diff options
author | Richard Stallman <rms@gnu.org> | 2016-09-02 21:55:09 -0400 |
---|---|---|
committer | Noam Postavsky <npostavs@gmail.com> | 2016-12-01 19:56:14 -0500 |
commit | 95eb641404adca84e71959a98369a30f1cadb7b6 (patch) | |
tree | 1b269bb2eeb30c7b117d8a881fd42e83b7badb69 | |
parent | d31298d8afa8166346fbc9206f38ec4b09a12204 (diff) | |
download | emacs-95eb641404adca84e71959a98369a30f1cadb7b6.tar.gz |
Fix mail-combine-fields
* lisp/mail/sendmail.el (mail-combine-fields): Call `save-excursion' to
avoid losing our place in the search loop.
(cherry picked from commit 5fbba6cceaf843cfca449eb000a0a65243b61808)
-rw-r--r-- | lisp/mail/sendmail.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index 58f708a0c1e..3d222090ca6 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el @@ -1110,10 +1110,11 @@ to combine them into one, and does so if the user says y." (save-restriction ;; This is just so the screen doesn't change. (narrow-to-region (point-min) old-max) - (goto-char old-point) - (setq query-asked t) - (if (y-or-n-p (format "Message contains multiple %s fields. Combine? " field)) - (setq query-answer t)))) + (save-excursion + (goto-char old-point) + (setq query-asked t) + (if (y-or-n-p (format "Message contains multiple %s fields. Combine? " field)) + (setq query-answer t))))) (when query-answer (let ((this-to-start (line-beginning-position)) this-to-end |