GNU bug report logs - #64296
30.0.50; problem with gnus-summary-resend-message

Previous Next

Package: emacs;

Reported by: Peter Münster <pm <at> a16n.net>

Date: Mon, 26 Jun 2023 08:25:02 UTC

Severity: normal

Found in version 30.0.50

Full log


Message #20 received at 64296 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Cohen <acohen <at> ust.hk>
To: Peter Münster <pm <at> a16n.net>
Cc: 64296 <at> debbugs.gnu.org
Subject: Re: bug#64296: 30.0.50; problem with gnus-summary-resend-message
Date: Tue, 27 Jun 2023 21:06:46 +0800
>>>>> "AC" == Andrew Cohen <acohen <at> ust.hk> writes:

>>>>> "PM" == Peter Münster <pm <at> a16n.net> writes:
    PM> On Tue, Jun 27 2023, Peter Münster wrote:
    >>> Yes, it works. Thanks!

    PM> Sorry, no, there is a new problem. When displaying a message
    PM> with such a header:

    PM> In-Reply-To: <87o7p2b7w5.fsf <at> a16n.net> ("Peter Münster"'s
    PM> message of "Thu, 09 Mar 2023 10:18:02 +0100")

    PM> I get this error: "cond: End of buffer"

    PM> And the message is displayed in it's raw format...

[...]

    AC> In the meantime I'll see if I can reproduce the problem to
    AC> figure out what is happening (if you can provide a backtrace
    AC> that might also help).

The problem is the presence of the ":" in the parenthetical comment
following the mailbox. If I am reading the spec correctly this is not
allowed (the ":" and ";" are special characters). But it is relatively
common nonetheless.

I think the following version should take care of it. Try it for awhile
and see if any other problems arise.  If not I'll push it to master.

#+begin_src emacs-lisp
(defun ietf-drums-parse-addresses (string &optional rawp)
  "Parse STRING and return a list of MAILBOX / DISPLAY-NAME pairs.
If RAWP, don't actually parse the addresses, but instead return
a list of address strings."
  (if (null string)
      nil
    (with-temp-buffer
      (ietf-drums-init string)
      (let ((beg (point))
	    pairs c address)
	(while (not (eobp))
	  (setq c (char-after))
	  (cond
           ((eq c '?:)
            (setq beg (1+ (point)))
            (skip-chars-forward "^;")
            (when-let ((address
                  (condition-case nil
                      (ietf-drums-parse-addresses
                       (buffer-substring beg (point)) rawp)
                    (error nil))))
              (if (listp address)
                  (setq pairs (append address pairs))
                (push address pairs)))
            (condition-case nil
	        (forward-char 1)
              (error nil))
	    (setq beg (point)))
	   ((memq c '(?\" ?< ?\())
	    (condition-case nil
		(forward-sexp 1)
	      (error
	       (skip-chars-forward "^,"))))
	   ((eq c ?,)
	    (setq address
		  (if rawp
		      (buffer-substring beg (point))
		    (condition-case nil
			(ietf-drums-parse-address
			 (buffer-substring beg (point)))
		      (error nil))))
	    (when (or (consp address)
                      (and (stringp address) (< 0 (length address))))
              (push address pairs))
	    (forward-char 1)
	    (setq beg (point)))
	   ((not (eobp))
	    (forward-char 1))))
	(setq address
	      (if rawp
		  (buffer-substring beg (point))
		(condition-case nil
		    (ietf-drums-parse-address
		     (buffer-substring beg (point)))
		  (error nil))))
        (when (or (consp address)
                  (and (stringp address) (< 0 (length address))))
          (push address pairs))
	(nreverse pairs)))))
#+end_src



-- 
Andrew Cohen




This bug report was last modified 1 year and 354 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.