ob-ref: don't let org-id rescan all IDs when trying to resolve a reference

* lisp/ob-ref.el (org-babel-ref-goto-headline-id): Don't let org-id
  rescan all IDs when trying to resolve a reference.
This commit is contained in:
Eric Schulte 2011-07-01 12:09:34 -07:00
parent 549a521256
commit 0b6eb6de3c
1 changed files with 9 additions and 1 deletions

View File

@ -87,7 +87,15 @@ the variable."
(let ((rx (regexp-quote id)))
(or (re-search-forward
(concat "^[ \t]*:CUSTOM_ID:[ \t]+" rx "[ \t]*$") nil t)
(condition-case nil (progn (org-id-goto id) t) (error nil)))))
(let* ((file (org-id-find-id-file id))
(m (when file (org-id-find-id-in-file id file 'marker))))
(when (and file m)
(message "file:%S" file)
(switch-to-buffer (marker-buffer m))
(goto-char m)
(move-marker m nil)
(org-show-context)
t)))))
(defun org-babel-ref-headline-body ()
(save-restriction