diff options
author | Stéphane Boucher <Stephane.Boucher@acceo.com> | 2020-03-04 02:05:55 +0200 |
---|---|---|
committer | Juri Linkov <juri@linkov.net> | 2020-03-04 02:05:55 +0200 |
commit | 21ebfa1dd8129420c832031d055c708075aec02c (patch) | |
tree | baef325f007b3f76d8cb8704e5fc90155c365abc /lisp/replace.el | |
parent | b48142ba190c5b490685af961af1f0f4fd5440ae (diff) | |
download | emacs-21ebfa1dd8129420c832031d055c708075aec02c.tar.gz emacs-21ebfa1dd8129420c832031d055c708075aec02c.tar.bz2 emacs-21ebfa1dd8129420c832031d055c708075aec02c.zip |
Update default-directory in occur buffer (bug#39608)
* lisp/replace.el (occur-1): Update default-directory in occur buffer.
Copyright-paperwork-exempt: yes
Diffstat (limited to 'lisp/replace.el')
-rw-r--r-- | lisp/replace.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/replace.el b/lisp/replace.el index a0b050637e1..168ccf2f72a 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -1576,7 +1576,8 @@ See also `multi-occur'." (and (overlayp boo) (overlay-buffer boo))) boo)) - bufs)))) + bufs))) + (source-buffer-default-directory default-directory)) ;; Handle the case where one of the buffers we're searching is the ;; output buffer. Just rename it. (when (member buf-name @@ -1593,6 +1594,9 @@ See also `multi-occur'." (setq occur-buf (get-buffer-create buf-name)) (with-current-buffer occur-buf + ;; Make the default-directory of the *Occur* buffer match that of + ;; the buffer where the occurences come from + (setq default-directory source-buffer-default-directory) (if (stringp nlines) (fundamental-mode) ;; This is for collect operation. (occur-mode)) |