]> code.delx.au - gnu-emacs/blobdiff - lisp/eshell/em-dirs.el
Fix minor quoting problems in doc strings
[gnu-emacs] / lisp / eshell / em-dirs.el
index 992b5bdd77e85801a96e0a26cdb9b61fb1b01615..8a3b5817d5f8373fa8cc7088158bdd5005562501 100644 (file)
@@ -1,6 +1,6 @@
-;;; em-dirs.el --- directory navigation commands
+;;; em-dirs.el --- directory navigation commands  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-201 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2015 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
 (require 'esh-opt)
 
 ;;;###autoload
-(eshell-defgroup eshell-dirs nil
+(progn
+(defgroup eshell-dirs nil
   "Directory navigation involves changing directories, examining the
 current directory, maintaining a directory stack, and also keeping
 track of a history of the last directory locations the user was in.
 Emacs does provide standard Lisp definitions of `pwd' and `cd', but
 they lack somewhat in feel from the typical shell equivalents."
   :tag "Directory navigation"
-  :group 'eshell-module)
+  :group 'eshell-module))
 
 ;;; User Variables:
 
@@ -206,7 +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 'eshell-lone-directory-p
+         (cons (cons #'(lambda (file args)
+                          (eshell-lone-directory-p file))
                      'eshell-dirs-substitute-cd)
                eshell-interpreter-alist)))
 
@@ -298,7 +300,7 @@ Thus, this does not include the current directory.")
                 eshell-user-names)))))))
 
 (defun eshell/pwd (&rest args)
-  "Change output from `pwd` to be cleaner."
+  "Change output from ‘pwd’ to be cleaner."
   (let* ((path default-directory)
         (len (length path)))
     (if (and (> len 1)
@@ -346,8 +348,6 @@ in the minibuffer:
                  index (1+ index)))))
     oldpath))
 
-(defvar dired-directory)
-
 (defun eshell/cd (&rest args)           ; all but first ignored
   "Alias to extend the behavior of `cd'."
   (setq args (eshell-flatten-list args))
@@ -392,11 +392,11 @@ in the minibuffer:
      (path
       (setq path (eshell-expand-multiple-dots path))))
     (unless handled
-      (setq dired-directory (or path "~"))
-      (let ((curdir (eshell/pwd)))
-       (unless (equal curdir dired-directory)
+      (let ((curdir (eshell/pwd))
+           (newdir (or path "~")))
+       (unless (equal curdir newdir)
          (eshell-add-to-dir-ring curdir))
-       (let ((result (cd dired-directory)))
+       (let ((result (cd newdir)))
          (and eshell-cd-shows-directory
               (eshell-printn result)))
        (run-hooks 'eshell-directory-change-hook)