GNU bug report logs - #30747
Emacs lacks a command to horizontally recenter

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Thu, 8 Mar 2018 06:44:01 UTC

Severity: wishlist

To reply to this bug, email your comments to 30747 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#30747; Package emacs. (Thu, 08 Mar 2018 06:44:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 08 Mar 2018 06:44:01 GMT) Full text and rfc822 format available.

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

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: bug-gnu-emacs <at> gnu.org
Subject: Emacs lacks a command to horizontally recenter
Date: Thu, 08 Mar 2018 11:01:43 +0800
Emacs has fancy commands to vertically recenter,
C-l runs the command recenter-top-bottom.

But alas no command to horizontally recenter.

All it has are the commands on
(info "(emacs) Horizontal Scrolling") Not good enough.

"It's just not fair." "Thin is in, fat is shat."

The future horizontal-recenter command (please implement) should keep
the cursor upon the same character (x), but just move the view screen ([
]) so that x is now in the center.

......[.......x..]...... BEFORE
.........[....x.....]... AFTER

Also at the end of (info "(emacs) Recentering")
add

     The above all refers to vertical recentering. For horizontal recentering
     see (info "(emacs) Horizontal Scrolling").

And on (info "(emacs) Horizontal Scrolling") add the above newly
implemented command, and at the bottom of course mention:

     The above all refers to horizontal scrolling/recentering. For vertical recentering
     see (info "(emacs) Recentering").


P.S.,
[..x.......]..... BEFORE
[..x.......]..... AFTER
i.e., nothing, is probably what should happen if there is no room to
pull from the left.
P.P.S., each "." represents around 10 characters.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30747; Package emacs. (Thu, 08 Mar 2018 10:08:01 GMT) Full text and rfc822 format available.

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

From: Marcin Borkowski <mbork <at> mbork.pl>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 30747 <at> debbugs.gnu.org
Subject: Re: bug#30747: Emacs lacks a command to horizontally recenter
Date: Thu, 08 Mar 2018 11:06:54 +0100
On 2018-03-08, at 04:01, 積丹尼 Dan Jacobson <jidanni <at> jidanni.org> wrote:

> Emacs has fancy commands to vertically recenter,
> C-l runs the command recenter-top-bottom.
>
> But alas no command to horizontally recenter.

Good point.  I'm all for a horizontal recenter command (maybe disabled
by default).

-- 
Marcin Borkowski
http://mbork.pl




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30747; Package emacs. (Thu, 08 Mar 2018 10:37:02 GMT) Full text and rfc822 format available.

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

From: Werner LEMBERG <wl <at> gnu.org>
To: mbork <at> mbork.pl
Cc: 30747 <at> debbugs.gnu.org, jidanni <at> jidanni.org
Subject: Re: bug#30747: Emacs lacks a command to horizontally recenter
Date: Thu, 08 Mar 2018 11:35:50 +0100 (CET)
>> Emacs has fancy commands to vertically recenter,
>> C-l runs the command recenter-top-bottom.
>>
>> But alas no command to horizontally recenter.
> 
> Good point.  I'm all for a horizontal recenter command (maybe
> disabled by default).

Indeed.  This could be quite helpful in editing and viewing very long
lines.


    Werner




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30747; Package emacs. (Fri, 25 Jun 2021 14:47:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 30747 <at> debbugs.gnu.org
Subject: Re: bug#30747: Emacs lacks a command to horizontally recenter
Date: Fri, 25 Jun 2021 16:46:28 +0200
積丹尼 Dan Jacobson <jidanni <at> jidanni.org> writes:

> Emacs has fancy commands to vertically recenter,
> C-l runs the command recenter-top-bottom.
>
> But alas no command to horizontally recenter.
>
> All it has are the commands on
> (info "(emacs) Horizontal Scrolling") Not good enough.
>
> "It's just not fair." "Thin is in, fat is shat."
>
> The future horizontal-recenter command (please implement) should keep
> the cursor upon the same character (x), but just move the view screen ([
> ]) so that x is now in the center.
>
> ......[.......x..]...... BEFORE
> .........[....x.....]... AFTER

So this would only be for buffers where truncate-lines is non-nil?  Yes,
it'd be handy to have such a command...  or perhaps `C-l' should just do
this automatically (in these buffers)?

Any opinions?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30747; Package emacs. (Fri, 25 Jun 2021 15:00:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 30747 <at> debbugs.gnu.org, jidanni <at> jidanni.org
Subject: Re: bug#30747: Emacs lacks a command to horizontally recenter
Date: Fri, 25 Jun 2021 17:59:23 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Fri, 25 Jun 2021 16:46:28 +0200
> Cc: 30747 <at> debbugs.gnu.org
> 
> > The future horizontal-recenter command (please implement) should keep
> > the cursor upon the same character (x), but just move the view screen ([
> > ]) so that x is now in the center.
> >
> > ......[.......x..]...... BEFORE
> > .........[....x.....]... AFTER
> 
> So this would only be for buffers where truncate-lines is non-nil?

No, also in partial-width windows (as in after "C-x 3").

> Yes, it'd be handy to have such a command...  or perhaps `C-l'
> should just do this automatically (in these buffers)?
> 
> Any opinions?

Since lines are generally not all of the same width, such horizontal
scrolling can only guarantee to center one line, and sometimes cannot
center it at all (if it's narrower than the window).  I wonder whether
the OP indeed understands what he will get as result of implementing
this feature.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30747; Package emacs. (Sat, 26 Jun 2021 12:50:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 30747 <at> debbugs.gnu.org, jidanni <at> jidanni.org
Subject: Re: bug#30747: Emacs lacks a command to horizontally recenter
Date: Sat, 26 Jun 2021 14:49:17 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> Since lines are generally not all of the same width, such horizontal
> scrolling can only guarantee to center one line, and sometimes cannot
> center it at all (if it's narrower than the window).  I wonder whether
> the OP indeed understands what he will get as result of implementing
> this feature.

The centring would be based on the current line, yes.  But horizontal
centring is mostly useful when you have a display that's much wider than
your window width, which can happen i deeply nested threads in Gnus, for
instance.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30747; Package emacs. (Sat, 26 Jun 2021 13:00:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 30747 <at> debbugs.gnu.org, jidanni <at> jidanni.org
Subject: Re: bug#30747: Emacs lacks a command to horizontally recenter
Date: Sat, 26 Jun 2021 15:58:56 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: jidanni <at> jidanni.org,  30747 <at> debbugs.gnu.org
> Date: Sat, 26 Jun 2021 14:49:17 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > Since lines are generally not all of the same width, such horizontal
> > scrolling can only guarantee to center one line, and sometimes cannot
> > center it at all (if it's narrower than the window).  I wonder whether
> > the OP indeed understands what he will get as result of implementing
> > this feature.
> 
> The centring would be based on the current line, yes.

So when one goes one line up or down, one would need to recenter?

>                                                        But horizontal
> centring is mostly useful when you have a display that's much wider than
> your window width, which can happen i deeply nested threads in Gnus, for
> instance.

Doesn't auto-hscroll-mode = current-line take care of that?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30747; Package emacs. (Sat, 26 Jun 2021 15:22:02 GMT) Full text and rfc822 format available.

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

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 30747 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#30747: Emacs lacks a command to horizontally recenter
Date: Sat, 26 Jun 2021 23:21:39 +0800
> I wonder whether the OP indeed understands what he will get as result
> of implementing this feature.

Well whatever you do, don't forcibly glue vertical and horizontal
centering to the same key... for now at least.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30747; Package emacs. (Wed, 30 Jun 2021 11:59:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 30747 <at> debbugs.gnu.org, jidanni <at> jidanni.org
Subject: Re: bug#30747: Emacs lacks a command to horizontally recenter
Date: Wed, 30 Jun 2021 13:58:03 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> So when one goes one line up or down, one would need to recenter?

If you want to recenter, then you recenter.

>>                                                        But horizontal
>> centring is mostly useful when you have a display that's much wider than
>> your window width, which can happen i deeply nested threads in Gnus, for
>> instance.
>
> Doesn't auto-hscroll-mode = current-line take care of that?

If somebody wants to do that, then that's up to them, but this is about
a command that'll recenter the display horizontally.  And that setting
doesn't help with that.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




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

Previous Next


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