Major mode for emacs

Linux specific questions.
Post Reply
dukester
Posts: 8
Joined: Oct 07, 2021 15:08
Location: Alberta, Canada

Major mode for emacs

Post by dukester »

Anybody know where I can find one for freebasic? Thx ..
TeeEmCee
Posts: 375
Joined: Jul 22, 2006 0:54
Location: Auckland

Re: Major mode for emacs

Post by TeeEmCee »

I thought you'd never ask!

I have written one for myself, and have been slowly tweaking it over the years. It is a bit messy, and it still has a couple bugs. It does syntax highlighting, indentation, begin/end of defun, comments, and a half-working lookup in manual key. But it doesn't highlight all keywords because I like to use certain keywords like 'data' as identifiers.

I need a little time to clean up the code and remove the parts specific to me, but will do so and post it for you. Hopefully tonight. I've always been meaning to do so eventually.

Separately I also have a deadgrep-based function to jump to the definition of a function/sub/variable/constant/macro, but it's quite a hack. I guess I should include that?

There is also an emacs mode for Visual BASIC but I immediately gave up on it when I tried it years ago.
dukester
Posts: 8
Joined: Oct 07, 2021 15:08
Location: Alberta, Canada

Re: Major mode for emacs

Post by dukester »

@TeeEmCee Much obliged - I'm sure! I'm just test-driving freeBasic at the moment though. I'd hate for you to go through all that trouble until I'm sure that I'll stick with it. :?
TeeEmCee
Posts: 375
Joined: Jul 22, 2006 0:54
Location: Auckland

Re: Major mode for emacs

Post by TeeEmCee »

Alright, here you go:

https://github.com/rversteegen/fb-mode

No worries if you never try it. I had a bad habit of not finishing things, and if I do finish them, not posting them. This was the impetus I needed to finally do something I've been meaning to for years. Aside from cleaning up the code, I also fixed some bugs that have been annoying me. I rewrote half of the indentation code.
dukester
Posts: 8
Joined: Oct 07, 2021 15:08
Location: Alberta, Canada

Re: Major mode for emacs

Post by dukester »

I'm much obliged TeeEmCee!! Thx a bunch! It'll make learning a new language feel more comfortable doing so in a familiar setting!
[sidebar] Here in Western Canada were heading in Fall with -30C coming up - maybe. You guys are just coming out of winter I suppose! The Commonwealth sure is spread out - or was! LOL

Thanks again!!
TeeEmCee
Posts: 375
Joined: Jul 22, 2006 0:54
Location: Auckland

Re: Major mode for emacs

Post by TeeEmCee »

Immediate feedback is very nice to have... and also when programming ;). It certainly makes leaning a language easier when you can see whether you have the syntax right. This mode does syntax highlighting of variable/function definitions by parsing, not just keywords, though FB has very quirky syntax with lots of edge cases. And as I said there are a couple keywords it doesn't highlight, nor does it highlight builtin functions.

I'll post a thread in the Projects forum and post any updates there.

Yikes, that's severe. You might be surprised to learn that because of the oceanic climate here, Spring is considered to start on Sept 1st, not Sept 23rd. Temperatures already often reaching 20's. But it's been a really wet Spring so far. Was a very mild winter with not a single frost :)
dukester
Posts: 8
Joined: Oct 07, 2021 15:08
Location: Alberta, Canada

Re: Major mode for emacs

Post by dukester »

TeeEmCee wrote:I'll post a thread in the Projects forum and post any updates there.
That would be swell!
Yikes, that's severe. You might be surprised to learn that because of the oceanic climate here, Spring is considered to start on Sept 1st, not Sept 23rd. Temperatures already often reaching 20's. But it's been a really wet Spring so far. Was a very mild winter with not a single frost :)
I keep wondering WHY I didn't moved to your neck-of-the-woods when my buddy did back in the early '70s. :/ Thanks again!!
TeeEmCee
Posts: 375
Joined: Jul 22, 2006 0:54
Location: Auckland

Re: Major mode for emacs

Post by TeeEmCee »

I posted the thread.

Back in the early 70's my father was deciding which sparsely populated country to emigrate to from the Netherlands. He rejected Australia because it was too hot and Canada because it was too cold :)
dukester
Posts: 8
Joined: Oct 07, 2021 15:08
Location: Alberta, Canada

Re: Major mode for emacs

Post by dukester »

Smart fellow - your father was!
Got your freebasic major mode on my Linux box. Haven't messed with it yet. Maybe this week.
Post Reply