Function: dirtrack-mode

dirtrack-mode is an autoloaded, interactive and byte-compiled function defined in dirtrack.el.gz.

Signature

(dirtrack-mode &optional ARG)

Documentation

Toggle directory tracking in shell buffers (Dirtrack mode).

This is a minor mode. If called interactively, toggle the Dirtrack mode mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode.

If called from Lisp, toggle the mode if ARG is toggle. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number.

To check whether the minor mode is enabled in the current buffer, evaluate dirtrack-mode(var)/dirtrack-mode(fun).

The mode's hook is called both when the mode is enabled and when it is disabled.

This method requires that your shell prompt contain the current working directory at all times, and that you set the variable dirtrack-list to match the prompt.

This is an alternative to shell-dirtrack-mode(var)/shell-dirtrack-mode(fun), which works by tracking cd and similar commands which change the shell working directory.

Probably introduced at or before Emacs version 22.2.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/dirtrack.el.gz
;;;###autoload
(define-minor-mode dirtrack-mode
  "Toggle directory tracking in shell buffers (Dirtrack mode).

This method requires that your shell prompt contain the current
working directory at all times, and that you set the variable
`dirtrack-list' to match the prompt.

This is an alternative to `shell-dirtrack-mode', which works by
tracking `cd' and similar commands which change the shell working
directory."
  :lighter nil
  (if dirtrack-mode
      (add-hook 'comint-preoutput-filter-functions 'dirtrack nil t)
    (remove-hook 'comint-preoutput-filter-functions 'dirtrack t)))