GNU bug report logs -
#54154
29.0.50; [PATCH] `sieve-manage-getscript' fails if script contains multibyte characters
Previous Next
Reported by: "Kai Tetzlaff" <kai.tetzlaff <at> t-online.de>
Date: Fri, 25 Feb 2022 09:20:01 UTC
Severity: normal
Tags: patch
Found in version 29.0.50
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #53 received at 54154 <at> debbugs.gnu.org (full text, mbox):
On Wed, Jan 18, 2023 at 09:17:59PM +0200, Eli Zaretskii wrote:
> > Cc: larsi <larsi <at> gnus.org>, 54154 <at> debbugs.gnu.org
> > Date: Wed, 18 Jan 2023 19:28:40 +0100
> > From: "Herbert J. Skuhra" <herbert <at> gojira.at>
> >
> > On Wed, Jan 18, 2023 at 10:09:33AM +0100, Kai Tetzlaff wrote:
> > > Hello Herbert,
> > >
> > > it seems that I'm responsible for this issue. Unfortunately, I cannot
> > > reproduce it with my imap/sieve server setup. However, if you're willing
> > > to provide some additional info, we should hopefully be able to find the
> > > bug.
> >
> > Hello,
> >
> > this is strange because I can reproduce it easily on different systems:
> >
> > - master on FreeBSD 13.1-STABLE
> > - emacs-29 and master on macOS 12.6.2
> > - master on WLS2/Windows11 (Ubuntu)
>
> Is this problem still relevant? I thought that Lars closed the bug
> report back in September?
>
> > > Could you re-run the steps above with the following additional steps
> > > before 3.:
> > >
> > > 2a) M-x find-library sieve-manage
> > > 2b) M-x eval-buffer
> > > 2c) M-x find-library sieve
> > > 2d) M-x eval-buffer
> > > 2e) M-x toggle-debug-on-error
> > >
> > > to get a full backtrace and send it to me?
> >
> > Backtrace attached.
>
> Thanks. The error is here:
>
> (defun sieve-manage--append-to-log (&rest args)
> "Append ARGS to sieve-manage log buffer.
>
> ARGS can be a string or a list of strings.
> The buffer to use for logging is specifified via
> `sieve-manage-log'. If it is nil, logging is disabled."
> (when sieve-manage-log
> (with-current-buffer (or (get-buffer sieve-manage-log)
> (with-current-buffer <<<<<<<<<<<<<<<<<<<<<<
> (get-buffer-create sieve-manage-log)
> (set-buffer-multibyte nil)
> (buffer-disable-undo)))
>
> And I admit that I don't understand this code. What is it trying to
> do? Shouldn't it be just
>
> (when sieve-manage-log
> (with-current-buffer (get-buffer-create sieve-manage-log)
> (set-buffer-multibyte nil)
> (buffer-disable-undo)))
>
> Kai, am I missing something?
>
> Herbert, if you make the change above, does the problem go away?
Yes, this change resolves the issue:
diff --git a/lisp/net/sieve-manage.el b/lisp/net/sieve-manage.el
index 5bee4f4c4a..636c7cbc5b 100644
--- a/lisp/net/sieve-manage.el
+++ b/lisp/net/sieve-manage.el
@@ -174,11 +174,9 @@ sieve-manage--append-to-log
The buffer to use for logging is specifified via
`sieve-manage-log'. If it is nil, logging is disabled."
(when sieve-manage-log
- (with-current-buffer (or (get-buffer sieve-manage-log)
- (with-current-buffer
- (get-buffer-create sieve-manage-log)
+ (with-current-buffer (get-buffer-create sieve-manage-log)
(set-buffer-multibyte nil)
- (buffer-disable-undo)))
+ (buffer-disable-undo)
(goto-char (point-max))
(apply #'insert args))))
Thanks.
--
Herbert
This bug report was last modified 297 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.