diff options
author | psg <> | 2009-02-23 19:53:21 +0000 |
---|---|---|
committer | psg <> | 2009-02-23 19:53:21 +0000 |
commit | a322507ad5b4b19bb1457e73727740ea52c4d969 (patch) | |
tree | ff59e0ac7fc3aa1c3438333f1b9c1911b9596842 | |
parent | ec1b2bf31187b27d5e8bb9480faf7285e4e752ba (diff) |
debian-changelog-mode.el
Added patch from Jari Aalto to finalize date in UTC (User configurable)
(Closes: #503700)
-rw-r--r-- | debian-changelog-mode.el | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/debian-changelog-mode.el b/debian-changelog-mode.el index 5e3dc27..c067698 100644 --- a/debian-changelog-mode.el +++ b/debian-changelog-mode.el @@ -330,7 +330,8 @@ ;; V1.88 12Apr2008 Trent W. Buck <trentbuck@gmail.com> ;; - Generalize auto-mode-alist entry. ;; See http://bugs.debian.org/457047 - +;; V1.89 23Feb2009 Jari.aalto@cante.net +;; - finalize date in UTC (User configurable) (Closes: #503700) ;;; Acknowledgements: (These people have contributed) ;; Roland Rosenfeld <roland@debian.org> ;; James LewisMoss <dres@ioa.com> @@ -411,6 +412,12 @@ new version in debian/changelog." :group 'debian-changelog :type 'hook) +(defcustom debian-changelog-date-utc-flag nil + "If non-nil, return date string in UTC when finalizing entry. +See function `debian-changelog-date-string'." + :group 'debian-changelogx + :type 'boolean) + ;; This function is from emacs/lisp/calendar/icalendar.el, ;; necessary to replace "%s" with the bug number in ;; `debian-changelog-close-bug-statement' @@ -1163,10 +1170,21 @@ If file is empty, create initial entry." ;; (defun debian-changelog-date-string () - "Return RFC-822 format date string." + "Return RFC-822 format date string. +Use UTC if `debian-changelog-date-utc-flag' is non-nil." (let* ((dp "date") (cp (point)) - (ret (call-process "date" nil t nil "-R")) + (ret + (let ((process-environment process-environment) + (tz (dolist (item process-environment) + (when (and (stringp item) + (string-match "^TZ=" item)) + (return item))))) + (when debian-changelog-date-utc-flag + (setq process-environment + (delete tz process-environment)) + (push "TZ=UTC" process-environment)) + (call-process "date" nil t nil "-R"))) (np (point)) (out nil)) (cond ((not (or (eq ret nil) (eq ret 0))) |