[Mew-dist 05448] Re: mew-draft-{mode|body}-map (Re: Re: 1.93b45)

SAKAI Kiyotaka ksakai at example.com
1998年 7月 8日 (水) 11:59:27 JST


>> In article <19980707180656X.mmurata at example.com>, Masahiro MURATA (村田全寛) <muse at example.com> writes:

>   body 部でキーを定義したい場合は,以下のようにすれば Emacs のバージョン
> を気にする必要がなくなると思います。

> (defmacro my-draft-body-map ()
>   (` (if mew-use-overlay-keymap
> 	 mew-draft-mode-map
>        mew-draft-body-map)))

> (define-key (my-draft-body-map) "\C-c\t"	'insert-signature-eref)

これを見てふと思ったのですが、mew-use-overlay-keymap が t の場合は以下
のように keymap の継承を利用すれば、mew-draft-body-map が共通に定義で
きていいのではないでしょうか。
-- 
酒井 清隆 (E-mail: ksakai at example.com)


Index: mew-draft.el
===================================================================
RCS file: /home/cvsroot/mew-1.93b45/mew-draft.el,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 mew-draft.el
--- mew-draft.el	1998/07/06 01:10:15	1.1.1.1
+++ mew-draft.el	1998/07/08 02:33:32
@@ -13,6 +13,7 @@
 
 (defvar mew-draft-mode-map   nil)
 (defvar mew-draft-header-map nil)
+(defvar mew-draft-body-map   nil)
 
 (defvar mew-draft-mode-syntax-table nil
   "*Syntax table used while in mew letter mode.")
@@ -138,23 +139,26 @@
     (define-key (symbol-value symmap) "\C-c\C-b" 'mew-pgp-sign-encrypt-letter)
     (define-key (symbol-value symmap) "\C-x\C-s" 'mew-save-buffer)
     )
-  (if mew-draft-mode-map
+  (if mew-draft-body-map
       ()
-    (setq mew-draft-mode-map (make-sparse-keymap))
-    (define-key mew-draft-mode-map "\C-c\t"   'mew-draft-insert-signature)
-    (define-key mew-draft-mode-map "\C-c\C-y" 'mew-draft-cite)
-    (define-key mew-draft-mode-map "\C-c\C-t" 'mew-draft-yank)
-    (define-key mew-draft-mode-map "\C-c\C-f" 'mew-fib-fill-default)
-    (define-key mew-draft-mode-map "\C-c\C-k" 'mew-fib-delete-frame)
-    (define-key mew-draft-mode-map "\C-c\C-n" 'mew-fib-next-item)
-    (define-key mew-draft-mode-map "\C-c\C-p" 'mew-fib-previous-item)
-    (define-key mew-draft-mode-map "\C-c\C-z" 'mew-fib-flush-input)
-    (mew-draft-share-keymap 'mew-draft-mode-map)
+    (setq mew-draft-body-map (make-sparse-keymap))
+    (define-key mew-draft-body-map "\C-c\t"   'mew-draft-insert-signature)
+    (define-key mew-draft-body-map "\C-c\C-y" 'mew-draft-cite)
+    (define-key mew-draft-body-map "\C-c\C-t" 'mew-draft-yank)
+    (define-key mew-draft-body-map "\C-c\C-f" 'mew-fib-fill-default)
+    (define-key mew-draft-body-map "\C-c\C-k" 'mew-fib-delete-frame)
+    (define-key mew-draft-body-map "\C-c\C-n" 'mew-fib-next-item)
+    (define-key mew-draft-body-map "\C-c\C-p" 'mew-fib-previous-item)
+    (define-key mew-draft-body-map "\C-c\C-z" 'mew-fib-flush-input)
+    (mew-draft-share-keymap 'mew-draft-body-map)
     )
   (mew-draft-share-keymap 'mew-draft-header-map)
+  (if mew-draft-mode-map
+      ()
+    (setq mew-draft-mode-map (make-sparse-keymap))
+    (set-keymap-parent mew-draft-mode-map mew-draft-body-map))
   )
  (t
-  (defvar mew-draft-body-map nil)
   (defun mew-draft-keyswitch ()
     "A function to implement region key binding."
     (interactive)



Mew-dist メーリングリストの案内