Authentication-Results: mail-b.sr.ht; dkim=pass header.d=protesilaos.com header.i=@protesilaos.com Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by mail-b.sr.ht (Postfix) with ESMTPS id 659E011EF6A for <~protesilaos/denote@lists.sr.ht>; Thu, 27 Oct 2022 03:43:45 +0000 (UTC) Received: (Authenticated sender: public@protesilaos.com) by mail.gandi.net (Postfix) with ESMTPSA id ABA051C0005; Thu, 27 Oct 2022 03:43:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protesilaos.com; s=gm1; t=1666842224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VX3WfQz3MoN3vtIv+IVC6cLR6Duhe4oaG8Q7/pWOymE=; b=QmtzKid6g767ASvZonTCPdg9gsjBaU60cPnH02jWdJirq6ehKvjEz6EKuTI0Js59ZrgCTT RcYw2Wb1IKpGMIPqNMcs/kTzvTgKseYVEWwRnYfrMQuq7+4CzmXSl+6nzfszyoPeHQeIf7 rYFGjEonTOqAda7y9ho4mnptbY9FsVSPKG4ffPIFXD5c+kTjN1CqXBKvgs2bx2YYNa4d3O UMka9umd9Q35XnKp2d7joIxGlk0viZWYT8X1i98tEsFtzoJrDxfO9yCcXMwkDkfADy5Teb TxlrBzi5oy69WUQ3GPHIb0vf7PRhyrCVhpJvkFO2C+5KTaUumSPA0/bXL53UcA== From: Protesilaos Stavrou To: Noboru Ota , ~protesilaos/denote@lists.sr.ht Subject: Re: [PATCH] Display context of identifier in backlinks buffer with xref In-Reply-To: <86ilk6uzf4.fsf@nobiot.com> References: <86ilk6uzf4.fsf@nobiot.com> Date: Thu, 27 Oct 2022 06:43:42 +0300 Message-ID: <87zgdi6idt.fsf@protesilaos.com> MIME-Version: 1.0 Content-Type: text/plain > From: Noboru Ota > Date: Wed, 26 Oct 2022 22:01:51 +0200 > > Made patches to make the current version compatible with 27.2. I have > tested both cases where user option 'denote-backlilnks-show-context' is > on and off for both 27.2 and 28.1. > > I have noted this in the commit text: TODO: It is likely that these two > functions can be made into one to be comptabile for both Emacs versions. > Further work is requried to refactor them. Hello again Noboru, I implemented some of your patches, but left out those that (i) are for Emacs 27 and (ii) prettify the backlinks' buffer. This is the current commit log, since our last exchange: * (HEAD -> main, origin/main, gitlab-mirror/main) ee69dae 2022-10-27 06:28:19 +0300 Protesilaos Stavrou: Update sample configuration, per b313dfc * 7c22231 2022-10-27 06:26:39 +0300 Protesilaos Stavrou: Update minimum required Emacs version to 28.1 * b313dfc 2022-10-27 06:23:12 +0300 Protesilaos Stavrou: Update backlinks' buffer documentation in the manual * 9b6cf70 2022-10-27 06:16:01 +0300 Protesilaos Stavrou: Add wrapper motions for backlinks' buffer * f90f79f 2022-10-27 05:13:42 +0300 Protesilaos Stavrou: Make denote-link-fontify-backlinks obsolete * 3da08ea 2022-10-27 05:13:12 +0300 Protesilaos Stavrou: Reword denote-backlilnks-show-context docstring * d304d79 2022-10-27 05:11:27 +0300 Protesilaos Stavrou: Reword denote--retrieve-files-in-xrefs doc string * bdc94d3 2022-10-26 18:30:31 +0200 Noboru Ota: Add user option to use original backlinks buffer or with context * bbdcc49 2022-10-26 18:07:08 +0200 Noboru Ota: Fix 'denote-link-find-backlink' Please let me know if you are okay with them. The "wrapper motions" are an alternative approach to the "n" and "p" keys in the backlinks' buffer, so that we retain the old behaviour but otherwise keep all of the Xref functionality. My hesitation with the xref--xref-buffer-mode was exaggerated, as I noticed the double hyphens and thought they signified something we should not touch. But the way it is implemented suggests that the maintainers simply forgot to remove the extra dash: this code is reliable. Also, I think it is better to have something that "just works" than ask users to bind their own keys to the denote-backlilnks-mode-map. I believe the way I implemented those wrappers accommodates both the old backlinks' buffer and the new one with the added context. Please let me know if this is true on your end. About Emacs 27, I think it is better we avoid all those workarounds and just depend on Emacs 28. No-one reported the error which indicates that this new requirement should not pose any problems. With regard to the prettification of the backlinks' buffer, I decided to deprecate the denote-link-fontify-backlinks in order to avoid confusion caused by the presence of too many options: we just handle this internally when denote-backlinks-show-context is nil. The reason is that such an option only worked nicely in the generic backlinks' buffer, but caused subtle presentation problems in the Xref-capable buffer with the added context. I like the standard Xref style, as it clearly distinguishes file names from the context, while it also highlights the matching identifier (particularly useful for multiple matches). The other tweaks I made are stylistic (rewording phrases and the like). I believe I have not missed anything from the latest set of patches you sent. If I did, it was not intentional, and please tell me about it. All the best, Prot -- Protesilaos Stavrou https://protesilaos.com