Hi Eric,
try this:
(progn
(org-cycle-agenda-files)
(when (not (and (bolp) (org-on-heading-p)))
(outline-previous-visible-heading 1)
(or (and (bolp) (org-on-heading-p))
(outline-next-visible-heading 1))))
Greetings,
Stephan
Also sprach Eric S Fraga:
> At Fri, 20 Nov 2009 15:57:09 +0100,
> Carsten Dominik wrote:
>> This is nice, but I guess you want to stay in fast-key space.
>> So
>>
>> ("," . (progn (org-cycle-agenda-files)
>> (or (and (bolp) (org-on-heading-p))
>> (outline-next-visible-heading 1))))
>
> This is really nice and works like a charm... *except* in a very
> extreme case: one of my agenda files is typically empty other than a
> single top level heading. When I cycle through the agenda files, when
> I land in this file, I am typically placed at the end of the file
> (emacs remembers my last location). When this happens, speed keys are
> no longer active and, before I know it, I have a number of ',' added
> to the end of this file!
>
> Actually, I guess this problem generalises so that it would appear
> whenever the cycling takes you to a file where the current point is at
> the end (or near the end) of the file so there is actually no "next"
> heading? Maybe the or statement above needs another clause (which I
> unfortunately cannot suggest; sorry!).
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> [email protected]
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-orgmode