;; `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-process-region (start end program
+ &optional delete buffer display
+ &rest args)
+ "Wrap call-process-region, binding DEFAULT-DIRECTORY to a safe
+default"
+ (notmuch--apply-with-env
+ #'call-process-region start end program delete buffer display args))
+
(defun notmuch-call-notmuch--helper (destination args)
"Helper for synchronous notmuch invocation commands.
(if (null stdin-string)
(apply #'call-process notmuch-command nil destination nil args)
(insert stdin-string)
- (apply #'call-process-region (point-min) (point-max)
+ (apply #'notmuch--call-process-region (point-min) (point-max)
notmuch-command t destination nil args))))
(defun notmuch-call-notmuch-process (&rest args)