changeset 106941:6132b66d6b9d

Merge from mainline.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Tue, 19 Jan 2010 22:05:33 +0000
parents 7936b8a7e05d (current diff) a38986b4badb (diff)
children d16c45d89283
files
diffstat 3 files changed, 54 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Jan 18 23:30:50 2010 +0000
+++ b/src/ChangeLog	Tue Jan 19 22:05:33 2010 +0000
@@ -1,3 +1,9 @@
+2010-01-19  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* xsettings.c (apply_xft_settings): Save settings in Vxft_settings
+	for debug purpose.
+	(syms_of_xsettings): Declare xft-settings.
+
 2010-01-18  Chong Yidong  <cyd@stupidchicken.com>
 
 	* editfns.c (Fcurrent_time_string): Doc fix (Bug#5408).
@@ -176,6 +182,13 @@
 	* dispnew.c (change_frame_size_1): newwidth == FRAME_COLS  (f) must
 	also be true before we can return early (bug #5339).
 
+2010-01-08  Alan Mackenzie  <acm@muc.de>
+
+	Fix spurious before-change-functions invocation from (insert ?\n).
+	* textprop.c (set_text_properties): rename parameter
+	`signal_after_change_p' to `coherent_change_p', and make the
+	invocation of `modify_region' conditional on it.
+
 2010-01-06  David Reitter  <david.reitter@gmail.com>
 
 	* nsfns.m (ns_get_screen): Rewrite, returning NULL for non-NS.
--- a/src/textprop.c	Mon Jan 18 23:30:50 2010 +0000
+++ b/src/textprop.c	Tue Jan 19 22:05:33 2010 +0000
@@ -1346,13 +1346,15 @@
 /* Replace properties of text from START to END with new list of
    properties PROPERTIES.  OBJECT is the buffer or string containing
    the text.  OBJECT nil means use the current buffer.
-   SIGNAL_AFTER_CHANGE_P nil means don't signal after changes.  Value
-   is nil if the function _detected_ that it did not replace any
-   properties, non-nil otherwise.  */
+   COHERENT_CHANGE_P nil means this is being called as an internal
+   subroutine, rather than as a change primitive with checking of
+   read-only, invoking change hooks, etc..  Value is nil if the
+   function _detected_ that it did not replace any properties, non-nil
+   otherwise.  */
 
 Lisp_Object
-set_text_properties (start, end, properties, object, signal_after_change_p)
-     Lisp_Object start, end, properties, object, signal_after_change_p;
+set_text_properties (start, end, properties, object, coherent_change_p)
+     Lisp_Object start, end, properties, object, coherent_change_p;
 {
   register INTERVAL i;
   Lisp_Object ostart, oend;
@@ -1397,12 +1399,12 @@
 	return Qnil;
     }
 
-  if (BUFFERP (object))
+  if (BUFFERP (object) && !NILP (coherent_change_p))
     modify_region (XBUFFER (object), XINT (start), XINT (end), 1);
 
   set_text_properties_1 (start, end, properties, object, i);
 
-  if (BUFFERP (object) && !NILP (signal_after_change_p))
+  if (BUFFERP (object) && !NILP (coherent_change_p))
     signal_after_change (XINT (start), XINT (end) - XINT (start),
 			 XINT (end) - XINT (start));
   return Qt;
--- a/src/xsettings.c	Mon Jan 18 23:30:50 2010 +0000
+++ b/src/xsettings.c	Tue Jan 19 22:05:33 2010 +0000
@@ -42,6 +42,8 @@
 static struct x_display_info *first_dpyinfo;
 static Lisp_Object Qfont_name, Qfont_render;
 static int use_system_font;
+static Lisp_Object Vxft_settings;
+
 
 #ifdef HAVE_GCONF
 static GConfClient *gconf_client;
@@ -406,12 +408,13 @@
   FcPattern *pat;
   struct xsettings settings, oldsettings;
   int changed = 0;
+  char buf[256];
 
   if (!read_xft_settings (dpyinfo, &settings))
     return;
 
   memset (&oldsettings, 0, sizeof (oldsettings));
-
+  buf[0] = '\0';
   pat = FcPatternCreate ();
   XftDefaultSubstitute (dpyinfo->display,
                         XScreenNumberOfScreen (dpyinfo->screen),
@@ -428,20 +431,30 @@
       FcPatternDel (pat, FC_ANTIALIAS);
       FcPatternAddBool (pat, FC_ANTIALIAS, settings.aa);
       ++changed;
+      oldsettings.aa = settings.aa;
     }
+  sprintf (buf, "Antialias: %d", oldsettings.aa);
+
   if ((settings.seen & SEEN_HINTING) != 0
       && oldsettings.hinting != settings.hinting)
     {
       FcPatternDel (pat, FC_HINTING);
       FcPatternAddBool (pat, FC_HINTING, settings.hinting);
       ++changed;
+      oldsettings.hinting = settings.hinting;
     }
+  if (strlen (buf) > 0) strcat (buf, ", ");
+  sprintf (buf+strlen (buf), "Hinting: %d", oldsettings.hinting);
   if ((settings.seen & SEEN_RGBA) != 0 && oldsettings.rgba != settings.rgba)
     {
       FcPatternDel (pat, FC_RGBA);
       FcPatternAddInteger (pat, FC_RGBA, settings.rgba);
+      oldsettings.rgba = settings.rgba;
       ++changed;
     }
+  if (strlen (buf) > 0) strcat (buf, ", ");
+  sprintf (buf+strlen (buf), "RGBA: %d", oldsettings.rgba);
+
   /* Older fontconfig versions don't have FC_LCD_FILTER. */
   if ((settings.seen & SEEN_LCDFILTER) != 0
       && oldsettings.lcdfilter != settings.lcdfilter)
@@ -449,14 +462,22 @@
       FcPatternDel (pat, FC_LCD_FILTER);
       FcPatternAddInteger (pat, FC_LCD_FILTER, settings.lcdfilter);
       ++changed;
+      oldsettings.lcdfilter = settings.lcdfilter;
     }
+  if (strlen (buf) > 0) strcat (buf, ", ");
+  sprintf (buf+strlen (buf), "LCDFilter: %d", oldsettings.lcdfilter);
+
   if ((settings.seen & SEEN_HINTSTYLE) != 0
       && oldsettings.hintstyle != settings.hintstyle)
     {
       FcPatternDel (pat, FC_HINT_STYLE);
       FcPatternAddInteger (pat, FC_HINT_STYLE, settings.hintstyle);
       ++changed;
+      oldsettings.hintstyle = settings.hintstyle;
     }
+  if (strlen (buf) > 0) strcat (buf, ", ");
+  sprintf (buf+strlen (buf), "Hintstyle: %d", oldsettings.hintstyle);
+
   if ((settings.seen & SEEN_DPI) != 0 && oldsettings.dpi != settings.dpi
       && settings.dpi > 0)
     {
@@ -465,7 +486,8 @@
       FcPatternDel (pat, FC_DPI);
       FcPatternAddDouble (pat, FC_DPI, settings.dpi);
       ++changed;
-
+      oldsettings.dpi = settings.dpi;
+      
       /* Change the DPI on this display and all frames on the display.  */
       dpyinfo->resy = dpyinfo->resx = settings.dpi;
       FOR_EACH_FRAME (tail, frame)
@@ -474,12 +496,16 @@
           XFRAME (frame)->resy = XFRAME (frame)->resx = settings.dpi;
     }
 
+  if (strlen (buf) > 0) strcat (buf, ", ");
+  sprintf (buf+strlen (buf), "DPI: %lf", oldsettings.dpi);
+
   if (changed)
     {
       XftDefaultSet (dpyinfo->display, pat);
       if (send_event_p)
         store_font_changed_event (Qfont_render,
                                   XCAR (dpyinfo->name_list_element));
+      Vxft_settings = make_string (buf, strlen (buf));
     }
   else
     FcPatternDestroy (pat);
@@ -638,6 +664,10 @@
     doc: /* *Non-nil means to use the system defined font.  */);
   use_system_font = 0;
 
+  DEFVAR_LISP ("xft-settings", &Vxft_settings,
+               doc: /* Font settings applied to Xft.  */);
+  Vxft_settings = make_string ("", 0);
+
 #ifdef HAVE_XFT
   Fprovide (intern_c_string ("font-render-setting"), Qnil);
 #ifdef HAVE_GCONF