summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1992-07-22 21:17:34 +0000
committerRoland McGrath <roland@gnu.org>1992-07-22 21:17:34 +0000
commit21800cb80bdd7f1e5e2d3d96828c11ae96ddaed0 (patch)
treedf3cdd2b730824db455213b2d66b95f8910207b1 /lisp
parente51e47f72998dacc5b8ebc2073a8dec7e6160af5 (diff)
downloademacs-21800cb80bdd7f1e5e2d3d96828c11ae96ddaed0.tar.gz
*** empty log message ***
Diffstat (limited to 'lisp')
-rw-r--r--lisp/progmodes/etags.el54
1 files changed, 39 insertions, 15 deletions
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 014832f46b3..28e7f8412c6 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -227,6 +227,24 @@ Returns t if it visits a tags table, or nil if there are no more in the list."
(cdr (assq 'tags-file-name (buffer-local-variables))))
(and default-tags-table-function
(funcall default-tags-table-function))
+ ;; Look for a tags table that contains
+ ;; tags for the current buffer's file.
+ (let ((tables tags-table-list)
+ (this-file (buffer-file-name))
+ (found nil))
+ (save-excursion
+ (while tables
+ (if (assoc this-file
+ (let ((tags-file-name (car tables)))
+ (visit-tags-file nil)
+ (or tags-table-files
+ (setq tags-table-files
+ (funcall
+ tags-table-files-function)))))
+ (setq found (car tables)
+ tables nil)
+ (setq tables (cdr tables)))))
+ found)
(car tags-table-list-pointer)
tags-file-name
(expand-file-name
@@ -420,6 +438,9 @@ File names returned are absolute."
(or default (error "There is no default tag"))
spec))))
+(defvar last-tag nil
+ "Last tag found by \\[find-tag].")
+
;;;###autoload
(defun find-tag-noselect (tagname &optional next-p regexp-p)
"Find tag (in current tags table) whose name contains TAGNAME.
@@ -438,21 +459,24 @@ See documentation of variable `tags-file-name'."
'(nil t)
(find-tag-tag "Find tag: ")))
(let ((local-find-tag-hook find-tag-hook))
- (if (not next-p)
- (visit-tags-table-buffer 'reset))
- (find-tag-in-order tagname
- (if regexp-p
- find-tag-regexp-search-function
- find-tag-search-function)
- (if regexp-p
- find-tag-regexp-tag-order
- find-tag-tag-order)
- (if regexp-p
- find-tag-regexp-next-line-after-failure-p
- find-tag-next-line-after-failure-p)
- (if regexp-p "matching" "containing")
- (not next-p))
- (run-hooks 'local-find-tag-hook)))
+ (if next-p
+ nil
+ (setq last-tag tagname)
+ (visit-tags-table-buffer 'reset))
+ (prog1
+ (find-tag-in-order (if next-p last-tag tagname)
+ (if regexp-p
+ find-tag-regexp-search-function
+ find-tag-search-function)
+ (if regexp-p
+ find-tag-regexp-tag-order
+ find-tag-tag-order)
+ (if regexp-p
+ find-tag-regexp-next-line-after-failure-p
+ find-tag-next-line-after-failure-p)
+ (if regexp-p "matching" "containing")
+ (not next-p))
+ (run-hooks 'local-find-tag-hook))))
;;;###autoload
(defun find-tag (tagname &optional next-p)