;ELC ;;; Compiled by cyd@localhost on Mon Apr 23 22:20:38 2007 ;;; from file /home/cyd/emacs/lisp/dirtrack.el ;;; in Emacs version 22.0.99 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. (if (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19.29"))) (error "`dirtrack.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (custom-declare-group 'dirtrack nil "Directory tracking by watching the prompt." :prefix "dirtrack-" :group 'shell) #@271 List for directory tracking. First item is a regexp that describes where to find the path in a prompt. Second is a number, the regexp group to match. Optional third item is whether the prompt is multi-line. If nil or omitted, prompt is assumed to be on a single line. (custom-declare-variable 'dirtrack-list '(list "^emacs \\([a-zA-Z]:.*\\)>" 1) '(#$ . 680) :group 'dirtrack :type '(sexp (regexp :tag "Prompt Expression") (integer :tag "Regexp Group") (boolean :tag "Multiline Prompt"))) (make-variable-buffer-local 'dirtrack-list) #@65 If non-nil, the function `dirtrack' will report debugging info. (custom-declare-variable 'dirtrack-debug 'nil '(#$ . 1220) :group 'dirtrack :type 'boolean) #@55 Buffer to write directory tracking debug information. (custom-declare-variable 'dirtrack-debug-buffer '"*Directory Tracking Log*" '(#$ . 1382) :group 'dirtrack :type 'string) #@59 If non-nil, directory tracking via `dirtrack' is enabled. (custom-declare-variable 'dirtrackp 't '(#$ . 1563) :group 'dirtrack :type 'boolean) (make-variable-buffer-local 'dirtrackp) #@68 Function to apply to the prompt directory for comparison purposes. (custom-declare-variable 'dirtrack-directory-function '(if (memq system-type (list 'ms-dos 'windows-nt 'cygwin)) 'dirtrack-windows-directory-function 'file-name-as-directory) '(#$ . 1752) :group 'dirtrack :type 'function) #@69 Function to apply to the default directory for comparison purposes. (custom-declare-variable 'dirtrack-canonicalize-function '(if (memq system-type (list 'ms-dos 'windows-nt 'cygwin)) 'downcase 'identity) '(#$ . 2047) :group 'dirtrack :type 'function) #@54 Hook that is called when a directory change is made. (custom-declare-variable 'dirtrack-directory-change-hook 'nil '(#$ . 2305) :group 'dirtrack :type 'hook) #@156 Return a canonical directory for comparison purposes. Such a directory is all lowercase, has forward-slashes as delimiters, and ends with a forward slash. (defalias 'dirtrack-windows-directory-function #[(dir) "\301\302\303\304#\227!\207" [dir file-name-as-directory subst-char-in-string 92 47] 5 (#$ . 2470)]) #@80 Return a canonical directory taken from a Cygwin path for comparison purposes. (defalias 'dirtrack-cygwin-directory-function #[(dir) "\301\302\"\203\303\304\"\305\303\306\"Q\207\207" [dir string-match "/cygdrive/\\([A-Z]\\)\\(.*\\)" match-string 1 ":" 2] 5 (#$ . 2788)]) #@66 Enable or disable Dirtrack directory tracking in a shell buffer. (defalias 'dirtrack-toggle #[nil "?\211\203\301\302\303\304\305$\210\202\306\302\303\305#\210\307\310\203!\311\202\"\312\"\207" [dirtrackp add-hook comint-preoutput-filter-functions dirtrack nil t remove-hook message "Directory tracking %s" "ON" "OFF"] 5 (#$ . 3071) nil]) #@39 Enable or disable Dirtrack debugging. (defalias 'dirtrack-debug-toggle #[nil "?\302\303\203 \304\202\305\"\210\205\306\307 !!\207" [dirtrack-debug dirtrack-debug-buffer message "Directory debugging %s" "ON" "OFF" display-buffer get-buffer-create] 3 (#$ . 3424) nil]) (defalias 'dirtrack-debug-message #[(string) "p\304! q\210db\210 \305Pc\210\nq*\207" [dirtrack-debug-buffer debug-buf buf string get-buffer-create "\n"] 3]) #@441 Determine the current directory by scanning the process output for a prompt. The prompt to look for is the first item in `dirtrack-list'. You can toggle directory tracking by using the function `dirtrack-toggle'. If directory tracking does not seem to be working, you can use the function `dirtrack-debug-toggle' to turn on debugging output. You can enable directory tracking by adding this function to `comint-output-filter-functions'. (defalias 'dirtrack #[(input) "\203\267`e=\204\267\306 \n@\nA@\307\n8\212\310 \"\2044\203\265\311\312\313\"!\210\202\265\314\f\"\211G\315V\204N\203\265\311\316!\210\202\265!!\203k\311\312\317#!\210\230\204}\320!\230\203\213\203\265\311\312\321!!\210\202\265\322!\203\257\323!\203\265\324\325!\203\265\203\265\311\312\326\"!\210\202\265\327\330\"\210.\207" [dirtrackp default-directory dirtrack-list multi-line match-num dirtrack-regexp nil 2 string-match dirtrack-debug-message format "Input `%s' failed to match `dirtrack-regexp'" match-string 0 "Match is empty string" "Prompt is %s\nCurrent directory is %s" abbreviate-file-name "Not changing directory" file-accessible-directory-p shell-process-cd run-hooks dirtrack-directory-change-hook "Changing directory to %s" error "Directory %s does not exist" current-dir prompt-path input dirtrack-debug dirtrack-directory-function dirtrack-canonicalize-function] 7 (#$ . 3867)]) (provide 'dirtrack)