;; harvest if necessary.
(notmuch-address-harvest-trigger)))
(t
- (process-lines notmuch-address-command original))))
+ (notmuch--process-lines notmuch-address-command original))))
(defun notmuch-address-expand-name ()
(cond
(defun notmuch-draft-resume (id)
"Resume editing of message with id ID."
;; Used by command `notmuch-show-resume-message'.
- (let* ((tags (process-lines notmuch-command "search" "--output=tags"
+ (let* ((tags (notmuch--process-lines notmuch-command "search" "--output=tags"
"--exclude=false" id))
(draft (equal tags (notmuch-update-tags tags notmuch-draft-tags))))
(when (or draft
(widget-get widget :notmuch-search-oldest-first)))))
(defun notmuch-saved-search-count (search)
- (car (process-lines notmuch-command "count" search)))
+ (car (notmuch--process-lines notmuch-command "count" search)))
(defun notmuch-hello-tags-per-line (widest)
"Determine how many tags to show per line and how wide they
(list (cons tag
(concat "tag:"
(notmuch-escape-boolean-term tag))))))
- (process-lines notmuch-command "search" "--output=tags" "*")))
+ (notmuch--process-lines notmuch-command "search" "--output=tags" "*")))
(defun notmuch-hello-insert-header ()
"Insert the default notmuch-hello header."
:help-echo "Refresh"
(notmuch-hello-nice-number
(string-to-number
- (car (process-lines notmuch-command "count")))))
+ (car (notmuch--process-lines notmuch-command "count")))))
(widget-insert " messages.\n")))
(defun notmuch-hello-insert-saved-searches ()
;; `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.
(concat " and (" query-context ")"))))
(sort-arg (if oldest-first "--sort=oldest-first" "--sort=newest-first"))
(message-arg (if unthreaded "--unthreaded" "--entire-thread")))
- (when (equal (car (process-lines notmuch-command "count" search-args)) "0")
+ (when (equal (car (notmuch--process-lines notmuch-command "count" search-args)) "0")
(setq search-args basic-query))
(notmuch-tag-clear-cache)
(let ((proc (notmuch-start-notmuch
PROMPT is the string to prompt with."
(let* ((all-tags
(mapcar (lambda (tag) (notmuch-escape-boolean-term tag))
- (process-lines notmuch-command "search" "--output=tags" "*")))
+ (notmuch--process-lines notmuch-command "search" "--output=tags" "*")))
(completions
(append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"
"subject:" "attachment:")