emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Store tagname into `find-tag-marker-ring'


From: Masatake YAMATO
Subject: Store tagname into `find-tag-marker-ring'
Date: Wed, 19 May 2004 19:22:19 +0900 (JST)

Do you know vim's tag stack?    

This is the :tags command output of vim.

    :tags
      # TO tag         FROM line  in file/text
      1  1 schedule            1  drivers/char/drm-4.0/drmP.h
      2  1 DRM_DMA_HISTOGRAM_SLOTS   378  drivers/char/drm-4.0/drmP.h
      3  1 atomic_t          537  drivers/char/drm-4.0/drmP.h
      4  1 LOCK               56  include/asm-i386/atomic.h
      5  1 CONFIG_SMP         11  include/asm-i386/atomic.h

This is something like buffer list of Emacs, but the each line stands 
for history of tag search. I want a similar things in Emacs. M-* is
useful but not enough. To implementat such a function, it is better
to store the searched tags to `find-tag-marker-ring'.

Regards,
Masatake YAMATO
 
2004-05-19  Masatake YAMATO  <address@hidden>

        * progmodes/etags.el (tags-reset-tags-tables, )
        (find-tag-noselect, pop-tag-mark): Store tagname
        to `find-tag-marker-ring'.

Index: lisp/progmodes/etags.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/etags.el,v
retrieving revision 1.177
diff -u -r1.177 etags.el
--- lisp/progmodes/etags.el     1 Sep 2003 15:45:35 -0000       1.177
+++ lisp/progmodes/etags.el     19 May 2004 10:09:01 -0000
@@ -693,10 +693,10 @@
   ;; Clear out the markers we are throwing away.
   (let ((i 0))
     (while (< i find-tag-marker-ring-length)
-      (if (aref (cddr tags-location-ring) i)
-         (set-marker (aref (cddr tags-location-ring) i) nil))
-      (if (aref (cddr find-tag-marker-ring) i)
-         (set-marker (aref (cddr find-tag-marker-ring) i) nil))
+      (if (aref (car (cddr tags-location-ring)) i)
+         (set-marker (aref (car (cddr tags-location-ring)) i) nil))
+      (if (aref (car (cddr find-tag-marker-ring)) i)
+         (set-marker (aref (car (cddr find-tag-marker-ring)) i) nil))
       (setq i (1+ i))))
   (setq tags-file-name nil
        tags-location-ring (make-ring find-tag-marker-ring-length)
@@ -873,7 +873,7 @@
              ;; Run the user's hook.  Do we really want to do this for pop?
              (run-hooks 'local-find-tag-hook))))
       ;; Record whence we came.
-      (ring-insert find-tag-marker-ring (point-marker))
+      (ring-insert find-tag-marker-ring (cons (point-marker) tagname))
       (if (and next-p last-tag)
          ;; Find the same table we last used.
          (visit-tags-table-buffer 'same)
@@ -901,7 +901,7 @@
            (or (not next-p) (not last-tag))))
          (set-marker marker (point))
          (run-hooks 'local-find-tag-hook)
-         (ring-insert tags-location-ring marker)
+         (ring-insert tags-location-ring (cons marker tagname))
          (current-buffer))))))
 
 ;;;###autoload
@@ -1034,7 +1034,7 @@
   (interactive)
   (if (ring-empty-p find-tag-marker-ring)
       (error "No previous locations for find-tag invocation"))
-  (let ((marker (ring-remove find-tag-marker-ring 0)))
+  (let ((marker (car (ring-remove find-tag-marker-ring 0))))
     (switch-to-buffer (or (marker-buffer marker)
                           (error "The marked buffer has been deleted")))
     (goto-char (marker-position marker))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]