[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [vile] toggle boolean settings
From: |
Thomas Dickey |
Subject: |
Re: [vile] toggle boolean settings |
Date: |
Thu, 16 Aug 2012 20:06:14 -0400 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Thu, Aug 16, 2012 at 06:44:35PM -0400, Wayne Cuddy wrote:
> Tom,
>
> I've been using this macro you wrote for me quite some time ago and just
> noticed that when 'setv' applies the setting it seems to be applied
> globally, not locally to the buffer. (set vs setl)
>
> If I load 2 buffers. Call "ToggleList li" and then switch the window's
> view to another buffer, listing is still applied (and turned off if I call
> the macro again). This is not the behavior if I enable listing using
> "setl".
>
> Is there a way to make it operate locally?
It's doable - another code change... -
I believe that it didn't happen to occur to me because
the particular function that I used to implement "setv" doesn't have
a parameter to specify the local setting.
(I'm getting ready to go out of town for a few days, otherwise I'd
make a patch right now :-( )
>
> Thanks,
> Wayne
>
> On Wed, Mar 07, 2012 at 08:49:29PM -0500, Thomas Dickey wrote:
> > On Tue, Mar 06, 2012 at 08:48:29PM -0500, Thomas Dickey wrote:
> > > On Wed, Feb 29, 2012 at 05:15:36PM -0500, Thomas Dickey wrote:
> > > > On Wed, Feb 29, 2012 at 01:51:46PM -0500, address@hidden wrote:
> > > > > Is there a way to simply negate boolean settings? If not it would be
> > > > > nice to have a feature like this:
> > > > >
> > > > > setl !list
> > > > > or
> > > > > setl notlist
> > > > >
> > > > > If listing is enabled it would be disabled, else enabled.
> > ...
> >
> > here's a complete macro (still not the suggested syntax...)
> >
> > ; generalized from ToggleList, for any boolean mode
> > store-procedure ToggleMode mode='Mode'
> > ~local %mode
> > setv %mode &cat '$' $1
> > ~if &or \
> > &seq "TRUE" &indirect %mode \
> > &seq "FALSE" &indirect %mode
> > setv &indirect $1 ¬ &indirect %mode
> > ~else
> > write-message "Not a boolean mode"
> > ~endif
> > ~endm
> >
> > --
> > Thomas E. Dickey <address@hidden>
> > http://invisible-island.net
> > ftp://invisible-island.net
>
>
>
> > _______________________________________________
> > vile mailing list
> > address@hidden
> > https://lists.nongnu.org/mailman/listinfo/vile
>
>
> _______________________________________________
> vile mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/vile
--
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net
signature.asc
Description: Digital signature