Article View: gnu.emacs.vm.bug
Article #9502miscellaneous suggested changes to VM 5.31
From: Joe Wells
Date: Sun, 07 Jul 1991 06:55
Date: Sun, 07 Jul 1991 06:55
193 lines
7900 bytes
7900 bytes
A variety of suggested changes to VM 5.31, in diff format, with
explanatory comments sprinkled therein (set off by #s at the beginning of
lines, and thus easily stripped out).
--
Joe
----------------------------------------------------------------------
--- vm.el-dist Sat Apr 20 17:35:04 1991
+++ vm.el Sat Apr 20 17:51:34 1991
#
# Small bug fix.
#
@@ -1342,6 +1342,7 @@
;; The solution, set vm-buffer-modified-p to a value that indicates
;; uncertainty.
(setq vm-buffer-modified-p "--??-")
+ (vm-check-for-killed-summary) ;jbw: added line
(if vm-summary-buffer
(save-excursion
(set-buffer vm-summary-buffer)
#
# A long requested hook.
#
@@ -1574,6 +1575,10 @@
(setq spool-files (cdr spool-files))))
new-mail ))
+(defvar vm-after-get-mail-hook nil
+ "Called after getting new mail from mail spool files.
+Called using run-hooks.")
+
(defun vm-get-spooled-mail ()
(if vm-block-new-mail
(error "Can't get new mail until you save this folder."))
@@ -1598,6 +1603,7 @@
(message "Getting new mail from %s... done" (car spool-files))
(setq got-mail t)))
(setq spool-files (cdr spool-files)))
+ (run-hooks 'vm-after-get-mail-hook) ;jbw: added line
got-mail ))
(defun vm-get-new-mail (&optional arg)
----------------------------------------------------------------------
--- vm-vars.el-dist Sat Apr 20 17:35:03 1991
+++ vm-vars.el Sat Apr 20 18:24:16 1991
#
# This change is not a semantic change, but merely makes it easier for me
# to copy the default definition of this variable and modify it. I also
# think this is cleaner.
#
@@ -614,9 +614,9 @@
" (no messages)"))
" "
global-mode-string
- (vm-message-list
- (" %[{" vm-ml-attributes-string "}%]----")
- (" %[%]----"))
+ " %["
+ (vm-message-list ("{" vm-ml-attributes-string "}"))
+ "%]----"
(-3 . "%p") "-%-"))
(defvar vm-folder-type nil)
(make-variable-buffer-local 'vm-folder-type)
----------------------------------------------------------------------
--- vm-save.el-dist Sat Apr 20 17:33:03 1991
+++ vm-save.el Fri May 17 19:48:45 1991
#
# Vastly improved semantics for interactively picking which file/folder to
# save a message in. Much closer to GNUS, so less confusion. Much easier
# to save several successive messages in different files in a strange
# directory. Never autoselect the current folder. Only sets
# vm-last-save-folder if it would be different from the default. Other
# minor bug fixes. Functionality of selecting folder separated out into
# another function, and thus easier to debug and customize.
#
@@ -130,21 +130,7 @@
The saved messages are flagged as `filed'."
(interactive
(list
- ;; protect value of last-command
- (let ((last-command last-command))
- (vm-follow-summary-cursor)
- (let ((default (save-excursion
- (vm-select-folder-buffer)
- (vm-check-for-killed-summary)
- (or (vm-auto-select-folder vm-message-pointer
- vm-auto-folder-alist)
- vm-last-save-folder)))
- (dir (or vm-folder-directory default-directory)))
- (if default
- (read-file-name (format "Save in folder: (default %s) "
- default)
- dir default nil )
- (read-file-name "Save in folder: " dir nil nil))))
+ (vm-get-save-folder) ;jbw: replaced lots with this call
(prefix-numeric-value current-prefix-arg)))
(let (unexpanded-folder)
(setq unexpanded-folder folder)
@@ -219,10 +205,54 @@
(message "Message%s saved to buffer %s" (if (/= 1 count) "s" "")
(buffer-name folder-buffer)))
(message "Message%s saved to %s" (if (/= 1 count) "s" "") folder)))
- (setq vm-last-save-folder unexpanded-folder)
+ ;;(setq vm-last-save-folder unexpanded-folder) ;jbw: commented out
(if vm-delete-after-saving
(vm-delete-message count))
(vm-update-summary-and-mode-line)))
+
+(defun vm-get-save-folder ()
+ (let ((last-command last-command) ; protect value of last-command
+ (this-command this-command)
+ (current-prefix-arg current-prefix-arg)
+ (folder-dir (file-name-as-directory
+ (expand-file-name
+ (expand-file-name vm-folder-directory "~"))))
+ current-folder auto-select-folder last-save-folder default-folder
+ default-dir folder)
+ (vm-follow-summary-cursor)
+ (save-excursion
+ (vm-select-folder-buffer)
+ (vm-check-for-killed-summary)
+ (vm-error-if-folder-empty)
+ (setq current-folder buffer-file-name)
+ (setq auto-select-folder
+ (vm-auto-select-folder vm-message-pointer vm-auto-folder-alist))
+ (if auto-select-folder
+ (setq auto-select-folder
+ (expand-file-name auto-select-folder folder-dir)))
+ (setq last-save-folder vm-last-save-folder)
+ (if (string-equal current-folder auto-select-folder)
+ (setq auto-select-folder nil))
+ (setq default-folder (or auto-select-folder last-save-folder))
+ (setq default-dir (if default-folder
+ (file-name-directory default-folder)
+ (or folder-dir default-directory))))
+ (setq folder
+ (read-file-name
+ (format "Save in folder: %s"
+ (if default-folder
+ (concat "\(default "
+ (file-name-nondirectory default-folder)
+ "\) ")
+ ""))
+ default-dir default-folder nil))
+ (or folder (error "impossible: read-file-name returned nil!"))
+ (cond ((or (not default-folder)
+ (not (string-equal default-folder folder)))
+ (save-excursion
+ (vm-select-folder-buffer)
+ (setq vm-last-save-folder (expand-file-name folder)))))
+ folder))
(defun vm-save-message-sans-headers (file &optional count)
"Save the current message to a file, without its header section.
----------------------------------------------------------------------
--- vm-reply.el-dist Sat Apr 20 17:35:03 1991
+++ vm-reply.el Sun Jul 7 00:27:42 1991
#
# A hook to allow one to do your own subject line processing. I use mine
# to strip out "Re^2" and "(was: ...)" stuff and also to generate my own
# "New Subject (was: Old Subject)" stuff.
#
@@ -17,6 +17,11 @@
(require 'vm)
+(defvar vm-reply-subject-hook nil
+ "If non-nil, a function which munges subjects for replying.
+Called with one argument, the former subject. What it returns will be the
+new subject.")
+
(defun vm-do-reply (to-all include-text count)
(save-restriction
(widen)
@@ -37,6 +42,8 @@
in-reply-to (and vm-in-reply-to-format
(vm-sprintf 'vm-in-reply-to-format (car mp)))
in-reply-to (and (not (equal "" in-reply-to)) in-reply-to))
+ (if vm-reply-subject-hook ;jbw: added
+ (setq subject (funcall vm-reply-subject-hook subject))
(and subject vm-reply-subject-prefix
(let ((case-fold-search t))
(not
@@ -44,7 +51,7 @@
(string-match (regexp-quote vm-reply-subject-prefix)
subject)
0)))
- (setq subject (concat vm-reply-subject-prefix subject))))
+ (setq subject (concat vm-reply-subject-prefix subject)))))
(t (cond ((setq tmp (vm-get-header-contents (car mp) "Reply-To"))
(setq to (concat to "," tmp)))
((setq tmp (vm-get-header-contents (car mp) "From"))
----------------------------------------------------------------------
Technical Details
Message-ID:
<9107070655.AA18859@maverick.uswest.com>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!wendy-fate.uu.net!bug-vmShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f6829,b37c37061699462a,start X-Google-Attributes: gidf6829,public X-Google-ArrivalTime: 1991-07-07 03:29:31 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!wendy-fate.uu.net!bug-vm From: jbw@maverick.uswest.com (Joe Wells) Newsgroups: gnu.emacs.vm.bug Subject: miscellaneous suggested changes to VM 5.31 Message-ID: <9107070655.AA18859@maverick.uswest.com> Date: 7 Jul 91 06:55:47 GMT Sender: bug-vm-request@uunet.uu.net Lines: 193