diff options
| author | Miles Bader | 2005-09-19 10:20:33 +0000 |
|---|---|---|
| committer | Miles Bader | 2005-09-19 10:20:33 +0000 |
| commit | 6f512f0b53ba23b88c686d27a748797add0a89dc (patch) | |
| tree | 03b4e8c24f256dc8d90330ab1021d5ac238508d2 /src | |
| parent | ff8d296438e69b8cf701d95b6ccd271c416c46fd (diff) | |
| parent | 430d3ed772627a9a23fccdeab2b868c6c41e8365 (diff) | |
| download | emacs-6f512f0b53ba23b88c686d27a748797add0a89dc.tar.gz emacs-6f512f0b53ba23b88c686d27a748797add0a89dc.zip | |
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-82
Merge from emacs--cvs-trunk--0
Patches applied:
* emacs--cvs-trunk--0 (patch 542-553)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 116-121)
- Merge from emacs--cvs-trunk--0
- Update from CVS
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 112 | ||||
| -rw-r--r-- | src/Makefile.in | 12 | ||||
| -rw-r--r-- | src/composite.h | 1 | ||||
| -rw-r--r-- | src/data.c | 1 | ||||
| -rw-r--r-- | src/editfns.c | 15 | ||||
| -rw-r--r-- | src/emacs.c | 2 | ||||
| -rw-r--r-- | src/fileio.c | 41 | ||||
| -rw-r--r-- | src/keymap.c | 5 | ||||
| -rw-r--r-- | src/macfns.c | 6 | ||||
| -rw-r--r-- | src/print.c | 6 | ||||
| -rw-r--r-- | src/sysdep.c | 5 | ||||
| -rw-r--r-- | src/w32.c | 4 | ||||
| -rw-r--r-- | src/window.c | 32 | ||||
| -rw-r--r-- | src/window.h | 5 | ||||
| -rw-r--r-- | src/xdisp.c | 51 | ||||
| -rw-r--r-- | src/xfns.c | 21 | ||||
| -rw-r--r-- | src/xterm.h | 2 |
17 files changed, 228 insertions, 93 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 99c9d951370..31943170b94 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,115 @@ | |||
| 1 | 2005-09-18 Andreas Schwab <schwab@suse.de> | ||
| 2 | |||
| 3 | * window.h (struct window): Remove height_fixed_p, no longer set. | ||
| 4 | |||
| 5 | * window.c (make_window): Don't initialize height_fixed_p. | ||
| 6 | (window_fixed_size_p): Don't use it. | ||
| 7 | |||
| 8 | 2005-09-18 John Paul Wallington <jpw@pobox.com> | ||
| 9 | |||
| 10 | * data.c (Fdefalias): Signal an error if SYMBOL is not a symbol. | ||
| 11 | |||
| 12 | 2005-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 13 | |||
| 14 | * Makefile.in (SOME_MACHINE_OBJECTS): Undo previous change. | ||
| 15 | |||
| 16 | * macfns.c (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]: | ||
| 17 | New variables. | ||
| 18 | [TARGET_API_MAC_CARBON] (Fx_file_dialog): Don't allow multiple | ||
| 19 | file selection. | ||
| 20 | |||
| 21 | * sysdep.c [MAC_OS8]: Don't include stdlib.h. Include sys/param.h. | ||
| 22 | |||
| 23 | 2005-09-17 Eli Zaretskii <eliz@gnu.org> | ||
| 24 | |||
| 25 | * Makefile.in (XMENU_OBJ) [!HAVE_CARBON]: Reinstate variable. | ||
| 26 | (obj): Use XMENU_OBJ, not a literal xmenu.o. | ||
| 27 | |||
| 28 | 2005-09-16 Romain Francoise <romain@orebokech.com> | ||
| 29 | |||
| 30 | * fileio.c (syms_of_fileio) <write-region-inhibit-fsync>: Doc fix. | ||
| 31 | |||
| 32 | 2005-09-15 Richard M. Stallman <rms@gnu.org> | ||
| 33 | |||
| 34 | * xdisp.c (overlay_arrow_at_row): Add HAVE_WINDOW_SYSTEM conditional. | ||
| 35 | (display_mode_element): Instead of `lisp_string' and `this', | ||
| 36 | record `offset' and increment that. | ||
| 37 | `last_offset' replaces `last'. | ||
| 38 | |||
| 39 | * Makefile.in (XMENU_OBJ): Variable deleted. | ||
| 40 | (obj): Use xmenu.o unconditionally. | ||
| 41 | (SOME_MACHINE_OBJECTS): Delete xmenu.o. | ||
| 42 | |||
| 43 | * emacs.c (main): Don't conditionalize syms_of_xmenu on HAVE_XMENU. | ||
| 44 | |||
| 45 | 2005-09-15 Kim F. Storm <storm@cua.dk> | ||
| 46 | |||
| 47 | * xdisp.c (move_it_vertically): Don't try to fetch byte BEGV-1. | ||
| 48 | (reseat_at_next_visible_line_start): Likewise (in xassert). | ||
| 49 | |||
| 50 | 2005-09-14 Romain Francoise <romain@orebokech.com> | ||
| 51 | |||
| 52 | * fileio.c (write_region_inhibit_fsync): New variable. | ||
| 53 | (Fwrite_region): Use it to skip call to fsync. | ||
| 54 | (syms_of_fileio): Initialize it. | ||
| 55 | |||
| 56 | 2005-09-14 Kenichi Handa <handa@m17n.org> | ||
| 57 | |||
| 58 | * coding.c (code_convert_region_unwind): Argument format changed. | ||
| 59 | (run_pre_post_conversion_on_str): If pre-write-conversion function | ||
| 60 | changed the current buffer, delete the new buffer. | ||
| 61 | (run_pre_write_conversin_on_c_str): Likewise. | ||
| 62 | |||
| 63 | * fileio.c (Fexpand_file_name): Check multibyteness of | ||
| 64 | default_directory. | ||
| 65 | |||
| 66 | 2005-09-13 Kenichi Handa <handa@m17n.org> | ||
| 67 | |||
| 68 | * composite.c (compose_chars_in_text): Delete it. | ||
| 69 | |||
| 70 | * composite.h (compose_chars_in_text): Delete extern. | ||
| 71 | |||
| 72 | 2005-09-13 Kim F. Storm <storm@cua.dk> | ||
| 73 | |||
| 74 | * print.c (print_error_message): Fix last change. | ||
| 75 | |||
| 76 | 2005-09-12 Kim F. Storm <storm@cua.dk> | ||
| 77 | |||
| 78 | * composite.c (compose_chars_in_text): Fix setup of `pend'. | ||
| 79 | Unconditionally reload `ptr' and `pend' after eval. | ||
| 80 | |||
| 81 | * xdisp.c (message3): Pass copy of lisp string to message_dolog. | ||
| 82 | |||
| 83 | * print.c (print_error_message): Pass copy of caller name to | ||
| 84 | message_dolog. | ||
| 85 | |||
| 86 | * fileio.c (auto_save_error): Pass copy of lisp string to message2. | ||
| 87 | |||
| 88 | 2005-09-12 Kenichi Handa <handa@m17n.org> | ||
| 89 | |||
| 90 | * xdisp.c (display_mode_element): Be sure to make variables THIS | ||
| 91 | and LISP_STRING point into a string data of ELT. | ||
| 92 | |||
| 93 | 2005-09-12 Kim F. Storm <storm@cua.dk> | ||
| 94 | |||
| 95 | * editfns.c (Ftranslate_region_internal): Reload `tt' after | ||
| 96 | signal_after_change that may have GC'ed. | ||
| 97 | (Fmessage, Fmessage_box, Fmessage_or_box): Doc fix. | ||
| 98 | |||
| 99 | * keymap.c (Fdescribe_buffer_bindings): Reload `translate' | ||
| 100 | after insert while runs signal_after_change. | ||
| 101 | |||
| 102 | * minibuf.c (Fminibuffer_complete_word): Move `completion_string' | ||
| 103 | declaration to where it is used. | ||
| 104 | |||
| 105 | * w32.c (check_windows_init_file): Fix allocation of error buffer. | ||
| 106 | |||
| 107 | * xfns.c (x_encode_text): Declare static. Add FREEP arg. | ||
| 108 | (x_set_name_internal): Call x_encode_text with new FREEP arg to | ||
| 109 | know if xfree is needed instead of guessing. | ||
| 110 | |||
| 111 | * xterm.h (x_encode_text): Remove prototype. | ||
| 112 | |||
| 1 | 2005-09-11 Chris Prince <cprince@gmail.com> (tiny change) | 113 | 2005-09-11 Chris Prince <cprince@gmail.com> (tiny change) |
| 2 | 114 | ||
| 3 | * w32term.c (x_bitmap_icon): Load small icons too. | 115 | * w32term.c (x_bitmap_icon): Load small icons too. |
diff --git a/src/Makefile.in b/src/Makefile.in index dc757182d4b..6e8b8a0f0f1 100644 --- a/src/Makefile.in +++ b/src/Makefile.in | |||
| @@ -305,16 +305,17 @@ ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(TOOLKIT_DEFINES) $(MYCPPFLAGS) -I. -I${srcd | |||
| 305 | #define LIB_X11_LIB -lX11 | 305 | #define LIB_X11_LIB -lX11 |
| 306 | #endif | 306 | #endif |
| 307 | 307 | ||
| 308 | /* xmenu.c should not be compiled on OSX. */ | ||
| 309 | #ifndef HAVE_CARBON | ||
| 310 | XMENU_OBJ = xmenu.o | ||
| 311 | #endif | ||
| 312 | |||
| 308 | #ifdef HAVE_X_WINDOWS | 313 | #ifdef HAVE_X_WINDOWS |
| 309 | 314 | ||
| 310 | XOBJ= xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o | 315 | XOBJ= xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o |
| 311 | 316 | ||
| 312 | #ifdef HAVE_MENUS | 317 | #ifdef HAVE_MENUS |
| 313 | 318 | ||
| 314 | #ifndef HAVE_CARBON | ||
| 315 | XMENU_OBJ = xmenu.o | ||
| 316 | #endif | ||
| 317 | |||
| 318 | #ifdef USE_GTK | 319 | #ifdef USE_GTK |
| 319 | GTK_OBJ= gtkutil.o | 320 | GTK_OBJ= gtkutil.o |
| 320 | #endif | 321 | #endif |
| @@ -450,9 +451,6 @@ LIBX= $(LIBXMENU) $(X11_LDFLAGS) $(LIBXT) LIBTIFF LIBJPEG LIBPNG LIBGIF LIBXPM L | |||
| 450 | LIBX= $(LIBXMENU) LD_SWITCH_X_SITE -lX10 LIBX10_MACHINE LIBX10_SYSTEM | 451 | LIBX= $(LIBXMENU) LD_SWITCH_X_SITE -lX10 LIBX10_MACHINE LIBX10_SYSTEM |
| 451 | #endif /* not HAVE_X11 */ | 452 | #endif /* not HAVE_X11 */ |
| 452 | #else /* not HAVE_X_WINDOWS */ | 453 | #else /* not HAVE_X_WINDOWS */ |
| 453 | #if defined(HAVE_MENUS) && !defined(HAVE_CARBON) | ||
| 454 | XMENU_OBJ = xmenu.o | ||
| 455 | #endif | ||
| 456 | #endif /* not HAVE_X_WINDOWS */ | 454 | #endif /* not HAVE_X_WINDOWS */ |
| 457 | 455 | ||
| 458 | LIBSOUND= @LIBSOUND@ | 456 | LIBSOUND= @LIBSOUND@ |
diff --git a/src/composite.h b/src/composite.h index fe931a579ae..37a75c8a80b 100644 --- a/src/composite.h +++ b/src/composite.h | |||
| @@ -221,7 +221,6 @@ extern void compose_region P_ ((int, int, Lisp_Object, Lisp_Object, | |||
| 221 | extern void syms_of_composite P_ ((void)); | 221 | extern void syms_of_composite P_ ((void)); |
| 222 | extern void compose_text P_ ((int, int, Lisp_Object, Lisp_Object, | 222 | extern void compose_text P_ ((int, int, Lisp_Object, Lisp_Object, |
| 223 | Lisp_Object)); | 223 | Lisp_Object)); |
| 224 | extern void compose_chars_in_text P_ ((int, int, Lisp_Object)); | ||
| 225 | 224 | ||
| 226 | #endif /* not EMACS_COMPOSITE_H */ | 225 | #endif /* not EMACS_COMPOSITE_H */ |
| 227 | 226 | ||
diff --git a/src/data.c b/src/data.c index c1545d0169f..5e83f018001 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -719,6 +719,7 @@ determined by DEFINITION. */) | |||
| 719 | (symbol, definition, docstring) | 719 | (symbol, definition, docstring) |
| 720 | register Lisp_Object symbol, definition, docstring; | 720 | register Lisp_Object symbol, definition, docstring; |
| 721 | { | 721 | { |
| 722 | CHECK_SYMBOL (symbol); | ||
| 722 | if (CONSP (XSYMBOL (symbol)->function) | 723 | if (CONSP (XSYMBOL (symbol)->function) |
| 723 | && EQ (XCAR (XSYMBOL (symbol)->function), Qautoload)) | 724 | && EQ (XCAR (XSYMBOL (symbol)->function), Qautoload)) |
| 724 | LOADHIST_ATTACH (Fcons (Qt, symbol)); | 725 | LOADHIST_ATTACH (Fcons (Qt, symbol)); |
diff --git a/src/editfns.c b/src/editfns.c index 8a61a7a1033..dfb6f865dfb 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -2943,6 +2943,8 @@ It returns the number of characters changed. */) | |||
| 2943 | { | 2943 | { |
| 2944 | if (tt) | 2944 | if (tt) |
| 2945 | { | 2945 | { |
| 2946 | /* Reload as signal_after_change in last iteration may GC. */ | ||
| 2947 | tt = SDATA (table); | ||
| 2946 | if (string_multibyte) | 2948 | if (string_multibyte) |
| 2947 | { | 2949 | { |
| 2948 | str = tt + string_char_to_byte (table, oc); | 2950 | str = tt + string_char_to_byte (table, oc); |
| @@ -3250,8 +3252,9 @@ The message also goes into the `*Messages*' buffer. | |||
| 3250 | The first argument is a format control string, and the rest are data | 3252 | The first argument is a format control string, and the rest are data |
| 3251 | to be formatted under control of the string. See `format' for details. | 3253 | to be formatted under control of the string. See `format' for details. |
| 3252 | 3254 | ||
| 3253 | If the first argument is nil, the function clears any existing message; | 3255 | If the first argument is nil or the empty string, the function clears |
| 3254 | this lets the minibuffer contents show. See also `current-message'. | 3256 | any existing message; this lets the minibuffer contents show. See |
| 3257 | also `current-message'. | ||
| 3255 | 3258 | ||
| 3256 | usage: (message STRING &rest ARGS) */) | 3259 | usage: (message STRING &rest ARGS) */) |
| 3257 | (nargs, args) | 3260 | (nargs, args) |
| @@ -3280,8 +3283,8 @@ If a dialog box is not available, use the echo area. | |||
| 3280 | The first argument is a format control string, and the rest are data | 3283 | The first argument is a format control string, and the rest are data |
| 3281 | to be formatted under control of the string. See `format' for details. | 3284 | to be formatted under control of the string. See `format' for details. |
| 3282 | 3285 | ||
| 3283 | If the first argument is nil, clear any existing message; let the | 3286 | If the first argument is nil or the empty string, clear any existing |
| 3284 | minibuffer contents show. | 3287 | message; let the minibuffer contents show. |
| 3285 | 3288 | ||
| 3286 | usage: (message-box STRING &rest ARGS) */) | 3289 | usage: (message-box STRING &rest ARGS) */) |
| 3287 | (nargs, args) | 3290 | (nargs, args) |
| @@ -3342,8 +3345,8 @@ Otherwise, use the echo area. | |||
| 3342 | The first argument is a format control string, and the rest are data | 3345 | The first argument is a format control string, and the rest are data |
| 3343 | to be formatted under control of the string. See `format' for details. | 3346 | to be formatted under control of the string. See `format' for details. |
| 3344 | 3347 | ||
| 3345 | If the first argument is nil, clear any existing message; let the | 3348 | If the first argument is nil or the empty string, clear any existing |
| 3346 | minibuffer contents show. | 3349 | message; let the minibuffer contents show. |
| 3347 | 3350 | ||
| 3348 | usage: (message-or-box STRING &rest ARGS) */) | 3351 | usage: (message-or-box STRING &rest ARGS) */) |
| 3349 | (nargs, args) | 3352 | (nargs, args) |
diff --git a/src/emacs.c b/src/emacs.c index 54e33f810ca..c74e729bf6a 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -1630,14 +1630,12 @@ main (argc, argv | |||
| 1630 | #endif | 1630 | #endif |
| 1631 | #endif /* HAVE_X_WINDOWS */ | 1631 | #endif /* HAVE_X_WINDOWS */ |
| 1632 | 1632 | ||
| 1633 | #ifdef HAVE_MENUS | ||
| 1634 | #ifndef HAVE_NTGUI | 1633 | #ifndef HAVE_NTGUI |
| 1635 | #ifndef MAC_OS | 1634 | #ifndef MAC_OS |
| 1636 | /* Called before init_window_once for Mac OS Classic. */ | 1635 | /* Called before init_window_once for Mac OS Classic. */ |
| 1637 | syms_of_xmenu (); | 1636 | syms_of_xmenu (); |
| 1638 | #endif | 1637 | #endif |
| 1639 | #endif | 1638 | #endif |
| 1640 | #endif | ||
| 1641 | 1639 | ||
| 1642 | #ifdef HAVE_NTGUI | 1640 | #ifdef HAVE_NTGUI |
| 1643 | syms_of_w32term (); | 1641 | syms_of_w32term (); |
diff --git a/src/fileio.c b/src/fileio.c index ff600a03a31..16eb0475a2b 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -225,6 +225,11 @@ int vms_stmlf_recfm; | |||
| 225 | expanding file names. This can be bound to / or \. */ | 225 | expanding file names. This can be bound to / or \. */ |
| 226 | Lisp_Object Vdirectory_sep_char; | 226 | Lisp_Object Vdirectory_sep_char; |
| 227 | 227 | ||
| 228 | #ifdef HAVE_FSYNC | ||
| 229 | /* Nonzero means skip the call to fsync in Fwrite-region. */ | ||
| 230 | int write_region_inhibit_fsync; | ||
| 231 | #endif | ||
| 232 | |||
| 228 | extern Lisp_Object Vuser_login_name; | 233 | extern Lisp_Object Vuser_login_name; |
| 229 | 234 | ||
| 230 | #ifdef WINDOWSNT | 235 | #ifdef WINDOWSNT |
| @@ -1060,6 +1065,7 @@ See also the function `substitute-in-file-name'. */) | |||
| 1060 | #endif /* DOS_NT */ | 1065 | #endif /* DOS_NT */ |
| 1061 | int length; | 1066 | int length; |
| 1062 | Lisp_Object handler, result; | 1067 | Lisp_Object handler, result; |
| 1068 | int multibyte; | ||
| 1063 | 1069 | ||
| 1064 | CHECK_STRING (name); | 1070 | CHECK_STRING (name); |
| 1065 | 1071 | ||
| @@ -1137,6 +1143,7 @@ See also the function `substitute-in-file-name'. */) | |||
| 1137 | 1143 | ||
| 1138 | name = FILE_SYSTEM_CASE (name); | 1144 | name = FILE_SYSTEM_CASE (name); |
| 1139 | nm = SDATA (name); | 1145 | nm = SDATA (name); |
| 1146 | multibyte = STRING_MULTIBYTE (name); | ||
| 1140 | 1147 | ||
| 1141 | #ifdef DOS_NT | 1148 | #ifdef DOS_NT |
| 1142 | /* We will force directory separators to be either all \ or /, so make | 1149 | /* We will force directory separators to be either all \ or /, so make |
| @@ -1302,8 +1309,7 @@ See also the function `substitute-in-file-name'. */) | |||
| 1302 | if (index (nm, '/')) | 1309 | if (index (nm, '/')) |
| 1303 | { | 1310 | { |
| 1304 | nm = sys_translate_unix (nm); | 1311 | nm = sys_translate_unix (nm); |
| 1305 | return make_specified_string (nm, -1, strlen (nm), | 1312 | return make_specified_string (nm, -1, strlen (nm), multibyte); |
| 1306 | STRING_MULTIBYTE (name)); | ||
| 1307 | } | 1313 | } |
| 1308 | #endif /* VMS */ | 1314 | #endif /* VMS */ |
| 1309 | #ifdef DOS_NT | 1315 | #ifdef DOS_NT |
| @@ -1315,8 +1321,7 @@ See also the function `substitute-in-file-name'. */) | |||
| 1315 | if (IS_DIRECTORY_SEP (nm[1])) | 1321 | if (IS_DIRECTORY_SEP (nm[1])) |
| 1316 | { | 1322 | { |
| 1317 | if (strcmp (nm, SDATA (name)) != 0) | 1323 | if (strcmp (nm, SDATA (name)) != 0) |
| 1318 | name = make_specified_string (nm, -1, strlen (nm), | 1324 | name = make_specified_string (nm, -1, strlen (nm), multibyte); |
| 1319 | STRING_MULTIBYTE (name)); | ||
| 1320 | } | 1325 | } |
| 1321 | else | 1326 | else |
| 1322 | #endif | 1327 | #endif |
| @@ -1325,8 +1330,7 @@ See also the function `substitute-in-file-name'. */) | |||
| 1325 | { | 1330 | { |
| 1326 | char temp[] = " :"; | 1331 | char temp[] = " :"; |
| 1327 | 1332 | ||
| 1328 | name = make_specified_string (nm, -1, p - nm, | 1333 | name = make_specified_string (nm, -1, p - nm, multibyte); |
| 1329 | STRING_MULTIBYTE (name)); | ||
| 1330 | temp[0] = DRIVE_LETTER (drive); | 1334 | temp[0] = DRIVE_LETTER (drive); |
| 1331 | name = concat2 (build_string (temp), name); | 1335 | name = concat2 (build_string (temp), name); |
| 1332 | } | 1336 | } |
| @@ -1334,8 +1338,7 @@ See also the function `substitute-in-file-name'. */) | |||
| 1334 | #else /* not DOS_NT */ | 1338 | #else /* not DOS_NT */ |
| 1335 | if (nm == SDATA (name)) | 1339 | if (nm == SDATA (name)) |
| 1336 | return name; | 1340 | return name; |
| 1337 | return make_specified_string (nm, -1, strlen (nm), | 1341 | return make_specified_string (nm, -1, strlen (nm), multibyte); |
| 1338 | STRING_MULTIBYTE (name)); | ||
| 1339 | #endif /* not DOS_NT */ | 1342 | #endif /* not DOS_NT */ |
| 1340 | } | 1343 | } |
| 1341 | } | 1344 | } |
| @@ -1447,6 +1450,7 @@ See also the function `substitute-in-file-name'. */) | |||
| 1447 | && !newdir) | 1450 | && !newdir) |
| 1448 | { | 1451 | { |
| 1449 | newdir = SDATA (default_directory); | 1452 | newdir = SDATA (default_directory); |
| 1453 | multibyte |= STRING_MULTIBYTE (default_directory); | ||
| 1450 | #ifdef DOS_NT | 1454 | #ifdef DOS_NT |
| 1451 | /* Note if special escape prefix is present, but remove for now. */ | 1455 | /* Note if special escape prefix is present, but remove for now. */ |
| 1452 | if (newdir[0] == '/' && newdir[1] == ':') | 1456 | if (newdir[0] == '/' && newdir[1] == ':') |
| @@ -1712,8 +1716,7 @@ See also the function `substitute-in-file-name'. */) | |||
| 1712 | CORRECT_DIR_SEPS (target); | 1716 | CORRECT_DIR_SEPS (target); |
| 1713 | #endif /* DOS_NT */ | 1717 | #endif /* DOS_NT */ |
| 1714 | 1718 | ||
| 1715 | result = make_specified_string (target, -1, o - target, | 1719 | result = make_specified_string (target, -1, o - target, multibyte); |
| 1716 | STRING_MULTIBYTE (name)); | ||
| 1717 | 1720 | ||
| 1718 | /* Again look to see if the file name has special constructs in it | 1721 | /* Again look to see if the file name has special constructs in it |
| 1719 | and perhaps call the corresponding file handler. This is needed | 1722 | and perhaps call the corresponding file handler. This is needed |
| @@ -5242,7 +5245,7 @@ This does code conversion according to the value of | |||
| 5242 | Disk full in NFS may be reported here. */ | 5245 | Disk full in NFS may be reported here. */ |
| 5243 | /* mib says that closing the file will try to write as fast as NFS can do | 5246 | /* mib says that closing the file will try to write as fast as NFS can do |
| 5244 | it, and that means the fsync here is not crucial for autosave files. */ | 5247 | it, and that means the fsync here is not crucial for autosave files. */ |
| 5245 | if (!auto_saving && fsync (desc) < 0) | 5248 | if (!auto_saving && !write_region_inhibit_fsync && fsync (desc) < 0) |
| 5246 | { | 5249 | { |
| 5247 | /* If fsync fails with EINTR, don't treat that as serious. */ | 5250 | /* If fsync fails with EINTR, don't treat that as serious. */ |
| 5248 | if (errno != EINTR) | 5251 | if (errno != EINTR) |
| @@ -5685,6 +5688,8 @@ auto_save_error (error) | |||
| 5685 | Lisp_Object args[3], msg; | 5688 | Lisp_Object args[3], msg; |
| 5686 | int i, nbytes; | 5689 | int i, nbytes; |
| 5687 | struct gcpro gcpro1; | 5690 | struct gcpro gcpro1; |
| 5691 | char *msgbuf; | ||
| 5692 | USE_SAFE_ALLOCA; | ||
| 5688 | 5693 | ||
| 5689 | ring_bell (); | 5694 | ring_bell (); |
| 5690 | 5695 | ||
| @@ -5694,13 +5699,15 @@ auto_save_error (error) | |||
| 5694 | msg = Fformat (3, args); | 5699 | msg = Fformat (3, args); |
| 5695 | GCPRO1 (msg); | 5700 | GCPRO1 (msg); |
| 5696 | nbytes = SBYTES (msg); | 5701 | nbytes = SBYTES (msg); |
| 5702 | SAFE_ALLOCA (msgbuf, char *, nbytes); | ||
| 5703 | bcopy (SDATA (msg), msgbuf, nbytes); | ||
| 5697 | 5704 | ||
| 5698 | for (i = 0; i < 3; ++i) | 5705 | for (i = 0; i < 3; ++i) |
| 5699 | { | 5706 | { |
| 5700 | if (i == 0) | 5707 | if (i == 0) |
| 5701 | message2 (SDATA (msg), nbytes, STRING_MULTIBYTE (msg)); | 5708 | message2 (msgbuf, nbytes, STRING_MULTIBYTE (msg)); |
| 5702 | else | 5709 | else |
| 5703 | message2_nolog (SDATA (msg), nbytes, STRING_MULTIBYTE (msg)); | 5710 | message2_nolog (msgbuf, nbytes, STRING_MULTIBYTE (msg)); |
| 5704 | Fsleep_for (make_number (1), Qnil); | 5711 | Fsleep_for (make_number (1), Qnil); |
| 5705 | } | 5712 | } |
| 5706 | 5713 | ||
| @@ -6656,6 +6663,14 @@ shortly after Emacs reads your `.emacs' file, if you have not yet given it | |||
| 6656 | a non-nil value. */); | 6663 | a non-nil value. */); |
| 6657 | Vauto_save_list_file_name = Qnil; | 6664 | Vauto_save_list_file_name = Qnil; |
| 6658 | 6665 | ||
| 6666 | #ifdef HAVE_FSYNC | ||
| 6667 | DEFVAR_BOOL ("write-region-inhibit-fsync", &write_region_inhibit_fsync, | ||
| 6668 | doc: /* *Non-nil means don't call fsync in `write-region'. | ||
| 6669 | This variable affects calls to `write-region' as well as save commands. | ||
| 6670 | A non-nil value may result in data loss! */); | ||
| 6671 | write_region_inhibit_fsync = 0; | ||
| 6672 | #endif | ||
| 6673 | |||
| 6659 | defsubr (&Sfind_file_name_handler); | 6674 | defsubr (&Sfind_file_name_handler); |
| 6660 | defsubr (&Sfile_name_directory); | 6675 | defsubr (&Sfile_name_directory); |
| 6661 | defsubr (&Sfile_name_nondirectory); | 6676 | defsubr (&Sfile_name_nondirectory); |
diff --git a/src/keymap.c b/src/keymap.c index 813030fe728..271b0672b1e 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -725,7 +725,7 @@ usage: (map-keymap FUNCTION KEYMAP) */) | |||
| 725 | Fsignal (Qinvalid_function, Fcons (function, Qnil)); | 725 | Fsignal (Qinvalid_function, Fcons (function, Qnil)); |
| 726 | if (! NILP (sort_first)) | 726 | if (! NILP (sort_first)) |
| 727 | return call3 (intern ("map-keymap-internal"), function, keymap, Qt); | 727 | return call3 (intern ("map-keymap-internal"), function, keymap, Qt); |
| 728 | 728 | ||
| 729 | map_keymap (keymap, map_keymap_call, function, NULL, 1); | 729 | map_keymap (keymap, map_keymap_call, function, NULL, 1); |
| 730 | return Qnil; | 730 | return Qnil; |
| 731 | } | 731 | } |
| @@ -2863,6 +2863,9 @@ You type Translation\n\ | |||
| 2863 | insert (buf, bufend - buf); | 2863 | insert (buf, bufend - buf); |
| 2864 | 2864 | ||
| 2865 | insert ("\n", 1); | 2865 | insert ("\n", 1); |
| 2866 | |||
| 2867 | /* Insert calls signal_after_change which may GC. */ | ||
| 2868 | translate = SDATA (Vkeyboard_translate_table); | ||
| 2866 | } | 2869 | } |
| 2867 | 2870 | ||
| 2868 | insert ("\n", 1); | 2871 | insert ("\n", 1); |
diff --git a/src/macfns.c b/src/macfns.c index 13cb563c156..9d07dc49049 100644 --- a/src/macfns.c +++ b/src/macfns.c | |||
| @@ -94,6 +94,11 @@ Lisp_Object Qcancel_timer; | |||
| 94 | 94 | ||
| 95 | extern Lisp_Object Vwindow_system_version; | 95 | extern Lisp_Object Vwindow_system_version; |
| 96 | 96 | ||
| 97 | #if GLYPH_DEBUG | ||
| 98 | int image_cache_refcount, dpyinfo_refcount; | ||
| 99 | #endif | ||
| 100 | |||
| 101 | |||
| 97 | #if 0 /* Use xstricmp instead. */ | 102 | #if 0 /* Use xstricmp instead. */ |
| 98 | /* compare two strings ignoring case */ | 103 | /* compare two strings ignoring case */ |
| 99 | 104 | ||
| @@ -4145,6 +4150,7 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */) | |||
| 4145 | options.optionFlags = kNavDefaultNavDlogOptions; | 4150 | options.optionFlags = kNavDefaultNavDlogOptions; |
| 4146 | options.optionFlags |= kNavAllFilesInPopup; /* All files allowed */ | 4151 | options.optionFlags |= kNavAllFilesInPopup; /* All files allowed */ |
| 4147 | options.optionFlags |= kNavSelectAllReadableItem; | 4152 | options.optionFlags |= kNavSelectAllReadableItem; |
| 4153 | options.optionFlags &= ~kNavAllowMultipleFiles; | ||
| 4148 | if (!NILP(prompt)) | 4154 | if (!NILP(prompt)) |
| 4149 | { | 4155 | { |
| 4150 | message = cfstring_create_with_string (prompt); | 4156 | message = cfstring_create_with_string (prompt); |
diff --git a/src/print.c b/src/print.c index b18bf19002f..7818565ce62 100644 --- a/src/print.c +++ b/src/print.c | |||
| @@ -1025,8 +1025,10 @@ 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 | message_dolog (name, strlen (name), 0, 0); | 1029 | char *name = alloca (SBYTES (cname)); |
| 1030 | bcopy (SDATA (cname), name, SBYTES (cname)); | ||
| 1031 | message_dolog (name, SBYTES (cname), 0, 0); | ||
| 1030 | message_dolog (": ", 2, 0, 0); | 1032 | message_dolog (": ", 2, 0, 0); |
| 1031 | } | 1033 | } |
| 1032 | 1034 | ||
diff --git a/src/sysdep.c b/src/sysdep.c index c0ff47e3072..eae493ba453 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -49,10 +49,7 @@ extern void srandom P_ ((unsigned int)); | |||
| 49 | #include "blockinput.h" | 49 | #include "blockinput.h" |
| 50 | 50 | ||
| 51 | #ifdef MAC_OS8 | 51 | #ifdef MAC_OS8 |
| 52 | /* It is essential to include stdlib.h so that this file picks up | 52 | #include <sys/param.h> |
| 53 | the correct definitions of rand, srand, and RAND_MAX. | ||
| 54 | Otherwise random numbers will not work correctly. */ | ||
| 55 | #include <stdlib.h> | ||
| 56 | 53 | ||
| 57 | #ifndef subprocesses | 54 | #ifndef subprocesses |
| 58 | /* Nonzero means delete a process right away if it exits (process.c). */ | 55 | /* Nonzero means delete a process right away if it exits (process.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/window.c b/src/window.c index 4089217825f..198edd3d6d8 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -273,7 +273,6 @@ make_window () | |||
| 273 | XSETWINDOW (val, p); | 273 | XSETWINDOW (val, p); |
| 274 | XSETFASTINT (p->last_point, 0); | 274 | XSETFASTINT (p->last_point, 0); |
| 275 | p->frozen_window_start_p = 0; | 275 | p->frozen_window_start_p = 0; |
| 276 | p->height_fixed_p = 0; | ||
| 277 | p->last_cursor_off_p = p->cursor_off_p = 0; | 276 | p->last_cursor_off_p = p->cursor_off_p = 0; |
| 278 | p->left_margin_cols = Qnil; | 277 | p->left_margin_cols = Qnil; |
| 279 | p->right_margin_cols = Qnil; | 278 | p->right_margin_cols = Qnil; |
| @@ -2438,27 +2437,22 @@ window_fixed_size_p (w, width_p, check_siblings_p) | |||
| 2438 | } | 2437 | } |
| 2439 | else if (BUFFERP (w->buffer)) | 2438 | else if (BUFFERP (w->buffer)) |
| 2440 | { | 2439 | { |
| 2441 | if (w->height_fixed_p && !width_p) | 2440 | struct buffer *old = current_buffer; |
| 2442 | fixed_p = 1; | 2441 | Lisp_Object val; |
| 2443 | else | ||
| 2444 | { | ||
| 2445 | struct buffer *old = current_buffer; | ||
| 2446 | Lisp_Object val; | ||
| 2447 | 2442 | ||
| 2448 | current_buffer = XBUFFER (w->buffer); | 2443 | current_buffer = XBUFFER (w->buffer); |
| 2449 | val = find_symbol_value (Qwindow_size_fixed); | 2444 | val = find_symbol_value (Qwindow_size_fixed); |
| 2450 | current_buffer = old; | 2445 | current_buffer = old; |
| 2451 | 2446 | ||
| 2452 | fixed_p = 0; | 2447 | fixed_p = 0; |
| 2453 | if (!EQ (val, Qunbound)) | 2448 | if (!EQ (val, Qunbound)) |
| 2454 | { | 2449 | { |
| 2455 | fixed_p = !NILP (val); | 2450 | fixed_p = !NILP (val); |
| 2456 | 2451 | ||
| 2457 | if (fixed_p | 2452 | if (fixed_p |
| 2458 | && ((EQ (val, Qheight) && width_p) | 2453 | && ((EQ (val, Qheight) && width_p) |
| 2459 | || (EQ (val, Qwidth) && !width_p))) | 2454 | || (EQ (val, Qwidth) && !width_p))) |
| 2460 | fixed_p = 0; | 2455 | fixed_p = 0; |
| 2461 | } | ||
| 2462 | } | 2456 | } |
| 2463 | 2457 | ||
| 2464 | /* Can't tell if this one is resizable without looking at | 2458 | /* Can't tell if this one is resizable without looking at |
diff --git a/src/window.h b/src/window.h index df359f37db2..46d75de384f 100644 --- a/src/window.h +++ b/src/window.h | |||
| @@ -290,11 +290,6 @@ struct window | |||
| 290 | be changed during redisplay. If point is not in the window, | 290 | be changed during redisplay. If point is not in the window, |
| 291 | accept that. */ | 291 | accept that. */ |
| 292 | unsigned frozen_window_start_p : 1; | 292 | unsigned frozen_window_start_p : 1; |
| 293 | |||
| 294 | /* 1 means that this window's height is temporarily fixed. Used | ||
| 295 | in resize_mini_window to precent resizing selected_window, if | ||
| 296 | possible. */ | ||
| 297 | unsigned height_fixed_p : 1; | ||
| 298 | }; | 293 | }; |
| 299 | 294 | ||
| 300 | /* 1 if W is a minibuffer window. */ | 295 | /* 1 if W is a minibuffer window. */ |
diff --git a/src/xdisp.c b/src/xdisp.c index e4adb43d624..3ae8543144d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -4903,7 +4903,8 @@ reseat_at_next_visible_line_start (it, on_newline_p) | |||
| 4903 | && indented_beyond_p (IT_CHARPOS (*it), IT_BYTEPOS (*it), | 4903 | && indented_beyond_p (IT_CHARPOS (*it), IT_BYTEPOS (*it), |
| 4904 | (double) it->selective)) /* iftc */ | 4904 | (double) it->selective)) /* iftc */ |
| 4905 | { | 4905 | { |
| 4906 | xassert (FETCH_BYTE (IT_BYTEPOS (*it) - 1) == '\n'); | 4906 | xassert (IT_BYTEPOS (*it) == BEGV |
| 4907 | || FETCH_BYTE (IT_BYTEPOS (*it) - 1) == '\n'); | ||
| 4907 | newline_found_p = forward_to_next_line_start (it, &skipped_p); | 4908 | newline_found_p = forward_to_next_line_start (it, &skipped_p); |
| 4908 | } | 4909 | } |
| 4909 | 4910 | ||
| @@ -6629,6 +6630,7 @@ move_it_vertically (it, dy) | |||
| 6629 | /* If buffer ends in ZV without a newline, move to the start of | 6630 | /* If buffer ends in ZV without a newline, move to the start of |
| 6630 | the line to satisfy the post-condition. */ | 6631 | the line to satisfy the post-condition. */ |
| 6631 | if (IT_CHARPOS (*it) == ZV | 6632 | if (IT_CHARPOS (*it) == ZV |
| 6633 | && ZV > BEGV | ||
| 6632 | && FETCH_BYTE (IT_BYTEPOS (*it) - 1) != '\n') | 6634 | && FETCH_BYTE (IT_BYTEPOS (*it) - 1) != '\n') |
| 6633 | move_it_by_lines (it, 0, 0); | 6635 | move_it_by_lines (it, 0, 0); |
| 6634 | } | 6636 | } |
| @@ -7166,7 +7168,15 @@ message3 (m, nbytes, multibyte) | |||
| 7166 | /* First flush out any partial line written with print. */ | 7168 | /* First flush out any partial line written with print. */ |
| 7167 | message_log_maybe_newline (); | 7169 | message_log_maybe_newline (); |
| 7168 | if (STRINGP (m)) | 7170 | if (STRINGP (m)) |
| 7169 | message_dolog (SDATA (m), nbytes, 1, multibyte); | 7171 | { |
| 7172 | char *buffer; | ||
| 7173 | USE_SAFE_ALLOCA; | ||
| 7174 | |||
| 7175 | SAFE_ALLOCA (buffer, char *, nbytes); | ||
| 7176 | bcopy (SDATA (m), buffer, nbytes); | ||
| 7177 | message_dolog (buffer, nbytes, 1, multibyte); | ||
| 7178 | SAFE_FREE (); | ||
| 7179 | } | ||
| 7170 | message3_nolog (m, nbytes, multibyte); | 7180 | message3_nolog (m, nbytes, multibyte); |
| 7171 | 7181 | ||
| 7172 | UNGCPRO; | 7182 | UNGCPRO; |
| @@ -10115,12 +10125,14 @@ overlay_arrow_at_row (it, row) | |||
| 10115 | if (FRAME_WINDOW_P (it->f) | 10125 | if (FRAME_WINDOW_P (it->f) |
| 10116 | && WINDOW_LEFT_FRINGE_WIDTH (it->w) > 0) | 10126 | && WINDOW_LEFT_FRINGE_WIDTH (it->w) > 0) |
| 10117 | { | 10127 | { |
| 10128 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 10118 | if (val = Fget (var, Qoverlay_arrow_bitmap), SYMBOLP (val)) | 10129 | if (val = Fget (var, Qoverlay_arrow_bitmap), SYMBOLP (val)) |
| 10119 | { | 10130 | { |
| 10120 | int fringe_bitmap; | 10131 | int fringe_bitmap; |
| 10121 | if ((fringe_bitmap = lookup_fringe_bitmap (val)) != 0) | 10132 | if ((fringe_bitmap = lookup_fringe_bitmap (val)) != 0) |
| 10122 | return make_number (fringe_bitmap); | 10133 | return make_number (fringe_bitmap); |
| 10123 | } | 10134 | } |
| 10135 | #endif | ||
| 10124 | return make_number (-1); /* Use default arrow bitmap */ | 10136 | return make_number (-1); /* Use default arrow bitmap */ |
| 10125 | } | 10137 | } |
| 10126 | return overlay_arrow_string_or_property (var); | 10138 | return overlay_arrow_string_or_property (var); |
| @@ -16044,7 +16056,7 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 16044 | { | 16056 | { |
| 16045 | /* A string: output it and check for %-constructs within it. */ | 16057 | /* A string: output it and check for %-constructs within it. */ |
| 16046 | unsigned char c; | 16058 | unsigned char c; |
| 16047 | const unsigned char *this, *lisp_string; | 16059 | int offset = 0; |
| 16048 | 16060 | ||
| 16049 | if (!NILP (props) || risky) | 16061 | if (!NILP (props) || risky) |
| 16050 | { | 16062 | { |
| @@ -16102,8 +16114,7 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 16102 | } | 16114 | } |
| 16103 | } | 16115 | } |
| 16104 | 16116 | ||
| 16105 | this = SDATA (elt); | 16117 | offset = 0; |
| 16106 | lisp_string = this; | ||
| 16107 | 16118 | ||
| 16108 | if (literal) | 16119 | if (literal) |
| 16109 | { | 16120 | { |
| @@ -16126,42 +16137,44 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 16126 | break; | 16137 | break; |
| 16127 | } | 16138 | } |
| 16128 | 16139 | ||
| 16140 | /* Handle the non-literal case. */ | ||
| 16141 | |||
| 16129 | while ((precision <= 0 || n < precision) | 16142 | while ((precision <= 0 || n < precision) |
| 16130 | && *this | 16143 | && SREF (elt, offset) != 0 |
| 16131 | && (mode_line_target != MODE_LINE_DISPLAY | 16144 | && (mode_line_target != MODE_LINE_DISPLAY |
| 16132 | || it->current_x < it->last_visible_x)) | 16145 | || it->current_x < it->last_visible_x)) |
| 16133 | { | 16146 | { |
| 16134 | const unsigned char *last = this; | 16147 | int last_offset = offset; |
| 16135 | 16148 | ||
| 16136 | /* Advance to end of string or next format specifier. */ | 16149 | /* Advance to end of string or next format specifier. */ |
| 16137 | while ((c = *this++) != '\0' && c != '%') | 16150 | while ((c = SREF (elt, offset++)) != '\0' && c != '%') |
| 16138 | ; | 16151 | ; |
| 16139 | 16152 | ||
| 16140 | if (this - 1 != last) | 16153 | if (offset - 1 != last_offset) |
| 16141 | { | 16154 | { |
| 16142 | int nchars, nbytes; | 16155 | int nchars, nbytes; |
| 16143 | 16156 | ||
| 16144 | /* Output to end of string or up to '%'. Field width | 16157 | /* Output to end of string or up to '%'. Field width |
| 16145 | is length of string. Don't output more than | 16158 | is length of string. Don't output more than |
| 16146 | PRECISION allows us. */ | 16159 | PRECISION allows us. */ |
| 16147 | --this; | 16160 | offset--; |
| 16148 | 16161 | ||
| 16149 | prec = c_string_width (last, this - last, precision - n, | 16162 | prec = c_string_width (SDATA (elt) + last_offset, |
| 16163 | offset - last_offset, precision - n, | ||
| 16150 | &nchars, &nbytes); | 16164 | &nchars, &nbytes); |
| 16151 | 16165 | ||
| 16152 | switch (mode_line_target) | 16166 | switch (mode_line_target) |
| 16153 | { | 16167 | { |
| 16154 | case MODE_LINE_NOPROP: | 16168 | case MODE_LINE_NOPROP: |
| 16155 | case MODE_LINE_TITLE: | 16169 | case MODE_LINE_TITLE: |
| 16156 | n += store_mode_line_noprop (last, 0, prec); | 16170 | n += store_mode_line_noprop (SDATA (elt) + last_offset, 0, prec); |
| 16157 | break; | 16171 | break; |
| 16158 | case MODE_LINE_STRING: | 16172 | case MODE_LINE_STRING: |
| 16159 | { | 16173 | { |
| 16160 | int bytepos = last - lisp_string; | 16174 | int bytepos = last_offset; |
| 16161 | int charpos = string_byte_to_char (elt, bytepos); | 16175 | int charpos = string_byte_to_char (elt, bytepos); |
| 16162 | int endpos = (precision <= 0 | 16176 | int endpos = (precision <= 0 |
| 16163 | ? string_byte_to_char (elt, | 16177 | ? string_byte_to_char (elt, offset) |
| 16164 | this - lisp_string) | ||
| 16165 | : charpos + nchars); | 16178 | : charpos + nchars); |
| 16166 | 16179 | ||
| 16167 | n += store_mode_line_string (NULL, | 16180 | n += store_mode_line_string (NULL, |
| @@ -16172,7 +16185,7 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 16172 | break; | 16185 | break; |
| 16173 | case MODE_LINE_DISPLAY: | 16186 | case MODE_LINE_DISPLAY: |
| 16174 | { | 16187 | { |
| 16175 | int bytepos = last - lisp_string; | 16188 | int bytepos = last_offset; |
| 16176 | int charpos = string_byte_to_char (elt, bytepos); | 16189 | int charpos = string_byte_to_char (elt, bytepos); |
| 16177 | n += display_string (NULL, elt, Qnil, 0, charpos, | 16190 | n += display_string (NULL, elt, Qnil, 0, charpos, |
| 16178 | it, 0, prec, 0, | 16191 | it, 0, prec, 0, |
| @@ -16183,12 +16196,12 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 16183 | } | 16196 | } |
| 16184 | else /* c == '%' */ | 16197 | else /* c == '%' */ |
| 16185 | { | 16198 | { |
| 16186 | const unsigned char *percent_position = this; | 16199 | int percent_position = offset; |
| 16187 | 16200 | ||
| 16188 | /* Get the specified minimum width. Zero means | 16201 | /* Get the specified minimum width. Zero means |
| 16189 | don't pad. */ | 16202 | don't pad. */ |
| 16190 | field = 0; | 16203 | field = 0; |
| 16191 | while ((c = *this++) >= '0' && c <= '9') | 16204 | while ((c = SREF (elt, offset++)) >= '0' && c <= '9') |
| 16192 | field = field * 10 + c - '0'; | 16205 | field = field * 10 + c - '0'; |
| 16193 | 16206 | ||
| 16194 | /* Don't pad beyond the total padding allowed. */ | 16207 | /* Don't pad beyond the total padding allowed. */ |
| @@ -16208,7 +16221,7 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 16208 | int bytepos, charpos; | 16221 | int bytepos, charpos; |
| 16209 | unsigned char *spec; | 16222 | unsigned char *spec; |
| 16210 | 16223 | ||
| 16211 | bytepos = percent_position - lisp_string; | 16224 | bytepos = percent_position; |
| 16212 | charpos = (STRING_MULTIBYTE (elt) | 16225 | charpos = (STRING_MULTIBYTE (elt) |
| 16213 | ? string_byte_to_char (elt, bytepos) | 16226 | ? string_byte_to_char (elt, bytepos) |
| 16214 | : bytepos); | 16227 | : bytepos); |
diff --git a/src/xfns.c b/src/xfns.c index 9655951d8c1..027a1464503 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -1516,11 +1516,12 @@ x_set_scroll_bar_background (f, value, oldval) | |||
| 1516 | Otherwise store 0 in *STRINGP, which means that the `encoding' of | 1516 | Otherwise store 0 in *STRINGP, which means that the `encoding' of |
| 1517 | the result should be `COMPOUND_TEXT'. */ | 1517 | the result should be `COMPOUND_TEXT'. */ |
| 1518 | 1518 | ||
| 1519 | unsigned char * | 1519 | static unsigned char * |
| 1520 | x_encode_text (string, coding_system, selectionp, text_bytes, stringp) | 1520 | x_encode_text (string, coding_system, selectionp, text_bytes, stringp, freep) |
| 1521 | Lisp_Object string, coding_system; | 1521 | Lisp_Object string, coding_system; |
| 1522 | int *text_bytes, *stringp; | 1522 | int *text_bytes, *stringp; |
| 1523 | int selectionp; | 1523 | int selectionp; |
| 1524 | int *freep; | ||
| 1524 | { | 1525 | { |
| 1525 | int result = string_xstring_p (string); | 1526 | int result = string_xstring_p (string); |
| 1526 | struct coding_system coding; | 1527 | struct coding_system coding; |
| @@ -1530,6 +1531,7 @@ x_encode_text (string, coding_system, selectionp, text_bytes, stringp) | |||
| 1530 | /* No multibyte character in OBJ. We need not encode it. */ | 1531 | /* No multibyte character in OBJ. We need not encode it. */ |
| 1531 | *text_bytes = SBYTES (string); | 1532 | *text_bytes = SBYTES (string); |
| 1532 | *stringp = 1; | 1533 | *stringp = 1; |
| 1534 | *freep = 0; | ||
| 1533 | return SDATA (string); | 1535 | return SDATA (string); |
| 1534 | } | 1536 | } |
| 1535 | 1537 | ||
| @@ -1543,6 +1545,7 @@ x_encode_text (string, coding_system, selectionp, text_bytes, stringp) | |||
| 1543 | SCHARS (string), SBYTES (string), Qnil); | 1545 | SCHARS (string), SBYTES (string), Qnil); |
| 1544 | *text_bytes = coding.produced; | 1546 | *text_bytes = coding.produced; |
| 1545 | *stringp = (result == 1 || !EQ (coding_system, Qcompound_text)); | 1547 | *stringp = (result == 1 || !EQ (coding_system, Qcompound_text)); |
| 1548 | *freep = 1; | ||
| 1546 | return coding.destination; | 1549 | return coding.destination; |
| 1547 | } | 1550 | } |
| 1548 | 1551 | ||
| @@ -1581,16 +1584,13 @@ x_set_name_internal (f, name) | |||
| 1581 | in the future which can encode all Unicode characters. | 1584 | in the future which can encode all Unicode characters. |
| 1582 | But, for the moment, there's no way to know that the | 1585 | But, for the moment, there's no way to know that the |
| 1583 | current window manager supports it or not. */ | 1586 | current window manager supports it or not. */ |
| 1584 | text.value = x_encode_text (name, coding_system, 0, &bytes, &stringp); | 1587 | text.value = x_encode_text (name, coding_system, 0, &bytes, &stringp, |
| 1588 | &do_free_text_value); | ||
| 1585 | text.encoding = (stringp ? XA_STRING | 1589 | text.encoding = (stringp ? XA_STRING |
| 1586 | : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT); | 1590 | : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT); |
| 1587 | text.format = 8; | 1591 | text.format = 8; |
| 1588 | text.nitems = bytes; | 1592 | text.nitems = bytes; |
| 1589 | 1593 | ||
| 1590 | /* Check early, because ENCODE_UTF_8 below may GC and name may be | ||
| 1591 | relocated. */ | ||
| 1592 | do_free_text_value = text.value != SDATA (name); | ||
| 1593 | |||
| 1594 | if (NILP (f->icon_name)) | 1594 | if (NILP (f->icon_name)) |
| 1595 | { | 1595 | { |
| 1596 | icon = text; | 1596 | icon = text; |
| @@ -1599,12 +1599,11 @@ x_set_name_internal (f, name) | |||
| 1599 | { | 1599 | { |
| 1600 | /* See the above comment "Note: Encoding strategy". */ | 1600 | /* See the above comment "Note: Encoding strategy". */ |
| 1601 | icon.value = x_encode_text (f->icon_name, coding_system, 0, | 1601 | icon.value = x_encode_text (f->icon_name, coding_system, 0, |
| 1602 | &bytes, &stringp); | 1602 | &bytes, &stringp, &do_free_icon_value); |
| 1603 | icon.encoding = (stringp ? XA_STRING | 1603 | icon.encoding = (stringp ? XA_STRING |
| 1604 | : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT); | 1604 | : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT); |
| 1605 | icon.format = 8; | 1605 | icon.format = 8; |
| 1606 | icon.nitems = bytes; | 1606 | icon.nitems = bytes; |
| 1607 | do_free_icon_value = icon.value != SDATA (f->icon_name); | ||
| 1608 | } | 1607 | } |
| 1609 | 1608 | ||
| 1610 | #ifdef USE_GTK | 1609 | #ifdef USE_GTK |
| @@ -1967,7 +1966,7 @@ xic_create_fontsetname (base_fontname, motif) | |||
| 1967 | - the same but with the family also replaced with -*-*-. */ | 1966 | - the same but with the family also replaced with -*-*-. */ |
| 1968 | char *p = base_fontname; | 1967 | char *p = base_fontname; |
| 1969 | int i; | 1968 | int i; |
| 1970 | 1969 | ||
| 1971 | for (i = 0; *p; p++) | 1970 | for (i = 0; *p; p++) |
| 1972 | if (*p == '-') i++; | 1971 | if (*p == '-') i++; |
| 1973 | if (i != 14) | 1972 | if (i != 14) |
| @@ -1991,7 +1990,7 @@ xic_create_fontsetname (base_fontname, motif) | |||
| 1991 | char *allcs = "*-*-*-*-*-*-*"; | 1990 | char *allcs = "*-*-*-*-*-*-*"; |
| 1992 | char *allfamilies = "-*-*-"; | 1991 | char *allfamilies = "-*-*-"; |
| 1993 | char *all = "*-*-*-*-"; | 1992 | char *all = "*-*-*-*-"; |
| 1994 | 1993 | ||
| 1995 | for (i = 0, p = base_fontname; i < 8; p++) | 1994 | for (i = 0, p = base_fontname; i < 8; p++) |
| 1996 | { | 1995 | { |
| 1997 | if (*p == '-') | 1996 | if (*p == '-') |
diff --git a/src/xterm.h b/src/xterm.h index 6a2a9a99200..da474beef58 100644 --- a/src/xterm.h +++ b/src/xterm.h | |||
| @@ -1044,8 +1044,6 @@ extern void x_real_positions P_ ((struct frame *, int *, int *)); | |||
| 1044 | extern int defined_color P_ ((struct frame *, char *, XColor *, int)); | 1044 | extern int defined_color P_ ((struct frame *, char *, XColor *, int)); |
| 1045 | extern void x_set_border_pixel P_ ((struct frame *, int)); | 1045 | extern void x_set_border_pixel P_ ((struct frame *, int)); |
| 1046 | extern void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object)); | 1046 | extern void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
| 1047 | extern unsigned char * x_encode_text P_ ((Lisp_Object, Lisp_Object, int, | ||
| 1048 | int *, int *)); | ||
| 1049 | extern void x_implicitly_set_name P_ ((struct frame *, Lisp_Object, Lisp_Object)); | 1047 | extern void x_implicitly_set_name P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
| 1050 | extern void xic_free_xfontset P_ ((struct frame *)); | 1048 | extern void xic_free_xfontset P_ ((struct frame *)); |
| 1051 | extern void create_frame_xic P_ ((struct frame *)); | 1049 | extern void create_frame_xic P_ ((struct frame *)); |