Changes committed gnus/lisp (gnus-art.el)

"Katsumi Yamaoka" <[email protected]>
Newsgroups gmane.emacs.gnus.commits
Message-ID <[email protected]>
Modified: gnus-art.el

(gnus-article-read-summary-keys): Work for `C-h' on XEmacs.
(gnus-article-describe-key, gnus-article-describe-key-briefly): Protect against
 non-character events.


Index: gnus-art.el
diff -u gnus/lisp/gnus-art.el:7.250 gnus/lisp/gnus-art.el:7.251
--- gnus-art.el:7.250	Wed Jan  9 23:29:37 2008
+++ gnus-art.el	Thu Jan 10 09:08:19 2008
@@ -6260,20 +6260,27 @@
 
     (cond
      ((eq (aref keys (1- (length keys))) ?\C-h)
-      ;; FIXME: XEmacs doesn't show the S-prefixed keys that are defined
-      ;; in the parent keymap (try `S C-h' in the article buffer).
-      (let ((keymap (make-sparse-keymap))
-	    (map (copy-keymap gnus-article-send-map)))
-	(define-key keymap "S" map)
-	(if (featurep 'xemacs)
-	    (set-keymap-default-binding map nil)
-	  (define-key map [t] nil))
-	(set-keymap-parent keymap
-			   (with-current-buffer gnus-article-current-summary
-			     (current-local-map)))
-	(with-temp-buffer
-	  (use-local-map keymap)
-	  (describe-bindings (substring keys 0 -1)))))
+      (if (featurep 'xemacs)
+	  (let ((keymap (with-current-buffer gnus-article-current-summary
+			  (copy-keymap (current-local-map)))))
+	    (map-keymap
+	     (lambda (key def)
+	       (define-key keymap (vector ?S key) def))
+	     gnus-article-send-map)
+	    (with-temp-buffer
+	      (setq major-mode 'gnus-article-mode)
+	      (use-local-map keymap)
+	      (describe-bindings (substring keys 0 -1))))
+	(let ((keymap (make-sparse-keymap))
+	      (map (copy-keymap gnus-article-send-map)))
+	  (define-key keymap "S" map)
+	  (define-key map [t] nil)
+	  (set-keymap-parent keymap
+			     (with-current-buffer gnus-article-current-summary
+			       (current-local-map)))
+	  (with-temp-buffer
+	    (use-local-map keymap)
+	    (describe-bindings (substring keys 0 -1))))))
      ((or (member keys nosaves)
 	  (member keys nosave-but-article)
 	  (member keys nosave-in-article))
@@ -6367,7 +6374,8 @@
     (gnus-article-read-summary-keys)))
 
 (defun gnus-article-describe-key (key)
-  "Display documentation of the function invoked by KEY.  KEY is a string."
+  "Display documentation of the function invoked by KEY.
+KEY is a string or a vector."
   (interactive (list (let ((cursor-in-echo-area t)) ;; better for XEmacs.
 		       (read-key-sequence "Describe key: "))))
   (gnus-article-check-buffer)
@@ -6378,7 +6386,9 @@
 	(setq unread-command-events
 	      (if (featurep 'xemacs)
 		  (append key nil)
-		(mapcar (lambda (x) (if (>= x 128) (list 'meta (- x 128)) x))
+		(mapcar (lambda (x) (if (and (integerp x) (>= x 128))
+					(list 'meta (- x 128))
+				      x))
 			key)))
 	(let ((cursor-in-echo-area t)
 	      gnus-pick-mode)
@@ -6386,7 +6396,8 @@
     (describe-key key)))
 
 (defun gnus-article-describe-key-briefly (key &optional insert)
-  "Display documentation of the function invoked by KEY.  KEY is a string."
+  "Display documentation of the function invoked by KEY.
+KEY is a string or a vector."
   (interactive (list (let ((cursor-in-echo-area t)) ;; better for XEmacs.
 		       (read-key-sequence "Describe key: "))
 		     current-prefix-arg))
@@ -6398,7 +6409,9 @@
 	(setq unread-command-events
 	      (if (featurep 'xemacs)
 		  (append key nil)
-		(mapcar (lambda (x) (if (>= x 128) (list 'meta (- x 128)) x))
+		(mapcar (lambda (x) (if (and (integerp x) (>= x 128))
+					(list 'meta (- x 128))
+				      x))
 			key)))
 	(let ((cursor-in-echo-area t)
 	      gnus-pick-mode)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.