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

[mhc:01529] mhc-scan-month-hook



mhc-goto-next-monthをお手軽にしたいなぁとおもったので
overlayをつかってやってみました。
Mewをつかっている人向けで、 < や > を2連打すると月を移動できます。

━━━━━━━━━━━━━━ここから━━━━━━━━━━━━━━
;;.emacsなどに
(defun mhc-easy-navigation()
  (save-excursion
    (let* ((ov-keymap (make-sparse-keymap))
           (ov (make-overlay (point-min) (1+ (point-min)))))
      (overlay-put ov 'evaporate t)
      (set-keymap-parent ov-keymap (current-local-map))
      (define-key ov-keymap "<" 'mhc-goto-prev-month)
      (overlay-put ov 'local-map ov-keymap))
    (let* ((ov-keymap (make-sparse-keymap))
           (ov (make-overlay (point-max) (1- (point-max)))))
      (overlay-put ov 'evaporate t)
      (set-keymap-parent ov-keymap (current-local-map))
      (define-key ov-keymap ">" 'mhc-goto-next-month)
      (overlay-put ov 'local-map ov-keymap))))
(add-hook 'mhc-setup-hook
          (function
           (lambda ()
             (add-hook 'mhc-scan-month-hook 'mhc-easy-navigation))))
━━━━━━━━━━━━━━ここまで━━━━━━━━━━━━━━

━━━━━━━━━━━━━━ここから━━━━━━━━━━━━━━
Index: emacs/mhc.el
===================================================================
RCS file: /cvsroot/mhc/emacs/mhc.el,v
retrieving revision 1.65
diff -u -F^( -r1.65 mhc.el
--- emacs/mhc.el	2001/12/25 15:40:56	1.65
+++ emacs/mhc.el	2002/01/30 17:32:04
@@ -435,6 +435,10 @@ (defvar mhc-summary-buffer-current-date-
   "Indicate summary buffer's month. It is also used by mhc-summary-buffer-p")
 (make-variable-buffer-local 'mhc-summary-buffer-current-date-month)
 
+(defcustom mhc-scan-month-hook nil
+  "Run hook after mhc-scan-month."
+  :group 'mhc
+  :type 'hook)
 
 (defun mhc-scan-month (date mailer category-predicate secret)
   (let ((from  (mhc-date-mm-first date))
@@ -517,6 +521,7 @@ (defun mhc-scan-month (date mailer categ
       (setq mhc-summary-buffer-current-date-month
 	    (mhc-date-mm-first date))
       (mhc-goto-today t)
+      (run-hooks 'mhc-scan-month-hook)
       (message (mhc-date-format date "Scanning %04d/%02d ... done." yy mm)))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
━━━━━━━━━━━━━━ここまで━━━━━━━━━━━━━━

--
KOIE Hidetaka 鯉江英隆 <hide@xxxxxxxx>