]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/gnorb/gnorb-utils.el
Merge commit '37c46180280f10fa5120a017acd04f7022d124e4'
[gnu-emacs-elpa] / packages / gnorb / gnorb-utils.el
index d7f5e8651f28a73cbb2dc6277b0716e5cea8a92f..4d473f17f0c7ea31b9bdc48678b630ac5816692b 100644 (file)
@@ -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.