emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* loading all agenda files at startup
@ 2014-04-30  8:18 Eric Abrahamsen
  2014-04-30  8:23 ` Daimrod
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Abrahamsen @ 2014-04-30  8:18 UTC (permalink / raw)
  To: emacs-orgmode

I've got a few top-level user commands, related to org, that load at
startup. Specifically org-agenda and org-ido-switchb are bound to keys
that are available after emacs starts up. Before Org loads properly,
however, things like the agenda file list and the list of valid tags and
TODO keywords are unavailable. That makes it hard to boot emacs and go
directly into a call to `org-todo-list': the TODO keywords aren't loaded
yet.

I've looked into this before but couldn't find a single function that
would "boot" my local data. `org-agenda-files' reads the file list, but
it doesn't actually parse the files and do all the setup routines.

Is there a single-function entry point that I could put in my init
files, that would get me where I want to be? ie, in a state as though
`org-agenda' had already been called, though it hasn't yet?

Thanks,
Eric

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: loading all agenda files at startup
  2014-04-30  8:18 loading all agenda files at startup Eric Abrahamsen
@ 2014-04-30  8:23 ` Daimrod
  2014-04-30  8:44   ` Eric Abrahamsen
  0 siblings, 1 reply; 6+ messages in thread
From: Daimrod @ 2014-04-30  8:23 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1092 bytes --]

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

Hi Eric,

> I've got a few top-level user commands, related to org, that load at
> startup. Specifically org-agenda and org-ido-switchb are bound to keys
> that are available after emacs starts up. Before Org loads properly,
> however, things like the agenda file list and the list of valid tags and
> TODO keywords are unavailable. That makes it hard to boot emacs and go
> directly into a call to `org-todo-list': the TODO keywords aren't loaded
> yet.
>
> I've looked into this before but couldn't find a single function that
> would "boot" my local data. `org-agenda-files' reads the file list, but
> it doesn't actually parse the files and do all the setup routines.
>
> Is there a single-function entry point that I could put in my init
> files, that would get me where I want to be? ie, in a state as though
> `org-agenda' had already been called, though it hasn't yet?

I call `org-agenda-list' in my `after-init-hook' but it is not "silent",
that is, it displays the agenda list.

Best,

-- 
Daimrod/Greg

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: loading all agenda files at startup
  2014-04-30  8:23 ` Daimrod
@ 2014-04-30  8:44   ` Eric Abrahamsen
  2014-04-30  8:58     ` Alexander Baier
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Abrahamsen @ 2014-04-30  8:44 UTC (permalink / raw)
  To: emacs-orgmode

Daimrod <daimrod@gmail.com> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
> Hi Eric,
>
>> I've got a few top-level user commands, related to org, that load at
>> startup. Specifically org-agenda and org-ido-switchb are bound to keys
>> that are available after emacs starts up. Before Org loads properly,
>> however, things like the agenda file list and the list of valid tags and
>> TODO keywords are unavailable. That makes it hard to boot emacs and go
>> directly into a call to `org-todo-list': the TODO keywords aren't loaded
>> yet.
>>
>> I've looked into this before but couldn't find a single function that
>> would "boot" my local data. `org-agenda-files' reads the file list, but
>> it doesn't actually parse the files and do all the setup routines.
>>
>> Is there a single-function entry point that I could put in my init
>> files, that would get me where I want to be? ie, in a state as though
>> `org-agenda' had already been called, though it hasn't yet?
>
> I call `org-agenda-list' in my `after-init-hook' but it is not "silent",
> that is, it displays the agenda list.
>
> Best,

Right, just calling the agenda directly will certainly solve the issue,
and I suppose as a member of the Org faithful I should be booting to the
agenda! But it would be nice to get the same effect, but be left in
*scratch*...

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: loading all agenda files at startup
  2014-04-30  8:44   ` Eric Abrahamsen
@ 2014-04-30  8:58     ` Alexander Baier
  2014-04-30  9:11       ` Alexander Baier
  2014-05-03 11:17       ` Eric Abrahamsen
  0 siblings, 2 replies; 6+ messages in thread
From: Alexander Baier @ 2014-04-30  8:58 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: emacs-orgmode

On 2014-04-30 10:44 Eric Abrahamsen wrote:
> Daimrod <daimrod@gmail.com> writes:
>
>> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>>
>> Hi Eric,
>>
>>> I've got a few top-level user commands, related to org, that load at
>>> startup. Specifically org-agenda and org-ido-switchb are bound to keys
>>> that are available after emacs starts up. Before Org loads properly,
>>> however, things like the agenda file list and the list of valid tags and
>>> TODO keywords are unavailable. That makes it hard to boot emacs and go
>>> directly into a call to `org-todo-list': the TODO keywords aren't loaded
>>> yet.
>>>
>>> I've looked into this before but couldn't find a single function that
>>> would "boot" my local data. `org-agenda-files' reads the file list, but
>>> it doesn't actually parse the files and do all the setup routines.
>>>
>>> Is there a single-function entry point that I could put in my init
>>> files, that would get me where I want to be? ie, in a state as though
>>> `org-agenda' had already been called, though it hasn't yet?
>>
>> I call `org-agenda-list' in my `after-init-hook' but it is not "silent",
>> that is, it displays the agenda list.
>>
>> Best,
>
> Right, just calling the agenda directly will certainly solve the issue,
> and I suppose as a member of the Org faithful I should be booting to the
> agenda! But it would be nice to get the same effect, but be left in
> *scratch*...

Maybe hacking around it with something like the following in
'org-agenda-after-show-hook' or some similar hook?

#+begin_src emacs-lisp
(defun my-switch-to-sratch ()
  (switch-to-buffer "*scratch*")
  (delete-other-windows))
#+end_src

HTH,
-- 
Alexander Baier

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: loading all agenda files at startup
  2014-04-30  8:58     ` Alexander Baier
@ 2014-04-30  9:11       ` Alexander Baier
  2014-05-03 11:17       ` Eric Abrahamsen
  1 sibling, 0 replies; 6+ messages in thread
From: Alexander Baier @ 2014-04-30  9:11 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: emacs-orgmode

On 2014-04-30 10:58 Alexander Baier wrote:
> #+begin_src emacs-lisp
> (defun my-switch-to-sratch ()
>   (switch-to-buffer "*scratch*")
>   (delete-other-windows)
    (remove-hook 'org-agenda-after-show-hook 'my-switch-to-scratch)
> )
> #+end_src

I forgot to remove this function again, so it is only run the first time
the agenda is shown.

-- 
Alexander Baier

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: loading all agenda files at startup
  2014-04-30  8:58     ` Alexander Baier
  2014-04-30  9:11       ` Alexander Baier
@ 2014-05-03 11:17       ` Eric Abrahamsen
  1 sibling, 0 replies; 6+ messages in thread
From: Eric Abrahamsen @ 2014-05-03 11:17 UTC (permalink / raw)
  To: emacs-orgmode

Alexander Baier <lexi.baier@gmail.com> writes:

> On 2014-04-30 10:44 Eric Abrahamsen wrote:
>> Daimrod <daimrod@gmail.com> writes:
>>
>>> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>>>
>>> Hi Eric,
>>>
>>>> I've got a few top-level user commands, related to org, that load at
>>>> startup. Specifically org-agenda and org-ido-switchb are bound to keys
>>>> that are available after emacs starts up. Before Org loads properly,
>>>> however, things like the agenda file list and the list of valid tags and
>>>> TODO keywords are unavailable. That makes it hard to boot emacs and go
>>>> directly into a call to `org-todo-list': the TODO keywords aren't loaded
>>>> yet.
>>>>
>>>> I've looked into this before but couldn't find a single function that
>>>> would "boot" my local data. `org-agenda-files' reads the file list, but
>>>> it doesn't actually parse the files and do all the setup routines.
>>>>
>>>> Is there a single-function entry point that I could put in my init
>>>> files, that would get me where I want to be? ie, in a state as though
>>>> `org-agenda' had already been called, though it hasn't yet?
>>>
>>> I call `org-agenda-list' in my `after-init-hook' but it is not "silent",
>>> that is, it displays the agenda list.
>>>
>>> Best,
>>
>> Right, just calling the agenda directly will certainly solve the issue,
>> and I suppose as a member of the Org faithful I should be booting to the
>> agenda! But it would be nice to get the same effect, but be left in
>> *scratch*...
>
> Maybe hacking around it with something like the following in
> 'org-agenda-after-show-hook' or some similar hook?
>
> #+begin_src emacs-lisp
> (defun my-switch-to-sratch ()
>   (switch-to-buffer "*scratch*")
>   (delete-other-windows))
> #+end_src
>
> HTH,

Yup, that's worth considering. I guess I was just hoping to get at the
"plumbing" a little more directly. But yes, on balance this is probably
a better approach.

Thanks,
Eric

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-05-03 11:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-30  8:18 loading all agenda files at startup Eric Abrahamsen
2014-04-30  8:23 ` Daimrod
2014-04-30  8:44   ` Eric Abrahamsen
2014-04-30  8:58     ` Alexander Baier
2014-04-30  9:11       ` Alexander Baier
2014-05-03 11:17       ` Eric Abrahamsen

Code repositories for project(s) associated with this 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).