all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Default value of recenter-redisplay
@ 2018-04-29 14:10 John Shahid
  2018-04-29 14:47 ` Amos Bird
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: John Shahid @ 2018-04-29 14:10 UTC (permalink / raw)
  To: help-gnu-emacs

Hi all,

Today I decided to tackle a flicker issue that happens when the flycheck
error list is displayed for the current buffer(i.e. by calling
`flycheck-list-errors' interactively). It turns out the flickering is
caused by a call to recenter[1] that happens inside a flycheck
post-command-hook[2]. Setting `recenter-redisplay' to nil fixes the
issue.


I'm wondering why the default value of the variable is set to `tty' ?
Also, is it safe to set the variable to `nil' ? If it is safe, can we
change the default value to `nil' in order to have a better terminal
experience ?

p.s. I'm using emacs version 27.0.50, although I don't think that will
make a difference given that the value of the variable hasn't changed in
a while.

thanks,

-js

[1]: https://github.com/flycheck/flycheck/blob/master/flycheck.el#L4208
[2]: https://github.com/flycheck/flycheck/blob/master/flycheck.el#L4360



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Default value of recenter-redisplay
  2018-04-29 14:10 Default value of recenter-redisplay John Shahid
@ 2018-04-29 14:47 ` Amos Bird
  2018-04-29 15:02 ` Göktuğ Kayaalp
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: Amos Bird @ 2018-04-29 14:47 UTC (permalink / raw)
  To: John Shahid; +Cc: help-gnu-emacs


Hi, I just encountered this today. Removing the (recenter) call 
makes the issue
go away. Thanks!

John Shahid <jvshahid@gmail.com> writes:

> Hi all,
>
> Today I decided to tackle a flicker issue that happens when the 
> flycheck
> error list is displayed for the current buffer(i.e. by calling
> `flycheck-list-errors' interactively). It turns out the 
> flickering is
> caused by a call to recenter[1] that happens inside a flycheck
> post-command-hook[2]. Setting `recenter-redisplay' to nil fixes 
> the
> issue.
>
>
> I'm wondering why the default value of the variable is set to 
> `tty' ?
> Also, is it safe to set the variable to `nil' ? If it is safe, 
> can we
> change the default value to `nil' in order to have a better 
> terminal
> experience ?
>
> p.s. I'm using emacs version 27.0.50, although I don't think 
> that will
> make a difference given that the value of the variable hasn't 
> changed in
> a while.
>
> thanks,
>
> -js
>
> [1]: 
> https://github.com/flycheck/flycheck/blob/master/flycheck.el#L4208
> [2]: 
> https://github.com/flycheck/flycheck/blob/master/flycheck.el#L4360


--
Amos Bird
amosbird@gmail.com



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Default value of recenter-redisplay
  2018-04-29 14:10 Default value of recenter-redisplay John Shahid
  2018-04-29 14:47 ` Amos Bird
@ 2018-04-29 15:02 ` Göktuğ Kayaalp
  2018-04-29 15:18 ` Eli Zaretskii
  2018-04-29 17:46 ` Eli Zaretskii
  3 siblings, 0 replies; 12+ messages in thread
From: Göktuğ Kayaalp @ 2018-04-29 15:02 UTC (permalink / raw)
  To: John Shahid; +Cc: help-gnu-emacs

On 2018-04-29 14:10 GMT, John Shahid <jvshahid@gmail.com> wrote:
> I'm wondering why the default value of the variable is set to `tty' ?
> Also, is it safe to set the variable to `nil' ? If it is safe, can we
> change the default value to `nil' in order to have a better terminal
> experience ?

The said variable was added in commit 666e158e382, and the documentation
bits of the patch read:

,----
| +center of the window, or as close to the center as possible.  If the
| +variable @var{recenter-redisplay} is non-nil, it also clears the
| +screen and redisplays all windows; this is useful in case the screen
| +becomes garbled for any reason (@pxref{Screen Garbled}).  If
| +@var{recenter-redisplay} has the special value @code{tty} (the
| +default), then redisplay only happens on tty frames.
`----

-- 
İ. Göktuğ Kayaalp	<https://www.gkayaalp.com/>
			 024C 30DD 597D 142B 49AC
			 40EB 465C D949 B101 2427



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Default value of recenter-redisplay
  2018-04-29 14:10 Default value of recenter-redisplay John Shahid
  2018-04-29 14:47 ` Amos Bird
  2018-04-29 15:02 ` Göktuğ Kayaalp
@ 2018-04-29 15:18 ` Eli Zaretskii
  2018-04-29 17:07   ` Bob Proulx
  2018-04-29 17:46 ` Eli Zaretskii
  3 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2018-04-29 15:18 UTC (permalink / raw)
  To: help-gnu-emacs

> From: John Shahid <jvshahid@gmail.com>
> Date: Sun, 29 Apr 2018 14:10:29 +0000
> 
> I'm wondering why the default value of the variable is set to `tty' ?

Because one important interactive use of 'recenter' is to redraw the
screen to eliminate display corruptions due to all kinds of unrelated
messages being dumped on the console.  When this variable and the
related feature was introduced, RMS explicitly asked not to change the
then default behavior on TTY's, see

  http://lists.gnu.org/archive/html/emacs-devel/2009-06/msg00416.html

> Also, is it safe to set the variable to `nil' ?

If you don't care about fixing corrupted display on TTYs (or never
experienced that), you can safely change it to nil.

> If it is safe, can we change the default value to `nil' in order to
> have a better terminal experience ?

Why does it have to change by default?  I generally find arguments
about default values to be waste of time and energy, since anyone who
doesn't like the default can change it for them.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Default value of recenter-redisplay
  2018-04-29 15:18 ` Eli Zaretskii
@ 2018-04-29 17:07   ` Bob Proulx
  2018-04-29 17:29     ` tomas
  2018-04-29 17:36     ` Drew Adams
  0 siblings, 2 replies; 12+ messages in thread
From: Bob Proulx @ 2018-04-29 17:07 UTC (permalink / raw)
  To: help-gnu-emacs

Eli Zaretskii wrote:
> > John Shahid wrote:
> > I'm wondering why the default value of the variable is set to `tty' ?
> 
> Because one important interactive use of 'recenter' is to redraw the
> screen to eliminate display corruptions due to all kinds of unrelated
> messages being dumped on the console.  When this variable and the
> related feature was introduced, RMS explicitly asked not to change the
> then default behavior on TTY's, see
> 
>   http://lists.gnu.org/archive/html/emacs-devel/2009-06/msg00416.html

I am compelled to say (because otherwise someone will argue that no
one complained about the change) that even if other people don't ever
see output emitted to their tty outside of emacs that I do still
routinely run into the case.  I see shutdown warnings or kernel
messages from martian IP packets or whatwever as there are many things
that write to the tty.  I rely upon C-l a lot.

Obviously a graphical X11 window does not have external processes
modifying it and does not need to be redisplayed.

> > Also, is it safe to set the variable to `nil' ?
> 
> If you don't care about fixing corrupted display on TTYs (or never
> experienced that), you can safely change it to nil.
> 
> > If it is safe, can we change the default value to `nil' in order to
> > have a better terminal experience ?

A better terminal experience is that C-l can be used after several
lines have been written to the tty by outside processes.  Keeping it
the same as with other terminal programs such as bash, vi, vim, less,
mutt, and so forth.  Making C-l work differently from those other
programs makes for a worse terminal experience.  A positive transfer
of learning across many programs.

> Why does it have to change by default?  I generally find arguments
> about default values to be waste of time and energy, since anyone who
> doesn't like the default can change it for them.

Changing defaults is painful and frustrating to people (often me) who
make use of the defaults.  It makes the feature one that is required
to be configured before it can be used.  Which contributes to making
emacs hard to learn for newcomers.  Which perpetuates the stereotype
that emacs is too arcane.  That's bad.

And as long as I am here I am also one of those people who didn't like
the change from recenter to recenter-top-bottom.  I added this to my
key bindings to avoid it.

  (global-set-key "\C-l" 'recenter) ; originally recenter, now annoyingly recenter-top-bottom

Bob



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Default value of recenter-redisplay
  2018-04-29 17:07   ` Bob Proulx
@ 2018-04-29 17:29     ` tomas
  2018-04-29 19:50       ` Drew Adams
  2018-04-29 17:36     ` Drew Adams
  1 sibling, 1 reply; 12+ messages in thread
From: tomas @ 2018-04-29 17:29 UTC (permalink / raw)
  To: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, Apr 29, 2018 at 11:07:29AM -0600, Bob Proulx wrote:
> Eli Zaretskii wrote:
> > > John Shahid wrote:
> > > I'm wondering why the default value of the variable is set to `tty' ?
> > 
> > Because one important interactive use of 'recenter' is to redraw the
> > screen to eliminate display corruptions [...]

[...]

> A better terminal experience is that C-l can be used after several
> lines have been written to the tty by outside processes.  Keeping it
> the same as with other terminal programs such as bash, vi, vim, less,
> mutt, and so forth [...]

Thirded: the "old" behaviour, on which many people rely should be the
"new" default. Almost always.

Cheers
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlrmAQUACgkQBcgs9XrR2kaOwwCdEmCi1z/+oIRR3SCJJun2KrYM
fcgAn0u919/VARFhbAcFjkVODcHM9nNC
=tT/P
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: Default value of recenter-redisplay
  2018-04-29 17:07   ` Bob Proulx
  2018-04-29 17:29     ` tomas
@ 2018-04-29 17:36     ` Drew Adams
  1 sibling, 0 replies; 12+ messages in thread
From: Drew Adams @ 2018-04-29 17:36 UTC (permalink / raw)
  To: Bob Proulx, help-gnu-emacs

> And as long as I am here I am also one of those people who didn't like
> the change from recenter to recenter-top-bottom.  I added this to my
> key bindings to avoid it.  (global-set-key "\C-l" 'recenter) ;
> originally recenter, now annoyingly recenter-top-bottom

Probably the other 3 "people who didn't like the change"
did the same thing. ;-)

As the guy responsible for `recenter-top-bottom', and for
its stealing key `C-l' from `recenter': what you did is
the right thing to do, if you want `recenter' behavior.

It's the reason `recenter-top-bottom' is a separate command.
It's trivial to use the key you want for the behavior you
want, as long as you have a command that does what you want.

The question of default behavior is a different one from
what this or that user prefers for their own use.  Emacs
is the easiest and most flexible application when it comes
to customizing keys.  Be glad.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Default value of recenter-redisplay
  2018-04-29 14:10 Default value of recenter-redisplay John Shahid
                   ` (2 preceding siblings ...)
  2018-04-29 15:18 ` Eli Zaretskii
@ 2018-04-29 17:46 ` Eli Zaretskii
  2018-04-29 22:11   ` John Shahid
  3 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2018-04-29 17:46 UTC (permalink / raw)
  To: help-gnu-emacs

> From: John Shahid <jvshahid@gmail.com>
> Date: Sun, 29 Apr 2018 14:10:29 +0000
> 
> Today I decided to tackle a flicker issue that happens when the flycheck
> error list is displayed for the current buffer(i.e. by calling
> `flycheck-list-errors' interactively). It turns out the flickering is
> caused by a call to recenter[1] that happens inside a flycheck
> post-command-hook[2]. Setting `recenter-redisplay' to nil fixes the
> issue.

Btw, everything that was said about using 'recenter' to clean up the
screen mess is only related to invoking that command interactively.
If Flycheck needs to invoke it without causing flickering on TTYs, it
can let-bind recenter-redisplay around the call.  Please consider
suggesting that to the Flycheck developer(s).



^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: Default value of recenter-redisplay
  2018-04-29 17:29     ` tomas
@ 2018-04-29 19:50       ` Drew Adams
  0 siblings, 0 replies; 12+ messages in thread
From: Drew Adams @ 2018-04-29 19:50 UTC (permalink / raw)
  To: tomas, help-gnu-emacs

> Thirded: the "old" behaviour, on which many people rely should be the
> "new" default. Almost always.

Default behavior should be decided on a case-by-case basis.
Almost always.  That goes for an initial decision as well
as later reconsideration.  But yes, changing an existing
default behavior does require at least as much consideration
as deciding on a default behavior initially.

In this case it was discussed at some length on emacs-devel.
But anyone is always welcome to reopen such a discussion
there.  That's the main place where Emacs design and
implementation get discussed and decided.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Default value of recenter-redisplay
  2018-04-29 17:46 ` Eli Zaretskii
@ 2018-04-29 22:11   ` John Shahid
  2018-04-30 12:38     ` Stefan Monnier
  0 siblings, 1 reply; 12+ messages in thread
From: John Shahid @ 2018-04-29 22:11 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs


Eli Zaretskii <eliz@gnu.org> writes:

>> From: John Shahid <jvshahid@gmail.com>
>> Date: Sun, 29 Apr 2018 14:10:29 +0000
>>
>> Today I decided to tackle a flicker issue that happens when the flycheck
>> error list is displayed for the current buffer(i.e. by calling
>> `flycheck-list-errors' interactively). It turns out the flickering is
>> caused by a call to recenter[1] that happens inside a flycheck
>> post-command-hook[2]. Setting `recenter-redisplay' to nil fixes the
>> issue.
>
> Btw, everything that was said about using 'recenter' to clean up the
> screen mess is only related to invoking that command interactively.
> If Flycheck needs to invoke it without causing flickering on TTYs, it
> can let-bind recenter-redisplay around the call.  Please consider
> suggesting that to the Flycheck developer(s).

I have given this more thought since my initial post. I understand
the arguments for not changing the default behavior and I support them
given that I have occasionally used C-l to redraw the frame. That said,
I would like to propose something else. I feel that `recenter' is a
primitive command that shouldn't combine more than one functionality
(i.e. recenter and redisplay). Could we either:

1. introduce a new lisp function for recentering and discourage the use
of `recenter' from lisp (i.e. declaring it `interactive-only'), or
2. add a new `recenter-and-redisplay' and bound it to C-l

My argument for the change is that the only use case for the redisplay
is when called interactively. I don't think the intention of calling
`recenter' in lisp code is to also redisplay the frame. I also find it
annoying to have to wrap every call to `recenter' in a let-bind.

cheers,

-js



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Default value of recenter-redisplay
  2018-04-29 22:11   ` John Shahid
@ 2018-04-30 12:38     ` Stefan Monnier
  2018-05-01  1:18       ` unknown
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Monnier @ 2018-04-30 12:38 UTC (permalink / raw)
  To: help-gnu-emacs

> I would like to propose something else. I feel that `recenter' is a
> primitive command that shouldn't combine more than one functionality
> (i.e. recenter and redisplay). Could we either:

Please do that via `M-x report-emacs-bug` so this request gets
a tracking number.

> 1. introduce a new lisp function for recentering and discourage the use
> of `recenter' from lisp (i.e. declaring it `interactive-only'), or
> 2. add a new `recenter-and-redisplay' and bound it to C-l

Another possibility is to add an argument to it.


        Stefan




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Default value of recenter-redisplay
  2018-04-30 12:38     ` Stefan Monnier
@ 2018-05-01  1:18       ` unknown
  0 siblings, 0 replies; 12+ messages in thread
From: unknown @ 2018-05-01  1:18 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: help-gnu-emacs


Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Please do that via `M-x report-emacs-bug` so this request gets
> a tracking number.

Opened a new bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=31325

thanks,

-js



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-05-01  1:18 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-29 14:10 Default value of recenter-redisplay John Shahid
2018-04-29 14:47 ` Amos Bird
2018-04-29 15:02 ` Göktuğ Kayaalp
2018-04-29 15:18 ` Eli Zaretskii
2018-04-29 17:07   ` Bob Proulx
2018-04-29 17:29     ` tomas
2018-04-29 19:50       ` Drew Adams
2018-04-29 17:36     ` Drew Adams
2018-04-29 17:46 ` Eli Zaretskii
2018-04-29 22:11   ` John Shahid
2018-04-30 12:38     ` Stefan Monnier
2018-05-01  1:18       ` unknown

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.