diff options
author | 2020-11-15 14:10:39 -0800 | |
---|---|---|
committer | 2020-11-15 14:10:39 -0800 | |
commit | f6fb70894b663e8df795341696f198e22543ccfe (patch) | |
tree | defdf68b0f2a8731e549c2231be4e7e4c37f6289 /oni-org | |
parent | 690ec65a30bea59b77a4cec1c21814b077a04c13 (diff) | |
download | emacs-config-f6fb70894b663e8df795341696f198e22543ccfe.tar.gz emacs-config-f6fb70894b663e8df795341696f198e22543ccfe.zip |
Don’t use the ORIGIN property for back-links
A lot of the time when capturing some task my cursor is at a random location and
it doesn’t actually mean what I’m looking at is at all related to what I’m
writing.
I think this will make me occasionally miss certain connections, but usually
will provide less noise.
Diffstat (limited to 'oni-org')
-rw-r--r-- | oni-org/oni-org.el | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/oni-org/oni-org.el b/oni-org/oni-org.el index 9ac593b..d0ffd87 100644 --- a/oni-org/oni-org.el +++ b/oni-org/oni-org.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse <tom@ryuslash.org> ;; Keywords: local -;; Version: 2020.0921.230900 +;; Version: 2020.1115.140847 ;; Package-Requires: (oni-yasnippet oni-alert oni-hydra org-plus-contrib org-bullets org-edna diminish all-the-icons) ;; This program is free software; you can redistribute it and/or modify @@ -150,6 +150,14 @@ _l_: Store link ^^ _j_: Journal entry "^[ \t]*#\\+end" lim-up lim-down)))) +(defun oni-org-at-origin-property-p () + "Non-nil when point is in an origin property." + (save-match-data + (save-excursion + (goto-char (line-beginning-position)) + (and (looking-at org-property-re) + (string= (match-string 2) "ORIGIN"))))) + (defun oni-org-dblock-write-backlinks (_params) "Generate backlinks to org headings." (let ((current-heading (nth 4 (org-heading-components))) @@ -158,7 +166,8 @@ _l_: Store link ^^ _j_: Journal entry (save-excursion (goto-char (point-min)) (while (re-search-forward (rx-to-string `(and "*" ,current-heading "]")) nil t) - (unless (oni-org-in-dblock-p) + (unless (or (oni-org-in-dblock-p) + (oni-org-at-origin-property-p)) (push (nth 4 (org-heading-components)) backlinks)))) (when (not (null current-heading-id)) (save-excursion |