* Sven Guckes <[EMAIL PROTECTED]> [2002-04-03 09:40]:
> ObMutt:
> can mutt display its own process id?
> 
> the display of the porcess id would be
> helpful when there's a problem with mutt.
> the admin could add this number to the
> status_format in /etc/Muttrc so that
> users will see it and will catch it
> with a screen hardcopy.  bug reports
> might then be handled much quicker..

This made me interested.  This works for me, against mutt-1.3.27.
Ite defines %$ as the status char for the pid.  My rudimentary tests
show that it Does The Right Thing.

(I diff'ed with -caw; is there a preferred option set for mutt patches?)

(darren)

*** status.c.orig       Wed Apr  3 11:11:19 2002
--- status.c    Wed Apr  3 11:17:51 2002
***************
*** 52,58 ****
   * %S = current aux sorting method ($sort_aux)
   * %t = # of tagged messages [option]
   * %v = Mutt version 
!  * %V = currently active limit pattern [option] */
  static const char *
  status_format_str (char *buf, size_t buflen, char op, const char *src,
                   const char *prefix, const char *ifstring,
--- 52,59 ----
   * %S = current aux sorting method ($sort_aux)
   * %t = # of tagged messages [option]
   * %v = Mutt version 
!  * %V = currently active limit pattern [option]
!  * %$ = current pid */
  static const char *
  status_format_str (char *buf, size_t buflen, char op, const char *src,
                   const char *prefix, const char *ifstring,
***************
*** 272,277 ****
--- 273,283 ----
        optional = 0;
        break;
  
+     case '$':
+       snprintf (fmt, sizeof(fmt), "%%%sd", prefix);
+       snprintf (buf, buflen, fmt, getpid());
+       break;
+ 
      case 0:
        *buf = 0;
        return (src);

-- 
Responsible behavior is the result of a socialization process.

Reply via email to