[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: M in emacs-w3m in gnus



>>>>> In [emacs-w3m : No.11090] jidanni@xxxxxxxxxxx wrote:
> Hmmm, in gnus I can use
> u runs the command w3m-print-this-url, which is an interactive
> However,
> M runs the command w3m-view-url-with-external-browser,
> is masked by gnus commands... I thought,

The key bindings in the article that emacs-w3m rendered are
controlled by `w3m-minor-mode-map', so you can add something
like the following to the ~/.emacs-w3m.el file:

(define-key w3m-minor-mode-map "M" 'w3m-view-url-with-external-browser)

I think this binding is not very useful though.

> until I hit M C-h, to see
> Global Bindings Starting With M:
> key             binding
> ---             -------

> [back]
> I.e., nothing. Hmmm.

That's a bug.  `A C-h', `V C-h', `/ C-h' don't show the bindings,
too.  I'm going to test the attached patch thoroughly and commit
to the trunk.  Thanks.
--- gnus-art.el~	2009-10-25 23:20:01 +0000
+++ gnus-art.el	2010-01-05 11:13:07 +0000
@@ -6477,10 +6477,17 @@
   (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 draft)
+	parent agent draft)
     (define-key keymap "S" map)
     (define-key map [t] nil)
     (with-current-buffer gnus-article-current-summary
+      (set-keymap-parent
+       keymap
+       (if (setq parent (keymap-parent gnus-article-mode-map))
+	   (prog1
+	       (setq parent (copy-keymap parent))
+	     (set-keymap-parent parent (current-local-map)))
+	 (current-local-map)))
       (set-keymap-parent map (key-binding "S"))
       (let (key def gnus-pick-mode)
 	(while sumkeys
--- gnus-xmas.el~	2009-10-16 06:47:34 +0000
+++ gnus-xmas.el	2010-01-05 11:13:07 +0000
@@ -362,10 +362,17 @@
   (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 draft)
+	parent agent draft)
     (define-key keymap "S" map)
     (set-keymap-default-binding map nil)
     (with-current-buffer gnus-article-current-summary
+      (set-keymap-parent
+       keymap
+       (if (setq parent (keymap-parent gnus-article-mode-map))
+	   (prog1
+	       (setq parent (copy-keymap parent))
+	     (set-keymap-parent parent (current-local-map)))
+	 (current-local-map)))
       (let ((def (key-binding "S"))
 	    gnus-pick-mode)
 	(set-keymap-parent map (if (symbolp def)