[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/vm 556b5b7d5e 2/2: Merge branch 'vm-fix-many-warnings-mark
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/vm 556b5b7d5e 2/2: Merge branch 'vm-fix-many-warnings-markd' into 'main' |
Date: |
Mon, 22 Jul 2024 01:01:06 -0400 (EDT) |
branch: elpa/vm
commit 556b5b7d5eba5d29bdadabbfa2d1d8467025b17e
Merge: bd7e1f9429 8f44ff52d8
Author: Mark Diekhans <markd@ucsc.edu>
Commit: Mark Diekhans <markd@ucsc.edu>
Merge branch 'vm-fix-many-warnings-markd' into 'main'
resolved conflicts in Stefan Monnier <monnier@iro.umontreal.ca> fixes
See merge request emacs-vm/vm!14
---
contrib/org-html-mail.el | 9 +-
contrib/org-vm.el | 1 +
contrib/vm-blueman.el | 2 +
contrib/vm-bogofilter.el | 17 +-
contrib/vm-mime-display-internal-application.el | 4 +-
contrib/vm-sumurg.el | 16 +-
lisp/tapestry.el | 3 +-
lisp/u-vm-color.el | 23 +-
lisp/vcard.el | 27 +-
lisp/vm-avirtual.el | 42 +-
lisp/vm-biff.el | 16 +-
lisp/vm-crypto.el | 9 +-
lisp/vm-delete.el | 30 +-
lisp/vm-digest.el | 55 +--
lisp/vm-dired.el | 31 +-
lisp/vm-edit.el | 30 +-
lisp/vm-folder.el | 111 +++---
lisp/vm-grepmail.el | 31 +-
lisp/vm-imap.el | 78 ++--
lisp/vm-license.el | 6 +-
lisp/vm-macro.el | 62 +--
lisp/vm-mark.el | 32 +-
lisp/vm-menu.el | 12 +-
lisp/vm-message-history.el | 18 +-
lisp/vm-message.el | 7 +-
lisp/vm-mime.el | 433 ++++++--------------
lisp/vm-minibuf.el | 12 +-
lisp/vm-misc.el | 40 +-
lisp/vm-motion.el | 28 +-
lisp/vm-mouse.el | 20 +-
lisp/vm-page.el | 33 +-
lisp/vm-pcrisis.el | 105 +++--
lisp/vm-pgg.el | 89 ++---
lisp/vm-pine.el | 52 ++-
lisp/vm-pop.el | 56 +--
lisp/vm-ps-print.el | 23 +-
lisp/vm-reply.el | 27 +-
lisp/vm-rfaddons.el | 138 ++++---
lisp/vm-save.el | 69 ++--
lisp/vm-search.el | 21 +-
lisp/vm-serial.el | 28 +-
lisp/vm-smime.el | 44 +--
lisp/vm-sort.el | 24 +-
lisp/vm-summary-faces.el | 12 +-
lisp/vm-summary.el | 64 +--
lisp/vm-thread.el | 17 +-
lisp/vm-toolbar.el | 11 +-
lisp/vm-undo.el | 24 +-
lisp/vm-user.el | 4 +-
lisp/vm-vars.el | 506 +++++++++++-------------
lisp/vm-vcard.el | 13 +-
lisp/vm-version.el | 6 +-
lisp/vm-virtual.el | 38 +-
lisp/vm-w3.el | 6 +-
lisp/vm-w3m.el | 19 +-
lisp/vm-window.el | 26 +-
lisp/vm.el | 48 ++-
57 files changed, 1023 insertions(+), 1685 deletions(-)
diff --git a/contrib/org-html-mail.el b/contrib/org-html-mail.el
index d026a9523d..94b67413e3 100644
--- a/contrib/org-html-mail.el
+++ b/contrib/org-html-mail.el
@@ -1,4 +1,4 @@
-;; Copyright � 2008 Eric Schulte
+;; Copyright © 2008 Eric Schulte
;;
;; WYSWYG, html mail composition using orgmode
;;
@@ -26,11 +26,14 @@
;; For discussion see "sending html mail using VM" at
;; http://groups.google.com/group/gnu.emacs.vm.info/browse_frm/month/2008-01
+(require 'org-macs)
+(require 'vm-misc)
+
(defun orgstruct-hijacker-command-21 (arg)
"In Structure, run `org-ctrl-c-ctrl-c'. Outside of Structure
check for a prefix argument and if buffer name contains `mail',
-and run orgstruct-send-as-html, or run the binding of
-`\C-c\C-c'."
+and run `orgstruct-send-as-html', or run the binding of
+`C-c C-c'."
(interactive "p")
(vm-inform 6 "calling html send mail")
(save-excursion
diff --git a/contrib/org-vm.el b/contrib/org-vm.el
index 6f547c3819..e827bcb20b 100644
--- a/contrib/org-vm.el
+++ b/contrib/org-vm.el
@@ -36,6 +36,7 @@
;;; Code:
(require 'org)
+(require 'vm-message)
;; Declare external functions and variables
(declare-function vm-preview-current-message "ext:vm-page" ())
diff --git a/contrib/vm-blueman.el b/contrib/vm-blueman.el
index e93771b1ee..d904be827c 100644
--- a/contrib/vm-blueman.el
+++ b/contrib/vm-blueman.el
@@ -6,6 +6,8 @@
;Was going through some old code and would like to share this helpful
;function..
+(require 'vm-mime)
+
;; Stretch/Shrink mime image to fit exactly in frame width.
;; The shrink functionality is particularly helpful since images displayed
;; by emacs look wacked when they extend past a line width
diff --git a/contrib/vm-bogofilter.el b/contrib/vm-bogofilter.el
index a8f76cfe29..ae8cf8b655 100644
--- a/contrib/vm-bogofilter.el
+++ b/contrib/vm-bogofilter.el
@@ -180,7 +180,9 @@
;;; Code:
-(eval-when-compile (require 'vm))
+(require 'vm-vars)
+(require 'vm-message)
+(require 'vm-folder)
;;; Customisation:
@@ -240,8 +242,8 @@ message as spam.
:type 'string)
(defcustom vm-bogofilter-formail-program-options "-s"
- "*Options for the 'vm-bogofilter-formail-program'. After this
-arguments, the name of the bogofilter program will be passed."
+ "Options for the `vm-bogofilter-formail-program'.
+After this arguments, the name of the bogofilter program will be passed."
:group 'vm-bogofilter
:type 'string)
@@ -267,7 +269,7 @@ are explicitly marked as spams by the vm-bogofilter-is-spam
function."
"The function used to do the actual filtering. It is used as a value for
vm-retrieved-spooled-mail-hook."
(save-excursion
- (vm-save-restriction
+ (save-restriction
(let ((tail-cons (vm-last vm-message-list))
(buffer-read-only nil))
(widen)
@@ -338,12 +340,11 @@ vm-retrieved-spooled-mail-hook."
(buffer (get-buffer-create "*Shell Command Output*"))
)
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(erase-buffer))
(set-buffer (vm-buffer-of message))
- (vm-save-restriction
- (vm-save-buffer-excursion
+ (save-restriction
+ (save-current-buffer
(widen)
(goto-char (vm-headers-of message))
(narrow-to-region (point) (vm-text-end-of message))
diff --git a/contrib/vm-mime-display-internal-application.el
b/contrib/vm-mime-display-internal-application.el
index 69e8b2f9af..f65e11581c 100644
--- a/contrib/vm-mime-display-internal-application.el
+++ b/contrib/vm-mime-display-internal-application.el
@@ -72,7 +72,9 @@ If MODE is t, SUBTYPE-mode is used to display
\"application/SUBTYPE\"
attachments.")
(defvar vm-mime-internal-application-x-subtypes nil
- "*If non-nil, display application/x-SUBTYPE attachments the same as
application/SUBTYPE attachments.
+ "If non-nil, ignore the `x-' in application/x-SUBTYPE.
+This requests to display application/x-SUBTYPE attachments
+the same as application/SUBTYPE attachments.
See `vm-mime-internal-application-subtypes'.")
(advice-add 'vm-mime-can-display-internal :around
diff --git a/contrib/vm-sumurg.el b/contrib/vm-sumurg.el
index 054f23cd87..00f76a0da3 100644
--- a/contrib/vm-sumurg.el
+++ b/contrib/vm-sumurg.el
@@ -284,8 +284,7 @@
;; to avoid indefinite build-up
(unintern (concat (vm-su-message-id m) label)
vm-sumurg-timer-obarray)
- (save-excursion
- (set-buffer (vm-buffer-of (vm-real-message-of m)))
+ (with-current-buffer (vm-buffer-of (vm-real-message-of m))
(unintern label vm-label-obarray))
(save-excursion (vm-sumurg-set-urgency level nil 1 m))
)
@@ -302,8 +301,8 @@
;; copy it to the other buffer
;; we expect always to be in the summary
;; buffer here, but just in case...
- (save-excursion
- (set-buffer (or vm-mail-buffer vm-summary-buffer))
+ (with-current-buffer
+ (or vm-mail-buffer vm-summary-buffer)
(setq vm-sumurg-timer-obarray o))))
(intern (concat (vm-su-message-id m) label)
vm-sumurg-timer-obarray)
@@ -491,8 +490,7 @@
(aref vm-sumurg-facearray
(vm-sumurg-level-of (car vm-message-pointer))))
(if vm-presentation-buffer
- (save-excursion
- (set-buffer vm-presentation-buffer)
+ (with-current-buffer vm-presentation-buffer
(set-extent-face vm-ml-sumurg-extent
(aref vm-sumurg-facearray
(vm-sumurg-level-of
@@ -704,9 +702,9 @@ happens later.)"
(mapcar (lambda (label)
(when (string-match "^\\*+[-0-9:t]+$" label)
(vm-add-or-delete-message-labels label count nil)
- (save-excursion
- (set-buffer (vm-buffer-of (vm-real-message-of
- (car vm-message-pointer))))
+ (with-current-buffer
+ (vm-buffer-of (vm-real-message-of
+ (car vm-message-pointer)))
(unintern label vm-label-obarray))))
(vm-labels-of (car vm-message-pointer)))
(if date
diff --git a/lisp/tapestry.el b/lisp/tapestry.el
index 561ec7a43c..b363b619e9 100644
--- a/lisp/tapestry.el
+++ b/lisp/tapestry.el
@@ -20,8 +20,6 @@
;;; Code:
-(provide 'tapestry)
-
(defvar tapestry-version "1.09")
;; Pass state information between the tapestry-set-window-map
@@ -616,4 +614,5 @@ ROOT-WINDOW-EDGES will be used."
(frame-live-p f)
t ))
+(provide 'tapestry)
;;; tapestry.el ends here
diff --git a/lisp/u-vm-color.el b/lisp/u-vm-color.el
index 9f88872c8d..f83374c7a0 100644
--- a/lisp/u-vm-color.el
+++ b/lisp/u-vm-color.el
@@ -14,11 +14,8 @@
;;; Code
-(provide 'u-vm-color)
-
-(eval-when-compile
- (require 'vm-misc)
- (require 'vm-folder))
+(require 'vm-misc)
+(require 'vm-folder)
(defconst u-vm-color-version "2.10" "Version number of u-vm-color.")
@@ -405,7 +402,7 @@ subexpressions."
(count 1)
(t-vm-summary-format vm-summary-format)
(u-vm-color-xemacs-workaround
- (string-match "XEmacs\\|Lucid" emacs-version)))
+ (featurep 'xemacs)))
;; pick up all elements in the vm-summary-format
(while (string-match
(concat "%-?\\([0-9]+\\.\\)?-?\\([0-9]+\\)?"
@@ -588,8 +585,7 @@ subexpressions."
;; apparently emacs expects this statement here...
(font-lock-mode 1)
- (cond ((string-match "XEmacs\\|Lucid" emacs-version)
- ;; XEmacs
+ (cond ((featurep 'xemacs)
(setq u-vm-color-summary-keywords
(list (u-vm-color-make-summary-keywords)))
(put 'vm-summary-mode 'font-lock-defaults
@@ -632,7 +628,7 @@ subexpressions."
"Search the buffer for an expression and fontify it.
Search starts at START and ends at END. If REGEXP is found, it
is fontified according to the argument HOW, which is a list of
-the form '((index face)...)."
+the form ((INDEX FACE)...)."
;;(message "Searching from %d to %d for %s" start end regexp)
(let ((inhibit-read-only t))
(save-excursion
@@ -653,12 +649,12 @@ the form '((index face)...)."
(defun u-vm-color-fontify-signature (start end)
"Search and fontify the signature.
Search is restricted to the region between START and END."
-(let ((inhibit-read-only t))
+ (let ((inhibit-read-only t))
(save-excursion
(goto-char end)
(setq start (re-search-backward "^\\(- \\)?-- ?$" start t))
- (when start
- (put-text-property start end 'face 'u-vm-color-signature-face)))))
+ (when start
+ (put-text-property start end 'face 'u-vm-color-signature-face)))))
(defun u-vm-color-fontify-pgp-signature (start end)
"Search and fontify inline PGP signatures."
@@ -750,9 +746,10 @@ Search is restricted to the region between START and END."
;;;###autoload
(defun u-vm-color-fontify-buffer-even-more ()
"Temporarily widen buffer and call `u-vm-color-fontify-buffer'."
-(save-restriction
+ (save-restriction
(widen)
;;(message "u-vm-color-fontify-even-more: %d %d" (point-min) (point-max))
(u-vm-color-fontify-buffer)))
+(provide 'u-vm-color)
;;; u-vm-color.el ends here
diff --git a/lisp/vcard.el b/lisp/vcard.el
index fe58cf1109..3b3d8e6332 100644
--- a/lisp/vcard.el
+++ b/lisp/vcard.el
@@ -191,19 +191,18 @@ Vcard data is normally in the form
prop3a;prop3b: value3a;value3b;value3c
end: vcard
-\(Whitespace around the `:' separating properties and values is optional.\)
+\(Whitespace around the `:' separating properties and values is optional.)
If supplied to this function an alist of the form
- \(\(\(\"prop1a\"\) \"value1a\"\)
- \(\(\"prop2a\" \"prop2b\" \(\"prop2c\" . \"param2c\"\)\) \"value2a\"\)
- \(\(\"prop3a\" \"prop3b\"\) \"value3a\" \"value3b\" \"value3c\"\)\)
+ (((\"prop1a\") \"value1a\")
+ ((\"prop2a\" \"prop2b\" (\"prop2c\" . \"param2c\")) \"value2a\")
+ ((\"prop3a\" \"prop3b\") \"value3a\" \"value3b\" \"value3c\"))
would be returned."
(let ((vcard nil)
(buf (generate-new-buffer " *vcard parser work*")))
(unwind-protect
- (save-excursion
- (set-buffer buf)
+ (with-current-buffer buf
;; Make sure last line is newline-terminated.
;; An extra trailing newline is harmless.
(insert raw "\n")
@@ -472,10 +471,9 @@ US domestic telephone numbers are replaced with
international format."
;;; Decoding methods.
(defmacro vcard-hexstring-to-ascii (s)
- (if (string-lessp emacs-version "20")
- `(format "%c" (car (read-from-string (format "?\\x%s" ,s))))
- `(format "%c" (string-to-number ,s 16))))
+ `(format "%c" (string-to-number ,s 16)))
+;; FIXME: Use `quoted-printable-decode-region'!
(defun vcard-region-decode-quoted-printable (&optional beg end)
(save-excursion
(save-restriction
@@ -489,6 +487,7 @@ US domestic telephone numbers are replaced with
international format."
(let ((s (buffer-substring (1+ (match-beginning 0)) (match-end 0))))
(replace-match (vcard-hexstring-to-ascii s) t t)))))))
+;; FIXME: Use `base64-decode-region'!
(defun vcard-region-decode-base64 (&optional beg end)
(save-restriction
(narrow-to-region (or beg (point-min)) (or end (point-max)))
@@ -505,21 +504,21 @@ US domestic telephone numbers are replaced with
international format."
(delete-char 1)
(cond ((char-equal c ?=)
(if (= count 2)
- (insert (lsh n -10))
+ (insert (ash n -10))
;; count must be 3
- (insert (lsh n -16) (logand 255 (lsh n -8))))
+ (insert (ash n -16) (logand 255 (ash n -8))))
(delete-region (point) (point-max)))
(t
(setq n (+ n (aref vcard-region-decode-base64-table
(vcard-char-to-int c))))
(setq count (1+ count))
(cond ((= count 4)
- (insert (logand 255 (lsh n -16))
- (logand 255 (lsh n -8))
+ (insert (logand 255 (ash n -16))
+ (logand 255 (ash n -8))
(logand 255 n))
(setq n 0 count 0))
(t
- (setq n (lsh n 6))))))))))
+ (setq n (ash n 6))))))))))
(defun vcard-split-string (string &optional separator limit)
diff --git a/lisp/vm-avirtual.el b/lisp/vm-avirtual.el
index 509f8a5c51..9dcbe3a8e8 100644
--- a/lisp/vm-avirtual.el
+++ b/lisp/vm-avirtual.el
@@ -103,28 +103,13 @@
;;
;;; Code:
-(provide 'vm-avirtual)
-
(require 'vm-macro)
-(require 'vm-virtual)
(require 'vm-vars)
+(require 'vm-thread)
+
+;; FIXME: Cyclic dependency, we can't require `vm-virtual'.
+(declare-function vm-vs-spam-word "vm-virtual" (m &optional part))
-(eval-when-compile
- (require 'vm-misc)
- (require 'vm-minibuf)
- (require 'vm-summary)
- (require 'vm-folder)
- (require 'vm-window)
- (require 'vm-page)
- (require 'vm-motion)
- (require 'vm-undo)
- (require 'vm-delete)
- (require 'vm-save)
- (require 'vm-reply)
- (require 'vm-sort)
- (require 'vm-thread)
-)
-
(declare-function vm-get-folder-buffer "vm" (folder))
;; The following function is erroneously called for fsfemacs as well
(declare-function key-or-menu-binding "vm-xemacs" (key &optional menu-flag))
@@ -654,8 +639,7 @@ If VIRTUAL is true we check the current message and not the
real one."
(if msg
(if virtual
(apply 'vm-vs-or msg selector)
- (save-excursion
- (set-buffer (vm-buffer-of (vm-real-message-of msg)))
+ (with-current-buffer (vm-buffer-of (vm-real-message-of msg))
(apply 'vm-vs-or msg selector)))
(if (eq major-mode 'mail-mode)
(apply 'vm-mail-vs-or selector))))
@@ -679,9 +663,8 @@ format:
(vm-virtual-check-diagnostics (or vm-virtual-check-diagnostics
diagnostics)))
(with-output-to-temp-buffer "*VM virtual-folder-check*"
- (save-excursion
- (set-buffer "*VM virtual-folder-check*")
- (toggle-truncate-lines t))
+ (with-current-buffer "*VM virtual-folder-check*"
+ (toggle-truncate-lines t))
(princ (format "Checking %S on <%s> from %s\n\n" selector
(vm-su-subject msg) (vm-su-from msg)))
(princ (format "\nThe virtual folder selector `%s' is %s\n"
@@ -926,7 +909,7 @@ Add this to `vm-arrived-messages-hook'.
See the function `vm-virtual-auto-delete-message' for details.
- (add-hook 'vm-arrived-messages-hook 'vm-virtual-auto-delete-messages)
+ (add-hook \\='vm-arrived-messages-hook #\\='vm-virtual-auto-delete-messages)
"
(interactive)
@@ -951,7 +934,7 @@ folder name and `mp' (a vm-message-pointer) to access the
message.
Example:
(setq vm-virtual-auto-folder-alist
- '((\"spam\" (concat folder \"-\"
+ \\='((\"spam\" (concat folder \"-\"
(format-time-string \"%y%m\" (current-time))))))
This will return \"spam-0008\" as a folder name for messages matching the
@@ -1090,8 +1073,7 @@ This is not yet the whole story! USR,
2013-01-18"
(save-excursion
(vm-select-folder-buffer-and-validate 0 (vm-interactive-p))
;; remove old descriptions
- (save-excursion
- (set-buffer vm-summary-buffer)
+ (with-current-buffer vm-summary-buffer
(goto-char (point-min))
(let ((buffer-read-only nil)
(s (point-min))
@@ -1110,8 +1092,7 @@ This is not yet the whole story! USR,
2013-01-18"
f (cdr (assoc m vm-sort-compare-auto-folder-cache)))
(when (not (equal oldf f))
(setq m (vm-su-start-of m))
- (save-excursion
- (set-buffer (marker-buffer m))
+ (with-current-buffer (marker-buffer m)
(let ((buffer-read-only nil))
(goto-char m)
(insert (format "%s\n" (or f "no default folder")))
@@ -1235,4 +1216,5 @@ with the same name."
;;----------------------------------------------------------------------------
+(provide 'vm-avirtual)
;;; vm-avirtual.el ends here
diff --git a/lisp/vm-biff.el b/lisp/vm-biff.el
index 39558533c7..2cc4a9f684 100644
--- a/lisp/vm-biff.el
+++ b/lisp/vm-biff.el
@@ -38,12 +38,9 @@
;;
;;; Code:
-(provide 'vm-biff)
-
-(eval-when-compile
- (require 'vm-misc)
- (require 'vm-summary)
-)
+(require 'vm-misc)
+(require 'vm-summary)
+(require 'vm-message)
;; vm-xemacs.el is a fake file to fool the Emacs 23 compiler
(declare-function get-itimer "vm-xemacs.el" (name))
@@ -257,8 +254,7 @@ folder selectors work."
(defun vm-biff-find-folder-window (msg)
(let ((buf (vm-buffer-of msg)))
- (save-excursion
- (set-buffer buf)
+ (with-current-buffer buf
(or (vm-biff-get-buffer-window buf)
(and vm-presentation-buffer
(vm-biff-get-buffer-window vm-presentation-buffer))
@@ -443,7 +439,7 @@ AddToFunc SelectWindow
(or force
(not (equal new-messages vm-biff-message-pointer))))
(setq msg (car new-messages))
- (backward-delete-char 1)
+ (delete-char -1)
(goto-char (point-min))
(setq truncate-lines t
@@ -521,3 +517,5 @@ AddToFunc SelectWindow
(add-hook 'vm-arrived-messages-hook 'vm-biff-popup t)
+(provide 'vm-biff)
+;;; vm-biff.el ends here.
diff --git a/lisp/vm-crypto.el b/lisp/vm-crypto.el
index 2213c3ad9e..0b00018961 100644
--- a/lisp/vm-crypto.el
+++ b/lisp/vm-crypto.el
@@ -21,12 +21,8 @@
;;; Code:
-(provide 'vm-crypto)
-
-(eval-when-compile
- (require 'vm-misc)
- (require 'vm-folder)
- )
+(require 'vm-misc)
+(require 'vm-folder)
;; compatibility
(fset 'vm-pop-md5 'vm-md5-string)
@@ -227,4 +223,5 @@
(vm-register-global-garbage-files (list vm-stunnel-configuration-file))
vm-stunnel-configuration-file))
+(provide 'vm-crypto)
;;; vm-crypto.el ends here
diff --git a/lisp/vm-delete.el b/lisp/vm-delete.el
index b3c54a714b..2414d94af7 100644
--- a/lisp/vm-delete.el
+++ b/lisp/vm-delete.el
@@ -21,26 +21,13 @@
;;; Code:
-(provide 'vm-delete)
-
(require 'vm-macro)
-(eval-when-compile
- (require 'cl-lib)
- (require 'vm-misc)
- (require 'vm-summary)
- (require 'vm-folder)
- (require 'vm-crypto)
- (require 'vm-window)
- (require 'vm-page)
- (require 'vm-motion)
- (require 'vm-undo)
- (require 'vm-sort)
- (require 'vm-thread)
- (require 'vm-pop)
- (require 'vm-imap)
-)
-
+(require 'vm-misc)
+(require 'vm-window)
+(require 'vm-undo)
+(require 'vm-sort)
+(eval-when-compile (require 'cl-lib))
;;;###autoload
(defun vm-delete-message (count &optional mlist)
@@ -285,7 +272,7 @@ don't move at all."
"Delete duplicate messages in the current folder.
This command works by comparing the message ID's. Messages that
are already deleted are not considered, so VM will never delete the last
-copy of a message in a folder. 'Deleting' means flagging for
+copy of a message in a folder. `Deleting' means flagging for
deletion; you will have to expunge the messages with
`vm-expunge-folder' to really get rid of them, as usual.
@@ -336,7 +323,7 @@ This command works by computing an MD5 hash for the body of
each
non-deleted message in the folder and deleting messages that have
a hash that has already been seen. Messages that are already deleted
are never hashed, so VM will never delete the last copy of a
-message in a folder. 'Deleting' means flagging for deletion; you
+message in a folder. `Deleting' means flagging for deletion; you
will have to expunge the messages with `vm-expunge-folder' to
really get rid of them, as usual.
@@ -471,7 +458,7 @@ ignored."
'uid)
vm-imap-retrieved-messages)))))
(vm-increment vm-modification-counter)
- (vm-save-restriction
+ (save-restriction
(widen)
(let ((buffer-read-only nil))
(delete-region (vm-start-of real-m)
@@ -549,4 +536,5 @@ ignored."
(vm-mark-folder-modified-p (current-buffer))
(vm-increment vm-modification-counter))))
+(provide 'vm-delete)
;;; vm-delete.el ends here
diff --git a/lisp/vm-digest.el b/lisp/vm-digest.el
index 9a6ab3fb09..79dd75bb8d 100644
--- a/lisp/vm-digest.el
+++ b/lisp/vm-digest.el
@@ -21,21 +21,14 @@
;;; Code:
-(provide 'vm-digest)
-
(require 'vm-macro)
-
-(eval-when-compile
- (require 'vm-misc)
- (require 'vm-summary)
- (require 'vm-folder)
- (require 'vm-window)
- (require 'vm-page)
- (require 'vm-motion)
- (require 'vm-mime)
- (require 'vm-undo)
- (require 'vm-delete)
-)
+(require 'vm-misc)
+(require 'vm-summary)
+(require 'vm-folder)
+(require 'vm-window)
+(require 'vm-motion)
+(require 'vm-mime)
+(require 'vm-delete)
(declare-function vm-mode "vm-mode" (&optional read-only))
(declare-function vm-yank-message "vm-reply" (message))
@@ -63,12 +56,10 @@ to find out how KEEP-LIST and DISCARD-REGEXP are used."
(narrow-to-region (point) (point))
(insert "------- start of forwarded message -------\n")
(setq source-buffer (vm-buffer-of m))
- (save-excursion
- (set-buffer source-buffer)
+ (with-current-buffer source-buffer
(save-restriction
(widen)
- (save-excursion
- (set-buffer target-buffer)
+ (with-current-buffer target-buffer
(let ((beg (point)))
;; (insert-buffer-substring
;; source-buffer (vm-headers-of m) (vm-text-end-of m))
@@ -210,7 +201,7 @@ all of them will be burst."
start part-list
(folder-type vm-folder-type))
(unwind-protect
- (vm-save-restriction
+ (save-restriction
(save-excursion
(widen)
(setq work-buffer (vm-make-work-buffer))
@@ -335,12 +326,10 @@ to find out how KEEP-LIST and DISCARD-REGEXP are used."
(insert "---------------\n")
(setq m (vm-real-message-of (car mlist))
source-buffer (vm-buffer-of m))
- (save-excursion
- (set-buffer source-buffer)
+ (with-current-buffer source-buffer
(save-restriction
(widen)
- (save-excursion
- (set-buffer target-buffer)
+ (with-current-buffer target-buffer
(let ((beg (point)))
(insert-buffer-substring source-buffer (vm-headers-of m)
(vm-text-end-of m))
@@ -430,12 +419,10 @@ to find out how KEEP-LIST and DISCARD-REGEXP are used."
(insert "---------------\n\n")
(setq m (vm-real-message-of (car mlist))
source-buffer (vm-buffer-of m))
- (save-excursion
- (set-buffer source-buffer)
+ (with-current-buffer source-buffer
(save-restriction
(widen)
- (save-excursion
- (set-buffer target-buffer)
+ (with-current-buffer target-buffer
(let ((beg (point)))
(insert-buffer-substring source-buffer (vm-headers-of m)
(vm-text-end-of m))
@@ -485,7 +472,7 @@ RFC 1153. Otherwise assume RFC 934 digests."
separator-regexp "^------------------------------\n")
(setq prologue-separator-regexp "\\(^-[^ ].*\n+\\)+"
separator-regexp "\\(^-[^ ].*\n+\\)+"))
- (vm-save-restriction
+ (save-restriction
(save-excursion
(widen)
(unwind-protect
@@ -674,8 +661,7 @@ burst."
(when vm-delete-after-bursting
;; if start folder was virtual, we're now in the wrong
;; buffer. switch back.
- (save-excursion
- (set-buffer start-buffer)
+ (with-current-buffer start-buffer
;; don't move message pointer when deleting the message
(let ((vm-move-after-deleting nil))
(vm-delete-message 1))))
@@ -788,14 +774,13 @@ burst."
(vm-inform 5 "Bursting %s digest... done" digest-type)
(and vm-delete-after-bursting
(yes-or-no-p (format "Delete message %s? " (vm-number-of m)))
- (save-excursion
- (set-buffer start-buffer)
+ (with-current-buffer start-buffer
;; don't move message pointer when deleting the message
(let ((vm-move-after-deleting nil))
(vm-delete-message 1))))
(setq mlist (cdr mlist)))
(set-buffer-modified-p nil) ; work-buffer
- (vm-save-buffer-excursion
+ (save-current-buffer
(vm-goto-new-folder-frame-maybe 'folder)
(vm-mode)
(if (vm-should-generate-summary)
@@ -814,8 +799,7 @@ burst."
M should be the message struct of a real message.
Returns either \"rfc934\", \"rfc1153\" or \"mime\"."
(catch 'return-value
- (save-excursion
- (set-buffer (vm-buffer-of m))
+ (with-current-buffer (vm-buffer-of m)
(let ((layout (vm-mm-layout m)))
(if (and (vectorp layout)
(or (vm-mime-layout-contains-type
@@ -850,4 +834,5 @@ Returns either \"rfc934\", \"rfc1153\" or \"mime\"."
(vm-matched-header-contents)
nil )))))
+(provide 'vm-digest)
;;; vm-digest.el ends here
diff --git a/lisp/vm-dired.el b/lisp/vm-dired.el
index bba80f8588..81404ee5d4 100644
--- a/lisp/vm-dired.el
+++ b/lisp/vm-dired.el
@@ -29,26 +29,16 @@
;;
;;; Code:
-(provide 'vm-dired)
-
-(require 'dired)
-
-(eval-when-compile
- (require 'vm-misc)
- (require 'vm-minibuf)
- (require 'vm-menu)
- (require 'vm-folder)
- (require 'vm-summary)
- (require 'vm-window)
- (require 'vm-page)
- (require 'vm-motion)
- (require 'vm-mime)
- (require 'vm-digest)
- (require 'vm-undo)
- )
-
-(eval-and-compile
- (require 'dired))
+(require 'vm-misc)
+(require 'vm-minibuf)
+(require 'vm-menu)
+(require 'vm-folder)
+(require 'vm-summary)
+(require 'vm-window)
+(require 'vm-motion)
+(require 'vm-mime)
+(require 'vm-digest)
+(require 'dired)
(declare-function vm-dired-file-name-at-point "vm-dired.el" ())
@@ -124,4 +114,5 @@ COMPOSITION's name will be read from the minibuffer."
(vm-attach-file file type)))
nil))
+(provide 'vm-dired)
;;; vm-dired.el ends here
diff --git a/lisp/vm-edit.el b/lisp/vm-edit.el
index de65f6008f..78dce145d3 100644
--- a/lisp/vm-edit.el
+++ b/lisp/vm-edit.el
@@ -21,21 +21,9 @@
;;; Code:
-(provide 'vm-edit)
-
(require 'vm-macro)
-
-(eval-when-compile
- (require 'vm-misc)
- (require 'vm-summary)
- (require 'vm-folder)
- (require 'vm-window)
- (require 'vm-page)
- (require 'vm-thread)
- (require 'vm-sort)
- (require 'vm-motion)
-)
-
+(require 'vm-folder)
+(require 'vm-motion)
;;;###autoload
(defun vm-edit-message (&optional prefix-argument)
@@ -73,7 +61,7 @@ replace the original, use C-c C-] and the edit will be
aborted."
:fail t)
(if (and edit-buf (buffer-name edit-buf))
(set-buffer edit-buf)
- (vm-save-restriction
+ (save-restriction
(widen)
(setq edit-buf
(generate-new-buffer
@@ -272,11 +260,10 @@ thread have their cached data discarded."
(if (not (buffer-modified-p))
(vm-inform 5 "No change.")
(widen)
- (save-excursion
- (set-buffer (vm-buffer-of (vm-real-message-of (car mp))))
+ (with-current-buffer (vm-buffer-of (vm-real-message-of (car mp)))
(if (not (memq (vm-real-message-of (car mp)) vm-message-list))
(error "The original copy of this message has been expunged."))
- (vm-save-restriction
+ (save-restriction
(widen)
(goto-char (vm-headers-of (vm-real-message-of (car mp))))
(let ((vm-message-pointer mp)
@@ -299,11 +286,11 @@ thread have their cached data discarded."
;; window. This works well for non MIME
;; messages, but the cursor drifts badly for
;; MIME and for refilled messages.
- (vm-save-buffer-excursion
+ (save-current-buffer
(and vm-presentation-buffer
(set-buffer vm-presentation-buffer))
- (vm-save-restriction
- (vm-save-buffer-excursion
+ (save-restriction
+ (save-current-buffer
(widen)
(let ((osw (selected-window))
(new-win (vm-get-visible-buffer-window
@@ -341,4 +328,5 @@ thread have their cached data discarded."
(kill-buffer (current-buffer))
(vm-inform 5 "Aborted, no change."))
+(provide 'vm-edit)
;;; vm-edit.el ends here
diff --git a/lisp/vm-folder.el b/lisp/vm-folder.el
index fdfa7a6077..ac13ba2075 100644
--- a/lisp/vm-folder.el
+++ b/lisp/vm-folder.el
@@ -22,32 +22,16 @@
;;; Code:
-(provide 'vm-folder)
-
(require 'vm-macro)
+(require 'vm-toolbar)
+(eval-when-compile (require 'cl-lib))
-(eval-when-compile
- (require 'cl-lib)
- (require 'vm-misc)
- (require 'vm-summary)
- (require 'vm-window)
- (require 'vm-minibuf)
- (require 'vm-menu)
- (require 'vm-toolbar)
- (require 'vm-page)
- (require 'vm-motion)
- (require 'vm-undo)
- (require 'vm-delete)
- (require 'vm-mark)
- (require 'vm-virtual)
- (require 'vm-mime)
- (require 'vm-sort)
- (require 'vm-thread)
- (require 'vm-pop)
- (require 'vm-imap)
- (require 'vm-message)
- (require 'vm-sort)
-)
+;; FIXME: Cyclic dependency.
+(provide 'vm-folder)
+
+(require 'vm-delete)
+(require 'vm-pop)
+(require 'vm-page)
;; vm-xemacs.el is a fake file to fool the Emacs 23 compiler
(declare-function get-itimer "vm-xemacs.el" (name))
@@ -1244,7 +1228,7 @@ vm-folder-type is initialized here."
;;
;; For free standing messages, unwanted headers are
;; stripped from the message, unremembered.
- (vm-save-restriction
+ (save-restriction
(let ((header-alist (vm-build-header-order-alist keep-list))
(buffer-read-only nil)
(work-buffer nil)
@@ -1775,7 +1759,7 @@ Supports version 4 format of attribute storage, for
backward compatibility."
(time nil)
time lim oldpoint)
(save-excursion
- (vm-save-restriction
+ (save-restriction
(widen)
(goto-char (point-min))
(vm-skip-past-folder-header)
@@ -1806,7 +1790,7 @@ Supports version 4 format of attribute storage, for
backward compatibility."
(let ((case-fold-search t)
lim)
(save-excursion
- (vm-save-restriction
+ (save-restriction
(widen)
(if (eq vm-folder-type 'babyl)
(progn
@@ -1862,7 +1846,7 @@ Supports version 4 format of attribute storage, for
backward compatibility."
(n nil)
lim oldpoint)
(save-excursion
- (vm-save-restriction
+ (save-restriction
(widen)
(goto-char (point-min))
(vm-skip-past-folder-header)
@@ -1899,7 +1883,7 @@ Supports version 4 format of attribute storage, for
backward compatibility."
(let ((case-fold-search t)
ob lim oldpoint)
(save-excursion
- (vm-save-restriction
+ (save-restriction
(widen)
(goto-char (point-min))
(vm-skip-past-folder-header)
@@ -1929,7 +1913,7 @@ Supports version 4 format of attribute storage, for
backward compatibility."
(let ((case-fold-search t)
ob lim oldpoint)
(save-excursion
- (vm-save-restriction
+ (save-restriction
(widen)
(goto-char (point-min))
(vm-skip-past-folder-header)
@@ -1957,7 +1941,7 @@ Supports version 4 format of attribute storage, for
backward compatibility."
(defun vm-gobble-visible-header-variables ()
(save-excursion
- (vm-save-restriction
+ (save-restriction
(let ((case-fold-search t)
lim)
(widen)
@@ -2075,7 +2059,7 @@ Supports version 4 format of attribute storage, for
backward compatibility."
(let ((case-fold-search t)
summary lim)
(save-excursion
- (vm-save-restriction
+ (save-restriction
(widen)
(goto-char (point-min))
(vm-skip-past-folder-header)
@@ -2141,7 +2125,7 @@ Supports version 4 format of attribute storage, for
backward compatibility."
message M into the folder buffer. The optional argument
FOR-OTHER-FOLDER indicates <someting unknown>. USR 2010-03-06"
(save-excursion
- (vm-save-restriction
+ (save-restriction
(widen)
(let ((old-buffer-modified-p (buffer-modified-p))
(vm-mime-qp-encoder-program nil) ; use internal code
@@ -2253,7 +2237,7 @@ pending input. So, presumably this is non-interactive.
USR 2012-12-22"
(let ((vm-key-functions '(vm-sort-compare-physical-order-r)))
(setq mp (sort newlist 'vm-sort-compare-xxxxxx)))
(save-excursion
- (vm-save-restriction
+ (save-restriction
(widen)
(let ((old-buffer-modified-p (buffer-modified-p))
(vm-mime-qp-encoder-program nil) ; use internal code
@@ -2426,7 +2410,7 @@ pending input. So, presumably this is non-interactive.
USR 2012-12-22"
(defun vm-stuff-labels ()
(if vm-message-list
(save-excursion
- (vm-save-restriction
+ (save-restriction
(widen)
(let ((old-buffer-modified-p (buffer-modified-p))
(case-fold-search t)
@@ -2485,7 +2469,7 @@ pending input. So, presumably this is non-interactive.
USR 2012-12-22"
(defun vm-stuff-bookmark ()
(if vm-message-pointer
(save-excursion
- (vm-save-restriction
+ (save-restriction
(widen)
(let ((old-buffer-modified-p (buffer-modified-p))
(case-fold-search t)
@@ -2528,7 +2512,7 @@ pending input. So, presumably this is non-interactive.
USR 2012-12-22"
(defun vm-stuff-last-modified ()
(if vm-message-list
(save-excursion
- (vm-save-restriction
+ (save-restriction
(widen)
(let ((old-buffer-modified-p (buffer-modified-p))
(case-fold-search t)
@@ -2571,7 +2555,7 @@ pending input. So, presumably this is non-interactive.
USR 2012-12-22"
(defun vm-stuff-pop-retrieved ()
(if vm-message-list
(save-excursion
- (vm-save-restriction
+ (save-restriction
(widen)
(let ((old-buffer-modified-p (buffer-modified-p))
(case-fold-search t)
@@ -2624,7 +2608,7 @@ pending input. So, presumably this is non-interactive.
USR 2012-12-22"
(defun vm-stuff-imap-retrieved ()
(if vm-message-list
(save-excursion
- (vm-save-restriction
+ (save-restriction
(widen)
(let ((old-buffer-modified-p (buffer-modified-p))
(case-fold-search t)
@@ -2678,7 +2662,7 @@ pending input. So, presumably this is non-interactive.
USR 2012-12-22"
(defun vm-stuff-summary ()
(if vm-message-list
(save-excursion
- (vm-save-restriction
+ (save-restriction
(widen)
(let ((old-buffer-modified-p (buffer-modified-p))
(case-fold-search t)
@@ -2725,7 +2709,7 @@ pending input. So, presumably this is non-interactive.
USR 2012-12-22"
(defun vm-stuff-header-variables ()
(if vm-message-list
(save-excursion
- (vm-save-restriction
+ (save-restriction
(widen)
(let ((old-buffer-modified-p (buffer-modified-p))
(case-fold-search t)
@@ -2773,7 +2757,7 @@ pending input. So, presumably this is non-interactive.
USR 2012-12-22"
(defun vm-stuff-message-order ()
(if (cdr vm-message-list)
(save-excursion
- (vm-save-restriction
+ (save-restriction
(widen)
(let ((old-buffer-modified-p (buffer-modified-p))
(case-fold-search t)
@@ -2831,7 +2815,7 @@ pending input. So, presumably this is non-interactive.
USR 2012-12-22"
(defun vm-remove-message-order ()
(if (cdr vm-message-list)
(save-excursion
- (vm-save-restriction
+ (save-restriction
(widen)
(let ((old-buffer-modified-p (buffer-modified-p))
(case-fold-search t)
@@ -3704,10 +3688,10 @@ This function is only used in background tasks. USR
2012-12-22."
;; Note that deleted messages are not expunged.
(defun vm-write-file-hook ()
(if (and (eq major-mode 'vm-mode) (not vm-inhibit-write-file-hook))
- ;; The vm-save-restriction isn't really necessary here, since
+ ;; The save-restriction isn't really necessary here, since
;; the stuff routines clean up after themselves, but should remain
;; as a safeguard against the time when other stuff is added here.
- (vm-save-restriction
+ (save-restriction
(let ((buffer-read-only))
(vm-discard-fetched-messages)
(vm-inform 7 "%s: Stuffing cached data..." (buffer-name))
@@ -4043,7 +4027,7 @@ Same as \\[vm-recover-folder]."
;; working any more. Not on GNU Emacs. USR, 2010-01-23
(defun vm-handle-file-recovery-or-reversion (recovery)
- (if (and vm-summary-buffer (buffer-name vm-summary-buffer))
+ (if (buffer-live-p vm-summary-buffer)
(kill-buffer vm-summary-buffer))
(vm-virtual-quit)
;; reset major mode, this will cause vm to start from scratch.
@@ -4148,7 +4132,7 @@ Same as \\[vm-recover-folder]."
(defun vm-gobble-crash-box (crash-box)
(save-excursion
- (vm-save-restriction
+ (save-restriction
(widen)
(let ((opoint-max (point-max)) crash-buf
(buffer-read-only nil)
@@ -4168,8 +4152,7 @@ Same as \\[vm-recover-folder]."
(find-file-noselect crash-box)))
(if (eq (current-buffer) crash-buf)
(error "folder is the same file as crash box, cannot continue"))
- (save-excursion
- (set-buffer crash-buf)
+ (with-current-buffer crash-buf
(setq crash-folder-type (vm-get-folder-type))
(if (and crash-folder-type vm-check-folder-types)
(cond ((eq crash-folder-type 'unknown)
@@ -4409,7 +4392,7 @@ Same as \\[vm-recover-folder]."
"Get new mail for the current folder from its spool file.
The optional argument INTERACTIVE says whether the function can make
interactive queries to the user. The possible values are t,
-'password-only and nil."
+`password-only', and nil."
(if vm-block-new-mail
(error "Can't get new mail until you save this folder."))
(cond ((eq vm-folder-access-method 'pop)
@@ -4692,7 +4675,7 @@ files."
(error "Folder %s is not the same format as this folder."
folder))
(save-excursion
- (vm-save-restriction
+ (save-restriction
(widen)
(goto-char (point-max))
(let ((coding-system-for-read (vm-binary-coding-system)))
@@ -4743,7 +4726,7 @@ files."
(let ((tail-cons (vm-last vm-message-list))
b-list new-messages)
(save-excursion
- (vm-save-restriction
+ (save-restriction
(widen)
(vm-build-message-list)
(when (or (null tail-cons) (cdr tail-cons))
@@ -4945,7 +4928,7 @@ current changes of the folder before making it read-only."
;; this does the real major mode scutwork.
(defun vm-mode-internal (&optional access-method reload)
"Turn on vm-mode in the current buffer.
-ACCESS-METHOD is either 'pop or 'imap for server folders.
+ACCESS-METHOD is either `pop' or `imap' for server folders.
If RELOAD is non-Nil, then the folder is being recovered. So,
folder-access-data should be preserved."
(widen)
@@ -5095,7 +5078,7 @@ Interactively TYPE will be read from the minibuffer."
(modulus (+ (% (vm-abs (random)) 11) 5))
text-end opoint)
(save-excursion
- (vm-save-restriction
+ (save-restriction
(widen)
(setq vm-folder-type type)
(goto-char (point-min))
@@ -5277,16 +5260,11 @@ argument GARBAGE."
(error nil))
(setq vm-message-garbage-alist (cdr vm-message-garbage-alist)))))
-(vm-add-write-file-hook 'vm-write-file-hook)
-(vm-add-find-file-hook 'vm-handle-file-recovery)
-(vm-add-find-file-hook 'vm-handle-file-reversion)
+(add-hook 'before-save-hook #'vm-write-file-hook) ;FIXME: Buffer-local!
+(add-hook 'find-file-hook #'vm-handle-file-recovery) ;FIXME: Buffer-local!
+(add-hook 'find-file-hook #'vm-handle-file-reversion) ;FIXME: Buffer-local!
-;; after-revert-hook is new to FSF v19.23
-(defvar after-revert-hook)
-(if (boundp 'after-revert-hook)
- (setq after-revert-hook
- (cons 'vm-after-revert-buffer-hook after-revert-hook))
- (setq after-revert-hook (list 'vm-after-revert-buffer-hook)))
+(add-hook 'after-revert-hook #'vm-after-revert-buffer-hook) ;FIXME:
Buffer-local!
(defun vm-message-can-be-external (m)
"Check if the message M can be used in external (headers-only) mode."
@@ -5428,9 +5406,8 @@ during retrieval.
Gives an error if unable to retrieve message."
(if (not (eq (vm-message-access-method-of mm) 'imap))
(message "External messages currently available only for imap folders.")
- (save-excursion
- (set-buffer (vm-buffer-of mm))
- (vm-save-restriction
+ (with-current-buffer (vm-buffer-of mm)
+ (save-restriction
(widen)
(narrow-to-region (marker-position (vm-headers-of mm))
(marker-position (vm-text-end-of mm)))
@@ -5570,7 +5547,7 @@ the folder is saved."
(vm-set-body-to-be-discarded-flag mm nil)
(save-current-buffer
(set-buffer (vm-buffer-of mm))
- (vm-save-restriction
+ (save-restriction
(widen)
(let ((inhibit-read-only t)
;; (buffer-read-only nil) ; seems redundant
diff --git a/lisp/vm-grepmail.el b/lisp/vm-grepmail.el
index 45d73c3238..29d64a2429 100644
--- a/lisp/vm-grepmail.el
+++ b/lisp/vm-grepmail.el
@@ -41,20 +41,14 @@
;;; Code:
-(provide 'vm-grepmail)
-
(require 'vm-macro)
-
-(eval-and-compile
- (require 'vm-misc)
- (require 'vm-minibuf)
- (require 'vm-undo)
- (require 'vm-startup)
- (require 'vm-motion)
- (require 'vm-summary)
- (require 'vm-folder)
- (require 'vm-window)
-)
+(require 'vm-misc)
+(require 'vm-minibuf)
+(require 'vm-startup)
+(require 'vm-motion)
+(require 'vm-summary)
+(require 'vm-folder)
+(require 'vm-window)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; group already defined in vm-vars.el
@@ -168,8 +162,7 @@ FOLDERS should be a list of files/directories to search in."
(vm-display (current-buffer) nil nil '(reading-message))
(vm-display (current-buffer) t nil '(vm-next-message reading-message))
- (save-excursion
- (set-buffer process-buffer)
+ (with-current-buffer process-buffer
(setq default-directory (expand-file-name vm-folder-directory))
(erase-buffer)
(switch-to-buffer process-buffer)
@@ -186,7 +179,7 @@ FOLDERS should be a list of files/directories to search in."
(error "Cannot start grepmail"))
;; set the send-filter
(if (not (featurep 'xemacs))
- (set-buffer-process-coding-system 'raw-text-unix 'raw-text-unix))
+ (set-process-coding-system process 'raw-text-unix 'raw-text-unix))
(set-process-filter process 'vm-grepmail-process-filter)
(set-process-sentinel process 'vm-grepmail-process-done)
process)))
@@ -246,10 +239,9 @@ FOLDERS should be a list of files/directories to search
in."
MESSAGE-BUFFER is the buffer of the message.
START the start position in the process output buffer.
END the end position in the process output buffer."
- (save-excursion
- (set-buffer vm-grepmail-folder-buffer)
+ (with-current-buffer vm-grepmail-folder-buffer
(let ((buffer-read-only nil))
- (vm-save-restriction
+ (save-restriction
(widen)
(goto-char (point-max))
(insert-buffer-substring message-buffer start end)
@@ -261,4 +253,5 @@ END the end position in the process output buffer."
(set-buffer-modified-p nil))))
(sit-for 0))
+(provide 'vm-grepmail)
;;; vm-grepmail.el ends here
diff --git a/lisp/vm-imap.el b/lisp/vm-imap.el
index 1dc300e9e0..ab8880f37f 100644
--- a/lisp/vm-imap.el
+++ b/lisp/vm-imap.el
@@ -23,31 +23,13 @@
;;; Code:
-(provide 'vm-imap)
-
(require 'vm-macro)
-
-(eval-when-compile
- (require 'cl-lib)
- (require 'sendmail)
- (require 'vm-misc))
-
-;; For function declarations
-(eval-when-compile
- (require 'vm-folder)
- (require 'vm-summary)
- (require 'vm-window)
- (require 'vm-motion)
- (require 'vm-undo)
- (require 'vm-delete)
- (require 'vm-crypto)
- (require 'vm-mime)
- (require 'vm-reply)
-)
-
-(eval-and-compile
- (require 'utf7)
-)
+(require 'vm-misc)
+(require 'vm-motion)
+(require 'vm-reply) ;vm-mail-mode-remove-header
+(require 'sendmail)
+(require 'utf7)
+(eval-when-compile (require 'cl-lib))
(declare-function vm-session-initialization
"vm.el" ())
@@ -610,8 +592,7 @@ from which mail is to be moved and DESTINATION is the VM
folder."
:purpose "movemail"))
(or process (throw 'end-of-session nil))
(setq process-buffer (process-buffer process))
- (save-excursion ; = save-current-buffer?
- (set-buffer process-buffer)
+ (with-current-buffer process-buffer
;;--------------------------------
(vm-buffer-type:enter 'process)
;;--------------------------------
@@ -959,7 +940,7 @@ on all the relevant IMAP servers and then immediately
expunges."
(if (zerop delete-count) "No" delete-count)
(if (= delete-count 1) "" "s")))
(insert "VM had problems expunging messages from:\n")
- (nreverse trouble)
+ (setq trouble (nreverse trouble))
(setq mp trouble)
(while mp
(insert " " (car mp) "\n")
@@ -1167,7 +1148,7 @@ of the current folder, or nil if none has been recorded."
"Create a new IMAP session for the IMAP mail box SOURCE, attached to
the current folder.
INTERACTIVE says the operation has been invoked interactively. The
-possible values are t, 'password-only and nil.
+possible values are t, `password-only', and nil.
and the optional argument PURPOSE is inserted in the process
buffer for tracing purposes. Optional argument RETRY says
whether this call is a retry.
@@ -1224,8 +1205,7 @@ Returns the process or nil if the session could not be
created."
(unwind-protect
(catch 'end-of-session
- (save-excursion ; = save-current-buffer?
- (set-buffer imap-buffer)
+ (with-current-buffer imap-buffer
;;----------------------------
(vm-buffer-type:enter 'process)
;;----------------------------
@@ -1487,8 +1467,7 @@ as well."
(when (and process (memq (process-status process) '(open run))
(buffer-live-p (process-buffer process)))
(unwind-protect
- (save-excursion ; = save-current-buffer?
- (set-buffer imap-buffer)
+ (with-current-buffer imap-buffer
;;----------------------------
(vm-buffer-type:enter 'process)
;;----------------------------
@@ -2464,7 +2443,7 @@ May throw exceptions."
"Checks if a REPSONSE from the IMAP server matches the pattern
EXPR. The syntax of patterns is:
- expr ::= quoted-symbol | 'atom | 'string | ('vector expr*) | ('list expr*)
+ EXPR ::= QUOTED-SYMBOL | atom | string | (vector EXPR*) | (list EXPR*)
Numbers are included among atoms."
(let ((case-fold-search t) e r)
@@ -3053,8 +3032,7 @@ server should be issued by UID, not message sequence
number."
(setq flags- (append (cdr copied-flags) flags-))
(unwind-protect
- (save-excursion ; = save-current-buffer?
- (set-buffer (process-buffer process))
+ (with-current-buffer (process-buffer process)
;;----------------------------------
(vm-buffer-type:enter 'process)
;;----------------------------------
@@ -3136,8 +3114,7 @@ MAILBOX."
;;-------------------
)
(unwind-protect
- (save-excursion ; = save-current-buffer?
- (set-buffer (process-buffer process))
+ (with-current-buffer (process-buffer process)
;;----------------------------
(vm-buffer-type:enter 'process)
;;----------------------------
@@ -3279,7 +3256,7 @@ LOCAL-EXPUNGE-LIST: A list of message descriptors for
messages in the
to expunged locally.
STALE-LIST: A list of message descriptors for messages in the
local cache whose UIDVALIDITY values are stale.
-If the argument DO-RETRIEVES is 'full, then all the messages that
+If the argument DO-RETRIEVES is `full', then all the messages that
are not presently in cache are retrieved. Otherwise, the
messages previously retrieved are ignored."
@@ -3358,18 +3335,18 @@ messages previously retrieved are ignored."
"Synchronize IMAP folder with the server.
INTERACTIVE says whether the function was invoked interactively,
e.g., as vm-get-spooled-mail. The possible values are t,
- 'password-only and nil.
+ `password-only', and nil.
DO-REMOTE-EXPUNGES indicates whether the server mail box should be
- expunged. If it is 'all, then all messages not present in the cache folder
+ expunged. If it is `all', then all messages not present in the cache folder
are expunged.
DO-LOCAL-EXPUNGES indicates whether the cache buffer should be
expunged.
DO-RETRIEVES indicates if new messages that are not already in the
- cache should be retrieved from the server. If this flag is 'full
+ cache should be retrieved from the server. If this flag is `full'
then messages previously retrieved but not in cache are retrieved
as well.
SAVE-ATTRIBUTES indicates if the message attributes should be updated on
- the server. If it is 'all, then the attributes of all messages are
+ the server. If it is `all', then the attributes of all messages are
updated irrespective of whether they were modified or not.
RETRIEVE-ATTRIBTUES indicates if the message attributes on the server
should be retrieved, updating the cache.
@@ -3488,7 +3465,7 @@ messages previously retrieved are ignored."
RETRIEVE-LIST and return the list of the retrieved messages. The
RETRIEVE-LIST is a list of cons-pairs (uid . n) of the UID's and
message sequence numbers of messages on the IMAP server. If
-`vm-enable-external-messages' includes 'imap, then messages
+`vm-enable-external-messages' includes `imap', then messages
larger than `vm-imap-max-message-size' are retrieved in
headers-only form."
(let* ((folder-buffer (current-buffer))
@@ -3506,7 +3483,7 @@ headers-only form."
(save-excursion
(vm-inform 6 "%s: Retrieving new messages... "
(buffer-name folder-buffer))
- (vm-save-restriction
+ (save-restriction
(widen)
(setq old-eob (point-max))
(goto-char (point-max))
@@ -3525,8 +3502,7 @@ headers-only form."
(mapcar (function cdr) retrieve-list)))
(unwind-protect
(condition-case error-data
- (save-excursion ; = save-current-buffer?
- (set-buffer (process-buffer process))
+ (with-current-buffer (process-buffer process)
;;----------------------------
(vm-buffer-type:enter 'process)
;;----------------------------
@@ -3667,8 +3643,7 @@ headers-only form."
(setq d-list (vm-imap-bunch-messages
(nreverse (mapcar (function cdr) m-list))))
(setq expunge-count 0) ; number of messages expunged
- (save-excursion ; = save-current-buffer?
- (set-buffer (process-buffer process))
+ (with-current-buffer (process-buffer process)
;;---------------------------
(vm-buffer-type:set 'process)
;;---------------------------
@@ -3850,8 +3825,7 @@ otherwise.
(error "Message has an invalid UID"))
(setq imap-buffer (process-buffer process))
(unwind-protect
- (save-excursion ; = save-current-buffer?
- (set-buffer imap-buffer)
+ (with-current-buffer imap-buffer
;;----------------------------------
(vm-buffer-type:enter 'process)
(vm-imap-session-type:assert-active)
@@ -4204,8 +4178,7 @@ IMAP mailbox spec."
sep p r response need-ok)
(vm-imap-check-connection process)
(unwind-protect
- (save-excursion ; = save-current-buffer?
- (set-buffer (process-buffer process))
+ (with-current-buffer (process-buffer process)
;;----------------------------------
(vm-buffer-type:enter 'process)
(vm-imap-session-type:assert-active)
@@ -4904,4 +4877,5 @@ downloaded bodies will be displayed."
))
+(provide 'vm-imap)
;;; vm-imap.el ends here
diff --git a/lisp/vm-license.el b/lisp/vm-license.el
index 8d77d6940e..2e195c6d1f 100644
--- a/lisp/vm-license.el
+++ b/lisp/vm-license.el
@@ -21,10 +21,7 @@
;;; Code:
-(provide 'vm-license)
-
-(eval-when-compile
- (require 'vm-window))
+(require 'vm-window)
(declare-function Info-goto-node "ext:info" (nodename &optional fork))
@@ -58,4 +55,5 @@
(interactive)
(vm-show-copying-restrictions t))
+(provide 'vm-license)
;;; vm-license.el ends here
diff --git a/lisp/vm-macro.el b/lisp/vm-macro.el
index c1a82d78e6..cf241c1e98 100644
--- a/lisp/vm-macro.el
+++ b/lisp/vm-macro.el
@@ -21,8 +21,6 @@
;;; Code:
-(provide 'vm-macro)
-
;; Definitions for things that aren't in all Emacsen and that we really
;; prefer not to live without.
(eval-and-compile
@@ -43,15 +41,14 @@
(defmacro defvaralias (&rest args)))
(unless (fboundp 'declare-function)
- (defmacro declare-function (fn file &optional arglist fileonly)))
-
- (defmacro vm-interactive-p ()
- (if (featurep 'xemacs)
- `(interactive-p)
- (if (> emacs-major-version 23)
- `(called-interactively-p 'interactive)
- `(interactive-p))))
- )
+ (defmacro declare-function (fn file &optional arglist fileonly))))
+
+(defmacro vm-interactive-p ()
+ (if (featurep 'xemacs)
+ `(interactive-p)
+ (if (fboundp 'called-interactively-p) ;; (> emacs-major-version 23)
+ `(called-interactively-p 'interactive)
+ `(interactive-p))))
(declare-function vm-check-for-killed-summary "vm-misc" ())
(declare-function vm-check-for-killed-presentation "vm-misc" ())
@@ -183,49 +180,9 @@ current-buffer in `vm-user-interaction-buffer'."
((featurep 'xemacs) 'no-conversion)
(t 'raw-text)))
-;;; can't use defsubst where quoting is needed in some places but
+;; can't use defsubst where quoting is needed in some places but
;; not others.
-;; save-restriction flubs restoring the clipping region if you
-;; (widen) and modify text outside the old region.
-;; This should do it right.
-(defmacro vm-save-restriction (&rest forms)
- (let ((vm-sr-clip (make-symbol "vm-sr-clip"))
- (vm-sr-min (make-symbol "vm-sr-min"))
- (vm-sr-max (make-symbol "vm-sr-max")))
- `(let ((,vm-sr-clip (> (buffer-size) (- (point-max) (point-min))))
- ;; this shouldn't be necessary but the
- ;; byte-compiler turns these into interned symbols
- ;; which utterly defeats the purpose of the
- ;; make-symbol calls above. Soooo, until the compiler
- ;; is fixed, these must be made into (let ...)
- ;; temporaries so that nested calls to this macros
- ;; won't misbehave.
- ,vm-sr-min ,vm-sr-max)
- (and ,vm-sr-clip
- (setq ,vm-sr-min (set-marker (make-marker) (point-min)))
- (setq ,vm-sr-max (set-marker (make-marker) (point-max))))
- (unwind-protect
- (progn ,@forms)
- (widen)
- (and ,vm-sr-clip
- (progn
- (narrow-to-region ,vm-sr-min ,vm-sr-max)
- (set-marker ,vm-sr-min nil)
- (set-marker ,vm-sr-max nil)))))))
-
-(put 'vm-save-restriction 'edebug-form-spec t)
-
-(defmacro vm-save-buffer-excursion (&rest forms)
- `(let ((vm-sbe-buffer (current-buffer)))
- (unwind-protect
- (progn ,@forms)
- (and (not (eq vm-sbe-buffer (current-buffer)))
- (buffer-name vm-sbe-buffer)
- (set-buffer vm-sbe-buffer)))))
-
-(put 'vm-save-buffer-excursion 'edebug-form-spec t)
-
(defmacro vm-assert (expression)
(list 'or 'vm-assertion-checking-off
(list 'or expression
@@ -309,4 +266,5 @@ vm-buffer-types stack."
(sleep-for 1)))
+(provide 'vm-macro)
;;; vm-macro.el ends here
diff --git a/lisp/vm-mark.el b/lisp/vm-mark.el
index fee509cef6..fec395f4dc 100644
--- a/lisp/vm-mark.el
+++ b/lisp/vm-mark.el
@@ -21,21 +21,15 @@
;;; Code:
-(provide 'vm-mark)
-
(require 'vm-macro)
-
-(eval-when-compile
- (require 'vm-misc)
- (require 'vm-folder)
- (require 'vm-motion)
- (require 'vm-thread)
- (require 'vm-summary)
- (require 'vm-sort)
- (require 'vm-virtual)
- (require 'vm-window)
- )
-
+(require 'vm-misc)
+(require 'vm-folder)
+(require 'vm-motion)
+(require 'vm-thread)
+(require 'vm-summary)
+(require 'vm-sort)
+(require 'vm-virtual)
+(require 'vm-window)
;;;###autoload
(defun vm-clear-all-marks ()
@@ -200,11 +194,10 @@ previous N-1 messages."
(setq selector (intern (concat "vm-vs-" (symbol-name selector))))
(while mlist
(if (if virtual
- (save-excursion
- (set-buffer
- (vm-buffer-of
- (vm-real-message-of
- (car mlist))))
+ (with-current-buffer
+ (vm-buffer-of
+ (vm-real-message-of
+ (car mlist)))
(apply selector (vm-real-message-of (car mlist)) arglist))
(apply selector (car mlist) arglist))
(progn
@@ -487,4 +480,5 @@ not work."
0
"MM = mark, MU = unmark, Mm = mark all, Mu = unmark all, MN = use marks,
..."))
+(provide 'vm-mark)
;;; vm-mark.el ends here
diff --git a/lisp/vm-menu.el b/lisp/vm-menu.el
index ed8148465c..d72bcffab2 100644
--- a/lisp/vm-menu.el
+++ b/lisp/vm-menu.el
@@ -52,12 +52,8 @@
;;; Code:
-(provide 'vm-menu)
-
-(eval-when-compile
- (require 'vm-misc)
- (require 'vm-mime)
- (require 'vm-delete))
+(require 'vm-misc)
+(require 'vm-mime)
(declare-function event-window "vm-xemacs" (event))
(declare-function event-point "vm-xemacs" (event))
@@ -820,8 +816,7 @@ set to the command name so that window configuration will
be done."
(defun vm-menu--global-menubar ()
(if (featurep 'xemacs)
- (save-excursion
- (set-buffer (get-buffer-create "*scratch*"))
+ (with-current-buffer (get-buffer-create "*scratch*")
current-menubar)
(lookup-key (current-global-map) [menu-bar])))
@@ -1676,4 +1671,5 @@ for the current directory (.) is inserted."
)
)
+(provide 'vm-menu)
;;; vm-menu.el ends here
diff --git a/lisp/vm-message-history.el b/lisp/vm-message-history.el
index 5e1f8ed267..0d8dde5d49 100644
--- a/lisp/vm-message-history.el
+++ b/lisp/vm-message-history.el
@@ -51,17 +51,12 @@
;;; Code:
-(provide 'vm-message-history)
-
-(eval-and-compile
- (require 'easymenu)
- (require 'vm-menu)
- (require 'vm-misc)
- (require 'vm-summary)
- (require 'vm-page)
- (require 'vm-window)
- (require 'vm-motion)
-)
+(require 'easymenu)
+(require 'vm-menu)
+(require 'vm-misc)
+(require 'vm-summary)
+(require 'vm-window)
+(require 'vm-motion)
(defgroup vm-message-history nil
"Message history for VM folders."
@@ -239,4 +234,5 @@ With prefix ARG, select the ARG'th next message."
(add-hook 'vm-select-message-hook 'vm-message-history-add)
+(provide 'vm-message-history)
;;; vm-message-history.el ends here
diff --git a/lisp/vm-message.el b/lisp/vm-message.el
index ab29cdd5c5..c805de3c25 100644
--- a/lisp/vm-message.el
+++ b/lisp/vm-message.el
@@ -22,9 +22,8 @@
;;; Code:
-(provide 'vm-message)
-
(require 'vm-macro)
+(require 'vm-vars)
(eval-when-compile (require 'cl-lib))
(declare-function vm-mime-encode-words-in-string "vm-mime" (string))
@@ -727,8 +726,7 @@ works in all VM buffers."
mvec ))
(defun vm-find-and-set-text-of (m)
- (save-excursion
- (set-buffer (vm-buffer-of m))
+ (with-current-buffer (vm-buffer-of m)
(save-restriction
(widen)
(goto-char (vm-headers-of m))
@@ -776,4 +774,5 @@ the headers/body of M."
(vm-zip-vectors vm-mirror-data-fields (vm-mirror-data-of m))))
nil)
+(provide 'vm-message)
;;; vm-message.el ends here
diff --git a/lisp/vm-mime.el b/lisp/vm-mime.el
index c488a97187..196f230ef4 100644
--- a/lisp/vm-mime.el
+++ b/lisp/vm-mime.el
@@ -21,30 +21,12 @@
;;; Code:
-(provide 'vm-mime)
-
(require 'vm-macro)
-
-(eval-and-compile
- (require 'vm-misc))
-
-(eval-when-compile
- (require 'cl-lib)
- (require 'vm-minibuf)
- (require 'vm-toolbar)
- (require 'vm-mouse)
- (require 'vm-summary)
- (require 'vm-folder)
- (require 'vm-menu)
- (require 'vm-crypto)
- (require 'vm-window)
- (require 'vm-page)
- (require 'vm-motion)
- (require 'vm-reply)
- (require 'vm-digest)
- (require 'vm-edit)
- (require 'smime)
- )
+(require 'vm-reply) ;vm-mail-mode-show-headers
+(require 'vm-summary)
+(require 'sendmail)
+(require 'smime)
+(eval-when-compile (require 'cl-lib))
;; vm-xemacs.el is a fake file to fool the Emacs 23 compiler
(declare-function get-itimer "vm-xemacs" (name))
@@ -108,22 +90,21 @@
;; A lot of the more complicated MIME character set processing is only
;; practical under MULE.
-(eval-when-compile
- (defvar latin-unity-ucs-list)
- (defvar latin-unity-character-sets)
- (defvar coding-system-list))
+(defvar latin-unity-ucs-list)
+(defvar latin-unity-character-sets)
+(defvar coding-system-list)
(defun vm-get-coding-system-priorities ()
"Return the value of `vm-coding-system-priorities', or a reasonable
default for it if it's nil. "
- (if vm-coding-system-priorities
- vm-coding-system-priorities
- (let ((res '(iso-8859-1 iso-8859-2 iso-8859-15 iso-8859-16 utf-8)))
- (dolist (list-item res)
- ;; Assumes iso-8859-1 is always available, which is reasonable.
- (unless (vm-coding-system-p list-item)
- (delq list-item res)))
- res)))
+ (or vm-coding-system-priorities
+ ;; FIXME: `utf-8' should be first nowadays!
+ (let ((res '(iso-8859-1 iso-8859-2 iso-8859-15 iso-8859-16 utf-8)))
+ (dolist (list-item res)
+ ;; Assumes iso-8859-1 is always available, which is reasonable.
+ (unless (vm-coding-system-p list-item)
+ (setq res (remq list-item res))))
+ res)))
(defun vm-mime-charset-to-coding (charset)
"Return the Emacs coding system corresonding to the given mime CHARSET."
@@ -159,13 +140,12 @@ default for it if it's nil. "
it's nil. This is used instead of `vm-mime-ucs-list' directly in order to
allow runtime checks for optional features like `mule-ucs' or
`latin-unity'. "
- (if vm-mime-ucs-list
- vm-mime-ucs-list
- (if (featurep 'latin-unity)
- latin-unity-ucs-list
- (if (vm-coding-system-p 'utf-8)
- '(utf-8 iso-2022-jp ctext escape-quoted)
- '(iso-2022-jp ctext escape-quoted)))))
+ (or vm-mime-ucs-list
+ (if (featurep 'latin-unity)
+ latin-unity-ucs-list
+ (if (vm-coding-system-p 'utf-8)
+ '(utf-8 iso-2022-jp ctext escape-quoted)
+ '(iso-2022-jp ctext escape-quoted)))))
(defun vm-update-mime-charset-maps ()
"Check for the presence of certain Mule coding systems, and add
@@ -198,10 +178,6 @@ configuration. "
(add-to-list 'vm-mime-mule-coding-to-charset-alist
'(iso-8859-1 "iso-8859-1")))
-(eval-when-compile
- (when (not (featurep 'xemacs))
- (defvar latin-unity-character-sets nil)))
-
(when (featurep 'xemacs)
(require 'vm-vars)
(vm-update-mime-charset-maps)
@@ -430,8 +406,7 @@ freshly parsing the message contents."
(progn (setq m (vm-real-message-of m))
(vm-set-mime-encoded-header-flag-of
m
- (save-excursion
- (set-buffer (vm-buffer-of m))
+ (with-current-buffer (vm-buffer-of m)
(save-excursion
(save-restriction
(widen)
@@ -517,8 +492,7 @@ same effect."
coding-system foo))
(setq start (point-min) end (point-max))
(setq retval (buffer-size))
- (save-excursion
- (set-buffer b)
+ (with-current-buffer b
(goto-char b-start)
(insert-buffer-substring work-buffer start end)
(delete-region (point) (+ (point) oldsize))
@@ -548,8 +522,7 @@ same effect."
coding-system foo))
(and (not (featurep 'xemacs)) (set-buffer-multibyte t)) ; is this
safe?
(setq start (point-min) end (point-max))
- (save-excursion
- (set-buffer b)
+ (with-current-buffer b
(goto-char b-start)
(delete-region (point) (+ (point) oldsize))
(insert-buffer-substring work-buffer start end)
@@ -599,89 +572,11 @@ out includes base-64, quoted-printable, uuencode and CRLF
conversion."
(or (markerp end) (setq end (vm-marker end)))
(and (> (- end start) 10000)
(vm-emit-mime-decoding-message "Decoding base64..."))
- (let ((work-buffer nil)
- (done nil)
- (counter 0)
- (bits 0)
- (lim 0) inputpos
- (non-data-chars (concat "^=" vm-mime-base64-alphabet)))
- (unwind-protect
- (save-excursion
- (cond
- ((and (featurep 'base64)
- (fboundp 'base64-decode-region)
- ;; W3 reportedly has a Lisp version of this, and
- ;; there's no point running it.
- (subrp (symbol-function 'base64-decode-region))
- ;; The FSF Emacs version of this is unforgiving
- ;; of errors, which is not in the spirit of the
- ;; MIME spec, so avoid using it.
- ;; Let us try it out now. USR, 2012-10-19
- ;; (not (not (featurep 'xemacs)))
- )
- (condition-case data
- (base64-decode-region start end)
- (error (vm-mime-error "%S" data)))
- (and crlf (vm-mime-crlf-to-lf-region start end)))
- (t
- (setq work-buffer (vm-make-work-buffer))
- (if vm-mime-base64-decoder-program
- (let* ((binary-process-output t) ; any text already has CRLFs
- ;; use binary coding system in FSF Emacs/MULE
- (coding-system-for-read (vm-binary-coding-system))
- (coding-system-for-write (vm-binary-coding-system))
- (status (apply 'vm-run-command-on-region
- start end work-buffer
- vm-mime-base64-decoder-program
- vm-mime-base64-decoder-switches)))
- (if (not (eq status t))
- (vm-mime-error "base64-decode failed: %s" (cdr status))))
- (goto-char start)
- (skip-chars-forward non-data-chars end)
- (while (not done)
- (setq inputpos (point))
- (cond
- ((> (skip-chars-forward vm-mime-base64-alphabet end) 0)
- (setq lim (point))
- (while (< inputpos lim)
- (setq bits (+ bits
- (aref vm-mime-base64-alphabet-decoding-vector
- (char-after inputpos))))
- (vm-increment counter)
- (vm-increment inputpos)
- (cond ((= counter 4)
- (vm-insert-char (lsh bits -16) 1 nil work-buffer)
- (vm-insert-char (logand (lsh bits -8) 255) 1 nil
- work-buffer)
- (vm-insert-char (logand bits 255) 1 nil work-buffer)
- (setq bits 0 counter 0))
- (t (setq bits (lsh bits 6)))))))
- (cond
- ((= (point) end)
- (if (not (zerop counter))
- (vm-mime-error "at least %d bits missing at end of base64
encoding"
- (* (- 4 counter) 6)))
- (setq done t))
- ((= (char-after (point)) 61) ; 61 is ASCII equals
- (setq done t)
- (cond ((= counter 1)
- (vm-mime-error "at least 2 bits missing at end of
base64 encoding"))
- ((= counter 2)
- (vm-insert-char (lsh bits -10) 1 nil work-buffer))
- ((= counter 3)
- (vm-insert-char (lsh bits -16) 1 nil work-buffer)
- (vm-insert-char (logand (lsh bits -8) 255)
- 1 nil work-buffer))
- ((= counter 0) t)))
- (t (skip-chars-forward non-data-chars end)))))
- (and crlf
- (save-excursion
- (set-buffer work-buffer)
- (vm-mime-crlf-to-lf-region (point-min) (point-max))))
- (goto-char start)
- (insert-buffer-substring work-buffer)
- (delete-region (point) end))))
- (and work-buffer (kill-buffer work-buffer))))
+ (save-excursion
+ (condition-case data
+ (base64-decode-region start end)
+ (error (vm-mime-error "%S" data)))
+ (and crlf (vm-mime-crlf-to-lf-region start end)))
(and (> (- end start) 10000)
(vm-emit-mime-decoding-message "Decoding base64... done")))
@@ -689,97 +584,28 @@ out includes base-64, quoted-printable, uuencode and CRLF
conversion."
(or (markerp end) (setq end (vm-marker end)))
(and (> (- end start) 200)
(vm-inform 7 "Encoding base64..."))
- (let ((work-buffer nil)
- (buffer-undo-list t)
- (counter 0)
- (cols 0)
- (bits 0)
- (alphabet vm-mime-base64-alphabet)
- inputpos)
- (unwind-protect
- (save-excursion
- (and crlf (vm-mime-lf-to-crlf-region start end))
- (cond
- ((and (featurep 'base64)
- (fboundp 'base64-encode-region)
- ;; W3 reportedly has a Lisp version of this, and
- ;; there's no point running it.
- (subrp (symbol-function 'base64-encode-region)))
- (condition-case data
- (base64-encode-region start end B-encoding)
- (wrong-number-of-arguments
- ;; call with two args and then strip out the
- ;; newlines if we're doing B encoding.
- (condition-case data
- (base64-encode-region start end)
- (error (vm-mime-error "%S" data)))
- (if B-encoding
- (save-excursion
- (goto-char start)
- (while (search-forward "\n" end t)
- (delete-char -1)))))
- (error (vm-mime-error "%S" data))))
- (t
- (setq work-buffer (vm-make-work-buffer))
- (if vm-mime-base64-encoder-program
- (let ((status (apply 'vm-run-command-on-region
- start end work-buffer
- vm-mime-base64-encoder-program
- vm-mime-base64-encoder-switches)))
- (if (not (eq status t))
- (vm-mime-error "base64-encode failed: %s" (cdr status)))
- (if B-encoding
- (save-excursion
- (set-buffer work-buffer)
- ;; if we're B encoding, strip out the line breaks
- (goto-char (point-min))
- (while (search-forward "\n" nil t)
- (delete-char -1)))))
- (setq inputpos start)
- (while (< inputpos end)
- (setq bits (+ bits (char-after inputpos)))
- (vm-increment counter)
- (cond ((= counter 3)
- (vm-insert-char (aref alphabet (lsh bits -18)) 1 nil
- work-buffer)
- (vm-insert-char (aref alphabet (logand (lsh bits -12)
63))
- 1 nil work-buffer)
- (vm-insert-char (aref alphabet (logand (lsh bits -6) 63))
- 1 nil work-buffer)
- (vm-insert-char (aref alphabet (logand bits 63)) 1 nil
- work-buffer)
- (setq cols (+ cols 4))
- (cond ((= cols 72)
- (setq cols 0)
- (if (not B-encoding)
- (vm-insert-char ?\n 1 nil work-buffer))))
- (setq bits 0 counter 0))
- (t (setq bits (lsh bits 8))))
- (vm-increment inputpos))
- ;; write out any remaining bits with appropriate padding
- (if (= counter 0)
- nil
- (setq bits (lsh bits (- 16 (* 8 counter))))
- (vm-insert-char (aref alphabet (lsh bits -18)) 1 nil
- work-buffer)
- (vm-insert-char (aref alphabet (logand (lsh bits -12) 63))
- 1 nil work-buffer)
- (if (= counter 1)
- (vm-insert-char ?= 2 nil work-buffer)
- (vm-insert-char (aref alphabet (logand (lsh bits -6) 63))
- 1 nil work-buffer)
- (vm-insert-char ?= 1 nil work-buffer)))
- (if (> cols 0)
- (vm-insert-char ?\n 1 nil work-buffer)))
- (or (markerp end) (setq end (vm-marker end)))
- (goto-char start)
- (insert-buffer-substring work-buffer)
- (delete-region (point) end)))
- (and (> (- end start) 200)
- (vm-inform 7 "Encoding base64... done"))
- (- end start))
- (and work-buffer (kill-buffer work-buffer)))))
-
+ (let ((buffer-undo-list t)) ;; FIXME: Really?
+ (save-excursion
+ (and crlf (vm-mime-lf-to-crlf-region start end))
+ (condition-case data
+ (base64-encode-region start end B-encoding)
+ (wrong-number-of-arguments
+ ;; call with two args and then strip out the
+ ;; newlines if we're doing B encoding.
+ (condition-case data
+ (base64-encode-region start end)
+ (error (vm-mime-error "%S" data)))
+ (if B-encoding
+ (save-excursion
+ (goto-char start)
+ (while (search-forward "\n" end t)
+ (delete-char -1)))))
+ (error (vm-mime-error "%S" data)))
+ (and (> (- end start) 200)
+ (vm-inform 7 "Encoding base64... done"))
+ (- end start))))
+
+;; FIXME: Use `quoted-printable-decode-region'!
(defun vm-mime-qp-decode-region (start end)
(and (> (- end start) 10000)
(vm-emit-mime-decoding-message "Decoding quoted-printable..."))
@@ -821,8 +647,7 @@ out includes base-64, quoted-printable, uuencode and CRLF
conversion."
(setq copy-point (point))
(goto-char stop-point))
(t (setq copy-point stop-point)))
- (save-excursion
- (set-buffer work-buffer)
+ (with-current-buffer work-buffer
(insert-buffer-substring buf inputpos copy-point))
(cond ((= (point) end) t)
((looking-at "\n")
@@ -864,6 +689,7 @@ out includes base-64, quoted-printable, uuencode and CRLF
conversion."
(and (> (- end start) 10000)
(vm-emit-mime-decoding-message "Decoding quoted-printable... done")))
+;; FIXME: Use `quoted-printable-encode-region'!
(defun vm-mime-qp-encode-region (start end &optional Q-encoding quote-from)
(and (> (- end start) 200)
(vm-inform 7 "Encoding quoted-printable..."))
@@ -891,14 +717,12 @@ out includes base-64, quoted-printable, uuencode and CRLF
conversion."
(if (not (eq status t))
(vm-mime-error "qp-encode failed: %s" (cdr status)))
(if quote-from
- (save-excursion
- (set-buffer work-buffer)
+ (with-current-buffer work-buffer
(goto-char (point-min))
(while (re-search-forward "^From " nil t)
(replace-match "=46rom " t t))))
(if Q-encoding
- (save-excursion
- (set-buffer work-buffer)
+ (with-current-buffer work-buffer
;; strip out the line breaks
(goto-char (point-min))
(while (search-forward "=\n" nil t)
@@ -931,7 +755,7 @@ out includes base-64, quoted-printable, uuencode and CRLF
conversion."
(and (= cols 0) (= char ?.)
(looking-at "\\.\\(\n\\|\\'\\)")))
(vm-insert-char ?= 1 nil work-buffer)
- (vm-insert-char (car (rassq (lsh (logand char 255) -4)
+ (vm-insert-char (car (rassq (ash (logand char 255) -4)
hex-digit-alist))
1 nil work-buffer)
(vm-insert-char (car (rassq (logand char 15)
@@ -1563,8 +1387,7 @@ shorter pieces, rebuild it from them."
a string denoting the folder name."
(let ((pres-buf (vm-generate-new-multibyte-buffer
(concat name " Presentation"))))
- (save-excursion
- (set-buffer pres-buf)
+ (with-current-buffer pres-buf
(buffer-disable-undo (current-buffer))
(setq mode-name "VM Presentation"
major-mode 'vm-presentation-mode
@@ -1618,8 +1441,7 @@ source of the message."
(when (fboundp 'remove-specifier)
(remove-specifier (face-foreground 'default) pres-buf)
(remove-specifier (face-background 'default) pres-buf))
- (save-excursion
- (set-buffer (vm-buffer-of real-m))
+ (with-current-buffer (vm-buffer-of real-m)
(save-restriction
(widen)
;; must reference this now so that headers will be in
@@ -1852,22 +1674,22 @@ etc. Only when displaying it the actual message is
fetched based
on the storage handler.
The information about the actual message is stored in the
-\"^X-VM-Storage:\" header and should be a lisp list of the
+\"^X-VM-Storage:\" header and should be a Lisp list of the
following format.
- \(HANDLER ARGS...\)
+ (HANDLER ARGS...)
HANDLER should correspond to a `vm-fetch-HANDLER-message'
function, e.g., the handler `file' corresponds to the function
`vm-fetch-file-message' which gets two arguments, the message
descriptor and the filename containing the message, and inserts the
-message body from the file into the current buffer.
+message body from the file into the current buffer. For example,
+
+ X-VM-Storage: (file \"message-11\")
-For example, 'X-VM-Storage: (file \"message-11\")' will fetch
-the actual message from the file \"message-11\"."
+will fetch the actual message from the file \"message-11\"."
(goto-char (match-end 0))
- (save-excursion
- (set-buffer (marker-buffer (vm-text-of mm)))
+ (with-current-buffer (marker-buffer (vm-text-of mm))
(let ((buffer-read-only nil)
(inhibit-read-only t)
(buffer-undo-list t)
@@ -2552,7 +2374,7 @@ The second time, buttons for all the objects are
displayed instead.
The third time, the raw, undecoded data is displayed.
The optional argument STATE can specify which decode state to display:
-'decoded, 'button or 'undecoded.
+`decoded', `button', or `undecoded'.
If decoding, the decoded objects might be displayed immediately, or
buttons might be displayed that you need to activate to view the
@@ -2627,7 +2449,7 @@ in the buffer. The function is expected to make the
message
(let ((vm-display-using-mime nil))
(vm-show-current-message)))
(setq m (car vm-message-pointer))
- (vm-save-restriction
+ (save-restriction
(widen)
(goto-char (vm-text-of m))
(let ((buffer-read-only nil)
@@ -2687,7 +2509,7 @@ If DONT-HONOR-C-D non-Nil, then don't honor the
Content-Disposition
declarations in the attachments and make a decision independently.
LAYOUT can be a mime layout vector. It can also be a button
-extent in the current buffer, in which case the 'vm-mime-layout
+extent in the current buffer, in which case the `vm-mime-layout'
property of the overlay will be extracted. The button may be
deleted.
@@ -3360,7 +3182,7 @@ emacs-w3m."
vm-digest-identifier-header-format
(vm-mm-layout-message layout))))
(vm-mime-burst-layout layout ident-header))
- (vm-save-buffer-excursion
+ (save-current-buffer
(vm-goto-new-folder-frame-maybe 'folder)
(vm-mode)
(if (vm-should-generate-summary)
@@ -3416,7 +3238,7 @@ emacs-w3m."
(setq vm-folder-type vm-default-folder-type)
(vm-mime-burst-layout layout nil)
(set-buffer-modified-p nil)
- (vm-save-buffer-excursion
+ (save-current-buffer
(vm-goto-new-folder-frame-maybe 'folder)
(vm-mode)
(if (vm-should-generate-summary)
@@ -3656,8 +3478,7 @@ button that this LAYOUT comes from."
vm-wget-program "-q" "-O" "-" url)
(error nil)))
t
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(erase-buffer)
nil )))
((if (and (memq 'w3m vm-url-retrieval-methods)
@@ -3667,8 +3488,7 @@ button that this LAYOUT comes from."
vm-w3m-program "-dump_source" url)
(error nil)))
t
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(erase-buffer)
nil )))
((if (and (memq 'fetch vm-url-retrieval-methods)
@@ -3678,8 +3498,7 @@ button that this LAYOUT comes from."
vm-fetch-program "-o" "-" url)
(error nil)))
t
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(erase-buffer)
nil )))
((if (and (memq 'curl vm-url-retrieval-methods)
@@ -3689,8 +3508,7 @@ button that this LAYOUT comes from."
vm-curl-program url)
(error nil)))
t
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(erase-buffer)
nil )))
((if (and (memq 'lynx vm-url-retrieval-methods)
@@ -3700,13 +3518,10 @@ button that this LAYOUT comes from."
vm-lynx-program "-source" url)
(error nil)))
t
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(erase-buffer)
nil )))))
- (save-excursion
- (set-buffer buffer)
- (not (zerop (buffer-size))))))
+ (not (zerop (buffer-size buffer)))))
(defun vm-mime-internalize-local-external-bodies (layout)
"Given a LAYOUT representing a message/external-body object, convert
@@ -3722,24 +3537,23 @@ it to an internal object by retrieving the body.
USR, 2011-03-28"
(vm-make-multibyte-work-buffer
(format "*%s mime object*"
(car (vm-mm-layout-type child-layout))))))
- (unwind-protect
- (let (oldsize)
- (with-current-buffer work-buffer
- (vm-mime-retrieve-external-body layout))
- (goto-char (vm-mm-layout-body-start child-layout))
- (setq oldsize (buffer-size))
- (condition-case data
- (insert-buffer-substring work-buffer)
- (error (signal 'vm-mime-error (cdr data))))
- ;; This is redundant because insertion moves point
- ;; (goto-char (+ (point) (- (buffer-size) oldsize)))
- (if (< (point) (vm-mm-layout-body-end child-layout))
- (delete-region (point)
- (vm-mm-layout-body-end child-layout))
- (vm-set-mm-layout-body-end child-layout (point-marker)))
- (delete-region (vm-mm-layout-header-start layout)
- (vm-mm-layout-body-start layout))
- (vm-mime-copy-layout child-layout layout)))
+ (let (oldsize)
+ (with-current-buffer work-buffer
+ (vm-mime-retrieve-external-body layout))
+ (goto-char (vm-mm-layout-body-start child-layout))
+ (setq oldsize (buffer-size))
+ (condition-case data
+ (insert-buffer-substring work-buffer)
+ (error (signal 'vm-mime-error (cdr data))))
+ ;; This is redundant because insertion moves point
+ ;; (goto-char (+ (point) (- (buffer-size) oldsize)))
+ (if (< (point) (vm-mm-layout-body-end child-layout))
+ (delete-region (point)
+ (vm-mm-layout-body-end child-layout))
+ (vm-set-mm-layout-body-end child-layout (point-marker)))
+ (delete-region (vm-mm-layout-header-start layout)
+ (vm-mm-layout-body-start layout))
+ (vm-mime-copy-layout child-layout layout))
(when work-buffer (kill-buffer work-buffer)))))
((vm-mime-composite-type-p (car (vm-mm-layout-type layout)))
(let ((p (vm-mm-layout-parts layout)))
@@ -3772,8 +3586,7 @@ it to an internal object by retrieving the body.
USR, 2011-03-28"
(if (null id)
(vm-mime-error
"message/partial message missing id parameter"))
- (save-excursion
- (set-buffer (marker-buffer (vm-mm-layout-body-start layout)))
+ (with-current-buffer (marker-buffer (vm-mm-layout-body-start layout))
(save-excursion
(save-restriction
(widen)
@@ -3873,7 +3686,7 @@ it to an internal object by retrieving the body.
USR, 2011-03-28"
(insert (vm-trailing-message-separator))
(set-buffer-modified-p nil)
(vm-inform 6 "Assembling message... done")
- (vm-save-buffer-excursion
+ (save-current-buffer
(vm-goto-new-folder-frame-maybe 'folder)
(vm-mode)
(if (vm-should-generate-summary)
@@ -3967,8 +3780,7 @@ describing the image type.
USR, 2011-03-25"
(vm-set-extent-property e 'vm-mime-layout layout)
(vm-set-extent-property e 'vm-mime-disposable t)
(vm-set-extent-property e 'keymap keymap)
- (save-excursion
- (set-buffer (process-buffer process))
+ (with-current-buffer (process-buffer process)
(set (make-local-variable 'vm-image-list) image-list)
(set (make-local-variable 'vm-image-type) image-type)
(set (make-local-variable 'vm-image-type-name)
@@ -4086,8 +3898,7 @@ describing the image type.
USR, 2011-03-25"
(overlay-put o 'vm-mime-disposable t)
(if vm-use-menus
(overlay-put o 'vm-image vm-menu-fsfemacs-image-menu))
- (save-excursion
- (set-buffer (process-buffer process))
+ (with-current-buffer (process-buffer process)
(set (make-local-variable 'vm-image-list) image-list)
(set (make-local-variable 'vm-image-type) image-type)
(set (make-local-variable 'vm-image-type-name)
@@ -4235,8 +4046,7 @@ describing the image type.
USR, 2011-03-25"
(and work-buffer (kill-buffer work-buffer)))))
(defun vm-process-sentinel-display-image-strips (process what-happened)
- (save-excursion
- (set-buffer (process-buffer process))
+ (with-current-buffer (process-buffer process)
(cond ((and (boundp 'vm-extent-list)
(boundp 'vm-image-list))
(let ((strips vm-image-list)
@@ -4284,8 +4094,7 @@ describing the image type.
USR, 2011-03-25"
(defun vm-display-image-strips-on-overlay-regions (strips overlays image-type)
(let (prop value omodified)
- (save-excursion
- (set-buffer (overlay-buffer (car vm-overlay-list)))
+ (with-current-buffer (overlay-buffer (car vm-overlay-list))
(setq omodified (buffer-modified-p))
(save-restriction
(widen)
@@ -4316,8 +4125,7 @@ describing the image type.
USR, 2011-03-25"
(setq which-strips (cons (string-to-number (match-string 1 output))
which-strips)
i (match-end 0)))
- (save-excursion
- (set-buffer (process-buffer process))
+ (with-current-buffer (process-buffer process)
(cond ((and (boundp 'vm-extent-list)
(boundp 'vm-image-list))
(let ((strips vm-image-list)
@@ -4370,8 +4178,7 @@ describing the image type.
USR, 2011-03-25"
(defun vm-display-some-image-strips-on-overlay-regions
(strips overlays image-type which-strips)
(let (sss ooo prop value omodified)
- (save-excursion
- (set-buffer (overlay-buffer (car vm-overlay-list)))
+ (with-current-buffer (overlay-buffer (car vm-overlay-list))
(setq omodified (buffer-modified-p))
(save-restriction
(widen)
@@ -4471,7 +4278,7 @@ The return value does not seem to be meaningful. USR,
2011-03-25"
(defun vm-mark-image-tempfile-as-message-garbage-once (layout tempfile)
"Register image TEMPFILE used for MIME LAYOUT as a message garbage
-file, and set the 'vm-message-garbage property of LAYOUT. This
+file, and set the `vm-message-garbage' property of LAYOUT. This
feature is currently not in use. USR, 2012-11-17"
(if (get (vm-mm-layout-cache layout) 'vm-message-garbage)
nil
@@ -4682,7 +4489,7 @@ expanded to display the mime object."
;;;###autoload
(defun vm-mime-run-display-function-at-point (&optional function)
- "Run the 'vm-mime-function for the MIME button at point.
+ "Run the `vm-mime-function' for the MIME button at point.
If optional argument FUNCTION is given, run it instead.
USR, 2011-03-07"
(interactive)
@@ -5830,8 +5637,8 @@ Returns non-NIL value M is a plain message."
(random t)
(while (< i (length boundary))
(aset boundary i (aref vm-mime-base64-alphabet
- (% (vm-abs (lsh (random) -8))
- (length vm-mime-base64-alphabet))))
+ (random
+ (length vm-mime-base64-alphabet))))
(vm-increment i))
boundary ))
@@ -6385,7 +6192,9 @@ there is no file name for this object. USR,
2011-03-07"
;; either vm-mime-forward-local-external-bodies is t
;; or vm-mime-forward-saved-attachments is nil
;; Otherwise, expand the external-body parts
- (fb (list (or vm-mime-forward-local-external-bodies
+ (fb (list (or (with-suppressed-warnings
+ ((obsolete vm-mime-forward-local-external-bodies))
+ vm-mime-forward-local-external-bodies)
(not vm-mime-forward-saved-attachments)))))
(cond ((and (stringp object) (not mimed))
(if (or (vm-mime-types-match "application" type)
@@ -6598,7 +6407,7 @@ extents are created for the purpose of this function.
USR, 2011-03-27"
(defun vm-mime-fake-attachment-overlays (start end &optional prop)
"For all attachment buttons in the region, i.e., pieces of text
with the given text property PROP, create \"fake\" attachment
-overlays with the 'vm-mime-object property. The list of these
+overlays with the `vm-mime-object' property. The list of these
overlays is returned.
This function is only used with GNU Emacs, not XEmacs. USR, 2011-02-19"
@@ -6800,7 +6609,7 @@ describes what was deleted."
opos
(buffer-read-only nil))
(save-excursion
- (vm-save-restriction
+ (save-restriction
(goto-char (vm-extent-start-position e))
(setq opos (point))
(setq label (vm-mime-sprintf
@@ -6829,7 +6638,7 @@ describes what was deleted."
(not (eq (marker-buffer (vm-mm-layout-body-start layout))
(current-buffer))))
(error "MIME body is not in the message"))
- (vm-save-restriction
+ (save-restriction
(widen)
(if (vm-mm-layout-is-converted layout)
(setq layout (vm-mm-layout-unconverted-layout layout)))
@@ -6909,9 +6718,10 @@ describes what was deleted."
(vm-set-mm-layout-display-error layout nil)))))))
(defun vm-mime-encode-words (&optional encoding)
- "MIME encode all words in the current buffer. The optional argument
-ENCODING can be 'Q or 'B (for quoted-printable and base64
-respectively). If none is specified, quoted-printbale is used."
+ "MIME encode all words in the current buffer.
+The optional argument ENCODING can be the symbol `Q' or `B' (for
+quoted-printable and base64 respectively).
+If none is specified, quoted-printable is used."
(goto-char (point-min))
;; find right encoding
@@ -6989,7 +6799,7 @@ should be encoded together."
(setq end (or (and (re-search-forward "^[^ \t:]+:" body-start t)
(match-beginning 0))
body-start)))
- (vm-save-restriction
+ (save-restriction
(narrow-to-region start end)
(vm-mime-encode-words))
(goto-char end)))))
@@ -8159,11 +7969,9 @@ the first sub part of a multipart/alternative is a
text/plain part."
(when (and nuke-html
(member "multipart/alternative" parent-types)
(vm-mime-types-match "text/html" this-type))
- (save-excursion
- (set-buffer (vm-buffer-of m))
- (let ((inhibit-read-only t)
- (buffer-read-only nil))
- (vm-save-restriction
+ (with-current-buffer (vm-buffer-of m)
+ (let ((buffer-read-only nil))
+ (save-restriction
(widen)
(if (vm-mm-layout-is-converted layout)
(setq layout (vm-mm-layout-unconverted-layout layout)))
@@ -8381,4 +8189,5 @@ buffer."
(insert-buffer-substring buffer))
+(provide 'vm-mime)
;;; vm-mime.el ends here
diff --git a/lisp/vm-minibuf.el b/lisp/vm-minibuf.el
index 941759ed44..c3e547d92a 100644
--- a/lisp/vm-minibuf.el
+++ b/lisp/vm-minibuf.el
@@ -21,14 +21,8 @@
;;; Code:
-(provide 'vm-minibuf)
-
(require 'vm-macro)
-
-(eval-when-compile
- (require 'vm-misc)
- (require 'vm-mouse)
- )
+(require 'vm-mouse)
(declare-function button-press-event-p "vm-xemacs" (object))
(declare-function button-release-event-p "vm-xemacs" (object))
@@ -176,8 +170,7 @@ to the calling program."
(defun vm-minibuffer-show-completions (list)
"Display LIST in a multi-column listing in the \" *Completions*\" buffer.
LIST should be a list of strings."
- (save-excursion
- (set-buffer (get-buffer-create " *Completions*"))
+ (with-current-buffer (get-buffer-create " *Completions*")
(setq buffer-read-only nil)
(use-local-map (make-sparse-keymap))
;; ignore vm-mutable-* here. the user shouldn't mind
@@ -379,4 +372,5 @@ click mouse triggered the current command."
;; predicate, require-match, initial-input, hist
nil t nil nil))
+(provide 'vm-minibuf)
;;; vm-minibuf.el ends here
diff --git a/lisp/vm-misc.el b/lisp/vm-misc.el
index 01c3fd1638..0643af83d2 100644
--- a/lisp/vm-misc.el
+++ b/lisp/vm-misc.el
@@ -22,12 +22,9 @@
;;; Code:
-(provide 'vm-misc)
-
(require 'vm-macro)
-
-;; (eval-when-compile
-;; (require 'vm-misc))
+(require 'vm-message)
+(require 'vm-vars)
;; vm-xemacs.el is a fake file to fool the Emacs 23 compiler
(declare-function find-coding-system "vm-xemacs" (coding-system-or-name))
@@ -376,7 +373,7 @@ need to add quotes or leave them undecoded. RWF"
(defun vm-write-string (where string)
(if (bufferp where)
- (vm-save-buffer-excursion
+ (save-current-buffer
(set-buffer where)
(goto-char (point-max))
(let ((buffer-read-only nil))
@@ -615,8 +612,8 @@ LIST2 satisfying PRED and return the position"
(defun vm-fsfemacs-device-type (&optional _device)
"An FSF Emacs emulation for XEmacs `device-type' function. Returns
-the type of the current screen device: one of 'x, 'gtk, 'w32, 'ns and
-'pc. The optional argument DEVICE is ignored."
+the type of the current screen device: one of `x', `gtk', `w32', `ns', and
+`pc'. The optional argument DEVICE is ignored."
(if (eq window-system 'x)
(if (featurep 'gtk) 'gtk)
window-system))
@@ -822,7 +819,7 @@ If HACK-ADDRESSES is t, then the strings are considered to
be mail addresses,
(defun vm-run-hook-on-message (hook-variable message)
(with-current-buffer (vm-buffer-of message)
- (vm-save-restriction
+ (save-restriction
(widen)
(save-excursion
(narrow-to-region (vm-headers-of message) (vm-text-end-of message))
@@ -834,7 +831,7 @@ If HACK-ADDRESSES is t, then the strings are considered to
be mail addresses,
(defun vm-run-hook-on-message-with-args (hook-variable message &rest args)
(with-current-buffer (vm-buffer-of message)
- (vm-save-restriction
+ (save-restriction
(widen)
(save-excursion
(narrow-to-region (vm-headers-of message) (vm-text-end-of message))
@@ -1491,7 +1488,7 @@ Returns t if there was a line longer than `fill-column'."
(defun vm-fill-paragraphs-containing-long-lines (width start end)
"Fill paragraphs spanning more than WIDTH columns in region
-START to END. If WIDTH is 'window-width, the current width of
+START to END. If WIDTH is `window-width', the current width of
the Emacs window is used. If vm-word-wrap-paragraphs is set
non-nil, then the longlines package is used to word-wrap long
lines without removing any existing line breaks.
@@ -1574,7 +1571,7 @@ filling of GNU Emacs does not work correctly here."
(- (window-width (get-buffer-window (current-buffer))) 1)))
)
(save-excursion
- (vm-save-restriction
+ (save-restriction
;; longlines-wrap-region contains a (forward-line -1) which is causing
;; wrapping of headers which is wrong, so we restrict it here!
(narrow-to-region start end)
@@ -1711,26 +1708,9 @@ If MODES is nil the take the modes from the variable
(setq vm-disable-modes-ignore (cons m vm-disable-modes-ignore)))
nil)))))
-(defun vm-add-write-file-hook (vm-hook-fn)
- "Add a function to the hook called during write-file.
-
-Emacs changed the name of write-file-hooks to write-file-functions as of
-Emacs 22.1. This function is used to supress compiler warnings."
- (if (boundp 'write-file-functions)
- (add-hook 'write-file-functions vm-hook-fn)
- (add-hook 'write-file-hooks vm-hook-fn)))
-
-(defun vm-add-find-file-hook (vm-hook-fn)
- "Add a function to the hook called during find-file.
-
-Emacs changed the name of the hook find-file-hooks to find-file-hook in
-Emacs 22.1. This function used to supress compiler warnings."
- (if (boundp 'find-file-hook)
- (add-hook 'find-file-hook vm-hook-fn)
- (add-hook 'find-file-hooks vm-hook-fn)))
-
;; Aliases for VM functions
+(provide 'vm-misc)
;;; vm-misc.el ends here
diff --git a/lisp/vm-motion.el b/lisp/vm-motion.el
index 81ca29dbcb..092b2089df 100644
--- a/lisp/vm-motion.el
+++ b/lisp/vm-motion.el
@@ -21,20 +21,11 @@
;;; Code:
-(provide 'vm-motion)
-
(require 'vm-macro)
-
-(eval-when-compile
- (require 'cl-lib)
- (require 'vm-misc)
- (require 'vm-minibuf)
- (require 'vm-folder)
- (require 'vm-summary)
- (require 'vm-thread)
- (require 'vm-window)
- (require 'vm-page)
- )
+(require 'vm-misc)
+(require 'vm-summary)
+(require 'vm-window)
+(eval-when-compile (require 'cl-lib))
(declare-function vm-so-sortable-subject "vm-sort" (message))
@@ -142,7 +133,7 @@ given."
(defun vm-move-message-pointer (direction)
"Move vm-message-pointer along DIRECTION by one position. DIRECTION
-is one of 'forward and 'backward. USR, 2011-01-18"
+is one of `forward' and `backward'. USR, 2011-01-18"
(let ((mp vm-message-pointer))
(if (eq direction 'forward)
(progn
@@ -200,7 +191,7 @@ value of COUNT is greater than 1, then the values of the
variables
vm-skip-deleted-messages and vm-skip-read-messages are ignored.
When invoked on marked messages (via `vm-next-command-uses-marks')
-this command 'sees' marked messages as it moves."
+this command \"sees\" marked messages as it moves."
;; second arg RETRY non-nil means retry a failed move, giving
;; not nil-or-t values of the vm-skip variables a chance to
;; work.
@@ -530,8 +521,7 @@ If a new message is selected then return t, otherwise nil.
USR, 2010-03-08"
(and vm-follow-summary-cursor (eq major-mode 'vm-summary-mode)
(let ((point (point))
message-pointer message-list mp)
- (save-excursion
- (set-buffer vm-mail-buffer)
+ (with-current-buffer vm-mail-buffer
(setq message-pointer vm-message-pointer
message-list vm-message-list))
(cond ((or (null message-pointer)
@@ -576,8 +566,7 @@ If a new message is selected then return t, otherwise nil.
USR, 2010-03-08"
(+ (vm-su-start-of (car mp)) 3) 'invisible))
(setq mp (cdr mp)))
(if (not (eq mp message-pointer))
- (save-excursion
- (set-buffer vm-mail-buffer)
+ (with-current-buffer vm-mail-buffer
;; presentation disabled to avoid message
;; loading. USR, 2010-09-30
(vm-record-and-change-message-pointer
@@ -586,4 +575,5 @@ If a new message is selected then return t, otherwise nil.
USR, 2010-03-08"
;; a new message was selected.
t )))))))
+(provide 'vm-motion)
;;; vm-motion.el ends here
diff --git a/lisp/vm-mouse.el b/lisp/vm-mouse.el
index ec27d6ae82..a9ee7337aa 100644
--- a/lisp/vm-mouse.el
+++ b/lisp/vm-mouse.el
@@ -21,19 +21,7 @@
;;; Code:
-(provide 'vm-mouse)
-
-(eval-when-compile
- (require 'vm-misc)
- (require 'vm-minibuf)
- (require 'vm-folder)
- (require 'vm-summary)
- (require 'vm-thread)
- (require 'vm-window)
- (require 'vm-page)
- (require 'vm-motion)
- (require 'vm-menu)
- )
+(require 'vm-menu)
(declare-function vm-mail-to-mailto-url "vm-reply" (url))
(declare-function event-window "vm-xemacs" (event))
@@ -120,7 +108,7 @@ Mouse'."
"Use mouse button 3 to see a menu of options.")
(defun vm-mouse-get-mouse-track-string (event)
- (save-excursion
+ (save-current-buffer
;; go to where the event occurred
(cond ((featurep 'xemacs)
(set-buffer (window-buffer (event-window event)))
@@ -594,8 +582,7 @@ HISTORY argument is ignored."
(defvar vm-mouse-read-string-should-delete-frame)
(defun vm-mouse-read-string (prompt completion-list &optional multi-word)
- (save-excursion
- (set-buffer (vm-make-work-buffer " *Choices*"))
+ (with-current-buffer (vm-make-work-buffer " *Choices*")
(use-local-map (make-sparse-keymap))
(setq buffer-read-only t)
(make-local-variable 'vm-mouse-read-string-prompt)
@@ -692,4 +679,5 @@ HISTORY argument is ignored."
(throw 'exit nil)
(throw 'exit t)))
+(provide 'vm-mouse)
;;; vm-mouse.el ends here
diff --git a/lisp/vm-page.el b/lisp/vm-page.el
index 8cf4d389f1..d3281051bf 100644
--- a/lisp/vm-page.el
+++ b/lisp/vm-page.el
@@ -21,22 +21,10 @@
;;; Code:
-(provide 'vm-page)
-
(require 'vm-macro)
-
-(eval-when-compile
- (require 'vm-misc)
- (require 'vm-minibuf)
- (require 'vm-folder)
- (require 'vm-summary)
- (require 'vm-window)
- (require 'vm-motion)
- (require 'vm-menu)
- (require 'vm-mouse)
- (require 'vm-mime)
- (require 'vm-undo)
- )
+(require 'vm-window)
+(require 'vm-motion)
+(require 'vm-menu)
(declare-function vm-make-virtual-copy "vm-virtual" (message))
(declare-function vm-make-presentation-copy "vm-mime" (message))
@@ -740,7 +728,7 @@ preview or the full message, governed by the the variables
;; (when (not need-preview)
;; (vm-inform 1 "External messages cannot be previewed")
;; (setq need-preview nil)))
- (vm-save-buffer-excursion
+ (save-current-buffer
(setq vm-system-state 'previewing)
(setq vm-mime-decoded nil)
@@ -782,7 +770,7 @@ preview or the full message, governed by the the variables
(vm-set-mime-layout-of
(car vm-message-pointer) new-layout))))
(vm-make-presentation-copy (car vm-message-pointer))
- (vm-save-buffer-excursion
+ (save-current-buffer
(vm-replace-buffer-in-windows (current-buffer)
vm-presentation-buffer))
(set-buffer vm-presentation-buffer)
@@ -917,13 +905,13 @@ is done if necessary. (USR, 2010-01-14)"
;; FIXME at this point, the folder buffer is being used for
;; display. Filling will corrupt the folder.
(debug "VM internal error #2010. Please report it")))
- (vm-save-restriction
+ (save-restriction
(widen)
(vm-fill-paragraphs-containing-long-lines
vm-fill-paragraphs-containing-long-lines
(vm-text-of (car vm-message-pointer))
(vm-text-end-of (car vm-message-pointer)))))
- (vm-save-buffer-excursion
+ (save-current-buffer
(save-excursion
(save-excursion
(goto-char (point-min))
@@ -969,7 +957,7 @@ is done if necessary. (USR, 2010-01-14)"
(vm-select-folder-buffer-and-validate 1 (vm-interactive-p))
(vm-display nil nil '(vm-expose-hidden-headers)
'(vm-expose-hidden-headers))
- (vm-save-buffer-excursion
+ (save-current-buffer
(vm-replace-buffer-in-windows (current-buffer)
vm-presentation-buffer))
(and vm-presentation-buffer
@@ -1053,7 +1041,7 @@ is done if necessary. (USR, 2010-01-14)"
(push-mark)
(vm-display (current-buffer) t '(vm-beginning-of-message)
'(vm-beginning-of-message reading-message))
- (vm-save-buffer-excursion
+ (save-current-buffer
(let ((osw (selected-window)))
(unwind-protect
(progn
@@ -1080,7 +1068,7 @@ as necessary."
(push-mark)
(vm-display (current-buffer) t '(vm-end-of-message)
'(vm-end-of-message reading-message))
- (vm-save-buffer-excursion
+ (save-current-buffer
(let ((osw (selected-window)))
(unwind-protect
(progn
@@ -1170,4 +1158,5 @@ exposed and marked as read."
(goto-char old-point)
(error "No more buttons"))))
+(provide 'vm-page)
;;; vm-page.el ends here
diff --git a/lisp/vm-pcrisis.el b/lisp/vm-pcrisis.el
index 8a0a3638fe..1fb5ff2a89 100644
--- a/lisp/vm-pcrisis.el
+++ b/lisp/vm-pcrisis.el
@@ -34,28 +34,15 @@
;;; Code:
-(provide 'vm-pcrisis)
-
-(eval-and-compile
- (require 'timezone)
- (require 'vm-misc)
- (require 'vm-minibuf)
- (require 'vm-folder)
- (require 'vm-summary)
- (require 'vm-motion)
- (require 'vm-reply))
-(eval-when-compile
- ;; get the macros we need.
- (condition-case e
- (progn
- (require 'regexp-opt)
- (require 'bbdb)
- (require 'bbdb-com))
- (error
- (message "%S" e)
- (message "Could not load bbdb.el. Related functions may not work
correctly!")
- ;; (vm-sit-for 5)
- )))
+(require 'timezone)
+(require 'vm-misc)
+(require 'vm-minibuf)
+(require 'vm-folder)
+(require 'vm-summary)
+(require 'vm-motion)
+(require 'vm-reply)
+(eval-when-compile (vm-load-features '(regexp-opt bbdb bbdb-com)))
+(eval-when-compile (require 'vm-macro))
(declare-function set-extent-face "vm-xemacs" (extent face))
(declare-function timezone-absolute-from-gregorian "ext:timezone"
@@ -143,58 +130,58 @@ Checks if the condition and all the actions exist."
,@(mapcar (lambda (a) `(const ,(car a))) vmpc-actions)
(string))))))
+(defvaralias 'vmpc-actions-alist 'vmpc-default-rules)
(defcustom vmpc-default-rules ()
- "*A default list of condition-action rules used for replying, forwarding,
+ "A default list of condition-action rules used for replying, forwarding,
resending, composing and automorphing, unless overridden by more
specific variables such as `vmpc-reply-rules'."
:type (vmpc-defcustom-rules-type)
; :set 'vmpc-rules-set
:group 'vmpc)
-(defvaralias 'vmpc-actions-alist 'vmpc-default-rules)
+(defvaralias 'vmpc-reply-alist 'vmpc-reply-rules)
(defcustom vmpc-reply-rules ()
- "*A list of condition-action rules used during reply."
+ "A list of condition-action rules used during reply."
:type (vmpc-defcustom-rules-type)
; :set 'vmpc-rules-set
:group 'vmpc)
-(defvaralias 'vmpc-reply-alist 'vmpc-reply-rules)
+(defvaralias 'vmpc-forward-alist 'vmpc-forward-rules)
(defcustom vmpc-forward-rules ()
- "*A list of condition-action rules used when forwarding."
+ "A list of condition-action rules used when forwarding."
:type (vmpc-defcustom-rules-type)
; :set 'vmpc-rules-set
:group 'vmpc)
-(defvaralias 'vmpc-forward-alist 'vmpc-forward-rules)
+(defvaralias 'vmpc-automorph-alist 'vmpc-automorph-rules)
(defcustom vmpc-automorph-rules ()
- "*An alist associating conditions with actions from `vmpc-actions' when
automorphing."
+ "Alist associating conditions with actions from `vmpc-actions' when
automorphing."
:type (vmpc-defcustom-rules-type)
; :set 'vmpc-rules-set
:group 'vmpc)
-(defvaralias 'vmpc-automorph-alist 'vmpc-automorph-rules)
+(defvaralias 'vmpc-mail-alist 'vmpc-mail-rules)
(defcustom vmpc-mail-rules ()
- "*An alist associating conditions with actions from `vmpc-actions'
+ "An alist associating conditions with actions from `vmpc-actions'
when composing a message starting from a folder."
:type (vmpc-defcustom-rules-type)
; :set 'vmpc-rules-set
:group 'vmpc)
-(defvaralias 'vmpc-mail-alist 'vmpc-mail-rules)
+(defvaralias 'vmpc-newmail-alist 'vmpc-newmail-rules)
(defcustom vmpc-newmail-rules ()
- "*An alist associating conditions with actions from `vmpc-actions'
+ "An alist associating conditions with actions from `vmpc-actions'
when composing."
:type (vmpc-defcustom-rules-type)
; :set 'vmpc-rules-set
:group 'vmpc)
-(defvaralias 'vmpc-newmail-alist 'vmpc-newmail-rules)
+(defvaralias 'vmpc-resend-alist 'vmpc-resend-rules)
(defcustom vmpc-resend-rules ()
- "*An alist associating conditions with actions from `vmpc-actions' when
resending."
+ "An alist associating conditions with actions from `vmpc-actions' when
resending."
:type (vmpc-defcustom-rules-type)
; :set 'vmpc-rules-set
:group 'vmpc)
-(defvaralias 'vmpc-resend-alist 'vmpc-resend-rules)
(defcustom vmpc-default-profile "default"
"*The default profile to select if no profile was found."
@@ -203,8 +190,8 @@ when composing."
:group 'vmpc)
(defcustom vmpc-auto-profiles-file "~/.vmpc-auto-profiles"
- "*File in which to save information used by `vmpc-prompt-for-profile'.
-When set to the symbol 'BBDB, profiles will be stored there."
+ "File in which to save information used by `vmpc-prompt-for-profile'.
+When set to the symbol `BBDB', profiles will be stored there."
:type '(choice (file)
(const BBDB))
:group 'vmpc)
@@ -220,12 +207,12 @@ right for you will depend on how often you send email to
new addresses using
(defvar vmpc-current-state nil
"The current state of pcrisis.
-It is one of 'reply, 'forward, 'resend, 'automorph, 'mail or 'newmail.
+It is one of `reply', `forward', `resend', `automorph', `mail', or `newmail'.
It controls which actions/functions can/will be run.")
(defvar vmpc-current-buffer nil
- "The current buffer, i.e. 'none or 'composition.
-It is 'none before running an adviced VM function and 'composition afterward,
+ "The current buffer, i.e. `none' or `composition'.
+It is `none' before running an adviced VM function and `composition' afterward,
i.e. when within the composition buffer.")
(defvar vmpc-saved-headers-alist nil
@@ -276,7 +263,7 @@ i.e. when within the composition buffer.")
"Whether to forbid the cursor from entering the signature.")
(defvar vmpc-expect-default-signature 'nil
- "*Set this to 't if you have a signature-inserting function.
+ "Set this to `t' if you have a signature-inserting function.
It will ensure that pcrisis correctly handles the signature .")
@@ -380,7 +367,7 @@ Overlays suck. Extents rule. XEmacs got this right."
(defun vmpc-set-extent-insertion-types (extent start end)
"Set the insertion types of EXTENT from START to END.
START and END should be either nil or t, indicating the desired value
-of the 'start-open and 'end-closed properties of the extent
+of the `start-open' and `end-closed' properties of the extent
respectively.
This is the XEmacs version of `vmpc-set-overlay-insertion-types'."
;; pretty simple huh?
@@ -421,14 +408,14 @@ start and end of the overlay/extent."
(defun vmpc-set-exerlay-detachable-property (exerlay newval)
- "Set the 'detachable or 'evaporate property for EXERLAY to NEWVAL."
+ "Set the `detachable' or `evaporate' property for EXERLAY to NEWVAL."
(if (featurep 'xemacs)
(vm-set-extent-property exerlay 'detachable newval)
(overlay-put exerlay 'evaporate newval)))
(defun vmpc-set-exerlay-intangible-property (exerlay newval)
- "Set the 'intangible or 'atomic property for EXERLAY to NEWVAL."
+ "Set the `intangible' or `atomic' property for EXERLAY to NEWVAL."
(if (featurep 'xemacs)
(progn
(require 'atomic-extents)
@@ -925,8 +912,7 @@ parameter POS means insert the pre-signature at position
POS if
(setq vmpc-auto-profiles (reverse vmpc-auto-profiles)))
(when (and (file-exists-p vmpc-auto-profiles-file) ;
(file-readable-p vmpc-auto-profiles-file))
- (save-excursion
- (set-buffer (get-buffer-create "*pcrisis-temp*"))
+ (with-current-buffer (get-buffer-create "*pcrisis-temp*")
(buffer-disable-undo (current-buffer))
(erase-buffer)
(insert-file-contents vmpc-auto-profiles-file)
@@ -942,8 +928,7 @@ parameter POS means insert the pre-signature at position
POS if
;; if file is not writable, signal an error:
(error "Error: P-Crisis could not write to file %s"
vmpc-auto-profiles-file))
- (save-excursion
- (set-buffer (get-buffer-create "*pcrisis-temp*"))
+ (with-current-buffer (get-buffer-create "*pcrisis-temp*")
(buffer-disable-undo (current-buffer))
(erase-buffer)
(goto-char (point-min))
@@ -1075,8 +1060,7 @@ If no email address in found in STR, returns nil."
whitespace."
(let (result
(not-separators (concat "^" separators)))
- (save-excursion
- (set-buffer (get-buffer-create " *split*"))
+ (with-current-buffer (get-buffer-create " *split*")
(erase-buffer)
(insert string)
(goto-char (point-min))
@@ -1159,7 +1143,7 @@ without an action.
The association is stored in `vmpc-auto-profiles-file' and in the future the
stored actions will automatically run for messages to that address.
-REMEMBER can be set to t or 'prompt. When set to 'prompt you will be asked if
+REMEMBER can be set to t or `prompt'. When set to `prompt' you will be asked
if
you want to store the association. When set to t a new profile will be stored
without asking.
@@ -1474,8 +1458,7 @@ buffer to which to write diagnostic output."
(let ((form (cons 'progn (cdr form)))
(results (eval (cons 'progn (cdr form)))))
(when verbose
- (save-excursion
- (set-buffer verbose)
+ (with-current-buffer verbose
(insert (format "Action form is:\n%S\nResults are:\n%S\n"
form results))))))))
@@ -1524,8 +1507,7 @@ recursion nor concurrent calls."
;; BUGME why is the global value resurrected after making the variable
;; buffer local? Is this related to defadvice? I have no idea what is
;; going on here! Thus we clear it afterwards now!
- (save-excursion
- (set-buffer (get-buffer-create " *vmpc-cleanup*"))
+ (with-current-buffer (get-buffer-create " *vmpc-cleanup*")
(vmpc-init-vars)
(setq vmpc-current-buffer nil)))
@@ -1545,7 +1527,7 @@ recursion nor concurrent calls."
(defun vmpc--mail (orig-fun &rest args)
"Start a new message with pcrisis voodoo."
(vm-follow-summary-cursor)
- (vm-select-folder-buffer-and-validate 1 (interactive-p))
+ (vm-select-folder-buffer-and-validate 1 (vm-interactive-p))
(vmpc-init-vars 'mail)
(vmpc-build-true-conditions-list)
(vmpc-build-actions-to-run-list)
@@ -1584,7 +1566,7 @@ recursion nor concurrent calls."
"Forward a message with pcrisis voodoo."
;; this stuff is already done when replying, but not here:
(vm-follow-summary-cursor)
- (vm-select-folder-buffer-and-validate 1 (interactive-p))
+ (vm-select-folder-buffer-and-validate 1 (vm-interactive-p))
;; the rest is almost exactly the same as replying:
(vmpc-init-vars 'forward)
(vmpc-build-true-conditions-list)
@@ -1600,7 +1582,7 @@ recursion nor concurrent calls."
"Forward a message in plain text with pcrisis voodoo."
;; this stuff is already done when replying, but not here:
(vm-follow-summary-cursor)
- (vm-select-folder-buffer-and-validate 1 (interactive-p))
+ (vm-select-folder-buffer-and-validate 1 (vm-interactive-p))
;; the rest is almost exactly the same as replying:
(vmpc-init-vars 'forward)
(vmpc-build-true-conditions-list)
@@ -1616,7 +1598,7 @@ recursion nor concurrent calls."
"Resent a message with pcrisis voodoo."
;; this stuff is already done when replying, but not here:
(vm-follow-summary-cursor)
- (vm-select-folder-buffer-and-validate 1 (interactive-p))
+ (vm-select-folder-buffer-and-validate 1 (vm-interactive-p))
;; the rest is almost exactly the same as replying:
(vmpc-init-vars 'resend)
(vmpc-build-true-conditions-list)
@@ -1646,7 +1628,7 @@ current composition, then call this function."
;;;###autoload
(defun vmpc-automorph ()
"*Change contents of the current mail message based on its own headers.
-Unless `vmpc-current-state' is 'no-automorph, headers and signatures can be
+Unless `vmpc-current-state' is `no-automorph', headers and signatures can be
changed; pre-signatures added; functions called.
Call `vmpc-no-automorph' to disable it for the current buffer."
@@ -1658,4 +1640,5 @@ Call `vmpc-no-automorph' to disable it for the current
buffer."
(vmpc-build-actions-to-run-list)
(vmpc-run-actions)))
+(provide 'vm-pcrisis)
;;; vm-pcrisis.el ends here
diff --git a/lisp/vm-pgg.el b/lisp/vm-pgg.el
index e988d503a7..35ca9bc7f1 100644
--- a/lisp/vm-pgg.el
+++ b/lisp/vm-pgg.el
@@ -87,8 +87,6 @@
;;; Code:
-(provide 'vm-pgg)
-
(require 'vm-macro)
;; handle missing pgg.el gracefully
@@ -97,28 +95,24 @@
(condition-case nil
(require 'pgg)
(error (message "WARNING: Cannot load pgg.el, related functions may
not work!")))
- (require 'pgg))
-
- (require 'easymenu)
- (require 'vm-misc)
- (require 'vm-folder)
- (require 'vm-window)
- (require 'vm-page)
- (require 'vm-mime)
- (require 'vm-reply)
- (require 'vm-motion))
+ (require 'pgg)))
+
+(require 'easymenu)
+(require 'vm-misc)
+(require 'vm-folder)
+(require 'vm-window)
+(require 'vm-mime)
+(require 'vm-reply)
+(require 'vm-motion)
(declare-function rfc822-addresses "ext:rfc822" (header-text))
-(eval-when-compile
- ;; avoid warnings
- (defvar vm-mode-line-format)
- (defvar vm-message-pointer)
- (defvar vm-presentation-buffer)
- (defvar vm-summary-buffer)
- ;; avoid bytecompile warnings
- (defvar vm-pgg-cleartext-state nil "For interfunction communication.")
-)
+;; avoid warnings
+(defvar vm-mode-line-format)
+(defvar vm-message-pointer)
+(defvar vm-presentation-buffer)
+(defvar vm-summary-buffer)
+(defvar vm-pgg-cleartext-state)
; group already defined in vm-vars.el
;(defgroup vm nil
@@ -305,9 +299,10 @@ Switch mode on/off according to ARG.
(setq vm-pgg-compose-mode
(if (null arg) (not vm-pgg-compose-mode)
(> (prefix-numeric-value arg) 0)))
- (if vm-pgg-compose-mode
- (easy-menu-add vm-pgg-compose-mode-menu)
- (easy-menu-remove vm-pgg-compose-mode-menu)))
+ (when (featurep 'xemacs)
+ (if vm-pgg-compose-mode
+ (easy-menu-add vm-pgg-compose-mode-menu)
+ (easy-menu-remove vm-pgg-compose-mode-menu))))
(defvar vm-pgg-compose-mode-string " vm-pgg"
"*String to put in mode line when function `vm-pgg-compose-mode' is active.")
@@ -425,7 +420,7 @@ Switch mode on/off according to ARG.
(layout (vm-mm-layout m)))
;; make a presentation copy
(vm-make-presentation-copy m)
- (vm-save-buffer-excursion
+ (save-current-buffer
(vm-replace-buffer-in-windows (current-buffer)
vm-presentation-buffer))
(set-buffer vm-presentation-buffer)
@@ -490,12 +485,10 @@ If STATES is nil, clear it."
(setq vm-pgg-state-message (car vm-message-pointer))
(setq vm-pgg-state nil)
(when vm-presentation-buffer
- (save-excursion
- (set-buffer vm-presentation-buffer)
+ (with-current-buffer vm-presentation-buffer
(setq vm-pgg-state nil)))
(when vm-summary-buffer
- (save-excursion
- (set-buffer vm-summary-buffer)
+ (with-current-buffer vm-summary-buffer
(setq vm-pgg-state nil))))
;; add prefix
(if (and states (not vm-pgg-state))
@@ -511,12 +504,10 @@ If STATES is nil, clear it."
;; propagate state
(setq states vm-pgg-state)
(when vm-presentation-buffer
- (save-excursion
- (set-buffer vm-presentation-buffer)
+ (with-current-buffer vm-presentation-buffer
(setq vm-pgg-state states)))
(when vm-summary-buffer
- (save-excursion
- (set-buffer vm-summary-buffer)
+ (with-current-buffer vm-summary-buffer
(setq vm-pgg-state states)))))
(defvar vm-pgg-cleartext-begin-regexp
@@ -529,8 +520,9 @@ If STATES is nil, clear it."
(defcustom vm-pgg-cleartext-search-limit 4096
"Number of bytes to peek into the message for a PGP clear text armor."
- :group 'vm-pgg
- :group 'faces)
+ :type 'integer
+ :group 'vm-pgg
+ :group 'faces)
(defun vm-pgg-cleartext-automode-button (label action)
"Cleartext thing by a button with text LABEL and associate ACTION with it.
@@ -857,8 +849,7 @@ cleanup here after verification and decoding took place."
:layout layout)))
(t
;; decode the message now
- (save-excursion
- (set-buffer (vm-buffer-of (vm-mm-layout-message message)))
+ (with-current-buffer (vm-buffer-of (vm-mm-layout-message message))
(save-restriction
(widen)
(setq status (pgg-decrypt-region (vm-mm-layout-body-start
message)
@@ -868,16 +859,14 @@ cleanup here after verification and decoding took place."
(vm-pgg-state-set 'error)
(insert-buffer-substring pgg-errors-buffer)
(put-text-property start (point) 'face 'vm-pgg-error))
- (save-excursion
- (set-buffer pgg-output-buffer)
+ (with-current-buffer pgg-output-buffer
(vm-pgg-crlf-cleanup (point-min) (point-max))
(setq message (vm-mime-parse-entity-safe
nil :passing-message-only t)))
(if message
(vm-decode-mime-layout message)
(insert-buffer-substring pgg-output-buffer))
- (setq status (save-excursion
- (set-buffer pgg-errors-buffer)
+ (setq status (with-current-buffer pgg-errors-buffer
(goto-char (point-min))
;; TODO: care for BADSIG
(when (re-search-forward "GOODSIG [^\n\r]+"
(point-max) t)
@@ -1021,8 +1010,8 @@ cleanup here after verification and decoding took place."
;; verify
(unless (pgg-snarf-keys)
(error "Snarfing failed"))
- (save-excursion
- (set-buffer (if (not (featurep 'xemacs)) pgg-errors-buffer
pgg-output-buffer))
+ (with-current-buffer
+ (if (not (featurep 'xemacs)) pgg-errors-buffer pgg-output-buffer)
(message (buffer-substring (point-min) (point-max))))))
;;; ###autoload
@@ -1036,8 +1025,7 @@ cleanup here after verification and decoding took place."
(description (concat "public key of " pgg-default-user-id))
(buffer (get-buffer-create (concat " *" description "*")))
start)
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(erase-buffer)
(setq start (point))
(pgg-insert-key)
@@ -1074,8 +1062,8 @@ seed and thus creates the same boundery when called twice
in a short period."
(random)
(while (< i (length boundary))
(aset boundary i (aref vm-mime-base64-alphabet
- (% (vm-abs (lsh (random) -8))
- (length vm-mime-base64-alphabet))))
+ (random
+ (length vm-mime-base64-alphabet))))
(vm-increment i))
boundary))
@@ -1084,8 +1072,7 @@ seed and thus creates the same boundery when called twice
in a short period."
(let ((composition-buffer (current-buffer))
(undo-list-backup buffer-undo-list)
(work-buffer (get-buffer-create " *VM-PGG-WORK*")))
- (save-excursion
- (set-buffer work-buffer)
+ (with-current-buffer work-buffer
(buffer-disable-undo)
(erase-buffer)
(insert-buffer-substring composition-buffer)
@@ -1281,7 +1268,7 @@ The transfer encoding done by `vm-pgg-sign' can be
controlled by the variable
;;; ###autoload
(defun vm-pgg-ask-hook ()
- "Hook to automatically ask for signing or encrypting outgoing messages with
PGP/MIME.
+ "Function to ask to sign or encrypt outgoing messages with PGP/MIME.
Put this function into `vm-mail-send-hook' to be asked each time you
send a message whether or not you want to sign or encrypt the
@@ -1293,7 +1280,7 @@ other functions there. Signing crucially relies on the
fact that the
message is not altered afterwards. To put it into `vm-mail-send-hook'
put something like
- (add-hook 'vm-mail-send-hook 'vm-pgg-ask-hook t)
+ (add-hook \\='vm-mail-send-hook #\\='vm-pgg-ask-hook t)
into your VM init file."
(interactive)
diff --git a/lisp/vm-pine.el b/lisp/vm-pine.el
index 677e0699dc..97fca6ba41 100644
--- a/lisp/vm-pine.el
+++ b/lisp/vm-pine.el
@@ -84,24 +84,18 @@
;;; Code:
-(provide 'vm-pine)
-
(require 'vm-macro)
-(require 'vm-vars)
-
-(eval-when-compile
- (require 'vm-misc)
- (require 'vm-folder)
- (require 'vm-summary)
- (require 'vm-window)
- (require 'vm-minibuf)
- (require 'vm-page)
- (require 'vm-motion)
- (require 'vm-undo)
- (require 'vm-delete)
- (require 'vm-mime)
- (require 'vm-reply)
- )
+(require 'vm-vars)
+(require 'vm-misc)
+(require 'vm-folder)
+(require 'vm-summary)
+(require 'vm-window)
+(require 'vm-minibuf)
+(require 'vm-motion)
+(require 'vm-undo)
+(require 'vm-delete)
+(require 'vm-mime)
+(require 'vm-reply)
(declare-function deiconify-frame "vm-xemacs" (&optional frame))
(declare-function frames-of-buffer "vm-xemacs"
@@ -428,8 +422,7 @@ creation). If DRAFT is non-nil, then do not delete the
draft message."
(goto-char (point-max))
(if presentation-buffer
;; when using presentation buffer we have to
- (save-excursion
- (set-buffer presentation-buffer)
+ (with-current-buffer presentation-buffer
(goto-char (point-min))
(search-forward-regexp "\n\n")
(setq tstart (match-end 0)
@@ -634,11 +627,10 @@ Optional argument DONT-KILL is positive, then do not kill
source message."
(setq folder-buffer (vm-get-file-buffer folder))
(if folder-buffer
;; o.k. the folder is already opened
- (save-excursion
- (set-buffer folder-buffer)
+ (with-current-buffer folder-buffer
(vm-error-if-folder-read-only)
(let ((buffer-read-only nil))
- (vm-save-restriction
+ (save-restriction
(widen)
(goto-char (point-max))
(vm-write-string (current-buffer) (vm-leading-message-separator))
@@ -745,8 +737,7 @@ Drafts in other folders are not recognized!"
;; postponed message in postponed folder
(when (and (not action) (setq buffer (vm-get-file-buffer ppfolder)))
(if (and (get-buffer-window-list buffer nil 0))
- (when (save-excursion
- (set-buffer buffer)
+ (when (with-current-buffer buffer
(not (vm-deleted-flag (car vm-message-pointer))))
(message "Please select a draft!")
(select-window (car (get-buffer-window-list buffer nil 0)))
@@ -836,8 +827,8 @@ configuration."
(defcustom vm-save-killed-message
'ask
"How `vm-save-killed-message-hook' handles saving of a mail as a draft.
-If set to 'ask it will ask whether to save the mail as draft or not.
-If set to 'always it will save without asking.
+If set to `ask' it will ask whether to save the mail as draft or not.
+If set to `always' it will save without asking.
If set to nil it will never save them nor it will ask."
:type '(choice (const ask)
(const always)
@@ -1007,8 +998,8 @@ Called with prefix ARG it just removes the FCC-header."
(defun vm-mail-auto-fcc ()
"Add a new FCC field, with file name guessed by `vm-mail-folder-alist'.
You likely want to add it to `vm-reply-hook' by
- (add-hook 'vm-reply-hook 'vm-mail-auto-fcc)
-or if sure about what you are doing you can add it to mail-send-hook."
+ (add-hook \\='vm-reply-hook #\\='vm-mail-auto-fcc)
+or if sure about what you are doing you can add it to `mail-send-hook'."
(interactive "")
(expand-abbrev)
(save-excursion
@@ -1049,8 +1040,7 @@ This function is a slightly changed version of
`vm-auto-select-folder'."
(result))
;; Set up a buffer that matches our cached
;; match data.
- (save-excursion
- (set-buffer buf)
+ (with-current-buffer buf
(if (not (featurep 'xemacs))
(set-buffer-multibyte nil)) ; for empty buffer
(widen)
@@ -1129,4 +1119,6 @@ If optional argument RETURN-ONLY is t just returns FCC."
fcc)))))))))
;;-----------------------------------------------------------------------------
+
+(provide 'vm-pine)
;;; vm-pine.el ends here
diff --git a/lisp/vm-pop.el b/lisp/vm-pop.el
index e03cf6c67b..cb0cf3b404 100644
--- a/lisp/vm-pop.el
+++ b/lisp/vm-pop.el
@@ -21,23 +21,15 @@
;;; Code:
-(provide 'vm-pop)
-
(require 'vm-macro)
-
-;; For function declarations
-(eval-when-compile
- (require 'cl-lib)
- (require 'vm-misc)
- (require 'vm-folder)
- (require 'vm-summary)
- (require 'vm-window)
- (require 'vm-motion)
- (require 'vm-undo)
- (require 'vm-delete)
- (require 'vm-crypto)
- (require 'vm-mime)
-)
+(require 'vm-misc)
+(require 'vm-summary)
+(require 'vm-window)
+(require 'vm-motion)
+(require 'vm-undo)
+(require 'vm-crypto)
+(require 'vm-mime)
+(eval-when-compile (require 'cl-lib))
(declare-function vm-submit-bug-report
"vm.el" (&optional pre-hooks post-hooks))
@@ -153,8 +145,7 @@ a POP server, find its cache file on the file system"
(setq process (vm-pop-make-session source vm-pop-ok-to-ask))
(or process (throw 'done nil))
(setq process-buffer (process-buffer process))
- (save-excursion
- (set-buffer process-buffer)
+ (with-current-buffer process-buffer
;; find out how many messages are in the box.
(vm-pop-send-command process "STAT")
(setq response (vm-pop-read-stat-response process)
@@ -419,7 +410,7 @@ relevant POP servers to remove the messages."
(if (zerop delete-count) "No" delete-count)
(if (= delete-count 1) "" "s")))
(insert "VM had problems expunging messages from:\n")
- (nreverse trouble)
+ (setq trouble (nreverse trouble))
(setq mp trouble)
(while mp
(insert " " (car mp) "\n")
@@ -436,7 +427,7 @@ relevant POP servers to remove the messages."
(defun vm-pop-make-session (source interactive &optional retry)
"Create a new POP session for the POP mail box SOURCE.
The argument INTERACTIVE says the operation has been invoked
-interactively. The possible values are t, 'password-only and nil.
+interactively. The possible values are t, `password-only', and nil.
Optional argument RETRY says whether this call is for a
retry.
@@ -506,8 +497,7 @@ Returns the process or nil if the session could not be
created."
(vm-make-trace-buffer-name session-name host)))
(unwind-protect
(catch 'end-of-session
- (save-excursion ; = save-current-buffer?
- (set-buffer pop-buffer)
+ (with-current-buffer pop-buffer
(setq vm-folder-type (or folder-type vm-default-folder-type))
(buffer-disable-undo pop-buffer)
(make-local-variable 'vm-pop-read-point)
@@ -679,8 +669,7 @@ is non-nil, the process buffer is retained, otherwise it is
killed as well."
(if (and process (memq (process-status process) '(open run))
(buffer-live-p (process-buffer process)))
- (save-excursion
- (set-buffer (process-buffer process))
+ (with-current-buffer (process-buffer process)
(vm-pop-send-command process "QUIT")
;; Previously we did not read the QUIT response because of
;; TCP shutdown problems (under Windows?) that made it
@@ -977,8 +966,7 @@ popdrop
(let ((attrs (file-attributes target)))
(or (null attrs) (equal 0 (nth 7 attrs)))))
((bufferp target)
- (save-excursion
- (set-buffer target)
+ (with-current-buffer target
(zerop (buffer-size))))))
(let ((opoint (point)))
(vm-convert-folder-header nil vm-folder-type)
@@ -1003,8 +991,7 @@ popdrop
(selective-display nil))
(write-region start end target t 0))
(let ((b (current-buffer)))
- (save-excursion
- (set-buffer target)
+ (with-current-buffer target
(let ((buffer-read-only nil))
(insert-buffer-substring b start end)))))
(delete-region start end)
@@ -1047,8 +1034,7 @@ popdrop
(defun vm-pop-get-uidl-data ()
(let ((there (make-vector 67 0))
(process (vm-folder-pop-process)))
- (save-excursion
- (set-buffer (process-buffer process))
+ (with-current-buffer (process-buffer process)
(vm-pop-send-command process "UIDL")
(let ((start vm-pop-read-point)
n uidl)
@@ -1140,13 +1126,13 @@ LOCAL-EXPUNGE-LIST: A list of message descriptors for
messages in the
(do-retrieves nil))
"Synchronize POP folder with the server.
INTERACTIVE says the operation has been invoked interactively. The
- possible values are t, 'password-only and nil.
+ possible values are t, `password-only', and nil.
DO-REMOTE-EXPUNGES indicates whether the server mail box should be
expunged.
DO-LOCAL-EXPUNGES indicates whether the cache buffer should be
expunged.
DO-RETRIEVES indicates if new messages that are not already in the
- cache should be retrieved from the server. If this flag is 'full
+ cache should be retrieved from the server. If this flag is `full'
then messages previously retrieved but not in cache are retrieved
as well.
"
@@ -1174,12 +1160,11 @@ LOCAL-EXPUNGE-LIST: A list of message descriptors for
messages in the
(folder-buffer (current-buffer)))
(if (and do-retrieves retrieve-list)
(save-excursion
- (vm-save-restriction
+ (save-restriction
(widen)
(goto-char (point-max))
(condition-case error-data
- (save-excursion
- (set-buffer (process-buffer process))
+ (with-current-buffer (process-buffer process)
(setq statblob (vm-pop-start-status-timer))
(vm-set-pop-stat-x-box statblob safe-popdrop)
(vm-set-pop-stat-x-maxmsg statblob
@@ -1380,4 +1365,5 @@ order to capture the trace of POP sessions during the
occurrence."
(vm-set-body-to-be-discarded-of m nil))
+(provide 'vm-pop)
;;; vm-pop.el ends here
diff --git a/lisp/vm-ps-print.el b/lisp/vm-ps-print.el
index e636c65e34..11d4c4628b 100644
--- a/lisp/vm-ps-print.el
+++ b/lisp/vm-ps-print.el
@@ -58,17 +58,12 @@
;;
;;; Code:
-(provide 'vm-ps-print)
-
(require 'cl-lib)
-
-(eval-when-compile
- (require 'ps-print)
-
- (require 'vm-save)
- (require 'vm-folder)
- (require 'vm-summary)
- (require 'vm-mime))
+(require 'ps-print)
+(require 'vm-save)
+(require 'vm-folder)
+(require 'vm-summary)
+(require 'vm-mime)
(declare-function vm-marked-messages "vm-mark" ())
@@ -385,10 +380,9 @@ for customization of the output."
(defun vm-ps-print-message-fix-menu (menu each)
"Fix VM-menu MENU.
If EACH it t, then replace `vm-print-message' by
-'vm-ps-print-each-message', otherwise by `vm-ps-print-message'."
+`vm-ps-print-each-message', otherwise by `vm-ps-print-message'."
(let ((tmpbuf (get-buffer-create "*vm-ps-print*")))
- (save-excursion
- (set-buffer tmpbuf)
+ (with-current-buffer tmpbuf
(erase-buffer)
(insert (format "(setq %s '%S)" (symbol-name menu) (symbol-value menu)))
(if (re-search-backward "vm-\\(ps-\\)?print-\\(each-\\)?message"
@@ -422,7 +416,7 @@ t) instead of `vm-print-message'."
print just the current message.
Optionally write postscript output to FILENAME (default is to spool
to printer).
-Optionally force SEPERATE printing of each message by setting to 't'.
+Optionally force SEPERATE printing of each message by setting to `t'.
Optionally also print NUP pages per sheet.
Optionally also print in COLOR by setting to non-nil.
@@ -449,4 +443,5 @@ filename and formats 1 page per sheet. (JJK)"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(provide 'vm-ps-print)
;;; vm-ps-print.el ends here
diff --git a/lisp/vm-reply.el b/lisp/vm-reply.el
index 92e264ec12..32750a135f 100644
--- a/lisp/vm-reply.el
+++ b/lisp/vm-reply.el
@@ -64,26 +64,9 @@
;;; Code:
-(provide 'vm-reply)
-
(require 'vm-macro)
-
-(eval-when-compile
- (require 'cl-lib)
- (require 'vm-misc)
- (require 'vm-minibuf)
- (require 'vm-menu)
- (require 'vm-folder)
- (require 'vm-summary)
- (require 'vm-window)
- (require 'vm-page)
- (require 'vm-motion)
- (require 'vm-mime)
- (require 'vm-digest)
- (require 'vm-undo)
- ;; (require 'vm-delete)
- ;; (require 'vm-imap)
- )
+(require 'vm-summary)
+(eval-when-compile (require 'cl-lib))
(declare-function vm-mode "vm" (&optional read-only))
(declare-function vm-session-initialization "vm" ())
@@ -860,8 +843,7 @@ as replied to, forwarded, etc, if appropriate."
(let (list)
(setq list (vm-mime-fragment-composition vm-mime-max-message-size))
(while list
- (save-excursion
- (set-buffer (car list))
+ (with-current-buffer (car list)
(vm-mail-send)
(kill-buffer (car list)))
(setq list (cdr list)))
@@ -2069,7 +2051,7 @@ message."
;; point of no return, don't kill it if the user quits
(setq temp-buffer nil)
(let ((vm-auto-decode-mime-messages t))
- (vm-save-buffer-excursion
+ (save-current-buffer
(vm-goto-new-folder-frame-maybe 'folder)
(vm-mode)))
(vm-inform 5
@@ -2187,4 +2169,5 @@ that is needed for Mac and NextStep."
(add-hook 'vm-mail-mode-hook 'vm-mail-mode-hide-headers-hook)
+(provide 'vm-reply)
;;; vm-reply.el ends here
diff --git a/lisp/vm-rfaddons.el b/lisp/vm-rfaddons.el
index 4ae8b5f4ed..a26438d8f7 100644
--- a/lisp/vm-rfaddons.el
+++ b/lisp/vm-rfaddons.el
@@ -58,37 +58,33 @@
;;
;;; Code:
-(provide 'vm-rfaddons)
-
(require 'vm-macro)
(require 'vm-version)
-(eval-when-compile
- (require 'cl-lib)
- (require 'vm-misc)
- (require 'vm-folder)
- (require 'vm-summary)
- (require 'vm-window)
- (require 'vm-minibuf)
- (require 'vm-menu)
- (require 'vm-toolbar)
- (require 'vm-mouse)
- (require 'vm-page)
- (require 'vm-motion)
- (require 'vm-undo)
- (require 'vm-delete)
- (require 'vm-crypto)
- (require 'vm-mime)
- (require 'vm-edit)
- (require 'vm-virtual)
- (require 'vm-pop)
- (require 'vm-imap)
- (require 'vm-sort)
- (require 'vm-reply)
- (require 'vm-pine)
- (require 'wid-edit)
- (require 'vm)
-)
+(require 'vm-misc)
+(require 'vm-folder)
+(require 'vm-summary)
+(require 'vm-window)
+(require 'vm-minibuf)
+(require 'vm-menu)
+(require 'vm-toolbar)
+(require 'vm-mouse)
+(require 'vm-motion)
+(require 'vm-undo)
+(require 'vm-delete)
+(require 'vm-crypto)
+(require 'vm-message)
+(require 'vm-mime)
+(require 'vm-edit)
+(require 'vm-virtual)
+(require 'vm-pop)
+(require 'vm-imap)
+(require 'vm-sort)
+(require 'vm-reply)
+(require 'vm-pine)
+(require 'wid-edit)
+(require 'vm)
+(eval-when-compile (require 'cl-lib))
(declare-function bbdb-record-raw-notes "ext:bbdb" (record))
(declare-function bbdb-record-net "ext:bbdb " (record))
@@ -101,10 +97,7 @@
(declare-function esmtpmail-via-smtp-server "ext:esmtpmail" ())
(declare-function vm-folder-buffers "ext:vm" (&optional non-virtual))
-(eval-when-compile
- (vm-load-features '(regexp-opt bbdb bbdb-vm))
- ;; gnus-group removed from features because it gives errors. USR, 2011-01-26
- )
+(eval-when-compile (vm-load-features '(regexp-opt bbdb bbdb-vm)))
(require 'sendmail)
(vm-load-features '(bbdb))
@@ -179,8 +172,8 @@ Other EXPERIMENTAL options:
If you want to use only a subset of the options then call
`vm-rfaddons-infect-vm' like this:
- (vm-rfaddons-infect-vm 2 '(general vm-mail-mode shrunken-headers)
- '(fake-date))
+ (vm-rfaddons-infect-vm 2 \\='(general vm-mail-mode shrunken-headers)
+ \\='(fake-date))
This will enable all `general' and `vm-mail-mode' options plus the
`shrunken-headers' option, but it will exclude the `fake-date' option of the
`vm-mail-mode' options.
@@ -437,7 +430,7 @@ This does only work with my modified VM, i.e. a hacked
;; (let ((buffer-read-only nil)
;; (fill-column width))
;; (save-excursion
-;; (vm-save-restriction
+;; (save-restriction
;; ;; longlines-wrap-region contains a (forward-line -1) which is
causing
;; ;; wrapping of headers which is wrong, so we restrict it here!
;; (narrow-to-region start end)
@@ -626,13 +619,13 @@ buffer. (Rob F)"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun bbdb/vm-set-virtual-folder-alist ()
"Create a `vm-virtual-folder-alist' according to the records in the bbdb.
-For each record that has a 'vm-virtual' attribute, add or modify the
+For each record that has a `vm-virtual' attribute, add or modify the
corresponding BBDB-VM-VIRTUAL element of the `vm-virtual-folder-alist'.
(BBDB-VM-VIRTUAL ((vm-primary-inbox)
(author-or-recipient BBDB-RECORD-NET-REGEXP)))
-The element gets added to the 'element-name' sublist of the
+The element gets added to the `element-name' sublist of the
`vm-virtual-folder-alist'. (Rob F)"
(interactive)
(let (notes-field email-regexp folder selector)
@@ -690,7 +683,7 @@ add/modify the corresponding VM-VIRTUAL element of the
(BBDB-VM-VIRTUAL ((vm-primary-inbox)
(author-or-recipient BBDB-RECORD-NET-REGEXP)))
-The element gets added to the 'element-name' sublist of the
+The element gets added to the `element-name' sublist of the
`vm-virtual-folder-alist'. (Rob F)"
(interactive)
(let (notes-field email-regexp mail-aliases folder selector)
@@ -738,9 +731,9 @@ The element gets added to the 'element-name' sublist of the
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defcustom vm-handle-return-receipt-mode 'edit
- "*Tells `vm-handle-return-receipt' how to handle return receipts.
-One can choose between 'ask, 'auto, 'edit or an expression which is evaluated
-and which should return t if the return receipts should be sent. (Rob F)"
+ "Tells `vm-handle-return-receipt' how to handle return receipts.
+One can choose between `ask', `auto', `edit', or an expression which should
+return t if the return receipts should be sent. (Rob F)"
:group 'vm-rfaddons
:type '(choice (const :tag "Edit" edit)
(const :tag "Ask" ask)
@@ -786,19 +779,18 @@ See the variable `vm-handle-return-receipt-mode' for
customization. (Rob F)"
"Your mail has been received on %s."
(current-time-string)))
(save-restriction
- (save-excursion
- (set-buffer (vm-buffer-of msg))
- (widen)
- (setq message
- (buffer-substring
- (vm-vheaders-of msg)
- (let ((tp (+ vm-handle-return-receipt-peek
- (marker-position
- (vm-text-of msg))))
- (ep (marker-position
- (vm-end-of msg))))
- (if (< tp ep) tp ep))
- ))))
+ (with-current-buffer (vm-buffer-of msg)
+ (widen)
+ (setq message
+ (buffer-substring
+ (vm-vheaders-of msg)
+ (let ((tp (+ vm-handle-return-receipt-peek
+ (marker-position
+ (vm-text-of msg))))
+ (ep (marker-position
+ (vm-end-of msg))))
+ (if (< tp ep) tp ep))
+ ))))
(insert
"\n-----------------------------------------------------------------------------\n"
message)
(if (re-search-backward "^\\s-+.*" (point-min) t)
@@ -826,11 +818,13 @@ See the variable `vm-handle-return-receipt-mode' for
customization. (Rob F)"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(defvar vm-attach-files-in-directory-regexps-history nil
- "Regexp history for matching files. (Rob F)")
(defvaralias 'vm-mime-attach-files-in-directory-regexps-history
'vm-attach-files-in-directory-regexps-history)
+(defvar vm-attach-files-in-directory-regexps-history nil
+ "Regexp history for matching files. (Rob F)")
+(defvaralias 'vm-mime-attach-files-in-directory-default-type
+ 'vm-attach-files-in-directory-default-type)
(defcustom vm-attach-files-in-directory-default-type nil
"*The default MIME-type for attached files.
If set to nil you will be asked for the type if it cannot be guessed.
@@ -838,19 +832,17 @@ For guessing mime-types we use
`vm-mime-attachment-auto-type-alist'. (Rob F)"
:group 'vm-rfaddons
:type '(choice (const :tag "Ask" nil)
(string "application/octet-stream")))
-(defvaralias 'vm-mime-attach-files-in-directory-default-type
- 'vm-attach-files-in-directory-default-type)
+(defvaralias 'vm-mime-attach-files-in-directory-default-charset
+ 'vm-attach-files-in-directory-default-charset)
(defcustom vm-attach-files-in-directory-default-charset 'guess
"*The default charset used for attached files of type `text'.
If set to nil you will be asked for the charset.
-If set to 'guess it will be determined by `vm-determine-proper-charset', but
+If set to `guess' it will be determined by `vm-determine-proper-charset', but
this may take some time, since the file needs to be visited. (Rob F)"
:group 'vm-rfaddons
:type '(choice (const :tag "Ask" nil)
(const :tag "Guess" guess)))
-(defvaralias 'vm-mime-attach-files-in-directory-default-charset
- 'vm-attach-files-in-directory-default-charset)
;; (define-obsolete-variable-alias 'vm-mime-save-all-attachments-types
;; 'vm-mime-saveable-types
@@ -979,7 +971,8 @@ date header as subdir for the attachments. (Rob F)"
(defun vm-mime-auto-save-all-attachments-subdir (msg)
"Return a subdir for the attachments of MSG.
-This will be done according to `vm-mime-auto-save-all-attachments-subdir'.
(Rob F)"
+This will be done according to `vm-mime-auto-save-all-attachments-subdir'.
+(Rob F)"
(setq msg (vm-real-message-of msg))
(when (not (string-match
(regexp-quote (vm-reencode-mime-encoded-words-in-string
@@ -1047,7 +1040,7 @@ Root directory for saving is
`vm-mime-attachment-save-directory'.
You might add this to `vm-select-new-message-hook' in order to automatically
save attachments.
- (add-hook 'vm-select-new-message-hook 'vm-mime-auto-save-all-attachments)
+ (add-hook \\='vm-select-new-message-hook
#\\='vm-mime-auto-save-all-attachments)
(Rob F)"
(interactive "P")
@@ -1518,7 +1511,8 @@ Add this to `vm-mail-mode-hook'. (Rob F)"
"Flag used by `vm-mail-mode-open-line'. (Rob F)")
(defcustom vm-mail-mode-open-line-regexp "[ \t]*>"
- "Regexp matching prefix of quoted text at line start. (Rob F)")
+ "Regexp matching prefix of quoted text at line start. (Rob F)"
+ :type 'regexp)
(defun vm-mail-mode-open-line (start end &optional length)
"Opens a line when inserting into the region of a reply.
@@ -1582,7 +1576,8 @@ of empty lines which have been quoted. (Rob F)"
;;;###autoload
(defun vm-mail-mode-elide-reply-region (b e)
"Replace marked region or current line with `vm-mail-elide-reply-region'.
-B and E are the beginning and end of the marked region or the current line.
(Rob F)"
+B and E are the beginning and end of the marked region or the current line.
+(Rob F)"
(interactive (if (mark)
(if (< (mark) (point))
(list (mark) (point))
@@ -1627,7 +1622,8 @@ B and E are the beginning and end of the marked region or
the current line. (Rob
;;;###autoload
(defun vm-save-message-preview (file)
"Save preview of a message in FILE.
-It saves the decoded message and not the raw message like `vm-save-message'
(Rob F)"
+It saves the decoded message and not the raw message like `vm-save-message'
+(Rob F)"
(interactive
;; protect value of last-command
(let ((last-command last-command)
@@ -1828,7 +1824,8 @@ not end the comment. Blank lines do not get comments.
(Rob F)"
;; Sometimes it's handy to fake a date.
;; I overwrite the standard function by a slightly different version.
(defcustom vm-mail-mode-fake-date-p t
- "*Non-nil means `vm-mail-mode-insert-date-maybe' will not overwrite a
existing date header. (Rob F)"
+ "Non-nil means `vm-mail-mode-insert-date-maybe' keeps an existing date
header.
+Otherwise, overwrite existing date headers (Rob F)"
:group 'vm-rfaddons
:type '(boolean))
@@ -1847,7 +1844,8 @@ not end the comment. Blank lines do not get comments.
(Rob F)"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defcustom vm-delete-message-action "vm-next-message"
"Command to do after deleting a message. (Rob F)"
- :group 'vm-rfaddons)
+ :group 'vm-rfaddons
+ :type 'string) ;; FIXME: `command' would be more useful, no?
;;;###autoload
(defun vm-delete-message-action (&optional arg)
@@ -1913,8 +1911,7 @@ calls. (Rob F)"
(error
(message (cadr err))
(if (and (get-buffer n)
- (< 0 (length (save-excursion
- (set-buffer (get-buffer n))
+ (< 0 (length (with-current-buffer (get-buffer n)
(buffer-substring (point-min)
(point-max))))))
(pop-to-buffer n))))
(if stream (delete-process stream))
@@ -1964,4 +1961,5 @@ calls. (Rob F)"
(vm-decode-mime-message 'decoded)
(message "using best internal MIME decoding"))))
+(provide 'vm-rfaddons)
;;; vm-rfaddons.el ends here
diff --git a/lisp/vm-save.el b/lisp/vm-save.el
index cde3230d08..77b5fd4d86 100644
--- a/lisp/vm-save.el
+++ b/lisp/vm-save.el
@@ -25,23 +25,18 @@
;;; Code:
-(provide 'vm-save)
-
(require 'vm-macro)
-(eval-when-compile
- (require 'vm-misc)
- (require 'vm-minibuf)
- (require 'vm-folder)
- (require 'vm-summary)
- (require 'vm-window)
- (require 'vm-page)
- (require 'vm-motion)
- (require 'vm-mime)
- (require 'vm-undo)
- (require 'vm-delete)
- (require 'vm-imap)
- )
+(require 'vm-misc)
+(require 'vm-minibuf)
+(require 'vm-folder)
+(require 'vm-summary)
+(require 'vm-window)
+(require 'vm-motion)
+(require 'vm-mime)
+(require 'vm-undo)
+(require 'vm-delete)
+(require 'vm-imap)
(declare-function vm-session-initialization "vm" ())
@@ -77,8 +72,7 @@ specified, use `vm-auto-folder-alist'."
(result))
;; Set up a buffer that matches our cached
;; match data.
- (save-excursion
- (set-buffer buf)
+ (with-current-buffer buf
(if (not (featurep 'xemacs))
(set-buffer-multibyte nil)) ; for empty buffer
(widen)
@@ -393,7 +387,7 @@ The saved messages are flagged as `filed'."
(set-buffer (vm-buffer-of m))
;; FIXME the following isn't really necessary
(vm-assert (vm-body-retrieved-of m))
- (vm-save-restriction
+ (save-restriction
(widen)
;; have to stuff the attributes in all cases because
;; the deleted attribute may have been stuffed
@@ -426,14 +420,13 @@ The saved messages are flagged as `filed'."
(vm-write-string
folder (vm-trailing-message-separator target-type))))
;; write to folder-buffer
- (save-excursion
- (set-buffer folder-buffer)
+ (with-current-buffer folder-buffer
;; if the buffer is a live VM folder
;; honor vm-folder-read-only.
(when vm-folder-read-only
(signal 'folder-read-only (list (current-buffer))))
(let ((buffer-read-only nil))
- (vm-save-restriction
+ (save-restriction
(widen)
(save-excursion
(goto-char (point-max))
@@ -574,18 +567,17 @@ This command should NOT be used to save message to mail
folders; use
(set-buffer (vm-buffer-of m))
;; FIXME the following shouldn't be necessary any more
(vm-assert (vm-body-retrieved-of m))
- (vm-save-restriction
+ (save-restriction
(widen)
(if (null file-buffer)
(write-region
(vm-text-of m) (vm-text-end-of m) file t 'quiet)
(let ((start (vm-text-of m))
(end (vm-text-end-of m)))
- (save-excursion
- (set-buffer file-buffer)
+ (with-current-buffer file-buffer
(save-excursion
(let (buffer-read-only)
- (vm-save-restriction
+ (save-restriction
(widen)
(save-excursion
(goto-char (point-max))
@@ -608,7 +600,7 @@ This command should NOT be used to save message to mail
folders; use
(defun vm-switch-to-command-output-buffer (command buffer discard-output)
"Eventually switch to the output buffer of the command."
- (let ((output-bytes (save-excursion (set-buffer buffer) (buffer-size))))
+ (let ((output-bytes (with-current-buffer buffer (buffer-size))))
(if (zerop output-bytes)
(vm-inform 5 "Command '%s' produced no output." command)
(if discard-output
@@ -663,8 +655,7 @@ Output, if any, is displayed. The message is not altered."
;; vm-select-operable-messages for marks and threads.
(mlist (vm-select-operable-messages 1 (vm-interactive-p) "Pipe")))
(vm-retrieve-operable-messages 1 mlist :fail t)
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(erase-buffer))
(while mlist
(setq m (vm-real-message-of (car mlist)))
@@ -689,8 +680,7 @@ Output, if any, is displayed. The message is not altered."
"Run a shell command with contents from the current message as input.
This function is like `vm-pipe-message-to-command', but will not display the
output of the command, but return it as a string."
- (save-excursion
- (set-buffer (vm-pipe-message-to-command command prefix-arg t))
+ (with-current-buffer (vm-pipe-message-to-command command prefix-arg t)
(buffer-substring-no-properties (point-min) (point-max))))
;;;###autoload
@@ -726,15 +716,15 @@ If non-nil call EXIT-HANDLER with the two arguments
COMMAND and OUTPUT-BUFFER."
(funcall exit-handler process-command buffer))))
(defvar vm-pipe-messages-to-command-start t
- "*The string to be used as the leading message separator by
+ "The string to be used as the leading message separator by
`vm-pipe-messages-to-command' at the beginning of each message.
-If set to 't', then use the leading message separator stored in the VM
+If set to `t', then use the leading message separator stored in the VM
folder. If set to nil, then no leading separator is included.")
(defvar vm-pipe-messages-to-command-end t
- "*The string to be used as the trailing message separator by
+ "The string to be used as the trailing message separator by
`vm-pipe-messages-to-command' at the end of each message.
-If set to 't', then use the trailing message separator stored in the VM
+If set to `t', then use the trailing message separator stored in the VM
folder. If set to nil, no trailing separator is included.")
;;;###autoload
@@ -779,9 +769,7 @@ arguments after the command finished."
(mlist (vm-select-operable-messages 1 (vm-interactive-p) "Pipe"))
m process)
(vm-retrieve-operable-messages 1 mlist :fail t)
- (save-excursion
- (set-buffer buffer)
- (erase-buffer))
+ (with-current-buffer buffer (erase-buffer))
(setq process (start-process command buffer
(or shell-file-name "sh")
shell-command-switch command))
@@ -838,8 +826,7 @@ output of the command, but return it as a string."
(vm-select-folder-buffer)
(list (read-string "Pipe to command: " vm-last-pipe-command)
current-prefix-arg))))
- (save-excursion
- (set-buffer (vm-pipe-messages-to-command command prefix-arg t))
+ (with-current-buffer (vm-pipe-messages-to-command command prefix-arg t)
(buffer-substring-no-properties (point-min) (point-max))))
;;;###autoload
@@ -894,8 +881,7 @@ Output, if any, is displayed. The message is not altered."
(mlist (vm-select-operable-messages count (vm-interactive-p) "Print")))
(vm-retrieve-operable-messages count mlist :fail t)
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(erase-buffer))
(while mlist
(setq m (vm-real-message-of (car mlist)))
@@ -1049,4 +1035,5 @@ The saved messages are flagged as `filed'."
(vm-delete-message count mlist))
folder ))
+(provide 'vm-save)
;;; vm-save.el ends here
diff --git a/lisp/vm-search.el b/lisp/vm-search.el
index acacd2be94..f81ec6005b 100644
--- a/lisp/vm-search.el
+++ b/lisp/vm-search.el
@@ -21,18 +21,14 @@
;;; Code:
-(provide 'vm-search)
-
-(eval-and-compile
- (require 'vm-misc)
- (require 'vm-minibuf)
- (require 'vm-undo)
- (require 'vm-startup)
- (require 'vm-motion)
- (require 'vm-summary)
- (require 'vm-folder)
- (require 'vm-window)
-)
+(require 'vm-misc)
+(require 'vm-minibuf)
+(require 'vm-undo)
+(require 'vm-startup)
+(require 'vm-motion)
+(require 'vm-summary)
+(require 'vm-folder)
+(require 'vm-window)
;;;###autoload
@@ -143,4 +139,5 @@ vm-search-using-regexps for this search."
(intern (buffer-name) vm-buffers-needing-display-update)
(vm-update-summary-and-mode-line)))))
+(provide 'vm-search)
;;; vm-search.el ends here
diff --git a/lisp/vm-serial.el b/lisp/vm-serial.el
index da3c81b29a..711875666c 100644
--- a/lisp/vm-serial.el
+++ b/lisp/vm-serial.el
@@ -71,25 +71,19 @@
;;
;;; Code:
-(provide 'vm-serial)
-
(require 'vm-reply)
(require 'vm-macro)
+(require 'vm-misc)
+(require 'vm-mime)
+(require 'vm-pine)
+(require 'mail-utils)
+(require 'mail-extr)
+(eval-when-compile (require 'cl-lib))
(defgroup vm-serial nil
"Sending personalized serial mails and getting message templates."
:group 'vm-ext)
-(eval-when-compile
- (require 'cl-lib)
- (require 'vm-misc)
- (require 'vm-mime))
-
-(eval-and-compile
- (require 'vm-pine)
- (require 'mail-utils)
- (require 'mail-extr))
-
(declare-function bbdb-extract-address-components
"ext:bbdb-snarf" (adstring &optional ignore-errors))
(declare-function bbdb-record-firstname "ext:bbdb" (record))
@@ -763,8 +757,7 @@ a warning."
(defvar vm-serial-send-mail-exit nil)
(defun vm-serial-send-mail-increment (variable)
- (save-excursion
- (set-buffer vm-serial-source-buffer)
+ (with-current-buffer vm-serial-source-buffer
(eval (list 'vm-increment variable))))
@@ -821,8 +814,7 @@ questions will bother you!"
vm-serial-killed-cnt 0)))
;; mail-extract-address-components isn't good at all! Fix it!
- (save-excursion
- (set-buffer work-buffer)
+ (with-current-buffer work-buffer
(setq major-mode 'mail-mode))
(while (and (not work) vm-serial-send-mail-jobs)
@@ -831,8 +823,7 @@ questions will bother you!"
(concat (car to) " <" (cadr to) ">")
(cadr to)))
(copy-to-buffer work-buffer (point-min) (point-max))
- (save-excursion
- (set-buffer work-buffer)
+ (with-current-buffer work-buffer
(goto-char (point-min))
(vm-mail-mode-remove-header "To:")
(mail-position-on-field "To")
@@ -918,4 +909,5 @@ questions will bother you!"
(kill-this-buffer)))
;;-----------------------------------------------------------------------------
+(provide 'vm-serial)
;;; vm-serial.el ends here
diff --git a/lisp/vm-smime.el b/lisp/vm-smime.el
index 37c43497d2..738cef83d4 100644
--- a/lisp/vm-smime.el
+++ b/lisp/vm-smime.el
@@ -21,29 +21,22 @@
;;; Code:
-(provide 'vm-smime)
-
-(eval-and-compile
- (require 'vm-misc))
-
-(eval-when-compile
- (require 'cl-lib)
- (require 'vm-minibuf)
- (require 'vm-toolbar)
- (require 'vm-mouse)
- (require 'vm-summary)
- (require 'vm-folder)
- (require 'vm-menu)
- (require 'vm-crypto)
- (require 'vm-window)
- (require 'vm-page)
- (require 'vm-motion)
- (require 'vm-reply)
- (require 'vm-digest)
- (require 'vm-edit)
- (require 'vm-mime)
- (require 'smime)
- )
+(require 'vm-misc)
+(require 'vm-minibuf)
+(require 'vm-toolbar)
+(require 'vm-mouse)
+(require 'vm-summary)
+(require 'vm-folder)
+(require 'vm-menu)
+(require 'vm-crypto)
+(require 'vm-window)
+(require 'vm-motion)
+(require 'vm-reply)
+(require 'vm-digest)
+(require 'vm-edit)
+(require 'vm-mime)
+(require 'smime)
+(eval-when-compile (require 'cl-lib))
(defun vm-mime-smime-extract-pkcs7-signature (layout)
(unless (vectorp layout)
@@ -294,7 +287,7 @@ certificate files."
(defun vm-get-sender ()
"Determine the sender of the message, used for determining
which mapping of `smime-keys' to use in S/MIME signing a
-composition. If there is no 'From' header in the message,
+composition. If there is no `From' header in the message,
`user-mail-address' will be used"
(or (save-excursion
(goto-char (point-min))
@@ -325,3 +318,6 @@ composition. If there is no 'From' header in the message,
(mail-fetch-field (car to-headers)) t)))))
(setq to-headers (cdr to-headers)))))
recips))
+
+(provide 'vm-smime)
+;;; vm-smime.el ends here.
diff --git a/lisp/vm-sort.el b/lisp/vm-sort.el
index 4aa3482145..d698ea34da 100644
--- a/lisp/vm-sort.el
+++ b/lisp/vm-sort.el
@@ -22,22 +22,15 @@
;;; Code
-(provide 'vm-sort)
-
(require 'vm-macro)
(require 'vm-vars)
-
-(eval-and-compile
- (require 'vm-misc)
- (require 'vm-minibuf)
- (require 'vm-folder)
- (require 'vm-summary)
- (require 'vm-thread)
- (require 'vm-motion)
- (require 'vm-page)
- (require 'vm-window)
- (require 'vm-undo)
- )
+(require 'vm-misc)
+(require 'vm-minibuf)
+(require 'vm-folder)
+(require 'vm-summary)
+(require 'vm-motion)
+(require 'vm-window)
+(eval-when-compile (require 'cl-lib))
(declare-function vm-sort-insert-auto-folder-names "vm-avirtual" ())
@@ -191,7 +184,7 @@ the folder undisturbed."
;; and variables containg markers before you modify this code.
(defun vm-physically-move-message (m m-dest)
(save-excursion
- (vm-save-restriction
+ (save-restriction
(widen)
;; Make sure vm-headers-of and vm-text-of are non-nil in
@@ -885,4 +878,5 @@ that, if P1 and P2 are the oldest different ancestors of M1
and M2, then
(string< (vm-get-header-contents m1 vm-sort-compare-header)
(vm-get-header-contents m2 vm-sort-compare-header))))
+(provide 'vm-sort)
;;; vm-sort.el ends here
diff --git a/lisp/vm-summary-faces.el b/lisp/vm-summary-faces.el
index 855f75ad5a..108a0bc2f2 100644
--- a/lisp/vm-summary-faces.el
+++ b/lisp/vm-summary-faces.el
@@ -32,14 +32,8 @@
;;
;;; Code
-(provide 'vm-summary-faces)
-
-(eval-when-compile
- (require 'vm-misc))
-
-(eval-and-compile
- (require 'vm-summary)
- (require 'vm-virtual))
+(require 'vm-misc)
+(require 'vm-avirtual)
;; (eval-and-compile
;; (if (featurep 'xemacs) (require 'overlay)))
@@ -182,3 +176,5 @@ fonts and colors, for easy recogniton of the message
status."
(add-hook 'vm-summary-pointer-update-hook 'vm-summary-faces-fix-pointer)
+(provide 'vm-summary-faces)
+;;; vm-summary-faces.el ends here.
diff --git a/lisp/vm-summary.el b/lisp/vm-summary.el
index 40126f59d8..9425e1f006 100644
--- a/lisp/vm-summary.el
+++ b/lisp/vm-summary.el
@@ -23,25 +23,8 @@
;;; Code:
-(provide 'vm-summary)
-
(require 'vm-macro)
-
-(eval-and-compile
- (require 'vm-misc)
- (require 'vm-crypto)
- (require 'vm-folder)
- (require 'vm-window)
- (require 'vm-menu)
- (require 'vm-toolbar)
- (require 'vm-mouse)
- (require 'vm-motion)
- (require 'vm-mime)
- (require 'vm-thread)
- (require 'vm-imap)
- (require 'vm-pop)
- (require 'vm-summary-faces)
-)
+(require 'vm-summary-faces)
(declare-function set-specifier "vm-xemacs"
(specifier value &optional locale tag-set how-to-add))
@@ -180,8 +163,7 @@ mandatory."
(setq vm-summary-buffer
(or (get-buffer summary-buffer-name)
(vm-generate-new-multibyte-buffer summary-buffer-name)))
- (save-excursion
- (set-buffer vm-summary-buffer)
+ (with-current-buffer vm-summary-buffer
(abbrev-mode 0)
(auto-fill-mode 0)
;; Experimental code to use buffer-face-mode to change font
@@ -232,8 +214,7 @@ the messages in the current folder."
(vm-mouse-support-possible-p))
vm-summary-enable-faces)))
;; (setq mp m-list)
- (save-excursion
- (set-buffer vm-summary-buffer)
+ (with-current-buffer vm-summary-buffer
(setq line-move-ignore-invisible vm-summary-show-threads)
(let ((buffer-read-only nil)
(modified (buffer-modified-p))
@@ -513,9 +494,8 @@ buffer by a regenerated summary line."
(vm-mouse-support-possible-p))
vm-summary-enable-faces))
summary)
- (save-excursion
+ (with-current-buffer (marker-buffer (vm-su-start-of m))
(setq summary (vm-su-summary m))
- (set-buffer (marker-buffer (vm-su-start-of m)))
(let ((buffer-read-only nil)
s e i
(selected nil)
@@ -1074,8 +1054,7 @@ of multiple header lines which might match
HEADER-NAME-REGEXP.
(let ((contents nil)
(regexp (concat "^\\(" header-name-regexp "\\)")))
(setq message (vm-real-message-of message))
- (save-excursion
- (set-buffer (vm-buffer-of (vm-real-message-of message)))
+ (with-current-buffer (vm-buffer-of (vm-real-message-of message))
(save-restriction
(widen)
(goto-char (vm-headers-of message))
@@ -1353,8 +1332,7 @@ field in the summary.
USR, 2012-10-13"
(if (not (memq (vm-message-type-of message)
'(BellFrom_ From_ From_-with-Content-Length)))
nil
- (save-excursion
- (set-buffer (vm-buffer-of (vm-real-message-of message)))
+ (with-current-buffer (vm-buffer-of (vm-real-message-of message))
(save-excursion
(save-restriction
(widen)
@@ -1498,8 +1476,7 @@ cached-data-vector."
(defun vm-run-user-summary-function (function message)
;; (condition-case nil
(let ((m (vm-real-message-of message)))
- (save-excursion
- (set-buffer (vm-buffer-of m))
+ (with-current-buffer (vm-buffer-of m)
(save-restriction
(widen)
(save-excursion
@@ -1593,8 +1570,7 @@ The result is a mime-encoded string, but this is not
certain.
(if (not (memq (vm-message-type-of message)
'(From_ BellFrom_ From_-with-Content-Length)))
nil
- (save-excursion
- (set-buffer (vm-buffer-of message))
+ (with-current-buffer (vm-buffer-of message)
(save-excursion
(save-restriction
(widen)
@@ -1834,8 +1810,7 @@ if necessary. The result is a mime-decoded string with
text properties.
(and id (car (vm-parse id "[^<]*\\(<[^>]+>\\)"))))
;; try running md5 on the message body to produce an ID
;; better than nothing.
- (save-excursion
- (set-buffer (vm-buffer-of (vm-real-message-of m)))
+ (with-current-buffer (vm-buffer-of (vm-real-message-of m))
(save-restriction
(widen)
(condition-case nil
@@ -1854,8 +1829,7 @@ entry (`vm-line-count-of') or recalculating it if
necessary. USR 2010-05-13"
(or (vm-line-count-of m)
(vm-set-line-count-of
m
- (save-excursion
- (set-buffer (vm-buffer-of (vm-real-message-of m)))
+ (with-current-buffer (vm-buffer-of (vm-real-message-of m))
(save-restriction
(widen)
(int-to-string
@@ -2077,6 +2051,11 @@ Call this function if you made changes to
`vm-summary-format'."
(file-truename
(expand-file-name folder (or dir vm-folder-directory)))))))
+(declare-function open-database "ext:berkeley-db")
+(declare-function close-database "ext:berkeley-db")
+(declare-function put-database "ext:berkeley-db")
+(declare-function get-database "ext:berkeley-db")
+
(defun vm-open-folders-summary-database (mode)
(condition-case data
(open-database vm-folders-summary-database 'berkeley-db 'hash mode)
@@ -2306,8 +2285,7 @@ Call this function if you made changes to
`vm-summary-format'."
(vm-mouse-support-possible-p))
vm-summary-enable-faces))
summary)
- (save-excursion
- (set-buffer (marker-buffer (vm-fs-start-of fs)))
+ (with-current-buffer (marker-buffer (vm-fs-start-of fs))
(let ((buffer-read-only nil))
(unwind-protect
(save-excursion
@@ -2377,8 +2355,7 @@ Call this function if you made changes to
`vm-summary-format'."
(do-mouse-track (or (and vm-mouse-track-summary
(vm-mouse-support-possible-p))
vm-summary-enable-faces)))
- (save-excursion
- (set-buffer vm-folders-summary-buffer)
+ (with-current-buffer vm-folders-summary-buffer
(erase-buffer)
(let ((buffer-read-only nil))
(if (null vm-folders-summary-database)
@@ -2465,8 +2442,7 @@ Call this function if you made changes to
`vm-summary-format'."
(defun vm-do-needed-folders-summary-update ()
(if (null vm-folders-summary-buffer)
nil
- (save-excursion
- (set-buffer vm-folders-summary-buffer)
+ (with-current-buffer vm-folders-summary-buffer
(if (or (eq vm-modification-counter vm-flushed-modification-counter)
(null vm-folders-summary-hash))
nil
@@ -2493,8 +2469,7 @@ Call this function if you made changes to
`vm-summary-format'."
(vm-set-fs-modflag-of fs t)
(vm-check-for-killed-summary)
(if vm-folders-summary-buffer
- (save-excursion
- (set-buffer vm-folders-summary-buffer)
+ (with-current-buffer vm-folders-summary-buffer
(vm-increment vm-modification-counter))))
(if dont-descend
nil
@@ -2547,4 +2522,5 @@ Call this function if you made changes to
`vm-summary-format'."
nil )))
+(provide 'vm-summary)
;;; vm-summary.el ends here
diff --git a/lisp/vm-thread.el b/lisp/vm-thread.el
index 8d258c6dbc..20b0fb4092 100644
--- a/lisp/vm-thread.el
+++ b/lisp/vm-thread.el
@@ -22,18 +22,10 @@
;;; Code:
-(provide 'vm-thread)
-
-;; For function declarations
-(eval-when-compile
- (require 'cl-lib)
- (require 'vm-misc)
- (require 'vm-folder)
- (require 'vm-motion)
- (require 'vm-summary)
- (require 'vm-sort)
-)
+(require 'vm-misc)
+(require 'vm-folder)
+(eval-when-compile (require 'cl-lib))
;; --------------------------------------------------------------------------
;; Top-level operations
@@ -168,7 +160,7 @@
(defsubst vm-th-thread-date-of (id-sym criterion)
"For the message with the interned symbol ID-SYM, return the
youngest or oldest date in its thread. CRITERION must be one of
-'youngest-date and 'oldest-date"
+`youngest-date' and `oldest-date'."
(get id-sym criterion))
(defsubst vm-th-message-of (id-sym)
@@ -1551,4 +1543,5 @@ to the thread. Used for testing purposes."
;; (setq vm-thread-subject-obarray 'bonk)
))))
+(provide 'vm-thread)
;;; vm-thread.el ends here
diff --git a/lisp/vm-toolbar.el b/lisp/vm-toolbar.el
index edda1173c4..210e9ba19d 100644
--- a/lisp/vm-toolbar.el
+++ b/lisp/vm-toolbar.el
@@ -21,12 +21,8 @@
;;; Code:
-(provide 'vm-toolbar)
-
-(eval-when-compile
- (require 'vm-misc)
- (require 'vm-window)
- )
+(require 'vm-misc)
+(require 'vm-window)
(declare-function vm-follow-summary-cursor "vm-motion" ())
(declare-function vm-mime-plain-message-p "vm-mime" (message))
@@ -566,7 +562,7 @@ s-expression like this one in your .vm file:
(if (and (boundp 'tool-bar-map)
(consp tool-bar-map))
(let ((map (cdr tool-bar-map))
- (v [tool-bar x]))
+ (v (vector 'tool-bar 'x)))
(while map
(aset v 1 (car (car map)))
(define-key vm-mode-map v 'undefined)
@@ -726,4 +722,5 @@ s-expression like this one in your .vm file:
name extension)
dir)))))
+(provide 'vm-toolbar)
;;; vm-toolbar.el ends here
diff --git a/lisp/vm-undo.el b/lisp/vm-undo.el
index 370d15f10a..fb6eb2b05d 100644
--- a/lisp/vm-undo.el
+++ b/lisp/vm-undo.el
@@ -21,20 +21,8 @@
;;; Code:
-(provide 'vm-undo)
-
(require 'vm-macro)
-
-(eval-when-compile
- (require 'vm-misc)
- (require 'vm-menu)
- (require 'vm-minibuf)
- (require 'vm-folder)
- (require 'vm-summary)
- (require 'vm-window)
- (require 'vm-page)
- (require 'vm-motion)
- )
+(require 'vm-summary)
;; vm-undo-record-list is a buffer-local-variable containing
;; undo-records.
@@ -426,8 +414,8 @@ M-LIST. STRING is a MIME-decoded string with text
properties.
The third parameter ADD is one of:
nil delete the label
-'all add the label in all cases
-'existing-only add the label only if it is already existing in the folder
+`all' add the label in all cases
+`existing-only' add the label only if it is already existing in the folder
USR, 2010-12-20
"
(vm-display nil nil '(vm-add-message-labels vm-delete-message-labels)
@@ -589,10 +577,7 @@ changed attributes are stuffed into the folder. USR
2010-04-06"
(cond
((and (not vm-folder-read-only)
(or (not (vm-virtual-messages-of m))
- (not (save-excursion
- (set-buffer
- (vm-buffer-of
- (vm-real-message-of m)))
+ (not (with-current-buffer (vm-buffer-of (vm-real-message-of m))
vm-folder-read-only))))
(dolist (v-m (cons (vm-real-message-of m) (vm-virtual-messages-of m)))
(if (eq (vm-attributes-of m) (vm-attributes-of v-m))
@@ -704,4 +689,5 @@ changed attributes are stuffed into the folder. USR
2010-04-06"
(defun vm-set-new-flag-in-vector (v flag)
(aset v 0 flag))
+(provide 'vm-undo)
;;; vm-undo.el ends here
diff --git a/lisp/vm-user.el b/lisp/vm-user.el
index 8d41161c75..9ebeb70538 100644
--- a/lisp/vm-user.el
+++ b/lisp/vm-user.el
@@ -21,7 +21,8 @@
;;; Code:
-(provide 'vm-user)
+(require 'vm-vars)
+(require 'vm-message)
(defun vm-user-composition-folder-buffer ()
"Return the folder buffer associated with the current buffer.
@@ -59,4 +60,5 @@ by VM for a reply, resend or forward."
newlist )
nil ))
+(provide 'vm-user)
;;; vm-user.el ends here
diff --git a/lisp/vm-vars.el b/lisp/vm-vars.el
index de5657bb6d..37228f0ba7 100644
--- a/lisp/vm-vars.el
+++ b/lisp/vm-vars.el
@@ -21,9 +21,8 @@
;;; Code:
-(provide 'vm-vars)
-
(require 'vm-version)
+(require 'vm-macro)
(declare-function vm-parse "vm-misc" (string regexp &optional matchn matches))
(declare-function vm-delete-directory-names "vm-misc" (list))
@@ -236,15 +235,15 @@ must be used to load the externally stored message
bodies."
:type '(choice (const :tag "No automatic fetching" nil)
(const :tag "Automatic fetching" t)))
+(defvaralias 'vm-fetched-message-limit
+ 'vm-external-fetched-message-limit)
(defcustom vm-external-fetched-message-limit 10
- "*Should be an integer representing the maximum number of messages
+ "Should be an integer representing the maximum number of messages
that VM should keep in the Folder buffer when the messages are
fetched on demand, or nil to signify no limit."
:group 'vm-external
:type '(choice (const :tag "No Limit" nil)
(integer :tag "Number of Mesages")))
-(defvaralias 'vm-fetched-message-limit
- 'vm-external-fetched-message-limit)
(defcustom vm-index-file-suffix nil
"*Suffix used to construct VM index file names, e.g., \".inx\".
@@ -285,23 +284,8 @@ folders (context name `imap'). Messages larger than
(make-obsolete-variable 'vm-load-headers-only
'vm-enable-external-messages "8.2.0")
-;; use this function to access vm-spool-files on the fly. this
-;; allows us to use environmental variables without setting
-;; vm-spool-files at load time and thereby making it hard to dump an
-;; Emacs containing a preloaded VM.
-(defun vm-spool-files ()
- (or vm-spool-files
- (and (setq vm-spool-files (getenv "MAILPATH"))
- (setq vm-spool-files
- (vm-delete-directory-names
- (vm-parse vm-spool-files
- "\\([^:%?]+\\)\\([%?][^:]*\\)?\\(:\\|$\\)"))))
- (and (setq vm-spool-files (getenv "MAIL"))
- (setq vm-spool-files (vm-delete-directory-names
- (list vm-spool-files))))))
-
(defcustom vm-spool-files nil
- "*If non-nil this variable's value should be a list of strings
+ "If non-nil this variable's value should be a list of strings
or a list of lists.
If the value is a list of strings, the strings should name files
@@ -317,7 +301,7 @@ If the value is a list of lists, each sublist should be of
the form
INBOX, SPOOLNAME and CRASHBOX are all strings.
INBOX is the folder where you want your new mail to be moved when
-you type 'g' (running `vm-get-new-mail') in VM. It is where you
+you type `g' (running `vm-get-new-mail') in VM. It is where you
will read the mail.
SPOOLNAME is where the mail system leaves your incoming mail,
@@ -460,11 +444,26 @@ has been specified."
(file :tag "Spoolfile")
(file :tag "Crashbox")))))
+;; use this function to access vm-spool-files on the fly. this
+;; allows us to use environmental variables without setting
+;; vm-spool-files at load time and thereby making it hard to dump an
+;; Emacs containing a preloaded VM.
+(defun vm-spool-files ()
+ (or vm-spool-files
+ (and (setq vm-spool-files (getenv "MAILPATH"))
+ (setq vm-spool-files
+ (vm-delete-directory-names
+ (vm-parse vm-spool-files
+ "\\([^:%?]+\\)\\([%?][^:]*\\)?\\(:\\|$\\)"))))
+ (and (setq vm-spool-files (getenv "MAIL"))
+ (setq vm-spool-files (vm-delete-directory-names
+ (list vm-spool-files))))))
+
(defcustom vm-spool-file-suffixes nil
"*List of suffixes to be used to create possible spool file names
for folders. Example:
- (setq vm-spool-file-suffixes '(\".spool\" \"-\"))
+ (setq vm-spool-file-suffixes \\='(\".spool\" \"-\"))
If you visit a folder ~/mail/beekeeping, when VM attempts to
retrieve new mail for that folder it will look for mail in
@@ -518,9 +517,9 @@ A nil value for `vm-pop-max-message-size' means no size
limit."
(defcustom vm-pop-messages-per-session nil
"*Non-nil value should be an integer specifying how many messages to
-retrieve per POP session. When you type 'g' to get new mail, VM
+retrieve per POP session. When you type `g' to get new mail, VM
will only retrieve that many messages from any particular POP maildrop.
-To retrieve more messages, type 'g' again.
+To retrieve more messages, type `g' again.
A nil value means there's no limit."
:group 'vm-folders
@@ -529,9 +528,9 @@ A nil value means there's no limit."
(defcustom vm-pop-bytes-per-session nil
"*Non-nil value should be an integer specifying how many bytes to
-retrieve per POP session. When you type 'g' to get new mail, VM
+retrieve per POP session. When you type `g' to get new mail, VM
will only retrieve messages until the byte limit is reached on
-any particular POP maildrop. To retrieve more messages, type 'g'
+any particular POP maildrop. To retrieve more messages, type `g'
again.
A nil value means there's no limit."
@@ -640,7 +639,7 @@ If VM encounters an IMAP message larger than this size, the
action
is as follows:
- In IMAP folders, the message is treated as an external message if
-`vm-enable-external-messages' includes 'imap. Otherwise it is
+`vm-enable-external-messages' includes `imap'. Otherwise it is
retrieved.
- In local folders, the message is skipped if it is part of
@@ -654,9 +653,9 @@ A nil value for `vm-imap-max-message-size' means no size
limit."
(defcustom vm-imap-messages-per-session nil
"*Non-nil value should be an integer specifying how many messages to
-retrieve per IMAP session. When you type 'g' to get new mail, VM
+retrieve per IMAP session. When you type `g' to get new mail, VM
will only retrieve that many messages from any particular IMAP maildrop.
-To retrieve more messages, type 'g' again.
+To retrieve more messages, type `g' again.
A nil value means there's no limit."
:group 'vm-folders
@@ -664,9 +663,9 @@ A nil value means there's no limit."
(defcustom vm-imap-bytes-per-session nil
"*Non-nil value should be an integer specifying how many bytes to
-retrieve per IMAP session. When you type 'g' to get new mail, VM
+retrieve per IMAP session. When you type `g' to get new mail, VM
will only retrieve messages until the byte limit is reached on
-any particular IMAP maildrop. To retrieve more messages, type 'g'
+any particular IMAP maildrop. To retrieve more messages, type `g'
again.
A nil value means there's no limit."
@@ -718,7 +717,7 @@ folders. It can be set to nil to prohibit the recognition
of
IMAP maildrops.")
(defvar vm-imap-server-list nil
- "*List of IMAP maildrop specifications that tell VM the IMAP servers
+ "List of IMAP maildrop specifications that tell VM the IMAP servers
you have access to and how to log into them. The IMAP maildrop
specification in the same format used by `vm-spool-files' (which
see). The mailbox part of the specifiation is ignored and should
@@ -729,12 +728,8 @@ instead.
Example:
(setq vm-imap-server-list
- '(
- \"imap-ssl:mail.foocorp.com:993:inbox:login:becky:*\"
- \"imap:crickle.lex.ky.us:143:inbox:login:becky:*\"
- )
- )"
-)
+ \\='(\"imap-ssl:mail.foocorp.com:993:inbox:login:becky:*\"
+ \"imap:crickle.lex.ky.us:143:inbox:login:becky:*\"))")
(make-obsolete-variable 'vm-imap-server-list
'vm-imap-account-alist "8.1.0")
@@ -753,12 +748,8 @@ will use to refer to this maildrop when using
`vm-visit-imap-folder'.
Example:
(setq vm-imap-account-alist
- '(
- (\"imap-ssl:mail.foocorp.com:993:inbox:login:becky:*\" \"becky\")
- (\"imap:crickle.lex.ky.us:143:inbox:login:becky:*\" \"crickle\")
- )
- )
-"
+ \\='((\"imap-ssl:mail.foocorp.com:993:inbox:login:becky:*\" \"becky\")
+ (\"imap:crickle.lex.ky.us:143:inbox:login:becky:*\" \"crickle\")))"
:group 'vm-imap
:type '(repeat (list (string :tag "IMAP Folder Specification")
(string :tag "Nickname"))))
@@ -831,13 +822,13 @@ timing out. It can be set to nil to never time out."
(defcustom vm-imap-connection-mode 'online
"*The mode of connection to the IMAP server. Possible values
-are: 'online, 'offline and 'autoconnect. In the 'online mode,
+are: `online', `offline', and `autoconnect'. In the `online' mode,
synchronization works normally and message bodies of external
-messages are fetched when needed. In 'offline mode, no
+messages are fetched when needed. In `offline' mode, no
connection is established to the IMAP server and message bodies
-are not fetched. In the 'autoconnect mode, a connection is
+are not fetched. In the `autoconnect' mode, a connection is
established whenever a synchronization operation is performed and the
-connection mode is then turned into 'online."
+connection mode is then turned into `online'."
:group 'vm-imap
:type '(choice (const :tag "online" online)
(const :tag "offline" offline)
@@ -922,7 +913,7 @@ VM maintains this variable, you should not set it.")
((string-match "-sco" system-configuration)
'mmdf)
(t 'From_))
- "*Default folder type for empty folders.
+ "Default folder type for empty folders.
If VM has to add messages that have no specific folder type to an
empty folder, the folder will become this default type.
Allowed types are:
@@ -935,7 +926,7 @@ Allowed types are:
Value must be a symbol, not a string. i.e. write
- (setq vm-default-folder-type 'From_)
+ (setq vm-default-folder-type \\='From_)
in your .emacs or .vm file.
@@ -1032,9 +1023,9 @@ must set this variable non-nil."
:type 'boolean)
(defvar vm-sync-thunderbird-status t
- "* If set to t, VM synchronizes its headers with the headers of
+ "If set to t, VM synchronizes its headers with the headers of
Thunderbird so that full interoperation with Thunderbird becomes
-possible. If it is set to 'read-only then VM reads the Thunderbird
+possible. If it is set to `read-only' then VM reads the Thunderbird
status flags, but refrains from updating them. If it is set to nil
then VM makes no attempt to read or write the Thunderbird status
flags.")
@@ -1200,9 +1191,9 @@ effect."
(defcustom vm-fill-paragraphs-containing-long-lines nil
"*This variable can be set to nil, a numeric value N, the
-symbol 'window-width. If it is numeric, it causes VM to fill
+symbol `window-width'. If it is numeric, it causes VM to fill
paragraphs that contain lines spanning that many columns or more.
-Setting it to 'window-width has the effect of using the width of
+Setting it to `window-width' has the effect of using the width of
the Emacs window.
Only plain text messages and text/plain MIME parts will be
@@ -1221,10 +1212,10 @@ wrapping."
(integer :tag "Fill width")))
(defcustom vm-fill-paragraphs-containing-long-lines-in-reply nil
- "*This variable can be set to nil, a numeric value N, the
-symbol 'window-width. If it is numeric, it causes VM to fill
+ "This variable can be set to nil, a numeric value N, the
+symbol `window-width'. If it is numeric, it causes VM to fill
included text in replies provided it has lines spanning that many
-columns or more. Setting it to 'window-width has the effect of
+columns or more. Setting it to `window-width' has the effect of
using the width of the Emacs window.
This variable determines which paragraphs are filled,
@@ -1281,14 +1272,14 @@ set directly rather use the function
`vm-smime-encrypt-message'
or `vm-smime-sign-encrypt-message'")
(defcustom vm-smime-get-recipient-certificate-method 'ask
- "*The method by which VM should find the certificates to use in
+ "The method by which VM should find the certificates to use in
encrypting this S/MIME encoded composition. Valid valus are as follows:
- 'ask - Ask the user to specify the files manually each time. The
+ `ask' - Ask the user to specify the files manually each time. The
user will be prompted for a file name and whether they want
to specify another thereafter and so on.
- 'links - This method assumes that there exist links under
+ `links' - This method assumes that there exist links under
`smime-certificate-directory' given by the recipient address
to the appropriate PEM encoded certificate, i.e.
~/CERTS/bob@somewhere.com -> ~/CERTS/bob_johnstons_certificate.pem
@@ -1375,10 +1366,12 @@ MIME messages."
:group 'vm-mime
:type 'boolean)
+(defvaralias 'vm-honor-mime-content-disposition
+ 'vm-mime-honor-content-disposition)
(defcustom vm-mime-honor-content-disposition nil
- "*Non-nil value means use information from the Content-Disposition
+ "Non-nil value means use information from the Content-Disposition
header to display MIME messages. Possible values are `t', to mean that the
-Content-Disposition header should always be honored or 'internal-only,
+Content-Disposition header should always be honored or `internal-only',
to mean that an \"inline\" disposition should be honored only for
internally-displayable types.
@@ -1392,8 +1385,6 @@ of options."
:type '(choice (const :tag "Ignore it" nil)
(const :tag "Honor it always" t)
(const :tag "Honor inline for internal types" internal-only)))
-(defvaralias 'vm-honor-mime-content-disposition
- 'vm-mime-honor-content-disposition)
(defcustom vm-auto-decode-mime-messages t
"*Non-nil value causes MIME decoding to occur automatically
@@ -1418,9 +1409,11 @@ for this variable to have effect."
"*Control variable that says whether MIME messages should be decoded
for showing the message, in addition to decoding for preview.")
+(defvaralias 'vm-auto-displayed-mime-content-types
+ 'vm-mime-auto-displayed-content-types)
(defcustom vm-mime-auto-displayed-content-types
'("text" "image" "message/rfc822")
- "*List of MIME content types that should be displayed immediately
+ "List of MIME content types that should be displayed immediately
after decoding. Other types will be displayed as a button that
you must activate to display the object.
@@ -1430,7 +1423,7 @@ A nil value means never display MIME objects immediately;
only use buttons.
If the value is a list, it should be a list of strings, which
should all be types or type/subtype pairs. Example:
- (setq vm-mime-auto-displayed-content-types '(\"text\" \"image/jpeg\"))
+ (setq vm-mime-auto-displayed-content-types \\='(\"text\" \"image/jpeg\"))
If a top-level type is listed without a subtype, all subtypes of
that type are assumed to be included.
@@ -1453,11 +1446,11 @@ object to a file."
:type '(choice (const t)
(const nil)
(repeat string)))
-(defvaralias 'vm-auto-displayed-mime-content-types
- 'vm-mime-auto-displayed-content-types)
+(defvaralias 'vm-auto-displayed-mime-content-type-exceptions
+ 'vm-mime-auto-displayed-content-type-exceptions)
(defcustom vm-mime-auto-displayed-content-type-exceptions nil
- "*List of MIME content types that should not be displayed immediately
+ "List of MIME content types that should not be displayed immediately
after decoding. These types will be displayed as a button that you
must activate to display the object. This is an exception list for
the types listed in `vm-mime-auto-displayed-content-types'; all types
@@ -1467,15 +1460,13 @@ list.
The value should be either nil or a list of strings. The strings
should all be types or type/subtype pairs. Example:
- (setq vm-mime-auto-displayed-content-type-exceptions '(\"text/html\"))
+ (setq vm-mime-auto-displayed-content-type-exceptions \\='(\"text/html\"))
If a top-level type is listed without a subtype, all subtypes of
that type are assumed to be included."
:group 'vm-mime
:type '(choice (const nil)
(repeat string)))
-(defvaralias 'vm-auto-displayed-mime-content-type-exceptions
- 'vm-mime-auto-displayed-content-type-exceptions)
(defcustom vm-mime-internal-content-types t
"*List of MIME content types that should be displayed internally
@@ -1487,7 +1478,7 @@ means VM must run an external viewer to display MIME
objects.
If the value is a list, it should be a list of strings. Example:
- (setq vm-mime-internal-content-types '(\"text\" \"message\" \"image/jpeg\"))
+ (setq vm-mime-internal-content-types \\='(\"text\" \"message\"
\"image/jpeg\"))
If a top-level type is listed without a subtype, all subtypes of
that type are assumed to be included.
@@ -1507,7 +1498,7 @@ displayed internally except for those in the exception
list.
The value should be a list of strings. Example:
- (setq vm-mime-internal-content-type-exceptions '(\"image/jpeg\"))
+ (setq vm-mime-internal-content-type-exceptions \\='(\"image/jpeg\"))
If a top-level type is listed without a subtype, all subtypes of
that type are assumed to be included."
@@ -1554,7 +1545,7 @@ filename was always added as the last argument; as of VM
6.49 this
is only done if %f does not appear in any of the ARG strings.
The filename inserted by %f will be quoted by `shell-quote-argument'
and thus no single quotes should be used, i.e. do not use the following
-\"...'%f'...\".
+\"...\\='%f'...\".
If the COMMAND-LINE form is used, the program and its arguments
are specified as a single string and that string is passed to the
@@ -1575,14 +1566,11 @@ may have associated with the attachment.
Example:
(setq vm-mime-external-content-types-alist
- '(
- (\"text/html\" browse-url-of-file)
+ \\='((\"text/html\" browse-url-of-file)
(\"image/gif\" \"xv\")
(\"image/jpeg\" \"xv\")
(\"video/mpeg\" \"mpeg_play\")
- (\"video\" w32-shell-execute \"open\")
- )
- )
+ (\"video\" w32-shell-execute \"open\")))
The first matching list element will be used.
@@ -1608,7 +1596,7 @@ unless you explicitly request it by menu or `$ e' from
the keyboard.
The value should be a list of strings. Example:
- (setq vm-mime-external-content-type-exceptions '(\"text/html\"))
+ (setq vm-mime-external-content-type-exceptions \\='(\"text/html\"))
If a top-level type is listed without a subtype, all subtypes of
that type are assumed to be included."
@@ -1647,11 +1635,8 @@ the standard input of the shell command.
Example:
(setq vm-mime-type-converter-alist
- '(
- (\"image/jpeg\" \"image/gif\" \"jpeg2gif\")
- (\"text/html\" \"text/plain\" \"striptags\")
- )
- )
+ \\='((\"image/jpeg\" \"image/gif\" \"jpeg2gif\")
+ (\"text/html\" \"text/plain\" \"striptags\")))
The first matching list element will be used."
:group 'vm-mime
@@ -1691,10 +1676,7 @@ use pipelines, shell variables and redirections.
Example:
(setq vm-mime-charset-converter-alist
- '(
- (\"utf-8\" \"iso-2022-jp\" \"iconv -f utf-8 -t iso-2022-jp\")
- )
- )
+ \\='((\"utf-8\" \"iso-2022-jp\" \"iconv -f utf-8 -t iso-2022-jp\")))
The first matching list element will be used."
:group 'vm-mime
@@ -1702,9 +1684,9 @@ The first matching list element will be used."
(repeat (list string string string))))
(defcustom vm-mime-alternative-show-method 'best-internal
- "*Value tells how to choose which alternative to display when
+ "Value tells how to choose which alternative to display when
it displays a message with \"multipart/alternative\" content.
-Possible values are 'best, 'best-internal, 'all or a
+Possible values are `best', `best-internal', `all', or a
favorite-methods list as described below.
A MIME message of type multipart/alternative has multiple
@@ -1716,27 +1698,27 @@ display.
(There is a separate variable `vm-mime-alternative-yank-method'
for deciding the multipart/alternative to be used in replies.)
- A value of 'best means choose the part that is the most
+ A value of `best' means choose the part that is the most
faithful to the sender's original content that can be displayed.
- A value of 'best-internal means choose the best part that can
+ A value of `best-internal' means choose the best part that can
be displayed internally, (i.e. with the built-in capabilities of
Emacs) and is allowed to be displayed internally (see
`vm-mime-internal-content-types'). If none of the parts can be
-displayed internally, behavior reverts to that of 'best.
+displayed internally, behavior reverts to that of `best'.
- A value of 'all means that all the alternatives are displayed.
+ A value of `all' means that all the alternatives are displayed.
The value can also be a list of the form
(favorite TYPE ...)
-with the first element of the list being the symbol 'favorite'. The
+with the first element of the list being the symbol `favorite'. The
remaining elements of the list are strings specifying MIME types.
VM will look for each TYPE in turn in the list of alternatives and
choose the first matching alternative found that can be displayed.
-If the symbol 'favorite' is 'favorite-internal' instead, the first TYPE
+If the symbol `favorite' is `favorite-internal' instead, the first TYPE
that matches an alternative that can be displayed internally will be
chosen."
@@ -1752,30 +1734,30 @@ chosen."
include, in replies, when it yanks a mesage with
\"multipart/alternative\" content. (It is similar to
`vm-mime-alternative-show-method' used for displaying messages.)
-Possible values are 'best, 'best-internal, 'all or a
+Possible values are `best', `best-internal', `all', or a
favorite-methods list as described below.
- A value of 'best means choose the part that is the most faithful to
+ A value of `best' means choose the part that is the most faithful to
the sender's original content that can be displayed.
- A value of 'best-internal means choose the best part that can
+ A value of `best-internal' means choose the best part that can
be displayed internally, (i.e. with the built-in capabilities of
Emacs) and is allowed to be displayed internally (see
`vm-mime-internal-content-types'). If none of the parts can be
-displayed internally, behavior reverts to that of 'best.
+displayed internally, behavior reverts to that of `best'.
- A value of 'all means that all the alternatives are yanked.
+ A value of `all' means that all the alternatives are yanked.
The value can also be a list of the form
(favorite TYPE ...)
-with the first element of the list being the symbol 'favorite'. The
+with the first element of the list being the symbol `favorite'. The
remaining elements of the list are strings specifying MIME types.
VM will look for each TYPE in turn in the list of alternatives and
choose the first matching alternative found that can be displayed.
-If the symbol 'favorite' is 'favorite-internal' instead, the first TYPE
+If the symbol `favorite' is `favorite-internal' instead, the first TYPE
that matches an alternative that can be displayed internally will be
chosen."
@@ -1789,18 +1771,18 @@ chosen."
(defcustom vm-mime-multipart/related-show-method 'related
"*Value tells how to handle \"multipart/related\" attachments in
-email messages. The possible values are 'mixed and 'related.
+email messages. The possible values are `mixed' and `related'.
-The value of 'mixed asks VM to treat \"multipart/related\"
+The value of `mixed' asks VM to treat \"multipart/related\"
attachments the same way as \"multipart/mixed\" attachments, i.e., all
of them will be displayed either as buttons or as content.
-The value of 'related asks VM to use them as related parts which means
+The value of `related' asks VM to use them as related parts which means
that they will be embedded in rendered \"text/html\" parts.
Some mail messages arrive with wrong placement of the
\"multipart/related\" content, inhibiting the html viewers from
-accessing them. In that case, setting this variable to 'mixed will
+accessing them. In that case, setting this variable to `mixed' will
allow you to view them separately."
:group 'vm-mime
:type '(choice (choice (const mixed)
@@ -1815,8 +1797,8 @@ cid: attachments to the content viewer.")
"*Non-nil value means that VM should attempt to verify signatures
attached in \"multipart/signed\" parts."
:group 'vm-mime
- :type '(choice (const nil :tag "Do not verify")
- (const t :tag "Verify")))
+ :type '(choice (const :tag "Do not verify" nil)
+ (const :tag "Verify" t)))
(defcustom vm-mime-text/html-handler 'auto-select
"*The library used for displaying HTML messages. The possible
@@ -1829,8 +1811,8 @@ values are:
nil No internal display of HTML messages.
"
:group 'vm-mime
- :type '(choice (const nil :tag "Do not display HTML messages.")
- (const auto-select :tag "Autoselect best method")
+ :type '(choice (const :tag "Do not display HTML messages." nil)
+ (const :tag "Autoselect best method" auto-select)
(const emacs-w3m)
(const emacs-w3)
(const w3m)
@@ -1858,12 +1840,13 @@ and when you read an email."
"*List of character sets that can be displayed using the `default' face.
The default face is what you normally see when you edit text in Emacs.
The font assigned to the default face can typically display one or two
-character sets. For U.S. and Western European users, ``us-ascii'' and
+character sets. For U.S. and Western European users, `us-ascii' and
one of the ISO-8859 character sets usually can be displayed. Whatever
character sets that your default face can display should be listed as
the value of `vm-mime-default-face-charsets'. Example:
- (setq vm-mime-default-face-charsets '(\"us-ascii\" \"ansi_x3.4-1968\"
\"iso-8859-1\"))
+ (setq vm-mime-default-face-charsets
+ \\='(\"us-ascii\" \"ansi_x3.4-1968\" \"iso-8859-1\"))
Case is not significant in character set names.
@@ -1896,8 +1879,8 @@ Emacs treats a displayed image as a single large
character and cannot
scroll vertically within an image. To work around this limitation VM
can display an image as a series of contiguous horizontal strips that
Emacs' scrolling routines can better handle. To do this VM needs to
-have the ImageMagick programs 'convert' and 'identify' installed;
-`vm-imagemagick-convert-program' and `vm-imagemagick-identify-program
+have the ImageMagick programs `convert' and `identify' installed;
+`vm-imagemagick-convert-program' and `vm-imagemagick-identify-program'
must point to them.
A nil value means VM should display images without cutting them
@@ -1933,19 +1916,19 @@ them all at once. See `vm-mime-use-image-strips'."
nil))))
(defcustom vm-imagemagick-convert-program (vm-locate-executable-file "convert")
- "*Name of ImageMagick 'convert' program.
+ "*Name of ImageMagick `convert' program.
VM uses this program to convert between image formats and to slice up
images for display. Set this to nil and VM will not use the
-'convert' program."
+`convert' program."
:group 'vm-helpers
:type '(choice (const :tag "None" nil)
file))
(defcustom vm-imagemagick-identify-program
(vm-locate-executable-file "identify")
- "*Name of ImageMagick 'identify' program.
+ "*Name of ImageMagick `identify' program.
VM uses this program to gather information about images. Set this to nil
-and VM will not use the 'convert' program."
+and VM will not use the `convert' program."
:group 'vm-helpers
:type '(choice (const :tag "None" nil)
file))
@@ -1977,6 +1960,8 @@ deleting a MIME object with `vm-delete-mime-object'."
:group 'vm-mime
:type 'boolean)
+(defvaralias 'vm-mime-savable-types
+ 'vm-mime-saveable-types)
(defcustom vm-mime-saveable-types
(append
'("application" "x-unknown" "application/x-gzip")
@@ -1985,20 +1970,20 @@ deleting a MIME object with `vm-delete-mime-object'."
;; (mapcar (lambda (a) (car a))
;; vm-mime-external-content-types-alist)
)
- "*List of MIME types which should be saved."
+ "List of MIME types which should be saved."
:group 'vm-mime
:type '(repeat (string :tag "MIME type" nil)))
-(defvaralias 'vm-mime-savable-types
- 'vm-mime-saveable-types)
+(defvaralias 'vm-mime-savable-type-exceptions
+ 'vm-mime-saveable-type-exceptions)
(defcustom vm-mime-saveable-type-exceptions
'("text")
- "*List of MIME types which should not be saved."
+ "List of MIME types which should not be saved."
:group 'vm-mime
:type '(repeat (string :tag "MIME type" nil)))
-(defvaralias 'vm-mime-savable-type-exceptions
- 'vm-mime-saveable-type-exceptions)
+(defvaralias 'vm-mime-deletable-types
+ 'vm-mime-deleteable-types)
(defcustom vm-mime-deleteable-types
(append
'("application" "x-unknown" "application/x-gzip")
@@ -2007,18 +1992,16 @@ deleting a MIME object with `vm-delete-mime-object'."
;; (mapcar (lambda (a) (car a))
;; vm-mime-external-content-types-alist)
)
- "*List of MIME types which should be deleted."
+ "List of MIME types which should be deleted."
:group 'vm-mime
:type '(repeat (string :tag "MIME type" nil)))
-(defvaralias 'vm-mime-deletable-types
- 'vm-mime-deleteable-types)
+(defvaralias 'vm-mime-deletable-type-exceptions
+ 'vm-mime-deleteable-type-exceptions)
(defcustom vm-mime-deleteable-type-exceptions '("text")
- "*List of MIME types which should not be deleted."
+ "List of MIME types which should not be deleted."
:group 'vm-mime
:type '(repeat (string :tag "MIME type" nil)))
-(defvaralias 'vm-mime-deletable-type-exceptions
- 'vm-mime-deleteable-type-exceptions)
(defvar vm-mime-auto-save-all-attachments-avoid-recursion nil
"For internal use.")
@@ -2228,8 +2211,7 @@ in a single buffer under MULE, VM will map the file
coding system
of the buffer to a single MIME character set that can display all
the buffer's characters."
:group 'vm-mime
- :type '(choice (const nil)
- (string :tag "iso-8859-1" "iso-8859-1")
+ :type '(choice (string :tag "iso-8859-1" "iso-8859-1")
(string :tag "iso-2022-jp" "iso-2022-jp")
(string :tag "User defined")
(const :tag "Auto select" nil)))
@@ -2244,9 +2226,9 @@ if the recipient does not have a MIME-capable mail
reader. BASE64
is unreadable without a MIME-capable mail reader, unless your name
is U3BvY2s=.
-A value of 'quoted-printable, means to use quoted-printable encoding.
-A value of 'base64 means to use BASE64 encoding.
-A value of '8bit means to send the message as is.
+A value of `quoted-printable', means to use quoted-printable encoding.
+A value of `base64' means to use BASE64 encoding.
+A value of `8bit' means to send the message as is.
Note that this variable usually only applies to textual MIME
content types. Images, audio, video, etc. typically will have
@@ -2486,14 +2468,14 @@ and the type corresponding to the first match found is
used."
:group 'vm-mime
:type 'boolean)
+(defvaralias 'vm-mime-attachment-infer-type-for-text-attachments
+ 'vm-infer-mime-types-for-text)
(defcustom vm-infer-mime-types-for-text nil
- "*Non-nil value means VM should try to infer a MIME object's
+ "Non-nil value means VM should try to infer a MIME object's
type from its filename also for text attachments, not only for
application/octet-stream."
:group 'vm-mime
:type 'boolean)
-(defvaralias 'vm-mime-attachment-infer-type-for-text-attachments
- 'vm-infer-mime-types-for-text)
(make-obsolete-variable 'vm-mime-attachment-infer-type-for-text-attachments
'vm-infer-mime-types-for-text "8.2.0")
@@ -3343,7 +3325,7 @@ A nil value means to use plain text forwarding."
(const "mime")
(const "rfc934")
(const "rfc1153")
- (const nil :tag "Forward in plain text")))
+ (const :tag "Forward in plain text" nil)))
(defcustom vm-mime-forward-local-external-bodies nil
"*Non-nil value means that the `message/external-body' MIME
@@ -3459,7 +3441,7 @@ A nil value means to use plain text digests."
:type '(choice (const "mime")
(const "rfc934")
(const "rfc1153")
- (const nil "Plain text digests")))
+ (const :tag "Plain text digests" nil)))
(defcustom vm-rfc934-digest-headers
'("Resent-"
@@ -3665,7 +3647,7 @@ the message."
regexp))
(defcustom vm-resend-headers nil
- "*List of headers that should be appear in messages resent with
+ "List of headers that should appear in messages resent with
`vm-resend-message'. These should be listed in the order you wish them
to appear in the message. Regular expressions are allowed.
There is no need to anchor patterns with \"^\", as searches always
@@ -3685,8 +3667,7 @@ appearance in that case, with headers not matching any in
the
`vm-resend-headers' list appearing last in the headers of
the message."
:group 'vm-forward
- :type '(choice (const nil)
- repeat regexp))
+ :type '(repeat regexp))
(defcustom vm-resend-discard-header-regexp
"\\(\\(X400-\\)?Received:\\|Resent-\\)"
"*Non-nil value should be a regular expression that tells
@@ -3945,13 +3926,13 @@ respectively."
:group 'vm-summary
:type '(choice (const nil) regexp))
+(defvaralias 'vm-summary-uninteresting-senders-arrow
+ 'vm-summary-recipient-marker)
(defcustom vm-summary-recipient-marker "To: "
- "*String to display before the recipients when displayed instead of an
+ "String to display before the recipients when displayed instead of an
\"uninteresting\" sender. See `vm-summary-uninteresting-senders'."
:group 'vm-summary
:type 'string)
-(defvaralias 'vm-summary-uninteresting-senders-arrow
- 'vm-summary-recipient-marker)
(defcustom vm-summary-principal-marker "For: "
"*String to display before the principal when displayed instead of an
@@ -4145,8 +4126,10 @@ List the directories in the order you wish them to
appear in the summary."
:group 'vm-summary
:type '(repeat directory))
+(defvaralias 'vm-mutable-windows
+ 'vm-mutable-window-configuration)
(defcustom vm-mutable-window-configuration pop-up-windows
- "*This variable's value controls VM's window usage.
+ "This variable's value controls VM's window usage.
A non-nil value gives VM free run of the Emacs display; it will commandeer
the entire screen for its purposes.
@@ -4156,11 +4139,11 @@ it was invoked. VM will not create, delete, or use any
other windows,
nor will it resize its own window."
:group 'vm-frames
:type 'boolean)
-(defvaralias 'vm-mutable-windows
- 'vm-mutable-window-configuration)
+(defvaralias 'vm-mutable-frames
+ 'vm-mutable-frame-configuration)
(defcustom vm-mutable-frame-configuration t
- "*Non-nil value means VM is allowed to create and destroy frames
+ "Non-nil value means VM is allowed to create and destroy frames
to display and undisplay buffers. Whether VM actually does
so depends on the value of the variables with names prefixed by
``vm-frame-per-''.
@@ -4173,8 +4156,6 @@ This variable does not apply to the VM commands whose
names end in -other-frame, which always create a new frame."
:group 'vm-frames
:type 'boolean)
-(defvaralias 'vm-mutable-frames
- 'vm-mutable-frame-configuration)
(defcustom vm-raise-frame-at-startup t
"*Specifies whether VM should raise its frame at startup.
@@ -4211,7 +4192,7 @@ VM will use them."
:type 'boolean)
(defcustom vm-frame-per-folders-summary nil
- "*Non-nil value causes VM to display the 'all folders' summary in its own
frame.
+ "Non-nil value causes VM to display the \"all folders\" summary in its own
frame.
Nil means the `vm-folders-summarize' command will use the current frame.
This variable has no meaning if you're not running under an Emacs
@@ -4675,7 +4656,7 @@ unread message appears before it in the folder, provided
:type 'boolean)
(defcustom vm-skip-deleted-messages t
- "*Non-nil value causes VM's `n' and 'p' commands to skip over
+ "Non-nil value causes VM's `n' and `p' commands to skip over
deleted messages. A value of t causes deleted messages to always be skipped.
A value that is not nil and not t causes deleted messages to be skipped only
if there are other messages that are not flagged for deletion in the desired
@@ -4851,20 +4832,18 @@ headers."
:type 'boolean)
(defcustom vm-select-new-message-hook nil
- "*List of hook functions called every time a message with the 'new'
-attribute is made to be the current message. When the hooks are run, the
-current buffer will be the folder containing the message and the
-start and end of the message will be bracketed by (point-min) and
-(point-max)."
+ "Hook run every time a message with the `new'
+attribute is made to be the current message. When the functions are run, the
+current buffer is the folder containing the message and it is narrowed
+to the start and end of the message."
:group 'vm-hooks
:type 'hook)
(defcustom vm-select-unread-message-hook nil
- "*List of hook functions called every time a message with the 'unread'
-attribute is made to be the current message. When the hooks are run, the
-current buffer will be the folder containing the message and the
-start and end of the message will be bracketed by (point-min) and
-(point-max)."
+ "Hook run every time a message with the `unread'
+attribute is made to be the current message. When the functions are called,
+the current buffer is the folder containing the message and it is narrowed to
+the start and end of the message."
:group 'vm-hooks
:type 'hook)
@@ -5471,7 +5450,7 @@ that `vm-decode-mime-message' would do is not done,
because this
function is expected to subsume all of it."
:group 'vm-mime
:type '(choice (const :tag "None" nil)
- 'function))
+ function))
(defcustom vm-mime-deleted-object-label "[Deleted %f (%t)]\n"
"*The label that will be inserted instead of the original mime object.
@@ -5480,8 +5459,8 @@ See `vm-mime-compile-format-1' for valid format
specifiers."
:type 'string)
(defvar vm-mime-show-alternatives nil
- "*This variable is deprecated. You can set
-`vm-mime-alternative-show-method' to 'all to get the same effect as
+ "This variable is deprecated. You can set
+`vm-mime-alternative-show-method' to `all' to get the same effect as
setting this one to t.")
(make-obsolete-variable 'vm-mime-show-alternatives
@@ -5790,7 +5769,7 @@ Older versions of stunnel used command line arguments
instead."
:group 'vm-helpers
:type '(choice (const :tag "Yes" t)
(const :tag "No" nil)
- (const :tag "Automatically determine" 'unknown)))
+ (const :tag "Automatically determine" unknown)))
(defcustom vm-stunnel-program-additional-configuration-file nil
"*Name of a configuration file to append to the config file VM creates
@@ -5828,7 +5807,7 @@ tells VM to generate the random data.
A nil value tells VM to do nothing and let stunnel find the data
if it can."
:group 'vm-helpers
- :type '(choice (const "Leave it to stunnel" nil)
+ :type '(choice (const :tag "Leave it to stunnel" nil)
(const generate)))
(defcustom vm-ssh-program "ssh"
@@ -5884,14 +5863,14 @@ data to XBM data."
"Non-nil if the uncompface command accepts a -X argument.
This is only used for FSF Emacs currently.")
+(defvaralias 'vm-tale-is-an-idiot 'vm-mail-check-recipient-format)
(defcustom vm-mail-check-recipient-format nil
- "*Non-nil value causes `vm-mail-send' to check multi-line recipient
+ "Non-nil value causes `vm-mail-send' to check multi-line recipient
headers of outbound mail for lines that don't end with a
comma. If such a line is found, an error is signaled and the
mail is not sent."
:group 'vm-compose
:type 'boolean)
-(defvaralias 'vm-tale-is-an-idiot 'vm-mail-check-recipient-format)
(defcustom vm-dnd-protocol-alist
'(("^file:///" . vm-dnd-attach-file)
@@ -5956,55 +5935,38 @@ be a regexp matching all chars to be replaced by a
\"_\"."
"Where to send VM bug reports.")
(defvar vm-use-v7-key-bindings nil
- "*Retain all the optional key bindings of VM as per version 7.19.")
-
-(defun vm-v8-key-bindings ()
- "Install optional key bindings for VM modes, as per versions 8.2.0
-and up."
- (interactive)
- (define-key vm-mode-map "!" 'vm-toggle-flag-message)
- (define-key vm-mode-map "<" 'vm-promote-subthread)
- (define-key vm-mode-map ">" 'vm-demote-subthread)
- (define-key vm-mode-virtual-map "O" 'vm-virtual-omit-message)
- (define-key vm-mode-virtual-map "U" 'vm-virtual-update-folders)
- (define-key vm-mode-virtual-map "D" 'vm-virtual-auto-delete-message)
- ;; (define-key vm-mode-virtual-map "S" 'vm-virtual-save-message)
- ;; (define-key vm-mode-virtual-map "A" 'vm-virtual-auto-archive-messages)
- (define-key vm-mode-virtual-map "?" 'vm-virtual-check-selector-interactive)
- )
-(defalias 'vm-current-key-bindings 'vm-v8-key-bindings)
-
-(defun vm-v7-key-bindings ()
- "Install optional key bindings for VM modes, as per version 7.19.
+ "Retain all the optional key bindings of VM as per version 7.19.")
-These key bindings are considered optional. They can be rebound by
-the users or bound to other functions in future versions of VM."
- (interactive)
- (define-key vm-mode-map "<" 'vm-beginning-of-message) ; infrequent
- (define-key vm-mode-map ">" 'vm-end-of-message) ; infrequent
- (define-key vm-mode-map "b" 'vm-scroll-backward) ; redundant, use <BSP>
- (define-key vm-mode-map "e" 'vm-edit-message) ; infrequent and dangerous
- (define-key vm-mode-map "w" 'vm-save-message-sans-headers) ; infrequent
- (define-key vm-mode-map "a" 'vm-set-message-attributes) ; infrequent
- (define-key vm-mode-map "i" 'vm-iconify-frame) ; redundant, C-x C-z
- (define-key vm-mode-map "*" 'vm-burst-digest) ; specialized
- (define-key vm-mode-map "!" 'shell-command) ; Emacs has a key binding
- (define-key vm-mode-map "=" 'vm-summarize) ; redundant, use `h'
- (define-key vm-mode-map "L" 'vm-load-init-file) ; infrequent
- (define-key vm-mode-map "\M-l" 'vm-edit-init-file) ; infrequent
- (define-key vm-mode-map "%" 'vm-change-folder-type) ; infrequent
- (define-key vm-mode-map "\M-g" 'vm-goto-message) ; redundant, use <RET>
- )
-(defalias 'vm-legacy-key-bindings 'vm-v7-key-bindings)
+(defvar vm-mode-virtual-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "V" 'vm-visit-virtual-folder)
+ (define-key map "C" 'vm-create-virtual-folder)
+ (define-key map "T" 'vm-create-virtual-folder-of-threads)
+ (define-key map "X" 'vm-apply-virtual-folder)
+ (define-key map "A" 'vm-create-virtual-folder-same-author)
+ (define-key map "R" 'vm-create-virtual-folder-same-recipient)
+ (define-key map "S" 'vm-create-virtual-folder-same-subject)
+ (define-key map "M" 'vm-toggle-virtual-mirror)
+
+ (define-key map "a" 'vm-create-author-virtual-folder)
+ (define-key map "r" 'vm-create-author-or-recipient-virtual-folder)
+ (define-key map "d" 'vm-create-date-virtual-folder)
+ (define-key map "l" 'vm-create-label-virtual-folder)
+ (define-key map "s" 'vm-create-subject-virtual-folder)
+ (define-key map "t" 'vm-create-text-virtual-folder)
+ (define-key map "!" 'vm-create-flagged-virtual-folder)
+ (define-key map "n" 'vm-create-new-virtual-folder)
+ (define-key map "u" 'vm-create-unseen-virtual-folder)
+
+ (define-key map "?" 'vm-virtual-help)
+ map))
(defvar vm-mode-map
(let ((map (make-keymap)))
+ ;; FIXME: Do we need these vars?
(defvar vm-mode-label-map (make-sparse-keymap))
- (defvar vm-mode-virtual-map (make-sparse-keymap))
(defvar vm-mode-mark-map (make-sparse-keymap))
(defvar vm-mode-window-map (make-sparse-keymap))
- (defvar vm-mode-mark-map (make-sparse-keymap))
- (defvar vm-mode-mark-map (make-sparse-keymap))
(defvar vm-mode-pipe-map (make-sparse-keymap))
;; unneeded now that VM buffers all have buffer-read-only == t.
;; but no harm in suppressing. USR, 2011-04-27
@@ -6094,26 +6056,6 @@ the users or bound to other functions in future versions
of VM."
(define-key vm-mode-label-map "e" 'vm-add-existing-message-labels)
(define-key vm-mode-label-map "d" 'vm-delete-message-labels)
(define-key map "V" vm-mode-virtual-map)
- (define-key vm-mode-virtual-map "V" 'vm-visit-virtual-folder)
- (define-key vm-mode-virtual-map "C" 'vm-create-virtual-folder)
- (define-key vm-mode-virtual-map "T" 'vm-create-virtual-folder-of-threads)
- (define-key vm-mode-virtual-map "X" 'vm-apply-virtual-folder)
- (define-key vm-mode-virtual-map "A" 'vm-create-virtual-folder-same-author)
- (define-key vm-mode-virtual-map "R"
'vm-create-virtual-folder-same-recipient)
- (define-key vm-mode-virtual-map "S" 'vm-create-virtual-folder-same-subject)
- (define-key vm-mode-virtual-map "M" 'vm-toggle-virtual-mirror)
-
- (define-key vm-mode-virtual-map "a" 'vm-create-author-virtual-folder)
- (define-key vm-mode-virtual-map "r"
'vm-create-author-or-recipient-virtual-folder)
- (define-key vm-mode-virtual-map "d" 'vm-create-date-virtual-folder)
- (define-key vm-mode-virtual-map "l" 'vm-create-label-virtual-folder)
- (define-key vm-mode-virtual-map "s" 'vm-create-subject-virtual-folder)
- (define-key vm-mode-virtual-map "t" 'vm-create-text-virtual-folder)
- (define-key vm-mode-virtual-map "!" 'vm-create-flagged-virtual-folder)
- (define-key vm-mode-virtual-map "n" 'vm-create-new-virtual-folder)
- (define-key vm-mode-virtual-map "u" 'vm-create-unseen-virtual-folder)
-
- (define-key vm-mode-virtual-map "?" 'vm-virtual-help)
(define-key map "M" vm-mode-mark-map)
(define-key vm-mode-mark-map "N" 'vm-next-command-uses-marks)
(define-key vm-mode-mark-map "n" 'vm-next-command-uses-marks)
@@ -6187,6 +6129,45 @@ the users or bound to other functions in future versions
of VM."
`vm-mode-pipe-map' VM mode pipe-to-application map (`|')
")
+(defun vm-v8-key-bindings ()
+ "Install optional key bindings for VM modes, as per versions 8.2.0
+and up."
+ (interactive)
+ (define-key vm-mode-map "!" 'vm-toggle-flag-message)
+ (define-key vm-mode-map "<" 'vm-promote-subthread)
+ (define-key vm-mode-map ">" 'vm-demote-subthread)
+ (define-key vm-mode-virtual-map "O" 'vm-virtual-omit-message)
+ (define-key vm-mode-virtual-map "U" 'vm-virtual-update-folders)
+ (define-key vm-mode-virtual-map "D" 'vm-virtual-auto-delete-message)
+ ;; (define-key vm-mode-virtual-map "S" 'vm-virtual-save-message)
+ ;; (define-key vm-mode-virtual-map "A" 'vm-virtual-auto-archive-messages)
+ (define-key vm-mode-virtual-map "?" 'vm-virtual-check-selector-interactive)
+ )
+(defalias 'vm-current-key-bindings 'vm-v8-key-bindings)
+
+(defun vm-v7-key-bindings ()
+ "Install optional key bindings for VM modes, as per version 7.19.
+
+These key bindings are considered optional. They can be rebound by
+the users or bound to other functions in future versions of VM."
+ (interactive)
+ (define-key vm-mode-map "<" 'vm-beginning-of-message) ; infrequent
+ (define-key vm-mode-map ">" 'vm-end-of-message) ; infrequent
+ (define-key vm-mode-map "b" 'vm-scroll-backward) ; redundant, use <BSP>
+ (define-key vm-mode-map "e" 'vm-edit-message) ; infrequent and dangerous
+ (define-key vm-mode-map "w" 'vm-save-message-sans-headers) ; infrequent
+ (define-key vm-mode-map "a" 'vm-set-message-attributes) ; infrequent
+ (define-key vm-mode-map "i" 'vm-iconify-frame) ; redundant, C-x C-z
+ (define-key vm-mode-map "*" 'vm-burst-digest) ; specialized
+ (define-key vm-mode-map "!" 'shell-command) ; Emacs has a key binding
+ (define-key vm-mode-map "=" 'vm-summarize) ; redundant, use `h'
+ (define-key vm-mode-map "L" 'vm-load-init-file) ; infrequent
+ (define-key vm-mode-map "\M-l" 'vm-edit-init-file) ; infrequent
+ (define-key vm-mode-map "%" 'vm-change-folder-type) ; infrequent
+ (define-key vm-mode-map "\M-g" 'vm-goto-message) ; redundant, use <RET>
+ )
+(defalias 'vm-legacy-key-bindings 'vm-v7-key-bindings)
+
(defun vm-optional-key ()
"Certain VM keys have optional bindings in VM, which differ from
version to version. Include \"(vm-legacy-key-bindings)\" in your
@@ -6232,7 +6213,7 @@ threads will apply to all the messages in the threads.
attributes, adding/deleting labels etc.
If the variable is set to t then thread operations are always
-carried out. If it is set to 'ask, then the user is asked for
+carried out. If it is set to `ask', then the user is asked for
confirmation whether the operation should apply to all the
messages in the thread. This can be overridden by invoking the
operation with a prefix argument using `C-u' and no questions will be
@@ -6320,7 +6301,7 @@ Its parent keymap is mail-mode-map.")
(defvar vm-folder-type nil)
(make-variable-buffer-local 'vm-folder-type)
(defvar vm-folder-access-method nil
- "Indicates how a VM folder is accessed: 'pop for POP folders, 'imap
+ "Indicates how a VM folder is accessed: `pop' for POP folders, `imap'
for IMAP folders and nil for local folders.")
(make-variable-buffer-local 'vm-folder-access-method)
@@ -6706,6 +6687,9 @@ folder needs to be updated.")
:group 'vm-folders
:type 'file)
+(defvaralias 'vm-vs-spam-score-headers
+ 'vm-spam-score-headers)
+
(defcustom vm-spam-score-headers
'(("X-Spam-Score:" "[-+]?[0-9]*\\.?[0-9]+" string-to-number)
("X-Spam-Status:" "[-+]?[0-9]*\\.?[0-9]+" string-to-number)
@@ -6725,9 +6709,6 @@ header line in email messages,
(regexp :tag "Regexp matching the spam-score")
(function :tag "Function to convert the spam-score
string to a number"))))
-(defvaralias 'vm-vs-spam-score-headers
- 'vm-spam-score-headers)
-
(defvar vm-supported-sort-keys
'("date" "reversed-date"
"activity" "reversed-activity"
@@ -6741,6 +6722,9 @@ header line in email messages,
"spam-score" "reversed-spam-score"
"physical-order" "reversed-physical-order"))
+(defvaralias 'vm-supported-interactive-virtual-selectors
+ 'vm-vs-interactive)
+
(defconst vm-vs-interactive
'(("any")
("sexp")
@@ -6804,8 +6788,8 @@ virtual folders (search folders) interactively. You can
get
individual help on each selector by checking the function
`vm-vs-SELECTOR', e.g., `vm-vs-spam-score' for the spam-score selector.")
-(defvaralias 'vm-supported-interactive-virtual-selectors
- 'vm-vs-interactive)
+(defvaralias 'vm-virtual-selector-function-alist
+ 'vm-vs-alist)
(defconst vm-vs-alist
'((any . vm-vs-any)
@@ -6875,9 +6859,6 @@ individual help on each selector by checking the function
(collapsed . vm-vs-collapsed)
))
-(defvaralias 'vm-virtual-selector-function-alist
- 'vm-vs-alist)
-
(defconst vm-supported-attribute-names
'("new"
"unread"
@@ -7129,25 +7110,12 @@ UIDVALIDITY for each message to be expunged.")
(defvar vm-imap-session-type nil
"This buffer-local variable holds the status of the IMAP session.
Possible values are
-'active - active session present
-'valid - message sequence numbers are valid
+`active' - active session present
+`valid' - message sequence numbers are valid
validity is preserved by FETCH, STORE and SEARCH operations
-'inactive - session is inactive")
+`inactive' - session is inactive")
(make-variable-buffer-local 'vm-imap-session-type)
-(eval-when-compile
- (defvar current-itimer nil)
- (defvar current-menubar nil)
- (defvar scrollbar-height nil)
- (defvar top-toolbar nil)
- (defvar top-toolbar-height nil)
- (defvar bottom-toolbar nil)
- (defvar bottom-toolbar-height nil)
- (defvar right-toolbar nil)
- (defvar right-toolbar-width nil)
- (defvar left-toolbar nil)
- (defvar left-toolbar-width nil))
-
(defvar vm-fsfemacs-toolbar-installed-p nil)
;; this defvar matches the XEmacs one so it doesn't matter if VM
;; is loaded before highlight-headers.el
@@ -7357,7 +7325,8 @@ actions to be taken to destroy them.")
alist)))
(setq coding-systems (cdr coding-systems)))
(setq alist (append '(("us-ascii" raw-text)
- ("unknown" iso-8859-1)) alist))
+ ("unknown" iso-8859-1))
+ alist))
alist))
(t
'(
@@ -7385,7 +7354,7 @@ actions to be taken to destroy them.")
)
))
"Alist that maps MIME character sets to MULE coding systems. The
-information is generated from the 'mime-charset property of coding
+information is generated from the `mime-charset' property of coding
systems, if it is defined in the Emacs version. Otherwise, a
default alist is used.")
@@ -7430,7 +7399,7 @@ default alist is used.")
(iso-2022-7-mac "iso-2022-jp")
)))
"Alist that maps MULE coding systems to MIME character sets. The
-information is generated from the 'mime-charset property of coding
+information is generated from the `mime-charset' property of coding
systems, if it is defined in the Emacs version. Otherwise, a
default alist is used.")
@@ -7566,12 +7535,13 @@ preferences file).
The file names may be customized via the variables `vm-init-file' and
`vm-preferences-file'. "
(interactive "P")
- (when (or (not vm-init-file-loaded) (interactive-p))
+ (when (or (not vm-init-file-loaded) (vm-interactive-p))
(when vm-init-file
- (load vm-init-file (not (interactive-p)) (not (interactive-p)) t))
+ (load vm-init-file (not (vm-interactive-p)) (not (vm-interactive-p)) t))
(when (and vm-preferences-file (not init-only))
(load vm-preferences-file t t t)))
(setq vm-init-file-loaded t)
(vm-display nil nil '(vm-load-init-file) '(vm-load-init-file)))
+(provide 'vm-vars)
;;; vm-vars.el ends here
diff --git a/lisp/vm-vcard.el b/lisp/vm-vcard.el
index 895b3f0933..2b34bf78ae 100644
--- a/lisp/vm-vcard.el
+++ b/lisp/vm-vcard.el
@@ -28,12 +28,8 @@
;;; Commentary:
;;; Code:
-(provide 'vm-vcard)
-
(require 'vcard)
-
-(eval-when-compile
- (require 'vm-mime))
+(require 'vm-mime)
(and (string-lessp vcard-api-version "2.0")
(error "vm-vcard.el requires vcard API version 2.0 or later."))
@@ -65,8 +61,7 @@
(let* ((beg (vm-mm-layout-body-start layout))
(end (vm-mm-layout-body-end layout))
(buf (if (markerp beg) (marker-buffer beg) (current-buffer)))
- (raw (vm-vcard-decode (save-excursion
- (set-buffer buf)
+ (raw (vm-vcard-decode (with-current-buffer buf
(save-restriction
(widen)
(buffer-substring beg end)))
@@ -79,8 +74,7 @@
(defun vm-vcard-decode (string layout)
(let ((buf (generate-new-buffer " *vcard decoding*")))
- (save-excursion
- (set-buffer buf)
+ (with-current-buffer buf
(insert string)
(vm-mime-transfer-decode-region layout (point-min) (point-max))
(setq string (buffer-substring (point-min) (point-max))))
@@ -90,4 +84,5 @@
(defun vm-vcard-format-simple (vcard)
(concat "\n\n--\n" (vcard-format-sample-string vcard) "\n\n"))
+(provide 'vm-vcard)
;;; vm-vcard.el ends here.
diff --git a/lisp/vm-version.el b/lisp/vm-version.el
index d4bfbed23f..d4fdc82f77 100644
--- a/lisp/vm-version.el
+++ b/lisp/vm-version.el
@@ -19,13 +19,12 @@
;;; Code:
-(provide 'vm-version)
+(require 'vm-macro)
;; Don't use vm-device-type here because it may not not be loaded yet.
(declare-function device-type "vm-xemacs" ())
(declare-function device-matching-specifier-tag-list "vm-xemacs" ())
-
(defconst vm-version
(condition-case nil
(with-temp-buffer
@@ -40,7 +39,7 @@
(defun vm-version ()
"Return the value of the variable `vm-version'."
(interactive)
- (when (interactive-p)
+ (when (vm-interactive-p)
(or (and (stringp vm-version)
(string-match "[0-9]" vm-version))
(error "Cannot determine VM version!"))
@@ -132,4 +131,5 @@ Return the list of loaded features."
feature-list))
(delete nil feature-list))
+(provide 'vm-version)
;;; vm-version.el ends here
diff --git a/lisp/vm-virtual.el b/lisp/vm-virtual.el
index 767e24dbdb..571b569079 100644
--- a/lisp/vm-virtual.el
+++ b/lisp/vm-virtual.el
@@ -22,26 +22,14 @@
;;; Code:
-(provide 'vm-virtual)
-
+(require 'vm-message)
(require 'vm-macro)
+(require 'vm-misc)
+(require 'vm-minibuf)
-(eval-when-compile
- (require 'vm-misc)
- (require 'vm-minibuf)
- (require 'vm-menu)
- (require 'vm-summary)
- (require 'vm-folder)
- (require 'vm-window)
- (require 'vm-page)
- (require 'vm-motion)
- (require 'vm-undo)
- (require 'vm-delete)
- (require 'vm-save)
- (require 'vm-reply)
- (require 'vm-sort)
- (require 'vm-thread)
-)
+;; FIXME: Cyclic dependence between vm-virtual.el and vm-avirtual.el
+;; prevents us from requiring `vm-avirtual' here.
+(defvar vm-virtual-message)
(declare-function vm-visit-folder "vm"
(folder &optional read-only &key interactive just-visit))
@@ -92,7 +80,7 @@ all the real folder buffers involved."
(vbuffer (current-buffer))
(mirrored vm-virtual-mirror)
(case-fold-search t)
- (tail-cons (if dont-finalize nil (vm-last vm-message-list)))
+ (tail-cons (if dont-finalize nil (last vm-message-list)))
(new-message-list nil)
virtual location-vector
message folders folder buffer
@@ -215,9 +203,8 @@ all the real folder buffers involved."
(vm-real-message-of m))
message-set)))
(if virtual
- (save-excursion
- (set-buffer
- (vm-buffer-of (vm-real-message-of m)))
+ (with-current-buffer
+ (vm-buffer-of (vm-real-message-of m))
(apply 'vm-vs-or m selectors))
(apply 'vm-vs-or m selectors)))
(when (and vm-virtual-debug
@@ -981,8 +968,7 @@ any) for this selector to detect the occurrences in the
text."
vm-spam-words-file
(file-readable-p vm-spam-words-file)
(not (get-file-buffer vm-spam-words-file)))
- (save-excursion
- (set-buffer (find-file-noselect vm-spam-words-file))
+ (with-current-buffer (find-file-noselect vm-spam-words-file)
(goto-char (point-min))
(while (re-search-forward "^\\s-*\\([^#;].*\\)\\s-*$" (point-max) t)
(setq vm-spam-words (cons (match-string 1) vm-spam-words)))
@@ -1366,8 +1352,7 @@ folder buffer (which should be the virtual folder in
which M occurs)."
(buffer-read-only nil)
(modified (buffer-modified-p)))
(unwind-protect
- (save-excursion
- (set-buffer (vm-buffer-of real-m))
+ (with-current-buffer (vm-buffer-of real-m)
(save-restriction
(widen)
;; must reference this now so that headers will be in
@@ -1394,4 +1379,5 @@ folder buffer (which should be the virtual folder in
which M occurs)."
;; ;; now load vm-avirtual to avoid a loading loop
;; (require 'vm-avirtual)
+(provide 'vm-virtual)
;;; vm-virtual.el ends here
diff --git a/lisp/vm-w3.el b/lisp/vm-w3.el
index 65fdbc7b9d..e3405eb055 100644
--- a/lisp/vm-w3.el
+++ b/lisp/vm-w3.el
@@ -25,9 +25,7 @@
;;; Code:
-(eval-when-compile
- (require 'vm-mime)
-)
+(require 'vm-mime)
(eval-and-compile
(require 'vm-version)
@@ -73,3 +71,5 @@
;; remove read-only text properties
(let ((inhibit-read-only t))
(remove-text-properties start end '(read-only nil))))
+(provide 'vm-w3)
+;;; vm-w3.el ends here
diff --git a/lisp/vm-w3m.el b/lisp/vm-w3m.el
index 9807ff8ed2..d77678f5d0 100644
--- a/lisp/vm-w3m.el
+++ b/lisp/vm-w3m.el
@@ -30,15 +30,10 @@
;;; Code:
-(provide 'vm-w3m)
-
-(eval-when-compile
- (require 'vm-mime)
- (require 'executable))
+(require 'vm-mime)
+(require 'vm-version)
-(eval-and-compile
- (require 'vm-version)
- (vm-load-features '(w3m)))
+(eval-and-compile (vm-load-features '(w3m)))
(declare-function w3m-region
"ext:w3m" (start end &optional url charset))
@@ -128,9 +123,7 @@ by the minor-mode-keymap for emacs-w3m text, as determined
by
(defun vm-w3m-cid-retrieve (url &rest args)
"Insert a content of URL."
- (let ((message (save-excursion
- (set-buffer w3m-current-buffer)
- (car vm-message-pointer)))
+ (let ((message (with-current-buffer w3m-current-buffer
(car vm-message-pointer)))
part
type)
(setq part (vm-mime-cid-retrieve url message))
@@ -189,8 +182,8 @@ If the prefix arg is given, all images are considered to be
safe."
((eq major-mode 'vm-mode)
vm-presentation-buffer))))
(if (buffer-live-p buffer)
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(w3m-safe-toggle-inline-images arg)))))
+(provide 'vm-w3m)
;;; vm-w3m.el ends here
diff --git a/lisp/vm-window.el b/lisp/vm-window.el
index 54971c8d94..64a85b5a29 100644
--- a/lisp/vm-window.el
+++ b/lisp/vm-window.el
@@ -21,14 +21,9 @@
;;; Code:
-(provide 'vm-window)
-
(require 'vm-macro)
-
-(eval-when-compile
- (require 'vm-misc)
- (require 'tapestry)
- )
+(require 'vm-misc)
+(require 'tapestry) ;; FIXME: Use Emacs-24's `frameset'?
(declare-function frame-highest-window "vm-xemacs" (frame))
@@ -90,7 +85,7 @@
;; configuration is done, and only then if the value of
;; this-command is found in the COMMANDS list.
(and (stringp buffer) (setq buffer (get-buffer buffer)))
- (vm-save-buffer-excursion
+ (save-current-buffer
(let* ((w (and buffer (vm-get-buffer-window buffer)))
(wf (and w (vm-window-frame w))))
(if (and w display (not do-not-raise))
@@ -100,8 +95,7 @@
(cond ((and buffer display)
(if (and vm-display-buffer-hook
(null (vm-get-visible-buffer-window buffer)))
- (progn (save-excursion
- (set-buffer buffer)
+ (progn (with-current-buffer buffer
(run-hooks 'vm-display-buffer-hook))
(switch-to-buffer buffer))
(if (not (and (memq this-command commands)
@@ -111,8 +105,7 @@
((and buffer (not display))
(if (and vm-undisplay-buffer-hook
(vm-get-visible-buffer-window buffer))
- (progn (save-excursion
- (set-buffer buffer)
+ (progn (with-current-buffer buffer
(run-hooks 'vm-undisplay-buffer-hook)))
(if (not (and (memq this-command commands)
(apply 'vm-set-window-configuration configs)))
@@ -133,7 +126,7 @@
(switch-to-buffer buffer))))
(defun vm-undisplay-buffer (buffer)
- (vm-save-buffer-excursion
+ (save-current-buffer
(let ((vm-mutable-frame-configuration
(and vm-mutable-frame-configuration pop-up-frames)))
(vm-maybe-delete-windows-or-frames-on buffer))
@@ -240,8 +233,7 @@
(if (and (stringp x)
(get-buffer x)
(zerop
- (save-excursion
- (set-buffer x)
+ (with-current-buffer x
(buffer-size))))
nonexistent
x )))))
@@ -311,8 +303,7 @@ window configurations."
(vm-inform 5 "%s configuration recorded" tag)))
(defun vm-buffer-to-label (buf)
- (save-excursion
- (set-buffer buf)
+ (with-current-buffer buf
(cond ((eq major-mode 'vm-summary-mode)
'summary)
((eq major-mode 'vm-folders-summary-mode)
@@ -728,4 +719,5 @@ Run the hooks in vm-iconify-frame-hook before doing so."
;; others.
(fset 'vm-select-frame 'ignore)))
+(provide 'vm-window)
;;; vm-window.el ends here
diff --git a/lisp/vm.el b/lisp/vm.el
index 1c3ee27405..228988a4a3 100644
--- a/lisp/vm.el
+++ b/lisp/vm.el
@@ -35,32 +35,29 @@
(require 'vm-version)
(require 'vm-macro)
+(require 'vm-misc)
+(require 'vm-folder)
+(require 'vm-summary)
+(require 'vm-window)
+(require 'vm-minibuf)
+(require 'vm-menu)
+(require 'vm-toolbar)
+(require 'vm-mouse)
+(require 'vm-page)
+(require 'vm-motion)
+(require 'vm-undo)
+(require 'vm-delete)
+(require 'vm-crypto)
+(require 'vm-mime)
+(require 'vm-virtual)
+(require 'vm-pop)
+(require 'vm-imap)
+(require 'vm-sort)
+(require 'vm-reply)
+(eval-when-compile (require 'cl-lib))
-(defvar enable-multibyte-characters)
-;; For function declarations
-(eval-when-compile
- (require 'cl-lib)
- (require 'vm-misc)
- (require 'vm-folder)
- (require 'vm-summary)
- (require 'vm-window)
- (require 'vm-minibuf)
- (require 'vm-menu)
- (require 'vm-toolbar)
- (require 'vm-mouse)
- (require 'vm-page)
- (require 'vm-motion)
- (require 'vm-undo)
- (require 'vm-delete)
- (require 'vm-crypto)
- (require 'vm-mime)
- (require 'vm-virtual)
- (require 'vm-pop)
- (require 'vm-imap)
- (require 'vm-sort)
- (require 'vm-reply)
-)
+(defvar enable-multibyte-characters)
;; vm-xemacs.el is a non-existent file to fool the Emacs 23 compiler
(declare-function vm-xemacs-set-face-foreground "vm-xemacs.el"
@@ -1264,8 +1261,7 @@ summary buffer to select a folder."
(setq vm-folders-summary-buffer
(or (get-buffer summary-buffer-name)
(vm-generate-new-multibyte-buffer summary-buffer-name)))
- (save-excursion
- (set-buffer vm-folders-summary-buffer)
+ (with-current-buffer vm-folders-summary-buffer
(abbrev-mode 0)
(auto-fill-mode 0)
(vm-fsfemacs-nonmule-display-8bit-chars)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [nongnu] elpa/vm 556b5b7d5e 2/2: Merge branch 'vm-fix-many-warnings-markd' into 'main',
ELPA Syncer <=