This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-02
Channels
- # babashka (117)
- # babashka-sci-dev (6)
- # beginners (34)
- # biff (2)
- # calva (7)
- # clj-kondo (27)
- # clojure (6)
- # clojure-dev (8)
- # clojure-europe (41)
- # clojure-israel (1)
- # clojure-nl (1)
- # clojure-norway (2)
- # clojure-uk (1)
- # clojurescript (22)
- # cursive (3)
- # datascript (12)
- # dev-tooling (4)
- # emacs (13)
- # hyperfiddle (60)
- # introduce-yourself (8)
- # joyride (9)
- # lsp (46)
- # malli (3)
- # mranderson (75)
- # off-topic (40)
- # pathom (9)
- # pedestal (4)
- # reagent (11)
- # reitit (18)
- # releases (2)
- # shadow-cljs (81)
- # squint (18)
Hi!
I've got a Clojure CLI that can emit lines of EDN. I want to select one of those lines with Vertico. Then use :uuid
and :title
from that line to call another CLI command.
Any suggestions on how to model the data on the Emacs lisp side? Have anyone of you done anything similar?
Sample data in thread.
$ ./play.clj relations :from files :to lines | shuf | head -n 4
{:slug "bitemporal-worldview", :title "A bitemporal worldview", :readiness :wtf-is-this, :lang :en}
{:slug "dots", :title "dots", :readiness :wtf-is-this, :author-url "", :created "2022-07-24", :builder :no-op, :lang :en}
{:slug "attention-later", :title "attention-later", :readiness :wtf-is-this, :uuid "0be4b1f7-e4dd-4209-981b-797795be7533", :author-url "", :created "2022-12-19", :lang :en}
{:slug "attention-design", :title "attention design", :readiness :wtf-is-this, :author-url "", :created "2022-07-14", :uuid "0cc48734-e933-44cb-a4e8-2678f125f6df", :lang :en}
> Deprecated > This library is no longer maintained as I consider it replaced by https://github.com/clojure-emacs/parseedn.
Gotcha. So you'd just work with EDN all the way, no conversion to Emacs lisp lists and symbols and strings?
Have to parse it to an elisp data structure for completing-read
but then you can call the shell-command
with the selected item
parseedn.el
is looking absolutely great! It even includes serialization. π
https://github.com/clojure-emacs/parseedn/blob/main/parseedn.el
parseedn.el
is looking absolutely great! It even includes serialization. π
https://github.com/clojure-emacs/parseedn/blob/main/parseedn.el
Hello π
Has anyone come across a way to fold/un-fold all the top level forms in the buffer except for comment
blocks?
(any hs-minor-mode
config, any other package, a custom function?)
I took this https://www.emacswiki.org/emacs/hide-region.el and updated it. Then here is a command. The resulting visuals are slightly clunky still I suppose.
(defun hide-all-toplevel-forms-except-comments ()
"Undo it with `hide-region-unhide' (use universal argument)."
(interactive)
(save-excursion
(goto-char (point-min))
(while (not (eobp))
(forward-list)
(unless (save-excursion
(beginning-of-defun)
(looking-at-p "(comment"))
(let ((bounds (bounds-of-thing-at-point 'defun)))
(hide-region-hide (car bounds) (cdr bounds)))))))
actually when I mull over your use case maybe you want to say narrow-to-defun
or similar inside your comment block
Hi @U02CV2P4J6S thank you for replying! I think this might the kind of thing Iβm looking forβneed to see if I can adapt it to my needs π
![catjam](https://emoji.slack-edge.com/T03RZGPFR/catjam/50c2b0ff9e925462.gif)