Fix export of links to attachments (part 2)

* lisp/org.el (org-entry-get): Widen buffer in order to retrieve
  a property, as both `org-entry-properties' and
  `org-entry-get-with-inheritance' already do.
This commit is contained in:
Nicolas Goaziou 2013-11-22 12:39:15 +01:00
parent 0a4d192b79
commit 5ae3a25755
1 changed files with 25 additions and 23 deletions

View File

@ -15362,30 +15362,32 @@ when a \"nil\" value can supersede a non-nil value higher up the hierarchy."
t)) t))
(org-entry-get-with-inheritance property literal-nil) (org-entry-get-with-inheritance property literal-nil)
(if (member property org-special-properties) (if (member property org-special-properties)
;; We need a special property. Use `org-entry-properties' to ;; We need a special property. Use `org-entry-properties'
;; retrieve it, but specify the wanted property ;; to retrieve it, but specify the wanted property
(cdr (assoc property (org-entry-properties nil 'special property))) (cdr (assoc property (org-entry-properties nil 'special property)))
(let ((range (org-get-property-block))) (org-with-wide-buffer
(when (and range (not (eq (car range) (cdr range)))) (let ((range (org-get-property-block)))
(let* ((props (list (or (assoc property org-file-properties) (when (and range (not (eq (car range) (cdr range))))
(assoc property org-global-properties) (let* ((props
(assoc property org-global-properties-fixed)))) (list (or (assoc property org-file-properties)
(ap (lambda (key) (assoc property org-global-properties)
(when (re-search-forward (assoc property org-global-properties-fixed))))
(org-re-property key) (cdr range) t) (ap (lambda (key)
(setq props (when (re-search-forward
(org-update-property-plist (org-re-property key) (cdr range) t)
key (setq props
(if (match-end 3) (org-update-property-plist
(org-match-string-no-properties 3) "") key
props))))) (if (match-end 3)
val) (org-match-string-no-properties 3) "")
(goto-char (car range)) props)))))
(funcall ap property) val)
(goto-char (car range)) (goto-char (car range))
(while (funcall ap (concat property "+"))) (funcall ap property)
(setq val (cdr (assoc property props))) (goto-char (car range))
(when val (if literal-nil val (org-not-nil val)))))))))) (while (funcall ap (concat property "+")))
(setq val (cdr (assoc property props)))
(when val (if literal-nil val (org-not-nil val)))))))))))
(defun org-property-or-variable-value (var &optional inherit) (defun org-property-or-variable-value (var &optional inherit)
"Check if there is a property fixing the value of VAR. "Check if there is a property fixing the value of VAR.