changeset 33691:936c632692fd

(gnus-mime-button-map): Don't inherit from gnus-article-mode-map. (gnus-mime-button-menu): Use mouse-set-point. (gnus-insert-mime-button, gnus-mime-display-alternative) (gnus-mime-display-alternative): Don't use local-map property.
author Dave Love <fx@gnu.org>
date Tue, 21 Nov 2000 17:54:13 +0000
parents 2169c99290cc
children 3f2fa039af24
files lisp/gnus/gnus-art.el
diffstat 1 files changed, 26 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/gnus-art.el	Tue Nov 21 17:49:42 2000 +0000
+++ b/lisp/gnus/gnus-art.el	Tue Nov 21 17:54:13 2000 +0000
@@ -2664,6 +2664,7 @@
 
     (easy-menu-define
      gnus-article-treatment-menu gnus-article-mode-map ""
+     ;; Fixme: this should use :active (and maybe :visible).
      '("Treatment"
        ["Hide headers" gnus-article-hide-headers t]
        ["Hide signature" gnus-article-hide-signature t]
@@ -2683,6 +2684,9 @@
 
     (gnus-run-hooks 'gnus-article-menu-hook)))
 
+;; Fixme: do something for the Emacs tool bar in Article mode a la
+;; Summary.
+
 (defun gnus-article-mode ()
   "Major mode for displaying an article.
 
@@ -2949,7 +2953,8 @@
 
 (defvar gnus-mime-button-map
   (let ((map (make-sparse-keymap)))
-    (set-keymap-parent map gnus-article-mode-map)
+    ;; Not for Emacs 21: fixme better.
+    ;; (set-keymap-parent map gnus-article-mode-map)
     (define-key map gnus-mouse-2 'gnus-article-push-button)
     (define-key map gnus-down-mouse-3 'gnus-mime-button-menu)
     (dolist (c gnus-mime-button-commands)
@@ -2960,17 +2965,15 @@
   "Construct a context-sensitive menu of MIME commands."
   (interactive "e")
   (save-excursion
-    (let ((pos (event-start event)))
-      (set-buffer (window-buffer (posn-window pos)))
-      (goto-char (posn-point pos))
-      (gnus-article-check-buffer)
-      (let ((response (x-popup-menu
-		       t `("MIME Part"
-			   ("" ,@(mapcar (lambda (c)
-					   (cons (caddr c) (car c)))
-					 gnus-mime-button-commands))))))
-	(if response
-	    (call-interactively response))))))
+    (mouse-set-point event)
+    (gnus-article-check-buffer)
+    (let ((response (x-popup-menu
+		     t `("MIME Part"
+			 ("" ,@(mapcar (lambda (c)
+					 (cons (caddr c) (car c)))
+				       gnus-mime-button-commands))))))
+      (if response
+	  (call-interactively response)))))
 
 (defun gnus-mime-view-all-parts (&optional handles)
   "View all the MIME parts."
@@ -3288,12 +3291,13 @@
     (setq b (point))
     (gnus-eval-format
      gnus-mime-button-line-format gnus-mime-button-line-format-alist
-     `(local-map ,gnus-mime-button-map
-		 keymap ,gnus-mime-button-map
-		 gnus-callback gnus-mm-display-part
-		 gnus-part ,gnus-tmp-id
-		 article-type annotation
-		 gnus-data ,handle))
+     `(keymap ,gnus-mime-button-map
+       ;; Not for Emacs 21: fixme better.
+       ;; local-map ,gnus-mime-button-map
+       gnus-callback gnus-mm-display-part
+       gnus-part ,gnus-tmp-id
+       article-type annotation
+       gnus-data ,handle))
     (setq e (point))
     (widget-convert-button
      'link b e
@@ -3521,7 +3525,8 @@
 		       ',gnus-article-mime-handle-alist))
 	       (gnus-mime-display-alternative
 		',ihandles ',not-pref ',begend ,id))
-	     local-map ,gnus-mime-button-map
+	     ;; Not for Emacs 21: fixme better.
+	     ;; local-map ,gnus-mime-button-map
 	     ,gnus-mouse-face-prop ,gnus-article-mouse-face
 	     face ,gnus-article-button-face
 	     keymap ,gnus-mime-button-map
@@ -3546,7 +3551,8 @@
 			 ',gnus-article-mime-handle-alist))
 		 (gnus-mime-display-alternative
 		  ',ihandles ',handle ',begend ,id))
-	       local-map ,gnus-mime-button-map
+	       ;; Not for Emacs 21: fixme better.
+	       ;; local-map ,gnus-mime-button-map
 	       ,gnus-mouse-face-prop ,gnus-article-mouse-face
 	       face ,gnus-article-button-face
 	       keymap ,gnus-mime-button-map