X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=emacs%2Fnotmuch-lib.el;fp=emacs%2Fnotmuch-lib.el;h=928286c3292cbaf5a16715217a3f18c1819c7d9d;hp=c7bb2091f8edcc457ed2f36569ce9bf744c90253;hb=a890241138ea468f8a275941b02da39b4e894c1e;hpb=06477bce03d09353e92cea7a59134b5ac3facae3 diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index c7bb2091..928286c3 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -860,6 +860,15 @@ You may need to restart Emacs or upgrade your notmuch package.")) ;; `notmuch-logged-error' does not return. )))) +(defmacro notmuch--apply-with-env (func &rest args) + `(let ((default-directory "~")) + (apply ,func ,@args))) + +(defun notmuch--process-lines (program &rest args) + "Wrap process-lines, binding DEFAULT-DIRECTORY to a safe +default" + (notmuch--apply-with-env #'process-lines program args)) + (defun notmuch-call-notmuch--helper (destination args) "Helper for synchronous notmuch invocation commands.