all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* smtpmail.el fixes for windows
@ 2002-09-11  5:23 Simon Josefsson
  2002-09-11 20:02 ` Richard Stallman
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Josefsson @ 2002-09-11  5:23 UTC (permalink / raw)


Is it OK to install this?

2002-09-11  Simon Josefsson  <jas@extundo.com>

	* mail/smtpmail.el (smtpmail-send-it): Don't use : in filenames
	(for cygwin). Convert number to string.  Suggested by Andrew
	Senior <aws@watson.ibm.com>.

	* time-stamp.el (time-stamp-hhmmss): New function.

--- smtpmail.el.~1.47.~	2002-09-11 06:50:53.000000000 +0200
+++ smtpmail.el	2002-09-11 07:20:56.000000000 +0200
@@ -346,10 +346,11 @@
 	    (let* ((file-data (concat
 			       smtpmail-queue-dir
 			       (concat (time-stamp-yyyy-mm-dd)
-				       "_" (time-stamp-hh:mm:ss)
+				       "_" (time-stamp-hhmmss)
 				       "_"
+				       (number-to-string
 				       (setq smtpmail-queue-counter
-					     (1+ smtpmail-queue-counter)))))
+					      (1+ smtpmail-queue-counter))))))
 		      (file-elisp (concat file-data ".el"))
 		   (buffer-data (create-file-buffer file-data))
 		   (buffer-elisp (create-file-buffer file-elisp))
--- time-stamp.el.~1.51.~	2002-05-19 01:50:11.000000000 +0200
+++ time-stamp.el	2002-09-11 07:16:35.000000000 +0200
@@ -731,6 +731,10 @@
   "Return the current time as a string in \"HH:MM:SS\" form."
   (format-time-string "%T"))
 
+(defun time-stamp-hhmmss ()
+  "Return the current time as a string in \"HHMMSS\" form."
+  (format-time-string "%H%M%S"))
+
 (defun time-stamp-hhmm ()
   "Return the current time as a string in \"HHMM\" form."
   (format-time-string "%H%M"))

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

* Re: smtpmail.el fixes for windows
  2002-09-11  5:23 smtpmail.el fixes for windows Simon Josefsson
@ 2002-09-11 20:02 ` Richard Stallman
  2002-09-12  6:04   ` Simon Josefsson
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Stallman @ 2002-09-11 20:02 UTC (permalink / raw)
  Cc: emacs-devel

It seems ok to me.  However, I think it would be better
to call format-time-string directly, just once for the date
and the time.

That way you can avoid the need to load the time-stamp library,
and make the code a little smaller rather than a little bigger.

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

* Re: smtpmail.el fixes for windows
  2002-09-11 20:02 ` Richard Stallman
@ 2002-09-12  6:04   ` Simon Josefsson
  0 siblings, 0 replies; 3+ messages in thread
From: Simon Josefsson @ 2002-09-12  6:04 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

> It seems ok to me.  However, I think it would be better
> to call format-time-string directly, just once for the date
> and the time.
>
> That way you can avoid the need to load the time-stamp library,
> and make the code a little smaller rather than a little bigger.

Yes, requiring time-stamp for this seems bloated. (The new time-stamp
function seems useful in itself, so I'm installing it as well.)
Revised patch below, which calls `convert-standard-filename', and uses
`expand-file-name' instead of concat (this is preferred, right?).  I
have installed this.

2002-09-12  Simon Josefsson  <jas@extundo.com>

	* mail/smtpmail.el (smtpmail-send-it): Don't use : in filenames
	(for cygwin). Suggested by Andrew Senior <aws@watson.ibm.com>.
	Use expand-file-name.  Also don't require time-stamp.

2002-09-11  Simon Josefsson  <jas@extundo.com>

	* time-stamp.el (time-stamp-hhmmss): New function.

Index: smtpmail.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/mail/smtpmail.el,v
retrieving revision 1.47
diff -u -p -u -r1.47 smtpmail.el
--- smtpmail.el 11 Sep 2002 04:53:15 -0000      1.47
+++ smtpmail.el 12 Sep 2002 06:00:39 -0000
@@ -66,7 +66,6 @@
 ;;; Code:

 (require 'sendmail)
-(require 'time-stamp)
 (autoload 'starttls-open-stream "starttls")
 (autoload 'starttls-negotiate "starttls")
 (autoload 'mail-strip-quoted-names "mail-utils")
@@ -343,14 +342,15 @@ This is relative to `smtpmail-queue-dir'
                            smtpmail-recipient-address-list tembuf))
                      (error "Sending failed; SMTP protocol error"))
                (error "Sending failed; no recipients"))
-           (let* ((file-data (concat
-                              smtpmail-queue-dir
-                              (concat (time-stamp-yyyy-mm-dd)
-                                      "_" (time-stamp-hh:mm:ss)
-                                      "_"
-                                      (setq smtpmail-queue-counter
-                                            (1+ smtpmail-queue-counter)))))
-                     (file-elisp (concat file-data ".el"))
+           (let* ((file-data
+                   (expand-file-name
+                    (format "%s_%i"
+                            (format-time-string "%Y-%m-%d_%H:%M:%S")
+                            (setq smtpmail-queue-counter
+                                  (1+ smtpmail-queue-counter)))
+                    smtpmail-queue-dir))
+                  (file-data (convert-standard-filename file-data))
+                  (file-elisp (concat file-data ".el"))
                   (buffer-data (create-file-buffer file-data))
                   (buffer-elisp (create-file-buffer file-elisp))
                   (buffer-scratch "*queue-mail*"))
Index: time-stamp.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/time-stamp.el,v
retrieving revision 1.51
diff -u -p -u -r1.51 time-stamp.el
--- time-stamp.el       18 May 2002 11:26:16 -0000      1.51
+++ time-stamp.el       12 Sep 2002 06:01:55 -0000
@@ -731,6 +731,10 @@ The first character of DD is space if th
   "Return the current time as a string in \"HH:MM:SS\" form."
   (format-time-string "%T"))

+(defun time-stamp-hhmmss ()
+  "Return the current time as a string in \"HHMMSS\" form."
+  (format-time-string "%H%M%S"))
+
 (defun time-stamp-hhmm ()
   "Return the current time as a string in \"HHMM\" form."
   (format-time-string "%H%M"))

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

end of thread, other threads:[~2002-09-12  6:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-11  5:23 smtpmail.el fixes for windows Simon Josefsson
2002-09-11 20:02 ` Richard Stallman
2002-09-12  6:04   ` Simon Josefsson

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.