GNU bug report logs - #55778
29.0.50; [PATCH] M-. into a .gz; we've all been there.

Previous Next

Package: emacs;

Reported by: dick.r.chiang <at> gmail.com

Date: Fri, 3 Jun 2022 08:19:02 UTC

Severity: normal

Found in version 29.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: dick.r.chiang <at> gmail.com
Cc: 55778 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
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
Lars Ingebrigtsen <larsi <at> gnus.org> 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




This bug report was last modified 3 years and 63 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.