mutt stable branch with some hacks
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove the $locale configuration variable.

$locale was only used to set the LC_TIME locale. Unfortunately, Mutt
previously defaulted to using "C". This overrode the user's locale
setting and forced them to re-specify their locale inside their
.muttrc.

Remove $locale and instead use the locale specified by the
environment. Mutt still allows "C locale" dates by using a leading
"!" in $date_format, ${}, etc.

Another use of $locale was to customize attribution dates using hooks.
The next commit will introduce $attribution_locale, which can be used
for this instead.

Thanks to Derek Martin for the original patch!

+24 -45
+6 -5
browser.c
··· 176 176 tnow = time (NULL); 177 177 t_fmt = tnow - folder->ff->mtime < 31536000 ? "%b %d %H:%M" : "%b %d %Y"; 178 178 } 179 - if (do_locales) 180 - setlocale(LC_TIME, NONULL (Locale)); /* use environment if $locale is not set */ 181 - else 182 - setlocale(LC_TIME, "C"); 183 - strftime (date, sizeof (date), t_fmt, localtime (&folder->ff->mtime)); 179 + 180 + if (!do_locales) 181 + setlocale (LC_TIME, "C"); 182 + strftime (date, sizeof (date), t_fmt, localtime (&folder->ff->mtime)); 183 + if (!do_locales) 184 + setlocale (LC_TIME, ""); 184 185 185 186 mutt_format_s (dest, destlen, fmt, date); 186 187 }
+6 -15
crypt-gpgme.c
··· 869 869 { 870 870 char p[STRING]; 871 871 872 - setlocale (LC_TIME, ""); 873 872 #ifdef HAVE_LANGINFO_D_T_FMT 874 873 strftime (p, sizeof (p), nl_langinfo (D_T_FMT), localtime (&t)); 875 874 #else 876 875 strftime (p, sizeof (p), "%c", localtime (&t)); 877 876 #endif 878 - setlocale (LC_TIME, "C"); 879 877 state_attach_puts (p, s); 880 878 } 881 879 ··· 2815 2813 } 2816 2814 *p = 0; 2817 2815 2818 - if (do_locales && Locale) 2819 - setlocale (LC_TIME, Locale); 2820 - 2821 2816 { 2822 2817 time_t tt = 0; 2823 2818 ··· 2826 2821 2827 2822 tm = localtime (&tt); 2828 2823 } 2829 - strftime (buf2, sizeof (buf2), dest, tm); 2830 2824 2831 - if (do_locales) 2832 - setlocale (LC_TIME, "C"); 2833 - 2825 + if (!do_locales) 2826 + setlocale (LC_TIME, "C"); 2827 + strftime (buf2, sizeof (buf2), dest, tm); 2828 + if (!do_locales) 2829 + setlocale (LC_TIME, ""); 2830 + 2834 2831 snprintf (fmt, sizeof (fmt), "%%%ss", prefix); 2835 2832 snprintf (dest, destlen, fmt, buf2); 2836 2833 if (len > 0) ··· 3371 3368 int i; 3372 3369 gpgme_user_id_t uid = NULL; 3373 3370 3374 - if (Locale) 3375 - setlocale (LC_TIME, Locale); 3376 - 3377 3371 is_pgp = key->protocol == GPGME_PROTOCOL_OpenPGP; 3378 3372 3379 3373 for (idx = 0, uid = key->uids; uid; idx++, uid = uid->next) ··· 3613 3607 putc ('\n', fp); 3614 3608 } 3615 3609 } 3616 - 3617 - if (Locale) 3618 - setlocale (LC_TIME, "C"); 3619 3610 } 3620 3611 3621 3612
-2
crypt.c
··· 64 64 if (option (OPTCRYPTTIMESTAMP)) 65 65 { 66 66 t = time(NULL); 67 - setlocale (LC_TIME, ""); 68 67 strftime (p, sizeof (p), _(" (current time: %c)"), localtime (&t)); 69 - setlocale (LC_TIME, "C"); 70 68 } 71 69 else 72 70 *p = '\0';
-1
globals.h
··· 66 66 #endif 67 67 WHERE char *Inbox; 68 68 WHERE char *Ispell; 69 - WHERE char *Locale; 70 69 WHERE char *MailcapPath; 71 70 WHERE char *Maildir; 72 71 #if defined(USE_IMAP) || defined(USE_POP)
+5 -7
hdrline.c
··· 383 383 } 384 384 *p = 0; 385 385 386 - if (do_locales && Locale) 387 - setlocale (LC_TIME, Locale); 388 - 389 386 if (op == '[' || op == 'D') 390 387 tm = localtime (&hdr->date_sent); 391 388 else if (op == '(') ··· 406 403 tm = gmtime (&T); 407 404 } 408 405 409 - strftime (buf2, sizeof (buf2), dest, tm); 410 - 411 - if (do_locales) 412 - setlocale (LC_TIME, "C"); 406 + if (!do_locales) 407 + setlocale (LC_TIME, "C"); 408 + strftime (buf2, sizeof (buf2), dest, tm); 409 + if (!do_locales) 410 + setlocale (LC_TIME, ""); 413 411 414 412 mutt_format_s (dest, destlen, prefix, buf2); 415 413 if (len > 0 && op != 'd' && op != 'D') /* Skip ending op */
-6
init.h
··· 1395 1395 ** from your spool mailbox to your $$mbox mailbox, or as a result of 1396 1396 ** a ``$mbox-hook'' command. 1397 1397 */ 1398 - { "locale", DT_STR, R_BOTH, UL &Locale, UL "C" }, 1399 - /* 1400 - ** .pp 1401 - ** The locale used by \fCstrftime(3)\fP to format dates. Legal values are 1402 - ** the strings your system accepts for the locale environment variable \fC$$$LC_TIME\fP. 1403 - */ 1404 1398 { "mail_check", DT_NUM, R_NONE, UL &BuffyTimeout, 5 }, 1405 1399 /* 1406 1400 ** .pp
+2 -3
main.c
··· 597 597 exit(1); 598 598 } 599 599 600 + setlocale (LC_ALL, ""); 601 + 600 602 #ifdef ENABLE_NLS 601 603 /* FIXME what about init.c:1439 ? */ 602 - setlocale (LC_ALL, ""); 603 604 bindtextdomain (PACKAGE, MUTTLOCALEDIR); 604 605 textdomain (PACKAGE); 605 606 #endif 606 - 607 - setlocale (LC_CTYPE, ""); 608 607 609 608 mutt_error = mutt_nocurses_error; 610 609 mutt_message = mutt_nocurses_error;
+5 -6
pgpkey.c
··· 195 195 } 196 196 *p = 0; 197 197 198 - if (do_locales && Locale) 199 - setlocale (LC_TIME, Locale); 200 198 201 199 tm = localtime (&key->gen_time); 202 200 203 - strftime (buf2, sizeof (buf2), dest, tm); 204 - 205 - if (do_locales) 206 - setlocale (LC_TIME, "C"); 201 + if (!do_locales) 202 + setlocale (LC_TIME, "C"); 203 + strftime (buf2, sizeof (buf2), dest, tm); 204 + if (!do_locales) 205 + setlocale (LC_TIME, ""); 207 206 208 207 snprintf (fmt, sizeof (fmt), "%%%ss", prefix); 209 208 snprintf (dest, destlen, fmt, buf2);