# HG changeset patch # User Katsumi Yamaoka # Date 1264937652 0 # Node ID 2fe02d61c7cb34c1245935077b8fd05717b0718d # Parent ec8c8b1202c6181cf6dea57b0d5432cec7ff0743# Parent efefb2cc67750e19cec244ddde2ee46b22a7daba Merge from mainline. diff -r ec8c8b1202c6 -r 2fe02d61c7cb doc/misc/eieio.texi diff -r ec8c8b1202c6 -r 2fe02d61c7cb src/ChangeLog --- 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 + + * 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 + + * nsterm.m (ns_defined_color): Block input. Suggested by Mike + (Bug#3605). + +2010-01-31 David De La Harpe Golden + + * fileio.c (Frename_file): Correctly rename symlinks to + directories (Bug#5496). + +2010-01-31 Filipe Cabecinhas (tiny change) + + * nsterm.m (ns_ring_bell): Handle visible bell like X. + 2010-01-30 Andreas Schwab * character.h (CHAR_PRINTABLE_P): Reparenthesize to avoid warning. diff -r ec8c8b1202c6 -r 2fe02d61c7cb src/config.in --- 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 header file. */ #undef HAVE_UTIME_H +/* Define to 1 if you have the header file. */ +#undef HAVE_UTMP_H + /* Define to 1 if you have the `vfork' function. */ #undef HAVE_VFORK diff -r ec8c8b1202c6 -r 2fe02d61c7cb src/fileio.c --- 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); diff -r ec8c8b1202c6 -r 2fe02d61c7cb src/font.c --- 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; diff -r ec8c8b1202c6 -r 2fe02d61c7cb src/nsterm.m --- 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; }