From 9c83baad4685fa96cf7f6f4cc126f4cd79a16742 Mon Sep 17 00:00:00 2001 From: kaoru Date: Sat, 2 Jan 2010 12:03:42 +0000 Subject: [PATCH] * wl-folder.el (wl-folder-get-entity-from-buffer): Macro to function. * wl-util.el (wl-match-string, wl-match-buffer): Macro to function. * wl-summary.el (wl-summary-message-status): Macro to inline-function. * wl.el (wl-plugged-string): Macro to function. --- wl/ChangeLog | 5 +++++ wl/wl-folder.el | 12 ++++++------ wl/wl-summary.el | 6 +++--- wl/wl-util.el | 10 +++++----- wl/wl.el | 11 ++++++----- 5 files changed, 25 insertions(+), 19 deletions(-) diff --git a/wl/ChangeLog b/wl/ChangeLog index 0dc565b..0f907f9 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -8,6 +8,11 @@ inline-function. * wl-folder.el (wl-folder-unread-regex, wl-folder-buffer-group-p): Macro to function. + (wl-folder-get-entity-from-buffer): Macro to function. + * wl-util.el (wl-match-string, wl-match-buffer): Macro to function. + * wl-summary.el (wl-summary-message-status): Macro to inline-function. + * wl.el (wl-plugged-string): Macro to function. + * wl-highlight.el (wl-delete-all-overlays): Macro to function. * wl-summary.el (wl-summary-get-alike): Macro to inline-function. (wl-summary-buffer-folder-name, wl-summary-sticky-buffer-name): diff --git a/wl/wl-folder.el b/wl/wl-folder.el index 5912b89..ddce576 100644 --- a/wl/wl-folder.el +++ b/wl/wl-folder.el @@ -273,12 +273,12 @@ (defmacro wl-folder-get-entity-id (entity) `(get-text-property 0 'wl-folder-entity-id ,entity)) -(defmacro wl-folder-get-entity-from-buffer (&optional getid) - `(let ((id (get-text-property (point) - 'wl-folder-entity-id))) - (if ,getid - id - (wl-folder-get-folder-name-by-id id)))) +(defun wl-folder-get-entity-from-buffer (&optional getid) + (let ((id (get-text-property (point) + 'wl-folder-entity-id))) + (if getid + id + (wl-folder-get-folder-name-by-id id)))) (defmacro wl-folder-entity-exists-p (entity &optional hashtb) `(let ((sym (intern-soft ,entity (or ,hashtb wl-folder-entity-hashtb)))) diff --git a/wl/wl-summary.el b/wl/wl-summary.el index fd034bb..5c89489 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -605,9 +605,9 @@ See also variable `wl-use-petname'." (setq wl-summary-buffer-message-ring (cdr wl-summary-buffer-message-ring))))) -(defmacro wl-summary-message-status (&optional number) - `(elmo-message-status wl-summary-buffer-elmo-folder - (or ,number (wl-summary-message-number)))) +(defsubst wl-summary-message-status (&optional number) + (elmo-message-status wl-summary-buffer-elmo-folder + (or number (wl-summary-message-number)))) (defun wl-summary-update-mark-and-highlight-window (&optional win beg) "A function to be called as window-scroll-functions." diff --git a/wl/wl-util.el b/wl/wl-util.el index d87afc4..5267d84 100644 --- a/wl/wl-util.el +++ b/wl/wl-util.el @@ -241,14 +241,14 @@ even when invalid character is contained." (setq alist (cdr alist))) value))) -(defmacro wl-match-string (pos string) +(defun wl-match-string (pos string) "Substring POSth matched STRING." - `(substring ,string (match-beginning ,pos) (match-end ,pos))) + (substring string (match-beginning pos) (match-end pos))) -(defmacro wl-match-buffer (pos) +(defun wl-match-buffer (pos) "Substring POSth matched from the current buffer." - `(buffer-substring-no-properties - (match-beginning ,pos) (match-end ,pos))) + (buffer-substring-no-properties + (match-beginning pos) (match-end pos))) (put 'wl-as-coding-system 'lisp-indent-function 1) (put 'wl-as-mime-charset 'lisp-indent-function 1) diff --git a/wl/wl.el b/wl/wl.el index a25bce4..250c80c 100644 --- a/wl/wl.el +++ b/wl/wl.el @@ -215,11 +215,12 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'." (setq buffer-read-only t) (run-hooks 'wl-plugged-mode-hook)) -(defmacro wl-plugged-string (plugged &optional time) - `(if ,time wl-plugged-auto-off - (if ,plugged - wl-plugged-plug-on - wl-plugged-plug-off))) +(defun wl-plugged-string (plugged &optional time) + (if time + wl-plugged-auto-off + (if plugged + wl-plugged-plug-on + wl-plugged-plug-off))) (defun wl-plugged-server-indent () (make-string wl-plugged-server-indent (string-to-char " "))) -- 1.7.10.4