Changeset 217a43e


Ignore:
Timestamp:
Jul 3, 2002, 6:28:46 PM (19 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".
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r1c6c4d3 r217a43e  
    2121        The "Not logged in or subscribing to messages" error
    2222                now includes the name of the recipient.
     23        Fixed a bug in the "reply -e" command.
     24        The "disable-ctrl-d" variable may also be set to "middle"
     25                which will result in ctrl-d only sending at the
     26                end of the message.  This is now the default.
     27                This also added a command "editmulti:done-or-delete".
    2328               
    24291.2.1-pre-1
  • commands.c

    r1c6c4d3 r217a43e  
    622622                  "", ""),
    623623
     624  OWLCMD_VOID_CTX("editmulti:done-or-delete", owl_command_editmulti_done_or_delete,
     625                  OWL_CTX_EDITMULTI,
     626                  "completes the command, but only if at end of message",
     627                  "",
     628                  "If only whitespace is to the right of the cursor,\n"
     629                  "runs 'editmulti:done'.\n"\
     630                  "Otherwise runs 'edit:delete-next-char'\n"),
     631
    624632  /****************************************************************/
    625633  /********************** POPLESS-SPECIFIC ************************/
     
    11461154    edit=1;
    11471155    argv++;
     1156    argc--;
    11481157  }
    11491158
     
    15531562}
    15541563
     1564void owl_command_editmulti_done_or_delete(owl_editwin *e) {
     1565  if (owl_editwin_is_at_end(e)) {
     1566    owl_command_editmulti_done(e);
     1567  } else {
     1568    owl_editwin_delete_char(e);
     1569  }
     1570}
     1571
    15551572
    15561573/*********************************************************************/
  • editwin.c

    rb68f9cd r217a43e  
    740740}
    741741
     742/* returns if only whitespace remains */
     743int owl_editwin_is_at_end(owl_editwin *e) {
     744  int i, cur; 
     745  cur=_owl_editwin_get_index_from_xy(e);
     746  if (cur >= e->bufflen) return(1);
     747  for (i=e->bufflen-1; i>cur; i--) {
     748    if (e->buff[i] != '\r'
     749        && e->buff[i] != '\n'
     750        && e->buff[i] != ' ') {
     751      return(0);
     752    }
     753  }
     754  if (cur==i) return(1);
     755  else return(0);
     756}
     757
    742758int owl_editwin_check_dotsend(owl_editwin *e) {
    743759  int i;
  • functions.c

    r507d5aa r217a43e  
    126126  owl_editwin_new_style(e, OWL_EDITWIN_STYLE_MULTILINE);
    127127
    128   if (!owl_global_is_lockout_ctrld(&g)) {
     128  if (!owl_global_get_lockout_ctrld(&g)) {
    129129    owl_function_makemsg("Type your zephyr below.  End with ^D or a dot on a line by itself.  ^C will quit.");
    130130  } else {
  • keys.c

    r262422c r217a43e  
    9494  /*BIND_CMD("C-c C-c", "editmulti:done", "sends the zephyr");*/
    9595
    96   /* note that changing "disable-ctrl-d" will change this to
     96  /* note that changing "disable-ctrl-d" to "on" will change this to
    9797   * edit:delete-next-char */
    98   BIND_CMD("C-d",     "editmulti:done", "sends the zephyr");
     98  BIND_CMD("C-d",     "editmulti:done-or-delete", "sends the zephyr if at the end of the message");
    9999
    100100
  • 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.