This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-01-10
Channels
- # announcements (14)
- # beginners (55)
- # calva (4)
- # cider (9)
- # clojure (56)
- # clojure-austin (25)
- # clojure-brasil (1)
- # clojure-dev (29)
- # clojure-europe (44)
- # clojure-mexico (1)
- # clojure-nl (2)
- # clojure-norway (1)
- # clojure-uk (5)
- # clojurescript (15)
- # cursive (9)
- # datomic (5)
- # emacs (30)
- # events (1)
- # graalvm (30)
- # honeysql (17)
- # hyperfiddle (54)
- # introduce-yourself (1)
- # jobs-discuss (6)
- # kaocha (2)
- # leiningen (5)
- # lsp (6)
- # malli (3)
- # missionary (16)
- # off-topic (42)
- # overtone (40)
- # pedestal (2)
- # re-frame (21)
- # shadow-cljs (16)
- # squint (2)
- # tools-deps (14)
An Elisp code style question:
In the https://github.com/scicloj/clay.el Emacs package for the Clay tool, I've been using slashes in file names, just thinking it would make them convenient & readable for Clojure users.
E.g., clay/make-last-sexp
instead of clay-make-last-sexp
.
Before proposing the package for MELPA, I am wondering whether this naming habit diverges too much from the common way of doing things.
Any thoughts?
Should I avoid that?
Is it actually useful?
Never gave me a practical problem in many years of elisping Personally I'd be happy to see it more commonly used!
Typical convention is the second one, but plenty of people use slash namespacing. Not worth worrying about it π
That is so helpful, thanks for your quick feedback!
https://github.com/purcell/package-lint gives me errors such as:
99:0: error: `clay/make-last-sexp' contains a non-standard separator `/', use hyphens instead (see Elisp Coding Conventions).
Since package-lint
seems to be a requirement for a MELPA pull-request, I guess I'll change the slashes to dashes.TIL about p-lint. Guess we should use it in CIDER etc (which predates that linter)
I've seen a lot of things in the form clay/make-last-sexp and this its very useful to identify the source of these functions. It makes it very clear to me this way.
Thanks, it helps to know.
Good afternoon! I need to quickly inspect 131 json files visually in a folder. Iβd like to view them in emacs, and quickly go to the next file, without having to remember the next file name. I found a way to do it with Vim:
vim *.json
:next
:next
:next
...
Vim was then opened with all the files, :next
shows me the next file. Problems:
β’ I had to use Vim, I prefer Emacs
β’ I have to type 5 letters each time I move to the next file. Iβd prefer an action that was one letter.
Any suggestions for how I can solve this in Emacs? Has anyone done something similar?https://github.com/protesilaos/dired-preview might save you having to open them at all, but I agree macro + dired is the way to go otherwise
I think Iβll try using macros* since Iβd like to get more experience using macros. Thank you both! π β€οΈ
oh, man this is totally amazing. I had no idea it would be so simple to do and so easy it would be to use. π π π π
I realise you've already learned used macros to solve this, which is probably way better, but if you use the emacs server, you could also open them all with emacsclient -nw -c *.json
and run server-edit
, which is bound to C-x #
by default, to say you're done editing that file and move on to the next one. When you get to the end of the list it will return you to the terminal prompt. Also, if you just wanted to read them, you can use less *.json
to display each in turn and then :n
to goto the next one (three less characters than vim ;P) or if you've installed bat
then that will display them all in a paginated fashion (like less
) and probably give you syntax highlighting.
@U0P0TMEFJ with your suggestion, I was able to come up with this abomination:
ls sites/*json | xargs -n 1 less
q
to go to next, C-c
to close all.
Abomination modified to work with bat
:
ls sites/*json | xargs -n 1 bat --paging=always
Thanks! And I hope Berlin is treating you as well as ever, if that was your permanent residence when we spoke last summer πI was remote working for a company in Berlin a while ago, but I'm generally UK based π ... I hope your currently location is treating you well too. π
Oslo is nice. We had a great holiday in TromsΓΈ a few years ago in Jan to see the Aurora, and spent a few days in Oslo. The Norwegian scenery can be amazing ;)
>> Vim was then opened with all the files, :next
shows me the next file. Problems:
> β’ I have to type 5 letters each time I move to the next file. Iβd prefer an action that was one letter.
FYI, :n
works just as well as :next
, I didn't even know :next
was possible and always used :n
https://youtu.be/q4ZJPiW9beE?si=_ivbugBevAMhwTg7 ... this seems like a good reason to live in Oslo π