summaryrefslogtreecommitdiff
path: root/lisp/eshell/em-term.el
diff options
context:
space:
mode:
authorAidan Gauland <aidalgol@no8wireless.co.nz>2013-06-09 18:39:40 +1200
committerAidan Gauland <aidalgol@no8wireless.co.nz>2013-06-09 18:39:40 +1200
commit88b00caa0aa5dea65256a82008281566efa0622b (patch)
treed390b28f718733e54fec6fe2feabc6c118c4a4a7 /lisp/eshell/em-term.el
parent5bf97bfc6730fa2a4ca187cadbb689d79178eafc (diff)
downloademacs-88b00caa0aa5dea65256a82008281566efa0622b.tar.gz
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.
Diffstat (limited to 'lisp/eshell/em-term.el')
-rw-r--r--lisp/eshell/em-term.el22
1 files changed, 13 insertions, 9 deletions
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."
"Initialize the `term' interface code."
(make-local-variable 'eshell-interpreter-alist)
(setq eshell-interpreter-alist
- (cons (cons (function
- (lambda (command args)
- (let ((command (file-name-nondirectory command)))
- (or (member command eshell-visual-commands)
- (member (car args)
- (cdr (assoc command eshell-visual-subcommands)))
- (cl-intersection args
- (cdr (assoc command eshell-visual-options))
- :test 'string=)))))
+ (cons (cons #'eshell-visual-command-p
'eshell-exec-visual)
eshell-interpreter-alist)))
+(defun eshell-visual-command-p (command args)
+ "Returns non-nil when given a visual command.
+If either COMMAND or a subcommand in ARGS (e.g. git log) is a
+visual command, returns non-nil."
+ (let ((command (file-name-nondirectory command)))
+ (or (member command eshell-visual-commands)
+ (member (car args)
+ (cdr (assoc command eshell-visual-subcommands)))
+ (cl-intersection args
+ (cdr (assoc command eshell-visual-options))
+ :test 'string=))))
+
(defun eshell-exec-visual (&rest args)
"Run the specified PROGRAM in a terminal emulation buffer.
ARGS are passed to the program. At the moment, no piping of input is