emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Temporarily setting agenda files list, cleaning up
@ 2019-05-27 12:04 Christoph Groth
  2019-05-27 12:46 ` John Kitchin
  2019-05-27 18:51 ` Thomas Plass
  0 siblings, 2 replies; 4+ messages in thread
From: Christoph Groth @ 2019-05-27 12:04 UTC (permalink / raw)
  To: emacs-orgmode

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

Hello,

I would like to expand my use of Org for notes, and to this end spread
project-specific org files across my home directory (currently I'm using
a central directory with one agenda file per year).  For obvious
reasons, I can't possibly include all these org files in
org-agenda-files permanently and have them open in Emacs all the time.

Instead, I'm thinking of a setup as follows: I'll reserve
org-agenda-files for active projects only.  But there will be many other
org files (for projects that are finished or dormant, general notes,
etc.), that I would like to be able to search as well.

I saw that some people have solved this problem with a custom search
solution, even using a database [1], but I think that for my purposes a
simpler solution mostly using Org's built-in functionality will do.  I'm
also aware of org-agenda-text-search-extra-files, keeping all my extra
files there is not satisfactory, because the search possibilities are
limited (and otherwise it poses the same questions that I will ask
further below).

Instead, I imagine a custom Emacs command to launch an agenda with
org-agenda-files that is temporarily set to a list of files that depends
on the current context.  For starters, this list could contain all the
org files under the current directory:

(split-string (shell-command-to-string "find `pwd`/* -name '*.org' -type f") "\n" t)

This way, I could easily explore the org files that belong to specific
subsets of my activities and interests.  I could also search *all* my
notes, when needed (for now the time this takes should not be a
problem).

I wonder if anyone has tried a similar setup and would be willing to
share his experience and ideas.  Specifically, I wonder about the
following points:

* Do you see any obvious problems with the above idea?

* In Elisp, what is the best way to temporarily set org-agenda-files and
  later reset it back to the standard value?

* How to automatically close unneeded org buffers that were opened for
  the temporarily agenda?  The command org-agenda-exit is not
  satisfactory, because it also kills the buffers that one has just
  found due to the search, and also it's not automatic.  Perhaps one
  could close the buffers immediately once the agenda view has been
  created?

Thanks
Christoph

[1] https://kitchingroup.cheme.cmu.edu/blog/2017/01/03/Find-stuff-in-org-mode-anywhere/

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

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

end of thread, other threads:[~2019-05-28 15:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-27 12:04 Temporarily setting agenda files list, cleaning up Christoph Groth
2019-05-27 12:46 ` John Kitchin
2019-05-27 18:51 ` Thomas Plass
2019-05-28 15:12   ` Christoph Groth

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).