X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=wl%2Fwl-template.el;h=0129e5a0b865ec3a17ea7ea0f668d9022e8259ee;hb=8b003dd16e3d4a1f0d29b5fcd0f57a2ee294f967;hp=78d49f5389b951c4624d3b38981cf4ad4d9362e0;hpb=1e366a559be4aec4ad4d3cf3e954b8e62a20d2f3;p=elisp%2Fwanderlust.git diff --git a/wl/wl-template.el b/wl/wl-template.el index 78d49f5..0129e5a 100644 --- a/wl/wl-template.el +++ b/wl/wl-template.el @@ -1,11 +1,10 @@ ;;; wl-template.el -- Draft template feature for Wanderlust. -;; Copyright 1998,1999,2000 Masahiro MURATA -;; Yuuichi Teranishi +;; Copyright (C) 1998,1999,2000 Masahiro MURATA +;; Copyright (C) 1998,1999,2000 Yuuichi Teranishi ;; Author: Masahiro MURATA ;; Keywords: mail, net news -;; Time-stamp: <2000-03-03 13:18:35 teranisi> ;; This file is part of Wanderlust (Yet Another Message Interface on Emacsen). @@ -53,6 +52,7 @@ (define-key wl-template-mode-map "\n" 'wl-template-set)) (defun wl-template-apply (name) + "Apply NAME template to draft." (let (template) (when name (if (string= name "") @@ -86,6 +86,7 @@ Enterring WL-Template mode calls the value of `wl-template-mode-hook'." (run-hooks 'wl-template-mode-hook)) (defun wl-template-select () + "Select template from `wl-template-alist'." (interactive) (if (not wl-template-visible-select) (wl-template-apply @@ -121,7 +122,8 @@ Enterring WL-Template mode calls the value of `wl-template-mode-hook'." (wl-template-show)))) (defun wl-template-show (&optional arg) - "Show reference INDEX in wl-template-alist." + "Show reference INDEX in `wl-template-alist'. +ARG is ignored." ; ARG ignored this version (?) (save-excursion (set-buffer wl-template-buffer-name) (let ((buffer-read-only nil) @@ -132,25 +134,24 @@ Enterring WL-Template mode calls the value of `wl-template-mode-hook'." (setq wl-template (car (nth wl-template-cur-num wl-template-alist))) mail-header-separator) (wl-highlight-message (point-min) (point-max) t) - (and wl-highlight-x-face-func - (funcall - wl-highlight-x-face-func - (point-min) (re-search-forward mail-header-separator nil t))) + (when wl-highlight-x-face-function + (funcall wl-highlight-x-face-function + (point-min) (re-search-forward mail-header-separator nil t))) (setq mode-line-process (concat ":" wl-template)) (set-buffer-modified-p nil)))) (defun wl-template-next () "Display next reference in other buffer." (interactive) - (if (eq wl-template-max-num - (setq wl-template-cur-num (1+ wl-template-cur-num))) + (if (= wl-template-max-num + (setq wl-template-cur-num (1+ wl-template-cur-num))) (setq wl-template-cur-num 0)) (wl-template-show)) (defun wl-template-prev () "Display previous reference in other buffer." (interactive) - (setq wl-template-cur-num (if (eq wl-template-cur-num 0) + (setq wl-template-cur-num (if (zerop wl-template-cur-num) (1- wl-template-max-num) (1- wl-template-cur-num))) (wl-template-show)) @@ -181,6 +182,8 @@ Enterring WL-Template mode calls the value of `wl-template-mode-hook'." (if win (select-window win)))))) (defun wl-template-insert (name &optional mail-header) + "Insert NAME template. +Set header-separator is MAIL-HEADER." (let ((template (cdr (assoc name wl-template-alist))) (mail-header-separator (or mail-header mail-header-separator))) @@ -189,6 +192,7 @@ Enterring WL-Template mode calls the value of `wl-template-mode-hook'." (insert mail-header-separator "\n")) (wl-draft-config-exec-sub template)))) -(provide 'wl-template) +(require 'product) +(product-provide (provide 'wl-template) (require 'wl-version)) ;;; wl-template.el ends here