]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix mail-combine-fields
authorRichard Stallman <rms@gnu.org>
Sat, 3 Sep 2016 01:55:09 +0000 (21:55 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Sat, 3 Sep 2016 15:46:50 +0000 (11:46 -0400)
* lisp/mail/sendmail.el (mail-combine-fields): Call `save-excursion' to
avoid losing our place in the search loop.

lisp/mail/sendmail.el

index 58f708a0c1e0aef14e6563706373d0f54a93066d..3d222090ca621342bb702d5a8d9da49a70111463 100644 (file)
@@ -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