Fix `org-find-entry-with-id'
* lisp/org.el (org-find-entry-with-id): Ignore false positive ID properties when looking for a specific ID.
This commit is contained in:
parent
269b680900
commit
8cdb2eef0f
15
lisp/org.el
15
lisp/org.el
|
@ -16430,19 +16430,10 @@ Return the position where this entry starts, or nil if there is no such entry."
|
||||||
(interactive "sID: ")
|
(interactive "sID: ")
|
||||||
(let ((id (cond
|
(let ((id (cond
|
||||||
((stringp ident) ident)
|
((stringp ident) ident)
|
||||||
((symbol-name ident) (symbol-name ident))
|
((symbolp ident) (symbol-name ident))
|
||||||
((numberp ident) (number-to-string ident))
|
((numberp ident) (number-to-string ident))
|
||||||
(t (error "IDENT %s must be a string, symbol or number" ident))))
|
(t (error "IDENT %s must be a string, symbol or number" ident)))))
|
||||||
(case-fold-search nil))
|
(org-with-wide-buffer (org-find-property "ID" id))))
|
||||||
(save-excursion
|
|
||||||
(save-restriction
|
|
||||||
(widen)
|
|
||||||
(goto-char (point-min))
|
|
||||||
(when (re-search-forward
|
|
||||||
(concat "^[ \t]*:ID:[ \t]+" (regexp-quote id) "[ \t]*$")
|
|
||||||
nil t)
|
|
||||||
(org-back-to-heading t)
|
|
||||||
(point))))))
|
|
||||||
|
|
||||||
;;;; Timestamps
|
;;;; Timestamps
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue