• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/emacs-93/emacs/lisp/eshell/

Lines Matching +defs:file +defs:name +defs:directory

1 ;;; em-dirs.el --- directory navigation commands
8 ;; This file is part of GNU Emacs.
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
32 current directory, maintaining a directory stack, and also keeping
33 track of a history of the last directory locations the user was in.
54 ;; cd =bcc ; change to the last directory visited containing "bcc"
71 'expand-file-name
75 last-visited directory in the last-dir-ring, so it will affect the
77 :type '(radio (function-item file-truename)
78 (function-item expand-file-name)
96 (defcustom eshell-cd-shows-directory nil
97 "*If non-nil, using `cd' will report the directory it changes to."
101 (defcustom eshell-cd-on-directory t
102 "*If non-nil, do a cd if a directory is in command position."
106 (defcustom eshell-directory-change-hook nil
107 "*A hook to run when the current directory changes."
114 achieved by adding a function to `eshell-directory-change-hook' that
138 "*If non-nil, show the directory stack following directory change.
139 This is effective only if directory tracking is enabled."
143 (defcustom eshell-last-dir-ring-file-name
144 (concat eshell-directory-name "lastdir")
145 "*If non-nil, name of the file to read/write the last-dir-ring.
148 :type 'file
152 "*If non-nil, the size of the directory history ring.
154 stores the most recent directory locations Eshell has been in. To
157 than `eshell-last-dir-ring-size'. To return to the last directory
159 directory history list, use 'cd ='.
167 a previously visited directory without having to type in the whole
181 Thus, this does not include the current directory.")
184 "The last directory that eshell was in.")
197 (expand-file-name
199 (expand-file-name
203 (expand-file-name (eshell/pwd))) t)
206 (expand-file-name
209 (when eshell-cd-on-directory
212 (cons (cons 'eshell-lone-directory-p
229 (if eshell-last-dir-ring-file-name
248 (buffer-name buf)))))
251 (defun eshell-lone-directory-p (file)
252 "Test whether FILE is just a directory name, and not a command name."
253 (and (file-directory-p file)
254 (or (file-name-directory file)
255 (not (eshell-search-path file)))))
258 "Substitute the given command for a call to `cd' on that name."
268 (add-to-list 'eshell-current-modifiers 'expand-file-name)
279 (path (eshell-find-previous-directory regexp)))
295 (file-name-as-directory (cdr user))))
300 (let* ((path default-directory)
318 (defadvice expand-file-name
320 (filename &optional directory) activate)
333 (defun eshell-find-previous-directory (regexp)
348 (defvar dired-directory))
375 (let ((oldpath (eshell-find-previous-directory
394 (setq dired-directory (or path "~"))
396 (unless (equal curdir dired-directory)
398 (let ((result (cd dired-directory)))
399 (and eshell-cd-shows-directory
401 (run-hooks 'eshell-directory-change-hook)
437 (error "pushd: No other directory"))))
507 (home (expand-file-name "~/"))
514 (setq msg (concat msg (directory-file-name dir) " "))
519 "Sets the buffer's `eshell-last-dir-ring' from a history file."
520 (let ((file eshell-last-dir-ring-file-name))
522 ((or (null file)
523 (equal file "")
524 (not (file-readable-p file)))
531 (insert-file-contents file)
532 ;; Save restriction in case file is already visited...
540 ;; directory
547 "Writes the buffer's `eshell-last-dir-ring' to a history file."
548 (let ((file eshell-last-dir-ring-file-name))
550 ((or (null file)
551 (equal file "")
555 ((not (file-writable-p file))
556 (message "Cannot write last-dir-ring file %s" file))
565 (eshell-with-private-file-modes
566 (write-region (point-min) (point-max) file nil