]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: wrap make-process
authorDavid Bremner <david@tethera.net>
Sun, 29 Aug 2021 19:23:32 +0000 (12:23 -0700)
committerDavid Bremner <david@tethera.net>
Sat, 11 Sep 2021 13:27:38 +0000 (10:27 -0300)
Provide a safe working directory.

emacs/notmuch-crypto.el
emacs/notmuch-lib.el
test/T310-emacs.sh

index de4d9aea520bd1d25367b1f0bad5a49630db3814..3ffb56540550beb90fecbfa9f71dbca75cc0c0a5 100644 (file)
@@ -224,7 +224,7 @@ corresponding key when the status button is pressed."
          (with-current-buffer buffer
            (goto-char (point-max))
            (insert (format "--- Retrieving key %s:\n" keyid)))
-         (let ((p (make-process
+         (let ((p (notmuch--make-process
                    :name "notmuch GPG key retrieval"
                    :connection-type 'pipe
                    :buffer buffer
index 207ea4c21749ba295fc87d033f0ad1845b25f0e6..9693185f69dde5cfb7a8615f739e328d928d6603 100644 (file)
@@ -869,6 +869,11 @@ You may need to restart Emacs or upgrade your notmuch package."))
 default"
   (notmuch--apply-with-env #'process-lines program args))
 
+(defun notmuch--make-process (&rest args)
+  "Wrap make-process, binding DEFAULT-DIRECTORY to a safe
+default"
+  (notmuch--apply-with-env #'make-process args))
+
 (defun notmuch--call-process-region (start end program
                                           &optional delete buffer display
                                           &rest args)
@@ -950,7 +955,7 @@ status."
   (let* ((command (or (executable-find notmuch-command)
                      (error "Command not found: %s" notmuch-command)))
         (err-buffer (generate-new-buffer " *notmuch-stderr*"))
-        (proc (make-process
+        (proc (notmuch--make-process
                :name name
                :buffer buffer
                :command (cons command args)
index 21b73e5a8f8ef321a312608766b75e2b65316262..1b6660f0a3598b6ec482c563ff02960b469284e1 100755 (executable)
@@ -1169,7 +1169,6 @@ EOF
 test_expect_equal_file EXPECTED OUTPUT
 
 test_begin_subtest "notmuch-search with nonexistent CWD"
-test_subtest_known_broken
 test_emacs '(test-log-error
              (let ((default-directory "/nonexistent"))
                (notmuch-search "*")))'