[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [PATCH 2/2] Allow inserting diary entries last in date tree
From: |
Nikolai Weibull |
Subject: |
Re: [O] [PATCH 2/2] Allow inserting diary entries last in date tree |
Date: |
Sun, 23 Aug 2015 19:11:05 +0200 |
On Sun, Aug 23, 2015 at 9:40 AM, Nicolas Goaziou <address@hidden> wrote:
>> + (let ((last (eq org-agenda-insert-diary-strategy 'date-tree-last))
>> + (has-children (save-excursion (org-goto-first-child))))
>> + (if (not (and last has-children))
>> + (outline-next-heading)
>> + (org-goto-first-child)
>> + (while (org-get-next-sibling)))
>> + (org-back-over-empty-lines)
>> + (unless (looking-at "[ \t]*$") (save-excursion (insert "\n")))
>> + (org-insert-heading nil t)
>> + (unless has-children
>> + (org-do-demote)))
>
> This part is incorrect, when tree is ill-formed, and slightly
> inefficient when there are many children.
>
> Assuming point is on the parent headline, I think a faster way to do
> this would be
>
> (org-end-of-subtree t t)
> (org-insert-heading nil t)
> (org-do-demote)
That’s what I used first, but that doesn’t work if the subtree has
children that has children.
- Re: [O] org-agenda-insert-diary-make-new-entry adds entry as first child?, Nikolai Weibull, 2015/08/20
- [O] [PATCH 2/2] Allow inserting diary entries last in date tree, Nikolai Weibull, 2015/08/20
- Re: [O] [PATCH 2/2] Allow inserting diary entries last in date tree, Nicolas Goaziou, 2015/08/23
- Re: [O] [PATCH 2/2] Allow inserting diary entries last in date tree,
Nikolai Weibull <=
- Re: [O] [PATCH 2/2] Allow inserting diary entries last in date tree, Nicolas Goaziou, 2015/08/23
- [O] [PATCH] Allow inserting diary entries last in date tree, Nikolai Weibull, 2015/08/24
- Re: [O] [PATCH] Allow inserting diary entries last in date tree, Nicolas Goaziou, 2015/08/24
- Re: [O] [PATCH] Allow inserting diary entries last in date tree, Nicolas Goaziou, 2015/08/24
- [O] [PATCH] Add news about org-agenda-insert-diary-strategy, Nikolai Weibull, 2015/08/25
- Re: [O] [PATCH] Add news about org-agenda-insert-diary-strategy, Bastien, 2015/08/25