Changeset 3895e23 for commands.c


Ignore:
Timestamp:
Dec 25, 2003, 12:05:02 AM (17 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
280ddc6
Parents:
330bcec
Message:
The '!' key (bound to 'view -r') now creates a negative version of the
  current view and switches to it.  i.e. "show me all the messages that
  are not these"
File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    r40458b9 r3895e23  
    548548  OWLCMD_ARGS("view", owl_command_view, OWL_CTX_INTERACTIVE,
    549549              "view messages matching a filter",
    550               "view [<viewname>] [-f <filter> | --home ] [-s <style>]\n"
     550              "view [<viewname>] [-f <filter> | --home | -r ] [-s <style>]\n"
    551551              "view <filter>\n"
    552552              "view -d <expression>\n"
     
    12261226  }
    12271227  if (filtname) {
    1228     owl_function_change_view(filtname);
     1228    owl_function_change_currentview_filter(filtname);
    12291229    owl_free(filtname);
    12301230  }
     
    19101910}
    19111911
     1912
     1913/* Backwards compatability has made this kind of complicated:
     1914 * view [<viewname>] [-f <filter> | -d <expression> | --home | -r ] [-s <style>]
     1915 * view <filter>
     1916 * view -d <expression>
     1917 * view --home
     1918 */
    19121919char *owl_command_view(int argc, char **argv, char *buff)
    19131920{
    1914 
    1915   /* Backwards compatability has made this kind of complicated:
    1916    * view [<viewname>] [-f <filter> | -d <expression> | --home ] [-s <style>]
    1917    * view <filter>
    1918    * view -d <expression>
    1919    * view --home
    1920    */
    1921 
    1922   /* First take the 'view --home' case */
    1923   if (argc == 2 && !strcmp(argv[1], "--home")) {
    1924     owl_function_change_view(owl_global_get_view_home(&g));
    1925     return(NULL);
     1921  /* First take the 'view --home' and 'view -r' cases */
     1922  if (argc == 2) {
     1923    if (!strcmp(argv[1], "--home")) {
     1924      owl_function_change_currentview_filter(owl_global_get_view_home(&g));
     1925      return(NULL);
     1926    } else if (!strcmp(argv[1], "-r")) {
     1927      char *foo;
     1928      foo=owl_function_create_negative_filter(owl_view_get_filtname(owl_global_get_current_view(&g)));
     1929      owl_function_change_currentview_filter(foo);
     1930      return(NULL);
     1931    }
    19261932  }
    19271933
    19281934  /* Now look for 'view <filter>' */
    19291935  if (argc==2) {
    1930     owl_function_change_view(argv[1]);
     1936    owl_function_change_currentview_filter(argv[1]);
    19311937    return(NULL);
    19321938  }
     
    19441950    }
    19451951    owl_function_create_filter(argc, myargv);
    1946     owl_function_change_view("owl-dynamic");
     1952    owl_function_change_currentview_filter("owl-dynamic");
    19471953    owl_free(myargv);
    19481954    return NULL;
     
    19561962  argc--;
    19571963  argv++;
    1958   if (strcmp(argv[0], "-f") && strcmp(argv[0], "-d") && strcmp(argv[0], "--home") && strcmp(argv[0], "-s")) {
     1964  if (strcmp(argv[0], "-f") &&
     1965      strcmp(argv[0], "-d") &&
     1966      strcmp(argv[0], "--home") &&
     1967      strcmp(argv[0], "-s") &&
     1968      strcmp(argv[0], "-r")) {
    19591969    if (strcmp(argv[0], "main")) {
    19601970      owl_function_makemsg("No view named '%s'", argv[0]);
     
    19701980        return(NULL);
    19711981      }
    1972       owl_function_change_view(argv[1]);
     1982      owl_function_change_currentview_filter(argv[1]);
    19731983      argc-=2;
    19741984      argv+=2;
    19751985    } else if (!strcmp(argv[0], "--home")) {
    1976       owl_function_change_view(owl_global_get_view_home(&g));
     1986      owl_function_change_currentview_filter(owl_global_get_view_home(&g));
    19771987      argc--;
    19781988      argv++;
     1989    } else if (!strcmp(argv[0], "-r")) {
     1990      char *foo;
     1991      foo=owl_function_create_negative_filter(owl_view_get_filtname(owl_global_get_current_view(&g)));
     1992      owl_function_change_currentview_filter(foo);
    19791993    } else if (!strcmp(argv[0], "-s")) {
    19801994      if (argc<2) {
     
    20692083  }
    20702084  filtname = owl_function_classinstfilt(argv[1], NULL);
    2071   owl_function_change_view(filtname);
     2085  owl_function_change_currentview_filter(filtname);
    20722086  owl_free(filtname);
    20732087  return NULL;
     
    20822096  }
    20832097  filtname=owl_function_zuserfilt(argv[1]);
    2084   owl_function_change_view(filtname);
     2098  owl_function_change_currentview_filter(filtname);
    20852099  owl_free(filtname);
    20862100  return NULL;
Note: See TracChangeset for help on using the changeset viewer.