?
Current Path : /usr/share/emacs/24.3/lisp/eshell/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : //usr/share/emacs/24.3/lisp/eshell/em-dirs.elc |
;ELC ;;; Compiled by mockbuild@buildfarm06-new.corp.cloudlinux.com on Fri Oct 11 10:10:50 2024 ;;; from file /builddir/build/BUILD/emacs-24.3/lisp/eshell/em-dirs.el ;;; in Emacs version 24.3.1 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\300\302!\210\300\303!\210\304\305\306\307\310\311\312\313&\210\314\315\306\316\317\320\321\322\312\305& \210\314\323\324\325\321\326\312\305&\210\314\327\330\331\321\332\312\305&\210\314\333\306\334\321\335\312\305&\210\314\336\337\340\321\335\312\305&\210\314\341\306\342\321\322\312\305&\210\314\343\306\344\321\335\312\305&\210\314\345\306\346\321\335\312\305&\210\314\347\306\350\321\335\312\305&\210\314\351\306\352\321\335\312\305&\210\314\353\337\354\321\335\312\305&\210\314\355\356\357\321\360\312\305&\210\314\361\362\363\321\364\312\305&\210\314\365\337\366\321\335\312\305&\207" [require eshell ring esh-opt custom-declare-group eshell-dirs nil "Directory navigation involves changing directories, examining the\ncurrent directory, maintaining a directory stack, and also keeping\ntrack of a history of the last directory locations the user was in.\nEmacs does provide standard Lisp definitions of `pwd' and `cd', but\nthey lack somewhat in feel from the typical shell equivalents." :tag "Directory navigation" :group eshell-module custom-declare-variable eshell-dirs-load-hook "A hook that gets run when `eshell-dirs' is loaded." :version "24.1" :type hook eshell-pwd-convert-function (if (eshell-under-windows-p) 'expand-file-name 'identity) "The function used to normalize the value of Eshell's `pwd'.\nThe value returned by `pwd' is also used when recording the\nlast-visited directory in the last-dir-ring, so it will affect the\nform of the list used by 'cd ='." (radio (function-item file-truename) (function-item expand-file-name) (function-item identity) (function :tag "Other")) eshell-ask-to-save-last-dir 'always "Determine if the last-dir-ring should be automatically saved.\nThe last-dir-ring is always preserved when exiting an Eshell buffer.\nHowever, when Emacs is being shut down, this variable determines\nwhether to prompt the user, or just save the ring.\nIf set to nil, it means never ask whether to save the last-dir-ring.\nIf set to t, always ask if any Eshell buffers are open at exit time.\nIf set to `always', the list-dir-ring will always be saved, silently." (choice (const :tag "Never" nil) (const :tag "Ask" t) (const :tag "Always save" always)) eshell-cd-shows-directory "If non-nil, using `cd' will report the directory it changes to." boolean eshell-cd-on-directory t "If non-nil, do a cd if a directory is in command position." eshell-directory-change-hook "A hook to run when the current directory changes." eshell-list-files-after-cd "If non-nil, call \"ls\" with any remaining args after doing a cd.\nThis is provided for convenience, since the same effect is easily\nachieved by adding a function to `eshell-directory-change-hook' that\ncalls \"ls\" and references `eshell-last-arguments'." eshell-pushd-tohome "If non-nil, make pushd with no arg behave as 'pushd ~' (like `cd').\nThis mirrors the optional behavior of tcsh." eshell-pushd-dextract "If non-nil, make \"pushd +n\" pop the nth dir to the stack top.\nThis mirrors the optional behavior of tcsh." eshell-pushd-dunique "If non-nil, make pushd only add unique directories to the stack.\nThis mirrors the optional behavior of tcsh." eshell-dirtrack-verbose "If non-nil, show the directory stack following directory change.\nThis is effective only if directory tracking is enabled." 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.\nSee also `eshell-read-last-dir-ring' and `eshell-write-last-dir-ring'.\nIf it is nil, the last-dir-ring will not be written to disk." file eshell-last-dir-ring-size 32 "If non-nil, the size of the directory history ring.\nThis ring is added to every time `cd' or `pushd' is used. It simply\nstores the most recent directory locations Eshell has been in. To\nreturn to the most recent entry, use 'cd -' (equivalent to 'cd -0').\nTo return to an older entry, use 'cd -N', where N is an integer less\nthan `eshell-last-dir-ring-size'. To return to the last directory\nmatching a particular regexp, use 'cd =REGEXP'. To display the\ndirectory history list, use 'cd ='.\n\nThis mechanism is very similar to that provided by `pushd', except\nit's far more automatic. `pushd' allows the user to decide which\ndirectories gets pushed, and its size is unlimited.\n\n`eshell-last-dir-ring' is meant for users who don't use `pushd'\nexplicitly very much, but every once in a while would like to return to\na previously visited directory without having to type in the whole\nthing again." integer eshell-last-dir-unique "If non-nil, `eshell-last-dir-ring' contains only unique entries."] 10) #@109 List of directories saved by pushd in the Eshell buffer. Thus, this does not include the current directory. (defvar eshell-dirstack nil (#$ . 5221)) #@40 The last directory that Eshell was in. (defvar eshell-last-dir-ring nil (#$ . 5376)) #@46 Initialize the builtin functions for Eshell. (defalias 'eshell-dirs-initialize #[nil "\306\300!\210\307\310\" \203 \306\302!\210\311\312B\nB\313\314\315\316\317$\210\320>\203+ \313\314\321\316\317$\210\322\211 >)\203; \313\323\324\316\317$\210\306\325!\210\306\326!\210\203K \327 \210\204V \330!\313\331\332\316\317$\210\313\333\334\"\207" [eshell-variable-aliases-list eshell-cd-on-directory eshell-interpreter-alist system-type module eshell-modules-list make-local-variable append (("-" (lambda (indices) (if (not indices) (unless (ring-empty-p eshell-last-dir-ring) (expand-file-name (ring-ref eshell-last-dir-ring 0))) (expand-file-name (eshell-apply-indices eshell-last-dir-ring indices))))) ("+" "PWD") ("PWD" (lambda (indices) (expand-file-name (eshell/pwd))) t) ("OLDPWD" (lambda (indices) (unless (ring-empty-p eshell-last-dir-ring) (expand-file-name (ring-ref eshell-last-dir-ring 0)))) t)) eshell-lone-directory-p eshell-dirs-substitute-cd add-hook eshell-parse-argument-hook eshell-parse-user-reference nil t (ms-dos windows-nt) eshell-parse-drive-letter eshell-cmpl pcomplete-try-first-hook eshell-complete-user-reference eshell-dirstack eshell-last-dir-ring eshell-read-last-dir-ring make-ring eshell-exit-hook eshell-write-last-dir-ring kill-emacs-hook eshell-save-some-last-dir eshell-last-dir-ring-file-name eshell-last-dir-ring-size] 6 (#$ . 5467)]) #@53 Save the list-dir-ring for any open Eshell buffers. (defalias 'eshell-save-some-last-dir #[nil "\304 \305\211\205; @\306!\2033 rq\210\n\2032 \2032 \307=\204/ \310\311\312\313!\"!\2032 \314 \210) A\211\204 \305*\207" [buf --dolist-tail-- eshell-mode eshell-ask-to-save-last-dir buffer-list nil buffer-live-p always y-or-n-p format "Save last dir ring for Eshell buffer `%s'? " buffer-name eshell-write-last-dir-ring] 6 (#$ . 6856)]) #@69 Test whether FILE is just a directory name, and not a command name. (defalias 'eshell-lone-directory-p #[(file) "\301!\205 \302!\206 \303!?\207" [file file-directory-p file-name-directory eshell-search-path] 2 (#$ . 7305)]) #@63 Substitute the given command for a call to `cd' on that name. (defalias 'eshell-dirs-substitute-cd #[(&rest args) "G\301V\203 \302\303@\"\207\304\305\306\307\310!\"\"\207" [args 1 error "%s: command not found" throw eshell-replace-command eshell-parse-command "cd" eshell-flatten-list] 6 (#$ . 7540)]) #@60 An argument beginning with ~ is a filename to be expanded. (defalias 'eshell-parse-user-reference #[nil "?\205 \301f\302=\205 \303\304\305\"\210\301u\210\306`Sf!\207" [eshell-current-argument nil 126 add-to-list eshell-current-modifiers expand-file-name char-to-string] 3 (#$ . 7852)]) #@64 An argument beginning with X:[^/] is a drive letter reference. (defalias 'eshell-parse-drive-letter #[nil "?\205# \304\305!\205# \306\225b\210\307\306!\310 P\311\n!\211\206 \312P+\207" [eshell-current-argument letter regexp path looking-at "\\([A-Za-z]:\\)\\([^/\\\\]\\|\\'\\)" 1 match-string "\\`" eshell-find-previous-directory "/"] 3 (#$ . 8147)]) #@44 If there is a user reference, complete it. (defalias 'eshell-complete-user-reference #[nil "\304 \305\306\"\205 \307\310O\311\312\313\314 \210\315\316\317\"!\")\207" [arg pcomplete-stub pcomplete-last-completion-raw eshell-user-names pcomplete-actual-arg string-match "\\`~[a-z]*\\'" 1 nil t throw pcomplete-completions eshell-read-user-names pcomplete-uniqify-list mapcar #[(user) "\301A!\207" [user file-name-as-directory] 2]] 6 (#$ . 8510)]) #@41 Change output from `pwd` to be cleaner. (defalias 'eshell/pwd #[(&rest args) "\211G\211\305V\203( \nSH\306=\203( \307>\203! \310\311 \"\204( \312 GSO\f\2032 \f !\2023 *\207" [default-directory path len system-type eshell-pwd-convert-function 1 47 (ms-dos windows-nt) string-match "\\`[A-Za-z]:[\\\\/]\\'" 0] 4 (#$ . 8969)]) #@386 Convert '...' to '../..', '....' to '../../..', etc.. With the following piece of advice, you can make this functionality available in most of Emacs, with the exception of filename completion in the minibuffer: (defadvice expand-file-name (before translate-multiple-dots (filename &optional directory) activate) (setq filename (eshell-expand-multiple-dots filename))) (defalias 'eshell-expand-multiple-dots #[(path) "\304\305\"\203. \306\307\"\211G\310\n\311V\203\"