If a blank regexp is provided to org-occur the function
goes away for a l-o-n-g time.  We'll just bail out
instead up front to prevent an infinite loop.
---
I never actually let this run long enough to find out if
it is an infinite loop -- or if it just takes forever
to return results.  I'm not that patient.

This patch is available at git://git.norang.ca/org-mode.git for-carsten

-Bernt


 lisp/org.el |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 942be39..9410dee 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -10127,6 +10127,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)
-- 
1.6.2.rc1.1002.g6345



_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to