[1499] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

Re: modnarrow: narrowing with/without the unclass

daemon@ATHENA.MIT.EDU (Nelson Elhage)
Thu Oct 29 18:17:17 2009

Resent-From: nelhage@mit.edu
Resent-To: barnowl-dev-mtg@charon.mit.edu
X-Original-To: nelhage@lunatique.mit.edu
Date: Tue, 9 Jun 2009 12:50:31 -0400
From: Nelson Elhage <nelhage@MIT.EDU>
To: Geoffrey Thomas <geofft@mit.edu>
Cc: barnowl-dev@mit.edu, Alexander M Vandiver <alexmv@mit.edu>,
        Joshua Pollack <fustflum@mit.edu>,
        Alejandro R Sedeno <asedeno@mit.edu>, Paul Baranay <pbaranay@mit.edu>
In-Reply-To: <alpine.DEB.2.00.0906051822030.24021@lunatique.mit.edu>

Sorry, it took me a while to get to looking at this. A few thoughts.

First, I don't love the 'modnarrow' name. I'll live with it if we've
got nothing better, but let's try to think of something better. One
thing that I came up with that I don't know if I like is 'related' --
have a 'narrow-related' variable, and generate filters like
'class-barnowl' or 'related-class-barnowl'.

As for the actual code, I've got a few comments:

(*) In owl_command_smartnarrow, I don't like the fact that
    'smartnarrow -m -i' won't work. Realistically, almost no one calls
    that command manually, so maybe it doesn't matter, but it bugs
    me. Given a choice, I'd prefer -m -i work and not -mi, than the
    other way around.

    Actually, it occurs to me we have enough rope to just move this
    function entirely into perl, if that makes the parsing cleaner.

(*) I don't like the calling convention you're creating for perl
    smartfilter methods. Let's pass in '-i' and '-m' as separate bits,
    rather than making every smartfilter method parse out the
    difference between '-m' and '-i' and '-mi'. I propose that
    'smartfilter' always gets called as one of:
    smartfilter('-i')
    smartfilter(undef, '-m')
    smartfilter('-i', '-m');

    Actually, I'd be entirely in favor of just using 1 or 0 as the
    flags there, since I think they should just be boolean
    flags. Current code treats them as such, in fact: Your modnarrow
    branch makes it so that the 'modnarrow' variable affects whether
    jabber personals narrow to <user@host/resource> or just
    <user@host>, because BarnOwl::Message::Jabber::smartfilter only
    examines the truth of its first argument, not its string value. I
    guess this could be intentional on your part, but it doesn't make
    sense to me.

- Nelson

On Fri, Jun 05, 2009 at 07:20:02PM -0400, Geoffrey Thomas wrote:
> I have code to make BarnOwl's narrowing commands either include or not  
> include the un- and .d classes, depending on the value of the "modnarrow" 
> variable. The way it works is that modnarrow is set by default, and uses  
> filters named modclass-barnowl etc., but if you unset it, narrowing  
> functions will use class-barnowl etc., which does not include the un- and 
> .d classes.
>
> There's also support for M-m and M-M doing the opposite of the current  
> modnarrow setting (i.e., the opposite of what M-n and M-M do), so you can 
> quickly include or ignore variant classes in your narrow.
>
> The code is available in the git branch
>
>   git://geofft.scripts.mit.edu/barnowl modnarrow
>
> (aka "cd /mit/geofft/owl; git log -p modnarrow" if that's easier), and  
> I've compiled and installed it in /mit/geofft/barnowl/bin/barnowl for 
> i386 Linux if you want to play around with it.
>
> Let me know if you have thoughts about merging it. The one change from  
> existing behavior (as opposed to additional behavior) is that the meaning 
> of the filter e.g. class-barnowl changes to not including the variant  
> classes, which can affect you if you use that filter for coloring or  
> something.
>
>       Add the "modnarrow" variable.
>       Add option to smartnarrow to temporarily invert modnarrow.
>
>  commands.c  |   24 ++++++++++++++----------
>  functions.c |   43 ++++++++++++++++++++++++++++---------------
>  keys.c      |    2 ++
>  variable.c  |    5 +++++
>  4 files changed, 49 insertions(+), 25 deletions(-)
>
> -- 
> Geoffrey Thomas
> geofft@mit.edu
>

home help back first fref pref prev next nref lref last post