diff --git a/menus-always-utf8.patch b/menus-always-utf8.patch new file mode 100644 index 0000000..ef5ce69 --- /dev/null +++ b/menus-always-utf8.patch @@ -0,0 +1,86 @@ +diff -ru xemacs-21.5.28.20080401.orig//lwlib/xlwmenu.c xemacs-21.5.28.20080401/lwlib/xlwmenu.c +--- xemacs-21.5.28.20080401.orig//lwlib/xlwmenu.c 2008-04-01 19:40:35.000000000 +0200 ++++ xemacs-21.5.28.20080401/lwlib/xlwmenu.c 2009-01-21 18:01:16.000000000 +0100 +@@ -332,12 +332,12 @@ + #else + # ifdef USE_XFONTSET + XRectangle ri, rl; +- XmbTextExtents (mw->menu.font_set, s, strlen (s), &ri, &rl); ++ Xutf8TextExtents (mw->menu.font_set, s, strlen (s), &ri, &rl); + return rl.width; + # else + #ifdef USE_XFT_MENUBARS + XGlyphInfo glyphinfo; +- XftTextExtents8 (XtDisplay (mw), mw->menu.renderFont, (FcChar8 *) s, ++ XftTextExtentsUtf8 (XtDisplay (mw), mw->menu.renderFont, (FcChar8 *) s, + strlen (s), &glyphinfo); + return glyphinfo.xOff; + #else +@@ -424,11 +424,11 @@ + return width; + #else + # ifdef USE_XFONTSET +- XmbTextExtents (mw->menu.font_set, newchars, j, &ri, &rl); ++ Xutf8TextExtents (mw->menu.font_set, newchars, j, &ri, &rl); + return rl.width; + # else /* ! USE_XFONTSET */ + #ifdef USE_XFT_MENUBARS +- XftTextExtents8 (XtDisplay (mw), mw->menu.renderFont, (FcChar8 *) newchars, ++ XftTextExtentsUtf8 (XtDisplay (mw), mw->menu.renderFont, (FcChar8 *) newchars, + j, &glyphinfo); + return glyphinfo.xOff; + #else +@@ -758,7 +758,7 @@ + { + static XGlyphInfo glyphinfo; + +- XftTextExtents8 (dpy, ++ XftTextExtentsUtf8 (dpy, + xft_font, + (FcChar8 *) run, len, &glyphinfo); + return glyphinfo.xOff; +@@ -805,12 +805,12 @@ + x_xft_text_width (display, renderFont, string, strlen (string)), + renderFont->ascent + renderFont->descent); /* XXX */ + /* draw text */ +- XftDrawString8 (xftDraw, color, renderFont, x, y + mw->menu.font_ascent, ++ XftDrawStringUtf8 (xftDraw, color, renderFont, x, y + mw->menu.font_ascent, + (FcChar8 *) string, strlen (string)); + XftDrawDestroy (xftDraw); + # else + # ifdef USE_XFONTSET +- XmbDrawString (XtDisplay (mw), window, mw->menu.font_set, gc, ++ Xutf8DrawString (XtDisplay (mw), window, mw->menu.font_set, gc, + x, y + mw->menu.font_ascent, string, strlen (string)); + # else + XDrawString (XtDisplay (mw), window, gc, +@@ -866,10 +866,10 @@ + + if (end <= start) + return 0; +- XmbDrawString ( ++ Xutf8DrawString ( + XtDisplay (mw), window, mw->menu.font_set, gc, + x, y + mw->menu.font_ascent, &string[start], end - start); +- XmbTextExtents ( ++ Xutf8TextExtents ( + mw->menu.font_set, &string[start], end - start, &ri, &rl); + return rl.width; + # else +@@ -892,12 +892,12 @@ + renderFont, &string[start], end - start), + renderFont->ascent + renderFont->descent); /* XXX */ + /* draw text */ +- XftDrawString8 (xftDraw, color, renderFont, ++ XftDrawStringUtf8 (xftDraw, color, renderFont, + x, y + mw->menu.font_ascent, + (FcChar8 *) &string[start], end - start); + +- XftTextExtents8 (display, renderFont, (FcChar8 *) &string[start], +- end - start, &glyphinfo); ++ XftTextExtentsUtf8 (display, renderFont, (FcChar8 *) &string[start], ++ end - start, &glyphinfo); + + /* #### should use parent frame's .xftDraw */ + XftDrawDestroy (xftDraw); +xemacs-21.5.28.20080401/lwlibだけに発見: xlwmenu.c.~1~ diff --git a/site-start.el b/site-start.el index c4611d7..76f078a 100644 --- a/site-start.el +++ b/site-start.el @@ -377,49 +377,56 @@ integrated into XEmacs" ;; it prevents data loss if files containing these characters are read ;; and saved again. -(make-charset 'suse-private - "Private character set for SUSE" - '(dimension 2 - chars 96 - columns 1 - final ?R ;; Change this--see docs for make-charset - long-name "Private charset for some Unicode char support." - short-name - "Suse-Private")) +;; This hack is not needed anymore, something similar has been +;; implemented upstream. +;; Keeping this hack enabled causes problems, for example it often +;; causes error messages when trying to attach .pdf files in Gnus. +;; Therefore I comment it out. +;; Mon Feb 23 12:20:01 2009 -(defun suse-list-unsupported-codepoints-range (range) - (interactive) - (let ((unsupported nil) - (i (car range)) - (j (cadr range))) - (while (<= i j) - (if (not (unicode-to-char i)) - (push i unsupported)) - (setq i (1+ i))) - unsupported)) - -(defun suse-fill-charset (charset codepoint-list) - (interactive) - (let ((n 0)) - (dolist (codepoint codepoint-list) - (let ((i (mod n 96)) - (j (/ n 96))) - (if (< j 95) - (set-unicode-conversion (make-char charset (+ i #x20) (+ j #x20)) codepoint) - (message "charset %s is full" charset)) - (setq n (1+ n)))))) - -(suse-fill-charset - 'suse-private - (nconc - (suse-list-unsupported-codepoints-range '(#x0100 #x06FF)) - (suse-list-unsupported-codepoints-range '(#x0900 #x11FF)) - (suse-list-unsupported-codepoints-range '(#x1E00 #x27FF)) - (suse-list-unsupported-codepoints-range '(#x3000 #x33FF)) - (suse-list-unsupported-codepoints-range '(#xE800 #xE8FF)) - (suse-list-unsupported-codepoints-range '(#xF000 #xF0FF)) - (suse-list-unsupported-codepoints-range '(#xFB00 #xFFFF)) - )) +;; (make-charset 'suse-private +;; "Private character set for SUSE" +;; '(dimension 2 +;; chars 96 +;; columns 1 +;; final ?R ;; Change this--see docs for make-charset +;; long-name "Private charset for some Unicode char support." +;; short-name +;; "Suse-Private")) +;; +;; (defun suse-list-unsupported-codepoints-range (range) +;; (interactive) +;; (let ((unsupported nil) +;; (i (car range)) +;; (j (cadr range))) +;; (while (<= i j) +;; (if (not (unicode-to-char i)) +;; (push i unsupported)) +;; (setq i (1+ i))) +;; unsupported)) +;; +;; (defun suse-fill-charset (charset codepoint-list) +;; (interactive) +;; (let ((n 0)) +;; (dolist (codepoint codepoint-list) +;; (let ((i (mod n 96)) +;; (j (/ n 96))) +;; (if (< j 95) +;; (set-unicode-conversion (make-char charset (+ i #x20) (+ j #x20)) codepoint) +;; (message "charset %s is full" charset)) +;; (setq n (1+ n)))))) +;; +;; (suse-fill-charset +;; 'suse-private +;; (nconc +;; (suse-list-unsupported-codepoints-range '(#x0100 #x06FF)) +;; (suse-list-unsupported-codepoints-range '(#x0900 #x11FF)) +;; (suse-list-unsupported-codepoints-range '(#x1E00 #x27FF)) +;; (suse-list-unsupported-codepoints-range '(#x3000 #x33FF)) +;; (suse-list-unsupported-codepoints-range '(#xE800 #xE8FF)) +;; (suse-list-unsupported-codepoints-range '(#xF000 #xF0FF)) +;; (suse-list-unsupported-codepoints-range '(#xFB00 #xFFFF)) +;; )) (if (and (boundp 'xft-version) (eq window-system 'x)) (load "suse-xft-init.el" t t)) diff --git a/xemacs-21.4.8-app-defaults.patch b/xemacs-21.4.8-app-defaults.patch deleted file mode 100644 index ae0bfae..0000000 --- a/xemacs-21.4.8-app-defaults.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- etc/Emacs.ad.appdef 2002-10-31 15:05:40.000000000 +0000 -+++ etc/Emacs.ad 2002-12-12 14:25:43.000000000 +0000 -@@ -41,6 +41,10 @@ - ! Note that by default, the pointer foreground and background are the same - ! as the default face. - -+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -+!! FontSet for menus when you use --with-xfs or --with-xim=xlib. -+XEmacs*fontSet: -*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso10646-1,-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-* -+ - ! Set the menubar colors. This overrides the default foreground and - ! background colors specified above. - *menubar*Foreground: Gray30 diff --git a/xemacs-app-defaults.patch b/xemacs-app-defaults.patch new file mode 100644 index 0000000..9a42660 --- /dev/null +++ b/xemacs-app-defaults.patch @@ -0,0 +1,21 @@ +diff -ru xemacs-21.5.28.20080401.orig//etc/Emacs.ad xemacs-21.5.28.20080401/etc/Emacs.ad +--- xemacs-21.5.28.20080401.orig//etc/Emacs.ad 2008-04-01 19:40:34.000000000 +0200 ++++ xemacs-21.5.28.20080401/etc/Emacs.ad 2009-02-23 14:10:15.000000000 +0100 +@@ -41,6 +41,17 @@ + ! Note that by default, the pointer foreground and background are the same + ! as the default face. + ++!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ++! Fonts for Xft: ++XEmacs*Tabs.fcFontName: sans-serif ++XEmacs*menubar.fcFontName: sans-serif ++XEmacs*modeline.attributeFont: sans-serif ++XEmacs*default.attributeFont: sans-serif ++ ++!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ++!! FontSet for menus when you use --with-xfs or --with-xim=xlib. ++XEmacs*fontSet: -*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso10646-1,-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-* ++ + ! Set the menubar colors. This overrides the default foreground and + ! background colors specified above. + *menubar*Foreground: Gray30 diff --git a/xemacs.changes b/xemacs.changes index 4ff9dc3..98093f7 100644 --- a/xemacs.changes +++ b/xemacs.changes @@ -1,3 +1,21 @@ +------------------------------------------------------------------- +Mon Feb 23 12:26:40 CET 2009 - maiku.fabian@gmail.com + +- add menus-always-utf8.patch to make the menus work in UTF-8 + locales with Xft. The patch is not yet perfect, it doesn't yet + work for the non-Xft case. +- disable the hack in site-start.el to support extra Unicode + characters. Something similar has been implemented upstream + and this hack now causes problems when trying to attach some PDF + files in Gnus. +- mark /etc/skel/.xemacs/init.el as %config. +- remove checks for obsolte suse versions. +- set font resources for Xft in /usr/share/X11/app-defaults/XEmacs: + XEmacs*Tabs.fcFontName: sans-serif + XEmacs*menubar.fcFontName: sans-serif + XEmacs*modeline.attributeFont: sans-serif + XEmacs*default.attributeFont: sans-serif + ------------------------------------------------------------------- Tue Jan 20 12:44:59 CET 2009 - mfabian@suse.de diff --git a/xemacs.spec b/xemacs.spec index 6011836..2a22012 100644 --- a/xemacs.spec +++ b/xemacs.spec @@ -44,7 +44,7 @@ Requires: xemacs-info xemacs-packages ctags Conflicts: gnuserv AutoReqProv: on Version: 21.5.28.20080401 -Release: 60 +Release: 61 Summary: XEmacs BuildRoot: %{_tmppath}/%{name}-%{version}-build # Howto get the cvs tree of XEmacs: @@ -77,7 +77,7 @@ Source6: site-start.el Source7: skel.init.el Patch0: xemacs.patch # keep in sync with the similar patch to the app-defaults in the main xemacs-packages package: -Patch3: xemacs-21.4.8-app-defaults.patch +Patch3: xemacs-app-defaults.patch Patch5: xemacs-21.4.4-font-menu.patch Patch13: xemacs-ia64.dif Patch14: ndbm.patch @@ -101,6 +101,7 @@ Patch45: fix-defface-custom-modified-face.patch Patch47: xaw3d-config.patch Patch48: fix-window-configuration-problem.patch Patch49: xemacs-configure.patch +Patch50: menus-always-utf8.patch Patch292811: bugzilla-292811-make-x-make-font-bold-italic-xft-work.patch Patch301352: bugzilla-301352-fix-wrong-incrementing-in-macros.patch Patch432404: bnc432404-bytecomp.diff @@ -171,7 +172,7 @@ Authors: %prep %setup -q -n xemacs-%{version} -%patch3 -p0 -b .appdef +%patch3 -p1 #%patch5 -p1 -b .fontmenu # appears to be not needed anymore %patch13 -p1 %patch14 -p1 @@ -197,6 +198,7 @@ Authors: %patch47 %patch48 -p1 %patch49 +%patch50 -p1 %patch292811 -p1 %patch301352 -p1 %patch432404 -p1 @@ -209,11 +211,7 @@ find lisp/ etc/ -name '*.elc' | xargs -r rm -f %define enable_pdump 1 %endif %define enable_dump_in_exec 0 -%if %suse_version > 1010 %define enable_xft 0%{?opensuse_bs} -%else -%define enable_xft 0 -%endif find . -name CVS -type d | xargs rm -rf find . -name .cvsignore -type f | xargs rm -f chmod -R u+w * @@ -318,7 +316,7 @@ SPECIAL="--enable-database=gdbm,berkdb \ --enable-pdump=no \ %endif %if %enable_xft - --with-xft=emacs,tabs,gauges \ + --with-xft=emacs,menubars,tabs,gauges \ %endif " # @@ -351,6 +349,8 @@ MAIL="--enable-clash-detection \ # # Mule # +MULE="--enable-mule \ + --with-xim=xlib \ # --with-xfs Compile with XFontSet support for bilingual menubar. # Can't use this option with --with-xim=motif or xlib. # And should have --with-menubars=lucid. @@ -359,10 +359,9 @@ MAIL="--enable-clash-detection \ # and Romanian texts in the menus. It DOES work with # --with-xim=xlib, the above comment from './configure --help' # seems to be incorrect in that respect.) -# -MULE="--enable-mule \ - --with-xim=xlib \ +%if ! %enable_xft --with-xfs \ +%endif " # # Compilation @@ -508,9 +507,7 @@ rm -rf $RPM_BUILD_ROOT/usr/lib/xemacs/%{version}/*-suse-linux/include/ %post %run_permissions %verifyscript -%if %suse_version > 920 %verify_permissions -e %{xbindir}/xemacs -e /var/lib/xemacs/lock -%endif %clean rm -rf $RPM_BUILD_ROOT @@ -518,11 +515,9 @@ rm -rf $RPM_BUILD_ROOT %files -f xe-list-el-without-elc_xe-list-elc-without-el_xe-list-elc-with-el %defattr(-,root,root) %dir /etc/skel/.xemacs -/etc/skel/.xemacs/init.el +%config /etc/skel/.xemacs/init.el /usr/share/applications/xemacs.desktop -%if %suse_version > 920 /usr/share/pixmaps/xemacs.png -%endif %{xbindir}/ellcc %{xbindir}/gnuattach %{xbindir}/gnuclient @@ -603,6 +598,21 @@ rm -rf $RPM_BUILD_ROOT %dir /usr/share/xemacs/site-packages/lisp/term/ %changelog +* Mon Feb 23 2009 maiku.fabian@gmail.com +- add menus-always-utf8.patch to make the menus work in UTF-8 + locales with Xft. The patch is not yet perfect, it doesn't yet + work for the non-Xft case. +- disable the hack in site-start.el to support extra Unicode + characters. Something similar has been implemented upstream + and this hack now causes problems when trying to attach some PDF + files in Gnus. +- mark /etc/skel/.xemacs/init.el as %%config. +- remove checks for obsolte suse versions. +- set font resources for Xft in /usr/share/X11/app-defaults/XEmacs: + XEmacs*Tabs.fcFontName: sans-serif + XEmacs*menubar.fcFontName: sans-serif + XEmacs*modeline.attributeFont: sans-serif + XEmacs*default.attributeFont: sans-serif * Tue Jan 20 2009 mfabian@suse.de - bnc#461244: change menu font set in app-defaults to use only -*-helvetica-*. This avoids matching the huge Chinese