FYI...


---------- Forwarded message ----------
Date: Sat, 13 Mar 2010 16:44:05 -0600 (CST)
From: Mike Miller
To: Help-Octave List <help at octave.org>
Subject: Re: nano syntax highlighting for Octave?

On Sat, 13 Mar 2010, Mike Miller wrote:

> On Wed, 10 Mar 2010, Ben Abbott wrote:
> 
>> On Wednesday, March 10, 2010, at 02:47PM, "Mike Miller" <mbmiller+l at gmail.com> wrote:
>> 
>>> I'm really more of an Emacs guy, but for students I recommend Nano to 
>>> get them started.  I've been working on getting the syntax 
>>> highlighting to work for various kinds of scripts.  I found something 
>>> for R and modified it to produce what you see below (don't blame 
>>> Haptonstahl if anything is broken in that code because it might be my 
>>> fault).  I think it works fairly well but there is definitely room for 
>>> improvement.
>>> 
>>> Of course I'd like some nano syntax highlighting code for Octave 
>>> and/or MATLAB if anybody out here has worked on that.  Thanks in 
>>> advance.
>> 
>> I haven't tried it, but a Google turned this link up.
>>
>>    http://savannah.gnu.org/patch/?6798
> 
> 
> Thanks, Ben.  I'm sure that will help.  I think I was searching too much 
> for Octave and not enough for MATLAB.
> 
> I'll edit that file and send it to the list.


I played around a little with the code I found at the URL above and 
created the attached text file.  To use it, just append it to your 
~/.nanorc file.  There's also a systemwide way to use it, but I don't know 
offhand.  Also see the attached screenshot PNG file.

It looks nice now (I'm using xterm with white on black and haven't tested 
with black on white), but I know it is still a little messed up -- I can 
see that some functions are repeated and I'm sure others are missing.  I 
don't have time to work on it much now.  I don't know how to retrieve 
lists of different types of functions, or even if there is a way to do 
that.

Nano is Free Software.  It is pretty lightweight and useful as a viewer. 
Just use the -v option to turn off editing functionality:

nano -v file.m

Best,
Mike
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: octave_nanorc.txt
Url: http://mailman.mn-linux.org/pipermail/tclug-list/attachments/20100313/62df83b7/attachment-0001.txt 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nano_octave.png
Type: image/png
Size: 34350 bytes
Desc: 
Url : http://mailman.mn-linux.org/pipermail/tclug-list/attachments/20100313/62df83b7/attachment-0001.png