all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: emacs-devel@gnu.org
Subject: Re: send new reply from gnus hangs
Date: Thu, 13 Jun 2019 19:39:11 -0700	[thread overview]
Message-ID: <87sgscgab4.fsf@ericabrahamsen.net> (raw)
In-Reply-To: vz1o935wtc6.fsf@gmail.com

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

Andy Moreton <andrewjmoreton@gmail.com> writes:

> On Mon 10 Jun 2019, Óscar Fuentes wrote:
>
>> Confirmed, reverting that commit fixes the problem.
>>
>>> Óscar Fuentes <ofv@wanadoo.es> writes:
>>>
>>> The problematic commit is
>>>
>>> master e51adfbdb7587c2b0b5ba154be210b30db82b4ea
>>> Author:     Oleh Krehel <ohwoeowho@gmail.com>
>>> AuthorDate: Thu Jun 6 16:01:10 2019 +0200
>>> Commit:     Oleh Krehel <ohwoeowho@gmail.com>
>>> CommitDate: Thu Jun 6 16:01:10 2019 +0200
>
> Thanks Óscar, that appears to be the problem.
>
> Looking at that commit, one call site calls `error' to abort sending the
> message, so the return value does not matter, but the other uses
> do-posting to set the return value from the `check-message' form, which
> is used by its caller.
>
>     AndyM

Okay, that worked!

What does everyone think of the attached diff? It moves the
`message-check' call out of the internal function (that seems like work
that should be done by the caller, not the internal function, and helps
the call fit in visually), and either returns nil or errors depending on
an optional arg.

E



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: message-continuation-fix.diff --]
[-- Type: text/x-patch, Size: 2167 bytes --]

diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 9ce35cece4..012aec0067 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -4477,16 +4477,24 @@ message-send-mail-partially
 
 (declare-function hashcash-wait-async "hashcash" (&optional buffer))
 
-(defun message--check-continuation-headers ()
-  (message-check 'continuation-headers
+(defun message--check-continuation-headers (&optional errorp)
+  "Check for continuation headers and possibly fix.
+Return t if no fixes are necessary.  Prompt the user about fixing
+continuation lines and/or sending without fixing.  If user opts
+not to send, raise an error if ERRORP is non-nil, otherwise
+return nil."
+  (catch 'check
     (goto-char (point-min))
     (while (re-search-forward "^[^ \t\n][^ \t\n:]*[ \t\n]" nil t)
       (goto-char (match-beginning 0))
       (if (y-or-n-p "Fix continuation lines? ")
           (insert " ")
-        (forward-line 1)
-        (unless (y-or-n-p "Send anyway? ")
-          (error "Failed to send the message"))))))
+	(forward-line 1)
+	(unless (y-or-n-p "Send anyway? ")
+	  (if errorp
+              (error "Failed to send the message")
+	    (throw 'check nil)))))
+    t))
 
 (defun message--send-mail-maybe-partially ()
   (if (or (not message-send-mail-partially-limit)
@@ -4571,7 +4579,8 @@ message-send-mail
 	     (if news nil message-deletable-headers)))
 	(message-generate-headers headers))
       ;; Check continuation headers.
-      (message--check-continuation-headers)
+      (message-check 'continuation-headers
+	(message--check-continuation-headers 'error))
       (message--fold-long-headers)
       ;; Let the user do all of the above.
       (run-hooks 'message-header-hook))
@@ -5166,7 +5175,8 @@ message-check-news-header-syntax
 	   (if (= (length errors) 1) "this" "these")
 	   (if (= (length errors) 1) "" "s")
 	   (mapconcat 'identity errors ", ")))))))
-   (message--check-continuation-headers)
+   (message-check 'continuation-headers
+     (message--check-continuation-headers))
    ;; Check the Newsgroups & Followup-To headers for syntax errors.
    (message-check 'valid-newsgroups
      (let ((case-fold-search t)

  parent reply	other threads:[~2019-06-14  2:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-07 21:20 send new reply from gnus hangs Andy Moreton
2019-06-07 22:34 ` Óscar Fuentes
2019-06-09 22:47   ` Óscar Fuentes
2019-06-09 23:00     ` Óscar Fuentes
2019-06-09 23:03       ` Óscar Fuentes
2019-06-09 23:11         ` Óscar Fuentes
2019-06-09 23:18           ` Óscar Fuentes
2019-06-09 23:19           ` Óscar Fuentes
2019-06-09 23:25             ` Óscar Fuentes
2019-06-09 23:33               ` Óscar Fuentes
2019-06-10  7:56                 ` Robert Pluim
2019-06-10 11:52                 ` Andy Moreton
2019-06-14  2:38                   ` Eric Abrahamsen
2019-06-14  2:39                   ` Eric Abrahamsen [this message]
2019-06-14 13:42                     ` Óscar Fuentes
2019-06-14 14:58                       ` Eric Abrahamsen
2019-06-09 23:04       ` Óscar Fuentes
2019-06-09 23:06       ` Óscar Fuentes
2019-06-09 23:16         ` Óscar Fuentes
2019-06-09 23:02     ` Óscar Fuentes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sgscgab4.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.