]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't quote lambdas in eshell/*.el
authorStefan Kangas <stefan@marxist.se>
Mon, 16 Nov 2020 13:43:55 +0000 (14:43 +0100)
committerStefan Kangas <stefan@marxist.se>
Mon, 16 Nov 2020 13:43:55 +0000 (14:43 +0100)
* lisp/eshell/em-basic.el (eshell-echo):
* lisp/eshell/em-cmpl.el (eshell-command-completion-function)
(eshell-default-completion-function, eshell-cmpl-initialize)
(eshell-complete-parse-arguments, eshell-complete-commands-list):
* lisp/eshell/em-dirs.el (eshell-complete-user-reference):
* lisp/eshell/em-hist.el (eshell-hist-unload-hook)
(eshell-hist-initialize):
* lisp/eshell/em-ls.el (eshell-ls-sort-entries):
* lisp/eshell/em-pred.el (eshell-modifier-alist)
(eshell-display-predicate-help, eshell-display-modifier-help)
(eshell-pred-substitute, eshell-split-members):
* lisp/eshell/em-prompt.el (eshell-prompt-function):
* lisp/eshell/em-smart.el (eshell-smart-unload-hook)
(eshell-smart-initialize, eshell-refresh-windows):
* lisp/eshell/em-unix.el (eshell-shuffle-files):
* lisp/eshell/esh-arg.el (eshell-parse-argument-hook):
* lisp/eshell/esh-cmd.el (eshell-cmd-initialize)
(eshell-parse-command):
* lisp/eshell/esh-mode.el (eshell-preinput-scroll-to-bottom)
(eshell-postoutput-scroll-to-bottom):
* lisp/eshell/esh-module.el (eshell-modules-list):
* lisp/eshell/esh-proc.el (eshell-read-process-name)
(eshell-round-robin-kill):
* lisp/eshell/esh-var.el (eshell-envvar-names)
(eshell-variables-list): Don't quote lambdas.

15 files changed:
lisp/eshell/em-basic.el
lisp/eshell/em-cmpl.el
lisp/eshell/em-dirs.el
lisp/eshell/em-hist.el
lisp/eshell/em-ls.el
lisp/eshell/em-pred.el
lisp/eshell/em-prompt.el
lisp/eshell/em-smart.el
lisp/eshell/em-unix.el
lisp/eshell/esh-arg.el
lisp/eshell/esh-cmd.el
lisp/eshell/esh-mode.el
lisp/eshell/esh-module.el
lisp/eshell/esh-proc.el
lisp/eshell/esh-var.el

index 6cfc89cce62d9096e96f4ee930a3b9df20b17f53..e54eab50fc9598a7b531e547d9d1a6e53489f0e0 100644 (file)
@@ -90,11 +90,10 @@ or `eshell-printn' for display."
             (car args))
            (t
             (mapcar
-             (function
-              (lambda (arg)
-                (if (stringp arg)
-                    (set-text-properties 0 (length arg) nil arg))
-                arg))
+              (lambda (arg)
+                (if (stringp arg)
+                    (set-text-properties 0 (length arg) nil arg))
+                arg)
              args)))))
       (if output-newline
          (cond
index 8a444c9100196b4038f6a937d95141fb692226a7..53a0cda354ec148e1736a041e2a6bc3cb91d35a3 100644 (file)
@@ -210,9 +210,8 @@ to writing a completion function."
   :group 'eshell-cmpl)
 
 (defcustom eshell-command-completion-function
-  (function
-   (lambda ()
-     (pcomplete-here (eshell-complete-commands-list))))
+  (lambda ()
+    (pcomplete-here (eshell-complete-commands-list)))
   (eshell-cmpl--custom-variable-docstring 'pcomplete-command-completion-function)
   :type (get 'pcomplete-command-completion-function 'custom-type)
   :group 'eshell-cmpl)
@@ -224,12 +223,11 @@ to writing a completion function."
   :group 'eshell-cmpl)
 
 (defcustom eshell-default-completion-function
-  (function
-   (lambda ()
-     (while (pcomplete-here
-            (pcomplete-dirs-or-entries
-             (cdr (assoc (funcall eshell-cmpl-command-name-function)
-                         eshell-command-completions-alist)))))))
+  (lambda ()
+    (while (pcomplete-here
+            (pcomplete-dirs-or-entries
+             (cdr (assoc (funcall eshell-cmpl-command-name-function)
+                         eshell-command-completions-alist))))))
   (eshell-cmpl--custom-variable-docstring 'pcomplete-default-completion-function)
   :type (get 'pcomplete-default-completion-function 'custom-type)
   :group 'eshell-cmpl)
@@ -308,10 +306,9 @@ to writing a completion function."
   ;; load-hooks for any other extension modules have been run, which
   ;; is true at the time `eshell-mode-hook' is run
   (add-hook 'eshell-mode-hook
-           (function
-            (lambda ()
-              (set (make-local-variable 'comint-file-name-quote-list)
-                   eshell-special-chars-outside-quoting)))
+            (lambda ()
+              (set (make-local-variable 'comint-file-name-quote-list)
+                   eshell-special-chars-outside-quoting))
             nil t)
   (add-hook 'pcomplete-quote-arg-hook #'eshell-quote-backslash nil t)
   (add-hook 'completion-at-point-functions
@@ -391,19 +388,18 @@ to writing a completion function."
       (nconc args (list ""))
       (nconc posns (list (point))))
     (cons (mapcar
-          (function
-           (lambda (arg)
-             (let ((val
-                    (if (listp arg)
-                        (let ((result
-                               (eshell-do-eval
-                                (list 'eshell-commands arg) t)))
-                          (cl-assert (eq (car result) 'quote))
-                          (cadr result))
-                      arg)))
-               (if (numberp val)
-                   (setq val (number-to-string val)))
-               (or val ""))))
+           (lambda (arg)
+             (let ((val
+                    (if (listp arg)
+                        (let ((result
+                               (eshell-do-eval
+                                (list 'eshell-commands arg) t)))
+                          (cl-assert (eq (car result) 'quote))
+                          (cadr result))
+                      arg)))
+               (if (numberp val)
+                   (setq val (number-to-string val)))
+               (or val "")))
           args)
          posns)))
 
@@ -454,9 +450,8 @@ to writing a completion function."
                              (eshell-alias-completions filename))
                         (eshell-winnow-list
                          (mapcar
-                          (function
-                           (lambda (name)
-                             (substring name 7)))
+                           (lambda (name)
+                             (substring name 7))
                           (all-completions (concat "eshell/" filename)
                                            obarray #'functionp))
                          nil '(eshell-find-alias-function))
index 51df6fa1d52cb51c96c530eecc1423d0a405364e..b4ed3794add1f207b7fabb285eaec1fcd1954aab 100644 (file)
@@ -289,9 +289,8 @@ Thus, this does not include the current directory.")
               (eshell-read-user-names)
               (pcomplete-uniquify-list
                (mapcar
-                (function
-                 (lambda (user)
-                   (file-name-as-directory (cdr user))))
+                 (lambda (user)
+                   (file-name-as-directory (cdr user)))
                 eshell-user-names)))))))
 
 (defun eshell/pwd (&rest _args)
index bdc21c916c687a27f88b4b60457231d078f956b5..c27e4503767003758c3e63a3cb7b4f1a51284fdf 100644 (file)
@@ -79,9 +79,8 @@
 
 (defcustom eshell-hist-unload-hook
   (list
-   (function
-    (lambda ()
-      (remove-hook 'kill-emacs-hook 'eshell-save-some-history))))
+   (lambda ()
+     (remove-hook 'kill-emacs-hook 'eshell-save-some-history)))
   "A hook that gets run when `eshell-hist' is unloaded."
   :type 'hook)
 
@@ -250,16 +249,14 @@ Returns nil if INPUT is prepended by blank space, otherwise non-nil."
        (set (make-local-variable 'search-invisible) t)
        (set (make-local-variable 'search-exit-option) t)
        (add-hook 'isearch-mode-hook
-                 (function
-                  (lambda ()
-                    (if (>= (point) eshell-last-output-end)
-                        (setq overriding-terminal-local-map
-                              eshell-isearch-map))))
+                  (lambda ()
+                    (if (>= (point) eshell-last-output-end)
+                        (setq overriding-terminal-local-map
+                              eshell-isearch-map)))
                   nil t)
        (add-hook 'isearch-mode-end-hook
-                 (function
-                  (lambda ()
-                    (setq overriding-terminal-local-map nil)))
+                  (lambda ()
+                    (setq overriding-terminal-local-map nil))
                   nil t))
     (eshell-hist-mode))
 
index c1a022ee521d64ce766894ed683240e06810edca..e10be8e6232bd94b31fe796cb8982b7fb4418429 100644 (file)
@@ -631,38 +631,37 @@ In Eshell's implementation of ls, ENTRIES is always reversed."
   (if (eq sort-method 'unsorted)
       (nreverse entries)
     (sort entries
-         (function
-          (lambda (l r)
-            (let ((result
-                   (cond
-                    ((eq sort-method 'by-atime)
-                     (eshell-ls-compare-entries l r 4 'time-less-p))
-                    ((eq sort-method 'by-mtime)
-                     (eshell-ls-compare-entries l r 5 'time-less-p))
-                    ((eq sort-method 'by-ctime)
-                     (eshell-ls-compare-entries l r 6 'time-less-p))
-                    ((eq sort-method 'by-size)
-                     (eshell-ls-compare-entries l r 7 '<))
-                    ((eq sort-method 'by-extension)
-                     (let ((lx (file-name-extension
-                                (directory-file-name (car l))))
-                           (rx (file-name-extension
-                                (directory-file-name (car r)))))
-                       (cond
-                        ((or (and (not lx) (not rx))
-                             (equal lx rx))
-                         (string-lessp (directory-file-name (car l))
-                                       (directory-file-name (car r))))
-                        ((not lx) t)
-                        ((not rx) nil)
-                        (t
-                         (string-lessp lx rx)))))
-                    (t
-                     (string-lessp (directory-file-name (car l))
-                                   (directory-file-name (car r)))))))
-              (if reverse-list
-                  (not result)
-                result)))))))
+          (lambda (l r)
+            (let ((result
+                   (cond
+                    ((eq sort-method 'by-atime)
+                     (eshell-ls-compare-entries l r 4 'time-less-p))
+                    ((eq sort-method 'by-mtime)
+                     (eshell-ls-compare-entries l r 5 'time-less-p))
+                    ((eq sort-method 'by-ctime)
+                     (eshell-ls-compare-entries l r 6 'time-less-p))
+                    ((eq sort-method 'by-size)
+                     (eshell-ls-compare-entries l r 7 '<))
+                    ((eq sort-method 'by-extension)
+                     (let ((lx (file-name-extension
+                                (directory-file-name (car l))))
+                           (rx (file-name-extension
+                                (directory-file-name (car r)))))
+                       (cond
+                        ((or (and (not lx) (not rx))
+                             (equal lx rx))
+                         (string-lessp (directory-file-name (car l))
+                                       (directory-file-name (car r))))
+                        ((not lx) t)
+                        ((not rx) nil)
+                        (t
+                         (string-lessp lx rx)))))
+                    (t
+                     (string-lessp (directory-file-name (car l))
+                                   (directory-file-name (car r)))))))
+              (if reverse-list
+                  (not result)
+                result))))))
 
 (defun eshell-ls-files (files &optional size-width copy-fileinfo)
   "Output a list of FILES.
@@ -799,9 +798,8 @@ to use, and each member of which is the width of that column
         (width 0)
         (widths
          (mapcar
-          (function
-           (lambda (file)
-             (+ 2 (length (car file)))))
+           (lambda (file)
+             (+ 2 (length (car file))))
           files))
         ;; must account for the added space...
         (max-width (+ (window-width) 2))
@@ -846,9 +844,8 @@ to use, and each member of which is the width of that column
         (width 0)
         (widths
          (mapcar
-          (function
-           (lambda (file)
-             (+ 2 (length (car file)))))
+           (lambda (file)
+             (+ 2 (length (car file))))
           files))
         (max-width (+ (window-width) 2))
         col-widths
index 59139da10dbc25140d7fc61a0109fb4e684321a8..7b9503917c45a52f414146eb508e4364047b365a 100644 (file)
@@ -116,10 +116,9 @@ The format of each entry is
 (defcustom eshell-modifier-alist
   '((?E . #'(lambda (lst)
               (mapcar
-               (function
-                (lambda (str)
-                  (eshell-stringify
-                   (car (eshell-parse-argument str)))))
+               (lambda (str)
+                 (eshell-stringify
+                  (car (eshell-parse-argument str))))
                lst)))
     (?L . #'(lambda (lst) (mapcar 'downcase lst)))
     (?U . #'(lambda (lst) (mapcar 'upcase lst)))
@@ -240,16 +239,14 @@ EXAMPLES:
 (defun eshell-display-predicate-help ()
   (interactive)
   (with-electric-help
-   (function
-    (lambda ()
-      (insert eshell-predicate-help-string)))))
+   (lambda ()
+     (insert eshell-predicate-help-string))))
 
 (defun eshell-display-modifier-help ()
   (interactive)
   (with-electric-help
-   (function
-    (lambda ()
-      (insert eshell-modifier-help-string)))))
+   (lambda ()
+     (insert eshell-modifier-help-string))))
 
 (define-minor-mode eshell-pred-mode
   "Minor mode for the eshell-pred module.
@@ -544,20 +541,20 @@ that `ls -l' will show in the first column of its display."
     (if repeat
        `(lambda (lst)
           (mapcar
-           (function
-            (lambda (str)
-              (let ((i 0))
-                (while (setq i (string-match ,match str i))
-                  (setq str (replace-match ,replace t nil str))))
-              str)) lst))
+            (lambda (str)
+              (let ((i 0))
+                (while (setq i (string-match ,match str i))
+                  (setq str (replace-match ,replace t nil str))))
+              str)
+            lst))
       `(lambda (lst)
         (mapcar
-         (function
-          (lambda (str)
-            (if (string-match ,match str)
-                (setq str (replace-match ,replace t nil str))
-              (error (concat str ": substitution failed")))
-            str)) lst)))))
+          (lambda (str)
+            (if (string-match ,match str)
+                (setq str (replace-match ,replace t nil str))
+              (error (concat str ": substitution failed")))
+            str)
+          lst)))))
 
 (defun eshell-include-members (&optional invert-p)
   "Include only lisp members matching a regexp."
@@ -598,9 +595,8 @@ that `ls -l' will show in the first column of its display."
       (goto-char (1+ end)))
     `(lambda (lst)
        (mapcar
-       (function
-        (lambda (str)
-          (split-string str ,sep))) lst))))
+        (lambda (str)
+          (split-string str ,sep)) lst))))
 
 (provide 'em-pred)
 
index 9ae5ae1281686196ecd1b2581826e40260c4c86c..dcee1e7a9819b64ccc12200d9cb96f605a18f78e 100644 (file)
@@ -48,10 +48,9 @@ as is common with most shells."
 (autoload 'eshell/pwd "em-dirs")
 
 (defcustom eshell-prompt-function
-  (function
-   (lambda ()
-     (concat (abbreviate-file-name (eshell/pwd))
-            (if (= (user-uid) 0) " # " " $ "))))
+  (lambda ()
+    (concat (abbreviate-file-name (eshell/pwd))
+            (if (= (user-uid) 0) " # " " $ ")))
   "A function that returns the Eshell prompt string.
 Make sure to update `eshell-prompt-regexp' so that it will match your
 prompt."
index f173c8db9c1f5e2ab63f6f1880196355a0e2be15..a28bb1d641502fc1ff14cbbd1b47a8f62bdfa30c 100644 (file)
@@ -94,10 +94,9 @@ it to get a real sense of how it works."
 
 (defcustom eshell-smart-unload-hook
   (list
-   (function
-    (lambda ()
-      (remove-hook 'window-configuration-change-hook
-                  'eshell-refresh-windows))))
+   (lambda ()
+     (remove-hook 'window-configuration-change-hook
+                  'eshell-refresh-windows)))
   "A hook that gets run when `eshell-smart' is unloaded."
   :type 'hook
   :group 'eshell-smart)
@@ -186,9 +185,8 @@ The options are `begin', `after' or `end'."
 
     (make-local-variable 'eshell-smart-command-done)
     (add-hook 'eshell-post-command-hook
-             (function
-              (lambda ()
-                (setq eshell-smart-command-done t)))
+              (lambda ()
+                (setq eshell-smart-command-done t))
               t t)
 
     (unless (eq eshell-review-quick-commands t)
@@ -208,13 +206,12 @@ The options are `begin', `after' or `end'."
   "Refresh all visible Eshell buffers."
   (let (affected)
     (walk-windows
-     (function
-      (lambda (wind)
-       (with-current-buffer (window-buffer wind)
-         (if eshell-mode
-             (let (window-scroll-functions) ;;FIXME: Why?
-               (eshell-smart-scroll-window wind (window-start))
-               (setq affected t))))))
+     (lambda (wind)
+       (with-current-buffer (window-buffer wind)
+         (if eshell-mode
+             (let (window-scroll-functions) ;;FIXME: Why?
+               (eshell-smart-scroll-window wind (window-start))
+               (setq affected t)))))
      0 frame)
     (if affected
        (let (window-scroll-functions) ;;FIXME: Why?
index 937b8bfa391d6afd4ccdd7d1a58b37139644abad..18818648bc40b8f09d7ab2da5c2094f3a55b15e1 100644 (file)
@@ -419,9 +419,8 @@ Remove the DIRECTORY(ies), if they are empty.")
                  (apply 'eshell-shuffle-files
                         command action
                         (mapcar
-                         (function
-                          (lambda (file)
-                            (concat source "/" file)))
+                          (lambda (file)
+                            (concat source "/" file))
                          (directory-files source))
                         target func t args)
                  (when (eq func 'rename-file)
index e7b07b4208d075959d318a813b30e29c464454d1..aefda647689aac10fb975c480c74d69c35f12518 100644 (file)
@@ -85,51 +85,48 @@ If POS is nil, the location of point is checked."
    'eshell-parse-special-reference
 
    ;; numbers convert to numbers if they stand alone
-   (function
-    (lambda ()
-      (when (and (not eshell-current-argument)
-                (not eshell-current-quoted)
-                (looking-at eshell-number-regexp)
-                (eshell-arg-delimiter (match-end 0)))
-       (goto-char (match-end 0))
-       (let ((str (match-string 0)))
-         (if (> (length str) 0)
-             (add-text-properties 0 (length str) '(number t) str))
-         str))))
+   (lambda ()
+     (when (and (not eshell-current-argument)
+                (not eshell-current-quoted)
+                (looking-at eshell-number-regexp)
+                (eshell-arg-delimiter (match-end 0)))
+       (goto-char (match-end 0))
+       (let ((str (match-string 0)))
+         (if (> (length str) 0)
+             (add-text-properties 0 (length str) '(number t) str))
+         str)))
 
    ;; parse any non-special characters, based on the current context
-   (function
-    (lambda ()
-      (unless eshell-inside-quote-regexp
-       (setq eshell-inside-quote-regexp
-             (format "[^%s]+"
-                     (apply 'string eshell-special-chars-inside-quoting))))
-      (unless eshell-outside-quote-regexp
-       (setq eshell-outside-quote-regexp
-             (format "[^%s]+"
-                     (apply 'string eshell-special-chars-outside-quoting))))
-      (when (looking-at (if eshell-current-quoted
-                           eshell-inside-quote-regexp
-                         eshell-outside-quote-regexp))
-       (goto-char (match-end 0))
-       (let ((str (match-string 0)))
-         (if str
-             (set-text-properties 0 (length str) nil str))
-         str))))
+   (lambda ()
+     (unless eshell-inside-quote-regexp
+       (setq eshell-inside-quote-regexp
+             (format "[^%s]+"
+                     (apply 'string eshell-special-chars-inside-quoting))))
+     (unless eshell-outside-quote-regexp
+       (setq eshell-outside-quote-regexp
+             (format "[^%s]+"
+                     (apply 'string eshell-special-chars-outside-quoting))))
+     (when (looking-at (if eshell-current-quoted
+                           eshell-inside-quote-regexp
+                         eshell-outside-quote-regexp))
+       (goto-char (match-end 0))
+       (let ((str (match-string 0)))
+         (if str
+             (set-text-properties 0 (length str) nil str))
+         str)))
 
    ;; whitespace or a comment is an argument delimiter
-   (function
-    (lambda ()
-      (let (comment-p)
-       (when (or (looking-at "[ \t]+")
-                 (and (not eshell-current-argument)
-                      (looking-at "#\\([^<'].*\\|$\\)")
-                      (setq comment-p t)))
-         (if comment-p
-             (add-text-properties (match-beginning 0) (match-end 0)
-                                  '(comment t)))
-         (goto-char (match-end 0))
-         (eshell-finish-arg)))))
+   (lambda ()
+     (let (comment-p)
+       (when (or (looking-at "[ \t]+")
+                 (and (not eshell-current-argument)
+                      (looking-at "#\\([^<'].*\\|$\\)")
+                      (setq comment-p t)))
+         (if comment-p
+             (add-text-properties (match-beginning 0) (match-end 0)
+                                  '(comment t)))
+         (goto-char (match-end 0))
+         (eshell-finish-arg))))
 
    ;; parse backslash and the character after
    'eshell-parse-backslash
index e0348ba501351eef186fc16eba5f23a9b1d9ed39..f1cf93368998ff93cd4bdf040ae75a5cc7431ee7 100644 (file)
@@ -304,10 +304,9 @@ otherwise t.")
   ;; situation can occur, for example, if a Lisp function results in
   ;; `debug' being called, and the user then types \\[top-level]
   (add-hook 'eshell-post-command-hook
-           (function
-            (lambda ()
-              (setq eshell-current-command nil
-                    eshell-last-async-proc nil)))
+            (lambda ()
+              (setq eshell-current-command nil
+                    eshell-last-async-proc nil))
             nil t)
 
   (add-hook 'eshell-parse-argument-hook
@@ -355,18 +354,17 @@ hooks should be run before and after the command."
           args))
         (commands
          (mapcar
-          (function
-           (lambda (cmd)
-              (setq cmd
-                    (if (or (not (car eshell--sep-terms))
-                            (string= (car eshell--sep-terms) ";"))
-                       (eshell-parse-pipeline cmd)
-                     `(eshell-do-subjob
-                        (list ,(eshell-parse-pipeline cmd)))))
-             (setq eshell--sep-terms (cdr eshell--sep-terms))
-             (if eshell-in-pipeline-p
-                 cmd
-               `(eshell-trap-errors ,cmd))))
+           (lambda (cmd)
+             (setq cmd
+                   (if (or (not (car eshell--sep-terms))
+                           (string= (car eshell--sep-terms) ";"))
+                       (eshell-parse-pipeline cmd)
+                     `(eshell-do-subjob
+                       (list ,(eshell-parse-pipeline cmd)))))
+             (setq eshell--sep-terms (cdr eshell--sep-terms))
+             (if eshell-in-pipeline-p
+                 cmd
+               `(eshell-trap-errors ,cmd)))
           (eshell-separate-commands terms "[&;]" nil 'eshell--sep-terms))))
     (let ((cmd commands))
       (while cmd
index e0e86348bd8af723225f5710252bb0e9377e1262..a80c2fc60d95312d9b65b66365c5c579ed806771 100644 (file)
@@ -742,13 +742,12 @@ This function should be a pre-command hook."
            (if (eq scroll 'this)
                (goto-char (point-max))
              (walk-windows
-              (function
-               (lambda (window)
-                 (when (and (eq (window-buffer window) current)
-                            (or (eq scroll t) (eq scroll 'all)))
-                   (select-window window)
-                   (goto-char (point-max))
-                   (select-window selected))))
+               (lambda (window)
+                 (when (and (eq (window-buffer window) current)
+                            (or (eq scroll t) (eq scroll 'all)))
+                   (select-window window)
+                   (goto-char (point-max))
+                   (select-window selected)))
               nil t))))))
 
 ;;; jww (1999-10-23): this needs testing
@@ -764,29 +763,28 @@ This function should be in the list `eshell-output-filter-functions'."
         (scroll eshell-scroll-to-bottom-on-output))
     (unwind-protect
        (walk-windows
-        (function
-         (lambda (window)
-           (if (eq (window-buffer window) current)
-               (progn
-                 (select-window window)
-                 (if (and (< (point) eshell-last-output-end)
-                          (or (eq scroll t) (eq scroll 'all)
-                              ;; Maybe user wants point to jump to end.
-                              (and (eq scroll 'this)
-                                   (eq selected window))
-                              (and (eq scroll 'others)
-                                   (not (eq selected window)))
-                              ;; If point was at the end, keep it at end.
-                              (>= (point) eshell-last-output-start)))
-                     (goto-char eshell-last-output-end))
-                 ;; Optionally scroll so that the text
-                 ;; ends at the bottom of the window.
-                 (if (and eshell-scroll-show-maximum-output
-                          (>= (point) eshell-last-output-end))
-                     (save-excursion
-                       (goto-char (point-max))
-                       (recenter -1)))
-                 (select-window selected)))))
+         (lambda (window)
+           (if (eq (window-buffer window) current)
+               (progn
+                 (select-window window)
+                 (if (and (< (point) eshell-last-output-end)
+                          (or (eq scroll t) (eq scroll 'all)
+                              ;; Maybe user wants point to jump to end.
+                              (and (eq scroll 'this)
+                                   (eq selected window))
+                              (and (eq scroll 'others)
+                                   (not (eq selected window)))
+                              ;; If point was at the end, keep it at end.
+                              (>= (point) eshell-last-output-start)))
+                     (goto-char eshell-last-output-end))
+                 ;; Optionally scroll so that the text
+                 ;; ends at the bottom of the window.
+                 (if (and eshell-scroll-show-maximum-output
+                          (>= (point) eshell-last-output-end))
+                     (save-excursion
+                       (goto-char (point-max))
+                       (recenter -1)))
+                 (select-window selected))))
         nil t)
       (set-buffer current))))
 
index 45c4c9e13c0fae8f5aa496a976fa0223da8a08f4..10994ba30108e8fde58167cb1c5af65d9f7f76c8 100644 (file)
@@ -65,16 +65,15 @@ Changes will only take effect in future Eshell buffers."
   :type (append
         (list 'set ':tag "Supported modules")
         (mapcar
-         (function
-          (lambda (modname)
-            (let ((modsym (intern modname)))
-              (list 'const
-                    ':tag (format "%s -- %s" modname
-                                  (get modsym 'custom-tag))
-                    ':link (caar (get modsym 'custom-links))
-                    ':doc (concat "\n" (get modsym 'group-documentation)
-                                  "\n ")
-                    modsym))))
+          (lambda (modname)
+            (let ((modsym (intern modname)))
+              (list 'const
+                    ':tag (format "%s -- %s" modname
+                                  (get modsym 'custom-tag))
+                    ':link (caar (get modsym 'custom-links))
+                    ':doc (concat "\n" (get modsym 'group-documentation)
+                                  "\n ")
+                    modsym)))
          (sort (mapcar 'symbol-name
                        (eshell-subgroups 'eshell-module))
                'string-lessp))
index db1b258c8f582336ecb8902f2aae7b69d0058418..4a1001bf0585f322ad302c8ce47018345ec2c96a 100644 (file)
@@ -215,9 +215,8 @@ and signal names."
 The prompt will be set to PROMPT."
   (completing-read prompt
                   (mapcar
-                   (function
-                    (lambda (proc)
-                      (cons (process-name proc) t)))
+                    (lambda (proc)
+                      (cons (process-name proc) t))
                    (process-list))
                    nil t))
 
@@ -499,9 +498,8 @@ See the variable `eshell-kill-processes-on-exit'."
   (let ((sigs eshell-kill-process-signals))
     (while sigs
       (eshell-process-interact
-       (function
-       (lambda (proc)
-         (signal-process (process-id proc) (car sigs)))) t query)
+       (lambda (proc)
+         (signal-process (process-id proc) (car sigs))) t query)
       (setq query nil)
       (if (not eshell-process-list)
          (setq sigs nil)
index 7388279f15789cdf2b6a76ae1cad6115b7814d5b..f91fb89412e27777bf7ac4a16615829f7832f4ff 100644 (file)
@@ -382,9 +382,8 @@ This function is explicit for adding to `eshell-parse-argument-hook'."
 
 (defun eshell-envvar-names (&optional environment)
   "Return a list of currently visible environment variable names."
-  (mapcar (function
-          (lambda (x)
-            (substring x 0 (string-match "=" x))))
+  (mapcar (lambda (x)
+            (substring x 0 (string-match "=" x)))
          (or environment process-environment)))
 
 (defun eshell-environment-variables ()
@@ -618,14 +617,13 @@ For example, to retrieve the second element of a user's record in
     (sort
      (append
       (mapcar
-       (function
-       (lambda (varname)
-         (let ((value (eshell-get-variable varname)))
-           (if (and value
-                    (stringp value)
-                    (file-directory-p value))
-               (concat varname "/")
-             varname))))
+       (lambda (varname)
+         (let ((value (eshell-get-variable varname)))
+           (if (and value
+                    (stringp value)
+                    (file-directory-p value))
+               (concat varname "/")
+             varname)))
        (eshell-envvar-names (eshell-environment-variables)))
       (all-completions argname obarray 'boundp)
       completions)