GNU bug report logs - #53398
29.0.50; narrow-to-region induces buffer recentering

Previous Next

Package: emacs;

Reported by: Jose A Ortega Ruiz <jao <at> gnu.org>

Date: Thu, 20 Jan 2022 21:00:02 UTC

Severity: normal

Tags: moreinfo, wontfix

Found in version 29.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jose A Ortega Ruiz <jao <at> gnu.org>
Cc: larsi <at> gnus.org, 53398 <at> debbugs.gnu.org
Subject: Re: bug#53398: 29.0.50; narrow-to-region induces buffer recentering
Date: Sun, 23 Jan 2022 08:08:10 +0200
> From: Jose A Ortega Ruiz <jao <at> gnu.org>
> Date: Sat, 22 Jan 2022 19:13:21 +0000
> Cc: 53398 <at> debbugs.gnu.org
> 
>      (defun text-with-right-padding (text)
>        (let* ((len (+ (string-pixel-width text) (string-pixel-width " ")))
>               (padding (propertize "-"
>                                    'display
>                                    `(space :align-to (- (+ right right-margin) (,len))))))
>          (concat padding text " ")))
> 
>      (defun custom-set-message (msg)
>        (when msg (concat msg (text-with-right-padding (buffer-name)))))
> 
>      (setq set-message-function #'custom-set-message)
> 
> text-with-right-padding is copied directly from a message in emacs-devel
> and i don't fully understand it (in particular, i cannot make sense of
> the parens around (,len)), but it does its intended job: with
> custom-set-message one sees messages displayed with the current buffer
> name attached and padded to the right.

These customizations cause the echo-area message become too long for a
single screen line.  That in turn causes Emacs to resize the
mini-window to show the echo-area message, and that indirectly causes
the recentering you see.

So I don't think there's anything in this behavior that isn't
expected.  If you want to prevent recentering, try setting
max-mini-window-height to 1, so that mini-windows aren't resized.  (I
didn't try it, though.)  Or just don't ask the echo-area messages to
display so much stuff.




This bug report was last modified 3 years and 118 days ago.

Previous Next


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