diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2021-11-15 07:16:49 +0100 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2021-11-15 07:38:21 +0100 |
commit | 6aeaf12551bc63c92cd85cd936c40b2f6a99e944 (patch) | |
tree | 9b6dbe987ab14d2c6ceedee964c8e8ab62da017b | |
parent | a7c9695835a15bb5510a5938d9a664982170be5f (diff) | |
download | emacs-6aeaf12551bc63c92cd85cd936c40b2f6a99e944.tar.gz emacs-6aeaf12551bc63c92cd85cd936c40b2f6a99e944.tar.bz2 emacs-6aeaf12551bc63c92cd85cd936c40b2f6a99e944.zip |
Allow mm-external-terminal-program to be a list of strings
* doc/misc/emacs-mime.texi (Display Customization): Document it.
* lisp/gnus/mm-decode.el (mm-external-terminal-program): Allow
being a list.
-rw-r--r-- | doc/misc/emacs-mime.texi | 3 | ||||
-rw-r--r-- | lisp/gnus/mm-decode.el | 23 |
2 files changed, 17 insertions, 9 deletions
diff --git a/doc/misc/emacs-mime.texi b/doc/misc/emacs-mime.texi index 7cd3e5f5828..96a4ad556f6 100644 --- a/doc/misc/emacs-mime.texi +++ b/doc/misc/emacs-mime.texi @@ -454,7 +454,8 @@ setting this option to non-@code{nil}. The default value is @code{t}. @item mm-external-terminal-program @vindex mm-external-terminal-program -The program used to start an external terminal. +This should be a list of strings; typically something like +@samp{("xterm" "-e")} or @samp{("gnome-terminal" "--")}. @item mm-enable-external @vindex mm-enable-external diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index aca4bf2062d..d781407cdcd 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -446,10 +446,11 @@ If not set, `default-directory' will be used." :type 'integer :group 'mime-display) -(defcustom mm-external-terminal-program "xterm" - "The program to start an external terminal." - :version "22.1" - :type 'string +(defcustom mm-external-terminal-program '("xterm" "-e") + "The program to start an external terminal. +This should be a list of strings." + :version "29.1" + :type '(choice string (repeat string)) :group 'mime-display) ;;; Internal variables. @@ -957,10 +958,16 @@ external if displayed external." (unwind-protect (if window-system (set-process-sentinel - (start-process "*display*" nil - mm-external-terminal-program - "-e" shell-file-name - shell-command-switch command) + (apply #'start-process "*display*" nil + (append + (if (listp mm-external-terminal-program) + mm-external-terminal-program + ;; Be backwards-compatible. + (list mm-external-terminal-program + "-e")) + (list shell-file-name + shell-command-switch + command))) (lambda (process _state) (if (eq 'exit (process-status process)) (run-at-time |