emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: pietru@caramail.com
To: TRS-80 <lists.trs-80@isnotmyreal.name>
Cc: emacs-orgmode@gnu.org
Subject: Re: Org Capture Menu cannot be fully viewed
Date: Sun, 13 Dec 2020 23:36:13 +0100	[thread overview]
Message-ID: <trinity-c7f8465f-58a8-4196-bd1a-2ce4b80ef06d-1607898973184@3c-app-mailcom-bs09> (raw)
In-Reply-To: <fa9ccb38ce7d0f1c8b3151990d5ae719@isnotmyreal.name>


> Sent: Sunday, December 13, 2020 at 11:00 PM
> From: "TRS-80" <lists.trs-80@isnotmyreal.name>
> To: emacs-orgmode@gnu.org
> Subject: Re: Org Capture Menu cannot be fully viewed
>
> On 2020-12-13 16:02, pietru@caramail.com wrote:
> >
> > Would that apply with respect to inserting long headings or
> > descriptions in org file?
>
> Yes.  If you have not used completing-read, just play around with it a
> bit and you will very quickly see how it works.  It takes a list (Elisp
> data type) as input, on which you can do narrowing selection as you
> type.
>
> Ivy was one of recommendations which I can second, I prefer it's more
> intuitive (to me) interaction style and support for native
> completing-read format.  But there are (many) others, too.
>
> > Example:
> >
> > ;;                "Site_SubType:
> > ;;                   [1a] Settlement > Encampment
> > ;;                   [1a] Settlement > Hamlet or Village
> > ;;                   [1a] Settlement > Town or City
> > [...]
>
> However to make it even simpler to use / maintain your candidate lists,
> I would just put them in a simple plain text file, aligned to left
> margin.  Example:
>
> File name: Site_SubType
>
> [1a] Settlement > Encampment
> [1a] Settlement > Hamlet or Village
> [1a] Settlement > Town or City

That would be my way to attack it, by storing any pre-defined things
with a field and a value in a record master file.

> Then you need a function to read from plain text file with your "list"
> of candidates, and turn that into an (Elisp data type) list:
>
> #+begin_src emacs-lisp
>
> (defun my-file-to-list (file)
>      "Read FILE and return it as a list of strings.
>
>    List items will be split upon newlines."
>      (with-temp-buffer
>        (insert-file-contents file)
>        (split-string (buffer-string) "\n" t)))
>
> #+end_src
>
> You then use the above function (with filename argument) for your
> candidate list in completing-read.  Modifying Jean Louis' earlier
> example, it now becomes:
>
> #+begin_src emacs-lisp
>
>    (completing-read "Choose: "
> 		   (my-file-to-list "/path/to/Site_SubType"))
>
> #+end_src
>
> You can even use this to fill in Org Properties.  Or you can use Org
> Properties similar native completion, although by default that only uses
> whatever values already exist in the buffer (which therefore could be
> "none"), instead of your specified controlled vocabulary file as I used
> above.  I (by far) prefer the controlled vocabulary method, for lots of
> reasons.
>
> Cheers,
> TRS-80
>
>


  reply	other threads:[~2020-12-13 22:38 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-12 18:02 pietru
2020-12-12 22:09 ` TRS-80
2020-12-12 22:46   ` pietru
2020-12-12 23:13     ` TRS-80
2020-12-12 23:30       ` pietru
2020-12-13  0:00         ` TRS-80
2020-12-13  0:10           ` pietru
2020-12-13 11:06   ` Jean Louis
2020-12-13 18:28     ` pietru
2020-12-13 20:37       ` Jean Louis
2020-12-13 20:52         ` TRS-80
2020-12-13 21:02         ` pietru
2020-12-13 21:48           ` Jean Louis
2020-12-13 22:08             ` pietru
2020-12-13 22:20             ` pietru
2020-12-13 22:00           ` TRS-80
2020-12-13 22:36             ` pietru [this message]
2020-12-13 20:32     ` TEC
2020-12-13 21:43       ` Jean Louis
2020-12-13  0:46 ` Tim Cross
2020-12-13  1:32   ` pietru
2020-12-13  2:08     ` pietru
2020-12-13  3:16       ` TRS-80
2020-12-13  3:49         ` pietru
2020-12-13  4:30           ` TRS-80
2020-12-13  9:58             ` pietru
2020-12-13 16:52             ` Jean Louis
2020-12-13 10:24           ` Jean Louis
2020-12-13 18:41             ` pietru
2020-12-13 20:48               ` TRS-80
2020-12-13  4:57         ` pietru
2020-12-13  9:24           ` Christopher Dimech
2020-12-13 23:08           ` TRS-80
2020-12-14  0:04             ` pietru
2020-12-13  9:44       ` Jean Louis
2020-12-13 18:46         ` Christopher Dimech
2020-12-16 18:46         ` No Wayman
2020-12-16 16:58       ` No Wayman
2020-12-13 15:12   ` Jean Louis
2020-12-13 18:08     ` pietru
2020-12-13 20:06     ` Tim Cross
2020-12-13 21:37       ` pietru
2020-12-13 21:57       ` Bastien
2020-12-13 22:31         ` pietru
2020-12-13 23:30         ` Jean Louis
2020-12-13 23:52           ` Bastien
2020-12-13 22:34       ` Jean Louis
2020-12-14 12:41 ` Marco Wahl
2020-12-14 13:00   ` pietru
2020-12-14 13:18     ` Marco Wahl
2020-12-14 20:02   ` Org Capture Menu cannot be fully viewed - Results of testing C-n, C-p, C-v pietru
2020-12-16 21:46     ` Marco Wahl
2020-12-16 23:25       ` pietru

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=trinity-c7f8465f-58a8-4196-bd1a-2ce4b80ef06d-1607898973184@3c-app-mailcom-bs09 \
    --to=pietru@caramail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=lists.trs-80@isnotmyreal.name \
    --subject='Re: Org Capture Menu cannot be fully viewed' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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