Add 2010 to copyright years.
[bpt/emacs.git] / lisp / mh-e / mh-seq.el
index a5732d0..f8ea12f 100644 (file)
@@ -1,7 +1,8 @@
 ;;; mh-seq.el --- MH-E sequences support
 
 ;; Copyright (C) 1993, 1995,
-;;  2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+;;   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+;;   Free Software Foundation, Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -21,9 +22,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
 
 ;;; Macros
 
-(defmacro mh-make-seq (name msgs)
+(defsubst mh-make-seq (name msgs)
   "Create sequence NAME with the given MSGS."
-  (list 'cons name msgs))
+  (cons name msgs))
 
-(defmacro mh-seq-name (sequence)
+(defsubst mh-seq-name (sequence)
   "Extract sequence name from the given SEQUENCE."
-  (list 'car sequence))
+  (car sequence))
 
 \f
 
@@ -134,7 +133,7 @@ you want to delete the messages, use \"\\[universal-argument]
       (apply #'mh-speed-flists t folders-changed))))
 
 ;; Shush compiler.
-(eval-when-compile (defvar view-exit-action))
+(defvar view-exit-action)
 
 ;;;###mh-autoload
 (defun mh-list-sequences ()
@@ -147,8 +146,7 @@ The list appears in a buffer named \"*MH-E Sequences*\"."
         (seq-list mh-seq-list)
         (max-len 0))
     (with-output-to-temp-buffer temp-buffer
-      (save-excursion
-        (set-buffer temp-buffer)
+      (with-current-buffer temp-buffer
         (erase-buffer)
         (message "Listing sequences ...")
         (insert "Sequences in folder " folder ":\n")
@@ -202,7 +200,8 @@ MESSAGE appears."
                         " "))))
 
 ;; Shush compiler.
-(eval-when-compile (mh-do-in-xemacs (defvar tool-bar-mode)))
+(defvar tool-bar-mode)                  ; XEmacs
+(defvar tool-bar-map)
 
 ;;;###mh-autoload
 (defun mh-narrow-to-seq (sequence)
@@ -238,8 +237,7 @@ When you want to widen the view to all your messages again, use
                (set (make-local-variable 'tool-bar-map)
                     mh-folder-seq-tool-bar-map)
                (when (buffer-live-p (get-buffer mh-show-buffer))
-                 (save-excursion
-                   (set-buffer (get-buffer mh-show-buffer))
+                 (with-current-buffer mh-show-buffer
                    (set (make-local-variable 'tool-bar-map)
                         mh-show-seq-tool-bar-map))))
              (push 'widen mh-view-ops)))
@@ -371,8 +369,7 @@ remove all limits and sequence restrictions."
   (when (and (null mh-folder-view-stack) (boundp 'tool-bar-mode) tool-bar-mode)
     (set (make-local-variable 'tool-bar-map) mh-folder-tool-bar-map)
     (when (buffer-live-p (get-buffer mh-show-buffer))
-      (save-excursion
-        (set-buffer (get-buffer mh-show-buffer))
+      (with-current-buffer mh-show-buffer
         (set (make-local-variable 'tool-bar-map) mh-show-tool-bar-map)))))
 
 \f
@@ -748,9 +745,10 @@ completion is over."
                   "-norecurse" folder "-sequence" (symbol-name mh-unseen-seq))
     (goto-char (point-min))
     (multiple-value-bind (folder unseen total)
-        (mh-parse-flist-output-line
-         (buffer-substring (point) (mh-line-end-position)))
-      (values total unseen folder))))
+        (values-list
+         (mh-parse-flist-output-line
+          (buffer-substring (point) (mh-line-end-position))))
+      (list total unseen folder))))
 
 (defun mh-folder-size-folder (folder)
   "Find size of FOLDER using \"folder\"."
@@ -761,8 +759,8 @@ completion is over."
                     "-norecurse" folder)
       (goto-char (point-min))
       (if (re-search-forward " has \\([0-9]+\\) " nil t)
-          (values (string-to-number (match-string 1)) u folder)
-        (values 0 u folder)))))
+          (list (string-to-number (match-string 1)) u folder)
+        (list 0 u folder)))))
 
 ;;;###mh-autoload
 (defun mh-parse-flist-output-line (line &optional current-folder)
@@ -790,7 +788,7 @@ folders whose names end with a '+' character."
             (when (and (equal (aref folder (1- (length folder))) ?+)
                        (equal current-folder folder))
               (setq folder (substring folder 0 (1- (length folder)))))
-            (values (format "+%s" folder) unseen total)))))))
+            (list (format "+%s" folder) unseen total)))))))
 
 ;;;###mh-autoload
 (defun mh-read-folder-sequences (folder save-refiles)