Changeset aa2f33b3


Ignore:
Timestamp:
Jul 16, 2002, 9:55:47 PM (22 years ago)
Author:
Erik Nygren <nygren@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:
f2e36b5
Parents:
e50cd56
Message:
	Variables now have a summary and a long description.
	        Only the summary is shown with help.
		The long description is shown with "show variable foo".
        Fix the scrolling bug where we would sometimes fail to scroll
             the screen down, leaving the current message off
             the bottom of the screen.
        Added a 'scrollmode' variable which determines how the screen
	     will scroll as the cursor moves.  The default behaves
	     identically to previous versions of owl.
             The following modes are supported:
	     normal      - This is the owl default.  Scrolling happens
	                   when it needs to, and an attempt is made to
	                   keep the current message roughly near
	                   the middle of the screen.  (default)
	     top         - The current message will always be the
	                   the top message displayed.
	     neartop     - The current message will be one down
	                   from the top message displayed,
	                   where possible.
	     center      - An attempt is made to keep the current
	                   message near the center of the screen.
	     paged       - The top message displayed only changes
	                   when user moves the cursor to the top
	                   or bottom of the screen.  When it moves,
	                   the screen will be paged up or down and
	                   the cursor will be near the top or
	                   the bottom.
	     pagedcenter - The top message displayed only changes
	                   when user moves the cursor to the top
	                   or bottom of the screen.  When it moves,
	                   the screen will be paged up or down and
	                   the cursor will be near the center.
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    re50cd56 raa2f33b3  
    11$Id$
     2
     31.2.1-pre-3
     4        Variables now have a summary and a long description.
     5                Only the summary is shown with help.
     6                The long description is shown with "show variable foo".
     7        Fix the scrolling bug where we would sometimes fail to scroll
     8             the screen down, leaving the current message off
     9             the bottom of the screen.
     10        Added a 'scrollmode' variable which determines how the screen
     11             will scroll as the cursor moves.  The default behaves
     12             identically to previous versions of owl.
     13             The following modes are supported:
     14             normal      - This is the owl default.  Scrolling happens
     15                           when it needs to, and an attempt is made to
     16                           keep the current message roughly near
     17                           the middle of the screen.  (default)
     18             top         - The current message will always be the
     19                           the top message displayed.
     20             neartop     - The current message will be one down
     21                           from the top message displayed,
     22                           where possible.
     23             center      - An attempt is made to keep the current
     24                           message near the center of the screen.
     25             paged       - The top message displayed only changes
     26                           when user moves the cursor to the top
     27                           or bottom of the screen.  When it moves,
     28                           the screen will be paged up or down and
     29                           the cursor will be near the top or
     30                           the bottom.
     31             pagedcenter - The top message displayed only changes
     32                           when user moves the cursor to the top
     33                           or bottom of the screen.  When it moves,
     34                           the screen will be paged up or down and
     35                           the cursor will be near the center.\n",
    236
    3371.2.1-pre-2
  • functions.c

    re50cd56 raa2f33b3  
    712712
    713713void owl_function_calculate_topmsg(int direction) {
    714   int recwinlines, y, savey, i, j, topmsg, curmsg, foo;
    715   owl_mainwin *mw;
     714  int recwinlines, topmsg, curmsg;
    716715  owl_view *v;
    717716
    718   mw=owl_global_get_mainwin(&g);
    719 
     717  v=owl_global_get_current_view(&g);
     718  curmsg=owl_global_get_curmsg(&g);
    720719  topmsg=owl_global_get_topmsg(&g);
    721   curmsg=owl_global_get_curmsg(&g);
    722   v=owl_global_get_current_view(&g);
    723720  recwinlines=owl_global_get_recwin_lines(&g);
    724721
     
    726723    return;
    727724  }
     725
     726  switch (owl_global_get_scrollmode(&g)) {
     727  case OWL_SCROLLMODE_TOP:
     728    topmsg = owl_function_calculate_topmsg_top(direction, v, curmsg,
     729                                               topmsg, recwinlines);
     730    break;
     731  case OWL_SCROLLMODE_NEARTOP:
     732    topmsg = owl_function_calculate_topmsg_neartop(direction, v, curmsg,
     733                                                   topmsg, recwinlines);
     734    break;
     735  case OWL_SCROLLMODE_CENTER:
     736    topmsg = owl_function_calculate_topmsg_center(direction, v, curmsg,
     737                                                  topmsg, recwinlines);
     738    break;
     739  case OWL_SCROLLMODE_PAGED:
     740    topmsg = owl_function_calculate_topmsg_paged(direction, v, curmsg,
     741                                                 topmsg, recwinlines, 0);
     742    break;
     743  case OWL_SCROLLMODE_PAGEDCENTER:
     744    topmsg = owl_function_calculate_topmsg_paged(direction, v, curmsg,
     745                                                 topmsg, recwinlines, 1);
     746    break;
     747  case OWL_SCROLLMODE_NORMAL:
     748  default:
     749    topmsg = owl_function_calculate_topmsg_normal(direction, v, curmsg,
     750                                                  topmsg, recwinlines);
     751  }
     752  owl_global_set_topmsg(&g, topmsg);
     753}
     754
     755/* Returns what the new topmsg should be. 
     756 * Passed the last direction of movement,
     757 * the current view,
     758 * the current message number in the view,
     759 * the top message currently being displayed,
     760 * and the number of lines in the recwin.
     761 */
     762int owl_function_calculate_topmsg_top(int direction, owl_view *v, int curmsg, int topmsg, int recwinlines) {
     763  return curmsg;
     764}
     765
     766int owl_function_calculate_topmsg_neartop(int direction, owl_view *v, int curmsg, int topmsg, int recwinlines) {
     767  if (curmsg>0
     768      && (owl_message_get_numlines(owl_view_get_element(v, curmsg-1))
     769          <  recwinlines/2)) {
     770    return curmsg-1;
     771  } else {
     772    return curmsg;
     773  }
     774}
     775 
     776int owl_function_calculate_topmsg_center(int direction, owl_view *v, int curmsg, int topmsg, int recwinlines) {
     777  int i, last, lines;
     778
     779  last = curmsg;
     780  lines = 0;
     781  for (i=curmsg-1; i>=0; i--) {
     782    lines += owl_message_get_numlines(owl_view_get_element(v, i));
     783    if (lines > recwinlines/2) break;
     784    last = i;
     785  }
     786  return last;
     787}
     788 
     789int owl_function_calculate_topmsg_paged(int direction, owl_view *v, int curmsg, int topmsg, int recwinlines, int center_on_page) {
     790  int i, last, lines, savey;
     791 
     792  /* If we're off the top of the screen, scroll up such that the
     793   * curmsg is near the botton of the screen. */
     794  if (curmsg < topmsg) {
     795    last = curmsg;
     796    lines = 0;
     797    for (i=curmsg; i>=0; i--) {
     798      lines += owl_message_get_numlines(owl_view_get_element(v, i));
     799      if (lines > recwinlines) break;
     800    last = i;
     801    }
     802    if (center_on_page) {
     803      return owl_function_calculate_topmsg_center(direction, v, curmsg, 0, recwinlines);
     804    } else {
     805      return last;
     806    }
     807  }
     808
     809  /* Find number of lines from top to bottom of curmsg (store in savey) */
     810  savey=0;
     811  for (i=topmsg; i<=curmsg; i++) {
     812    savey+=owl_message_get_numlines(owl_view_get_element(v, i));
     813  }
     814
     815  /* if we're off the bottom of the screen, scroll down */
     816  if (savey > recwinlines) {
     817    if (center_on_page) {
     818      return owl_function_calculate_topmsg_center(direction, v, curmsg, 0, recwinlines);
     819    } else {
     820      return curmsg;
     821    }
     822  }
     823
     824  /* else just stay as we are... */
     825  return topmsg;
     826}
     827
     828
     829int owl_function_calculate_topmsg_normal(int direction, owl_view *v, int curmsg, int topmsg, int recwinlines) {
     830  int savey, j, i, foo, y;
    728831 
    729832  /* Find number of lines from top to bottom of curmsg (store in savey) */
     
    761864      }
    762865      if (j<0) j=0;
    763       owl_global_set_topmsg(&g, j);
    764       return;
     866      return j;
    765867    }
    766868  }
     
    778880        j--;
    779881      }
    780       owl_global_set_topmsg(&g, j+1);
    781       return;
    782     }
    783   }
     882      return j+1;
     883    }
     884  }
     885
     886  return topmsg;
    784887}
    785888
     
    12191322      "Variables: (use 'show variable <name>' for details)\n");
    12201323  owl_variable_dict_get_names(owl_global_get_vardict(&g), &varnames);
    1221   owl_variable_get_summaryheader(&fm);
    12221324  numvarnames = owl_list_get_size(&varnames);
    12231325  for (i=0; i<numvarnames; i++) {
    12241326    varname = owl_list_get_element(&varnames, i);
    12251327    if (varname && varname[0]!='_') {
    1226       owl_variable_get_summary(owl_global_get_vardict(&g), varname, &fm);
     1328      owl_variable_describe(owl_global_get_vardict(&g), varname, &fm);
    12271329    }
    12281330  }
  • help.c

    r6794f72 raa2f33b3  
    105105                         "Variables:\n");
    106106  owl_variable_dict_get_names(owl_global_get_vardict(&g), &varnames);
    107   owl_variable_get_summaryheader(&fm);
    108107  numvarnames = owl_list_get_size(&varnames);
    109108  for (i=0; i<numvarnames; i++) {
    110109    varname = owl_list_get_element(&varnames, i);
    111110    if (varname && varname[0]!='_') {
    112       owl_variable_get_summary(owl_global_get_vardict(&g), varname, &fm);
     111      owl_variable_describe(owl_global_get_vardict(&g), varname, &fm);
    113112    }
    114113  }
  • owl.h

    rae9e6be raa2f33b3  
    1212static const char owl_h_fileIdent[] = "$Id$";
    1313
    14 #define OWL_VERSION         1.2.1-pre-1
    15 #define OWL_VERSION_STRING "1.2.1-pre-1"
     14#define OWL_VERSION         1.2.1-pre-3
     15#define OWL_VERSION_STRING "1.2.1-pre-3"
    1616
    1717#define OWL_DEBUG 0
     
    4646#define OWL_DIRECTION_DOWNWARDS 1
    4747#define OWL_DIRECTION_UPWARDS   2
     48
     49#define OWL_SCROLLMODE_NORMAL   0
     50#define OWL_SCROLLMODE_TOP      1
     51#define OWL_SCROLLMODE_NEARTOP  2
     52#define OWL_SCROLLMODE_CENTER   3
     53#define OWL_SCROLLMODE_PAGED    4
     54#define OWL_SCROLLMODE_PAGEDCENTER 5
     55
    4856
    4957#define OWL_TAB               3  /* This *HAS* to be the size of TABSTR below */
     
    114122  int   ival_default;  /* for types int and bool     */
    115123  char *validsettings;          /* documentation of valid settings */
    116   char *docstring;              /* documentation of valid settings */
     124  char *summary;                /* summary of usage */
     125  char *description;            /* detailed description */
    117126  void *val;                    /* current value */
    118127  int  (*validate_fn)(struct _owl_variable *v, void *newval);
  • variable.c

    rae9e6be raa2f33b3  
    1010static int in_regtest = 0;
    1111
    12 #define OWLVAR_BOOL(name,default,docstring) \
    13         { name, OWL_VARIABLE_BOOL, NULL, default, "on,off", docstring, NULL, \
     12#define OWLVAR_BOOL(name,default,summary,description) \
     13        { name, OWL_VARIABLE_BOOL, NULL, default, "on,off", summary,description, NULL, \
    1414        NULL, NULL, NULL, NULL, NULL }
    1515
    16 #define OWLVAR_BOOL_FULL(name,default,docstring,validate,set,get) \
    17         { name, OWL_VARIABLE_BOOL, NULL, default, "on,off", docstring, NULL, \
     16#define OWLVAR_BOOL_FULL(name,default,summary,description,validate,set,get) \
     17        { name, OWL_VARIABLE_BOOL, NULL, default, "on,off", summary,description, NULL, \
    1818        validate, set, NULL, get, NULL }
    1919
    20 #define OWLVAR_INT(name,default,docstring) \
    21         { name, OWL_VARIABLE_INT, NULL, default, "<int>", docstring, NULL, \
     20#define OWLVAR_INT(name,default,summary,description) \
     21        { name, OWL_VARIABLE_INT, NULL, default, "<int>", summary,description, NULL, \
    2222        NULL, NULL, NULL, NULL, NULL, NULL }
    2323
    24 #define OWLVAR_INT_FULL(name,default,docstring,validset,validate,set,get) \
    25         { name, OWL_VARIABLE_INT, NULL, default, validset, docstring, NULL, \
     24#define OWLVAR_INT_FULL(name,default,summary,description,validset,validate,set,get) \
     25        { name, OWL_VARIABLE_INT, NULL, default, validset, summary,description, NULL, \
    2626        validate, set, NULL, get, NULL, NULL }
    2727
    28 #define OWLVAR_PATH(name,default,docstring) \
    29         { name, OWL_VARIABLE_STRING, default, 0, "<path>", docstring,  NULL, \
     28#define OWLVAR_PATH(name,default,summary,description) \
     29        { name, OWL_VARIABLE_STRING, default, 0, "<path>", summary,description,  NULL, \
    3030        NULL, NULL, NULL, NULL, NULL, NULL }
    3131
    32 #define OWLVAR_STRING(name,default,docstring) \
    33         { name, OWL_VARIABLE_STRING, default, 0, "<string>", docstring, NULL, \
     32#define OWLVAR_STRING(name,default,summary,description) \
     33        { name, OWL_VARIABLE_STRING, default, 0, "<string>", summary,description, NULL, \
    3434        NULL, NULL, NULL, NULL, NULL, NULL }
    3535
     
    3737 * list of strings which can be specified.  The tokens, starting at 0,
    3838 * correspond to the values that may be specified. */
    39 #define OWLVAR_ENUM(name,default,docstring,validset) \
    40         { name, OWL_VARIABLE_INT, NULL, default, validset, docstring, NULL, \
     39#define OWLVAR_ENUM(name,default,summary,description,validset) \
     40        { name, OWL_VARIABLE_INT, NULL, default, validset, summary,description, NULL, \
    4141        owl_variable_enum_validate, \
    4242        NULL, owl_variable_enum_set_fromstring, \
     
    4444        NULL }
    4545
    46 #define OWLVAR_ENUM_FULL(name,default,docstring,validset,validate, set, get) \
    47         { name, OWL_VARIABLE_INT, NULL, default, validset, docstring, NULL, \
     46#define OWLVAR_ENUM_FULL(name,default,summary,description,validset,validate, set, get) \
     47        { name, OWL_VARIABLE_INT, NULL, default, validset, summary,description, NULL, \
    4848        validate, \
    4949        set, owl_variable_enum_set_fromstring, \
     
    5454
    5555  OWLVAR_BOOL( "personalbell" /* %OwlVarStub */, 0,
    56                "ring the terminal bell when personal messages are received" ),
     56               "ring the terminal bell when personal messages are received",
     57               "" ),
    5758
    5859  OWLVAR_BOOL( "bell" /* %OwlVarStub */, 1,
    59                "enable / disable the terminal bell" ),
     60               "enable / disable the terminal bell", "" ),
    6061
    6162  OWLVAR_BOOL_FULL( "debug" /* %OwlVarStub */, OWL_DEBUG,
    6263                    "whether debugging is enabled",
     64                    "If set to 'on', debugging messages are logged to the\n"
     65                    "file specified by the debugfile variable.\n",
    6366                    NULL, owl_variable_debug_set, NULL),
    6467
    6568  OWLVAR_BOOL( "startuplogin" /* %OwlVarStub */, 1,
    66                "send a login message when owl starts" ),
     69               "send a login message when owl starts", "" ),
    6770
    6871  OWLVAR_BOOL( "shutdownlogout" /* %OwlVarStub */, 1,
    69                "send a logout message when owl exits" ),
     72               "send a logout message when owl exits", "" ),
    7073
    7174  OWLVAR_BOOL( "rxping" /* %OwlVarStub */, 0,
    72                "display received pings" ),
     75               "display received pings", "" ),
    7376
    7477  OWLVAR_BOOL( "txping" /* %OwlVarStub */, 1,
    75                "send pings" ),
     78               "send pings", "" ),
    7679
    7780  OWLVAR_BOOL( "displayoutgoing" /* %OwlVarStub */, 1,
    78                "display outgoing messages" ),
     81               "display outgoing messages", "" ),
    7982
    8083  OWLVAR_BOOL( "loginsubs" /* %OwlVarStub */, 1,
    81                "load logins from .anyone on startup" ),
     84               "load logins from .anyone on startup", "" ),
    8285
    8386  OWLVAR_BOOL( "logging" /* %OwlVarStub */, 0,
    84                "turn personal logging on or off" ),
     87               "turn personal logging on or off",
     88               "If this is set to on, personal messages are\n"
     89               "logged in the directory specified\n"
     90               "by the 'logpath' variable.  The filename in that\n"
     91               "directory is derived from the sender of the message.\n" ),
    8592
    8693  OWLVAR_BOOL( "classlogging" /* %OwlVarStub */, 0,
    87                "turn class logging on or off" ),
     94               "turn class logging on or off",
     95               "If this is set to on, class messages are\n"
     96               "logged in the directory specified\n"
     97               "by the 'classlogpath' variable.\n"
     98               "The filename in that directory is derived from\n"
     99               "the name of the class to which the message was sent.\n" ),
    88100
    89101  OWLVAR_BOOL( "colorztext" /* %OwlVarStub */, 1,
    90                "allow @color() in zephyrs to change color" ),
     102               "allow @color() in zephyrs to change color",
     103               "Note that only messages received after this variable\n"
     104               "is set will be affected." ),
    91105
    92106  OWLVAR_ENUM_FULL( "disable-ctrl-d" /* %OwlVarStub:lockout_ctrld */, 1,
    93                     "don't send zephyrs on C-d (or disable if in the middle of the message if set to 'middle')", "off,middle,on",
     107                    "don't send zephyrs on C-d",
     108                    "If set to 'off', C-d won't send a zephyr from the edit\n"
     109                    "window.  If set to 'on', C-d will always send a zephyr\n"
     110                    "being composed in the edit window.  If set to 'middle',\n"
     111                    "C-d will only ever send a zephyr if the cursor is at\n"
     112                    "the end of the message being composed.\n\n"
     113                    "Note that this works by changing the C-d keybinding\n"
     114                    "in the editmulti keymap.\n",
     115                    "off,middle,on",
    94116                    NULL, owl_variable_disable_ctrl_d_set, NULL),
    95117
    96118  OWLVAR_BOOL( "_burningears" /* %OwlVarStub:burningears */, 0,
    97                "[NOT YET IMPLEMENTED] beep on messages matching patterns" ),
     119               "[NOT YET IMPLEMENTED] beep on messages matching patterns", "" ),
    98120
    99121  OWLVAR_BOOL( "_summarymode" /* %OwlVarStub:summarymode */, 0,
    100                "[NOT YET IMPLEMENTED]" ),
     122               "[NOT YET IMPLEMENTED]", "" ),
    101123
    102124  OWLVAR_PATH( "logpath" /* %OwlVarStub */, "~/zlog/people",
    103                "path for logging personal zephyrs" ),
     125               "path for logging personal zephyrs",
     126               "Specifies a directory which must exist.\n"
     127               "Files will be created in the directory for each sender.\n"),
    104128
    105129  OWLVAR_PATH( "classlogpath" /* %OwlVarStub:classlogpath */, "~/zlog/class",
    106                "path for logging class zephyrs" ),
     130               "path for logging class zephyrs",
     131               "Specifies a directory which must exist.\n"
     132               "Files will be created in the directory for each class.\n"),
    107133
    108134  OWLVAR_PATH( "debug_file" /* %OwlVarStub */, OWL_DEBUG_FILE,
    109                "path for logging debug messages when debugging is enabled" ),
     135               "path for logging debug messages when debugging is enabled",
     136               "This file will be logged to if 'debug' is set to 'on'.\n"),
    110137 
    111138  OWLVAR_PATH( "zsigproc" /* %OwlVarStub:zsig_exec */, NULL,
    112                "name of a program to run that will generate zsigs" ),
     139               "name of a program to run that will generate zsigs",
     140               "This program should produce a zsig on stdout when run.\n"
     141               "Note that it is important that this program not block.\n" ),
    113142
    114143  OWLVAR_STRING( "zsig" /* %OwlVarStub */, "",
    115                  "zephyr signature" ),
     144                 "zephyr signature",
     145                 "If 'zsigproc' is not set, this string will be used\n"
     146                 "as a zsig.  If this is also unset, the 'zwrite-signature'\n"
     147                 "zephyr variable will be used instead.\n"),
    116148
    117149  OWLVAR_STRING( "appendtosepbar" /* %OwlVarStub */, "",
    118                  "string to append to the end of the sepbar" ),
     150                 "string to append to the end of the sepbar",
     151                 "The sepbar is the bar separating the top and bottom\n"
     152                 "of the owl screen.  Any string specified here will\n"
     153                 "be displayed on the right of the sepbar\n"),
    119154
    120155  OWLVAR_BOOL( "zaway" /* %OwlVarStub */, 0,
    121                "turn zaway on or off" ),
     156               "turn zaway on or off", "" ),
    122157
    123158  OWLVAR_STRING( "zaway_msg" /* %OwlVarStub */,
    124159                 OWL_DEFAULT_ZAWAYMSG,
    125                  "zaway msg for responding to zephyrs when away" ),
     160                 "zaway msg for responding to zephyrs when away", "" ),
    126161
    127162  OWLVAR_STRING( "zaway_msg_default" /* %OwlVarStub */,
    128163                 OWL_DEFAULT_ZAWAYMSG,
    129                  "default zaway message" ),
     164                 "default zaway message", "" ),
    130165
    131166  OWLVAR_STRING( "view_home" /* %OwlVarStub */, "all",
    132                  "home view to switch to after 'X'" ),
     167                 "home view to switch to after 'X' and 'V'",
     168                 "SEE ALSO: view, filter\n" ),
    133169
    134170  OWLVAR_INT(    "edit:maxfillcols" /* %OwlVarStub:edit_maxfillcols */, 70,
    135                  "maximum number of columns for M-q to fill text to (or unlimited if 0)" ),
     171                 "maximum number of columns for M-q to fill text to",
     172                 "This specifies the maximum number of columns for M-q\n"
     173                 "to fill text to.  If set to 0, ther will be no maximum\n"
     174                 "limit.  In all cases, the current width of the screen\n"
     175                 "will also be taken into account.  It will be used instead\n"
     176                 "if it is narrower than the maximum, or if this\n"
     177                 "is set to 0.\n" ),
    136178
    137179  OWLVAR_INT(    "edit:maxwrapcols" /* %OwlVarStub:edit_maxwrapcols */, 0,
    138                  "maximum number of columns for line-wrapping (or unlimited if 0)" ),
     180                 "maximum number of columns for line-wrapping",
     181                 "This specifies the maximum number of columns for\n"
     182                 "auto-line-wrapping.  If set to 0, ther will be no maximum\n"
     183                 "limit.  In all cases, the current width of the screen\n"
     184                 "will also be taken into account.  It will be used instead\n"
     185                 "if it is narrower than the maximum, or if this\n"
     186                 "is set to 0.\n\n"
     187                 "It is recommended that outgoing messages be no wider\n"
     188                 "than 60 columns, as a courtesy to recipients.\n"),
    139189
    140190  OWLVAR_INT_FULL( "typewinsize" /* %OwlVarStub:typwin_lines */,
    141191                   OWL_TYPWIN_SIZE,
    142                   "number of lines in the typing window", "int > 0",
     192                  "number of lines in the typing window",
     193                   "This specifies the height of the window at the\n"
     194                   "bottom of the screen where commands are entered\n"
     195                   "and where messages are composed.\n",
     196                   "int > 0",
    143197                   owl_variable_int_validate_gt0,
    144198                   owl_variable_typewinsize_set,
     
    146200                   ),
    147201
     202  OWLVAR_ENUM( "scrollmode" /* %OwlVarStub */, OWL_SCROLLMODE_NORMAL,
     203               "how to scroll up and down",
     204               "This controls how the screen is scrolled as the\n"
     205               "cursor moves between messages being displayed.\n"
     206               "The following modes are supported:\n\n"
     207               "   normal      - This is the owl default.  Scrolling happens\n"
     208               "                 when it needs to, and an attempt is made to\n"
     209               "                 keep the current message roughly near\n"
     210               "                 the middle of the screen.\n"
     211               "   top         - The current message will always be the\n"
     212               "                 the top message displayed.\n"
     213               "   neartop     - The current message will be one down\n"
     214               "                 from the top message displayed,\n"
     215               "                 where possible.\n"
     216               "   center      - An attempt is made to keep the current\n"
     217               "                 message near the center of the screen.\n"
     218               "   paged       - The top message displayed only changes\n"
     219               "                 when user moves the cursor to the top\n"
     220               "                 or bottom of the screen.  When it moves,\n"
     221               "                 the screen will be paged up or down and\n"
     222               "                 the cursor will be near the top or\n"
     223               "                 the bottom.\n"
     224               "   pagedcenter - The top message displayed only changes\n"
     225               "                 when user moves the cursor to the top\n"
     226               "                 or bottom of the screen.  When it moves,\n"
     227               "                 the screen will be paged up or down and\n"
     228               "                 the cursor will be near the center.\n",
     229               "normal,top,neartop,center,paged,pagedcenter" ),
     230
    148231  OWLVAR_ENUM( "webbrowser" /* %OwlVarStub */, OWL_WEBBROWSER_NETSCAPE,
    149232               "web browser to use to launch URLs",
     233               "When the 'w' key is pressed, this browser is used\n"
     234               "to display the requested URL.\n",
    150235               "none,netscape,galeon,opera" ),
    151236
    152237  OWLVAR_BOOL( "_followlast" /* %OwlVarStub */, 0,
    153                "enable automatic following of the last zephyr" ),
     238               "enable automatic following of the last zephyr",
     239               "If the cursor is at the last message, it will\n"
     240               "continue to follow the last message if this is set.\n"
     241               "Note that this is currently risky as you might accidentally\n"
     242               "delete a message right as it came in.\n" ),
    154243
    155244  /* This MUST be last... */
    156   { NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
     245  { NULL, 0, NULL, 0, NULL, NULL, NULL, NULL,
     246    NULL, NULL, NULL, NULL, NULL, NULL }
    157247
    158248};
     
    300390
    301391
    302 char *owl_variable_get_docstring(owl_variable *v) {
    303   return v->docstring;
     392char *owl_variable_get_description(owl_variable *v) {
     393  return v->description;
     394}
     395
     396char *owl_variable_get_summary(owl_variable *v) {
     397  return v->summary;
    304398}
    305399
     
    420514}
    421515
    422 #define OWL_VARIABLE_HELP_FMT "     %-15s %-9s %-9s %s\n"
    423 
    424 /* appends to the end of the fmtext */
    425 void owl_variable_get_summaryheader(owl_fmtext *fm) {
    426   char tmpbuff[512];
    427   snprintf(tmpbuff, 512, 
    428            OWL_VARIABLE_HELP_FMT OWL_VARIABLE_HELP_FMT,
    429            "name",            "settings", "default", "meaning",
    430            "---------------", "--------", "-------", "-------");
    431   owl_fmtext_append_bold(fm, tmpbuff);
    432 }
    433 
    434 void owl_variable_get_summary(owl_vardict *d, char *name, owl_fmtext *fm) {
    435   char defaultbuf[10];
     516void owl_variable_describe(owl_vardict *d, char *name, owl_fmtext *fm) {
     517  char defaultbuf[50];
    436518  char buf[1024];
    437519  int buflen = 1023;
     
    446528  }
    447529  if (v->type == OWL_VARIABLE_INT || v->type == OWL_VARIABLE_BOOL) {
    448     v->get_tostring_fn(v, defaultbuf, 10, &(v->ival_default));
     530    v->get_tostring_fn(v, defaultbuf, 50, &(v->ival_default));
    449531  } else {
    450     v->get_tostring_fn(v, defaultbuf, 10, v->pval_default);
    451   }
    452   snprintf(buf, buflen, OWL_VARIABLE_HELP_FMT,
     532    v->get_tostring_fn(v, defaultbuf, 50, v->pval_default);
     533  }
     534  snprintf(buf, buflen, OWL_TABSTR "%-20s - %s (default: '%s')\n",
    453535                  v->name,
    454                   owl_variable_get_validsettings(v),
    455                   defaultbuf,
    456                   owl_variable_get_docstring(v));
     536                  owl_variable_get_summary(v), defaultbuf);
    457537  owl_fmtext_append_normal(fm, buf);
    458538}
     
    474554  owl_fmtext_append_normal(fm, name);
    475555  owl_fmtext_append_normal(fm, " - ");
    476   owl_fmtext_append_normal(fm, v->docstring);
     556  owl_fmtext_append_normal(fm, v->summary);
    477557  owl_fmtext_append_normal(fm, "\n\n");
    478558
     
    495575  owl_fmtext_append_normal(fm, owl_variable_get_validsettings(v));
    496576  owl_fmtext_append_normal(fm, "\n\n");
     577
     578  if (v->description && *v->description) {
     579    owl_fmtext_append_normal(fm, "Description:\n");
     580    owl_fmtext_append_normal(fm, owl_variable_get_description(v));
     581    owl_fmtext_append_normal(fm, "\n\n");
     582  }
    497583}
    498584
Note: See TracChangeset for help on using the changeset viewer.