Fork me on GitHub
#emacs
<
2023-08-18
>
vemv09:08:33

No comment syntax is defined. Use: prompts plague me. I think it's never in Clojure contexts - for me it's typically in plain text files running fundamental-mode. Anyone got to fix those?

2
ericdallo15:08:20

yeah, faced that some times with different extensions than clojure

Darrick Wiebe15:08:31

I've found issues like this by grep-ing my entire plugin tree and then figuring out what the actual problem is or just disabling the message.

Benjamin16:08:16

Its when you use comment-region etc. in a major mode... without comment syntax definend. A mode should set the local vars from newcomment.el The prompt asks the user for a comment start syntax, so if you know you can for example say # and it puts # everywhere.

💡 2
vemv16:08:02

Is there a way to avoid prompts and not get any specific behavior? i.e. assume I don't care about the problem (at least for now) (note: this problem pops up to me when just opening / scrolling through a buffer. I don't try to run comment-region, AFAIK)

Benjamin16:08:57

could do debug-on-error to see which code is calling a comment function - this would annoy me too 😛 hack comment-normalize-vars or advice: (advice-add #'comment-normalize-vars :filter-args (defun always-no-error-for-comment-normalize-vars (&rest _) (list t))) One idea is to use # as default

vemv17:08:16

Thanks! Will give it a try

😃 2
vemv19:10:52

...for some reason I never gave it a try. But would have worked! I added t ( (comment-normalize-vars t) ) in a few places of cider/clojure-mode today.

sheetz16:08:38

Instead of opening a Windows CMD command prompt to run Lein (for Clojure), can I use Lein inside of Emacs ? Like, can I put "lein new app todolistexample" inside Emacs and have it create a project for me ?

vemv16:08:22

Not sure if I understand the question cider-jack-in shoud create a Lein/java process within Emacs. Does it not do that for you?

sheetz16:08:29

Yes, I am able to access cider-jack-in in Emacs and run the CIDER REPL. I was just wondering how to run Lein inside of it. (I'm a total newb to this btw lol)

sheetz16:08:56

I used Lein to create a new project in the Windows Command prompt .... I was wondering if I can do that inside EMACS instead.

sheetz16:08:40

Like if I want to start a new Clojure prject, I'll have to go into the CMD and type "lein new app APPNAME" and it creates the folders for me

vemv16:08:51

got it! What do M-x shell or M-x eshell do for you? (Those are two different shell implementations to choose from)

sheetz16:08:00

lemme check

sheetz16:08:32

OH SNAPS ! i think thats it !

sheetz16:08:52

I used M-x shell and typed "Lein" and it popped up with the Leinengen options !

Evan Bernard16:08:01

i’ve certainly just run arbitrary shell commands with M-! . i’m no stranger to running, e.g. M-! lein deps :tree in emacs

👀 2
❤️ 2
vemv16:08:02

@U05N5T43AF5 cheers. My first emacs/cider experience was with Windows. That was around 2011 - time flies. Have fun!

❤️ 2
👍 2
sheetz16:08:03

THAT WORKED TOO !!!

sheetz16:08:10

thanks guys, they both worked !!!

Evan Bernard16:08:20

if you’re new to shell-mode, and want to start using it, i’d recommend perusing the manual for it as well 🙂 M-! just works for a single command, but shell-mode provides you with an interactive shell to work with

sheetz16:08:08

ahhh I was saying windows command prompt lol but its called SHELL

sheetz16:08:28

im gonna check out the manual because EMACS is getting really fun

👍 2
Evan Bernard16:08:02

you can always C-h r to open it and C-s to search for whatever you want 😄 like C-s shell for instance 🙂

❤️ 2
sheetz16:08:41

WOW !! Extremely helpful !!! thank you lots for those commands !! :face_with_cowboy_hat:

Stig Brautaset16:08:47

I almost never use any other shell than Eshell (`M-x eshell`). It’s very capable.

❤️ 2
sheetz16:08:54

NICE !!! What about be the main difference between eshell and shell ??

Stig Brautaset17:08:40

eshell is implemented in Emacs lisp, and you can call many emacs lisp functions from within it. Here’s a great primer: https://www.masteringemacs.org/article/complete-guide-mastering-eshell

❤️ 2
sheetz17:08:15

heck yeah !! thanks for the link ! gonna read that one now