Gnus development mailing list
 help / color / mirror / Atom feed
* pgnus and message-make-date
@ 1998-10-06 16:00 Robert Mihram
  1998-10-07  9:18 ` Robert Bihlmeyer
  1998-10-10 22:20 ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 18+ messages in thread
From: Robert Mihram @ 1998-10-06 16:00 UTC (permalink / raw)


I've just tried pgnus (v0.33), but wasn't able to post anymore (my ISP's 
server told me: 441 Can't parse "Date" header). The problem is, that 
message-make-date generates a locale's based month name.

Example: "06 Oct 1998 17:52:25 +0200" (semi-gnus) 
	 "06 Okt 1998 17:52:55 +0200" (pgnus)

It's a bug, isn't it ?

Regards,
Rob
-- 
"Yeah, yeah, yeah, yeah" - 22 Pistepirkko


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: pgnus and message-make-date
  1998-10-06 16:00 pgnus and message-make-date Robert Mihram
@ 1998-10-07  9:18 ` Robert Bihlmeyer
  1998-10-10 22:20 ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 18+ messages in thread
From: Robert Bihlmeyer @ 1998-10-07  9:18 UTC (permalink / raw)


Hi,

>>>>> On 06 Oct 1998 18:00:25 +0200
>>>>> "Robert Mihram" <rob.dm@berlin.snafu.de> said:

 Robert> Example: "06 Oct 1998 17:52:25 +0200" (semi-gnus)
 Robert> 	 "06 Okt 1998 17:52:55 +0200" (pgnus)

 Robert> It's a bug, isn't it ?

Yep, this is not 1036-conformant. I hate to say this, but this bug
looks almost ... microsoftish. When is service pack 34 due?

	Robbe

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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: pgnus and message-make-date
  1998-10-06 16:00 pgnus and message-make-date Robert Mihram
  1998-10-07  9:18 ` Robert Bihlmeyer
@ 1998-10-10 22:20 ` Lars Magne Ingebrigtsen
  1998-10-11 12:34   ` Robert Mihram
  1 sibling, 1 reply; 18+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-10-10 22:20 UTC (permalink / raw)


"Robert Mihram" <rob.dm@berlin.snafu.de> writes:

> I've just tried pgnus (v0.33), but wasn't able to post anymore (my ISP's 
> server told me: 441 Can't parse "Date" header). The problem is, that 
> message-make-date generates a locale's based month name.
> 
> Example: "06 Oct 1998 17:52:25 +0200" (semi-gnus) 
> 	 "06 Okt 1998 17:52:55 +0200" (pgnus)

Ick.  Is there some way of telling `format-time-string' that we don't
want to use any locale?  Or the "us" locale, or something?

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: pgnus and message-make-date
  1998-10-10 22:20 ` Lars Magne Ingebrigtsen
@ 1998-10-11 12:34   ` Robert Mihram
  1998-10-11 15:44     ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 18+ messages in thread
From: Robert Mihram @ 1998-10-11 12:34 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> "Robert Mihram" <rob.dm@berlin.snafu.de> writes:
> 
> > I've just tried pgnus (v0.33), but wasn't able to post anymore (my ISP's 
> > server told me: 441 Can't parse "Date" header). The problem is, that 
> > message-make-date generates a locale's based month name.
> > 
> > Example: "06 Oct 1998 17:52:25 +0200" (semi-gnus) 
> > 	 "06 Okt 1998 17:52:55 +0200" (pgnus)
> 
> Ick.  Is there some way of telling `format-time-string' that we don't
> want to use any locale?  Or the "us" locale, or something?

I don't think so, but we could use timezone-make-date-arpa-standard:            
                                                                                
timezone-make-date-arpa-standard is a compiled Lisp function in `timezone'.     
(timezone-make-date-arpa-standard DATE &optional LOCAL TIMEZONE)                
                                                                                
Convert DATE to an arpanet standard date.                                       
Optional 1st argument LOCAL specifies the default local timezone of the DATE;   
if nil, GMT is assumed.                                                         
Optional 2nd argument TIMEZONE specifies a time zone to be represented in;      
if nil, the local time zone is assumed.                                         
                                                                                
This is semi-gnus message-make-date:                                            
                                                                                
(defun message-make-date ()                                                     
  "Make a valid data header."                                                   
  (let ((now (current-time)))                                                   
    (timezone-make-date-arpa-standard                                           
     (current-time-string now) (current-time-zone now))))

Regards,                                                                        
Rob
-- 
"Yeah, yeah, yeah, yeah" - 22 Pistepirkko


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: pgnus and message-make-date
  1998-10-11 12:34   ` Robert Mihram
@ 1998-10-11 15:44     ` Lars Magne Ingebrigtsen
  1998-10-11 18:13       ` Kai.Grossjohann
  0 siblings, 1 reply; 18+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-10-11 15:44 UTC (permalink / raw)


"Robert Mihram" <rob.dm@berlin.snafu.de> writes:

> > Ick.  Is there some way of telling `format-time-string' that we don't
> > want to use any locale?  Or the "us" locale, or something?
> 
> I don't think so, but we could use timezone-make-date-arpa-standard:            
I'd rather not use timezone, so I've fiddled with message-make-date
some to use parse-time and its thingies.

I think it's rather disgusting that the locales get in the way of
using functions sensibly.  `format-time-string' is such a nice
function, but if it keeps growing in this annoying manner, it's going
to get rather useless after a while.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: pgnus and message-make-date
  1998-10-11 15:44     ` Lars Magne Ingebrigtsen
@ 1998-10-11 18:13       ` Kai.Grossjohann
  1998-10-11 22:52         ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 18+ messages in thread
From: Kai.Grossjohann @ 1998-10-11 18:13 UTC (permalink / raw)


>>>>> Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

  > I think it's rather disgusting that the locales get in the way of
  > using functions sensibly.  `format-time-string' is such a nice
  > function, but if it keeps growing in this annoying manner, it's
  > going to get rather useless after a while.

If only one knew how to set the locale from Lisp, then

  (let ((locale "C"))
    (format-time-string "..."))

would do something useful...  Oh, well.

kai
-- 
OOP: object oriented programming;  OOPS: object oriented mistakes


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: pgnus and message-make-date
  1998-10-11 18:13       ` Kai.Grossjohann
@ 1998-10-11 22:52         ` Lars Magne Ingebrigtsen
  1998-10-12 13:51           ` Kai Grossjohann
                             ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-10-11 22:52 UTC (permalink / raw)


Kai.Grossjohann@CS.Uni-Dortmund.DE writes:

> If only one knew how to set the locale from Lisp, then
> 
>   (let ((locale "C"))
>     (format-time-string "..."))
> 
> would do something useful...  Oh, well.

This would be useful.

Or do things respond to the LC_LANG (etc.) environment variables?
Then we could just `setenv' a bit...

(format-time-string "%b" (current-time))
=> "Oct"

even with LC_ALL or LANG set to "de".  Am I doing something wrong?

And try

(setenv "LANG" "C")

or whatever before evaling the format-time-string...

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: pgnus and message-make-date
  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-13  4:06           ` Stephen Zander
  1998-10-13  9:29           ` Robert Bihlmeyer
  2 siblings, 1 reply; 18+ messages in thread
From: Kai Grossjohann @ 1998-10-12 13:51 UTC (permalink / raw)


Sadly, I don't grok the code for emacs_strftime and modifying
process-environment does not seem to change the behavior of
format-time-string.

Of course, one solution is to use the individual format escapes for
format-time-string which make up an ARPA date.
kai
-- 
I wonder why nobody don't like me,
or is it de fact dat I'm ugly? -- Harry Belafonte


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: pgnus and message-make-date
  1998-10-12 13:51           ` Kai Grossjohann
@ 1998-10-12 14:08             ` Lars Magne Ingebrigtsen
  1998-10-12 14:57               ` Kai Grossjohann
  0 siblings, 1 reply; 18+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-10-12 14:08 UTC (permalink / raw)


Kai Grossjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> writes:

> Of course, one solution is to use the individual format escapes for
> format-time-string which make up an ARPA date.

Sorry; I don't quite follow.  Which format escapes are those?  (I'm
not really familiar with strftime.)

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: pgnus and message-make-date
  1998-10-12 14:08             ` Lars Magne Ingebrigtsen
@ 1998-10-12 14:57               ` Kai Grossjohann
  0 siblings, 0 replies; 18+ messages in thread
From: Kai Grossjohann @ 1998-10-12 14:57 UTC (permalink / raw)


>>>>> Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

  > Sorry; I don't quite follow.  Which format escapes are those?
  > (I'm not really familiar with strftime.)

My mistake.  You're already using the %Y, %H and so on.  Only %b might
expand to the wrong month name...

Sorry.
kai
-- 
I wonder why nobody don't like me,
or is it de fact dat I'm ugly? -- Harry Belafonte


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: pgnus and message-make-date
  1998-10-11 22:52         ` Lars Magne Ingebrigtsen
  1998-10-12 13:51           ` Kai Grossjohann
@ 1998-10-13  4:06           ` Stephen Zander
  1998-10-13  8:12             ` Kai Grossjohann
  1998-10-13  9:29           ` Robert Bihlmeyer
  2 siblings, 1 reply; 18+ messages in thread
From: Stephen Zander @ 1998-10-13  4:06 UTC (permalink / raw)


>>>>> "Lars" == Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
    Lars> Or do things respond to the LC_LANG (etc.) environment
    Lars> variables?  Then we could just `setenv' a bit...

    Lars> (format-time-string "%b" (current-time)) => "Oct"

    Lars> even with LC_ALL or LANG set to "de".  Am I doing something
    Lars> wrong?

Try LC_TIME.

-- 
Stephen
---
Perl is really designed more for the guys that will hack Perl at least
20 minutes a day for the rest of their career.  TCL/Python is more a
"20 minutes a week", and VB is probably in that "20 minutes a month"
group. :) -- Randal Schwartz


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: pgnus and message-make-date
  1998-10-13  4:06           ` Stephen Zander
@ 1998-10-13  8:12             ` Kai Grossjohann
  0 siblings, 0 replies; 18+ messages in thread
From: Kai Grossjohann @ 1998-10-13  8:12 UTC (permalink / raw)
  Cc: ding

>>>>> Stephen Zander <gibreel@pobox.com> writes:

  > Try LC_TIME.

Doesn't work:

,-----
| (let ((process-environment (cons "LC_TIME=de" process-environment)))
|   (format-time-string "%c")) 
| ==> "Tue Oct 13 10:11:27 1998"
`-----

Too bad, this.
kai
-- 
I wonder why nobody don't like me,
or is it de fact dat I'm ugly? -- Harry Belafonte


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: pgnus and message-make-date
  1998-10-11 22:52         ` Lars Magne Ingebrigtsen
  1998-10-12 13:51           ` Kai Grossjohann
  1998-10-13  4:06           ` Stephen Zander
@ 1998-10-13  9:29           ` Robert Bihlmeyer
  1998-10-17 19:39             ` Lars Magne Ingebrigtsen
  2 siblings, 1 reply; 18+ messages in thread
From: Robert Bihlmeyer @ 1998-10-13  9:29 UTC (permalink / raw)


Hi,

>>>>> On 12 Oct 1998 00:52:17 +0200
>>>>> Lars Magne Ingebrigtsen <larsi@gnus.org> said:

 Lars> Or do things respond to the LC_LANG (etc.) environment
 Lars> variables?

The LC_* environment variables are used when calling setlocal(). This
is normally only done at the start of a program. (It *is* a bit crazy
to change environment variables from inside program, and then use this 
variables to change program settings.)

	Robbe

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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: pgnus and message-make-date
  1998-10-13  9:29           ` Robert Bihlmeyer
@ 1998-10-17 19:39             ` Lars Magne Ingebrigtsen
  1998-10-19 15:53               ` Robert Bihlmeyer
  0 siblings, 1 reply; 18+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-10-17 19:39 UTC (permalink / raw)


Robert Bihlmeyer <e9426626@stud2.tuwien.ac.at> writes:

>  Lars> Or do things respond to the LC_LANG (etc.) environment
>  Lars> variables?
> 
> The LC_* environment variables are used when calling setlocal(). This
> is normally only done at the start of a program.

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

Is there no interface for doing this?  If not, that's, uhm, er, not
good. 

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: pgnus and message-make-date
  1998-10-17 19:39             ` Lars Magne Ingebrigtsen
@ 1998-10-19 15:53               ` Robert Bihlmeyer
  1998-10-19 18:13                 ` Paul Franklin
  1998-10-19 19:27                 ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 18+ messages in thread
From: Robert Bihlmeyer @ 1998-10-19 15:53 UTC (permalink / raw)


>>>>> 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>


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: pgnus and message-make-date
  1998-10-19 15:53               ` Robert Bihlmeyer
@ 1998-10-19 18:13                 ` Paul Franklin
  1998-10-19 18:25                   ` Ulrich Drepper
  1998-10-19 19:27                 ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 18+ messages in thread
From: Paul Franklin @ 1998-10-19 18:13 UTC (permalink / raw)
  Cc: bug-glibc

>>>>> Robert Bihlmeyer writes:

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

[From (libc)Setting the Locale]

 >        /* Copy the name so it won't be clobbered by `setlocale'. */
 >        saved_locale = strdup (old_locale);
 >        if (old_locale == NULL)
 >          fatal ("Out of memory");

It seems to me that that check should be
	if (saved_locale == NULL)

--Paul


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: pgnus and message-make-date
  1998-10-19 18:13                 ` Paul Franklin
@ 1998-10-19 18:25                   ` Ulrich Drepper
  0 siblings, 0 replies; 18+ messages in thread
From: Ulrich Drepper @ 1998-10-19 18:25 UTC (permalink / raw)
  Cc: ding, bug-glibc

Paul Franklin <paul@cs.washington.edu> writes:

> It seems to me that that check should be
> 	if (saved_locale == NULL)

Right.  It's fixed.  Thanks,

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: pgnus and message-make-date
  1998-10-19 15:53               ` Robert Bihlmeyer
  1998-10-19 18:13                 ` Paul Franklin
@ 1998-10-19 19:27                 ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 18+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-10-19 19:27 UTC (permalink / raw)


Robert Bihlmeyer <e9426626@stud2.tuwien.ac.at> writes:

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

I can do it.  I've written a note to RMS, Steve and Hrvoje asking for
comments. 

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~1998-10-19 19:27 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-10-06 16:00 pgnus and message-make-date 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
1998-10-19 18:13                 ` Paul Franklin
1998-10-19 18:25                   ` Ulrich Drepper
1998-10-19 19:27                 ` Lars Magne Ingebrigtsen

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).