diff options
| author | David Bremner <david@tethera.net> | 2021-08-29 12:23:30 -0700 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2021-09-11 10:19:27 -0300 |
| commit | 5e5f2122f91413e93761ca4a3d30b0b8b0d5e38e (patch) | |
| tree | 4364e0574098907a54fbf0e7b7acdb3d60e9f09a /emacs/notmuch-lib.el | |
| parent | a890241138ea468f8a275941b02da39b4e894c1e (diff) | |
emacs: wrap call-process-region
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.
Diffstat (limited to 'emacs/notmuch-lib.el')
| -rw-r--r-- | emacs/notmuch-lib.el | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 928286c3..207ea4c2 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -869,6 +869,14 @@ You may need to restart Emacs or upgrade your notmuch package.")) 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. @@ -885,7 +893,7 @@ for `call-process'. ARGS is as described for (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) |
