Re: [O] [RFC] Do not declare drawers to use them

2013-11-02 Thread Samuel Wales
I think these patches are increasing Org load time by orders of
magnitude.  Finding 7 files now takes a minute and a half.

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  ANYBODY can get it.

Denmark: free Karina Hansen NOW.



Re: [O] [RFC] Do not declare drawers to use them

2013-11-02 Thread Samuel Wales
Beforehand, I could find them in a second or two max.

On 11/2/13, Samuel Wales samolog...@gmail.com wrote:
 I think these patches are increasing Org load time by orders of
 magnitude.  Finding 7 files now takes a minute and a half.

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  ANYBODY can get it.

Denmark: free Karina Hansen NOW.



Re: [O] [RFC] Do not declare drawers to use them

2013-11-02 Thread Nicolas Goaziou
Hello,

Samuel Wales samolog...@gmail.com writes:

 Beforehand, I could find them in a second or two max.

 On 11/2/13, Samuel Wales samolog...@gmail.com wrote:
 I think these patches are increasing Org load time by orders of
 magnitude.  Finding 7 files now takes a minute and a half.

Interesting. Could you provide some profiling information?

Thank you.


Regards,

-- 
Nicolas Goaziou



Re: [O] [RFC] Do not declare drawers to use them

2013-11-02 Thread Samuel Wales
It is the difference between instantaneous and more than 10 seconds
per Org file.

If you tell me the symbols to elp profile, I will do so.  I can't do
the polling profiler.

On 11/2/13, Nicolas Goaziou n.goaz...@gmail.com wrote:
 Hello,

 Samuel Wales samolog...@gmail.com writes:

 Beforehand, I could find them in a second or two max.

 On 11/2/13, Samuel Wales samolog...@gmail.com wrote:
 I think these patches are increasing Org load time by orders of
 magnitude.  Finding 7 files now takes a minute and a half.

 Interesting. Could you provide some profiling information?

 Thank you.


 Regards,

 --
 Nicolas Goaziou



-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  ANYBODY can get it.

Denmark: free Karina Hansen NOW.



Re: [O] [RFC] Do not declare drawers to use them

2013-11-02 Thread Nicolas Goaziou
Hello,

Samuel Wales samolog...@gmail.com writes:

 It is the difference between instantaneous and more than 10 seconds
 per Org file.

 If you tell me the symbols to elp profile, I will do so.  I can't do
 the polling profiler.

Instrumenting package org would be useful.


Regards,

-- 
Nicolas Goaziou



Re: [O] [RFC] Do not declare drawers to use them

2013-11-02 Thread Samuel Wales
Instrumenting package org is not an option.

On 11/2/13, Nicolas Goaziou n.goaz...@gmail.com wrote:
 Hello,

 Samuel Wales samolog...@gmail.com writes:

 It is the difference between instantaneous and more than 10 seconds
 per Org file.

 If you tell me the symbols to elp profile, I will do so.  I can't do
 the polling profiler.

 Instrumenting package org would be useful.


 Regards,

 --
 Nicolas Goaziou



-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  ANYBODY can get it.

Denmark: free Karina Hansen NOW.



Re: [O] [RFC] Do not declare drawers to use them

2013-11-02 Thread Nicolas Goaziou
Samuel Wales samolog...@gmail.com writes:

 Instrumenting package org is not an option.

Hmmm. Could you send me an example file then? You can replace
[a-zA-Z0-9] with x if needed.


Regards,

-- 
Nicolas Goaziou



Re: [O] [RFC] Do not declare drawers to use them

2013-10-31 Thread Nicolas Goaziou
Hello,

Carsten Dominik carsten.domi...@gmail.com writes:

 On 21.10.2013, at 12:03, Nicolas Goaziou n.goaz...@gmail.com wrote:

 Hello,
 
 Carsten Dominik carsten.domi...@gmail.com writes:
 
 I think one objection agains this patch is that, I think, MobileOrg
 relies on #+DRAWERS lines to be present to define drawers.
 
 The patch also contains org-mobile.el modifications.
 
 Maybe the MobileOrg maintainers for both Android and iOS can chime in
 here?
 
 Obviously, a double check cannot hurt.
 
 Otherwise I don't have a significant objection against this change.
 I am wondering if it is going to introduce spurious drawers and
 parsing errors if someone happens to have a string :xxx: on a line by
 itself in the buffer. This might be unlikely, but I am not really
 sure.
 
 Actually, as far as the parser goes, :xxx: is insufficient to define
 a drawer. Indeed, the drawer has to be complete, i.e. it has to contain
 the :END: part.
 
 An incomplete drawer does not trigger a parsing error: it is parsed as
 a mere paragraph.

 OK, sounds good to me, then.

Applied.


Regards,

-- 
Nicolas Goaziou



Re: [O] [RFC] Do not declare drawers to use them

2013-10-23 Thread Nicolas Goaziou
Hello,

Achim Gratz strom...@nexgo.de writes:

 I suggest that completion should still look at configured drawer
 names.

Since the patch removes DRAWER keyword, there is no place left to
configure drawer names.

Using DRAWER keyword only for completion would be confusing, because it
would then behave very differently from similar keywords, e.g. TAGS.

Another option would be to collect drawer names already used throughout
the buffer and offer it as a completion basis. It should be reasonably
fast once parser cache is implemented.


Regards,

-- 
Nicolas Goaziou



Re: [O] [RFC] Do not declare drawers to use them

2013-10-21 Thread Nicolas Goaziou
Hello,

Carsten Dominik carsten.domi...@gmail.com writes:

 I think one objection agains this patch is that, I think, MobileOrg
 relies on #+DRAWERS lines to be present to define drawers.

The patch also contains org-mobile.el modifications.

 Maybe the MobileOrg maintainers for both Android and iOS can chime in
 here?

Obviously, a double check cannot hurt.

 Otherwise I don't have a significant objection against this change.
 I am wondering if it is going to introduce spurious drawers and
 parsing errors if someone happens to have a string :xxx: on a line by
 itself in the buffer. This might be unlikely, but I am not really
 sure.

Actually, as far as the parser goes, :xxx: is insufficient to define
a drawer. Indeed, the drawer has to be complete, i.e. it has to contain
the :END: part.

An incomplete drawer does not trigger a parsing error: it is parsed as
a mere paragraph.


Regards,

-- 
Nicolas Goaziou



Re: [O] [RFC] Do not declare drawers to use them

2013-10-21 Thread Carsten Dominik

On 21.10.2013, at 12:03, Nicolas Goaziou n.goaz...@gmail.com wrote:

 Hello,
 
 Carsten Dominik carsten.domi...@gmail.com writes:
 
 I think one objection agains this patch is that, I think, MobileOrg
 relies on #+DRAWERS lines to be present to define drawers.
 
 The patch also contains org-mobile.el modifications.
 
 Maybe the MobileOrg maintainers for both Android and iOS can chime in
 here?
 
 Obviously, a double check cannot hurt.
 
 Otherwise I don't have a significant objection against this change.
 I am wondering if it is going to introduce spurious drawers and
 parsing errors if someone happens to have a string :xxx: on a line by
 itself in the buffer. This might be unlikely, but I am not really
 sure.
 
 Actually, as far as the parser goes, :xxx: is insufficient to define
 a drawer. Indeed, the drawer has to be complete, i.e. it has to contain
 the :END: part.
 
 An incomplete drawer does not trigger a parsing error: it is parsed as
 a mere paragraph.

OK, sounds good to me, then.

- Carsten

 
 
 Regards,
 
 -- 
 Nicolas Goaziou




Re: [O] [RFC] Do not declare drawers to use them

2013-10-21 Thread Achim Gratz
Nicolas Goaziou writes:
 At the moment, in order to use a drawer, one has to declare its name
 through `org-drawers' variable or DRAWERS keyword first.

 I'd like to simplify a bit the process and let the user create drawers
 on the fly instead. A valid name includes any word constituent, hyphen
 and underscore characters. Case isn't significant.

That would be very welcome.

 It also cleans the internals (i.e. some dynamically scoped variables are
 removed) and makes syntax more portable. But we lose completion for
 drawer names.

I suggest that completion should still look at configured drawer names.


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

SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada




[O] [RFC] Do not declare drawers to use them

2013-10-20 Thread Nicolas Goaziou
Hello,

At the moment, in order to use a drawer, one has to declare its name
through `org-drawers' variable or DRAWERS keyword first.

I'd like to simplify a bit the process and let the user create drawers
on the fly instead. A valid name includes any word constituent, hyphen
and underscore characters. Case isn't significant.

It also cleans the internals (i.e. some dynamically scoped variables are
removed) and makes syntax more portable. But we lose completion for
drawer names.

This patch is backward compatible, as long as previously user-defined
drawers didn't include forbidden characters within their names.

WDYT?


Regards,

-- 
Nicolas Goaziou
From 8a2dad690caec96e6daf86097ff0cb062ac348f8 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou n.goaz...@gmail.com
Date: Sun, 20 Oct 2013 14:40:09 +0200
Subject: [PATCH] Remove need to declare drawers before using them

* lisp/org-agenda.el (org-agenda-prepare): Remove reference to
  `org-drawers-for-agenda'.
(org-agenda-show-1): Remove reference to `org-drawers'.
* lisp/org-clock.el (org-clock-remove-empty-clock-drawer,
  org-clock-cancel): Apply signature change to
  `org-remove-empty-drawer-at'.
* lisp/org-element.el (org-element--list-struct): Use
  `org-drawer-regexp' instead of `org-drawers'.
* lisp/org-feed.el (org-feed-drawer): Update docstring according to
  change.
* lisp/org-list.el (org-in-item-p, org-list-context): Use
  `org-drawer-regexp' instead of `org-drawers'.
* lisp/org-mobile.el (org-mobile-create-index-file): Remove reference
  to `org-drawers-for-agenda'.
* lisp/org-pcomplete.el (pcomplete/org-mode/drawer): Remove function.
* lisp/org.el (org-drawer-regexp): Make variable global.
(org-drawers): Remove variable.
(org-set-regexps-and-options): Ignore DRAWER keyword.
(org-cycle): Use `org-drawer-regexp' instead of `org-drawers'.
(org-cycle-hide-drawers): Add an optional argument to ignore some
drawers.
(org-remove-empty-drawer-at): Remove second argument.  Rewrite
function.
(org-clone-subtree-with-time-shift): Apply signature change to
`org-remove-empty-drawer-at'.
(org-toggle-ordered-property): Apply `org-delete-property' signature
change.
(org-map-entries): Remove reference to `org-drawers-for-agenda'.
(org-entry-delete): Remove optional argument.  Small refactoring.
(org-insert-drawer): Remove reference to `org-drawers'.
(org-delete-property): Apply `org-entry-delete' signature change.
(org-in-drawer-p): Rewrite function.
* testing/lisp/test-org-element.el: Update tests.
* testing/lisp/test-org.el: Update tests.
* testing/lisp/test-ox.el: Update tests.
---
 lisp/org-agenda.el   |  15 ++---
 lisp/org-clock.el|   6 +-
 lisp/org-element.el  |   5 +-
 lisp/org-feed.el |   5 +-
 lisp/org-list.el |  25 ++-
 lisp/org-mobile.el   |   4 +-
 lisp/org-pcomplete.el|  19 --
 lisp/org.el  | 141 ++-
 testing/lisp/test-org-element.el |  57 ++--
 testing/lisp/test-org.el |  22 +++---
 testing/lisp/test-ox.el  |  28 
 11 files changed, 109 insertions(+), 218 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 0bfba27..fe4c2d4 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -3642,7 +3642,6 @@ generating a new one.
 	(or org-agenda-multi (org-agenda-fit-window-to-buffer))
 	(throw 'exit Sticky Agenda buffer, use `r' to refresh))
 (setq org-todo-keywords-for-agenda nil)
-(setq org-drawers-for-agenda nil)
 (unless org-agenda-persistent-filter
   (setq org-agenda-tag-filter nil
 	org-agenda-category-filter nil
@@ -3682,7 +3681,6 @@ generating a new one.
 	(org-uniquify org-todo-keywords-for-agenda))
   (setq org-done-keywords-for-agenda
 	(org-uniquify org-done-keywords-for-agenda))
-  (setq org-drawers-for-agenda (org-uniquify org-drawers-for-agenda))
   (setq org-agenda-last-prefix-arg current-prefix-arg)
   (setq org-agenda-this-buffer-name org-agenda-buffer-name)
   (and name (not org-agenda-name)
@@ -8627,15 +8625,10 @@ if it was hidden in the outline.
 	(run-hook-with-args 'org-cycle-hook 'subtree))
   (message Remote: SUBTREE))
  ((= more 4)
-  (let* ((org-drawers (delete LOGBOOK (copy-sequence org-drawers)))
-	 (org-drawer-regexp
-	  (concat ^[ \t]*:\\(
-		  (mapconcat 'regexp-quote org-drawers \\|)
-		  \\):[ \t]*$)))
-	(show-subtree)
-	(save-excursion
-	  (org-back-to-heading)
-	  (org-cycle-hide-drawers 'subtree)))
+  (show-subtree)
+  (save-excursion
+	(org-back-to-heading)
+	(org-cycle-hide-drawers 'subtree '(LOGBOOK)))
   (message Remote: SUBTREE AND LOGBOOK))
  (( more 4)
   (show-subtree)
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 3195dc1..1cdbdc1 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1589,7 +1589,7 @@ to, overriding the existing value of `org-clock-out-switch-to-state'.
 	(while (and ( 

Re: [O] [RFC] Do not declare drawers to use them

2013-10-20 Thread Carsten Dominik
Hello Nicolas,

I think one objection agains this patch is that, I think, MobileOrg relies on 
#+DRAWERS lines to be present to define drawers.  Maybe the MobileOrg 
maintainers for both Android and iOS can chime in here?

Otherwise I don't have a significant objection against this change.
I am wondering if it is going to introduce spurious drawers and parsing errors 
if someone happens to have a string :xxx: on a line by itself in the buffer.  
This might be unlikely, but I am not really sure.
Comments?

- Carsten

On 20.10.2013, at 15:38, Nicolas Goaziou n.goaz...@gmail.com wrote:

 Hello,
 
 At the moment, in order to use a drawer, one has to declare its name
 through `org-drawers' variable or DRAWERS keyword first.
 
 I'd like to simplify a bit the process and let the user create drawers
 on the fly instead. A valid name includes any word constituent, hyphen
 and underscore characters. Case isn't significant.
 
 It also cleans the internals (i.e. some dynamically scoped variables are
 removed) and makes syntax more portable. But we lose completion for
 drawer names.
 
 This patch is backward compatible, as long as previously user-defined
 drawers didn't include forbidden characters within their names.
 
 WDYT?
 
 
 Regards,
 
 -- 
 Nicolas Goaziou
 0001-Remove-need-to-declare-drawers-before-using-them.patch