;; Kyle Jones <kyle_jones@wonderworks.com>
;; added "Exact match, then inexact" code
;; added support for include directive.
-;; Hrvoje Niksic <hniksic@srce.hr>
+;; Hrvoje Niksic <hniksic@xemacs.org>
;; various changes.
\f
arguments.")
(defvar find-tag-hook nil
- "Function to call after a tag is found.
+ "*Function to call after a tag is found.
Make it buffer-local in a mode hook. The function is called with no
arguments.")
(format "%s(default %s) " prompt default)
prompt)
tag-completion-table 'tag-completion-predicate nil nil
- 'find-tag-history))
- (if (string-equal tag-name "")
- ;; #### - This is a really LAME way of doing it! --Stig
- default ;indicate exact symbol match
- tag-name)))
+ 'find-tag-history default))
+ tag-name))
(defvar last-tag-data nil
"Information for continuing a tag search.
(t
(setq tag-table-currently-matching-exact t)))
;; \_ in the tagname is used to indicate a symbol boundary.
- (setq exact-tagname (concat "\\_" tagname "\\_"))
+ (setq exact-tagname (format "\C-?\\_%s\\_\C-a\\|\\_%s\\_" tagname tagname))
(while (string-match "\\\\_" exact-tagname)
(aset exact-tagname (1- (match-end 0)) ?b))
(save-excursion
syn-tab exact-syntax-table)
(setq tag-target tagname
syn-tab normal-syntax-table))
- (with-caps-disable-folding tag-target
+ (with-search-caps-disable-folding tag-target t
(while tag-tables
(set-buffer (get-tag-table-buffer (car tag-tables)))
(bury-buffer (current-buffer))
;; tag searches?
(while (re-search-forward tag-target nil t)
(and (save-match-data
- (looking-at "[^\n\C-?]*\C-?"))
+ (save-excursion
+ (goto-char (match-beginning 0))
+ (looking-at "[^\n\C-?]*\C-?")))
;; If we're looking for inexact matches, skip
;; exact matches since we've visited them
;; already.
(if next "more " "")
(if exact "matching" "containing")
tagname))
+ (beginning-of-line)
(search-forward "\C-?")
(setq file (expand-file-name (file-of-tag)
;; In XEmacs, this needs to be
(push-mark)
(goto-char tag-point)
(if find-tag-hook
- (funcall find-tag-hook)
+ (run-hooks 'find-tag-hook)
(if local-find-tag-hook
- (funcall local-find-tag-hook))))
+ (run-hooks 'local-find-tag-hook))))
(setq tags-loop-scan (list 'find-tag nil nil)
- tags-loop-operate nil)
+ tags-loop-operate nil)
;; Return t in case used as the tags-loop-scan.
t)
See documentation of variable `tag-table-alist'."
(interactive "sTags search (regexp): ")
(if (and (equal regexp "")
- (eq (car tags-loop-scan) 'with-caps-disable-folding)
+ (eq (car tags-loop-scan) 'with-search-caps-disable-folding)
(null tags-loop-operate))
;; Continue last tags-search as if by `M-,'.
(tags-loop-continue nil)
- (setq tags-loop-scan `(with-caps-disable-folding ,regexp
+ (setq tags-loop-scan `(with-search-caps-disable-folding ,regexp t
(re-search-forward ,regexp nil t))
tags-loop-operate nil)
(tags-loop-continue (or file-list-form t))))
See documentation of variable `tag-table-alist'."
(interactive
"sTags query replace (regexp): \nsTags query replace %s by: \nP")
- (setq tags-loop-scan `(with-caps-disable-folding ,from
+ (setq tags-loop-scan `(with-search-caps-disable-folding ,from t
(if (re-search-forward ,from nil t)
;; When we find a match, move back
;; to the beginning of it so perform-replace
\f
;; Sample uses of find-tag-hook and find-tag-default-hook
-;; This is wrong. We should either make this behaviour default and
+;; This is wrong. We should either make this behavior default and
;; back it up, or not use it at all. For now, I've commented it out.
;; --hniksic
;;;###autoload (define-key esc-map "*" 'pop-tag-mark)
+;;;###autoload
(defun pop-tag-mark (arg)
"Go to last tag position.
`find-tag' maintains a mark-stack seperate from the \\[set-mark-command] mark-stack.
\f
(provide 'etags)
(provide 'tags)
+
+;;; etags.el ends here