aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2010-02-05 09:28:04 -0500
committerEli Zaretskii2010-02-05 09:28:04 -0500
commit565cbcc3282217eea840141a424c692f68093f8e (patch)
tree90fc13dd8ee31a854247e835a66d4f61a21a24ee /src
parentcc2d79728f517ab4b437539826a331181102c60d (diff)
parentd9320986e56f1a3761ad8da0f77794fa9c99ef46 (diff)
downloademacs-565cbcc3282217eea840141a424c692f68093f8e.tar.gz
emacs-565cbcc3282217eea840141a424c692f68093f8e.zip
Merge from mainline.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog25
-rw-r--r--src/charset.c3
-rw-r--r--src/config.in3
-rw-r--r--src/fileio.c7
-rw-r--r--src/font.c2
-rw-r--r--src/nsterm.m85
6 files changed, 98 insertions, 27 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 795b6059a6f..f1f4aa24b35 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,28 @@
12010-02-05 Chong Yidong <cyd@stupidchicken.com>
2
3 * charset.c (load_charset_map_from_file): Allocate large
4 charset_map_entries structure on the heap rather than the stack.
5 (Bug#5526).
6
72010-01-31 Kenichi Handa <handa@m17n.org>
8
9 * font.c (font_parse_xlfd): If FONT is a font-entity and pixel
10 size in NAME is invalid, return -1 (Bug#5396).
11
122010-01-31 Chong Yidong <cyd@stupidchicken.com>
13
14 * nsterm.m (ns_defined_color): Block input. Suggested by Mike
15 <deactivated@gmail.com> (Bug#3605).
16
172010-01-31 David De La Harpe Golden <david@harpegolden.net>
18
19 * fileio.c (Frename_file): Correctly rename symlinks to
20 directories (Bug#5496).
21
222010-01-31 Filipe Cabecinhas <filcab@gmail.com> (tiny change)
23
24 * nsterm.m (ns_ring_bell): Handle visible bell like X.
25
12010-01-30 Andreas Schwab <schwab@linux-m68k.org> 262010-01-30 Andreas Schwab <schwab@linux-m68k.org>
2 27
3 * character.h (CHAR_PRINTABLE_P): Reparenthesize to avoid warning. 28 * character.h (CHAR_PRINTABLE_P): Reparenthesize to avoid warning.
diff --git a/src/charset.c b/src/charset.c
index 0f6bb4f0906..9e8ff1d59c9 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -526,7 +526,7 @@ load_charset_map_from_file (charset, mapfile, control_flag)
526 error ("Failure in loading charset map: %S", SDATA (mapfile)); 526 error ("Failure in loading charset map: %S", SDATA (mapfile));
527 527
528 head = entries = ((struct charset_map_entries *) 528 head = entries = ((struct charset_map_entries *)
529 alloca (sizeof (struct charset_map_entries))); 529 xmalloc (sizeof (struct charset_map_entries)));
530 n_entries = 0; 530 n_entries = 0;
531 eof = 0; 531 eof = 0;
532 while (1) 532 while (1)
@@ -563,6 +563,7 @@ load_charset_map_from_file (charset, mapfile, control_flag)
563 close (fd); 563 close (fd);
564 564
565 load_charset_map (charset, head, n_entries, control_flag); 565 load_charset_map (charset, head, n_entries, control_flag);
566 xfree (head);
566} 567}
567 568
568static void 569static void
diff --git a/src/config.in b/src/config.in
index fca6ac89dff..b321c586a4a 100644
--- a/src/config.in
+++ b/src/config.in
@@ -741,6 +741,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
741/* Define to 1 if you have the <utime.h> header file. */ 741/* Define to 1 if you have the <utime.h> header file. */
742#undef HAVE_UTIME_H 742#undef HAVE_UTIME_H
743 743
744/* Define to 1 if you have the <utmp.h> header file. */
745#undef HAVE_UTMP_H
746
744/* Define to 1 if you have the `vfork' function. */ 747/* Define to 1 if you have the `vfork' function. */
745#undef HAVE_VFORK 748#undef HAVE_VFORK
746 749
diff --git a/src/fileio.c b/src/fileio.c
index 72f695acb68..50f8cb14bfb 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2300,7 +2300,12 @@ This is what happens in interactive use with M-x. */)
2300 2300
2301 count = SPECPDL_INDEX (); 2301 count = SPECPDL_INDEX ();
2302 specbind (Qdelete_by_moving_to_trash, Qnil); 2302 specbind (Qdelete_by_moving_to_trash, Qnil);
2303 if (!NILP (Ffile_directory_p (file))) 2303
2304 if (!NILP (Ffile_directory_p (file))
2305#ifdef S_IFLNK
2306 && NILP (symlink_target)
2307#endif
2308 )
2304 call2 (Qdelete_directory, file, Qt); 2309 call2 (Qdelete_directory, file, Qt);
2305 else 2310 else
2306 Fdelete_file (file); 2311 Fdelete_file (file);
diff --git a/src/font.c b/src/font.c
index 557f1fbcddc..5f1d59afe22 100644
--- a/src/font.c
+++ b/src/font.c
@@ -1122,6 +1122,8 @@ font_parse_xlfd (name, font)
1122 val = INTERN_FIELD (XLFD_PIXEL_INDEX); 1122 val = INTERN_FIELD (XLFD_PIXEL_INDEX);
1123 if (INTEGERP (val)) 1123 if (INTEGERP (val))
1124 ASET (font, FONT_SIZE_INDEX, val); 1124 ASET (font, FONT_SIZE_INDEX, val);
1125 else if (FONT_ENTITY_P (font))
1126 return -1;
1125 else 1127 else
1126 { 1128 {
1127 double point_size = -1; 1129 double point_size = -1;
diff --git a/src/nsterm.m b/src/nsterm.m
index a102267920c..8f3233f9fde 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -808,23 +808,58 @@ ns_ring_bell ()
808 view = FRAME_NS_VIEW (frame); 808 view = FRAME_NS_VIEW (frame);
809 if (view != nil) 809 if (view != nil)
810 { 810 {
811 NSRect r, surr; 811 /* Get the bounds of our NSView */
812 NSPoint dim = NSMakePoint (128, 128); 812 NSRect viewBounds = [view bounds];
813 813
814 r = [view bounds]; 814 /* Height of each line to flash. */
815 r.origin.x += (r.size.width - dim.x) / 2; 815 int flash_height = FRAME_LINE_HEIGHT (frame);
816 r.origin.y += (r.size.height - dim.y) / 2; 816 int width = FRAME_PIXEL_WIDTH (frame)
817 r.size.width = dim.x; 817 - NS_SCROLL_BAR_WIDTH (frame);
818 r.size.height = dim.y; 818
819 surr = NSInsetRect (r, -2, -2); 819 /* Get the GraphicsContext */
820 ns_focus (frame, &surr, 1); 820 CGContextRef ctxt = [[NSGraphicsContext currentContext] graphicsPort];
821 [[view window] cacheImageInRect: [view convertRect: surr toView:nil]]; 821 CGRect lowerLine, upperLine;
822 [ns_lookup_indexed_color (NS_FACE_FOREGROUND 822 lowerLine =
823 (FRAME_DEFAULT_FACE (frame)), frame) set]; 823 CGRectMake(viewBounds.origin.x, viewBounds.origin.y,
824 NSRectFill (r); 824 width + NS_SCROLL_BAR_WIDTH(frame),
825 flash_height + FRAME_INTERNAL_BORDER_WIDTH (frame));
826 upperLine =
827 CGRectMake(viewBounds.origin.x,
828 viewBounds.origin.y + viewBounds.size.height
829 - (flash_height + FRAME_INTERNAL_BORDER_WIDTH (frame)),
830 width,
831 flash_height + FRAME_INTERNAL_BORDER_WIDTH (frame));
832
833 /* Invert the colors using a difference blend. */
834 CGContextSetBlendMode(ctxt, kCGBlendModeDifference);
835 CGContextSetGrayFillColor(ctxt, 1, 1);
836
837 /* If window is tall, flash top and bottom line. */
838 if (viewBounds.size.height > 3 * FRAME_LINE_HEIGHT (frame))
839 {
840 CGContextFillRect(ctxt, upperLine);
841 CGContextFillRect(ctxt, lowerLine);
842 }
843 else
844 /* If it is short, flash it all. */
845 CGContextFillRect(ctxt, NSRectToCGRect([view bounds]));
846
847 /* Bounce Dock icon. Maybe we can allow some configuration here. */
848 [NSApp requestUserAttention: NSInformationalRequest];
849
825 [[view window] flushWindow]; 850 [[view window] flushWindow];
826 ns_timeout (150000); 851 ns_timeout (150000);
827 [[view window] restoreCachedImage]; 852
853 /* If window is tall, flash top and bottom line. */
854 if (viewBounds.size.height > 3 * FRAME_LINE_HEIGHT (frame))
855 {
856 CGContextFillRect(ctxt, upperLine);
857 CGContextFillRect(ctxt, lowerLine);
858 }
859 else
860 /* If it is short, flash it all. */
861 CGContextFillRect(ctxt, NSRectToCGRect([view bounds]));
862
828 [[view window] flushWindow]; 863 [[view window] flushWindow];
829 ns_unfocus (frame); 864 ns_unfocus (frame);
830 } 865 }
@@ -1517,19 +1552,19 @@ ns_defined_color (struct frame *f, char *name, XColor *color_def, int alloc,
1517 Return 0 if not found 1552 Return 0 if not found
1518 -------------------------------------------------------------------------- */ 1553 -------------------------------------------------------------------------- */
1519{ 1554{
1520 NSColor *temp; 1555 NSColor *col;
1521 int notFound = ns_get_color (name, &temp);
1522
1523 NSTRACE (ns_defined_color); 1556 NSTRACE (ns_defined_color);
1524 1557
1525 if (notFound) 1558 BLOCK_INPUT;
1526 return 0; 1559 if (ns_get_color (name, &col) != 0) /* Color not found */
1527 1560 {
1561 UNBLOCK_INPUT;
1562 return 0;
1563 }
1528 if (makeIndex && alloc) 1564 if (makeIndex && alloc)
1529 color_def->pixel = ns_index_color(temp, f); /* [temp retain]; */ 1565 color_def->pixel = ns_index_color (col, f);
1530 1566 ns_query_color (col, color_def, !makeIndex);
1531 ns_query_color (temp, color_def, !makeIndex); 1567 UNBLOCK_INPUT;
1532
1533 return 1; 1568 return 1;
1534} 1569}
1535 1570