aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChong Yidong2010-11-27 15:04:57 -0500
committerChong Yidong2010-11-27 15:04:57 -0500
commit07976ae3b816dea4fd541bbba862603d3132eb2c (patch)
tree4a437b7cb3abb01fb144530a130c991882a1b7f2 /src
parent9610796712a3bc43730c99005906571a2c0bccbd (diff)
parent402c8a49571227f8a4e678d4a6cdd6ba7841aef9 (diff)
downloademacs-07976ae3b816dea4fd541bbba862603d3132eb2c.tar.gz
emacs-07976ae3b816dea4fd541bbba862603d3132eb2c.zip
Merge changes from emacs-23 branch
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog36
-rw-r--r--src/alloc.c11
-rw-r--r--src/charset.c6
-rw-r--r--src/charset.h2
-rw-r--r--src/coding.c20
-rw-r--r--src/editfns.c4
-rw-r--r--src/gtkutil.c31
-rw-r--r--src/lread.c8
8 files changed, 92 insertions, 26 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 8c98b52e6aa..b1d67c9c31f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,39 @@
12010-11-27 Kenichi Handa <handa@m17n.org>
2
3 * charset.c (emacs_mule_charset): Make it an array of charset ID;
4 i.e. integer.
5 (Fdefine_charset_internal): Adjusted for the above change.
6 (init_charset_once): Likewise.
7
8 * charset.h (emacs_mule_charset): Adjust the prototype. Delete
9 duplicated extern.
10
11 * coding.c (emacs_mule_char): Adjust for the change of
12 emacs_mule_charset.
13
14 * lread.c (read_emacs_mule_char): Adjust for the change of
15 emacs_mule_charset.
16
172010-11-27 Eli Zaretskii <eliz@gnu.org>
18
19 * w32.c (_PROCESS_MEMORY_COUNTERS_EX): Don't define with versions
20 of w32api >= 3.15. (Bug#6989) (Bug#7452)
21
222010-11-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
23
24 * alloc.c (mark_terminals): Ensure that the image cache is marked
25 even if the terminal object was marked earlier (Bug#6301).
26
272010-11-21 Chong Yidong <cyd@stupidchicken.com>
28
29 * editfns.c (Fbyte_to_string): Signal an error arg is not a byte.
30
312010-11-27 Jan Djärv <jan.h.d@swipnet.se>
32
33 * gtkutil.c (menubar_map_cb): New function (Bug#7425).
34 (xg_update_frame_menubar): Connect signal map to menubar_map_cb.
35 Use 23 as menubar height if 0. (Bug#7425).
36
12010-11-26 Eli Zaretskii <eliz@gnu.org> 372010-11-26 Eli Zaretskii <eliz@gnu.org>
2 38
3 * xdisp.c (set_message_1): Force paragraph direction in echo area 39 * xdisp.c (set_message_1): Force paragraph direction in echo area
diff --git a/src/alloc.c b/src/alloc.c
index 28636ec776c..a1c78a408d9 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -5643,13 +5643,14 @@ mark_terminals (void)
5643 for (t = terminal_list; t; t = t->next_terminal) 5643 for (t = terminal_list; t; t = t->next_terminal)
5644 { 5644 {
5645 eassert (t->name != NULL); 5645 eassert (t->name != NULL);
5646 if (!VECTOR_MARKED_P (t))
5647 {
5648#ifdef HAVE_WINDOW_SYSTEM 5646#ifdef HAVE_WINDOW_SYSTEM
5649 mark_image_cache (t->image_cache); 5647 /* If a terminal object is reachable from a stacpro'ed object,
5648 it might have been marked already. Make sure the image cache
5649 gets marked. */
5650 mark_image_cache (t->image_cache);
5650#endif /* HAVE_WINDOW_SYSTEM */ 5651#endif /* HAVE_WINDOW_SYSTEM */
5651 mark_vectorlike ((struct Lisp_Vector *)t); 5652 if (!VECTOR_MARKED_P (t))
5652 } 5653 mark_vectorlike ((struct Lisp_Vector *)t);
5653 } 5654 }
5654} 5655}
5655 5656
diff --git a/src/charset.c b/src/charset.c
index 0ab776b6914..39a376a947f 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -114,7 +114,7 @@ Lisp_Object Viso_2022_charset_list;
114/* List of emacs-mule charsets. */ 114/* List of emacs-mule charsets. */
115Lisp_Object Vemacs_mule_charset_list; 115Lisp_Object Vemacs_mule_charset_list;
116 116
117struct charset *emacs_mule_charset[256]; 117int emacs_mule_charset[256];
118 118
119/* Mapping table from ISO2022's charset (specified by DIMENSION, 119/* Mapping table from ISO2022's charset (specified by DIMENSION,
120 CHARS, and FINAL-CHAR) to Emacs' charset. */ 120 CHARS, and FINAL-CHAR) to Emacs' charset. */
@@ -1210,7 +1210,7 @@ usage: (define-charset-internal ...) */)
1210 1210
1211 if (charset.emacs_mule_id >= 0) 1211 if (charset.emacs_mule_id >= 0)
1212 { 1212 {
1213 emacs_mule_charset[charset.emacs_mule_id] = CHARSET_FROM_ID (id); 1213 emacs_mule_charset[charset.emacs_mule_id] = id;
1214 if (charset.emacs_mule_id < 0xA0) 1214 if (charset.emacs_mule_id < 0xA0)
1215 emacs_mule_bytes[charset.emacs_mule_id] = charset.dimension + 1; 1215 emacs_mule_bytes[charset.emacs_mule_id] = charset.dimension + 1;
1216 else 1216 else
@@ -2330,7 +2330,7 @@ init_charset_once (void)
2330 iso_charset_table[i][j][k] = -1; 2330 iso_charset_table[i][j][k] = -1;
2331 2331
2332 for (i = 0; i < 256; i++) 2332 for (i = 0; i < 256; i++)
2333 emacs_mule_charset[i] = NULL; 2333 emacs_mule_charset[i] = -1;
2334 2334
2335 charset_jisx0201_roman = -1; 2335 charset_jisx0201_roman = -1;
2336 charset_jisx0208_1978 = -1; 2336 charset_jisx0208_1978 = -1;
diff --git a/src/charset.h b/src/charset.h
index dbe9c776a0d..6e6422f3c73 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -255,7 +255,7 @@ extern Lisp_Object Vcharset_list;
255extern Lisp_Object Viso_2022_charset_list; 255extern Lisp_Object Viso_2022_charset_list;
256extern Lisp_Object Vemacs_mule_charset_list; 256extern Lisp_Object Vemacs_mule_charset_list;
257 257
258extern struct charset *emacs_mule_charset[256]; 258extern int emacs_mule_charset[256];
259 259
260extern Lisp_Object Vcurrent_iso639_language; 260extern Lisp_Object Vcurrent_iso639_language;
261 261
diff --git a/src/coding.c b/src/coding.c
index c834f76a65e..a7b7c7d6b23 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -2053,7 +2053,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
2053 const unsigned char *src_end = coding->source + coding->src_bytes; 2053 const unsigned char *src_end = coding->source + coding->src_bytes;
2054 const unsigned char *src_base = src; 2054 const unsigned char *src_base = src;
2055 int multibytep = coding->src_multibyte; 2055 int multibytep = coding->src_multibyte;
2056 struct charset *charset; 2056 int charset_id;
2057 unsigned code; 2057 unsigned code;
2058 int c; 2058 int c;
2059 int consumed_chars = 0; 2059 int consumed_chars = 0;
@@ -2063,7 +2063,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
2063 if (c < 0) 2063 if (c < 0)
2064 { 2064 {
2065 c = -c; 2065 c = -c;
2066 charset = emacs_mule_charset[0]; 2066 charset_id = emacs_mule_charset[0];
2067 } 2067 }
2068 else 2068 else
2069 { 2069 {
@@ -2099,7 +2099,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
2099 switch (emacs_mule_bytes[c]) 2099 switch (emacs_mule_bytes[c])
2100 { 2100 {
2101 case 2: 2101 case 2:
2102 if (! (charset = emacs_mule_charset[c])) 2102 if ((charset_id = emacs_mule_charset[c]) < 0)
2103 goto invalid_code; 2103 goto invalid_code;
2104 ONE_MORE_BYTE (c); 2104 ONE_MORE_BYTE (c);
2105 if (c < 0xA0) 2105 if (c < 0xA0)
@@ -2112,7 +2112,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
2112 || c == EMACS_MULE_LEADING_CODE_PRIVATE_12) 2112 || c == EMACS_MULE_LEADING_CODE_PRIVATE_12)
2113 { 2113 {
2114 ONE_MORE_BYTE (c); 2114 ONE_MORE_BYTE (c);
2115 if (c < 0xA0 || ! (charset = emacs_mule_charset[c])) 2115 if (c < 0xA0 || (charset_id = emacs_mule_charset[c]) < 0)
2116 goto invalid_code; 2116 goto invalid_code;
2117 ONE_MORE_BYTE (c); 2117 ONE_MORE_BYTE (c);
2118 if (c < 0xA0) 2118 if (c < 0xA0)
@@ -2121,7 +2121,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
2121 } 2121 }
2122 else 2122 else
2123 { 2123 {
2124 if (! (charset = emacs_mule_charset[c])) 2124 if ((charset_id = emacs_mule_charset[c]) < 0)
2125 goto invalid_code; 2125 goto invalid_code;
2126 ONE_MORE_BYTE (c); 2126 ONE_MORE_BYTE (c);
2127 if (c < 0xA0) 2127 if (c < 0xA0)
@@ -2136,7 +2136,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
2136 2136
2137 case 4: 2137 case 4:
2138 ONE_MORE_BYTE (c); 2138 ONE_MORE_BYTE (c);
2139 if (c < 0 || ! (charset = emacs_mule_charset[c])) 2139 if (c < 0 || (charset_id = emacs_mule_charset[c]) < 0)
2140 goto invalid_code; 2140 goto invalid_code;
2141 ONE_MORE_BYTE (c); 2141 ONE_MORE_BYTE (c);
2142 if (c < 0xA0) 2142 if (c < 0xA0)
@@ -2150,21 +2150,21 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
2150 2150
2151 case 1: 2151 case 1:
2152 code = c; 2152 code = c;
2153 charset = CHARSET_FROM_ID (ASCII_BYTE_P (code) 2153 charset_id = ASCII_BYTE_P (code) ? charset_ascii : charset_eight_bit;
2154 ? charset_ascii : charset_eight_bit);
2155 break; 2154 break;
2156 2155
2157 default: 2156 default:
2158 abort (); 2157 abort ();
2159 } 2158 }
2160 CODING_DECODE_CHAR (coding, src, src_base, src_end, charset, code, c); 2159 CODING_DECODE_CHAR (coding, src, src_base, src_end,
2160 CHARSET_FROM_ID (charset_id), code, c);
2161 if (c < 0) 2161 if (c < 0)
2162 goto invalid_code; 2162 goto invalid_code;
2163 } 2163 }
2164 *nbytes = src - src_base; 2164 *nbytes = src - src_base;
2165 *nchars = consumed_chars; 2165 *nchars = consumed_chars;
2166 if (id) 2166 if (id)
2167 *id = charset->id; 2167 *id = charset_id;
2168 return (mseq_found ? -c : c); 2168 return (mseq_found ? -c : c);
2169 2169
2170 no_more_source: 2170 no_more_source:
diff --git a/src/editfns.c b/src/editfns.c
index f76beb5e678..4a9e2314a84 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -218,11 +218,13 @@ usage: (char-to-string CHAR) */)
218} 218}
219 219
220DEFUN ("byte-to-string", Fbyte_to_string, Sbyte_to_string, 1, 1, 0, 220DEFUN ("byte-to-string", Fbyte_to_string, Sbyte_to_string, 1, 1, 0,
221 doc: /* Convert arg BYTE to a string containing that byte. */) 221 doc: /* Convert arg BYTE to a unibyte string containing that byte. */)
222 (Lisp_Object byte) 222 (Lisp_Object byte)
223{ 223{
224 unsigned char b; 224 unsigned char b;
225 CHECK_NUMBER (byte); 225 CHECK_NUMBER (byte);
226 if (XINT (byte) < 0 || XINT (byte) > 255)
227 error ("Invalid byte");
226 b = XINT (byte); 228 b = XINT (byte);
227 return make_string_from_bytes (&b, 1, 1); 229 return make_string_from_bytes (&b, 1, 1);
228} 230}
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 89b16a10fbc..b091df19905 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -3074,6 +3074,23 @@ xg_modify_menubar_widgets (GtkWidget *menubar, FRAME_PTR f, widget_value *val,
3074 gtk_widget_show_all (menubar); 3074 gtk_widget_show_all (menubar);
3075} 3075}
3076 3076
3077/* Callback called when the menu bar W is mapped.
3078 Used to find the height of the menu bar if we didn't get it
3079 after showing the widget. */
3080
3081static void
3082menubar_map_cb (GtkWidget *w, gpointer user_data)
3083{
3084 GtkRequisition req;
3085 FRAME_PTR f = (FRAME_PTR) user_data;
3086 gtk_widget_size_request (w, &req);
3087 if (FRAME_MENUBAR_HEIGHT (f) != req.height)
3088 {
3089 FRAME_MENUBAR_HEIGHT (f) = req.height;
3090 xg_height_changed (f);
3091 }
3092}
3093
3077/* Recompute all the widgets of frame F, when the menu bar has been 3094/* Recompute all the widgets of frame F, when the menu bar has been
3078 changed. Value is non-zero if widgets were updated. */ 3095 changed. Value is non-zero if widgets were updated. */
3079 3096
@@ -3095,10 +3112,20 @@ xg_update_frame_menubar (FRAME_PTR f)
3095 FALSE, FALSE, 0); 3112 FALSE, FALSE, 0);
3096 gtk_box_reorder_child (GTK_BOX (x->vbox_widget), x->menubar_widget, 0); 3113 gtk_box_reorder_child (GTK_BOX (x->vbox_widget), x->menubar_widget, 0);
3097 3114
3115 g_signal_connect (x->menubar_widget, "map", G_CALLBACK (menubar_map_cb), f);
3098 gtk_widget_show_all (x->menubar_widget); 3116 gtk_widget_show_all (x->menubar_widget);
3099 gtk_widget_size_request (x->menubar_widget, &req); 3117 gtk_widget_size_request (x->menubar_widget, &req);
3100 FRAME_MENUBAR_HEIGHT (f) = req.height; 3118
3101 xg_height_or_width_changed (f); 3119 /* If menu bar doesn't know its height yet, cheat a little so the frame
3120 doesn't jump so much when resized later in menubar_map_cb. */
3121 if (req.height == 0)
3122 req.height = 23;
3123
3124 if (FRAME_MENUBAR_HEIGHT (f) != req.height)
3125 {
3126 FRAME_MENUBAR_HEIGHT (f) = req.height;
3127 xg_height_or_width_changed (f);
3128 }
3102 UNBLOCK_INPUT; 3129 UNBLOCK_INPUT;
3103 3130
3104 return 1; 3131 return 1;
diff --git a/src/lread.c b/src/lread.c
index 18d4ba8360e..bfe3755cc51 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -582,7 +582,7 @@ read_emacs_mule_char (int c, int (*readbyte) (int, Lisp_Object), Lisp_Object rea
582 582
583 if (len == 2) 583 if (len == 2)
584 { 584 {
585 charset = emacs_mule_charset[buf[0]]; 585 charset = CHARSET_FROM_ID (emacs_mule_charset[buf[0]]);
586 code = buf[1] & 0x7F; 586 code = buf[1] & 0x7F;
587 } 587 }
588 else if (len == 3) 588 else if (len == 3)
@@ -590,18 +590,18 @@ read_emacs_mule_char (int c, int (*readbyte) (int, Lisp_Object), Lisp_Object rea
590 if (buf[0] == EMACS_MULE_LEADING_CODE_PRIVATE_11 590 if (buf[0] == EMACS_MULE_LEADING_CODE_PRIVATE_11
591 || buf[0] == EMACS_MULE_LEADING_CODE_PRIVATE_12) 591 || buf[0] == EMACS_MULE_LEADING_CODE_PRIVATE_12)
592 { 592 {
593 charset = emacs_mule_charset[buf[1]]; 593 charset = CHARSET_FROM_ID (emacs_mule_charset[buf[1]]);
594 code = buf[2] & 0x7F; 594 code = buf[2] & 0x7F;
595 } 595 }
596 else 596 else
597 { 597 {
598 charset = emacs_mule_charset[buf[0]]; 598 charset = CHARSET_FROM_ID (emacs_mule_charset[buf[0]]);
599 code = ((buf[1] << 8) | buf[2]) & 0x7F7F; 599 code = ((buf[1] << 8) | buf[2]) & 0x7F7F;
600 } 600 }
601 } 601 }
602 else 602 else
603 { 603 {
604 charset = emacs_mule_charset[buf[1]]; 604 charset = CHARSET_FROM_ID (emacs_mule_charset[buf[1]]);
605 code = ((buf[2] << 8) | buf[3]) & 0x7F7F; 605 code = ((buf[2] << 8) | buf[3]) & 0x7F7F;
606 } 606 }
607 c = DECODE_CHAR (charset, code); 607 c = DECODE_CHAR (charset, code);