emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* agenda view opening multiple buffers
@ 2011-03-27 13:03 Julian Burgos
  2011-03-27 13:58 ` Bernt Hansen
  0 siblings, 1 reply; 9+ messages in thread
From: Julian Burgos @ 2011-03-27 13:03 UTC (permalink / raw)
  To: emacs-orgmode

Dear list,

When asking for an agenda view (C-c a), org mode opens all files in
the agenda list in individual buffers.  I keep lots of files in my
list (one per project), so having all those buffers open each time I
visit my agenda is pretty annoying.  Is there a way to make org mode
not open each file in a buffer (or close the buffers after reading the
file) when asking for an agenda view?
Thanks,

Julian

-- 
Julian Mariano Burgos
Hafrannsóknastofnunin/Marine Research Institute
Skúlagata 4, 121 Reykjavík, Iceland
Sími/Telephone : +354-5752037
Bréfsími/Telefax:  +354-5752001
Netfang/Email: julian@hafro.is, jmburgos@uw.edu

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

* Re: agenda view opening multiple buffers
  2011-03-27 13:03 agenda view opening multiple buffers Julian Burgos
@ 2011-03-27 13:58 ` Bernt Hansen
  2011-03-27 14:21   ` Michael Markert
  0 siblings, 1 reply; 9+ messages in thread
From: Bernt Hansen @ 2011-03-27 13:58 UTC (permalink / raw)
  To: Julian Burgos; +Cc: emacs-orgmode

Julian Burgos <jmburgos@uw.edu> writes:

> Dear list,
>
> When asking for an agenda view (C-c a), org mode opens all files in
> the agenda list in individual buffers.  I keep lots of files in my
> list (one per project), so having all those buffers open each time I
> visit my agenda is pretty annoying.  Is there a way to make org mode
> not open each file in a buffer (or close the buffers after reading the
> file) when asking for an agenda view?
> Thanks,
>
> Julian

Hi Julian,

I think 'e' in the agenda is supposed to exit the agenda and close
automatically opened agenda files.

HTH,
-- 
Bernt

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

* Re: Re: agenda view opening multiple buffers
  2011-03-27 13:58 ` Bernt Hansen
@ 2011-03-27 14:21   ` Michael Markert
  2011-03-27 14:51     ` Julian Burgos
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Markert @ 2011-03-27 14:21 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: Julian Burgos, emacs-orgmode

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

On 27 Mar 2011, Bernt Hansen wrote:
> Julian Burgos <jmburgos@uw.edu> writes:
>
>> Dear list,
>>
>> When asking for an agenda view (C-c a), org mode opens all files in
>> the agenda list in individual buffers.  I keep lots of files in my
>> list (one per project), so having all those buffers open each time I
>> visit my agenda is pretty annoying.  Is there a way to make org mode
>> not open each file in a buffer (or close the buffers after reading the
>> file) when asking for an agenda view?
>> Thanks,
>>
>> Julian
>
> Hi Julian,
>
> I think 'e' in the agenda is supposed to exit the agenda and close
> automatically opened agenda files.

It's `x'. But I think Julian meant that the buffers should be closed
automatically and not open at least as long as the agenda is shown.

For the original issue I think the following would help:
#+begin_src emacs-lisp
(defun project-agenda (&optional args keys restriction)
  (interactive)
  (let ((org-agenda-files '("~/project-file1"
                            "~/project-file2")))
    (org-agenda args keys restriction)))
#+end_src

Or pressing `<' in the prompt buffer, for more see (describe-function
'org-agenda)

Michael

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: Re: agenda view opening multiple buffers
  2011-03-27 14:21   ` Michael Markert
@ 2011-03-27 14:51     ` Julian Burgos
  2011-03-27 18:55       ` Manish
  0 siblings, 1 reply; 9+ messages in thread
From: Julian Burgos @ 2011-03-27 14:51 UTC (permalink / raw)
  To: Michael Markert; +Cc: Bernt Hansen, emacs-orgmode

Thanks.  Using x is good enough for now.  I´ll explore also Michael´s
suggestions.  It would be good to have the agenda open in a buffer
without having all the agenda files opened too.

On Sun, Mar 27, 2011 at 2:21 PM, Michael Markert
<markert.michael@googlemail.com> wrote:
> On 27 Mar 2011, Bernt Hansen wrote:
>> Julian Burgos <jmburgos@uw.edu> writes:
>>
>>> Dear list,
>>>
>>> When asking for an agenda view (C-c a), org mode opens all files in
>>> the agenda list in individual buffers.  I keep lots of files in my
>>> list (one per project), so having all those buffers open each time I
>>> visit my agenda is pretty annoying.  Is there a way to make org mode
>>> not open each file in a buffer (or close the buffers after reading the
>>> file) when asking for an agenda view?
>>> Thanks,
>>>
>>> Julian
>>
>> Hi Julian,
>>
>> I think 'e' in the agenda is supposed to exit the agenda and close
>> automatically opened agenda files.
>
> It's `x'. But I think Julian meant that the buffers should be closed
> automatically and not open at least as long as the agenda is shown.
>
> For the original issue I think the following would help:
> #+begin_src emacs-lisp
> (defun project-agenda (&optional args keys restriction)
>  (interactive)
>  (let ((org-agenda-files '("~/project-file1"
>                            "~/project-file2")))
>    (org-agenda args keys restriction)))
> #+end_src
>
> Or pressing `<' in the prompt buffer, for more see (describe-function
> 'org-agenda)
>
> Michael
>



-- 
Julian Mariano Burgos
Hafrannsóknastofnunin/Marine Research Institute
Skúlagata 4, 121 Reykjavík, Iceland
Sími/Telephone : +354-5752037
Bréfsími/Telefax:  +354-5752001
Netfang/Email: julian@hafro.is, jmburgos@uw.edu

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

* Re: Re: agenda view opening multiple buffers
  2011-03-27 14:51     ` Julian Burgos
@ 2011-03-27 18:55       ` Manish
  2011-03-28 15:18         ` Carsten Dominik
  0 siblings, 1 reply; 9+ messages in thread
From: Manish @ 2011-03-27 18:55 UTC (permalink / raw)
  To: Julian Burgos; +Cc: Bernt Hansen, emacs-orgmode, Michael Markert

On Sun, Mar 27, 2011 at 8:21 PM, Julian Burgos wrote:
> Thanks.  Using x is good enough for now.  I´ll explore also Michael´s
> suggestions.  It would be good to have the agenda open in a buffer
> without having all the agenda files opened too.
>

Following code should do what you want (I think).

#+begin_src emacs-lisp
;; function code copied from definition of org-agenda-exit
  (add-hook 'org-finalize-agenda-hook
            (lambda ()
              (interactive)
              (org-release-buffers org-agenda-new-buffers)
              (setq org-agenda-new-buffers nil)))
#+end_src

HTH
-- 
Manish

> On Sun, Mar 27, 2011 at 2:21 PM, Michael Markert
> <markert.michael@googlemail.com> wrote:
>> On 27 Mar 2011, Bernt Hansen wrote:
>>> Julian Burgos <jmburgos@uw.edu> writes:
>>>
>>>> Dear list,
>>>>
>>>> When asking for an agenda view (C-c a), org mode opens all files in
>>>> the agenda list in individual buffers.  I keep lots of files in my
>>>> list (one per project), so having all those buffers open each time I
>>>> visit my agenda is pretty annoying.  Is there a way to make org mode
>>>> not open each file in a buffer (or close the buffers after reading the
>>>> file) when asking for an agenda view?
>>>> Thanks,
>>>>
>>>> Julian
>>>
>>> Hi Julian,
>>>
>>> I think 'e' in the agenda is supposed to exit the agenda and close
>>> automatically opened agenda files.
>>
>> It's `x'. But I think Julian meant that the buffers should be closed
>> automatically and not open at least as long as the agenda is shown.
>>
>> For the original issue I think the following would help:
>> #+begin_src emacs-lisp
>> (defun project-agenda (&optional args keys restriction)
>>  (interactive)
>>  (let ((org-agenda-files '("~/project-file1"
>>                            "~/project-file2")))
>>    (org-agenda args keys restriction)))
>> #+end_src
>>
>> Or pressing `<' in the prompt buffer, for more see (describe-function
>> 'org-agenda)
>>
>> Michael
>>
>
>
>
> --
> Julian Mariano Burgos
> Hafrannsóknastofnunin/Marine Research Institute
> Skúlagata 4, 121 Reykjavík, Iceland
> Sími/Telephone : +354-5752037
> Bréfsími/Telefax:  +354-5752001
> Netfang/Email: julian@hafro.is, jmburgos@uw.edu
>
>

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

* Re: Re: agenda view opening multiple buffers
  2011-03-27 18:55       ` Manish
@ 2011-03-28 15:18         ` Carsten Dominik
  2011-03-28 18:30           ` Manish
  0 siblings, 1 reply; 9+ messages in thread
From: Carsten Dominik @ 2011-03-28 15:18 UTC (permalink / raw)
  To: Manish; +Cc: Julian Burgos, Bernt Hansen, emacs-orgmode, Michael Markert


On 27.3.2011, at 20:55, Manish wrote:

> On Sun, Mar 27, 2011 at 8:21 PM, Julian Burgos wrote:
>> Thanks.  Using x is good enough for now.  I´ll explore also Michael´s
>> suggestions.  It would be good to have the agenda open in a buffer
>> without having all the agenda files opened too.
>> 
> 
> Following code should do what you want (I think).
> 
> #+begin_src emacs-lisp
> ;; function code copied from definition of org-agenda-exit
>  (add-hook 'org-finalize-agenda-hook
>            (lambda ()
>              (interactive)
>              (org-release-buffers org-agenda-new-buffers)
>              (setq org-agenda-new-buffers nil)))
> #+end_src

This will make the agenda disfunctional.  Each line in the agenda contains a pointer to the entry the line was derived from, so remote editing etc will stop working.

Exiting with "x" is the much better solution.

HTH

- Carsten

> 
> HTH
> -- 
> Manish
> 
>> On Sun, Mar 27, 2011 at 2:21 PM, Michael Markert
>> <markert.michael@googlemail.com> wrote:
>>> On 27 Mar 2011, Bernt Hansen wrote:
>>>> Julian Burgos <jmburgos@uw.edu> writes:
>>>> 
>>>>> Dear list,
>>>>> 
>>>>> When asking for an agenda view (C-c a), org mode opens all files in
>>>>> the agenda list in individual buffers.  I keep lots of files in my
>>>>> list (one per project), so having all those buffers open each time I
>>>>> visit my agenda is pretty annoying.  Is there a way to make org mode
>>>>> not open each file in a buffer (or close the buffers after reading the
>>>>> file) when asking for an agenda view?
>>>>> Thanks,
>>>>> 
>>>>> Julian
>>>> 
>>>> Hi Julian,
>>>> 
>>>> I think 'e' in the agenda is supposed to exit the agenda and close
>>>> automatically opened agenda files.
>>> 
>>> It's `x'. But I think Julian meant that the buffers should be closed
>>> automatically and not open at least as long as the agenda is shown.
>>> 
>>> For the original issue I think the following would help:
>>> #+begin_src emacs-lisp
>>> (defun project-agenda (&optional args keys restriction)
>>> (interactive)
>>> (let ((org-agenda-files '("~/project-file1"
>>>                           "~/project-file2")))
>>>   (org-agenda args keys restriction)))
>>> #+end_src
>>> 
>>> Or pressing `<' in the prompt buffer, for more see (describe-function
>>> 'org-agenda)
>>> 
>>> Michael
>>> 
>> 
>> 
>> 
>> --
>> Julian Mariano Burgos
>> Hafrannsóknastofnunin/Marine Research Institute
>> Skúlagata 4, 121 Reykjavà k, Iceland
>> SÃ mi/Telephone : +354-5752037
>> Bréfsà mi/Telefax:  +354-5752001
>> Netfang/Email: julian@hafro.is, jmburgos@uw.edu
>> 
>> 
> 

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

* Re: Re: agenda view opening multiple buffers
  2011-03-28 15:18         ` Carsten Dominik
@ 2011-03-28 18:30           ` Manish
  2011-03-28 18:47             ` Carsten Dominik
  0 siblings, 1 reply; 9+ messages in thread
From: Manish @ 2011-03-28 18:30 UTC (permalink / raw)
  To: Carsten Dominik
  Cc: Julian Burgos, Bernt Hansen, emacs-orgmode, Michael Markert

On Mon, Mar 28, 2011 at 8:48 PM, Carsten Dominik wrote:
>
> On 27.3.2011, at 20:55, Manish wrote:
>
>> On Sun, Mar 27, 2011 at 8:21 PM, Julian Burgos wrote:
>>> Thanks.  Using x is good enough for now.  I´ll explore also Michael´s
>>> suggestions.  It would be good to have the agenda open in a buffer
>>> without having all the agenda files opened too.
>>>
>>
>> Following code should do what you want (I think).
>>
>> #+begin_src emacs-lisp
>> ;; function code copied from definition of org-agenda-exit
>>  (add-hook 'org-finalize-agenda-hook
>>            (lambda ()
>>              (interactive)
>>              (org-release-buffers org-agenda-new-buffers)
>>              (setq org-agenda-new-buffers nil)))
>> #+end_src
>
> This will make the agenda disfunctional.  Each line in the agenda contains a pointer to the entry the line was derived from, so remote editing etc will stop working.
>
> Exiting with "x" is the much better solution.
>


Thanks for pointing that out.  Wouldn't "x" that close the agenda as
well along with the buffers?  OP said: " It would be good to have the
agenda open in a buffer without having all the agenda files opened
too."  May be a special custom agenda command that calls the above
lambda function at the end would work better by limiting the damaged
behaviour to just one command?

/manish

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

* Re: Re: agenda view opening multiple buffers
  2011-03-28 18:30           ` Manish
@ 2011-03-28 18:47             ` Carsten Dominik
  2011-03-30 18:59               ` Matt Lundin
  0 siblings, 1 reply; 9+ messages in thread
From: Carsten Dominik @ 2011-03-28 18:47 UTC (permalink / raw)
  To: Manish; +Cc: Julian Burgos, Bernt Hansen, emacs-orgmode, Michael Markert


On 28.3.2011, at 20:30, Manish wrote:

> On Mon, Mar 28, 2011 at 8:48 PM, Carsten Dominik wrote:
>> 
>> On 27.3.2011, at 20:55, Manish wrote:
>> 
>>> On Sun, Mar 27, 2011 at 8:21 PM, Julian Burgos wrote:
>>>> Thanks.  Using x is good enough for now.  I´ll explore also Michael´s
>>>> suggestions.  It would be good to have the agenda open in a buffer
>>>> without having all the agenda files opened too.
>>>> 
>>> 
>>> Following code should do what you want (I think).
>>> 
>>> #+begin_src emacs-lisp
>>> ;; function code copied from definition of org-agenda-exit
>>>  (add-hook 'org-finalize-agenda-hook
>>>            (lambda ()
>>>              (interactive)
>>>              (org-release-buffers org-agenda-new-buffers)
>>>              (setq org-agenda-new-buffers nil)))
>>> #+end_src
>> 
>> This will make the agenda disfunctional.  Each line in the agenda contains a pointer to the entry the line was derived from, so remote editing etc will stop working.
>> 
>> Exiting with "x" is the much better solution.
>> 
> 
> 
> Thanks for pointing that out.  Wouldn't "x" that close the agenda as
> well along with the buffers?

Yes.

>  OP said: " It would be good to have the
> agenda open in a buffer without having all the agenda files opened
> too."  May be a special custom agenda command that calls the above
> lambda function at the end would work better by limiting the damaged
> behaviour to just one command?

No.  The agenda buffer needs the source buffers alive to function.

- Carsten

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

* Re: agenda view opening multiple buffers
  2011-03-28 18:47             ` Carsten Dominik
@ 2011-03-30 18:59               ` Matt Lundin
  0 siblings, 0 replies; 9+ messages in thread
From: Matt Lundin @ 2011-03-30 18:59 UTC (permalink / raw)
  To: Carsten Dominik
  Cc: Julian Burgos, Bernt Hansen, emacs-orgmode, Michael Markert

Carsten Dominik <carsten.dominik@gmail.com> writes:

>> Thanks for pointing that out.  Wouldn't "x" that close the agenda as
>> well along with the buffers?
>
> Yes.
>
>>  OP said: " It would be good to have the
>> agenda open in a buffer without having all the agenda files opened
>> too."  May be a special custom agenda command that calls the above
>> lambda function at the end would work better by limiting the damaged
>> behaviour to just one command?
>
> No.  The agenda buffer needs the source buffers alive to function.

In addition, closing agenda buffers with "x" means that the next time
ones call the agenda, Emacs has to load and parse all those files again,
which takes much longer than simply rescanning buffers in memory.

In other words, the expense of keeping the buffers open (a relatively
small amount of RAM) is much less than the expense (disk IO, processing,
time) of reloading the files each time one calls the agenda. In
addition, pressing "x" will interrupt clocking.

If the problem is difficulty scanning through and navigating to buffers
in the Buffer List, ido offers a nice way to switch buffers quickly. 

In my experience, Emacs is better savored as a sumptuous feast than as a
spartan repast. The more dishes there are on the table, the merrier
everyone is. :)

(length (buffer-list)) => 178

And I haven't started ERC yet. ;)

Best,
Matt

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

end of thread, other threads:[~2011-03-30 18:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-27 13:03 agenda view opening multiple buffers Julian Burgos
2011-03-27 13:58 ` Bernt Hansen
2011-03-27 14:21   ` Michael Markert
2011-03-27 14:51     ` Julian Burgos
2011-03-27 18:55       ` Manish
2011-03-28 15:18         ` Carsten Dominik
2011-03-28 18:30           ` Manish
2011-03-28 18:47             ` Carsten Dominik
2011-03-30 18:59               ` Matt Lundin

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