This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-12-14
Channels
- # adventofcode (29)
- # aws (3)
- # babashka (25)
- # beginners (13)
- # calva (4)
- # cherry (7)
- # cider (26)
- # clj-kondo (9)
- # clojure (88)
- # clojure-europe (21)
- # clojure-losangeles (3)
- # clojure-nl (1)
- # clojure-norway (6)
- # clojure-uk (11)
- # clojuredesign-podcast (2)
- # clojurescript (4)
- # cursive (10)
- # datalevin (1)
- # emacs (50)
- # gratitude (1)
- # honeysql (12)
- # hyperfiddle (19)
- # jobs-discuss (28)
- # kaocha (3)
- # lsp (53)
- # malli (4)
- # meander (3)
- # off-topic (48)
- # re-frame (11)
- # releases (2)
- # ring-swagger (2)
- # shadow-cljs (50)
- # squint (26)
- # tools-build (3)
- # tools-deps (8)
- # xtdb (4)
- # yamlscript (1)
This might be a silly Emacs question: sometimes when I execute some command in Emacs (e.g., projectile-run-project) it pops up a buffer with some process information about the command, which is fine. After that though, C-x o for changing windows stops working. When I do it all my windows grey out. I have to manually click on the window that popped up, close it, and then it works again. What's that about and how do I get around it without using my mouse?
I ask because some desktops like macos will focus newly launched apps, and it has been a long time since I've used macos but it would sometimes treat the jvm process as an app (even adding an icon for it to the dock) even if there was no gui window for it displayed, and if projectile-run-project starts a jvm maybe emacs isn't in focus anymore which would be why it doesn't respond to the keyboard
I am using Prelude, so I see that it has (menu-bar-mode -1)
but that prelude-macos which I am presumably running flips that around (menu-bar-mode +1)
Not sure where to find that - M-:
leads to eval on my machine. I ran toggle menu-bar-mode off and on though
Yeah, that's what I mean. If you eval menu-bar-mode
, which is also a variable, it says whether it is enabled
Another silly Emacs question: adding a new file to a clojure project is a whole level of hell in Emacs, so I must be doing it wrong. I use C-x b to switch to a new buffer, add the namespace declaration, and save it. ONce I do that, everything starts breaking apart. Emacs starts insisting that I import clojure/core.clj, everything starts slowing down to a crawl, and as soon as I type anything into the new file I get error buffers popping. What am I supposed to be doing instead?
are your projects under a symlink'ed directory, I've had some issues where project mode decided would decide depending on if a file was created using the path through the symlink or not would lead to weird behavior
i’ve never seen emacs insist importing clojure/core.clj. and error buffers popping, can you say what errors they are reporting?
I probably should have noted them down, but I ended up force quitting emacs and trying again... This time it's OK
The minibuffer pops up with a range of options including importing clojure/core.clj, and if I don't it just pops up again
so cider is generally dynamic information (it inspects what is in memory in a running process)
and clojure-lsp is generally static information (static analysis of the text in the files on disk)
when you create a new file on disk and add an ns form, but haven't eval'ed it yet, there will be a discrepancy between the static and dynamic view (it exists on disk in a file, but doesn't exist in the repl) and I could in some hand wavy way see some cider plugin in or something not finding the namespace in the repl and some how deciding that means the namespace is missing a require of clojure.core (which, if you create a namespace using in-ns for example, it doesn't automatically have clojure.core required)
the above being said, I don't think cider ever prompts to require a namespace, and cider being clojure specific is more likely to use the correct clojure terminology "require" the namespace "clojure.core", where lsp-mode is more generic and likely to say something like "import" the file "clojure/core.clj"
so I think it is most likely whatever is going on there is coming from lsp-mode and clojure-lsp
I use eglot (not lsp-mode) and don't use cider, when I open a new file in the project clojure-lsp sees it and asks eglot if it is ok to add the appropriate ns form to the file, and eglot pops up a "is it ok to edit this file?" in the mini buffer, and that is all that happens
> (find-file FILENAME &optional WILDCARDS) > > Edit file FILENAME. > Switch to a buffer visiting file FILENAME, creating one if none > already exists.
a buffer in emacs is a view of some text, which may or may not be associated with the contents of a file
Yep, that was your issue right there. When you C-x b
a new buffer, Emacs/CIDER doesn't know you want it to be related to a REPL that's currently running (and which one?). When you create a file with C-x C-f
in the directory of a project that has a REPL running, then it's inferred.