dykstrom / basic-mode

Emacs major mode for editing BASIC code
GNU General Public License v3.0
7 stars 10 forks source link

Can't seem to enable basic-mode #1

Closed lmintmate closed 6 years ago

lmintmate commented 6 years ago

I installed your package on my Emacs 24.5.1 installed from the package manager of Linux Mint 18.2 (based on Ubuntu LTS 16.04), and couldn't find a way to enable basic-mode. I tried to see if M-x basic-mode was available, but the only 2 shortcuts smex completion showed me were irrelevant. I tried to see if I could find the customization group and couldn't find it either (but that was expected, as many packages require their mode to be enabled first and then they show the relevant options at the Customize interface). After I perused the code and saw something about .bas listed there, I tried to create a .bas file with a simple Hello World program, to see if I could get that recognised by basic-mode, but it was opened as Fundamental mode instead. Hope you can fix this, as it basically makes the package unusable. Thanks for the understanding.

dykstrom commented 6 years ago

Thanks for letting me know about this! basic-mode was just recently published on MELPA so one may expect some initial problems. It seems define-generic-mode that I use does not work well with the MELPA package format. No autoloads are generated. I will try to fix that.

In the meantime, if you have installed the package (using package-list-packages, and then finding basic-mode in the list), what you can do is evaluating

(require 'basic-mode)

in the scratch buffer, and then basic-mode should be autoloaded when you open a file with extension .bas.

lmintmate commented 6 years ago

The method you suggested with (require -basic-mode) worked, thanks a lot! Hope you'll implement the autoloads soon, so this won't be needed every time I open emacs. Just a suggestion: You could also add relevant instructions for setting up the mode in the README - transfer the text found in the comments section of the .el file and add any needed requires or anything else- and add other explanations that will help make the project more accessible/discoverable (the reason I tried the package at this early point is because I like retrocomputing in general and did wonder from time to time why there wasn't a basic mode yet). Btw, a small suggestion for the future (don't know how difficult this will be to implement though): You could add a REPL-like functionality, so that e.g. PRINT "HELLO WORLD" will print "HELLO WORLD" in a separate buffer (as happens in other programming modes e.g. Geiser and racket-mode). This will probably have some complications though, for example what will happen with your typical 10 PRINT "HELLO WORLD" 20 GOTO 10, which results in an endless loop. Just a suggestion though... Anyways, thanks again!

lmintmate commented 6 years ago

Update: Just updated my installed version from MELPA (the fix having been added 12 hours before now) and everything now works as expected. Thanks a lot! Also thank you for updating the README, even if it was to add the things already mentioned in the Comments section - this will help explain the package to people who won't think to look at the .el file. Feel free to close this issue btw, since the problem I reported through it has now been resolved (I'm used to developers closing issues when they are successfully resolved, and thought you probably hadn't closed it, because you were waiting for feedback).

P.S. I also thought that this issue also won't have to stay open if you are considering to implement my additional suggestion, about executing BASIC code from emacs (which is not necessary though, as I understand it might not be easy to implement, it would just be nice to have), since you can write up a roadmap for that, and it thus won't clutter the issues tab.

dykstrom commented 6 years ago

Great that it works now! I didn't have the chance to test until now. Yes, I updated the README also, as you suggested. At first I thought I wouldn't bother with that, since people would install using MELPA anyway, but as you say, it is probably a good idea.

When it comes to the REPL, I agree that it would be a really cool idea. But I think it would be way too much work to implement such a feature. It would be hard for me to find that time. However, if you want to give it a try, feel free to fork my repository and start hacking. :-)