[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] [PATCH] org-occur requires a non-empty regexp for performance

From: Bernt Hansen
Subject: [Orgmode] [PATCH] org-occur requires a non-empty regexp for performance
Date: Sat, 01 Aug 2009 20:51:37 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

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


 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)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]