Re: Bring up a screen giving option to open a series of orgmode files

2020-11-24 Thread John Sturdy
I've got a rather specialized version of that at
https://github.com/hillwithsmallfields/JCGS-emacs/blob/master/special-setups/tasks/org-agenda-kiosk.el

It's aimed at navigating a collection of org-mode files via the numeric
keypad only, and I wrote it to go with some custom hardware I made (a
screen and keypadded embedded in a corkboard, so I can keep all my "things
to do" lists together, whether on paper or on the computer), hence it
having mappings for a keypad rotated 90degrees!

__John

On Sun, Nov 22, 2020 at 10:02 AM Gerardo Moro 
wrote:

> Basically that :)
> I'm looking for some setup that allows me to open a menu with a list of
> files and shortcut access keys to open them.
>
> Probably somebody has done this before.
>
> Thank you,
> GM
>


Re: [Idea] Org Collections

2019-12-15 Thread John Sturdy
That seems hierarchical, which is ok (as in org-mode itself) but how about
implementing a more general graph mechanism, which could be used to do this
but more flexibly?

On Sat, 14 Dec 2019, 21:04 Gustav Wikström,  wrote:

> Hi list and all honored readers!
>
> I have an idea. One that I've mentioned before in side notes. And I want
> to emphasize that this still only is an idea. But I want to present this
> idea to you. As a way to gather feedback and get input. Maybe the idea is
> stupid!? Maybe you think it's already solved? Or maybe it's not, and lots
> of you resonate with it as well. In any case, please let me know what you
> think on the piece below!
>
> 
>
>  ORG MODE: COLLECTIONS/PROJECTS
>
> Gustav Wikström
> 
>
>
> Table of Contents
> _
>
> 1. Motivation
> 2. Idea
> 3. Benefit
> .. 1. For the user
> .. 2. For the developer
> 4. Example use cases
> .. 1. Separate actions from reference
> .. 2. Work / Personal separation
> .. 3. Separated book library
> .. 4. More?
> 5. Risks and challenges
> .. 1. Which configuration to use?
> .. 2. Should project config allow local variables?
> . 1. How to initialize the local variables?
> .. 3. Conflict with other customizations
> .. 4. Files that belong to multiple collections
> .. 5. Dynamic lists of files and folders for a collection?
> 6. Alternatives
> 7. References
>
>
> 1 Motivation
> 
>
>   Org mode is more than a major mode for emacs buffers. That has been
>   clear for quite some time. Org mode can operate on sets of files.
>   Consolidate TODO's and calendar information into custom views. Publish
>   sets of files. To do this Org mode assumes that the user has a
>   configuration for each of those features. Each feature is responsible
>   for maintaining its own context. And almost all of that context has
>   to be set globally. So even though Org mode has commands and features
>   that operate on sets of files and folders it has not yet developed
>   that in a congruent, extensible and composable way. Thus, for the
>   sanity of our users and developers I think it's time to ... introduce
>   another concept! One that hopefully can simplify things both for users
>   and developers.
>
>
> 2 Idea
> ==
>
>   I propose to introduce `Collection' as a concept in the realm of Org
>   mode. [1]
>
>   An Org mode collection is defined as the combination of:
>   1. A short name and description
>   2. A collection of Org mode documents
>   3. A collection of files and/or folders called attachments and
>  attachment-locations for the project
>   4. A collection of configurations for the given project
>
>   Globally available collections are defined in a list,
>   `org-collections'. Org mode should include a safe parameter that can
>   be set as a folder customization to the local active project,
>   `org-collections-active'. The default should be to the first entry in
>   `org-collections' unless customized. This local parameter would be
>   used to instruct Emacs and Org mode on which collection is active.
>   Only one collection at a time can be active.
>
>   Org agenda should use `org-collections-active' as default for the
>   collection of Org mode documents to operate on. Org agenda should get
>   a new command to switch between active projects.
>
>   I'm thinking that there could be a special Emacs major mode for the
>   collection as well, called "Org collections mode". Not sure exactly
>   what to display and how to represent the project there... But
>   certainly some kind of list of included documents and attachments.
>   When in that mode there should possibly be single key
>   keyboard-shortcuts to the most important features that operate on the
>   collection. And switch between them.
>
>
> 3 Benefit
> =
>
> 3.1 For the user
> 
>
>   A user would gain mainly two benefits as I can see right now:
>   1. The ability to clearly define (multiple) collections of files that
>  belong together across org mode, with unique configurations.
>   2. Less global configuration state to manage and worry about!
>
>   The second point might not look like much but is sooo important! Most
>   programmers know that global state should be avoided. Putting things
>   in a context most of the time makes things better. And if we can
>   configure Org mode connected to a context it makes it much more useful
>   for those who use Org mode for multiple purposes.
>
>   The first point is equally important in my opinion. Today one must
>   configure Org mode per feature. If you want to configure publishing
>   you do that globally. If you want to configure the agenda, you have to
>   do that globally as well. If you want to define a location for
>   attachments, do it globally! What about custom TODO-keywords? Do it
>   globally! Track ID-locations? Define a 

Re: Exporting agendas as org-mode files?

2019-11-18 Thread John Sturdy
Thanks, I'll try switching to org-ql for my main queries, and then build on
that.

__John

On Wed, Nov 13, 2019 at 11:07 AM Mikhail Skorzhinskii 
wrote:

> Adam Porter  writes:
>
>  > org-ql would make this pretty easy, I think.  Use an org-ql query to
>  > select entries, and for the :action function, use a simple function that
>  > copies the entry or subtree and yanks it into a buffer.  Then save that
>  > buffer to a file.
>
> Yes, it is.
>
> Although just picking some entries from huge org-mode base and write
> them into separate file is a base feature of org-mode itself. org-ql
> package just making the process of finding entries of interest much
> easier and faster.
>
> John Sturdy  writes:
>
>   > I'd like to be able to export agendas as org-mode files
>
> If you're looking into the pure org-mode approach, then what you're
> looking for ~org-agenda-write~ function or custom agenda view written
> with exporting in mind. In order to export to org all you need to do is
> to specify .org extension.
>
>   https://orgmode.org/manual/Exporting-agenda-views.html
>
> I was using this small snippet to export some of my agenda seacrhes:
>
> #+begin_src emacs-lisp
>   (org-agenda nil "a")
>   (org-agenda-write "~/example.org" nil t "*Org Agenda*")
> #+end_src
>
> Be aware that this will regenerate your *Org Agenda* buffer, so either
> use sticky agendas or export agendas in separate emacs process.
>
>
> But I would highly recommend using org-ql for these purpouses. Besides
> pretty solid and easy-to-use interface it is noticably faster.
>
> Here is the snippet I am currently using to export all subtress directly
> tagged with :info: to the separate file. (Sorry for the lack of proper
> parametrisation).
>
> #+begin_src emacs-lisp
> (defun org-user/store-info ()
>   (let ((file "~/org/cals/info.org")
> (heading (org-format-outline-path (org-get-outline-path t
> (save-excursion
>   (org-copy-subtree)
>   (find-file file)
>   (end-of-buffer)
>   (org-paste-subtree)
>   (org-edit-headline heading
>
> (defun org-user/export-info ()
>   "Export all information entries into one file."
>   (find-file "~/org/cals/info.org")
>   (erase-buffer)
>   (insert "#+TITLE: Information")
>   (org-ql-select
> (org-agenda-files)
> '(tags-local "info")
> :action #'org-user/store-info)
>   (save-buffer))
> #+end_src
>
> You need to invoke (org-user/export-info), obviosuly.
>


Exporting agendas as org-mode files?

2019-11-12 Thread John Sturdy
I'd like to be able to export agendas as org-mode files, so that I can use
the agenda system's ability to make subsets of my tasks, then sync those
with Google tasks using michel-orgmode (so I don't end up with hundreds of
tasks to look through on my phone, but only the ones with tags such as
:soon: etc).  Is there an existing command for this?  I've tried the
manual, the wiki and the function names in the code, and nothing looks like
it will do this.  I don't mind writing it myself, I'm quite familiar with
emacs-lisp, but I'd rather pick up anything existing if there is one.

__John