X-Git-Url: https://code.delx.au/gnu-emacs-elpa/blobdiff_plain/942850b99d7ea8c4c527ecdba60f09c6e7ca55fc..4b07f2cf9a93f14a7a322c7624f17ab5dbeaf6e2:/packages/gnorb/gnorb-utils.el diff --git a/packages/gnorb/gnorb-utils.el b/packages/gnorb/gnorb-utils.el index d7f5e8651..4d473f17f 100644 --- a/packages/gnorb/gnorb-utils.el +++ b/packages/gnorb/gnorb-utils.el @@ -334,24 +334,27 @@ agenda. Then let the user choose an action from the value of "Return pretty outline path of the Org heading indicated by ID. If the KW argument is true, add the TODO keyword into the path." - (org-with-point-at (org-id-find id t) - (let ((el (org-element-at-point))) - (concat - (if kw - (format "(%s): " - (org-element-property :todo-keyword el)) - "") - (org-format-outline-path - (append - (list - (file-name-nondirectory - (buffer-file-name - (org-base-buffer (current-buffer))))) - (org-get-outline-path) - (list - (replace-regexp-in-string - org-bracket-link-regexp - "\\3" (org-element-property :raw-value el))))))))) + (let ((pt (org-id-find id t))) + (if pt + (org-with-point-at pt + (let ((el (org-element-at-point))) + (concat + (if kw + (format "(%s): " + (org-element-property :todo-keyword el)) + "") + (org-format-outline-path + (append + (list + (file-name-nondirectory + (buffer-file-name + (org-base-buffer (current-buffer))))) + (org-get-outline-path) + (list + (replace-regexp-in-string + org-bracket-link-regexp + "\\3" (org-element-property :raw-value el)))))))) + "[none]"))) (defun gnorb-scan-links (bound &rest types) "Scan from point to BOUND looking for links of type in TYPES.