diff options
| author | Oleg Pykhalov <go.wigust@gmail.com> | 2018-02-15 20:08:51 +0300 |
|---|---|---|
| committer | Oleg Pykhalov <go.wigust@gmail.com> | 2018-02-15 20:08:51 +0300 |
| commit | 1d51858513f51738a2126034e864b3034f5b5c34 (patch) | |
| tree | 80e8808fdef5419abc8d89d9ab0aaa28d0c9d48f | |
| parent | Add launch terminal with multiplexer functions. (diff) | |
| parent | Find executable for a terminal (diff) | |
| download | emacs-terminal-here-1d51858513f51738a2126034e864b3034f5b5c34.tar.gz | |
Merge branch 'wip-find-terminal' into devel
| -rw-r--r-- | terminal-here.el | 10 | ||||
| -rw-r--r-- | test/terminal-here-test.el | 9 |
2 files changed, 15 insertions, 4 deletions
diff --git a/terminal-here.el b/terminal-here.el index d83b4fb..236734d 100644 --- a/terminal-here.el +++ b/terminal-here.el @@ -30,6 +30,13 @@ :group 'external :prefix "terminal-here-") +(defcustom terminal-here-terminal-emulators + '("x-terminal-emulator" "sl" "urxvt" "gnome-terminal" + "xfce4-terminal" "konsole" "xterm") + "List of terminal emulators." + :group 'terminal-here + :type 'list) + (defun terminal-here-find-executable (variants) (file-name-nondirectory (cl-some (lambda (executable) @@ -47,8 +54,7 @@ (list "cmd.exe" "/C" "start" "cmd.exe")) ;; Probably X11! - (t '("x-terminal-emulator")))) - + (t (list (terminal-here-find-executable terminal-here-terminal-emulators))))) (defcustom terminal-here-terminal-command #'terminal-here-default-terminal-command diff --git a/test/terminal-here-test.el b/test/terminal-here-test.el index 849f18d..62fc571 100644 --- a/test/terminal-here-test.el +++ b/test/terminal-here-test.el @@ -16,7 +16,11 @@ (ert-deftest linux-default-command () (with-terminal-here-mocks - (mock (start-process "x-terminal-emulator" * "x-terminal-emulator")) + (mock + (start-process (terminal-here-find-executable + terminal-here-terminal-emulators) + * (terminal-here-find-executable + terminal-here-terminal-emulators))) (let ((system-type 'gnu/linux)) (custom-reevaluate-setting 'terminal-here-terminal-command) (terminal-here-launch-in-directory "adir")))) @@ -106,6 +110,7 @@ (setq launch-command command)))) (validate-setq terminal-here-command-flag "-k") (terminal-here-launch-in-directory "/ssh:david@pi:/home/pi/") - (should (equal (car launch-command) "x-terminal-emulator")) + (should (equal (car launch-command) (terminal-here-find-executable + terminal-here-terminal-emulators))) (should (equal (cadr launch-command) "-k")) (should (equal (caddr launch-command) "ssh")))) |
