(require 'bytecomp)
(require 'elmo-util)
(require 'elmo-flag)
+(require 'wl-vars)
+(eval-when-compile (require 'elmo-pop3))
+(eval-when-compile (require 'cl))
+(eval-when-compile (require 'static))
(condition-case nil (require 'pp) (error nil))
(string-to-char (format "%s" (this-command-keys))))))
(message "%s" mes-string)
(setq key (car (setq keve (wl-read-event-char))))
- (if (or (equal key ?\ )
+ (if (or (equal key (string-to-char " "))
(and cmd
(equal key cmd)))
(progn
(or (string= name wl-draft-folder)
(string= name wl-queue-folder)))
-;(defalias 'wl-make-hash 'elmo-make-hash)
-;;(make-obsolete 'wl-make-hash 'elmo-make-hash)
+;;;(defalias 'wl-make-hash 'elmo-make-hash)
+;;;(make-obsolete 'wl-make-hash 'elmo-make-hash)
-;;(defalias 'wl-get-hash-val 'elmo-get-hash-val)
-;;(make-obsolete 'wl-get-hash-val 'elmo-get-hash-val)
+;;;(defalias 'wl-get-hash-val 'elmo-get-hash-val)
+;;;(make-obsolete 'wl-get-hash-val 'elmo-get-hash-val)
-;;(defalias 'wl-set-hash-val 'elmo-set-hash-val)
-;;(make-obsolete 'wl-set-hash-val 'elmo-set-hash-val)
+;;;(defalias 'wl-set-hash-val 'elmo-set-hash-val)
+;;;(make-obsolete 'wl-set-hash-val 'elmo-set-hash-val)
(defsubst wl-set-string-width (width string &optional padding ignore-invalid)
"Make a new string which have specified WIDTH and content of STRING.
(abs width))))
(let ((paddings (make-string
(max 0 (- (abs width) (string-width string)))
- (or padding ?\ ))))
+ (or padding (string-to-char " ")))))
(if (< width 0)
(concat paddings string)
(concat string paddings)))))
(if (= (current-column) (abs width))
string
(let ((paddings (make-string (- (abs width) (current-column))
- (or padding ?\ ))))
+ (or padding (string-to-char " ")))))
(if (< width 0)
(concat paddings string)
(concat string paddings))))))))
(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)
(cond
(wl-on-mule3
(defmacro wl-as-coding-system (coding-system &rest body)
- (` (let ((coding-system-for-read (, coding-system))
- (coding-system-for-write (, coding-system)))
- (,@ body)))))
+ `(let ((coding-system-for-read ,coding-system)
+ (coding-system-for-write ,coding-system))
+ ,@body)))
(wl-on-mule
(defmacro wl-as-coding-system (coding-system &rest body)
- (` (let ((file-coding-system-for-read (, coding-system))
- (file-coding-system (, coding-system)))
- (,@ body)))))
+ `(let ((file-coding-system-for-read ,coding-system)
+ (file-coding-system ,coding-system))
+ ,@body)))
(t
(defmacro wl-as-coding-system (coding-system &rest body)
- (` (progn (,@ body)))))))
+ `(progn ,@body)))))
(defmacro wl-as-mime-charset (mime-charset &rest body)
- (` (wl-as-coding-system (mime-charset-to-coding-system (, mime-charset))
- (,@ body))))
+ `(wl-as-coding-system (mime-charset-to-coding-system ,mime-charset)
+ ,@body))
(defalias 'wl-string 'elmo-string)
(make-obsolete 'wl-string 'elmo-string)
(setq keys (cdr keys)))
result))
-(eval-when-compile
- (require 'static))
(static-unless (fboundp 'pp)
(defvar pp-escape-newlines t)
(defun pp (object &optional stream)
(setq fld-name nil))
(if (eq (length (setq port
(elmo-match-string 2 url))) 0)
- (setq port (int-to-string elmo-nntp-default-port)))
+ (setq port (number-to-string elmo-nntp-default-port)))
(if (eq (length (setq server
(elmo-match-string 1 url))) 0)
(setq server elmo-nntp-default-server))
(message "Not a nntp: url."))))
(defmacro wl-concat-list (list separator)
- (` (mapconcat 'identity (delete "" (delq nil (, list))) (, separator))))
+ `(mapconcat 'identity (delete "" (delq nil ,list)) ,separator))
(defun wl-current-message-buffer ()
(when (buffer-live-p wl-current-summary-buffer)
wl-summary-buffer-display-mime-mode
nil nil))))))
-(defmacro wl-kill-buffers (regexp)
- (` (mapcar (function
- (lambda (x)
- (if (and (buffer-name x)
- (string-match (, regexp) (buffer-name x)))
- (and (get-buffer x)
- (kill-buffer x)))))
- (buffer-list))))
+(defun wl-kill-buffers (regexp)
+ (mapc
+ (lambda (x)
+ (if (and (buffer-name x)
+ (string-match regexp (buffer-name x)))
+ (and (get-buffer x)
+ (kill-buffer x))))
+ (buffer-list)))
(defun wl-collect-summary ()
(let (result)
- (mapcar
- (function (lambda (x)
- (if (and (string-match "^Summary"
- (buffer-name x))
- (save-excursion
- (set-buffer x)
- (equal major-mode 'wl-summary-mode)))
- (setq result (nconc result (list x))))))
+ (mapc
+ (lambda (x)
+ (if (and (string-match "^Summary"
+ (buffer-name x))
+ (with-current-buffer x
+ (eq major-mode 'wl-summary-mode)))
+ (setq result (nconc result (list x)))))
(buffer-list))
result))
(static-if (fboundp 'local-variable-p)
(defalias 'wl-local-variable-p 'local-variable-p)
(defmacro wl-local-variable-p (symbol &optional buffer)
- (` (if (assq (, symbol) (buffer-local-variables (, buffer)))
- t))))
+ `(if (assq ,symbol (buffer-local-variables ,buffer))
+ t)))
(defun wl-number-base36 (num len)
(if (if (< len 0)
("Jul" . "07") ("Aug" . "08")
("Sep" . "09") ("Oct" . "10")
("Nov" . "11") ("Dec" . "12"))))))
- (list (string-to-int (concat (nth 6 cts) m
- (substring (nth 2 cts) 0 1)))
- (string-to-int (concat (substring (nth 2 cts) 1)
- (nth 4 cts) (nth 5 cts)
- (nth 6 cts))))))))
+ (list (string-to-number (concat (nth 6 cts) m
+ (substring (nth 2 cts) 0 1)))
+ (string-to-number (concat (substring (nth 2 cts) 1)
+ (nth 4 cts) (nth 5 cts)
+ (nth 6 cts))))))))
(concat
(if (memq system-type '(ms-dos emx vax-vms))
(let ((user (downcase (user-login-name))))
;;;
-(defmacro wl-count-lines ()
- (` (save-excursion
- (beginning-of-line)
- (count-lines 1 (point)))))
+(defsubst wl-count-lines ()
+ (count-lines 1 (point-at-bol)))
(defun wl-horizontal-recenter ()
"Recenter the current buffer horizontally."
(while flist
(setq folder (wl-folder-get-elmo-folder (car flist))
flist (cdr flist))
+ (elmo-folder-set-biff-internal folder t)
(when (and (elmo-folder-plugged-p folder)
(elmo-folder-exists-p folder))
(setq new-mails
(append (list 'format f) specs)))
(defmacro wl-line-formatter-setup (formatter format alist)
- (` (let (byte-compile-warnings)
- (setq (, formatter)
- (byte-compile
- (list 'lambda ()
- (wl-line-parse-format (, format) (, alist)))))
- (when (get-buffer "*Compile-Log*")
- (bury-buffer "*Compile-Log*"))
- (when (get-buffer "*Compile-Log-Show*")
- (bury-buffer "*Compile-Log-Show*")))))
+ `(let (byte-compile-warnings)
+ (setq ,formatter
+ (byte-compile
+ (list 'lambda ()
+ (wl-line-parse-format ,format ,alist))))
+ (when (get-buffer "*Compile-Log*")
+ (bury-buffer "*Compile-Log*"))
+ (when (get-buffer "*Compile-Log-Show*")
+ (bury-buffer "*Compile-Log-Show*"))))
(defsubst wl-copy-local-variables (src dst local-variables)
"Copy value of LOCAL-VARIABLES from SRC buffer to DST buffer."
(let ((default (format-time-string "%Y-%m-%d")))
(setq value (completing-read
(format "Value for '%s' [%s]: " field default)
- (mapcar (function
- (lambda (x)
- (list (format "%s" (car x)))))
- elmo-date-descriptions)))
+ (mapcar
+ (lambda (x)
+ (list (format "%s" (car x))))
+ elmo-date-descriptions)))
(concat (downcase field) ":"
(if (equal value "") default value))))
((string-match "!?Flag" field)
(cdr (wl-read-event-char prompt)))
((?y ?Y)
(throw 'done t))
- (?\
+ ((string-to-char " ")
(if scroll-by-SPC
(ignore-errors (scroll-up))
(throw 'done t)))