Compare commits

...

22 Commits
rawhide ... f18

Author SHA1 Message Date
Michael Schwendt cbee6d134d Really fix #970924 2013-07-14 23:26:48 +02:00
Petr Hracek 7b037a67a7 rpm-goto-add-change-log-entry is not working (#970924) 2013-06-11 13:04:44 +02:00
Petr Hracek 222fd19083 rpm-goto-add-change-log-entry is not working (#970924) 2013-06-11 10:23:08 +02:00
Petr Hracek ac5768b2c2 emacs rpm spec mode is no more provided (#951101) 2013-04-12 14:22:39 +02:00
Petr Hracek c458421ef5 Spell checking broken by non-default dictionary (#827033) 2013-04-08 13:38:12 +02:00
Petr Hracek 3f9bd64274 Fix #929353: adding patch emacs-gtk-warning.patch 2013-04-04 12:35:07 +02:00
Petr Hracek aaed453653 Fix:#929353 emacs gives gtk-WARNING 2013-04-04 12:35:07 +02:00
Petr Hracek cc8064d65c bell does not work (#526719), style_changed_cb (#922519) 2013-03-29 15:21:23 +01:00
Petr Hracek 32580573e9 bell does not work (#526719) 2013-03-28 15:14:12 +01:00
Petr Hracek 1dde37e57e Fix for emacs bug 112144, style_changed_cb (#922519) 2013-03-28 14:22:17 +01:00
Petr Hracek a9f326d8df deleting return code 2013-03-28 10:22:22 +01:00
Petr Hracek f32435b905 remove debugging info 2013-03-27 08:39:43 +01:00
Petr Hracek d61c164ebe fixing build on RHEL-7.0 2013-03-26 17:38:31 +01:00
Petr Hracek 1684d20792 fixing distribution flags to rhel instead of el6:1 2013-03-26 16:56:40 +01:00
Petr Hracek 6bc6c875b3 fixing distribution flags to rhel instead of el6:1 2013-03-26 14:42:13 +01:00
Petr Hracek 8885fc80b9 Wrongly used flags 2013-03-18 16:44:45 +01:00
Petr Hracek 32e51e58c6 solved problem with distribution flag 2013-03-18 15:34:39 +01:00
Petr Hracek c6b688e7af solved detection of rhel distribution flag 2013-03-18 15:30:18 +01:00
Jochen Schmitt 46aabb9ddb Fix for emacs bug #13460, ispell-change dictionary hunspell issue (#903151) 2013-02-02 12:58:31 +01:00
Karel Klic fccdf0aac0 Fix version in changelog 2012-11-18 02:38:20 +01:00
Karel Klic 1ebe78c128 Fix for Emacs bug #11580 2012-11-16 17:32:11 +01:00
Karel Klic f394cbaae4 Change xorg-x11-fonts-misc dependency to dejavu-sans-mono-fonts, rhbz#732422 2012-10-22 13:47:08 +02:00
11 changed files with 1803 additions and 11 deletions

View File

@ -0,0 +1,13 @@
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 2740d9c..e56e576 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1171,7 +1171,7 @@ aspell is used along with Emacs).")
;; Unless default dict, re-add "-d" option with the mapped value
(if dict-name
(if dict-equiv
- (nconc ispell-args (list "-d" dict-equiv))
+ (setq ispell-args (nconc ispell-args (list "-d" dict-equiv)))
(message
"ispell-set-spellchecker-params: Missing hunspell equiv for \"%s\". Skipping."
dict-name)

View File

@ -0,0 +1,39 @@
diff --git a/configure.in b/configure.in
index 2b0b2f7..68459bc 100644
--- a/configure.in
+++ b/configure.in
@@ -1843,6 +1843,7 @@ if test "${HAVE_X11}" = "yes"; then
AC_MSG_RESULT($emacs_xkb)
if test $emacs_xkb = yes; then
AC_DEFINE(HAVE_XKBGETKEYBOARD, 1, [Define to 1 if you have the XkbGetKeyboard function.])
+ AC_DEFINE(HAVE_XKB, 1, [Define to 1 if you have the Xkb extension.])
fi
AC_CHECK_FUNCS(XrmSetDatabase XScreenResourceString \
diff --git a/src/xterm.c b/src/xterm.c
index 9ce1668..67ad919 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -139,6 +139,10 @@ extern void _XEditResCheckMessages (Widget, XtPointer, XEvent *, Boolean *);
#endif
#endif
+#ifdef HAVE_XKB
+#include <X11/XKBlib.h>
+#endif
+
/* Default to using XIM if available. */
#ifdef USE_XIM
int use_xim = 1;
@@ -3238,7 +3242,11 @@ XTring_bell (struct frame *f)
#endif
{
BLOCK_INPUT;
+#ifdef HAVE_XKB
+ XkbBell (FRAME_X_DISPLAY (f), None, 0, None);
+#else
XBell (FRAME_X_DISPLAY (f), 0);
+#endif
XFlush (FRAME_X_DISPLAY (f));
UNBLOCK_INPUT;
}

43
emacs-gtk-warning.patch Normal file
View File

@ -0,0 +1,43 @@
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 44f828c..d434a48 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -784,6 +784,14 @@ xg_hide_tooltip (FRAME_PTR f)
General functions for creating widgets, resizing, events, e.t.c.
***********************************************************************/
+static void
+my_log_handler (const gchar *log_domain, GLogLevelFlags log_level,
+ const gchar *msg, gpointer user_data)
+{
+ if (!strstr (msg, "visible children"))
+ fprintf (stderr, "XX %s-WARNING **: %s\n", log_domain, msg);
+}
+
/* Make a geometry string and pass that to GTK. It seems this is the
only way to get geometry position right if the user explicitly
asked for a position when starting Emacs.
@@ -799,6 +807,7 @@ xg_set_geometry (FRAME_PTR f)
int top = f->top_pos;
int yneg = f->size_hint_flags & YNegative;
char geom_str[sizeof "=x--" + 4 * INT_STRLEN_BOUND (int)];
+ guint id;
if (xneg)
left = -left;
@@ -811,9 +820,15 @@ xg_set_geometry (FRAME_PTR f)
(xneg ? '-' : '+'), left,
(yneg ? '-' : '+'), top);
+ /* Silence warning about visible children. */
+ id = g_log_set_handler ("Gtk", G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL
+ | G_LOG_FLAG_RECURSION, my_log_handler, NULL);
+
if (!gtk_window_parse_geometry (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
geom_str))
fprintf (stderr, "Failed to parse: '%s'\n", geom_str);
+
+ g_log_remove_handler ("Gtk", id);
}
}

View File

@ -0,0 +1,15 @@
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 4dbef65..44f828c 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -1050,7 +1050,9 @@ style_changed_cb (GObject *go,
FOR_EACH_FRAME (rest, frame)
{
FRAME_PTR f = XFRAME (frame);
- if (FRAME_X_DISPLAY (f) == dpy)
+ if (FRAME_LIVE_P (f)
+ && FRAME_X_P (f)
+ && FRAME_X_DISPLAY (f) == dpy)
{
x_set_scroll_bar_default_width (f);
xg_frame_set_char_size (f, FRAME_COLS (f), FRAME_LINES (f));

View File

@ -3,7 +3,7 @@ Summary: GNU Emacs text editor
Name: emacs
Epoch: 1
Version: 24.2
Release: 11%{?dist}
Release: 20%{?dist}
License: GPLv3+
URL: http://www.gnu.org/software/emacs/
Group: Applications/Editors
@ -16,14 +16,29 @@ Source5: default.el
# Emacs Terminal Mode, #551949, #617355
Source6: emacs-terminal.desktop
Source7: emacs-terminal.sh
# rpm-spec-mode for XEmacs
Source10: https://bitbucket.org/xemacs/prog-modes/raw/eacc4cb30d0c/rpm-spec-mode.el
Source11: rpm-spec-mode-init.el
Patch1: rpm-spec-mode.patch
Patch2: rpm-spec-mode-utc.patch
Patch3: rpm-spec-mode-changelog.patch
Patch4: rpm-spec-mode-changelog2.patch
# rhbz#713600
Patch7: emacs-spellchecker.patch
# rhbz#830162, fixed in org-mode upstream
Patch8: emacs-locate-library.patch
# Fix for Emacs bug #111500.
Patch9: emacs-bz11580-eudc-bbdb.patch
# Fix for emacs bug #922519
Patch10: emacs-style-change-cb.patch
# Fix for emacs bug #922519
Patch11: emacs-bell-dont-work.patch
# Fix for emacs bug #929353
Patch12: emacs-gtk-warning.patch
# Fix for emacs bug #13460.
Patch100: emacs-24.2-hunspell.patch
# Fix for emacs bug #827033.
Patch101: emacs-24.2-hunspell.2.patch
BuildRequires: atk-devel cairo-devel freetype-devel fontconfig-devel dbus-devel giflib-devel glibc-devel libpng-devel
BuildRequires: libjpeg-devel libtiff-devel libX11-devel libXau-devel libXdmcp-devel libXrender-devel libXt-devel
@ -31,13 +46,17 @@ BuildRequires: libXpm-devel ncurses-devel xorg-x11-proto-devel zlib-devel gnutls
BuildRequires: librsvg2-devel m17n-lib-devel libotf-devel ImageMagick-devel libselinux-devel
BuildRequires: GConf2-devel alsa-lib-devel gpm-devel liblockfile-devel libxml2-devel
BuildRequires: bzip2 cairo texinfo gzip desktop-file-utils
%if 0%{?el6}
%if 0%{?rhel} == 6
BuildRequires: gtk2-devel
%else
%if 0%{?rhel} == 7
BuildRequires: gtk3-devel python2-devel
# Buildrequire both python2 and python3 on systems containing both,
# since below we turn off the brp-python-bytecompile script
%else
BuildRequires: gtk3-devel python2-devel python3-devel
%endif
%endif
%ifarch %{ix86}
BuildRequires: util-linux
%endif
@ -49,7 +68,7 @@ Requires(posttrans): %{_sbindir}/alternatives
Requires: emacs-common = %{epoch}:%{version}-%{release}
Provides: emacs(bin) = %{epoch}:%{version}-%{release}
%if 0%{!?el6:1}
%if 0%{!?rhel:1}
# Turn off the brp-python-bytecompile script since this script doesn't
# properly dtect the correct python runtime for the files emacs2.py and
# emacs3.py
@ -156,7 +175,22 @@ packages that add functionality to Emacs.
%patch8 -p1 -b .locate-library
%patch9 -p1 -b .emacs-bz11580-eudc-bbdb
%patch10 -p1 -b .style-change-cb.patch
%patch11 -p1 -b .bell-dont-work.patch
%patch12 -p1 -b .gtk-warning.patch
%patch100 -p1 -b .hunspell
%patch101 -p1 -b .hunspell.2
#Install site-lisp files
cp %SOURCE10 site-lisp
pushd site-lisp
%patch1 -p0
%patch2 -p0
%patch3 -p0
%patch4 -p1
popd
# We prefer our emacs.desktop file
cp %SOURCE1 etc/emacs.desktop
@ -194,6 +228,7 @@ ln -s ../../%{name}/%{version}/etc/NEWS doc
# Remove unpatched files as all files in the lisp directory are
# installed.
rm lisp/textmodes/ispell.el.hunspell
rm lisp/textmodes/ispell.el.hunspell.2
rm lisp/textmodes/ispell.el.spellchecker
export CFLAGS="-DMAIL_USE_LOCKF $RPM_OPT_FLAGS"
@ -202,7 +237,7 @@ export CFLAGS="-DMAIL_USE_LOCKF $RPM_OPT_FLAGS"
mkdir build-gtk && cd build-gtk
ln -s ../configure .
%if 0%{?el6}
%if 0%{?rhel} == 6
%define toolkit gtk
%else
%define toolkit gtk3
@ -222,6 +257,10 @@ ln -s ../configure .
%{setarch} make %{?_smp_mflags}
cd ..
# Make sure patched lisp files get byte-compiled
build-gtk/src/emacs %{bytecompargs} site-lisp/*.el
# Remove versioned file so that we end up with .1 suffix and only one DOC file
rm build-{gtk,nox}/src/emacs-%{version}.*
@ -278,7 +317,11 @@ mv %{buildroot}%{_mandir}/man1/{ctags.1.gz,gctags.1.gz}
mv %{buildroot}%{_mandir}/man1/{etags.1.gz,etags.emacs.1.gz}
mv %{buildroot}%{_bindir}/{ctags,gctags}
# Install site-lisp files
install -p -m 0644 site-lisp/*.el{,c} %{buildroot}%{site_lisp}
mkdir -p %{buildroot}%{site_lisp}/site-start.d
install -p -m 0644 %SOURCE11 %{buildroot}%{site_lisp}/site-start.d
# Default initialization file
mkdir -p %{buildroot}%{_sysconfdir}/skel
@ -310,7 +353,9 @@ desktop-file-install --dir=%{buildroot}%{_datadir}/applications \
%SOURCE6
# Byte compile emacs*.py with correct python interpreters
%if 0%{!?el6:1}
%if 0%{?rhel:1}
rm -f %{buildroot}%{_datadir}/%{name}/%{version}/etc/emacs3.py
%else
%py_byte_compile %{__python} %{buildroot}%{_datadir}/%{name}/%{version}/etc/emacs.py
%py_byte_compile %{__python} %{buildroot}%{_datadir}/%{name}/%{version}/etc/emacs2.py
%py_byte_compile %{__python3} %{buildroot}%{_datadir}/%{name}/%{version}/etc/emacs3.py
@ -432,6 +477,34 @@ update-desktop-database &> /dev/null || :
%dir %{_datadir}/emacs/site-lisp/site-start.d
%changelog
* Sun Jul 14 2013 Michael Schwendt <mschwendt@fedoraproject.org> - 1:24.2-20
- Really fix #970924
* Tue Jun 11 2013 Petr Hracek <phracek@redhat.com> - 1:24.2-19
- rpm-goto-add-change-log-entry is not working (#970924)
* Fri Apr 12 2013 Petr Hracek <phracek@redhat.com> - 1:24.2-18
- emacs rpm spec mode is no more provided (#951101)
* Mon Apr 08 2013 Petr Hracek <phracek@redhat.com> - 1:24.2-17
- Spell checking broken by non-default dictionary (#827033)
* Thu Apr 04 2013 Petr Hracek <phracek@redhat.com> - 1:24.2-16
- Fix #929353: emacs gives gtk-warning
* Thu Mar 28 2013 Petr Hracek <phracek@redhat.com> - 1:24.2-15
- Fix for emacs bug 112144, style_changed_cb (#922519)
- Fix for emacs bug 112131, bell does not work (#526719)
* Tue Mar 26 2013 Petr Hracek <phracek@redhat.com> - 1:24.2-14
- fixing distribution flags to rhel instead of el6:1
* Mon Mar 18 2013 Petr Hracek <phracek@redhat.com> - 1:24.2-13
- solved problem with distribution flag in case of rhel
* Mon Mar 18 2013 Petr Hracek <phracek@redhat.com> - 1:24.2-12
- solved problem with distribution flag in case of rhel
* Fri Mar 08 2013 Ralf Corsépius <corsepiu@fedoraproject.org> - 1:24.2-11
- Remove %%config from %%{_sysconfdir}/rpm/macros.*
(https://fedorahosted.org/fpc/ticket/259).
@ -613,7 +686,7 @@ update-desktop-database &> /dev/null || :
- Added filesystem subpackage (rhbz#661866)
- Added emacsclient desktop file (rhbz#665362)
* Thu Jan 7 2011 Karel Klic <kklic@redhat.com> - 1:23.2-16
* Fri Jan 7 2011 Karel Klic <kklic@redhat.com> - 1:23.2-16
- Removed dependency on both hunspell and aspell. Emacs does not
_require_ spell checker, e.g. if user wants to uninstall one, there
is no reason why Emacs should also be uninstalled. Emacs can run one
@ -623,7 +696,7 @@ update-desktop-database &> /dev/null || :
- Cleaned spec file header
- Removed gcc-4.5.0 specific CFLAGS
* Thu Jan 7 2011 Karel Klic <kklic@redhat.com> - 1:23.2-15
* Fri Jan 7 2011 Karel Klic <kklic@redhat.com> - 1:23.2-15
- The emacs-terminal package now requires emacs package
* Thu Jan 6 2011 Karel Klic <kklic@redhat.com> - 1:23.2-14
@ -923,7 +996,7 @@ update-desktop-database &> /dev/null || :
- fix pkgconfig path (from pkg-config to pkgconfig (Jonathan Underwood)
- use macro instead of variable style for buildroot.
* Mon Aug 28 2007 Chip Coldwell <coldwell@redhat.com> - 22.1-3
* Tue Aug 28 2007 Chip Coldwell <coldwell@redhat.com> - 22.1-3
- change group from Development to Utility
* Mon Aug 13 2007 Chip Coldwell <coldwell@redhat.com> - 22.1-2
@ -931,7 +1004,7 @@ update-desktop-database &> /dev/null || :
- glibc-open-macro.patch to deal with glibc turning "open" into a macro.
- leave emacs info pages in default section (Resolves: bz199008)
* Fri Jun 6 2007 Chip Coldwell <coldwell@redhat.com> - 22.1-1
* Wed Jun 6 2007 Chip Coldwell <coldwell@redhat.com> - 22.1-1
- move alternatives install to posttrans scriptlet (Resolves: bz239745)
- new release tarball from FSF (Resolves: bz245303)
- new php-mode 1.2.0
@ -1263,7 +1336,7 @@ update-desktop-database &> /dev/null || :
and remove redundant next-line-add-newlines setting
- update info_file list (Reuben Thomas,114729)
* Wed Mar 16 2004 Mike A. Harris <mharris@redhat.com> 21.3-11
* Tue Mar 16 2004 Mike A. Harris <mharris@redhat.com> 21.3-11
- Removed bogus Requires: XFree86-libs that was added in 21.3-8, as rpm
find-requires will automatically pick up the dependancies on any runtime
libraries, and such hard coded requires is not X11 implementation
@ -1584,7 +1657,7 @@ update-desktop-database &> /dev/null || :
* Sat Jan 27 2001 Jakub Jelinek <jakub@redhat.com>
- Preprocess Makefiles as if they were assembly, not C source.
* Thu Jan 24 2001 Yukihiro Nakai <ynakai@redhat.com>
* Wed Jan 24 2001 Yukihiro Nakai <ynakai@redhat.com>
- Fix the fontset problem when creating a new frame.
* Thu Jan 18 2001 Trond Eivind Glomsrød <teg@redhat.com>

View File

@ -0,0 +1,48 @@
diff -up rpm-spec-mode.el.orig site-lisp/rpm-spec-mode.el
--- rpm-spec-mode.el.orig 2011-11-10 17:22:20.000000000 +0100
+++ rpm-spec-mode.el 2011-11-23 15:59:13.959987280 +0100
@@ -491,6 +491,7 @@ value returned by function `user-mail-ad
(set-keymap-name rpm-spec-mode-map 'rpm-spec-mode-map))
(define-key rpm-spec-mode-map "\C-c\C-c" 'rpm-change-tag)
(define-key rpm-spec-mode-map "\C-c\C-e" 'rpm-add-change-log-entry)
+ (define-key rpm-spec-mode-map "\C-c\C-w" 'rpm-goto-add-change-log-entry)
(define-key rpm-spec-mode-map "\C-c\C-i" 'rpm-insert-tag)
(define-key rpm-spec-mode-map "\C-c\C-n" 'rpm-forward-section)
(define-key rpm-spec-mode-map "\C-c\C-o" 'rpm-goto-section)
@@ -719,10 +720,8 @@ This variable is global by default, but
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: ")
- (save-excursion
+(defun rpm-goto-add-change-log-header ()
+ "Find change log and add header (if needed) for today"
(rpm-goto-section "changelog")
(let* ((address (rpm-spec-user-mail-address))
(fullname (or rpm-spec-user-full-name (user-full-name)))
@@ -733,8 +732,21 @@ If `rpm-change-log-uses-utc' is nil, \"t
(concat " - " (rpm-find-spec-version t))))))
(if (not (search-forward string nil t))
(insert "\n" string "\n")
- (forward-line 2))
- (insert "- " change-log-entry "\n"))))
+ (forward-line 2))))
+
+(defun rpm-add-change-log-entry (&optional change-log-entry)
+ "Find change log and add an entry for today."
+ (interactive "sChange log entry: ")
+ (save-excursion
+ (rpm-goto-add-change-log-header)
+ (insert "- " change-log-entry "\n")))
+
+(defun rpm-goto-add-change-log-entry ()
+ "Goto change log and add an header for today (if needed)."
+ (interactive)
+ (rpm-goto-add-change-log-header)
+ (insert "- \n")
+ (end-of-line '0))
;;------------------------------------------------------------

View File

@ -0,0 +1,21 @@
diff --git a/rpm-spec-mode.el b/rpm-spec-mode.el
index 63c37fa..88a7247 100644
--- a/rpm-spec-mode.el
+++ b/rpm-spec-mode.el
@@ -739,12 +739,16 @@ If `rpm-change-log-uses-utc' is nil, \"today\" means the local time zone."
(interactive "sChange log entry: ")
(save-excursion
(rpm-goto-add-change-log-header)
+ (while (looking-at "^-")
+ (forward-line))
(insert "- " change-log-entry "\n")))
(defun rpm-goto-add-change-log-entry ()
"Goto change log and add an header for today (if needed)."
(interactive)
(rpm-goto-add-change-log-header)
+ (while (looking-at "^-")
+ (forward-line))
(insert "- \n")
(end-of-line '0))

5
rpm-spec-mode-init.el Normal file
View File

@ -0,0 +1,5 @@
;; rpm-spec-mode for spec files
(autoload 'rpm-spec-mode "rpm-spec-mode" "RPM spec mode." t)
(add-to-list 'auto-mode-alist '("\\.spec\\(\\.in\\)?$" . rpm-spec-mode))
(setq-default rpm-change-log-uses-utc t)

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

@ -0,0 +1,31 @@
--- rpm-spec-mode.el~ 2009-06-11 11:01:53.000000000 +0200
+++ rpm-spec-mode.el 2009-06-11 11:05:24.000000000 +0200
@@ -708,6 +708,17 @@
;;------------------------------------------------------------
+(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,8 @@
(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) " "
+ (system-time-locale "C")
+ (string (concat "* " (rpm-change-log-date-string) " "
fullname " <" address ">"
(and rpm-spec-insert-changelog-version
(concat " - " (rpm-find-spec-version t))))))

1413
rpm-spec-mode.el Normal file

File diff suppressed because it is too large Load Diff

91
rpm-spec-mode.patch Normal file
View File

@ -0,0 +1,91 @@
--- rpm-spec-mode.el~ 2008-04-22 15:14:40.000000000 -0400
+++ rpm-spec-mode.el 2008-04-22 16:19:09.000000000 -0400
@@ -63,7 +63,9 @@
;;; Code:
-(defconst rpm-spec-mode-version "0.12.3x" "Version of `rpm-spec-mode'.")
+(require 'compile)
+
+(defconst rpm-spec-mode-version "0.12.3x.rh1" "Version of `rpm-spec-mode'.")
(defgroup rpm-spec nil
"RPM spec mode with Emacs/XEmacs enhancements."
@@ -189,11 +191,6 @@
:type 'boolean
:group 'rpm-spec)
-(defcustom rpm-spec-use-compilation-mode t
- "*If non-nil, build in `compilation-mode' if it's available."
- :type 'boolean
- :group 'rpm-spec)
-
(defcustom rpm-spec-default-release "1"
"*Default value for the Release tag in new spec files."
:type 'string
@@ -225,6 +222,11 @@
:type 'string
:group 'rpm-spec)
+(defcustom rpm-spec-auto-topdir nil
+ "*Automatically detect an rpm build directory tree and define _topdir."
+ :type 'boolean
+ :group 'rpm-spec)
+
(defgroup rpm-spec-faces nil
"Font lock faces for `rpm-spec-mode'."
:prefix "rpm-spec-"
@@ -1025,20 +1027,30 @@
(setq buildoptions (cons "--nodeps" buildoptions)))
(if (and rpm-spec-sign-gpg (not rpm-no-gpg))
(setq buildoptions (cons "--sign" buildoptions)))
- (save-excursion
- (set-buffer (get-buffer rpm-buffer-name))
- (and rpm-spec-use-compilation-mode
- (fboundp 'compilation-mode)
- (compilation-mode))
- (goto-char (point-max)))
- (let* ((process-environment (cons "EMACS=t" process-environment))
- (process
- (apply 'start-process rpm-spec-build-command rpm-buffer-name
- rpm-spec-build-command buildoptions)))
- (if (and rpm-spec-sign-gpg (not rpm-no-gpg))
- (let ((rpm-passwd-cache (read-passwd "GPG passphrase: ")))
- (process-send-string process (concat rpm-passwd-cache "\n"))))
- (set-process-filter process 'rpm-command-filter)))
+
+ (if rpm-spec-auto-topdir
+ (if (string-match ".*/SPECS/$" default-directory)
+ (let ((topdir (expand-file-name default-directory)))
+ (setq buildoptions
+ (cons
+ (concat "--define \"_topdir "
+ (replace-regexp-in-string "/SPECS/$" "" topdir)
+ "\"")
+ buildoptions)))))
+
+ (progn
+ (defun list->string (lst)
+ (if (cdr lst)
+ (concat (car lst) " " (list->string (cdr lst)))
+ (car lst)))
+ (compilation-start (list->string (cons rpm-spec-build-command buildoptions)) 'rpmbuild-mode))
+
+ (if (and rpm-spec-sign-gpg (not rpm-no-gpg))
+ (let ((build-proc (get-buffer-process
+ (get-buffer
+ (compilation-buffer-name "rpmbuild" nil nil))))
+ (rpm-passwd-cache (read-passwd "GPG passphrase: ")))
+ (process-send-string build-proc (concat rpm-passwd-cache "\n")))))
(defun rpm-build-prepare (&optional arg)
"Run a `rpmbuild -bp'."
@@ -1409,5 +1421,8 @@
;;;###autoload(add-to-list 'auto-mode-alist '("\\.spec\\(\\.in\\)?$" . rpm-spec-mode))
(provide 'rpm-spec-mode)
+;;;###autoload
+(define-compilation-mode rpmbuild-mode "RPM build" ""
+ (set (make-local-variable 'compilation-disable-input) t))
;;; rpm-spec-mode.el ends here