emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bernt Hansen <bernt@norang.ca>
To: Matt Lundin <mdl@imapmail.org>,
	Bastien <bastienguerry@googlemail.com>,
	carsten.dominik@gmail.com
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH 2/3] Honour existing restrictions when clocking in from the agenda
Date: Thu, 19 Jan 2012 09:51:14 -0500	[thread overview]
Message-ID: <87fwfb690d.fsf@norang.ca> (raw)
In-Reply-To: <874nvr4xlb.fsf@fastmail.fm> (Matt Lundin's message of "Thu, 19 Jan 2012 07:43:12 -0600")

Eeek!

I'm not running into this (as far as I know) in my current setup but I
vote we just revert the clocking restriction patches.  There are other
unresolved issues with these patches that I've seen and don't currently
have a fix for.

  - column view clocking totals on the agenda are wrong if a restriction
    is in place in the org file

In my current setup recreating the restriction with a speed key is
easy so I can live with that until a proper fix can be created or we
decide to drop this patch series.

Bastien/Carsten:

Please revert the following commits (again).  Sorry :(

  - 7a73e15 (Remove file restrictions when generating clock report data, 2012-01-09)
  - e8f93a75 (Honour existing restrictions when visiting tasks from the agenda, 2011-12-30)
  - c41a6f5 (Honour existing restrictions when clocking in from the agenda, 2011-12-30)
  - a0a26cd (Honour existing restrictions when regenerating the agenda, 2011-12-30)

Regards,
Bernt

Matt Lundin <mdl@imapmail.org> writes:

> Hi Bernt,
>
> Bernt Hansen <bernt@norang.ca> writes:
>
>> * lisp/org-agenda.el (org-agenda-clock-in): Save restriction when clocking in from the agenda
>>
>> Narrowed org buffers are now retained when clocking in from the agenda.
>> We only widen the buffer when the task to clock in is outside the existing
>> restriction.
>
> It seems that adding save-restriction to org-agenda-clock-in causes the
> following:
>
> When one clocks in from the agenda, all preexisting drawers in a buffer
> are aligned to org-tags-column (i.e., the right side of the file).
>
> I can confirm this using emacs -Q. 
>
> Here's a sample file. Before clocking in it looks like this:
>
> * A headline
>   SCHEDULED: <2012-01-18 Wed +1d>
>   :LOGBOOK:
>   CLOCK: [2012-01-18 Wed 20:10]--[2012-01-19 Thu 07:18] => 11:08
>   :END:
>   :PROPERTIES:
>   :HELLO: there
>   :END:
> * And another
>   :PROPERTIES:
>   :NOW: and again
>   :END:
>
> After clocking in from the agenda -- (org-agenda-clock-in) -- the file
> looks like this:
>
> * A headline
>   SCHEDULED: <2012-01-18 Wed +1d>
>                                                                        :LOGBOOK:
>   CLOCK: [2012-01-19 Thu 07:19]
>   CLOCK: [2012-01-18 Wed 20:10]--[2012-01-19 Thu 07:18] => 11:08
>                                                                            :END:
>                                                                     :PROPERTIES:
>   :HELLO: there
>                                                                            :END:
> * And another
>                                                                     :PROPERTIES:
>   :NOW: and again
>                                                                            :END:
>
> Strangely (though not demonstrated in the above example), all tags in
> the buffer are also realigned.
>
> Note: org-indent-mode is not on. My emacs version is:
>
> GNU Emacs 24.0.92.1 (i686-pc-linux-gnu, GTK+ Version 2.24.8) of
> 2012-01-18 on archeee
>
> Org-version:
>
> release_7.8.03-149-g46ff3
> Org-mode version 7.8.03 (release_7.8.03.149.g46ff3)
>
> Best, 
> Matt
>
> P.S. I hope all on the list are doing well. I look forward to
> participating more in the near future.
>
> Bernt Hansen <bernt@norang.ca> writes:
>
>> * lisp/org-agenda.el (org-agenda-clock-in): Save restriction when clocking in from the agenda
>>
>> Narrowed org buffers are now retained when clocking in from the agenda.
>> We only widen the buffer when the task to clock in is outside the existing
>> restriction.
>> ---
>>  lisp/org-agenda.el |   17 +++++++++--------
>>  1 files changed, 9 insertions(+), 8 deletions(-)
>>
>> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
>> index 780794e..f240f5e 100644
>> --- a/lisp/org-agenda.el
>> +++ b/lisp/org-agenda.el
>> @@ -7797,14 +7797,15 @@ The cursor may be at a date in the calendar, or in the Org agenda."
>>  	   newhead)
>>        (org-with-remote-undo (marker-buffer marker)
>>          (with-current-buffer (marker-buffer marker)
>> -	  (widen)
>> -	  (goto-char pos)
>> -	  (org-show-context 'agenda)
>> -	  (org-show-entry)
>> -	  (org-cycle-hide-drawers 'children)
>> -	  (org-clock-in arg)
>> -	  (setq newhead (org-get-heading)))
>> -	(org-agenda-change-all-lines newhead hdmarker)))))
>> +	  (save-restriction
>> +	    (widen)
>> +	    (goto-char pos)
>> +	    (org-show-context 'agenda)
>> +	    (org-show-entry)
>> +	    (org-cycle-hide-drawers 'children)
>> +	    (org-clock-in arg)
>> +	    (setq newhead (org-get-heading)))
>> +	  (org-agenda-change-all-lines newhead hdmarker))))))
>>  
>>  (defun org-agenda-clock-out ()
>>    "Stop the currently running clock."

  reply	other threads:[~2012-01-19 14:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-30 10:49 Honour existing restrictions if possible when visiting tasks from the agenda Bernt Hansen
2011-12-30 10:49 ` [PATCH 1/3] Honour existing restrictions when regenerating " Bernt Hansen
2011-12-30 10:49 ` [PATCH 2/3] Honour existing restrictions when clocking in from " Bernt Hansen
2012-01-19 13:43   ` Matt Lundin
2012-01-19 14:51     ` Bernt Hansen [this message]
2012-01-19 15:22       ` Bastien
2012-01-19 15:44       ` Bernt Hansen
2012-01-19 15:47       ` Sebastien Vauban
2012-01-19 16:11         ` Bastien
2012-01-19 18:05         ` Bernt Hansen
2011-12-30 10:49 ` [PATCH 3/3] Honour existing restrictions when visiting tasks " Bernt Hansen
2011-12-31  8:11 ` Honour existing restrictions if possible " Carsten Dominik
2011-12-31 14:12   ` Bernt Hansen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fwfb690d.fsf@norang.ca \
    --to=bernt@norang.ca \
    --cc=bastienguerry@googlemail.com \
    --cc=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mdl@imapmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).