From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: hugo@heagren.com Newsgroups: gmane.emacs.bugs Subject: bug#58071: 28.2; [PATCH] jumprel: A tool to find/create related files Date: Fri, 28 Oct 2022 23:08:26 +0100 Message-ID: <4134dcab7071de01a2a737a22fd06e33@heagren.com> References: <878rm7wvib.fsf@cassou.me> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23318"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Roundcube Webmail/1.5.2 To: 58071@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 29 07:20:45 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 1ooeGz-0005rY-LS for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 29 Oct 2022 07:20:45 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ooeEf-00007p-Q0; Sat, 29 Oct 2022 01:18:22 -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 1oodDU-0006qm-OD for bug-gnu-emacs@gnu.org; Sat, 29 Oct 2022 00:13:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oodDU-00065s-GG for bug-gnu-emacs@gnu.org; Sat, 29 Oct 2022 00:13:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oodDU-00056G-7R for bug-gnu-emacs@gnu.org; Sat, 29 Oct 2022 00:13:04 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <878rm7wvib.fsf@cassou.me> Resent-From: hugo@heagren.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Oct 2022 04:13:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58071 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.166701674819528 (code B ref -1); Sat, 29 Oct 2022 04:13:04 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Oct 2022 04:12:28 +0000 Original-Received: from localhost ([127.0.0.1]:34724 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oodCt-00054o-F5 for submit@debbugs.gnu.org; Sat, 29 Oct 2022 00:12:28 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:43732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooXXN-00027J-IK for submit@debbugs.gnu.org; Fri, 28 Oct 2022 18:09:17 -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 1ooXXN-0002iQ-5x for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 18:09:13 -0400 Original-Received: from whuk14.whukhost.com ([5.77.41.174]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ooXXK-0003gm-RA for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 18:09:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=heagren.com ; s=default; h=Content-Transfer-Encoding:Content-Type:Message-ID:Subject:To: From:Date:MIME-Version:Sender:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=mvUSSrCGZDotNV2HuY1VDYTw+3Gg4Px1Bzv1U0HY85k=; b=k9s+R8u752YvIh+fo138kBKaA3 mXQhXjX9RKpA0clCTv8FCBP/xzJ0QbBqF5HCikE+71xebpTI28uGpa/4uIjcoLCC1CcrHTdWdZ5g0 VjBqgTfeQczXEkvvinQfnn5wGZ3xX53I8S6k7livx9f/J9fSqKgsvZbXrRhtestMm5vi+manp8OCd 08UZ1B3F+SOZq6njsCV4DqrBK1Uj4VD0HeH/jmA7i0MRUfj5XKAvm9UvoqHMYqYoMzniNZRFL2f95 +RMwHuWc9fDponA82H4R7xBeF4Ckj8uAAvlxTRCaSjBHzjfE95EPAg1eODldWKKAXJ8fKtqyrgZCy e3ej6nrw==; Original-Received: from [::1] (port=50574 helo=whuk14.whukhost.com) by whuk14.whukhost.com with esmtpa (Exim 4.95) (envelope-from ) id 1ooXWb-00B9QD-Di for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 23:08:27 +0100 X-Sender: hugo@heagren.com X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - whuk14.whukhost.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - heagren.com X-Get-Message-Sender-Via: whuk14.whukhost.com: authenticated_id: hugo@heagren.com X-Authenticated-Sender: whuk14.whukhost.com: hugo@heagren.com Received-SPF: pass client-ip=5.77.41.174; envelope-from=hugo@heagren.com; helo=whuk14.whukhost.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 29 Oct 2022 00:12:21 -0400 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: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246483 Archived-At: Hi Damien, I've been looking for a package just like this for a while now. I was close to getting round to writing one, but now you have, so thank you! I've had a look through it, and so far I really like it. I think its probably a pretty common problem for lots of Emacs users (jumping to related files easily), so I think including it in the core would make sense, but I can also see the points others have made and wouldn't mind downloading from somewhere else either. Some comments: - The package doesn't work for non-file based buffers, which in particular means it doesn't work in org (roam) capture buffers (for jumping to the pdf I'm making notes on). I appreciate that you need some sort of reference to get off the ground, and that /normally/ that will be a file name, but for my use case it would be great to be able to use other things as well (org roam node id, or a citation ref). This would make a big difference to me. Of course, the package doesn't have to do all the work of handling these different cases, so long as the user can write their own functions for everything (and it is well documented how these interact/what types of inputs and outputs everything needs). - Conversely, the package hard-codes /how/ to jump to a file---with `find-file'. This means I can't go the other way, from a pdf file to an org-roam-capture buffer on its notes (which is what I would like to do). Another way of saying this is the package assumes all places will be files, and that the best way to get to them is `find-file'. It would be nice to be able to specify (perhaps customisable, arbitrary?) types of places and functions actually used to /do/ the jumping. (though I agree that `find-file' is a very sensible default). - At the moment, the presented list of places (files) to jump to is just a list of strings (as in, there is no file metadata, so things like Marginalia don't work properly). I think this should be fixed. This might also make it easier to implement different kinds of jumpers; have an alist of ~(CATEGORY . JUMP-FUNCTION)~ function pairs. Whenever the user selects something from the jump list, get its category, look that up, and then ~(funcall JUMP-FUNCTION SELECTION)~. Ideally, any such system should also support pretty-printing functions for non-string (e.g. org-roam nodes) places. Just a thought, I don't know how easy this would be to implement. - Documentation could be improved, but you knew that already, and there isn't much point until the package reaches a more stable state. Once it is, I would be happy to write some if you want help. - I can see myself using something like `:filler' a lot, but not necessarily for altering the buffer, and which runs every time I jump (or maybe every time I jump, /and/ the buffer I end up is newly created---even if the file already existed). I'm thinking about things like setting local variables which I might use later for establishing targets to jump /back/ to from that buffer. Perhaps something like this could be included in a a separate `:hook' or `:final' keyword, which would be run /last/ in the jumping process. Hope some of that is useful, or finds its way into some code. I'd be happy to make patch contributions, but at this stage I'd like to hear what you think about how I want to use the package and what you want to include before I start hacking. Hugo