From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Info-mode patch Date: Tue, 27 Jun 2023 15:42:56 +0300 Message-ID: <835y79vzxr.fsf@gnu.org> References: <86fs6ertto.fsf@mail.linkov.net> <838rc5w2ku.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31488"; mail-complaints-to="usenet@ciao.gmane.io" Cc: juri@linkov.net, emacs-devel@gnu.org To: Arthur Miller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jun 27 14:43:01 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qE828-0007xL-Pz for ged-emacs-devel@m.gmane-mx.org; Tue, 27 Jun 2023 14:43:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qE81k-0005fc-Vm; Tue, 27 Jun 2023 08:42:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qE81j-0005fC-IK for emacs-devel@gnu.org; Tue, 27 Jun 2023 08:42:35 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qE81i-0001OI-HN; Tue, 27 Jun 2023 08:42:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Inhlb6r+vqwA521CKJ6O0L6XwQ0pjAYP9ythX7jWuj8=; b=DnzdGplJf11U YhpnnLt9oek5ejMlxn8lFxiphdQ0TRzok9DG4156mV09pFaWNgsejLlPNNYWOvw/1wRkIzV3KSQoR T8BAZ8+b4VqCOjaN3fKhJmvroE8P72/LsY193yHrXQH5P+P8BNlzoseBafhYPUxerAmWa7dApyEw/ 05wZBGtofhZbOLR5bwEtgR7kXnNvyMQNXDEOYAX/JS0CAnhc1nDmWw/VxajiW1jeMauYRhjTx16D+ dfP5bXDLTH5cVzTEfbcI4/IpE5He40IDleM/itHbeMMQpS47TjxLVj0sPDBqTKFvL1oj6T1Jx8M+m wAIr4/0dUMu+dpXCPtWizg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qE81h-0000Cz-UP; Tue, 27 Jun 2023 08:42:34 -0400 In-Reply-To: (message from Arthur Miller on Tue, 27 Jun 2023 14:15:37 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:307256 Archived-At: > From: Arthur Miller > Cc: Juri Linkov , emacs-devel@gnu.org > Date: Tue, 27 Jun 2023 14:15:37 +0200 > > Eli Zaretskii writes: > > >> From: Juri Linkov > >> 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. I think you are trying to solve a much wider, more general, and more hard problem than you need to. Remember, this started as a feature to allow the user invoke help-mode and Info-mode commands from a window other than the one showing (help* or *info* buffers. You are describing issues far away from that. > 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. The "universal-window-argument" suggestion is precisely so you could pass such a "window argument" without actually touching the signature of the functions.