<<< Date Index >>>     <<< Thread Index >>>

Re: mutt/2323: feature of creating personal my_variables should be documented



The following reply was made to PR mutt/2323; it has been noted by GNATS.

From: Brendan Cully <brendan@xxxxxxxxxx>
To: bug-any@xxxxxxxxxxxxx, veronatif@xxxxxxx
Cc: 
Subject: Re: mutt/2323: feature of creating personal my_variables should be 
documented
Date: Tue, 4 Jul 2006 11:50:09 -0700

 --45Z9DzgjV8m4Oswq
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 On Tuesday, 04 July 2006 at 10:15, Alain Bench wrote:
 > The following reply was made to PR mutt/2323; it has been noted by GNATS.
 > 
 > From: Alain Bench <veronatif@xxxxxxx>
 > To: bug-any@xxxxxxxxxxxxx
 > Cc: 
 > Subject: Re: mutt/2323: feature of creating personal my_variables should be 
 > documented
 > Date: Tue, 4 Jul 2006 09:44:07 +0200 (CEST)
 > 
 >   On Monday, July 3, 2006 at 20:45:02 +0200, Brendan Cully wrote:
 >  
 >  > On Monday, 03 July 2006 at 20:35, Alain Bench wrote:
 >  >> BTW I tried to interactively type ":set my_variable=value" while in
 >  >> pager of CVS 2006-06-29, and got "Not available in this menu." and
 >  >> the var was not changed. Feature?
 >  >>
 >  >> The same typed in index does work. But shouts "Sorting mailbox..."
 >  >> and redisplays the full index.
 >  > Strange - I can't reproduce either of those. Maybe a make clean is in
 >  > order? or perhaps there's a local patch involved?
 >  
 >      No patch, straight copy of a clean updated but untouched checkout,
 >  ./prepare --enable-debug && make for the first time in the copy... And
 >  ./mutt -nF /dev/null while at it. Same symptoms.
 >  
 >  
 >   On Tuesday, July 4, 2006 at 0:25:01 +0200, Christian Ebert wrote:
 >  
 >  >>> [same typed in index] shouts "Sorting mailbox..." and redisplays
 >  > No.
 >  
 >      Resorting takes a fraction of second: A big folder and typing "of"
 >  ($sort=from is dead slow) might help seeing the message. I see the same
 >  as if I typed ":reset duplicate_threads" that *does* affect sorting
 >  (this variable has R_RESORT|R_RESORT_INIT|R_INDEX flags in init.h),
 >  while it should be as say ":reset editor" no redraw/resort (R_NONE).
 
 Ah! Thanks for the clue. Please let me know if the attached patch
 solves these problems.
 
 --45Z9DzgjV8m4Oswq
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="myvar-vs-checkpager.diff"
 
 ? .cdtproject
 ? .project
 Index: init.c
 ===================================================================
 RCS file: /home/roessler/cvs/mutt/init.c,v
 retrieving revision 3.55
 diff -u -p -r3.55 init.c
 --- init.c     6 Jun 2006 23:58:10 -0000       3.55
 +++ init.c     4 Jul 2006 18:46:54 -0000
 @@ -50,7 +50,7 @@
  #include <sys/wait.h>
  
  #define CHECK_PAGER \
 -      if ((CurrentMenu == MENU_PAGER) && \
 +  if ((CurrentMenu == MENU_PAGER) && (idx >= 0) &&    \
            (MuttVars[idx].flags & R_RESORT)) \
        { \
          snprintf (err->data, err->dsize, \
 @@ -1756,7 +1756,7 @@ static int parse_set (BUFFER *tmp, BUFFE
        CHECK_PAGER;
          if (myvar)
            myvar_del (myvar);
 -        else if (DTYPE (MuttVars[idx].type) == DT_ADDR)
 +      else if (DTYPE (MuttVars[idx].type) == DT_ADDR)
          rfc822_free_address ((ADDRESS **) MuttVars[idx].data);
        else
          /* MuttVars[idx].data is already 'char**' (or some 'void**') or... 
 @@ -1800,12 +1800,12 @@ static int parse_set (BUFFER *tmp, BUFFE
        CHECK_PAGER;
          s->dptr++;
  
 -        /* copy the value of the string */
          if (myvar)
 -        {
 -          myvar = safe_strdup (myvar);
 +      {
 +        /* myvar is a pointer to tmp and will be lost on extract_token */
 +        myvar = safe_strdup (myvar);
            myvar_del (myvar);
 -        }
 +      }
          else if (DTYPE (MuttVars[idx].type) == DT_ADDR)
          rfc822_free_address ((ADDRESS **) MuttVars[idx].data);
          else
 @@ -1818,6 +1818,7 @@ static int parse_set (BUFFER *tmp, BUFFE
          {
            myvar_set (myvar, tmp->data);
            FREE (&myvar);
 +        myvar="don't resort";
          }
          else if (DTYPE (MuttVars[idx].type) == DT_PATH)
          {
 
 --45Z9DzgjV8m4Oswq--