Function: vi-locate-def

vi-locate-def is an interactive and byte-compiled function defined in vi.el.gz.

Signature

(vi-locate-def)

Documentation

Locate definition in current file for the name before the point.

It assumes a (def.. always starts at the beginning of a line.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/vi.el.gz
(defun vi-locate-def ()
  "Locate definition in current file for the name before the point.
It assumes a `(def..' always starts at the beginning of a line."
  (interactive)
  (let (name)
    (save-excursion
      (setq name (buffer-substring (progn (vi-backward-blank-delimited-word 1)
					  (skip-chars-forward "^a-zA-Z")
					  (point))
				   (progn (vi-end-of-blank-delimited-word 1)
					  (forward-char)
					  (skip-chars-backward "^a-zA-Z")
					  (point)))))
    (set-mark-command nil)
    (goto-char (point-min))
    (if (re-search-forward (concat "^(def[unvarconst ]*" name) nil t)
	nil
      (ding)
      (message "No definition for \"%s\" in current file." name)
      (set-mark-command t))))