emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] org-occur requires a non-empty regexp for performance
@ 2009-08-02  0:51 Bernt Hansen
  2009-08-02 18:59 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Bernt Hansen @ 2009-08-02  0:51 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] org-occur requires a non-empty regexp for performance
  2009-08-02  0:51 [PATCH] org-occur requires a non-empty regexp for performance Bernt Hansen
@ 2009-08-02 18:59 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2009-08-02 18:59 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: emacs-orgmode

Bernt Hansen <bernt@norang.ca> writes:

> 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

Applied, thanks!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-08-02 19:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-02  0:51 [PATCH] org-occur requires a non-empty regexp for performance Bernt Hansen
2009-08-02 18:59 ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).