emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] emacs-25 bc55a57: * lisp/menu-bar.el (kill-this-buffer


From: Eli Zaretskii
Subject: Re: [Emacs-diffs] emacs-25 bc55a57: * lisp/menu-bar.el (kill-this-buffer): Doc fix. (Bug#26466)
Date: Mon, 17 Apr 2017 19:52:39 +0300

> From: Stefan Monnier <address@hidden>
> Date: Mon, 17 Apr 2017 12:05:02 -0400
> 
> > The request for documenting the subtlety was voiced more than once
> > over the years,
> 
> IOW, people have complained about that buggy behavior.

They used the function outside its domain, because its domain wasn't
documented.

> The difference is that we know how to fix the bug rather than document it.

No, we _think_ we know how to fix the "bug", and we _think_ the fix
won't cause other problems.

> > And I see no ugliness here, so if it exists, it must be minor.
> 
> The ugliness is that the kill-this-buffer code uses
> menu-bar-non-minibuffer-window-p and
> menu-bar-menu-frame-live-and-visible-p both of which consult
> menu-updating-frame because they are designed to be used in menu
> attributes (as in :enable, :active, ...).

There's no ugliness: this function was designed to be used from a menu
bar.  It took several iterations over several years to get it right
with all the various GUI variants we support.  It wasn't easy.  Since
its last change, it worked without any complaints, except about its
being inappropriate outside of menus.  And yet you still want to make
these changes, in the very same place which took us years to get
right.  What makes you think we are now any wiser than we were back
then, and won't be making the same kinds of mistakes we did then?

The master branch now has a new kill-current-buffer function that
doesn't refer to menus, under a different name.  New code should use
it in preference to kill-this-buffer.  With luck, uses of
kill-this-buffer outside of the menus will stop now.  And we already
know kill-this-buffer is okay when invoked from menus.  So I think
this particular bike shed has the right color, and we can move on to
more serious issues.

> It's a plain bug.  Minor, but a bug nonetheless.

What can I say? I disagree.  From my POV, it's a minor issue not worth
the risk of breaking users of this function.



reply via email to

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