]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch-lib.el
emacs: notmuch-start-notmuch: avoid storing process buffer twice
[notmuch] / emacs / notmuch-lib.el
index 06ca8cdcbc498391561c26f2730a16a1bea65674..be15af5e2ea9ffff04b2ca8f2e1dd43e0208f353 100644 (file)
@@ -906,12 +906,11 @@ status."
                :connection-type 'pipe
                :stderr err-buffer))
         (err-proc (get-buffer-process err-buffer)))
-    (process-put err-proc 'err-buffer err-buffer)
-    (set-process-sentinel err-proc #'notmuch-start-notmuch-error-sentinel)
     (process-put proc 'err-buffer err-buffer)
     (process-put proc 'sub-sentinel sentinel)
     (process-put proc 'real-command (cons notmuch-command args))
     (set-process-sentinel proc #'notmuch-start-notmuch-sentinel)
+    (set-process-sentinel err-proc #'notmuch-start-notmuch-error-sentinel)
     proc))
 
 (defun notmuch-start-notmuch-sentinel (proc event)
@@ -956,7 +955,7 @@ status."
        (message "%s" (error-message-string err))))))
 
 (defun notmuch-start-notmuch-error-sentinel (proc event)
-  (let ((buffer (process-get proc 'err-buffer)))
+  (let ((buffer (process-buffer proc)))
     (when (buffer-live-p buffer)
       (kill-buffer buffer))))