emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: TRS-80 <lists.trs-80@isnotmyreal.name>
To: emacs-orgmode@gnu.org
Subject: Re: Org Capture Menu cannot be fully viewed
Date: Sun, 13 Dec 2020 15:48:43 -0500	[thread overview]
Message-ID: <66b6496483c38dd46436fdf360cb5b2e@isnotmyreal.name> (raw)
In-Reply-To: <trinity-e12bbbd0-61d7-43b3-8755-9c6a75ce5d3a-1607884873499@3c-app-mailcom-bs09>

On 2020-12-13 13:41, pietru@caramail.com wrote:
>> From: "Jean Louis" <bugs@gnu.support>
>> 
>> ;; Create hash
>> (setq my-files-hash (make-hash-table))
>> 
>> ;; Try putting something into the hash, define your files and their 
>> meanings
>> (puthash (intern "One file") "~/tmp/new.org" my-files-hash)
>> (puthash (intern "Something else") "~/tmp/else.org" my-files-hash)
>> ;; You could continue feeding various files while only making sure
>> ;; that they description differ from each other
>> 
>> ;; Take it back from hash to verify
>> (gethash (intern "Something else") my-files-hash)
>> "~/tmp/else.org"
>> 
>> ;; Construct list of semantic meanings of those files
>> (hash-table-keys my-files-hash)
>> => (One\ file Something\ else)
>> 
>> (defun my-capture ()
>>   (interactive)
>>   (let* ((my-files (hash-table-keys my-files-hash))
>> 	 (my-files (mapcar #'symbol-name my-files))
>> 	 (my-selection (completing-read "File to capture: " my-files))
>> 	 (my-selected-file (gethash (intern my-selection) my-files-hash)))
>>     (when selected-file
>>       (find-file selected-file)
>>       (goto-char (point-max))
>>       (insert "\n")
>>       (insert ** ))))
>> 
> 
> I have to take some time to chew into this.
> 
>> Jean
>> 

All due respect, particularly for such an effort, however I think Jean
Louis' solution is far too complex, especially for someone not well
versed in Elisp.  Which I am still assuming, as Pietru have not
explicitly stated so (or not) yet.

My path of questioning was trying to draw out relevent info, with the
end goal of suggesting the right solution.  If that solution is a simple
completing-read then so be it but I am not even sure we have determined
that is the correct (or preferred) solution yet.

In particular, hash tables are not needed with the sorts of numbers of
candidates I think we are talking about here.

Cheers,
TRS-80


  reply	other threads:[~2020-12-13 20:49 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
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 [this message]
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=66b6496483c38dd46436fdf360cb5b2e@isnotmyreal.name \
    --to=lists.trs-80@isnotmyreal.name \
    --cc=emacs-orgmode@gnu.org \
    --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).