* gnus-art.el (gnus-article-read-summary-send-keys): Use
authorKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 17 Jan 2008 01:54:00 +0000 (01:54 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 17 Jan 2008 01:54:00 +0000 (01:54 +0000)
 gnus-character-to-event.
(gnus-article-describe-bindings): Simplify; move XEmacs stuff to gnus-xmas.el.

* gnus-xmas.el: Bind gnus-agent-summary-mode when compiling.
(gnus-xmas-article-describe-bindings): New function.
(gnus-xmas-redefine): Make gnus-article-describe-bindings alias to
 gnus-xmas-article-describe-bindings.

* lpath.el: Don't fbind character-to-event and map-keymap for Emacs 21.

lisp/ChangeLog
lisp/gnus-art.el
lisp/gnus-xmas.el
lisp/lpath.el

index ff8c88b..448df4b 100644 (file)
@@ -1,3 +1,17 @@
+2008-01-17  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-art.el (gnus-article-read-summary-send-keys): Use
+       gnus-character-to-event.
+       (gnus-article-describe-bindings): Simplify; move XEmacs stuff to
+       gnus-xmas.el.
+
+       * gnus-xmas.el: Bind gnus-agent-summary-mode when compiling.
+       (gnus-xmas-article-describe-bindings): New function.
+       (gnus-xmas-redefine): Make gnus-article-describe-bindings alias to
+       gnus-xmas-article-describe-bindings.
+
+       * lpath.el: Don't fbind character-to-event and map-keymap for Emacs 21.
+
 2008-01-16  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * gnus-registry.el (gnus-registry-marks, gnus-registry-default-mark):
index 645d468..7823bdb 100644 (file)
@@ -6349,9 +6349,7 @@ not have a face in `gnus-article-boring-faces'."
 
 (defun gnus-article-read-summary-send-keys ()
   (interactive)
-  (let ((unread-command-events (list (if (featurep 'xemacs)
-                                        (character-to-event ?S)
-                                      ?S))))
+  (let ((unread-command-events (list (gnus-character-to-event ?S))))
     (gnus-article-read-summary-keys)))
 
 (defun gnus-article-describe-key (key)
@@ -6399,78 +6397,33 @@ KEY is a string or a vector."
          (describe-key-briefly (read-key-sequence nil t) insert)))
     (describe-key-briefly key insert)))
 
+;;`gnus-agent-mode' in gnus-agent.el will define it.
 (defvar gnus-agent-summary-mode)
 
 (defun gnus-article-describe-bindings (&optional prefix)
   "Show a list of all defined keys, and their definitions.
 The optional argument PREFIX, if non-nil, should be a key sequence;
-then we display only bindings in the summary buffer that start with
-that prefix."
+then we display only bindings that start with that prefix."
   (interactive)
   (gnus-article-check-buffer)
-  (if (featurep 'xemacs)
-      (if prefix
-         (let (keymap agent)
-           (with-current-buffer gnus-article-current-summary
-             (setq keymap (copy-keymap (current-local-map))
-                   agent (if (boundp 'gnus-agent-summary-mode)
-                             gnus-agent-summary-mode)))
-           (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)
-             (set (make-local-variable 'gnus-agent-summary-mode) agent)
-             (describe-bindings prefix)))
-       (let ((keymap (copy-keymap gnus-article-mode-map))
-             (map (copy-keymap gnus-article-send-map))
-             (sumkeys (where-is-internal 'gnus-article-read-summary-keys)))
-         (define-key keymap "S" map)
-         (set-keymap-default-binding map nil)
-         (with-current-buffer gnus-article-current-summary
-           (let ((def (key-binding "S"))
-                 gnus-pick-mode)
-             (set-keymap-parent map (if (symbolp def)
-                                        (symbol-value def)
-                                      def))
-             (dolist (key sumkeys)
-               (when (setq def (key-binding key))
-                 (define-key keymap key def)))))
-         (with-temp-buffer
-           (setq major-mode 'gnus-article-mode)
-           (use-local-map keymap)
-           (describe-bindings))))
-    (if prefix
-       (let ((keymap (make-sparse-keymap))
-             (map (copy-keymap gnus-article-send-map))
-             smap agent)
-         (with-current-buffer gnus-article-current-summary
-           (setq smap (current-local-map)
-                 agent (if (boundp 'gnus-agent-summary-mode)
-                           'gnus-agent-summary-mode)))
-         (define-key keymap "S" map)
-         (define-key map [t] nil)
-         (set-keymap-parent keymap smap)
-         (with-temp-buffer
-           (use-local-map keymap)
-           (set (make-local-variable 'gnus-agent-summary-mode) agent)
-           (describe-bindings prefix)))
-      (let ((keymap (copy-keymap gnus-article-mode-map))
-           (map (copy-keymap gnus-article-send-map))
-           (sumkeys (where-is-internal 'gnus-article-read-summary-keys)))
-       (define-key keymap "S" map)
-       (define-key map [t] nil)
-       (with-current-buffer gnus-article-current-summary
-         (set-keymap-parent map (key-binding "S"))
-         (let (def gnus-pick-mode)
-           (dolist (key sumkeys)
-             (when (setq def (key-binding key))
-               (define-key keymap key def)))))
-       (with-temp-buffer
-         (use-local-map keymap)
-         (describe-bindings))))))
+  (let ((keymap (copy-keymap gnus-article-mode-map))
+       (map (copy-keymap gnus-article-send-map))
+       (sumkeys (where-is-internal 'gnus-article-read-summary-keys))
+       agent)
+    (define-key keymap "S" map)
+    (define-key map [t] nil)
+    (with-current-buffer gnus-article-current-summary
+      (set-keymap-parent map (key-binding "S"))
+      (let (def gnus-pick-mode)
+       (dolist (key sumkeys)
+         (when (setq def (key-binding key))
+           (define-key keymap key def))))
+      (when (boundp 'gnus-agent-summary-mode)
+       (setq agent gnus-agent-summary-mode)))
+    (with-temp-buffer
+      (use-local-map keymap)
+      (set (make-local-variable 'gnus-agent-summary-mode) agent)
+      (describe-bindings prefix))))
 
 (defun gnus-article-reply-with-original (&optional wide)
   "Start composing a reply mail to the current message.
index 05da0e4..4e0c276 100644 (file)
@@ -102,6 +102,8 @@ Possibly the `etc' directory has not been installed.")))
 (defvar gnus-mouse-2)
 (defvar standard-display-table)
 (defvar gnus-tree-minimize-window)
+;;`gnus-agent-mode' in gnus-agent.el will define it.
+(defvar gnus-agent-summary-mode)
 
 (defun gnus-xmas-highlight-selected-summary ()
   ;; Highlight selected article in summary buffer
@@ -345,6 +347,35 @@ call it with the value of the `gnus-data' text property."
               (event-to-character event))
          event)))
 
+(defun gnus-xmas-article-describe-bindings (&optional prefix)
+  "Show a list of all defined keys, and their definitions.
+The optional argument PREFIX, if non-nil, should be a key sequence;
+then we display only bindings that start with that prefix."
+  (interactive)
+  (gnus-article-check-buffer)
+  (let ((keymap (copy-keymap gnus-article-mode-map))
+       (map (copy-keymap gnus-article-send-map))
+       (sumkeys (where-is-internal 'gnus-article-read-summary-keys))
+       agent)
+    (define-key keymap "S" map)
+    (set-keymap-default-binding map nil)
+    (with-current-buffer gnus-article-current-summary
+      (let ((def (key-binding "S"))
+           gnus-pick-mode)
+       (set-keymap-parent map (if (symbolp def)
+                                  (symbol-value def)
+                                def))
+       (dolist (key sumkeys)
+         (when (setq def (key-binding key))
+           (define-key keymap key def))))
+      (when (boundp 'gnus-agent-summary-mode)
+       (setq agent gnus-agent-summary-mode)))
+    (with-temp-buffer
+      (setq major-mode 'gnus-article-mode)
+      (use-local-map keymap)
+      (set (make-local-variable 'gnus-agent-summary-mode) agent)
+      (describe-bindings prefix))))
+
 (defun gnus-xmas-define ()
   (setq gnus-mouse-2 [button2])
   (setq gnus-mouse-3 [button3])
@@ -440,6 +471,8 @@ FRONT-ADVANCE and REAR-ADVANCE are ignored."
   (defalias 'gnus-put-image 'gnus-xmas-put-image)
   (defalias 'gnus-create-image 'gnus-xmas-create-image)
   (defalias 'gnus-remove-image 'gnus-xmas-remove-image)
+  (defalias 'gnus-article-describe-bindings
+    'gnus-xmas-article-describe-bindings)
 
   ;; These ones are not defcutom'ed, sometimes not even defvar'ed. They
   ;; probably should. If that is done, the code below should then be moved
index 117fb84..e59759c 100644 (file)
                    show-trailing-whitespace temporary-file-directory
                    timer-list tool-bar-mode transient-mark-mode)))
   (maybe-fbind '(bbdb-complete-name
-                character-to-event delete-annotation delete-extent
-                device-connection dfw-device events-to-keys find-face
-                font-lock-set-defaults frame-device get-char-table
-                glyph-height glyph-width ldap-search-entries
+                delete-annotation delete-extent device-connection dfw-device
+                events-to-keys find-face font-lock-set-defaults frame-device
+                get-char-table glyph-height glyph-width ldap-search-entries
                 mail-aliases-setup make-annotation make-event make-glyph
-                map-extents map-keymap message-xmas-redefine put-char-table
+                map-extents message-xmas-redefine put-char-table
                 run-mode-hooks set-extent-property set-itimer-function
                 set-keymap-default-binding temp-directory
                 valid-image-instantiator-format-p