Changeset 217a43e for variable.c


Ignore:
Timestamp:
Jul 3, 2002, 6:28:46 PM (18 years ago)
Author:
Erik Nygren <nygren@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:
8df36cc
Parents:
83a9b63
Message:
	Fixed a bug in the "reply -e" command.
	The "disable-ctrl-d" variable may also be set to "middle"
	        which will result in ctrl-d only sending at the
		end of the message.  This is now the default.
		This also added a command "editmulti:done-or-delete".
File:
1 edited

Legend:

Unmodified
Added
Removed
  • variable.c

    r039213e r217a43e  
    4242        NULL }
    4343
     44#define OWLVAR_ENUM_FULL(name,default,docstring,validset,validate, set, get) \
     45        { name, OWL_VARIABLE_INT, NULL, default, validset, docstring, NULL, \
     46        validate, \
     47        set, owl_variable_enum_set_fromstring, \
     48        get, owl_variable_enum_get_tostring, \
     49        NULL }
     50
    4451static owl_variable variables_to_init[] = {
    4552
     
    7885               "turn class logging on or off" ),
    7986
    80   OWLVAR_BOOL_FULL( "disable-ctrl-d" /* %OwlVarStub:lockout_ctrld */, 0,
    81                     "don't send zephyrs on C-d",
     87  OWLVAR_ENUM_FULL( "disable-ctrl-d" /* %OwlVarStub:lockout_ctrld */, 1,
     88                    "don't send zephyrs on C-d (or disable if in the middle of the message if set to 'middle')", "off,middle,on",
    8289                    NULL, owl_variable_disable_ctrl_d_set, NULL),
    8390
     
    186193 * any user setting of this */
    187194int owl_variable_disable_ctrl_d_set(owl_variable *v, void *newval) {
    188   if (newval && !owl_context_is_startup(owl_global_get_context(&g))
    189       && (*(int*)newval == 1 || *(int*)newval == 0)) {
    190     if (*(int*)newval) {
     195  if (newval && !owl_context_is_startup(owl_global_get_context(&g))) {
     196    if (*(int*)newval == 2) {
    191197      owl_function_command_norv("bindkey editmulti C-d command edit:delete-next-char");
     198    } else if (*(int*)newval == 1) {
     199      owl_function_command_norv("bindkey editmulti C-d command editmulti:done-or-delete");
    192200    } else {
    193201      owl_function_command_norv("bindkey editmulti C-d command editmulti:done");
    194202    }
    195203  } 
    196   return owl_variable_bool_set_default(v, newval); 
     204  return owl_variable_int_set_default(v, newval); 
    197205}
    198206
Note: See TracChangeset for help on using the changeset viewer.