changeset 108406:2fe02d61c7cb

Merge from mainline.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Sun, 31 Jan 2010 11:34:12 +0000
parents ec8c8b1202c6 (current diff) efefb2cc6775 (diff)
children 955ed37b44ca
files
diffstat 5 files changed, 90 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sat Jan 30 11:24:01 2010 +0000
+++ b/src/ChangeLog	Sun Jan 31 11:34:12 2010 +0000
@@ -1,3 +1,22 @@
+2010-01-31  Kenichi Handa  <handa@m17n.org>
+
+	* font.c (font_parse_xlfd): If FONT is a font-entity and pixel
+	size in NAME is invalid, return -1 (Bug#5396).
+
+2010-01-31  Chong Yidong  <cyd@stupidchicken.com>
+
+	* nsterm.m (ns_defined_color): Block input.  Suggested by Mike
+	<deactivated@gmail.com> (Bug#3605).
+
+2010-01-31  David De La Harpe Golden  <david@harpegolden.net>
+
+	* fileio.c (Frename_file): Correctly rename symlinks to
+	directories (Bug#5496).
+
+2010-01-31  Filipe Cabecinhas  <filcab@gmail.com>  (tiny change)
+
+	* nsterm.m (ns_ring_bell): Handle visible bell like X.
+
 2010-01-30  Andreas Schwab  <schwab@linux-m68k.org>
 
 	* character.h (CHAR_PRINTABLE_P): Reparenthesize to avoid warning.
--- a/src/config.in	Sat Jan 30 11:24:01 2010 +0000
+++ b/src/config.in	Sun Jan 31 11:34:12 2010 +0000
@@ -741,6 +741,9 @@
 /* Define to 1 if you have the <utime.h> header file. */
 #undef HAVE_UTIME_H
 
+/* Define to 1 if you have the <utmp.h> header file. */
+#undef HAVE_UTMP_H
+
 /* Define to 1 if you have the `vfork' function. */
 #undef HAVE_VFORK
 
--- a/src/fileio.c	Sat Jan 30 11:24:01 2010 +0000
+++ b/src/fileio.c	Sun Jan 31 11:34:12 2010 +0000
@@ -2300,7 +2300,12 @@
 
 	  count = SPECPDL_INDEX ();
 	  specbind (Qdelete_by_moving_to_trash, Qnil);
-	  if (!NILP (Ffile_directory_p (file)))
+
+	  if (!NILP (Ffile_directory_p (file))
+#ifdef S_IFLNK
+	      && NILP (symlink_target)
+#endif
+	      )
 	    call2 (Qdelete_directory, file, Qt);
 	  else
 	    Fdelete_file (file);
--- a/src/font.c	Sat Jan 30 11:24:01 2010 +0000
+++ b/src/font.c	Sun Jan 31 11:34:12 2010 +0000
@@ -1122,6 +1122,8 @@
 	  val = INTERN_FIELD (XLFD_PIXEL_INDEX);
 	  if (INTEGERP (val))
 	    ASET (font, FONT_SIZE_INDEX, val);
+	  else if (FONT_ENTITY_P (font))
+	    return -1;
 	  else
 	    {
 	      double point_size = -1;
--- a/src/nsterm.m	Sat Jan 30 11:24:01 2010 +0000
+++ b/src/nsterm.m	Sun Jan 31 11:34:12 2010 +0000
@@ -808,23 +808,58 @@
       view = FRAME_NS_VIEW (frame);
       if (view != nil)
         {
-          NSRect r, surr;
-          NSPoint dim = NSMakePoint (128, 128);
-
-          r = [view bounds];
-          r.origin.x += (r.size.width - dim.x) / 2;
-          r.origin.y += (r.size.height - dim.y) / 2;
-          r.size.width = dim.x;
-          r.size.height = dim.y;
-          surr = NSInsetRect (r, -2, -2);
-          ns_focus (frame, &surr, 1);
-          [[view window] cacheImageInRect: [view convertRect: surr toView:nil]];
-          [ns_lookup_indexed_color (NS_FACE_FOREGROUND
-                                      (FRAME_DEFAULT_FACE (frame)), frame) set];
-          NSRectFill (r);
+          /* Get the bounds of our NSView */
+          NSRect viewBounds = [view bounds];
+
+          /* Height of each line to flash.  */
+          int flash_height = FRAME_LINE_HEIGHT (frame);
+          int width = FRAME_PIXEL_WIDTH (frame)
+                    - NS_SCROLL_BAR_WIDTH (frame);
+
+          /* Get the GraphicsContext */
+          CGContextRef ctxt = [[NSGraphicsContext currentContext] graphicsPort];
+          CGRect lowerLine, upperLine;
+          lowerLine =
+          CGRectMake(viewBounds.origin.x, viewBounds.origin.y,
+                     width + NS_SCROLL_BAR_WIDTH(frame),
+                     flash_height + FRAME_INTERNAL_BORDER_WIDTH (frame));
+          upperLine =
+          CGRectMake(viewBounds.origin.x,
+                     viewBounds.origin.y + viewBounds.size.height
+                     - (flash_height + FRAME_INTERNAL_BORDER_WIDTH (frame)),
+                     width,
+                     flash_height + FRAME_INTERNAL_BORDER_WIDTH (frame));
+
+          /* Invert the colors using a difference blend.  */
+          CGContextSetBlendMode(ctxt, kCGBlendModeDifference);
+          CGContextSetGrayFillColor(ctxt, 1, 1);
+
+          /* If window is tall, flash top and bottom line.  */
+          if (viewBounds.size.height > 3 * FRAME_LINE_HEIGHT (frame))
+            {
+              CGContextFillRect(ctxt, upperLine);
+              CGContextFillRect(ctxt, lowerLine);
+            }
+          else
+            /* If it is short, flash it all.  */
+            CGContextFillRect(ctxt, NSRectToCGRect([view bounds]));
+
+          /* Bounce Dock icon. Maybe we can allow some configuration here.  */
+          [NSApp requestUserAttention: NSInformationalRequest];
+
           [[view window] flushWindow];
           ns_timeout (150000);
-          [[view window] restoreCachedImage];
+
+          /* If window is tall, flash top and bottom line.  */
+          if (viewBounds.size.height > 3 * FRAME_LINE_HEIGHT (frame))
+            {
+              CGContextFillRect(ctxt, upperLine);
+              CGContextFillRect(ctxt, lowerLine);
+            }
+          else
+            /* If it is short, flash it all.  */
+            CGContextFillRect(ctxt, NSRectToCGRect([view bounds]));
+
           [[view window] flushWindow];
           ns_unfocus (frame);
         }
@@ -1517,19 +1552,19 @@
          Return 0 if not found
    -------------------------------------------------------------------------- */
 {
-  NSColor *temp;
-  int notFound = ns_get_color (name, &temp);
-
+  NSColor *col;
   NSTRACE (ns_defined_color);
 
-  if (notFound)
-    return 0;
-
+  BLOCK_INPUT;
+  if (ns_get_color (name, &col) != 0) /* Color not found  */
+    {
+      UNBLOCK_INPUT;
+      return 0;
+    }
   if (makeIndex && alloc)
-      color_def->pixel = ns_index_color(temp, f); /* [temp retain]; */
-
-  ns_query_color (temp, color_def, !makeIndex);
-
+    color_def->pixel = ns_index_color (col, f);
+  ns_query_color (col, color_def, !makeIndex);
+  UNBLOCK_INPUT;
   return 1;
 }