From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Adding support for xref jumping to headers/interfaces Date: Tue, 28 Nov 2023 14:45:00 +0200 Message-ID: <00b85d5b-7878-4099-ab44-8200e153885d@gutov.dev> References: <87il697r5g.fsf@catern.com> <87r0kw8nxu.fsf@catern.com> <3fe5a8cd-b355-d7eb-10ad-8846aef3387b@gutov.dev> <878r6mx1xc.fsf@betli.tmit.bme.hu> <90e4b9a7-3b51-587d-e317-b89e5d5464d9@gutov.dev> <87sf4scxax.fsf@betli.tmit.bme.hu> <77500777-aea2-14db-4aab-7a5dff43443b@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1266"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: Felician Nemeth , Spencer Baugh , emacs-devel@gnu.org, Eshel Yaron , John Yates , Ergus , Filipp Gunbin To: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 28 13:46:08 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 1r7xTb-00005G-9E for ged-emacs-devel@m.gmane-mx.org; Tue, 28 Nov 2023 13:46:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r7xSk-0004mz-8T; Tue, 28 Nov 2023 07:45:14 -0500 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 1r7xSi-0004mX-Ml for emacs-devel@gnu.org; Tue, 28 Nov 2023 07:45:12 -0500 Original-Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r7xSg-0005n0-O8 for emacs-devel@gnu.org; Tue, 28 Nov 2023 07:45:12 -0500 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 1EBA33200C05; Tue, 28 Nov 2023 07:45:07 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 28 Nov 2023 07:45:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1701175506; x=1701261906; bh=9JMJKb8QZ7Is2xfNfAJMqmacmEOB+LLxJfQ mg6OgwqI=; b=zq2D42wekSihiuFywRTz+OXVXGivm3WXsXLDs+Sw8/CEqIZnmO2 0mX4J5QjIq8OwCTi3f/1vGfbLMhqy+Kf38J93Pa809pTC7nuaaT96tfpfKdz4ozJ 6unzJpwt0RwM6Fvh/rm8cWsLwkp/BdTifgsJL5TYX++bIAvMg6y2al3PsMUwGV2L NzUsW6/lFD1TxsnvcSktTcdbXxieGIQ70l0ETcKXJ3C2AKfOR/LDQlIJwWV0gQBH +LcN0sR3aw55jX/MrRO0HUrcxxB/pwIaoPxEoCLiXA1AcgAo5DPyzfgl1zW9YOI3 S1ZNskt7KWhqLkdjtGPh2TXCzFqZWdU03bg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1701175506; x=1701261906; bh=9JMJKb8QZ7Is2xfNfAJMqmacmEOB+LLxJfQ mg6OgwqI=; b=r5lMRYEJvVHn688gOmhMbK1P7SpFATyivlCH4ywRrRSGeWT4JqL j+a5dCVeAPyuWKSCanKRkn3yyQOss9JZjJ6RB42eVtVTNxRtWPSe3Ei8L3agKvnv Mn6bH9amDpkfVpMVMpUtWDCKdJ3fCVyAMZffSNC/p6xreyrvU5LQ0G7R/+0IV+Oo LF/dAOiO8tZxg1p/KsZBqrM+Ozxwiy7fGQMbXXlLS+MUUzrUibF8BGqGGAEkB1B2 FCm1bJRhoxlVjPOMafCU+OOddvHL3iodRKXvIf+sr539CxaHIfsdmLlJj9bFjqc8 IKjLCi/DG0aKvfenPlZvE0wIQCvLMxKiEPQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudeifedggedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfffheeljeffgeffueeghfekkedtfffgheejvdegjeettdduheeufffggfef jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 28 Nov 2023 07:45:03 -0500 (EST) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=64.147.123.19; envelope-from=dmitry@gutov.dev; helo=wout3-smtp.messagingengine.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-1.37, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:313313 Archived-At: On 28/11/2023 11:51, João Távora wrote: >> I'm wary of using macros as framework/library interface in Elisp because >> unless they are very stable, they can cause versioning problems when >> upgrading or reverting to an earlier version. You change a macro, but a >> dependent package is already installed and byte-compiled, and there >> won't be a recompilation until its next update. We might not even intend >> to change them much, but then you don't always anticipate a bugfix. > BTW, these tangents and distractions are possibly what Eli complained > about when trying to follow this discussion about xref, but in the > interest of Lisp programmers out there, what you describe is both a > very real problem and a problem which is trivial to eradicate. Just > expand to functions. Here's a general form of a command-defining macro > suitable for a library interface. > > (defmacro mylib-define-command (name &rest margs) > `(defun ,name (&rest args) > (interactive (mylib--interactive ,@margs)) > (apply #'mylib--doit args))) > > Then you can freely change the implementations of mylib--interactive > and mylib--doit in mylib.el. > > And there are tricks to concoct the docstring at > consultation time too (see 13.2.4 Documentation Strings of Functions) That's a good practice, and it works (and mitigates the issues) until we need to change the underlying function, for some reasons or other. In that sense, having the expansion use private functions (with "--" in the name) doesn't do much because those cannot be safely renamed, extended, etc. Unlike when they're called by a public function. Anyway, adding such macro is even less of a priority concern than the addition (or not) of new key bindings. We could always do it later.