From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#55778: 29.0.50; [PATCH] M-. into a .gz; we've all been there. Date: Sun, 05 Jun 2022 15:49:04 +0200 Message-ID: <87r14343vz.fsf@gnus.org> References: <87k09yw9ao.fsf@dick> <874k12auir.fsf@gnus.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="20855"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 55778@debbugs.gnu.org, Stefan Monnier To: dick.r.chiang@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 05 15:50:39 2022 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 1nxqeN-0005Gq-4L for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Jun 2022 15:50:39 +0200 Original-Received: from localhost ([::1]:33102 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxqeK-0007zb-H4 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Jun 2022 09:50:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56622) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxqdp-0007xs-3S for bug-gnu-emacs@gnu.org; Sun, 05 Jun 2022 09:50:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38216) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nxqdm-0005Y0-9e for bug-gnu-emacs@gnu.org; Sun, 05 Jun 2022 09:50:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nxqdm-0007Xk-7u for bug-gnu-emacs@gnu.org; Sun, 05 Jun 2022 09:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Jun 2022 13:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55778 X-GNU-PR-Package: emacs Original-Received: via spool by 55778-submit@debbugs.gnu.org id=B55778.165443696028940 (code B ref 55778); Sun, 05 Jun 2022 13:50:02 +0000 Original-Received: (at 55778) by debbugs.gnu.org; 5 Jun 2022 13:49:20 +0000 Original-Received: from localhost ([127.0.0.1]:60346 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nxqd5-0007Wi-SH for submit@debbugs.gnu.org; Sun, 05 Jun 2022 09:49:20 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:56946) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nxqd2-0007WS-CR for 55778@debbugs.gnu.org; Sun, 05 Jun 2022 09:49:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=h6ZUq0FW3be4veivo/YSJwRlVFp3S8V2mxsJJnjoyD0=; b=KFF6r5krII/RDBH0iCqE5QssHT JBWIzkNR0B1MvdGZFNB1xKDgJuOZuUCfpdLAjBl433x4ExUIlvJ0rkaYkTwBi+VWPsmlSrGZxKsuk SYNLbcuCUsw8tz/i1mE7Mq+Y68oWrsK5Bf1R96gifWX8XNKTrCslDiq25EL76HR1RHiY=; Original-Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nxqcr-0001VG-O1; Sun, 05 Jun 2022 15:49:08 +0200 X-Now-Playing: 1CD (2022) - 09 Aquabat's _Illusion_: "(Circle Of Whispers)" In-Reply-To: <874k12auir.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 03 Jun 2022 12:52:44 +0200") 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:233710 Archived-At: Lars Ingebrigtsen writes: > The idea of the feature is good, though, but can probably be implemented > as a simple file name regexp substitution in the xref machinery that > says "if we were going to jump to > /usr/share/emacs/27.1/lisp/gnus/gnus.el.gz, then jump to > /usr/src/emacs/27.1/lisp/gnus/gnus.el" instead. This reminded me of something Stefan M said the other day(ish) -- it'd be nice to be able to jump to "another file" that's somehow tied to the current file. For instance, jump to files-tests.el from files.el, or to emacs-28/lisp/files.el when you're in trunk/lisp/files.el, or jump to foo.h when you're in foo.c. And this is basically the same -- if you're in /usr/share/emacs/27.1/lisp/abbrev.el.gz, then you want to jump to the development sources. So I've now added a new command `find-sibling-file' to Emacs 29. This setting does what the latter: (setq find-sibling-rules '(("\\(/usr/share/emacs.*/\\(lisp/.*.el\\).gz\\)" "/home/larsi/src/emacs/trunk/\\2\\'"))) Something like this does the Emacs development sibling dance: (setq find-sibling-rules '(("src/emacs/trunk/[^/]+/\\(.*\\)\\'" "src/emacs/emacs-28/.*/\\1\\'") ("emacs/trunk/\\(.*\\)\\.\\(c\\|el\\)\\'" "emacs/trunk/test/\\1-tests.el\\'"))) And this is foo.c -> foo.h: (setq find-sibling-rules '(("\\([^/]+\\)\\.c\\'" "\\1.h"))) I'm not 100% sure about the semantics of the match/expansions here -- there may well be use cases I haven't considered, so this should probably be tweaked a bit. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no