unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* sendmail.el
@ 2016-08-24  3:05 Richard Stallman
  2016-08-24  8:26 ` sendmail.el Nicolas Petton
  2016-08-25  1:05 ` sendmail.el Noam Postavsky
  0 siblings, 2 replies; 11+ messages in thread
From: Richard Stallman @ 2016-08-24  3:05 UTC (permalink / raw)
  To: emacs-devel

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

This fixes a bug I ran across today.  My sources are from July,
but the bug may be present in the Emacs 25.1 code.  Please check.

diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 58f708a..3d22209 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -1110,10 +1110,11 @@ mail-combine-fields
               (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


-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.




^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: sendmail.el
  2016-08-24  3:05 sendmail.el Richard Stallman
@ 2016-08-24  8:26 ` Nicolas Petton
  2016-08-24 19:46   ` sendmail.el Richard Stallman
  2016-08-25  1:05 ` sendmail.el Noam Postavsky
  1 sibling, 1 reply; 11+ messages in thread
From: Nicolas Petton @ 2016-08-24  8:26 UTC (permalink / raw)
  To: rms, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 239 bytes --]

Richard Stallman <rms@gnu.org> writes:

Hi Richard,

> This fixes a bug I ran across today.  My sources are from July,
> but the bug may be present in the Emacs 25.1 code.  Please check.

Could you describe the bug it fixes?

Thanks,
Nico

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 512 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: sendmail.el
  2016-08-24  8:26 ` sendmail.el Nicolas Petton
@ 2016-08-24 19:46   ` Richard Stallman
  0 siblings, 0 replies; 11+ messages in thread
From: Richard Stallman @ 2016-08-24 19:46 UTC (permalink / raw)
  To: Nicolas Petton; +Cc: emacs-devel

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > Could you describe the bug it fixes?

When it happened to me, it combined the From field with the To field.
It is supposed to combine only multiple To fields, multiple CC fields, etc.

-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: sendmail.el
  2016-08-24  3:05 sendmail.el Richard Stallman
  2016-08-24  8:26 ` sendmail.el Nicolas Petton
@ 2016-08-25  1:05 ` Noam Postavsky
  2016-08-25 22:20   ` sendmail.el Richard Stallman
  2016-08-27 21:46   ` sendmail.el Richard Stallman
  1 sibling, 2 replies; 11+ messages in thread
From: Noam Postavsky @ 2016-08-25  1:05 UTC (permalink / raw)
  To: rms; +Cc: Emacs developers

> This fixes a bug I ran across today.  My sources are from July,
> but the bug may be present in the Emacs 25.1 code.  Please check.
>
> diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
> index 58f708a..3d22209 100644
> --- a/lisp/mail/sendmail.el
> +++ b/lisp/mail/sendmail.el
> @@ -1110,10 +1110,11 @@ mail-combine-fields
>                (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)))))

The wrapping of y-or-n-p with a save-excursion sounds similar to #2209
"copyright-update might not update copyright", I was thinking it might
be a case of a window point being different from the buffer point that
causes the unexpected move.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: sendmail.el
  2016-08-25  1:05 ` sendmail.el Noam Postavsky
@ 2016-08-25 22:20   ` Richard Stallman
  2016-08-27  3:04     ` sendmail.el Noam Postavsky
  2016-08-27 21:46   ` sendmail.el Richard Stallman
  1 sibling, 1 reply; 11+ messages in thread
From: Richard Stallman @ 2016-08-25 22:20 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: emacs-devel

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

I think the problem is simply that old-point is the wrong place for
point to remain at.  It needs to go back where it was in the search
loop, but old-point is where it was on entry to the function.

-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: sendmail.el
  2016-08-25 22:20   ` sendmail.el Richard Stallman
@ 2016-08-27  3:04     ` Noam Postavsky
  2016-08-27  7:42       ` sendmail.el Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Noam Postavsky @ 2016-08-27  3:04 UTC (permalink / raw)
  To: rms; +Cc: Emacs developers

On Thu, Aug 25, 2016 at 6:20 PM, Richard Stallman <rms@gnu.org> wrote:
> I think the problem is simply that old-point is the wrong place for
> point to remain at.  It needs to go back where it was in the search
> loop, but old-point is where it was on entry to the function.

Yes, after looking more at the surrounding code, I concur.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: sendmail.el
  2016-08-27  3:04     ` sendmail.el Noam Postavsky
@ 2016-08-27  7:42       ` Eli Zaretskii
  0 siblings, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2016-08-27  7:42 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: rms, emacs-devel

> From: Noam Postavsky <npostavs@users.sourceforge.net>
> Date: Fri, 26 Aug 2016 23:04:55 -0400
> Cc: Emacs developers <emacs-devel@gnu.org>
> 
> On Thu, Aug 25, 2016 at 6:20 PM, Richard Stallman <rms@gnu.org> wrote:
> > I think the problem is simply that old-point is the wrong place for
> > point to remain at.  It needs to go back where it was in the search
> > loop, but old-point is where it was on entry to the function.
> 
> Yes, after looking more at the surrounding code, I concur.

Please push, and thanks.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: sendmail.el
  2016-08-25  1:05 ` sendmail.el Noam Postavsky
  2016-08-25 22:20   ` sendmail.el Richard Stallman
@ 2016-08-27 21:46   ` Richard Stallman
  2016-08-27 22:05     ` sendmail.el Noam Postavsky
  1 sibling, 1 reply; 11+ messages in thread
From: Richard Stallman @ 2016-08-27 21:46 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: emacs-devel

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

This patch may be needed in Emacs 25.  Would someone please check?

-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: sendmail.el
  2016-08-27 21:46   ` sendmail.el Richard Stallman
@ 2016-08-27 22:05     ` Noam Postavsky
  2016-08-28  2:01       ` sendmail.el John Wiegley
  0 siblings, 1 reply; 11+ messages in thread
From: Noam Postavsky @ 2016-08-27 22:05 UTC (permalink / raw)
  To: rms; +Cc: Emacs developers

On Sat, Aug 27, 2016 at 5:46 PM, Richard Stallman <rms@gnu.org> wrote:
> This patch may be needed in Emacs 25.  Would someone please check?

The function `mail-combine-fields' hasn't changed since you introduced
it in 79a16968 Wed Aug 12 11:25:26 2015 "Offer to combine multiple To
or CC fields[...]". So the bug is present on both emacs-25 and master
branches. But I guess it's too late to fix for 25.1 by now.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: sendmail.el
  2016-08-27 22:05     ` sendmail.el Noam Postavsky
@ 2016-08-28  2:01       ` John Wiegley
  2016-09-03 15:48         ` sendmail.el Noam Postavsky
  0 siblings, 1 reply; 11+ messages in thread
From: John Wiegley @ 2016-08-28  2:01 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: rms, Emacs developers

>>>>> "NP" == Noam Postavsky <npostavs@users.sourceforge.net> writes:

NP> The function `mail-combine-fields' hasn't changed since you introduced it
NP> in 79a16968 Wed Aug 12 11:25:26 2015 "Offer to combine multiple To or CC
NP> fields[...]". So the bug is present on both emacs-25 and master branches.
NP> But I guess it's too late to fix for 25.1 by now.

Yes, it is too late, harmless thought it may be. Accepting it in 25.1 would
mean another release candidate, and another round of waiting, which I'd like
to avoid except for truly damaging bugs.

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: sendmail.el
  2016-08-28  2:01       ` sendmail.el John Wiegley
@ 2016-09-03 15:48         ` Noam Postavsky
  0 siblings, 0 replies; 11+ messages in thread
From: Noam Postavsky @ 2016-09-03 15:48 UTC (permalink / raw)
  To: Noam Postavsky, rms, Emacs developers

On Sat, Aug 27, 2016 at 10:01 PM, John Wiegley <jwiegley@gmail.com> wrote:
>>>>>> "NP" == Noam Postavsky <npostavs@users.sourceforge.net> writes:
>
> NP> The function `mail-combine-fields' hasn't changed since you introduced it
> NP> in 79a16968 Wed Aug 12 11:25:26 2015 "Offer to combine multiple To or CC
> NP> fields[...]". So the bug is present on both emacs-25 and master branches.
> NP> But I guess it's too late to fix for 25.1 by now.
>
> Yes, it is too late, harmless thought it may be. Accepting it in 25.1 would
> mean another release candidate, and another round of waiting, which I'd like
> to avoid except for truly damaging bugs.
>

I've pushed to master as 5fbba6cc "Fix mail-combine-fields".



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-09-03 15:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-24  3:05 sendmail.el Richard Stallman
2016-08-24  8:26 ` sendmail.el Nicolas Petton
2016-08-24 19:46   ` sendmail.el Richard Stallman
2016-08-25  1:05 ` sendmail.el Noam Postavsky
2016-08-25 22:20   ` sendmail.el Richard Stallman
2016-08-27  3:04     ` sendmail.el Noam Postavsky
2016-08-27  7:42       ` sendmail.el Eli Zaretskii
2016-08-27 21:46   ` sendmail.el Richard Stallman
2016-08-27 22:05     ` sendmail.el Noam Postavsky
2016-08-28  2:01       ` sendmail.el John Wiegley
2016-09-03 15:48         ` sendmail.el Noam Postavsky

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).