Changeset bd3f232 for variable.c


Ignore:
Timestamp:
Jun 10, 2003, 3:14:59 PM (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:
f14a7ee
Parents:
6e05655
Message:
Styles implemented
It's still a little buggy ... if a format_msg(); is used in perl admin
  messages (or maybe just the first admin message) are not formatted.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • variable.c

    r6a415e9 rbd3f232  
    198198  OWLVAR_STRING_FULL( "tty" /* %OwlVarStub */, "", "tty name for zephyr location", "",
    199199                      NULL, owl_variable_tty_set, NULL),
    200  
     200
     201  OWLVAR_STRING_FULL( "style" /* %OwlVarStub */, "default", "name of the current formatting style", "",
     202                      NULL, owl_variable_style_set, NULL),
     203
    201204  OWLVAR_INT(    "edit:maxfillcols" /* %OwlVarStub:edit_maxfillcols */, 70,
    202205                 "maximum number of columns for M-q to fill text to",
     
    347350  ZInitLocationInfo(owl_global_get_hostname(&g), newval);
    348351  return(owl_variable_string_set_default(v, newval));
     352}
     353
     354int owl_variable_style_set(owl_variable *v, void *newval) {
     355  /* Invalidate all message formats first */
     356  int ret;
     357  owl_style *s;
     358
     359  s=owl_global_get_style_by_name(&g, newval);
     360  if (!s) {
     361    /* this message won't get seen, we'll need to deal with that later */
     362    owl_function_makemsg("No style named '%s' exists.", newval);
     363    return(0);
     364  }
     365 
     366  owl_messagelist_invalidate_formats(owl_global_get_msglist(&g));
     367  ret=owl_variable_string_set_default(v, newval);
     368  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
     369  return(ret);
    349370}
    350371
Note: See TracChangeset for help on using the changeset viewer.