From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Whitton Newsgroups: gmane.emacs.bugs Subject: bug#41890: bug#42210: bug#41890: 28.0.50; [PATCH]: Add bindings for project.el Date: Fri, 24 Jul 2020 08:12:13 -0700 Message-ID: <871rl1t0aa.fsf@iris.silentflame.com> References: <87mu50b43d.fsf@warpmail.net> <87pn92t1ye.fsf@iris.silentflame.com> <874kqcsnu5.fsf@iris.silentflame.com> <54a1ed24-9d0e-4671-eb70-9d8c253e7aac@yandex.ru> <87y2ngg64e.fsf@iris.silentflame.com> <99e82681-e645-2888-3d24-26698ee0c7e0@yandex.ru> <871rl6gmip.fsf@iris.silentflame.com> <874kq1d7wf.fsf@iris.silentflame.com> <87zh7s8mlv.fsf@mail.linkov.net> <87blk849lh.fsf@iris.silentflame.com> <87tuxz2vt8.fsf@iris.silentflame.com> <1d2621fe-2e06-cc2d-3c3f-b44d61427ac2@yandex.ru> <878sf9u0rm.fsf@iris.silentflame.com> <83sgdhe9jc.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39556"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 41890@debbugs.gnu.org, 42210@debbugs.gnu.org, juri@linkov.net, contovob@tcd.ie, philip@warpmail.net, dgutov@yandex.ru To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 24 17:13:25 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1jyzO1-000AAz-7D for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Jul 2020 17:13:25 +0200 Original-Received: from localhost ([::1]:39840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyzO0-0000Du-93 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Jul 2020 11:13:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33384) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jyzNg-0000Co-0N for bug-gnu-emacs@gnu.org; Fri, 24 Jul 2020 11:13:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36989) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jyzNe-00042v-Hk for bug-gnu-emacs@gnu.org; Fri, 24 Jul 2020 11:13:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jyzNe-0006qG-CD for bug-gnu-emacs@gnu.org; Fri, 24 Jul 2020 11:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sean Whitton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Jul 2020 15:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41890 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 41890-submit@debbugs.gnu.org id=B41890.159560354326239 (code B ref 41890); Fri, 24 Jul 2020 15:13:02 +0000 Original-Received: (at 41890) by debbugs.gnu.org; 24 Jul 2020 15:12:23 +0000 Original-Received: from localhost ([127.0.0.1]:48533 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jyzN1-0006p7-CY for submit@debbugs.gnu.org; Fri, 24 Jul 2020 11:12:23 -0400 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:39363) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jyzMy-0006on-Ro; Fri, 24 Jul 2020 11:12:21 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id A6B775C005C; Fri, 24 Jul 2020 11:12:15 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 24 Jul 2020 11:12:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm3; bh=XY46UX1XaCegjz8LWYcGgGrGxM 3SQ9qdXdmEX/KDQoE=; b=ePxWrCGojbq1pPzPiN90Ukp2c3r+2qXuAcPa+FBon9 XK2Q5laajrm5cn3WSlW+6S7dL0/czVgmXBUWAELyHL3HnAD8gq/7Fumpy99ODNAi cB/IQs0LhKeW2WjWofodSHBdAsXHNGZ9Ghf7Mx/D4Gl+JzuaRiFgqAkqNKTomz6A DEvLqscIRCednLYEWaQ388qfcNK5H9h62soJ8ALkWCoVtA60msXA9ezOwTBcZFOV K6PtSzXhTTedOv/hfWe1NlYtfMHeTpWQryV3c/zZ3KQ2jzJttAZggidk9w38GsuI nz55VTT27xLO0Punimul1VA34A54MWlQQRjMYbw/3wKg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=XY46UX 1XaCegjz8LWYcGgGrGxM3SQ9qdXdmEX/KDQoE=; b=twQiJqYU1nB1Kt2qVZER0u hygT40gxWt0jVK2xBWiH5deizmLbsogR3b5PwrH1IVvScHTBsOMkiq7H8iIzohJp mHv0psH06Rie8hxShnD4JskCRs0AuO6WQ9p4DZVKmo+HwOClVITcpBR2zMM6VS5Q qTOKw0c2exBF0dyiyvDqCjq7NDFlSoId4kcbrJ89fY8XYn7FGDnv8BJ98nePrYk9 MIwmdfpfv13WVEvEO5is0daX2DiXpxAtKA8YkdpSA+f9Wc6xg2RaMyTYKZG0dLAi 2N2TUd29cGXIU1LyxFHqQAESeShLrocWDx9hZq5oCl5mUN68Yhv+Quyl2sheUnyg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrheefgdekkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffujghffffkgggtsehttdertddttddtnecuhfhrohhmpefuvggrnhcuhghh ihhtthhonhcuoehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgeqnecugg ftrfgrthhtvghrnhepgedtvdehgeffhfffvdeffefhgfejffelhfetveffffektefgtdej tdeivddtveehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgv X-ME-Proxy: In-Reply-To: <83sgdhe9jc.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:183488 Archived-At: Hello Eli, On Fri 24 Jul 2020 at 09:01AM +03, Eli Zaretskii wrote: >> Date: Thu, 23 Jul 2020 19:04:13 -0700 >> Cc: "Basil L. Contovounesios" , >> "Philip K." , 41890@debbugs.gnu.org, >> 42210@debbugs.gnu.org >> >> -(defun project-switch-to-buffer () >> +(defun project-switch-to-buffer (&optional switching-function) >> "Switch to another buffer belonging to the current project. >> This function prompts for another buffer, offering as candidates >> buffers that belong to the same project as the current buffer. >> Two buffers belong to the same project if their project instances, >> -as reported by `project-current' in each buffer, are identical." >> +as reported by `project-current' in each buffer, are identical. >> + >> +Optional argument SWITCHING-FUNCTION is the function used to >> +switch the buffer. It defaults to `switch-to-buffer'." >> (interactive) > > This interface strikes me as unusual and even unexpected for a command > that switches to another buffer. I would expect it to have an API > similar to that of switch-to-buffer: that it should accept the buffer > to switch to as an argument, and set up that argument in the > 'interactive' spec according to the preferences of this command > (offering buffers in the same project etc.). The API you propose > makes it awkward, to say the least, to invoke this command from Lisp. I added the argument just so I could reuse the code in project-switch-to-buffer, so a simple alternative for the purposes of my patch would be to factor that code out into a new project--select-project-buffer defun. Then no existing APIs would be changed. Would that be sufficient? > Granted, the original API doesn't allow such invocation, either, but > as long as we are changing this API, let's try fixing that, okay? This is a bit tricky actually -- what should the function do if some Lisp code passes it a buffer which is not part of the current project? Throw an error? But then surely the Lisp code would prefer to just check if the buffer is part of the project itself, and use switch-to-buffer. I'd be grateful if you could say more about the sort of Lisp code you have in mind. I'm struggling to imagine wanting to call this function from Lisp except via call-interactively. -- Sean Whitton