From 2011414821fb9175c4958bb247d0f1fc52b6fbfc Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 15 Feb 2024 12:58:02 -0800 Subject: [oni-org-roam] Show only the current element of a reference --- oni-org-roam.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 ;; 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) -- cgit v1.2.3-54-g00ecf