Skip to content

Commit

Permalink
Use pop-to-buffer in all embark-export functions
Browse files Browse the repository at this point in the history
Allows the user to set display rules in `display-buffer-alist`,
closes oantolin#216.
  • Loading branch information
iyefrat committed May 17, 2021
1 parent b2a9f84 commit a7aa68a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions embark-consult.el
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ The elements of LINES are assumed to be values of category `consult-line'."
(insert (concat lineno contents nl))))
(goto-char (point-min))
(occur-mode))
(switch-to-buffer buf)))
(pop-to-buffer buf)))

(setf (alist-get 'consult-location embark-collect-initial-view-alist)
'list)
Expand All @@ -169,7 +169,7 @@ The elements of LINES are assumed to be values of category `consult-line'."
(grep-mode)
(setq-local wgrep-header/footer-parser #'ignore)
(when (fboundp 'wgrep-setup) (wgrep-setup)))
(switch-to-buffer buf)))
(pop-to-buffer buf)))

(autoload 'compile-goto-error "compile")

Expand Down
14 changes: 8 additions & 6 deletions embark.el
Original file line number Diff line number Diff line change
Expand Up @@ -1776,11 +1776,13 @@ buffer for each type of completion."
(let ((file (file-name-nondirectory path)))
(or (string= file ".") (string= file ".."))))
files)))
(dired (cons
;; TODO: is it worth finding the deepest common containing directory?
(if (cl-every #'file-name-absolute-p files) "/" default-directory)
files))
(rename-buffer (format "*Embark Export Dired %s*" default-directory)))
(let ((buf (dired-noselect (cons
;; TODO: is it worth finding the deepest common containing directory?
(if (cl-every #'file-name-absolute-p files) "/" default-directory)
files))))
(with-current-buffer buf
(rename-buffer (format "*Embark Export Dired %s*" default-directory)))
(pop-to-buffer buf)))

(autoload 'package-menu-mode "package")
(autoload 'package-menu--generate "package")
Expand All @@ -1791,7 +1793,7 @@ buffer for each type of completion."
(with-current-buffer buf
(package-menu-mode)
(package-menu--generate nil (mapcar #'intern packages)))
(switch-to-buffer buf)))
(pop-to-buffer buf)))

(defvar bookmark-alist)

Expand Down

0 comments on commit a7aa68a

Please sign in to comment.