emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] Fix %e agenda format and refresh of agenda items in gene


From: Max Mikhanosha
Subject: Re: [O] [PATCH] Fix %e agenda format and refresh of agenda items in general
Date: Fri, 22 Jul 2011 14:01:07 -0400
User-agent: Wanderlust/2.15.3 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/23.3.50 (x86_64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO)

Here is an updated patch, its split into 3 very small part, belowe is
an explanaton of each:

1. First patch is my original patch to fix error with %e agenda format.

2. Second patch fixes what I beleive to be a logic bug. Most agenda
related commands have the following format:

  (defun org-agenda-do-STUFF ()

   (org-with-remote-undo buffer
      (with-current-buffer buffer

        ;; change the item
        (call-interactively 'org-do-STUFF)
        (setq newhead (org-get-heading)))

     ;; refresh agenda lines that have same marker
     (org-agenda-change-all-lines newhead hdmarker))) 

The problem is with (org-agenda-change-all-lines). It calls
(org-format-agenda-item) on each item, but with the current buffer
being the agenda buffer and not the original item's buffer.

Also (org-format-agenda-item) expects the agenda item format to be in
the variable org-prefix-format-compiled. But when called by
(org-agenda-change-all-lines), that variable is not restored, and
instead has stale value from the last block of the agenda.

This causes the items to be randomly reformatted with last block's
agenda format, when they are changed.

My second patch fixes above problem, by making
(org-agenda-change-all-lines) call (org-format-agenda-item) in the
same way as when item was originally generated including changing
to the item's buffer, and restoring the correct compiled format variable.

3. Third patch changes (org-agenda-set-effort) to refresh the item. It requires
the 2nd patch to work.


    

Attachment: 0003-Fix-error-with-e-agenda-prefix-format-when-there-is-.patch
Description: Binary data

Attachment: 0007-org-agenda-change-all-lines-Change-to-item-s-buffer-.patch
Description: Binary data

Attachment: 0008-org-agenda-set-effort-Refresh-changed-lines.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]