X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=emacs%2Fnotmuch-show.el;h=b8782ddb632e5397e84d6a2f9e63d853cd9aa8d9;hp=88752f1719306271fc4e276568dae0a904fd4701;hb=ec13bd12e3335d0ceb878d403d11004bbe330c8e;hpb=ed720f4e6d18c80381e0e84ff3b5571474c92512 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 88752f17..b8782ddb 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -1781,10 +1781,14 @@ message." (setq shell-command (concat notmuch-command " show --format=raw " (shell-quote-argument (notmuch-show-get-message-id)) " | " command))) - (let ((buf (get-buffer-create (concat "*notmuch-pipe*")))) + (let ((cwd default-directory) + (buf (get-buffer-create (concat "*notmuch-pipe*")))) (with-current-buffer buf (setq buffer-read-only nil) (erase-buffer) + ;; Use the originating buffer's working directory instead of + ;; that of the pipe buffer. + (cd cwd) (let ((exit-code (call-process-shell-command shell-command nil buf))) (goto-char (point-max)) (set-buffer-modified-p nil)