aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2024-02-15 12:58:02 -0800
committerGravatar Tom Willemse2024-02-15 12:58:02 -0800
commit2011414821fb9175c4958bb247d0f1fc52b6fbfc (patch)
tree43e5dec7db45509300a8fca3b42a88aad1c58186
parent3d17ef6cb2cfe3c48e308d18e903001b94a236e7 (diff)
downloademacs-config-2011414821fb9175c4958bb247d0f1fc52b6fbfc.tar.gz
emacs-config-2011414821fb9175c4958bb247d0f1fc52b6fbfc.zip
[oni-org-roam] Show only the current element of a reference
-rw-r--r--oni-org-roam.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/oni-org-roam.el b/oni-org-roam.el
index e33b103..289da05 100644
--- a/oni-org-roam.el
+++ b/oni-org-roam.el
@@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
-;; Version: 2023.0805.233914
+;; Version: 2024.0212.234817
;; Package-Requires: (oni-org org-roam)
;; This program is free software; you can redistribute it and/or modify
@@ -101,6 +101,15 @@
(cons '(org-roam-backlinks-section :unique t)
(delete 'org-roam-backlinks-section org-roam-mode-sections)))
+;; Show only the current element, not the whole heading for the org-roam-buffer
+;; preview.
+(defun oni-org-roam-preview-element-function ()
+ (let ((element (org-element-at-point)))
+ (buffer-substring-no-properties (org-element-property :begin element)
+ (org-element-property :end element))))
+
+(setq org-roam-preview-function #'oni-org-roam-preview-element-function)
+
(org-roam-db-autosync-mode)
(provide 'oni-org-roam)