Jelajahi Sumber

Install w3m copying command in w3m-minor-mode-map.

Gnus uses w3m to wash HTML messages and installs w3m-minor-mode-map in
these buffers.  Therefore, this patch makes sure that the special copy
command that converts HTML links to Org-mode links also gets installed
into the minor mode map.

This is as yet untested.
Carsten Dominik 16 tahun lalu
induk
melakukan
bac235cb67
2 mengubah file dengan 14 tambahan dan 1 penghapusan
  1. 3 0
      lisp/ChangeLog
  2. 11 1
      lisp/org-w3m.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2008-12-03  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-w3m.el (w3m-minor-mode-hook): Also add the special copy
+	command to the `w3m-minor-mode-map'.
+
 	* org-archive.el (org-archive-to-archive-sibling): Protect
 	`this-command' to avoid appending kills during archiving.
 

+ 11 - 1
lisp/org-w3m.el

@@ -27,7 +27,8 @@
 
 ;; This file implements copying HTML content from a w3m buffer and
 ;; transfomring the text on the fly so that it can be pasted into
-;; an org-mode buffer with hot links.
+;; an org-mode buffer with hot links.  It will also work for regions
+;; in gnus buffers that have ben washed with w3m.
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;
@@ -141,11 +142,20 @@ Otherwise, return nil."
 	   (keymapp w3m-mode-map))
   (define-key w3m-mode-map "\C-c\C-x\M-w" 'org-w3m-copy-for-org-mode)
   (define-key w3m-mode-map "\C-c\C-x\C-w" 'org-w3m-copy-for-org-mode))
+(when (and (boundp 'w3m-minor-mode-map)
+	   (keymapp w3m-minor-mode-map))
+  (define-key w3m-minor-mode-map "\C-c\C-x\M-w" 'org-w3m-copy-for-org-mode)
+  (define-key w3m-minor-mode-map "\C-c\C-x\C-w" 'org-w3m-copy-for-org-mode))
 (add-hook
  'w3m-mode-hook
  (lambda ()
    (define-key w3m-mode-map "\C-c\C-x\M-w" 'org-w3m-copy-for-org-mode)
    (define-key w3m-mode-map "\C-c\C-x\C-w" 'org-w3m-copy-for-org-mode)))
+(add-hook
+ 'w3m-minor-mode-hook
+ (lambda ()
+   (define-key w3m-minor-mode-map "\C-c\C-x\M-w" 'org-w3m-copy-for-org-mode)
+   (define-key w3m-minor-mode-map "\C-c\C-x\C-w" 'org-w3m-copy-for-org-mode)))
 
 (provide 'org-w3m)