unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Masatake YAMATO <jet@gyve.org>
Subject: enable mouse-2 in tags-select-tags-table
Date: Sun, 06 Apr 2003 04:32:16 +0900 (JST)	[thread overview]
Message-ID: <20030406.043216.108750441.jet@gyve.org> (raw)

With attached patch, you can select a tags table with
mouse-2(and/or C-m).

I hope many part of etags.el is now overhauled.

Masatake YAMATO
P.S. I got a CVS write access. So if my patch passes your 
review, I can install it by myself.

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

	* progmodes/etags.el (select-tags-table-mode-map): 
	Don't create new keymap. Instead copy from button-buffer-map.
	Bind push-button to `t' instead of binding
	select-tags-table-select directly
	
	* (tags-select-tags-table): New button.

 	* progmodes/etags.el (select-tags-table): Put
	a button for each selections.

Warning: Remote host denied X11 forwarding.
Index: lisp/progmodes/etags.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/etags.el,v
retrieving revision 1.174
diff -u -r1.174 etags.el
--- lisp/progmodes/etags.el	5 Apr 2003 18:19:30 -0000	1.174
+++ lisp/progmodes/etags.el	5 Apr 2003 19:22:40 -0000
@@ -1890,6 +1890,10 @@
 \f
 ;; XXX Kludge interface.
 
+(define-button-type 'tags-select-tags-table
+  'action (lambda (button) (select-tags-table-select))
+  'hel-echo "RET, t or mouse-2: select tags table")
+
 ;; XXX If a file is in multiple tables, selection may get the wrong one.
 ;;;###autoload
 (defun select-tags-table ()
@@ -1901,16 +1905,21 @@
   (setq buffer-read-only nil)
   (erase-buffer)
   (let ((set-list tags-table-set-list)
-	(desired-point nil))
+	(desired-point nil)
+	b)
     (when tags-table-list
 	  (setq desired-point (point-marker))
+	  (setq b (point))
 	  (princ tags-table-list (current-buffer))
+	  (make-text-button b (point) 'type 'tags-select-tags-table)
 	  (insert "\C-m")
 	  (prin1 (car tags-table-list) (current-buffer)) ;invisible
       (insert "\n"))
     (while set-list
       (unless (eq (car set-list) tags-table-list)
+	(setq b (point))
 	(princ (car set-list) (current-buffer))
+	(make-text-button b (point) 'type 'tags-select-tags-table)
 	(insert "\C-m")
 	(prin1 (car (car set-list)) (current-buffer)) ;invisible
 	(insert "\n"))
@@ -1918,7 +1927,10 @@
     (when tags-file-name
 	  (or desired-point
 	      (setq desired-point (point-marker)))
-	  (insert tags-file-name "\C-m")
+	  (setq b (point))
+	  (insert tags-file-name)
+	  (make-text-button b (point) 'type 'tags-select-tags-table)
+	  (insert "\C-m")
 	  (prin1 tags-file-name (current-buffer)) ;invisible
       (insert "\n"))
     (setq set-list (delete tags-file-name
@@ -1926,7 +1938,10 @@
 					       (mapcar 'copy-sequence
 						       tags-table-set-list)))))
     (while set-list
-      (insert (car set-list) "\C-m")
+      (setq b (point))
+      (insert (car set-list))
+      (make-text-button b (point) 'type 'tags-select-tags-table)
+      (insert "\C-m")
       (prin1 (car set-list) (current-buffer)) ;invisible
       (insert "\n")
       (setq set-list (delete (car set-list) set-list)))
@@ -1939,15 +1954,15 @@
   (set-buffer-modified-p nil)
   (select-tags-table-mode))
 
-(defvar select-tags-table-mode-map)
-(let ((map (make-sparse-keymap)))
-  (define-key map "t" 'select-tags-table-select)
-  (define-key map " " 'next-line)
-  (define-key map "\^?" 'previous-line)
-  (define-key map "n" 'next-line)
-  (define-key map "p" 'previous-line)
-  (define-key map "q" 'select-tags-table-quit)
-  (setq select-tags-table-mode-map map))
+(defvar select-tags-table-mode-map
+  (let ((map (copy-keymap button-buffer-map)))
+    (define-key map "t" 'push-button)
+    (define-key map " " 'next-line)
+    (define-key map "\^?" 'previous-line)
+    (define-key map "n" 'next-line)
+    (define-key map "p" 'previous-line)
+    (define-key map "q" 'select-tags-table-quit)
+    map))
 
 (defun select-tags-table-mode ()
   "Major mode for choosing a current tags table among those already loaded.

             reply	other threads:[~2003-04-05 19:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-05 19:32 Masatake YAMATO [this message]
2003-04-06 12:27 ` enable mouse-2 in tags-select-tags-table Masatake YAMATO

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030406.043216.108750441.jet@gyve.org \
    --to=jet@gyve.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).