(minor)db: make check for property drawers case-insensitive (#1949)

master
Jethro Kuan 4 years ago committed by GitHub
parent 36928d655a
commit d26047e6f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      org-roam-db.el
  2. 7
      org-roam-utils.el

@ -344,7 +344,7 @@ If UPDATE-P is non-nil, first remove the file in the database."
(setq link element))
;; Prevent self-referencing links in ROAM_REFS
((and (eq type 'node-property)
(string-equal (org-element-property :key element) "ROAM_REFS"))
(org-roam-string-equal (org-element-property :key element) "ROAM_REFS"))
nil)
;; Links in property drawers and lines starting with #+. Recall that, as for Org Mode v9.4.4, the
;; org-element-type of links within properties drawers is "node-property" and for lines starting with

@ -52,6 +52,13 @@
(org-roam-replace-string "\\" "\\\\")
(org-roam-replace-string "\"" "\\\"")))
(defun org-roam-string-equal (s1 s2)
"Return t if S1 and S2 are equal.
Like `string-equal', but case-insensitive."
(and (= (length s1) (length s2))
(or (string-equal s1 s2)
(string-equal (downcase s1) (downcase s2)))))
;;; List utilities
(defmacro org-roam-plist-map! (fn plist)
"Map FN over PLIST, modifying it in-place."

Loading…
Cancel
Save