X-Git-Url: https://code.delx.au/gnu-emacs-elpa/blobdiff_plain/942850b99d7ea8c4c527ecdba60f09c6e7ca55fc..f10533854f4c7bb54247a11981191bf37b70cb36:/packages/gnorb/gnorb-utils.el diff --git a/packages/gnorb/gnorb-utils.el b/packages/gnorb/gnorb-utils.el index d7f5e8651..dcf289886 100644 --- a/packages/gnorb/gnorb-utils.el +++ b/packages/gnorb/gnorb-utils.el @@ -334,30 +334,33 @@ 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. -TYPES is a list of symbols, possible values include 'bbdb, 'mail, -and 'gnus." +TYPES is a list of symbols, possible values include `bbdb', `mail', +and `gnus'." ;; this function could be refactored somewhat -- lots of code ;; repetition. It also should be a little faster for when we're ;; scanning for gnus links only, that's a little slow. We should