
@haakonhr has joined the channel

So how do you jump to a definition in racket-mode? The docs suggest M-. should work, but when I try that it asks for a TAGS file, which of course I don’t have for Racket.

You need a add a few lines to your .emacs
https://www.racket-mode.com/#Xref-_0028definitions-and-references_0029

If you’re using Racket Mode since mid Nov 2020, then M-.
should just-work w/o any special configuration in racket-mode
edit buffers, and also in those edit buffers with the racket-xp-mode
minor mode enabled (recommended), and also in racket-repl-mode
buffers.

If you have a slighter older version, then it won’t work in plain old racket-mode
edit buffers; you definitely need to use the racket-xp-mode
minor mode to “enhance” them.

That might be why you’re getting the TAGS file prompt?

Apropos, what is the official way of updating Emacs modes?

You can just use the package update command in Emacs, usually.

To be super safe, since Emacs has no module system and is a huge ball of mutable state, you could uninstall a package, restart Emacs, then install the new version of a package.


Anyway @jjsimpso if you’re still having problems I’m glad to try to work it out with you here or on GitHub Issues https://github.com/greghendershott/racket-mode/issues

Got it. I updated racket-mode and M-. appears to be working. It looks like I need to enable xp-mode for it to be that useful though. I’ve never used xp-mode but it appears to be working now!

Thanks for the assistance.

Great! Yes, the M-.
support in plain racket-mode
is a weak default that only lets you visit relative requires like if you have point on "foo.rkt"
in (require "foo.rkt")
. Otherwise it recommends activating racket-xp-mode
.

It really needs the back end to do a check-syntax to help it know what things are bound to and where to find them. Like, there are a bazillion "define"s besides the one provided by racket/base
. Also it can find defs of local vars.

And it can do that without needing to Run the file first, which is super helpful.

racket-repl-mode
is simpler, something did get run, it’s a live REPL with namespace symbols and it’s clear what means what.

This is neat! I regret not updating earlier…

Wait… It seems I no longer can activate flyspell
in a racket-mode
buffer. Am I doing something wrong?

To be precise: M-x flyspell
will start flyspell
as a minor mode, and I see “Racket Fly hs” in the mode line.

However, no spelling errors are detected when I try to make mistakes. Also, marking a region and running flyspell-region
starts the checker, but nothing is marked as errors in the buffer.

Forgot to say, that flyspell
still works in other buffers.

Hmm. Something works:

I have no idea, whether I need to change a flyspell or an racket-mode setting.

If I begin with a new file then flyspell works with racket-mode. So… I think the problem is unrelated to racket-mode. It must be flyspell that gets confused about something in my macro-tutorial.rkt file.

FWIW, this seems to enable checking of everything: (add-hook 'racket-mode
(lambda () (setq flyspell-generic-check-word-predicate
't)))

@nhanclassroom has joined the channel