+2001-10-12 TSUCHIYA Masatoshi <tsuchiya@pine.kuee.kyoto-u.ac.jp>
+
+ * poe.el (format-time-string): Support the construct `%z'.
+ (support-timezone-in-numeric-form): New advice.
+
2001-09-09 Daiki Ueno <ueno@unixuser.org>
* pccl.el (transform-make-coding-system-args): Follow old backquote
((eq cur-char ?Z)
(setq change-case (not change-case))
(downcase (cadr (current-time-zone))))
+ ((eq cur-char ?z)
+ (let ((tz (car (current-time-zone))))
+ (if (< tz 0)
+ (format "-%02d%02d" (/ (- tz) 3600) (/ (% (- tz) 3600) 60))
+ (format "+%02d%02d" (/ tz 3600) (/ (% tz 3600) 60)))))
(t
(concat
"%"
(setq current-load-list (cons 'format-time-string current-load-list))
(put 'format-time-string 'defun-maybe t))))
+;; Emacs 19.29-19.34/XEmacs: format-time-string() doesn't support `%z'.
+(unless (string-match "\\`[\\-\\+][0-9]+\\'"
+ (format-time-string "%z" (current-time)))
+ (defadvice format-time-string
+ (before support-timezone-in-numeric-form activate compile)
+ "Advice to support the construct `%z'."
+ (if (let ((case-fold-search nil))
+ (string-match "\\(\\(\\`\\|[^%]\\)\\(%%\\)*\\)%z" (ad-get-arg 0)))
+ (ad-set-arg
+ 0
+ (concat
+ (substring (ad-get-arg 0) 0 (match-end 1))
+ (let ((tz (car (current-time-zone))))
+ (if (< tz 0)
+ (format "-%02d%02d" (/ (- tz) 3600) (/ (% (- tz) 3600) 60))
+ (format "+%02d%02d" (/ tz 3600) (/ (% tz 3600) 60))))
+ (substring (ad-get-arg 0) (match-end 0)))))))
+
;; Emacs 20.1/XEmacs 20.3(?) and later: (split-string STRING &optional PATTERN)
;; Here is a XEmacs version.
(defun-maybe split-string (string &optional pattern)