- Subject: Re: [Jed-users-l] Turning off auto-wrap
- From: Doug Kramer <doog@xxxxxxxxxx>
- Date: Fri, 24 Jun 2011 14:34:59 -0700
On Thu, May 5, 2011 at 4:14 PM, Parke Bostrom <parke.bostrom@xxxxxxxxx>wrote:
> > Doug Kramer <doog@xxxxxxxxxx> wrote:
> >
> > > Is there a way to turn off the automatic wrapping of text to the next
> line
> > > if it gets too long?
> >
>
> On Thu, May 05, 2011 at 10:02:01PM +0200, Morten Bo Johansen wrote:
> > There is the WRAP variable that you could set to a sufficiently high
> > number, e.g. in you .jedrc
> >
> > WRAP = 1000;
> >
> > I wondered what would be the best method to turn it off completely ...
> > in your .jedrc, something like (?)
> >
> > define text_mode_hook ()
> > {
> > set_mode (get_mode_name, 0);
> > }
> >
> > which would turn off wrapping when editing files with text_mode.
> >
> > It would be nice if the WRAP variable turned off wrapping completely if
> > set to e.g. -1
> >
> > WRAP = -1 % turn off wrapping altogether
>
>
> You could also install a "wrapok_hook" function that returns false, as
> per the below.
>
> -Parke
>
>
> >From (on Ubuntu) /usr/share/jed/doc/txt/hooks.txt:
>
> ===========================================================================
> Buffer-local Hooks
> ===========================================================================
>
> Buffer-local hooks are hooks that are defined on a buffer-by-buffer
> basis. These hooks are associated with the current buffer via the
> function set_buffer_hook'. The syntax for this function is
>
> set_buffer_hook (name_of_hook, &hook_function);
>
> Here name_of_hook is a string that indicates the name of the hook that
> is being set. The second argument, hook_function' specifies the
> S-Lang function to be associated with the hook. The calling syntax of
> the hook function varies with the hook.
>
> The following buffer-local hooks are supported:
>
> [snip]
>
> "wrapok_hook"
> This hook may be used to enable automatic wrapping on a
> line-by-line basis. Jed will call this hook prior to wrapping a
> line, and if it returns a non-zero value, the line will be
> wrapped. See lib/slmode.sl for an example of its use.
> _______________________________________________
>
(Delayed followup)
I don't quite follow set_buffer_hook. (Are hooks related to modes?)
When I'm editing with no mode, I am able to happily type way past 100
without the line wrapping, which is what I need.
(I really prefer creating my own newlines.)
But when editing *.txt files in Text mode, it reverts to wrapping.
How do I set WRAP = 1000; for Text mode, please? (Or for all modes, if
that's easier)
I found some guidance here, but not enough:
http://www.fi.infn.it/info/jed/jed_19.html
-Doug
_______________________________________________
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]