emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: org-resolve-clocks should not iterate over non-agenda org files [8.3.3 (8.3.3-elpaplus @ /home/dfeich/.emacs.d/elpa/org-plus-contrib-20160108/)
@ 2016-01-19 20:22 Derek Feichtinger
  2016-01-20 13:14 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Derek Feichtinger @ 2016-01-19 20:22 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 629 bytes --]

Hi

org-resolve-clock loops over all open org buffers for detecting open
clocks (using function org-files-list). Is this really intended? I think
it should just loop over the org-agenda-files.

I was working on an extension for clocking and was recording my testing
results
into a separate org file. I also had put there examples of
various clock lines to test regexps against. The example clock lines
effectively prevented me from clocking in to a task from my normal
agenda files.

Since org has so many usages, I think it should not be assumed that each
org buffer is related to the agenda functionality.

Best regards,
Derek

[-- Attachment #2: Type: text/html, Size: 855 bytes --]

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

* Re: Bug: org-resolve-clocks should not iterate over non-agenda org files [8.3.3 (8.3.3-elpaplus @ /home/dfeich/.emacs.d/elpa/org-plus-contrib-20160108/)
  2016-01-19 20:22 Bug: org-resolve-clocks should not iterate over non-agenda org files [8.3.3 (8.3.3-elpaplus @ /home/dfeich/.emacs.d/elpa/org-plus-contrib-20160108/) Derek Feichtinger
@ 2016-01-20 13:14 ` Nicolas Goaziou
  2016-01-21  9:26   ` Derek Feichtinger
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2016-01-20 13:14 UTC (permalink / raw)
  To: Derek Feichtinger; +Cc: emacs-orgmode

Hello,

Derek Feichtinger <dfeich@gmail.com> writes:

> org-resolve-clock loops over all open org buffers for detecting open
> clocks (using function org-files-list). Is this really intended? I think
> it should just loop over the org-agenda-files.
>
> I was working on an extension for clocking and was recording my testing
> results
> into a separate org file. I also had put there examples of
> various clock lines to test regexps against. The example clock lines
> effectively prevented me from clocking in to a task from my normal
> agenda files.
>
> Since org has so many usages, I think it should not be assumed that each
> org buffer is related to the agenda functionality.

Clocking is not just an agenda functionality. Since every Org document
can contain clocks, it makes sense to use `org-files-list' instead of
`org-agenda-files'.

You could test your extension in a dedicated Emacs process, with
`org-agenda-files' being nil and Org documents opened piece-wise.


Regards,

-- 
Nicolas Goaziou

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

* Re: Bug: org-resolve-clocks should not iterate over non-agenda org files [8.3.3 (8.3.3-elpaplus @ /home/dfeich/.emacs.d/elpa/org-plus-contrib-20160108/)
  2016-01-20 13:14 ` Nicolas Goaziou
@ 2016-01-21  9:26   ` Derek Feichtinger
  2016-01-21  9:47     ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Derek Feichtinger @ 2016-01-21  9:26 UTC (permalink / raw)
  To: Derek Feichtinger, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2618 bytes --]

Hi Nicolas

Ok, that makes sense, then. Probably there are other users who indeed will
rely on clocking in non-agenda files.

The thing which made it hard for me to identify the initial problem was
that the test CLOCK lines I had in the testing file where placed there
without a heading. When later in the day I wanted to clock in to my tasks,
 I then just ended up with a "outline-back-to-heading: before first
heading" error, but with no indicator which of my ~60 open org files was
the culprit. Maybe one could insert the file location in that error message?

Since org is so extremely useful, and I almost spend 80% of my day in org
files (also some of my collaborators are beginning to use it... it is
viral), I often have >50 files with all kinds of purposes open: agenda,
various notes, beamer, html-exports, wiki-authoring, project-organization,
bookkeeping... the thing is just too useful. So, I think clashes between
the many uses of org files probably are natural.

This being emacs  :-) I just decided to advise org-resolve-clocks.

(defun dfeich/org-resolve-clocks (orig-function &optional only-dangling-p
prompt-fn last-valid)
  (cl-letf (((symbol-function 'org-files-list) 'org-agenda-files))
    (apply orig-function only-dangling-p prompt-fn last-valid)))

(advice-add #'org-resolve-clocks :around #'dfeich/org-resolve-clocks)

Thanks for maintaining and developing an environment which made my time in
front of the keyboard so much more efficient.

Derek

On Wed, Jan 20, 2016 at 2:14 PM, Nicolas Goaziou <mail@nicolasgoaziou.fr>
wrote:

> Hello,
>
> Derek Feichtinger <dfeich@gmail.com> writes:
>
> > org-resolve-clock loops over all open org buffers for detecting open
> > clocks (using function org-files-list). Is this really intended? I think
> > it should just loop over the org-agenda-files.
> >
> > I was working on an extension for clocking and was recording my testing
> > results
> > into a separate org file. I also had put there examples of
> > various clock lines to test regexps against. The example clock lines
> > effectively prevented me from clocking in to a task from my normal
> > agenda files.
> >
> > Since org has so many usages, I think it should not be assumed that each
> > org buffer is related to the agenda functionality.
>
> Clocking is not just an agenda functionality. Since every Org document
> can contain clocks, it makes sense to use `org-files-list' instead of
> `org-agenda-files'.
>
> You could test your extension in a dedicated Emacs process, with
> `org-agenda-files' being nil and Org documents opened piece-wise.
>
>
> Regards,
>
> --
> Nicolas Goaziou
>

[-- Attachment #2: Type: text/html, Size: 3500 bytes --]

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

* Re: Bug: org-resolve-clocks should not iterate over non-agenda org files [8.3.3 (8.3.3-elpaplus @ /home/dfeich/.emacs.d/elpa/org-plus-contrib-20160108/)
  2016-01-21  9:26   ` Derek Feichtinger
@ 2016-01-21  9:47     ` Nicolas Goaziou
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2016-01-21  9:47 UTC (permalink / raw)
  To: Derek Feichtinger; +Cc: emacs-orgmode

Hello,

Derek Feichtinger <dfeich@gmail.com> writes:

> The thing which made it hard for me to identify the initial problem was
> that the test CLOCK lines I had in the testing file where placed there
> without a heading. When later in the day I wanted to clock in to my tasks,
>  I then just ended up with a "outline-back-to-heading: before first
> heading" error, but with no indicator which of my ~60 open org files was
> the culprit. Maybe one could insert the file location in that error
> message?

Actually, that is the very point of `org-back-to-heading' but... it
wasn't used. I fixed it. Thank you.

> Since org is so extremely useful, and I almost spend 80% of my day in org
> files (also some of my collaborators are beginning to use it... it is
> viral), I often have >50 files with all kinds of purposes open: agenda,
> various notes, beamer, html-exports, wiki-authoring, project-organization,
> bookkeeping... the thing is just too useful. So, I think clashes between
> the many uses of org files probably are natural.
>
> This being emacs  :-) I just decided to advise org-resolve-clocks.

Exactly. Thanks to Emacs, you can bend any part of Org to your needs.


Regards,

-- 
Nicolas Goaziou

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

end of thread, other threads:[~2016-01-21  9:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-19 20:22 Bug: org-resolve-clocks should not iterate over non-agenda org files [8.3.3 (8.3.3-elpaplus @ /home/dfeich/.emacs.d/elpa/org-plus-contrib-20160108/) Derek Feichtinger
2016-01-20 13:14 ` Nicolas Goaziou
2016-01-21  9:26   ` Derek Feichtinger
2016-01-21  9:47     ` Nicolas Goaziou

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).