diff options
| author | Aidan Gauland | 2013-06-09 18:39:40 +1200 |
|---|---|---|
| committer | Aidan Gauland | 2013-06-09 18:39:40 +1200 |
| commit | 88b00caa0aa5dea65256a82008281566efa0622b (patch) | |
| tree | d390b28f718733e54fec6fe2feabc6c118c4a4a7 | |
| parent | 5bf97bfc6730fa2a4ca187cadbb689d79178eafc (diff) | |
| download | emacs-88b00caa0aa5dea65256a82008281566efa0622b.tar.gz emacs-88b00caa0aa5dea65256a82008281566efa0622b.zip | |
Tidy module initialisation functions
* eshell/em-term.el (eshell-visual-command-p): New function.
(eshell-term-initialize): Move long lambda to separate function eshell-visual-command-p.
* eshell/em-dirs.el (eshell-dirs-initialise): Add missing #' to lambda.
* eshell/em-script.el (eshell-script-initialize): Add missing #' to lambda.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/eshell/em-dirs.el | 4 | ||||
| -rw-r--r-- | lisp/eshell/em-script.el | 7 | ||||
| -rw-r--r-- | lisp/eshell/em-term.el | 22 |
4 files changed, 26 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 18ea431a7df..31746dd8de2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2013-06-09 Aidan Gauland <aidalgol@amuri.net> | ||
| 2 | |||
| 3 | * eshell/em-term.el (eshell-visual-command-p): New function. | ||
| 4 | (eshell-term-initialize): Move long lambda to separate function eshell-visual-command-p. | ||
| 5 | * eshell/em-dirs.el (eshell-dirs-initialise): Add missing #' to lambda. | ||
| 6 | * eshell/em-script.el (eshell-script-initialize): Add missing #' to lambda. | ||
| 7 | |||
| 1 | 2013-06-08 Leo Liu <sdl.web@gmail.com> | 8 | 2013-06-08 Leo Liu <sdl.web@gmail.com> |
| 2 | 9 | ||
| 3 | * progmodes/octave.el (octave-add-log-current-defun): New function. | 10 | * progmodes/octave.el (octave-add-log-current-defun): New function. |
diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el index 106ca152c90..e8fbe0518ac 100644 --- a/lisp/eshell/em-dirs.el +++ b/lisp/eshell/em-dirs.el | |||
| @@ -207,8 +207,8 @@ Thus, this does not include the current directory.") | |||
| 207 | (when eshell-cd-on-directory | 207 | (when eshell-cd-on-directory |
| 208 | (make-local-variable 'eshell-interpreter-alist) | 208 | (make-local-variable 'eshell-interpreter-alist) |
| 209 | (setq eshell-interpreter-alist | 209 | (setq eshell-interpreter-alist |
| 210 | (cons (cons (lambda (file args) | 210 | (cons (cons #'(lambda (file args) |
| 211 | (eshell-lone-directory-p file)) | 211 | (eshell-lone-directory-p file)) |
| 212 | 'eshell-dirs-substitute-cd) | 212 | 'eshell-dirs-substitute-cd) |
| 213 | eshell-interpreter-alist))) | 213 | eshell-interpreter-alist))) |
| 214 | 214 | ||
diff --git a/lisp/eshell/em-script.el b/lisp/eshell/em-script.el index 13ae6941dde..b073928738f 100644 --- a/lisp/eshell/em-script.el +++ b/lisp/eshell/em-script.el | |||
| @@ -61,9 +61,10 @@ This includes when running `eshell-command'." | |||
| 61 | "Initialize the script parsing code." | 61 | "Initialize the script parsing code." |
| 62 | (make-local-variable 'eshell-interpreter-alist) | 62 | (make-local-variable 'eshell-interpreter-alist) |
| 63 | (setq eshell-interpreter-alist | 63 | (setq eshell-interpreter-alist |
| 64 | (cons '((lambda (file args) | 64 | (cons (cons #'(lambda (file args) |
| 65 | (string= (file-name-nondirectory file) | 65 | (string= (file-name-nondirectory file) |
| 66 | "eshell")) . eshell/source) | 66 | "eshell")) |
| 67 | 'eshell/source) | ||
| 67 | eshell-interpreter-alist)) | 68 | eshell-interpreter-alist)) |
| 68 | (make-local-variable 'eshell-complex-commands) | 69 | (make-local-variable 'eshell-complex-commands) |
| 69 | (setq eshell-complex-commands | 70 | (setq eshell-complex-commands |
diff --git a/lisp/eshell/em-term.el b/lisp/eshell/em-term.el index f30aad305e4..1ed584df882 100644 --- a/lisp/eshell/em-term.el +++ b/lisp/eshell/em-term.el | |||
| @@ -132,18 +132,22 @@ character to the invoked process." | |||
| 132 | "Initialize the `term' interface code." | 132 | "Initialize the `term' interface code." |
| 133 | (make-local-variable 'eshell-interpreter-alist) | 133 | (make-local-variable 'eshell-interpreter-alist) |
| 134 | (setq eshell-interpreter-alist | 134 | (setq eshell-interpreter-alist |
| 135 | (cons (cons (function | 135 | (cons (cons #'eshell-visual-command-p |
| 136 | (lambda (command args) | ||
| 137 | (let ((command (file-name-nondirectory command))) | ||
| 138 | (or (member command eshell-visual-commands) | ||
| 139 | (member (car args) | ||
| 140 | (cdr (assoc command eshell-visual-subcommands))) | ||
| 141 | (cl-intersection args | ||
| 142 | (cdr (assoc command eshell-visual-options)) | ||
| 143 | :test 'string=))))) | ||
| 144 | 'eshell-exec-visual) | 136 | 'eshell-exec-visual) |
| 145 | eshell-interpreter-alist))) | 137 | eshell-interpreter-alist))) |
| 146 | 138 | ||
| 139 | (defun eshell-visual-command-p (command args) | ||
| 140 | "Returns non-nil when given a visual command. | ||
| 141 | If either COMMAND or a subcommand in ARGS (e.g. git log) is a | ||
| 142 | visual command, returns non-nil." | ||
| 143 | (let ((command (file-name-nondirectory command))) | ||
| 144 | (or (member command eshell-visual-commands) | ||
| 145 | (member (car args) | ||
| 146 | (cdr (assoc command eshell-visual-subcommands))) | ||
| 147 | (cl-intersection args | ||
| 148 | (cdr (assoc command eshell-visual-options)) | ||
| 149 | :test 'string=)))) | ||
| 150 | |||
| 147 | (defun eshell-exec-visual (&rest args) | 151 | (defun eshell-exec-visual (&rest args) |
| 148 | "Run the specified PROGRAM in a terminal emulation buffer. | 152 | "Run the specified PROGRAM in a terminal emulation buffer. |
| 149 | ARGS are passed to the program. At the moment, no piping of input is | 153 | ARGS are passed to the program. At the moment, no piping of input is |