jed-users mailing list

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

Re: [Jed-users-l] Turning off auto-wrap


On Fri, Jun 24, 2011 at 02:34:59PM -0700, Doug Kramer wrote:

> (Delayed followup)
> 
> I don't quite follow set_buffer_hook. (Are hooks related to modes?)

Hooks are described in the following file:

> On Thu, May 5, 2011 at 4:14 PM, Parke Bostrom <parke.bostrom@xxxxxxxxx>wrote:
> > >From (on Ubuntu) /usr/share/jed/doc/txt/hooks.txt:

Hooks are event specific callback functions.

I suspect that "set_buffer_hook" would install a buffer specific hook, 
rather than a mode specific hook.  (Of course, it could be the mode 
that sets the buffer specific hook.)

> How do I set WRAP = 1000; for Text mode, please?  (Or for all modes, if
> that's easier)

I'm not sure.  It might be as simple as putting WRAP = 1000; in .jedrc 
(outside of any function).

> I found some guidance here, but not enough:
> http://www.fi.infn.it/info/jed/jed_19.html

To edit a function from that page:

public define text_mode_hook ()
   {
      variable mode, modestr;
      (modestr, mode) = whatmode ();
      mode = mode & ~(1);  % unset wrap bit
      setmode (modestr, mode);
   }

(I believe) the above function would give you a text_mode_hook function 
that would run (on the buffer) every time a buffer enters text-mode.  
The hook unsets the mode's wrap bit (hopefully disabling wrapping).

I believe jed actually has 2 layers of modes:  modestr is a string that 
names a mode.  modestr modes are more flexible and customizable.  The 
"mode" variable, on the other hand, chooses between a very small set of 
fundamental/primative modes that are much less flexible.  Knowing that 
these two layers exist might(?) help you avoid confusion.

-Parke
_______________________________________________
Jed-users-l mailing list
Jed-users-l@xxxxxxxx
http://mailman.jtan.com/mailman/listinfo/jed-users-l


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