aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2010-02-20 05:25:57 -0500
committerEli Zaretskii2010-02-20 05:25:57 -0500
commitd77fbdad04a1e3f8e4fa1038508379a5f5b8e67e (patch)
treed20e47abe63806acbc519454e597ab7dc6ced017 /src
parentae9784892b7c9005b792b026d466af105bcb655f (diff)
parent0f00e9485d96c308b126553bd1b90ce4e64f1a1d (diff)
downloademacs-d77fbdad04a1e3f8e4fa1038508379a5f5b8e67e.tar.gz
emacs-d77fbdad04a1e3f8e4fa1038508379a5f5b8e67e.zip
Merge from mainline.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog33
-rw-r--r--src/callint.c2
-rw-r--r--src/ccl.c5
-rw-r--r--src/coding.c59
-rw-r--r--src/dispextern.h4
-rw-r--r--src/fileio.c5
-rw-r--r--src/nsterm.m65
-rw-r--r--src/term.c7
-rw-r--r--src/xterm.c23
9 files changed, 110 insertions, 93 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a48194a90aa..14e06fc1e28 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,7 +1,38 @@
12010-02-18 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * term.c (fatal): Add a final \n if needed (bug#5596).
4
52010-02-18 Chong Yidong <cyd@stupidchicken.com>
6
7 * nsterm.m (ns_ring_bell): Revert last change (Bug#5569).
8
92010-02-18 Glenn Morris <rgm@gnu.org>
10
11 * callint.c (Finteractive): Doc fix.
12
132010-02-18 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14
15 * coding.c (record_conversion_result):
16 Handle CODING_RESULT_INSUFFICIENT_DST.
17 (decode_coding_object): Record CODING_RESULT_INSUFFICIENT_MEM on
18 memory allocation error.
19
202010-02-17 Kenichi Handa <handa@m17n.org>
21
22 * coding.c (decode_coding_ccl): Don't setup ccl program here.
23 Fix for the case that the output buffer is fullfilled.
24 (decode_coding): Setup ccl program here. Keep looping when the
25 decoder stopped because the output buffer is
26 fullfilled (bug#5534).
27
28 * ccl.c (ccl_driver): Never reset ic to CCL_HEADER_MAIN.
29
12010-02-13 Jan Djärv <jan.h.d@swipnet.se> 302010-02-13 Jan Djärv <jan.h.d@swipnet.se>
2 31
3 * xterm.c (x_clear_frame_area): Cal gtk_widget_queue_draw if USE_GTK, 32 * xterm.c (x_clear_frame_area): Call gtk_widget_queue_draw if USE_GTK,
4 bug #5571. 33 bug #5571.
34 (XTflash): Use Gdk-routines if USE_GTK so scroll bars don't get
35 overdrawn.
5 36
62010-02-10 Jan Djärv <jan.h.d@swipnet.se> 372010-02-10 Jan Djärv <jan.h.d@swipnet.se>
7 38
diff --git a/src/callint.c b/src/callint.c
index 2c6ab983de2..a45f8a372b8 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -127,7 +127,7 @@ If the string begins with `@', Emacs searches the key sequence which
127 invoked the command for its first mouse click (or any other event 127 invoked the command for its first mouse click (or any other event
128 which specifies a window). 128 which specifies a window).
129If the string begins with `^' and `shift-select-mode' is non-nil, 129If the string begins with `^' and `shift-select-mode' is non-nil,
130 Emacs first calls the function `handle-shift-select'. 130 Emacs first calls the function `handle-shift-selection'.
131You may use `@', `*', and `^' together. They are processed in the 131You may use `@', `*', and `^' together. They are processed in the
132 order that they appear, before reading any arguments. 132 order that they appear, before reading any arguments.
133usage: (interactive &optional ARGS) */) 133usage: (interactive &optional ARGS) */)
diff --git a/src/ccl.c b/src/ccl.c
index c1c566e53c4..c5523c2d44f 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -43,7 +43,7 @@ Lisp_Object Vcode_conversion_map_vector;
43/* Alist of fontname patterns vs corresponding CCL program. */ 43/* Alist of fontname patterns vs corresponding CCL program. */
44Lisp_Object Vfont_ccl_encoder_alist; 44Lisp_Object Vfont_ccl_encoder_alist;
45 45
46/* This symbol is a property which assocates with ccl program vector. 46/* This symbol is a property which associates with ccl program vector.
47 Ex: (get 'ccl-big5-encoder 'ccl-program) returns ccl program vector. */ 47 Ex: (get 'ccl-big5-encoder 'ccl-program) returns ccl program vector. */
48Lisp_Object Qccl_program; 48Lisp_Object Qccl_program;
49 49
@@ -883,9 +883,6 @@ ccl_driver (ccl, source, destination, src_size, dst_size, charset_list)
883 int eof_ic = ccl->eof_ic; 883 int eof_ic = ccl->eof_ic;
884 int eof_hit = 0; 884 int eof_hit = 0;
885 885
886 if (ic >= eof_ic)
887 ic = CCL_HEADER_MAIN;
888
889 if (ccl->buf_magnification == 0) /* We can't read/produce any bytes. */ 886 if (ccl->buf_magnification == 0) /* We can't read/produce any bytes. */
890 dst = NULL; 887 dst = NULL;
891 888
diff --git a/src/coding.c b/src/coding.c
index 935d32e6a58..2144fe5fcd4 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -993,6 +993,11 @@ record_conversion_result (struct coding_system *coding,
993 case CODING_RESULT_INSUFFICIENT_MEM: 993 case CODING_RESULT_INSUFFICIENT_MEM:
994 Vlast_code_conversion_error = Qinsufficient_memory; 994 Vlast_code_conversion_error = Qinsufficient_memory;
995 break; 995 break;
996 case CODING_RESULT_INSUFFICIENT_DST:
997 /* Don't record this error in Vlast_code_conversion_error
998 because it happens just temporarily and is resolved when the
999 whole conversion is finished. */
1000 break;
996 case CODING_RESULT_SUCCESS: 1001 case CODING_RESULT_SUCCESS:
997 break; 1002 break;
998 default: 1003 default:
@@ -5220,18 +5225,16 @@ decode_coding_ccl (coding)
5220 int *charbuf_end = coding->charbuf + coding->charbuf_size; 5225 int *charbuf_end = coding->charbuf + coding->charbuf_size;
5221 int consumed_chars = 0; 5226 int consumed_chars = 0;
5222 int multibytep = coding->src_multibyte; 5227 int multibytep = coding->src_multibyte;
5223 struct ccl_program ccl; 5228 struct ccl_program *ccl = &coding->spec.ccl->ccl;
5224 int source_charbuf[1024]; 5229 int source_charbuf[1024];
5225 int source_byteidx[1024]; 5230 int source_byteidx[1024];
5226 Lisp_Object attrs, charset_list; 5231 Lisp_Object attrs, charset_list;
5227 5232
5228 CODING_GET_INFO (coding, attrs, charset_list); 5233 CODING_GET_INFO (coding, attrs, charset_list);
5229 setup_ccl_program (&ccl, CODING_CCL_DECODER (coding));
5230 5234
5231 while (src < src_end) 5235 while (1)
5232 { 5236 {
5233 const unsigned char *p = src; 5237 const unsigned char *p = src;
5234 int *source, *source_end;
5235 int i = 0; 5238 int i = 0;
5236 5239
5237 if (multibytep) 5240 if (multibytep)
@@ -5245,37 +5248,26 @@ decode_coding_ccl (coding)
5245 source_charbuf[i++] = *p++; 5248 source_charbuf[i++] = *p++;
5246 5249
5247 if (p == src_end && coding->mode & CODING_MODE_LAST_BLOCK) 5250 if (p == src_end && coding->mode & CODING_MODE_LAST_BLOCK)
5248 ccl.last_block = 1; 5251 ccl->last_block = 1;
5249 5252 ccl_driver (ccl, source_charbuf, charbuf, i, charbuf_end - charbuf,
5250 source = source_charbuf; 5253 charset_list);
5251 source_end = source + i; 5254 charbuf += ccl->produced;
5252 while (source < source_end) 5255 if (multibytep && ccl->consumed < i)
5253 { 5256 src += source_byteidx[ccl->consumed];
5254 ccl_driver (&ccl, source, charbuf,
5255 source_end - source, charbuf_end - charbuf,
5256 charset_list);
5257 source += ccl.consumed;
5258 charbuf += ccl.produced;
5259 if (ccl.status != CCL_STAT_SUSPEND_BY_DST)
5260 break;
5261 }
5262 if (source < source_end)
5263 src += source_byteidx[source - source_charbuf];
5264 else 5257 else
5265 src = p; 5258 src += ccl->consumed;
5266 consumed_chars += source - source_charbuf; 5259 consumed_chars += ccl->consumed;
5267 5260 if (p == src_end || ccl->status != CCL_STAT_SUSPEND_BY_SRC)
5268 if (ccl.status != CCL_STAT_SUSPEND_BY_SRC
5269 && ccl.status != CODING_RESULT_INSUFFICIENT_SRC)
5270 break; 5261 break;
5271 } 5262 }
5272 5263
5273 switch (ccl.status) 5264 switch (ccl->status)
5274 { 5265 {
5275 case CCL_STAT_SUSPEND_BY_SRC: 5266 case CCL_STAT_SUSPEND_BY_SRC:
5276 record_conversion_result (coding, CODING_RESULT_INSUFFICIENT_SRC); 5267 record_conversion_result (coding, CODING_RESULT_INSUFFICIENT_SRC);
5277 break; 5268 break;
5278 case CCL_STAT_SUSPEND_BY_DST: 5269 case CCL_STAT_SUSPEND_BY_DST:
5270 record_conversion_result (coding, CODING_RESULT_INSUFFICIENT_DST);
5279 break; 5271 break;
5280 case CCL_STAT_QUIT: 5272 case CCL_STAT_QUIT:
5281 case CCL_STAT_INVALID_CMD: 5273 case CCL_STAT_INVALID_CMD:
@@ -7117,6 +7109,7 @@ decode_coding (coding)
7117 Lisp_Object attrs; 7109 Lisp_Object attrs;
7118 Lisp_Object undo_list; 7110 Lisp_Object undo_list;
7119 Lisp_Object translation_table; 7111 Lisp_Object translation_table;
7112 struct ccl_spec cclspec;
7120 int carryover; 7113 int carryover;
7121 int i; 7114 int i;
7122 7115
@@ -7149,6 +7142,11 @@ decode_coding (coding)
7149 translation_table = get_translation_table (attrs, 0, NULL); 7142 translation_table = get_translation_table (attrs, 0, NULL);
7150 7143
7151 carryover = 0; 7144 carryover = 0;
7145 if (coding->decoder == decode_coding_ccl)
7146 {
7147 coding->spec.ccl = &cclspec;
7148 setup_ccl_program (&cclspec.ccl, CODING_CCL_DECODER (coding));
7149 }
7152 do 7150 do
7153 { 7151 {
7154 EMACS_INT pos = coding->dst_pos + coding->produced_char; 7152 EMACS_INT pos = coding->dst_pos + coding->produced_char;
@@ -7165,9 +7163,10 @@ decode_coding (coding)
7165 coding->charbuf[i] 7163 coding->charbuf[i]
7166 = coding->charbuf[coding->charbuf_used - carryover + i]; 7164 = coding->charbuf[coding->charbuf_used - carryover + i];
7167 } 7165 }
7168 while (coding->consumed < coding->src_bytes 7166 while (coding->result == CODING_RESULT_INSUFFICIENT_DST
7169 && (coding->result == CODING_RESULT_SUCCESS 7167 || (coding->consumed < coding->src_bytes
7170 || coding->result == CODING_RESULT_INVALID_SRC)); 7168 && (coding->result == CODING_RESULT_SUCCESS
7169 || coding->result == CODING_RESULT_INVALID_SRC)));
7171 7170
7172 if (carryover > 0) 7171 if (carryover > 0)
7173 { 7172 {
@@ -7871,7 +7870,7 @@ decode_coding_object (coding, src_object, from, from_byte, to, to_byte,
7871 if (! destination) 7870 if (! destination)
7872 { 7871 {
7873 record_conversion_result (coding, 7872 record_conversion_result (coding,
7874 CODING_RESULT_INSUFFICIENT_DST); 7873 CODING_RESULT_INSUFFICIENT_MEM);
7875 unbind_to (count, Qnil); 7874 unbind_to (count, Qnil);
7876 return; 7875 return;
7877 } 7876 }
diff --git a/src/dispextern.h b/src/dispextern.h
index e281fe6d925..2b581fd0eaa 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -2385,8 +2385,8 @@ struct it
2385 && ((IT)->c == '\n' \ 2385 && ((IT)->c == '\n' \
2386 || ((IT)->c == '\r' && (IT)->selective))) 2386 || ((IT)->c == '\r' && (IT)->selective)))
2387 2387
2388/* Call produce_glyphs or produce_glyphs_hook, if set. Shortcut to 2388/* Call produce_glyphs or FRAME_RIF->produce_glyphs, if set. Shortcut
2389 avoid the function call overhead. */ 2389 to avoid the function call overhead. */
2390 2390
2391#define PRODUCE_GLYPHS(IT) \ 2391#define PRODUCE_GLYPHS(IT) \
2392 do { \ 2392 do { \
diff --git a/src/fileio.c b/src/fileio.c
index 50f8cb14bfb..a80ba11bcab 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1408,8 +1408,9 @@ filesystem tree, not (expand-file-name ".." dirname). */)
1408 bugs _are_ found, it might be of interest to look at the old code and 1408 bugs _are_ found, it might be of interest to look at the old code and
1409 see what did it do in the relevant situation. 1409 see what did it do in the relevant situation.
1410 1410
1411 Don't remove this code: it's true that it will be accessible via CVS, 1411 Don't remove this code: it's true that it will be accessible
1412 but a few years from deletion, people will forget it is there. */ 1412 from the repository, but a few years from deletion, people will
1413 forget it is there. */
1413 1414
1414/* Changed this DEFUN to a DEAFUN, so as not to confuse `make-docfile'. */ 1415/* Changed this DEFUN to a DEAFUN, so as not to confuse `make-docfile'. */
1415DEAFUN ("expand-file-name", Fexpand_file_name, Sexpand_file_name, 1, 2, 0, 1416DEAFUN ("expand-file-name", Fexpand_file_name, Sexpand_file_name, 1, 2, 0,
diff --git a/src/nsterm.m b/src/nsterm.m
index 8f3233f9fde..a4d06f82d97 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -808,58 +808,23 @@ 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 /* Get the bounds of our NSView */ 811 NSRect r, surr;
812 NSRect viewBounds = [view bounds]; 812 NSPoint dim = NSMakePoint (128, 128);
813 813
814 /* Height of each line to flash. */ 814 r = [view bounds];
815 int flash_height = FRAME_LINE_HEIGHT (frame); 815 r.origin.x += (r.size.width - dim.x) / 2;
816 int width = FRAME_PIXEL_WIDTH (frame) 816 r.origin.y += (r.size.height - dim.y) / 2;
817 - NS_SCROLL_BAR_WIDTH (frame); 817 r.size.width = dim.x;
818 818 r.size.height = dim.y;
819 /* Get the GraphicsContext */ 819 surr = NSInsetRect (r, -2, -2);
820 CGContextRef ctxt = [[NSGraphicsContext currentContext] graphicsPort]; 820 ns_focus (frame, &surr, 1);
821 CGRect lowerLine, upperLine; 821 [[view window] cacheImageInRect: [view convertRect: surr toView:nil]];
822 lowerLine = 822 [ns_lookup_indexed_color (NS_FACE_FOREGROUND
823 CGRectMake(viewBounds.origin.x, viewBounds.origin.y, 823 (FRAME_DEFAULT_FACE (frame)), frame) set];
824 width + NS_SCROLL_BAR_WIDTH(frame), 824 NSRectFill (r);
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
850 [[view window] flushWindow]; 825 [[view window] flushWindow];
851 ns_timeout (150000); 826 ns_timeout (150000);
852 827 [[view window] restoreCachedImage];
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
863 [[view window] flushWindow]; 828 [[view window] flushWindow];
864 ns_unfocus (frame); 829 ns_unfocus (frame);
865 } 830 }
diff --git a/src/term.c b/src/term.c
index a90bb2a0762..dbfdf80d905 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1600,8 +1600,9 @@ append_glyph (it)
1600 and where in the glyph matrix we currently are (glyph row and hpos). 1600 and where in the glyph matrix we currently are (glyph row and hpos).
1601 produce_glyphs fills in output fields of *IT with information such as the 1601 produce_glyphs fills in output fields of *IT with information such as the
1602 pixel width and height of a character, and maybe output actual glyphs at 1602 pixel width and height of a character, and maybe output actual glyphs at
1603 the same time if IT->glyph_row is non-null. See the explanation of 1603 the same time if IT->glyph_row is non-null. For an overview, see
1604 struct display_iterator in dispextern.h for an overview. 1604 the explanation in dispextern.h, before the definition of the
1605 display_element_type enumeration.
1605 1606
1606 produce_glyphs also stores the result of glyph width, ascent 1607 produce_glyphs also stores the result of glyph width, ascent
1607 etc. computations in *IT. 1608 etc. computations in *IT.
@@ -3970,6 +3971,8 @@ fatal (const char *str, ...)
3970 va_start (ap, str); 3971 va_start (ap, str);
3971 fprintf (stderr, "emacs: "); 3972 fprintf (stderr, "emacs: ");
3972 vfprintf (stderr, str, ap); 3973 vfprintf (stderr, str, ap);
3974 if (!(strlen (str) > 0 && str[strlen (str) - 1] == '\n'))
3975 fprintf (stderr, "\n");
3973 va_end (ap); 3976 va_end (ap);
3974 fflush (stderr); 3977 fflush (stderr);
3975 exit (1); 3978 exit (1);
diff --git a/src/xterm.c b/src/xterm.c
index 9ed98deb7b5..b4a04195430 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -3015,6 +3015,21 @@ XTflash (f)
3015 BLOCK_INPUT; 3015 BLOCK_INPUT;
3016 3016
3017 { 3017 {
3018#ifdef USE_GTK
3019 /* Use Gdk routines to draw. This way, we won't draw over scroll bars
3020 when the scroll bars and the edit widget share the same X window. */
3021 GdkGCValues vals;
3022 vals.foreground.pixel = (FRAME_FOREGROUND_PIXEL (f)
3023 ^ FRAME_BACKGROUND_PIXEL (f));
3024 vals.function = GDK_XOR;
3025 GdkGC *gc = gdk_gc_new_with_values (FRAME_GTK_WIDGET (f)->window,
3026 &vals,
3027 GDK_GC_FUNCTION
3028 | GDK_GC_FOREGROUND);
3029#define XFillRectangle(d, win, gc, x, y, w, h) \
3030 gdk_draw_rectangle (FRAME_GTK_WIDGET (f)->window, \
3031 gc, TRUE, x, y, w, h)
3032#else
3018 GC gc; 3033 GC gc;
3019 3034
3020 /* Create a GC that will use the GXxor function to flip foreground 3035 /* Create a GC that will use the GXxor function to flip foreground
@@ -3029,7 +3044,7 @@ XTflash (f)
3029 gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 3044 gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
3030 GCFunction | GCForeground, &values); 3045 GCFunction | GCForeground, &values);
3031 } 3046 }
3032 3047#endif
3033 { 3048 {
3034 /* Get the height not including a menu bar widget. */ 3049 /* Get the height not including a menu bar widget. */
3035 int height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, FRAME_LINES (f)); 3050 int height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, FRAME_LINES (f));
@@ -3072,6 +3087,7 @@ XTflash (f)
3072 (height - flash_height 3087 (height - flash_height
3073 - FRAME_INTERNAL_BORDER_WIDTH (f)), 3088 - FRAME_INTERNAL_BORDER_WIDTH (f)),
3074 width, flash_height); 3089 width, flash_height);
3090
3075 } 3091 }
3076 else 3092 else
3077 /* If it is short, flash it all. */ 3093 /* If it is short, flash it all. */
@@ -3133,7 +3149,12 @@ XTflash (f)
3133 flash_left, FRAME_INTERNAL_BORDER_WIDTH (f), 3149 flash_left, FRAME_INTERNAL_BORDER_WIDTH (f),
3134 width, height - 2 * FRAME_INTERNAL_BORDER_WIDTH (f)); 3150 width, height - 2 * FRAME_INTERNAL_BORDER_WIDTH (f));
3135 3151
3152#ifdef USE_GTK
3153 g_object_unref (G_OBJECT (gc));
3154#undef XFillRectangle
3155#else
3136 XFreeGC (FRAME_X_DISPLAY (f), gc); 3156 XFreeGC (FRAME_X_DISPLAY (f), gc);
3157#endif
3137 x_flush (f); 3158 x_flush (f);
3138 } 3159 }
3139 } 3160 }