Can't get emacs j-mode to work properly

150 views
Skip to first unread message

John Dell'Aquila

unread,
Mar 14, 2025, 10:22:34 AM3/14/25
to forum
I'm running a recent Doom Emacs atop emacs 30.1 on Windows 11.

J-mode installs without complaint but when I send J statements to the comint buffer the input is not indented and all the emitted text has the read-only property set, making the buffer unmodifiable thereafter. If I toggle inhibit-read-only to "t" j-mode becomes usable, but with no indentation the transcript is very hard to read.

Apparently my emacs setup is not reacting well to whatever jconsole.exe does to emit the unmodifiable indentation. Does anyone know what's going wrong? Any fix or workaround to get proper indentation would be appreciated.

Thanks,
John

Raul Miller

unread,
Mar 14, 2025, 5:53:18 PM3/14/25
to fo...@jsoftware.com
Does console mode work in your instance of emacs?

If so, is it able to start jconsole?

Thanks,

--
Raul
> To unsubscribe from this group and stop receiving emails from it, send an email to forum+un...@jsoftware.com.

Raul Miller

unread,
Mar 14, 2025, 5:54:03 PM3/14/25
to fo...@jsoftware.com
er... wait, I think it's maybe called "shell mode"

Its been too long since I've used emacs.

(Had to stop because of an RSI issue.)

--
Raul

Devon McCormick

unread,
Mar 14, 2025, 8:04:13 PM3/14/25
to fo...@jsoftware.com
For me, it works fine in emacs 27.1 on Windows 11.
--

Devon McCormick

Flâneur


John Dell'Aquila

unread,
Mar 15, 2025, 11:38:02 AM3/15/25
to forum, Raul Miller
When I run jconsole from a Doom emacs shell it does the same thing, no indentation and read-only text. It works normally when run outside of emacs.

When I remove Doom and run jconsole from a bare emacs 30.1 shell it still has no indentation but the text isn't read-only, so that may be an interaction with some Doom package.

As an aside, if you want the power of emacs without the RSI inducing control key combinations take a look at Doom Emacs. I used straight emacs for more than 25 years before switching to Doom because I was tired of curating my own emacs config. I quickly discovered that evil-mode, the optional VI emulation, is for me a much better way of interacting with an editor than the native emacs key bindings, which I now barely remember and don't miss.

alexv

unread,
Mar 15, 2025, 2:55:49 PM3/15/25
to forum, John Dell'Aquila, Raul Miller
I am using development version of Emacs under WSL and I have no issues with the j-mode (both in jconsole and with org-mode where I added a few yasnippet templates for convenience) and J. Every now and then I update J to the latest commit from github. Nix makes it trivial to build. I gave up on the native Windows version of Emacs years ago due to the lack of a standard consistent set of Linux utilities various Emacs packages want to call. WSL fixed that.

Raul Miller

unread,
Mar 15, 2025, 3:25:08 PM3/15/25
to John Dell'Aquila, forum
Doom emacs looks plausible, and I think I'd like to try it.

That said... I'm using windows 11 with cygwin and wsl, and that leaves
me with several possibilities for emacs 30.1 and I'm not quite sure
where to dip my toe in the water. Do you have any experiences with any
of these variants?

Thanks,

--
Raul

On Sat, Mar 15, 2025 at 11:38 AM John Dell'Aquila

John Dell'Aquila

unread,
Mar 16, 2025, 12:16:10 PM3/16/25
to forum, Raul Miller, forum, John Dell'Aquila
I've tried them all. I prefer WSL emacs, but I work in a corporate environment where almost everything I do is on a Windows filesystem somewhere. Windows emacs makes more sense for me because it can access drive letters and network shares directly without having to mount them first. If you control your own environment, choose the emacs that is native to the OS you're most comfortable with.

Regards,
John

John Dell'Aquila

unread,
Mar 18, 2025, 11:57:43 AM3/18/25
to forum, John Dell'Aquila, Raul Miller, forum
Problem solved.

Jconsole only supplies prompts if it detects that stdin is a terminal. My emacs shell does not look like a terminal to jconsole, probably because I launch Windows emacs from a bash shell. Fortunately there is a command line argument to force prompts, which fixes my missing prompt and read-only text issues:
;; j-mode
(setq j-console-cmd "jconsole")
(setq j-console-cmd-args '("-prompt"))  ;; force prompts, *always* the behavior you want

If anybody is interested I patched j-mode to use the NuVoc help pages and color scheme (purple for verbs, blue for adverbs, and green for conjunctions), because I like it better than the dictionary, which seems out of date.

John

John Dell'Aquila

unread,
Mar 19, 2025, 1:43:19 PM3/19/25
to forum, John Dell'Aquila, Raul Miller, forum
addendum: timing issue

If there is no "J" buffer already open, the first J command I execute always has its indentation reversed (command unindented, output indented). I think this happens because emacs inserts the command text before jconsole has a chance to insert the indentation. Adding a 1 second delay cures the problem for me:

(define-advice j-console-create-session (:after ()) (sleep-for 1))

John

bill lam

unread,
Mar 19, 2025, 10:05:53 PM3/19/25
to fo...@jsoftware.com, John Dell'Aquila, Raul Miller
Thank you for sharing. It may help others if y'all can update the jwiki eg.

More Rice

unread,
Mar 20, 2025, 9:15:59 AM3/20/25
to fo...@jsoftware.com, John Dell'Aquila, Raul Miller
That would be fantastic, John. I once tried spacemacs in the hope to get a more efficient keybinding (vim mode) with a nice front end similar to jqt - didn’t went well in configuring J side. I suck at emacs config. This may help me too. 

Thanks.

Maurice 
Sent from mobile

John Dell'Aquila

unread,
Mar 20, 2025, 3:47:13 PM3/20/25
to forum, More Rice, John Dell'Aquila, Raul Miller
I agree that the emacs guide could use an update. I think we should drop the even-handed discussion of the 2 historic j-modes. That confuses newcomers needlessly because LdBeth's updates have made the MELPA package the clear choice in my opinion. We should walk people through that installation and only mention in passing that there is another, out-of-date, j-mode. I'd also like to get j-mode updated to use the NuVoc help pages rather than the dictionary. If LdBeth is agreeable I can provide those changes.

I'm a noob without a clue how to actually do things around here, but I'm happy to learn and contribute.

John

More Rice

unread,
Mar 31, 2025, 1:55:02 AM3/31/25
to John Dell'Aquila, forum, Raul Miller
> [John] I'm a noob without a clue how to actually do things around here, but I'm happy to learn and contribute.

I'm surprised no one offered the instruction. Here you go, John.


> [John] I'd also like to get j-mode updated to use the NuVoc help pages rather than the dictionary.

I personally flip between them a lot. 😁

thanks.

Maurice

alexv

unread,
Apr 2, 2025, 7:48:05 PM4/2/25
to forum, More Rice, forum, Raul Miller, John Dell'Aquila
I also use this emacs package https://github.com/abo-abo/helm-j-cheatsheet to search the dictionary.
Reply all
Reply to author
Forward
0 new messages