4.3BSD/usr/contrib/emacs/lisp/tags.elc


(defvar tag-table-files nil "List of file names covered by current tag table.
nil means it has not been computed yet; do (tag-table-files) to compute it.")

(defvar last-tag nil "Tag found by the last find-tag.")

(defun visit-tags-table (file) "\
Tell tags commands to use tag table file FILE.
FILE should be the name of a file created with the `etags' program.
A directory name is ok too; it means file TAGS in that directory." (interactive (byte-code "P	$C" [default-directory t read-file-name "Visit tags table: (default TAGS) " "TAGS"] 5)) (byte-code "Ĉ
!
!
PĈ
" [default-directory t file tags-file-name nil expand-file-name file-directory-p "TAGS"] 4))

(defun visit-tags-table-buffer nil "\
Select the buffer containing the current tag table.
This is a file whose name is in the variable tags-file-name." (byte-code "!!
!qfU\"\"!!8!8!
" [tags-file-name tag-table-files nil t call-interactively visit-tags-table get-file-buffer find-file-noselect 1 12 error "File %s not a valid tag table" verify-visited-file-modtime yes-or-no-p "Tags file has changed, read new contents? " revert-buffer] 10))

(defun file-of-tag nil "\
Return the file name of the file whose tags point is within.
Assumes the tag table is the current buffer.
File name returned is relative to tag table file's directory." (byte-code "`eb`W3! !`p!	b!
!
	Sb` `\")+" [opoint prev size nil forward-line 1 end-of-line skip-chars-backward "^,
" read forward-char buffer-substring beginning-of-line] 10))

(defun tag-table-files nil "\
Return a list of files in the current tag table.
File names returned are absolute." (byte-code " Pebm?I! !`p!
b`S `)\"!\"	B!!
	!))" [tag-table-files files prev size tags-file-name visit-tags-table-buffer nil forward-line 1 end-of-line skip-chars-backward "^,
" read expand-file-name buffer-substring beginning-of-line file-name-directory forward-char nreverse] 14))

(defun find-tag (tagname &optional next other-window) "\
Find tag (in current tag table) whose name contains TAGNAME.
 Selects the buffer that the tag is contained in
and puts point at its definition.
 If TAGNAME is a null string, the expression in the buffer
around or before point is used as the tag name.
 If second arg NEXT is non-nil (interactively, with prefix arg),
searches for the next tag in the tag table
that matches the tagname used in the previous find-tag.

See documentation of variable tags-file-name." (interactive (byte-code "!C" [current-prefix-arg (nil t) read-string "Find tag: "] 2)) (byte-code "ψ	\"!`!`\")ψ ?5eb9		!!?Oψ?! !\"`S `)\"!p!)	!!  !P

e?

Zbo?

\\
#
\"
!+ ,
" [current-prefix-arg tagname buffer file linebeg startpos next last-tag tags-file-name other-window offset found pat t tags-loop-form nil equal "" buffer-substring backward-sexp 1 forward-sexp visit-tags-table-buffer search-forward looking-at "[^
]*" "" expand-file-name file-of-tag file-name-directory beginning-of-line "," read find-file-other-window find-file widen push-mark 1000 "^" regexp-quote re-search-forward * 3 (find-tag nil t)] 26))

(defun find-tag-other-window (tagname &optional next) "\
Find tag (in current tag table) whose name contains TAGNAME.
 Selects the buffer that the tag is contained in
and puts point at its definition.
 If TAGNAME is a null string, the expression in the buffer
around or before point is used as the tag name.
 If second arg NEXT is non-nil (interactively, with prefix arg),
searches for the next tag in the tag table
that matches the tagname used in the previous find-tag.

See documentation of variable tags-file-name." (interactive "sFind tag other window: 
P") (byte-code "È	
#" [tagname next t nil find-tag] 4))

(defvar next-file-list nil "List of files for next-file to process.")

(defun next-file (&optional initialize) "\
Select next file among files in current tag table.
Non-nil argument (prefix arg, if interactive)
initializes to the beginning of the list of files in the tag table." (interactive "P") (byte-code "ˆ
 ˆ	!	@!	A" [initialize next-file-list nil tag-table-files error "No more files." find-file] 5))

(defvar tags-loop-form nil "Form for tags-loop-continue to eval to process one file.
If it returns nil, it is through with one file; move on to next.")

(defun tags-loop-continue (&optional first-time) "\
Continue last \\[tags-search] or \\[tags-query-replace] command.
Used noninteractively with non-nil argument
to begin such a command.  See variable tags-loop-form." (interactive) (byte-code "È	!ebÈ
!?! eb" [first-time t tags-loop-form nil next-file eval] 5))

(defun tags-search (regexp) "\
Search through all files listed in tag table for match for REGEXP.
Stops when a match is found.
To continue searching for next match, use command \\[tags-loop-continue].

See documentation of variable tags-file-name." (interactive "sTags search (regexp): ") (byte-code "ˆ	
F!" [tags-loop-form regexp nil t re-search-forward tags-loop-continue] 4))

(defun tags-query-replace (from to) "\
Query-replace FROM with TO through all files listed in tag table.
If you exit (C-G or ESC), you can resume the query-replace
with the command \\[tags-loop-continue].

See documentation of variable tags-file-name." (interactive "sTags query replace (regexp): 
sTags query replace %s by: ") (byte-code "ˆ	
FD	EDE!" [tags-loop-form from nil t to and save-excursion re-search-forward not query-replace-regexp tags-loop-continue] 6))

(defun list-tags (string) "\
Display list of tags in file FILE.
FILE should not contain a directory spec
unless it has one in the tag table." (interactive "sList tags (in file): ") (byte-code "!!  bQ!!!?=`!`\"! !!)" [string nil "*Help*" princ "Tags in file " terpri visit-tags-table-buffer 1 search-forward "
" "," forward-line looking-at "" buffer-substring skip-chars-forward "^"] 15))

(defun tags-apropos (string) "\
Display list of all tags in tag table REGEXP matches." (interactive "sTag apropos (regexp): ") (byte-code "Ð!!  b	
#6 `!`\"! !)" [string nil t "*Help*" princ "Tags matching regexp " prin1 terpri visit-tags-table-buffer 1 re-search-forward beginning-of-line buffer-substring skip-chars-forward "^" forward-line] 14))