Abstract popwin defuns
This commit is contained in:
parent
0cd60e5ae8
commit
5193970d8f
13 changed files with 39 additions and 110 deletions
|
@ -92,9 +92,8 @@ Inspired from http://demonastery.org/2013/04/emacs-evil-narrow-region/"
|
|||
(when window-system
|
||||
(mac-start-animation (get-buffer-window) :type 'fade-out :duration 0.3))
|
||||
(kill-this-buffer))))
|
||||
(if (and (eq (current-buffer) popwin:popup-buffer)
|
||||
(popwin:popup-window-live-p))
|
||||
(popwin:close-popup-window)
|
||||
(if (narf/popup-p (current-buffer))
|
||||
(narf/popup-close)
|
||||
(unless (narf/real-buffer-p (current-buffer))
|
||||
(narf/previous-real-buffer))))
|
||||
|
||||
|
@ -227,7 +226,7 @@ left, create a scratch buffer."
|
|||
;; or scratch buffer by default
|
||||
(let* ((project-dir (narf/project-root t))
|
||||
(buffer-name "*scratch*"))
|
||||
(popwin:popup-buffer (get-buffer-create buffer-name))
|
||||
(narf/popup-open (get-buffer-create buffer-name))
|
||||
(when (eq (get-buffer buffer-name) (current-buffer))
|
||||
(when project-dir
|
||||
(cd project-dir))
|
||||
|
|
|
@ -17,14 +17,6 @@
|
|||
(setq mode-line-format nil)
|
||||
(setq header-line-format nil))
|
||||
|
||||
;;;###autoload
|
||||
(defun narf/helm-split-window (&optional window)
|
||||
"Minimalistic split-fn; leaves popwin to handle helm buffers."
|
||||
(if (one-window-p t)
|
||||
(let ((helm-full-frame t))
|
||||
(selected-window))
|
||||
(other-window-for-scrolling)))
|
||||
|
||||
;;;###autoload
|
||||
(defun narf/helm-get-org-candidates-in-file (filename min-depth max-depth &optional fontify nofname)
|
||||
(with-current-buffer (pcase filename
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
;;; defuns-popwin.el
|
||||
|
||||
;;;###autoload
|
||||
(defun narf/popwin-toggle ()
|
||||
(interactive)
|
||||
(if (popwin:popup-window-live-p)
|
||||
(popwin:close-popup-window)
|
||||
(popwin:popup-last-buffer)))
|
||||
|
||||
(provide 'defuns-popwin)
|
||||
;;; defuns-popwin.el ends here
|
|
@ -55,7 +55,7 @@ If ARG is nil this function calls `recompile', otherwise it calls
|
|||
(insert out)
|
||||
(goto-char (point-min))
|
||||
(read-only-mode 1)
|
||||
(popwin:popup-buffer buf :height (if (> lines 25) 25 (1+ lines))))))))
|
||||
(narf/popup-open buf))))))
|
||||
(t (quickrun-region beg end))))
|
||||
|
||||
;;;###autoload (autoload 'narf:eval-region-and-replace "defuns-quickrun" nil t)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue