* elmo-spam.el (elmo-spam-scheme): Add 'sa' as a candidate.
[elisp/wanderlust.git] / wl / wl-util.el
index 19885ae..b40d735 100644 (file)
@@ -274,7 +274,7 @@ even when invalid character is contained."
                     (setq value (append value (list (cdr pair)))))
                    ((eq match 'all-list)
                     (setq value (append value (cdr pair))))
-                   ((not match)
+                   ((or (not match) (eq match 'function))
                     (throw 'found (cdr pair))))))
        (setq alist (cdr alist)))
       value)))
@@ -314,14 +314,6 @@ even when invalid character is contained."
 (defalias 'wl-string 'elmo-string)
 (make-obsolete 'wl-string 'elmo-string)
 
-;; Check if active region exists or not.
-(if (boundp 'mark-active)
-    (defmacro wl-region-exists-p ()
-      'mark-active)
-  (if (fboundp 'region-exists-p)
-      (defmacro wl-region-exists-p ()
-       (list 'region-exists-p))))
-
 (if (not (fboundp 'overlays-in))
     (defun overlays-in (beg end)
       "Return a list of the overlays that overlap the region BEG ... END.
@@ -540,8 +532,7 @@ that `read' can handle, whenever this is possible."
               folder nil nil nil t)
            (wl-summary-goto-folder-subr
             folder 'update nil nil t)
-           (goto-char (point-min))
-           (re-search-forward (concat "^ *" msg) nil t)
+           (wl-summary-jump-to-msg (string-to-number msg))
            (wl-summary-redisplay)))
       (message "Not a nntp: url."))))
 
@@ -551,9 +542,11 @@ that `read' can handle, whenever this is possible."
 (defun wl-current-message-buffer ()
   (when (buffer-live-p wl-current-summary-buffer)
     (with-current-buffer wl-current-summary-buffer
-      (car (wl-message-buffer-display wl-summary-buffer-elmo-folder
-                                     (wl-summary-message-number)
-                                     'mime)))))
+      (or wl-message-buffer
+         (and (wl-summary-message-number)
+              (car (wl-message-buffer-display wl-summary-buffer-elmo-folder
+                                              (wl-summary-message-number)
+                                              'mime)))))))
 
 (defmacro wl-kill-buffers (regexp)
   (` (mapcar (function
@@ -915,9 +908,14 @@ is enclosed by at least one regexp grouping construct."
 (defun wl-region-exists-p ()
   "Return non-nil if a region exists on current buffer."
   (static-if (featurep 'xemacs)
-      (and zmacs-regions zmacs-region-active-p)
+      (region-active-p)
     (and transient-mark-mode mark-active)))
 
+(defun wl-deactivate-region ()
+  "Deactivate region on current buffer"
+  (static-if (not (featurep 'xemacs))
+      (setq mark-active nil)))
+
 (defvar wl-line-string)
 (defun wl-line-parse-format (format spec-alist)
   "Make a formatter from FORMAT and SPEC-ALIST."