As with notmuch--process-lines, initial purpose is to provide a safe
binding for default-directory. This is enough to make notmuch-hello
robust against non-existent or corrupt values default-directory, but
probably not other views.
(or (plist-get options :filter-count)
(plist-get options :filter))))
"\n")))
(or (plist-get options :filter-count)
(plist-get options :filter))))
"\n")))
- (unless (= (call-process-region (point-min) (point-max) notmuch-command
+ (unless (= (notmuch--call-process-region (point-min) (point-max) notmuch-command
t t nil "count" "--batch") 0)
(notmuch-logged-error
"notmuch count --batch failed"
t t nil "count" "--batch") 0)
(notmuch-logged-error
"notmuch count --batch failed"
default"
(notmuch--apply-with-env #'process-lines program args))
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.
(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)
(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)
notmuch-command t destination nil args))))
(defun notmuch-call-notmuch-process (&rest args)
"Pass the contents of the current buffer to 'muttprint'.
Optional OUTPUT allows passing a list of flags to muttprint."
"Pass the contents of the current buffer to 'muttprint'.
Optional OUTPUT allows passing a list of flags to muttprint."
- (apply #'call-process-region (point-min) (point-max)
+ (apply #'notmuch--call-process-region (point-min) (point-max)
;; Reads from stdin.
"muttprint"
nil nil nil
;; Reads from stdin.
"muttprint"
nil nil nil
test_expect_equal_file $EXPECTED/notmuch-hello-long-names OUTPUT
test_begin_subtest "notmuch-hello with nonexistent CWD"
test_expect_equal_file $EXPECTED/notmuch-hello-long-names OUTPUT
test_begin_subtest "notmuch-hello with nonexistent CWD"
-test_subtest_known_broken
test_emacs '
(notmuch-hello)
(test-log-error
test_emacs '
(notmuch-hello)
(test-log-error