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

Patch by Bernt Hansen.
This commit is contained in:
Bastien Guerry 2009-08-03 02:58:41 +08:00
parent e05c4511af
commit 052f6e334d
2 changed files with 3 additions and 0 deletions

View File

@ -1,6 +1,7 @@
2009-08-02 Bastien Guerry <bzg@altern.org> 2009-08-02 Bastien Guerry <bzg@altern.org>
* org.el (org-adapt-indentation): Slightly improve the docstring. * 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 * org-exp.el (org-export-as-org): Use file-source.org format
instead of file.org-source. instead of file.org-source.

View File

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