diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7d452ea08..0e3bef0be 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,6 +1,7 @@ 2009-08-02 Bastien Guerry * 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. diff --git a/lisp/org.el b/lisp/org.el index 222841e9a..ad87dedc1 100644 --- a/lisp/org.el +++ b/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)