X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/42c3a9e31dd7cf6ea27ccbe41f0129cbb5d3a840..ab422c4d6899b1442cb6954c1829c1fb656b006c:/lisp/eshell/em-dirs.el diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el index cc95d81021..c93bbe9ecb 100644 --- a/lisp/eshell/em-dirs.el +++ b/lisp/eshell/em-dirs.el @@ -1,7 +1,6 @@ ;;; em-dirs.el --- directory navigation commands -;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, -;; 2008, 2009 Free Software Foundation, Inc. +;; Copyright (C) 1999-2013 Free Software Foundation, Inc. ;; Author: John Wiegley @@ -48,26 +47,28 @@ (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: -(defcustom eshell-dirs-load-hook '(eshell-dirs-initialize) - "*A hook that gets run when `eshell-dirs' is loaded." +(defcustom eshell-dirs-load-hook nil + "A hook that gets run when `eshell-dirs' is loaded." + :version "24.1" ; removed eshell-dirs-initialize :type 'hook :group 'eshell-dirs) (defcustom eshell-pwd-convert-function (if (eshell-under-windows-p) 'expand-file-name 'identity) - "*The function used to normalize the value of Eshell's `pwd'. + "The function used to normalize the value of Eshell's `pwd'. The value returned by `pwd' is also used when recording the last-visited directory in the last-dir-ring, so it will affect the form of the list used by 'cd ='." @@ -78,7 +79,7 @@ form of the list used by 'cd ='." :group 'eshell-dirs) (defcustom eshell-ask-to-save-last-dir 'always - "*Determine if the last-dir-ring should be automatically saved. + "Determine if the last-dir-ring should be automatically saved. The last-dir-ring is always preserved when exiting an Eshell buffer. However, when Emacs is being shut down, this variable determines whether to prompt the user, or just save the ring. @@ -91,22 +92,22 @@ If set to `always', the list-dir-ring will always be saved, silently." :group 'eshell-dirs) (defcustom eshell-cd-shows-directory nil - "*If non-nil, using `cd' will report the directory it changes to." + "If non-nil, using `cd' will report the directory it changes to." :type 'boolean :group 'eshell-dirs) (defcustom eshell-cd-on-directory t - "*If non-nil, do a cd if a directory is in command position." + "If non-nil, do a cd if a directory is in command position." :type 'boolean :group 'eshell-dirs) (defcustom eshell-directory-change-hook nil - "*A hook to run when the current directory changes." + "A hook to run when the current directory changes." :type 'hook :group 'eshell-dirs) (defcustom eshell-list-files-after-cd nil - "*If non-nil, call \"ls\" with any remaining args after doing a cd. + "If non-nil, call \"ls\" with any remaining args after doing a cd. This is provided for convenience, since the same effect is easily achieved by adding a function to `eshell-directory-change-hook' that calls \"ls\" and references `eshell-last-arguments'." @@ -114,39 +115,39 @@ calls \"ls\" and references `eshell-last-arguments'." :group 'eshell-dirs) (defcustom eshell-pushd-tohome nil - "*If non-nil, make pushd with no arg behave as 'pushd ~' (like `cd'). + "If non-nil, make pushd with no arg behave as 'pushd ~' (like `cd'). This mirrors the optional behavior of tcsh." :type 'boolean :group 'eshell-dirs) (defcustom eshell-pushd-dextract nil - "*If non-nil, make \"pushd +n\" pop the nth dir to the stack top. + "If non-nil, make \"pushd +n\" pop the nth dir to the stack top. This mirrors the optional behavior of tcsh." :type 'boolean :group 'eshell-dirs) (defcustom eshell-pushd-dunique nil - "*If non-nil, make pushd only add unique directories to the stack. + "If non-nil, make pushd only add unique directories to the stack. This mirrors the optional behavior of tcsh." :type 'boolean :group 'eshell-dirs) (defcustom eshell-dirtrack-verbose t - "*If non-nil, show the directory stack following directory change. + "If non-nil, show the directory stack following directory change. This is effective only if directory tracking is enabled." :type 'boolean :group 'eshell-dirs) (defcustom eshell-last-dir-ring-file-name (expand-file-name "lastdir" eshell-directory-name) - "*If non-nil, name of the file to read/write the last-dir-ring. + "If non-nil, name of the file to read/write the last-dir-ring. See also `eshell-read-last-dir-ring' and `eshell-write-last-dir-ring'. If it is nil, the last-dir-ring will not be written to disk." :type 'file :group 'eshell-dirs) (defcustom eshell-last-dir-ring-size 32 - "*If non-nil, the size of the directory history ring. + "If non-nil, the size of the directory history ring. This ring is added to every time `cd' or `pushd' is used. It simply stores the most recent directory locations Eshell has been in. To return to the most recent entry, use 'cd -' (equivalent to 'cd -0'). @@ -160,14 +161,14 @@ it's far more automatic. `pushd' allows the user to decide which directories gets pushed, and its size is unlimited. `eshell-last-dir-ring' is meant for users who don't use `pushd' -explicity very much, but every once in a while would like to return to +explicitly very much, but every once in a while would like to return to a previously visited directory without having to type in the whole thing again." :type 'integer :group 'eshell-dirs) (defcustom eshell-last-dir-unique t - "*If non-nil, `eshell-last-dir-ring' contains only unique entries." + "If non-nil, `eshell-last-dir-ring' contains only unique entries." :type 'boolean :group 'eshell-dirs) @@ -178,7 +179,7 @@ thing again." Thus, this does not include the current directory.") (defvar eshell-last-dir-ring nil - "The last directory that eshell was in.") + "The last directory that Eshell was in.") ;;; Functions: @@ -234,7 +235,7 @@ Thus, this does not include the current directory.") (defun eshell-save-some-last-dir () "Save the list-dir-ring for any open Eshell buffers." - (eshell-for buf (buffer-list) + (dolist (buf (buffer-list)) (if (buffer-live-p buf) (with-current-buffer buf (if (and eshell-mode @@ -267,7 +268,7 @@ Thus, this does not include the current directory.") (char-to-string (char-before)))) (defun eshell-parse-drive-letter () - "An argument beginning X:[^/] is a drive letter reference." + "An argument beginning with X:[^/] is a drive letter reference." (when (and (not eshell-current-argument) (looking-at "\\([A-Za-z]:\\)\\([^/\\\\]\\|\\'\\)")) (goto-char (match-end 1)) @@ -401,8 +402,8 @@ in the minibuffer: (eshell-printn result))) (run-hooks 'eshell-directory-change-hook) (if eshell-list-files-after-cd - (throw 'eshell-replace-command - (eshell-parse-command "ls" (cdr args)))) + ;; Let-bind eshell-last-command around this? + (eshell-plain-command "ls" (cdr args))) nil)))) (put 'eshell/cd 'eshell-no-numeric-conversions t) @@ -517,7 +518,7 @@ in the minibuffer: msg))) (defun eshell-read-last-dir-ring () - "Sets the buffer's `eshell-last-dir-ring' from a history file." + "Set the buffer's `eshell-last-dir-ring' from a history file." (let ((file eshell-last-dir-ring-file-name)) (cond ((or (null file) @@ -545,7 +546,7 @@ in the minibuffer: (setq eshell-last-dir-ring ring)))))) (defun eshell-write-last-dir-ring () - "Writes the buffer's `eshell-last-dir-ring' to a history file." + "Write the buffer's `eshell-last-dir-ring' to a history file." (let ((file eshell-last-dir-ring-file-name)) (cond ((or (null file) @@ -573,5 +574,4 @@ in the minibuffer: ;; generated-autoload-file: "esh-groups.el" ;; End: -;; arch-tag: 1e9c5a95-f1bd-45f8-ad36-55aac706e787 ;;; em-dirs.el ends here