jed-users mailing list

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

defining a simple mode + hook for catching user abort signals


Hello

I am trying to define a very simple mode for editing slightly structured text. All it does is define a few functions which I would like to bind to certain keys; other than that I would like jed to behave as it does in text mode (e.g., wrapping lines). How can I do this simple modification?

By looking at the documentation at the mode repository I came up with the following. I have the functions in a .sl file in my jed dir together with the following function

define alttext_mode()
{
  run_mode_hooks("alttext_mode_hook");
  local_setkey(fun1, "^I");
  % other keybindings
}

Then I appended

() = evalfile("alttext");

to my jed.rc. This works - meaning that I get access to those functions by pressing the keybindings I defined - but I lose the text mode behavior; how can I simply define a couple of functions+keybindings "on top" of the regular text mode and define that as a new mode?

I would also like to know how I can catch a user abort signal (Ctrl-G) when one of the functions I defined is running. Eg, when a certain function is called I display information to the user in a temporary buffer and wait for input through the minibuffer. If the user presses Ctrl-G instead of entering something, I would like that other buffer to disappear (just as pressing "Ctrl+X B", followed by tab and then Ctrl-G works: the file list disappears when the latter is pressed). How can I achieve this?

Thanks in advance for any help,

Mack

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/


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


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