Updated versions of the TADS 3 and Inform 7 modes for Emacs

Hey, I just noticed the ELI in there… are you using my EventListItem extension??

oh my god what a coincidence! Yes I am! It’s super useful actually, I really like having it. Thank you for writing it! By the way, I found it because it’s included with adv3Lite as one of the extensions it comes with by default, so I definitely don’t think it’s been buried, it’s being regularly distributed to anyone who uses adv3Lite!

1 Like

The tads3-mode plugin I’m working on actually does have something like that. I’m not sure if it’s exactly what you mean, but it provides an outline of all the object, class, function, and modify/replace declarations in your current file, and you can fuzzy search and jump to them as well. (One of the things that’s great about DOOM Emacs is that it makes even heavier use of fuzzy command palettes than even VS Code does, it’s very convenient). There are also keybindings to jump to the previous and next objects. Here’s what the outline looks like:

It’s a bit basic right now, eventually I’d like to make it look more advanced, like what the Emacs Lisp extension has:

But I haven’t figured out how to do that yet.

1 Like

Sweet, I didn’t know Eric was distributing ELI with the library! I just assumed it was an optional module stuck in an archive directory. Glad to hear! My WIP relies on it heavily, because I have a game-long sidekick that provides most of the atmosphere. One other class I’ve made/used heavily is very simple but very handy, simplifies/encapsulates the use of Daemons and Fuses, particularly ones that turn off and on a lot. I was thinking of reposting it on the forum because there are a lot more active T3 users on here now (a whopping six or seven!) than when I first posted it…

1 Like

I’ll try to get eMacs set up in the next couple days and see what it can do!

Just to be clear, I functionally wrote the ELI extension, but Eric made some implementation tweaks and we collaborated to package it for adv3Lite… so it’s his extension too…

1 Like

I just checked out the VSCode TADS 3 extension and just so you’re aware, tads3-mode is nowhere even remotely close. It could be, if given an equal amount of development time, but the VSCode extension uses a language server and so is going to be fundamentally, categorically better ununless I switch tads3-mode to an LSP as well. The equivalent to IDE language support I was talking about was for languages like Python, C++, Rust, etc.

1 Like

Nice!

Here’s a customization I make to inform7-mode, 'cause I figure one can’t afford not to see the syntactically-significant hard tab characters, the silent killers.

(defface extra-whitespace-face
   '((t (:background "pale green")))
   "Used for tabs and such.")

(add-hook 'inform7-mode-hook
          (lambda () (font-lock-add-keywords nil my-extra-keywords)))

(defvar my-extra-keywords
   '(("\t" . 'extra-whitespace-face)))
2 Likes

Good one! I’ll integrate that, bc tabs vs spaces has gotten me too.

well, I hope that these improved modes enter the main EMACS branch (the GNU one, from where all *nix distros take the code and modes…)

Best regards from Italy,
dott. Piergiorgio.

1 Like

I’ve archived my TADS-3-Mode-for-Emacs repository and bequeathed future development to @alexispurslane. I’ll try to contribute to her efforts, but the TADS 3 mode is in her very capable hands.

3 Likes

You are welcome to use the LSP server in case you would like to expand your extension into an LSP client and get its features for free. My guess though is that you don’t want to depend on a server running on nodejs while running emacs. In my Imagination that just doesn’t sound like a mix Richard Stallman would think fondly of :slight_smile: even so, it would be a cheap way to get an outliner, go-to-references etc.

Keep up the good work!

3 Likes

Thank you, I have been considering that actually. I’m not sure yet but in the long run I do think setting up an LSP would probably be my best bet. My hangup is, first of all, how to isolate it nicely from the vscode extension (I assume that’s what you’re talking about) and second of all, a deep and abiding dislike for JavaScript and Node lol.

1 Like

I could try creating server standalone binaries for different OS:es that you can dynamically download from the releases page depending on what OS the client is running on. That wouldn’t require nodejs on the user’s part. I need to investigate it further though. I’m guessing it will be plenty of binaries and not the most maintainable solution. But somehow feels better than downloading the server folder and running “npm install“ as a part of installing the extension. Even if it is just once.

1 Like

That does sound a lot better. On Arch Linux, my girlfriend was actually stymied installing the TADS vscode extension because of all the dependencies on Node and TypeScript. That’s probably not a universal experience, but installing it that way feels gross anyway. To reach parity with most other LSPs, I think just putting three binaries up on the release page (windows, macos, linux) for people to manually download themselves should be enough, then they can just tell my Emacs plugin where to look.

Hm, that’s odd. As I made the effort to make it a published extension she shouldn’t need to make a manual build with npm. It’s searchable in the extension tab within vscode. It should just be a one click installation from there.

She uses VSCodium, I think that was the issue.

Out of curiosity, because I don’t know too much about how LSPs work, there’s a standard lsp-mode that Emacs uses to connect to all the LSP backends for various languages, which is then activated when a given major mode launches. Does your TADS LSP adhere to whatever standard JSON format other LSPs use? Because if so this might be a plug n’ play solution!

1 Like

It adheres, since it implements the interfaces for the 7.0.0 version of the LSP protocol. (The client and server communicates with classes serialized
to json. )
I’ve added a few special messages for the map feature besides those but they are voluntary to listen to. So in theory, yes for the client it’s just to start it up with the server. Not sure if lsp-mode takes care of the installation of the server though. But in case it does. A PR to their repo might be the way to go.

1 Like

This is really cool! Although testing out the Inform7 mode, I’ve noticed the syntax highlighter gets confused if you put a word or phrase in parentheses in a comment, like [this is a comment that I might (ideally) like to use].

1 Like

A post was split to a new topic: Learning Emacs [split on request]