From: Aidan Gauland Date: Sun, 9 Jun 2013 06:39:40 +0000 (+1200) Subject: Tidy module initialisation functions X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~2026^2~31 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=88b00caa0aa5dea65256a82008281566efa0622b;p=emacs.git 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. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 18ea431a7df..31746dd8de2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2013-06-09 Aidan Gauland + + * 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. + 2013-06-08 Leo Liu * 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.") (when eshell-cd-on-directory (make-local-variable 'eshell-interpreter-alist) (setq eshell-interpreter-alist - (cons (cons (lambda (file args) - (eshell-lone-directory-p file)) + (cons (cons #'(lambda (file args) + (eshell-lone-directory-p file)) 'eshell-dirs-substitute-cd) eshell-interpreter-alist))) 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'." "Initialize the script parsing code." (make-local-variable 'eshell-interpreter-alist) (setq eshell-interpreter-alist - (cons '((lambda (file args) - (string= (file-name-nondirectory file) - "eshell")) . eshell/source) + (cons (cons #'(lambda (file args) + (string= (file-name-nondirectory file) + "eshell")) + 'eshell/source) eshell-interpreter-alist)) (make-local-variable 'eshell-complex-commands) (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." "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