4.4BSD/usr/src/contrib/emacs-18.57/lisp/tags.elc


(provide (quote tags))

(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 tag-table-files nil tags-file-name 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 "!!‰!q!!-!-\"‰f=9\"" [tags-file-name tag-table-files nil t call-interactively visit-tags-table get-file-buffer find-file-noselect verify-visited-file-modtime yes-or-no-p "Tags file has changed, read new contents? " revert-buffer 1 12 error "File %s not a valid tag table"] 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-default nil (byte-code "!!#4!`!!.!!`\"5)" [nil t looking-at "\\sw\\|\\s_" forward-char 1 re-search-backward buffer-substring forward-sexp -1 "\\s'"] 11))

(defun find-tag-tag (string) (byte-code " 
#
!	\"	C*" [default spec string find-tag-default read-string format "%s(default %s) " equal ""] 6))

(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 "!" [current-prefix-arg (nil t) find-tag-tag "Find tag: "] 2)) (byte-code "Ȉ 
?eb#?<
8Ԃ9#!?IȈ$! 
!\"`S `)\"!p!)|
!
!  !P
e
?Zbo?\\#
\"
#
#+ ,ɇ" [current-prefix-arg buffer file linebeg startpos next tagname last-tag nil t tags-file-name other-window offset found pat tags-loop-form visit-tags-table-buffer search-forward error "No %sentries containing %s" "more " "" looking-at "[^
]*" "" expand-file-name file-of-tag file-name-directory buffer-substring beginning-of-line "," read find-file-other-window find-file widen push-mark 1000 "^" regexp-quote re-search-forward * 3 "%s not found in %s" (find-tag nil t)] 24))

(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 in another window
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 "!" [current-prefix-arg (nil t) find-tag-tag "Find tag other window: "] 2)) (byte-code "Ĉ	
#" [current-prefix-arg 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 "All files processed." 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 buffer-file-name nil next-file eval message "Scanning file %s..."] 7))

(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!" [regexp tags-loop-form nil t equal "" re-search-forward tags-loop-continue] 6))

(defun tags-query-replace (from to &optional delimited) "\
Query-replace-regexp FROM with TO through all files listed in tag table.
Third arg DELIMITED (prefix arg) means replace only word-delimited matches.
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: 
P") (byte-code "ˆ	FD	
??&DE!" [tags-loop-form from nil t to delimited and save-excursion re-search-forward not list perform-replace tags-loop-continue] 10))

(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!!m(!?A`!`\"! !!)" [string nil "*Tags List*" 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 "*Tags List*" 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))