[Mew-dist 12345] little patch for mew-addrbook.el

Ninomiya Hideyuki nin at example.com
2000年 2月 12日 (土) 22:08:16 JST


こんばんは	二宮@お四国 です

ほんの箸休めでこんなもんを作ってみました。
今までこんな要望は出てなかったので、もしかすると必要無い事かも知んない
ですがっ.....

自分はこういうのが欲しかったのです。
良く、Message buffer を参照したくなるんです、Addrbook 登録のさなかに..

コードは正直いって、汚いと思います。
mew-addrbook-buffer-disp-msg なんて変数勝手に作っちゃいましたが、
これ、buffer local とかにした方が良いかも知れません。

# これ当ててみておかしくなったって言われても自分には責任持てませんので、
# その点御了承下さい。elisp まだ良く解ってない自分
---
ICQ UIN:57442553                        二宮 秀幸@愛媛 鬼北 広見町
PGP-Fingerprint:6C59 EC08 5B23 6490 44D0  7CD3 DA40 219F 7114 8553
PGP-Public-Key:  http://user.shikoku.ne.jp/~nin/pgp/public-key.txt
mailto:nin at example.com http://user.shikoku.ne.jp/~nin/index.html
-------------- next part --------------
Index: mew-addrbook.el
===================================================================
RCS file: /tmp/am/pd/CVSROOT/mew/mew-addrbook.el,v
retrieving revision 0.0.0.1
retrieving revision 0.0.0.1.4.1
diff -u -r0.0.0.1 -r0.0.0.1.4.1
--- mew-addrbook.el	2000/02/04 06:40:15	0.0.0.1
+++ mew-addrbook.el	2000/02/12 12:34:24	0.0.0.1.4.1
@@ -21,6 +21,7 @@
     ()
   (setq mew-addrbook-mode-map (make-sparse-keymap))
   (mew-set-keymap-parent mew-addrbook-mode-map text-mode-map)
+  (define-key mew-addrbook-mode-map "\C-c\C-v" 'mew-addrbook-toggle-disp-msg)
   (define-key mew-addrbook-mode-map "\C-c\C-c" 'mew-addrbook-register)
   (define-key mew-addrbook-mode-map "\C-c\C-q" 'mew-addrbook-kill))
 
@@ -308,7 +309,9 @@
 executed with '\\[universal-argument]', it will add personal information.  Otherwise,
 it will add an alias."
   (interactive "P")
+  (mew-window-push)
   (mew-summary-display nil)
+  (setq mew-addrbook-buffer-disp-msg nil)
   (let ((buf (mew-buffer-message))
 	from shortname addrs name)
     (save-excursion
@@ -348,8 +351,11 @@
   (delete-other-windows)
   (switch-to-buffer (get-buffer-create mew-buffer-addrbook))
   (mew-erase-buffer)
-  (insert "#If you want to register this entry, type "
+  (insert "#If you want to toggle display Message buffer\n#\t\t\tin another window, type "
 	  (substitute-command-keys
+	   "'\\<mew-addrbook-mode-map>\\[mew-addrbook-toggle-disp-msg]'.\n")
+	  "#If you want to register this entry, type "
+	  (substitute-command-keys
 	   "'\\<mew-addrbook-mode-map>\\[mew-addrbook-register]'.\n")
 	  "#If you want to NOT register this entry, type "
 	  (substitute-command-keys
@@ -381,6 +387,7 @@
 Mew Addrbook mode:: major mode to resistor Addrbook.
 The keys that are defined for this mode are:
 
+\\[mew-addrbook-toggle-disp-msg]	Toggle display Message buffer in another window.
 \\[mew-addrbook-register]	Register information in Addrbook mode to Addrbook.
 \\[mew-addrbook-kill]	Kill Addrbook mode.
 "
@@ -392,6 +399,18 @@
   (run-hooks 'mew-addrbook-mode-hook)
   (setq buffer-undo-list nil))
 
+(defun mew-addrbook-toggle-disp-msg ()
+  "Toggle display Message buffer in another window."
+  (interactive)
+  (let* ((prev pop-up-windows))
+    (setq pop-up-windows t)
+    (if mew-addrbook-buffer-disp-msg
+	(delete-other-windows) ; now on to off
+      (pop-to-buffer (mew-buffer-message)) ; now off to on
+      (other-window -1))
+    (setq pop-up-windows prev))
+  (setq mew-addrbook-buffer-disp-msg (not mew-addrbook-buffer-disp-msg)))
+
 (defun mew-addrbook-register ()
   "Register information in Addrbook mode to Addrbook."
   (interactive)
@@ -469,7 +488,8 @@
   "Kill Addrbook mode."
   (interactive "P")
   (kill-buffer (current-buffer))
-  (or no-msg (message "Not registered.")))
+  (or no-msg (message "Not registered."))
+  (mew-window-pop))
 
 (provide 'mew-addrbook)
 


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