changeset 50545:f1c99baf3a4f

2003-04-11 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.
author Masatake YAMATO <jet@gyve.org>
date Fri, 11 Apr 2003 09:08:29 +0000
parents f7d63c53fb6c
children 4a06e3332577
files lisp/ChangeLog lisp/progmodes/etags.el
diffstat 2 files changed, 39 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Apr 11 08:40:02 2003 +0000
+++ b/lisp/ChangeLog	Fri Apr 11 09:08:29 2003 +0000
@@ -1,3 +1,15 @@
+2003-04-11  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.
+
 2003-04-11  Kenichi Handa  <handa@m17n.org>
 
 	* international/quail.el (quail-guidance-str)
--- a/lisp/progmodes/etags.el	Fri Apr 11 08:40:02 2003 +0000
+++ b/lisp/progmodes/etags.el	Fri Apr 11 09:08:29 2003 +0000
@@ -1890,6 +1890,10 @@
 
 ;; XXX Kludge interface.
 
+(define-button-type 'tags-select-tags-table
+  'action (lambda (button) (select-tags-table-select))
+  'help-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.