aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey2005-09-17 19:00:49 +0000
committerKaroly Lorentey2005-09-17 19:00:49 +0000
commit567c887847144d9609ccfe550fd7ef178120297a (patch)
treea322ad214ee43847fcd5293f30c7cdac373baf9a /src
parent262b162ac70eb07d3b9a591acc9d5a6c8ff90177 (diff)
parent115f219da4851988a9eca58bae20257a752a7db3 (diff)
downloademacs-567c887847144d9609ccfe550fd7ef178120297a.tar.gz
emacs-567c887847144d9609ccfe550fd7ef178120297a.zip
Merged from miles@gnu.org--gnu-2005 (patch 543)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-543 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-420
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog37
-rw-r--r--src/composite.c13
-rw-r--r--src/editfns.c15
-rw-r--r--src/fileio.c8
-rw-r--r--src/keymap.c5
-rw-r--r--src/minibuf.c3
-rw-r--r--src/print.c4
-rw-r--r--src/w32.c4
-rw-r--r--src/xdisp.c12
-rw-r--r--src/xfns.c21
-rw-r--r--src/xterm.h2
11 files changed, 95 insertions, 29 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 13f8c409cde..29f3929ccd8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,40 @@
12005-09-12 Kim F. Storm <storm@cua.dk>
2
3 * composite.c (compose_chars_in_text): Fix setup of `pend'.
4 Unconditionally reload `ptr' and `pend' after eval.
5
6 * xdisp.c (message3): Pass copy of lisp string to message_dolog.
7
8 * print.c (print_error_message): Pass copy of caller name to
9 message_dolog.
10
11 * fileio.c (auto_save_error): Pass copy of lisp string to message2.
12
132005-09-12 Kenichi Handa <handa@m17n.org>
14
15 * xdisp.c (display_mode_element): Be sure to make variables THIS
16 and LISP_STRING point into a string data of ELT.
17
182005-09-12 Kim F. Storm <storm@cua.dk>
19
20 * editfns.c (Ftranslate_region_internal): Reload `tt' after
21 signal_after_change that may have GC'ed.
22 (Fmessage, Fmessage_box, Fmessage_or_box): Doc fix.
23
24 * keymap.c (Fdescribe_buffer_bindings): Reload `translate'
25 after insert while runs signal_after_change.
26
27 * minibuf.c (Fminibuffer_complete_word): Move `completion_string'
28 declaration to where it is used.
29
30 * w32.c (check_windows_init_file): Fix allocation of error buffer.
31
32 * xfns.c (x_encode_text): Declare static. Add FREEP arg.
33 (x_set_name_internal): Call x_encode_text with new FREEP arg to
34 know if xfree is needed instead of guessing.
35
36 * xterm.h (x_encode_text): Remove prototype.
37
12005-09-11 Chris Prince <cprince@gmail.com> (tiny change) 382005-09-11 Chris Prince <cprince@gmail.com> (tiny change)
2 39
3 * w32term.c (x_bitmap_icon): Load small icons too. 40 * w32term.c (x_bitmap_icon): Load small icons too.
diff --git a/src/composite.c b/src/composite.c
index daa6dceb3c6..02abb66e1e5 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -616,7 +616,7 @@ compose_chars_in_text (start, end, string)
616 GCPRO1 (string); 616 GCPRO1 (string);
617 stop = end; 617 stop = end;
618 ptr = SDATA (string) + string_char_to_byte (string, start); 618 ptr = SDATA (string) + string_char_to_byte (string, start);
619 pend = ptr + SBYTES (string); 619 pend = SDATA (string) + SBYTES (string);
620 } 620 }
621 else 621 else
622 { 622 {
@@ -680,10 +680,19 @@ compose_chars_in_text (start, end, string)
680 { 680 {
681 start += XINT (val); 681 start += XINT (val);
682 if (STRINGP (string)) 682 if (STRINGP (string))
683 ptr = SDATA (string) + string_char_to_byte (string, start); 683 {
684 ptr = SDATA (string) + string_char_to_byte (string, start);
685 pend = SDATA (string) + SBYTES (string);
686 }
684 else 687 else
685 ptr = CHAR_POS_ADDR (start); 688 ptr = CHAR_POS_ADDR (start);
686 } 689 }
690 else if (STRINGP (string))
691 {
692 start++;
693 ptr = SDATA (string) + string_char_to_byte (string, start);
694 pend = SDATA (string) + SBYTES (string);
695 }
687 else 696 else
688 { 697 {
689 start++; 698 start++;
diff --git a/src/editfns.c b/src/editfns.c
index a05d2396448..e67e56d2efa 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -2857,6 +2857,8 @@ It returns the number of characters changed. */)
2857 { 2857 {
2858 if (tt) 2858 if (tt)
2859 { 2859 {
2860 /* Reload as signal_after_change in last iteration may GC. */
2861 tt = SDATA (table);
2860 if (string_multibyte) 2862 if (string_multibyte)
2861 { 2863 {
2862 str = tt + string_char_to_byte (table, oc); 2864 str = tt + string_char_to_byte (table, oc);
@@ -3118,8 +3120,9 @@ The message also goes into the `*Messages*' buffer.
3118The first argument is a format control string, and the rest are data 3120The first argument is a format control string, and the rest are data
3119to be formatted under control of the string. See `format' for details. 3121to be formatted under control of the string. See `format' for details.
3120 3122
3121If the first argument is nil, the function clears any existing message; 3123If the first argument is nil or the empty string, the function clears
3122this lets the minibuffer contents show. See also `current-message'. 3124any existing message; this lets the minibuffer contents show. See
3125also `current-message'.
3123 3126
3124usage: (message STRING &rest ARGS) */) 3127usage: (message STRING &rest ARGS) */)
3125 (nargs, args) 3128 (nargs, args)
@@ -3148,8 +3151,8 @@ If a dialog box is not available, use the echo area.
3148The first argument is a format control string, and the rest are data 3151The first argument is a format control string, and the rest are data
3149to be formatted under control of the string. See `format' for details. 3152to be formatted under control of the string. See `format' for details.
3150 3153
3151If the first argument is nil, clear any existing message; let the 3154If the first argument is nil or the empty string, clear any existing
3152minibuffer contents show. 3155message; let the minibuffer contents show.
3153 3156
3154usage: (message-box STRING &rest ARGS) */) 3157usage: (message-box STRING &rest ARGS) */)
3155 (nargs, args) 3158 (nargs, args)
@@ -3210,8 +3213,8 @@ Otherwise, use the echo area.
3210The first argument is a format control string, and the rest are data 3213The first argument is a format control string, and the rest are data
3211to be formatted under control of the string. See `format' for details. 3214to be formatted under control of the string. See `format' for details.
3212 3215
3213If the first argument is nil, clear any existing message; let the 3216If the first argument is nil or the empty string, clear any existing
3214minibuffer contents show. 3217message; let the minibuffer contents show.
3215 3218
3216usage: (message-or-box STRING &rest ARGS) */) 3219usage: (message-or-box STRING &rest ARGS) */)
3217 (nargs, args) 3220 (nargs, args)
diff --git a/src/fileio.c b/src/fileio.c
index 53b989f52e2..56557da6a30 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -5771,6 +5771,8 @@ auto_save_error (error)
5771 Lisp_Object args[3], msg; 5771 Lisp_Object args[3], msg;
5772 int i, nbytes; 5772 int i, nbytes;
5773 struct gcpro gcpro1; 5773 struct gcpro gcpro1;
5774 char *msgbuf;
5775 USE_SAFE_ALLOCA;
5774 5776
5775 ring_bell (XFRAME (selected_frame)); 5777 ring_bell (XFRAME (selected_frame));
5776 5778
@@ -5780,13 +5782,15 @@ auto_save_error (error)
5780 msg = Fformat (3, args); 5782 msg = Fformat (3, args);
5781 GCPRO1 (msg); 5783 GCPRO1 (msg);
5782 nbytes = SBYTES (msg); 5784 nbytes = SBYTES (msg);
5785 SAFE_ALLOCA (msgbuf, char *, nbytes);
5786 bcopy (SDATA (msg), msgbuf, nbytes);
5783 5787
5784 for (i = 0; i < 3; ++i) 5788 for (i = 0; i < 3; ++i)
5785 { 5789 {
5786 if (i == 0) 5790 if (i == 0)
5787 message2 (SDATA (msg), nbytes, STRING_MULTIBYTE (msg)); 5791 message2 (msgbuf, nbytes, STRING_MULTIBYTE (msg));
5788 else 5792 else
5789 message2_nolog (SDATA (msg), nbytes, STRING_MULTIBYTE (msg)); 5793 message2_nolog (msgbuf, nbytes, STRING_MULTIBYTE (msg));
5790 Fsleep_for (make_number (1), Qnil); 5794 Fsleep_for (make_number (1), Qnil);
5791 } 5795 }
5792 5796
diff --git a/src/keymap.c b/src/keymap.c
index 9d67f4400c0..8fa4d91a9c7 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -743,7 +743,7 @@ usage: (map-keymap FUNCTION KEYMAP) */)
743 Fsignal (Qinvalid_function, Fcons (function, Qnil)); 743 Fsignal (Qinvalid_function, Fcons (function, Qnil));
744 if (! NILP (sort_first)) 744 if (! NILP (sort_first))
745 return call3 (intern ("map-keymap-internal"), function, keymap, Qt); 745 return call3 (intern ("map-keymap-internal"), function, keymap, Qt);
746 746
747 map_keymap (keymap, map_keymap_call, function, NULL, 1); 747 map_keymap (keymap, map_keymap_call, function, NULL, 1);
748 return Qnil; 748 return Qnil;
749} 749}
@@ -2837,6 +2837,9 @@ You type Translation\n\
2837 insert (buf, bufend - buf); 2837 insert (buf, bufend - buf);
2838 2838
2839 insert ("\n", 1); 2839 insert ("\n", 1);
2840
2841 /* Insert calls signal_after_change which may GC. */
2842 translate = SDATA (Vkeyboard_translate_table);
2840 } 2843 }
2841 2844
2842 insert ("\n", 1); 2845 insert ("\n", 1);
diff --git a/src/minibuf.c b/src/minibuf.c
index a66d0f8f5c8..34cadfc3e24 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -2164,7 +2164,6 @@ Return nil if there is no valid completion, else t. */)
2164{ 2164{
2165 Lisp_Object completion, tem, tem1; 2165 Lisp_Object completion, tem, tem1;
2166 register int i, i_byte; 2166 register int i, i_byte;
2167 register const unsigned char *completion_string;
2168 struct gcpro gcpro1, gcpro2; 2167 struct gcpro gcpro1, gcpro2;
2169 int prompt_end_charpos = XINT (Fminibuffer_prompt_end ()); 2168 int prompt_end_charpos = XINT (Fminibuffer_prompt_end ());
2170 2169
@@ -2295,7 +2294,7 @@ Return nil if there is no valid completion, else t. */)
2295 { 2294 {
2296 int len, c; 2295 int len, c;
2297 int bytes = SBYTES (completion); 2296 int bytes = SBYTES (completion);
2298 completion_string = SDATA (completion); 2297 register const unsigned char *completion_string = SDATA (completion);
2299 for (; i_byte < SBYTES (completion); i_byte += len, i++) 2298 for (; i_byte < SBYTES (completion); i_byte += len, i++)
2300 { 2299 {
2301 c = STRING_CHAR_AND_LENGTH (completion_string + i_byte, 2300 c = STRING_CHAR_AND_LENGTH (completion_string + i_byte,
diff --git a/src/print.c b/src/print.c
index 65c48b6d82b..2ba749aff44 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1025,7 +1025,9 @@ print_error_message (data, stream, context, caller)
1025 *Messages*. */ 1025 *Messages*. */
1026 if (!NILP (caller) && SYMBOLP (caller)) 1026 if (!NILP (caller) && SYMBOLP (caller))
1027 { 1027 {
1028 const char *name = SDATA (SYMBOL_NAME (caller)); 1028 Lisp_Object cname = SYMBOL_NAME (caller);
1029 char *name = alloca (SBYTES (cname));
1030 bcopy (SDATA (cname), name, SBYTES (cname));
1029 message_dolog (name, strlen (name), 0, 0); 1031 message_dolog (name, strlen (name), 0, 0);
1030 message_dolog (": ", 2, 0, 0); 1032 message_dolog (": ", 2, 0, 0);
1031 } 1033 }
diff --git a/src/w32.c b/src/w32.c
index c7f6e3172f9..9a51233527d 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -3894,7 +3894,9 @@ check_windows_init_file ()
3894 Lisp_Object load_path_print = Fprin1_to_string (full_load_path, Qnil); 3894 Lisp_Object load_path_print = Fprin1_to_string (full_load_path, Qnil);
3895 char *init_file_name = SDATA (init_file); 3895 char *init_file_name = SDATA (init_file);
3896 char *load_path = SDATA (load_path_print); 3896 char *load_path = SDATA (load_path_print);
3897 char *buffer = alloca (1024); 3897 char *buffer = alloca (1024
3898 + strlen (init_file_name)
3899 + strlen (load_path));
3898 3900
3899 sprintf (buffer, 3901 sprintf (buffer,
3900 "The Emacs Windows initialization file \"%s.el\" " 3902 "The Emacs Windows initialization file \"%s.el\" "
diff --git a/src/xdisp.c b/src/xdisp.c
index c8ca187f3df..031260c48ad 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -7048,7 +7048,15 @@ message3 (m, nbytes, multibyte)
7048 /* First flush out any partial line written with print. */ 7048 /* First flush out any partial line written with print. */
7049 message_log_maybe_newline (); 7049 message_log_maybe_newline ();
7050 if (STRINGP (m)) 7050 if (STRINGP (m))
7051 message_dolog (SDATA (m), nbytes, 1, multibyte); 7051 {
7052 char *buffer;
7053 USE_SAFE_ALLOCA;
7054
7055 SAFE_ALLOCA (buffer, char *, nbytes);
7056 bcopy (SDATA (m), buffer, nbytes);
7057 message_dolog (buffer, nbytes, 1, multibyte);
7058 SAFE_FREE ();
7059 }
7052 message3_nolog (m, nbytes, multibyte); 7060 message3_nolog (m, nbytes, multibyte);
7053 7061
7054 UNGCPRO; 7062 UNGCPRO;
@@ -16183,6 +16191,8 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky)
16183 else /* c == 0 */ 16191 else /* c == 0 */
16184 break; 16192 break;
16185 } 16193 }
16194 this += SDATA (elt) - lisp_string;
16195 lisp_string = SDATA (elt);
16186 } 16196 }
16187 } 16197 }
16188 break; 16198 break;
diff --git a/src/xfns.c b/src/xfns.c
index 11f4c2eadb1..84521939ec2 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1524,11 +1524,12 @@ x_set_scroll_bar_background (f, value, oldval)
1524 Otherwise store 0 in *STRINGP, which means that the `encoding' of 1524 Otherwise store 0 in *STRINGP, which means that the `encoding' of
1525 the result should be `COMPOUND_TEXT'. */ 1525 the result should be `COMPOUND_TEXT'. */
1526 1526
1527unsigned char * 1527static unsigned char *
1528x_encode_text (string, coding_system, selectionp, text_bytes, stringp) 1528x_encode_text (string, coding_system, selectionp, text_bytes, stringp, freep)
1529 Lisp_Object string, coding_system; 1529 Lisp_Object string, coding_system;
1530 int *text_bytes, *stringp; 1530 int *text_bytes, *stringp;
1531 int selectionp; 1531 int selectionp;
1532 int *freep;
1532{ 1533{
1533 unsigned char *str = SDATA (string); 1534 unsigned char *str = SDATA (string);
1534 int chars = SCHARS (string); 1535 int chars = SCHARS (string);
@@ -1545,6 +1546,7 @@ x_encode_text (string, coding_system, selectionp, text_bytes, stringp)
1545 /* No multibyte character in OBJ. We need not encode it. */ 1546 /* No multibyte character in OBJ. We need not encode it. */
1546 *text_bytes = bytes; 1547 *text_bytes = bytes;
1547 *stringp = 1; 1548 *stringp = 1;
1549 *freep = 0;
1548 return str; 1550 return str;
1549 } 1551 }
1550 1552
@@ -1572,6 +1574,7 @@ x_encode_text (string, coding_system, selectionp, text_bytes, stringp)
1572 *stringp = (charset_info == 1 1574 *stringp = (charset_info == 1
1573 || (!EQ (coding_system, Qcompound_text) 1575 || (!EQ (coding_system, Qcompound_text)
1574 && !EQ (coding_system, Qcompound_text_with_extensions))); 1576 && !EQ (coding_system, Qcompound_text_with_extensions)));
1577 *freep = 1;
1575 return buf; 1578 return buf;
1576} 1579}
1577 1580
@@ -1610,16 +1613,13 @@ x_set_name_internal (f, name)
1610 in the future which can encode all Unicode characters. 1613 in the future which can encode all Unicode characters.
1611 But, for the moment, there's no way to know that the 1614 But, for the moment, there's no way to know that the
1612 current window manager supports it or not. */ 1615 current window manager supports it or not. */
1613 text.value = x_encode_text (name, coding_system, 0, &bytes, &stringp); 1616 text.value = x_encode_text (name, coding_system, 0, &bytes, &stringp,
1617 &do_free_text_value);
1614 text.encoding = (stringp ? XA_STRING 1618 text.encoding = (stringp ? XA_STRING
1615 : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT); 1619 : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
1616 text.format = 8; 1620 text.format = 8;
1617 text.nitems = bytes; 1621 text.nitems = bytes;
1618 1622
1619 /* Check early, because ENCODE_UTF_8 below may GC and name may be
1620 relocated. */
1621 do_free_text_value = text.value != SDATA (name);
1622
1623 if (NILP (f->icon_name)) 1623 if (NILP (f->icon_name))
1624 { 1624 {
1625 icon = text; 1625 icon = text;
@@ -1628,12 +1628,11 @@ x_set_name_internal (f, name)
1628 { 1628 {
1629 /* See the above comment "Note: Encoding strategy". */ 1629 /* See the above comment "Note: Encoding strategy". */
1630 icon.value = x_encode_text (f->icon_name, coding_system, 0, 1630 icon.value = x_encode_text (f->icon_name, coding_system, 0,
1631 &bytes, &stringp); 1631 &bytes, &stringp, &do_free_icon_value);
1632 icon.encoding = (stringp ? XA_STRING 1632 icon.encoding = (stringp ? XA_STRING
1633 : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT); 1633 : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
1634 icon.format = 8; 1634 icon.format = 8;
1635 icon.nitems = bytes; 1635 icon.nitems = bytes;
1636 do_free_icon_value = icon.value != SDATA (f->icon_name);
1637 } 1636 }
1638 1637
1639#ifdef USE_GTK 1638#ifdef USE_GTK
@@ -1996,7 +1995,7 @@ xic_create_fontsetname (base_fontname, motif)
1996 - the same but with the family also replaced with -*-*-. */ 1995 - the same but with the family also replaced with -*-*-. */
1997 char *p = base_fontname; 1996 char *p = base_fontname;
1998 int i; 1997 int i;
1999 1998
2000 for (i = 0; *p; p++) 1999 for (i = 0; *p; p++)
2001 if (*p == '-') i++; 2000 if (*p == '-') i++;
2002 if (i != 14) 2001 if (i != 14)
@@ -2020,7 +2019,7 @@ xic_create_fontsetname (base_fontname, motif)
2020 char *allcs = "*-*-*-*-*-*-*"; 2019 char *allcs = "*-*-*-*-*-*-*";
2021 char *allfamilies = "-*-*-"; 2020 char *allfamilies = "-*-*-";
2022 char *all = "*-*-*-*-"; 2021 char *all = "*-*-*-*-";
2023 2022
2024 for (i = 0, p = base_fontname; i < 8; p++) 2023 for (i = 0, p = base_fontname; i < 8; p++)
2025 { 2024 {
2026 if (*p == '-') 2025 if (*p == '-')
diff --git a/src/xterm.h b/src/xterm.h
index aa615d06a17..e2db932a0be 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -1041,8 +1041,6 @@ extern void x_real_positions P_ ((struct frame *, int *, int *));
1041extern int defined_color P_ ((struct frame *, char *, XColor *, int)); 1041extern int defined_color P_ ((struct frame *, char *, XColor *, int));
1042extern void x_set_border_pixel P_ ((struct frame *, int)); 1042extern void x_set_border_pixel P_ ((struct frame *, int));
1043extern void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object)); 1043extern void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
1044extern unsigned char * x_encode_text P_ ((Lisp_Object, Lisp_Object, int,
1045 int *, int *));
1046extern void x_implicitly_set_name P_ ((struct frame *, Lisp_Object, Lisp_Object)); 1044extern void x_implicitly_set_name P_ ((struct frame *, Lisp_Object, Lisp_Object));
1047extern void xic_free_xfontset P_ ((struct frame *)); 1045extern void xic_free_xfontset P_ ((struct frame *));
1048extern void create_frame_xic P_ ((struct frame *)); 1046extern void create_frame_xic P_ ((struct frame *));