tools/magit: remove +magit-display-popup-buffer

Because magit uses transient now, and other plugins that use magit-popup
don't seem to need it anymore.

And update docstring+comments.
This commit is contained in:
Henrik Lissner 2019-05-04 18:59:15 -04:00
parent 0b6d21649e
commit 051f792205
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 12 additions and 16 deletions

View file

@ -2,7 +2,8 @@
;;;###autoload ;;;###autoload
(defun +magit-display-buffer (buffer) (defun +magit-display-buffer (buffer)
"Like `magit-display-buffer-fullframe-status-v1' with two differences: "Marries `magit-display-buffer-fullcolumn-most-v1' with
`magit-display-buffer-same-window-except-diff-v1', except:
1. Magit sub-buffers that aren't spawned from a status screen are opened as 1. Magit sub-buffers that aren't spawned from a status screen are opened as
popups. popups.
@ -33,17 +34,6 @@
;; Last resort: use current window ;; Last resort: use current window
('(display-buffer-same-window)))))) ('(display-buffer-same-window))))))
;;;###autoload
(defun +magit-display-popup-buffer (buffer &optional alist)
"TODO"
(cond ((eq (window-dedicated-p) 'side)
(if (fboundp '+popup-display-buffer-stacked-side-window)
(+popup-display-buffer-stacked-side-window buffer alist)
(display-buffer-in-side-window buffer alist)))
((derived-mode-p 'magit-mode)
(display-buffer-below-selected buffer alist))
((display-buffer-in-side-window buffer alist))))
;; ;;
;; Commands ;; Commands

View file

@ -21,10 +21,16 @@ It is passed a user and repository name.")
magit-revision-show-gravatars '("^Author: " . "^Commit: ") magit-revision-show-gravatars '("^Author: " . "^Commit: ")
magit-diff-refine-hunk t) ; show granular diffs in selected hunk magit-diff-refine-hunk t) ; show granular diffs in selected hunk
;; Leave it to `+magit-display-buffer' and `+magit-display-popup-buffer' to ;; Magit uses `magit-display-buffer-traditional' to display windows, by
;; manage popup windows. ;; default, which is a little primitive. `+magit-display-buffer' marries
(setq magit-display-buffer-function #'+magit-display-buffer ;; `magit-display-buffer-fullcolumn-most-v1' with
magit-popup-display-buffer-action '((+magit-display-popup-buffer))) ;; `magit-display-buffer-same-window-except-diff-v1', except:
;;
;; 1. Magit sub-buffers (like `magit-log') that aren't spawned from a status
;; screen are opened as popups.
;; 2. The status screen isn't buried when viewing diffs or logs from the
;; status screen.
(setq magit-display-buffer-function #'+magit-display-buffer)
(set-popup-rule! "^\\(?:\\*magit\\|magit:\\)" :ignore t) (set-popup-rule! "^\\(?:\\*magit\\|magit:\\)" :ignore t)
;; so magit buffers can be switched to (except for process buffers) ;; so magit buffers can be switched to (except for process buffers)