diff options
author | dancer <> | 2009-11-01 15:07:20 +0000 |
---|---|---|
committer | dancer <> | 2009-11-01 15:07:20 +0000 |
commit | 7338290e0850c3ef8a2521320e2cc8dbedcb87f3 (patch) | |
tree | 07389a513d1e5eb46b8538c4fdb5a5444d6b75b3 /readme-debian.el | |
parent | 3d2456809dfe1ab78055301c5effa08736d692ac (diff) |
readme-debian.el: support xemacs in adding date for README.Debian (closes: #364234)
Xemacs doesn't handle '%z', work around by forking 'date -R'.
Diffstat (limited to 'readme-debian.el')
-rw-r--r-- | readme-debian.el | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/readme-debian.el b/readme-debian.el index 20c49ea..f400028 100644 --- a/readme-debian.el +++ b/readme-debian.el @@ -41,6 +41,18 @@ (3 font-lock-string-face))) "Regexp keywords used to fontify README.Debian buffers.") +(defun readme-debian-date-string () + "Return RFC-822 format date string." + ;; this function could be simpler if xemacs supported %z, but + ;; it doesn't, so we're shelling out to invoke date -R to obtain + ;; Debian-policy-compliant date string. + (let* ((date-program "date -R") + (system-time-locale "C")) + (if (featurep 'xemacs) + (replace-in-string (exec-to-string date-program) "\n" "") + ;; if it's not xemacs, just use format-time-string + (format-time-string "%a, %e %b %Y %T %z" (current-time))))) + (defun readme-debian-update-timestamp () "Function to update timestamp in README.Debian files, automatically invoked when saving file." (save-excursion @@ -55,8 +67,7 @@ " -- " debian-changelog-full-name " <" debian-changelog-mailing-address ">, " - (let* ((system-time-locale "C")) - (format-time-string "%a, %e %b %Y %T %z" (current-time))))) + (readme-debian-date-string))) (if (and (= (point)(point-max)) (not (bolp))) (insert "\n")))) |