0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-22 10:10:42 +00:00

Honour existing restrictions when clocking in from the agenda

* 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.
This commit is contained in:
Bernt Hansen 2011-12-30 15:49:08 +00:00 committed by Carsten Dominik
parent 9b250f8e09
commit fc1f01c54e

View file

@ -7797,14 +7797,15 @@ The cursor may be at a date in the calendar, or in the Org agenda."
newhead) newhead)
(org-with-remote-undo (marker-buffer marker) (org-with-remote-undo (marker-buffer marker)
(with-current-buffer (marker-buffer marker) (with-current-buffer (marker-buffer marker)
(widen) (save-restriction
(goto-char pos) (widen)
(org-show-context 'agenda) (goto-char pos)
(org-show-entry) (org-show-context 'agenda)
(org-cycle-hide-drawers 'children) (org-show-entry)
(org-clock-in arg) (org-cycle-hide-drawers 'children)
(setq newhead (org-get-heading))) (org-clock-in arg)
(org-agenda-change-all-lines newhead hdmarker))))) (setq newhead (org-get-heading)))
(org-agenda-change-all-lines newhead hdmarker))))))
(defun org-agenda-clock-out () (defun org-agenda-clock-out ()
"Stop the currently running clock." "Stop the currently running clock."