[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: On "write function for each reference"
From: |
Jean Louis |
Subject: |
Re: On "write function for each reference" |
Date: |
Sun, 8 Jan 2023 09:57:05 +0300 |
User-agent: |
Mutt/2.2.9+54 (af2080d) (2022-11-21) |
* Eduardo Ochs <eduardoochs@gmail.com> [2023-01-08 04:37]:
>
> (find-kla-intro)
eval: Symbol’s function definition is void: find-kla-intro
In that last e-mail, I understand you tried generating hyperlinks and
sending such to your notes file.
Personally I like to insist on creating elementary objects:
Elementary Objects:
https://www.dougengelbart.org/content/view/110/460/#2a1a
in structured, organized way. If I create one time an object like:
(eek "M-j")
then I would not need to create this object ever again, but just
include it where I need it and in swift manner.
Do you know the tool `fzf'?
Or ivy-mode? helm-mode?
Try:
grep --line-number --binary-files=without-match "eev" *.el | fzf
--delimiter=':' --preview 'less {1}'
in your eev directory and try typing other words.
That tool shows how quick it can be to find elementary objects.
If object is of type "eev" or Emacs Lisp, then function will know
where to search.
(defun string-to-file-force (string file)
"Prints string into file, matters not if file exists. Returns FILE as file
name."
(with-temp-file file
(insert string))
file)
(defun dmenu-completing-read (prompt collection)
;; &optional predicate require-match initial-input history def
inherit-input-method)
"Uses external `dmenu' command for Emacs completions."
(let* ((collection (concat (string-join collection "\n") "\n"))
(file (string-to-file-force collection "/dev/shm/collection"))
(dmenu "dmenu"))
(with-temp-buffer
(call-process dmenu file (current-buffer) nil "-fn" "DejaVu:pixelsize=30"
"-l" "10" "-i" "-b" "-p" prompt "-nb" "dark goldenrod" "-nb" "black")
(string-trim (buffer-string)))))
Then try:
(setq collection '("2 ÅLAND ISLANDS" "30 BOUVET ISLAND" "41 CAYMAN ISLANDS" "46
CHRISTMAS ISLAND" "47 COCOS (KEELING) ISLANDS" "52 COOK ISLANDS" "70 FALKLAND
ISLANDS (MALVINAS)" "71 FAROE ISLANDS" "94 HEARD ISLAND AND MCDONALD ISLANDS"
"134 MARSHALL ISLANDS" "160 NORFOLK ISLAND" "161 NORTHERN MARIANA ISLANDS"))
;; (dmenu-completing-read "Country: " collection) ➜ "52 COOK ISLANDS"
That is `dmenu' based completion.
At this point you probably don't understand WHY I mention searching,
completion.
It was about elementary objects, and eev generates links, and those
hyperlinks or sexps are objects, they could be saved.
Then objects can be found in blaze. Any `eek' function ever defined
could be found within seconds and inserted in the buffer.
If not saved as elementary objects somewhere, user would be creating
and creating over time possibly duplicate hyperlinks, wasting time
typing, choosing, invoking functions, to duplicate hyperlinks over and
over again.
Same applies for snippets that are too often generated as same, and
then have to be copied, inserted, duplicated, as the snippet of
several functions can be recorded as elementary objects and later
quicklyy inserted where necessary.
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/