Changeset 382:0d4b409996b9

Show
Ignore:
Timestamp:
1998-10-05 11:24:42 (10 years ago)
Author:
Thomas Roessler <roessler@…>
Branch:
HEAD
Message:

Vikas' macro_function patch.

Files:
24 modified

Legend:

Unmodified
Added
Removed
  • aclocal.m4

    r300 r382  
    183183           if test "$gt_cv_func_gettext_libc" != "yes"; then 
    184184             AC_CHECK_LIB(intl, bindtextdomain, 
    185                [AC_CACHE_CHECK([for gettext in libintl], 
    186                  gt_cv_func_gettext_libintl, 
    187                  [AC_CHECK_LIB(intl, gettext, 
    188                   gt_cv_func_gettext_libintl=yes, 
    189                   gt_cv_func_gettext_libintl=no)], 
     185               [AC_CHECK_LIB(intl, gettext, 
     186                 gt_cv_func_gettext_libintl=yes, 
    190187                 gt_cv_func_gettext_libintl=no)]) 
    191188           fi 
  • addrbook.c

    r324 r382  
    126126  int i, done = 0; 
    127127  char helpstr[SHORT_STRING]; 
     128  int savedmenu = CurrentMenu; 
    128129 
    129130  if (!aliases) 
     
    140141  menu->search = alias_search; 
    141142  menu->tag = alias_tag; 
    142   menu->menu = MENU_ALIAS; 
     143  menu->menu = CurrentMenu = MENU_ALIAS; 
    143144  menu->title = _("Aliases"); 
    144145  menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_ALIAS, AliasHelp); 
     
    189190   
    190191  mutt_menuDestroy (&menu); 
     192  CurrentMenu = savedmenu; 
    191193  safe_free ((void **) &AliasTable); 
    192194} 
  • browser.c

    r332 r382  
    466466  struct stat st; 
    467467  int i, killPrefix = 0; 
     468  int savedmenu = CurrentMenu; 
    468469 
    469470  memset (&state, 0, sizeof (struct browser_state)); 
     
    516517 
    517518  menu = mutt_new_menu (); 
    518   menu->menu = MENU_FOLDER; 
     519  menu->menu = CurrentMenu = MENU_FOLDER; 
    519520  menu->make_entry = folder_entry; 
    520521  menu->search = select_file_search; 
     
    625626        destroy_state (&state); 
    626627        mutt_menuDestroy (&menu); 
     628        CurrentMenu = savedmenu; 
    627629        return; 
    628630 
     
    663665                destroy_state (&state); 
    664666                mutt_menuDestroy (&menu); 
     667                CurrentMenu = savedmenu; 
    665668                return; 
    666669              } 
     
    719722              mutt_error _("Error scanning directory."); 
    720723              mutt_menuDestroy (&menu); 
     724              CurrentMenu = savedmenu; 
    721725              return; 
    722726            } 
     
    737741        { 
    738742          int reverse = 0; 
     743          event_t ch; 
    739744 
    740745          move (LINES - 1, 0); 
     
    748753          clrtoeol (); 
    749754 
    750           while ((i = mutt_getch ()) != EOF && i != 'a' && i != 'd' && i != 'z' 
    751                  && i != 'n') 
    752           { 
    753             if (i == ERR || CI_is_return (i)) 
     755          FOREVER 
     756          { 
     757            ch = mutt_getch(); 
     758            if (ch.ch == EOF || ch.ch == 'a' || ch.ch == 'd' || ch.ch == 'z' || ch.ch == 'n') 
     759              break; 
     760 
     761            if (ch.ch == ERR || CI_is_return (ch.ch)) 
    754762              break; 
    755763            else 
     
    757765          } 
    758766 
    759           if (i != EOF) 
    760           { 
    761             switch (i) 
     767          if (ch.ch != EOF) 
     768          { 
     769            switch (ch.ch) 
    762770            { 
    763771              case 'a':  
     
    806814          destroy_state (&state); 
    807815          mutt_menuDestroy (&menu); 
     816          CurrentMenu = savedmenu; 
    808817          return; 
    809818        } 
  • commands.c

    r300 r382  
    222222    if (option (OPTPROMPTAFTER)) 
    223223    { 
    224       mutt_ungetch (mutt_any_key_to_continue _("Command: ")); 
     224      mutt_ungetch (mutt_any_key_to_continue _("Command: "), 0); 
    225225      rc = km_dokey (MENU_PAGER); 
    226226    } 
     
    394394{ 
    395395  int method = Sort; /* save the current method in case of abort */ 
    396   int ch; 
     396  event_t ch; 
    397397 
    398398  Sort = 0; 
     
    404404_("Sort (d)ate/(f)rm/(r)ecv/(s)ubj/t(o)/(t)hread/(u)nsort/si(z)e/s(c)ore?: ")); 
    405405    ch = mutt_getch (); 
    406     if (ch == ERR || CI_is_return (ch)) 
     406    if (ch.ch == -1 || CI_is_return (ch.ch)) 
    407407    { 
    408408      Sort = method; 
     
    410410      return (-1); 
    411411    } 
    412     switch (ch) 
     412    switch (ch.ch) 
    413413    { 
    414414      case 'c': 
  • compose.c

    r334 r382  
    436436  int oldSort = Sort, oldSortAux = SortAux; 
    437437  struct stat st; 
     438  int savedmenu = CurrentMenu; 
    438439 
    439440  idx = mutt_gen_attach_list (msg->content, idx, &idxlen, &idxmax, 0, 1); 
    440441 
    441442  menu = mutt_new_menu (); 
    442   menu->menu = MENU_COMPOSE; 
     443  menu->menu = CurrentMenu = MENU_COMPOSE; 
    443444  menu->offset = HDR_ATTACH; 
    444445  menu->max = idxlen; 
     
    11061107 
    11071108  mutt_menuDestroy (&menu); 
     1109  CurrentMenu = savedmenu; 
    11081110 
    11091111  if (idxlen) 
  • configure

    r379 r382  
    818818 
    819819 
    820 ALL_LINGUAS="de" 
     820ALL_LINGUAS="de ru" 
    821821 
    822822 
     
    43254325if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then 
    43264326  echo "$ac_t""yes" 1>&6 
    4327   echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 
    4328 echo "configure:4329: checking for gettext in libintl" >&5 
    4329 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then 
    4330   echo $ac_n "(cached) $ac_c" 1>&6 
    4331 else 
    43324327  echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6 
    4333 echo "configure:4334: checking for gettext in -lintl" >&5 
     4328echo "configure:4329: checking for gettext in -lintl" >&5 
    43344329ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'` 
    43354330if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then 
     
    43394334LIBS="-lintl  $LIBS" 
    43404335cat > conftest.$ac_ext <<EOF 
    4341 #line 4342 "configure" 
     4336#line 4337 "configure" 
    43424337#include "confdefs.h" 
    43434338/* Override any gcc2 internal prototype to avoid an error.  */ 
     
    43504345; return 0; } 
    43514346EOF 
    4352 if { (eval echo configure:4353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 
     4347if { (eval echo configure:4348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 
    43534348  rm -rf conftest* 
    43544349  eval "ac_cv_lib_$ac_lib_var=yes" 
     
    43714366fi 
    43724367 
    4373 fi 
    4374  
    4375 echo "$ac_t""$gt_cv_func_gettext_libintl" 1>&6 
    43764368else 
    43774369  echo "$ac_t""no" 1>&6 
     
    43894381set dummy msgfmt; ac_word=$2 
    43904382echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 
    4391 echo "configure:4392: checking for $ac_word" >&5 
     4383echo "configure:4384: checking for $ac_word" >&5 
    43924384if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then 
    43934385  echo $ac_n "(cached) $ac_c" 1>&6 
     
    44234415do 
    44244416echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 
    4425 echo "configure:4426: checking for $ac_func" >&5 
     4417echo "configure:4418: checking for $ac_func" >&5 
    44264418if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then 
    44274419  echo $ac_n "(cached) $ac_c" 1>&6 
    44284420else 
    44294421  cat > conftest.$ac_ext <<EOF 
    4430 #line 4431 "configure" 
     4422#line 4423 "configure" 
    44314423#include "confdefs.h" 
    44324424/* System header to define __stub macros and hopefully few prototypes, 
     
    44514443; return 0; } 
    44524444EOF 
    4453 if { (eval echo configure:4454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 
     4445if { (eval echo configure:4446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 
    44544446  rm -rf conftest* 
    44554447  eval "ac_cv_func_$ac_func=yes" 
     
    44784470set dummy gmsgfmt; ac_word=$2 
    44794471echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 
    4480 echo "configure:4481: checking for $ac_word" >&5 
     4472echo "configure:4473: checking for $ac_word" >&5 
    44814473if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then 
    44824474  echo $ac_n "(cached) $ac_c" 1>&6 
     
    45104502set dummy xgettext; ac_word=$2 
    45114503echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 
    4512 echo "configure:4513: checking for $ac_word" >&5 
     4504echo "configure:4505: checking for $ac_word" >&5 
    45134505if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then 
    45144506  echo $ac_n "(cached) $ac_c" 1>&6 
     
    45424534 
    45434535                cat > conftest.$ac_ext <<EOF 
    4544 #line 4545 "configure" 
     4536#line 4537 "configure" 
    45454537#include "confdefs.h" 
    45464538 
     
    45504542; return 0; } 
    45514543EOF 
    4552 if { (eval echo configure:4553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 
     4544if { (eval echo configure:4545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 
    45534545  rm -rf conftest* 
    45544546  CATOBJEXT=.gmo 
     
    45734565        if test "$CATOBJEXT" = "NONE"; then 
    45744566          echo $ac_n "checking whether catgets can be used""... $ac_c" 1>&6 
    4575 echo "configure:4576: checking whether catgets can be used" >&5 
     4567echo "configure:4568: checking whether catgets can be used" >&5 
    45764568          # Check whether --with-catgets or --without-catgets was given. 
    45774569if test "${with_catgets+set}" = set; then 
     
    45864578          if test "$nls_cv_use_catgets" = "yes"; then 
    45874579                    echo $ac_n "checking for main in -li""... $ac_c" 1>&6 
    4588 echo "configure:4589: checking for main in -li" >&5 
     4580echo "configure:4581: checking for main in -li" >&5 
    45894581ac_lib_var=`echo i'_'main | sed 'y%./+-%__p_%'` 
    45904582if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then 
     
    45944586LIBS="-li  $LIBS" 
    45954587cat > conftest.$ac_ext <<EOF 
    4596 #line 4597 "configure" 
     4588#line 4589 "configure" 
    45974589#include "confdefs.h" 
    45984590 
     
    46014593; return 0; } 
    46024594EOF 
    4603 if { (eval echo configure:4604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 
     4595if { (eval echo configure:4596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 
    46044596  rm -rf conftest* 
    46054597  eval "ac_cv_lib_$ac_lib_var=yes" 
     
    46294621 
    46304622            echo $ac_n "checking for catgets""... $ac_c" 1>&6 
    4631 echo "configure:4632: checking for catgets" >&5 
     4623echo "configure:4624: checking for catgets" >&5 
    46324624if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then 
    46334625  echo $ac_n "(cached) $ac_c" 1>&6 
    46344626else 
    46354627  cat > conftest.$ac_ext <<EOF 
    4636 #line 4637 "configure" 
     4628#line 4629 "configure" 
    46374629#include "confdefs.h" 
    46384630/* System header to define __stub macros and hopefully few prototypes, 
     
    46574649; return 0; } 
    46584650EOF 
    4659 if { (eval echo configure:4660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 
     4651if { (eval echo configure:4652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 
    46604652  rm -rf conftest* 
    46614653  eval "ac_cv_func_catgets=yes" 
     
    46794671set dummy gencat; ac_word=$2 
    46804672echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 
    4681 echo "configure:4682: checking for $ac_word" >&5 
     4673echo "configure:4674: checking for $ac_word" >&5 
    46824674if eval "test \"`echo '$''{'ac_cv_path_GENCAT'+set}'`\" = set"; then 
    46834675  echo $ac_n "(cached) $ac_c" 1>&6 
     
    47114703set dummy gmsgfmt; ac_word=$2 
    47124704echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 
    4713 echo "configure:4714: checking for $ac_word" >&5 
     4705echo "configure:4706: checking for $ac_word" >&5 
    47144706if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then 
    47154707  echo $ac_n "(cached) $ac_c" 1>&6 
     
    47444736set dummy msgfmt; ac_word=$2 
    47454737echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 
    4746 echo "configure:4747: checking for $ac_word" >&5 
     4738echo "configure:4739: checking for $ac_word" >&5 
    47474739if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then 
    47484740  echo $ac_n "(cached) $ac_c" 1>&6 
     
    47794771set dummy xgettext; ac_word=$2 
    47804772echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 
    4781 echo "configure:4782: checking for $ac_word" >&5 
     4773echo "configure:4774: checking for $ac_word" >&5 
    47824774if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then 
    47834775  echo $ac_n "(cached) $ac_c" 1>&6 
     
    48374829set dummy msgfmt; ac_word=$2 
    48384830echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 
    4839 echo "configure:4840: checking for $ac_word" >&5 
     4831echo "configure:4832: checking for $ac_word" >&5 
    48404832if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then 
    48414833  echo $ac_n "(cached) $ac_c" 1>&6 
     
    48714863set dummy gmsgfmt; ac_word=$2 
    48724864echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 
    4873 echo "configure:4874: checking for $ac_word" >&5 
     4865echo "configure:4866: checking for $ac_word" >&5 
    48744866if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then 
    48754867  echo $ac_n "(cached) $ac_c" 1>&6 
     
    49034895set dummy xgettext; ac_word=$2 
    49044896echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 
    4905 echo "configure:4906: checking for $ac_word" >&5 
     4897echo "configure:4898: checking for $ac_word" >&5 
    49064898if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then 
    49074899  echo $ac_n "(cached) $ac_c" 1>&6 
     
    49964988     else 
    49974989       echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 
    4998 echo "configure:4999: checking for catalogs to be installed" >&5 
     4990echo "configure:4991: checking for catalogs to be installed" >&5 
    49994991       NEW_LINGUAS= 
    50004992       for lang in ${LINGUAS=$ALL_LINGUAS}; do 
     
    50245016     ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` 
    50255017echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 
    5026 echo "configure:5027: checking for linux/version.h" >&5 
     5018echo "configure:5019: checking for linux/version.h" >&5 
    50275019if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then 
    50285020  echo $ac_n "(cached) $ac_c" 1>&6 
    50295021else 
    50305022  cat > conftest.$ac_ext <<EOF 
    5031 #line 5032 "configure" 
     5023#line 5024 "configure" 
    50325024#include "confdefs.h" 
    50335025#include <linux/version.h> 
    50345026EOF 
    50355027ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 
    5036 { (eval echo configure:5037: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 
     5028{ (eval echo configure:5029: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 
    50375029ac_err=`grep -v '^ *+' conftest.out` 
    50385030if test -z "$ac_err"; then 
  • configure.in

    r379 r382  
    44AM_INIT_AUTOMAKE(mutt, 0.94.10) 
    55 
    6 ALL_LINGUAS="de" 
     6ALL_LINGUAS="de ru" 
    77 
    88AC_CANONICAL_HOST 
  • curs_lib.c

    r332 r382  
    3636 */ 
    3737static short UngetCount = 0; 
    38  
    3938#define UngetBufLen 128 
    40 static int UngetBuf[UngetBufLen]; 
     39static event_t KeyEvent[UngetBufLen] = { {0,0} }; 
    4140 
    4241void mutt_refresh (void) 
     
    4746} 
    4847 
    49 int mutt_getch (void) 
     48event_t mutt_getch (void) 
    5049{ 
    5150  int ch; 
     51  event_t err = {-1,0}, ret; 
    5252 
    5353  if (UngetCount) 
    54     return (UngetBuf[--UngetCount]); 
     54    return (KeyEvent[--UngetCount]); 
    5555 
    5656  Signals &= ~S_INTERRUPT; 
     
    6767 
    6868  if(ch == -1) 
    69     return ch; 
     69    return err; 
    7070   
    7171  if ((ch & 0x80) && option (OPTMETAKEY)) 
     
    7373    /* send ALT-x as ESC-x */ 
    7474    ch &= ~0x80; 
    75     mutt_ungetch (ch); 
    76     return ('\033'); 
    77   } 
    78  
    79   return (ch == ctrl ('G') ? ERR : ch); 
     75    mutt_ungetch (ch, 0); 
     76    ret.ch = '\033'; 
     77    ret.op = 0; 
     78    return ret; 
     79  } 
     80 
     81  ret.ch = ch; 
     82  ret.op = 0; 
     83  return (ch == ctrl ('G') ? err : ret); 
    8084} 
    8185 
     
    127131int mutt_yesorno (const char *msg, int def) 
    128132{ 
    129   int ch; 
     133  event_t ch; 
    130134  const char *yes = _("yes"); 
    131135  const char *no = _("no"); 
     
    138142    mutt_refresh (); 
    139143    ch = mutt_getch (); 
    140     if (ch == ERR) return(-1); 
    141     if (CI_is_return (ch)) 
     144    if (ch.ch == ERR) return(-1); 
     145    if (CI_is_return (ch.ch)) 
    142146      break; 
    143     else if (tolower(ch) == tolower(*yes)) 
     147    else if (tolower(ch.ch) == tolower(*yes)) 
    144148    { 
    145149      def = 1; 
    146150      break; 
    147151    } 
    148     else if (tolower(ch) == tolower(*no)) 
     152    else if (tolower(ch.ch) == tolower(*no)) 
    149153    { 
    150154      def = 0; 
     
    298302int mutt_enter_fname (const char *prompt, char *buf, size_t blen, int *redraw, int buffy) 
    299303{ 
    300   int i; 
     304  event_t ch; 
    301305 
    302306  mvaddstr (LINES-1, 0, (char *) prompt); 
     
    307311  mutt_refresh (); 
    308312 
    309   if ((i = mutt_getch ()) == ERR) 
     313  ch = mutt_getch(); 
     314  if (ch.ch == -1) 
    310315  { 
    311316    CLEARLINE (LINES-1); 
    312317    return (-1); 
    313318  } 
    314   else if (i == '?') 
     319  else if (ch.ch == '?') 
    315320  { 
    316321    mutt_refresh (); 
     
    324329 
    325330    sprintf (pc, "%s: ", prompt); 
    326     mutt_ungetch (i); 
     331    mutt_ungetch (ch.ch, 0); 
    327332    if (mutt_get_field (pc, buf, blen, (buffy ? M_EFILE : M_FILE) | M_CLEAR) 
    328333        != 0) 
     
    338343 * instead of using a fixed array 
    339344 */ 
    340 void mutt_ungetch (int ch) 
    341 { 
     345void mutt_ungetch (int ch, int op) 
     346{ 
     347  event_t tmp; 
     348 
     349  tmp.ch = ch; 
     350  tmp.op = op; 
     351 
    342352  if (UngetCount < UngetBufLen) /* make sure not to overflow */ 
    343     UngetBuf[UngetCount++] = ch; 
     353    KeyEvent[UngetCount++] = tmp; 
    344354} 
    345355 
  • curs_main.c

    r324 r382  
    242242{ 
    243243  char buf[LONG_STRING], helpstr[SHORT_STRING]; 
    244   int op = OP_NULL;                 /* function to execute */ 
     244  int op = OP_NULL; 
     245  event_t event = {OP_NULL, 0}; 
    245246  int done = 0;                /* controls when to exit the "event" loop */ 
    246247  int i = 0, j; 
     
    255256  int close = 0; /* did we OP_QUIT or OP_EXIT out of this menu? */ 
    256257  int attach_msg = option(OPTATTACHMSG); 
     258  int savedmenu = CurrentMenu; 
    257259 
    258260  menu = mutt_new_menu (); 
    259   menu->menu = MENU_MAIN; 
     261  menu->menu = CurrentMenu = MENU_MAIN; 
    260262  menu->offset = 1; 
    261263  menu->pagelen = LINES - 3; 
     
    475477      { 
    476478        timeout (Timeout * 1000); /* milliseconds */       
    477         op = mutt_getch (); 
     479        event = mutt_getch (); 
    478480        timeout (-1); /* restore blocking operation */ 
    479         if (op != -1) 
    480         { 
    481           mutt_ungetch (op); 
     481        if (event.ch != -1) 
     482        { 
     483          mutt_ungetch (event.ch, event.op); 
    482484          op = km_dokey (MENU_MAIN); 
    483