]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow mm-external-terminal-program to be a list of strings
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 15 Nov 2021 06:16:49 +0000 (07:16 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 15 Nov 2021 06:38:21 +0000 (07:38 +0100)
* doc/misc/emacs-mime.texi (Display Customization): Document it.

* lisp/gnus/mm-decode.el (mm-external-terminal-program): Allow
being a list.

doc/misc/emacs-mime.texi
lisp/gnus/mm-decode.el

index 7cd3e5f58288180139f72ad9f53f6421baeb0bff..96a4ad556f675de5fadffd88bbce756502a5abd6 100644 (file)
@@ -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
index aca4bf2062d96e3f0135dde1e5c563e0a1fa0741..d781407cdcd2e188fb5a8fa96cadf867f5fe3c4c 100644 (file)
@@ -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