Browse Source

Remember: Avoid error when before first headline in org file

Carsten Dominik 16 years ago
parent
commit
9fc88c0a0e
2 changed files with 6 additions and 1 deletions
  1. 5 0
      lisp/ChangeLog
  2. 1 1
      lisp/org.el

+ 5 - 0
lisp/ChangeLog

@@ -1,3 +1,8 @@
+2009-04-24  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org.el (org-store-link): No errors when getting custom id before
+	first headline.
+
 2009-04-23  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org.el (org-prepare-agenda-buffers): Catch a throw to nextfile.

+ 1 - 1
lisp/org.el

@@ -6949,7 +6949,7 @@ For file links, arg negates `org-context-in-file-links'."
 	    link (org-make-link cpltxt)))
 
      ((and buffer-file-name (org-mode-p))
-      (setq custom-id (org-entry-get nil "CUSTOM_ID"))
+      (setq custom-id (ignore-errors (org-entry-get nil "CUSTOM_ID")))
       (cond
        ((org-in-regexp "<<\\(.*?\\)>>")
 	(setq cpltxt