CVS update by aidan xemacs/src ...

xemacs-cvs at xemacs.org xemacs-cvs at xemacs.org
Sun Apr 22 15:59:09 EDT 2007


  User: aidan   
  Date: 07/04/22 21:59:09

  Modified:    xemacs/src ChangeLog faces.c
Log:
Make the X11 font menu work again, server side X11 with Mule.

Revision  Changes    Path
1.790     +26 -0     XEmacs/xemacs/lisp/ChangeLog

Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/ChangeLog,v
retrieving revision 1.789
retrieving revision 1.790
diff -u -p -r1.789 -r1.790
--- ChangeLog	2007/04/22 09:24:11	1.789
+++ ChangeLog	2007/04/22 19:58:27	1.790
@@ -1,3 +1,29 @@
+2007-01-02  Aidan Kehoe  <kehoea at parhasard.net>
+
+	* cus-face.el (custom-set-face-update-spec):
+	Fix some formatting. 
+	* faces.el (reset-face):
+	reset-face resets other faces to behave like the default face--it
+	shouldn't do anything if it's handed the default face. 
+	* font-menu.el:
+	* font-menu.el (font-menu-set-font):
+	If the font was initialised from X resources (the tag-set
+	contains 'x-resource) pretend to Custom that it has
+	responsibility for those settings.
+	* x-faces.el:
+	Add a couple of fontconfig functions to the
+	globally-declare-fboundp, to eliminate a couple of byte-compile
+	warnings. 
+	* x-faces.el ('x-resource)): New specifier tag, used to mark when
+	a face's font or other attributes have been initialised from X
+	resources. 
+	* x-faces.el (x-init-face-from-resources):
+	Use the new specifier tag; also, instead of using a fragile
+	explicit list of what would incidentally be specified for the X11
+	Unicode fonts in faces.c, pay attention to the new specifier tag
+	created in that file for the specific purpose of grouping those
+	instantiators together. 
+
 2007-04-22  Aidan Kehoe  <kehoea at parhasard.net>
 
 	* x-font-menu.el (x-reset-device-font-menus-core):



1.14      +1 -1      XEmacs/xemacs/lisp/cus-face.el

Index: cus-face.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/cus-face.el,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -p -r1.13 -r1.14
--- cus-face.el	2007/02/22 16:53:21	1.13
+++ cus-face.el	2007/04/22 19:58:32	1.14
@@ -282,7 +282,7 @@ If FRAME is nil, use the default face."
 ;;;###autoload
 (defun custom-set-face-update-spec (face display plist)
   "Customize the FACE for display types matching DISPLAY, merging
-  in the new items from PLIST."
+in the new items from PLIST."
   (let ((spec (face-spec-update-all-matching (custom-face-get-spec face)
 					     display plist)))
     (put face 'customized-face spec)



1.40      +4 -4      XEmacs/xemacs/lisp/faces.el

Index: faces.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/faces.el,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -p -r1.39 -r1.40
--- faces.el	2006/11/05 22:31:32	1.39
+++ faces.el	2007/04/22 19:58:33	1.40
@@ -398,10 +398,10 @@ operation and is not undoable.
 
 The arguments LOCALE, TAG-SET and EXACT-P are the same as for
 `remove-specifier'."
-  (mapc (lambda (x)
-	  (remove-specifier (face-property face x) locale tag-set exact-p))
-	built-in-face-specifiers)
-  nil)
+  ;; Don't reset the default face. 
+  (unless (eq 'default face)
+    (dolist (x built-in-face-specifiers nil)
+      (remove-specifier (face-property face x) locale tag-set exact-p))))
 
 (defun set-face-parent (face parent &optional locale tag-set how-to-add)
   "Set the parent of FACE to PARENT, for all properties.



1.10      +21 -2     XEmacs/xemacs/lisp/font-menu.el

Index: font-menu.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/font-menu.el,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -p -r1.9 -r1.10
--- font-menu.el	2005/11/26 11:45:54	1.9
+++ font-menu.el	2007/04/22 19:58:33	1.10
@@ -365,13 +365,32 @@ or if you change your font path, you can
 			      (/ (or size from-size)
 				 (specifier-instance font-menu-size-scaling
 						     (selected-device))))
-			     "pt"))))
+			     "pt")))
+            new-spec-list)
+        ;; If the font was initialised from X resources (the tag-set
+        ;; contains 'x-resource) pretend to Custom that it has
+        ;; responsibility for those settings.
+        (map-specifier (face-font 'default)
+                       (lambda (spec locale inst-list arg)
+                         (loop
+                           for (tag-set . inst)
+                           in inst-list
+                           do (setq tag-set (delq 'x-resource tag-set)
+                                    tag-set (delq 'custom tag-set)
+                                    tag-set (cons 'custom tag-set))
+                           (push (cons tag-set inst) new-spec-list)
+                           ;; Need to return nil, else map-specifier stops
+                           finally return nil))
+                       nil nil '(x-resource))
+        (remove-specifier (face-font 'default) nil '(x-resource))
+        (when new-spec-list
+          (add-spec-list-to-specifier (face-font 'default)
+                                      (list (cons 'global new-spec-list))))
 	(custom-set-face-update-spec 'default
 				     (list (list 'type (device-type)))
 				     (list :family (or family from-family)
 					   :size fsize))))
     (message "Font %s" (face-font-name 'default))))
-
 
 ;; #### This should be called `font-menu-maybe-change-face'
 ;; I wonder if a better API wouldn't (face attribute from to)



1.28      +34 -35    XEmacs/xemacs/lisp/x-faces.el

Index: x-faces.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/x-faces.el,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -p -r1.27 -r1.28
--- x-faces.el	2006/12/17 11:25:59	1.27
+++ x-faces.el	2007/04/22 19:58:33	1.28
@@ -74,11 +74,11 @@
      fc-font-name-slant-oblique   fc-font-name-slant-italic
      fc-font-name-slant-roman))
   (globally-declare-fboundp
-    '(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)))
+    '(fc-font-match 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-parse
+      fc-name-unparse fc-pattern-get-pixelsize)))
 
 (defconst x-font-regexp nil)
 (defconst x-font-regexp-head nil)
@@ -653,6 +653,9 @@ Otherwise, it returns the next larger ve
 ;;; state where signalling an error or entering the debugger would likely
 ;;; result in a crash.
 
+;; When we initialise a face from an X resource, note that we did so. 
+(define-specifier-tag 'x-resource)
+
 (defun x-init-face-from-resources (face &optional locale set-anyway)
 
   ;;
@@ -681,6 +684,7 @@ Otherwise, it returns the next larger ve
 	 ;; specs.
 	 (x-tag-set '(x default))
 	 (tty-tag-set '(tty default))
+         (our-tag-set '(x x-resource))
 	 (device-class nil)
 	 (face-sym (face-name face))
 	 (name (symbol-name face-sym))
@@ -738,7 +742,8 @@ Otherwise, it returns the next larger ve
     (if device-class
 	(setq tag-set (cons device-class tag-set)
 	      x-tag-set (cons device-class x-tag-set)
-	      tty-tag-set (cons device-class tty-tag-set)))
+	      tty-tag-set (cons device-class tty-tag-set)
+              our-tag-set (cons device-class our-tag-set)))
 
     ;;
     ;; If this is the default face, then any unspecified properties should
@@ -782,28 +787,22 @@ Otherwise, it returns the next larger ve
 	;; globally.  This means we should override global
 	;; defaults for all X device classes.
 	(remove-specifier (face-font face) locale x-tag-set nil))
-      (set-face-font face fn locale 'x append)
-      ;
-      ; (debug-print "the face is %s, locale %s, specifier %s"
-      ;	       face locale (face-font face))
-      ;
+      (set-face-font face fn locale our-tag-set append)
+
       ;; And retain some of the fallbacks in the generated default face,
       ;; since we don't want to try andale-mono's ISO-10646-1 encoding for
-      ;; Amharic or Thai. This is fragile; it depends on the code in
-      ;; faces.c.
-      (unless (featurep 'xft-fonts)
-        (dolist (assocked '((x encode-as-utf-8 initial)
-                            (x two-dimensional initial)
-                            (x one-dimensional final)
-                            (x two-dimensional final)))
-          (when (and (specifierp (face-font face))
-                     (consp (specifier-fallback (face-font face)))
-                     (setq assocked 
-                           (assoc assocked 
-                                  (specifier-fallback
-                                   (face-font face)))))
-            (set-face-font face (cdr assocked) locale
-                           (nreverse (car assocked)) append)))))
+      ;; Amharic or Thai.
+      (when (and (specifierp (face-font face))
+                 (consp (specifier-fallback (face-font face))))
+        (loop
+          for (tag-set . instantiator)
+          in (specifier-fallback (face-font face))
+          if (memq 'x-coverage-instantiator tag-set)
+          do (add-spec-list-to-specifier
+              (face-font face)
+              (list (cons (or locale 'global)
+                          (list (cons tag-set instantiator))))
+              append))))
 		     
     ;; Kludge-o-rooni.  Set the foreground and background resources for
     ;; X devices only -- otherwise things tend to get all messed up
@@ -814,14 +813,14 @@ Otherwise, it returns the next larger ve
 							locale
 							x-tag-set)
 	(remove-specifier (face-foreground face) locale x-tag-set nil))
-      (set-face-foreground face fg locale 'x append))
+      (set-face-foreground face fg locale our-tag-set append))
     (when bg
       (if device-class
 	  (remove-specifier-specs-matching-tag-set-cdrs (face-background face)
 							locale
 							x-tag-set)
 	(remove-specifier (face-background face) locale x-tag-set nil))
-      (set-face-background face bg locale 'x append))
+      (set-face-background face bg locale our-tag-set append))
     (when bgp
       (if device-class
 	  (remove-specifier-specs-matching-tag-set-cdrs (face-background-pixmap
@@ -829,7 +828,7 @@ Otherwise, it returns the next larger ve
 							locale
 							x-tag-set)
 	(remove-specifier (face-background-pixmap face) locale x-tag-set nil))
-      (set-face-background-pixmap face bgp locale nil append))
+      (set-face-background-pixmap face bgp locale our-tag-set append))
     (when ulp
       (if device-class
 	  (remove-specifier-specs-matching-tag-set-cdrs (face-property
@@ -838,7 +837,7 @@ Otherwise, it returns the next larger ve
 							tty-tag-set)
 	(remove-specifier (face-property face 'underline) locale
 			  tty-tag-set nil))
-      (set-face-underline-p face ulp locale nil append))
+      (set-face-underline-p face ulp locale our-tag-set append))
     (when stp
       (if device-class
 	  (remove-specifier-specs-matching-tag-set-cdrs (face-property
@@ -847,7 +846,7 @@ Otherwise, it returns the next larger ve
 							tty-tag-set)
 	(remove-specifier (face-property face 'strikethru)
 			  locale tty-tag-set nil))
-      (set-face-strikethru-p face stp locale nil append))
+      (set-face-strikethru-p face stp locale our-tag-set append))
     (when hp
       (if device-class
 	  (remove-specifier-specs-matching-tag-set-cdrs (face-property
@@ -856,7 +855,7 @@ Otherwise, it returns the next larger ve
 							tty-tag-set)
 	(remove-specifier (face-property face 'highlight)
 			  locale tty-tag-set nil))
-      (set-face-highlight-p face hp locale nil append))
+      (set-face-highlight-p face hp locale our-tag-set append))
     (when dp
       (if device-class
 	  (remove-specifier-specs-matching-tag-set-cdrs (face-property
@@ -864,7 +863,7 @@ Otherwise, it returns the next larger ve
 							locale
 							tty-tag-set)
 	(remove-specifier (face-property face 'dim) locale tty-tag-set nil))
-      (set-face-dim-p face dp locale nil append))
+      (set-face-dim-p face dp locale our-tag-set append))
     (when bp
       (if device-class
 	  (remove-specifier-specs-matching-tag-set-cdrs (face-property
@@ -873,7 +872,7 @@ Otherwise, it returns the next larger ve
 							tty-tag-set)
 	(remove-specifier (face-property face 'blinking) locale
 			  tty-tag-set nil))
-      (set-face-blinking-p face bp locale nil append))
+      (set-face-blinking-p face bp locale our-tag-set append))
     (when rp
       (if device-class
 	  (remove-specifier-specs-matching-tag-set-cdrs (face-property
@@ -882,7 +881,7 @@ Otherwise, it returns the next larger ve
 							tty-tag-set)
 	(remove-specifier (face-property face 'reverse) locale
 			  tty-tag-set nil))
-      (set-face-reverse-p face rp locale nil append))
+      (set-face-reverse-p face rp locale our-tag-set append))
     ))
 
 ;; GNU Emacs compatibility. (move to obsolete.el?)



1.1056    +9 -0      XEmacs/xemacs/src/ChangeLog

Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.1055
retrieving revision 1.1056
diff -u -p -r1.1055 -r1.1056
--- ChangeLog	2007/04/16 14:22:39	1.1055
+++ ChangeLog	2007/04/22 19:58:54	1.1056
@@ -1,3 +1,12 @@
+2007-01-02  Aidan Kehoe  <kehoea at parhasard.net>
+
+	* faces.c:
+	* faces.c (syms_of_faces):
+	* faces.c (complex_vars_of_faces):
+	New symbol and corresponding specifier tag,
+	x-coverage-instantiator, used to group those fonts used for their
+	extensive coverage for obscure characters in x-faces.el. 
+
 2007-04-16  Stephen J. Turnbull  <stephen at xemacs.org>
 
 	* redisplay-x.c (separate_textual_runs_nomule): Oops.  We agreed



1.55      +13 -4     XEmacs/xemacs/src/faces.c

Index: faces.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/faces.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -p -r1.54 -r1.55
--- faces.c	2007/01/27 17:14:22	1.54
+++ faces.c	2007/04/22 19:58:59	1.55
@@ -2011,7 +2011,7 @@ LOCALE, TAG-SET, EXACT-P, and HOW-TO-ADD
 
 #ifdef MULE
 
-Lisp_Object Qone_dimensional, Qtwo_dimensional;
+Lisp_Object Qone_dimensional, Qtwo_dimensional, Qx_coverage_instantiator;
 
 DEFUN ("specifier-tag-one-dimensional-p", 
        Fspecifier_tag_one_dimensional_p, 
@@ -2108,6 +2108,8 @@ syms_of_faces (void)
 #ifdef MULE
   DEFSYMBOL (Qone_dimensional);
   DEFSYMBOL (Qtwo_dimensional);
+  DEFSYMBOL (Qx_coverage_instantiator);
+
   /* I would much prefer these were in Lisp. */
   DEFSUBR (Fspecifier_tag_one_dimensional_p);
   DEFSUBR (Fspecifier_tag_two_dimensional_p);
@@ -2308,6 +2310,13 @@ complex_vars_of_faces (void)
 
     define_specifier_tag (Qencode_as_utf_8, Qnil,
 			  intern("specifier-tag-encode-as-utf-8-p"));
+
+    /* This tag is used to group those instantiators made available in the
+       fallback for the sake of coverage of obscure characters, notably
+       Markus Kuhn's misc-fixed fonts. They will be copied from the fallback
+       when the default face is determined from X resources at startup.  */
+    define_specifier_tag (Qx_coverage_instantiator, Qnil, Qnil);
+
 #endif /* MULE */
 
 #ifdef USE_XFT
@@ -2334,7 +2343,7 @@ complex_vars_of_faces (void)
     inst_list = 
       Fcons
       (Fcons
-       (list3(device_symbol, Qtwo_dimensional, Qfinal), 
+       (list4(device_symbol, Qtwo_dimensional, Qfinal, Qx_coverage_instantiator), 
 	build_string 
 	("-misc-fixed-medium-r-normal--15-140-75-75-c-90-iso10646-1")),
        inst_list);
@@ -2346,7 +2355,7 @@ complex_vars_of_faces (void)
     inst_list = 
       Fcons
       (Fcons
-       (list3(device_symbol, Qone_dimensional, Qfinal), 
+       (list4(device_symbol, Qone_dimensional, Qfinal, Qx_coverage_instantiator), 
 	build_string 
 	("-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1")), 
        inst_list);
@@ -2366,7 +2375,7 @@ complex_vars_of_faces (void)
     inst_list = 
       Fcons
       (Fcons
-       (list3(device_symbol, Qencode_as_utf_8, Qinitial), 
+       (list4(device_symbol, Qencode_as_utf_8, Qinitial, Qx_coverage_instantiator), 
 	build_string 
 	("-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1")), 
        inst_list);





More information about the XEmacs-CVS mailing list