From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Groth Subject: Temporarily setting agenda files list, cleaning up Date: Mon, 27 May 2019 14:04:09 +0200 Message-ID: <87v9xwf6iu.fsf@neron> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:43401) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVEMS-00037r-To for emacs-orgmode@gnu.org; Mon, 27 May 2019 08:04:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVEMR-0004lT-NF for emacs-orgmode@gnu.org; Mon, 27 May 2019 08:04:16 -0400 Received: from mail6.webfaction.com ([31.170.123.134]:56294 helo=smtp.webfaction.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVEMR-0004ha-Hm for emacs-orgmode@gnu.org; Mon, 27 May 2019 08:04:15 -0400 Received: from localhost (s8s38-1-88-180-226-12.fbx.proxad.net [88.180.226.12]) by smtp.webfaction.com (Postfix) with ESMTPSA id 17FAF602CDD92 for ; Mon, 27 May 2019 12:03:41 +0000 (UTC) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain 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/ --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEUimQV/rXmWU8TwiKw/FH9ZgPNTUFAlzr0jkACgkQw/FH9ZgP NTUWTQ//Yrtpj9s3v7ONantOw5DCp3/+3J+q00htEdH4SUXBagP6NkKq4qOtBQH4 3BXTK1So6pHVgtnzDO6SweUCqH5uZAC3qBgs81A24lY+b5Hwcn4NgWKtOxBymGxO rgB4HZDQd8tTOnqgjg/s4sLETOz+RLDaKc9aLEky0sdB+ch3LlDtPyik4DLUGeOv xyu9yoZVehIv9gkWr9tLRTMDS0Gg5oNOjksLv5QFGoS/mxjKwgXp0XQYUyFpCS2t DFypiqkACDDm8mPNqgyu0Si0KrMa36tAoVNHnfVw7BwGgLNVvXetN1LVzXLO1jG6 yAtrdwCXPEWxE1hJcVNUtIEQwssS67NvCg0JPST5rKnFiEMdFdERXr612Rh1Hd+k DM/oS+NAzS32Ik6l7ncMMpKiVYm8nyYNYjAR58U/fB0gg5PFd6gH9sDZ8h44hGy2 p+TicY4JRGr3LFh80C4vQ0+jq0HQnnXR9r5qq6DIn3E+dxLKjni3XCr03l6QkV/J KgoMfgZkGcBjePg9EDFqnz33etoHCL0AyQpzaVTubwOi5xc2Vr8Z8krk2ujDHzCz i/DPTPk0aI4CKu6uBmJTVrjb6C12e1yllP9ArDsyzwTuANubqz/4QIgyixX66ZJ4 2GMorBEego/OSUY3ua5gzIy4o0s6WpypVK77FH/EMlM9+o0eOTI= =uyJg -----END PGP SIGNATURE----- --=-=-=--