changeset 3360:316fddbf58e2

[xemacs-hg @ 2006-04-25 14:01:52 by stephent] Repair broken commit to Xft code. <87aca9n4in.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Tue, 25 Apr 2006 14:02:09 +0000
parents af8dab703edc
children 9fddb79e8a88
files lisp/ChangeLog lisp/faces.el lisp/font-mgr.el lisp/font.el lisp/fontconfig.el lisp/startup.el lisp/x-faces.el lisp/x-font-menu.el lisp/x-init.el lwlib/ChangeLog lwlib/lwlib-fonts.c src/ChangeLog src/console.h src/emacs.c src/font-mgr.c src/font-mgr.h src/objects-x.c src/redisplay.c src/symsinit.h
diffstat 19 files changed, 148 insertions(+), 132 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Apr 24 21:51:11 2006 +0000
+++ b/lisp/ChangeLog	Tue Apr 25 14:02:09 2006 +0000
@@ -1,3 +1,21 @@
+2006-04-25  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	Repair busted commit and gratuitous doc improvements.
+
+	* startup.el (command-line-do-help): Document options for forcing
+	initial from on a given window-system.
+
+	* faces.el (Face-frob-property): Give informative error if device
+	type has no mapper function.
+
+	* x-font-menu.el (x-font-menu-font-data-xft):
+	* x-faces.el (globally-declare-fboundp):
+	Eliminate references to `fc-font-real-pattern'.
+
+	* fontconfig.el (section header comments):
+	* x-init.el (x-init-toolbar-from-resources):
+	Improve comments.
+
 2006-04-23  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* cl.el (push):
--- a/lisp/faces.el	Mon Apr 24 21:51:11 2006 +0000
+++ b/lisp/faces.el	Tue Apr 25 14:02:09 2006 +0000
@@ -990,8 +990,10 @@
 				  locale tag-set devtype-spec ffpdev)
 		   ;; devtype may be nil if it fails to match DEVTYPE-SPEC
 		   if devtype
-		   if (let* ((mapper (if (functionp frob-mapping) frob-mapping
-				       (plist-get frob-mapping devtype)))
+		   if (let* ((mapper
+			      (cond ((functionp frob-mapping) frob-mapping)
+				    ((plist-get frob-mapping devtype))
+				    (t (error 'unimplemented "mapper" devtype))))
 			     (result
 			      (cond
 			       ;; if a vector ...
--- a/lisp/font-mgr.el	Mon Apr 24 21:51:11 2006 +0000
+++ b/lisp/font-mgr.el	Tue Apr 25 14:02:09 2006 +0000
@@ -234,16 +234,6 @@
 match other font-listing APIs."
   (error 'unimplemented "font-mgr library is experimental and incomplete"))
 
-(when nil
-  ;; #### this actually is an Xft function, should split those out
-  ;; or get rid of them entirely?
-  ;; #### be consistent about argument order.
-(defun fc-font-real-pattern (fontname xdevice)
-  "Temporarily open FONTNAME (a string) and return the actual
-fc pattern matched by the Fc library."
-  (error 'unimplemented "font-mgr library is experimental and incomplete"))
-)
-
 (defun xlfd-font-name-p (fontname)
   "Check whether the string FONTNAME is a XLFD font name."
   (save-match-data
--- a/lisp/font.el	Mon Apr 24 21:51:11 2006 +0000
+++ b/lisp/font.el	Tue Apr 25 14:02:09 2006 +0000
@@ -796,10 +796,12 @@
   "A list of font family mappings on Xft devices.")
 
 (defun xft-font-create-object (fontname &optional device)
-  "Return a font descriptor object for FONTNAME, appropriate for Xft."
+  "Return a font descriptor object for FONTNAME, appropriate for Xft.
+
+Optional DEVICE defaults to `default-x-device'."
   (let* ((name fontname)
 	 (device (or device (default-x-device)))
-	 (pattern (fc-font-real-pattern name device))
+	 (pattern (fc-font-match device (fc-name-parse name)))
 	 (font-obj (make-font))
 	 (family (fc-pattern-get-family pattern 0))
 	 (size (fc-pattern-get-size pattern 0))
--- a/lisp/fontconfig.el	Mon Apr 24 21:51:11 2006 +0000
+++ b/lisp/fontconfig.el	Tue Apr 25 14:02:09 2006 +0000
@@ -89,9 +89,8 @@
 ;;
 ;; The fontconfig pattern API
 ;;
-;; The basic interfaces are defined as API wrappers in C in xft-font.c
-;; #### which should be renamed to fontconfig.c.  These are prefixed
-;; with "fc-pattern-".  These are
+;; The basic interfaces are defined as API wrappers in C in font-mgr.c.
+;; These are prefixed with "fc-pattern-".  These are
 ;;
 ;;   fc-pattern-p
 ;;   fc-pattern-create
@@ -385,13 +384,11 @@
 ;;
 ;; The fontconfig fontname UI
 ;;
-;; The basic interfaces are defined as API wrappers in C in xft-font.c
-;; #### which should be renamed to fontconfig.c.  These are prefixed
-;; with "fc-name-".  These are
+;; The basic interfaces are defined as API wrappers in C in font-mgr.c
+;; These are prefixed with "fc-name-".  These are
 ;;
 ;;   fc-name-parse
 ;;   fc-name-unparse
-;;   xft-name-unparse (nonfunctional and presumably obsolete)
 ;;
 ;; For interfacing with various font rendering systems, we need to be able
 ;; to convert the fontconfig patterns to names, and vice versa.  The high-
@@ -423,14 +420,12 @@
 ;;
 ;; The fontconfig font API
 ;;
-;; The basic interfaces are defined as API wrappers in C in xft-font.c
-;; #### which should be renamed to fontconfig.c.  These are prefixed
-;; with "fc-font-".  These are
+;; The basic interfaces are defined as API wrappers in C in font-mgr.c.
+;; These are prefixed with "fc-font-".  These are
 ;;
 ;;   fc-font-match
 ;;   fc-list-fonts-pattern-objects
 ;;   fc-font-sort
-;;   fc-font-real-pattern
 ;;
 ;; The high-level API is
 ;;
--- a/lisp/startup.el	Mon Apr 24 21:51:11 2006 +0000
+++ b/lisp/startup.el	Tue Apr 25 14:02:09 2006 +0000
@@ -174,7 +174,7 @@
 (defvar load-user-init-file-p t
   "Non-nil if XEmacs should load the user's init file.")
 
-;; #### called `site-run-file' in FSFmacs
+;; #### called `site-run-file' in GNU Emacs
 
 (defvar site-start-file "site-start"
   "File containing site-wide run-time initializations.
@@ -285,6 +285,11 @@
                         -t is given.  Otherwise, a TTY frame is created.
   -unmapped             Do not display the initial frame.  Useful to create
                         a \"server\" that can accept `gnuclient' connections.
+  -tty                  Create the initial frame on the given window system.
+  -x                    (Requesting an unsupported window system, or giving
+  -gtk                  conflicting window systems, is a fatal error.)
+  -gnome
+  -msw
 
 Noninteractive options:
 
@@ -569,7 +574,7 @@
       ;;      ;; Modify the initial frame based on what the init file puts into
       ;;      ;; ...-frame-alist.
       (frame-notice-user-settings)
-      ;;      ;;####FSFmacs junk
+      ;;      ;;#### GNU Emacs junk
       ;;      ;; Now we know the user's default font, so add it to the menu.
       ;;      (if (fboundp 'font-menu-add-default)
       ;;	  (font-menu-add-default))
@@ -583,7 +588,7 @@
 
     (if load-user-init-file-p
 	(maybe-migrate-user-init-file))
-    ;; FSF calls precompute-menubar-bindings.  We don't mix menubars
+    ;; GNU calls precompute-menubar-bindings.  We don't mix menubars
     ;; and keymaps.
     ))
 
@@ -606,7 +611,7 @@
 	       (string= vc "simple"))
 	   (setq version-control 'never))))
 
-  ;;####FSFmacs
+  ;;#### GNU Emacs
   ;;  (if (let ((ctype
   ;;	     ;; Use the first of these three envvars that has a nonempty value.
   ;;	     (or (let ((string (getenv "LC_ALL")))
--- a/lisp/x-faces.el	Mon Apr 24 21:51:11 2006 +0000
+++ b/lisp/x-faces.el	Tue Apr 25 14:02:09 2006 +0000
@@ -1,6 +1,6 @@
 ;;; x-faces.el --- X-specific face frobnication, aka black magic.
 
-;; Copyright (C) 1992-4, 1997 Free Software Foundation, Inc.
+;; Copyright (C) 1992-1994, 1997, 2006 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 2002, 2004 Ben Wing.
 
 ;; Author: Jamie Zawinski <jwz@jwz.org>
@@ -74,11 +74,11 @@
      fc-font-name-slant-oblique   fc-font-name-slant-italic
      fc-font-name-slant-roman))
   (globally-declare-fboundp
-    '(fc-font-real-pattern  fc-pattern-get-size  fc-copy-pattern-partial
-      fc-pattern-del-weight fc-pattern-del-style fc-pattern-duplicate
-      fc-pattern-add-weight fc-try-font          fc-pattern-add-size
-      fc-name-unparse       fc-pattern-del-slant fc-pattern-add-slant
-      fc-pattern-del-size   fc-pattern-get-pixelsize)))
+    '(fc-pattern-del-size   fc-pattern-get-size   fc-pattern-add-size
+      fc-pattern-del-style  fc-pattern-duplicate  fc-copy-pattern-partial
+      fc-pattern-add-weight fc-pattern-del-weight fc-try-font          
+      fc-pattern-del-slant  fc-pattern-add-slant  fc-name-unparse
+      fc-pattern-get-pixelsize)))
 
 (defconst x-font-regexp nil)
 (defconst x-font-regexp-head nil)
@@ -194,8 +194,8 @@
     (x-make-font-bold-core font device)))
 
 (defun x-make-font-bold-xft (font &optional device)
-  (let ((pattern (fc-font-real-pattern 
-		  font (or device (default-x-device)))))
+  (let ((pattern (fc-font-match (or device (default-x-device))
+				(fc-name-parse font))))
     (if pattern
 	(let ((size (fc-pattern-get-size pattern 0))
 	      (copy (fc-copy-pattern-partial pattern (list "family"))))
@@ -238,8 +238,8 @@
     (x-make-font-unbold-core font device)))
   
 (defun x-make-font-unbold-xft (font &optional device)
-  (let ((pattern (fc-font-real-pattern 
-		  font (or device (default-x-device)))))
+  (let ((pattern (fc-font-match (or device (default-x-device))
+				(fc-name-parse font))))
     (when pattern
       (fc-pattern-del-weight pattern)
       (fc-pattern-add-weight pattern fc-font-name-weight-medium)
@@ -268,8 +268,8 @@
     (x-make-font-italic-core font device)))
 
 (defun x-make-font-italic-xft (font &optional device)
-  (let ((pattern (fc-font-real-pattern 
-		  font (or device (default-x-device)))))
+  (let ((pattern (fc-font-match (or device (default-x-device))
+				(fc-name-parse font))))
     (if pattern
       (let ((size (fc-pattern-get-size pattern 0))
 	    (copy (fc-copy-pattern-partial pattern (list "family"))))
@@ -322,8 +322,8 @@
     (x-make-font-unitalic-core font device)))
   
 (defun x-make-font-unitalic-xft (font &optional device)
-  (let ((pattern (fc-font-real-pattern 
-		  font (or device (default-x-device)))))
+  (let ((pattern (fc-font-match (or device (default-x-device))
+				(fc-name-parse font))))
     (when pattern
       (fc-pattern-del-slant pattern)
       (fc-pattern-add-slant pattern fc-font-name-slant-roman)
@@ -389,11 +389,11 @@
 
 ;; this is unbelievable &*@#
 (defun x-font-size-xft (font)
-  (let ((pattern (fc-font-real-pattern 
-		  font (default-x-device))))
+  (let ((pattern (fc-font-match (default-x-device)
+				(fc-name-parse font))))
     (when pattern
       (let ((pixelsize (fc-pattern-get-pixelsize pattern 0)))
-	(if (floatp pixelsize) (round pixelsize))))))
+	(if (floatp pixelsize) (round pixelsize) pixelsize)))))
 
 (defun x-font-size-core (font)
   (if (font-instance-p font) (setq font (font-instance-name font)))
@@ -521,8 +521,8 @@
     (x-find-smaller-font-core font device)))
 
 (defun x-find-xft-font-of-size (font new-size-proc &optional device)
-  (let* ((pattern (fc-font-real-pattern 
-		   font (or device (default-x-device)))))
+  (let* ((pattern (fc-font-match (or device (default-x-device))
+				 (fc-name-parse font))))
     (when pattern
       (let ((size (fc-pattern-get-size pattern 0)))
 	(if (floatp size)
--- a/lisp/x-font-menu.el	Mon Apr 24 21:51:11 2006 +0000
+++ b/lisp/x-font-menu.el	Tue Apr 25 14:02:09 2006 +0000
@@ -35,7 +35,6 @@
 (require 'font-menu)
 
 (when (featurep 'xft-fonts)
-  (require 'xft)
   (require 'fontconfig))
 
 (globally-declare-boundp
@@ -276,6 +275,7 @@
        (x-font-menu-font-data-core face dcache))))
 
 (defun x-font-menu-font-data-xft (face dcache name domain)
+  ;; DOMAIN is expected to be a device.
   (let* ((truename (font-instance-truename
 		    (face-font-instance face domain
 					(if (featurep 'mule) 'ascii))))
@@ -284,7 +284,7 @@
 	(progn
 	  nil)
       (progn
-	(let* ((pattern (fc-font-real-pattern name domain))
+	(let* ((pattern (fc-font-match domain (fc-name-parse name)))
 	       (family (and pattern
 			    (fc-pattern-get-family pattern 0))))
 	  (if (fc-pattern-get-successp family)
--- a/lisp/x-init.el	Mon Apr 24 21:51:11 2006 +0000
+++ b/lisp/x-init.el	Tue Apr 25 14:02:09 2006 +0000
@@ -271,7 +271,7 @@
 	(fill-paragraph nil))))))
 
 
-;; Moved from x-toolbar.el, since InfoDock doesn't dump a x-toolbar.el.
+;; Moved from x-toolbar.el, since InfoDock doesn't dump x-toolbar.el.
 (defun x-init-toolbar-from-resources (locale)
   (loop for (specifier . resname) in
     `((   ,top-toolbar-height       .    "topToolBarHeight")
--- a/lwlib/ChangeLog	Mon Apr 24 21:51:11 2006 +0000
+++ b/lwlib/ChangeLog	Tue Apr 25 14:02:09 2006 +0000
@@ -1,6 +1,7 @@
-2006-04-22  Stephen J. Turnbull  <stephen@xemacs.org>
+2006-04-16  Stephen J. Turnbull  <stephen@xemacs.org>
 
-	* lwlib-fonts.c: Rename xft-fonts.h to font-mgr.h.
+	* lwlib-fonts.c: Change #include to "font-mgr.h".  Make
+	conditional on HAVE_FONTCONFIG, not USE_XFT.
 
 2006-03-31  Stephen J. Turnbull  <stephen@xemacs.org>
 
--- a/lwlib/lwlib-fonts.c	Mon Apr 24 21:51:11 2006 +0000
+++ b/lwlib/lwlib-fonts.c	Tue Apr 25 14:02:09 2006 +0000
@@ -36,8 +36,10 @@
 #include "device.h"
 #include "device-impl.h"
 #include "console-x-impl.h"
+#ifdef HAVE_FONTCONFIG
 #include "font-mgr.h"
 #endif
+#endif
 
 /*
  * code for handling Xft
--- a/src/ChangeLog	Mon Apr 24 21:51:11 2006 +0000
+++ b/src/ChangeLog	Tue Apr 25 14:02:09 2006 +0000
@@ -1,3 +1,21 @@
+2006-04-25  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	Repair busted commit, plus some gratuitous doc improvements.
+
+	* emacs.c (main_1): Initialize display_use to NULL for clarity.
+
+	* objects-x.c (x_color_list):
+	(x_initialize_font_instance):
+	(x_font_instance_truename):
+	(x_find_charset_font):
+	* font-mgr.h (Qfc_font_name_encoding):
+	Qxft_font_name_encoding -> Qfc_font_name_encoding.
+
+	* console.h (header comment):
+	* font-mgr.c (vars_of_font_mgr):
+	* redisplay.c (Vwindow_system):
+	Improve comments.
+
 2006-04-22  Jerry James  <james@xemacs.org>
 
 	* event-stream.c (copy_command_builder): Also copy the console.
--- a/src/console.h	Mon Apr 24 21:51:11 2006 +0000
+++ b/src/console.h	Tue Apr 25 14:02:09 2006 +0000
@@ -28,21 +28,26 @@
 /* Devices and consoles are similar entities.  The idea is that
    a console represents a physical keyboard/mouse/other-input-source
    while a device represents a display where frames appear on.
+   Nowadays "multi-headed" displays with multiple physical screens
+   are becoming familiar; in the XEmacs nomenclature, this maps to a
+   "console" supporting multiple "devices".
+
    In the X world, a console is a "Display" while a device is a
    "Screen".  Implementationally, it can sometimes get confusing:
    under X, multiple devices on a single console are different
    "Display" connections to what is in reality the same Display on
-   the same server.  Because of this, input comes from the device
-   and not from the console.  This is OK because events are basically
-   always tagged to a particular X window (i.e. frame),
-   which exists on only one screen; therefore the event won't be
-   reported multiple times even if there are multiple devices on
-   the same physical display.  This is an implementation detail
-   specific to X consoles (e.g. under NeXTstep or Windows, this
-   could be different, and input would come directly from the console).
+   the same server.  Furthermore, in the X model input comes from the
+   device and not from the console.  This causes no confusion because
+   events are basically always tagged to a particular X window (i.e.
+   frame), which exists on only one screen; therefore the event won't
+   be reported multiple times even if there are multiple devices on
+   the same physical display.
+
+   This is an implementation detail specific to X consoles (e.g. under
+   NeXTstep or Windows, this could be different, and input would come
+   directly from the console).
 */
 
-
 /* GCC does not like forward enum declaration. This needs to be
    defined here. What a disgust! */
 
--- a/src/emacs.c	Mon Apr 24 21:51:11 2006 +0000
+++ b/src/emacs.c	Tue Apr 25 14:02:09 2006 +0000
@@ -911,7 +911,7 @@
 #endif /* not SYSTEM_MALLOC or HAVE_LIBMCHECK or DOUG_LEA_MALLOC */
 
   noninteractive = 0;
-  display_use = 0;
+  display_use = NULL;
   inhibit_non_essential_conversion_operations = 1;
 
 #ifdef NEW_GC
--- a/src/font-mgr.c	Mon Apr 24 21:51:11 2006 +0000
+++ b/src/font-mgr.c	Tue Apr 25 14:02:09 2006 +0000
@@ -32,8 +32,6 @@
 /* This module provides the Lisp interface to fonts in X11, including Xft,
    but (at least at first) not GTK+ or Qt.
 
-   It should be renamed to fonts-x.h.
-
    Sealevel code should be in ../lwlib/lwlib-fonts.c or
    ../lwlib/lwlib-colors.c.
 */
@@ -69,7 +67,7 @@
    . Fontconfig fontnames are encoded in UTF-8.
 */
 
-Lisp_Object Qxft_font;
+Lisp_Object Qfont_mgr;
 Lisp_Object Qfc_patternp;
 Lisp_Object Qfc_fontsetp;
 /* Lisp_Object Qfc_result_match; */ 	/* FcResultMatch */
@@ -122,9 +120,11 @@
    is a Lisp string.
 */
 #define extract_fcapi_string(str) \
-  ((FcChar8 *) NEW_LISP_STRING_TO_EXTERNAL ((str), Qnative))
+  ((FcChar8 *) NEW_LISP_STRING_TO_EXTERNAL ((str), Qfc_font_name_encoding))
 
-/* fontconfig assumes that objects (property names) are statically allocated,
+/* #### This homebrew lashup should be replaced with FcConstants.
+
+   fontconfig assumes that objects (property names) are statically allocated,
    and you will get bizarre results if you pass Lisp string data or strings
    allocated on the stack as objects.  fontconfig _does_ copy values, so we
    (I hope) don't have to worry about that member.
@@ -135,12 +135,20 @@
 
    I suspect that using symbol names or even keywords does not provide
    assurance that the string won't move in memory.  So we hash them
-   ourselves; hash.c hashtables do not interpret the value pointers. */
-static FcChar8 *fc_standard_properties[] = {
-  "antialias", "aspect", "autohint", "charset", "dpi", "family", "file",
+   ourselves; hash.c hashtables do not interpret the value pointers.
+
+   This array should be FcChar8**, but GCC 4.x bitches about signedness. */
+static Extbyte *fc_standard_properties[] = {
+  /* treated specially, ordered first */
+  "family", "size",
+  /* remaining are alphabetized by group */
+  /* standard properties in fontconfig and Xft v.2 */
+  "antialias", "aspect", "autohint", "charset", "dpi", "file",
   "foundry", "ftface", "globaladvance", "hinting", "index", "lang",
   "minspace", "outline", "pixelsize", "rasterizer", "rgba", "scalable",
-  "scale", "size", "slant", "spacing", "style", "verticallayout", "weight",
+  "scale", "slant", "spacing", "style", "verticallayout", "weight",
+  /* common in modern fonts */
+  "fontformat", "fontversion",
   /* obsolete after Xft v. 1 */
   "charwidth", "charheight", "core", "encoding", "render"
 };
@@ -213,7 +221,7 @@
   CHECK_FCPATTERN(pattern);
   {
   FcChar8 *temp = FcNameUnparse(XFCPATTERN_PTR(pattern));
-  Lisp_Object res = build_ext_string (temp, Qxft_font_name_encoding);
+  Lisp_Object res = build_ext_string (temp, Qfc_font_name_encoding);
   free (temp);
   return res;
   }
@@ -419,7 +427,7 @@
 	case FcTypeString:
 	  return ((!NILP (type) && !EQ (type, Qstring))
 		  ? Qfc_result_type_mismatch
-		  : build_ext_string (fc_value.u.s, Qxft_font_name_encoding));
+		  : build_ext_string (fc_value.u.s, Qfc_font_name_encoding));
 	case FcTypeBool:
 	  return ((!NILP (type) && !EQ (type, Qboolean))
 		  ? Qfc_result_type_mismatch : fc_value.u.b ? Qt : Qnil);
@@ -457,7 +465,6 @@
 `fc-result-no-match' and `fc-result-no-id'. */
       (device, pattern))
 {
-  Display *dpy;
   FcResult res;
 
   struct fc_pattern *res_fcpat =
@@ -469,11 +476,15 @@
   if (!DEVICE_LIVE_P(XDEVICE(device)))
     return Qnil;
 
-  dpy = DEVICE_X_DISPLAY(XDEVICE(device));
-  /* More Xft vs fontconfig brain damage? */
-  res_fcpat->fcpatPtr = XftFontMatch(dpy, DefaultScreen (dpy),
-				     XFCPATTERN_PTR(pattern), &res);
-  
+  {
+    FcPattern *p = XFCPATTERN_PTR(pattern);
+    FcConfig *fcc = FcConfigGetCurrent ();
+
+    FcConfigSubstitute (fcc, p, FcMatchPattern);
+    FcDefaultSubstitute (p);
+    res_fcpat->fcpatPtr = FcFontMatch (fcc, p, &res);
+  }
+
   if (res_fcpat->fcpatPtr == NULL)
     switch (res) {
     case FcResultNoMatch:
@@ -576,41 +587,6 @@
   }
 }
 
-/* #### this actually is an Xft function, should split those out
-   or get rid of them entirely? */
-/* #### be consistent about argument order. */
-DEFUN("fc-font-real-pattern", Ffc_font_real_pattern, 2, 2, 0, /*
-Temporarily open FONTNAME (a string) and return the actual
-fc pattern matched by the Fc library.	*/
-      (fontname, xdevice))
-{
-  FcPattern *copy;
-  Display *dpy;
-  XftFont *font;
-  struct fc_pattern *fcpat =
-    ALLOC_LCRECORD_TYPE (struct fc_pattern, &lrecord_fc_pattern);
-
-  CHECK_STRING (fontname);	/* #### MEMORY LEAK?!  maybe not ... */
-  if (NILP(xdevice))
-    return Qnil;
-  CHECK_X_DEVICE (xdevice);
-  if (!DEVICE_LIVE_P(XDEVICE(xdevice)))
-    return Qnil;
-
-  /* #### these gymnastics should be unnecessary, just use FcFontMatch */
-  dpy = DEVICE_X_DISPLAY (XDEVICE (xdevice));
-  font = XftFontOpenName (dpy, DefaultScreen(dpy),
-			  extract_fcapi_string (fontname));
-  if (font == NULL)
-    return Qnil;
-  copy = FcPatternDuplicate(font->pattern);
-  XftFontClose(dpy, font);  
-  if (copy == NULL)
-    return Qnil;
-  fcpat->fcpatPtr = copy;
-  return wrap_fcpattern(fcpat);
-}
-
 DEFUN("xlfd-font-name-p", Fxlfd_font_name_p, 1, 1, 0, /*
 Check whether the string FONTNAME is a XLFD font name. */
       (fontname))
@@ -744,7 +720,7 @@
   DEFSYMBOL(Qfc_result_no_match);
   DEFSYMBOL(Qfc_result_no_id);
   DEFSYMBOL(Qfc_internal_error);
-  DEFSYMBOL(Qxft_font);
+  DEFSYMBOL(Qfont_mgr);
 
   DEFSUBR(Ffc_pattern_p);
   DEFSUBR(Ffc_pattern_create);
@@ -757,14 +733,13 @@
   DEFSUBR(Ffc_list_fonts_pattern_objects);
   DEFSUBR(Ffc_font_sort);
   DEFSUBR(Ffc_font_match);
-  DEFSUBR(Ffc_font_real_pattern);
   DEFSUBR(Fxlfd_font_name_p);
 }
 
 void
 vars_of_font_mgr (void)
 {
-  /* #### These two variables need to go somewhere else. */
+  /* #### The next two functions belong somewhere else. */
 
   /* #### I know, but the right fix is use the generic debug facility. */
   DEFVAR_INT ("xft-debug-level", &debug_xft /*
@@ -780,7 +755,7 @@
 */ );
   Vxft_version = make_int(XFT_VERSION);
 
-  Fprovide (intern ("xft"));
+  Fprovide (intern ("font-mgr"));
 }
 
 void
--- a/src/font-mgr.h	Mon Apr 24 21:51:11 2006 +0000
+++ b/src/font-mgr.h	Tue Apr 25 14:02:09 2006 +0000
@@ -48,7 +48,7 @@
 extern Fixnum debug_xft;
 
 /* Standard for fontconfig.  Use a macro to show we're not guessing. */
-#define Qxft_font_name_encoding Qutf_8
+#define Qfc_font_name_encoding Qutf_8
 
 #define XE_XLFD_MAKE_LISP_STRING(s) (make_string(s, strlen(s)))
 
--- a/src/objects-x.c	Mon Apr 24 21:51:11 2006 +0000
+++ b/src/objects-x.c	Tue Apr 25 14:02:09 2006 +0000
@@ -255,7 +255,7 @@
     DECLARE_EISTRING (eistrpxft_name);				\
     FcChar8 *name = FcNameUnparse (pattern);			\
 								\
-    eicpy_ext(eistrpxft_name, name, Qxft_font_name_encoding);	\
+    eicpy_ext(eistrpxft_name, name, Qfc_font_name_encoding);	\
     DEBUG_XFT1 (level, format, eidata(eistrpxft_name));		\
     free (name);						\
   } while (0)
@@ -267,7 +267,7 @@
 #define CHECKING_LANG(level,font,lang)					\
   do {									\
     DECLARE_EISTRING (eistrcl_name);					\
-    eicpy_ext(eistrcl_name, font, Qxft_font_name_encoding);		\
+    eicpy_ext(eistrcl_name, font, Qfc_font_name_encoding);		\
     DEBUG_XFT2 (level, "checking if %s handles %s\n",			\
 			eidata(eistrcl_name), lang);			\
   } while (0)
@@ -295,7 +295,7 @@
      The problem is that the fontconfig/Xft functions work much too hard
      to ensure that something is returned; but that something need not be
      at all close to what we asked for. */
-  LISP_STRING_TO_EXTERNAL (f->name, extname, Qxft_font_name_encoding);
+  LISP_STRING_TO_EXTERNAL (f->name, extname, Qfc_font_name_encoding);
   rf = xft_open_font_by_name (dpy, extname);
 #endif
   LISP_STRING_TO_EXTERNAL (f->name, extname, Qx_font_name_encoding);
@@ -808,7 +808,7 @@
       if (res)
 	{
 	  FONT_INSTANCE_TRUENAME (f) = 
-	    build_ext_string (res, Qxft_font_name_encoding); 
+	    build_ext_string (res, Qfc_font_name_encoding); 
 	  free (res);
 	  return FONT_INSTANCE_TRUENAME (f);
 	}
@@ -1218,7 +1218,7 @@
       DECLARE_EISTRING (eistr_longname);  /* omit FC_LANG and FC_CHARSET */
       DECLARE_EISTRING (eistr_fullname);  /* everything */
 
-      LISP_STRING_TO_EXTERNAL (font, patternext, Qxft_font_name_encoding);
+      LISP_STRING_TO_EXTERNAL (font, patternext, Qfc_font_name_encoding);
       fcc = FcConfigGetCurrent ();
 
       /* parse the name, do the substitutions, and match the font */
@@ -1251,7 +1251,7 @@
 
 	/* full name, including language coverage and repertoire */
 	name = FcNameUnparse (p);
-	eicpy_ext (eistr_fullname, name, Qxft_font_name_encoding);
+	eicpy_ext (eistr_fullname, name, Qfc_font_name_encoding);
 	free (name);
 
 	/* long name, omitting coverage and repertoire, plus a number
@@ -1268,7 +1268,7 @@
 	FcPatternDel (p, FC_SCALE);
 	FcPatternDel (p, FC_FONTVERSION);
 	name = FcNameUnparse (p);
-	eicpy_ext (eistr_longname, name, Qxft_font_name_encoding);
+	eicpy_ext (eistr_longname, name, Qfc_font_name_encoding);
 	free (name);
 
 	/* nickname, just family and size, but
@@ -1282,7 +1282,7 @@
 	FcPatternDel (p, FC_SCALABLE);
 	FcPatternDel (p, FC_DPI);
 	name = FcNameUnparse (p);
-	eicpy_ext (eistr_shortname, name, Qxft_font_name_encoding);
+	eicpy_ext (eistr_shortname, name, Qfc_font_name_encoding);
 	free (name);
 
 	FcPatternDestroy (p);
--- a/src/redisplay.c	Mon Apr 24 21:51:11 2006 +0000
+++ b/src/redisplay.c	Tue Apr 25 14:02:09 2006 +0000
@@ -470,9 +470,12 @@
    where one page is used for Emacs and another for all else. */
 int no_redraw_on_reenter;
 
-Lisp_Object Vwindow_system;	/* nil or a symbol naming the window system
+Lisp_Object Vwindow_system;	/* #### this variable is deprecated
+				   nil or a symbol naming the window system
 				   under which emacs is running
-				   (`x' is the only current possibility) */
+				   (`x', `gtk', `mswindows', and `tty' are
+				   supported -- yes, TTYs are window systems
+				   for this purpose. */
 Lisp_Object Vinitial_window_system;
 
 Lisp_Object Vglobal_mode_string;
--- a/src/symsinit.h	Mon Apr 24 21:51:11 2006 +0000
+++ b/src/symsinit.h	Tue Apr 25 14:02:09 2006 +0000
@@ -149,7 +149,7 @@
 void syms_of_menubar_x (void);
 void syms_of_minibuf (void);
 void syms_of_module (void);
-void syms_of_canna_api (void);
+EXTERN_C void syms_of_canna_api (void);
 void syms_of_mule_ccl (void);
 void syms_of_mule_charset (void);
 void syms_of_mule_coding (void);
@@ -388,7 +388,7 @@
 void reinit_vars_of_minibuf (void);
 void vars_of_module (void);
 void reinit_vars_of_module (void);
-void vars_of_canna_api (void);
+EXTERN_C void vars_of_canna_api (void);
 void vars_of_mule_ccl(void);
 void vars_of_mule_charset (void);
 void vars_of_mule_coding (void);