Browse Source

Better error message when selecting empty link

Carsten Dominik 15 years ago
parent
commit
a50243cdc4
2 changed files with 5 additions and 0 deletions
  1. 3 0
      lisp/ChangeLog
  2. 2 0
      lisp/org.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-11-26  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org.el (org-insert-link): Improve error message when there is no
+	default link to select with RET.
+
 	* org-agenda.el (org-agenda-filter-by-tag): Use char argument from
 	parameter list.
 

+ 2 - 0
lisp/org.el

@@ -7926,6 +7926,8 @@ Use TAB to complete link prefixes, then RET for type-specific completion support
 		     nil nil nil
 		     'tmphist
 		     (car (car org-stored-links)))))
+	    (if (not (string-match "\\S-" link))
+		(error "No link selected"))
 	    (if (or (member link all-prefixes)
 		    (and (equal ":" (substring link -1))
 			 (member (substring link 0 -1) all-prefixes)