From: Stephen Berman via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 68893@debbugs.gnu.org
Subject: bug#68893: 30.0.50; pixel-fill-region errors when folding message headers in Gnus
Date: Fri, 02 Feb 2024 20:35:29 +0100 [thread overview]
Message-ID: <87y1c2zmke.fsf@gmx.net> (raw)
In-Reply-To: <86v87650dr.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 02 Feb 2024 17:52:48 +0200")
[-- Attachment #1: Type: text/plain, Size: 1648 bytes --]
On Fri, 02 Feb 2024 17:52:48 +0200 Eli Zaretskii <eliz@gnu.org> wrote:
> merge 68893 67791
> thanks
>
>> Date: Fri, 02 Feb 2024 16:33:00 +0100
>> From: Stephen Berman via "Bug reports for GNU Emacs,
>> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>>
>> When I type `t' (gnus-summary-toggle-header) on many (but not all)
>> articles in the Gnus Summary buffer, I get an error in pixel-fill-region
>> that the indentation is wider than the fill width. I can reproduce the
>> error as follows:
>>
>> 0. emacs -Q
>> 1. Enable debug-on-error.
>> 2. M-x gnus, type `y' at the prompt, then type `B RET news.gmane.io
>> RET', then `C-s emacs.bugs RET RET 1 RET' to enter the Gnus Summary
>> buffer showing the latest article in the gnu.emacs.bugs group. Then
>> type `j' and at the prompt paste the following Message-ID (of an
>> article that reliably induces the error) into the minibuffer:
>> <CALDnm52NYEfCacWrCxi1JywLZ6O5rRRkx9H9qAod5DcM9ayJ-w@mail.gmail.com>
>> 3. Type `t'. This raises an error and produces the following backtrace:
>
> This is another duplicate of bug#67791. Please see there for the
> analysis and the proposed solutions.
Ah, I actually had seen that report and also the recent other one that
you merged with it, but unfortunately I didn't remember them when I
encountered the issue myself today. Thanks for the pointer. And
indeed, not only does Katsumi Yamaoka's patch to
gnus-article-treat-fold-headers fix the problem for me too, but also
your suggestion to apply the fix to pixel-fill-region instead, as in the
following patch, works just as well:
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: pixel-fill-region patch --]
[-- Type: text/x-patch, Size: 589 bytes --]
diff --git a/lisp/textmodes/pixel-fill.el b/lisp/textmodes/pixel-fill.el
index 25c0b46cee9..dcd57acc2e5 100644
--- a/lisp/textmodes/pixel-fill.el
+++ b/lisp/textmodes/pixel-fill.el
@@ -73,7 +73,8 @@ pixel-fill-region
If START isn't at the start of a line, the horizontal position of
START, converted to pixel units, will be used as the indentation
prefix on subsequent lines."
- (save-excursion
+ (save-window-excursion
+ (set-window-buffer nil (current-buffer))
(goto-char start)
(let ((indentation
(car (window-text-pixel-size nil (line-beginning-position)
[-- Attachment #3: Type: text/plain, Size: 319 bytes --]
(I also tried your suggestion to use buffer-text-pixel-size in place of
window-text-pixel-size in pixel-fill-region, and while that prevented
the error, it resulted in irregular and very large indentation of the
continuations of overlong headers, and I didn't immediately see an easy
way to avoid that.)
Steve Berman
next prev parent reply other threads:[~2024-02-02 19:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-02 15:33 bug#68893: 30.0.50; pixel-fill-region errors when folding message headers in Gnus Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-02 15:52 ` Eli Zaretskii
2024-02-02 19:35 ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-02-02 19:38 ` Eli Zaretskii
2024-02-02 21:37 ` No Wayman
2024-02-03 9:11 ` Eli Zaretskii
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=87y1c2zmke.fsf@gmx.net \
--to=bug-gnu-emacs@gnu.org \
--cc=68893@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=stephen.berman@gmx.net \
/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.