Authentication-Results: mail-b.sr.ht; dkim=none Received: from outbound.soverin.net (outbound.soverin.net [185.233.34.20]) by mail-b.sr.ht (Postfix) with ESMTPS id 13CF811EE06 for <~protesilaos/denote@lists.sr.ht>; Wed, 26 Oct 2022 17:25:41 +0000 (UTC) Received: from smtp.soverin.net (c04smtp-lb01.int.sover.in [10.10.4.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id 4MyG102G7fz6r; Wed, 26 Oct 2022 17:25:40 +0000 (UTC) Received: from smtp.soverin.net (smtp.soverin.net [10.10.4.99]) by soverin.net (Postfix) with ESMTPSA id 4MyG0z6kh6zKf; Wed, 26 Oct 2022 17:25:39 +0000 (UTC) X-Soverin-Authenticated: true From: Noboru Ota To: ~protesilaos/denote@lists.sr.ht Cc: Protesilaos Stavrou Subject: Re: [PATCH] Display context of identifier in backlinks buffer with xref In-Reply-To: <87o7tzl1zv.fsf@protesilaos.com> Date: Wed, 26 Oct 2022 19:25:39 +0200 Message-ID: <86tu3qwl7w.fsf@nobiot.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Two more patches attached, addressing your comments 2 and 4. I will look into your comment 3 about Emacs version 27.2 later. I don't think it will be today, but hopefully soon. Thanks. nobiot --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0003-Revert-denote-backlinks-mode-to-derive-from-special-.patch Content-Description: Patch 3 From 2ec435921001fbdab67c69a9d0fceae78e16877d Mon Sep 17 00:00:00 2001 From: Noboru Ota Date: Wed, 26 Oct 2022 19:13:54 +0200 Subject: [PATCH 1/2] Revert 'denote-backlinks-mode' to derive from special-mode Based on conversation in https://lists.sr.ht/~protesilaos/denote/%3C86r0yvzm12.fsf%40nobiot.com%3E With this change, it is suggested that following keybindings be listed in the user manual when user option 'denote-backlilnks-show-context' is on: (define-key denote-backlinks-mode-map (kbd "N") #'xref-next-group) (define-key denote-backlinks-mode-map (kbd "P") #'xref-prev-group) (define-key denote-backlinks-mode-map (kbd "n") #'xref-next-line) (define-key denote-backlinks-mode-map (kbd "p") #'xref-prev-line) (define-key denote-backlinks-mode-map (kbd "r") #'xref-query-replace-in-results) (define-key denote-backlinks-mode-map (kbd "RET") #'xref-goto-xref) (define-key denote-backlinks-mode-map (kbd "TAB") #'xref-quit-and-goto-xref) (define-key denote-backlinks-mode-map (kbd "C-o") #'xref-show-location-at-point) (define-key denote-backlinks-mode-map (kbd ".") #'xref-next-line) (define-key denote-backlinks-mode-map (kbd ",") #'xref-prev-line) (define-key denote-backlinks-mode-map (kbd "M-,") #'xref-quit-and-pop-marker-stack) * denote.el (denote-backlinks-mode-map): Revert part of commit fcefc1d; the mode-map is back to use 'forward/back-button' functions. Keep "g" mapped to 'revert-buffer'. (denote-backlinks-mode): Revert part of commit fcefc1d; now the mode derives directly from 'special-mode' --- denote.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/denote.el b/denote.el index e53863b..d633233 100644 --- a/denote.el +++ b/denote.el @@ -2606,13 +2606,15 @@ Expand `denote-link-backlinks-display-buffer-action'." (defvar denote-backlinks-mode-map (let ((m (make-sparse-keymap))) + (define-key m (kbd "n") #'forward-button) + (define-key m (kbd "p") #'backward-button) (define-key m "g" #'revert-buffer) m) "Keymap for `denote-backlinks-mode'.") (make-obsolete-variable 'denote-backlink-mode-map 'denote-backlinks-mode-map "0.6.0") -(define-derived-mode denote-backlinks-mode xref--xref-buffer-mode "Backlinks" +(define-derived-mode denote-backlinks-mode special-mode "Backlinks" "Major mode for backlinks buffers." (when denote-link-fontify-backlinks (font-lock-add-keywords nil denote-faces-file-name-keywords-for-backlinks t))) -- 2.34.1 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0004-Add-extra-space-in-backlinks-buffer-for-context.patch Content-Description: Patch 4 From f5fb6258e20159ba7545b490005b5004f78df190 Mon Sep 17 00:00:00 2001 From: Noboru Ota Date: Wed, 26 Oct 2022 19:16:44 +0200 Subject: [PATCH 2/2] Add extra space in backlinks buffer for context --- denote.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/denote.el b/denote.el index d633233..89d82cd 100644 --- a/denote.el +++ b/denote.el @@ -2690,13 +2690,13 @@ built-in function `xref--insert-xrefs'." (when (and (equal prev-group group) (or (null line) (not (equal prev-line line)))) - (insert "\n")) + (insert "\n\n")) (xref--insert-propertized (nconc (list 'xref-item xref) item-text-props) prefix summary) (setq prev-line line prev-group group)))) - (insert "\n")) + (insert "\n\n")) (add-to-invisibility-spec '(ellipsis . t)) (save-excursion (goto-char (point-min)) -- 2.34.1 --=-=-=--