Re: [O] Regex Speedup for org-refresh-category-properties.

2014-07-30 Thread Achim Gratz
Malcolm Purvis malcolm at purvis.id.au writes:
 Thanks.  Things are just as fast with this regexp.

Thanks for the confirmation.



Regards,
Achim.





Re: [O] Regex Speedup for org-refresh-category-properties.

2014-07-29 Thread Bastien
Hi Malcolm,

Malcolm Purvis malc...@purvis.id.au writes:

 I use the master version of org, and some months ago the time required
 to generate my custom agenda view sky rocketed.  I've found that 90% of
 the time was being spent in the call to re-search-forward in
 org-refresh-category-properties.  The patch below speeds up the regular
 expression search and makes the generation of my agenda as fast as
 before.

Applied, thanks!

-- 
 Bastien



Re: [O] Regex Speedup for org-refresh-category-properties.

2014-07-29 Thread Nick Dokos
Malcolm Purvis malc...@purvis.id.au writes:

 I use the master version of org, and some months ago the time required
 to generate my custom agenda view sky rocketed.  I've found that 90% of
 the time was being spent in the call to re-search-forward in
 org-refresh-category-properties.  The patch below speeds up the regular
 expression search and makes the generation of my agenda as fast as
 before.

 Malcolm

 diff --git a/lisp/org.el b/lisp/org.el
 index 7e30061..2fc6854 100644
 --- a/lisp/org.el
 +++ b/lisp/org.el
 @@ -9474,7 +9474,7 @@ The refresh happens only for the current tree (not 
 subtree).
(goto-char (point-min))
(put-text-property (point) (point-max) 'org-category def-cat)
(while (re-search-forward
 -  ^[ \t]*\\(#\\+CATEGORY:\\|[ \t]*:CATEGORY:\\)\\(.*\\) nil t)
 +  ^[ \t]*\\(#\\+CATEGORY:\\|*:CATEGORY:\\)\\(.*\\) nil t)
^
^
   What does the asterisk do?

Can you explain what this regexp is supposed to match?

Thanks,
Nick





Re: [O] Regex Speedup for org-refresh-category-properties.

2014-07-29 Thread Bastien
Hi Nick,

Nick Dokos ndo...@gmail.com writes:

What does the asterisk do?

I think this is simply a code typo, fixed in master.

-- 
 Bastien



Re: [O] Regex Speedup for org-refresh-category-properties.

2014-07-29 Thread Achim Gratz
Malcolm Purvis writes:
 I use the master version of org, and some months ago the time required
 to generate my custom agenda view sky rocketed.  I've found that 90% of
 the time was being spent in the call to re-search-forward in
 org-refresh-category-properties.  The patch below speeds up the regular
 expression search and makes the generation of my agenda as fast as
 before.

I agree that this is faster, but it doesn't look right.  Specifically I
don't think you are matching CATEGORY drawers any longer.

 -  ^[ \t]*\\(#\\+CATEGORY:\\|[ \t]*:CATEGORY:\\)\\(.*\\) nil t)
 +  ^[ \t]*\\(#\\+CATEGORY:\\|*:CATEGORY:\\)\\(.*\\) nil t)

I think that ^[ \t]*\\(\\(?:#\\+\\|:\\)CATEGORY:\\)\\(.*\\) would be a
better regex, assuming that the original regex was doing the right thing.


Regards,
Achim.
-- 
+[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+

SD adaptation for Waldorf Blofeld V1.15B11:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada




Re: [O] Regex Speedup for org-refresh-category-properties.

2014-07-29 Thread Bastien
Achim Gratz strom...@nexgo.de writes:

 I think that ^[ \t]*\\(\\(?:#\\+\\|:\\)CATEGORY:\\)\\(.*\\) would be a
 better regex, assuming that the original regex was doing the right thing.

Applied, thanks,

-- 
 Bastien



Re: [O] Regex Speedup for org-refresh-category-properties.

2014-07-29 Thread Malcolm Purvis
 Achim == Achim Gratz strom...@nexgo.de writes:

Achim I think that ^[ \t]*\\(\\(?:#\\+\\|:\\)CATEGORY:\\)\\(.*\\)
Achim would be a better regex, assuming that the original regex was
Achim doing the right thing.

Thanks.  Things are just as fast with this regexp.

Malcolm

-- 
   Malcolm Purvis malc...@purvis.id.au



[O] Regex Speedup for org-refresh-category-properties.

2014-07-28 Thread Malcolm Purvis

I use the master version of org, and some months ago the time required
to generate my custom agenda view sky rocketed.  I've found that 90% of
the time was being spent in the call to re-search-forward in
org-refresh-category-properties.  The patch below speeds up the regular
expression search and makes the generation of my agenda as fast as
before.

Malcolm

diff --git a/lisp/org.el b/lisp/org.el
index 7e30061..2fc6854 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -9474,7 +9474,7 @@ The refresh happens only for the current tree (not 
subtree).
 (goto-char (point-min))
 (put-text-property (point) (point-max) 'org-category def-cat)
 (while (re-search-forward
-^[ \t]*\\(#\\+CATEGORY:\\|[ \t]*:CATEGORY:\\)\\(.*\\) nil t)
+^[ \t]*\\(#\\+CATEGORY:\\|*:CATEGORY:\\)\\(.*\\) nil t)
   (setq pos (match-end 0)
 optionp (equal (char-after (match-beginning 0)) ?#)
 cat (org-trim (match-string 2)))

-- 
   Malcolm Purvis malc...@purvis.id.au