Browse Source

(org-occur): Sends an error when the user inputs an empty string.

Patch by Bernt Hansen.
Bastien Guerry 15 years ago
parent
commit
052f6e334d
2 changed files with 3 additions and 0 deletions
  1. 1 0
      lisp/ChangeLog
  2. 2 0
      lisp/org.el

+ 1 - 0
lisp/ChangeLog

@@ -1,6 +1,7 @@
 2009-08-02  Bastien Guerry  <bzg@altern.org>
 
 	* org.el (org-adapt-indentation): Slightly improve the docstring.
+	(org-occur): Sends an error when the user inputs an empty string.
 
 	* org-exp.el (org-export-as-org): Use file-source.org format
 	instead of file.org-source.

+ 2 - 0
lisp/org.el

@@ -10138,6 +10138,8 @@ command.
 If CALLBACK is non-nil, it is a function which is called to confirm
 that the match should indeed be shown."
   (interactive "sRegexp: \nP")
+  (when (equal regexp "")
+    (error "Regexp cannot be empty"))
   (unless keep-previous
     (org-remove-occur-highlights nil nil t))
   (push (cons regexp callback) org-occur-parameters)