This commit is contained in:
Daniel Novotny 2009-03-12 09:54:36 +00:00
parent c005e5809e
commit c129385e96
2 changed files with 39 additions and 2 deletions

View File

@ -4,7 +4,7 @@ Summary: GNU Emacs text editor
Name: emacs Name: emacs
Epoch: 1 Epoch: 1
Version: 22.3 Version: 22.3
Release: 8%{?dist} Release: 9%{?dist}
License: GPLv3+ License: GPLv3+
URL: http://www.gnu.org/software/emacs/ URL: http://www.gnu.org/software/emacs/
Group: Applications/Editors Group: Applications/Editors
@ -27,6 +27,7 @@ Source21: igrep-init.el
Patch0: glibc-open-macro.patch Patch0: glibc-open-macro.patch
Patch1: rpm-spec-mode.patch Patch1: rpm-spec-mode.patch
Patch2: po-mode-auto-replace-date-71264.patch Patch2: po-mode-auto-replace-date-71264.patch
Patch3: rpm-spec-mode-utc.patch
Buildroot: %{_tmppath}/%{name}-%{version}-root Buildroot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: atk-devel, cairo-devel, freetype-devel, fontconfig-devel, giflib-devel, glibc-devel, gtk2-devel, libpng-devel BuildRequires: atk-devel, cairo-devel, freetype-devel, fontconfig-devel, giflib-devel, glibc-devel, gtk2-devel, libpng-devel
BuildRequires: libjpeg-devel, libtiff-devel, libX11-devel, libXau-devel, libXdmcp-devel, libXrender-devel, libXt-devel BuildRequires: libjpeg-devel, libtiff-devel, libX11-devel, libXau-devel, libXdmcp-devel, libXrender-devel, libXt-devel
@ -116,7 +117,10 @@ Emacs packages or see some elisp examples.
# rpm-spec-mode can use compilation-mode # rpm-spec-mode can use compilation-mode
patch < %PATCH1 patch < %PATCH1
# fix po-auto-replace-revision-date nil # fix po-auto-replace-revision-date nil
patch < %PATCH2 ) patch < %PATCH2
# rpm-spec-mode: added rpm-change-log-uses-utc variable
patch < %PATCH3
)
# we prefer our emacs.desktop file # we prefer our emacs.desktop file
cp %SOURCE1 etc/emacs.desktop cp %SOURCE1 etc/emacs.desktop
@ -357,6 +361,9 @@ alternatives --install %{_bindir}/etags emacs.etags %{_bindir}/etags.emacs 80 \
%dir %{_datadir}/emacs/%{version} %dir %{_datadir}/emacs/%{version}
%changelog %changelog
* Thu Mar 12 2009 Daniel Novotny <dnovotny@redhat.com> 1:22.3-9
- implement UTC change log option in rpm-spec-mode.el (#489829)
* Wed Mar 4 2009 Michel Salim <salimma@fedoraproject.org> - 1:22.3-8 * Wed Mar 4 2009 Michel Salim <salimma@fedoraproject.org> - 1:22.3-8
- Use desktop-file-utils to handle desktop file - Use desktop-file-utils to handle desktop file
- Update icon cache if GTK2 is installed - Update icon cache if GTK2 is installed

30
rpm-spec-mode-utc.patch Normal file
View File

@ -0,0 +1,30 @@
--- rpm-spec-mode.el.~1~
+++ rpm-spec-mode.el
@@ -708,6 +708,17 @@ with no args, if that value is non-nil."
;;------------------------------------------------------------
+(defvar rpm-change-log-uses-utc nil
+ "*If non-nil, \\[rpm-add-change-log-entry] will use Universal time (UTC).
+If this is nil, it uses local time as returned by `current-time'.
+
+This variable is global by default, but you can make it buffer-local.")
+
+(defsubst rpm-change-log-date-string ()
+ "Return the date string for today, inserted by \\[rpm-add-change-log-entry].
+If `rpm-change-log-uses-utc' is nil, \"today\" means the local time zone."
+ (format-time-string "%a %b %e %Y" nil rpm-change-log-uses-utc))
+
(defun rpm-add-change-log-entry (&optional change-log-entry)
"Find change log and add an entry for today."
(interactive "sChange log entry: ")
@@ -715,8 +726,7 @@ with no args, if that value is non-nil."
(rpm-goto-section "changelog")
(let* ((address (rpm-spec-user-mail-address))
(fullname (or rpm-spec-user-full-name (user-full-name)))
- (string (concat "* " (substring (current-time-string) 0 11)
- (substring (current-time-string) -4) " "
+ (string (concat "* " (rpm-change-log-date-string) " "
fullname " <" address ">"
(and rpm-spec-insert-changelog-version
(concat " - " (rpm-find-spec-version t))))))