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: TRS-80
Subject: Re: Org Capture Menu cannot be fully viewed
Date: Sun, 13 Dec 2020 15:48:43 -0500
User-agent: Roundcube Webmail/1.3.15

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 via email to

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