Changeset 5e0b690


Ignore:
Timestamp:
Apr 10, 2004, 10:47:40 AM (20 years ago)
Author:
James M. Kretchmar <kretch@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:
405d5e6
Parents:
f84bca8
Message:
The colorclass command is added, to make colorization easy
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    rf84bca8 r5e0b690  
    11$Id$
    22
     32.1.7-pre-1
     4        The colorclass command is added, to make colorization easy
     5       
    362.1.6
    47        Fixed three bugs found by Valgrind.
  • commands.c

    rd4b84c0 r5e0b690  
    546546              "The color of messages in the current filter will be changed\n"
    547547              "to <color>.  Use the 'show colors' command for a list\n"
     548              "of valid colors.\n\n"
     549              "SEE ALSO: 'show colors'\n"),
     550
     551  OWLCMD_ARGS("colorclass", owl_command_colorclass, OWL_CTX_INTERACTIVE,
     552              "create a filter to color messages of the given class name",
     553              "colorclass <class> <color>",
     554              "A filter will be created to color messages in <class>"
     555              "in <color>.  Use the 'show colors' command for a list\n"
    548556              "of valid colors.\n\n"
    549557              "SEE ALSO: 'show colors'\n"),
     
    22322240}
    22332241
     2242char *owl_command_colorclass(int argc, char **argv, char *buff)
     2243{
     2244  char *filtname;
     2245 
     2246  if (argc!=3) {
     2247    owl_function_makemsg("Wrong number of arguments to colorclass command");
     2248    return NULL;
     2249  }
     2250
     2251  filtname=owl_function_classinstfilt(argv[1], NULL);
     2252  (void) owl_function_color_filter(filtname, argv[2]);
     2253  return NULL;
     2254}
     2255
    22342256char *owl_command_zpunt(int argc, char **argv, char *buff)
    22352257{
  • functions.c

    rfe1f605 r5e0b690  
    23012301}
    23022302
     2303/* Change the filter associated with the current view.
     2304 * This also figures out which message in the new filter
     2305 * should have the pointer.
     2306 */
    23032307void owl_function_change_currentview_filter(char *filtname)
    23042308{
     
    23462350}
    23472351
     2352/* Create a new filter, or replace an existing one
     2353 * with a new definition.
     2354 */
    23482355void owl_function_create_filter(int argc, char **argv)
    23492356{
     
    28392846}
    28402847
     2848/* Set the color of the current view's filter to
     2849 * be 'color'
     2850 */
    28412851void owl_function_color_current_filter(char *color)
    28422852{
     2853  char *name;
     2854
     2855  name=owl_view_get_filtname(owl_global_get_current_view(&g));
     2856  owl_function_color_filter(name, color);
     2857}
     2858
     2859/* Set the color of the filter 'filter' to be 'color'.  If the color
     2860 * name does not exist, return -1, if the filter does not exist or is
     2861 * the "all" filter, return -2.  Return 0 on success
     2862 */
     2863int owl_function_color_filter(char *filtname, char *color)
     2864{
    28432865  owl_filter *f;
    2844   char *name;
    2845 
    2846   name=owl_view_get_filtname(owl_global_get_current_view(&g));
    2847   f=owl_global_get_filter(&g, name);
     2866
     2867  f=owl_global_get_filter(&g, filtname);
    28482868  if (!f) {
    28492869    owl_function_error("Unknown filter");
    2850     return;
     2870    return(-2);
    28512871  }
    28522872
    28532873  /* don't touch the all filter */
    2854   if (!strcmp(name, "all")) {
     2874  if (!strcmp(filtname, "all")) {
    28552875    owl_function_error("You may not change the 'all' filter.");
    2856     return;
    2857   }
    2858 
    2859   /* deal with the case of trying change the filter color */
     2876    return(-2);
     2877  }
     2878
    28602879  if (owl_util_string_to_color(color)==-1) {
    28612880    owl_function_error("No color named '%s' avilable.");
    2862     return;
     2881    return(-1);
    28632882  }
    28642883  owl_filter_set_color(f, owl_util_string_to_color(color));
    28652884  owl_global_set_needrefresh(&g);
    28662885  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
     2886  return(0);
    28672887}
    28682888
  • owl.h

    rf84bca8 r5e0b690  
    5959static const char owl_h_fileIdent[] = "$Id$";
    6060
    61 #define OWL_VERSION         2.1.6
    62 #define OWL_VERSION_STRING "2.1.6"
     61#define OWL_VERSION         2.1.7-pre-1
     62#define OWL_VERSION_STRING "2.1.7-pre-1"
    6363
    6464/* Feature that is being tested to redirect stderr through a pipe.
Note: See TracChangeset for help on using the changeset viewer.