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

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

bug#24213: 25.1.50; Fishy use of delete-window in register.el


From: martin rudalics
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






reply via email to

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