]> git.eshelyaron.com Git - emacs.git/commitdiff
Tidy module initialisation functions
authorAidan Gauland <aidalgol@no8wireless.co.nz>
Sun, 9 Jun 2013 06:39:40 +0000 (18:39 +1200)
committerAidan Gauland <aidalgol@no8wireless.co.nz>
Sun, 9 Jun 2013 06:39:40 +0000 (18:39 +1200)
* 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.

lisp/ChangeLog
lisp/eshell/em-dirs.el
lisp/eshell/em-script.el
lisp/eshell/em-term.el

index 18ea431a7dfe932674b927da12adffa92523b85a..31746dd8de2702785d40bfd78b4dcf242f7d36fe 100644 (file)
@@ -1,3 +1,10 @@
+2013-06-09  Aidan Gauland  <aidalgol@amuri.net>
+
+       * 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  <sdl.web@gmail.com>
 
        * progmodes/octave.el (octave-add-log-current-defun): New function.
index 106ca152c906c27e5d90a2b54259bfef4fd1dfd9..e8fbe0518ac92c8896d3565a7ee1cdc8d5897d4c 100644 (file)
@@ -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)))
 
index 13ae6941dde67acce44cf69b4fbb6489f213aeac..b073928738ffc1faab0b301b4df7e1ac590e023a 100644 (file)
@@ -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
index f30aad305e49a2ad32ee46e177b70c4c324bd390..1ed584df8825d2f74b367a60ec0d5f3a124fcbbd 100644 (file)
@@ -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