diff options
| author | Steve Purcell <steve@sanityinc.com> | 2017-03-18 15:09:24 +1300 |
|---|---|---|
| committer | David Shepherd <davidshepherd7@gmail.com> | 2017-03-19 15:37:09 +0000 |
| commit | d6f491dda7e8f9a68f264ee150dc0e97155580f0 (patch) | |
| tree | a5e3fb656b2f6107a33576b9bf6fa170333cb858 | |
| parent | Tidy up the Commentary (diff) | |
| download | emacs-terminal-here-d6f491dda7e8f9a68f264ee150dc0e97155580f0.tar.gz | |
Simplify default terminal command and add missing defgroup
| -rw-r--r-- | terminal-here.el | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/terminal-here.el b/terminal-here.el index 12f3ebe..ee23e92 100644 --- a/terminal-here.el +++ b/terminal-here.el @@ -19,21 +19,26 @@ -(defun terminal-here--default-terminal-command () - "Pick a good default command to use." +(defgroup terminal-here nil + "Open external terminal emulators in the current buffer's directory." + :group 'external + :prefix "terminal-here-") + +(defun terminal-here-default-terminal-command (dir) + "Pick a good default command to use for DIR." (cond ((eq system-type 'darwin) - (lambda (dir) (list "open" "-a" "Terminal.app" dir))) + (list "open" "-a" "Terminal.app" dir)) - ((or (eq system-type 'windows-nt) (eq system-type 'ms-dos) (eq system-type 'cygwin)) - (lambda (dir) (list "start" "/D" dir "cmd"))) + ((memq system-type '(windows-nt ms-dos cygwin)) + (list "start" "/D" dir "cmd")) ;; Probably X11! (t '("x-terminal-emulator")))) (defcustom terminal-here-terminal-command - (terminal-here--default-terminal-command) + #'terminal-here-default-terminal-command "The command used to start a terminal. Either a list of strings: (terminal-binary arg1 arg2 ...); or a |
