all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* broken tags-apropos
@ 2003-04-01 18:51 Masatake YAMATO
  2003-04-03 10:36 ` Richard Stallman
  0 siblings, 1 reply; 7+ messages in thread
From: Masatake YAMATO @ 2003-04-01 18:51 UTC (permalink / raw)


It seems that tags-apropos is broken.
tags-apropos doesn't work well with new apropos-mode which
is based on button.el.

I've tried to update tags-apropos to work well with new 
apropos-mode. There are still some codes in etags.el which
depends on old apropos-mode. I'll continue working on etags.el.

In addition, I put a file name for each item in *Tags List* buffer,
the result of tags-apropos. If the source code files(etags target)
contain the symbols which has the same name, you want to distinguish
them from file names. 

Masatake YAMATO

2003-04-02  Masatake YAMATO  <jet@gyve.org>

	* progmodes/etags.el: require button.el.
	(etags-tags-apropos): use make-text-button instead of 
	add-text-properties. use snarf-tag-function and
	etags-goto-tag-location instead of find-tag-other-window.
	find-tag-other-window is too simple.

Index: lisp/progmodes/etags.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/etags.el,v
retrieving revision 1.171
diff -u -r1.171 etags.el
--- lisp/progmodes/etags.el	11 Feb 2003 21:40:17 -0000	1.171
+++ lisp/progmodes/etags.el	1 Apr 2003 19:09:38 -0000
@@ -29,6 +29,7 @@
 ;;; Code:
 
 (require 'ring)
+(require 'button)
 
 ;;;###autoload
 (defvar tags-file-name nil
@@ -1413,16 +1414,41 @@
   (goto-char (point-min))
   (while (re-search-forward string nil t)
     (beginning-of-line)
-    (let ((tag (buffer-substring (point)
-				 (progn (skip-chars-forward "^\177")
-					(point))))
-          (props `(action find-tag-other-window mouse-face highlight
-			  face ,tags-tag-face))
-          (pt (with-current-buffer standard-output (point))))
-      (princ tag)
-      (when (= (aref tag 0) ?\() (princ " ...)"))
-      (add-text-properties pt (with-current-buffer standard-output (point))
-                           `(item ,tag ,@props) standard-output))
+    (let* ((tag-info (save-excursion (funcall snarf-tag-function)))
+	   (tag (if (eq t (car tag-info)) nil (car tag-info)))
+	   (file (if tag (file-of-tag)
+		   (save-excursion (next-line 1)
+				   (file-of-tag))))
+	   (pt (with-current-buffer standard-output (point))))
+      (if tag
+	  (progn
+	    (princ (format "[%s]: " file))
+	    (princ tag)
+	    (when (= (aref tag 0) ?\() (princ " ...)"))
+	    (with-current-buffer standard-output
+	    (make-text-button pt (point)
+			      'tag-info tag-info
+			      'file file
+			      'action (lambda (button) 
+					;; TODO: just `find-file is too simple.
+					;; Use code `find-tag-in-order'.
+					(let ((tag-info (button-get button 'tag-info)))
+					  (find-file (button-get button 'file))
+					  (etags-goto-tag-location tag-info)))
+			      'face 'tags-tag-face
+			      'type 'button)))
+	(princ (format "- %s" file))
+	(with-current-buffer standard-output
+	  (make-text-button pt (point)
+	  'file file
+	  'action (lambda (button) 
+		    ;; TODO: just `find-file is too simple.
+		    ;; Use code `find-tag-in-order'.
+		    (find-file (button-get button 'file))
+		    (goto-char (point-min)))
+	  'face 'tags-tag-face
+	  'type 'button))
+	))
     (terpri)
     (forward-line 1))
   (when tags-apropos-verbose (princ "\n")))
@@ -1814,8 +1840,10 @@
 	  (funcall tags-apropos-function regexp))))
     (etags-tags-apropos-additional regexp))
   (with-current-buffer "*Tags List*"
-    (setq buffer-read-only t)
-    (apropos-mode)))
+    (apropos-mode)
+    ;; apropos-mode is derived from fundamental-mode and it kills
+    ;; all local variables.
+    (setq buffer-read-only t)))
 \f
 ;; XXX Kludge interface.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-04-05  8:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-01 18:51 broken tags-apropos Masatake YAMATO
2003-04-03 10:36 ` Richard Stallman
2003-04-03 11:51   ` Masatake YAMATO
2003-04-03 17:40     ` broken tags-apropos and list-tags Masatake YAMATO
2003-04-04  6:58       ` Richard Stallman
2003-04-04  8:25         ` Masatake YAMATO
2003-04-05  8:12           ` Richard Stallman

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.