* org-batch-agenda lock problem @ 2009-06-09 10:40 Angus Gibson 2009-06-09 12:24 ` Carsten Dominik 0 siblings, 1 reply; 4+ messages in thread From: Angus Gibson @ 2009-06-09 10:40 UTC (permalink / raw) To: emacs-orgmode I am a recent convert to org-mode, and the ability to export the agenda is very useful. Currently I have a script that runs every 10 seconds or so that calls: emacs -batch -l ~/.emacs -eval '(org-batch-agenda "a" org-agenda-ndays 1)' 2>/dev/null In order to put the agenda items on my desktop. This works fine, until I start to edit the org file. From what I have gathered, this causes a lock to be placed, and org-batch-agenda has a collision with this lock, resulting in no output because it's trying to output the message about resolving the collision. Obviously this isn't very useful, so I was wondering why org-batch-agenda would have to modify the file, or possibly the easiest way to resolve this (I'm not amazing with Emacs). Thanks, Angus ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: org-batch-agenda lock problem 2009-06-09 10:40 org-batch-agenda lock problem Angus Gibson @ 2009-06-09 12:24 ` Carsten Dominik 2009-06-09 12:53 ` Angus Gibson 0 siblings, 1 reply; 4+ messages in thread From: Carsten Dominik @ 2009-06-09 12:24 UTC (permalink / raw) To: Angus Gibson; +Cc: emacs-orgmode On Jun 9, 2009, at 12:40 PM, Angus Gibson wrote: > I am a recent convert to org-mode, and the ability to export the > agenda is very useful. Currently I have a script that runs every 10 > seconds or so that calls: > > emacs -batch -l ~/.emacs -eval '(org-batch-agenda "a" org-agenda- > ndays 1)' 2>/dev/null The following may or may not work, depending on what happens in non- interactive emacs sessions when a lock is encountered. Maybe this would work? emacs -batch -l ~/.emacs -eval '(progn (defun ask-user-about-lock (&rest args) nil) (org-batch-agenda "a" org-agenda-ndays 1))' 2>/dev/ null or emacs -batch -l ~/.emacs -eval '(progn (defun file-locked-p (&rest args) nil) (org-batch-agenda "a" org-agenda-ndays 1))' 2>/dev/null These are bad hacks, but should be OK sice creating an agenda should not modify any file buffers... - Carsten > > In order to put the agenda items on my desktop. This works fine, > until I start to edit the org file. From what I have gathered, this > causes a lock to be placed, and org-batch-agenda has a collision > with this lock, resulting in no output because it's trying to output > the message about resolving the collision. Obviously this isn't very > useful, so I was wondering why org-batch-agenda would have to modify > the file, or possibly the easiest way to resolve this (I'm not > amazing with Emacs). > > Thanks, > Angus > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: org-batch-agenda lock problem 2009-06-09 12:24 ` Carsten Dominik @ 2009-06-09 12:53 ` Angus Gibson 2009-06-15 10:44 ` Carsten Dominik 0 siblings, 1 reply; 4+ messages in thread From: Angus Gibson @ 2009-06-09 12:53 UTC (permalink / raw) To: Carsten Dominik; +Cc: emacs-orgmode On 09/06/2009, at 22:24 , Carsten Dominik wrote: > > On Jun 9, 2009, at 12:40 PM, Angus Gibson wrote: > >> I am a recent convert to org-mode, and the ability to export the >> agenda is very useful. Currently I have a script that runs every 10 >> seconds or so that calls: >> >> emacs -batch -l ~/.emacs -eval '(org-batch-agenda "a" org-agenda- >> ndays 1)' 2>/dev/null > > The following may or may not work, depending on what happens in non- > interactive emacs sessions when a lock is encountered. Maybe this > would work? > > emacs -batch -l ~/.emacs -eval '(progn (defun ask-user-about-lock > (&rest args) nil) (org-batch-agenda "a" org-agenda-ndays 1))' 2>/dev/ > null Simple enough solution, thanks. I think it's a bit weird that it is encountering the lock, but I suppose getting rid of the confirmation is the easiest step for a completely non-interactive session. Thanks, Angus > > or > > emacs -batch -l ~/.emacs -eval '(progn (defun file-locked-p (&rest > args) nil) (org-batch-agenda "a" org-agenda-ndays 1))' 2>/dev/null > > > These are bad hacks, but should be OK sice creating an agenda should > not modify any file buffers... > > - Carsten > > > > >> >> In order to put the agenda items on my desktop. This works fine, >> until I start to edit the org file. From what I have gathered, this >> causes a lock to be placed, and org-batch-agenda has a collision >> with this lock, resulting in no output because it's trying to >> output the message about resolving the collision. Obviously this >> isn't very useful, so I was wondering why org-batch-agenda would >> have to modify the file, or possibly the easiest way to resolve >> this (I'm not amazing with Emacs). >> >> Thanks, >> Angus >> >> >> _______________________________________________ >> Emacs-orgmode mailing list >> Remember: use `Reply All' to send replies to the list. >> Emacs-orgmode@gnu.org >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: org-batch-agenda lock problem 2009-06-09 12:53 ` Angus Gibson @ 2009-06-15 10:44 ` Carsten Dominik 0 siblings, 0 replies; 4+ messages in thread From: Carsten Dominik @ 2009-06-15 10:44 UTC (permalink / raw) To: Angus Gibson; +Cc: emacs-orgmode On Jun 9, 2009, at 2:53 PM, Angus Gibson wrote: > On 09/06/2009, at 22:24 , Carsten Dominik wrote: > >> >> On Jun 9, 2009, at 12:40 PM, Angus Gibson wrote: >> >>> I am a recent convert to org-mode, and the ability to export the >>> agenda is very useful. Currently I have a script that runs every >>> 10 seconds or so that calls: >>> >>> emacs -batch -l ~/.emacs -eval '(org-batch-agenda "a" org-agenda- >>> ndays 1)' 2>/dev/null >> >> The following may or may not work, depending on what happens in non- >> interactive emacs sessions when a lock is encountered. Maybe this >> would work? >> >> emacs -batch -l ~/.emacs -eval '(progn (defun ask-user-about-lock >> (&rest args) nil) (org-batch-agenda "a" org-agenda-ndays 1))' 2>/ >> dev/null > > Simple enough solution, thanks. I think it's a bit weird that it is > encountering the lock, Not really! A batch session could potentially modify the file, and Emacs cannot know in advance that it will not. I guess a properly constructed batch command would load file contents into temporary buffers without actually visiting files, but I used the fast trach to such a command by simply calling the already implemented commands... > but I suppose getting rid of the confirmation is the easiest step > for a completely non-interactive session. I think so I might consider doing the even in the batch commands...... Not sure though how dangerous this would be.... - Carsten > > Thanks, > Angus > >> >> or >> >> emacs -batch -l ~/.emacs -eval '(progn (defun file-locked-p (&rest >> args) nil) (org-batch-agenda "a" org-agenda-ndays 1))' 2>/dev/null >> >> >> These are bad hacks, but should be OK sice creating an agenda >> should not modify any file buffers... >> >> - Carsten >> >> >> >> >>> >>> In order to put the agenda items on my desktop. This works fine, >>> until I start to edit the org file. From what I have gathered, >>> this causes a lock to be placed, and org-batch-agenda has a >>> collision with this lock, resulting in no output because it's >>> trying to output the message about resolving the collision. >>> Obviously this isn't very useful, so I was wondering why org-batch- >>> agenda would have to modify the file, or possibly the easiest way >>> to resolve this (I'm not amazing with Emacs). >>> >>> Thanks, >>> Angus >>> >>> >>> _______________________________________________ >>> Emacs-orgmode mailing list >>> Remember: use `Reply All' to send replies to the list. >>> Emacs-orgmode@gnu.org >>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode >> > ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-06-17 13:11 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-06-09 10:40 org-batch-agenda lock problem Angus Gibson 2009-06-09 12:24 ` Carsten Dominik 2009-06-09 12:53 ` Angus Gibson 2009-06-15 10:44 ` Carsten Dominik
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/emacs.git https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.