GNU bug report logs - #24213
25.1.50; Fishy use of delete-window in register.el

Previous Next

Package: emacs;

Reported by: Andreas Politz <politza <at> hochschule-trier.de>

Date: Fri, 12 Aug 2016 20:23:02 UTC

Severity: wishlist

Tags: fixed, patch

Found in version 25.1.50

Fixed in version 27.1

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: npostavs <at> users.sourceforge.net
Cc: 24213 <at> debbugs.gnu.org, Leo Liu <sdl.web <at> gmail.com>, Andreas Politz <politza <at> hochschule-trier.de>
Subject: bug#24213: 25.1.50; Fishy use of delete-window in register.el
Date: Sat, 13 Aug 2016 15:30:11 +0200
>> ‘delete-window’ is primarily a command bound to C-x 0.  It should be
>> used only sparingly in Elisp code.  Nevertheless, I think that any
>> advice to use ‘quit-window’ instead should go to the ‘display-buffer’
>> group functions because ‘quit-window’ (now) inherently belongs there.
>
> Wouldn't it then make sense to add the usual "if you are thinking of
> using this function from Lisp code, it's probably a mistake, try
> `quit-window' instead" warning to the delete-window's docstring?

Then readers might think that they should replace ‘delete-window’ with
‘quit-window’ indiscriminately.  That would be incorrect because without
an accompanying ‘quit-restore’ parameter, ‘quit-window’ is not very
useful.  (The history of ‘quit-window’ and ‘quit-restore-window’ is a
convoluted one - I never wanted to commingle these but Chong overruled
me, if my memory doesn't fail).

Paired with ‘split-window’, ‘delete-window’ is the correct choice to
undo the former.  So any warning should go to ‘split-window’ instead.
But then readers might be tempted to replace ‘split-window’ calls with
‘display-buffer’ calls indiscriminately and I don't want to think of the
consequences of this.

> (also, doc fixes should go to emacs-25, right?)

I was tempted to do that.  But please let's postpone further changes in
this area to the time when Andreas has posted his first patch.  I'm glad
that someone has started looking into this and suppose that further doc
fixes will be necessary.

martin





This bug report was last modified 5 years and 276 days ago.

Previous Next


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