Re: [O] [PATCH 0/5] loop over headlines in active region
Hi Carsten, At Thu, 6 Oct 2011 10:35:18 +0200, Carsten Dominik wrote: Hi David, I see that this patch is still on the patchwork server. What is the status, I remember that you dot a number of comments Started to make a list of Org's behavior with headlines when region is active but didn't make much progress. Besides that I'm waiting for some feedback by Bastien. Personally I think we can turn the state to Deferred -- I don't consider it of high importance. I gave up on using the functionallity in favour of Agenda's bulk operations and rescheduling/deadlining multiple items in the same buffer does not happen that often. Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de pgpuj8tHgyAds.pgp Description: PGP signature
Re: [O] [PATCH 0/5] loop over headlines in active region
Hi David, On 8.10.2011, at 20:59, David Maus wrote: Hi Carsten, At Thu, 6 Oct 2011 10:35:18 +0200, Carsten Dominik wrote: Hi David, I see that this patch is still on the patchwork server. What is the status, I remember that you dot a number of comments Started to make a list of Org's behavior with headlines when region is active but didn't make much progress. Besides that I'm waiting for some feedback by Bastien. Personally I think we can turn the state to Deferred -- I don't consider it of high importance. I gave up on using the functionallity in favour of Agenda's bulk operations and rescheduling/deadlining multiple items in the same buffer does not happen that often. OK, lets do that, I agree. I guess this applies to the whole batch, 910, 911, 925, 926? I have lost the overview a bit. Will you change the status? Cheers - Carsten Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de
Re: [O] [PATCH 0/5] loop over headlines in active region
At Sat, 8 Oct 2011 22:11:37 +0200, Carsten Dominik wrote: Hi David, On 8.10.2011, at 20:59, David Maus wrote: Hi Carsten, At Thu, 6 Oct 2011 10:35:18 +0200, Carsten Dominik wrote: Hi David, I see that this patch is still on the patchwork server. What is the status, I remember that you dot a number of comments Started to make a list of Org's behavior with headlines when region is active but didn't make much progress. Besides that I'm waiting for some feedback by Bastien. Personally I think we can turn the state to Deferred -- I don't consider it of high importance. I gave up on using the functionallity in favour of Agenda's bulk operations and rescheduling/deadlining multiple items in the same buffer does not happen that often. OK, lets do that, I agree. I guess this applies to the whole batch, 910, 911, 925, 926? I have lost the overview a bit. Will you change the status? Done. Any information about Bastien's absence? I remember he announce to be on vacation till Sep 5, but as far as I could see hasn't appeared to be be active on the list. Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de pgpgQwlr1JUFm.pgp Description: PGP signature
Re: [O] [PATCH 0/5] loop over headlines in active region
Hi David, I see that this patch is still on the patchwork server. What is the status, I remember that you dot a number of comments - Carsten On Aug 25, 2011, at 6:25 AM, David Maus wrote: Hi Bastien, Great -- can you submit a patch against current git head? Following 5 patches implement looping over headlines in active region for org-schedule and org-deadline. Invisible headlines are skipped and bulk-agenda commands work by binding the customization variable to nil before executing a command. I've been running with this modification for 2 weeks now, using the feature occassionally without a visibile problem. As for the macro: What stop me to implement a macro for the generic operation is that for now the macro would depend on the global customization variable. That's not a problem per se but according to my readings about macros (mostly in context of Common Lisp, but that shouldn't matter) it should be considered bad style. I did some experiments with defining an `org-map-entries' MATCH of 'current that causes FUNC to be applied to the current heading only, but I'm not sure if this would be a right thing (tm) to do. Best, -- David David Maus (5): Extend scope 'region to include body of last headline in active region Immediately return if scope is region but no region is active New customization variable: Loop over headlines in active region Skip invisible headlines when mapping over headlines in active region Avoid conflict between bulk command and loop-over-headlines - Carsten
Re: [O] [PATCH 0/5] loop over headlines in active region
On Fri, 09 Sep 2011 06:06:26 +0200 David Maus wrote: At Wed, 07 Sep 2011 21:34:41 +0200, Štěpán Němec wrote: So your what stop me to implement a macro argument is bogus, isn't it? I can't really comment on whether using a macro or not is the right thing here, but it seems to me you shouldn't base the decision on an invalid argument (IOW, from the fact that you even felt the need to explain why you didn't use a macro to begin with, it would appear to be the case that you would have preferred the macro way). One of the things Ford Prefect had always found hardest to understand about humans was their habit of continually stating and repeating the very very obvious, as in /It's a nice day/, or /You're very tall/, or /Oh dear you seem to have fallen down a thirty-foot well, are you all right?/ At first Ford had formed a theory to account for this strange behavior. If human beings don't keep exercising their lips, he thought, their mouths probably seize up. After a few months' consideration and observation he abandoned this theory in favor of a new one. If they don't keep on exercising their lips, he thought, their brains start working. After a while he abandoned this one as well as being obstructively cynical and decided he quite liked human beings after all, but he always remained desperately worried about the terrible number of things they didn't know about. Douglas Adams, The Hitchiker's Guide to the Galaxy In your enlightened style, that would be “曰:‘四境之內不治則如之何?’王顧左右而言他。” 《孟子·梁惠王下》 Still, I'd rather we stuck to the point and expressed ourselves in a way that doesn't imply the other side is either an idiot or a telepathist (although I'd argue that in the currrent context, my quotation is much clearer than yours). -- Štěpán
Re: [O] [PATCH 0/5] loop over headlines in active region
Guys, let's keep using a civil tone in discussions. I will come back to this issue and see if I can help. Thanks, -- Bastien
Re: [O] [PATCH 0/5] loop over headlines in active region
On Fri, Sep 09, 2011 at 12:41:45PM +0200, Bastien wrote: Guys, let's keep using a civil tone in discussions. I think you're confusing civil tone with political correctness (which, in a lot of instances, can be translated as hypocrisy). I don't think every sentence containing the word idiot is uncivil, if that's what tripped you up. In any case, I really appreciate David's contributions focused on improving Org code quality. I even more appreciate that he sends his patches to the list so that anyone can review and comment on them. It's just that I believe it's more helpful to stick to the point being discussed and address questions raised instead of spamming the list with one's reading notes. -- Štěpán
Re: [O] [PATCH 0/5] loop over headlines in active region
At Fri, 09 Sep 2011 12:26:31 +0200, Štěpán Němec wrote: Still, I'd rather we stuck to the point and expressed ourselves in a way that doesn't imply the other side is either an idiot ... Your message simply repeated my conclusion: Yes, the problem of referencing a free variable in the macro expansion does not apply in this case. Yes, I should base decisions on valid arguments (Who shouldn't?). Yes, the fact that I refrained from implementing it as a macro indicates that I wanted to implement it as a macro in the first place. Repeating and stating the very, very obvious is one way to call someone an idiot. -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de pgpptcO2Ig7jL.pgp Description: PGP signature
Re: [O] [PATCH 0/5] loop over headlines in active region
On Fri, 09 Sep 2011 17:10:42 +0200 David Maus wrote: At Fri, 09 Sep 2011 12:26:31 +0200, Štěpán Němec wrote: Still, I'd rather we stuck to the point and expressed ourselves in a way that doesn't imply the other side is either an idiot ... Your message simply repeated my conclusion: Yes, the problem of referencing a free variable in the macro expansion does not apply in this case. Yes, I should base decisions on valid arguments (Who shouldn't?). Yes, the fact that I refrained from implementing it as a macro indicates that I wanted to implement it as a macro in the first place. Repeating and stating the very, very obvious is one way to call someone an idiot. It's not. (One way to call someone an idiot is saying You're an idiot. If you somehow understood any of my emails as implying you're an idiot, then I'm sorry. It was definitely not intended.) The reason I asked (I didn't actually repeat anything, and it's all apparently still far from obvious, at least to me) is that I'm confused: You say I didn't implement is as a macro, because A. Now we both agree that A is an invalid argument. Given that you now also confirmed you did want to implement it as a macro in the first place, I would expect that either you do implement it as a macro, or provide a valid argument for not doing so. Maybe I really am too dense, but the hitchhiker quotation didn't help. -- Štěpán
Re: [O] [PATCH 0/5] loop over headlines in active region
At Fri, 09 Sep 2011 17:26:43 +0200, Štěpán Němec wrote: The reason I asked (I didn't actually repeat anything, and it's all apparently still far from obvious, at least to me) is that I'm confused: You say I didn't implement is as a macro, because A. Now we both agree that A is an invalid argument. Given that you now also confirmed you did want to implement it as a macro in the first place, I would expect that either you do implement it as a macro, or provide a valid argument for not doing so. Maybe I really am too dense, but the hitchhiker quotation didn't help. Okay, now I get it. Do I implement a macro for the operation? I Don't know. Please see http://thread.gmane.org/gmane.emacs.orgmode/44422/focus=46184 Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de pgpluR4CDEL8P.pgp Description: PGP signature
Re: [O] [PATCH 0/5] loop over headlines in active region
At Wed, 07 Sep 2011 21:34:41 +0200, Štěpán Němec wrote: On Sun, 28 Aug 2011 15:57:19 +0200 David Maus wrote: At Thu, 25 Aug 2011 12:08:42 +0200, Štěpán Němec wrote: On Thu, 25 Aug 2011 06:25:29 +0200 David Maus wrote: As for the macro: What stop me to implement a macro for the generic operation is that for now the macro would depend on the global customization variable. That's not a problem per se but according to my readings about macros (mostly in context of Common Lisp, but that shouldn't matter) it should be considered bad style. Could you expand on this a bit? As far as I can tell, you obviously shouldn't depend on a customisation variable at macro expansion time, but I don't see how depending on it at run time is any different from a function doing the same. At expansion time the macro performs a transformation of the lisp at the place where the macro is used. At runtime the code of the expanded macro runs in the scope of the function where the macro was expanded into. A macro that uses a variable inside the expanded code that is not under its control (e.g. part of the argument list or gensym'd) is prone to introduce a bug caused by expanding the macro in an environment where this variable is not bound or used with a different semantics. In this particular case this should not be a problem indeed because we use a global dynamically scoped customization variable. Thus, whereever we would use the macro we can be sure the variable in the macro expansion is bound and carries the same meaning. So your what stop me to implement a macro argument is bogus, isn't it? I can't really comment on whether using a macro or not is the right thing here, but it seems to me you shouldn't base the decision on an invalid argument (IOW, from the fact that you even felt the need to explain why you didn't use a macro to begin with, it would appear to be the case that you would have preferred the macro way). One of the things Ford Prefect had always found hardest to understand about humans was their habit of continually stating and repeating the very very obvious, as in /It's a nice day/, or /You're very tall/, or /Oh dear you seem to have fallen down a thirty-foot well, are you all right?/ At first Ford had formed a theory to account for this strange behavior. If human beings don't keep exercising their lips, he thought, their mouths probably seize up. After a few months' consideration and observation he abandoned this theory in favor of a new one. If they don't keep on exercising their lips, he thought, their brains start working. After a while he abandoned this one as well as being obstructively cynical and decided he quite liked human beings after all, but he always remained desperately worried about the terrible number of things they didn't know about. Douglas Adams, The Hitchiker's Guide to the Galaxy -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de pgp5PevHSSLwv.pgp Description: PGP signature
Re: [O] [PATCH 0/5] loop over headlines in active region
On Sun, 28 Aug 2011 15:57:19 +0200 David Maus wrote: At Thu, 25 Aug 2011 12:08:42 +0200, Štěpán Němec wrote: On Thu, 25 Aug 2011 06:25:29 +0200 David Maus wrote: As for the macro: What stop me to implement a macro for the generic operation is that for now the macro would depend on the global customization variable. That's not a problem per se but according to my readings about macros (mostly in context of Common Lisp, but that shouldn't matter) it should be considered bad style. Could you expand on this a bit? As far as I can tell, you obviously shouldn't depend on a customisation variable at macro expansion time, but I don't see how depending on it at run time is any different from a function doing the same. At expansion time the macro performs a transformation of the lisp at the place where the macro is used. At runtime the code of the expanded macro runs in the scope of the function where the macro was expanded into. A macro that uses a variable inside the expanded code that is not under its control (e.g. part of the argument list or gensym'd) is prone to introduce a bug caused by expanding the macro in an environment where this variable is not bound or used with a different semantics. In this particular case this should not be a problem indeed because we use a global dynamically scoped customization variable. Thus, whereever we would use the macro we can be sure the variable in the macro expansion is bound and carries the same meaning. So your what stop me to implement a macro argument is bogus, isn't it? I can't really comment on whether using a macro or not is the right thing here, but it seems to me you shouldn't base the decision on an invalid argument (IOW, from the fact that you even felt the need to explain why you didn't use a macro to begin with, it would appear to be the case that you would have preferred the macro way). -- Štěpán
Re: [O] [PATCH 0/5] loop over headlines in active region
On Aug 28, 2011, at 3:58 PM, David Maus wrote: Hi Carsten, At Thu, 25 Aug 2011 08:13:21 +0200, Carsten Dominik wrote: I am wondering, why did you choose to skip invisible headlines? I would worry that this introduces inconsistent behavior and also makes it hard to use this feature in a programmatic way. Good points. I though of skipping invisible headlines as a way to control which headlines are 'looped over' but if this is inconsistent with already present behaviour of Org mode or Emacs in general we can scratch that idea. Yes, let's do that. What brings up the question: What is the current behavior of Org mode with regards to operations in a region? I think almost everything that iterates over a number of headlines will also do the invisible ones. Exceptions are exporting/copying the visible headlines, and probably something else I am not remembering. - Carsten
Re: [O] [PATCH 0/5] loop over headlines in active region
Hi Carsten, At Mon, 29 Aug 2011 11:29:04 +0200, Carsten Dominik wrote: On Aug 28, 2011, at 3:58 PM, David Maus wrote: Hi Carsten, At Thu, 25 Aug 2011 08:13:21 +0200, Carsten Dominik wrote: I am wondering, why did you choose to skip invisible headlines? I would worry that this introduces inconsistent behavior and also makes it hard to use this feature in a programmatic way. Good points. I though of skipping invisible headlines as a way to control which headlines are 'looped over' but if this is inconsistent with already present behaviour of Org mode or Emacs in general we can scratch that idea. Yes, let's do that. What brings up the question: What is the current behavior of Org mode with regards to operations in a region? I think almost everything that iterates over a number of headlines will also do the invisible ones. Exceptions are exporting/copying the visible headlines, and probably something else I am not remembering. I'll investigate this. Maybe the customization variable could control all operations on headlines in active region. Current proposal does not feel good because it only controls some. Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de pgpa2hFgS1kzx.pgp Description: PGP signature
Re: [O] [PATCH 0/5] loop over headlines in active region
At Thu, 25 Aug 2011 12:08:42 +0200, Štěpán Němec wrote: On Thu, 25 Aug 2011 06:25:29 +0200 David Maus wrote: As for the macro: What stop me to implement a macro for the generic operation is that for now the macro would depend on the global customization variable. That's not a problem per se but according to my readings about macros (mostly in context of Common Lisp, but that shouldn't matter) it should be considered bad style. Could you expand on this a bit? As far as I can tell, you obviously shouldn't depend on a customisation variable at macro expansion time, but I don't see how depending on it at run time is any different from a function doing the same. At expansion time the macro performs a transformation of the lisp at the place where the macro is used. At runtime the code of the expanded macro runs in the scope of the function where the macro was expanded into. A macro that uses a variable inside the expanded code that is not under its control (e.g. part of the argument list or gensym'd) is prone to introduce a bug caused by expanding the macro in an environment where this variable is not bound or used with a different semantics. In this particular case this should not be a problem indeed because we use a global dynamically scoped customization variable. Thus, whereever we would use the macro we can be sure the variable in the macro expansion is bound and carries the same meaning. Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de pgp4wAB3wZmkl.pgp Description: PGP signature
Re: [O] [PATCH 0/5] loop over headlines in active region
Hi Carsten, At Thu, 25 Aug 2011 08:13:21 +0200, Carsten Dominik wrote: I am wondering, why did you choose to skip invisible headlines? I would worry that this introduces inconsistent behavior and also makes it hard to use this feature in a programmatic way. Good points. I though of skipping invisible headlines as a way to control which headlines are 'looped over' but if this is inconsistent with already present behaviour of Org mode or Emacs in general we can scratch that idea. What brings up the question: What is the current behavior of Org mode with regards to operations in a region? Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de pgpMdN7x13PuZ.pgp Description: PGP signature
Re: [O] [PATCH 0/5] loop over headlines in active region
On 25.8.2011, at 06:25, David Maus wrote:Hi Bastien,Great -- can you submit a patch against current git head?Following 5 patches implement looping over headlines in active regionfor org-schedule and org-deadline. Invisible headlines are skippedHi David,I am wondering, why did you choose to skip invisible headlines?I would worry that this introduces inconsistent behavior and alsomakes it hard to use this feature in a programmatic way.Regards- Carstenandbulk-agenda commands work by binding the customization variable to nilbefore executing a command.I've been running with this modification for 2 weeks now, using thefeature occassionally without a visibile problem.As for the macro: What stop me to implement a macro for the genericoperation is that for now the macro would depend on the globalcustomization variable. That's not a problem per se but according tomy readings about macros (mostly in context of Common Lisp, but thatshouldn't matter) it should be considered bad style.I did some experiments with defining an `org-map-entries' MATCH of'current that causes FUNC to be applied to the current headingonly, but I'm not sure if this would be a right thing (tm) to do.Best, -- DavidDavid Maus (5): Extend scope 'region to include body of last headline in active region Immediately return if scope is region but no region is active New customization variable: Loop over headlines in active region Skip invisible headlines when mapping over headlines in active region Avoid conflict between bulk command and loop-over-headlines
Re: [O] [PATCH 0/5] loop over headlines in active region
On Thu, 25 Aug 2011 06:25:29 +0200 David Maus wrote: As for the macro: What stop me to implement a macro for the generic operation is that for now the macro would depend on the global customization variable. That's not a problem per se but according to my readings about macros (mostly in context of Common Lisp, but that shouldn't matter) it should be considered bad style. Could you expand on this a bit? As far as I can tell, you obviously shouldn't depend on a customisation variable at macro expansion time, but I don't see how depending on it at run time is any different from a function doing the same. -- Štěpán
[O] [PATCH 0/5] loop over headlines in active region
Hi Bastien, Great -- can you submit a patch against current git head? Following 5 patches implement looping over headlines in active region for org-schedule and org-deadline. Invisible headlines are skipped and bulk-agenda commands work by binding the customization variable to nil before executing a command. I've been running with this modification for 2 weeks now, using the feature occassionally without a visibile problem. As for the macro: What stop me to implement a macro for the generic operation is that for now the macro would depend on the global customization variable. That's not a problem per se but according to my readings about macros (mostly in context of Common Lisp, but that shouldn't matter) it should be considered bad style. I did some experiments with defining an `org-map-entries' MATCH of 'current that causes FUNC to be applied to the current heading only, but I'm not sure if this would be a right thing (tm) to do. Best, -- David David Maus (5): Extend scope 'region to include body of last headline in active region Immediately return if scope is region but no region is active New customization variable: Loop over headlines in active region Skip invisible headlines when mapping over headlines in active region Avoid conflict between bulk command and loop-over-headlines