;;; wl-xmas.el --- Wanderlust modules for XEmacsen.
-;; Copyright (C) 1998,1999,2000 Yuuichi Teranishi <teranisi@gohome.org>
-;; Copyright (C) 2000 Katsumi Yamaoka <yamaoka@jpl.org>
+;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003
+;; Yuuichi Teranishi <teranisi@gohome.org>
+;; Copyright (C) 2000, 2001, 2002, 2003 Katsumi Yamaoka <yamaoka@jpl.org>
;; Author: Yuuichi Teranishi <teranisi@gohome.org>
;; Katsumi Yamaoka <yamaoka@jpl.org>
wl-folder-prev-entity t "Previous Folder"]
[wl-folder-check-current-entity
wl-folder-check-current-entity t "Check Current Folder"]
-;;; [wl-draft
-;;; wl-draft t "Write a New Message"]
[wl-folder-sync-current-entity
wl-folder-sync-current-entity t "Sync Current Folder"]
[wl-draft
wl-draft t "Write a New Message"]
+ [wl-folder-goto-draft-folder
+ wl-folder-goto-draft-folder t "Go to Draft Folder"]
[wl-folder-empty-trash
wl-folder-empty-trash t "Empty Trash"]
[wl-exit
wl-summary-jump-to-current-message t "Jump to Current Message"]
[wl-summary-sync-force-update
wl-summary-sync-force-update t "Sync Current Folder"]
- [wl-summary-delete
- wl-summary-delete t "Delete Current Message"]
- [wl-summary-mark-as-important
- wl-summary-mark-as-important t "Mark Current Message as Important"]
+ [wl-summary-dispose
+ wl-summary-dispose t "Dispose Current Message"]
+ [wl-summary-set-flags
+ wl-summary-set-flags t "Set Flags"]
[wl-draft
- wl-draft t "Write a New Message"]
+ wl-summary-write-current-folder t "Write for Current Folder"]
[wl-summary-reply
wl-summary-reply t "Reply to Current Message" ]
[wl-summary-reply-with-citation
wl-draft-insert-signature t "Insert Signature"]
[wl-draft-kill
wl-draft-kill t "Kill Current Draft"]
+ [wl-draft-save-and-exit
+ wl-draft-save-and-exit t "Save Draft and Exit"]
)
"The Draft buffer toolbar.")
(defsubst wl-xmas-highlight-folder-group-line (glyph text-face numbers)
(let ((start (match-beginning 1))
(end (match-end 1)))
- (let (extent)
- (while (and (setq extent (extent-at start nil nil extent 'at))
- (not (and (eq start (extent-start-position extent))
- (eq end (extent-end-position extent))
- (extent-end-glyph extent)))))
- (unless extent
- (setq extent (make-extent start end)))
+ (let ((extent (or (map-extents
+ (lambda (extent maparg)
+ (and (eq start (extent-start-position extent))
+ (eq end (extent-end-position extent))
+ extent))
+ nil start start nil nil 'end-glyph)
+ (make-extent start end))))
(set-extent-properties extent `(end-open t start-closed t invisible t))
(set-extent-end-glyph
extent
(let (fld-name)
(cond
(;; opened folder group
- (looking-at wl-highlight-folder-opened-regexp)
+ (and (wl-folder-buffer-group-p)
+ (looking-at wl-highlight-folder-opened-regexp))
(wl-xmas-highlight-folder-group-line 'wl-folder-opened-glyph
'wl-highlight-folder-opened-face
numbers))
(;; closed folder group
- (looking-at wl-highlight-folder-closed-regexp)
+ (and (wl-folder-buffer-group-p)
+ (looking-at wl-highlight-folder-closed-regexp))
(wl-xmas-highlight-folder-group-line 'wl-folder-closed-glyph
'wl-highlight-folder-closed-face
numbers))
(get-text-property (point) 'wl-folder-entity-id)))
(looking-at "[ \t]+\\([^ \t]+\\)"))
(let ((start (match-beginning 1)))
- (let (extent)
- (while (and (setq extent (extent-at start nil nil extent 'at))
- (not (and (eq start (extent-start-position extent))
- (eq start (extent-end-position extent))
- (extent-begin-glyph extent)))))
- (unless extent
- (setq extent (make-extent start start)))
+ (let ((extent (or (map-extents
+ (lambda (extent maparg)
+ (and (eq start (extent-start-position extent))
+ (eq start (extent-end-position extent))
+ extent))
+ nil start start nil nil 'begin-glyph)
+ (make-extent start start))))
(let (type)
(set-extent-begin-glyph
extent
((string= fld-name wl-queue-folder);; queue folder
(get 'wl-folder-queue-glyph 'glyph))
(;; and one of many other folders
- (setq type (elmo-folder-type fld-name))
+ (setq type (or (elmo-folder-type fld-name)
+ (elmo-folder-type-internal
+ (elmo-make-folder fld-name))))
(get (intern (format "wl-folder-%s-glyph" type)) 'glyph))))))
(let ((end (point-at-eol)))
(when wl-use-highlight-mouse-line
(wl-folder-maildir-glyph . wl-maildir-folder-icon)
(wl-folder-nmz-glyph . wl-nmz-folder-icon)
(wl-folder-shimbun-glyph . wl-shimbun-folder-icon)
+ (wl-folder-file-glyph . wl-file-folder-icon)
(wl-folder-trash-empty-glyph . wl-empty-trash-folder-icon)
(wl-folder-draft-glyph . wl-draft-folder-icon)
(wl-folder-queue-glyph . wl-queue-folder-icon)
(defun wl-message-define-keymap ()
(let ((keymap (make-sparse-keymap)))
+ (define-key keymap "D" 'wl-message-delete-current-part)
(define-key keymap "l" 'wl-message-toggle-disp-summary)
+ (define-key keymap "\C-c:d" 'wl-message-decrypt-pgp-nonmime)
+ (define-key keymap "\C-c:v" 'wl-message-verify-pgp-nonmime)
+ (define-key keymap "w" 'wl-draft)
(define-key keymap 'button4 'wl-message-wheel-down)
(define-key keymap 'button5 'wl-message-wheel-up)
(define-key keymap [(shift button4)] 'wl-message-wheel-down)
(defun wl-message-wheel-up (event)
(interactive "e")
- (let ((cur-buf (current-buffer))
- proceed)
- (save-selected-window
- (select-window (event-window event))
- (set-buffer cur-buf)
- (setq proceed (wl-message-next-page)))
- (when proceed
- (if (memq 'shift (event-modifiers event))
- (wl-summary-down t)
- (wl-summary-next t)))))
+ (if (string-match (regexp-quote wl-message-buffer-name)
+ (regexp-quote (buffer-name)))
+ (wl-message-prev-page)
+ (let ((cur-buf (current-buffer))
+ proceed)
+ (save-selected-window
+ (select-window (event-window event))
+ (set-buffer cur-buf)
+ (setq proceed (wl-message-next-page)))
+ (when proceed
+ (if (memq 'shift (event-modifiers event))
+ (wl-summary-down t)
+ (wl-summary-next t))))))
(defun wl-message-wheel-down (event)
(interactive "e")
- (let ((cur-buf (current-buffer))
- proceed)
- (save-selected-window
- (select-window (event-window event))
- (set-buffer cur-buf)
- (setq proceed (wl-message-prev-page)))
- (when proceed
- (if (memq 'shift (event-modifiers event))
- (wl-summary-up t)
- (wl-summary-prev t)))))
+ (if (string-match (regexp-quote wl-message-buffer-name)
+ (regexp-quote (buffer-name)))
+ (wl-message-prev-page)
+ (let ((cur-buf (current-buffer))
+ proceed)
+ (save-selected-window
+ (select-window (event-window event))
+ (set-buffer cur-buf)
+ (setq proceed (wl-message-prev-page)))
+ (when proceed
+ (if (memq 'shift (event-modifiers event))
+ (wl-summary-up t)
+ (wl-summary-prev t))))))
(defun wl-draft-overload-menubar ()
(when (featurep 'menubar)
(add-menu-item '("Mail") "Send Message"
'wl-draft-send-and-exit t "Send and Exit")
(delete-menu-item '("Mail" "Send Mail"))
- (delete-menu-item '("Mail" "Send and Exit"))))
+ (delete-menu-item '("Mail" "Send and Exit"))
+ (add-menu-item '("Mail") "Preview Message"
+ 'wl-draft-preview-message t "Cancel")
+ (add-menu-item '("Mail") "Save Draft and Exit"
+ 'wl-draft-save-and-exit t "Cancel")
+ (add-menu-item '("Mail") "Kill Current Draft"
+ 'wl-draft-kill t "Cancel")
+ (delete-menu-item '("Mail" "Cancel"))))
(defun wl-draft-mode-setup ()
(require 'derived)
(define-key wl-draft-mode-map "\C-c\C-e" 'wl-draft-config-exec)
(define-key wl-draft-mode-map "\C-c\C-j" 'wl-template-select)
(define-key wl-draft-mode-map "\C-c\C-p" 'wl-draft-preview-message)
- (define-key wl-draft-mode-map "\C-x\C-s" 'wl-draft-save)
+;; (define-key wl-draft-mode-map "\C-x\C-s" 'wl-draft-save)
(define-key wl-draft-mode-map "\C-c\C-a" 'wl-addrmgr)
- (define-key wl-draft-mode-map "\C-xk" 'wl-draft-mimic-kill-buffer))
+ (define-key wl-draft-mode-map "\C-xk" 'wl-draft-mimic-kill-buffer)
+ (define-key wl-draft-mode-map "\C-c\C-d" 'wl-draft-elide-region)
+ (define-key wl-draft-mode-map "\C-a" 'wl-draft-beginning-of-line)
+ (define-key wl-draft-mode-map "\M-p" 'wl-draft-previous-history-element)
+ (define-key wl-draft-mode-map "\M-n" 'wl-draft-next-history-element))
(defun wl-draft-overload-functions ()
(wl-mode-line-buffer-identification)
(event-to-character event))
event)))
+(defun wl-completing-read-multiple (prompt
+ table
+ &optional predicate
+ require-match initial-input)
+ "Read multiple strings in the minibuffer"
+ (split-string (completing-read prompt table predicate require-match
+ initial-input) ","))
+
(require 'product)
(product-provide (provide 'wl-xmas) (require 'wl-version))