Emacs Propeller mode available
proplem
Posts: 233
Hello every one,
after hours of hacking i may proudly present:
prop-mode.el.7z
my contribution to the propeller and Emacs community.
Certainly not ready for sale (it's GPL, and i copied and stole the knowledge in the internet) but already useful. I don't use another IDE as i don't use another microcontroller.
0. preconditions
1. put prop-mode.el in a path so that emacs may find it
5. useful prop-mode/Emacs commands
7. Thanks
after hours of hacking i may proudly present:
prop-mode.el.7z
my contribution to the propeller and Emacs community.
Certainly not ready for sale (it's GPL, and i copied and stole the knowledge in the internet) but already useful. I don't use another IDE as i don't use another microcontroller.
0. preconditions
- use Emacs 23 because of the Parallax Truetype font and the newly integrated function serial-term which i'm planning to use in future
- the Parallax font should be installed (HOWTO: google for it)
- prop-mode depends on BradC's bstc.linux. Without his work this mode wouldn't be useful! Thanks BradC.
- I made the following symbolic links in /usr/local/bin
bstc -> bstc.linux
bstl -> bstl.linux (currently not used) - prop-mode.el was developed and tested under Debian Squeeze (6.0)
1. put prop-mode.el in a path so that emacs may find it
C-x C-f prop-mode.el <enter> M-x emacs-lisp-byte-compile-and-load <enter>2. Put this in your .emacs:
(load "prop-mode")3. within emacs
C-x C-f <any spin file you like>4. now prop-mode should be activated and you see a relatively poor syntax highlighting
5. useful prop-mode/Emacs commands
C-c c prop-compile C-c e prop-compile-and-load-EEPROM C-c r prop-compile-and-load-RAM With C-h f <command-name> you get a little help C-h m shows additional help to prop-mode6. important hints
- There is an automatically created buffer "*Propeller Compile*" with compilation output of bstc.
I prefer to open a new frame with C-x 5 2 in which i select (C-x b *Prop<tab>) to permanently view what's happening in that buffer. - one has to save (C-x C-s) before compiling. I didn't automate that yet.
- /dev/ttyUSB0 is currently hardcoded in prop-mode.el
- i didn't test prop-mode.el on Windows yet.
7. Thanks
- Without his knowledge BradC delivered an important contribution to prop-mode.el. I hope he is not angry for this new propeller-IDE offending his cool bst. I love Emacs and i wanted bring together what is belonging together: Propeller and Emacs.
BradC: RESPECT for your work and many, many thanks. I admire your productivity. - Thanks to all the anonymous people in the internet which contributed the foundation for prop-mode.el
- Thanks to the Emacs community
- Thanks to Ariba for posting PropTerminal_Linux which works fine on Debian squeeze
- Thanks to ErNa who led me to propeller, software, electronics and many other things that enriched my life in the last 22 years.
Comments
Well, for your first post here you've certainly hit the ground running!
HUGE thanks for that. It's exactly what I've been looking for. I spent some time trying to produce such a thing myself, but my lisp/emacs skills are much too low and I didn't get very far at all.
Your version works fine in my setup (Fedora 11 with emacs 23.1.1) and your instructions led to a flawless installation. The lengthiest part was finding a 7-zip decoder :-)
I did get one warning when building the file:
Compiling file /home/john/elisp/prop-mode.el at Wed Apr 27 20:30:07 2011
Entering directory `/home/john/elisp/'
In prop-mode-face-activate:
prop-mode.el:358:10:Warning: assignment to free variable
`buffer-face-mode-face'
Doesn't seem to have done any harm though.
Of course, there's always a downside to posting things like this: people like me come straight back with wish lists :-(
1. I'd like to adjust the font size to be a little larger. I can't see anything in the .el file that explicitly sets the size - do you have any suggestions as to how to do that?
2. Using the tab key, the indentation seems to increase by steps that are not of equal size. It'd be very convenient if the steps could be made equal.
Thanks again for a brilliant piece of work. It's now part of my standard setup.
Welcome to the forum and a big thank you for that.
Just so that no one is left out don't forget there is Spin syntax highlighting for vim here http://forums.parallax.com/showthread.php?118328-Spin-syntax-definition-for-Vim
johnfos,
i am happy to hear that you're going to add it to your standard setup. That's what i wanted.
Though your wish list isn't very long, i can't improve prop-mode as i would like to do - job, family and so on, but my goal is continuous improvement of prop-mode in longer terms.
Some words to your issues:
The warning is reproducable, i know of it, a fix will follow.
To 1:
In emacs23 you can increase and decrease font size with S-<left mouse button> or C-x C-+? Try both. There'll appear a popup menu with appropriate selections.
In prop-mode.el search C-s Parallax. At some place the fontset is selected in a line similar to
Here is the right place to insert a font size, i don't know it either. I do not have the code in front of me. In future may be this will be a customizable setting. You might find some hints in the internet how this is to be done.
I'm no native lisp speaker, and it was a lot of try and error necessary to implement prop-mode :-)
To 2:
Yes indentation is currently problematic. It will be solved as fast as possible. Patience:-)
There's is workaround: If i was confused about indentation, i marked tho whole buffer C-x h and M-x untabify. So any tabs are replaced by spaces. Another way is using whitespace.el. It works quite sufficient.
A tip aside:
There is one function i found out by accident after years of using emacs: M-/ it's auto completion. Mode independent, it tries to complete by accessing possibilities in all open buffers.
Regards,
proplem
Many thanks for that helpful reply.
I promise to be patient :-)
Meanwhile, exploring your tip on the font size, I added one line to the prop-mode-face-activate function (the text-scale-adjust line, which is what the command C-X C-+ translates to):
Probably not the best way to do it, but for me it gives a much more readable size.
Jim
i did not try prop-mode.el with Windows. AFAIK bstc is not available for Windows though you have to use propellent.exe which i didn't ever try.
I think the wish list is getting longer ... :-)
regards, proplem
good news johnfos! bstc is a platform independent tool. I didn't know that.
But there are some further news:
prop-mode-0.1.7z
It is now possible to customize variables:
use M-x customize-group prop-mode<return>
@johnfos: handling of fonts in emacs lisp requires at least a PHD or Prof title, but with prop-mode-std-fontsize you can adjust the size to your needs. Try values about 150, 125 i think you'll be happy.
There is another important feature:
prop-mode-serial-interface is also customizable aiming at platform independency (without knowing of bstc's ability to do that). I thought of people working on windows (and me also;-). Furter more prop-mode-serial-interface is buffer-local. So one can M-x set-variable COM1 or /dev/ttyUSB1 and so on for a specific buffer and compilation will compile into that device. Great isn't it? A Multi-Propeller-Interface IDE with one additional line of code.
Did anybody work on windows with prop-mode? Maybe successful? I didn't have the time yet.
regards, proplem
Replace this: with:
(The change is removing ' marks from the last three lines)
it's funny that you fixed a bug in that lines. It's funny because i wanted to comment these lines with the comment sign of spin forgetting to be talking lisp. I understand you really fixed another bug - strange.
So far it was a bugbug :-))
I can't understand what you are meaning with can you explain?
I would suggest you leave these lines commented or better you comment them in the following manner:
Strings and comments are already fontified by other means. Only the operator := is not yet fontified.
Better fontification is one of the obvious open issues.
sorry for the inconvenience, best regards,
proplem
Well I only encountered the problem on a Mac I have connected to a printer - using print-buffer in emacs on a buffer in propellor mode failed with an error about 'QUOTE'.
So I hunted in the source for the likely cause - I know several Lisp dialects so that backquoted expression stood out as wrong (not everyone can read Lisp fluenty, I know
And if you know Lisp you know that 'expr is a macro for (QUOTE expr)
I presume printing the buffer exercises more parts of the mode definition than simply setting the mode on the buffer.
PS Thanks for the mode, its looking good (and saving me some black ink!)
prop-mode-110615.7z
Many improvements have been done:
M-x customize-group prop-mode
If there are any wishes feel free to reply to this post.
regards, proplem