2 Commits

Author SHA1 Message Date
  Nicolas Petton ca401e4872
* nroam.el: Remove a double space 1 month ago
  Nicolas Petton 00506d08ed
Minor refactoring 1 month ago
1 changed files with 7 additions and 7 deletions
Split View
  1. +7

+ 7
- 7
nroam.el View File

@ -1,6 +1,6 @@
;;; nroam.el --- Org-roam backlinks within org-mode buffers -*- lexical-binding: t; -*-
;; Copyright (C) 2021 Nicolas Petton
;; Copyright (C) 2021 Nicolas Petton
;; Author: Nicolas Petton <nicolas@petton.fr>
;; URL: https://github.com/NicolasPetton/nroam
@ -233,20 +233,20 @@ Make the region inserted by BODY read-only, and marked with
(defun nroam--insert-source-content (backlink)
"Insert the source element where BACKLINK is defined."
(seq-let (from _ props) backlink
(when-let* ((backlink-point (plist-get props :point))
(elt (nroam--crawl-source from backlink-point))
(seq-let (file _ props) backlink
(when-let* ((point (plist-get props :point))
(elt (nroam--crawl-source file point))
(type (car elt))
(content (string-trim (cdr elt)))
(beg (point)))
(pcase type
('headline (progn
(org-paste-subtree 3 (nroam--fix-links content from))
(org-paste-subtree 3 (nroam--fix-links content file))
(goto-char (point-max))))
(_ (insert (nroam--fix-links content from))))
(_ (insert (nroam--fix-links content file))))
(set-text-properties beg (point)
`(nroam-link t file ,from point ,backlink-point))
`(nroam-link t file ,file point ,point))
(insert "\n")))))
(defun nroam--crawl-source (file point)