branch: elpa/vm commit 8ec23d2ccc79a920a75ce912d6f9805373e2df9a Merge: 7566b1ea46 06c7290094 Author: Mark Diekhans <ma...@ucsc.edu> Commit: Mark Diekhans <ma...@ucsc.edu>
Merge branch 'backout-suprious-optional' into 'main' backed out commit 310d8ff, which causes Internal display failed on multi-part mime See merge request diekhans/vm!1 --- info/vm.texinfo | 19 +++------ lisp/vm-imap.el | 129 +++++++++++++++++++++----------------------------------- lisp/vm-mime.el | 11 ++--- lisp/vm.el | 9 ++-- 4 files changed, 63 insertions(+), 105 deletions(-) diff --git a/info/vm.texinfo b/info/vm.texinfo index bb03409d13..af3288f473 100644 --- a/info/vm.texinfo +++ b/info/vm.texinfo @@ -2299,9 +2299,9 @@ which are described in this section. The Emacs-w3m browser has its own key bindings for use within HTML text. These are disabled by default so that VM's key bindings will continue to have effect. To switch to the Emacs-w3m key bindings, set the variable -@code{vm-use-presentation-minor-modes} to @code{t}. This asks VM to use the -minor modes specified in @code{vm-presentation-minor-modes}. By default the -presentation-minor-mode for emacs-w3m is set to @code{w3m-minor-mode}. +@code{vm-use-presentation-minor-modes} to @code{t}. The minor mode to be +used for the Emacs-w3m generated text can be set using the variable +@code{vm-presentation-minor-modes}. @vindex vm-w3m-display-inline-images @cindex multipart/related @@ -2325,7 +2325,7 @@ customize the variable @code{vm-w3m-safe-url-regexp}. You can set it to expression that identifies which @acronym{URL}'s should be regarded as safe. The Emacs-w3m browser has numerous -option settings that you may customize. Some important +option settings that may customize. Some important settings for use with VM are the following: @table @code @@ -2951,7 +2951,6 @@ parent of this composition. @item C-c C-v <Any VM command key> All VM commands may be accessed in a VM Mail mode buffer by prefixing them with C-c C-v. - @kindex C-c C-a @vindex vm-send-using-mime @cindex drag and drop @@ -2988,7 +2987,6 @@ message to be attached. If you invoke the command on marked messages by running @code{vm-next-command-uses-marks} first, the marked messages in the selected folder will be attached as a @acronym{MIME} digest. - @kindex C-c C-b @item C-c C-b (@code{vm-attach-buffer}) Attaches an Emacs buffer to the composition. @@ -3017,12 +3015,10 @@ composing your message. @kindex m @findex vm-mail-from-folder -@cindex parent folder @anchor{vm-mail-from-folder} The simplest command is @kbd{m} (@code{vm-mail-from-folder}) which sends a mail message much as @kbd{M-x mail} does but allows the added commands -described above. The mail folder from which the command is invoked is -designated as the @emph{parent folder} of the mail composition. +described above. @findex vm-mail @anchor{vm-mail} @@ -3416,9 +3412,8 @@ Replies to the all recipients of the current message. @item F (@code{vm-followup-include-text}) Replies to the all recipients of the current message and provides included text. -@kindex m -@findex vm-mail-from-folder -@item m (@code{vm-mail-from-folder}) +@findex vm-mail-to-sender +@item vm-mail-to-sender Writes a message to the sender of the current message. (This is similar to @code{vm-reply} but meant for writing a message about a new subject.) @end table diff --git a/lisp/vm-imap.el b/lisp/vm-imap.el index d5c6f207be..1dc300e9e0 100644 --- a/lisp/vm-imap.el +++ b/lisp/vm-imap.el @@ -1106,8 +1106,6 @@ of the current folder, or nil if none has been recorded." ;; -- lower level I/O ;; vm-imap-send-command: (process command &optional tag no-tag) -> ;; void -;; vm-imap-send-string: (process string &optional tag no-tag) -> -;; void ;; vm-imap-select-mailbox: (process & mailbox &optional bool bool) -> ;; (int int uid-validity bool bool (flag list)) ;; vm-imap-read-capability-response: process -> ? @@ -1489,58 +1487,52 @@ 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) - ;;---------------------------- - (vm-buffer-type:enter 'process) - ;;---------------------------- - ;; vm-imap-end-session might have already been called on - ;; this process, so don't logout and schedule the killing - ;; the process again if it's already been done. - (unwind-protect - (condition-case nil - (if vm-imap-session-done - ;;------------------------------------- - ;; Don't bother checking because it might fail if - ;; the user typed C-g. - ;; (vm-imap-session-type:assert 'inactive) - ;;------------------------------------- - nil - (vm-inform 6 "%s: Closing IMAP session to %s..." - (if vm-mail-buffer - (buffer-name vm-mail-buffer) - "vm") - "server") - (vm-imap-send-command process "LOGOUT") - ;; we don't care about the response. - ;; avoid waiting for it because some servers misbehave. - ;; (vm-imap-read-ok-response process) - ) - (vm-imap-protocol-error ; handler - nil) ; ignore errors - (error nil)) ; handler - ;; unwind-protections - (setq vm-imap-session-done t) - ;;---------------------------------- - (vm-imap-session-type:set 'inactive) - ;;---------------------------------- - ;; This is just for tracing purposes - (goto-char (point-max)) - (insert "\r\n\r\n\r\n" - "ending IMAP session " (current-time-string) "\r\n") - ;; Schedule killing of the process after a delay to allow - ;; any output to be received first - (if (fboundp 'add-async-timeout) - (add-async-timeout 2 'delete-process process) - (run-at-time 2 nil 'delete-process process)))) + (save-excursion ; = save-current-buffer? + (set-buffer imap-buffer) + ;;---------------------------- + (vm-buffer-type:enter 'process) + ;;---------------------------- + ;; vm-imap-end-session might have already been called on + ;; this process, so don't logout and schedule the killing + ;; the process again if it's already been done. + (unwind-protect + (condition-case nil + (if vm-imap-session-done + ;;------------------------------------- + ;; Don't bother checking because it might fail if + ;; the user typed C-g. + ;; (vm-imap-session-type:assert 'inactive) + ;;------------------------------------- + nil + (vm-inform 6 "%s: Closing IMAP session to %s..." + (if vm-mail-buffer + (buffer-name vm-mail-buffer) + "vm") + "server") + (vm-imap-send-command process "LOGOUT") + ;; we don't care about the response. + ;; avoid waiting for it because some servers misbehave. + ;; (vm-imap-read-ok-response process) + ) + (vm-imap-protocol-error ; handler + nil) ; ignore errors + (error nil)) ; handler + ;; unwind-protections + (setq vm-imap-session-done t) + ;;---------------------------------- + (vm-imap-session-type:set 'inactive) + ;;---------------------------------- + ;; This is just for tracing purposes + (goto-char (point-max)) + (insert "\r\n\r\n\r\n" + "ending IMAP session " (current-time-string) "\r\n") + ;; Schedule killing of the process after a delay to allow + ;; any output to be received first + (if (fboundp 'add-async-timeout) + (add-async-timeout 2 'delete-process process) + (run-at-time 2 nil 'delete-process process)))) ;; unwind-protections ;;---------------------------------- - (vm-inform 6 "%s: Closing IMAP session to %s... done" - (if vm-mail-buffer - (buffer-name vm-mail-buffer) - "vm") - "server") - (vm-buffer-type:exit) ;;---------------------------------- )) @@ -1597,29 +1589,6 @@ as well." (process-send-string process (format "%s\r\n" command)) (process-send-string process (format "%s %s\r\n" (or tag "VM") command)))) -(defun vm-imap-send-string (process string) - (vm-imap-log-token 'send) - ;;------------------------------ - (vm-buffer-type:assert 'process) - ;;------------------------------ - (vm-imap-check-connection process) - (if (not (= (point) (point-max))) - (vm-imap-log-tokens (list 'send1 (point) (point-max)))) - (goto-char (point-max)) - ;; try if it makes a difference to get pending output here, use timeout - ;; (accept-process-output process 0 0.01) - ;; (if (not (= (point) (point-max))) - ;; (vm-imap-log-tokens (list 'send2 (point) (point-max)))) - ;; (goto-char (point-max)) - (setq vm-imap-read-point (point)) - ;; send the string line by line - (let ((lines (split-string string "\r\n"))) - (mapcar (function - (lambda (line) - (process-send-string process (format "%s\r\n" line)))) - lines)) - ) - (defun vm-imap-select-mailbox (process mailbox &optional just-retrieve just-examine) "I/O function to select an IMAP mailbox @@ -4725,7 +4694,7 @@ May throw exceptions." (mailboxes nil) (fcc-string (vm-mail-get-header-contents "FCC:" ",")) fcc-list fcc maildrop spec-list - process flags response composition m + process flags response string m (vm-imap-ok-to-ask t)) (if (null mailbox) (setq mailboxes nil) @@ -4769,10 +4738,10 @@ May throw exceptions." (goto-char (point-min)) (re-search-forward (concat "^" (regexp-quote mail-header-separator) "$")) - (setq composition (concat (buffer-substring (point-min) (match-beginning 0)) + (setq string (concat (buffer-substring (point-min) (match-beginning 0)) (buffer-substring (match-end 0) (point-max)))) - (setq composition (vm-imap-subst-CRLF-for-LF composition)) + (setq string (vm-imap-subst-CRLF-for-LF string)) (while mailboxes (setq mailbox (car (car mailboxes))) @@ -4800,7 +4769,7 @@ May throw exceptions." (format "APPEND %s %s {%d}" (vm-imap-quote-mailbox-name mailbox) (if flags flags "()") - (length composition))) + (length string))) ;; could these be done with vm-imap-read-boolean-response? (let ((need-plus t) response) (while need-plus @@ -4819,7 +4788,7 @@ May throw exceptions." ((vm-imap-response-matches response '+) (setq need-plus nil))))) - (vm-imap-send-string process composition) + (vm-imap-send-command process string nil t) (let ((need-ok t) response) (while need-ok diff --git a/lisp/vm-mime.el b/lisp/vm-mime.el index 449f00f838..c488a97187 100644 --- a/lisp/vm-mime.el +++ b/lisp/vm-mime.el @@ -615,7 +615,7 @@ out includes base-64, quoted-printable, uuencode and CRLF conversion." (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. - Kyle Jones + ;; MIME spec, so avoid using it. ;; Let us try it out now. USR, 2012-10-19 ;; (not (not (featurep 'xemacs))) ) @@ -2765,12 +2765,9 @@ is not successful. USR, 2011-03-25" ;; if the handler returns t, overwrite the layout type (vm-mime-rewrite-with-inferred-type layout infered-type)) - ((or (and (vm-mime-internally-displayable layout) - (vm-mime-display-internal layout type primary-type)) - ;; if the handler returns t, we are done - ;; otherwise, unless the user chooses external, we quit - (not - (y-or-n-p "Internal display failed; use external viewer?"))) + ((and (vm-mime-internally-displayable layout) + (vm-mime-display-internal layout type primary-type)) + ;; if the handler returns t, we are done ) ((and vm-infer-mime-types infered-type diff --git a/lisp/vm.el b/lisp/vm.el index 2e045f73c8..1c3ee27405 100644 --- a/lisp/vm.el +++ b/lisp/vm.el @@ -158,15 +158,12 @@ deleted messages. Use `###' to expunge deleted messages." (cond ((bufferp folder) ; may be unnecessary. USR, 2010-01 (setq access-method vm-folder-access-method)) ((and (stringp folder) (vm-imap-folder-spec-p folder)) - (setq access-method 'imap) - (setq vm-last-visit-imap-folder folder)) + (setq access-method 'imap)) ((and (stringp folder) (vm-pop-folder-spec-p folder)) - (setq access-method 'pop) - (setq vm-last-visit-pop-folder folder)) + (setq access-method 'pop)) ((stringp folder) (setq folder - (expand-file-name folder vm-folder-directory)) - (setq vm-last-visit-folder folder)))) + (expand-file-name folder vm-folder-directory))))) ;; [2] Set up control variables that decide what needs to be done ;; (not yet fully understood. USR, 2012-02)