bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#52023: [External] : Re: bug#52023: 27.2; Enhancement: `this-command-


From: Drew Adams
Subject: bug#52023: [External] : Re: bug#52023: 27.2; Enhancement: `this-command-invocation-(buffer|window)'
Date: Mon, 22 Nov 2021 20:00:23 +0000

> >> But in any case you can use `pre-command-hook' to store
> >> the original buffer and window.
> >
> > Please the bug report.  It includes this:
> 
> A verb is missing.  I assume you meant: "Please close the bug report"?

It should have said "please read".  No, the report
should not be closed.

> >   Currently, to get this information a workaround
> >   would be to use a `pre-command-hook' function
> >   that sets variables, and then to test those variables.
> 
> Indeed, `pre-command-hook' could be used to set these variables,
> and other possible variables.  There are much worse problems
> while using window-configuration-change-hook.  When this hook is fired,
> it doesn't provide the previous window-configuration as its argument,
> thus requiring remembering the old window-configuration in `pre-command-
> hook'.
>
> So every `pre-command-hook' calls `current-window-configuration'
> that is huge performance overhead.  This is worse than remembering
> a variable in `pre-command-hook', and still no one complains about this.

Please consider filing a bug / enhancement request
for that (other) problem.

`pre-command-hook' (and `post-') are overused.
One reason, I think, is that sometimes there's no
other way to do something easily.  They can be kind
of a mess, and yes, they can affect performance and
other behavior.

I'd like to see this particular enhancement added,
as I think such functions would be useful generally.
I'd like to avoid yet another use of the `pre-' and
`post-' hooks just to obtain some simple state info.

There are lots of things that no one complains about
but that it would be good to fix.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]