jed-users mailing list

[2008 Date Index] [2008 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: hooks and modes


On 13.11.08, Duke Normandin wrote:
> On Wed, 12 Nov 2008, G. Milde wrote:

> > On 11.11.08, Duke Normandin wrote:
> >
> > > I want to install Jed's HTML mode. 
...
> > So it is already installed. Did you want to install one of the alternative
> > implementations?

> Yes to both!

> I see! So in summary  blah_mode_hook()s are used _only_ when
> blah_mode.sl needs to be customised. 

It is *needed* only when ... but always *used* if it is defined.

> So what is the syntax for writing
> a xxxxx_mode_hook()?

No special syntax, just define a function with the correct name:

define xxxxx_mode_hook()
{
  % some action
}

> html-mode now appears to be working automatically. I'm using Jed on an
> OS X Leopard box, so maybe some of the Terminal setting were a bit
> off. I fiddled with the settings and I now have one-color syntax
> highlighting - red - for the html tags. Not great, but better than
> nothing.

Normally, you will have a 

  mode: <your-mode> 

message on your status line. Also, 

  M-X vinsert("%S %S", what_mode)
  
could help.

Do you have more colours in other modes?

> I will soon be interested in writing a "mode" for a language that I'm
> learning - Mumps (or M Technology as it's currently called). If I take
> an existing .sl mode-type file in JED_ROOT and modify it, that could
> be a good start? 

Yes. Alternatively, have a look at

http://jedmodes.sourceforge.net/doc/foo.sl.html
http://jedmodes.sourceforge.net/doc/foo.sl

foo.sl.html is the literate source of a mode template and commented
example for anyone wanting to write a new jed mode. The S-Lang code is
foo.sl


> Then I can call it up automatically in my .jedrc file
> using () = evalfile("mumps.sl")? or from jed using S-lang () = blah
> blah. How would I set up the M-x mumps-mode thing? 

autoload("mumps", "mumps.sl");
add_mode_for_extension("mumps", "mu"); % mode for mumps

or so.

Günter


--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2008 date index] [2008 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]