diff options
| author | Richard Stallman | 2016-09-02 21:55:09 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2016-09-03 11:46:50 -0400 |
| commit | 5fbba6cceaf843cfca449eb000a0a65243b61808 (patch) | |
| tree | 7dbb8df108ee10a2a1d075e112ed46c1c01e1d3e | |
| parent | 5a4bffb6617a274ca19bc7f5c1b1ceb6345651ab (diff) | |
| download | emacs-5fbba6cceaf843cfca449eb000a0a65243b61808.tar.gz emacs-5fbba6cceaf843cfca449eb000a0a65243b61808.zip | |
Fix mail-combine-fields
* lisp/mail/sendmail.el (mail-combine-fields): Call `save-excursion' to
avoid losing our place in the search loop.
| -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." | |||
| 1110 | (save-restriction | 1110 | (save-restriction |
| 1111 | ;; This is just so the screen doesn't change. | 1111 | ;; This is just so the screen doesn't change. |
| 1112 | (narrow-to-region (point-min) old-max) | 1112 | (narrow-to-region (point-min) old-max) |
| 1113 | (goto-char old-point) | 1113 | (save-excursion |
| 1114 | (setq query-asked t) | 1114 | (goto-char old-point) |
| 1115 | (if (y-or-n-p (format "Message contains multiple %s fields. Combine? " field)) | 1115 | (setq query-asked t) |
| 1116 | (setq query-answer t)))) | 1116 | (if (y-or-n-p (format "Message contains multiple %s fields. Combine? " field)) |
| 1117 | (setq query-answer t))))) | ||
| 1117 | (when query-answer | 1118 | (when query-answer |
| 1118 | (let ((this-to-start (line-beginning-position)) | 1119 | (let ((this-to-start (line-beginning-position)) |
| 1119 | this-to-end | 1120 | this-to-end |