Subject: bug#54154: Emacs commit ae963e80a79f5a9184daabfc8197f211a39b136d (sieve-manage)

From: "Herbert J. Skuhra" <[email-masked]>
Date: Sun, 29 Sep 2024 14:15:47 +0200

On Sun, 29 Sep 2024 12:23:03 +0200,
Eli Zaretskii <[email-masked]> wrote:
> 
> > Cc: [email-masked], [email-masked], [email-masked]
> > Date: Sun, 29 Sep 2024 12:29:39 +0300
> > From: Eli Zaretskii <[email-masked]>
> > 
> > > - Run emacs -Q
> > > - M-x sieve-manage
> > > - Input IMAP server (e.g. imap.mailbox.org)
> > > 
> > > Debugger entered--Lisp error: (wrong-type-argument stringp t)
> > >   sieve-manage--append-to-log("sieve-manage: Connecting to imap.mailbox.org..." "\n")
> > >   sieve-manage--message("Connecting to %s..." "imap.mailbox.org")
> > >   sieve-manage-open("imap.mailbox.org" nil)
> > >   sieve-open-server("imap.mailbox.org" nil)
> > >   sieve-manage("imap.mailbox.org")
> > >   funcall-interactively(sieve-manage "imap.mailbox.org")
> > >   command-execute(sieve-manage record)
> > >   execute-extended-command(nil "sieve-manage" "sieve-ma")
> > >   funcall-interactively(execute-extended-command nil "sieve-manage" "sieve-ma")
> > >   command-execute(execute-extended-command)
> > > 
> > > On 2nd try it works!
> > 
> > The fix was not merged to the-then master branch, so it is not in
> > Emacs 30.  Therefore, it is not a surprise you still see the problem:
> > it was only fixed in Emacs 29.
> > 
> > I lost the context long ago, so I hope Kai will suggest how to handle
> > this.
> 
> However, it's quite possible that the following band-aid should fix
> this particular issue:
> 
> diff --git a/lisp/net/sieve-manage.el b/lisp/net/sieve-manage.el
> index 0faeb02..da2167c 100644
> --- a/lisp/net/sieve-manage.el
> +++ b/lisp/net/sieve-manage.el
> @@ -178,7 +178,8 @@ sieve-manage--append-to-log
>                               (with-current-buffer
>                                   (get-buffer-create sieve-manage-log)
>                                 (set-buffer-multibyte nil)
> -                               (buffer-disable-undo)))
> +                               (buffer-disable-undo)
> +                               (current-buffer)))
>        (goto-char (point-max))
>        (apply #'insert args))))

Yes, this works. Thanks.

As manage-sieve logs credentials maybe logging should be disabled by
default and/or credentials shouldn't be logged when logging is
enabled?