emacs-devel
[Top][All Lists]
Advanced

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

Re: Info-mode patch


From: Arthur Miller
Subject: Re: Info-mode patch
Date: Tue, 27 Jun 2023 14:15:37 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Juri Linkov <juri@linkov.net>
>> Cc: emacs-devel@gnu.org
>> Date: Mon, 26 Jun 2023 20:56:19 +0300
>> 
>> > -(defun Info-directory ()
>> > +(defun Info-directory (&optional window)
>> >    "Go to the Info directory node."
>> >    (interactive)
>> > -  (Info-find-node "dir" "top"))
>> > +  (with-selected-window (or window (info-window))
>> > +    (Info-find-node "dir" "top")))
>> 
>> I wonder why you modified a lot of commands instead of implementing
>> a non-intrusive approach of creating standard wrapper commands like
>> 
>>   (defun Info-directory-other-window (&optional window)
>>      "Go to the Info directory node in another window."
>>      (interactive)
>>      (with-selected-window (or window (info-window))
>>        (Info-directory)))
>
> Someone, I think it was Stefan, suggested to use a kind of "universal
> window argument", similar to "C-x RET c" (which is bound to
> universal-coding-system-argument, and allows to specify a
> coding-system for the next command.  Wouldn't that approach resulted
> in a cleaner, more elegant solution?

In my personal opinion, after wrestling with this, I don't think there is one
single "unisex" modell for all. As I see Lisp functions, especially interactive
commands in Emacs, they are more akin to applications, or small shell scripts,
that can basically do whatever they want. Some of them work on buffers, some on
windows, some can just download stuff from the web. With other words, they
should be looked at individually what they do, on case by case basis.

It can also happen that wrapping ends up in as much work, just different in the
long run. One has to create wrappers, in some cases not so trivial, otherwise
user will be thrown between minibuffers on different frames, which I don't think
would be pretty from the user perspective, then there is the manual and docs
everything etc. It can happen that it is not much less work that has to be done,
but just different work, and it can also happen that it ends up in glitches on
some window managers as described in the original mail and response to Juri.

It is definitely possible to implement this in other ways too. As a wise man
said to me: it is all software, everything is possible, it is just the work
that is needed.

By the way, I could possible remove that optional "window" argument in those few
functions that introduce it and use plist as I did in some other place; it was
just a convenience. In that case no signatures are changed at all; no need to
change the manual, possibly it is enough to just mention in News that info/help
commands are callable from other buffers.




reply via email to

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