emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Org Capture Menu cannot be fully viewed


From: No Wayman
Subject: Re: Org Capture Menu cannot be fully viewed
Date: Wed, 16 Dec 2020 11:58:38 -0500
User-agent: mu4e 1.5.6; emacs 28.0.50


Pietru:

If you are extensively using Org's capture templates I suggest taking a look at:

https://github.com/progfolio/doct

A brief summary of some of the benefits it provides:

- Allows capture template inheritance
- Checks for certain errors in template declarations *before* capture.
- Automatically computes the keys for nested menus
- Makes per-template hooks/contexts easy to declare.
- Allows for storing custom metadata with templates which can be used within templates - Declarative: Your template declarations will be easier to read/share.

Taking the list of templates provided earlier as an example,
It could utilize nested menus/inheritance like so:

#+begin_src emacs-lisp :lexical t
(doct
'( :group "Archaeology"
   :file "~/histr/archaeol.org"
   :template "* Site_Type: %?\n %T\n"
   :children (("Research" :keys "r"
               :children (("Bioarchaeological"     :keys "b")
                          ("Collections"           :keys "c")
                          ("Design/Data Recovery"  :keys "d")
                          ("Environment"           :keys "e")
                          ("Ethnographic"          :keys "g")
                          ("Ethnohistoric"         :keys "h")
                          ("Historic Eval/Testing" :keys "t")))
              ("Survey" :keys "s"
               :children (("Architectural"       :keys "a")
                          ("Geophysical"         :keys "g")
                          ("Reconnaissance"      :keys "r")
                          ("Recovery/Excavation" :keys "R")))
              ("Consultation"                      :keys "c")
              ("Architectural Documentation"       :keys "d")
              ("Site Stabilization"                :keys "e")
              ("Ground Disturbance Monitoring"     :keys "g")
              ("Heritage Management"               :keys "h")
              ("Records Search/Inventory Checking" :keys "i")
              ("Methodology, Theory, Synthesis"    :keys "m")
              ("Archaeological Overview"           :keys "o")
              ("Remote Sensing"                    :keys "R")
              ("Site Stewardship Monitoring"       :keys "d"))))
#+end_src

Each template inherits the :file and :template values.
The keys for the "Research" and "Survey" children templates are computed by doct, so changing the whole groups prefix key only requires a change on the parent template's :keys.

I haven't demoed the custom metadata in this example as I don't know your exact use case,
but there is an example in the documentation:

https://github.com/progfolio/doct#custom-data


Hope this is useful for you.

~ Nick



reply via email to

[Prev in Thread] Current Thread [Next in Thread]