From: Simon Josefsson <jas@extundo.com>
Cc: emacs-devel@gnu.org
Subject: Re: smtpmail.el fixes for windows
Date: Thu, 12 Sep 2002 08:04:12 +0200 [thread overview]
Message-ID: <iluvg5bn3qb.fsf@latte.josefsson.org> (raw)
In-Reply-To: <200209112002.g8BK2nj20489@wijiji.santafe.edu> (Richard Stallman's message of "Wed, 11 Sep 2002 14:02:49 -0600 (MDT)")
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"))
prev parent reply other threads:[~2002-09-12 6:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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=iluvg5bn3qb.fsf@latte.josefsson.org \
--to=jas@extundo.com \
--cc=emacs-devel@gnu.org \
/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.
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.