Gnus development mailing list
 help / color / mirror / Atom feed
From: Robert Bihlmeyer <e9426626@stud2.tuwien.ac.at>
Subject: Re: pgnus and message-make-date
Date: 19 Oct 1998 17:53:15 +0200	[thread overview]
Message-ID: <lf90icmtuc.fsf@mars.zserv.tuwien.ac.at> (raw)
In-Reply-To: Lars Magne Ingebrigtsen's message of "17 Oct 1998 21:39:19 +0200"

>>>>> On 17 Oct 1998 21:39:19 +0200
>>>>> Lars Magne Ingebrigtsen <larsi@gnus.org> said:

 Lars> Robert Bihlmeyer <e9426626@stud2.tuwien.ac.at> writes: Or do
 Lars> things respond to the LC_LANG (etc.) environment variables?
 >>
 >> The LC_* environment variables are used when calling setlocal().
 >> This is normally only done at the start of a program.

 Lars> Surely I can't be the only one who needs to dislocalize the
 Lars> environment momentarily to do something, like, standardized.

This is code from the GNU libc manual, that temporarily changes the locale:

     #include <stddef.h>
     #include <locale.h>
     #include <stdlib.h>
     #include <string.h>
     
     void
     with_other_locale (char *new_locale,
                        void (*subroutine) (int),
                        int argument)
     {
       char *old_locale, *saved_locale;
     
       /* Get the name of the current locale.  */
       old_locale = setlocale (LC_ALL, NULL);
     
       /* Copy the name so it won't be clobbered by `setlocale'. */
       saved_locale = strdup (old_locale);
       if (old_locale == NULL)
         fatal ("Out of memory");
     
       /* Now change the locale and do some stuff with it. */
       setlocale (LC_ALL, new_locale);
       (*subroutine) (argument);
     
       /* Restore the original locale. */
       setlocale (LC_ALL, saved_locale);
       free (saved_locale);
     }

If someone would translate this into a proper emacs primitive, you
could do:

(with-locale "C"
  ; do date formatting
  )

Someone with his hands deep in emacs guts wants to do this? Hrvoje?
Steve?

	Robbe

-- 
Robert Bihlmeyer	reads: Deutsch, English, MIME, Latin-1, NO SPAM!
<robbe@orcus.priv.at>	<http://stud2.tuwien.ac.at/~e9426626/sig.html>


  reply	other threads:[~1998-10-19 15:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-06 16:00 Robert Mihram
1998-10-07  9:18 ` Robert Bihlmeyer
1998-10-10 22:20 ` Lars Magne Ingebrigtsen
1998-10-11 12:34   ` Robert Mihram
1998-10-11 15:44     ` Lars Magne Ingebrigtsen
1998-10-11 18:13       ` Kai.Grossjohann
1998-10-11 22:52         ` Lars Magne Ingebrigtsen
1998-10-12 13:51           ` Kai Grossjohann
1998-10-12 14:08             ` Lars Magne Ingebrigtsen
1998-10-12 14:57               ` Kai Grossjohann
1998-10-13  4:06           ` Stephen Zander
1998-10-13  8:12             ` Kai Grossjohann
1998-10-13  9:29           ` Robert Bihlmeyer
1998-10-17 19:39             ` Lars Magne Ingebrigtsen
1998-10-19 15:53               ` Robert Bihlmeyer [this message]
1998-10-19 18:13                 ` Paul Franklin
1998-10-19 18:25                   ` Ulrich Drepper
1998-10-19 19:27                 ` Lars Magne Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=lf90icmtuc.fsf@mars.zserv.tuwien.ac.at \
    --to=e9426626@stud2.tuwien.ac.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).