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

This commit is contained in:
Jethro Kuan
2021-11-07 22:29:17 +08:00
committed by GitHub
parent 36928d655a
commit d26047e6f7
2 changed files with 8 additions and 1 deletions

View File

@ -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

View File

@ -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."