Changeset 8ee73f8d for examples


Ignore:
Timestamp:
Jun 30, 2002, 2:54:22 AM (22 years ago)
Author:
Erik Nygren <nygren@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
039213e
Parents:
d36f2cb
Message:
	Fixed a memory reference bug in delete and undelete commands.
	Added support for perl to call directly back into owl.
	Changed the implementation of owl::command("...") to immediately
	        call back into owl.  This allows perl to get the return
		value of strings returned by owl commands.
	Added the getview command which returns the name of the current
	        view's filter.
	Added the getvar command which returns the value of a variable.
	Added an example to examples/owlconf.erik which uses TAB to
		narrow and restore the view.
	Added an example to examples/owlconf.erik which uses M-c to
		color messages matching the current one green.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/owlconf.erik

    rb950088 r8ee73f8d  
    6666sub sepbartokens_set {
    6767    owl::command(sprintf "set -q appendtosepbar \"%s\"", (join " ", @sepbartokens));
     68}
     69
     70my $restoreview = undef;
     71sub swapview {
     72    my $curview = owl::command("getview");
     73    if ($restoreview) {
     74        owl::command("view $restoreview");
     75        $restoreview = undef;
     76    } else {
     77        $restoreview = $curview;
     78        owl::command("smartnarrow");
     79    }
     80}
     81
     82my $lastcolored = undef;
     83sub colorthread {
     84    if ($lastcolored) {
     85        owl::command("filter $lastcolored -c default");
     86    }
     87    my $smartfilt = owl::command("smartfilter");
     88    if (!$smartfilt or $smartfilt eq $lastcolored) {
     89        owl::command("filter $lastcolored -c default");
     90        $lastcolored = undef;
     91    } else {
     92        owl::command("filter $smartfilt -c green");
     93        $lastcolored = $smartfilt;
     94    }
    6895}
    6996
     
    97124    owl::command("bindkey recv M-l command ( expunge ; view all )");
    98125    owl::command("bindkey recv M-K command ( smartnarrow ; delete view ; expunge ; view all )");
     126
     127    # toggle between a view and a smartnarrow with TAB
     128    owl::command("alias swapview perl swapview();");
     129    owl::command("bindkey recv C-i command swapview");
     130
     131    # color the current thread
     132    owl::command("alias colorthread perl colorthread();");
     133    owl::command("bindkey recv M-c command colorthread");
    99134
    100135    # Make 'M-s' insert a <scritchscritchscritch> sequence with a random
Note: See TracChangeset for help on using the changeset viewer.