Generalize INTERNAL_FIELD between buffers, keyboards and frames.
[bpt/emacs.git] / src / ChangeLog
1 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2
3 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4 * lisp.h (INTERNAL_FIELD): New macro.
5 * buffer.h (BUFFER_INTERNAL_FIELD): Removed.
6 (BVAR): Change to use INTERNAL_FIELD.
7 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
8 (KVAR): Change to use INTERNAL_FIELD.
9 * frame.h (FVAR): New macro.
10 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
11 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c
12 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c
13 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h,
14 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
15
16 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
17
18 Miscellaneous fixes for non-default X toolkits.
19 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
20 * xterm.c (x_frame_of_widget): Remove redundant prototype.
21 Move under #ifdef USE_LUCID.
22 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
23 definition and usage to avoid warnings.
24
25 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
26
27 * nsterm.m (openFiles): Fix previous checkin.
28
29 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
30
31 * indent.c (compute_motion): Remove unused local.
32
33 2012-07-31 Glenn Morris <rgm@gnu.org>
34
35 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
36
37 * conf_post.h [USG5_4]:
38 Move remaining contents of s/usg5-4-common.h here.
39 * s/usg5-4-common.h: Remove file.
40
41 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
42 * s/irix6-5.h: Remove file.
43
44 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
45 * s/darwin.h: Remove file.
46
47 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
48 * s/hpux10-20.h: Remove file, which is now empty.
49
50 2012-07-30 Glenn Morris <rgm@gnu.org>
51
52 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
53 * Makefile.in (config_h): Add conf_post.h.
54 * makefile.w32-in (CONFIG_H): Add conf_post.h.
55
56 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
57
58 * nsterm.m (ns_do_open_file): New variable.
59 (ns_term_init): Set ns_do_open_file to YES after run returns.
60 (openFile, openTempFile, openFileWithoutUI, openFiles): Open
61 files only if ns_do_open_file.
62
63 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
64
65 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
66 This no-op macro hasn't been needed for many years.
67 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
68
69 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
70 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
71 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
72 gdb_make_enums_visible.
73 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
74 (DIRECTORY_SEP): Now a constant, not a macro.
75
76 2012-07-30 Eli Zaretskii <eliz@gnu.org>
77
78 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
79 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
80
81 * w32term.c <w32_keyboard_codepage>: Renamed from
82 keyboard_codepage and now external. All users changed.
83
84 * w32term.h: Add declaration of w32_keyboard_codepage.
85
86 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
87 the codepage to translate keys to Unicode. If this argument is
88 -1, use the value returned by GetConsoleCP. All callers changed.
89
90 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
91
92 Update .PHONY listings in makefiles.
93 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
94 bootstrap-clean, distclean, maintainer-clean, versioclean,
95 extraclean, frc.
96
97 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
98 This is a bit clearer. Fix some commentary typos.
99
100 2012-07-30 Glenn Morris <rgm@gnu.org>
101
102 * s/netbsd.h: Let configure include signal.h if needed.
103 Remove file, which is now empty.
104
105 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
106 Let configure set them.
107 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
108 No more need to undefine.
109
110 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
111
112 * keymap.c (Fkey_description): Don't remove 0x80 bit from
113 non-single-byte char when adding meta modifier. (Bug#12090)
114
115 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
116
117 Convert safe_call to use variable number of arguments.
118 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
119 (safe_call2): Fix comment.
120 * lisp.h (safe_call): Adjust prototype.
121 * coding.c (encode_coding_object): Change to use safe_call2.
122 * xfaces.c (merge_face_heights): Change to use safe_call1.
123
124 2012-07-30 Glenn Morris <rgm@gnu.org>
125
126 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
127 does that unconditionally. Remove file, which is now empty.
128
129 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
130 Remove empty files.
131
132 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
133
134 Export to GDB most of lisp.h's remaining object-like macros.
135 * lisp.h (min, max): Move earlier, because they're used earlier now.
136 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
137 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
138 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
139 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
140 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
141 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
142 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
143 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
144 Now constants, for GDB. They need not be macros.
145 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
146 Now constants, for GDB, as well as macros, for static initializers.
147 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
148 Move to after the definition of struct Lisp_Char_Table,
149 since the former now needs that type defined.
150 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
151 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
152 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
153 New enums, for gdb_make_enums_visible.
154 (GLYPH_MODE_LINE_FACE): Remove; unused.
155 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
156 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
157 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
158 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
159 enum maxargs, enum MAX_ALLOCA.
160 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
161 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
162 no longer needed, now that they are done in lisp.h.
163
164 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
165
166 Cleanup string bytes checking.
167 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
168 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
169 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
170 (check_sblock, compact_small_strings): Simplify.
171
172 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
173
174 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
175 These macros are confusing and no longer need to be defined, as
176 the enum values now suffice. All uses replaced with definiens.
177 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
178
179 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
180
181 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
182 ($(BLD)/w32console.$(O)): Update dependencies.
183
184 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
185
186 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
187 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
188 time. Adjust users.
189 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
190
191 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
192
193 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
194 setting sitelisp (Bug#12010).
195
196 2012-07-29 Eli Zaretskii <eliz@gnu.org>
197
198 * w32heap.h (OS_9X): Renamed from OS_WINDOWS_95.
199
200 * w32heap.c (cache_system_info):
201 * w32.c (sys_rename):
202 * w32proc.c (find_child_console, sys_kill): All users changed.
203
204 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
205
206 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
207
208 2012-07-29 Eli Zaretskii <eliz@gnu.org>
209
210 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
211
212 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
213
214 Cleanup statistics calculation in Fgarbage_collect.
215 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start. Fix
216 zombies percentage calculation. Simplify elapsed time calculation.
217
218 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
219
220 Generalize marker debugging code under MARKER_DEBUG and use eassert.
221 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
222 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
223 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
224 (replace_range, replace_range_2, del_range_2): Change to eassert.
225 * marker.c (byte_char_debug_check): Adjust style.
226
227 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
228
229 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
230 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
231 long-ago-commented-out code that talks about "WIN32".
232 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
233 All uses changed.
234
235 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
236
237 Use Gnulib stdalign module (Bug#9772, Bug#9960).
238 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
239 Simplify by using alignof.
240 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
241 * lisp.h: Include <stdalign.h>.
242 (GCALIGNMENT): New macro and constant.
243 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
244 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
245 (stdalign): New macro, if not already defined.
246
247 2012-07-28 Eli Zaretskii <eliz@gnu.org>
248
249 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
250 * w32inevt.c: Include w32inevt.h.
251 (w32_read_console_input): New inline function, calls either
252 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
253 w32_console_unicode_input.
254 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
255 (w32_kbd_patch_key, key_event): Use the codepage returned by
256 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
257 (key_event): use uChar.UnicodeChar only if
258 w32_console_unicode_input is non-zero.
259
260 * w32console.c: Include w32heap.h.
261 <w32_console_unicode_input>: New global variable.
262 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
263 family of Windows, zero otherwise.
264
265 * w32inevt.h: Declare w32_console_unicode_input.
266
267 * xdisp.c (init_iterator): Don't reference tip_frame in a build
268 --without-x. (Bug#11742)
269
270 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
271
272 Adjust GDB to reflect pvec_type changes (Bug#12036).
273 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
274 2012-07-04 changes to pseudovector representation. Problem
275 reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
276
277 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
278
279 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
280 bus address.
281 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
282
283 2012-07-27 Eli Zaretskii <eliz@gnu.org>
284
285 * alloc.c (listn): Fix the order the arguments are consed onto the
286 list.
287
288 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
289 enumeration constants, as PURE and HEAP are too general, and clash
290 with other headers and sources, such as gmalloc.c and the
291 MS-Windows system headers. All users changed.
292
293 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
294
295 Revert last save_excursion_save and save_excursion_restore changes.
296 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
297 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
298
299 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
300
301 Fix recently-introduced typos in Windows port.
302 Reported by Martin Rudalics <rudalics@gmx.at>.
303 * w32.c (init_environment): Replace comma with semicolon.
304 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
305
306 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
307
308 Improve GDB symbol export (Bug#12036).
309 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
310 arms of an 'if', not using conditional expressions; otherwise GDB
311 complains about the types in the unevaluated arm when the argument
312 is an integer literal.
313 (xgetint): Simplify expression.
314 * alloc.c (gdb_make_enums_visible): New constant. This ports to
315 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
316 Zaretskii in <http://bugs.gnu.org/12036#13>.
317 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
318 needed now that we have gdb_make_enums_visible.
319 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
320 (enum enum_USE_LSB_TAG):
321 New enum types, packaging up enums that need to be exported to GDB.
322
323 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
324
325 Utility function to make a list from specified amount of objects.
326 * lisp.h (enum constype): New datatype.
327 (listn): New prototype.
328 * alloc.c (listn): New function.
329 (Fmemory_use_count, syms_of_alloc): Use it.
330 * buffer.c (syms_of_buffer): Likewise.
331 * callint.c (syms_of_callint): Likewise.
332 * charset.c (define_charset_internal): Likewise.
333 * coding.c (syms_of_coding): Likewise.
334 * keymap.c (syms_of_keymap): Likewise.
335 * search.c (syms_of_search): Likewise.
336 * syntax.c (syms_of_syntax): Likewise.
337 * w32.c (init_environment): Likewise.
338 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
339 * xdisp.c (syms_of_xdisp): Likewise.
340 * xfns.c (syms_of_xfns): Likewise.
341
342 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
343
344 Fast save_excursion_save and save_excursion_restore.
345 * lisp.h (struct Lisp_Excursion): New data type.
346 (PVEC_EXCURSION): New pseudovector type.
347 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
348 to deal with it. Adjust comments.
349 (init_marker, attach_marker): New prototype.
350 (unchain_marker): Adjust prototype.
351 * marker.c (attach_marker): Change to global.
352 (init_marker): New function.
353 * alloc.c (Fmake_marker, build_marker): Use it.
354 (build_marker): More easserts.
355 (mark_object): Handle struct Lisp_Excursion.
356 * editfns.c (save_excursion_save, save_excursion_restore):
357 Reimplement to use struct Lisp_Excursion. Add comments.
358
359 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
360
361 Fix export of symbols to GDB (Bug#12036).
362 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
363 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
364 emacs.c, as this is a more-suitable home. Had this been done earlier
365 the fix for 12036 would have avoided some of the problems noted in
366 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
367 would have been more obvious.
368 * emacs.c: Do not include <verify.h>; no longer needed.
369 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
370 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
371 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
372 Remove; now done in lisp.h.
373 * lisp.h (PUBLISH_TO_GDB): New macro.
374 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
375 (DATA_SEG_BITS): Use it.
376 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
377 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
378 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
379 not be usable in #if. This simplifies things.
380
381 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
382
383 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
384
385 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
386
387 Simplify export of symbols to GDB (Bug#12036).
388 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
389 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
390 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
391 Adjust to changes in lisp.h and emacs.c, by using
392 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
393 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
394 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
395 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
396 instead of gdb_valbits.
397 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
398 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
399 instead of gdb_array_mark_flag.
400 (xboolvector): Get size from $->size, not $->header.size.
401 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
402 (xreload, hook-run, hookpost-run): Remove.
403 * emacs.c: Include <verify.h>.
404 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
405 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
406 Remove.
407 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
408 (gdb_USE_LSB_TAG): New enum constants.
409 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
410 Also define these as enum constants, so they're visible to GDB.
411 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
412 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
413 as constants, so they're visible to GDB.
414 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
415 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
416 Now enum constants, not macros, so they're visible to GDB.
417 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
418 more convenient now. All uses changed.
419 (VALMASK) [USE_LSB_TAG]: Also define in this case.
420 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
421
422 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
423
424 Explicitly free restriction data that are not needed anymore.
425 * editfns.c (save_restriction_restore): Free restriction data.
426
427 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
428
429 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
430 add argument, tune behavior, and adjust all callers.
431
432 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
433
434 Use typedef for EMACS_INT, EMACS_UINT.
435 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
436 than macros. This simplifies debugging in the usual case, since
437 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
438 and it allows expressions involving EMACS_INT casts.
439 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
440
441 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
442
443 * nsterm.m (ns_read_socket): Return early if there is a modal
444 window (Bug#12043).
445
446 2012-07-25 Martin Rudalics <rudalics@gmx.at>
447
448 * frame.c (Fredirect_frame_focus): In doc-string don't mention
449 that FOCUS-FRAME can be omitted.
450
451 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
452
453 Adjust buffer text indirection counters at the end of Fkill_buffer.
454 * buffer.c (Fkill_buffer): Adjust indirection counters when the
455 buffer is definitely dead. This should really fix an issue reported
456 by Christoph Scholtes again. (Bug#12007).
457 (init_buffer_once): Initialize indirection counters of
458 buffer_defaults and buffer_local_symbols (for sanity and safety).
459
460 2012-07-24 Eli Zaretskii <eliz@gnu.org>
461
462 * xdisp.c (init_iterator): Don't compute dimensions of truncation
463 and continuation glyphs on tooltip frames, leave them at zero.
464 Avoids continued lines in tooltips. (Bug#11832)
465
466 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
467
468 Simplify copy_overlay.
469 * buffer.c (copy_overlay): Simplify. Use build_marker.
470 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
471
472 2012-07-23 Eli Zaretskii <eliz@gnu.org>
473
474 * print.c (print_object): Don't crash when a frame's name is nil
475 or invalid. (Bug#12025)
476
477 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
478 it signals an error when a tooltip frame is being created.
479
480 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
481
482 Cleanup miscellaneous objects allocation and initialization.
483 * alloc.c (allocate_misc): Change to static. Add argument to
484 specify the subtype. Adjust comment and users.
485 (build_overlay): New function.
486 * buffer.c (copy_overlays, Fmake_overlay): Use it.
487 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
488 (allocate_misc): Remove prototype.
489 (build_overlay): Add prototype.
490
491 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
492
493 Swap buffer text indirection counters in Fbuffer_swap_text.
494 * buffer.c (Fbuffer_swap_text): Swap indirections too.
495 This avoids crash reported by Christoph Scholtes at
496 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
497
498 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
499
500 * nsmenu.m (Popdown_data): New struct.
501 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
502 free Popdown_data.
503 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
504 (initWithContentRect): Make imgView and contentView non-static
505 and autorelease them. Also autorelease img and matrix (Bug#12005).
506 (dealloc): Remove (Bug#12005).
507
508 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
509
510 Adjust consing_since_gc when objects are explicitly freed.
511 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
512 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
513 (free_cons, free_misc): Subtract object size from consing_since_gc.
514
515 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
516
517 Simplify and cleanup markers positioning code.
518 * marker.c (attach_marker): More useful eassert.
519 (live_buffer, set_marker_internal): New function.
520 (Fset_marker, set_marker_restricted): Use set_marker_internal.
521 (set_marker_both, set_marker_restricted_both): Use live_buffer.
522
523 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
524
525 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
526 as it's limited by the amount of memory, not by INT_MAX.
527
528 2012-07-21 Eli Zaretskii <eliz@gnu.org>
529
530 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
531 in special-event-map. See the discussion at
532 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
533 for the reasons.
534
535 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
536 info.dwItemData. Fixes crashes on 64-bit Windows. Suggested by
537 Fabrice Popineau <fabrice.popineau@supelec.fr>.
538
539 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
540
541 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
542 (conversationIdentifier): Return value is NSInteger.
543 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
544
545 2012-07-21 Chong Yidong <cyd@gnu.org>
546
547 * window.c (decode_any_window): Signal an error if the window is
548 on a dead frame (Bug#11984).
549
550 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
551
552 Add indirection counting to speed up Fkill_buffer.
553 * buffer.h (struct buffer): New member.
554 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
555 (Fmake_indirect_buffer): Set indirection counter to -1, increment
556 base buffer indirection counter.
557 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
558 (Fkill_buffer): Adjust indirection counters as needed, don't walk
559 through buffer list if indirection counter is 0.
560
561 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
562
563 Extend the value returned by Fgarbage_collect with heap statistics.
564 * alloc.c (Qheap): New symbol.
565 (syms_of_alloc): DEFSYM it.
566 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
567 (Fmemory_free): Remove.
568 (syms_of_alloc): Don't defsubr it.
569 * buffer.c (Fcompact_buffer): Remove.
570 (syms_of_buffer): Don't defsubr it.
571
572 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
573
574 Make maybe_gc inline.
575 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
576 * lisp.h (consing_since_gc, gc_relative_threshold)
577 (memory_full_cons_threshold): Revert declaration.
578 (maybe_gc): Remove prototype, define as inline.
579 * alloc.c: Remove old commented-out code.
580 (consing_since_gc, gc_relative_threshold)
581 (memory_full_cons_threshold): Revert to global.
582 (maybe_gc): Remove.
583
584 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
585
586 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
587 * lisp.h (build_unibyte_string): New function.
588 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
589 * sysdep.c, w32fns.c, xfns.c: Use it.
590 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
591 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
592 Adjust users accordingly.
593 * font.h (font_open_by_name): Adjust prototype.
594
595 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
596
597 Cleanup calls to Fgarbage_collect.
598 * lisp.h (maybe_gc): New prototype.
599 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
600 Remove declarations.
601 * alloc.c (maybe_gc): New function.
602 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
603 Make them static.
604 * bytecode.c (MAYBE_GC): Use maybe_gc.
605 * eval.c (eval_sub, Ffuncall): Likewise.
606 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
607 to avoid dependency from auto-save feature.
608
609 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
610
611 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
612 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
613 'for_each_per_buffer_object_at'.
614 All uses changed. It's better to use upper-case for macros that
615 cannot be implemented as functions, to give the reader a clue
616 that they're special.
617
618 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
619
620 * alloc.c (Fgarbage_collect): Tweak docstring.
621
622 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
623
624 Tweak the value returned from Fgarbage_collect again.
625 * alloc.c (Fgarbage_collect): New return value, as confirmed in
626 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
627 Adjust documentation.
628 (total_vector_bytes): Rename to total_vector_slots, adjust
629 accounting.
630 (total_free_vector_bytes): Rename to total_free_vector_slots,
631 adjust accounting.
632 (Qstring_bytes, Qvector_slots): New symbols.
633 (syms_of_alloc): DEFSYM them.
634
635 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
636
637 Buffer compaction primitive which may be used from Lisp.
638 * buffer.c (compact_buffer, Fcompact_buffer): New function.
639 (syms_of_buffer): Register Fcompact_buffer.
640 * alloc.c (Fgarbage_collect): Use compact_buffer.
641 * buffer.h (compact_buffer): New prototype.
642 (struct buffer_text): New member.
643
644 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
645
646 New macro to iterate over all buffers, miscellaneous cleanups.
647 * lisp.h (all_buffers): Remove declaration.
648 * buffer.h (all_buffers): Add declaration, with comment.
649 (for_each_buffer): New macro.
650 * alloc.c (Fgarbage_collect, mark_object): Use it.
651 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
652 (init_buffer): Likewise.
653 * data.c (Fset_default): Likewise.
654 * coding.c (code_conversion_restore): Remove redundant check
655 for dead buffer.
656 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
657
658 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
659
660 Fix bug that created negative-length intervals.
661 * intervals.c (merge_interval_right, merge_interval_left):
662 Do not zero out this interval if it is absorbed by its children,
663 as this interval's total length doesn't change in that case. See
664 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
665
666 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
667
668 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
669 when invoking (make-bool-vector N t) and N is a positive
670 multiple of 8 -- the last 8 bits were mistakenly cleared.
671
672 Remove some struct layout assumptions in bool vectors.
673 * alloc.c (bool_header_size): New constant.
674 (header_size, word_size): Move earlier, as they're now used earlier.
675 Use 'word_size' in a few more places, where it's appropriate.
676 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
677 padding before the data member of a bool vector.
678 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
679 than doing the check by hand with an abort ().
680
681 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
682
683 * eval.c (Fdefvar): Don't check constants since we only set the var if
684 it's not yet defined anyway (bug#11904).
685
686 * lisp.h (last_undo_boundary): Declare new var.
687 * keyboard.c (command_loop_1): Set it.
688 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
689 were auto-added by the command loop (bug#11774).
690
691 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
692
693 * w32font.c (Qsymbol): Remove local definition.
694 (syms_of_w32font): Don't DEFSYM it.
695
696 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
697
698 Fix sweep_vectors to handle large bool vectors correctly.
699 * alloc.c (sweep_vectors): Account total_vector_bytes for
700 bool vectors larger than VBLOCK_BYTES_MAX.
701
702 2012-07-18 Chong Yidong <cyd@gnu.org>
703
704 * frame.c (x_set_frame_parameters): Revert bogus change introduced
705 in 2012-05-25 commit by Paul Eggert (Bug#11738).
706
707 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
708
709 Return more descriptive data from Fgarbage_collect.
710 Suggested by Stefan Monnier in
711 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
712 * alloc.c (bounded_number): New function.
713 (total_buffers, total_vectors): New variable.
714 (total_string_size): Rename to total_string_bytes, adjust users.
715 (total_vector_size): Rename to total_vector_bytes, adjust users.
716 (sweep_vectors): Account total_vectors and total_vector_bytes.
717 (Fgarbage_collect): New return value. Adjust documentation.
718 (gc_sweep): Account total_buffers.
719 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
720 (VECTOR_SIZE): Remove.
721 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
722 (Qinterval, Qmisc): New symbols.
723 (syms_of_data): Initialize them.
724 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
725 (Qcons, Qbuffer): New declarations.
726
727 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
728
729 * alloc.c (Fmemory_free): Account for memory-free's own storage.
730 Round up, not down. Improve doc.
731
732 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
733
734 Restore old code in allocate_string_data to avoid Faset breakage.
735 Reported by Julien Danjou <julien@danjou.info> in
736 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
737 * alloc.c (allocate_string_data): Restore old code with minor
738 adjustments, fix comment to explain this subtle issue.
739
740 2012-07-17 Eli Zaretskii <eliz@gnu.org>
741
742 Remove FILE_SYSTEM_CASE.
743 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
744
745 * fileio.c (FILE_SYSTEM_CASE): Don't define.
746 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
747 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
748 call-process-region passes it through expand-file-name.
749
750 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
751
752 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
753
754 Fix crash when creating indirect buffer (Bug#11917)
755 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
756 Don't handle unbound variables specially if non-zero.
757 (Fbuffer_local_variables): Pass zero.
758 (clone_per_buffer_values): Pass non-zero.
759
760 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
761
762 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
763 to make the loop interruptible.
764
765 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
766
767 * gnutls.c (emacs_gnutls_handshake): Only retry if
768 GNUTLS_E_INTERRUPTED.
769
770 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
771
772 Cleanup and convert miscellaneous checks to eassert.
773 * alloc.c (mark_interval): Fix comment, partially rephrase
774 old comment from intervals.h (see below).
775 * intervals.c (find_interval, adjust_intervals_for_insertion)
776 (delete_interval, adjust_intervals_for_deletion)
777 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
778 Convert to eassert.
779 (adjust_intervals_for_insertion, make_new_interval):
780 Remove obsolete and unused code.
781 * intervals.h (struct interval): Remove obsolete comment.
782 * textprotp.c (erase_properties): Remove unused code.
783 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
784 (Fremove_list_of_text_properties): Convert to eassert.
785
786 2012-07-17 Chong Yidong <cyd@gnu.org>
787
788 * editfns.c (Finsert_char): Doc fix.
789
790 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
791
792 Fix previous change to make Fmemory_free always accurate.
793 * alloc.c (make_interval): Update total_free_intervals.
794 (make_float): Likewise for total_free_floats.
795 (free_cons, Fcons): Likewise for total_free_conses.
796 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
797 Likewise for total_free_vector_bytes.
798 (Fmake_symbol): Likewise for total_free_symbols.
799 (bytes_free): Remove.
800
801 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
802
803 Simple free memory accounting feature.
804 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
805 (sweep_vectors): Accumulate size of free vectors.
806 (Fgarbage_collect): Setup bytes_free.
807 (Fmemory_free): New function.
808 (syms_of_alloc): Register it.
809
810 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
811
812 Cleanup overlays checking.
813 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
814 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
815 eassert and OVERLAYP.
816 (sort_overlays): Change to use OVERLAYP.
817
818 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
819
820 * editfns.c (Finsert_char): Make it interactive, and make the
821 second arg optional. Copy interactive spec and docstring from
822 ucs-insert.
823
824 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
825
826 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
827 Unlike the other wrapped functions, fabs has an unspecified
828 effect on errno.
829
830 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
831
832 * nsterm.m (keyDown): Interpret flags without left/right bits
833 as the left key (Bug#11670).
834
835 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
836
837 Remove empty and useless init functions.
838 * lisp.h (init_character_once, init_fns, init_image)
839 (init_filelock, init_sound): Remove prototype.
840 * character.c (init_character_once): Remove.
841 * filelock.c (init_filelock): Likewise.
842 * fns.c (init_fns): Likewise.
843 * image.c (init_image): Likewise.
844 * sound.c (init_sound): Likewise.
845 * emacs.c (main): Adjust accordingly.
846
847 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
848
849 * gtkutil.h: Tiny cleanups.
850 (use_old_gtk_file_dialog): Remove useless declaration.
851 (xg_uses_old_file_dialog): Add suggested const attribute.
852
853 2012-07-15 Eli Zaretskii <eliz@gnu.org>
854
855 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
856 (bidi_paragraph_init): Use it to limit search forward for a strong
857 directional character in abnormally large paragraphs full of
858 neutral or weak characters. (Bug#11943)
859
860 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
861
862 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
863 the toolbar (Bug#9451).
864 (xg_make_tool_item): Give the widget event box a transparent
865 background.
866
867 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
868
869 Cleanup basic allocation variables and functions.
870 * alloc.c (ignore_warnings, init_intervals, init_float)
871 (init_cons, init_symbol, init_marker): Remove.
872 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
873 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
874 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
875 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
876 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
877 (staticidx, init_alloc_once, init_strings, free_ablock):
878 Remove redundant initialization.
879 * fns.c (init_weak_hash_tables): Remove.
880 * lisp.h (init_weak_hash_tables): Remove prototype.
881
882 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
883
884 Use zero_vector where appropriate.
885 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
886 accordingly.
887 * lisp.h (zero_vector): New declaration.
888 * font.c (null_vector): Remove.
889 (syms_of_font): Remove initialization and staticpro.
890 (font_list_entities, font_find_for_lface): Change to use zero_vector.
891 * keymap.c (Faccessible_keymaps): Likewise.
892
893 2012-07-15 Leo Liu <sdl.web@gmail.com>
894
895 * fringe.c: Fix typo in comments.
896
897 2012-07-14 Leo Liu <sdl.web@gmail.com>
898
899 * fringe.c: Add a new bitmap exclamation-mark.
900
901 2012-07-14 Eli Zaretskii <eliz@gnu.org>
902
903 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
904
905 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
906 (HAVE_MENUS): Don't define, defined by editing config.in with
907 msdos/sed2v2.inp.
908 (GMALLOC_INHIBIT_VALLOC): Don't define.
909 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
910
911 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
912
913 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
914
915 2012-07-14 Glenn Morris <rgm@gnu.org>
916
917 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
918 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
919 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
920
921 2012-07-13 Glenn Morris <rgm@gnu.org>
922
923 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
924
925 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
926 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
927
928 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
929
930 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
931 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
932 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
933 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
934 where appropriate.
935 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
936 as boolean expression.
937 (x_set_window_size): Remove unused variable toolbar.
938 (ns_get_color_default, ns_mod_to_lisp): Remove.
939 (ns_mouse_position): Remove unused variables xchar and ychar.
940 (ns_compute_glyph_string_overhangs): Remove unused variable face.
941 (ns_set_vertical_scroll_bar): Remove unused variable count.
942 (ns_delete_terminal): Remove unused variable i.
943 (ns_term_init): Remove unused variables r, g and b.
944 (mouseDown): Remove unused variable window.
945 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
946 (initFrameFromEmacs): Remove unused variable vbextra.
947 (mouseEntered): Remove unused variables p and dpyinfo.
948 (mouseExited): Remove unused variables p and r.
949 (ns_define_frame_cursor, ns_clear_frame_area)
950 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
951 (menuDown): Assign [sender tag] to variable and cast the variable.
952
953 * nsterm.h (menuDown): Add id as type to argument sender.
954 (ns_display_info_for_name): Add Lisp_Object argument.
955 (ns_term_init): Add Lisp_Object argument.
956 (ns_map_event_to_object): Add void argument.
957 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
958 prototype with arguments and only declare if __OBJC__.
959 (nxatoms_of_nsselect): Add void argument.
960 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
961 (ns_alloc_autorelease_pool): Add void argument.
962 (ns_release_autorelease_pool): Add void* argument.
963 (ns_get_defaults_value): Add const char* argument.
964
965 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
966 (initFromContents): Use SSDATA where appropriate.
967 (ns_update_menubar): Add braces to ambigous if-else.
968 (initWithTitle): Put () around assignment in if statement.
969 (ns_menu_show): Remove unused variables window and keymap.
970 (update_frame_tool_bar): Remove unused variable selected_p.
971 (initWithContentRect): Remove unused variable this_cmd_name.
972
973 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
974 appropriate.
975 (setXBMColor): Remove unused variable len.
976 (setPixmapData): Put () around assignment in loop statement.
977
978 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
979 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
980 where appropriate.
981 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
982 around assignment in loop statement.
983 (nsfont_open): Remove unused variable i.
984 (nsfont_open): Remove unused variable len.
985 (nsfont_draw): Remove unused variable cs.
986
987 * nsfns.m (x_set_icon_name, ns_set_name_internal)
988 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
989 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
990 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
991 (Fns_font_name, Fns_perform_service)
992 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
993 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
994 (ns_set_name): Remove unused variable view.
995 (x_set_menu_bar_lines): Remove unused variable olines.
996 (x_set_tool_bar_lines): Remove unused variable root_window.
997 (Fns_list_colors): Put () around assignment in while statement.
998 (Fns_perform_service): Remove unused variable len.
999 (Fns_display_usable_bounds): Remove unused variable top.
1000 (syms_of_nsfns): Remove unused variable i.
1001
1002 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
1003 memcpy (Bug#11907).
1004
1005 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
1006
1007 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
1008 and free it with DestroyExceptionInfo (Bug#11558).
1009
1010 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
1011
1012 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
1013 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
1014 Set here, not in nt/config.nt.
1015
1016 2012-07-13 Eli Zaretskii <eliz@gnu.org>
1017
1018 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
1019 cursor overflow into the last glyph on display line when the right
1020 fringe is off. (Bug#11832)
1021
1022 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
1023
1024 * xdisp.c (produce_special_glyphs): Now static.
1025 * dispextern.h (produce_special_glyphs): Remove decl.
1026
1027 2012-07-13 Glenn Morris <rgm@gnu.org>
1028
1029 * s/bsd-common, s/cygwin.h: Remove empty files.
1030 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
1031
1032 * s/usg5-4-common.h (USG, USG5):
1033 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
1034 * s/sol2-6.h (SOLARIS2):
1035 * s/irix6-5.h (IRIX6_5):
1036 * s/hpux10-20.h (USG, USG5, HPUX):
1037 * s/gnu-linux.h (USG, GNU_LINUX):
1038 * s/freebsd.h (BSD_SYSTEM):
1039 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
1040 * s/cygwin.h (CYGWIN):
1041 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
1042 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
1043
1044 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
1045
1046 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
1047
1048 2012-07-13 Glenn Morris <rgm@gnu.org>
1049
1050 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
1051
1052 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
1053
1054 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
1055 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
1056
1057 2012-07-12 Glenn Morris <rgm@gnu.org>
1058
1059 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
1060
1061 * process.c (init_process_emacs): Rename from init_process.
1062 The old name is also the name of a Mach system call.
1063 * lisp.h, emacs.c: Update for this name change.
1064 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
1065 longer needed.
1066
1067 2012-07-12 Eli Zaretskii <eliz@gnu.org>
1068
1069 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
1070 memmove call that removes glyphs covered by the left truncation
1071 glyph. Improve commentary.
1072 (display_line): Fix display of continuation glyphs on GUI frames
1073 when the right fringe is turned off and variable-size fonts are
1074 used in the window. Move the code that appends a stretch glyph to
1075 produce_special_glyphs, so that it could be used for truncation
1076 and continuation glyphs alike.
1077 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
1078 glyph of a suitably computed width, to align the special glyphs at
1079 the window margin. Code moved from display_line. (Bug#11832)
1080
1081 2012-07-12 Glenn Morris <rgm@gnu.org>
1082
1083 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
1084
1085 * s/gnu-linux.h, s/hpux10-20.h:
1086 Do not unconditionally define HAVE_XRMSETDATABASE.
1087
1088 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
1089
1090 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
1091
1092 Fix typos that broke OS X build.
1093 Reported by Randal L. Schwartz in
1094 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
1095 * nsterm.m (ns_timeout): Add missing local decl.
1096 (ns_get_color): snprintf -> sprintf, to fix typo.
1097
1098 2012-07-12 Glenn Morris <rgm@gnu.org>
1099
1100 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
1101 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
1102 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
1103 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
1104
1105 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
1106 Move PTY_OPEN to configure.
1107
1108 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
1109 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
1110 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
1111
1112 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
1113
1114 Use empty_unibyte_string where applicable.
1115 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
1116 * lread.c (read1): Likewise.
1117 * xsettings.c (syms_of_xsettings): Likewise.
1118
1119 2012-07-12 Glenn Morris <rgm@gnu.org>
1120
1121 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
1122 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
1123 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
1124 * s/hpux10-20.h (RUN_TIME_REMAP):
1125 * s/bsd-common.h (TABDLY): Move to configure.
1126
1127 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
1128
1129 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
1130
1131 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
1132 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
1133
1134 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
1135
1136 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
1137 * s/template.h: Move NARROWPROTO to configure.
1138
1139 2012-07-11 Glenn Morris <rgm@gnu.org>
1140
1141 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
1142 unused since 2011-01-17 change to systty.h.
1143
1144 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
1145 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
1146 Move HAVE_PTYS and HAVE_SOCKETS to configure.
1147
1148 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
1149
1150 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
1151
1152 2012-07-11 Glenn Morris <rgm@gnu.org>
1153
1154 * s/darwin.h, s/gnu-linux.h, s/template.h:
1155 Move INTERRUPT_INPUT to configure.
1156
1157 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
1158
1159 Minor adjustments to interning code.
1160 * lisp.h (intern, intern_c_string): Redefine as static inline
1161 wrappers for intern_1 and intern_c_string_1, respectively.
1162 (intern_1, intern_c_string_1): Rename prototypes.
1163 * lread.c (intern_1, intern_c_string_1, oblookup): Simplify
1164 Vobarray checking.
1165 * font.c (font_intern_prop): Likewise. Adjust comment.
1166 * w32font.c (intern_font_name): Likewise.
1167
1168 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
1169
1170 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
1171
1172 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
1173 of Fcar/Fcdr if possible.
1174 * font.c (check_otf_features): Likewise.
1175 * fontset.c (Fnew_fontset): Likewise.
1176 * gnutls.c (Fgnutls_boot): Likewise.
1177 * minibuf.c (read_minibuf): Likewise.
1178 * msdos.c (IT_set_frame_parameters): Likewise.
1179 * xmenu.c (Fx_popup_dialog): Likewise.
1180 * w32menu.c (Fx_popup_dialog): Likewise.
1181
1182 2012-07-11 Glenn Morris <rgm@gnu.org>
1183
1184 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
1185 since nothing has defined it on these platforms.
1186
1187 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
1188 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
1189
1190 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
1191 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
1192 Move CLASH_DETECTION to configure.
1193
1194 * s/gnu.h: Remove file, which is now empty.
1195
1196 * s/gnu.h, s/gnu-linux.h:
1197 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
1198
1199 2012-07-11 John Wiegley <johnw@newartisans.com>
1200
1201 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
1202 function attribute, so we only use it if it exists in the
1203 compiler.
1204
1205 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
1206
1207 Avoid call to strlen in fast_c_string_match_ignore_case.
1208 * search.c (fast_c_string_match_ignore_case): Change to use
1209 length argument. Adjust users accordingly.
1210 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
1211
1212 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
1213
1214 Assume mkdir, rmdir.
1215 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
1216 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
1217
1218 Assume rename.
1219 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
1220
1221 Assume perror.
1222 * s/hpux10-20.h (HAVE_PERROR): Remove.
1223 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
1224 Remove dummy definition, as this problem was obsolete long ago.
1225
1226 Assume strerror.
1227 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
1228
1229 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
1230
1231 Avoid calls to strlen in font processing functions.
1232 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
1233 (font_open_by_name): Change to use length argument. Adjust
1234 users accordingly.
1235 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
1236 Adjust prototypes.
1237 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
1238 Change to return ptrdiff_t.
1239 (xfont_list_pattern, xfont_match): Use length returned by
1240 xfont_decode_coding_xlfd.
1241 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
1242
1243 2012-07-11 Glenn Morris <rgm@gnu.org>
1244
1245 * s/darwin.h, s/freebsd.h, s/netbsd.h:
1246 Move DONT_REOPEN_PTY to configure.
1247
1248 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
1249 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
1250
1251 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
1252
1253 Remove "#define unix" that is no longer needed (Bug#11905).
1254 * s/aix4-2.h (unix): Remove; no longer needed.
1255
1256 EMACS_TIME simplification (Bug#11875).
1257 This replaces macros (which typically do not work in GDB)
1258 with functions, typedefs and enums, making the code easier to debug.
1259 The functional style also makes code easier to read and maintain.
1260 * systime.h: Include <sys/time.h> on all hosts, not just if
1261 WINDOWSNT, since 'struct timeval' is needed in general.
1262 (EMACS_TIME): Now a typedef, not a macro.
1263 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
1264 not macros.
1265 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
1266 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
1267 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
1268 (EMACS_TIME_LE): Now functions, not macros.
1269 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
1270 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
1271 which are not functions. All uses rewritten to use:
1272 (make_emacs_time): New function.
1273 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
1274 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
1275 not functions. All uses rewritten to use the following, respectively:
1276 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
1277 (add_emacs_time, sub_emacs_time): New functions.
1278 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
1279 * fileio.c (Fcopy_file):
1280 * xterm.c (XTflash): Get the current time closer to when it's used.
1281 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
1282
1283 * bytecode.c (targets): Suppress -Woverride-init warnings.
1284
1285 Simplify by avoiding confusing use of strncpy etc.
1286 * doc.c (Fsnarf_documentation):
1287 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
1288 * frame.c (Fmake_terminal_frame):
1289 * gtkutil.c (get_utf8_string):
1290 * lread.c (openp):
1291 * nsmenu.m (ns_update_menubar):
1292 * regex.c (regerror):
1293 Prefer memcpy to strncpy and strncat when either will do.
1294 * fileio.c (Fsubstitute_in_file_name):
1295 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
1296 (menu_separator_name_p):
1297 * nsmenu.m (ns_update_menubar):
1298 Prefer memcmp to strncmp when either will do.
1299 * nsterm.m: Include <ftoastr.h>.
1300 (ns_get_color):
1301 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
1302 Prefer snprintf to strncpy.
1303 * nsterm.m (ns_term_init):
1304 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
1305 * nsterm.m (ns_term_init):
1306 Avoid the need for strncpy, by using build_string or
1307 make_unibyte_string directly. Use dtoastr, not snprintf.
1308 * process.c (Fmake_network_process): Diagnose service names that
1309 are too long, rather than silently truncating them or creating
1310 non-null-terminated names.
1311 (Fnetwork_interface_info): Likewise, for interface names.
1312 * sysdep.c (system_process_attributes) [GNU_LINUX]:
1313 Prefer sprintf to strncat.
1314 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
1315 Prefer vsnprintf to vsprintf + strncpy.
1316
1317 2012-07-10 Glenn Morris <rgm@gnu.org>
1318
1319 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
1320 Clarify fallback case.
1321
1322 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1323
1324 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
1325 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
1326 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
1327 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
1328 where argument type is known to be a Lisp_Cons.
1329
1330 2012-07-10 Tom Tromey <tromey@redhat.com>
1331
1332 * bytecode.c (BYTE_CODE_THREADED): New macro.
1333 (BYTE_CODES): New macro. Replaces all old byte-code defines.
1334 (enum byte_code_op): New type.
1335 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
1336 (exec_byte_code): Use them. Use token threading when applicable.
1337
1338 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1339
1340 Optimize pure C strings initialization.
1341 * lisp.h (make_pure_string): Fix prototype.
1342 (build_pure_c_string): New function, defined as static inline. This
1343 provides a better opportunity to optimize away calls to strlen when
1344 the function is called with compile-time constant argument.
1345 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
1346 argument, adjust users accordingly. Use build_pure_c_string where
1347 appropriate.
1348 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
1349 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
1350 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
1351
1352 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1353
1354 Avoid calls to strlen in miscellaneous functions.
1355 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
1356 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
1357 * lread.c (openp): Likewise.
1358
1359 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1360
1361 Avoid calls to strlen in path processing functions.
1362 * fileio.c (file_name_as_directory): Add comment. Change to add
1363 srclen argument and return the length of result. Adjust users
1364 accordingly.
1365 (directory_file_name): Fix comment. Change to add srclen argument,
1366 swap 1st and 2nd arguments to obey the common convention. Adjust
1367 users accordingly.
1368 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
1369
1370 2012-07-10 Glenn Morris <rgm@gnu.org>
1371
1372 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
1373 Move PENDING_OUTPUT_COUNT definition to configure.
1374
1375 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
1376 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
1377 * s/gnu.h (DATA_START): Move definitions to configure.
1378
1379 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
1380 We include usg5-4-common.h, which defines them both.
1381
1382 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
1383 O_RDONLY already includes it).
1384
1385 Stop ns builds setting the EMACSLOADPATH environment variable.
1386 * nsterm.m (ns_load_path): Rename from ns_init_paths.
1387 Now it does not set EMACSLOADPATH, just returns the load-path string.
1388 * nsterm.h: Update accordingly.
1389 * lread.c [HAVE_NS]: Include nsterm.h.
1390 (init_lread) [HAVE_NS]: Use ns_load_path.
1391 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
1392
1393 2012-07-09 Glenn Morris <rgm@gnu.org>
1394
1395 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
1396 since the included bsd-common.h does so.
1397
1398 Stop ns builds setting the EMACSPATH environment variable.
1399 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
1400 (ns_init_paths): Do not set EMACSPATH.
1401 * nsterm.h (ns_exec_path): Add it.
1402 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
1403 Use ns_exec_path.
1404
1405 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
1406
1407 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
1408
1409 * process.c (wait_reading_process_output): 'waitchannels' was unset
1410 when read_kbd || !NILP (wait_for_cell); fix this.
1411
1412 Add GCC-style 'const' attribute to functions that can use it.
1413 * character.h (char_resolve_modifier_mask):
1414 * keyboard.h (make_ctrl_char):
1415 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
1416 (init_character_once, next_almost_prime, init_fns, init_image)
1417 (flush_pending_output, init_sound):
1418 * mem-limits.h (start_of_data):
1419 * menu.h (finish_menu_items):
1420 Add ATTRIBUTE_CONST.
1421 * emacs.c (DEFINE_DUMMY_FUNCTION):
1422 Declare the dummy function with ATTRIBUTE_CONST.
1423 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
1424 Add decls with ATTRIBUTE_CONST.
1425
1426 Minor improvements to make_formatted_string.
1427 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
1428 where int is good enough, as vsprintf returns an int.
1429 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
1430
1431 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
1432
1433 Use make_formatted_string to avoid double length calculation.
1434 * lisp.h (make_formatted_string): New prototype.
1435 * alloc.c (make_formatted_string): New function.
1436 * buffer.c (Fgenerate_new_buffer_name): Use it.
1437 * dbus.c (syms_of_dbusbind): Likewise.
1438 * editfns.c (Fcurrent_time_zone): Likewise.
1439 * filelock.c (get_boot_time): Likewise.
1440 * frame.c (make_terminal_frame, set_term_frame_name)
1441 (x_report_frame_params): Likewise.
1442 * image.c (gs_load): Likewise.
1443 * minibuf.c (get_minibuffer): Likewise.
1444 * msdos.c (dos_set_window_size): Likewise.
1445 * process.c (make_process): Likewise.
1446 * xdisp.c (ensure_echo_area_buffers): Likewise.
1447 * xsettings.c (apply_xft_settings): Likewise.
1448
1449 2012-07-09 Glenn Morris <rgm@gnu.org>
1450
1451 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
1452 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
1453 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
1454 * nsterm.h (ns_etc_directory): Add it.
1455 * callproc.c [HAVE_NS]: Include nsterm.h.
1456 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
1457
1458 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
1459
1460 Move marker debugging code under MARKER_DEBUG.
1461 * marker.c (MARKER_DEBUG): Move marker debugging code under
1462 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
1463 for bootstrap with --enable-checking (~3x slowdown reported
1464 by Juanma Barranquero <lekktu@gmail.com>).
1465 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
1466
1467 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
1468
1469 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
1470 See <http://bugs.gnu.org/11825#29>.
1471
1472 2012-07-08 Eli Zaretskii <eliz@gnu.org>
1473
1474 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
1475 has no font, use the frame's font. (Bug#11813)
1476 (display_line): Add commentary about displaying truncation glyphs
1477 on GUI frames.
1478 (produce_special_glyphs): Move here from term.c.
1479
1480 * term.c (produce_special_glyphs): Move to xdisp.c.
1481
1482 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
1483 section.
1484
1485 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
1486
1487 * xdisp.c (display_line): Avoid warning about implicit declaration
1488 of FRAME_FONT.
1489
1490 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
1491
1492 * lisp.h: Remove empty conditional.
1493
1494 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
1495
1496 * lread.c (load_path_check): Now static.
1497
1498 Fix some minor --with-ns problems found by static checking.
1499 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
1500 (x_set_font) [!HAVE_X_WINDOWS]:
1501 * image.c (xpm_load_image) [HAVE_NS]:
1502 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
1503 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
1504 Remove unused local.
1505 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
1506 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
1507 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
1508 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
1509 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
1510 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
1511 Fix pointer signedness problem.
1512 * xfaces.c (FRAME_X_FONT_TABLE):
1513 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
1514
1515 2012-07-07 Glenn Morris <rgm@gnu.org>
1516
1517 * lread.c (load_path_check): New function, split from init_lread.
1518 (init_lread): Reorganize. Motivation:
1519 If EMACSLOADPATH is set, check/warn about that rather than the
1520 defaults, which we are not going to use. Hence we can remove
1521 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
1522 Don't warn if site-lisp directories are missing.
1523 If not installed, start from a blank load-path, since
1524 PATH_LOADSEARCH refers to the eventual installation directories.
1525
1526 2012-07-07 Eli Zaretskii <eliz@gnu.org>
1527
1528 Support truncation and continuation glyphs on GUI frames, when
1529 fringes are disabled. (Bug#11832)
1530 * xdisp.c (init_iterator): Get dimensions of truncation and
1531 continuation glyphs even if on GUI frames. Adjust
1532 it->last_visible_x on GUI frames when the left or right fringes,
1533 or both, are absent.
1534 (start_display, move_it_in_display_line_to): Handle the case of a
1535 GUI frame without a fringe to display continuation or truncation
1536 glyphs.
1537 (insert_left_trunc_glyphs): Support GUI frames: make sure
1538 truncation glyphs overwrite enough glyphs from the current line to
1539 have sufficient space in pixels.
1540 (display_line): Support truncation and continuation glyphs on GUI
1541 frames. If some spare pixels are left on the line after inserting
1542 the truncation glyphs, fill that space with a stretch glyph of a
1543 suitably computed width.
1544
1545 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
1546 produce_glyphs, to support GUI sessions.
1547
1548 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
1549
1550 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
1551
1552 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
1553
1554 Do not require float-time's arg to fit in time_t (Bug#11825).
1555 This works better on hosts where time_t is unsigned, and where
1556 float-time is applied to the (negative) difference between two times.
1557 * editfns.c (decode_time_components): Last arg is now double *,
1558 not int *, and means to store all the result as a double, without
1559 worrying about whether the seconds part fits in time_t.
1560 All callers changed.
1561 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
1562 All callers changed.
1563 (Ffloat_time): Do not fail merely because the specified time falls
1564 outside of time_t range.
1565
1566 2012-07-07 Glenn Morris <rgm@gnu.org>
1567
1568 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
1569 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
1570 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
1571
1572 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
1573
1574 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
1575 Update dependencies.
1576
1577 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
1578
1579 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
1580
1581 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
1582 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
1583 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
1584 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
1585 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
1586 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
1587
1588 * xfont.c (compare_font_names): Redo to omit the need for casts.
1589
1590 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
1591
1592 * xfns.c (Fx_change_window_property): Doc fix.
1593 * w32fns.c (Fx_change_window_property): Doc fix.
1594
1595 * w32fns.c (Fx_window_property): Accept the same arguments as the
1596 X Windows version. Doc fix.
1597 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
1598
1599 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
1600 Eli Zaretskii <eliz@gnu.org>
1601
1602 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
1603 Windows-specific code from nt/config.nt moved here.
1604 Obsolete settings removed.
1605
1606 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
1607
1608 * process.c: Avoid unnecessary calls to gettime.
1609 (wait_reading_process_output): Don't get the time of day
1610 when gobbling data immediately and not waiting, as there's no need
1611 for it in that case. This removes a FIXME.
1612
1613 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
1614
1615 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
1616 is defined (Bug#11768).
1617
1618 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1619
1620 Fix marker debugging code.
1621 * marker.c (byte_char_debug_check): Do not perform the check
1622 if buffer is not multibyte.
1623 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
1624 Call byte_char_debug_check with correct arguments.
1625
1626 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1627
1628 Compile marker debugging code only if ENABLE_CHECKING is defined.
1629 * marker.c (byte_char_debug_check, count_markers):
1630 Use only if ENABLE_CHECKING is defined.
1631 (byte_debug_flag): Remove.
1632 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
1633 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
1634
1635 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1636
1637 Avoid code repetition in marker-related functions.
1638 * marker.c (attach_marker): New function.
1639 (Fset_marker, set_marker_restricted, set_marker_both)
1640 (set_marker_restricted_both): Use it.
1641 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
1642 Consistently rename charno to charpos.
1643 (marker_position): Add eassert.
1644 (marker_byte_position): Convert to eassert.
1645
1646 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1647
1648 Simplify list operations in unchain_overlay and unchain_marker.
1649 * buffer.c (unchain_overlay): Simplify. Add comment.
1650 * marker.c (unchain_marker): Simplify. Fix comments.
1651
1652 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1653
1654 Introduce fast path for the widely used marker operation.
1655 * alloc.c (build_marker): New function.
1656 * lisp.h (build_marker): New prototype.
1657 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
1658 * composite.c (autocmp_chars): Likewise.
1659 * editfns.c (buildmark): Remove.
1660 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
1661 (save_restriction_save): Use build_marker.
1662 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
1663 * window.c (save_window_save): Likewise.
1664
1665 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1666
1667 Do not use Fdelete_overlay in delete_all_overlays
1668 to avoid redundant calls to unchain_overlay.
1669 * buffer.c (drop_overlay): New function.
1670 (delete_all_overlays, Fdelete_overlay): Use it.
1671 * minibuf.c (get_minibuffer): Fix comment.
1672
1673 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
1674
1675 Port to OpenBSD 5.1 amd64.
1676 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
1677 This is needed for OpenBSD, and should be harmless on all BSD systems.
1678 Also, include <sys/sysctl.h>, as it should be available on all
1679 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
1680 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
1681 use p_pid member, not kp_proc.pid.
1682
1683 2012-07-06 Glenn Morris <rgm@gnu.org>
1684
1685 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
1686
1687 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
1688
1689 More xmalloc and related cleanup.
1690 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
1691 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
1692 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
1693 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
1694 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
1695 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
1696 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
1697 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
1698 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
1699 * xterm.c:
1700 Omit needless casts involving void * pointers and allocation.
1701 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
1702 as the former is more robust if P's type is changed.
1703 Prefer xzalloc to xmalloc + memset 0.
1704 Simplify malloc-or-realloc to realloc.
1705 Don't worry about xmalloc returning a null pointer.
1706 Prefer xstrdup to xmalloc + strcpy.
1707 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
1708 growing it.
1709 * keyboard.c (apply_modifiers_uncached): Prefer local array to
1710 alloca of a constant.
1711
1712 2012-07-05 Eli Zaretskii <eliz@gnu.org>
1713
1714 * xdisp.c (display_line): Fix horizontal pixel coordinates when
1715 hscroll is larger than the line width. Fixes long and futile
1716 looping inside extend_face_to_end_of_line (on a TTY) producing
1717 glyphs that are not needed and thrown away.
1718
1719 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
1720
1721 * marker.c (set_marker_restricted_both): Simplify by using
1722 clip_to_bounds.
1723
1724 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
1725
1726 * editfns.c (region_limit): Simplify by using clip_to_bounds.
1727
1728 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
1729
1730 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
1731 not defined (Bug#11768).
1732 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
1733 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
1734 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
1735 followed by gtk_box_set_homogeneous (Bug#11768).
1736 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
1737 (update_theme_scrollbar_width, xg_create_scroll_bar):
1738 Use gtk_scrollbar_new (Bug#11768).
1739 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
1740 (is_box_type): New function (Bug#11768).
1741 (xg_tool_item_stale_p): Call is_box_type.
1742 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
1743 with default display (Bug#11768).
1744
1745 2012-07-05 Eli Zaretskii <eliz@gnu.org>
1746
1747 * xdisp.c (window_hscroll_limited): New function.
1748 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
1749 coordinates when window's hscroll is set to insanely large
1750 values. (Bug#11857)
1751
1752 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
1753
1754 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
1755 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
1756
1757 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
1758
1759 Cleanup xmalloc.
1760 * lisp.h (xzalloc): New prototype. Omit needless casts.
1761 * alloc.c (xzalloc): New function. Omit needless casts.
1762 * charset.c: Omit needless casts. Convert all calls to
1763 xmalloc with following memset to xzalloc.
1764 * dispnew.c: Likewise.
1765 * fringe.c: Likewise.
1766 * image.c: Likewise.
1767 * sound.c: Likewise.
1768 * term.c: Likewise.
1769 * w32fns.c: Likewise.
1770 * w32font.c: Likewise.
1771 * w32term.c: Likewise.
1772 * xfaces.c: Likewise.
1773 * xfns.c: Likewise.
1774 * xterm.c: Likewise.
1775 * atimer.c: Omit needless casts.
1776 * buffer.c: Likewise.
1777 * callproc.c: Likewise.
1778 * ccl.c: Likewise.
1779 * coding.c: Likewise.
1780 * composite.c: Likewise.
1781 * doc.c: Likewise.
1782 * doprnt.c: Likewise.
1783 * editfns.c: Likewise.
1784 * emacs.c: Likewise.
1785 * eval.c: Likewise.
1786 * filelock.c: Likewise.
1787 * fns.c: Likewise.
1788 * gtkutil.c: Likewise.
1789 * keyboard.c: Likewise.
1790 * lisp.h: Likewise.
1791 * lread.c: Likewise.
1792 * minibuf.c: Likewise.
1793 * msdos.c: Likewise.
1794 * print.c: Likewise.
1795 * process.c: Likewise.
1796 * region-cache.c: Likewise.
1797 * search.c: Likewise.
1798 * sysdep.c: Likewise.
1799 * termcap.c: Likewise.
1800 * terminal.c: Likewise.
1801 * tparam.c: Likewise.
1802 * w16select.c: Likewise.
1803 * w32.c: Likewise.
1804 * w32reg.c: Likewise.
1805 * w32select.c: Likewise.
1806 * w32uniscribe.c: Likewise.
1807 * widget.c: Likewise.
1808 * xdisp.c: Likewise.
1809 * xmenu.c: Likewise.
1810 * xrdb.c: Likewise.
1811 * xselect.c: Likewise.
1812
1813 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
1814
1815 * fileio.c (time_error_value): Check the right error number.
1816 Problem reported by Troels Nielsen in
1817 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
1818
1819 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1820
1821 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
1822 This should be fixed in a better way; see Eli Zaretskii in
1823 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
1824 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
1825
1826 * fileio.c (time_error_value): Rename from special_mtime.
1827 The old name's problems were noted by Eli Zaretskii in
1828 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
1829
1830 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
1831 This variable's comment says Emacs needs at least one GDB-visible
1832 symbol of type enum pvec_type, to work around GDB problems.
1833 The symbol's value doesn't matter.
1834
1835 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
1836 that causes compilation to fail on pre-C99 compilers.
1837
1838 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
1839
1840 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
1841 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
1842
1843 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
1844
1845 * buffer.c (init_buffer_once): Fix initialization of
1846 headers for buffer_defaults and buffer_local_symbols.
1847 Reported by Juanma Barranquero <lekktu@gmail.com>.
1848
1849 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
1850
1851 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
1852 * lisp.h (enum pvec_type): Use fewer bits.
1853 (PSEUDOVECTOR_SIZE_BITS): New constant.
1854 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
1855 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
1856 change in pvec_type.
1857 (PSEUDOVECTOR_TYPEP): New macro.
1858 (TYPED_PSEUDOVECTORP): Use it.
1859 * fns.c (internal_equal): Adapt code to extract pvectype.
1860 * emacs.c (gdb_pvec_type): Update type.
1861 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
1862 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
1863 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
1864 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
1865 (sweep_vectors): Use it. Use local var `total_bytes' instead of
1866 abusing vector->header.next.nbytes.
1867 (live_vector_p): Use PVEC_TYPE.
1868 (mark_object): Adapt code to extract pvectype. Use switch.
1869
1870 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1871
1872 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
1873 Tighten new eassert a bit.
1874
1875 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
1876
1877 Fix compilation with --enable-gcc-warnings and -O1
1878 optimization level.
1879 * doprnt.c (doprnt): Change type of tem to int, initialize
1880 to avoid compiler warning. Add eassert.
1881 * search.c (simple_search): Initialize match_byte to avoid
1882 compiler warning. Add eassert.
1883
1884 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1885
1886 Avoid weird behavior with large horizontal scrolls.
1887 Without this change, for example, large hscroll values would
1888 mess up Emacs's display on Fedora 15 x86, presumably due to
1889 overflows in int calculations in the display code.
1890 Also, if buffers had long lines, Emacs would freeze.
1891 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
1892 (set_window_hscroll): New function, containing the old guts of
1893 Fset_window_hscroll. Return the clipped value.
1894 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
1895 This avoids the need to check against PTRDIFF_MAX.
1896
1897 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
1898
1899 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
1900
1901 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
1902
1903 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1904
1905 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
1906 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
1907 since GCC 4.4.6 issues a bogus warning for them.
1908
1909 Fix bugs in file timestamp newness comparisons.
1910 * fileio.c (Ffile_newer_than_file_p):
1911 * lread.c (Fload): Use full timestamp resolution of files,
1912 not just the 1-second resolution, so that files that are only
1913 slightly newer still count as newer.
1914 * fileio.c (Ffile_newer_than_file_p): Don't assume file
1915 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
1916
1917 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
1918
1919 * fileio.c: Improve handling of file time marker. (Bug#11852)
1920 (special_mtime): New function.
1921 (Finsert_file_contents, Fverify_visited_file_modtime):
1922 Use it to set special mtime values consistently.
1923
1924 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
1925
1926 * fileio.c (Finsert_file_contents): Properly handle st_mtime
1927 marker for non-existing file. (Bug#11852)
1928
1929 2012-07-03 Glenn Morris <rgm@gnu.org>
1930
1931 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
1932 and did not make it into globals.h).
1933
1934 2012-07-03 Tom Tromey <tromey@redhat.com>
1935
1936 * window.c (Fset_window_margins, Fset_window_fringes)
1937 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
1938 * textprop.c (Fprevious_property_change): No longer static.
1939 * syntax.c (Fsyntax_table_p): No longer static.
1940 * process.c (Fget_process, Fprocess_datagram_address): No longer
1941 static.
1942 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
1943 * keyboard.c (Fcommand_execute): No longer static.
1944 Remove EXFUN.
1945 * insdel.c (Fcombine_after_change_execute): No longer static.
1946 * image.c (Finit_image_library): No longer static.
1947 * fileio.c (Fmake_symbolic_link): No longer static.
1948 * eval.c (Ffetch_bytecode): No longer static.
1949 * editfns.c (Fuser_full_name): No longer static.
1950 * doc.c (Fdocumentation_property, Fsnarf_documentation):
1951 No longer static.
1952 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
1953 static.
1954 * dired.c (Ffile_attributes): No longer static.
1955 * composite.c (Fcomposition_get_gstring): No longer static.
1956 * callproc.c (Fgetenv_internal): No longer static.
1957
1958 * ccl.h: Remove EXFUNs.
1959 * buffer.h: Remove EXFUNs.
1960 * dispextern.h: Remove EXFUNs.
1961 * intervals.h: Remove EXFUNs.
1962 * fontset.h: Remove EXFUN.
1963 * font.h: Remove EXFUNs.
1964 * dosfns.c (system_process_attributes): Remove EXFUN.
1965 * keymap.h: Remove EXFUNs.
1966 * lisp.h: Remove EXFUNs.
1967 * w32term.h: Remove EXFUNs.
1968 * window.h: Remove EXFUNs.
1969 * xsettings.h: Remove EXFUN.
1970 * xterm.h: Remove EXFUN.
1971
1972 2012-07-03 Glenn Morris <rgm@gnu.org>
1973
1974 * lisp.h (Frandom): Make it visible to C.
1975 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
1976 buffer for invisible buffers. (Bug#1229)
1977
1978 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1979
1980 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
1981 values which aren't power of 2.
1982 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro. Verify
1983 it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
1984 accordingly.
1985
1986 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
1987
1988 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
1989
1990 * alloc.c (mark_object): Revert part of last patch to use `switch'.
1991
1992 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1993
1994 * alloc.c (allocate_vector_block): Remove redundant
1995 calls to mallopt if DOUG_LEA_MALLOC is defined.
1996 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
1997 avoid calls to mallopt if zero_vector is returned.
1998
1999 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
2000
2001 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
2002 is enabled, avoid dereferencing NULL current_sblock if
2003 running undumped.
2004
2005 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
2006
2007 Cleanup basic buffer management.
2008 * buffer.h (struct buffer): Change layout to use generic vector
2009 marking code. Fix some comments. Change type of 'clip_changed'
2010 to bitfield. Remove unused #ifndef old.
2011 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
2012 (GET_OVERLAYS_AT): Fix indentation.
2013 (for_each_per_buffer_object_at): New macro.
2014 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
2015 (Fbuffer_local_variables): Use it.
2016 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
2017 * alloc.c (allocate_buffer): Adjust to match new layout of
2018 struct buffer. Fix comment.
2019 (mark_overlay): New function.
2020 (mark_buffer): Use it. Use mark_vectorlike to mark normal
2021 Lisp area of struct buffer.
2022 (mark_object): Use it. Adjust marking of misc objects
2023 and related comments.
2024
2025 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
2026
2027 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
2028 wrapper that is not needed because the wrapped code is a no-op (zero
2029 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
2030 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
2031
2032 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
2033
2034 * alloc.c (mark_buffer): Simplify. Remove prototype.
2035 (mark_object): Add comment. Reorganize marking of vector-like
2036 objects. Use CHECK_LIVE for all vector-like objects except buffers
2037 and subroutines when GC_CHECK_MARKED_OBJECTS is defined. Avoid
2038 redundant calls to mark_vectorlike for bool vectors.
2039
2040 2012-06-30 Glenn Morris <rgm@gnu.org>
2041
2042 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
2043
2044 * epaths.in (PATH_SITELOADSEARCH): New.
2045 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
2046 This is rather than relying on --enable-locallisppath elements
2047 having "site-lisp" in their names. (Bug#10208#25, 11658)
2048
2049 2012-06-30 Eli Zaretskii <eliz@gnu.org>
2050
2051 * w32proc.c (sys_select): Accept and ignore one more argument.
2052
2053 * w32.c (emacs_gnutls_pull): Call select with one more argument.
2054
2055 * sysselect.h [DOS_NT]: Don't include sys/select.h.
2056 (pselect) [!MS_DOS]: Redirect to sys_select.
2057
2058 * sysdep.c: Don't include dos.h and dosfns.h.
2059
2060 * process.c (sys_select):
2061 * msdos.c (sys_select): Accept one more argument and ignore it.
2062
2063 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
2064 adapt data types and code to that.
2065
2066 * dosfns.c:
2067 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
2068 which clashes with the gnulib function of the same name.
2069
2070 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
2071
2072 * font.c (font_style_to_value, font_style_symbolic)
2073 (font_prop_validate_style): Add type checks for values in
2074 font_style_table.
2075
2076 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
2077 argument.
2078 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
2079 uses.
2080
2081 2012-06-29 Eli Zaretskii <eliz@gnu.org>
2082
2083 * xdisp.c (try_window_id): Undo last change.
2084
2085 * w32.c (getwd): Adjust commentary about startup_dir.
2086 (init_environment): Always call sys_access, even in non-MSVC
2087 builds. Don't chdir to the directory of the Emacs executable.
2088 This undoes code from 1997 which was justified by the need to
2089 "avoid conflicts when removing and renaming directories". But its
2090 downside was that every relative file name was being interpreted
2091 relative to the directory of the Emacs executable, which can never
2092 be TRT. In particular, it broke sys_access when called with
2093 relative file names.
2094 (sys_access): Map GetLastError to errno.
2095
2096 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
2097
2098 * window.h (struct window): Change type of 'fringes_outside_margins'
2099 to bitfield. Fix comment. Adjust users accordingly.
2100 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2101 Adjust comment.
2102 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
2103 to ptrdiff_t.
2104
2105 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
2106
2107 * gnutls.c (emacs_gnutls_handshake):
2108 Add QUIT to make the loop interruptible.
2109
2110 2012-06-29 Glenn Morris <rgm@gnu.org>
2111
2112 * charset.c (init_charset): Make lack of etc/charsets fatal.
2113
2114 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
2115
2116 * editfns.c (region_limit): Fix type mismatch.
2117
2118 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
2119
2120 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
2121 undefined. Convert from xassert to eassert.
2122 * nsmenu.m: Convert from xassert to eassert.
2123 * nsterm.m: Likewise.
2124
2125 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
2126
2127 * editfns.c (region_limit): Clip to narrowing (bug#11770).
2128
2129 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
2130
2131 Avoid integer overflow on scroll-left and scroll-right.
2132 * window.c (HSCROLL_MAX): New macro.
2133 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
2134 overflow when requested scroll falls outside ptrdiff_t range.
2135
2136 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2137
2138 * window.h (struct window): Change type of 'hscroll',
2139 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
2140 'last_modified' and 'last_overlay_modified' to EMACS_INT.
2141 Adjust users accordingly.
2142 * xdisp.c (try_cursor_movement): Replace type check with eassert.
2143 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
2144 from EMACS_INT to ptrdiff_t.
2145 (make_window): Omit redundant initialization.
2146
2147 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
2148
2149 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
2150
2151 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2152
2153 * window.h (struct window): Change type of 'use_time' and
2154 'sequence_number' from Lisp_Object to int.
2155 * frame.c (make_frame): Adjust users accordingly.
2156 * print.c (print_object): Likewise.
2157 * window.c (select_window, Fwindow_use_time, make_parent_window)
2158 (make_window): Likewise.
2159
2160 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2161
2162 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
2163 enabled with --enable-checking=[all,glyphs] configure option.
2164 Fix GLYPH_DEBUG usage assuming that it may be undefined,
2165 adjust comments accordingly.
2166 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
2167 undefined, adjust comments accordingly.
2168 * image.c: Likewise.
2169 * scroll.c: Likewise.
2170 * w32fns.c: Likewise.
2171 * w32term.c: Likewise.
2172 * xdisp.c: Likewise.
2173 * xfaces.c: Likewise.
2174 * xfns.c: Likewise.
2175 * xterm.c: Likewise.
2176
2177 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2178
2179 Generalize run-time debugging checks.
2180 * dispextern.h (XASSERTS): Remove.
2181 * fontset.c (xassert): Remove.
2182 Convert from xassert to eassert.
2183 * alloc.c: Convert from xassert to eassert.
2184 * bidi.c: Likewise.
2185 * dispnew.c: Likewise.
2186 * fns.c: Likewise.
2187 * fringe.c: Likewise.
2188 * ftfont.c: Likewise.
2189 * gtkutil.c: Likewise.
2190 * image.c: Likewise.
2191 * keyboard.c: Likewise.
2192 * menu.c: Likewise.
2193 * process.c: Likewise.
2194 * scroll.c: Likewise.
2195 * sound.c: Likewise.
2196 * term.c: Likewise.
2197 * w32console.c: Likewise.
2198 * w32fns.c: Likewise.
2199 * w32term.c: Likewise.
2200 * window.c: Likewise.
2201 * xdisp.c: Likewise.
2202 * xfaces.c: Likewise.
2203 * xfns.c: Likewise.
2204 * xselect.c: Likewise.
2205 * xterm.c: Likewise.
2206
2207 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
2208
2209 * fns.c (maybe_resize_hash_table): Output message when growing the
2210 purify-hashtable.
2211
2212 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2213
2214 * alloc.c (allocate_string_data): Remove dead code.
2215 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
2216 avoid GCC warning about unused macro.
2217
2218 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2219
2220 * alloc.c (allocate_string): Omit intervals initialization.
2221 * alloc.c (make_uninit_multibyte_string): Initialize intervals
2222 as in make_pure_string and make_pure_c_string.
2223
2224 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2225
2226 * alloc.c (allocate_string): Fix last change.
2227
2228 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2229
2230 * alloc.c (allocate_string): Remove two redundant calls
2231 to memset, add explicit initialization where appropriate.
2232
2233 2012-06-27 Glenn Morris <rgm@gnu.org>
2234
2235 * lisp.mk (lisp): Remove paths.elc.
2236
2237 2012-06-27 Chong Yidong <cyd@gnu.org>
2238
2239 * doc.c (Fsubstitute_command_keys): Fix punctuation.
2240
2241 2012-06-26 John Wiegley <johnw@newartisans.com>
2242
2243 * unexmacosx.c (copy_data_segment): Add two section names used
2244 on Mac OS X Lion: __mod_init_func and __mod_term_func.
2245
2246 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
2247 when building with Clang.
2248
2249 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
2250
2251 * eval.c (Fapply): Allow calling it with a single argument.
2252
2253 2012-06-26 Eli Zaretskii <eliz@gnu.org>
2254
2255 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
2256 _stricmp and _strnicmp.
2257 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
2258
2259 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
2260
2261 * alloc.c (allocate_window): Zero out non-Lisp part of newly
2262 allocated window.
2263 (allocate_process): Likewise for new process.
2264 (allocate_terminal): Change to use offsetof.
2265 (allocate_frame): Likewise.
2266 * frame.c (make_frame): Omit redundant initialization.
2267 * window.c (make_parent_window): Use memset.
2268 (make_window): Omit redundant initialization.
2269 * process.c (make_process): Omit redundant initialization.
2270 * terminal.c (create_terminal): Likewise.
2271
2272 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
2273
2274 * term.c (delete_tty): Remove redundant call to memset.
2275
2276 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
2277
2278 * alloc.c: Remove build_string.
2279 * lisp.h: Define build_string as static inline. This provides
2280 a better opportunity to optimize away calls to strlen when the
2281 function is called with compile-time constant argument.
2282 * image.c (imagemagick_error): Convert to build_string.
2283 * w32proc.c (sys_spawnve): Likewise.
2284 * xterm.c (x_term_init): Likewise.
2285
2286 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
2287
2288 Use sprintf return value instead of invoking strlen on result.
2289 In the old days this wasn't portable, since some sprintf
2290 implementations returned char *. But they died out years ago and
2291 Emacs already assumes sprintf returns int.
2292 Similarly for float_to_string.
2293 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
2294 * ccl.c (ccl_driver):
2295 * character.c (string_escape_byte8):
2296 * data.c (Fnumber_to_string):
2297 * doprnt.c (doprnt):
2298 * print.c (print_object):
2299 * xdisp.c (message_dolog):
2300 * xfns.c (syms_of_xfns):
2301 Use sprintf or float_to_string result to avoid need to call strlen.
2302 * data.c (Fnumber_to_string):
2303 Use make_unibyte_string, since the string must be ASCII.
2304 * lisp.h, print.c (float_to_string): Now returns int length.
2305 * term.c (produce_glyphless_glyph):
2306 Use sprintf result rather than recomputing it.
2307
2308 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
2309 * Makefile.in (ALL_CFLAGS):
2310 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
2311 * gmalloc.c, regex.c: Include <config.h> unconditionally.
2312
2313 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
2314
2315 * dispextern.h (xstrcasecmp): Define to library function
2316 strcasecmp if available.
2317 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
2318
2319 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
2320
2321 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
2322 Avoid comma operator.
2323 * menu.c (push_submenu_start, push_submenu_end)
2324 (push_left_right_boundary, push_menu_pane): Likewise.
2325 * msdos.c (dos_rawgetc): Likewise.
2326
2327 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
2328
2329 * xfns.c (xic_create_fontsetname): Remove redundant calls
2330 to memset.
2331
2332 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
2333
2334 * gtkutil.c (get_utf8_string): Remove redundant assignment.
2335 sprintf already null-terminates its output.
2336
2337 * xfns.c (x_window): Remove redundant cast.
2338
2339 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
2340
2341 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
2342 `const char *' to `char *' to avoid compiler warning.
2343
2344 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
2345
2346 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
2347 instead of truncating it to 63 (admittedly a generous limit).
2348
2349 * process.c: Fix spelling and caps in comments.
2350
2351 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
2352
2353 * emacs.c (setpgrp): Remove definition, unused.
2354 * sysdep.c (setpgrp): Remove definition, not used in this file.
2355
2356 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
2357
2358 * makefile.w32-in: Update dependencies.
2359
2360 2012-06-24 Eli Zaretskii <eliz@gnu.org>
2361
2362 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
2363 (SYSTIME_H): Add nt/inc/sys/time.h.
2364
2365 * systime.h [WINDOWSNT]: Include sys/time.h.
2366
2367 * s/ms-w32.h (struct timespec): Definition moved from
2368 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
2369
2370 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
2371
2372 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
2373 * buffer.h (buffer_slot_type_mismatch):
2374 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
2375 * eval.c (unwind_to_catch):
2376 * image.c (my_png_error, my_error_exit):
2377 * keyboard.c (quit_throw_to_read_char, user_error)
2378 (Fexit_recursive_edit, Fabort_recursive_edit):
2379 * lisp.h (die, args_out_of_range, args_out_of_range_3)
2380 (wrong_type_argument, buffer_overflow, __executable_start)
2381 (memory_full, buffer_memory_full, string_overflow, Fthrow)
2382 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
2383 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
2384 (fatal):
2385 (child_setup) [!DOS_NT]:
2386 * lread.c (end_of_file_error, invalid_syntax):
2387 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
2388 * puresize.h (pure_write_error):
2389 * search.c (matcher_overflow):
2390 * sound.c (sound_perror, alsa_sound_perror):
2391 * sysdep.c, syssignal.h (croak):
2392 * term.c (maybe_fatal, vfatal):
2393 * textprop.c (text_read_only):
2394 * undo.c (user_error):
2395 * unexmacosx.c (unexec_error):
2396 * xterm.c (x_ins_del_lines, x_delete_glyphs):
2397 Use _Noreturn rather than NO_RETURN.
2398 No need for separate decl merely because of _Noreturn.
2399 * sound.c (sound_warning, parse_sound):
2400 Remove unnecessary forward decls.
2401
2402 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
2403
2404 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
2405 * lisp.h (WAIT_READING_MAX): New macro.
2406 * dispnew.c (Fsleep_for, sit_for):
2407 * keyboard.c (kbd_buffer_get_event):
2408 * process.c (Faccept_process_output):
2409 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
2410 This improves on the previous patch, which introduced a bug
2411 when time_t is unsigned and as wide as intmax_t.
2412 See <http://bugs.gnu.org/9000#51>.
2413
2414 2012-06-23 Eli Zaretskii <eliz@gnu.org>
2415
2416 * dispnew.c (sit_for, Fsleep_for):
2417 * keyboard.c (kbd_buffer_get_event):
2418 * process.c (Faccept_process_output): Avoid compiler warnings when
2419 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
2420
2421 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
2422
2423 * makefile.w32-in: Update dependencies.
2424
2425 * w32.c (ltime): Add return type and declare static.
2426 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
2427
2428 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
2429
2430 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
2431 Privately reported by Herbert J. Skuhra.
2432 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
2433 All uses changed.
2434 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
2435 not make_lisp_timeval, when the argument is of type EMACS_TIME.
2436
2437 2012-06-23 Eli Zaretskii <eliz@gnu.org>
2438
2439 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
2440 last argument of make_unibyte_string.
2441
2442 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
2443 language ID in the event parameters.
2444
2445 * w32term.c (w32_read_socket): Put the new keyboard codepage into
2446 event.code, not the obscure "character set ID".
2447
2448 2012-06-23 Chong Yidong <cyd@gnu.org>
2449
2450 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
2451
2452 2012-06-23 Eli Zaretskii <eliz@gnu.org>
2453
2454 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
2455 * w32.c (fdutimens): New function.
2456
2457 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
2458
2459 * s/ms-w32.h (pselect): Redirect to sys_select.
2460
2461 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
2462
2463 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
2464 in the logic of incrementing and decrementing the value of
2465 use_relocatable_buffers.
2466
2467 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
2468
2469 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
2470 Privately reported by Herbert J. Skuhra.
2471 [__FreeBSD__]: Remove "*/" typo after "#include".
2472 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
2473 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
2474 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
2475 Don't assume EMACS_TIME and struct timeval are the same type.
2476
2477 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
2478
2479 Support higher-resolution time stamps (Bug#9000).
2480 The time stamps are only nanosecond-resolution at the C level,
2481 since that's the best that any real-world system supports now.
2482 But they are picosecond-resolution at the Lisp level, as that's
2483 easy, and leaves room for future OS improvements.
2484
2485 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
2486 (LIBES): Use it.
2487
2488 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
2489 Don't get current time unless it's needed.
2490
2491 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
2492 now provides it if it's absent.
2493 (start_atimer): Port to higher-res time stamps.
2494 Check for time stamp overflow. Don't get current time more
2495 often than is needed.
2496
2497 * buffer.h (struct buffer): Buffer modtime now has high resolution.
2498 Include systime.h, not time.h.
2499 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
2500
2501 * dired.c: Include stat-time.h.
2502 (Ffile-attributes): File times now have higher resolution.
2503
2504 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
2505 (struct image): Timestamp now has higher resolution.
2506
2507 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
2508 has at least microseconds now. All uses removed.
2509 (update_frame, update_single_window, update_window, update_frame_1)
2510 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
2511
2512 * editfns.c (time_overflow): Now extern.
2513 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
2514 (float-time, Fformat_time_string, Fcurrent_time_string)
2515 (Fcurrent_time_zone): Accept and generate higher-resolution
2516 time stamps.
2517 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
2518 (decode_time_components, lisp_seconds_argument): New functions.
2519 (make_time): Now static.
2520 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
2521 Report an error if the time is invalid, rather than having the caller
2522 do that.
2523
2524 * fileio.c: Include <stat-time.h>
2525 (Fcopy_file): Copy higher-resolution time stamps.
2526 Prefer to set the time stamp via a file descriptor if that works.
2527 (Fset_file_times, Finsert_file_contents, Fwrite_region)
2528 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
2529 (Fvisited_file_modtime, Fset_visited_file_modtime):
2530 Support higher-resolution time stamps.
2531
2532 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
2533
2534 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
2535
2536 * image.c (prepare_image_for_display, clear_image_cache)
2537 (lookup_image): Port to higer-resolution time stamps.
2538
2539 * keyboard.c (start_polling, bind_polling_period):
2540 Check for time stamp overflow.
2541 (read_char, kbd_buffer_get_event, timer_start_idle)
2542 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
2543 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
2544 Port to higher-resolution time stamps. Do not assume time_t is signed.
2545 (decode_timer): New function. Timers are now vectors of length 9,
2546 not 8, to accommodate the picosecond component.
2547 (timer_check_2): Use it.
2548
2549 * nsterm.m (select_timeout, timeval_subtract): Remove.
2550 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
2551 as they're a bit more accurate and handle overflow better.
2552 (ns_select): Change prototype to be compatible with pselect.
2553 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
2554 * nsterm.h (ns_select): Adjust prototype.
2555
2556 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
2557 us-resolution time stamps.
2558 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
2559
2560 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
2561
2562 * lisp.h (time_overflow): New decl.
2563 (wait_reading_process_output): First arg is now intmax_t, not int,
2564 to accommodate larger waits.
2565
2566 * process.h (struct Lisp_Process.read_output_delay):
2567 Now counts nanoseconds, not microseconds.
2568 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
2569 EMACS_HAS_USECS.
2570 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
2571 (wait_reading_process_output):
2572 Port to ns-resolution time stamps.
2573 (Faccept_process_output, wait_reading_process_output):
2574 Check for time stamp overflow. Do not assume time_t is signed.
2575 (select_wrapper): Remove; we now use pselect.
2576 (Fprocess_attributes): Now generates ns-resolution time stamps.
2577
2578 * sysdep.c: Include utimens.h. Don't include utime.h
2579 or worry about struct utimbuf; gnulib does that for us now.
2580 (gettimeofday): Remove; gnulib provides a substitute.
2581 (make_timeval): New function.
2582 (set_file_times): Now sets ns-resolution time stamps.
2583 New arg FD; all uses changed.
2584 (time_from_jiffies, ltime_from_jiffies, get_up_time)
2585 (system_process_attributes):
2586 Now returns ns-resolution time stamp. All uses changed.
2587 Check for time stamp overflow.
2588
2589 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
2590 provides a substitute now.
2591
2592 * systime.h: Include timespec.h rather than sys/time.h and time.h,
2593 since it guarantees struct timespec.
2594 (EMACS_TIME): Now struct timespec, so that we can support
2595 ns-resolution time stamps.
2596 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
2597 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
2598 (EMACS_USECS): Remove.
2599 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
2600 so multiply the arg by 1000 before storing it.
2601 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
2602 New macros.
2603 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
2604 Port to ns-resolution time stamps.
2605 (EMACS_TIME_NEG_P): Remove; replaced by....
2606 (EMACS_TIME_SIGN): New macro.
2607 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
2608 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
2609 (set_file_times, make_time, lisp_time_argument): Adjust signature.
2610 (make_timeval, make_lisp_time, decode_time_components): New decls.
2611 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
2612 that it mishandled time_t overflow. You can't compare by subtracting!
2613 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
2614 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
2615
2616 * term.c: Include <sys/time.h>.
2617 (timeval_to_Time): New function, for proper overflow wraparound.
2618 (term_mouse_position, term_mouse_click): Use it.
2619
2620 * undo.c (record_first_change): Support higher-resolution time stamps
2621 in the undo buffer.
2622 (Fprimitive_undo): Use them when restoring time stamps.
2623
2624 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
2625 (w32_get_internal_run_time):
2626 Port to higher-resolution Emacs time stamps.
2627 (ltime): Now accepts single 64-bit integer, as that's more convenient
2628 for callers.
2629
2630 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
2631
2632 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
2633 for compatibility with pselect. Support ns-resolution time stamps.
2634
2635 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
2636
2637 * xselect.c (wait_for_property_change, x_get_foreign_selection):
2638 Check for time stamp overflow, and support ns-resolution time stamps.
2639
2640 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
2641 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
2642 (timeval_subtract): Remove; no longer needed.
2643 (XTflash, XTring_bell, x_wait_for_event):
2644 Port to ns-resolution time stamps. Don't assume time_t is signed.
2645
2646 2012-06-22 Chong Yidong <cyd@gnu.org>
2647
2648 * xdisp.c (x_consider_frame_title): Revert last change.
2649
2650 2012-06-22 Eli Zaretskii <eliz@gnu.org>
2651
2652 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
2653 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
2654 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
2655 staticidx goes up to 1597 out of 1600 = 0x640.)
2656
2657 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
2658
2659 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
2660 Otherwise, the umask might be mistakenly 0 while handling input signals.
2661
2662 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
2663
2664 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
2665
2666 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
2667
2668 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
2669 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
2670 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
2671 access to `contents' member of Lisp_Vector objects with AREF and ASET
2672 where appropriate.
2673
2674 2012-06-19 Chong Yidong <cyd@gnu.org>
2675
2676 * frame.c (delete_frame): When selecting a frame on a different
2677 text terminal, do not alter the terminal's top-frame.
2678
2679 * xdisp.c (format_mode_line_unwind_data): Record the target
2680 frame's selected window and its terminal's top-frame.
2681 (unwind_format_mode_line): Restore them.
2682 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
2683 Callers changed.
2684 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
2685 since tty frames can be explicitly named.
2686 (prepare_menu_bars): Likewise.
2687
2688 * term.c (Ftty_top_frame): New function.
2689
2690 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
2691
2692 Port byte-code-meter to modern targets.
2693 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
2694 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
2695 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
2696 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
2697 (METER_1, METER_2): Simplify.
2698
2699 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
2700
2701 * data.c (Fdefalias): Return `symbol' (bug#11686).
2702
2703 2012-06-18 Martin Rudalics <rudalics@gmx.at>
2704
2705 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
2706 gets killed during executing of this function (Bug#11665).
2707 Try to always return Qt when the buffer has been actually killed.
2708 (Vkill_buffer_query_functions): In doc-string say that functions
2709 run by this hook should not change the current buffer.
2710
2711 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
2712
2713 Fix recently-introduced process.c problems found by static checking.
2714 * process.c (write_queue_push, write_queue_pop, send_process):
2715 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
2716 (write_queue_pop): Fix pointer signedness problem.
2717 (send_process): Remove unused local.
2718
2719 2012-06-17 Chong Yidong <cyd@gnu.org>
2720
2721 * xdisp.c (redisplay_internal): No need to redisplay terminal
2722 frames that are not on top.
2723
2724 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
2725
2726 * process.c (make_process): Initialize write_queue.
2727 (write_queue_push, write_queue_pop): New functions.
2728 (send_process): Use them to maintain correct ordering of process
2729 writes (Bug#10815).
2730
2731 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
2732
2733 * lisp.h (eassert): Assume C89 or later.
2734 This removes the need for CHECK.
2735 (CHECK): Remove. Its comments about always evaluating its
2736 argument were confusing, as 'eassert' typically does not evaluate
2737 its argument.
2738
2739 * coding.c (produce_chars): Use ptrdiff_t, not int.
2740
2741 * xterm.c (x_draw_underwave): Check for integer overflow.
2742 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
2743
2744 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
2745
2746 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
2747 referenced (Bug#11583).
2748
2749 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
2750
2751 Implement wave-style variant of underlining.
2752 * dispextern.h (face_underline_type): New enum.
2753 (face): Add field for underline type.
2754 * nsterm.m (ns_draw_underwave): New function.
2755 (ns_draw_text_decoration): Use it.
2756 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
2757 New functions.
2758 (x_draw_glyph_string): Use them.
2759 * xfaces.c (Qline, Qwave): New Lisp objects.
2760 (check_lface_attrs, merge_face_ref)
2761 (Finternal_set_lisp_face_attribute, realize_x_face):
2762 Handle wave-style underline face attributes.
2763 * xterm.c (x_draw_underwave): New function.
2764 (x_draw_glyph_string): Use it.
2765
2766 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
2767
2768 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
2769 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
2770 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
2771 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
2772 ($(BLD)/w32select.$(O)): Update dependencies.
2773
2774 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
2775
2776 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
2777 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
2778 * character.c (_fetch_multibyte_char_p): Remove.
2779 * alloc.c: Include "character.h" before "buffer.h".
2780 * bidi.c: Likewise.
2781 * buffer.c: Likewise.
2782 * bytecode.c: Likewise.
2783 * callint.c: Likewise.
2784 * callproc.c: Likewise.
2785 * casefiddle.c: Likewise.
2786 * casetab.c: Likewise.
2787 * category.c: Likewise.
2788 * cmds.c: Likewise.
2789 * coding.c: Likewise.
2790 * composite.c: Likewise.
2791 * dired.c: Likewise.
2792 * dispnew.c: Likewise.
2793 * doc.c: Likewise.
2794 * dosfns.c: Likewise.
2795 * editfns.c: Likewise.
2796 * emacs.c: Likewise.
2797 * fileio.c: Likewise.
2798 * filelock.c: Likewise.
2799 * font.c: Likewise.
2800 * fontset.c: Likewise.
2801 * fringe.c: Likewise.
2802 * indent.c: Likewise.
2803 * insdel.c: Likewise.
2804 * intervals.c: Likewise.
2805 * keyboard.c: Likewise.
2806 * keymap.c: Likewise.
2807 * lread.c: Likewise.
2808 * macros.c: Likewise.
2809 * marker.c: Likewise.
2810 * minibuf.c: Likewise.
2811 * nsfns.m: Likewise.
2812 * nsmenu.m: Likewise.
2813 * print.c: Likewise.
2814 * process.c: Likewise.
2815 * regex.c: Likewise.
2816 * region-cache.c: Likewise.
2817 * search.c: Likewise.
2818 * syntax.c: Likewise.
2819 * term.c: Likewise.
2820 * textprop.c: Likewise.
2821 * undo.c: Likewise.
2822 * unexsol.c: Likewise.
2823 * w16select.c: Likewise.
2824 * w32fns.c: Likewise.
2825 * w32menu.c: Likewise.
2826 * window.c: Likewise.
2827 * xdisp.c: Likewise.
2828 * xfns.c: Likewise.
2829 * xmenu.c: Likewise.
2830 * xml.c: Likewise.
2831 * xselect.c: Likewise.
2832
2833 2012-06-16 Eli Zaretskii <eliz@gnu.org>
2834
2835 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
2836 If all the glyphs of the glyph row came from strings, and we have no
2837 cursor positioning clues, put the cursor on the first glyph of the
2838 row.
2839 (handle_face_prop): Use chunk-relative overlay string index when
2840 indexing into it->string_overlays array. (Bug#11653)
2841 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
2842 the rightmost. (Bug#11720)
2843
2844 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
2845
2846 * category.h (CHAR_HAS_CATEGORY): Define as inline.
2847 (CATEGORY_MEMBER): Enforce 1/0 value.
2848 * category.c (_temp_category_set): Remove.
2849
2850 2012-06-16 Eli Zaretskii <eliz@gnu.org>
2851
2852 * window.c (Fdelete_other_windows_internal)
2853 (Fdelete_window_internal): Don't access frame's mouse highlight
2854 info of the initial frame. (Bug#11677)
2855
2856 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
2857
2858 * .gdbinit (xgetint): Fix recently-introduced paren typo.
2859 Assume USE_2_TAGS_FOR_INTS.
2860 (xreload): Adjust $tagmask width to match recent lisp.h change.
2861
2862 Simplify lisp.h in minor ways that should not affect code.
2863 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
2864 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
2865 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
2866 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
2867 (INTTYPEBITS): New macro, for clarity.
2868 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
2869 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
2870 Simplify now that USE_LSB_TAG is always defined.
2871 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
2872 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
2873
2874 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
2875
2876 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
2877
2878 2012-06-13 Glenn Morris <rgm@gnu.org>
2879
2880 * s/bsd-common.h (BSD4_3):
2881 * s/usg5-4-common.h (USG5_4): No longer define; unused.
2882
2883 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
2884
2885 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
2886 instead of union.
2887 (XLI, XIL): Define.
2888 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
2889 Use them.
2890 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
2891 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
2892 * alloc.c (widen_to_Lisp_Object): Remove.
2893 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
2894 * frame.c (delete_frame): Remove outdated comment.
2895 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
2896 USE_LISP_UNION_TYPE.
2897 (Fw32_unregister_hot_key): Likewise.
2898 (Fw32_toggle_lock_key): Likewise.
2899 * w32menu.c (add_menu_item): Likewise.
2900 (w32_menu_display_help): Use XIL instead of checking
2901 USE_LISP_UNION_TYPE.
2902 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
2903 (init_heap): Likewise.
2904 * w32term.c (w32_read_socket): Update comment.
2905
2906 2012-06-13 Glenn Morris <rgm@gnu.org>
2907
2908 * s/usg5-4-common.h, src/s/unixware.h:
2909 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
2910
2911 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
2912
2913 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
2914
2915 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
2916 * alloc.c (make_number) [!defined make_number]:
2917 Remove, as lisp.h always defines this now.
2918 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
2919 (roundup_size): Verify that it is a power of 2.
2920 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
2921 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
2922 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
2923 -DUSE_LSB_TAG=0, to override the automatically-selected default.
2924 USE_LSB_TAG now is always defined to be either 0 or 1.
2925 All uses changed.
2926 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
2927 code works fine either way, and efficiency is not a concern here,
2928 as the union type is for debugging, not for production.
2929 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
2930 Use an inline function on all platforms when using the union type,
2931 since this is simpler and 'static inline' can be used portably
2932 within Emacs now.
2933 (LISP_INITIALLY_ZERO): New macro.
2934 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
2935 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
2936
2937 2012-06-12 Glenn Morris <rgm@gnu.org>
2938
2939 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
2940
2941 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
2942
2943 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
2944 Move BROKEN_SIGIO to configure.
2945
2946 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
2947 Move NO_TERMIO to configure.
2948
2949 2012-06-12 Chong Yidong <cyd@gnu.org>
2950
2951 * image.c (imagemagick_load_image): Use MagickFlattenImage if
2952 MagickMergeImageLayers is undefined. Use pixel pusher loop if
2953 MagickExportImagePixels is undefined.
2954
2955 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
2956
2957 * image.c (imagemagick_load_image): Remove unused label.
2958
2959 2012-06-11 Glenn Morris <rgm@gnu.org>
2960
2961 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2962 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
2963 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
2964 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
2965
2966 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
2967
2968 * alloc.c (make_byte_code): New function.
2969 (Fmake_byte_code): Use it. Don't purify here.
2970 * lread.c (read1): Use it as well to avoid extra allocation.
2971
2972 2012-06-11 Chong Yidong <cyd@gnu.org>
2973
2974 * image.c (imagemagick_load_image): Implement transparency.
2975
2976 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
2977
2978 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
2979 account for preceding backslashes. (Bug#11663)
2980
2981 2012-06-09 Chong Yidong <cyd@gnu.org>
2982
2983 * term.c: Support italics in capable terminals (Bug#9652).
2984 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
2985 (turn_on_face): Output using TS_enter_italic_mode if available.
2986 Don't handle unused blinking and alt-charset cases.
2987 (turn_off_face): Handle italic case; discard unused tty_blinking_p
2988 and tty_alt_charset_p cases.
2989 (tty_capable_p, init_tty): Support italics.
2990
2991 * termchar.h (struct tty_display_info): Add field for italics.
2992 Remove unused blink field.
2993
2994 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
2995 Handle slant.
2996
2997 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
2998 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
2999 tty_alt_charset_p. Add tty_italic_p.
3000
3001 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
3002
3003 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
3004 dbus_type_is_basic if available.
3005 (xd_extract_signed, xd_extract_unsigned): Rename from
3006 extract_signed and extract_unsigned, respectively. Adapt callers.
3007
3008 2012-06-09 Chong Yidong <cyd@gnu.org>
3009
3010 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
3011
3012 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
3013 case (Bug#9752).
3014
3015 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
3016
3017 * xdisp.c (vmessage): Treat frame message as multibyte.
3018 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
3019 would generate the diagnostic "Making \302\247 buffer-local while
3020 let-bound!".
3021
3022 2012-06-08 Eli Zaretskii <eliz@gnu.org>
3023
3024 * dispnew.c (showing_window_margins_p): Undo last change, which
3025 was done due to an inadvertent commit.
3026 (adjust_frame_glyphs_for_frame_redisplay): Do call
3027 showing_window_margins_p.
3028
3029 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
3030
3031 * eval.c (Fmake_var_non_special): New primitive.
3032 (syms_of_eval): Defsubr it.
3033 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
3034
3035 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
3036
3037 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
3038 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
3039
3040 2012-06-08 Eli Zaretskii <eliz@gnu.org>
3041
3042 * alloc.c (allocate_vectorlike): Fix last change.
3043
3044 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
3045
3046 Block-based vector allocation of small vectors.
3047 * lisp.h (struct vectorlike_header): New field `nbytes',
3048 adjust comment accordingly.
3049 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
3050 to denote vector blocks. Adjust users (live_vector_p,
3051 mark_maybe_pointer, valid_lisp_object_p) accordingly.
3052 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
3053 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
3054 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
3055 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
3056 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
3057 (roundup_size): New constant.
3058 (struct vector_block): New data type.
3059 (vector_blocks, vector_free_lists, zero_vector): New variables.
3060 (all_vectors): Rename to `large_vectors'.
3061 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
3062 (sweep_vectors): New functions.
3063 (allocate_vectorlike): Return `zero_vector' as the only vector of
3064 0 items. Allocate new vector from block if vector size is less than
3065 or equal to VBLOCK_BYTES_MAX.
3066 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
3067 (init_alloc_once): Add call to init_vectors.
3068
3069 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
3070
3071 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
3072
3073 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
3074
3075 * doprnt.c (doprnt): Truncate multibyte char correctly.
3076 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
3077 would mishandle a string argument "Xc" if X was a multibyte
3078 character of length 2: it would truncate after X's first byte
3079 rather than including all of X.
3080
3081 2012-06-06 Chong Yidong <cyd@gnu.org>
3082
3083 * buffer.c (word_wrap): Doc fix.
3084
3085 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
3086
3087 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
3088
3089 2012-06-03 Glenn Morris <rgm@gnu.org>
3090
3091 * xdisp.c (tool-bar-style): Doc fix.
3092
3093 2012-06-03 Ulrich Müller <ulm@gentoo.org>
3094
3095 * Makefile.in (PAXCTL): Define.
3096 (temacs$(EXEEXT)): Disable memory randomization for the temacs
3097 binary via PaX flags if the paxctl utility is available.
3098 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3099 Restore PaX flags to their default. (Bug#11398)
3100
3101 2012-06-03 Chong Yidong <cyd@gnu.org>
3102
3103 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
3104 buffer (Bug#11226).
3105
3106 2012-06-03 Chong Yidong <cyd@gnu.org>
3107
3108 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
3109 (note_mode_line_or_margin_highlight): If there is no help echo,
3110 use mode-line-default-help-echo. Handle the case where the mouse
3111 position is past the end of the mode line string.
3112
3113 * buffer.c (buffer_local_value_1): New function, split from
3114 Fbuffer_local_value; can return Qunbound.
3115 (Fbuffer_local_value): Use it.
3116 (Vmode_line_format): Docstring tweaks.
3117
3118 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
3119
3120 * sysdep.c (system_process_attributes): Improve comment.
3121
3122 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
3123
3124 * keyboard.c: Export real-this-command to Elisp.
3125 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
3126 and DEFVAR it. Update all users.
3127
3128 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
3129
3130 * minibuf.c (Fassoc_string): Remove duplicate declaration.
3131
3132 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
3133 Convert pctcpu and pctmem to Lisp float properly.
3134 Let the compiler fold better, as 100.0/0x8000 is exact.
3135
3136 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
3137
3138 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
3139 cons_block.
3140
3141 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
3142
3143 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
3144
3145 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
3146
3147 For a 'struct window', replace some Lisp_Object fields to
3148 bitfields where appropriate, remove unused fields.
3149 * window.h (struct window): Remove unused 'last_mark_x' and
3150 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
3151 change it's type from Lisp_Object to bitfield.
3152 Change type of 'force_start', 'optional_new_start',
3153 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
3154 fields from Lisp_Object to bitfield. Adjust users accordingly.
3155
3156 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
3157
3158 Pacify gcc -Wdouble-precision when using Xaw.
3159 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
3160 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
3161 Use 'float' consistently, rather than 'float' in most places
3162 and 'double' in a couple of places.
3163
3164 2012-05-31 Eli Zaretskii <eliz@gnu.org>
3165
3166 * xdisp.c (handle_stop): Detect whether we have overlay strings
3167 loaded by testing it->current.overlay_string_index to be
3168 non-negative, instead of checking whether n_overlay_strings is
3169 positive. (Bug#11587)
3170
3171 2012-05-31 Chong Yidong <cyd@gnu.org>
3172
3173 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
3174
3175 * doc.c (Fsubstitute_command_keys): Doc fix.
3176
3177 2012-05-31 Eli Zaretskii <eliz@gnu.org>
3178
3179 * search.c (search_buffer): Remove calls to
3180 r_alloc_inhibit_buffer_relocation, as it is now called by
3181 maybe_unify_char, which was the cause of relocation of buffer text
3182 in bug#11519.
3183
3184 2012-05-31 Eli Zaretskii <eliz@gnu.org>
3185
3186 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
3187 for the duration of call to load_charset, to avoid problems with
3188 callers of maybe_unify_char that access buffer text through C
3189 pointers.
3190
3191 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
3192 decrement the inhibition flag, instead of just setting or
3193 resetting it.
3194
3195 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
3196
3197 Remove obsolete '#define static' cruft.
3198 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
3199 This #undef was "temporary" in 2000; it is no longer needed
3200 now that '#define static' has gone away.
3201 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
3202 (gray_bitmap_bits): Remove; no longer needed.
3203 All uses replaced with definiens.
3204 * xterm.c: Include "bitmaps/gray.xbm".
3205
3206 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
3207
3208 Clean up __executable_start, monstartup when --enable-profiling.
3209 The following changes affect the code only when profiling.
3210 * dispnew.c (__executable_start): Rename from safe_bcopy.
3211 Define only on platforms that need it.
3212 * emacs.c: Include <sys/gmon.h> when profiling.
3213 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
3214 (__executable_start): Remove decl, since lisp.h does it now.
3215 (safe_bcopy): Remove decl; no longer has that name.
3216 (main): Coalesce #if into single bit of code, for simplicity.
3217 Cast pointers to uintptr_t, since standard libraries want integers
3218 and not pointers.
3219 * lisp.h (__executable_start): New decl.
3220
3221 2012-05-31 Glenn Morris <rgm@gnu.org>
3222
3223 * image.c (Fimagemagick_types): Doc fix.
3224
3225 2012-05-30 Jim Meyering <meyering@redhat.com>
3226
3227 * callproc.c (Fcall_process_region): Include directory component
3228 in mkstemp error message (Bug#11586).
3229
3230 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
3231
3232 * alloc.c, lisp.h (make_pure_vector): Now static.
3233
3234 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
3235
3236 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
3237 Move to byte-run.el.
3238 (Fautoload): Do the hash-doc more carefully.
3239 * data.c (Fdefalias): Purify definition, except for keymaps.
3240 (Qdefun): Move from eval.c.
3241 * lisp.h (Qdefun): Remove.
3242 * lread.c (read1): Tiny simplification.
3243
3244 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
3245
3246 Do not create empty overlays with the evaporate property (Bug#9642).
3247 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
3248 Bug#9642, but explicitly check that the buffer the overlay would
3249 be moved to is live and rearrange lines to make sure that errors
3250 will not put the overlay in an inconsistent state.
3251 (Fdelete_overlay): Cosmetics.
3252
3253 2012-05-28 Eli Zaretskii <eliz@gnu.org>
3254
3255 * w32term.c (my_bring_window_to_top): New function.
3256 (x_raise_frame): Use handle returned by DeferWindowPos, which
3257 could be different from the original one.
3258 Call my_bring_window_to_top instead of my_set_foreground_window.
3259 (Bug#11513)
3260
3261 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
3262 by calling BringWindowToTop.
3263
3264 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
3265 (WM_EMACS_END): Increase by one.
3266
3267 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
3268
3269 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
3270 This avoids undefined behavior that might cause the eassert
3271 to not catch an out-of-range value.
3272
3273 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
3274
3275 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
3276 Update dependencies.
3277
3278 2012-05-27 Eli Zaretskii <eliz@gnu.org>
3279
3280 * bidi.c (bidi_mirror_char): Fix last change.
3281
3282 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
3283
3284 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
3285 when referring to sectname field in printf format.
3286
3287 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
3288
3289 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
3290 Only r_alloc_inhibit_buffer_relocation needed to be added;
3291 the others were already declared.
3292
3293 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
3294 before checking whether it's out of range. Put the check inside
3295 eassert. See
3296 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
3297
3298 2012-05-27 Ken Brown <kbrown@cornell.edu>
3299
3300 * callproc.c (Fcall_process): Restore a line that was accidentally
3301 commented out in the 2011-02-13 change (bug#11547).
3302
3303 2012-05-27 Eli Zaretskii <eliz@gnu.org>
3304
3305 * lisp.h [REL_ALLOC]: Add prototypes for external functions
3306 defined on ralloc.c.
3307
3308 * buffer.c [REL_ALLOC]: Remove prototypes of
3309 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
3310 they are now on lisp.h.
3311
3312 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
3313
3314 * search.c (search_buffer): Use it to inhibit relocation of buffer
3315 text while re_search_2 is doing its job, because re_search_2 is
3316 passed C pointers to buffer text. (Bug#11519)
3317
3318 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
3319 Update value to 24.
3320
3321 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
3322 state after an additional call to move_it_in_display_line_to, keep
3323 the values of it->max_ascent and it->max_descent found for the
3324 entire line.
3325 (pos_visible_p): Revert the comparison against bottom_y to what it
3326 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
3327 (Bug#11464)
3328
3329 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
3330
3331 Fix coding-related core dumps with gcc -ftrapv.
3332 The code was computing A - B, where A and B are pointers, and B is
3333 random garbage. This can lead to core dumps on platforms that
3334 have special pointer registers, and it also leads to core dumps on
3335 x86-64 when compiled with gcc -ftrapv. The fix is to compute
3336 A - B only when B is initialized properly.
3337 * coding.c (coding_set_source, coding_set_destination): Return void.
3338 (coding_change_source, coding_change_destinations): New functions,
3339 with the old behaviors of coding_set_source and coding_set_destination.
3340 All callers that need an offset changed to use these new functions.
3341
3342 2012-05-26 Glenn Morris <rgm@gnu.org>
3343
3344 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
3345
3346 2012-05-26 Eli Zaretskii <eliz@gnu.org>
3347
3348 Extend mouse support on W32 text-mode console.
3349 * xdisp.c (draw_row_with_mouse_face):
3350 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
3351
3352 * w32console.c: Include window.h.
3353 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
3354 New functions.
3355 (initialize_w32_display): Initialize mouse-highlight data.
3356
3357 * w32inevt.c: Include termchar.h and window.h.
3358 (do_mouse_event): Support mouse-autoselect-window. When the mouse
3359 moves, call note_mouse_highlight. If help_echo changed, call
3360 gen_help_event to produce help-echo message in the echo area.
3361 Call clear_mouse_face if mouse_face_hidden is set in the mouse
3362 highlight info.
3363
3364 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
3365
3366 * lread.c (read1): Simplify slightly to avoid an overflow warning
3367 with GCC 4.7.0 on x86-64.
3368
3369 2012-05-26 Eli Zaretskii <eliz@gnu.org>
3370
3371 * bidi.c (bidi_mirror_char): Revert last change: an int is
3372 definitely wide enough here.
3373
3374 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3375
3376 Fix integer width and related bugs (Bug#9874).
3377 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
3378 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
3379 (string_bytes, check_sblock, allocate_string_data):
3380 (compact_small_strings, Fmake_bool_vector, make_string)
3381 (make_unibyte_string, make_multibyte_string)
3382 (make_string_from_bytes, make_specified_string)
3383 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
3384 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
3385 (mark_vectorlike):
3386 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3387 (allocate_pseudovector):
3388 Use int, not EMACS_INT, where int is wide enough.
3389 (inhibit_garbage_collection, Fgarbage_collect):
3390 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3391 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
3392 int might not be wide enough.
3393 (bidi_cache_search, bidi_cache_find, bidi_init_it)
3394 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
3395 (bidi_at_paragraph_end, bidi_find_paragraph_start)
3396 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
3397 (bidi_level_of_next_char, bidi_move_to_visually_next):
3398 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3399 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
3400 (Fkill_buffer, Fset_buffer_major_mode)
3401 (advance_to_char_boundary, Fbuffer_swap_text)
3402 (Fset_buffer_multibyte, overlays_at, overlays_in)
3403 (overlay_touches_p, struct sortvec, record_overlay_string)
3404 (overlay_strings, recenter_overlay_lists)
3405 (adjust_overlays_for_insert, adjust_overlays_for_delete)
3406 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
3407 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
3408 (Foverlay_recenter, last_overlay_modification_hooks_used)
3409 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
3410 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3411 (validate_region): Omit unnecessary test for b <= e,
3412 since that's guaranteed by the previous test.
3413 (adjust_overlays_for_delete): Avoid pos + length overflow.
3414 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
3415 (report_overlay_modification):
3416 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3417 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
3418 Omit pointer cast, which isn't needed anyway, and doesn't work
3419 after the EMACS_INT -> ptrdiff_t change.
3420 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
3421 * buffer.h: Adjust decls to match defn changes elsewhere.
3422 (struct buffer_text, struct buffer):
3423 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3424 Use EMACS_INT, not int, where int might not be wide enough.
3425 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
3426 not int, to avoid needless 32-bit limit on 64-bit hosts.
3427 (exec_byte_code): Use tighter memory-full test, one that checks
3428 for alloca overflow. Don't compute the address of the object just
3429 before an array, as that's not portable. Use EMACS_INT, not
3430 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
3431 * callint.c (Fcall_interactively):
3432 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3433 * callproc.c (call_process_kill, Fcall_process):
3434 Don't assume pid_t fits into an Emacs fixnum.
3435 (call_process_cleanup, Fcall_process, child_setup):
3436 Don't assume pid_t fits into int.
3437 (call_process_cleanup, Fcall_process, delete_temp_file)
3438 (Fcall_process_region):
3439 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3440 (Fcall_process): Simplify handling of volatile integers.
3441 Use int, not EMACS_INT, where int will do.
3442 * casefiddle.c (casify_object, casify_region, operate_on_word)
3443 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
3444 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3445 (casify_object): Avoid integer overflow when overallocating buffer.
3446 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
3447 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
3448 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
3449 * category.h (CATEGORYP): Don't assume arg is nonnegative.
3450 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
3451 integers are now checked earlier. All uses replaced with XINT.
3452 (ccl_driver):
3453 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3454 For CCL_MapSingle, check that content and value are in int range.
3455 (ccl_driver, Fregister_code_conversion_map):
3456 Check that Vcode_version_map_vector is a vector.
3457 (resolve_symbol_ccl_program): Check that vector header is in range.
3458 Always copy the vector, so that we can check its contents reliably
3459 now rather than having to recheck each instruction as it's being
3460 executed. Check that vector words fit in 'int'.
3461 (ccl_get_compiled_code, Fregister_ccl_program)
3462 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
3463 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
3464 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
3465 contents are in range.
3466 (Fccl_execute_on_string): Check that status is in range.
3467 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
3468 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
3469 Accept and return EMACS_INT, not int, because callers can pass values
3470 out of 'int' range.
3471 (c_string_width, strwidth, lisp_string_width, chars_in_text)
3472 (multibyte_chars_in_text, parse_str_as_multibyte)
3473 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
3474 (str_as_unibyte, str_to_unibyte, string_count_byte8)
3475 (string_escape_byte8, Fget_byte):
3476 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3477 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
3478 avoid mishandling large integers.
3479 * character.h: Adjust decls to match defn changes elsewhere.
3480 * charset.c (load_charset_map_from_file, find_charsets_in_text)
3481 (Ffind_charset_region):
3482 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3483 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
3484 (load_charset_map_from_vector, Fdefine_charset_internal):
3485 Don't assume fixnum fits in int.
3486 (load_charset_map_from_vector, Fmap_charset_chars):
3487 Remove now-unnecessary CHECK_NATNUMs.
3488 (Fdefine_charset_internal): Check ranges here, more carefully.
3489 Don't rely on undefined behavior with signed left shift overflow.
3490 Don't assume unsigned int fits into fixnum, or that fixnum fits
3491 into unsigned int. Don't require max_code to be a valid fixnum;
3492 that's not true for gb10830 4-byte on a 32-bit host. Allow
3493 invalid_code to be a cons, for the same reason. Require code_offset
3494 to be a character. Avoid int overflow if max_char is close
3495 to INT_MAX.
3496 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
3497 this is intended anyway and avoids some undefined behavior.
3498 (load_charset_map): Pass unsigned, not int, as 2nd arg of
3499 INDEX_TO_CODE_POINT, as that's what it expects.
3500 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
3501 * charset.h (DECODE_CHAR): Return int, not unsigned;
3502 this is what was intended anyway, and it avoids undefined behavior.
3503 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
3504 integer-overflow issues.
3505 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
3506 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
3507 where the argument is EMACS_INT, and this behavior is not intended.
3508 * chartab.c (Fmake_char_table, Fset_char_table_range)
3509 (uniprop_get_decoder, uniprop_get_encoder):
3510 Don't assume fixnum fits in int.
3511 * cmds.c (move_point): New function, that does the gist of
3512 Fforward_char and Fbackward_char, but does so while checking
3513 for integer overflow more accurately.
3514 (Fforward_char, Fbackward_char): Use it.
3515 (Fforward_line, Fend_of_line, internal_self_insert)
3516 (internal_self_insert):
3517 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3518 Fix a FIXME, by checking for integer overflow when calculating
3519 target_clm and actual_clm.
3520 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
3521 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
3522 (ASSURE_DESTINATION, coding_alloc_by_realloc)
3523 (coding_alloc_by_making_gap, alloc_destination)
3524 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
3525 (encode_coding_utf_16, detect_coding_emacs_mule)
3526 (decode_coding_emacs_mule, encode_coding_emacs_mule)
3527 (detect_coding_iso_2022, decode_coding_iso_2022)
3528 (encode_invocation_designation, encode_designation_at_bol)
3529 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
3530 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
3531 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
3532 (encode_coding_ccl, encode_coding_raw_text)
3533 (detect_coding_charset, decode_coding_charset)
3534 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
3535 (produce_composition, produce_charset, produce_annotation)
3536 (decode_coding, handle_composition_annotation)
3537 (handle_charset_annotation, consume_chars, decode_coding_gap)
3538 (decode_coding_object, encode_coding_object, detect_coding_system)
3539 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
3540 (code_convert_region, code_convert_string)
3541 (Fdefine_coding_system_internal)
3542 (coding_set_source, coding_set_destination):
3543 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3544 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
3545 (Fdefine_coding_system_internal):
3546 Don't assume fixnums fit in int.
3547 (decode_coding_gap, decode_coding_object, encode_coding_object)
3548 (Fread_coding_system, Fdetect_coding_region)
3549 (Funencodable_char_position, Fcheck_coding_systems_region)
3550 (get_translation, handle_composition_annotation, consume_chars):
3551 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3552 (consume_chars): Rewrite to not calculate an address outside buffer.
3553 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
3554 Don't access memory outside of the args array.
3555 (Fdefine_coding_system_internal): Check for charset-id overflow.
3556 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
3557 result of ENCODE_CHAR.
3558 * coding.h: Adjust decls to match defn changes elsewhere.
3559 (struct coding_system):
3560 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3561 * composite.c (get_composition_id, find_composition)
3562 (run_composition_function, update_compositions)
3563 (compose_text, composition_gstring_put_cache)
3564 (composition_gstring_p, composition_gstring_width)
3565 (fill_gstring_header, fill_gstring_body, autocmp_chars)
3566 (composition_compute_stop_pos, composition_reseat_it)
3567 (composition_update_it, struct position_record)
3568 (find_automatic_composition, composition_adjust_point)
3569 (Fcomposition_get_gstring, Ffind_composition_internal):
3570 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3571 (update_compositions):
3572 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3573 * composite.h: Adjust decls to match defn changes elsewhere.
3574 (struct composition):
3575 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3576 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
3577 Do not attempt to compute the address of the object just before a
3578 buffer; this is not portable.
3579 (Faref, Faset):
3580 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3581 (Faset): Use int, not EMACS_INT, where int is wide enough.
3582 (Fstring_to_number): Don't assume fixnums fit in int.
3583 (Frem): Don't assume arg is nonnegative.
3584 * dbusbind.c (xd_append_arg): Check for integers out of range.
3585 (Fdbus_call_method): Don't overflow the timeout int.
3586 (extract_signed, extract_unsigned): New functions.
3587 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
3588 (xd_get_connection_references): Return ptrdiff_t, not int.
3589 All uses changed.
3590 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
3591 (xd_read_message_1):
3592 Use int, not unsigned, where the dbus API uses int.
3593 (Fdbus_message_internal): Don't overflow mtype.
3594 (syms_of_dbusbind): Allocate right-sized buffer for integers.
3595 * dired.c (directory_files_internal, file_name_completion, scmp)
3596 (file_name_completion_stat):
3597 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3598 (file_name_completion): Don't overflow matchcount.
3599 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
3600 * dispextern.h: Adjust decls to match defn changes elsewhere.
3601 (struct text_pos, struct glyph, struct bidi_saved_info)
3602 (struct bidi_string_data, struct bidi_it, struct composition_it)
3603 (struct it):
3604 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3605 (struct display_pos, struct composition_it, struct it):
3606 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3607 * dispnew.c (increment_matrix_positions)
3608 (increment_row_positions, mode_line_string)
3609 (marginal_area_string):
3610 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3611 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
3612 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3613 (duration_to_sec_usec): New function, to check for overflow better.
3614 (Fsleep_for, sit_for): Use it.
3615 * doc.c (get_doc_string, store_function_docstring):
3616 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3617 (get_doc_string, Fsnarf_documentation):
3618 Use int, not EMACS_INT, where int is wide enough.
3619 (get_doc_string):
3620 Use SAFE_ALLOCA, not alloca.
3621 Check for overflow when converting EMACS_INT to off_t.
3622 * doprnt.c (doprnt):
3623 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3624 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
3625 Don't assume uid_t fits into fixnum.
3626 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
3627 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
3628 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
3629 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
3630 (general_insert_function)
3631 (Finsert_char, make_buffer_string, make_buffer_string_both)
3632 (update_buffer_properties, Fbuffer_substring)
3633 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
3634 (Fsubst_char_in_region, check_translation)
3635 (Ftranslate_region_internal, save_restriction_restore, Fformat)
3636 (transpose_markers, Ftranspose_regions):
3637 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3638 (clip_to_bounds): Move to lisp.h as an inline function).
3639 (Fconstrain_to_field): Don't assume integers are nonnegative.
3640 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
3641 (Fsubst_char_in_region, Fsave_restriction):
3642 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3643 (Femacs_pid): Don't assume pid_t fits into fixnum.
3644 (lo_time): Use int, not EMACS_INT, when int suffices.
3645 (lisp_time_argument): Check for usec out of range.
3646 (Fencode_time): Don't assume fixnum fits in int.
3647 (Fuser_login_name, Fuser_full_name): Signal an error
3648 if a uid argument is out of range, rather than relying on
3649 undefined behavior.
3650 (Fformat_time_string): Remove now-unnecessary check.
3651 lisp_time_argument checks for out-of-range usec now.
3652 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
3653 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
3654 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
3655 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
3656 (init_cmdargs, Fdump_emacs):
3657 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3658 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
3659 the bottom (typically) 32 bits of the fixnum.
3660 * eval.c (specpdl_size, call_debugger):
3661 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3662 (when_entered_debugger, Fbacktrace_debug):
3663 Don't assume fixnum can fit in int.
3664 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
3665 the object just before a buffer; this is not portable.
3666 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
3667 (grow_specpdl, unbind_to):
3668 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3669 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
3670 (grow_specpdl): Simplify allocation by using xpalloc.
3671 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
3672 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
3673 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
3674 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3675 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
3676 (a_write, e_write):
3677 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3678 (Fcopy_file, non_regular_nbytes, read_non_regular)
3679 (Finsert_file_contents):
3680 Use int, not EMACS_INT, where int is wide enough.
3681 (READ_BUF_SIZE): Verify that it fits in int.
3682 (Finsert_file_contents): Check that counts are in proper range,
3683 rather than assuming fixnums fit into ptrdiff_t etc.
3684 Don't assume fixnums fit into int.
3685 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
3686 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
3687 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
3688 (string_char_to_byte, string_byte_to_char)
3689 (string_make_multibyte, string_to_multibyte)
3690 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
3691 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
3692 (substring_both, Fdelete, internal_equal, Ffillarray)
3693 (Fclear_string, mapcar1)
3694 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
3695 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
3696 (larger_vector, make_hash_table, maybe_resize_hash_table)
3697 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
3698 (Fmaphash, secure_hash):
3699 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3700 (concat): Check for string index and length overflow.
3701 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
3702 (Frequire):
3703 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3704 (larger_vector): New API (vec, incr_min, size_max) replaces old
3705 one (vec, new_size, init). This catches size overflow.
3706 INIT was removed because it was always Qnil.
3707 All callers changed.
3708 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
3709 the upper bound on a hash table index size.
3710 (make_hash_table, maybe_resize_hash_table): Use it.
3711 (secure_hash): Computer start_byte and end_byte only after
3712 they're known to be in ptrdiff_t range.
3713 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
3714 (Ffont_get_glyphs, Ffont_at):
3715 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3716 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
3717 (Flist_fonts, Fopen_font):
3718 Don't assume fixnum can fit in int.
3719 (check_gstring): Don't assume index can fit in int.
3720 (font_match_p): Check that fixnum is a character, not a nonnegative
3721 fixnum, since the later code needs to stuff it into an int.
3722 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
3723 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
3724 conversion overflow issues.
3725 (Fopen_font): Check for integer out of range.
3726 (Ffont_get_glyphs): Don't assume index can fit in int.
3727 * font.h: Adjust decls to match defn changes elsewhere.
3728 * fontset.c (reorder_font_vector): Redo score calculation to avoid
3729 integer overflow.
3730 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
3731 printmax_t, where ptrdiff_t is wide enough.
3732 (Finternal_char_font):
3733 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3734 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
3735 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
3736 (Fset_frame_position, x_set_frame_parameters)
3737 (x_set_line_spacing, x_set_border_width)
3738 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
3739 Check that fixnums are in proper range for system types.
3740 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
3741 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3742 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
3743 Use SAFE_ALLOCA_LISP, not alloca.
3744 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
3745 intptr_t is wide enough.
3746 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
3747 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
3748 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
3749 Check for fixnum out of range.
3750 * ftfont.c (ftfont_list): Don't assume index fits in int.
3751 Check that fixnums are in proper range for system types.
3752 (ftfont_shape_by_flt):
3753 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3754 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
3755 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3756 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
3757 Check that fixnums are in proper range for system types.
3758 * gnutls.h: Adjust decls to match defn changes elsewhere.
3759 * gtkutil.c (xg_dialog_run):
3760 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3761 (update_frame_tool_bar):
3762 Check that fixnums are in proper range for system types.
3763 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
3764 (lookup_image): Check that fixnums are in range for system types.
3765 * indent.c (last_known_column, last_known_column_point):
3766 (current_column_bol_cache):
3767 (skip_invisible, current_column, check_display_width):
3768 (check_display_width, scan_for_column, current_column_1)
3769 (Findent_to, Fcurrent_indentation, position_indentation)
3770 (indented_beyond_p, Fmove_to_column, compute_motion):
3771 (Fcompute_motion, Fvertical_motion):
3772 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3773 (last_known_column_modified): Use EMACS_INT, not int.
3774 (check_display_width):
3775 (Fcompute_motion):
3776 Check that fixnums and floats are in proper range for system types.
3777 (compute_motion): Don't assume index or fixnum fits in int.
3778 (compute_motion, Fcompute_motion):
3779 Use int, not EMACS_INT, when it is wide enough.
3780 (vmotion): Omit local var start_hpos that is always 0; that way
3781 we don't need to worry about overflow in expressions involving it.
3782 * indent.h: Adjust decls to match defn changes elsewhere.
3783 (struct position):
3784 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3785 Use int, not EMACS_INT, where int is wide enough.
3786 Remove unused members ovstring_chars_done and tab_offset;
3787 all uses removed.
3788 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
3789 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
3790 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
3791 (make_gap, copy_text, insert, insert_and_inherit)
3792 (insert_before_markers, insert_before_markers_and_inherit)
3793 (insert_1, count_combining_before, count_combining_after)
3794 (insert_1_both, insert_from_string)
3795 (insert_from_string_before_markers, insert_from_string_1)
3796 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
3797 (adjust_after_replace, adjust_after_insert, replace_range)
3798 (replace_range_2, del_range, del_range_1, del_range_byte)
3799 (del_range_both, del_range_2, modify_region)
3800 (prepare_to_modify_buffer, signal_before_change)
3801 (signal_after_change, Fcombine_after_change_execute):
3802 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3803 * intervals.c (traverse_intervals, rotate_right, rotate_left)
3804 (balance_an_interval, split_interval_right, split_interval_left)
3805 (find_interval, next_interval, update_interval)
3806 (adjust_intervals_for_insertion, delete_node, delete_interval)
3807 (interval_deletion_adjustment, adjust_intervals_for_deletion)
3808 (static_offset_intervals, offset_intervals)
3809 (merge_interval_right, merge_interval_left, make_new_interval)
3810 (graft_intervals_into_buffer, temp_set_point_both)
3811 (temp_set_point, set_point, adjust_for_invis_intang)
3812 (set_point_both, move_if_not_intangible, get_property_and_range)
3813 (get_local_map, copy_intervals, copy_intervals_to_string)
3814 (compare_string_intervals, set_intervals_multibyte_1):
3815 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3816 * intervals.h: Adjust decls to match defn changes elsewhere.
3817 (struct interval):
3818 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3819 * keyboard.c (this_command_key_count, this_single_command_key_start)
3820 (before_command_key_count, before_command_echo_length, echo_now)
3821 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
3822 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
3823 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
3824 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
3825 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3826 (last_non_minibuf_size, last_point_position, echo_truncate)
3827 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
3828 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
3829 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
3830 (stuff_buffered_input):
3831 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3832 (last_auto_save, command_loop_1, read_char):
3833 Use EMACS_INT, not int, to avoid integer overflow.
3834 (record_char): Avoid overflow in total_keys computation.
3835 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
3836 * keyboard.h: Adjust decls to match defn changes elsewhere.
3837 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
3838 (Fkey_description, Fdescribe_vector, Flookup_key):
3839 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3840 (click_position): New function, to check that positions are in range.
3841 (Fcurrent_active_maps):
3842 (describe_command):
3843 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3844 (Faccessible_keymaps, Fkey_description):
3845 (preferred_sequence_p):
3846 Don't assume fixnum can fit into int.
3847 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
3848 Check for integer overflow in size calculations.
3849 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
3850 avoid mishandling large integers.
3851 * lisp.h: Adjust decls to match defn changes elsewhere.
3852 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
3853 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
3854 (struct Lisp_Marker):
3855 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3856 (clip_to_bounds): Now an inline function, moved here from editfns.c.
3857 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
3858 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
3859 All callers changed.
3860 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
3861 Assume the arg has valid form, since it always does.
3862 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
3863 unsigned integer system type.
3864 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
3865 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
3866 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3867 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
3868 (duration_to_sec_usec): New decl.
3869 * lread.c (read_from_string_index, read_from_string_index_byte)
3870 (read_from_string_limit, readchar, unreadchar, openp)
3871 (read_internal_start, read1, oblookup):
3872 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3873 (Fload, readevalloop, Feval_buffer, Feval_region):
3874 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3875 (openp): Check for out-of-range argument to 'access'.
3876 (read1): Use int, not EMACS_INT, where int is wide enough.
3877 Don't assume fixnum fits into int.
3878 Fix off-by-one error that can read outside a buffer.
3879 (read_filtered_event): Use duration_to_sec_usec
3880 to do proper overflow checking on durations.
3881 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
3882 in size calculation.
3883 (Fexecute_kbd_macro):
3884 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3885 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
3886 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
3887 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
3888 (set_marker_both, set_marker_restricted_both, marker_position)
3889 (marker_byte_position, Fbuffer_has_markers_at):
3890 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3891 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
3892 * menu.c (ensure_menu_items): Rename from grow_menu_items.
3893 It now merely ensures that the menu is large enough, without
3894 necessarily growing it, as this avoids some integer overflow issues.
3895 All callers changed.
3896 (keymap_panes, parse_single_submenu, Fx_popup_menu):
3897 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3898 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
3899 Use SAFE_ALLOCA_LISP, not alloca.
3900 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
3901 to EMACS_INT. Check that fixnums are in proper range for system types.
3902 * minibuf.c (minibuf_prompt_width, string_to_object)
3903 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
3904 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
3905 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3906 (get_minibuffer, read_minibuf_unwind):
3907 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3908 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
3909 this simplifies overflow checking. All callers changed.
3910 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
3911 (Ftest_completion):
3912 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3913 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
3914 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
3915 Check that fixnums are in proper range for system types.
3916 (Fx_create_frame, Fx_show_tip):
3917 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3918 * nsfont.m (ns_findfonts, nsfont_list_family):
3919 Don't assume fixnum fits in long.
3920 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
3921 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3922 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
3923 wide enough.
3924 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
3925 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3926 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
3927 (PRINTDECLARE, PRINTPREPARE):
3928 (strout, print_string):
3929 (print, print_preprocess, print_check_string_charset_prop)
3930 (print_object):
3931 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3932 (PRINTDECLARE):
3933 (temp_output_buffer_setup, Fprin1_to_string, print_object):
3934 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3935 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
3936 (printchar, strout): Use xpalloc to catch size calculation overflow.
3937 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
3938 (print_error_message): Use SAFE_ALLOCA, not alloca.
3939 (print_object): Use int, not EMACS_INT, where int is wide enough.
3940 (print_depth, new_backquote_output, print_number_index):
3941 Use ptrdiff_t, not int, where int might not be wide enough.
3942 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
3943 (Fset_process_window_size, Fformat_network_address)
3944 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
3945 (sigchld_handler):
3946 Check that fixnums are in proper range for system types.
3947 (Fsignal_process): Simplify by avoiding a goto.
3948 Check for process-ids out of pid_t range rather than relying on
3949 undefined behavior.
3950 (process_tick, update_tick): Use EMACS_INT, not int.
3951 (Fformat_network_address, read_process_output, send_process)
3952 (Fprocess_send_region, status_notify):
3953 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3954 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
3955 (wait_reading_process_output, read_process_output, exec_sentinel):
3956 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3957 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
3958 (Faccept_process_output): Use duration_to_sec_usec to do proper
3959 overflow checking on durations.
3960 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
3961 Don't assume pid_t fits in int.
3962 * process.h (struct Lisp_Process): Members tick and update_tick
3963 are now of type EMACS_INT, not int.
3964 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
3965 configured --with-wide-int.
3966 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
3967 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
3968 * search.c (looking_at_1, string_match_1):
3969 (fast_string_match, fast_c_string_match_ignore_case)
3970 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
3971 (scan_newline, find_before_next_newline, search_command)
3972 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
3973 (set_search_regs, wordify):
3974 (Freplace_match):
3975 (Fmatch_data):
3976 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3977 (string_match_1, search_buffer, set_search_regs):
3978 (Fmatch_data):
3979 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3980 (wordify): Check for overflow in size calculation.
3981 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
3982 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
3983 Check that fixnums are in proper range for system types.
3984 * sound.c (struct sound_device)
3985 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
3986 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3987 (Fplay_sound_internal):
3988 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3989 * syntax.c (struct lisp_parse_state, find_start_modiff)
3990 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
3991 (Fparse_partial_sexp):
3992 Don't assume fixnums can fit in int.
3993 (struct lisp_parse_state, find_start_pos, find_start_value)
3994 (find_start_value_byte, find_start_begv)
3995 (update_syntax_table, char_quoted, dec_bytepos)
3996 (find_defun_start, prev_char_comend_first, back_comment):
3997 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
3998 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
3999 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4000 (Finternal_describe_syntax_value): Check that match_lisp is a
4001 character, not an integer, since the code stuffs it into int.
4002 (scan_words, scan_sexps_forward):
4003 Check that fixnums are in proper range for system types.
4004 (Fforward_word):
4005 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4006 (scan_sexps_forward):
4007 Use CHARACTERP, not INTEGERP, since the value must fit into int.
4008 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
4009 * syntax.h: Adjust decls to match defn changes elsewhere.
4010 (struct gl_state_s):
4011 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4012 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
4013 MOST_POSITIVE_FIXNUM.
4014 * sysdep.c (wait_for_termination_1, wait_for_termination)
4015 (interruptible_wait_for_termination, mkdir):
4016 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
4017 (emacs_read, emacs_write):
4018 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4019 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
4020 and double all fit in int.
4021 * term.c (set_tty_color_mode):
4022 Check that fixnums are in proper range for system types.
4023 * termhooks.h (struct input_event):
4024 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4025 * textprop.c (validate_interval_range, interval_of)
4026 (Fadd_text_properties, set_text_properties_1)
4027 (Fremove_text_properties, Fremove_list_of_text_properties)
4028 (Ftext_property_any, Ftext_property_not_all)
4029 (copy_text_properties, text_property_list, extend_property_ranges)
4030 (verify_interval_modification):
4031 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4032 (Fnext_single_char_property_change)
4033 (Fprevious_single_char_property_change):
4034 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4035 (copy_text_properties):
4036 Check for integer overflow in index calculation.
4037 * undo.c (last_boundary_position, record_point, record_insert)
4038 (record_delete, record_marker_adjustment, record_change)
4039 (record_property_change):
4040 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4041 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
4042 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4043 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
4044 (Fx_hide_tip, Fx_file_dialog):
4045 * w32menu.c (set_frame_menubar):
4046 Use ptrdiff_t, not int, for consistency with rest of code.
4047 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
4048 (select_window, Fdelete_other_windows_internal)
4049 (window_scroll_pixel_based, window_scroll_line_based)
4050 (Frecenter, Fset_window_configuration):
4051 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4052 (Fset_window_hscroll, run_window_configuration_change_hook)
4053 (set_window_buffer, temp_output_buffer_show, scroll_command)
4054 (Fscroll_other_window, Frecenter):
4055 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4056 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
4057 Don't assume fixnum fits in int.
4058 (Fset_window_scroll_bars):
4059 Check that fixnums are in proper range for system types.
4060 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
4061 (string_pos, c_string_pos, number_of_chars, init_iterator)
4062 (in_ellipses_for_invisible_text_p, init_from_display_pos)
4063 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
4064 (compute_display_string_end, handle_face_prop)
4065 (face_before_or_after_it_pos, handle_invisible_prop)
4066 (handle_display_prop, handle_display_spec, handle_single_display_spec)
4067 (display_prop_intangible_p, string_buffer_position_lim)
4068 (string_buffer_position, handle_composition_prop, load_overlay_strings)
4069 (get_overlay_strings_1, get_overlay_strings)
4070 (iterate_out_of_display_property, forward_to_next_line_start)
4071 (back_to_previous_visible_line_start, reseat, reseat_to_string)
4072 (get_next_display_element, set_iterator_to_next)
4073 (get_visually_first_element, compute_stop_pos_backwards)
4074 (handle_stop_backwards, next_element_from_buffer)
4075 (move_it_in_display_line_to, move_it_in_display_line)
4076 (move_it_to, move_it_vertically_backward, move_it_by_lines)
4077 (add_to_log, message_dolog, message_log_check_duplicate)
4078 (message2, message2_nolog, message3, message3_nolog
4079 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
4080 (current_message_1, truncate_echo_area, truncate_message_1)
4081 (set_message, set_message_1, store_mode_line_noprop)
4082 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
4083 (text_outside_line_unchanged_p, check_point_in_composition)
4084 (reconsider_clip_changes)
4085 (redisplay_internal, set_cursor_from_row, try_scrolling)
4086 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
4087 (redisplay_window, find_last_unchanged_at_beg_row)
4088 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
4089 (trailing_whitespace_p, find_row_edges, display_line)
4090 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
4091 (display_mode_element, store_mode_line_string)
4092 (pint2str, pint2hrstr, decode_mode_spec)
4093 (display_count_lines, display_string, draw_glyphs)
4094 (x_produce_glyphs, x_insert_glyphs)
4095 (rows_from_pos_range, mouse_face_from_buffer_pos)
4096 (fast_find_string_pos, mouse_face_from_string_pos)
4097 (note_mode_line_or_margin_highlight, note_mouse_highlight):
4098 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4099 (safe_call, init_from_display_pos, handle_fontified_prop)
4100 (handle_single_display_spec, load_overlay_strings)
4101 (with_echo_area_buffer, setup_echo_area_for_printing)
4102 (display_echo_area, echo_area_display)
4103 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
4104 (update_tool_bar, hscroll_window_tree, redisplay_internal)
4105 (redisplay_window, dump_glyph_row, display_mode_line)
4106 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
4107 (handle_display_spec, display_prop_string_p):
4108 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4109 (handle_single_display_spec, build_desired_tool_bar_string)
4110 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
4111 (get_specified_cursor_type):
4112 Check that fixnums are in proper range for system types.
4113 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
4114 (Flookup_image_map):
4115 Don't assume fixnums fit in int.
4116 (compare_overlay_entries):
4117 Avoid mishandling comparisons due to subtraction overflow.
4118 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
4119 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
4120 (handle_tool_bar_click):
4121 Use int, not unsigned, since we prefer signed and the signedness
4122 doesn't matter here.
4123 (get_next_display_element, next_element_from_display_vector):
4124 Use int, not EMACS_INT, when int is wide enough.
4125 (start_hourglass): Use duration_to_sec_usec to do proper
4126 overflow checking on durations.
4127 * xfaces.c (Fbitmap_spec_p):
4128 Check that fixnums are in proper range for system types.
4129 (compare_fonts_by_sort_order):
4130 Avoid mishandling comparisons due to subtraction overflow.
4131 (Fx_family_fonts, realize_basic_faces):
4132 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4133 (Fx_family_fonts):
4134 Don't assume fixnum fits in int.
4135 Use SAFE_ALLOCA_LISP, not alloca.
4136 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
4137 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
4138 (face_at_buffer_position, face_for_overlay_string)
4139 (face_at_string_position):
4140 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4141 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
4142 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
4143 (Fx_show_tip):
4144 Check that fixnums are in proper range for system types.
4145 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
4146 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
4147 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4148 (Fx_change_window_property): Don't assume fixnums fit in int.
4149 * xfont.c (xfont_chars_supported):
4150 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4151 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
4152 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
4153 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4154 * xml.c (parse_region):
4155 * xrdb.c (magic_file_p):
4156 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4157 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
4158 (x_get_local_selection, x_reply_selection_request)
4159 (x_handle_selection_request, wait_for_property_change):
4160 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4161 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
4162 short is wide enough.
4163 (x_send_client_event): Don't assume fixnum fits in int.
4164 * xterm.c (x_x_to_emacs_modifiers):
4165 Don't assume EMACS_INT overflows nicely into int.
4166 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
4167 may come from Lisp.
4168 (handle_one_xevent): NATNUMP can eval its arg twice.
4169 (x_connection_closed):
4170 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4171 * xterm.h: Adjust decls to match defn changes elsewhere.
4172 (struct scroll_bar): Use struct vectorlike_header
4173 rather than rolling our own approximation.
4174 (SCROLL_BAR_VEC_SIZE): Remove; not used.
4175
4176 2012-05-25 Glenn Morris <rgm@gnu.org>
4177
4178 * lisp.mk (lisp): Update for more files being compiled now.
4179
4180 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
4181
4182 * lread.c: Remove `read_pure' which makes no difference.
4183 (read_pure): Remove var.
4184 (unreadpure): Remove function.
4185 (readevalloop): Don't call read_list with -1 flag.
4186 (read1, read_vector): Don't test read_pure any more.
4187 (read_list): Simplify.
4188
4189 * fileio.c, character.h: Minor style tweaks.
4190
4191 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
4192
4193 * window.h (clip_changed): Remove useless declaration.
4194
4195 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
4196
4197 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
4198 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
4199
4200 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
4201
4202 Remove src/m/*.
4203 This directory predates autoconf and is no longer needed nowadays.
4204 Move its few remaining bits of functionality to where they're needed.
4205 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
4206 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
4207 * m/template.h: Remove.
4208 * Makefile.in (M_FILE): Remove. All uses removed.
4209 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
4210 * lisp.h (USE_LSB_TAG):
4211 * mem-limits.h (EXCEEDS_LISP_PTR):
4212 Use VAL_MAX, not VALBITS, in #if.
4213 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
4214 (EMACS_UINT): Define unconditionally now.
4215 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
4216 (BITS_PER_EMACS_INT): New constants, replacing
4217 what used to be in config.h, but not useful in #if.
4218 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
4219 define them any more.
4220 (VAL_MAX): New macro.
4221 (VALMASK): Use it.
4222 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
4223 BITS_PER_EMACS_INT, in #if.
4224 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4225 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
4226 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
4227 * s/ms-w32.h (DATA_START):
4228 Move here from removed file m/intel386.h.
4229 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
4230 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
4231
4232 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
4233
4234 Assume C89 or later.
4235 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
4236 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
4237 (xrealloc):
4238 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
4239 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
4240 * textprop.c, tparam.c (NULL): Remove.
4241 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
4242 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
4243 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
4244 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
4245 * xterm.c (input_signal_count): Assume volatile works.
4246
4247 2012-05-21 Ken Brown <kbrown@cornell.edu>
4248
4249 * xgselect.c (xg_select): Fix first argument in call to 'select'
4250 (bug#11508).
4251
4252 2012-05-20 Ken Brown <kbrown@cornell.edu>
4253
4254 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
4255 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
4256
4257 2012-05-19 Ken Brown <kbrown@cornell.edu>
4258
4259 * xfns.c (x_in_use): Remove `static' qualifier.
4260 * xterm.h (x_in_use): Declare.
4261 * xgselect.c: Include xterm.h.
4262 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
4263 and `display_arg' (bug#9754).
4264
4265 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
4266
4267 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
4268
4269 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
4270 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
4271
4272 2012-05-18 Eli Zaretskii <eliz@gnu.org>
4273
4274 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
4275
4276 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
4277 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
4278
4279 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
4280 reference to image_cache->refcount.
4281 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
4282
4283 2012-05-17 Juri Linkov <juri@jurta.org>
4284
4285 * search.c (Fword_search_regexp, Fword_search_backward)
4286 (Fword_search_forward, Fword_search_backward_lax)
4287 (Fword_search_forward_lax): Move functions to isearch.el
4288 (bug#10145, bug#11381).
4289
4290 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
4291
4292 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
4293
4294 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
4295
4296 * lread.c (init_obarray): Declare Qt and Qnil as special.
4297
4298 2012-05-14 Glenn Morris <rgm@gnu.org>
4299
4300 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
4301 Put "libexec" before "bin", for the sake of init_callproc_1.
4302
4303 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
4304
4305 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
4306
4307 * unexaix.c: Port to more-recent AIX compilers.
4308 (report_error, report_error_1, make_hdr, copy_sym)
4309 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
4310 Make arguments const char *, not char *, to avoid violations of C
4311 standard and to fix some AIX warnings reported by Gilles Pion.
4312
4313 2012-05-14 Eli Zaretskii <eliz@gnu.org>
4314
4315 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
4316 already have overlays loaded.
4317 (handle_single_display_spec): Before returning without displaying
4318 fringe bitmap, synchronize the bidi iterator with the main display
4319 iterator, by calling iterate_out_of_display_property.
4320 (iterate_out_of_display_property): Detect buffer iteration by
4321 testing that it->string is a Lisp string.
4322 (get_next_display_element): When the current object is exhausted,
4323 and there's something on it->stack, call set_iterator_to_next to
4324 proceed with what's on the stack, instead of returning zero.
4325 (set_iterator_to_next): If called at the end of a Lisp string,
4326 proceed to consider_string_end without incrementing string
4327 position. Don't increment display vector index past the end of
4328 the display vector. (Bug#11417)
4329 (pos_visible_p): Don't report a position visible when move_it_to
4330 stopped at the last line of window, which happens to be scanned
4331 backwards by the bidi iteration. (Bug#11464)
4332
4333 2012-05-14 Eli Zaretskii <eliz@gnu.org>
4334
4335 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
4336 and right-margin display specs even if the spec is invalid or we
4337 are on a TTY, and thus unable to display on the fringes.
4338 That's because the text with the property will not be displayed anyway,
4339 so we need to signal to the caller that this is a "replacing"
4340 display spec. This fixes display when the spec is invalid or we
4341 are on a TTY.
4342
4343 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
4344
4345 * unexaix.c (make_hdr): Fix typo in prototype.
4346 This bug broke the build on AIX. Problem reported by Gilles Pion.
4347
4348 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
4349
4350 * keyboard.c (kbd_buffer_get_event): Read special events also in
4351 batch mode. (Bug#11415)
4352
4353 2012-05-12 Glenn Morris <rgm@gnu.org>
4354
4355 * ns.mk: Update for ns_appbindir no longer having trailing "/".
4356
4357 2012-05-12 Eli Zaretskii <eliz@gnu.org>
4358
4359 * lisp.mk (lisp): Add newcomment.elc.
4360
4361 2012-05-12 Glenn Morris <rgm@gnu.org>
4362
4363 * Makefile.in (MKDIR_P): New, set by configure.
4364 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
4365
4366 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
4367
4368 Remove unused function hourglass_started.
4369 * dispextern.h (hourglass_started):
4370 * w32fns.c (hourglass_started):
4371 * xdisp.c (hourglass_started): Remove.
4372
4373 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
4374
4375 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
4376 Update dependencies.
4377
4378 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
4379
4380 * xgselect.c (xg_select): Put maxfds+1 into a var.
4381 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
4382
4383 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
4384
4385 2012-05-10 Dave Abrahams <dave@boostpro.com>
4386
4387 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
4388 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
4389
4390 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
4391
4392 * dbusbind.c (xd_registered_buses): New internal Lisp object.
4393 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
4394 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
4395 Initialize xd_registered_buses.
4396
4397 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
4398
4399 Untag more efficiently if USE_LSB_TAG.
4400 This is based on a proposal by YAMAMOTO Mitsuharu in
4401 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
4402 For an admittedly artificial (nth 8000 longlist) benchmark on
4403 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
4404 Emacs's overall text size by 1%.
4405 * lisp.h (XUNTAG): New macro.
4406 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
4407 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
4408 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
4409 * eval.c (Fautoload):
4410 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
4411 * frame.h (XFRAME): Use XUNTAG.
4412
4413 Port recent dbusbind.c changes to 32-bit --with-wide-int.
4414 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
4415 Remove unportable assumptions about print widths of types like
4416 dbus_uint32_t.
4417 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
4418 intptr_t when converting between pointer and integer, to avoid GCC
4419 warnings about wrong width.
4420
4421 2012-05-09 Eli Zaretskii <eliz@gnu.org>
4422
4423 * w32proc.c (new_child): Force Windows to reserve only 64KB of
4424 stack for each reader_thread, instead of defaulting to 8MB
4425 determined by the linker. This avoids failures in creating
4426 subprocesses on Windows 7, see the discussion in this thread:
4427 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
4428
4429 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
4430
4431 Fix up display of the *Minibuf-0* buffer in the mini window.
4432 * keyboard.c (read_char): Don't clear the echo area if there's no
4433 message to clear.
4434 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
4435 contents of *Minibuf-0*) if there's no message displayed in its stead.
4436
4437 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
4438
4439 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
4440 batch mode.
4441
4442 2012-05-06 Chong Yidong <cyd@gnu.org>
4443
4444 * lisp.mk (lisp): Update.
4445
4446 2012-05-05 Jim Meyering <meyering@redhat.com>
4447
4448 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
4449
4450 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
4451
4452 * data.c (PUT_ERROR): New macro.
4453 (syms_of_data): Use it. Add new error type `user-error'.
4454 * undo.c (user_error): New function.
4455 (Fprimitive_undo): Use it.
4456 * print.c (print_error_message): Adjust print style for `user-error'.
4457 * keyboard.c (user_error): New function.
4458 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
4459
4460 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
4461
4462 Do not limit current-time-string to years 1000..9999.
4463 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
4464 (Fcurrent_time_string): Support any year that is supported by the
4465 underlying localtime representation. Don't use asctime, as it
4466 has undefined behavior for years outside the range -999..9999.
4467
4468 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
4469
4470 Fix race conditions involving setenv, gmtime, localtime, asctime.
4471 Without this fix, interrupts could mess up code that uses these
4472 nonreentrant functions, since setting TZ invalidates existing
4473 tm_zone or tzname values, and since most of these functions return
4474 pointers to static storage.
4475 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
4476 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
4477 Grow the critical sections to include not just invoking
4478 localtime/gmtime, but also accessing these functions' results
4479 including their tm_zone values if any, and any related TZ setting.
4480 (format_time_string): Last arg is now struct tm *, not struct tm **,
4481 so that the struct tm is saved in the critical section.
4482 All callers changed. Simplify allocation of initial buffer, partly
4483 motivated by the fact that memory allocation needs to be outside
4484 the critical section.
4485
4486 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
4487
4488 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
4489 with RESET_INTERVAL.
4490
4491 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
4492 Remove duplicated buffer name initialization.
4493
4494 2012-05-02 Jim Meyering <jim@meyering.net>
4495
4496 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
4497
4498 * xfns.c (x_window): Use xstrdup (Bug#11375).
4499
4500 2012-05-02 Eli Zaretskii <eliz@gnu.org>
4501
4502 * xdisp.c (pos_visible_p): If already at a newline from the
4503 display string before the 'while' loop, don't walk back the glyphs
4504 from it3.glyph_row. Solves assertion violation when the display
4505 string begins with a newline (egg.el). (Bug#11367)
4506
4507 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
4508
4509 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
4510 Move to simple.el.
4511
4512 2012-05-01 Glenn Morris <rgm@gnu.org>
4513
4514 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
4515 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
4516 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
4517 All were removed before 23.1.
4518
4519 * dispnew.c: Remove HAVE_LIBNCURSES test;
4520 it is always true on relevant platforms.
4521
4522 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
4523 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
4524
4525 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
4526
4527 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
4528
4529 * .gdbinit (xpr): Remove checks for no longer existing misc types.
4530 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
4531 Remove.
4532
4533 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
4534
4535 Do not avoid creating empty evaporating overlays (Bug#9642).
4536 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
4537 That is, do not delete an evaporating overlay if it becomes
4538 empty after its bounds are adjusted to fit within its buffer.
4539 This fix caused other problems, and I'm reverting it until we get
4540 to the bottom of them.
4541
4542 2012-04-27 Chong Yidong <cyd@gnu.org>
4543
4544 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
4545
4546 2012-04-27 Eli Zaretskii <eliz@gnu.org>
4547
4548 * xdisp.c (pos_visible_p): If the window start position is beyond
4549 ZV, start the display from buffer beginning. Prevents assertion
4550 violation in init_iterator when the minibuffer window is scrolled
4551 via the scroll bar.
4552
4553 * window.c (window_scroll_pixel_based): Likewise.
4554
4555 2012-04-27 Chong Yidong <cyd@gnu.org>
4556
4557 * keymap.c (where_is_internal): Doc fix (Bug#10872).
4558
4559 2012-04-27 Glenn Morris <rgm@gnu.org>
4560
4561 * fileio.c (Fcopy_file, Fset_file_selinux_context):
4562 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
4563
4564 2012-04-27 Eli Zaretskii <eliz@gnu.org>
4565
4566 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
4567 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
4568
4569 2012-04-26 Eli Zaretskii <eliz@gnu.org>
4570
4571 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
4572 display element, check also the underlying string or buffer
4573 character. (Bug#11341)
4574
4575 * w32menu.c: Include w32heap.h.
4576 (add_menu_item): If the call to AppendMenuW (via
4577 unicode_append_menu) fails, disable Unicode menus only if we are
4578 running on Windows 9X/Me.
4579
4580 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
4581
4582 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
4583 (xgetint): Add missing shift for LSB tags.
4584
4585 2012-04-24 Martin Rudalics <rudalics@gmx.at>
4586
4587 * keyboard.c (read_char): Don't wipe echo area for select window
4588 events: These might get delayed via `mouse-autoselect-window'
4589 (Bug#11304).
4590
4591 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
4592
4593 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
4594 manipulation of :loaded-from data.
4595
4596 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
4597
4598 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
4599 now a cons (bug#11311).
4600
4601 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
4602
4603 Do not create empty overlays with the evaporate property (Bug#9642).
4604 * buffer.c (Fmove_overlay): Delete an evaporating overlay
4605 if it becomes empty after its bounds are adjusted to fit within
4606 its buffer. Without this fix, in a nonempty buffer (let ((o
4607 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
4608 yields an empty overlay that has the evaporate property, which is
4609 not supposed to happen.
4610
4611 Fix minor GTK3 problems found by static checking.
4612 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
4613 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
4614 (struct _EmacsFixedClass, emacs_fixed_get_type):
4615 Move decls here from emacsgtkfixed.h, since they needn't be public.
4616 (emacs_fixed_get_type): Now static.
4617 (emacs_fixed_class_init): Omit unused local.
4618 (emacs_fixed_child_type): Remove; unused.
4619 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
4620 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
4621 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
4622 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
4623 (EMACS_FIXED_GET_CLASS): Remove; unused.
4624 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
4625
4626 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
4627 Problem reported by Juanma Barranquero for Windows -Wunused-function.
4628
4629 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
4630
4631 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
4632 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
4633 (__malloc_size_t, __malloc_ptrdiff_t):
4634 Remove. All uses removed, replaced by the definiens if needed,
4635 since we can assume C89 or better now.
4636 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
4637 (protect_malloc_state, align, get_contiguous_space)
4638 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
4639 (malloc_atfork_handler_child, malloc_enable_thread)
4640 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
4641 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
4642 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
4643 (special_realloc, _realloc_internal_nolock, _realloc_internal)
4644 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
4645 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
4646 Define using prototypes, not old style.
4647 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
4648 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
4649 (align): Don't assume that signed integer overflow wraps around.
4650 Omit unused local var.
4651 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
4652 (_free_internal_nolock, memalign, mallochook, reallochook):
4653 Omit no-longer-needed casts.
4654 (valloc): Use getpagesize, not __getpagesize.
4655 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
4656 (struct hdr): The 'magic' member is now size_t, not unsigned long.
4657
4658 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
4659
4660 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
4661
4662 Move functions from C to Lisp. Make non-blocking method calls
4663 the default. Implement further D-Bus standard interfaces.
4664
4665 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
4666 (QCdbus_request_name_allow_replacement)
4667 (QCdbus_request_name_replace_existing)
4668 (QCdbus_request_name_do_not_queue)
4669 (QCdbus_request_name_reply_primary_owner)
4670 (QCdbus_request_name_reply_in_queue)
4671 (QCdbus_request_name_reply_exists)
4672 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
4673 (QCdbus_registered_serial, QCdbus_registered_method)
4674 (QCdbus_registered_signal): New Lisp objects.
4675 (XD_DEBUG_MESSAGE): Use sizeof.
4676 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
4677 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
4678 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
4679 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
4680 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
4681 (xd_signature, xd_append_arg): Allow float for integer types.
4682 (xd_get_connection_references): New function.
4683 (xd_get_connection_address): Rename from xd_initialize.
4684 Return cached address.
4685 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
4686 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
4687 level.
4688 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
4689 Return number of refcounts.
4690 (Fdbus_get_unique_name): Make stronger parameter check.
4691 (Fdbus_message_internal): New defun.
4692 (Fdbus_call_method, Fdbus_call_method_asynchronously)
4693 (Fdbus_method_return_internal, Fdbus_method_error_internal)
4694 (Fdbus_send_signal, Fdbus_register_service)
4695 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
4696 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
4697 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
4698 (Vdbus_compiled_version, Vdbus_runtime_version)
4699 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
4700 (Vdbus_message_type_method_return, Vdbus_message_type_error)
4701 (Vdbus_message_type_signal): New defvars.
4702 (Vdbus_registered_buses, Vdbus_registered_objects_table):
4703 Adapt docstring.
4704
4705 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
4706
4707 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
4708 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
4709 Do not assume ptrdiff_t is the same width as 'int'.
4710
4711 * alloc.c: Handle unusual debugging option combinations.
4712 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
4713 since the two debugging options are incompatible.
4714 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
4715 is defined.
4716 (mem_init, mem_insert, mem_insert_fixup):
4717 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
4718 (NEED_MEM_INSERT): Remove; no longer needed.
4719
4720 2012-04-22 Leo Liu <sdl.web@gmail.com>
4721
4722 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
4723
4724 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
4725
4726 * sysdep.c [__FreeBSD__]: Minor cleanups.
4727 (list_system_processes, system_process_attributes) [__FreeBSD__]:
4728 Use Emacs indenting style more consistently. Avoid some casts.
4729 Use 'double' consistently rather than mixing 'float' and 'double'.
4730
4731 2012-04-21 Eduard Wiebe <usenet@pusto.de>
4732
4733 * sysdep.c (list_system_processes, system_process_attributes):
4734 Add implementation for FreeBSD (Bug#5243).
4735
4736 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
4737
4738 * lisp.mk (lisp): Update.
4739
4740 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
4741
4742 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
4743 It is never used otherwise.
4744
4745 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
4746
4747 * print.c (print_preprocess): Only check print_depth if print-circle
4748 is nil.
4749 (print_object): Check for cycles even when print-circle is nil and
4750 print-gensym is t, but only check print_depth if print-circle is nil.
4751
4752 2012-04-20 Chong Yidong <cyd@gnu.org>
4753
4754 * process.c (wait_reading_process_output): If EIO occurs on a pty,
4755 set the status to "failed" and ensure that sentinel is run.
4756
4757 2012-04-20 Glenn Morris <rgm@gnu.org>
4758
4759 * process.c (Fset_process_inherit_coding_system_flag)
4760 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4761 (Fmake_network_process, Fmake_serial_process): Doc fix.
4762
4763 2012-04-20 Eli Zaretskii <eliz@gnu.org>
4764
4765 * xdisp.c (string_buffer_position_lim): Limit starting position to
4766 BEGV.
4767 (set_cursor_from_row): If called for a mode-line or header-line
4768 row, return zero immediately.
4769 (try_cursor_movement): If inside continuation line, don't back up
4770 farther than the first row after the header line, if any.
4771 Don't consider the header-line row as "partially visible", even if
4772 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
4773
4774 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
4775
4776 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
4777 (bug#11238).
4778
4779 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
4780 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
4781
4782 configure: new option --enable-gcc-warnings (Bug#11207)
4783 * Makefile.in (C_WARNINGS_SWITCH): Remove.
4784 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
4785 (ALL_CFLAGS): Use new macros rather than old.
4786 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
4787 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
4788 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
4789 -Wunused-result, -Wunused-variable. This should go away once
4790 the Emacs and Gnulib regex code is merged.
4791 (xmalloc, xrealloc): Now static.
4792
4793 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
4794
4795 * dired.c (Fsystem_groups): Remove unused local.
4796
4797 2012-04-17 Glenn Morris <rgm@gnu.org>
4798
4799 * dired.c (Fsystem_users): Doc fix.
4800
4801 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
4802
4803 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
4804 (syms_of_dired): Add them.
4805
4806 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
4807
4808 Fix minor alloc.c problems found by static checking.
4809 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
4810 New extern decls, to avoid calling undeclared functions.
4811 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
4812 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
4813 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
4814 (NEED_MEM_INSERT): New macro.
4815 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4816 Remove one incorrect comment and fix another.
4817
4818 Fix minor ralloc.c problems found by static checking.
4819 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
4820 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
4821 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
4822 (r_alloc_sbrk): Now static.
4823
4824 Improve ralloc.c interface checking.
4825 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
4826 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
4827 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
4828 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
4829 [REL_ALLOC]: ... to here, to check interface.
4830 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
4831 Remove decls. This fixes an "It stinks!".
4832
4833 * alloc.c (which_symbols): Fix alignment issue / type clash.
4834
4835 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
4836
4837 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
4838 (struct Lisp_Misc_Any): Likewise.
4839 (struct Lisp_Free): Likewise.
4840 * alloc.c (union aligned_Lisp_Symbol): Define.
4841 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
4842 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
4843 (union aligned_Lisp_Misc): Define.
4844 (MARKER_BLOCK_SIZE, struct marker_block): Use union
4845 aligned_Lisp_Misc instead of union Lisp_Misc.
4846 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
4847
4848 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
4849
4850 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
4851 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
4852 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
4853 * s/netbsd.h, s/sol2-6.h:
4854 Remove definition of GC_MARK_STACK, since the default now works.
4855 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
4856 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
4857 no longer the default.
4858 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
4859
4860 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
4861
4862 * lread.c (lisp_file_lexically_bound_p):
4863 Fix hang at ";-*-\n" (bug#11238).
4864
4865 2012-04-14 Eli Zaretskii <eliz@gnu.org>
4866
4867 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
4868 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
4869
4870 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
4871
4872 * nsterm.m (constrainFrameRect): Always constrain when there is only
4873 one screen (Bug#10962).
4874
4875 2012-04-13 Ken Brown <kbrown@cornell.edu>
4876
4877 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
4878
4879 2012-04-13 Reuben Thomas <rrt@sc3d.org>
4880
4881 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
4882
4883 2012-04-11 Daniel Colascione <dancol@dancol.org>
4884
4885 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
4886 against is gone. It's better to use vfork now so that when Cygwin
4887 gains a new, working vfork, we use it automatically (bug#10398).
4888
4889 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
4890
4891 * window.c (save_window_save): Obey window-point-insertion-type.
4892
4893 2012-04-11 Glenn Morris <rgm@gnu.org>
4894
4895 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
4896
4897 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
4898
4899 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
4900
4901 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
4902
4903 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
4904 (force_quit_count): New var.
4905 (handle_interrupt): Use it.
4906
4907 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
4908
4909 * w32.c (w32_delayed_load): Record the full path of the library
4910 being loaded (bug#10424).
4911
4912 2012-04-09 Glenn Morris <rgm@gnu.org>
4913
4914 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
4915 not just in the obarray, before snarfing them. (Bug#11036)
4916
4917 * Makefile.in ($(leimdir)/leim-list.el):
4918 Pass EMACS rather than BUILT_EMACS.
4919
4920 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
4921
4922 * process.c (make_process):
4923 * process.h: Add integer `gnutls_handshakes_tried' member to
4924 process struct.
4925
4926 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
4927 Add convenience `GNUTLS_LOG2i' macro.
4928
4929 * gnutls.c (gnutls_log_function2i): Convenience log function.
4930 (emacs_gnutls_read): Use new log functions,
4931 `gnutls_handshakes_tried' process member, and
4932 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
4933 attempts per process (connection).
4934
4935 2012-04-09 Chong Yidong <cyd@gnu.org>
4936
4937 * eval.c (Fuser_variable_p, user_variable_p_eh)
4938 (lisp_indirect_variable): Functions deleted.
4939 (Fdefvar): Caller changed.
4940
4941 * callint.c (Finteractive, Fcall_interactively):
4942 * minibuf.c (Fread_variable): Callers changed.
4943
4944 2012-04-09 Eli Zaretskii <eliz@gnu.org>
4945
4946 * xdisp.c (set_cursor_from_row): If the display string appears in
4947 the buffer at position that is closer to point than the position
4948 after the display string, display the cursor on the first glyph of
4949 the display string. Fixes cursor display when a 'display' text
4950 property immediately follows invisible text. (Bug#11094)
4951
4952 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
4953
4954 composite.c: use 'double' consistently
4955 * composite.c (get_composition_id): Use 'double' consistently
4956 instead of converting 'float' to 'double' and vice versa; this is
4957 easier to understand and avoids a GCC warning.
4958
4959 2012-04-09 Glenn Morris <rgm@gnu.org>
4960
4961 * Makefile.in: Generate leim-list with bootstrap-emacs, in
4962 preparation for dumping it with emacs. (Bug#4789)
4963 (leimdir): New variable.
4964 ($(leimdir)/leim-list.el): New rule.
4965 (emacs$(EXEEXT)): Depend on leim-list.el.
4966
4967 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
4968 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
4969 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
4970
4971 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
4972
4973 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
4974 proper alignment.
4975
4976 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
4977
4978 * xml.c (init_libxml2_functions) [WINDOWSNT]:
4979 Remove unused local variable.
4980
4981 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
4982
4983 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
4984 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
4985 (mark_memory): Mark Lisp_Objects only if pointers might hide in
4986 objects, as mark_maybe_pointer will catch them otherwise.
4987 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
4988 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
4989
4990 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
4991
4992 Fix typo that broke non-Windows builds.
4993 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
4994
4995 2012-04-07 Eli Zaretskii <eliz@gnu.org>
4996
4997 Support building on MS-Windows with libxml2.
4998
4999 * makefile.w32-in (OBJ2): Add xml.$(O).
5000 (GLOBAL_SOURCES): Add xml.c.
5001 ($(BLD)/xml.$(O)): New dependency list.
5002
5003 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
5004 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
5005 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
5006 [!WINDOWSNT]: New macros.
5007 (init_libxml2_functions, libxml2_loaded_p): New functions.
5008 (parse_region): Call fn_xmlCheckVersion instead of using the macro
5009 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
5010 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
5011 Calls xmlCleanupParser only if libxml2 was loaded (or statically
5012 linked in).
5013 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
5014 Call init_libxml2_functions before calling libxml2 functions.
5015 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
5016
5017 * emacs.c: Don't include libxml/parser.h.
5018 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
5019 xmlCleanupParser directly.
5020
5021 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
5022
5023 2012-04-07 Eli Zaretskii <eliz@gnu.org>
5024
5025 * indent.c (Fvertical_motion): If there is a display string at
5026 point, use it.vpos to compute how many lines to backtrack after
5027 move_it_to point. (Bug#11133)
5028
5029 2012-04-06 Eli Zaretskii <eliz@gnu.org>
5030
5031 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
5032 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
5033 about subtle differences between FETCH_CHAR* and STRING_CHAR*
5034 macros related to unification of CJK characters. For the details,
5035 see the discussion following the message here:
5036 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
5037
5038 2012-04-04 Chong Yidong <cyd@gnu.org>
5039
5040 * keyboard.c (Vdelayed_warnings_list): Doc fix.
5041
5042 2012-04-01 Eli Zaretskii <eliz@gnu.org>
5043
5044 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
5045 instead of alloca. (Bug#11138)
5046
5047 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
5048
5049 * w32menu.c (is_simple_dialog): Properly check lisp types.
5050 (Bug#11141)
5051
5052 2012-03-31 Eli Zaretskii <eliz@gnu.org>
5053
5054 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
5055 position we get to after a call to move_it_to fails the
5056 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
5057 only if we wind up in a string from display property. (Bug#11063)
5058
5059 * window.c (Fdelete_other_windows_internal): Invalidate the row
5060 and column information about mouse highlight, so that redisplay
5061 restores it after reallocating the glyph matrices. (Bug#7464)
5062
5063 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
5064 string comes from a `display' text property, use the buffer
5065 position of that property as if we actually saw that position in
5066 the row's glyphs.
5067 (move_it_by_lines): Remove the assertion that
5068 "it->current_x == 0 && it->hpos == 0" which can be legitimately
5069 violated when there's a before-string at the beginning of a line.
5070 (Bug#11063)
5071
5072 2012-03-30 Eli Zaretskii <eliz@gnu.org>
5073
5074 * xdisp.c (append_space_for_newline): If the default face was
5075 remapped, use the remapped face for the appended newline.
5076 (extend_face_to_end_of_line): Use the remapped default face for
5077 extending the face to the end of the line.
5078 (display_line): Call extend_face_to_end_of_line when the default
5079 face was remapped. (Bug#11068)
5080
5081 2012-03-29 Eli Zaretskii <eliz@gnu.org>
5082
5083 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
5084
5085 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
5086
5087 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
5088
5089 2012-03-27 Glenn Morris <rgm@gnu.org>
5090
5091 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
5092 Doc fixes.
5093
5094 2012-03-26 Kenichi Handa <handa@m17n.org>
5095
5096 * dispextern.h (struct glyph): Fix previous change. Change the
5097 bit length of glyphless.ch to 25 (Bug#11082).
5098
5099 2012-03-26 Chong Yidong <cyd@gnu.org>
5100
5101 * keyboard.c (Vselection_inhibit_update_commands): New variable.
5102 (command_loop_1): Use it; inhibit selection update for
5103 handle-select-window too (Bug#8996).
5104
5105 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
5106
5107 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
5108
5109 2012-03-25 Kenichi Handa <handa@m17n.org>
5110
5111 * dispextern.h (struct glyph): Change the bit length of
5112 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
5113
5114 2012-03-24 Eli Zaretskii <eliz@gnu.org>
5115
5116 * s/ms-w32.h (tzname): Include time.h before redirecting to
5117 _tzname. Fixes the MSVC build. (Bug#9960)
5118
5119 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
5120
5121 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
5122 characters.
5123
5124 * xterm.c (XTread_socket): Only modify handling_signal if
5125 !SYNC_INPUT. (Bug#11080)
5126
5127 2012-03-23 Eli Zaretskii <eliz@gnu.org>
5128
5129 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
5130 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
5131 when fetching a multibyte character consumes more bytes than
5132 CHAR_BYTES returns, due to unification of CJK characters in
5133 string_char. (Bug#11073)
5134
5135 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
5136
5137 * process.c (wait_reading_process_output): Handle pty disconnect
5138 by refraining from sending oneself a SIGCHLD (bug#10933).
5139
5140 2012-03-22 Chong Yidong <cyd@gnu.org>
5141
5142 * dispextern.h (struct it): New member string_from_prefix_prop_p.
5143
5144 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
5145 Mark string as coming from a prefix property.
5146 (handle_face_prop): Use default face for prefix strings (Bug#4281).
5147 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
5148
5149 2012-03-21 Chong Yidong <cyd@gnu.org>
5150
5151 * xfaces.c (Vface_remapping_alist): Doc fix.
5152
5153 2012-03-20 Eli Zaretskii <eliz@gnu.org>
5154
5155 * w32proc.c (Fw32_set_console_codepage)
5156 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
5157 Doc fixes.
5158
5159 2012-03-20 Chong Yidong <cyd@gnu.org>
5160
5161 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
5162 to reflect default non-nil value of redisplay-dont-pause.
5163
5164 2012-03-19 Kenichi Handa <handa@m17n.org>
5165
5166 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
5167 it fit in a valid range (Bug#11003).
5168
5169 2012-03-18 Eli Zaretskii <eliz@gnu.org>
5170
5171 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
5172 that is not from display property, accept the row as a "cursor
5173 row" if one of the string's character has a non-nil `cursor'
5174 property. Fixes cursor positioning when there are newlines in
5175 overlay strings, e.g. in icomplete.el. (Bug#11035)
5176
5177 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
5178
5179 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
5180
5181 2012-03-12 Chong Yidong <cyd@gnu.org>
5182
5183 * eval.c (inhibit_lisp_code): Rename from
5184 inhibit_window_configuration_change_hook; move from window.c.
5185
5186 * xfns.c (unwind_create_frame_1, Fx_create_frame):
5187 * window.c (run_window_configuration_change_hook)
5188 (syms_of_window): Callers changed.
5189
5190 2012-03-11 Chong Yidong <cyd@gnu.org>
5191
5192 * keymap.c (Fkey_description): Doc fix (Bug#9700).
5193
5194 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
5195
5196 2012-03-10 Chong Yidong <cyd@gnu.org>
5197
5198 * frame.c (other_visible_frames): Don't assume the selected frame
5199 is visible (Bug#10955).
5200
5201 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
5202
5203 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
5204
5205 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
5206
5207 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
5208 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
5209 zero (Bug#10954).
5210
5211 2012-03-03 Glenn Morris <rgm@gnu.org>
5212
5213 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
5214
5215 2012-03-02 Eli Zaretskii <eliz@gnu.org>
5216
5217 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
5218 position past the first glyph_row that ends at ZV. (Bug#10902)
5219 (redisplay_window, next_element_from_string): Fix typos in
5220 comments.
5221 (redisplay_window): Pass to move_it_vertically the margin in
5222 pixels, not in screen lines.
5223
5224 2012-03-02 Glenn Morris <rgm@gnu.org>
5225
5226 * buffer.c (buffer-list-update-hook): Doc fix.
5227
5228 2012-02-29 Eli Zaretskii <eliz@gnu.org>
5229
5230 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
5231 push_it before setting up the iterator for the first overlay
5232 string, even if we have an empty string loaded.
5233 (next_overlay_string): If there's an empty string on the iterator
5234 stack, pop the stack. (Bug#10903)
5235
5236 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
5237
5238 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
5239 Suggested by Stefan Monnier in
5240 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
5241 * alloc.c (widen_to_Lisp_Object): New static function.
5242 (mark_memory): Also mark Lisp_Objects by fetching pointer words
5243 and widening them to Lisp_Objects. This would work even if
5244 USE_LSB_TAG is defined and wide integers are used, which might
5245 happen in a future version of Emacs.
5246
5247 2012-02-25 Chong Yidong <cyd@gnu.org>
5248
5249 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
5250 Doc fix.
5251
5252 * xselect.c (Fx_selection_exists_p): Doc fix.
5253 (x_clipboard_manager_save_all): Print an informative message
5254 before saving to clipboard manager.
5255
5256 2012-02-24 Chong Yidong <cyd@gnu.org>
5257
5258 * keyboard.c (process_special_events): Handle all X selection
5259 requests in kbd_buffer, not just the next one (Bug#8869).
5260
5261 2012-02-23 Chong Yidong <cyd@gnu.org>
5262
5263 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
5264 call when setting menu-bar-lines and tool-bar-lines parameters.
5265 (unwind_create_frame_1): New helper function.
5266
5267 * window.c (inhibit_window_configuration_change_hook): New var.
5268 (run_window_configuration_change_hook): Obey it.
5269 (syms_of_window): Initialize it.
5270
5271 2012-02-22 Chong Yidong <cyd@gnu.org>
5272
5273 * xterm.c (x_draw_image_relief): Add missing type check for
5274 Vtool_bar_button_margin (Bug#10743).
5275
5276 2012-02-21 Chong Yidong <cyd@gnu.org>
5277
5278 * fileio.c (Vfile_name_handler_alist): Doc fix.
5279
5280 * buffer.c (Fget_file_buffer): Protect against invalid file
5281 handler return value.
5282
5283 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
5284
5285 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
5286 when computing $valmask.
5287
5288 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
5289 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
5290 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
5291 It's useless in that case, and it can cause problems on hosts
5292 that allocate halves of EMACS_INT values separately.
5293 Reported by Dan Horák. Diagnosed by Andreas Schwab in
5294 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
5295 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
5296 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
5297 it avoids undefined behavior on hosts where shifting right by more
5298 than the word width has undefined behavior.
5299
5300 2012-02-19 Chong Yidong <cyd@gnu.org>
5301
5302 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
5303 (Funhandled_file_name_directory, Ffile_name_as_directory)
5304 (Fdirectory_file_name, Fexpand_file_name)
5305 (Fsubstitute_in_file_name): Protect against invalid file handler
5306 return values (Bug#10845).
5307
5308 2012-02-18 Eli Zaretskii <eliz@gnu.org>
5309
5310 * .gdbinit (pitx): Fix incorrect references to fields of the
5311 iterator stack.
5312
5313 2012-02-17 Chong Yidong <cyd@gnu.org>
5314
5315 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
5316
5317 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
5318
5319 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
5320 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
5321
5322 2012-02-15 Chong Yidong <cyd@gnu.org>
5323
5324 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
5325 marked as special. Also, starting docstrings with * is obsolete.
5326
5327 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
5328
5329 * gnutls.c (emacs_gnutls_write): Fix last change.
5330
5331 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
5332
5333 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
5334 send_process.
5335
5336 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
5337
5338 * keymap.c (Fsingle_key_description): Handle char ranges.
5339
5340 2012-02-12 Chong Yidong <cyd@gnu.org>
5341
5342 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
5343 as that creates a dangerous corner case.
5344
5345 * window.c (Fdelete_window_internal): Invalidate the mouse
5346 highlight (Bug#9904).
5347
5348 2012-02-12 Glenn Morris <rgm@gnu.org>
5349
5350 * xselect.c (Fx_own_selection_internal)
5351 (Fx_get_selection_internal, Fx_disown_selection_internal)
5352 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
5353 * nsselect.m (Fx_own_selection_internal)
5354 (Fx_disown_selection_internal, Fx_selection_exists_p)
5355 (Fx_selection_owner_p, Fx_get_selection_internal):
5356 Sync docs and argument specs with the xselect.c versions.
5357
5358 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
5359
5360 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
5361
5362 2012-02-11 Eli Zaretskii <eliz@gnu.org>
5363
5364 * w32select.c (Fx_selection_exists_p): Sync doc string and
5365 argument list with xselect.c. (Bug#10783)
5366
5367 * w16select.c (Fx_selection_exists_p): Sync doc string and
5368 argument list with xselect.c. (Bug#10783)
5369
5370 2012-02-10 Glenn Morris <rgm@gnu.org>
5371
5372 * fns.c (Fsecure_hash): Doc fix.
5373
5374 2012-02-09 Kenichi Handa <handa@m17n.org>
5375
5376 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
5377
5378 2012-02-07 Chong Yidong <cyd@gnu.org>
5379
5380 * buffer.c (Fbuffer_local_variables)
5381 (buffer_lisp_local_variables): Handle unbound vars correctly;
5382 don't let Qunbound leak into Lisp.
5383
5384 2012-02-07 Glenn Morris <rgm@gnu.org>
5385
5386 * image.c (Fimagemagick_types): Doc fix.
5387
5388 * image.c (imagemagick-render-type): Change it from a lisp object
5389 to an integer. Move the doc here from the lisp manual.
5390 Treat all values not equal to 0 the same.
5391
5392 2012-02-06 Chong Yidong <cyd@gnu.org>
5393
5394 * doc.c (store_function_docstring): Avoid applying docstring of
5395 alias to base function (Bug#2603).
5396
5397 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
5398
5399 * .gdbinit (pp1, pv1): Remove redundant defines.
5400 (pr): Use pp.
5401
5402 2012-02-04 Chong Yidong <cyd@gnu.org>
5403
5404 * nsterm.m: Declare a global (Bug#10694).
5405
5406 2012-02-04 Eli Zaretskii <eliz@gnu.org>
5407
5408 * w32.c (get_emacs_configuration_options):
5409 Include --enable-checking, if specified, in the return value.
5410
5411 2012-02-04 Martin Rudalics <rudalics@gmx.at>
5412
5413 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
5414 after rounding frame sizes. (Bug#9723)
5415
5416 2012-02-04 Eli Zaretskii <eliz@gnu.org>
5417
5418 * keyboard.c (adjust_point_for_property): Don't position point
5419 before BEGV. (Bug#10696)
5420
5421 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
5422
5423 Handle overflow when computing char display width (Bug#9496).
5424 * character.c (char_width): Return EMACS_INT, not int.
5425 (char_width, c_string_width): Check for overflow when
5426 computing the width; this is possible now that individual
5427 characters can have unbounded width. Problem introduced
5428 by merge from Emacs 23 on 2012-01-19.
5429
5430 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
5431
5432 * dbusbind.c (Fdbus_register_method): Mention the return value
5433 :ignore in the docstring.
5434
5435 2012-02-02 Glenn Morris <rgm@gnu.org>
5436
5437 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
5438
5439 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
5440 Unconditionally set to t. (Bug#10673)
5441 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
5442 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
5443 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
5444
5445 2012-02-02 Kenichi Handa <handa@m17n.org>
5446
5447 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
5448 0, do not call append_composite_glyph.
5449
5450 2012-02-02 Kenichi Handa <handa@m17n.org>
5451
5452 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
5453 NULL (Bug#6988).
5454 (x_produce_glyphs): If the component of a composition is a null
5455 string, set it->pixel_width to 1 to avoid zero-width glyph.
5456
5457 2012-02-01 Eli Zaretskii <eliz@gnu.org>
5458
5459 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
5460 first 2 arguments are identical. This makes inserting large
5461 output from a subprocess an order of magnitude faster on
5462 MS-Windows, where all sbrk'ed memory is always contiguous.
5463
5464 2012-01-31 Glenn Morris <rgm@gnu.org>
5465
5466 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
5467 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
5468 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
5469
5470 2012-01-29 Glenn Morris <rgm@gnu.org>
5471
5472 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
5473
5474 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
5475
5476 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
5477
5478 2012-01-28 Chong Yidong <cyd@gnu.org>
5479
5480 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
5481
5482 2012-01-26 Chong Yidong <cyd@gnu.org>
5483
5484 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
5485
5486 * search.c (Fsearch_forward, Fsearch_backward): Document negative
5487 repeat counts (Bug#10507).
5488
5489 2012-01-26 Glenn Morris <rgm@gnu.org>
5490
5491 * lread.c (syms_of_lread): Doc fix.
5492
5493 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
5494
5495 * coding.c (encode_designation_at_bol): Change return value to
5496 EMACS_INT.
5497
5498 2012-01-25 Chong Yidong <cyd@gnu.org>
5499
5500 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
5501
5502 2012-01-21 Chong Yidong <cyd@gnu.org>
5503
5504 * floatfns.c (Fcopysign): Make the second argument non-optional,
5505 since nil is not allowed anyway.
5506
5507 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
5508
5509 * process.c (read_process_output): Use p instead of XPROCESS (proc).
5510 (send_process): Likewise.
5511
5512 2012-01-19 Martin Rudalics <rudalics@gmx.at>
5513
5514 * window.c (save_window_save, Fcurrent_window_configuration)
5515 (Vwindow_persistent_parameters): Do not use Qstate.
5516 Rewrite doc-strings.
5517
5518 2012-01-19 Kenichi Handa <handa@m17n.org>
5519
5520 * character.c (char_width): New function.
5521 (Fchar_width, c_string_width, lisp_string_width):
5522 Use char_width (Bug#9496).
5523
5524 2012-01-16 Martin Rudalics <rudalics@gmx.at>
5525
5526 * window.c (Vwindow_persistent_parameters): New variable.
5527 (Fset_window_configuration, save_window_save): Handle persistent
5528 window parameters.
5529
5530 2012-01-14 Eli Zaretskii <eliz@gnu.org>
5531
5532 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
5533 thrashing the stack of the thread. (Bug#9087)
5534
5535 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
5536
5537 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
5538
5539 2012-01-11 Eli Zaretskii <eliz@gnu.org>
5540
5541 * xdisp.c (rows_from_pos_range): Handle the case where the
5542 highlight ends on a newline. (Bug#10464)
5543 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
5544 he end column for display of highlight that ends on a newline
5545 before a R2L line.
5546
5547 2012-01-11 Glenn Morris <rgm@gnu.org>
5548
5549 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
5550 from load-path also when installation-directory is nil. (Bug#10208)
5551
5552 2012-01-10 Glenn Morris <rgm@gnu.org>
5553
5554 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
5555
5556 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
5557 Update template values to be closer to their typical values these days.
5558
5559 2012-01-09 Eli Zaretskii <eliz@gnu.org>
5560
5561 * xdisp.c (rows_from_pos_range): Accept additional argument
5562 DISP_STRING, and accept any glyph in a row whose object is that
5563 string as eligible for mouse highlight. Fixes mouse highlight of
5564 display strings from overlays. (Bug#10464)
5565
5566 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
5567
5568 emacs: fix an auto-save permissions race condition (Bug#10400)
5569 * fileio.c (auto_saving_dir_umask): New static var.
5570 (Fmake_directory_internal): Use it.
5571 (do_auto_save_make_dir): Set it, instead of invoking chmod after
5572 creating the directory. The old code temporarily assigns
5573 too-generous permissions to the directory.
5574 (do_auto_save_eh): Clear it.
5575 (Fdo_auto_save): Catch all errors, not just file errors, so
5576 that the var is always cleared.
5577
5578 2012-01-07 Eli Zaretskii <eliz@gnu.org>
5579
5580 * search.c (scan_buffer): Pass character positions to
5581 know_region_cache, not byte positions. (Bug#6540)
5582
5583 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
5584
5585 * w32.c (sys_rename): Report EXDEV when rename of a directory
5586 fails because the target is on another logical disk. (Bug#10284)
5587
5588 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
5589
5590 * xterm.c (x_embed_request_focus): New function.
5591
5592 * xterm.h: Add prototype.
5593
5594 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
5595
5596 2012-01-05 Glenn Morris <rgm@gnu.org>
5597
5598 * emacs.c (emacs_copyright): Update short copyright year to 2012.
5599
5600 2012-01-01 Eli Zaretskii <eliz@gnu.org>
5601
5602 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
5603 Load gnutls_transport_set_lowat only if GnuTLS version is below
5604 2.11.1.
5605 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
5606 GnuTLS versions below 2.11.1.
5607
5608 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
5609
5610 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
5611 to the doc string advising against its use for altering the way
5612 windows are scrolled.
5613
5614 2011-12-28 Kenichi Handa <handa@m17n.org>
5615
5616 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
5617 coding-system ASCII compatible only when it does not produce BOM
5618 on encoding (Bug#10383).
5619
5620 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
5621
5622 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
5623 can scroll.
5624 (create_and_show_popup_menu): Always use menu_position_func for
5625 Gtk3 (Bug#10361).
5626
5627 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
5628
5629 * callint.c (Fcall_interactively): Don't truncate prompt string.
5630
5631 2011-12-23 Eli Zaretskii <eliz@gnu.org>
5632
5633 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
5634 property that ends at ZV, so that the bidi iteration could be
5635 resumed from there (after widening). (Bug#10360)
5636
5637 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
5638
5639 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
5640
5641 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
5642
5643 * nsterm.m (x_free_frame_resources):
5644 Release f->output_data.ns->miniimage.
5645 (ns_index_color): Fix indentation. Do not retain
5646 color_table->colors[i].
5647
5648 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
5649 before returning.
5650
5651 * nsfns.m (x_set_background_color): Assign return value from
5652 ns_index_color to face-background instead of NSColor*.
5653 (ns_implicitly_set_icon_type): Fix indentation.
5654 Change assignment in for loop to comparison.
5655
5656 * emacs.c (ns_pool): New variable.
5657 (main): Assign ns_pool.
5658 (Fkill_emacs): Call ns_release_autorelease_pool.
5659
5660 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
5661 autorelease fdesc, release fdAttrs and tdict.
5662 (ns_get_covering_families): Release charset.
5663 (ns_findfonts): Release NSFontDescriptor created with new.
5664 (ns_uni_to_glyphs): Fix indentation.
5665 (setString): Release attrStr before assigning new value.
5666
5667 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5668
5669 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
5670 and NS_IMPL_COCOA.
5671 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
5672 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
5673
5674 2011-12-18 David Reitter <reitter@cmu.edu>
5675
5676 * nsterm.m (ns_term_init): Subscribe for notifications
5677 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
5678 to method trackingNotification in EmacsMenu.
5679
5680 * nsmenu.m (trackingMenu): New variable.
5681 (trackingNotification): New method (from Aquamacs).
5682 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
5683 from Aquamacs (Bug#7030).
5684
5685 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5686
5687 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
5688 (symbol_to_nsstring): Fix indentation.
5689 (ns_symbol_to_pb): New function.
5690 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
5691 (Fns_rotate_cut_buffers_internal): Remove.
5692 (Fns_store_selection_internal): Rename from
5693 Fns_store_cut_buffer_internal.
5694 (ns_get_foreign_selection, Fx_own_selection_internal)
5695 (Fx_disown_selection_internal, Fx_selection_exists_p)
5696 (Fns_get_selection_internal, Fns_store_selection_internal):
5697 Use ns_symbol_to_pb and check if return value is nil.
5698 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
5699 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
5700 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
5701 renamed to Sns_store_selection_internal.
5702 (ns_handle_selection_request): Move code to Fx_own_selection_internal
5703 and remove this function.
5704 (ns_handle_selection_clear): Remove, never used.
5705 (Fx_own_selection_internal): Move code from ns_handle_selection_request
5706 here.
5707
5708 2011-12-17 Ken Brown <kbrown@cornell.edu>
5709
5710 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
5711 GID is unknown (Bug#10257).
5712
5713 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
5714
5715 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
5716 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
5717 which caused a build failure on GNU/Linux IA-64. This problem was
5718 introduced by my 2011-10-07 patch.
5719
5720 2011-12-15 Juri Linkov <juri@jurta.org>
5721
5722 * image.c (imagemagick_error): New function. (Bug#10112)
5723 (imagemagick_load_image): Comment out `MagickSetResolution' call.
5724 Use `imagemagick_error' where ImageMagick functions return
5725 `MagickFalse'.
5726 (Fimagemagick_types): Add `Fnreverse' to return the list in the
5727 proper order.
5728
5729 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5730
5731 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
5732 fill background (Bug#8992).
5733
5734 2011-12-13 Martin Rudalics <rudalics@gmx.at>
5735
5736 * window.c (Vwindow_combination_resize)
5737 (Vwindow_combination_limit): Use t instead of non-nil in
5738 doc-strings.
5739 (Vrecenter_redisplay): Add first sentence of doc-string on
5740 separate line.
5741 (Frecenter): Fix doc-string typo.
5742
5743 2011-12-11 Kenichi Handa <handa@m17n.org>
5744
5745 * coding.c (Funencodable_char_position): Pay attention to the
5746 buffer text relocation (Bug#9389).
5747
5748 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
5749
5750 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
5751 gtk_init (Bug#10100).
5752
5753 2011-12-10 Eli Zaretskii <eliz@gnu.org>
5754
5755 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
5756 IT->string is nil. (Bug#10263)
5757
5758 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
5759
5760 * nsterm.h (x_free_frame_resources): Declare.
5761
5762 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
5763 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
5764
5765 * nsterm.h (ns_get_defaults_value): Declare.
5766
5767 * nsterm.m (ns_default): Call ns_get_defaults_value.
5768
5769 2011-12-09 Eli Zaretskii <eliz@gnu.org>
5770
5771 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
5772 (Bug#10170)
5773
5774 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5775
5776 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
5777 that where the value of an _OBJC_* symbol points to is in the .bss
5778 section (Bug#10240).
5779
5780 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
5781
5782 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
5783 after the loop to call ccl_driver at least once (Bug#8619).
5784
5785 2011-12-08 Kenichi Handa <handa@m17n.org>
5786
5787 * ftfont.c (get_adstyle_property): Fix previous change
5788 (Bug#10233).
5789
5790 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
5791
5792 * w32.c (init_environment): If no_site_lisp, remove site-lisp
5793 dirs from the default value of EMACSLOADPATH (bug#10208).
5794
5795 2011-12-07 Glenn Morris <rgm@gnu.org>
5796
5797 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
5798 installation and source directories as well. (Bug#10208)
5799
5800 2011-12-06 Chong Yidong <cyd@gnu.org>
5801
5802 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
5803
5804 2011-12-06 Glenn Morris <rgm@gnu.org>
5805
5806 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
5807 as an error, not just -1. (Bug#10217)
5808
5809 2011-12-05 Chong Yidong <cyd@gnu.org>
5810
5811 * keyboard.c (process_special_events): New function.
5812 (swallow_events, Finput_pending_p): Use it (Bug#10195).
5813
5814 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
5815
5816 * coding.c (encode_designation_at_bol): Don't use uninitialized
5817 local variable (Bug#9318).
5818
5819 2011-12-05 Kenichi Handa <handa@m17n.org>
5820
5821 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
5822 return Qnil (Bug#8046, Bug#10193).
5823
5824 2011-12-05 Kenichi Handa <handa@m17n.org>
5825
5826 * coding.c (encode_designation_at_bol): New args charbuf_end and
5827 dst. Return the number of produced bytes. Callers changed.
5828 (coding_set_source): Return how many bytes coding->source was
5829 relocated.
5830 (coding_set_destination): Return how many bytes
5831 coding->destination was relocated.
5832 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
5833 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5834
5835 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
5836
5837 * coding.c (CODING_CHAR_CHARSET_P): New macro.
5838 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
5839 macro (Bug#9318).
5840
5841 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
5842
5843 The following changes are to fix Bug#9318.
5844
5845 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5846 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
5847 (encode_coding_iso_2022, encode_coding_sjis)
5848 (encode_coding_big5, encode_coding_charset): Use the above macros.
5849
5850 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
5851
5852 * lisp.h (process_quit_flag): Fix external declaration.
5853
5854 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
5855
5856 Don't macro-inline non-performance-critical code.
5857 * eval.c (process_quit_flag): New function.
5858 * lisp.h (QUIT): Use it.
5859
5860 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
5861
5862 * nsfns.m (get_geometry_from_preferences): New function.
5863 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
5864
5865 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
5866
5867 * emacs.c (Qkill_emacs): Define.
5868 (syms_of_emacs): Initialize it.
5869 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
5870 Qquit_flag to `kill-emacs' instead.
5871 (quit_throw_to_read_char): Add parameter `from_signal'.
5872 All callers changed. Call Fkill_emacs if requested and safe.
5873 * lisp.h (QUIT): Call Fkill_emacs if requested.
5874
5875 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
5876
5877 * widget.c (update_wm_hints): Return if wmshell is null.
5878 (widget_update_wm_size_hints): New function.
5879
5880 * widget.h (widget_update_wm_size_hints): Declare.
5881
5882 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
5883 widget_update_wm_size_hints (Bug#10104).
5884
5885 2011-12-03 Eli Zaretskii <eliz@gnu.org>
5886
5887 * xdisp.c (handle_invisible_prop): If the invisible text ends just
5888 before a newline, prepare the bidi iterator for consuming the
5889 newline, and keep the current paragraph direction. (Bug#10183)
5890 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
5891
5892 2011-12-02 Juri Linkov <juri@jurta.org>
5893
5894 * search.c (Fword_search_regexp): New Lisp function created from
5895 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
5896 (Fword_search_backward, Fword_search_forward)
5897 (Fword_search_backward_lax, Fword_search_forward_lax):
5898 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
5899 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
5900
5901 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
5902
5903 * fileio.c (Finsert_file_contents): Move after-change-function call
5904 to before the "handled:" label, since all "goto handled" appear in
5905 cases where the *-change-functions have already been properly called
5906 (bug#10117).
5907
5908 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
5909
5910 * keyboard.c (interrupt_signal): Don't call kill-emacs when
5911 waiting for input. (Bug#10169)
5912
5913 2011-11-30 Eli Zaretskii <eliz@gnu.org>
5914
5915 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
5916 verifies glyph row's hash code--we have just reallocated the
5917 glyphs, so their contents can be complete garbage. (Bug#10164)
5918
5919 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
5920
5921 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
5922
5923 2011-11-30 Eli Zaretskii <eliz@gnu.org>
5924
5925 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
5926 attributes are tested _before_ calling verify_row_hash, to protect
5927 against GCC re-ordering of the tests. (Bug#10164)
5928
5929 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
5930
5931 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
5932
5933 * xterm.c (handle_one_xevent): Only set async_visible and friends
5934 if net_wm_state_hidden_seen is non-zero (Bug#10002)
5935 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
5936 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
5937
5938 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
5939
5940 Remove GCPRO-related macros that exist only to avoid shadowing locals.
5941 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
5942 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
5943 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
5944 All uses changed to use GCPRO1 etc.
5945 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
5946 Revert to old implementation (i.e., before 2011-03-11).
5947
5948 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5949
5950 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
5951 of scroll runs so as to avoid assigning disabled bogus rows and
5952 unnecessary graphics copy operations.
5953
5954 2011-11-27 Eli Zaretskii <eliz@gnu.org>
5955
5956 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
5957 (snprintf) [_MSC_VER]: Redirect to _snprintf.
5958 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
5959 (malloc, free, realloc, calloc): Redirect to e_* only when
5960 compiling Emacs.
5961
5962 * lisp.h (GCTYPEBITS): Move before first use.
5963 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
5964 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
5965 this macro definition.
5966
5967 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
5968 _MSC_VER.
5969
5970 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
5971
5972 * gtkutil.c (xg_create_frame_widgets):
5973 Call gtk_window_set_has_resize_grip (FALSE) if that function is
5974 present with Gtk+ 2.0.
5975
5976 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
5977
5978 * fileio.c (Finsert_file_contents): Undo previous change; see
5979 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
5980
5981 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
5982
5983 Rename locals to avoid shadowing.
5984 * fileio.c (Finsert_file_contents):
5985 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
5986 * process.c (wait_reading_process_output):
5987 Rename inner 'proc' to 'p' to avoid shadowing.
5988 Indent for consistency with usual Emacs style.
5989
5990 2011-11-25 Eli Zaretskii <eliz@gnu.org>
5991
5992 * xdisp.c (redisplay_window): If cursor row is not fully visible
5993 after recentering, and scroll-conservatively is set to a large
5994 number, scroll window by a few more lines to make the cursor fully
5995 visible and out of scroll-margin. (Bug#10105)
5996 (start_display): Don't move to the next line if the display should
5997 start at a newline that is part of a display vector or an overlay
5998 string. (Bug#10119)
5999
6000 2011-11-24 Juri Linkov <juri@jurta.org>
6001
6002 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
6003 after the `MagickPingImage' call. (Bug#10112)
6004
6005 2011-11-23 Chong Yidong <cyd@gnu.org>
6006
6007 * window.c (Fcoordinates_in_window_p): Accept only live windows.
6008
6009 2011-11-23 Martin Rudalics <rudalics@gmx.at>
6010
6011 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
6012 making another buffer current. (Bug#10114)
6013
6014 2011-11-23 Glenn Morris <rgm@gnu.org>
6015
6016 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
6017
6018 2011-11-23 Chong Yidong <cyd@gnu.org>
6019
6020 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
6021 using it (Bug#5984).
6022
6023 2011-11-22 Eli Zaretskii <eliz@gnu.org>
6024
6025 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
6026 and header-lines, as they don't have one computed for them.
6027 (Bug#10098)
6028
6029 * .gdbinit (prow): Make displayed values more self-explaining.
6030 Add row's hash code.
6031
6032 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
6033
6034 * process.c (wait_reading_process_output): Fix asynchrounous
6035 GnuTLS socket handling on some versions of the GnuTLS library.
6036 (wait_reading_process_output): Add comment and URL.
6037
6038 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
6039
6040 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
6041
6042 2011-11-21 Chong Yidong <cyd@gnu.org>
6043
6044 * window.c (Fnext_window, Fprevious_window): Doc fix.
6045
6046 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
6047
6048 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
6049
6050 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
6051
6052 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
6053
6054 2011-11-20 Martin Rudalics <rudalics@gmx.at>
6055
6056 * window.c (Fset_window_combination_limit): Rename argument
6057 STATUS to LIMIT.
6058 (Vwindow_combination_limit): Remove "status" from doc-string.
6059
6060 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
6061
6062 * m/ibms390.h: Remove.
6063 * m/ibms390x.h: Don't include "ibms390.h".
6064
6065 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
6066
6067 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
6068 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
6069
6070 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
6071
6072 * casetab.c (Fset_case_table):
6073 * charset.c (Fcharset_after): Fix typos.
6074
6075 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6076
6077 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
6078 Otherwise, valgrind does not work on some platforms.
6079 Problem reported by Andreas Schwab in
6080 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
6081 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
6082 is set, removing the need for VIRT_ADDRESS_VARIES.
6083 (PURE_P): Use a more-efficient implementation that needs just one
6084 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
6085 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
6086 to 4 (xorl, subq, cmpq, setbe).
6087 * alloc.c (pure): Always extern now, since that's the
6088 VIRT_ADDR_VARIES behavior.
6089 (PURE_POINTER_P): Use a single comparison, not two, for
6090 consistency with the new puresize.h.
6091 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
6092 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
6093 Remove VIRT_ADDR_VARIES no longer needed.
6094
6095 2011-11-19 Eli Zaretskii <eliz@gnu.org>
6096
6097 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
6098 (erase_phys_cursor, update_window_cursor, show_mouse_face)
6099 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
6100 behave as if the cursor position were at the window margin.
6101
6102 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
6103 and the cursor position is out of bounds, behave as if the cursor
6104 position were at the window margin. (Bug#10075)
6105
6106 2011-11-18 Chong Yidong <cyd@gnu.org>
6107
6108 * window.c (Fwindow_combination_limit): Make first argument
6109 non-optional, since it is meaningless for live windows like the
6110 selected window.
6111
6112 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
6113
6114 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
6115
6116 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
6117
6118 * intervals.c: Fix grafting over the whole buffer (bug#10071).
6119 (graft_intervals_into_buffer): Simplify.
6120
6121 2011-11-18 Eli Zaretskii <eliz@gnu.org>
6122
6123 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
6124 hash values of the two rows.
6125 (copy_row_except_pointers): Preserve the used[] arrays and the
6126 hash values of the two rows. (Bug#10035)
6127 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
6128
6129 * xdisp.c (row_hash): New function, body extracted from
6130 compute_line_metrics.
6131 (compute_line_metrics): Call row_hash, instead of computing the
6132 hash code inline.
6133
6134 * dispnew.c (verify_row_hash): Call row_hash for computing the
6135 hash code of a row, instead of duplicating code from xdisp.c.
6136
6137 * dispextern.h (row_hash): Add prototype.
6138
6139 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
6140
6141 * frame.c (delete_frame): Don't delete the terminal when the last
6142 X frame is closed if emacs is built with GTK toolkit.
6143
6144 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
6145
6146 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
6147
6148 2011-11-17 Martin Rudalics <rudalics@gmx.at>
6149
6150 * window.c (Vwindow_splits): Rename to
6151 Vwindow_combination_resize. Suggested by Juri Linkov.
6152 (Fsplit_window_internal): Use Vwindow_combination_resize instead
6153 of Vwindow_splits.
6154
6155 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
6156
6157 * nsfns.m (Fns_font_name):
6158 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
6159
6160 2011-11-16 Martin Rudalics <rudalics@gmx.at>
6161
6162 * window.h (window): Rename slot "nest" to "combination_limit".
6163 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
6164 (Fset_window_nest): Rename to Fset_window_combination_limit.
6165 (Vwindow_nest): Rename to Vwindow_combination_limit.
6166 (recombine_windows, make_parent_window, make_window)
6167 (Fsplit_window_internal, saved_window)
6168 (Fset_window_configuration, save_window_save): Rename all
6169 occurrences of window_nest to window_combination_limit.
6170
6171 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
6172
6173 * image.c (imagemagick_load_image): Fix typo.
6174
6175 2011-11-14 Eli Zaretskii <eliz@gnu.org>
6176
6177 * xdisp.c (display_line): Move the call to
6178 highlight_trailing_whitespace before the call to
6179 compute_line_metrics, since the latter needs to see the final
6180 faces of all the glyphs to compute ROW's hash value.
6181 Fixes assertion violations in row_equal_p. (Bug#10035)
6182
6183 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
6184
6185 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
6186 just return (bug#10044).
6187
6188 2011-11-12 Eli Zaretskii <eliz@gnu.org>
6189
6190 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
6191 with user-defined heap size. Bump the default size of the temacs
6192 heap to 27MB, to avoid memory warning when running temacs.
6193 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
6194
6195 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
6196 current_matrix and desired_matrix. (Bug#9990)
6197 (verify_row_hash) [XASSERTS]: New function.
6198 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
6199 that the hash value of glyph rows is correct.
6200
6201 2011-11-12 Martin Rudalics <rudalics@gmx.at>
6202
6203 * window.h (window): Remove splits slot.
6204 * window.c (Fwindow_splits, Fset_window_splits): Remove.
6205 (Fdelete_other_windows_internal, make_parent_window)
6206 (make_window, Fsplit_window_internal, Fdelete_window_internal)
6207 (Fset_window_configuration, save_window_save): Don't deal with
6208 split status of windows.
6209 (saved_window): Remove splits slot.
6210 (Vwindow_splits): Rewrite doc-string.
6211
6212 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
6213
6214 * xfns.c (unwind_create_frame):
6215 * nsfns.m (unwind_create_frame):
6216 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
6217 Vframe_list (Bug#9999).
6218
6219 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
6220
6221 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
6222
6223 2011-11-11 Kenichi Handa <handa@m17n.org>
6224
6225 * callproc.c (Fcall_process): Set the member dst_multibyte of
6226 process_coding.
6227
6228 2011-11-11 Johan Bockgård <bojohan@gnu.org>
6229
6230 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
6231 avoid a crash (bug#9496).
6232
6233 2011-11-09 Chong Yidong <cyd@gnu.org>
6234
6235 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
6236 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
6237
6238 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
6239
6240 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
6241
6242 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
6243
6244 Avoid some portability problems by eschewing 'extern inline' functions.
6245 The trivial performance wins aren't worth the portability hassles; see
6246 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
6247 et seq.
6248 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
6249 (window_box_width, window_box_left, window_box_left_offset)
6250 (window_box_right, window_box_right_offset): Undo previous change,
6251 by removing the "extern"s.
6252 * intervals.c (adjust_intervals_for_insertion)
6253 (adjust_intervals_for_deletion): Undo previous change,
6254 making these static again.
6255 (offset_intervals, temp_set_point_both, temp_set_point)
6256 (copy_intervals_to_string): No longer inline.
6257 * xdisp.c (window_text_bottom_y, window_box_width)
6258 (window_box_height, window_box_left_offset)
6259 (window_box_right_offset, window_box_left, window_box_right)
6260 (window_box): No longer inline.
6261
6262 2011-11-08 Chong Yidong <cyd@gnu.org>
6263
6264 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6265 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
6266 Signal an error if not a live window.
6267 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
6268 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
6269
6270 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
6271
6272 * lisp.h (syms_of_abbrev): Remove declaration.
6273 Reported by CHENG Gao <chenggao@royau.me>.
6274
6275 2011-11-07 Eli Zaretskii <eliz@gnu.org>
6276
6277 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
6278 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
6279 of temacs in GUI mode.
6280
6281 2011-11-07 Martin Rudalics <rudalics@gmx.at>
6282
6283 * window.h: Declare delete_all_child_windows instead of
6284 delete_all_subwindows.
6285 * window.c (Fwindow_nest, Fset_window_nest)
6286 (Fset_window_new_total, Fset_window_new_normal)
6287 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
6288 (delete_all_subwindows): Rename to delete_all_child_windows.
6289 (Fdelete_other_windows_internal, Fset_window_configuration):
6290 Call delete_all_child_windows instead of delete_all_subwindows.
6291 * frame.c (delete_frame): Call delete_all_child_windows instead
6292 of delete_all_subwindows.
6293
6294 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
6295
6296 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
6297 This is also needed for porting to any host where GC_MARK_STACK is
6298 not GC_MAKE_GCPROS_NOOPS.
6299 (which_symbols): Use it.
6300
6301 2011-11-07 Kenichi Handa <handa@m17n.org>
6302
6303 * coding.c (coding_set_destination): Check coding->src_pos only
6304 when coding->src_object is a buffer (bug#9910).
6305
6306 * process.c (send_process): Set the member src_multibyte of coding
6307 to 0 (bug#9911) when sending a unibyte text.
6308
6309 * callproc.c (Fcall_process): Set the member src_multibyte of
6310 process_coding to 0 (bug#9912).
6311
6312 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6313
6314 * xmenu.c (cleanup_widget_value_tree): New function.
6315 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
6316 calling free_menubar_widget_value_tree directly (Bug#9830).
6317
6318 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
6319
6320 Fix some portability problems with 'inline'.
6321 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
6322 (window_box_width, window_box_left, window_box_left_offset)
6323 (window_box_right, window_box_right_offset): Declare extern.
6324 Otherwise, these inline functions do not conform to C99 and
6325 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
6326 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
6327 * intervals.c (adjust_intervals_for_insertion)
6328 (adjust_intervals_for_deletion): Now extern, because otherwise the
6329 extern inline functions 'offset_intervals' couldn't refer to it.
6330 (static_offset_intervals): Remove.
6331 (offset_intervals): Rewrite using the old contents of
6332 static_offset_intervals. The old version didn't conform to C99
6333 because an extern inline function contained a reference to an
6334 identifier with static linkage.
6335
6336 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
6337
6338 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
6339 GC.
6340
6341 2011-11-06 Eli Zaretskii <eliz@gnu.org>
6342
6343 * xdisp.c (init_iterator, reseat_to_string): Don't set the
6344 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
6345 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
6346 return Qleft_to_right.
6347
6348 2011-11-06 Chong Yidong <cyd@gnu.org>
6349
6350 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
6351 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
6352 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
6353 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
6354 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
6355 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
6356 (Fwindow_vscroll): Doc fix.
6357 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
6358 argument, since it makes no sense to pass a live window and for
6359 consistency with window-child.
6360
6361 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
6362
6363 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
6364 support MSVC.
6365
6366 2011-11-05 Jason Rumney <jasonr@gnu.org>
6367
6368 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
6369 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
6370 fonts (Bug#6029).
6371 (add_font_entity_to_list): Fix logic errors in mixed boolean and
6372 bitwise arithmetic preventing use of unicode-sip and non-truetype
6373 opentype fonts.
6374
6375 2011-11-05 Eli Zaretskii <eliz@gnu.org>
6376
6377 * s/ms-w32.h (fstat, stat, utime): Move redirections to
6378 "emacs"-only part.
6379
6380 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
6381 initialization code to keep similarity to xfns.c after changes
6382 from 2011-11-05.
6383
6384 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
6385
6386 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
6387 (unwind_create_frame): New function (Bug#9943).
6388 (Fx_create_frame): Restructure code to be more similar to the one in
6389 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
6390 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
6391 Move terminal->reference_count++ just before making the frame official
6392 (Bug#9943).
6393
6394 * nsterm.m (x_free_frame_resources): New function.
6395 (x_destroy_window): Move code to x_free_frame_resources.
6396
6397 * xfns.c (unwind_create_frame): Fix comment.
6398 (Fx_create_frame, x_create_tip_frame):
6399 Move terminal->reference_count++ just before making the frame
6400 official. Move initialization of image_cache_refcount and
6401 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
6402
6403 2011-11-05 Eli Zaretskii <eliz@gnu.org>
6404
6405 Support MSVC build with newer versions of Visual Studio.
6406 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
6407 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
6408 nt/gmake.defs.
6409
6410 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
6411 which are not supported by MSVC.
6412 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
6413 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
6414 bitfields.
6415 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
6416 types in bitfields.
6417 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
6418
6419 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
6420
6421 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
6422
6423 Support MSVC build with newer versions of Visual Studio.
6424 * w32.c: Don't include w32api.h for MSVC.
6425 (init_environment) [_MSC_VER]: Call sys_access, not _access.
6426
6427 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
6428 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
6429 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
6430 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
6431 e_* cousins.
6432 (alloca) [_MSC_VER]: Define to _alloca.
6433
6434 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
6435
6436 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
6437
6438 2011-11-04 Eli Zaretskii <eliz@gnu.org>
6439
6440 * xdisp.c (note_mouse_highlight): If either of
6441 previous/next-single-property-change returns nil, treat that as
6442 the beginning or the end of the buffer. (Bug#9955)
6443
6444 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
6445
6446 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
6447 label is not null (Bug#9951).
6448 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
6449 may be NULL.
6450
6451 2011-11-04 Eli Zaretskii <eliz@gnu.org>
6452
6453 * window.c (Fwindow_body_size): Mention in the doc string that the
6454 return value is in frame's canonical units. (Bug#9949)
6455
6456 2011-11-03 Eli Zaretskii <eliz@gnu.org>
6457
6458 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
6459
6460 * w32fns.c (unwind_create_frame): If needed, free the glyph
6461 matrices of the partially constructed frame. (Bug#9943)
6462 * xfns.c (unwind_create_frame): Likewise.
6463
6464 2011-11-01 Eli Zaretskii <eliz@gnu.org>
6465
6466 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
6467 Don't stop backward scan on the continuation glyph, even though
6468 its CHARPOS is positive.
6469 (mouse_face_from_buffer_pos, note_mouse_highlight):
6470 Rename cover_string to disp_string.
6471
6472 2011-11-01 Martin Rudalics <rudalics@gmx.at>
6473
6474 * window.c (temp_output_buffer_show): Don't use
6475 Vtemp_buffer_show_specifiers.
6476 (Vtemp_buffer_show_specifiers): Remove unused variable.
6477
6478 2011-10-30 Eli Zaretskii <eliz@gnu.org>
6479
6480 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
6481 past the beginning of the current glyph matrix.
6482
6483 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6484
6485 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
6486 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
6487 HAVE_GTK3 (Bug#9869).
6488
6489 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
6490 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
6491
6492 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
6493
6494 * xterm.c: Declare x_handle_net_wm_state to return int.
6495 (handle_one_xevent): Check if we are iconified but don't have
6496 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
6497 (get_current_wm_state): Return non-zero if not hidden,
6498 check for _NET_WM_STATE_HIDDEN (Bug#9893).
6499 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
6500 (x_handle_net_wm_state): Return what get_current_wm_state returns.
6501 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
6502
6503 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
6504
6505 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
6506 so that this new function doesn't get optimized away by a
6507 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
6508
6509 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
6510
6511 * frame.h (MOUSE_HL_INFO): Remove excess parens.
6512
6513 2011-10-29 Eli Zaretskii <eliz@gnu.org>
6514
6515 Fix the `xbytecode' command.
6516 * .gdbinit (xprintbytestr): New command.
6517 (xwhichsymbols): Rename from `which'; all callers changed.
6518 (xbytecode): Print the byte-code string as well.
6519
6520 2011-10-29 Kim Storm <storm@cua.dk>
6521
6522 * alloc.c (which_symbols): New function.
6523
6524 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
6525
6526 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
6527 line. (Bug#9903)
6528
6529 2011-10-29 Glenn Morris <rgm@gnu.org>
6530
6531 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
6532 Not clear what it was for, and it causes various bugs. (Bug#9839)
6533
6534 2011-10-28 Eli Zaretskii <eliz@gnu.org>
6535
6536 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
6537 possible random value that matches one of those tested as
6538 condition to clear the mouse face.
6539
6540 2011-10-28 Chong Yidong <cyd@gnu.org>
6541
6542 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
6543
6544 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
6545
6546 * window.c (make_window): Initialize phys_cursor_on_p.
6547
6548 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
6549
6550 * lisp.h (struct Lisp_Symbol): Update comments.
6551
6552 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
6553
6554 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
6555
6556 2011-10-28 Eli Zaretskii <eliz@gnu.org>
6557
6558 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
6559 <oslsachem@gmail.com> for helping to debug this.
6560
6561 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
6562 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
6563 (g_b_init_get_glyph_outline_w): New static variables.
6564 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
6565 (GetGlyphOutlineW_Proc): New typedefs.
6566 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
6567 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
6568 New functions.
6569 (w32font_open_internal, compute_metrics):
6570 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
6571 instead of calling the "wide" APIs directly.
6572
6573 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
6574
6575 * w32.h (syms_of_w32font): Add prototype.
6576
6577 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
6578
6579 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
6580 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
6581 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
6582 (Fmove_to_window_line): Doc fix.
6583
6584 2011-10-27 Chong Yidong <cyd@gnu.org>
6585
6586 * process.c (make_process): Set gnutls_state to NULL.
6587
6588 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
6589 non-NULL, regardless of GNUTLS_INITSTAGE.
6590 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
6591 an error. Set process slots as soon as we allocate them.
6592
6593 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
6594
6595 2011-10-27 Chong Yidong <cyd@gnu.org>
6596
6597 * gnutls.c (emacs_gnutls_deinit): New function.
6598 Deallocate credentials structures as well as calling gnutls_deinit.
6599 (Fgnutls_deinit, Fgnutls_boot): Use it.
6600
6601 * process.c (make_process): Initialize GnuTLS credentials to NULL.
6602 (deactivate_process): Call emacs_gnutls_deinit.
6603
6604 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
6605
6606 * image.c (x_create_x_image_and_pixmap):
6607 * w32.c (sys_rename, w32_delayed_load):
6608 * w32font.c (fill_in_logfont):
6609 * w32reg.c (x_get_string_resource): Silence compiler warnings.
6610
6611 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
6612
6613 * w32fns.c (w32_default_color_map): New function,
6614 extracted from Fw32_default_color_map.
6615 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
6616
6617 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
6618
6619 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
6620
6621 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
6622
6623 * keyboard.c (test_undefined): New function (bug#9751).
6624 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
6625
6626 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
6627
6628 * sysdep.c (init_sys_modes): Fix the check for the controlling
6629 terminal (Bug#6649).
6630
6631 2011-10-20 Eli Zaretskii <eliz@gnu.org>
6632
6633 * dispextern.h (struct bidi_it): New member next_en_type.
6634
6635 * bidi.c (bidi_line_init): Initialize the next_en_type member.
6636 (bidi_resolve_explicit_1): When next_en_pos is valid for the
6637 current character, check also for next_en_type being WEAK_EN.
6638 (bidi_resolve_weak): Don't enter the expensive loop if the current
6639 position is before next_en_pos. Record the bidi type of the first
6640 non-ET, non-BN character we find, in addition to its position.
6641 (bidi_level_of_next_char): Invalidate next_en_type when
6642 next_en_pos is over-stepped.
6643
6644 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
6645
6646 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
6647 * editfns.c: Rewrite current-time-zone so that it invokes
6648 the equivalent of (format-time-string "%Z") to get the time zone name.
6649 This fixes a bug when the time zone name contains characters that
6650 need converting from the system time locale to Emacs internal format.
6651 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
6652 that patch fixed format-time-string to do the conversion, but
6653 I forgot to fix current-time-zone.
6654 (format_time_string): New function, containing most of
6655 what Fformat_time_string used to contain.
6656 (Fformat_time_string): Rewrite in terms of format_time_string.
6657 This doesn't change this function's behavior.
6658 (current-time-zone): Rewrite to use format_time_string.
6659 This fixes the bug reported by Michael Schierl in
6660 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
6661 Jason Rumney's 2007-06-07 change worked around this bug, but
6662 didn't fix it.
6663 * systime.h (tzname, timezone): Remove no-longer-used declarations.
6664
6665 2011-10-19 Eli Zaretskii <eliz@gnu.org>
6666
6667 * xdisp.c (start_display): If the character at POS is displayed
6668 via a display vector, reset IT->current.dpvec_index to zero.
6669 (try_window_reusing_current_matrix): If a line ends in a display
6670 vector or the next line starts in a display vector, continue
6671 redrawing the window even though the character position of
6672 start_row was reached.
6673 (Bug#9771, part 2)
6674
6675 2011-10-18 Chong Yidong <cyd@gnu.org>
6676
6677 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
6678 with nobreak-char-display too.
6679
6680 2011-10-18 Eli Zaretskii <eliz@gnu.org>
6681
6682 Fix part 3 of bug#9771.
6683 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
6684 (bidi_resolve_neutral): Don't enter the expensive loop looking for
6685 non-neutral characters if the current character is a paragraph
6686 separator (a.k.a. Newline). This avoids running the same
6687 expensive loop twice, once when we consume the preceding newline
6688 and the other time when the line actually needs to be displayed.
6689 Avoid the loop when we see neutrals on the base embedding level
6690 following a character whose directionality is the same as the
6691 paragraph's. This avoids running the expensive loop when a line
6692 ends in a long sequence of neutrals, like control characters.
6693 Add assertion against STRONG_AL type. Slightly rearrange code
6694 that determines the type of a neutral given the first non-neutral
6695 that follows it.
6696 (bidi_level_of_next_char): Set next_en_pos to zero when
6697 invalidating its info.
6698
6699 2011-10-17 Eli Zaretskii <eliz@gnu.org>
6700
6701 * xdisp.c (push_display_prop): Determine whether to record string
6702 or buffer position by IT->string, not by IT->method. Allow
6703 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
6704 (move_it_vertically_backward): Don't look for character position
6705 immediately after the newline when in a continuation line.
6706 (Bug#9771, part 1)
6707
6708 2011-10-15 Martin Rudalics <rudalics@gmx.at>
6709
6710 * window.c (coordinates_in_window): Rewrite and delabelize
6711 vertical border check. (Bug#5357) (Bug#9618)
6712
6713 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
6714
6715 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
6716 errors in XSetWindowBorder (bug#9310).
6717
6718 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
6719
6720 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
6721 avoid crash when xmalloc overrun checking is enabled.
6722
6723 2011-10-13 Eli Zaretskii <eliz@gnu.org>
6724
6725 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
6726 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
6727 cursor motion with <left> and <right> arrow keys.
6728
6729 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
6730 some callers set that themselves.
6731
6732 2011-10-12 Eli Zaretskii <eliz@gnu.org>
6733
6734 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
6735 display string and the previous row comes from the same string and
6736 is empty. (Bug#9739) (Bug#9738)
6737
6738 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
6739
6740 * doc.c (get_doc_string): Encode file name (bug#9735).
6741
6742 2011-10-12 Eli Zaretskii <eliz@gnu.org>
6743
6744 * bidi.c (bidi_level_of_next_char):
6745 * xdisp.c (get_visually_first_element): Remove old incorrect
6746 comments regarding the Unicode Line Separator character.
6747
6748 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
6749
6750 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
6751
6752 * alloc.c (Fgc_status): Do not access beyond zombies array
6753 boundary if nzombies > MAX_ZOMBIES.
6754 * alloc.c (dump_zombies): Add missing format specifier.
6755
6756 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
6757
6758 * xdisp.c (set_cursor_from_row): Simplify conditionals,
6759 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
6760
6761 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
6762 Some packages use them to denote characters with modifiers.
6763
6764 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
6765
6766 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
6767 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
6768 matching a pp-number. Rename parameter var to var1.
6769
6770 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
6771
6772 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
6773
6774 2011-10-08 Glenn Morris <rgm@gnu.org>
6775
6776 * callint.c (Fcall_interactively): Give a more explicit error for the
6777 'c' case with a non-character input. (Bug#8479)
6778
6779 2011-10-08 Eli Zaretskii <eliz@gnu.org>
6780
6781 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
6782 lines.
6783 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
6784 lines that are hscrolled on the left.
6785
6786 * dispnew.c (buffer_posn_from_coords): Account for a possible
6787 presence of header-line. (Bug#4426)
6788
6789 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
6790
6791 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
6792 Don't advertise functionality which we discourage or doesn't work.
6793
6794 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
6795
6796 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
6797 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
6798 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
6799 this makes Emacs dump core during garbage collection on rare
6800 occasions. sizeof is obviously inferior to offsetof here, so
6801 stick with offsetof.
6802 (GC_POINTER_ALIGNMENT): New macro.
6803 (mark_memory): Omit 3rd (offset) arg; caller changed.
6804 Don't assume EMACS_INT alignment is the same as pointer alignment.
6805
6806 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
6807
6808 * keyboard.c (read_key_sequence_remapped): New var.
6809 (read_key_sequence): Compute remapping in the right buffer.
6810 (command_loop_1): Use read_key_sequence's remapping directly.
6811
6812 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
6813
6814 * dired.c (file_name_completion): Don't expand file name.
6815 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
6816 before checking file name handler.
6817
6818 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
6819 they've been requested explicitly (bug#9591).
6820
6821 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
6822
6823 * keymap.c (Fsingle_key_description): Use make_specified_string
6824 instead of build_string to build string from push_key_description.
6825 (Bug#5193)
6826
6827 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
6828
6829 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
6830 This fixes a Y2038 bug on 64-bit hosts.
6831 * buffer.c (reset_buffer):
6832 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
6833 (Fclear_buffer_auto_save_failure):
6834 Use 0, not -1, to represent an unset failure time, since time_t
6835 might not be signed.
6836
6837 Remove dependency on glibc malloc internals.
6838 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6839 Move back here from lisp.h, but with their new implementations.
6840 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
6841 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
6842 * charset.c (charset_table_init): New static var.
6843 (syms_of_charset): Use it instead of xmalloc. This removes a
6844 dependency on glibc malloc internals. See Eli Zaretskii's comment in
6845 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
6846 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6847 Move back to alloc.c.
6848 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
6849 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
6850
6851 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
6852
6853 * nsterm.m (windowDidResize): Call x_set_window_size only when
6854 ns_in_resize is true. Otherwise set pixelwidth/height and
6855 call change_frame_size (Bug#9628).
6856
6857 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
6858
6859 Port --enable-checking=all to Fedora 14 x86-64.
6860 * charset.c (syms_of_charset): Also account for glibc malloc's
6861 internal overhead when calculating the initial malloc maximum.
6862
6863 Port --enable-checking=all to Fedora 14 x86.
6864 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6865 Move to lisp.h.
6866 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
6867 (overrun_check_realloc, overrun_check_free):
6868 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
6869 That way, xmalloc returns a properly-aligned pointer even if
6870 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
6871 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
6872 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
6873 into account when calculating the initial malloc maximum.
6874 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6875 Move here from alloc.c, so that charset.c can use it too.
6876 Properly align; the old code wasn't right for common 32-bit hosts
6877 when configured with --enable-checking=all.
6878 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
6879 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
6880
6881 2011-09-29 Eli Zaretskii <eliz@gnu.org>
6882
6883 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
6884 use EDOM.
6885
6886 2011-09-28 Eli Zaretskii <eliz@gnu.org>
6887
6888 * xdisp.c (compute_display_string_end): If there's no display
6889 string at CHARPOS, return -1.
6890
6891 * bidi.c (bidi_fetch_char): When compute_display_string_end
6892 returns a negative value, treat the character as a normal
6893 character not covered by a display string. (Bug#9624)
6894
6895 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
6896
6897 * lread.c (Fread_from_string): Fix typo in docstring.
6898
6899 2011-09-27 Eli Zaretskii <eliz@gnu.org>
6900
6901 * xdisp.c (handle_invisible_prop): If invisible text ends on a
6902 newline, reseat the iterator instead of bidi-iterating there one
6903 character at a time. (Bug#9610)
6904 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
6905 TO_CHARPOS if the bidi iterator is at base embedding level.
6906
6907 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
6908
6909 * lread.c (readevalloop): Use correct code for NBSP.
6910 (read1): Likewise. (Bug#9608)
6911
6912 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
6913
6914 * dbusbind.c (Fdbus_register_signal): When service is not
6915 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
6916
6917 2011-09-25 Glenn Morris <rgm@gnu.org>
6918
6919 * buffer.c (truncate-lines): Doc fix.
6920
6921 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
6922
6923 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
6924 (Fset_window_next_buffers): Doc fix.
6925
6926 2011-09-24 Glenn Morris <rgm@gnu.org>
6927
6928 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
6929
6930 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
6931
6932 Fix minor problems found by static checking.
6933 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
6934 * indent.c (Fvertical_motion): Fix == vs = typo.
6935
6936 2011-09-24 Eli Zaretskii <eliz@gnu.org>
6937
6938 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
6939 Default value is now t. Doc fix.
6940
6941 * indent.c (Fvertical_motion): Compute and apply the overshoot
6942 logic when moving up, not only when moving down. Fix the
6943 confusing name and values of the it_overshoot_expected variable;
6944 logic changes accordingly. (Bug#9254) (Bug#9549)
6945
6946 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
6947 CHARPOS is covered by a display string which includes newlines.
6948 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
6949 is covered by a display string with embedded newlines.
6950
6951 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
6952
6953 * dbusbind.c (Fdbus_register_signal): Add match rule to
6954 Vdbus_registered_objects_table. (Bug#9581)
6955 (Fdbus_register_method, Vdbus_registered_objects_table):
6956 Fix docstring.
6957
6958 2011-09-24 Jim Meyering <meyering@redhat.com>
6959
6960 do not ignore write error for any output size
6961 The previous change was incomplete.
6962 While it makes emacs --batch detect the vast majority of stdout
6963 write failures, errors were still ignored whenever the output size is
6964 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
6965 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
6966 && echo FAIL: ignored write error
6967 FAIL: ignored write error
6968 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
6969 && echo FAIL: ignored write error
6970 FAIL: ignored write error
6971 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
6972
6973 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
6974
6975 * emacs.c (Fkill_emacs): In noninteractive mode exit
6976 non-successfully if a write error occurred on stdout. (Bug#9574)
6977
6978 2011-09-21 Eli Zaretskii <eliz@gnu.org>
6979
6980 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
6981 the xassert test.
6982
6983 * dispextern.h (struct it): Update the comment documenting what
6984 can it->OBJECT be.
6985
6986 2011-09-20 Eli Zaretskii <eliz@gnu.org>
6987
6988 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
6989 a display string, extend search for cursor position to end of row.
6990 (find_row_edges): If the row ends in a newline from a display
6991 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
6992 Handle the case of a display string with multiple newlines.
6993 (Fcurrent_bidi_paragraph_direction): Fix search for previous
6994 non-empty line. Fixes confusing cursor motion with arrow keys at
6995 the beginning of a line that starts with whitespace.
6996
6997 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
6998
6999 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
7000 (bug#9493).
7001
7002 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
7003
7004 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
7005 boolean (Bug#9154).
7006
7007 2011-09-18 Eli Zaretskii <eliz@gnu.org>
7008
7009 * xdisp.c (display_line): Record maximum and minimum buffer
7010 positions even if no glyphs were produced (e.g., by a zero-width
7011 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
7012 buffer positions that will be removed from the glyph row because
7013 they don't fit.
7014 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
7015 column is beyond frame width: don't subtract 1 "pixel" when
7016 computing width of the stretch.
7017 (reseat_at_next_visible_line_start): Undo the change made on
7018 2011-09-17 that saved paragraph information and restored it after
7019 the call to `reseat'. (Bug#9545)
7020
7021 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7022
7023 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
7024 and turn window cursor on if cleared (Bug#9415).
7025
7026 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
7027
7028 * search.c (boyer_moore): Take unibyte characters from pattern
7029 literally. (Bug#9458)
7030
7031 2011-09-18 Eli Zaretskii <eliz@gnu.org>
7032
7033 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
7034
7035 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
7036
7037 Fix minor problem found by static checking.
7038 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
7039 initialized, to pacify gcc -Wuninitialized.
7040
7041 * fileio.c: Report proper errno when syscall falls.
7042 (Finsert_file_contents): Save and restore errno,
7043 so that report_file_error outputs the correct diagnostic.
7044 (Fwrite_region) [CLASH_DETECTION]: Likewise.
7045
7046 2011-09-18 Eli Zaretskii <eliz@gnu.org>
7047
7048 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
7049
7050 2011-09-17 Eli Zaretskii <eliz@gnu.org>
7051
7052 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
7053 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
7054
7055 2011-09-17 Eli Zaretskii <eliz@gnu.org>
7056
7057 * xdisp.c (reseat_at_next_visible_line_start): Keep information
7058 about the current paragraph and restore it after the call to reseat.
7059
7060 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
7061 (bidi_find_paragraph_start): Search back for paragraph beginning
7062 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
7063 (bidi_move_to_visually_next): Only trigger paragraph-related
7064 computations when the last character is a newline or at EOB, not
7065 just any NEUTRAL_B. (Bug#9470)
7066
7067 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
7068 truncated lines if point is covered by a display string. (Bug#9524)
7069
7070 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
7071
7072 * xselect.c: Relax test for outgoing X longs (Bug#9498).
7073 (cons_to_x_long): New function.
7074 (lisp_data_to_selection_data): Use it. Correct the test for
7075 short-versus-long data; it was negated. Break out of vector
7076 loop, for efficiency, when a long datum is discovered.
7077
7078 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
7079
7080 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
7081
7082 2011-09-16 Eli Zaretskii <eliz@gnu.org>
7083
7084 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
7085 GCC PR/17406) by declaring this function with external scope.
7086
7087 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
7088
7089 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
7090 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
7091
7092 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
7093
7094 * editfns.c (Fformat): Correctly handle text properties on "%%".
7095
7096 2011-09-15 Eli Zaretskii <eliz@gnu.org>
7097
7098 * xterm.c (x_draw_composite_glyph_string_foreground):
7099 * w32term.c (x_draw_composite_glyph_string_foreground):
7100 * term.c (encode_terminal_code):
7101 * composite.c (composition_update_it, get_composition_id):
7102 * xdisp.c (get_next_display_element)
7103 (fill_composite_glyph_string): Add comments about special meaning
7104 of TAB characters in a composition.
7105
7106 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
7107
7108 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
7109 This occurs when processing a multibyte format.
7110 Problem reported by Wolfgang Jenker.
7111
7112 2011-09-15 Johan Bockgård <bojohan@gnu.org>
7113
7114 * xdisp.c (try_cursor_movement): Only check for exact match if
7115 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
7116
7117 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
7118
7119 Remove unused external symbols.
7120 * dispextern.h (calc_pixel_width_or_height): Remove decl.
7121 * xdisp.c (calc_pixel_width_or_height): Now static.
7122 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
7123 * indent.c (check_display_width):
7124 * w32term.c: Fix comment to match code.
7125 * xterm.c, xterm.h (x_catching_errors): Remove.
7126
7127 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
7128
7129 * xselect.c: Use signed conversions more consistently (Bug#9498).
7130 (selection_data_to_lisp_data): Assume incoming selection data are
7131 signed integers, not unsigned. This is to be consistent with
7132 outgoing selection data, which was modified to use signed integers
7133 in as part of the fix to Bug#9196 in response to Jan D.'s comment
7134 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
7135 expects long, not unsigned long.
7136
7137 2011-09-14 Eli Zaretskii <eliz@gnu.org>
7138
7139 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
7140 computation of loop end. Reported by Johan Bockgård
7141 <bojohan@gnu.org>.
7142
7143 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
7144
7145 * frame.c (Fother_visible_frames_p): Function deleted.
7146
7147 2011-09-12 Eli Zaretskii <eliz@gnu.org>
7148
7149 * indent.c (compute_motion): Process display vector front to back
7150 rather than the other way around. (Bug#2496)
7151
7152 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7153
7154 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
7155
7156 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
7157
7158 * minibuf.c (Fread_from_minibuffer): Doc fix.
7159
7160 2011-09-11 Eli Zaretskii <eliz@gnu.org>
7161
7162 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
7163 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
7164
7165 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
7166
7167 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
7168 value for non-existent files.
7169
7170 2011-09-11 Eli Zaretskii <eliz@gnu.org>
7171
7172 * fileio.c (Finsert_file_contents): If the file cannot be opened,
7173 set its "size" to -1. This will set the modtime_size field of
7174 the corresponding buffer to -1, which is what
7175 verify-visited-file-modtime expects for files that do not exist.
7176 (Bug#9139)
7177
7178 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
7179
7180 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
7181 here ...
7182 * lisp.h: ... from here. push_key_description is no longer
7183 defined in keyboard.c, so its declaration should not be in
7184 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
7185 logically belongs with push_key_description.
7186
7187 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
7188
7189 * buffer.h: Include <sys/types.h> instead of <time.h>.
7190 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
7191 Problem reported by Herbert J. Skuhra.
7192
7193 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
7194
7195 * xml.c (parse_region): Make the parsing work for
7196 non-comment-starting XML files again (bug#9144).
7197
7198 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
7199
7200 * image.c (gif_load): Fix calculation of bottom and right corner.
7201 (Bug#9468)
7202
7203 2011-09-10 Eli Zaretskii <eliz@gnu.org>
7204
7205 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
7206 redisplay in small windows.
7207
7208 2011-09-09 Eli Zaretskii <eliz@gnu.org>
7209
7210 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
7211
7212 2011-09-08 Martin Rudalics <rudalics@gmx.at>
7213
7214 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
7215 Operate on live windows only.
7216
7217 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
7218
7219 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
7220
7221 2011-09-07 Eli Zaretskii <eliz@gnu.org>
7222
7223 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
7224 only under bidi iteration.
7225
7226 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
7227
7228 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
7229
7230 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
7231
7232 isnan: Fix porting problem to Solaris 10 with bundled gcc.
7233 Without this fix, the command to link temacs failed due to an
7234 undefined symbol __builtin_isnan. This is because
7235 /usr/include/iso/math_c99.h #defines isnan(x) to
7236 __builtin_isnan(x), but the bundled gcc, which identifies itself
7237 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
7238 a __builtin_isnan.
7239 * floatfns.c (isnan): #undef, and then #define to a clone of
7240 what's in data.c.
7241 (Fisnan): Always define, since it's always available now.
7242 (syms_of_floatfns): Always define isnan at the Lisp level.
7243
7244 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
7245
7246 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
7247
7248 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
7249
7250 * fileio.c: Fix bugs with large file offsets (Bug#9428).
7251 The previous code assumed that file offsets (off_t values) fit in
7252 EMACS_INT variables, which is not true on typical 32-bit hosts.
7253 The code messed up by falsely reporting buffer overflow in cases
7254 such as (insert-file-contents "big" nil 1 2) into an empty buffer
7255 when "big" contains more than 2**29 bytes, even though this
7256 inserts just one byte and does not overflow the buffer.
7257 (Finsert_file_contents): Store file offsets as off_t
7258 values, not as EMACS_INT values. Check for overflow when
7259 converting between EMACS_INT and off_t. When checking for
7260 buffer overflow or for overlap, take the offsets into account.
7261 Don't use EMACS_INT for small values where int suffices.
7262 When checking for overlap, fix a typo: ZV was used where
7263 ZV_BYTE was intended.
7264 (Fwrite_region): Don't assume off_t fits into 'long'.
7265 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
7266
7267 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
7268
7269 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
7270
7271 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
7272
7273 sprintf-related integer and memory overflow issues (Bug#9412).
7274
7275 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
7276 (esprintf, exprintf, evxprintf): New functions.
7277 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
7278 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
7279 (modify_event_symbol): Do not assume that the length of
7280 name_alist_or_stem is safe to alloca and fits in int.
7281 (Fexecute_extended_command): Likewise for function name and binding.
7282 (Frecursion_depth): Wrap around reliably on integer overflow.
7283 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
7284 since some callers pass EMACS_INT values.
7285 (Fsingle_key_description): Don't crash if symbol name contains more
7286 than MAX_ALLOCA bytes.
7287 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
7288 (get_minibuffer): Arg is now EMACS_INT, not int.
7289 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
7290 (esprintf, exprintf, evxprintf): New decls.
7291 * window.h (command_loop_level, minibuf_level): Reflect API changes.
7292
7293 * dbusbind.c (signature_cat): New function.
7294 (xd_signature, Fdbus_register_signal):
7295 Do not overrun buffer; instead, report string overflow.
7296
7297 * dispnew.c (add_window_display_history): Don't overrun buffer.
7298 Truncate instead; this is OK since it's just a log.
7299
7300 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
7301 even if the time zone offset is outlandishly large.
7302 Don't mishandle offset == INT_MIN.
7303
7304 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
7305 when creating daemon; the previous buffer-overflow check was incorrect.
7306
7307 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
7308 which has the guts of the old verror function.
7309
7310 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
7311 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
7312
7313 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
7314 (font_unparse_xlfd): Don't blindly alloca long strings.
7315 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
7316 fits in int, when using sprintf. Use single snprintf to count
7317 length of string rather than counting it via multiple sprintfs;
7318 that's simpler and more reliable.
7319 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
7320 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
7321 sprintf, in case result does not fit in int.
7322
7323 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
7324 (fontset_from_font): Print it.
7325
7326 * frame.c (tty_frame_count): Now printmax_t, not int.
7327 (make_terminal_frame, set_term_frame_name): Print it.
7328 (x_report_frame_params): In X, window IDs are unsigned long,
7329 not signed long, so print them as unsigned.
7330 (validate_x_resource_name): Check for implausibly long names,
7331 and don't assume name length fits in 'int'.
7332 (x_get_resource_string): Don't blindly alloca invocation name;
7333 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
7334 not fit in int.
7335
7336 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
7337 (xg_check_special_colors, xg_set_geometry):
7338 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
7339
7340 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
7341 Use esprintf, not sprintf, in case result does not fit in int.
7342
7343 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
7344 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
7345 it as a large positive number.
7346 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
7347 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
7348
7349 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
7350 in case result does not fit in int.
7351
7352 * print.c (float_to_string): Detect width overflow more reliably.
7353 (print_object): Make sprintf buffer a bit bigger, to avoid potential
7354 buffer overrun. Don't assume list length fits in 'int'. Treat
7355 print length of 0 as 0, not as infinity; to be consistent with other
7356 uses of print length in this function. Don't overflow print length
7357 index. Don't assume hash table size fits in 'long', or that
7358 vectorlike size fits in 'unsigned long'.
7359
7360 * process.c (make_process): Use printmax_t, not int, to format
7361 process-name gensyms.
7362
7363 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
7364
7365 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
7366 to avoid potential buffer overrun.
7367
7368 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
7369 if X resource line is longer than 512 bytes.
7370
7371 * xfns.c (x_window): Make sprintf buffer a bit bigger
7372 to avoid potential buffer overrun.
7373
7374 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
7375
7376 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
7377
7378 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
7379
7380 Integer overflow fixes for scrolling, etc.
7381 Without these, Emacs silently mishandles large integers sometimes.
7382 For example, "C-u 4294967297 M-x recenter" was treated as if
7383 it were "C-u 1 M-x recenter" on a typical 64-bit host.
7384
7385 * xdisp.c (try_window_id): Check Emacs fixnum range before
7386 converting to 'int'.
7387
7388 * window.c (window_scroll_line_based, Frecenter):
7389 Check that an Emacs fixnum is in range before assigning it to 'int'.
7390 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
7391 values converted from Emacs fixnums.
7392 (Frecenter): Don't wrap around a line count if it is out of 'int'
7393 range; instead, treat it as an extreme value.
7394 (Fset_window_configuration, compare_window_configurations):
7395 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
7396
7397 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
7398 that can exceed INT_MAX. Check that EMACS_INT value is in range
7399 before assigning it to the (possibly-narrower) index.
7400 (match_limit): Don't assume that a fixnum can fit in 'int'.
7401
7402 * print.c (print_object): Use ptrdiff_t, not int, for index that can
7403 exceed INT_MAX.
7404
7405 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
7406 (Fvertical_motion): Don't wrap around LINES values that don't fit
7407 in 'int'. Instead, treat them as extreme values. This is good
7408 enough for windows, which can't have more than INT_MAX lines anyway.
7409
7410 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
7411
7412 * Require libxml/parser.h to avoid compilation warning.
7413
7414 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
7415
7416 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
7417 since this reportedly can destroy thread storage.
7418
7419 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
7420
7421 * syntax.c (find_defun_start): Update all cache variables if
7422 exiting early (Bug#9401).
7423
7424 2011-08-30 Eli Zaretskii <eliz@gnu.org>
7425
7426 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
7427
7428 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
7429 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
7430 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
7431
7432 * term.c (tty_append_glyph): New function.
7433 (produce_stretch_glyph): Static function and its prototype deleted.
7434
7435 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
7436 Add prototypes.
7437
7438 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
7439
7440 * image.c (parse_image_spec): Check for nonnegative, not for positive,
7441 when checking :margin (Bug#9390).
7442 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
7443 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
7444 so that the name doesn't mislead. All uses changed.
7445
7446 2011-08-28 Johan Bockgård <bojohan@gnu.org>
7447
7448 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
7449 set_tty_hooks.
7450
7451 2011-08-27 Eli Zaretskii <eliz@gnu.org>
7452
7453 * xdisp.c (move_it_to): Don't bail out early when reaching
7454 position beyond to_charpos, if we are scanning backwards.
7455 (move_it_vertically_backward): When DY == 0, make sure we get to
7456 the first character in the line after the newline.
7457
7458 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
7459
7460 * ccl.c: Improve and simplify overflow checking (Bug#9196).
7461 (ccl_driver): Do not generate an out-of-range pointer.
7462 (Fccl_execute_on_string): Remove unnecessary check for
7463 integer overflow, noted by Stefan Monnier in
7464 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
7465 Remove a FIXME that didn't need fixing.
7466 Simplify the newly-introduced buffer reallocation code.
7467
7468 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
7469
7470 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
7471
7472 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
7473
7474 Integer and memory overflow issues (Bug#9196).
7475
7476 * doc.c (get_doc_string): Rework so that
7477 get_doc_string_buffer_size is the actual buffer size, rather than
7478 being 1 less than the actual buffer size; this makes xpalloc more
7479 convenient.
7480
7481 * image.c (x_allocate_bitmap_record, cache_image):
7482 * xselect.c (Fx_register_dnd_atom):
7483 Simplify previous changes by using xpalloc.
7484
7485 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
7486 since either will do and ptrdiff_t is convenient with xpalloc.
7487
7488 * charset.c (charset_table_size)
7489 (struct charset_sort_data.priority): Now ptrdiff_t.
7490 (charset_compare): Don't overflow if priorities differ greatly.
7491 (Fsort_charsets): Don't assume list length fits in int.
7492 Check for size-calculation overflow when allocating sort data.
7493 (syms_of_charset): Allocate an initial charset table that is
7494 just under 64 KiB, to avoid problems with glibc malloc and mmap.
7495
7496 * cmds.c (internal_self_insert): Check for size-calculation overflow.
7497
7498 * composite.h (struct composition.glyph_len): Now int, not unsigned.
7499 The actual value is always <= INT_MAX, and leaving it unsigned made
7500 overflow checking harder.
7501
7502 * dispextern.h (struct glyph_matrix.rows_allocated)
7503 (struct face_cache.size): Now ptrdiff_t, for convenience in use
7504 with xpalloc. The values are still always <= INT_MAX.
7505
7506 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
7507
7508 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
7509 (SAFE_NALLOCA): New macro.
7510
7511 * region-cache.c (struct boundary.pos, find_cache_boundary)
7512 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
7513 (set_cache_region, invalidate_region_cache)
7514 (revalidate_region_cache, know_region_cache, region_cache_forward)
7515 (region_cache_backward, pp_cache):
7516 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
7517 so that ptrdiff_t * can be passed to xpalloc.
7518 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
7519 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
7520 (pp_cache): Don't assume cache_len fits in int.
7521 * region-cache.h: Adjust extern decls to match.
7522
7523 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
7524 EMACS_INT, since either will do, for xpalloc.
7525
7526 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
7527 (xnmalloc, xnrealloc, xpalloc): New functions.
7528
7529 * bidi.c (bidi_shelve_header_size): New constant.
7530 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
7531 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
7532
7533 * bidi.c (bidi_cache_shrink):
7534 * buffer.c (overlays_at, overlays_in, record_overlay_string)
7535 (overlay_strings):
7536 Don't update size of array until after memory allocation succeeds,
7537 because xmalloc/xrealloc may not return.
7538 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
7539 now that we have proper integer overflow checking.
7540 (record_overlay_string, overlay_strings): Catch overflows when
7541 calculating size of overlay_str_buf.
7542
7543 * callproc.c (Fcall_process): Check for size overflow when
7544 calculating size of args2.
7545 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
7546 Normally we prefer signed values, but sticking with ptrdiff_t would
7547 require adding more-complicated checks.
7548
7549 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
7550 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
7551 Redo buffer-overflow calculations to avoid integer overflow.
7552 Add a FIXME comment where memory seems to be over-allocated.
7553
7554 * character.c (Fstring): Check for size-calculation overflow.
7555
7556 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
7557 unnecessary integer overflow. Check for size overflow.
7558 (encode_coding_object): Don't update size until xmalloc succeeds.
7559
7560 * composite.c (get_composition_id): Check for overflow in glyph
7561 length calculations.
7562
7563 Integer and memory overflow fixes for display code.
7564 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
7565 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
7566 (scrolling_window): Check for overflow in size calculations.
7567 (line_draw_cost, realloc_glyph_pool, add_row_entry):
7568 Don't assume glyph table len fits in int.
7569 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
7570 (row_table_size): Now ptrdiff_t, not int.
7571 (scrolling_window): Avoid overflow in size calculations.
7572 Don't update size until allocation succeeds.
7573 * fns.c (concat): Check for overflow in size calculations.
7574 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
7575 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
7576 (NEXT_ALMOST_PRIME_LIMIT): New constant.
7577
7578 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
7579 (get_doc_string): Check for size calculation overflow.
7580 Don't update size until allocation succeeds.
7581 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
7582 EMACS_INT, where ptrdiff_t will do.
7583 (Fsubstitute_command_keys): Check for string overflow.
7584
7585 * editfns.c (set_time_zone_rule): Don't assume environment length
7586 fits in int.
7587 (message_length): Now ptrdiff_t, not int.
7588 (Fmessage_box): Don't update size until allocation succeeds.
7589 Don't assume message length fits in int.
7590 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
7591
7592 * emacs.c (main): Do not reallocate argv, since there is a null at
7593 the end that can be overwritten, and this way there's no need to
7594 worry about size-calculation overflow.
7595 (sort_args): Check for size-calculation overflow.
7596
7597 * eval.c (init_eval_once, grow_specpdl): Don't update size until
7598 alloc succeeds.
7599 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
7600
7601 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
7602 (x_set_scroll_bar_width, x_figure_window_size):
7603 Check for integer overflow.
7604 (x_set_alpha): Do not assume XINT fits in int.
7605
7606 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
7607 This is for the members text_lines, text_cols, total_lines, total_cols,
7608 where the system imposes an 'int' limit.
7609
7610 * fringe.c (Fdefine_fringe_bitmap):
7611 Don't update size until alloc works.
7612
7613 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
7614 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
7615
7616 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
7617 Check for size-calculation overflow.
7618 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
7619 do, as we prefer signed integers.
7620 (id_to_widget.max_size, id_to_widget.used)
7621 (xg_store_widget_in_map, xg_remove_widget_from_map)
7622 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
7623 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
7624 Use and return ptrdiff_t, not int.
7625 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
7626 * gtkutil.h: Change prototypes to match the above.
7627
7628 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
7629 are duplicate now that they've been promoted to lisp.h.
7630 (x_allocate_bitmap_record, x_alloc_image_color)
7631 (make_image_cache, cache_image, xpm_load):
7632 Don't update size until alloc is done.
7633 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
7634 (x_detect_edges):
7635 Check for size calculation overflow.
7636 (ct_colors_allocated_max): New constant.
7637 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
7638 overflow.
7639
7640 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
7641 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
7642 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
7643 Use ptrdiff_t, not int, to count maps.
7644 (read_char_minibuf_menu_prompt): Check for overflow in size
7645 calculations. Don't update size until allocation succeeds.
7646 Redo calculations to avoid overflow.
7647 * keyboard.h: Change prototypes to match the above.
7648
7649 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
7650 to count maps.
7651 (current_minor_maps): Check for size calculation overflow.
7652 * keymap.h: Change prototypes to match the above.
7653
7654 * lread.c (read1, init_obarray): Don't update size until alloc done.
7655
7656 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
7657 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
7658
7659 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
7660 Now ptrdiff_t, not int.
7661 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
7662 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
7663
7664 * process.c (Fnetwork_interface_list): Check for overflow
7665 in size calculation.
7666
7667 * region-cache.c (move_cache_gap): Check for size calculation overflow.
7668
7669 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
7670 overflow. Don't bother calling xmalloc when xrealloc will do.
7671
7672 * search.c (Freplace_match): Check for size calculation overflow.
7673 (Fset_match_data): Don't assume list lengths fit in 'int'.
7674
7675 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
7676 for command line length. Do not attempt to address one before the
7677 beginning of an array, as that's not portable.
7678
7679 * term.c (max_frame_lines): Remove; unused.
7680 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
7681 not int.
7682 (encode_terminal_code, calculate_costs): Check for size
7683 calculation overflow.
7684 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
7685 table lengths and related sizes. Don't update size until alloc
7686 done. Redo calculations to avoid overflow.
7687 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
7688
7689 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
7690 subtracting pointers.
7691 (gobble_line): Check for overflow more carefully. Don't update size
7692 until alloc done.
7693
7694 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
7695 Don't update size until alloc done.
7696 Redo size calculations to avoid overflow.
7697 Check for size calculation overflow.
7698 (main) [DEBUG]: Fix typo in invoking tparam1.
7699
7700 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
7701 Use ptrdiff_t, not int, for sizes.
7702 (store_mode_line_noprop_char): Don't update size until alloc done.
7703
7704 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
7705 Use ptrdiff_t, not int, for sizes.
7706 (Finternal_make_lisp_face, cache_face):
7707 Check for size calculation overflow.
7708 (cache_face): Treat size calculation overflows as if they were
7709 memory exhaustion (the usual treatment), rather than aborting.
7710
7711 * xfns.c (x_encode_text, x_set_name_internal)
7712 (Fx_change_window_property): Use ptrdiff_t, not int, to count
7713 sizes, since they can exceed INT_MAX in size. Check for size
7714 calculation overflow.
7715
7716 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
7717 (xg_select): Check for size calculation overflow.
7718 Don't update size until alloc done.
7719
7720 * xrdb.c (get_environ_db): Don't assume path length fits in int,
7721 as sprintf is limited to int lengths.
7722
7723 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
7724 (X_LONG_MIN): New macros.
7725 Use them to make the following changes clearer.
7726 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
7727 This change doesn't affect the value now, but it may help remind
7728 future maintainers not to raise the value too much later.
7729 (SELECTION_QUANTUM): Remove, replacing with ...
7730 (selection_quantum): ... new function, which avoids overflow.
7731 All uses changed.
7732 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
7733 assumption that selection length fits in 'int'.
7734 (x_reply_selection_request, x_handle_selection_request)
7735 (x_get_window_property, receive_incremental_selection)
7736 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
7737 (lisp_data_to_selection_data, clean_local_selection_data):
7738 Use ptrdiff_t, not int, to record length of selection.
7739 (x_reply_selection_request, x_get_window_property)
7740 (receive_incremental_selection, x_property_data_to_lisp):
7741 Redo calculations to avoid overflow.
7742 (x_reply_selection_request): When sending hint, ceiling it at
7743 X_LONG_MAX rather than relying on wraparound overflow to send
7744 something.
7745 (x_get_window_property, receive_incremental_selection)
7746 (lisp_data_to_selection_data, x_property_data_to_lisp):
7747 Check for size-calculation overflow.
7748 (x_get_window_property, receive_incremental_selection)
7749 (lisp_data_to_selection_data, Fx_register_dnd_atom):
7750 Don't store size until memory allocation succeeds.
7751 (x_get_window_property): Plug memory leak on memory exhaustion.
7752 Don't double-block input; malloc is safe here. Don't assume 2**34
7753 - 4 fits in unsigned long. Add an xassert to check
7754 XGetWindowProperty overflow. Be more careful about overflow
7755 calculations, and distinguish size from memory overflow better.
7756 (receive_incremental_selection): When tracing, don't assume
7757 unsigned int is less than INT_MAX.
7758 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
7759 harmful) conversions of unsigned short to int.
7760 (lisp_data_to_selection_data): Don't assume that integers
7761 in the range -65535 through -1 fit in an X unsigned short.
7762 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
7763 result parameters unless successful. Rely on cons_to_unsigned
7764 to report problems with elements; the old code wasn't right anyway.
7765 (x_check_property_data): Check for int overflow; we cannot use
7766 a wider type due to X limits.
7767 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
7768
7769 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
7770
7771 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
7772 (x_term_init): Check for size calculation overflow.
7773 (x_color_cells): Don't store size until memory allocation succeeds.
7774 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
7775 Don't assume alloca size is less than MAX_ALLOCA.
7776 (x_term_init): Don't assume length fits in int (sprintf is limited
7777 to int size).
7778
7779 Use ptrdiff_t for composition IDs.
7780 * character.c (lisp_string_width):
7781 * composite.c (composition_table_size, n_compositions)
7782 (get_composition_id, composition_gstring_from_id):
7783 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
7784 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
7785 * window.c (Frecenter):
7786 Use ptrdiff_t, not int, for composition IDs.
7787 * composite.c (get_composition_id): Check for integer overflow.
7788 * composite.h: Adjust prototypes to match the above changes.
7789
7790 Use ptrdiff_t for hash table indexes.
7791 * category.c (hash_get_category_set):
7792 * ccl.c (ccl_driver):
7793 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
7794 * coding.c (coding_system_charset_list, detect_coding_system):
7795 * coding.h (struct coding_system.id):
7796 * composite.c (get_composition_id, gstring_lookup_cache):
7797 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
7798 * image.c (xpm_get_color_table_h):
7799 * lisp.h (hash_lookup, hash_put):
7800 * minibuf.c (Ftest_completion):
7801 Use ptrdiff_t for hash table indexes, not int (which is too
7802 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
7803 32-bit --with-wide-int hosts).
7804
7805 * charset.c (Fdefine_charset_internal): Check for integer overflow.
7806 Add a FIXME comment about memory leaks.
7807 (syms_of_charset): Don't assume xmalloc returns.
7808
7809 Don't assume that stated character widths fit in int.
7810 * character.c (Fchar_width, c_string_width, lisp_string_width):
7811 * character.h (CHAR_WIDTH):
7812 * indent.c (MULTIBYTE_BYTES_WIDTH):
7813 Use sanitize_char_width to avoid undefined and/or bad behavior
7814 with outlandish widths.
7815 * character.h (sanitize_tab_width): Rename from sanitize_width,
7816 now that we have two such functions. All uses changed.
7817 (sanitize_char_width): New inline function.
7818
7819 Don't assume that tab-width fits in int.
7820 * character.h (sanitize_width): New inline function.
7821 (SANE_TAB_WIDTH): New macro.
7822 (ASCII_CHAR_WIDTH): Use it.
7823 * indent.c (sane_tab_width): Remove. All uses replaced by
7824 SANE_TAB_WIDTH (current_buffer).
7825 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
7826
7827 * fileio.c: Integer overflow issues with file modes.
7828 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
7829
7830 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
7831 Remove unreachable code.
7832 (read_hex, load_charset_map_from_file): Check for integer overflow.
7833
7834 * xterm.c: Don't go over XClientMessageEvent limit.
7835 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
7836 (x_send_scroll_bar_event): Likewise. Check that the size does not
7837 exceed limits imposed by XClientMessageEvent, as well as the usual
7838 ptrdiff_t and size_t limits.
7839
7840 * keyboard.c: Overflow, signedness and related fixes.
7841 (make_lispy_movement): Use same integer type in forward decl
7842 that is used in the definition.
7843 (read_key_sequence, keyremap_step):
7844 Change bufsize argument back to int, undoing my 2011-03-30 change.
7845 We prefer signed types, and int is wide enough here.
7846 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
7847 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
7848 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
7849 length, not size_t. Use ptrdiff_t for index, not int.
7850 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
7851 possibility of integer overflow.
7852
7853 Overflow, signedness and related fixes for images.
7854
7855 * dispextern.h (struct it.stack[0].u.image.image_id)
7856 (struct_it.image_id, struct image.id, struct image_cache.size)
7857 (struct image_cache.used, struct image_cache.ref_count):
7858 * gtkutil.c (update_frame_tool_bar):
7859 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
7860 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
7861 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
7862 * nsmenu.m (update_frame_tool_bar):
7863 * xdisp.c (calc_pixel_width_or_height):
7864 * xfns.c (image_cache_refcount):
7865 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
7866 on typical 64-bit hosts.
7867
7868 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
7869 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
7870 Omit unnecessary casts to int.
7871 (parse_image_spec): Check that integers fall into 'int' range
7872 when the callers expect that.
7873 (image_ascent): Redo ascent calculation to avoid int overflow.
7874 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
7875 (lookup_image): Remove unnecessary tests.
7876 (xbm_image_p): Locals are now of int, not EMACS_INT,
7877 since parse_image_check makes sure they fit into int.
7878 (png_load, gif_load, svg_load_image):
7879 Prefer int to unsigned where either will do.
7880 (tiff_handler): New function, combining the cores of the
7881 old tiff_error_handler and tiff_warning_handler.
7882 This function is rewritten to use vsnprintf and thereby avoid
7883 stack buffer overflows. It uses only the features of vsnprintf
7884 that are common to both POSIX and native Microsoft.
7885 (tiff_error_handler, tiff_warning_handler): Use it.
7886 (tiff_load, gif_load, imagemagick_load_image):
7887 Don't assume :index value fits in 'int'.
7888 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
7889 (imagemagick_load_image): Check that crop parameters fit into
7890 the integer types that MagickCropImage accepts. Don't assume
7891 Vimagemagick_render_type has a nonnegative value. Don't assume
7892 size_t fits in 'long'.
7893 (gs_load): Use printmax_t to print the widest integers possible.
7894 Check for integer overflow when computing image height and width.
7895
7896 2011-08-26 Eli Zaretskii <eliz@gnu.org>
7897
7898 * xdisp.c (redisplay_window): Don't force window start if point
7899 will be invisible in the resulting window. (Bug#9324)
7900
7901 2011-08-25 Eli Zaretskii <eliz@gnu.org>
7902
7903 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
7904 the display spec is of the form `(space ...)'.
7905 (handle_display_spec): Return the value returned by
7906 handle_single_display_spec, not just 1 or zero.
7907 (handle_single_display_spec): If the display spec is of the form
7908 `(space ...)', and specifies display in the text area, return 2
7909 rather than 1.
7910 (try_cursor_movement): Check for the need to scroll more
7911 accurately, and prefer exact match for point under bidi.
7912 Don't advance `row' beyond the last row of the window.
7913
7914 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
7915 into disp_prop; all users changed.
7916
7917 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
7918 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
7919 for the text covered by the display property.
7920
7921 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
7922
7923 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
7924 Change return value to nil.
7925 (Frecord_buffer): Delete unused function.
7926
7927 2011-08-24 Eli Zaretskii <eliz@gnu.org>
7928
7929 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
7930 buffers, return left-to-right.
7931 (set_cursor_from_row): Consider candidate row a win if its glyph
7932 represents a newline and point is on that newline. Fixes cursor
7933 positioning on the newline at EOL of R2L text within L2R
7934 paragraph, and vice versa.
7935 (try_cursor_movement): Check continued rows, in addition to
7936 continuation rows. Fixes unwarranted scroll when point enters a
7937 continued line of R2L text within an L2R paragraph, or vice versa.
7938 (cursor_row_p): Consider the case of point being equal to
7939 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
7940 from the end of a short line to the beginning of a continued line
7941 of R2L text within L2R paragraph.
7942 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
7943 composed characters.
7944
7945 * bidi.c (bidi_check_type): Use xassert.
7946 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
7947 members.
7948
7949 2011-08-23 Eli Zaretskii <eliz@gnu.org>
7950
7951 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
7952 a character.
7953
7954 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
7955
7956 * nsfont.m (ns_otf_to_script): Fix typo.
7957
7958 2011-08-22 Kenichi Handa <handa@m17n.org>
7959
7960 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
7961 extra slot even if the purpose is char-code-property-table.
7962
7963 2011-08-23 Eli Zaretskii <eliz@gnu.org>
7964
7965 * xdisp.c (redisplay_window): When computing centering_position,
7966 account for the height of the header line. (Bug#8874)
7967
7968 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
7969 instead of CHAR_TO_BYTE. Fixes a crash when a completion
7970 candidate is selected by the mouse, and that candidate has a
7971 composed character under the mouse.
7972
7973 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
7974 coordinates reported by pos-visible-in-window-p for a composed
7975 character in column zero.
7976
7977 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
7978
7979 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
7980
7981 2011-08-22 Eli Zaretskii <eliz@gnu.org>
7982
7983 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
7984 consider it a hit if to_charpos is anywhere in the range of the
7985 composed buffer positions.
7986
7987 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
7988
7989 * image.c (gif_load): Don't assume that each subimage has the same
7990 dimensions as the base image. Handle disposal method that is
7991 "undefined" by the gif spec (Bug#9335).
7992
7993 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
7994
7995 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
7996 (Fcondition_case): Document `debug' symbol in error handler.
7997
7998 2011-08-19 Eli Zaretskii <eliz@gnu.org>
7999
8000 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
8001 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
8002 from an Org mode buffer to a Speedbar frame.
8003
8004 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
8005 a composition, take its buffer position from IT->cmp_it.charpos.
8006 Fixes cursor positioning at the beginning of a line that begins
8007 with a composed character.
8008
8009 2011-08-18 Eli Zaretskii <eliz@gnu.org>
8010
8011 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
8012 character bidirectional type, use STRONG_L instead. Fixes crashes
8013 in a buffer produced by `describe-categories'.
8014
8015 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
8016 members before the level stack, so they would be saved and
8017 restored when copying iterator state. Fixes incorrect reordering
8018 around TABs covered by display properties.
8019
8020 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
8021
8022 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
8023
8024 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
8025
8026 * eval.c (internal_condition_case, internal_condition_case_1)
8027 (internal_condition_case_2, internal_condition_case_n):
8028 Remove unnecessary aborts (Bug#9081).
8029
8030 2011-08-17 Eli Zaretskii <eliz@gnu.org>
8031
8032 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
8033 has no `load' handler, try opening the file locally. (Bug#9311)
8034
8035 2011-08-16 Ken Brown <kbrown@cornell.edu>
8036
8037 * gmalloc.c: Expand comment.
8038
8039 2011-08-16 Eli Zaretskii <eliz@gnu.org>
8040
8041 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
8042 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
8043
8044 2011-08-16 Ken Brown <kbrown@cornell.edu>
8045
8046 Fix memory allocation problems in Cygwin build (Bug#9273).
8047
8048 * unexcw.c ( __malloc_initialized): Declare external variable.
8049 (fixup_executable): Force the dumped emacs to reinitialize malloc.
8050
8051 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
8052 New variables.
8053 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
8054 dumped emacs.
8055 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
8056 in the static heap.
8057 [CYGWIN] (special_realloc): New function.
8058 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
8059 requests to realloc storage in the static heap.
8060
8061 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
8062
8063 * bidi.c (bidi_initialize): Remove unused local.
8064
8065 2011-08-15 Eli Zaretskii <eliz@gnu.org>
8066
8067 * bidimirror.h:
8068 * biditype.h: Remove file.
8069 * makefile.w32-in ($(BLD)/bidi.$(O)):
8070 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
8071
8072 * dispextern.h: Fix a typo in the comment to bidi_type_t.
8073
8074 * chartab.c: Improve commentary for the uniprop_table API.
8075
8076 * bidi.c (bidi_paragraph_init): Support zero value of
8077 bidi_ignore_explicit_marks_for_paragraph_level.
8078 (bidi_initialize): Use uniprop_table instead of including
8079 biditype.h and bidimirror.h.
8080
8081 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
8082 coordinates of the iterator when restoring from ppos_it.
8083 (Bug#9296)
8084
8085 2011-08-14 Kenichi Handa <handa@m17n.org>
8086
8087 * process.c (create_process): Call setup_process_coding_systems
8088 after the pid of the process is set to -1 (Bug#8162).
8089
8090 2011-08-14 Eli Zaretskii <eliz@gnu.org>
8091
8092 * xdisp.c (move_it_in_display_line_to): Don't invoke
8093 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
8094 ppos_it. Fixes vertical cursor motion when line beginning is
8095 covered by an image. (Bug#9296)
8096
8097 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
8098
8099 * nsterm.h (ns_run_ascript): Declare.
8100 (NSAPP_DATA2_RUNASSCRIPT): Define.
8101
8102 * nsfns.m (as_script, as_result, as_status): New static variables.
8103 (ns_run_ascript): New function.
8104 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
8105 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
8106 the event loop. Get status from as_status (Bug#7276).
8107
8108 * nsterm.m (sendEvent): If event is NSApplicationDefined and
8109 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
8110 the event loop (Bug#7276).
8111
8112 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
8113
8114 * gnutls.c (QCgnutls_bootprop_priority)
8115 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
8116 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
8117 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
8118 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
8119 (QCgnutls_bootprop_verify_hostname_error)
8120 (QCgnutls_bootprop_callbacks_verify): Rename from
8121 Qgnutls_bootprop_..., all uses changed.
8122
8123 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
8124 uses changed.
8125
8126 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
8127
8128 * xfaces.c (Qframe_set_background_mode): Now static.
8129 * dispextern.h (Qframe_set_background_mode): Remove decl.
8130
8131 * process.c (Fnetwork_interface_info): Declare local only if needed.
8132
8133 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
8134
8135 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
8136 (Fnetwork_interface_list): Allocate in increments of bytes instead
8137 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
8138 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
8139 sockaddr.
8140 (struct ifflag_def): notrailers is smart on OSX.
8141 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
8142 Get hardware address with getifaddrs if available.
8143
8144 2011-08-12 Eli Zaretskii <eliz@gnu.org>
8145
8146 * xdisp.c (iterate_out_of_display_property): xassert that
8147 IT->position is set to within IT->object's boundaries. Break from
8148 the loop as soon as EOB is reached; avoids infloops in redisplay
8149 when IT->position is set up wrongly due to some bug.
8150 Set IT->current to match the bidi iterator unconditionally.
8151 (push_display_prop): Allow GET_FROM_STRING as IT->method on
8152 entry. Force push_it to save on the stack the current
8153 buffer/string position, to be restored by pop_it. Fix flags in
8154 the iterator structure wrt the object coming from a display
8155 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
8156 properties. (Bug#9284)
8157
8158 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
8159
8160 * fontset.c (fontset_get_font_group): Add proper type checks.
8161 (Bug#9172)
8162
8163 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8164
8165 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
8166 and LC_VERSION_MIN_MACOSX.
8167 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
8168 (dump_it) [LC_FUNCTION_STARTS]: Use it.
8169
8170 2011-08-08 Eli Zaretskii <eliz@gnu.org>
8171
8172 * xdisp.c (forward_to_next_line_start): Allow to use the
8173 no-display-properties-and-no-overlays under bidi display.
8174 Set disp_pos in the bidi iterator to avoid searches for display
8175 properties and overlays.
8176
8177 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
8178
8179 * editfns.c (Fset_time_zone_rule): Document relationship with the
8180 setenv function.
8181
8182 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
8183 the font entity extracted from the cache (Bug#8109).
8184
8185 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
8186
8187 * composite.c (autocmp_chars): Don't reset point. That is done by
8188 restore_point_unwind (Bug#5984).
8189
8190 2011-08-07 Juri Linkov <juri@jurta.org>
8191
8192 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
8193 to show the arg `TIME' instead of `TIMEVAL'.
8194
8195 2011-08-06 Eli Zaretskii <eliz@gnu.org>
8196
8197 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
8198 display property strides EOL and includes a newline, as in
8199 longlines-mode. (Bug#9254)
8200 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
8201 word-wrap under bidirectional display. (Bug#9224)
8202
8203 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
8204 is non-zero, even if the data buffer is NULL. Fixes a crash in
8205 vertical-motion with longlines-mode. (Bug#9254)
8206
8207 2011-08-05 Eli Zaretskii <eliz@gnu.org>
8208
8209 * bidi.c <bidi_cache_total_alloc>: Now static.
8210 (bidi_initialize): Initialize bidi_cache_total_alloc.
8211
8212 * xdisp.c (display_line): Release buffer allocated for shelved bidi
8213 cache. (Bug#9221)
8214
8215 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
8216 amount allocated this far in `bidi_cache_total_alloc'.
8217 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
8218 non-zero, only free the data buffer without restoring the cache
8219 contents. All callers changed.
8220
8221 * dispextern.h (bidi_unshelve_cache): Update prototype.
8222
8223 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
8224 (move_it_in_display_line, move_it_to)
8225 (move_it_vertically_backward, move_it_by_lines): Replace the call
8226 to xfree to an equivalent call to bidi_unshelve_cache.
8227 (move_it_in_display_line_to): Fix logic of returning
8228 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
8229
8230 2011-08-05 Eli Zaretskii <eliz@gnu.org>
8231
8232 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
8233 came from a string character with a `cursor' property. (Bug#9229)
8234
8235 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
8236
8237 * Makefile.in (LIB_PTHREAD): New variable.
8238 (LIBES): Add LIB_PTHREAD (Bug#9216).
8239
8240 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
8241 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
8242
8243 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
8244
8245 * regex.c (re_iswctype): Remove some redundant boolean conversions.
8246
8247 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
8248
8249 * xterm.c (x_find_topmost_parent): New function.
8250 (x_set_frame_alpha): Find topmost parent window with
8251 x_find_topmost_parent and set the property there also (bug#9181).
8252 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
8253
8254 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
8255
8256 * callproc.c (Fcall_process): Avoid vfork clobbering
8257 the local vars buffer, coding_systems, current_dir.
8258
8259 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
8260
8261 * keymap.c (Fmake_composed_keymap): Move to subr.el.
8262
8263 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
8264
8265 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
8266 so that it is not optimized away.
8267
8268 * xdisp.c (compute_display_string_pos): Remove unused local.
8269
8270 2011-08-02 Eli Zaretskii <eliz@gnu.org>
8271
8272 Fix slow cursor motion and scrolling in large buffers with
8273 selective display, like Org Mode buffers. (Bug#9218)
8274
8275 * dispextern.h (struct bidi_it): New member disp_prop_p.
8276
8277 * xdisp.c: Remove one-slot cache of display string positions.
8278 (compute_display_string_pos): Accept an additional argument
8279 DISP_PROP_P; callers changed. Scan at most 5K characters forward
8280 for a display string or property. If found, set DISP_PROP_P
8281 non-zero.
8282
8283 * bidi.c (bidi_fetch_char): Accept an additional argument
8284 DISP_PROP_P, and pass it to compute_display_string_pos.
8285 Only handle text covered by a display string if DISP_PROP_P is returned
8286 non-zero. All callers of bidi_fetch_char changed.
8287
8288 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
8289
8290 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
8291
8292 2010-12-03 Don March <don@ohspite.net>
8293
8294 * keymap.c (Fdefine_key): Fix non-prefix key error message when
8295 last character M-[char] is translated to ESC [char] (bug#7541).
8296
8297 2011-08-02 Kenichi Handa <handa@m17n.org>
8298
8299 * lisp.h (uniprop_table): Extern it.
8300
8301 * chartab.c (uniprop_table): Make it non-static.
8302
8303 2011-08-01 Eli Zaretskii <eliz@gnu.org>
8304
8305 * xdisp.c (forward_to_next_line_start): Accept additional argument
8306 BIDI_IT_PREV, and store into it the state of the bidi iterator had
8307 on the newline.
8308 (reseat_at_next_visible_line_start): Use the bidi iterator state
8309 returned by forward_to_next_line_start to restore the state of
8310 it->bidi_it after backing up to previous newline. (Bug#9212)
8311
8312 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
8313
8314 * regex.c (re_comp): Protoize.
8315 (re_exec): Fix return type.
8316 (regexec): Fix type of `ret'. (Bug#9203)
8317
8318 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8319
8320 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
8321 This is needed if max-image-size is a floating-point number.
8322
8323 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
8324
8325 * print.c (print_object): Print empty symbol as ##.
8326
8327 * lread.c (read1): Read ## as empty symbol.
8328
8329 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
8330
8331 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
8332 setting frame foreground color (Bug#9175).
8333 (x_set_background_color): Likewise.
8334
8335 * nsmenu.m (-setText): Size tooltip dimensions precisely to
8336 contents (Bug#9176).
8337 (EmacsTooltip -init): Remove bezels and add shadows to
8338 tooltip windows.
8339
8340 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
8341 or scroll bar (Bug#8470).
8342
8343 * nsfont.m (nsfont_open): Remove assignment to voffset and
8344 unnecessary vars hshink, expand, hd, full_height, min_height.
8345 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
8346
8347 * nsterm.h (nsfont_info): Remove voffset field.
8348
8349 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
8350
8351 Implement strike-through and overline on NextStep (Bug#8863).
8352
8353 * nsfont.m (nsfont_open): Use underline position provided by font,
8354 instead of hard-coded value of 2.
8355 (nsfont_draw): Call ns_draw_text_decoration instead.
8356
8357 * nsterm.h: Add declaration for ns_draw_text_decoration.
8358
8359 * nsterm.m (ns_draw_text_decoration): New function for drawing
8360 underline, overline, and strike-through.
8361 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
8362 ns_draw_text_decoration. Change treatment of cursor drawing to
8363 accommodate underlining, etc.
8364
8365 2011-07-28 Eli Zaretskii <eliz@gnu.org>
8366
8367 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
8368 default.
8369
8370 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8371
8372 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
8373 Without this fix, if a signal arrives just after memory fills up,
8374 'malloc' might be invoked reentrantly.
8375
8376 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
8377 In other words, assume that every image size is allowed, on non-X
8378 hosts. This assumption is probably wrong, but it lets Emacs compile.
8379
8380 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
8381
8382 * regex.c (re_iswctype): Convert return values to boolean.
8383
8384 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
8385
8386 * xdisp.c (compute_display_string_pos): Don't use cached display
8387 string position if the buffer had its restriction changed.
8388 (Bug#9184)
8389
8390 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8391
8392 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
8393
8394 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8395
8396 Integer signedness and overflow and related fixes. (Bug#9079)
8397
8398 * bidi.c: Integer size and overflow fixes.
8399 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
8400 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
8401 (bidi_cache_find_level_change, bidi_cache_ensure_space)
8402 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
8403 (bidi_find_other_level_edge):
8404 Use ptrdiff_t instead of EMACS_INT where either will do.
8405 This works better on 32-bit hosts configured --with-wide-int.
8406 (bidi_cache_ensure_space): Check for size-calculation overflow.
8407 Use % rather than repeated addition, for better worst-case speed.
8408 Don't set bidi_cache_size until after xrealloc returns, because it
8409 might not return.
8410 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
8411 (bidi_cache_ensure_space): Also check that the bidi cache size
8412 does not exceed that of the largest Lisp string or buffer. See Eli
8413 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
8414
8415 * alloc.c (__malloc_size_t): Remove.
8416 All uses replaced by size_t. See Andreas Schwab's note
8417 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
8418
8419 * image.c: Improve checking for integer overflow.
8420 (check_image_size): Assume that f is nonnull, since
8421 it is always nonnull in practice. This is one less thing to
8422 worry about when checking for integer overflow later.
8423 (x_check_image_size): New function, which checks for integer
8424 overflow issues inside X.
8425 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
8426 This removes the need for a memory_full check.
8427 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
8428 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
8429 (xbm_read_bitmap_data): Change locals back to 'int', since
8430 their values must fit in 'int'.
8431 (xpm_load_image, png_load, tiff_load):
8432 Invoke x_create_x_image_and_pixmap earlier,
8433 to avoid much needless work if the image is too large.
8434 (tiff_load): Treat overly large images as if
8435 x_create_x_image_and_pixmap failed, not as malloc failures.
8436 (gs_load): Use x_check_image_size.
8437
8438 * gtkutil.c: Omit integer casts.
8439 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
8440 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
8441
8442 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
8443
8444 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
8445 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
8446 would wrongly return t on a 64-bit host.
8447
8448 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
8449 The plain *_OVERFLOW macros run afoul of GCC bug 49705
8450 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
8451 and therefore cause GCC to emit a bogus diagnostic in some cases.
8452
8453 * image.c: Integer signedness and overflow and related fixes.
8454 This is not an exhaustive set of fixes, but it's time to
8455 record what I've got.
8456 (lookup_pixel_color, check_image_size): Remove redundant decls.
8457 (check_image_size): Don't assume that arbitrary EMACS_INT values
8458 fit in 'int', or that arbitrary 'double' values fit in 'int'.
8459 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
8460 (tiff_load, imagemagick_load_image):
8461 Check for overflow in size calculations.
8462 (x_create_x_image_and_pixmap): Remove unnecessary test for
8463 xmalloc returning NULL; that can't happen.
8464 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
8465 (xpm_color_bucket): Use better integer hashing function.
8466 (xpm_cache_color): Don't possibly over-allocate memory.
8467 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
8468 (gif_memory_source):
8469 Use ptrdiff_t, not int or size_t, to record sizes.
8470 (png_load): Don't assume values greater than 2**31 fit in 'int'.
8471 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
8472 either works, as we prefer signed integers.
8473 (tiff_read_from_memory, tiff_write_from_memory):
8474 Return tsize_t, not size_t, since that's what the TIFF API wants.
8475 (tiff_read_from_memory): Don't fail simply because the read would
8476 go past EOF; instead, return a short read.
8477 (tiff_load): Omit no-longer-needed casts.
8478 (Fimagemagick_types): Don't assume size fits into 'int'.
8479
8480 Improve hashing quality when configured --with-wide-int.
8481 * fns.c (hash_string): New function, taken from sxhash_string.
8482 Do not discard information about ASCII character case; this
8483 discarding is no longer needed.
8484 (sxhash-string): Use it. Change sig to match it. Caller changed.
8485 * lisp.h: Declare it.
8486 * lread.c (hash_string): Remove, since we now use fns.c's version.
8487 The fns.c version returns a wider integer if --with-wide-int is
8488 specified, so this should help the quality of the hashing a bit.
8489
8490 * emacs.c: Integer overflow minor fix.
8491 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
8492 Define only if GNU_LINUX.
8493 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
8494
8495 * dispnew.c: Integer signedness and overflow fixes.
8496 Remove unnecessary forward decls, that were a maintenance hassle.
8497 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
8498 All uses changed.
8499 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
8500 (scrolling_window): Use ptrdiff_t, not int, for byte count.
8501 (prepare_desired_row, line_draw_cost):
8502 Use int, not unsigned, where either works.
8503 (save_current_matrix, restore_current_matrix):
8504 Use ptrdiff_t, not size_t, where either works.
8505 (init_display): Check for overflow more accurately, and without
8506 relying on undefined behavior.
8507
8508 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
8509 Remove, replacing with the new symbols in lisp.h. All uses changed.
8510 * fileio.c (make_temp_name):
8511 * filelock.c (lock_file_1, lock_file):
8512 * xdisp.c (message_dolog):
8513 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
8514 Use pMd etc. instead.
8515 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
8516 replacing the pWIDE etc. symbols removed from editfns.c.
8517
8518 * keyboard.h (num_input_events): Now uintmax_t.
8519 This is (very slightly) less likely to mess up due to wraparound.
8520 All uses changed.
8521
8522 * buffer.c: Integer signedness fixes.
8523 (alloc_buffer_text, enlarge_buffer_text):
8524 Use ptrdiff_t rather than size_t when either will do, as we prefer
8525 signed integers.
8526
8527 * alloc.c: Integer signedness and overflow fixes.
8528 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
8529 (__malloc_size_t): Default to size_t, not to int.
8530 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
8531 (Fgarbage_collect, mark_object_loop_halt, mark_object):
8532 Prefer ptrdiff_t to size_t when either would do, as we prefer
8533 signed integers.
8534 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
8535 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
8536 Now const. Initialize with values that are in range even if char
8537 is signed.
8538 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
8539 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
8540 These functions do the right thing with sizes > 2**32.
8541 (check_depth): Now ptrdiff_t, not int.
8542 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
8543 Adjust to new way of storing sizes. Check for size overflow bugs
8544 in rest of code.
8545 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
8546 slightly wrong anyway, as it missed one instance of
8547 XMALLOC_OVERRUN_CHECK_OVERHEAD.
8548 (refill_memory_reserve): Omit needless cast to size_t.
8549 (mark_object_loop_halt): Mark as externally visible.
8550
8551 * xselect.c: Integer signedness and overflow fixes.
8552 (Fx_register_dnd_atom, x_handle_dnd_message):
8553 Use ptrdiff_t, not size_t, since we prefer signed.
8554 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
8555 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
8556 x_dnd_atoms_size and x_dnd_atoms_length.
8557
8558 * doprnt.c: Prefer signed to unsigned when either works.
8559 * eval.c (verror):
8560 * doprnt.c (doprnt):
8561 * lisp.h (doprnt):
8562 * xdisp.c (vmessage):
8563 Use ptrdiff_t, not size_t, when using or implementing doprnt,
8564 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
8565 prefer signed arithmetic to avoid comparison confusion.
8566 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
8567 but is a bit tricky.
8568
8569 Assume freestanding C89 headers, string.h, stdlib.h.
8570 * data.c, doprnt.c, floatfns.c, print.c:
8571 Include float.h unconditionally.
8572 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
8573 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
8574 * regex.c: Likewise for stddef.h, string.h.
8575 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
8576 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
8577 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
8578 (STDC_HEADERS): Remove obsolete defines.
8579 * sysdep.c: Include limits.h unconditionally.
8580
8581 Assume support for memcmp, memcpy, memmove, memset.
8582 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
8583 * regex.c (memcmp, memcpy):
8584 Remove; we assume C89 now.
8585
8586 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
8587 (__malloc_safe_bcopy): Remove; no longer needed.
8588
8589 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
8590 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
8591 well either way, and we prefer signed to unsigned.
8592
8593 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
8594
8595 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
8596 closes the connection while we're reading (bug#9182).
8597
8598 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
8599
8600 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
8601 are specified (Bug#9168).
8602
8603 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
8604
8605 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
8606 Found by GCC static checking and --with-wide-int on a 32-bit host.
8607
8608 2011-07-25 Eli Zaretskii <eliz@gnu.org>
8609
8610 * xdisp.c (compute_display_string_pos): Fix logic of caching
8611 previous display string position. Initialize cached_prev_pos to
8612 -1. Fixes slow-down at the beginning of a buffer.
8613
8614 2011-07-24 Eli Zaretskii <eliz@gnu.org>
8615
8616 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
8617 for attrs[LFACE_FONTSET_INDEX].
8618
8619 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
8620
8621 * xml.c (parse_region): Remove unused local
8622 that was recently introduced.
8623
8624 2011-07-23 Eli Zaretskii <eliz@gnu.org>
8625
8626 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
8627 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
8628
8629 * xdisp.c (move_it_in_display_line_to): Record the best matching
8630 position for TO_CHARPOS while scanning the line, and restore it on
8631 exit if none of the characters scanned was an exact match.
8632 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
8633 when exact match is impossible due to invisible text, and the
8634 lines are truncated.
8635
8636 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
8637
8638 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
8639 for OSX >= 10.7.
8640
8641 2011-07-22 Eli Zaretskii <eliz@gnu.org>
8642
8643 Fix a significant slow-down of cursor motion with C-n, C-p,
8644 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
8645 auto-repeat under bidi redisplay in fontified buffers.
8646 * xdisp.c (compute_stop_pos_backwards): New function.
8647 (next_element_from_buffer): Call compute_stop_pos_backwards to
8648 find a suitable prev_stop when we find ourselves before
8649 base_level_stop.
8650 (reseat): Don't look for prev_stop, as that could mean a very long
8651 run.
8652 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
8653 <cached_disp_overlay_modiff>: Cache for last found display string
8654 position.
8655 (compute_display_string_pos): Return the cached position if asked
8656 about the same buffer in the same area of character positions, and
8657 the buffer wasn't changed since the time the display string
8658 position was cached.
8659
8660 2011-07-22 Eli Zaretskii <eliz@gnu.org>
8661
8662 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
8663 is an integer, which is important for empty lines. (Bug#9149)
8664
8665 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
8666
8667 * frame.c (Fmodify_frame_parameters): In tty case, update the
8668 default face if necessary (Bug#4238).
8669
8670 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
8671
8672 * editfns.c (Fstring_to_char): No need to explain what a character
8673 is in the docstring (Bug#6576).
8674
8675 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
8676
8677 * xml.c (parse_region): Make sure we always return a tree.
8678
8679 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
8680
8681 * xml.c (parse_region): If a document contains only comments,
8682 return that, too.
8683
8684 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
8685
8686 * xml.c (make_dom): Return comments, too.
8687
8688 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
8689
8690 Port to OpenBSD.
8691 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
8692 and the surrounding thread.
8693 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
8694 rather than fgets, and retry after EINTR. Otherwise, 'emacs
8695 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
8696 timer goes off.
8697 * s/openbsd.h (BROKEN_SIGIO): Define.
8698 * unexelf.c (unexec) [__OpenBSD__]:
8699 Don't update the .mdebug section of the Alpha COFF symbol table.
8700
8701 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
8702
8703 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
8704 (bug#8460).
8705
8706 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
8707
8708 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
8709 This fixes some race conditions on the permissions of any newly
8710 created file.
8711
8712 * alloc.c (valid_pointer_p): Use pipe, not open.
8713 This fixes some permissions issues when debugging.
8714
8715 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
8716 If fchown fails to set both uid and gid, try to set just gid,
8717 as that is sometimes allowed. Adjust the file's mode to eliminate
8718 setuid or setgid bits that are inappropriate if fchown fails.
8719
8720 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
8721
8722 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
8723 to compare Lisp_Objects.
8724 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
8725 global_gnutls_log_level, don't mistake it for a Lisp_Object.
8726 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
8727
8728 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
8729
8730 * lread.c (read_integer): Unread even EOF character.
8731 (read1): Likewise. Properly record start position of symbol.
8732
8733 * lread.c (read1): Read `#:' as empty uninterned symbol if no
8734 symbol character follows.
8735
8736 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
8737
8738 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
8739 This works around a problem with the previous change to Fcopy_file.
8740 Recent glibc declares fchown with __attribute__((warn_unused_result)),
8741 and without this change, GCC might complain about discarding
8742 fchown's return value.
8743
8744 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
8745
8746 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
8747
8748 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
8749
8750 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
8751
8752 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
8753
8754 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
8755 it's used from the C level.
8756
8757 * process.c: Use the same condition for POLL_FOR_INPUT in both
8758 keyboard.c and process.c (bug#1858).
8759
8760 2011-07-09 Lawrence Mitchell <wence@gmx.li>
8761
8762 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
8763 (Fgnutls_boot): Use it.
8764
8765 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
8766
8767 * doc.c (Fsubstitute_command_keys): Revert last change.
8768
8769 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
8770
8771 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
8772 quotes the next character, and doesn't affect other longer
8773 sequences (bug#8935).
8774
8775 * lread.c (syms_of_lread): Clarify that is isn't only
8776 `eval-buffer' and `eval-defun' that's affected by
8777 `lexical-binding' (bug#8460).
8778
8779 2011-07-15 Eli Zaretskii <eliz@gnu.org>
8780
8781 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
8782 bidi redisplay when a line includes both an image and is truncated.
8783
8784 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
8785
8786 Fix minor problems found by static checking.
8787 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
8788 (elsz): Now a signed constant, not a size_t var. We prefer signed
8789 types to unsigned, to avoid integer comparison confusion. Without
8790 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
8791 "cannot optimize loop, the loop counter may overflow", a symptom
8792 of the confusion.
8793 * indent.c (Fvertical_motion): Mark locals as initialized.
8794 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
8795
8796 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
8797
8798 * search.c (Fre_search_backward): Mention `case-fold-search' in
8799 all the re_search_* functions (bug#8138).
8800
8801 * keyboard.c (Fopen_dribble_file): Document when the file is
8802 closed (bug#8056).
8803
8804 2011-07-14 Eli Zaretskii <eliz@gnu.org>
8805
8806 * bidi.c (bidi_dump_cached_states): Fix format of displaying
8807 bidi_cache_idx.
8808
8809 Support bidi reordering of display and overlay strings.
8810 * xdisp.c (compute_display_string_pos)
8811 (compute_display_string_end): Accept additional argument STRING.
8812 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
8813 (reseat_to_string): Initialize bidi_it->string.s and
8814 bidi_it->string.schars.
8815 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
8816 NULL (avoids a crash in bidi_paragraph_init).
8817 Initialize itb.string.lstring.
8818 (init_iterator): Call bidi_init_it only of a valid
8819 buffer position was specified. Initialize paragraph_embedding to
8820 L2R.
8821 (reseat_to_string): Initialize the bidi iterator.
8822 (display_string): If we need to ignore text properties of
8823 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
8824 original value of -1 will not work with bidi.)
8825 (compute_display_string_pos): First arg is now struct
8826 `text_pos *'; all callers changed. Support display properties on
8827 Lisp strings.
8828 (compute_display_string_end): Support display properties on Lisp
8829 strings.
8830 (init_iterator, reseat_1, reseat_to_string): Initialize the
8831 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
8832 when iterating on a string not from display properties).
8833 (compute_display_string_pos, compute_display_string_end):
8834 Fix calculation of the object to scan. Fixes an error when using
8835 arrow keys.
8836 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
8837 base_level_stop; instead, set base_level_stop to BEGV.
8838 Fixes crashes in vertical-motion.
8839 (next_element_from_buffer): Improve commentary for when
8840 the iterator is before prev_stop.
8841 (init_iterator): Initialize bidi_p from the default value of
8842 bidi-display-reordering, not from buffer-local value. Use the
8843 buffer-local value only if initializing for buffer iteration.
8844 (handle_invisible_prop): Support invisible properties on strings
8845 that are being bidi-reordered.
8846 (set_iterator_to_next): Support bidi reordering of C strings and
8847 Lisp strings.
8848 (next_element_from_string): Support bidi reordering of Lisp
8849 strings.
8850 (handle_stop_backwards): Support Lisp strings as well.
8851 (display_string): Support display of R2L glyph rows.
8852 Use IT_STRING_CHARPOS when displaying from a Lisp string.
8853 (init_iterator): Don't initialize it->bidi_p for strings
8854 here.
8855 (reseat_to_string): Initialize it->bidi_p for strings here.
8856 (next_element_from_string, next_element_from_c_string)
8857 (next_element_from_buffer): Add xassert's for correspondence
8858 between IT's object being iterated and it->bidi_it.string
8859 structure.
8860 (face_before_or_after_it_pos): Support bidi iteration.
8861 (next_element_from_c_string): Handle the case of the first string
8862 character that is not the first one in the visual order.
8863 (get_visually_first_element): New function, refactored from common
8864 parts of next_element_from_buffer, next_element_from_string, and
8865 next_element_from_c_string.
8866 (tool_bar_lines_needed, redisplay_tool_bar)
8867 (display_menu_bar): Force left-to-right direction. Add a FIXME
8868 comment for making that be controlled by a user option.
8869 (push_it, pop_it): Save and restore the state of the
8870 bidi iterator. Save and restore the bidi_p flag.
8871 (pop_it): Iterate out of display property for string iteration as
8872 well.
8873 (iterate_out_of_display_property): Support iteration over strings.
8874 (handle_single_display_spec): Set up it->bidi_it for iteration
8875 over a display string, and call bidi_init_it.
8876 (handle_single_display_spec, next_overlay_string)
8877 (get_overlay_strings_1, push_display_prop): Set up the bidi
8878 iterator for displaying display or overlay strings.
8879 (forward_to_next_line_start): Don't use the shortcut if
8880 bidi-iterating.
8881 (back_to_previous_visible_line_start): If handle_display_prop
8882 pushed the iterator stack, restore the internal state of the bidi
8883 iterator by calling bidi_pop_it same number of times.
8884 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
8885 and we are bidi-iterating, don't decrement the iterator position;
8886 instead, set the first_elt flag in the bidi iterator, to produce
8887 the same effect.
8888 (reseat_1): Remove redundant setting of string_from_display_prop_p.
8889 (push_display_prop): xassert that we are iterating a buffer.
8890 (push_it, pop_it): Save and restore paragraph_embedding member.
8891 (handle_single_display_spec, next_overlay_string)
8892 (get_overlay_strings_1, reseat_1, reseat_to_string)
8893 (push_display_prop): Set up the `unibyte' member of bidi_it.string
8894 correctly. Don't assume unibyte strings are not bidi-reordered.
8895 (compute_display_string_pos)
8896 (compute_display_string_end): Fix handling the case of C string.
8897 (push_it, pop_it): Save and restore from_disp_prop_p.
8898 (handle_single_display_spec, push_display_prop): Set the
8899 from_disp_prop_p flag.
8900 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
8901 (pop_it): Call iterate_out_of_display_property only if we are
8902 popping after iteration over a string that came from a display
8903 property. Fix a typo in popping stretch info. Add an assertion
8904 for verifying that the iterator position is in sync with the bidi
8905 iterator.
8906 (handle_single_display_spec, get_overlay_strings_1)
8907 (push_display_prop): Fix initialization of paragraph direction for
8908 string when that of the parent object is not yet determined.
8909 (reseat_1): Call bidi_init_it to resync the bidi
8910 iterator with IT's position. (Bug#7616)
8911 (find_row_edges): If ROW->start.pos gives position
8912 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
8913 (handle_stop, back_to_previous_visible_line_start, reseat_1):
8914 Reset the from_disp_prop_p flag.
8915 (SAVE_IT, RESTORE_IT): New macros.
8916 (pos_visible_p, face_before_or_after_it_pos)
8917 (back_to_previous_visible_line_start)
8918 (move_it_in_display_line_to, move_it_in_display_line)
8919 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8920 (try_scrolling, redisplay_window, display_line): Use them when
8921 saving a temporary copy of the iterator and restoring it back.
8922 (back_to_previous_visible_line_start, reseat_1)
8923 (init_iterator): Empty the bidi cache "stack".
8924 (move_it_in_display_line_to): If iterator ended up at
8925 EOL, but we never saw any buffer positions smaller than
8926 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
8927 motion in bidi-reordered lines.
8928 (move_it_in_display_line_to): Record prev_method and prev_pos
8929 immediately before the call to set_iterator_to_next. Fixes cursor
8930 motion in bidi-reordered lines with stretch glyphs and strings
8931 displayed in margins. (Bug#8133) (Bug#8867)
8932 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
8933 TO_CHARPOS.
8934 (pos_visible_p): Support positions in bidi-reordered lines.
8935 Save and restore bidi cache.
8936
8937 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
8938 (bidi_paragraph_info): Delete unused struct.
8939 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
8940 (bidi_cache_start): New variable.
8941 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
8942 to zero.
8943 (bidi_cache_fetch_state, bidi_cache_search)
8944 (bidi_cache_find_level_change, bidi_cache_iterator_state)
8945 (bidi_cache_find, bidi_peek_at_next_level)
8946 (bidi_level_of_next_char, bidi_find_other_level_edge)
8947 (bidi_move_to_visually_next): Compare cache index with
8948 bidi_cache_start rather than with zero.
8949 (bidi_fetch_char): Accept new argument STRING; all callers
8950 changed. Support iteration over a string. Support strings with
8951 display properties. Support unibyte strings. Fix the type of
8952 `len' according to what STRING_CHAR_AND_LENGTH expects.
8953 (bidi_paragraph_init, bidi_resolve_explicit_1)
8954 (bidi_resolve_explicit, bidi_resolve_weak)
8955 (bidi_level_of_next_char, bidi_move_to_visually_next):
8956 Support iteration over a string.
8957 (bidi_set_sor_type, bidi_resolve_explicit_1)
8958 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
8959 can now be zero (for strings); special values 0 and -1 were
8960 changed to -1 and -2, respectively.
8961 (bidi_char_at_pos): New function.
8962 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
8963 Call it instead of FETCH_MULTIBYTE_CHAR.
8964 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
8965 initialized to valid values.
8966 (bidi_init_it): Don't initialize charpos and bytepos with invalid
8967 values.
8968 (bidi_level_of_next_char): Allow the sentinel "position" to pass
8969 the test for valid cached positions. Fix the logic for looking up
8970 the sentinel state in the cache. GCPRO the Lisp string we are
8971 iterating.
8972 (bidi_push_it, bidi_pop_it): New functions.
8973 (bidi_initialize): Initialize the bidi cache start stack pointer.
8974 (bidi_cache_ensure_space): New function, refactored from part of
8975 bidi_cache_iterator_state. Don't assume the required size is just
8976 one BIDI_CACHE_CHUNK away.
8977 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
8978 (bidi_count_bytes, bidi_char_at_pos): New functions.
8979 (bidi_cache_search): Don't assume bidi_cache_last_idx is
8980 always valid if bidi_cache_idx is valid.
8981 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
8982 is valid if it's going to be used.
8983 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
8984 (bidi_cache_fetch_state, bidi_cache_search)
8985 (bidi_cache_find_level_change, bidi_cache_ensure_space)
8986 (bidi_cache_iterator_state, bidi_cache_find)
8987 (bidi_find_other_level_edge, bidi_cache_start_stack):
8988 All variables related to cache indices are now EMACS_INT.
8989
8990 * dispextern.h (struct bidi_string_data): New structure.
8991 (struct bidi_it): New member `string'. Make flag members be 1-bit
8992 fields, and put them last in the struct.
8993 (compute_display_string_pos, compute_display_string_end):
8994 Update prototypes.
8995 (bidi_push_it, bidi_pop_it): Add prototypes.
8996 (struct iterator_stack_entry): New members bidi_p,
8997 paragraph_embedding, and from_disp_prop_p.
8998 (struct it): Member bidi_p is now a bit field 1 bit wide.
8999 (bidi_shelve_cache, bidi_unshelve_cache):
9000 Declare prototypes.
9001
9002 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
9003 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
9004 and vector-like objects.
9005
9006 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
9007 cache around display iteration.
9008
9009 * window.c (Fwindow_end, window_scroll_pixel_based)
9010 (displayed_window_lines, Frecenter): Save and restore the bidi
9011 cache around display iteration.
9012
9013 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
9014
9015 * editfns.c (Fdelete_region): Clarify the use of the named
9016 parameters (bug#6788).
9017
9018 2011-07-14 Martin Rudalics <rudalics@gmx.at>
9019
9020 * indent.c (Fvertical_motion): Set and restore w->pointm when
9021 saving and restoring the window's buffer (Bug#9006).
9022
9023 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
9024
9025 * editfns.c (Fstring_to_char): Clarify just what is returned
9026 (bug#6576). Text by Eli Zaretskii.
9027
9028 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
9029
9030 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
9031
9032 2011-07-13 Eli Zaretskii <eliz@gnu.org>
9033
9034 * buffer.c (mmap_find): Fix a typo.
9035
9036 2011-07-13 Johan Bockgård <bojohan@gnu.org>
9037
9038 Fix execution of x selection hooks.
9039 * xselect.c (Qx_lost_selection_functions)
9040 (Qx_sent_selection_functions): New vars.
9041 (syms_of_xselect): DEFSYM them.
9042 (x_handle_selection_request): Pass Qx_sent_selection_functions
9043 rather than Vx_sent_selection_functions to Frun_hook_with_args.
9044 (x_handle_selection_clear,x_clear_frame_selections):
9045 Pass Qx_lost_selection_functions rather than
9046 Vx_lost_selection_functions to Frun_hook_with_args.
9047
9048 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
9049
9050 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
9051 The old code sometimes used this field without initializing it.
9052
9053 * alloc.c (gc_sweep): Don't read past end of array.
9054 In theory, the old code could also have corrupted Emacs internals,
9055 though it'd be very unlikely.
9056
9057 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
9058
9059 * character.c (Fcharacterp): Don't advertise optional ignored
9060 argument. (Bug#4026)
9061
9062 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
9063
9064 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
9065 key" (bug#4257).
9066
9067 * window.c (Fset_window_start): Doc fix (bug#4199).
9068 (Fset_window_hscroll): Ditto.
9069
9070 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
9071
9072 Fix minor new problems caught by GCC 4.6.1.
9073 * term.c (init_tty): Remove unused local.
9074 * xsettings.c (store_monospaced_changed): Define this function only
9075 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
9076 not used otherwise.
9077
9078 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
9079
9080 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
9081
9082 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
9083
9084 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
9085 are the mini-buffer and the echo area (bug#3320).
9086
9087 * term.c (init_tty): Remove support for supdup, c10 and perq
9088 terminals, which are no longer supported (bug#1482).
9089
9090 2011-07-10 Johan Bockgård <bojohan@gnu.org>
9091
9092 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
9093
9094 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
9095
9096 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
9097 for non-popups (Bug#3642).
9098
9099 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
9100
9101 * alloc.c (reset_malloc_hooks): Protoize.
9102 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
9103 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
9104 * cm.c (losecursor): Likewise.
9105 * data.c (fmod): Likewise.
9106 * dispnew.c (swap_glyphs_in_rows): Likewise.
9107 * emacs.c (memory_warning_signal): Likewise.
9108 * floatfns.c (float_error): Likewise.
9109 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
9110 (otf_open, font_otf_capability, generate_otf_features)
9111 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
9112 Likewise.
9113 * image.c (pbm_read_file): Likewise.
9114 * indent.c (string_display_width): Likewise.
9115 * intervals.c (check_for_interval, search_for_interval)
9116 (inc_interval_count, count_intervals, root_interval)
9117 (adjust_intervals_for_insertion, make_new_interval): Likewise.
9118 * lread.c (defalias): Likewise.
9119 * ralloc.c (r_alloc_check): Likewise.
9120 * regex.c (set_image_of_range_1, set_image_of_range)
9121 (regex_grow_registers): Likewise.
9122 * sysdep.c (strerror): Likewise.
9123 * termcap.c (valid_filename_p, tprint, main): Likewise.
9124 * tparam.c (main): Likewise.
9125 * unexhp9k800.c (run_time_remap, save_data_space)
9126 (update_file_ptrs, read_header, write_header, calculate_checksum)
9127 (copy_file, copy_rest, display_header): Likewise.
9128 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
9129 Likewise.
9130 * xdisp.c (check_it): Likewise.
9131 * xfaces.c (register_color, unregister_color, unregister_colors):
9132 Likewise.
9133 * xfns.c (print_fontset_result): Likewise.
9134 * xrdb.c (member, fatal, main): Likewise.
9135
9136 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
9137
9138 Fix minor problems found by static checking (Bug#9031).
9139 * chartab.c (char_table_set_range, map_sub_char_table):
9140 Remove unused locals.
9141 (uniprop_table): Now static.
9142 * composite.c (_work_char): Remove unused static var.
9143
9144 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
9145
9146 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
9147
9148 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
9149
9150 * gtkutil.c (qttip_cb): Remove code without function.
9151
9152 2011-07-09 Eli Zaretskii <eliz@gnu.org>
9153
9154 * w32.c (pthread_sigmask): New stub.
9155
9156 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
9157
9158 Use pthread_sigmask, not sigprocmask (Bug#9010).
9159 sigprocmask is portable only for single-threaded applications, and
9160 Emacs can be multi-threaded when it uses GTK.
9161 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
9162 (LIBES): Use it.
9163 * callproc.c (Fcall_process):
9164 * process.c (create_process):
9165 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
9166 Use pthread_sigmask, not sigprocmask.
9167
9168 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
9169
9170 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
9171 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
9172 wrong (Bug#8591).
9173
9174 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
9175
9176 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
9177 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
9178 (xg_hide_tooltip): Fix comment.
9179
9180 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
9181 in registerServicesMenuSendTypes.
9182 (validRequestorForSendType): Don't check ns_return_types.
9183
9184 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
9185 ns_return_type.
9186
9187 2011-07-08 Jason Rumney <jasonr@gnu.org>
9188
9189 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
9190 SH_SHOW for hidden windows (Bug#5482).
9191
9192 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
9193 frame struct members of non-existent frames (Bug#6284).
9194
9195 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
9196
9197 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
9198 variable firstTime not needed on OSX >= 10.6.
9199 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
9200 >= 10.5. Use setKnobProportion, setDoubleValue.
9201
9202 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
9203 (MAC_OS_X_VERSION_10_5): Define if not defined.
9204 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
9205 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
9206 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
9207
9208 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
9209 cString and lossyCString on OSX >= 10.4.
9210
9211 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
9212 sizeToFit on OSX >= 10.2.
9213
9214 * nsimage.m (allocInitFromFile): Don't use deprecated method
9215 bestRepresentationForDevice on OSX >= 10.6.
9216
9217 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
9218 to avoid warning.
9219
9220 * emacs.c: Declare unexec_init_emacs_zone.
9221
9222 * nsgui.h: Fix compiler warning about gnulib redefining verify.
9223
9224 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
9225
9226 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
9227 on svcsMenu (Bug#8842).
9228
9229 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
9230 ns_return_types.
9231 (Fns_list_services): Just return Qnil on 10.6, code not working there.
9232
9233 * nsterm.m (QUTF8_STRING): Declare.
9234 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
9235 (validRequestorForSendType): Return type is (id).
9236 Change indexOfObjectIdenticalTo to indexOfObject.
9237 Check if we have local selection before returning self (Bug#8842).
9238 (writeSelectionToPasteboard): Put local selection into paste board
9239 if we have a local selection (Bug#8842).
9240 (syms_of_nsterm): DEFSYM QUTF8_STRING.
9241
9242 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
9243 (ns_get_local_selection): Declare.
9244
9245 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
9246
9247 * keymap.c (describe_map_tree): Don't insert a double newline at
9248 the end of the buffer (bug#1169) and return whether we inserted
9249 something.
9250
9251 * callint.c (Fcall_interactively): Change "reading args" to
9252 "providing args" to try to clarify what it does (bug#1010).
9253
9254 2011-07-07 Kenichi Handa <handa@m17n.org>
9255
9256 * composite.c (composition_compute_stop_pos): Ignore a static
9257 composition starting before CHARPOS (Bug#8915).
9258
9259 * xdisp.c (handle_composition_prop): Likewise.
9260
9261 2011-07-07 Eli Zaretskii <eliz@gnu.org>
9262
9263 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
9264 (Bug#9015)
9265
9266 2011-07-07 Kenichi Handa <handa@m17n.org>
9267
9268 * character.h (unicode_category_t): New enum type.
9269
9270 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
9271 (Qchar_code_property_table): New variable.
9272 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
9273 (UNIPROP_COMPRESSED_FORM_P): New macros.
9274 (char_table_ascii): Uncompress the compressed values.
9275 (sub_char_table_ref): New arg is_uniprop. Callers changed.
9276 Uncompress the compressed values.
9277 (sub_char_table_ref_and_range): Likewise.
9278 (char_table_ref_and_range): Uncompress the compressed values.
9279 (sub_char_table_set): New arg is_uniprop. Callers changed.
9280 Uncompress the compressed values.
9281 (sub_char_table_set_range): Args changed. Callers changed.
9282 (char_table_set_range): Adjuted for the above change.
9283 (map_sub_char_table): Delete args default_val and parent. Add arg
9284 top. Give decoded values to a Lisp function.
9285 (map_char_table): Adjust for the above change. Give decoded
9286 values to a Lisp function. Gcpro more variables.
9287 (uniprop_table_uncompress)
9288 (uniprop_decode_value_run_length): New functions.
9289 (uniprop_decoder, uniprop_decoder_count): New variables.
9290 (uniprop_get_decoder, uniprop_encode_value_character)
9291 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
9292 New functions.
9293 (uniprop_encoder, uniprop_encoder_count): New variables.
9294 (uniprop_get_encoder, uniprop_table)
9295 (Funicode_property_table_internal, Fget_unicode_property_internal)
9296 (Fput_unicode_property_internal): New functions.
9297 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
9298 Sunicode_property_table_internal, Sget_unicode_property_internal,
9299 and Sput_unicode_property_internal. Defvar_lisp
9300 char-code-property-alist.
9301
9302 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
9303 Vunicode_category_table.
9304
9305 * font.c (font_range): Adjust for the change of
9306 Vunicode_category_table.
9307
9308 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
9309
9310 * m/iris4d.h: Remove file, move contents ...
9311 * s/irix6-5.h: ... here.
9312
9313 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
9314
9315 Remove unportable assumption about struct layout (Bug#8884).
9316 * alloc.c (mark_buffer):
9317 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
9318 (clone_per_buffer_values): Don't assume that
9319 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
9320 This isn't true in general, and it's particularly not true
9321 if Emacs is configured with --with-wide-int.
9322 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
9323 New macros, used in the buffer.c change.
9324
9325 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
9326
9327 * xsettings.c: Use both GConf and GSettings if both are available.
9328 (store_config_changed_event): Add comment.
9329 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
9330 (store_tool_bar_style_changed): New functions.
9331 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
9332 (struct xsettings): Move font inside HAVE_XFT.
9333 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
9334 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
9335 Move inside HAVE_XFT.
9336 (something_changed_gsettingsCB): Rename from something_changedCB.
9337 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
9338 also.
9339 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
9340 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
9341 (something_changed_gconfCB): Rename from something_changedCB.
9342 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
9343 (parse_settings): Move check for font inside HAVE_XFT.
9344 (read_settings, apply_xft_settings): Add comment.
9345 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
9346 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
9347 call store_font_name_changed.
9348 (xft_settings_event): Add comment.
9349 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
9350 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
9351 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
9352 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
9353 (xsettings_initialize): Call init_gsettings last.
9354 (xsettings_get_system_font, xsettings_get_system_normal_font):
9355 Add comment.
9356
9357 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
9358
9359 Random fixes. E.g., (random) never returned negative values.
9360 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
9361 subseconds part to the entropy, as that's a bit more random.
9362 Prefer signed to unsigned, since the signedness doesn't matter and
9363 in general we prefer signed. When given a limit, use a
9364 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
9365 latter isn't right if USE_2_TAGS_FOR_INTS.
9366 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
9367 not 0..VALMASK. Don't discard "excess" bits that random () returns.
9368
9369 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
9370
9371 * textprop.c (text_property_stickiness):
9372 Obey Vtext_property_default_nonsticky.
9373 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
9374 * w32fns.c (syms_of_w32fns):
9375 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
9376
9377 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
9378
9379 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
9380 This is more efficient than Ffile_directory_p and avoids a minor race.
9381
9382 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
9383
9384 * buffer.c (Foverlay_put): Say what the return value is
9385 (bug#7835).
9386
9387 * fileio.c (barf_or_query_if_file_exists): Check first if the file
9388 is a directory before asking whether to use the file name
9389 (bug#7564).
9390 (barf_or_query_if_file_exists): Make the "File is a directory"
9391 error be more correct.
9392
9393 * fns.c (Frequire): Remove the mention of the .gz files, since
9394 that's installation-specific, but keep the mention of
9395 `get-load-suffixes'.
9396
9397 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
9398
9399 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
9400 Report string overflow if the output is too long.
9401
9402 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
9403
9404 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
9405 (syms_of_gnutls): Remove duplicate DEFSYM for
9406 Qgnutls_bootprop_verify_hostname_error, an error for
9407 Qgnutls_bootprop_verify_error (which is no longer used).
9408
9409 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
9410 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
9411 Also (re)move comments that are misplaced or no longer relevant.
9412
9413 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
9414
9415 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
9416
9417 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
9418
9419 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
9420 and background color parameters if they have been changed.
9421
9422 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
9423
9424 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
9425
9426 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
9427
9428 * xsettings.c (SYSTEM_FONT): Define only when used.
9429 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
9430
9431 * keymap.c (access_keymap_1): Now static.
9432
9433 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
9434
9435 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
9436 leave any prefix arg for the up event (Bug#1586).
9437
9438 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
9439
9440 * lread.c (syms_of_lread): Mention single symbols defined by
9441 `defvar' or `defconst' (bug#7154).
9442
9443 * fns.c (Frequire): Mention .el.gz files (bug#7314).
9444 (Frequire): Mention get-load-suffixes.
9445
9446 2011-07-02 Martin Rudalics <rudalics@gmx.at>
9447
9448 * window.h (window): Remove clone_number slot.
9449 * window.c (Fwindow_clone_number, Fset_window_clone_number):
9450 Remove.
9451 (make_parent_window, make_window, saved_window)
9452 (Fset_window_configuration, save_window_save): Don't deal with
9453 clone numbers.
9454 * buffer.c (Qclone_number): Remove declaration.
9455 (sort_overlays, overlay_strings): Don't deal with clone numbers.
9456
9457 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
9458
9459 Add multiple inheritance to keymaps.
9460 * keymap.c (Fmake_composed_keymap): New function.
9461 (Fset_keymap_parent): Simplify.
9462 (fix_submap_inheritance): Remove.
9463 (access_keymap_1): New function extracted from access_keymap to handle
9464 embedded parents and handle lists of maps.
9465 (access_keymap): Use it.
9466 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
9467 (Fcopy_keymap): Handle embedded parents.
9468 (Fcommand_remapping, define_as_prefix): Simplify.
9469 (Fkey_binding): Simplify.
9470 (syms_of_keymap): Move minibuffer-local-completion-map,
9471 minibuffer-local-filename-completion-map,
9472 minibuffer-local-must-match-map, and
9473 minibuffer-local-filename-must-match-map to Elisp.
9474 (syms_of_keymap): Defsubr make-composed-keymap.
9475 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
9476 (parse_menu_item): Trivial simplification.
9477
9478 2011-07-01 Glenn Morris <rgm@gnu.org>
9479
9480 * Makefile.in (SETTINGS_LIBS): Fix typo.
9481
9482 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
9483
9484 * coding.c (Fencode_coding_string): Record the last coding system
9485 used, as the function doc string says (bug#8738).
9486
9487 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
9488
9489 * xsettings.c (store_monospaced_changed): Take new font as arg and
9490 check for change against current_mono_font.
9491 (EMACS_TYPE_SETTINGS): Remove this and related defines.
9492 (emacs_settings_constructor, emacs_settings_get_property)
9493 (emacs_settings_set_property, emacs_settings_class_init)
9494 (emacs_settings_init, gsettings_obj): Remove.
9495 (something_changedCB): New function for HAVE_GSETTINGS.
9496 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
9497 with value as argument.
9498 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
9499 g_settings_new (Bug#8967). Do not create gsettings_obj.
9500 Remove calls to g_settings_bind. Connect something_changedCB to
9501 "changed".
9502
9503 * xgselect.c: Add defined (HAVE_GSETTINGS).
9504 (xgselect_initialize): Ditto.
9505
9506 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
9507 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
9508 xg_select.
9509
9510 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
9511
9512 * eval.c (struct backtrace): Simplify and port the data structure.
9513 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
9514 signed bit field, as this assumption is not portable and it makes
9515 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
9516 "char debug_on_exit : 1" as this is not portable either; instead,
9517 use the portable "unsigned int debug_on_exit : 1". Remove unused
9518 member evalargs. Remove obsolete comments about cc bombing out.
9519
9520 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
9521
9522 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9523 Let HAVE_GSETTINGS override HAVE_GCONF.
9524 (store_monospaced_changed): New function.
9525 (EMACS_SETTINGS): A new type derived from GObject to handle
9526 GSettings notifications.
9527 (emacs_settings_constructor, emacs_settings_get_property)
9528 (emacs_settings_set_property, emacs_settings_class_init):
9529 New functions.
9530 (gsettings_client, gsettings_obj): New variables.
9531 (GSETTINGS_SCHEMA): New define.
9532 (something_changedCB): Call store_monospaced_changed.
9533 (init_gsettings): New function.
9534 (xsettings_initialize): Call init_gsettings.
9535 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
9536 to NULL.
9537
9538 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9539 GCONF_CFLAGS/LIBS.
9540
9541 2011-06-29 Martin Rudalics <rudalics@gmx.at>
9542
9543 * window.c (resize_root_window, grow_mini_window)
9544 (shrink_mini_window): Rename Qresize_root_window to
9545 Qwindow_resize_root_window and Qresize_root_window_vertically to
9546 Qwindow_resize_root_window_vertically.
9547
9548 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
9549
9550 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
9551
9552 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
9553
9554 * makefile.w32-in: Redesign dependencies so they reflect more
9555 clearly which files are directly included by each source file,
9556 and not through other includes.
9557
9558 2011-06-27 Martin Rudalics <rudalics@gmx.at>
9559
9560 * buffer.c (Qclone_number): Declare static and DEFSYM it.
9561 (sort_overlays, overlay_strings): When an overlay's clone number
9562 matches the window's clone number process the overlay even if
9563 the overlay's window property doesn't match the current window.
9564
9565 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
9566 (Fwindow_hchild): Rename to Fwindow_left_child.
9567 (Fwindow_next): Rename to Fwindow_next_sibling.
9568 (Fwindow_prev): Rename to Fwindow_prev_sibling.
9569 (resize_window_check): Rename to window_resize_check.
9570 (resize_window_apply): Rename to window_resize_apply.
9571 (Fresize_window_apply): Rename to Fwindow_resize_apply.
9572 (Fdelete_other_windows_internal, resize_frame_windows)
9573 (Fsplit_window_internal, Fdelete_window_internal)
9574 (grow_mini_window, shrink_mini_window)
9575 (Fresize_mini_window_internal): Fix callers accordingly.
9576
9577 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
9578
9579 * emacsgtkfixed.h: State that this is only used with Gtk+3.
9580 (emacs_fixed_set_min_size): Remove.
9581 (emacs_fixed_new): Take frame as argument.
9582
9583 * emacsgtkfixed.c: State that this is only used with Gtk+3.
9584 (_EmacsFixedPrivate): Remove minwidth/height.
9585 Add struct frame *f.
9586 (emacs_fixed_init): Initialize priv->f.
9587 (get_parent_class, emacs_fixed_set_min_size): Remove.
9588 (emacs_fixed_new): Set priv->f to argument.
9589 (emacs_fixed_get_preferred_width)
9590 (emacs_fixed_get_preferred_height): Use min_width/height from
9591 frames size_hint to set minimum and natural (Bug#8919).
9592 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
9593 and use min_width/height from frames size_hint to set
9594 min_width/height (Bug#8919).
9595
9596 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9597 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
9598 Fix indentation.
9599
9600 2011-06-26 Eli Zaretskii <eliz@gnu.org>
9601
9602 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
9603 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
9604 called at ZV.
9605
9606 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
9607
9608 * process.c (wait_reading_process_output): Bypass select if
9609 waiting for a cell while ignoring keyboard input, and input is
9610 pending. Suggested by Jan Djärv (Bug#8869).
9611
9612 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
9613
9614 Use gnulib's dup2 module instead of rolling our own.
9615 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
9616
9617 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9618
9619 * dispnew.c (scrolling_window): Before scrolling, turn off a
9620 mouse-highlight in the window being scrolled.
9621
9622 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
9623
9624 Move DEFSYM to lisp.h and use everywhere.
9625
9626 * character.h (DEFSYM): Move declaration...
9627 * lisp.h (DEFSYM): ...here.
9628
9629 * gnutls.c:
9630 * minibuf.c:
9631 * w32menu.c:
9632 * w32proc.c:
9633 * w32select.c: Don't include character.h.
9634
9635 * alloc.c (syms_of_alloc):
9636 * buffer.c (syms_of_buffer):
9637 * bytecode.c (syms_of_bytecode):
9638 * callint.c (syms_of_callint):
9639 * casefiddle.c (syms_of_casefiddle):
9640 * casetab.c (init_casetab_once):
9641 * category.c (init_category_once, syms_of_category):
9642 * ccl.c (syms_of_ccl):
9643 * cmds.c (syms_of_cmds):
9644 * composite.c (syms_of_composite):
9645 * dbusbind.c (syms_of_dbusbind):
9646 * dired.c (syms_of_dired):
9647 * dispnew.c (syms_of_display):
9648 * doc.c (syms_of_doc):
9649 * editfns.c (syms_of_editfns):
9650 * emacs.c (syms_of_emacs):
9651 * eval.c (syms_of_eval):
9652 * fileio.c (syms_of_fileio):
9653 * fns.c (syms_of_fns):
9654 * frame.c (syms_of_frame):
9655 * fringe.c (syms_of_fringe):
9656 * insdel.c (syms_of_insdel):
9657 * keymap.c (syms_of_keymap):
9658 * lread.c (init_obarray, syms_of_lread):
9659 * macros.c (syms_of_macros):
9660 * msdos.c (syms_of_msdos):
9661 * print.c (syms_of_print):
9662 * process.c (syms_of_process):
9663 * search.c (syms_of_search):
9664 * sound.c (syms_of_sound):
9665 * syntax.c (init_syntax_once, syms_of_syntax):
9666 * terminal.c (syms_of_terminal):
9667 * textprop.c (syms_of_textprop):
9668 * undo.c (syms_of_undo):
9669 * w32.c (globals_of_w32):
9670 * window.c (syms_of_window):
9671 * xdisp.c (syms_of_xdisp):
9672 * xfaces.c (syms_of_xfaces):
9673 * xfns.c (syms_of_xfns):
9674 * xmenu.c (syms_of_xmenu):
9675 * xsettings.c (syms_of_xsettings):
9676 * xterm.c (syms_of_xterm): Use DEFSYM.
9677
9678 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
9679
9680 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
9681
9682 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
9683
9684 Integer and buffer overflow fixes (Bug#8873).
9685
9686 * print.c (printchar, strout): Check for string overflow.
9687 (PRINTPREPARE, printchar, strout):
9688 Don't set size unless allocation succeeds.
9689
9690 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
9691 for sizes. Check for string overflow more accurately.
9692 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
9693
9694 * macros.c: Integer and buffer overflow fixes.
9695 * keyboard.h (struct keyboard.kbd_macro_bufsize):
9696 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
9697 Use ptrdiff_t, not int, for sizes.
9698 Don't increment bufsize until after realloc succeeds.
9699 Check for size-calculation overflow.
9700 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
9701
9702 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
9703
9704 * lread.c: Integer overflow fixes.
9705 (read_integer): Radix is now EMACS_INT, not int,
9706 to improve quality of diagnostics for out-of-range radices.
9707 Calculate buffer size correctly for out-of-range radices.
9708 (read1): Check for integer overflow in radices, and in
9709 read-circle numbers.
9710 (read_escape): Avoid int overflow.
9711 (Fload, openp, read_buffer_size, read1)
9712 (substitute_object_recurse, read_vector, read_list, map_obarray):
9713 Use ptrdiff_t, not int, for sizes.
9714 (read1): Use EMACS_INT, not int, for sizes.
9715 Check for size overflow.
9716
9717 * image.c (cache_image): Check for size arithmetic overflow.
9718
9719 * lread.c: Integer overflow issues.
9720 (saved_doc_string_size, saved_doc_string_length)
9721 (prev_saved_doc_string_size, prev_saved_doc_string_length):
9722 Now ptrdiff_t, not int.
9723 (read1): Don't assume doc string length fits in int. Check for
9724 out-of-range doc string lengths.
9725 (read_list): Don't assume file position fits in int.
9726 (read_escape): Check for hex character overflow.
9727
9728 2011-06-22 Leo Liu <sdl.web@gmail.com>
9729
9730 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
9731 Move to minibuffer.el.
9732
9733 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
9734
9735 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
9736 The following patches are for when GLYPH_DEBUG && !XASSERT.
9737 * dispextern.h (trace_redisplay_p, dump_glyph_string):
9738 * dispnew.c (flush_stdout):
9739 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
9740 Mark as externally visible.
9741 * dispnew.c (check_window_matrix_pointers): Now static.
9742 * dispnew.c (window_to_frame_vpos):
9743 * xfns.c (unwind_create_frame):
9744 * xterm.c (x_check_font): Remove unused local.
9745 * scroll.c (CHECK_BOUNDS):
9746 * xfaces.c (cache_fache): Rename local to avoid shadowing.
9747 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
9748 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
9749 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
9750 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
9751 Now static.
9752 (debug_method_add): Use va_list and vsprintf rather than relying
9753 on undefined behavior with wrong number of arguments.
9754 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
9755 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
9756 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
9757 since we're not interested in debugging glyphs with old libraries.
9758 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
9759 GCC 4.6.0's static checking.
9760
9761 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
9762
9763 Integer overflow and signedness fixes (Bug#8873).
9764 A few related buffer overrun fixes, too.
9765
9766 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
9767
9768 * dispextern.h (struct face.stipple):
9769 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
9770 (x_bitmap_mask, x_allocate_bitmap_record)
9771 (x_create_bitmap_from_data, x_create_bitmap_from_file)
9772 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
9773 (x_create_bitmap_from_xpm_data):
9774 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
9775 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
9776 (.bitmaps_last):
9777 * xfaces.c (load_pixmap):
9778 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
9779 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
9780 (.bitmaps_last, struct x_output.icon_bitmap):
9781 Use ptrdiff_t, not int, for bitmap indexes.
9782 (x_allocate_bitmap_record): Check for size overflow.
9783 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
9784
9785 Use ptrdiff_t, not int, for overlay counts.
9786 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
9787 * editfns.c (overlays_around, get_pos_property):
9788 * textprop.c (get_char_property_and_overlay):
9789 * xdisp.c (next_overlay_change, note_mouse_highlight):
9790 * xfaces.c (face_at_buffer_position):
9791 * buffer.c (OVERLAY_COUNT_MAX): New macro.
9792 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
9793 (Fnext_overlay_change, Fprevious_overlay_change)
9794 (mouse_face_overlay_overlaps, Foverlays_in):
9795 Use ptrdiff_t, not int, for sizes.
9796 (overlays_at, overlays_in): Check for size-calculation overflow.
9797
9798 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
9799
9800 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
9801 (x_session_initialize): Do not assume string length fits in int.
9802
9803 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
9804 This is unlikely, but can occur if DPI is outlandish.
9805
9806 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
9807 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
9808
9809 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
9810 * xrdb.c (magic_file_p, search_magic_path):
9811 Omit last arg SUFFIX; it was always 0. All callers changed.
9812 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
9813
9814 * xfont.c (xfont_match): Avoid need for strlen.
9815
9816 * xfns.c: Don't assume strlen fits in int.
9817 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
9818
9819 * xdisp.c (message_log_check_duplicate): Return intmax_t,
9820 not unsigned long, as we prefer signed integers. All callers changed.
9821 Detect integer overflow in repeat count.
9822 (message_dolog): Don't assume print length fits in 39 bytes.
9823 (display_mode_element): Don't assume strlen fits in int.
9824
9825 * termcap.c: Don't assume sizes fit in int and never overflow.
9826 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
9827 (gobble_line): Check for size-calculation overflow.
9828
9829 * minibuf.c (Fread_buffer):
9830 * lread.c (intern, intern_c_string):
9831 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
9832 Don't assume string length fits in int.
9833
9834 * keyboard.c (parse_tool_bar_item):
9835 * gtkutil.c (style_changed_cb): Avoid need for strlen.
9836
9837 * font.c: Don't assume string length fits in int.
9838 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
9839 Use ptrdiff_t, not int.
9840 (font_intern_prop): Don't assume string length fits in int.
9841 Don't assume integer property fits in fixnum.
9842 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
9843
9844 * filelock.c: Fix some buffer overrun and integer overflow issues.
9845 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
9846 Reformulate so as not to need the command string.
9847 Invoke gzip -cd rather than gunzip, as it's more portable.
9848 (lock_info_type, lock_file_1, lock_file):
9849 Don't assume pid_t and time_t fit in unsigned long.
9850 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
9851 (current_lock_owner): Prefer signed type for sizes.
9852 Use memcpy, not strncpy, where memcpy is what is really wanted.
9853 Don't assume (via atoi) that time_t and pid_t fit in int.
9854 Check for time_t and/or pid_t out of range, e.g., via a network share.
9855 Don't alloca where an auto var works fine.
9856
9857 * fileio.c: Fix some integer overflow issues.
9858 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
9859 Don't assume string length fits in int.
9860 (directory_file_name): Don't assume string length fits in long.
9861 (make_temp_name): Don't assume pid fits in int, or that its print
9862 length is less than 20.
9863
9864 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
9865
9866 * coding.c (make_subsidiaries): Don't assume string length fits in int.
9867
9868 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
9869
9870 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
9871 We prefer signed integers, even for size calculations.
9872
9873 * emacs.c: Don't assume string length fits in 'int'.
9874 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
9875 (main): Don't invoke strlen when not needed.
9876
9877 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
9878 (XD_DEBUG_MESSAGE): Don't waste a byte.
9879
9880 * callproc.c (getenv_internal_1, getenv_internal)
9881 (Fgetenv_internal):
9882 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
9883
9884 * lread.c (invalid_syntax): Omit length argument.
9885 All uses changed. This doesn't fix a bug, but it simplifies the
9886 code away from its former Hollerith-constant appearance, and it's
9887 one less 'int' to worry about when looking at integer-overflow issues.
9888 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
9889
9890 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
9891 This didn't break anything, but it didn't help either.
9892 It's confusing to put a bogus integer in a place where the actual
9893 value does not matter.
9894 (LIST_END_P): Remove unused macro and its bogus comment.
9895 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
9896
9897 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
9898 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
9899 implementation.
9900 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
9901 We prefer signed types, and the value cannot exceed the EMACS_INT
9902 range anyway (because otherwise the length would not be representable).
9903 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
9904 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
9905 This avoids a GCC warning when WIDE_EMACS_INT.
9906
9907 * indent.c (sane_tab_width): New function.
9908 (current_column, scan_for_column, Findent_to, position_indentation)
9909 (compute_motion): Use it. This is just for clarity.
9910 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
9911
9912 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
9913
9914 * lisp.h (lint_assume): New macro.
9915 * composite.c (composition_gstring_put_cache):
9916 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
9917
9918 * editfns.c, insdel.c:
9919 Omit unnecessary forward decls, to simplify future changes.
9920
9921 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
9922
9923 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
9924
9925 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
9926 Use much-faster test for byte-length change.
9927 Don't assume string byte-length fits in 'int'.
9928 Check that character arg fits in 'int'.
9929 (mapcar1): Declare byte as byte, for clarity.
9930
9931 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
9932
9933 * fns.c (concat): Catch string overflow earlier.
9934 Do not rely on integer wraparound.
9935
9936 * dispextern.h (struct it.overlay_strings_charpos)
9937 (struct it.selective): Now EMACS_INT, not int.
9938 * xdisp.c (forward_to_next_line_start)
9939 (back_to_previous_visible_line_start)
9940 (reseat_at_next_visible_line_start, next_element_from_buffer):
9941 Don't arbitrarily truncate the value of 'selective' to int.
9942
9943 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
9944
9945 * composite.c: Don't truncate sizes to 'int'.
9946 (composition_gstring_p, composition_reseat_it)
9947 (composition_adjust_point): Use EMACS_INT, not int.
9948 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
9949 not EMACS_UINT, for indexes.
9950
9951 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
9952
9953 * buffer.c: Include <verify.h>.
9954 (struct sortvec.priority, struct sortstr.priority):
9955 Now EMACS_INT, not int.
9956 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
9957 (struct sortstr.size, record_overlay_string)
9958 (struct sortstrlist.size, struct sortlist.used):
9959 Don't truncate size to int.
9960 (record_overlay_string): Check for size-calculation overflow.
9961 (init_buffer_once): Check at compile-time, not run-time.
9962
9963 2011-06-22 Jim Meyering <meyering@redhat.com>
9964
9965 Don't leak an XBM-image-sized buffer
9966 * image.c (xbm_load): Free the image buffer after using it.
9967
9968 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
9969
9970 Port to Sun C.
9971 * composite.c (find_automatic_composition): Omit needless 'return 0;'
9972 that Sun C diagnosed.
9973 * fns.c (secure_hash): Fix pointer signedness issue.
9974 * intervals.c (static_offset_intervals): New function.
9975 (offset_intervals): Use it.
9976
9977 2011-06-21 Leo Liu <sdl.web@gmail.com>
9978
9979 * deps.mk (fns.o):
9980 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
9981 sha512.h.
9982
9983 * fns.c (secure_hash): Rename from crypto_hash_function and change
9984 the first arg to accept symbols.
9985 (Fsecure_hash): New primitive.
9986 (syms_of_fns): New symbols.
9987
9988 2011-06-20 Deniz Dogan <deniz@dogan.se>
9989
9990 * process.c (Fset_process_buffer): Clarify return value in
9991 docstring.
9992
9993 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
9994
9995 * dispnew.c (add_window_display_history): Use BVAR.
9996
9997 * xdisp.c (debug_method_add): Use BVAR.
9998 (check_window_end, dump_glyph_matrix, dump_glyph)
9999 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
10000
10001 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
10002 Likewise.
10003
10004 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
10005 check till after the cache is created in init_frame_faces.
10006
10007 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
10008
10009 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
10010
10011 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
10012
10013 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
10014 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
10015 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
10016
10017 Improve buffer-overflow checking (Bug#8873).
10018 * fileio.c (Finsert_file_contents):
10019 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
10020 Remove the old (too-loose) buffer overflow checks.
10021 They weren't needed, since make_gap checks for buffer overflow.
10022 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
10023 The old code merely checked for Emacs fixnum overflow, and relied
10024 on undefined (wraparound) behavior. The new code avoids undefined
10025 behavior, and also checks for ptrdiff_t and/or size_t overflow.
10026
10027 * editfns.c (Finsert_char): Don't dump core with very negative counts.
10028 Tune. Don't use wider integers than needed. Don't use alloca.
10029 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
10030
10031 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
10032
10033 * insdel.c, lisp.h (buffer_overflow): New function.
10034 (insert_from_buffer_1, replace_range, replace_range_2):
10035 * insdel.c (make_gap_larger):
10036 * editfns.c (Finsert_char):
10037 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
10038
10039 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
10040
10041 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
10042
10043 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
10044
10045 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
10046 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
10047
10048 * fileio.c: Don't assume EMACS_INT fits in off_t.
10049 (emacs_lseek): New static function.
10050 (Finsert_file_contents, Fwrite_region): Use it.
10051 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
10052
10053 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
10054
10055 * fns.c: Don't overflow int when computing a list length.
10056 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
10057 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
10058 truncation on 64-bit hosts. Check for QUIT every
10059 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
10060 faster and is responsive enough.
10061 (Flength): Report an error instead of overflowing an integer.
10062 (Fsafe_length): Return a float if the value is not representable
10063 as a fixnum. This shouldn't happen except in contrived situations.
10064 (Fnthcdr, Fsort): Don't assume list length fits in int.
10065 (Fcopy_sequence): Don't assume vector length fits in int.
10066
10067 * alloc.c: Check that resized vectors' lengths fit in fixnums.
10068 (header_size, word_size): New constants.
10069 (allocate_vectorlike): Don't check size overflow here.
10070 (allocate_vector): Check it here instead, since this is the only
10071 caller of allocate_vectorlike that could cause overflow.
10072 Check that the new vector's length is representable as a fixnum.
10073
10074 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
10075 The previous code was bogus. For example, next_almost_prime (32)
10076 returned 39, which is undesirable as it is a multiple of 3; and
10077 next_almost_prime (24) returned 25, which is a multiple of 5 so
10078 why was the code bothering to check for multiples of 7?
10079
10080 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
10081
10082 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
10083
10084 Variadic C functions now count arguments with ptrdiff_t.
10085 This partly undoes my 2011-03-30 change, which replaced int with size_t.
10086 Back then I didn't know that the Emacs coding style prefers signed int.
10087 Also, in the meantime I found a few more instances where arguments
10088 were being counted with int, which may truncate counts on 64-bit
10089 machines, or EMACS_INT, which may be unnecessarily wide.
10090 * lisp.h (struct Lisp_Subr.function.aMANY)
10091 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
10092 Arg counts are now ptrdiff_t, not size_t.
10093 All variadic functions and their callers changed accordingly.
10094 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
10095 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
10096 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
10097 * callint.c (Fcall_interactively): Check arg count for overflow,
10098 to avoid potential buffer overrun. Use signed char, not 'int',
10099 for 'varies' array, so that we needn't bother to check its size
10100 calculation for overflow.
10101 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
10102 * eval.c (apply_lambda):
10103 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
10104 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
10105 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
10106
10107 * callint.c (Fcall_interactively): Don't use index var as event count.
10108
10109 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
10110 * mem-limits.h (SIZE): Remove; no longer used.
10111
10112 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
10113
10114 Remove unnecessary casts.
10115 * xterm.c (x_term_init):
10116 * xfns.c (x_set_border_pixel):
10117 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
10118 These aren't needed now that we assume ANSI C.
10119
10120 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
10121 It's more likely to cause problems (due to unsigned overflow)
10122 than to cure them.
10123
10124 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
10125
10126 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
10127
10128 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
10129
10130 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
10131
10132 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
10133
10134 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
10135
10136 GLYPH_CODE_FACE returns EMACS_INT, not int.
10137 * dispextern.h (merge_faces):
10138 * xfaces.c (merge_faces):
10139 * xdisp.c (get_next_display_element, next_element_from_display_vector):
10140 Don't assume EMACS_INT fits in int.
10141
10142 * character.h (CHAR_VALID_P): Remove unused parameter.
10143 * fontset.c, lisp.h, xdisp.c: All uses changed.
10144
10145 * editfns.c (Ftranslate_region_internal): Omit redundant test.
10146
10147 * fns.c (concat): Minor tuning based on overflow analysis.
10148 This doesn't fix any bugs. Use int to hold character, instead
10149 of constantly refetching from Emacs object. Use XFASTINT, not
10150 XINT, for value known to be a character. Don't bother comparing
10151 a single byte to 0400, as it's always less.
10152
10153 * floatfns.c (Fexpt):
10154 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
10155
10156 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
10157 for characters.
10158
10159 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
10160
10161 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
10162 Without this fix, on a 64-bit host (aset S 0 4294967386) would
10163 incorrectly succeed when S was a string, because 4294967386 was
10164 truncated before it was used.
10165
10166 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
10167 Otherwise, an out-of-range integer could cause undefined behavior
10168 on a 64-bit host.
10169
10170 * composite.c: Use int, not EMACS_INT, for characters.
10171 (fill_gstring_body, composition_compute_stop_pos): Use int, not
10172 EMACS_INT, for values that are known to be in character range.
10173 This doesn't fix any bugs but is the usual style inside Emacs and
10174 may generate better code on 32-bit machines.
10175
10176 Make sure a 64-bit char is never passed to ENCODE_CHAR.
10177 This is for reasons similar to the recent CHAR_STRING fix.
10178 * charset.c (Fencode_char): Check that character arg is actually
10179 a character. Pass an int to ENCODE_CHAR.
10180 * charset.h (ENCODE_CHAR): Verify that the character argument is no
10181 wider than 'int', as a compile-time check to prevent future regressions
10182 in this area.
10183
10184 * character.c (char_string): Remove unnecessary casts.
10185
10186 Make sure a 64-bit char is never passed to CHAR_STRING.
10187 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
10188 by silently ignoring the top 32 bits, allowing some values
10189 that were far too large to be valid characters.
10190 * character.h: Include <verify.h>.
10191 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
10192 arguments are no wider than unsigned, as a compile-time check
10193 to prevent future regressions in this area.
10194 * data.c (Faset):
10195 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
10196 (Fsubst_char_in_region):
10197 * fns.c (concat):
10198 * xdisp.c (decode_mode_spec_coding):
10199 Adjust to CHAR_STRING's new requirement.
10200 * editfns.c (Finsert_char, Fsubst_char_in_region):
10201 * fns.c (concat): Check that character args are actually
10202 characters. Without this test, these functions did the wrong
10203 thing with wildly out-of-range values on 64-bit hosts.
10204
10205 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
10206 These casts should not be needed on 32-bit hosts, either.
10207 * keyboard.c (read_char):
10208 * lread.c (Fload): Remove casts to unsigned.
10209
10210 * lisp.h (UNSIGNED_CMP): New macro.
10211 This fixes comparison bugs on 64-bit hosts.
10212 (ASCII_CHAR_P): Use it.
10213 * casefiddle.c (casify_object):
10214 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
10215 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
10216 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
10217 * dispextern.h (FACE_FROM_ID):
10218 * keyboard.c (read_char): Use UNSIGNED_CMP.
10219
10220 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
10221 not to EMACS_INT, to avoid GCC warning.
10222
10223 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
10224
10225 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
10226 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
10227 isn't needed on 32-bit machines.
10228
10229 * buffer.c (Fgenerate_new_buffer_name):
10230 Use EMACS_INT for count, not int.
10231 (advance_to_char_boundary): Return EMACS_INT, not int.
10232
10233 * data.c (Qcompiled_function): Now static.
10234
10235 * window.c (window_body_lines): Now static.
10236
10237 * image.c (gif_load): Rename local to avoid shadowing.
10238
10239 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
10240 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
10241 * alloc.c (make_save_value): Integer argument is now of type
10242 ptrdiff_t, not int.
10243 (mark_object): Use ptrdiff_t, not int.
10244 * lisp.h (pD): New macro.
10245 * print.c (print_object): Use it.
10246
10247 * alloc.c: Use EMACS_INT, not int, to count objects.
10248 (total_conses, total_markers, total_symbols, total_vector_size)
10249 (total_free_conses, total_free_markers, total_free_symbols)
10250 (total_free_floats, total_floats, total_free_intervals)
10251 (total_intervals, total_strings, total_free_strings):
10252 Now EMACS_INT, not int. All uses changed.
10253 (Fgarbage_collect): Compute overall total using a double, so that
10254 integer overflow is less likely to be a problem. Check for overflow
10255 when converting back to an integer.
10256 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
10257 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
10258 These were 'int' variables that could overflow on 64-bit hosts;
10259 they were never used, so remove them instead of repairing them.
10260 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
10261 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
10262 Previously, this ceilinged at INT_MAX, but that doesn't work on
10263 64-bit machines.
10264 (allocate_pseudovector): Don't use EMACS_INT when int would do.
10265
10266 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
10267 (allocate_vectorlike): Check for ptrdiff_t overflow.
10268 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
10269 when a (possibly-narrower) signed value would do just as well.
10270 We prefer using signed arithmetic, to avoid comparison confusion.
10271
10272 * alloc.c: Catch some string size overflows that we were missing.
10273 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
10274 for convenience in STRING_BYTES_MAX.
10275 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
10276 The definition here is exact; the one in lisp.h was approximate.
10277 (allocate_string_data): Check for string overflow. This catches
10278 some instances we weren't catching before. Also, it catches
10279 size_t overflow on (unusual) hosts where SIZE_MAX <= min
10280 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
10281 and ptrdiff_t and EMACS_INT are both 64 bits.
10282
10283 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
10284 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
10285 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
10286
10287 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
10288
10289 * alloc.c (Fmake_string): Check for out-of-range init.
10290
10291 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
10292
10293 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
10294
10295 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
10296
10297 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
10298 xg_get_default_scrollbar_width.
10299
10300 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
10301 (int_gtk_range_get_value): Move to the scroll bar part of the file.
10302 (style_changed_cb): Call update_theme_scrollbar_width and call
10303 x_set_scroll_bar_default_width and xg_frame_set_char_size for
10304 all frames (Bug#8505).
10305 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
10306 Call gtk_window_set_resizable if HAVE_GTK3.
10307 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
10308 and height if HAVE_GTK3 (Bug#8505).
10309 (scroll_bar_width_for_theme): New variable.
10310 (update_theme_scrollbar_width): New function.
10311 (xg_get_default_scrollbar_width): Move code to
10312 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
10313 (xg_initialize): Call update_theme_scrollbar_width.
10314
10315 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
10316
10317 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
10318
10319 2011-06-12 Martin Rudalics <rudalics@gmx.at>
10320
10321 * frame.c (make_frame): Call other_buffer_safely instead of
10322 other_buffer.
10323
10324 * window.c (temp_output_buffer_show): Call display_buffer with
10325 second argument Vtemp_buffer_show_specifiers and reset latter
10326 immediately after the call.
10327 (Vtemp_buffer_show_specifiers): New variable.
10328 (auto_window_vscroll_p, next_screen_context_lines)
10329 (Vscroll_preserve_screen_position): Remove leading asterisks from
10330 doc-strings.
10331
10332 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
10333
10334 Fix minor problems found by GCC 4.6.0 static checking.
10335 * buffer.c (Qclone_number): Remove for now, as it's unused.
10336 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
10337 (record_buffer): Remove unused local.
10338 * frame.c (other_visible_frames, frame_buffer_list): Now static.
10339 (set_frame_buffer_list): Remove; unused.
10340 * frame.h (other_visible_frames): Remove decl.
10341 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
10342 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
10343 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
10344 if HAVE_GPM.
10345 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
10346 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
10347 Define only if HAVE_GPM.
10348 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
10349 (update_hints_inhibit): Remove; never set. All uses removed.
10350 * widgetprv.h (emacsFrameClassRec): Remove decl.
10351 * window.c (delete_deletable_window): Now returns void, since it
10352 wasn't returning anything.
10353 (compare_window_configurations): Remove unused locals.
10354 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
10355 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
10356 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
10357 the same widths as pointers. This follows up on the 2011-05-06 patch.
10358 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
10359 * xterm.h: Likewise.
10360 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
10361
10362 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
10363
10364 * makefile.w32-in: Update dependencies.
10365 (LISP_H): Add lib/intprops.h.
10366
10367 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
10368
10369 * image.c (gif_load): Add animation frame delay to the metadata.
10370 (syms_of_image): Use DEFSYM. New symbol `delay'.
10371
10372 2011-06-11 Martin Rudalics <rudalics@gmx.at>
10373
10374 * window.c (delete_deletable_window): Re-add.
10375 (Fset_window_configuration): Rewrite to handle dead buffers and
10376 consequently deletable windows.
10377 (window_tree, Fwindow_tree): Remove. Supply functionality in
10378 window.el.
10379 (compare_window_configurations): Simplify code.
10380
10381 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
10382
10383 * image.c (imagemagick_load_image): Fix type mismatch.
10384 (Fimagemagick_types): Likewise.
10385
10386 * window.h (replace_buffer_in_windows): Declare.
10387
10388 2011-06-11 Martin Rudalics <rudalics@gmx.at>
10389
10390 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
10391 Qclone_number. Remove external declaration of Qdelete_window.
10392 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
10393 code.
10394 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
10395 Run Qbuffer_list_update_hook if allowed.
10396 (Fother_buffer): Rewrite doc-string. Major rewrite for new
10397 buffer list implementation.
10398 (other_buffer_safely): New function.
10399 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
10400 calls to replace_buffer_in_windows and
10401 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
10402 if allowed.
10403 (record_buffer): Inhibit quitting and rewrite using quittable
10404 functions. Run Qbuffer_list_update_hook if allowed.
10405 (Frecord_buffer, Funrecord_buffer): New functions.
10406 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
10407 Move switch-to-buffer to window.el.
10408 (bury-buffer): Move to window.el.
10409 (Vbuffer_list_update_hook): New variable.
10410
10411 * lisp.h (other_buffer_safely): Add prototype in buffer.c
10412 section.
10413
10414 * window.h (resize_frame_windows): Move up in code.
10415 (Fwindow_frame): Remove EXFUN.
10416 (replace_buffer_in_all_windows): Remove prototype.
10417 (replace_buffer_in_windows_safely): Add prototype.
10418
10419 * window.c: Declare Qdelete_window static again. Move down
10420 declaration of select_count.
10421 (Fnext_window, Fprevious_window): Rewrite doc-strings.
10422 (Fother_window): Move to window.el.
10423 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
10424 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
10425 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
10426 window.el.
10427 (replace_buffer_in_windows): Implement by calling
10428 Qreplace_buffer_in_windows.
10429 (replace_buffer_in_all_windows): Remove with some functionality
10430 moved into replace_buffer_in_windows_safely.
10431 (replace_buffer_in_windows_safely): New function.
10432 (select_window_norecord, select_frame_norecord): Move in front
10433 of run_window_configuration_change_hook. Remove now obsolete
10434 declarations.
10435 (Fset_window_buffer): Rewrite doc-string.
10436 Call Qrecord_window_buffer.
10437 (keys_of_window): Move binding for other-window to window.el.
10438
10439 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
10440
10441 * dispextern.h (struct image): Replace data member, whose int_val
10442 and ptr_val fields were not used by anything, with a single
10443 lisp_val object.
10444
10445 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
10446 (gif_clear_image, gif_load, imagemagick_load_image)
10447 (gs_clear_image, gs_load): Callers changed.
10448
10449 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
10450
10451 * buffer.h: Include <time.h>, for time_t.
10452 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
10453
10454 Fix minor problems found by static checking.
10455
10456 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
10457
10458 Make identifiers static if they are not used in other modules.
10459 * data.c (Qcompiled_function, Qframe, Qvector):
10460 * image.c (QimageMagick, Qsvg):
10461 * minibuf.c (Qmetadata):
10462 * window.c (resize_window_check, resize_root_window): Now static.
10463 * window.h (resize_window_check, resize_root_window): Remove decls.
10464
10465 * window.c (window_deletion_count, delete_deletable_window):
10466 Remove; unused.
10467 (window_body_lines): Now static.
10468 (Fdelete_other_windows_internal): Mark vars as initialized.
10469 Make sure 'resize_failed' is initialized.
10470 (run_window_configuration_change_hook): Rename local to avoid shadowing.
10471 (resize_window_apply): Remove unused local.
10472 * window.h (delete_deletable_window): Remove decl.
10473
10474 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
10475 (imagemagick_load_image): Fix pointer signedness problem by changing
10476 last arg from unsigned char * to char *. All uses changed.
10477 Also, fix a local for similar reasons.
10478 Remove unused locals. Remove locals to avoid shadowing.
10479 (fn_rsvg_handle_free): Remove; unused.
10480 (svg_load, svg_load_image): Fix pointer signedness problem.
10481 (imagemagick_load_image): Don't use garbage pointer image_wand.
10482
10483 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
10484
10485 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
10486
10487 * image.c (gif_load): Fix omitted cast error introduced by
10488 2011-06-06 change.
10489
10490 2011-06-10 Martin Rudalics <rudalics@gmx.at>
10491
10492 * window.h (resize_proportionally, orig_total_lines)
10493 (orig_top_line): Remove from window structure.
10494 (set_window_height, set_window_width, change_window_heights)
10495 (Fdelete_window): Remove prototypes.
10496 (resize_frame_windows): Remove duplicate declaration.
10497
10498 2011-06-10 Eli Zaretskii <eliz@gnu.org>
10499
10500 * window.h (resize_frame_windows, resize_window_check)
10501 (delete_deletable_window, resize_root_window)
10502 (resize_frame_windows): Declare prototypes.
10503
10504 * window.c (resize_window_apply): Make definition be "static" to
10505 match the prototype.
10506
10507 2011-06-10 Martin Rudalics <rudalics@gmx.at>
10508
10509 * window.c: Remove declarations of Qwindow_size_fixed,
10510 window_min_size_1, window_min_size_2, window_min_size,
10511 size_window, window_fixed_size_p, enlarge_window, delete_window.
10512 Remove static from declaration of Qdelete_window, it's
10513 temporarily needed by Fbury_buffer.
10514 (replace_window): Don't assign orig_top_line and
10515 orig_total_lines.
10516 (Fdelete_window, delete_window): Remove. Window deletion is
10517 handled by window.el.
10518 (window_loop): Remove DELETE_OTHER_WINDOWS case.
10519 Replace Fdelete_window calls with calls to Qdelete_window.
10520 (Fdelete_other_windows): Remove. Deleting other windows is
10521 handled by window.el.
10522 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
10523 handled in window.el.
10524 (window_min_size_2, window_min_size_1, window_min_size): Remove.
10525 Window minimum sizes are handled in window.el.
10526 (shrink_windows, size_window, set_window_height)
10527 (set_window_width, change_window_heights, window_height)
10528 (window_width, CURBEG, CURSIZE, enlarge_window)
10529 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
10530 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
10531 handled in window.el.
10532 (make_dummy_parent): Rename to make_parent_window and give it a
10533 second argument horflag.
10534 (make_window): Don't set resize_proportionally any more.
10535 (Fsplit_window): Remove. Windows are split in window.el.
10536 (save_restore_action, save_restore_orig_size)
10537 (shrink_window_lowest_first, save_restore_orig_size): Remove.
10538 Resize mini windows in window.el.
10539 (grow_mini_window, shrink_mini_window): Implement by calling
10540 Qresize_root_window_vertically, resize_window_check and
10541 resize_window_apply.
10542 (saved_window, Fset_window_configuration, save_window_save):
10543 Do not handle orig_top_line, orig_total_lines, and
10544 resize_proportionally.
10545 (window_min_height, window_min_width): Move to window.el.
10546 (keys_of_window): Move bindings for delete-other-windows,
10547 split-window, delete-window and enlarge-window to window.el.
10548
10549 * buffer.c: Temporarily extern Qdelete_window.
10550 (Fbury_buffer): Temporarily call Qdelete_window instead of
10551 Fdelete_window (Fbury_buffer will move to window.el soon).
10552
10553 * frame.c (set_menu_bar_lines_1): Remove code handling
10554 orig_top_line and orig_total_lines.
10555
10556 * dispnew.c (adjust_frame_glyphs_initially): Don't use
10557 set_window_height but set heights directly.
10558 (change_frame_size_1): Use resize_frame_windows.
10559
10560 * xdisp.c (init_xdisp): Don't use set_window_height but set
10561 heights directly.
10562
10563 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
10564 Use resize_frame_windows instead of change_window_heights and run
10565 run_window_configuration_change_hook.
10566
10567 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
10568 instead of change_window_heights and run
10569 run_window_configuration_change_hook.
10570
10571 2011-06-09 Martin Rudalics <rudalics@gmx.at>
10572
10573 * window.c (replace_window): Rename second argument REPLACEMENT to
10574 NEW. New third argument SETFLAG. Rewrite.
10575 (delete_window, make_dummy_parent): Call replace_window with
10576 third argument 1.
10577 (window_list_1): Move down in code.
10578 (run_window_configuration_change_hook): Move set_buffer part
10579 before select_frame_norecord part in order to unwind correctly.
10580 Rename count1 to count.
10581 (recombine_windows, delete_deletable_window, resize_root_window)
10582 (Fdelete_other_windows_internal)
10583 (Frun_window_configuration_change_hook, make_parent_window)
10584 (resize_window_check, resize_window_apply, Fresize_window_apply)
10585 (resize_frame_windows, Fsplit_window_internal)
10586 (Fdelete_window_internal, Fresize_mini_window_internal):
10587 New functions.
10588 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
10589
10590 2011-06-08 Martin Rudalics <rudalics@gmx.at>
10591
10592 * window.h (window): Add some new members to window structure -
10593 normal_lines, normal_cols, new_total, new_normal, clone_number,
10594 splits, nest, prev_buffers, next_buffers.
10595 (WINDOW_TOTAL_SIZE): Move here from window.c.
10596 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
10597
10598 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
10599 Remove.
10600 (make_dummy_parent): Set new members of windows structure.
10601 (make_window): Move down in code. Handle new members of window
10602 structure.
10603 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
10604 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
10605 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
10606 (Fset_window_prev_buffers, Fwindow_next_buffers)
10607 (Fset_window_next_buffers, Fset_window_clone_number):
10608 New functions.
10609 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
10610 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
10611 Doc-string fixes.
10612 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
10613 Argument WINDOW can be now internal window too.
10614 (Fwindow_use_time): Move up in code.
10615 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
10616 Rewrite doc-string.
10617 (Fset_window_configuration, saved_window)
10618 (Fcurrent_window_configuration, save_window_save): Handle new
10619 members of window structure.
10620 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
10621 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
10622 (syms_of_window): New Lisp objects Qrecord_window_buffer,
10623 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
10624 Qget_mru_window, Qresize_root_window,
10625 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
10626 Qauto_buffer_name; staticpro them.
10627
10628 2011-06-07 Martin Rudalics <rudalics@gmx.at>
10629
10630 * window.c (Fwindow_total_size, Fwindow_left_column)
10631 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
10632 (Fwindow_list_1): New functions.
10633 (window_box_text_cols): Replace with window_body_cols.
10634 (Fwindow_width, Fscroll_left, Fscroll_right):
10635 Use window_body_cols instead of window_box_text_cols.
10636 (delete_window, Fset_window_configuration):
10637 Call delete_all_subwindows with window as argument.
10638 (delete_all_subwindows): Take a window as argument and not a
10639 structure. Rewrite.
10640 (window_loop): Remove handling of GET_LRU_WINDOW and
10641 GET_LARGEST_WINDOW.
10642 (Fget_lru_window, Fget_largest_window): Move to window.el.
10643
10644 * window.h: Extern window_body_cols instead of
10645 window_box_text_cols. delete_all_subwindows now takes a
10646 Lisp_Object as argument.
10647
10648 * indent.c (compute_motion, Fcompute_motion):
10649 Use window_body_cols instead of window_box_text_cols.
10650
10651 * frame.c (delete_frame): Call delete_all_subwindows with root
10652 window as argument.
10653
10654 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
10655
10656 * fns.c (Fputhash): Document return value.
10657
10658 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
10659
10660 * image.c (gif_load): Implement gif89a spec "no disposal" method.
10661
10662 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
10663
10664 Cons<->int and similar integer overflow fixes (Bug#8794).
10665
10666 Check for overflow when converting integer to cons and back.
10667 * charset.c (Fdefine_charset_internal, Fdecode_char):
10668 Use cons_to_unsigned to catch overflow.
10669 (Fencode_char): Use INTEGER_TO_CONS.
10670 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
10671 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
10672 * data.c (long_to_cons, cons_to_long): Remove.
10673 (cons_to_unsigned, cons_to_signed): New functions.
10674 These signal an error for invalid or out-of-range values.
10675 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
10676 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
10677 * font.c (Ffont_variation_glyphs):
10678 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
10679 * lisp.h: Include <intprops.h>.
10680 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
10681 (cons_to_signed, cons_to_unsigned): New decls.
10682 (long_to_cons, cons_to_long): Remove decls.
10683 * undo.c (record_first_change): Use INTEGER_TO_CONS.
10684 (Fprimitive_undo): Use CONS_TO_INTEGER.
10685 * xfns.c (Fx_window_property): Likewise.
10686 * xselect.c: Include <limits.h>.
10687 (x_own_selection, selection_data_to_lisp_data):
10688 Use INTEGER_TO_CONS.
10689 (x_handle_selection_request, x_handle_selection_clear)
10690 (x_get_foreign_selection, Fx_disown_selection_internal)
10691 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
10692 (lisp_data_to_selection_data): Use cons_to_unsigned.
10693 (x_fill_property_data): Use cons_to_signed.
10694 Report values out of range.
10695
10696 Check for buffer and string overflow more precisely.
10697 * buffer.h (BUF_BYTES_MAX): New macro.
10698 * lisp.h (STRING_BYTES_MAX): New macro.
10699 * alloc.c (Fmake_string):
10700 * character.c (string_escape_byte8):
10701 * coding.c (coding_alloc_by_realloc):
10702 * doprnt.c (doprnt):
10703 * editfns.c (Fformat):
10704 * eval.c (verror):
10705 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
10706 since they may not be the same number.
10707 * editfns.c (Finsert_char):
10708 * fileio.c (Finsert_file_contents):
10709 Likewise for BUF_BYTES_MAX.
10710
10711 * image.c: Use ptrdiff_t, not int, for sizes.
10712 (slurp_file): Switch from int to ptrdiff_t.
10713 All uses changed.
10714 (slurp_file): Check that file size fits in both size_t (for
10715 malloc) and ptrdiff_t (for sanity and safety).
10716
10717 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
10718 if b->modtime has its maximal value.
10719
10720 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
10721
10722 Don't assume time_t can fit into int.
10723 * buffer.h (struct buffer.modtime): Now time_t, not int.
10724 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
10725 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
10726
10727 Minor fixes for signed vs unsigned integers.
10728 * character.h (MAYBE_UNIFY_CHAR):
10729 * charset.c (maybe_unify_char):
10730 * keyboard.c (read_char, reorder_modifiers):
10731 XINT -> XFASTINT, since the integer must be nonnegative.
10732 * ftfont.c (ftfont_spec_pattern):
10733 * keymap.c (access_keymap, silly_event_symbol_error):
10734 XUINT -> XFASTINT, since the integer must be nonnegative.
10735 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
10736 since it makes no difference and we prefer signed.
10737 * keyboard.c (record_char): Use XUINT when all the neighbors do.
10738 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
10739 nonnegative.
10740
10741 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
10742
10743 * window.h (Fwindow_frame): Declare.
10744
10745 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
10746
10747 * alloc.c: Simplify handling of large-request failures (Bug#8800).
10748 (SPARE_MEMORY): Always define.
10749 (LARGE_REQUEST): Remove.
10750 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
10751
10752 2011-06-06 Martin Rudalics <rudalics@gmx.at>
10753
10754 * lisp.h: Move EXFUNS for Fframe_root_window,
10755 Fframe_first_window and Fset_frame_selected_window to window.h.
10756
10757 * window.h: Move EXFUNS for Fframe_root_window,
10758 Fframe_first_window and Fset_frame_selected_window here from
10759 lisp.h.
10760
10761 * frame.c (Fwindow_frame, Fframe_first_window)
10762 (Fframe_root_window, Fframe_selected_window)
10763 (Fset_frame_selected_window): Move to window.c.
10764 (Factive_minibuffer_window): Move to minibuf.c.
10765 (Fother_visible_frames_p): New function.
10766
10767 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
10768
10769 * window.c (decode_window, decode_any_window): Move up in code.
10770 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
10771 (inhibit_frame_unsplittable): Remove unused variable.
10772 (Fwindow_buffer): Move up and rewrite doc-string.
10773 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
10774 (Fwindow_prev): New functions.
10775 (Fwindow_frame): Move here from frame.c. Accept any window as
10776 argument.
10777 (Fframe_root_window, Fframe_first_window)
10778 (Fframe_selected_window): Move here from frame.c. Accept frame
10779 or arbitrary window as argument. Update doc-strings.
10780 (Fminibuffer_window): Move up in code.
10781 (Fwindow_minibuffer_p): Move up in code and simplify.
10782 (Fset_frame_selected_window): Move here from frame.c.
10783 Marginal rewrite.
10784 (Fselected_window, select_window, Fselect_window): Move up in
10785 code. Minor doc-string fixes.
10786
10787 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
10788
10789 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
10790 Do not assume that spare memory exists; that assumption is valid
10791 only if SYSTEM_MALLOC.
10792 (LARGE_REQUEST): New macro, so that the issue of large requests
10793 is separated from the issue of spare memory.
10794
10795 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
10796
10797 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
10798 format. (Bug#8806)
10799
10800 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
10801
10802 * xfns.c (x_set_scroll_bar_default_width): Move declarations
10803 before statements.
10804
10805 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
10806
10807 * gtkutil.c (xg_get_default_scrollbar_width): New function.
10808
10809 * gtkutil.h: Declare xg_get_default_scrollbar_width.
10810
10811 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
10812 min width by calling x_set_scroll_bar_default_width (Bug#8505).
10813
10814 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
10815
10816 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
10817
10818 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
10819
10820 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
10821 (x_clipboard_manager_save): Add return value.
10822 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
10823 New error handlers.
10824 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
10825 Obey Vx_select_enable_clipboard_manager. Catch errors in
10826 x_clipboard_manager_save (Bug#8779).
10827 (Vx_select_enable_clipboard_manager): New variable.
10828 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
10829
10830 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
10831
10832 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
10833
10834 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10835
10836 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
10837 in the current matrix if keep_current_p is non-zero.
10838
10839 2011-06-04 Eli Zaretskii <eliz@gnu.org>
10840
10841 * bidi.c (bidi_level_of_next_char): Fix last change.
10842
10843 2011-06-03 Eli Zaretskii <eliz@gnu.org>
10844
10845 Support bidi reordering of text covered by display properties.
10846
10847 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
10848 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
10849 (bidi_cache_search, bidi_cache_iterator_state)
10850 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
10851 (bidi_level_of_next_char, bidi_move_to_visually_next):
10852 Support character positions inside a run of characters covered by a
10853 display string.
10854 (bidi_paragraph_init, bidi_resolve_explicit_1)
10855 (bidi_level_of_next_char): Call bidi_fetch_char and
10856 bidi_fetch_char_advance instead of FETCH_CHAR and
10857 FETCH_CHAR_ADVANCE.
10858 (bidi_init_it): Initialize new members.
10859 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
10860 definitions.
10861 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
10862 instead of using explicit *_CHAR codes.
10863 (bidi_resolve_explicit, bidi_resolve_weak):
10864 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
10865 bidirectional text is supported only in multibyte buffers.
10866 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
10867 it to initialize the frame_window_p member of struct bidi_it.
10868 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
10869 (bidi_resolve_explicit, bidi_resolve_weak)
10870 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
10871 bidi_it->nchars is non-positive.
10872 (bidi_level_of_next_char): Don't try to lookup the cache for the
10873 next/previous character if nothing is cached there yet, or if we
10874 were just reseat()'ed to a new position.
10875
10876 * xdisp.c (set_cursor_from_row): Set start and stop points
10877 according to the row's direction when priming the loop that looks
10878 for the glyph on which to display cursor.
10879 (single_display_spec_intangible_p): Function deleted.
10880 (display_prop_intangible_p): Reimplement to call
10881 handle_display_spec instead of single_display_spec_intangible_p.
10882 Accept 3 additional arguments needed by handle_display_spec.
10883 This fixes incorrect cursor motion across display property with complex
10884 values: lists, `(when COND...)' forms, etc.
10885 (single_display_spec_string_p): Support property values that are
10886 lists with the argument STRING its top-level element.
10887 (display_prop_string_p): Fix the condition for processing a
10888 property that is a list to be consistent with handle_display_spec.
10889 (handle_display_spec): New function, refactored from the
10890 last portion of handle_display_prop.
10891 (compute_display_string_pos): Accept additional argument
10892 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
10893 value of a `display' property is a "replacing spec".
10894 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
10895 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
10896 the display property, but just return a value indicating whether
10897 the display property will replace the characters it covers.
10898 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
10899 frame_window_p members of struct bidi_it.
10900 (compute_display_string_pos, compute_display_string_end):
10901 New functions.
10902 (push_it): Accept second argument POSITION, where pop_it should
10903 jump to continue iteration.
10904 (reseat_1): Initialize bidi_it.disp_pos.
10905
10906 * keyboard.c (adjust_point_for_property): Adjust the call to
10907 display_prop_intangible_p to its new signature.
10908
10909 * dispextern.h (struct bidi_it): New member frame_window_p.
10910 (bidi_init_it): Update prototypes.
10911 (display_prop_intangible_p): Update prototype.
10912 (compute_display_string_pos, compute_display_string_end):
10913 Declare prototypes.
10914 (struct bidi_it): New members nchars and disp_pos. ch_len is now
10915 EMACS_INT.
10916
10917 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
10918
10919 Malloc failure behavior now depends on size of allocation.
10920 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
10921 * lisp.h: Change signatures accordingly.
10922 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
10923 All callers changed. (Bug#8762)
10924
10925 * gnutls.c: Use Emacs's memory allocators.
10926 Without this change, the gnutls library would invoke malloc etc.
10927 directly, which causes problems on non-SYNC_INPUT hosts, and which
10928 runs afoul of improving memory_full behavior. (Bug#8761)
10929 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
10930 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
10931 xfree instead of the default malloc, realloc, free.
10932 (Fgnutls_boot): No need to check for memory allocation failure,
10933 since xmalloc does that for us.
10934
10935 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
10936 * category.c (hash_get_category_set):
10937 * ccl.c (ccl_driver):
10938 * charset.c (Fdefine_charset_internal):
10939 * charset.h (struct charset.hash_index):
10940 * composite.c (get_composition_id, gstring_lookup_cache)
10941 (composition_gstring_put_cache):
10942 * composite.h (struct composition.hash_index):
10943 * dispextern.h (struct image.hash):
10944 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
10945 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
10946 (hashfn_equal, hashfn_user_defined, make_hash_table)
10947 (maybe_resize_hash_table, hash_lookup, hash_put)
10948 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
10949 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
10950 (Fsxhash, Fgethash, Fputhash, Fmaphash):
10951 * image.c (make_image, search_image_cache, lookup_image)
10952 (xpm_put_color_table_h):
10953 * lisp.h (struct Lisp_Hash_Table):
10954 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
10955 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
10956 for hashes and hash indexes, instead of 'unsigned' and 'int'.
10957 * alloc.c (allocate_vectorlike):
10958 Check for overflow in vector size calculations.
10959 * ccl.c (ccl_driver):
10960 Check for overflow when converting EMACS_INT to int.
10961 * fns.c, image.c: Remove unnecessary static decls that would otherwise
10962 need to be updated by these changes.
10963 * fns.c (make_hash_table, maybe_resize_hash_table):
10964 Check for integer overflow with large hash tables.
10965 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
10966 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
10967 (SXHASH_REDUCE): New macro.
10968 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
10969 Use it instead of discarding useful hash info with large hash values.
10970 (sxhash_float): New function.
10971 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
10972 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
10973 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
10974 Rewrite to use FIXNUM_BITS, as this simplifies things.
10975 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
10976 Adjust signatures to match updated version of code.
10977 (consing_since_gc): Now EMACS_INT, since a single hash table can
10978 use more than INT_MAX bytes.
10979
10980 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
10981
10982 Make it possible to build with GCC-4.6+ -O2 -flto.
10983
10984 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
10985
10986 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
10987
10988 * minibuf.c (get_minibuffer, read_minibuf_unwind):
10989 Call minibuffer-inactive-mode.
10990
10991 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
10992
10993 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
10994 Update dependencies.
10995
10996 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10997
10998 * data.c (init_data): Remove code for UTS, this system is not
10999 supported anymore.
11000
11001 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11002
11003 Don't force ./temacs to start in terminal mode.
11004
11005 * frame.c (make_initial_frame): Initialize faces in all cases, not
11006 only when CANNOT_DUMP is defined.
11007 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
11008
11009 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11010
11011 * dispnew.c (add_window_display_history): Use const for the string
11012 pointer. Remove declaration, not needed.
11013
11014 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
11015
11016 Use 'inline', not 'INLINE'.
11017 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
11018 * alloc.c, fontset.c (INLINE): Remove.
11019 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
11020 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
11021 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
11022 * gmalloc.c (register_heapinfo): Use inline unconditionally.
11023 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
11024
11025 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11026
11027 Make it possible to run ./temacs.
11028
11029 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
11030 syms_of_callproc does the same thing. Remove test for
11031 "initialized", do it in the caller.
11032 * emacs.c (main): Avoid calling set_initial_environment when dumping.
11033
11034 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
11035
11036 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
11037 (read_minibuf): Use get_minibuffer.
11038 (syms_of_minibuf): Use DEFSYM.
11039 (Qmetadata): New var.
11040 * data.c (Qbuffer): Don't make it static.
11041 (syms_of_data): Use DEFSYM.
11042
11043 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
11044
11045 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
11046 (CCL_CODE_MIN): New macro.
11047
11048 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
11049
11050 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
11051
11052 * eval.c (Qdebug): Now static.
11053 * lisp.h (Qdebug): Remove decl. This reverts a part of the
11054 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
11055 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
11056
11057 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
11058
11059 * image.c: Various fixes to ImageMagick code comments.
11060 (Fimagemagick_types): Doc fix.
11061
11062 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
11063
11064 Minor fixes prompted by GCC 4.6.0 warnings.
11065
11066 * xselect.c (converted_selections, conversion_fail_tag): Now static.
11067
11068 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
11069 (x_clipboard_manager_save_all): Move extern decl to ...
11070 * xterm.h: ... here, so that it can be checked for consistency.
11071
11072 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
11073
11074 * xselect.c (x_clipboard_manager_save_frame)
11075 (x_clipboard_manager_save_all): New functions.
11076 (Fx_clipboard_manager_save): Lisp function deleted.
11077
11078 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
11079 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
11080
11081 * xterm.h: Update prototype.
11082
11083 2011-05-28 William Xu <william.xwl@gmail.com>
11084
11085 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
11086 exiting (Bug#8239).
11087
11088 2011-05-28 Jim Meyering <meyering@redhat.com>
11089
11090 Avoid a sign-extension bug in crypto_hash_function.
11091 * fns.c (to_uchar): Define.
11092 (crypto_hash_function): Use it to convert some newly-signed
11093 variables to unsigned, to avoid sign-extension bugs. For example,
11094 without this change, (md5 "truc") would evaluate to
11095 45723a2aff78ff4fff7fff1114760e62 rather than the expected
11096 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
11097 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
11098
11099 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
11100
11101 Integer overflow fixes.
11102
11103 * dbusbind.c: Serial number integer overflow fixes.
11104 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
11105 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
11106 to hold a serial number that is too large for a fixnum.
11107 (Fdbus_method_return_internal, Fdbus_method_error_internal):
11108 Check for serial numbers out of range. Decode any serial number
11109 that was so large that it became a float. (Bug#8722)
11110
11111 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
11112 (Fdbus_call_method, Fdbus_call_method_asynchronously):
11113 Use XFASTINT rather than XUINT when numbers are nonnegative.
11114 (xd_append_arg, Fdbus_method_return_internal):
11115 (Fdbus_method_error_internal): Likewise. Also, for unsigned
11116 arguments, check that Lisp number is nonnegative, rather than
11117 silently wrapping negative numbers around. (Bug#8722)
11118 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
11119 (Bug#8722)
11120
11121 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
11122
11123 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
11124
11125 ccl: Add integer overflow checks.
11126 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
11127 (IN_INT_RANGE): New macros.
11128 (ccl_driver): Use them to check for integer overflow when
11129 decoding a CCL program. Many of the new checks are whether XINT (x)
11130 fits in int; it doesn't always, on 64-bit hosts. The new version
11131 doesn't catch all possible integer overflows, but it's an
11132 improvement. (Bug#8719)
11133
11134 * alloc.c (make_event_array): Use XINT, not XUINT.
11135 There's no need for unsigned here.
11136
11137 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
11138 This follows up to the 2011-05-06 change that substituted uintptr_t
11139 for EMACS_INT. This case wasn't caught back then.
11140
11141 Rework Fformat to avoid integer overflow issues.
11142 * editfns.c: Include <float.h> unconditionally, as it's everywhere
11143 now (part of C89). Include <verify.h>.
11144 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
11145 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
11146 (Fformat): Avoid the prepass trying to compute sizes; it was only
11147 approximate and thus did not catch overflow reliably. Instead, walk
11148 through the format just once, formatting and computing sizes as we go,
11149 checking for integer overflow at every step, and allocating a larger
11150 buffer as needed. Keep track separately whether the format is
11151 multibyte. Keep only the most-recently calculated precision, rather
11152 than them all. Record whether each argument has been converted to
11153 string. Use EMACS_INT, not int, for byte and char and arg counts.
11154 Support field widths and precisions larger than INT_MAX. Avoid
11155 sprintf's undefined behavior with conversion specifications such as %#d
11156 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
11157 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
11158 formatting out-of-range floating point numbers with int
11159 formats. (Bug#8668)
11160
11161 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
11162
11163 * data.c: Avoid integer truncation in expressions involving floats.
11164 * data.c: Include <intprops.h>.
11165 (arith_driver): When there's an integer overflow in an expression
11166 involving floating point, convert the integers to floating point
11167 so that the resulting value does not suffer from catastrophic
11168 integer truncation. For example, on a 64-bit host (* 4
11169 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
11170 Do not rely on undefined behavior after integer overflow.
11171
11172 merge count_size_as_multibyte, parse_str_to_multibyte
11173 * character.c, character.h (count_size_as_multibyte):
11174 Rename from parse_str_to_multibyte; all uses changed.
11175 Check for integer overflow.
11176 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
11177 since it's now a duplicate of the other. This is more of
11178 a character than a buffer op, so better that it's in character.c.
11179 * fns.c, print.c: Adjust to above changes.
11180
11181 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
11182
11183 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
11184
11185 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
11186
11187 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
11188 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
11189 (x_clipboard_manager_save): Now static.
11190 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
11191
11192 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
11193 (crypto_hash_function): Now static.
11194 Fix pointer signedness problems. Avoid unnecessary initializations.
11195
11196 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
11197
11198 * termhooks.h (Vselection_alist): Make it terminal-local.
11199
11200 * terminal.c (create_terminal): Initialize it.
11201
11202 * xselect.c: Support for clipboard managers.
11203 (Vselection_alist): Move to termhooks.h as terminal-local var.
11204 (LOCAL_SELECTION): New macro.
11205 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
11206 (symbol_to_x_atom): Remove gratuitous arg.
11207 (x_handle_selection_request, lisp_data_to_selection_data)
11208 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
11209 (x_own_selection, x_get_local_selection, x_convert_selection):
11210 New arg, specifying work frame. Use terminal-local Vselection_alist.
11211 (some_frame_on_display): Delete unused function.
11212 (Fx_own_selection_internal, Fx_get_selection_internal)
11213 (Fx_disown_selection_internal, Fx_selection_owner_p)
11214 (Fx_selection_exists_p): New optional frame arg.
11215 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
11216 (x_handle_selection_clear): Don't treat other terminals with the
11217 same keyboard specially. Use the terminal-local Vselection_alist.
11218 (x_clear_frame_selections): Use Frun_hook_with_args.
11219
11220 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
11221
11222 * xterm.h: Add support for those atoms.
11223
11224 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
11225
11226 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
11227 (converted_selections, conversion_fail_tag): New global variables.
11228 (x_selection_request_lisp_error): Free the above.
11229 (x_get_local_selection): Remove unnecessary code.
11230 (x_reply_selection_request): Args changed; handle arbitrary array
11231 of converted selections stored in converted_selections.
11232 Separate the XChangeProperty and SelectionNotify steps.
11233 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
11234 (x_convert_selection): New function.
11235 (x_handle_selection_event): Simplify.
11236 (x_get_foreign_selection): Don't ignore incoming requests while
11237 waiting for an answer; this will fail when we implement
11238 SAVE_TARGETS, and seems unnecessary anyway.
11239 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
11240 (Vx_sent_selection_functions): Doc fix.
11241
11242 2011-05-26 Leo Liu <sdl.web@gmail.com>
11243
11244 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
11245
11246 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11247
11248 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
11249
11250 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
11251 for fringe update if it has periodic bitmap.
11252 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
11253 and fringe_bitmap_periodic_p.
11254
11255 * fringe.c (get_fringe_bitmap_data): New function.
11256 (draw_fringe_bitmap_1, update_window_fringes): Use it.
11257 (update_window_fringes): Record periodicity of fringe bitmap in glyph
11258 row. Mark glyph row for fringe update if periodicity changed.
11259
11260 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
11261 for fringe update unless it has periodic bitmap.
11262
11263 2011-05-25 Kenichi Handa <handa@m17n.org>
11264
11265 * xdisp.c (get_next_display_element): Set correct it->face_id for
11266 a static composition.
11267
11268 2011-05-24 Leo Liu <sdl.web@gmail.com>
11269
11270 * deps.mk (fns.o):
11271 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
11272
11273 * fns.c (crypto_hash_function, Fsha1): New function.
11274 (Fmd5): Use crypto_hash_function.
11275 (syms_of_fns): Add Ssha1.
11276
11277 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
11278
11279 * gnutls.c: Remove unused macros.
11280 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
11281 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
11282 Remove macros that are defined and never used.
11283 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
11284
11285 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
11286
11287 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
11288 (Fx_get_selection_internal): Minor cleanup.
11289 (Fx_own_selection_internal): Rename arguments for consistency with
11290 select.el.
11291
11292 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
11293
11294 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
11295
11296 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
11297
11298 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
11299
11300 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11301
11302 * dispnew.c (scrolling_window): Don't exclude the case that the
11303 last enabled row in the desired matrix touches the bottom boundary.
11304
11305 2011-05-21 Glenn Morris <rgm@gnu.org>
11306
11307 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
11308 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
11309 and add some more files.
11310
11311 2011-05-20 Eli Zaretskii <eliz@gnu.org>
11312
11313 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
11314 report_file_error introduced by the change from 2011-05-07.
11315
11316 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
11317
11318 * systime.h (Time): Define only if emacs is defined.
11319 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
11320 where the include path doesn't have X11/X.h by default. See
11321 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
11322
11323 2011-05-20 Kenichi Handa <handa@m17n.org>
11324
11325 * composite.c (find_automatic_composition): Fix previous change.
11326
11327 2011-05-20 Glenn Morris <rgm@gnu.org>
11328
11329 * lisp.mk: New file, split from Makefile.in.
11330 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
11331 (shortlisp): Remove.
11332 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
11333
11334 2011-05-19 Glenn Morris <rgm@gnu.org>
11335
11336 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
11337 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
11338 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
11339 (lisp): Set the order to that of loadup.el.
11340 (shortlisp): Make it a copy of $lisp.
11341 (SOME_MACHINE_LISP): Remove.
11342 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
11343 Use just $shortlisp, not $SOME_MACHINE_LISP too.
11344
11345 2011-05-18 Kenichi Handa <handa@m17n.org>
11346
11347 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
11348 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
11349 (find_automatic_composition): Mostly rewrite for efficiency.
11350
11351 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
11352
11353 * makefile.w32-in: Update dependencies.
11354
11355 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
11356
11357 * menu.c: Include limits.h (fixes the MS-Windows build broken by
11358 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
11359
11360 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
11361
11362 Fix some integer overflow issues, such as string length overflow.
11363
11364 * insdel.c (count_size_as_multibyte): Check for string overflow.
11365
11366 * character.c (lisp_string_width): Check for string overflow.
11367 Use EMACS_INT, not int, for string indexes and lengths; in
11368 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
11369 the resulting string length overflows an EMACS_INT; instead,
11370 report a string overflow if no precision given. When checking for
11371 precision exhaustion, use a check that cannot possibly have
11372 integer overflow. (Bug#8675)
11373 * character.h (lisp_string_width): Adjust to new signature.
11374
11375 * alloc.c (string_overflow): New function.
11376 (Fmake_string): Use it. This doesn't change behavior, but saves
11377 a few bytes and will simplify future changes.
11378 * character.c (string_escape_byte8): Likewise.
11379 * lisp.h (string_overflow): New decl.
11380
11381 Fixups, following up to the user-interface timestamp change.
11382 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
11383 for UI timestamps, instead of unsigned long.
11384 * msdos.c (mouse_get_pos): Likewise.
11385 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
11386 * w32gui.h (Time): Define by including "systime.h" rather than by
11387 declaring it ourselves. (Bug#8664)
11388
11389 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
11390 * image.c (clear_image_cache): Likewise.
11391
11392 * term.c (term_mouse_position): Don't assume time_t wraparound.
11393
11394 Be more systematic about user-interface timestamps.
11395 Before, the code sometimes used 'Time', sometimes 'unsigned long',
11396 and sometimes 'EMACS_UINT', to represent these timestamps.
11397 This change causes it to use 'Time' uniformly, as that's what X uses.
11398 This makes the code easier to follow, and makes it easier to catch
11399 integer overflow bugs such as Bug#8664.
11400 * frame.c (Fmouse_position, Fmouse_pixel_position):
11401 Use Time, not unsigned long, for user-interface timestamps.
11402 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
11403 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
11404 * keyboard.h (last_event_timestamp): Likewise.
11405 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
11406 * menu.h (xmenu_show): Likewise.
11407 * term.c (term_mouse_position): Likewise.
11408 * termhooks.h (struct input_event.timestamp): Likewise.
11409 (struct terminal.mouse_position_hook): Likewise.
11410 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
11411 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
11412 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
11413 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
11414 what it was before.
11415 * menu.h, termhooks.h: Include "systime.h", for Time.
11416
11417 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
11418 Don't assume that the difference between two unsigned long values
11419 can fit into an integer. At this point, we know button_down_time
11420 <= event->timestamp, so the difference must be nonnegative, so
11421 there's no need to cast the result if double-click-time is
11422 nonnegative, as it should be; check that it's nonnegative, just in
11423 case. This bug is triggered when events are more than 2**31 ms
11424 apart (about 25 days). (Bug#8664)
11425
11426 * xselect.c (last_event_timestamp): Remove duplicate decl.
11427 (x_own_selection): Remove needless cast to unsigned long.
11428
11429 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
11430 that always fit in int. Use a sentinel instead of a counter, to
11431 avoid a temp and to allay GCC's concerns about possible int overflow.
11432 * frame.h (struct frame): Use int for menu_bar_items_used
11433 instead of EMACS_INT, since it always fits in int.
11434
11435 * menu.c (grow_menu_items): Check for int overflow.
11436
11437 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
11438
11439 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
11440 Before, the code was not consistent. These values cannot exceed
11441 2**31 - 1 so there's no need to make them unsigned.
11442 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
11443 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
11444 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
11445 as modifiers.
11446 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
11447
11448 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
11449 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
11450 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
11451 presumably because the widths might not match.
11452
11453 * window.c (size_window): Avoid needless test at loop start.
11454
11455 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
11456
11457 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
11458
11459 2011-05-12 Drew Adams <drew.adams@oracle.com>
11460
11461 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
11462
11463 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11464
11465 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
11466 `width' to `bar_area_x' and `bar_area_width', respectively.
11467 (x_scroll_run): Take account of fringe background extension.
11468
11469 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
11470 Rename local vars `left' and `width' to `bar_area_x' and
11471 `bar_area_width', respectively.
11472 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
11473 background extension.
11474
11475 2011-05-10 Jim Meyering <meyering@redhat.com>
11476
11477 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
11478
11479 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
11480
11481 * image.c (Finit_image_library): Return t for built-in image types,
11482 like pbm and xbm. (Bug#8640)
11483
11484 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
11485
11486 * w32menu.c (set_frame_menubar): Fix submenu allocation.
11487
11488 2011-05-07 Eli Zaretskii <eliz@gnu.org>
11489
11490 * w32console.c (Fset_screen_color): Doc fix.
11491 (Fget_screen_color): New function.
11492 (syms_of_ntterm): Defsubr it.
11493
11494 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
11495 unlink the temporary file if Fcall_process didn't create it in the
11496 first place.
11497 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
11498 child process will be redirected to a file specified with `:file'.
11499 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
11500 cue to call_process_cleanup not to close that handle.
11501
11502 2011-05-07 Ben Key <bkey76@gmail.com>
11503
11504 * makefile.w32-in: The bootstrap-temacs rule now makes use of
11505 one of two shell specific rules, either bootstrap-temacs-CMD or
11506 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
11507 to the previous implementation of the bootstrap-temacs rule.
11508 The bootstrap-temacs-CMD rule is similar to the previous
11509 implementation of the bootstrap-temacs rule except that it
11510 makes use of the ESC_CFLAGS variable instead of the CFLAGS
11511 variable.
11512
11513 These changes, along with some changes to nt/configure.bat,
11514 nt/gmake.defs, and nt/nmake.defs, are required to extend my
11515 earlier fix to add support for --cflags and --ldflags options
11516 that include quotes so that it works whether make uses cmd or
11517 sh as the shell.
11518
11519 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
11520
11521 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
11522 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
11523 is a constant.
11524 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
11525 a string. Handle both cases.
11526 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
11527 (Fdbus_register_method): Use Qinvalid_function.
11528
11529 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
11530
11531 * makefile.w32-in: Update dependencies.
11532 (LISP_H): Add inttypes.h and stdin.h.
11533 (PROCESS_H): Add unistd.h.
11534
11535 2011-05-06 Eli Zaretskii <eliz@gnu.org>
11536
11537 * lread.c: Include limits.h (fixes the MS-Windows build broken by
11538 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
11539
11540 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
11541
11542 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
11543
11544 * term.c (vfatal): Remove stray call to va_end.
11545 It's not needed and the C Standard doesn't allow it here anyway.
11546
11547 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
11548 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
11549
11550 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
11551 bytes.
11552
11553 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
11554
11555 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11556
11557 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
11558
11559 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
11560
11561 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
11562
11563 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
11564 * charset.c (Fdefine_charset_internal): Don't initialize
11565 charset.code_space[15]. The value was garbage, on hosts with
11566 32-bit int (Bug#8600).
11567
11568 * lread.c (read_integer): Be more consistent with string-to-number.
11569 Use string_to_number to do the actual conversion; this avoids
11570 rounding errors and fixes some other screwups. Without this fix,
11571 for example, #x1fffffffffffffff was misread as -2305843009213693952.
11572 (digit_to_number): Move earlier, for benefit of read_integer.
11573 Return -1 if the digit is out of range for the base, -2 if it is
11574 not a digit in any supported base. (Bug#8602)
11575
11576 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
11577
11578 * dispnew.c (scrolling_window): Return 1 if we scrolled,
11579 to match comment at start of function. This also removes a
11580 GCC warning about overflow in a 32+64-bit port.
11581
11582 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
11583
11584 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
11585 Reported by Stefan Monnier in
11586 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
11587 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
11588 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
11589
11590 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
11591 (EMACS_UINTPTR): Likewise, with uintptr_t.
11592
11593 * lisp.h: Prefer 64-bit EMACS_INT if available.
11594 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
11595 on 32-bit hosts that have 64-bit int, so that they can access
11596 large files.
11597 However, temporarily disable this change unless the temporary
11598 symbol WIDE_EMACS_INT is defined.
11599
11600 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
11601
11602 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
11603 This removes an assumption that EMACS_INT and long are the same
11604 width as pointers. The assumption is true for Emacs porting targets
11605 now, but we want to make other targets possible.
11606 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
11607 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
11608 In the rest of the code, change types of integers that hold casted
11609 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
11610 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
11611 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
11612 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
11613 No need to cast type when ORing.
11614 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
11615 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
11616 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
11617 assume EMACS_INT is the same width as char *.
11618 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
11619 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
11620 Remove no-longer-needed casts.
11621 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
11622 (xg_tool_bar_help_callback, xg_make_tool_item):
11623 Use EMACS_INTPTR to hold an integer
11624 that will be cast to void *; this can avoid a GCC warning
11625 if EMACS_INT is not the same width as void *.
11626 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
11627 * xdisp.c (display_echo_area_1, resize_mini_window_1):
11628 (current_message_1, set_message_1):
11629 Use a local to convert to proper width without a cast.
11630 * xmenu.c (dialog_selection_callback): Likewise.
11631
11632 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
11633 Also, don't assume VALBITS / RAND_BITS is less than 5,
11634 and don't rely on undefined behavior when shifting a 1 left into
11635 the sign bit.
11636 * lisp.h (get_random): Change signature to match.
11637
11638 * lread.c (hash_string): Use size_t, not int, for hash computation.
11639 Normally we prefer signed values; but hashing is special, because
11640 it's better to use unsigned division on hash table sizes so that
11641 the remainder is nonnegative. Also, size_t is the natural width
11642 for hashing into memory. The previous code used 'int', which doesn't
11643 retain enough info to hash well into very large tables.
11644 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
11645
11646 * dbusbind.c: Don't possibly lose pointer info when converting.
11647 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
11648 Use XPNTR rather than XHASH, so that the high-order bits of
11649 the pointer aren't lost when converting through void *.
11650
11651 * eval.c (Fautoload): Don't double-shift a pointer.
11652
11653 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
11654
11655 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
11656
11657 * gnutls.c (DEF_GNUTLS_FN):
11658 * image.c (DEF_IMGLIB_FN): Make function pointers static.
11659
11660 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
11661
11662 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
11663 marker. (Bug#8610)
11664
11665 2011-05-05 Eli Zaretskii <eliz@gnu.org>
11666
11667 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
11668 New version that can reserve upto 2GB of heap space.
11669
11670 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
11671
11672 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
11673
11674 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
11675
11676 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
11677 `gnutls_certificate_set_x509_key_file'.
11678
11679 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
11680
11681 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
11682 Update dependencies.
11683
11684 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
11685
11686 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
11687 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
11688 Remove unused parameter `fildes'.
11689 * process.c (read_process_output, send_process): Don't pass it.
11690
11691 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
11692
11693 Fix previous change: the library cache is defined in w32.c.
11694 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
11695 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
11696
11697 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
11698
11699 Implement dynamic loading of GnuTLS on Windows.
11700
11701 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
11702 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
11703 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
11704 Declare.
11705
11706 * gnutls.c (Qgnutls_dll): Define.
11707 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
11708 (gnutls_*): Declare function pointers.
11709 (init_gnutls_functions): New function to initialize function pointers.
11710 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
11711 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
11712 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
11713 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
11714 (emacs_gnutls_write, emacs_gnutls_read)
11715 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
11716 (Fgnutls_available_p): New function.
11717 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
11718 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
11719 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
11720
11721 * image.c: Include w32.h.
11722 (Vimage_type_cache): Delete.
11723 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
11724 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
11725 (w32_delayed_load): Move to w32.c.
11726
11727 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
11728
11729 * w32.c (QCloaded_from, Vlibrary_cache): Define.
11730 (w32_delayed_load): Move from image.c. When loading a library, record
11731 its filename in the :loaded-from property of the library id.
11732 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
11733 Initialize and staticpro them.
11734 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
11735
11736 * process.c: Include lisp.h before w32.h, not after.
11737 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
11738 instead of gnutls_record_check_pending.
11739
11740 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
11741
11742 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
11743
11744 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
11745 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
11746 as passed in.
11747
11748 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
11749
11750 * xterm.c (x_set_frame_alpha): Do not set property on anything
11751 else than FRAME_X_OUTER_WINDOW (Bug#8608).
11752
11753 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
11754
11755 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
11756
11757 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
11758
11759 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
11760 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
11761 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
11762 (gnutls_global_initialized, Qgnutls_bootprop_priority)
11763 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
11764 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
11765 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
11766 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
11767 (Qgnutls_bootprop_callbacks_verify): Make static.
11768
11769 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
11770
11771 * callproc.c: Indentation fixup.
11772
11773 * sysdep.c (wait_for_termination_1): Make static.
11774 (wait_for_termination, interruptible_wait_for_termination):
11775 Move after wait_for_termination_1.
11776
11777 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
11778
11779 * sysdep.c (interruptible_wait_for_termination): New function
11780 which is like wait_for_termination, but allows keyboard
11781 interruptions.
11782
11783 * callproc.c (Fcall_process): Add (:file "file") as an option for
11784 the STDOUT buffer.
11785 (Fcall_process_region): Ditto.
11786
11787 2011-04-30 Eli Zaretskii <eliz@gnu.org>
11788
11789 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
11790 rather than `XVECTOR (FOO)->size'.
11791
11792 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
11793 inttypes.h, as a gnulib replacement is used if it not available in
11794 system headers.
11795
11796 2011-04-21 Eli Zaretskii <eliz@gnu.org>
11797
11798 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
11799 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
11800 of MOST_POSITIVE_FIXNUM. (Bug#8528)
11801
11802 * coding.c (coding_alloc_by_realloc): Error out if destination
11803 will grow beyond MOST_POSITIVE_FIXNUM.
11804 (decode_coding_emacs_mule): Abort if there isn't enough place in
11805 charbuf for the composition carryover bytes. Reserve an extra
11806 space for up to 2 characters produced in a loop.
11807 (decode_coding_iso_2022): Abort if there isn't enough place in
11808 charbuf for the composition carryover bytes.
11809
11810 2011-04-21 Eli Zaretskii <eliz@gnu.org>
11811
11812 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
11813 aborting when %lld or %lll format is passed.
11814 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
11815 %llo or %llx format is passed. (Bug#8545)
11816
11817 * window.c (window_scroll_line_based): Use a marker instead of
11818 simple variables to record original value of point. (Bug#7952)
11819
11820 * doprnt.c (doprnt): Fix the case where a multibyte sequence
11821 produced by %s or %c overflows available buffer space. (Bug#8545)
11822
11823 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
11824
11825 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
11826 (SIZE_MAX): Move defn after all includes, as they might #define it.
11827
11828 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
11829
11830 * w32.c (init_environment): Warn about defaulting HOME to C:\.
11831
11832 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
11833
11834 * keyboard.c (Qdelayed_warnings_hook): Define.
11835 (command_loop_1): Run `delayed-warnings-hook'
11836 if Vdelayed_warnings_list is non-nil.
11837 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
11838 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
11839
11840 2011-04-28 Eli Zaretskii <eliz@gnu.org>
11841
11842 * doprnt.c (doprnt): Don't return value smaller than the buffer
11843 size if the message was truncated. (Bug#8545).
11844
11845 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
11846
11847 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
11848 (Fx_window_property): #if-0 the whole functions, not just the bodies.
11849
11850 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
11851
11852 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
11853
11854 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
11855
11856 * makefile.w32-in: Update dependencies.
11857
11858 2011-04-27 Eli Zaretskii <eliz@gnu.org>
11859
11860 Improve `doprnt' and its usage. (Bug#8545)
11861 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
11862 `format_end'. Remove support for %l as a conversion specifier.
11863 Don't use xrealloc. Improve diagnostics when the %l size modifier
11864 is used. Update the commentary.
11865
11866 * eval.c (verror): Simplify calculation of size_t.
11867
11868 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
11869 messages.
11870
11871 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
11872
11873 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
11874 change.
11875
11876 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
11877
11878 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
11879 This makes this file independent of the recent pseudovector change.
11880
11881 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
11882
11883 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
11884
11885 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
11886 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
11887 Remove unused local.
11888 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
11889
11890 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
11891 GCC 4.6.0 optimizes based on type-based alias analysis.
11892 For example, if b is of type struct buffer * and v of type struct
11893 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
11894 != &v->size, and therefore "v->size = 1; b->size = 2; return
11895 v->size;" must therefore return 1. This assumption is incorrect
11896 for Emacs, since it type-puns struct Lisp_Vector * with many other
11897 types. To fix this problem, this patch adds a new type struct
11898 vectorlike_header that documents the constraints on layout of vectors
11899 and pseudovectors, and helps optimizing compilers not get fooled
11900 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
11901 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
11902 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
11903 the size member.
11904 (XSETPVECTYPE): Rewrite in terms of new macro.
11905 (XSETPVECTYPESIZE): New macro, specifying both type and size.
11906 This is a bit clearer, and further avoids the possibility of
11907 undesirable aliasing.
11908 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
11909 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
11910 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
11911 since Lisp_Subr is a special case (no "next" field).
11912 (ASIZE): Now uses header.size rather than size.
11913 All previous uses of XVECTOR (foo)->size replaced to use this macro,
11914 to avoid the hassle of writing XVECTOR (foo)->header.size.
11915 (struct vectorlike_header): New type.
11916 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
11917 object, to help avoid aliasing.
11918 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
11919 (SUBRP): Likewise, since Lisp_Subr is a special case.
11920 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
11921 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
11922 (struct Lisp_Hash_Table): Combine first two members into a single
11923 struct vectorlike_header member. All uses of "size" and "next" members
11924 changed to be "header.size" and "header.next".
11925 * buffer.h (struct buffer): Likewise.
11926 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
11927 * frame.h (struct frame): Likewise.
11928 * process.h (struct Lisp_Process): Likewise.
11929 * termhooks.h (struct terminal): Likewise.
11930 * window.c (struct save_window_data, struct saved_window): Likewise.
11931 * window.h (struct window): Likewise.
11932 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
11933 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
11934 * buffer.c (init_buffer_once): Likewise.
11935 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
11936 special case.
11937 * process.c (Fformat_network_address): Use local var for size,
11938 for brevity.
11939
11940 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
11941
11942 Make the Lisp reader and string-to-float more consistent (Bug#8525)
11943 * data.c (atof): Remove decl; no longer used or needed.
11944 (digit_to_number): Move to lread.c.
11945 (Fstring_to_number): Use new string_to_number function, to be
11946 consistent with how the Lisp reader treats infinities and NaNs.
11947 Do not assume that floating-point numbers represent EMACS_INT
11948 without losing information; this is not true on most 64-bit hosts.
11949 Avoid double-rounding errors, by insisting on integers when
11950 parsing non-base-10 numbers, as the documentation specifies.
11951 * lisp.h (string_to_number): New decl, replacing ...
11952 (isfloat_string): Remove.
11953 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
11954 (read1): Do not accept +. and -. as integers; this
11955 appears to have been a coding error. Similarly, do not accept
11956 strings like +-1e0 as floating point numbers. Do not report
11957 overflow for integer overflows unless the base is not 10 which
11958 means we have no simple and reliable way to continue.
11959 Break out the floating-point parsing into a new
11960 function string_to_number, so that Fstring_to_number parses
11961 floating point numbers consistently with the Lisp reader.
11962 (digit_to_number): Move here from data.c. Make it static inline.
11963 (E_CHAR, EXP_INT): Remove, replacing with ...
11964 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
11965 (string_to_number): New function, replacing isfloat_string.
11966 This function checks for valid syntax and produces the resulting
11967 Lisp float number too. Rework it so that string-to-number
11968 no longer mishandles examples like "1.0e+". Use strtoumax,
11969 so that overflow for non-base-10 numbers is reported only when
11970 there's no portable and simple way to convert to floating point.
11971
11972 * textprop.c (set_text_properties_1): Rewrite for clarity,
11973 and to avoid GCC warning about integer overflow.
11974
11975 * intervals.h (struct interval): Use EMACS_INT for members
11976 where EMACS_UINT might cause problems. See
11977 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
11978 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
11979 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
11980 All uses changed.
11981 (offset_intervals): Tell GCC not to worry about length overflow
11982 when negating a negative length.
11983
11984 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
11985 (overrun_check_free): Likewise.
11986
11987 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
11988 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
11989 word size.
11990
11991 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
11992 (gnutls_make_error): Rename local to avoid shadowing.
11993 (gnutls_emacs_global_deinit): ifdef out; not used.
11994 (Fgnutls_boot): Use const for pointer to readonly storage.
11995 Comment out unused local. Fix pointer signedness problems.
11996
11997 * lread.c (openp): Don't stuff size_t into an 'int'.
11998 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
11999 about possible signed overflow.
12000
12001 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
12002 (GDK_KEY_g): Don't define if already defined.
12003 (xg_prepare_tooltip): Avoid pointer signedness problem.
12004 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
12005
12006 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
12007 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
12008
12009 * xfns.c (Fx_window_property): Simplify a bit,
12010 to make a bit faster and to avoid GCC 4.6.0 warning.
12011 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
12012
12013 * fns.c (internal_equal): Don't assume size_t fits in int.
12014
12015 * alloc.c (compact_small_strings): Tighten assertion a little.
12016
12017 Replace pEd with more-general pI, and fix some printf arg casts.
12018 * lisp.h (pI): New macro, generalizing old pEd macro to other
12019 conversion specifiers. For example, use "...%"pI"d..." rather
12020 than "...%"pEd"...".
12021 (pEd): Remove. All uses replaced with similar uses of pI.
12022 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
12023 * alloc.c (check_pure_size): Don't overflow by converting size to int.
12024 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
12025 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
12026 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
12027 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
12028 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
12029 64-bit hosts.
12030 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
12031 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
12032 * print.c (safe_debug_print, print_object): Likewise.
12033 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
12034 to int.
12035 Use pI instead of if-then-else-abort. Use %p to avoid casts,
12036 avoiding the 0 flag, which is not portable.
12037 * process.c (Fmake_network_process): Use pI to avoid cast.
12038 * region-cache.c (pp_cache): Likewise.
12039 * xdisp.c (decode_mode_spec): Likewise.
12040 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
12041 behavior on 64-bit hosts with printf arg.
12042 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
12043 (x_stop_queuing_selection_requests): Likewise.
12044 (x_get_window_property): Don't truncate byte count to an 'int'
12045 when tracing.
12046
12047 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
12048 here, since it parses constructs like leading '-' and spaces,
12049 which are not wanted; and it overflows with large numbers.
12050 Instead, simply match F[0-9]+, which is what is wanted anyway.
12051
12052 * alloc.c: Remove unportable assumptions about struct layout.
12053 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
12054 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
12055 (allocate_vectorlike, make_pure_vector): Use the new macros,
12056 plus offsetof, to remove unportable assumptions about struct layout.
12057 These assumptions hold on all porting targets that I know of, but
12058 they are not guaranteed, they're easy to remove, and removing them
12059 makes further changes easier.
12060
12061 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
12062 This doesn't fix a bug but makes the code clearer.
12063 (string_overrun_cookie): Now const. Use initializers that
12064 don't formally overflow signed char, to avoid warnings.
12065 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
12066 can cause Emacs to crash when string overrun checking is enabled.
12067 (allocate_buffer): Don't assume sizeof (struct buffer) is a
12068 multiple of sizeof (EMACS_INT); it need not be, if
12069 alignof(EMACS_INT) < sizeof (EMACS_INT).
12070 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
12071
12072 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
12073
12074 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
12075
12076 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
12077
12078 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
12079 supposed to be handshaking. (Bug#8556)
12080 Reported by Paul Eggert <eggert@cs.ucla.edu>.
12081
12082 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
12083
12084 * lisp.h (Qdebug): List symbol.
12085 * eval.c (Qdebug): Restore global linkage.
12086 * keyboard.c (debug-on-event): New variable.
12087 (handle_user_signal): Break into debugger when debug-on-event
12088 matches the current signal symbol.
12089
12090 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
12091
12092 * alloc.c (check_sblock, check_string_bytes)
12093 (check_string_free_list): Convert to standard C.
12094
12095 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
12096
12097 * w32.c (emacs_gnutls_push): Fix typo.
12098
12099 2011-04-25 Eli Zaretskii <eliz@gnu.org>
12100
12101 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
12102 "cast to pointer from integer of different size".
12103
12104 Improve doprnt and its use in verror. (Bug#8545)
12105 * doprnt.c (doprnt): Document the set of format control sequences
12106 supported by the function. Use SAFE_ALLOCA instead of always
12107 using `alloca'.
12108
12109 * eval.c (verror): Don't limit the buffer size at size_max-1, that
12110 is one byte too soon. Don't use xrealloc; instead xfree and
12111 xmalloc anew.
12112
12113 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
12114
12115 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
12116 callbacks stage.
12117
12118 * gnutls.c: Renamed global_initialized to
12119 gnutls_global_initialized. Added internals for the
12120 :verify-hostname-error, :verify-error, and :verify-flags
12121 parameters of `gnutls-boot' and documented those parameters in the
12122 docstring. Start callback support.
12123 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
12124 unless a fatal error occurred. Call gnutls_alert_send_appropriate
12125 on error. Return error code.
12126 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
12127 (emacs_gnutls_read): Likewise.
12128 (Fgnutls_boot): Return handshake error code.
12129 (emacs_gnutls_handle_error): New function.
12130 (wsaerror_to_errno): Likewise.
12131
12132 * w32.h (emacs_gnutls_pull): Add prototype.
12133 (emacs_gnutls_push): Likewise.
12134
12135 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
12136 (emacs_gnutls_push): Likewise.
12137
12138 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
12139
12140 * process.c (wait_reading_process_output): Check if GnuTLS
12141 buffered some data internally if no FDs are set for TLS
12142 connections.
12143
12144 * makefile.w32-in (OBJ2): Add gnutls.$(O).
12145 (LIBS): Link to USER_LIBS.
12146 ($(BLD)/gnutls.$(0)): New target.
12147
12148 2011-04-24 Eli Zaretskii <eliz@gnu.org>
12149
12150 * xdisp.c (handle_single_display_spec): Rename the
12151 display_replaced_before_p argument into display_replaced_p, to
12152 make it consistent with the commentary. Fix typos in the
12153 commentary.
12154
12155 * textprop.c (syms_of_textprop): Remove dead code.
12156 (copy_text_properties): Delete obsolete commentary about an
12157 interface that was deleted long ago. Fix typos in the description
12158 of arguments.
12159
12160 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
12161 to changes in oldXMenu/XMenu.h from 2011-04-16.
12162 <menu_help_message, prev_menu_help_message>: Constify.
12163 (IT_menu_make_room): menu->help_text is now `const char **';
12164 adjust.
12165
12166 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
12167 to changes in oldXMenu/XMenu.h from 2011-04-16.
12168 (struct XMenu): Declare `help_text' `const char **'.
12169
12170 * xfaces.c <Qunspecified>: Make extern again.
12171
12172 * syntax.c: Include sys/types.h before including regex.h, as
12173 required by POSIX.
12174
12175 * doc.c (get_doc_string): Improve the format passed to `error'.
12176
12177 * doprnt.c (doprnt): Improve commentary.
12178
12179 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
12180
12181 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
12182 them with etags.
12183
12184 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
12185 changes in globals.h immediately force recompilation.
12186 (TAGS): Depend on $(CURDIR)/m/intel386.h and
12187 $(CURDIR)/s/ms-w32.h.
12188 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
12189
12190 * character.c (Fchar_direction): Function deleted.
12191 (syms_of_character): Don't defsubr it.
12192 <char-direction-table>: Deleted.
12193
12194 2011-04-23 Eli Zaretskii <eliz@gnu.org>
12195
12196 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
12197 * doprnt.c: Include limits.h.
12198 (SIZE_MAX): New macro.
12199 (doprnt): Return a size_t value. 2nd arg is now size_t.
12200 Many local variables are now size_t instead of int or unsigned.
12201 Improve overflow protection. Support `l' modifier for integer
12202 conversions. Support %l conversion. Don't assume an EMACS_INT
12203 argument for integer conversions and for %c.
12204
12205 * lisp.h (doprnt): Restore prototype.
12206
12207 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
12208 $(SRC)/character.h.
12209
12210 * Makefile.in (base_obj): Add back doprnt.o.
12211
12212 * deps.mk (doprnt.o): Add back prerequisites.
12213 (callint.o): Depend on character.h.
12214
12215 * eval.c (internal_lisp_condition_case): Include the handler
12216 representation in the error message.
12217 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
12218 when breaking from the loop.
12219
12220 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
12221
12222 * callint.c (Fcall_interactively): When displaying error message
12223 about invalid control letter, pass the character's codepoint, not
12224 a pointer to its multibyte form. Improve display of the character
12225 in octal and display also its hex code.
12226
12227 * character.c (char_string): Use %x to display the (unsigned)
12228 codepoint of an invalid character, to avoid displaying a bogus
12229 negative value.
12230
12231 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
12232 `error', not SYMBOL_NAME itself.
12233
12234 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
12235 character arguments to `error'.
12236
12237 * charset.c (check_iso_charset_parameter): Fix incorrect argument
12238 to `error' in error message about FINAL_CHAR argument. Make sure
12239 FINAL_CHAR is a character, and use %c when it is passed as
12240 argument to `error'.
12241
12242 2011-04-23 Eli Zaretskii <eliz@gnu.org>
12243
12244 * s/ms-w32.h (localtime): Redirect to sys_localtime.
12245
12246 * w32.c: Include <time.h>.
12247 (sys_localtime): New function.
12248
12249 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
12250
12251 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
12252
12253 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
12254
12255 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
12256
12257 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
12258 zombies (Bug#8467).
12259
12260 2011-04-19 Eli Zaretskii <eliz@gnu.org>
12261
12262 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
12263 gl_state.e_property when gl_state.object is Qt.
12264
12265 * insdel.c (make_gap_larger): Remove limitation of buffer size
12266 to <= INT_MAX.
12267
12268 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
12269
12270 * xdisp.c (lookup_glyphless_char_display)
12271 (produce_glyphless_glyph): Handle cons cell entry in
12272 glyphless-char-display.
12273 (Vglyphless_char_display): Document it.
12274
12275 * term.c (produce_glyphless_glyph): Handle cons cell entry in
12276 glyphless-char-display.
12277
12278 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
12279
12280 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
12281
12282 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
12283
12284 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
12285 definition for no-X builds.
12286
12287 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
12288
12289 Static checks with GCC 4.6.0 and non-default toolkits.
12290
12291 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
12292
12293 * process.c (keyboard_bit_set): Define only if SIGIO.
12294 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
12295 (send_process): Repair possible setjmp clobbering.
12296
12297 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
12298
12299 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
12300
12301 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
12302
12303 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
12304 Define only if needed.
12305
12306 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
12307 by pacifying GCC about it. Maybe it's time to retire it?
12308 * xfaces.c (USG, __TIMEVAL__): Likewise.
12309
12310 * dispextern.h (struct redisplay_interface): Rename param
12311 to avoid shadowing.
12312 * termhooks.h (struct terminal): Likewise.
12313 * xterm.c (xembed_send_message): Likewise.
12314
12315 * insdel.c (make_gap_smaller): Define only if
12316 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
12317
12318 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
12319 it.
12320
12321 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
12322 so that we aren't warned about unused symbols.
12323
12324 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
12325
12326 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
12327
12328 * xfns.c (x_real_positions): Mark locals as initialized.
12329
12330 * xmenu.c (xmenu_show): Don't use uninitialized vars.
12331
12332 * xterm.c: Fix problems found by static analysis with other toolkits.
12333 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
12334 (x_dispatch_event): Declare static if USE_GTK, and
12335 define if USE_GTK || USE_X_TOOLKIT.
12336 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
12337 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
12338 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
12339 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
12340
12341 * xmenu.c (menu_help_callback): Pointer type fixes.
12342 Use const pointers when pointing at readonly data. Avoid pointer
12343 signedness clashes.
12344 (FALSE): Remove unused macro.
12345 (update_frame_menubar): Remove unused decl.
12346
12347 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
12348
12349 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
12350 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
12351 (single_menu_item): Rename local to avoid shadowing.
12352
12353 * keyboard.c (make_lispy_event): Remove unused local var.
12354
12355 * frame.c, frame.h (x_get_resource_string): Bring this back, but
12356 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
12357
12358 * bitmaps: Change bitmaps from unsigned char back to the X11
12359 compatible char. Avoid the old compiler warnings about
12360 out-of-range initializers by using, for example, '\xab' rather
12361 than 0xab.
12362
12363 * xgselect.c (xgselect_initialize): Check vs interface
12364 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
12365
12366 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
12367
12368 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
12369 to read-only memory.
12370
12371 * fns.c (vector): Remove; this old hack is no longer needed.
12372
12373 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
12374 Remove unused var.
12375 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
12376
12377 * xrdb.c (x_load_resources): Omit unused local.
12378
12379 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
12380 (x_window): Rename locals to avoid shadowing.
12381 (USG): Use the kludged USG macro, to pacify gcc.
12382
12383 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
12384 (x_term_init): Remove local to avoid shadowing.
12385
12386 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
12387
12388 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
12389 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
12390
12391 2011-04-16 Eli Zaretskii <eliz@gnu.org>
12392
12393 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
12394
12395 Fix regex.c, syntax.c and friends for buffers > 2GB.
12396 * syntax.h (struct gl_state_s): Declare character position members
12397 EMACS_INT.
12398
12399 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
12400
12401 * textprop.c (verify_interval_modification, interval_of):
12402 Declare arguments EMACS_INT.
12403
12404 * intervals.c (adjust_intervals_for_insertion): Declare arguments
12405 EMACS_INT.
12406
12407 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
12408
12409 * indent.c (Fvertical_motion): Local variable it_start is now
12410 EMACS_INT.
12411
12412 * regex.c (re_match, re_match_2, re_match_2_internal)
12413 (bcmp_translate, regcomp, regexec, print_double_string)
12414 (group_in_compile_stack, re_search, re_search_2, regex_compile)
12415 (re_compile_pattern, re_exec): Declare arguments and local
12416 variables `size_t' and `ssize_t' and return values `regoff_t', as
12417 appropriate.
12418 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
12419 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
12420 <compile_stack_type>: `size' and `avail' are now `size_t'.
12421
12422 * regex.h <regoff_t>: Use ssize_t, not int.
12423 (re_search, re_search_2, re_match, re_match_2): Arguments that
12424 specify buffer/string position and length are now ssize_t and
12425 size_t. Return type is regoff_t.
12426
12427 2011-04-16 Ben Key <bkey76@gmail.com>
12428
12429 * nsfont.m: Fixed bugs in ns_get_family and
12430 ns_descriptor_to_entity that were caused by using free to
12431 deallocate memory blocks that were allocated by xmalloc (via
12432 xstrdup). This caused Emacs to crash when compiled with
12433 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
12434 --enable-checking=xmallocoverrun). xfree is now used to
12435 deallocate these memory blocks.
12436
12437 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
12438
12439 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
12440
12441 emacs_write: Accept and return EMACS_INT for sizes.
12442 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
12443 et seq.
12444 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
12445 Accept and return EMACS_INT.
12446 (emacs_gnutls_write): Return the number of bytes written on
12447 partial writes.
12448 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
12449 (emacs_read, emacs_write): Remove check for negative size, as the
12450 Emacs source code has been audited now.
12451 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
12452 (emacs_read, emacs_write): Use it.
12453 * process.c (send_process): Adjust to the new signatures of
12454 emacs_write and emacs_gnutls_write. Do not attempt to store
12455 a byte offset into an 'int'; it might overflow.
12456 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
12457
12458 * sound.c: Don't assume sizes fit in 'int'.
12459 (struct sound_device.period_size, alsa_period_size):
12460 Return EMACS_INT, not int.
12461 (struct sound_device.write, vox_write, alsa_write):
12462 Accept EMACS_INT, not int.
12463 (wav_play, au_play): Use EMACS_INT to store sizes and to
12464 record read return values.
12465
12466 2011-04-15 Ben Key <bkey76@gmail.com>
12467
12468 * keyboard.c (Qundefined): Don't declare static since it is used
12469 in nsfns.m.
12470 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
12471 static since they are used in nsfont.m.
12472
12473 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
12474
12475 * process.c (Qprocessp): Don't declare static.
12476 * lisp.h (Qprocessp): Declare again.
12477
12478 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
12479
12480 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
12481
12482 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
12483
12484 Improve C-level modularity by making more things 'static'.
12485
12486 Don't publish debugger-only interfaces to other modules.
12487 * lisp.h (safe_debug_print, debug_output_compilation_hack):
12488 (verify_bytepos, count_markers): Move decls to the only modules
12489 that need them.
12490 * region-cache.h (pp_cache): Likewise.
12491 * window.h (check_all_windows): Likewise.
12492 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
12493
12494 * sysdep.c (croak): Now static, if
12495 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
12496 * syssignal.h (croak): Declare only if not static.
12497
12498 * alloc.c (refill_memory_reserve): Now static if
12499 !defined REL_ALLOC || defined SYSTEM_MALLOC.
12500 * lisp.h (refill_memory_reserve): Declare only if not static.
12501
12502 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
12503 Define only if USE_LUCID.
12504
12505 * xrdb.c (x_customization_string, x_rm_string): Now static.
12506
12507 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
12508 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
12509
12510 * xdisp.c (draw_row_with_mouse_face): Now static.
12511 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
12512
12513 * window.h (check_all_windows): Mark externally visible.
12514
12515 * window.c (window_deletion_count): Now static.
12516
12517 * undo.c: Make symbols static if they're not exported.
12518 (last_undo_buffer, last_boundary_position, pending_boundary):
12519 Now static.
12520
12521 * textprop.c (interval_insert_behind_hooks): Now static.
12522 (interval_insert_in_front_hooks): Likewise.
12523
12524 * term.c: Make symbols static if they're not exported.
12525 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
12526 (max_frame_lines, tty_set_terminal_modes):
12527 (tty_reset_terminal_modes, tty_turn_off_highlight):
12528 (get_tty_terminal): Now static.
12529 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
12530 * termhooks.h (term_mouse_moveto): Do not declare if
12531 HAVE_WINDOW_SYSTEM.
12532 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
12533 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
12534
12535 * sysdep.c: Make symbols static if they're not exported.
12536 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
12537 Now static.
12538 (sigprocmask_set, full_mask): Remove; unused.
12539 (wait_debugging): Mark as visible.
12540 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
12541 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
12542
12543 * syntax.c (syntax_temp): Define only if !__GNUC__.
12544
12545 * sound.c (current_sound_device, current_sound): Now static.
12546
12547 * search.c (searchbufs, searchbuf_head): Now static.
12548
12549 * scroll.c (scroll_cost): Remove; unused.
12550 * dispextern.h (scroll_cost): Remove decl.
12551
12552 * region-cache.h (pp_cache): Mark as externally visible.
12553
12554 * process.c: Make symbols static if they're not exported.
12555 (process_tick, update_tick, create_process, chan_process):
12556 (Vprocess_alist, proc_buffered_char, datagram_access):
12557 (fd_callback_data, send_process_frame, process_sent_to): Now static.
12558 (deactivate_process): Mark defn as static, as well as decl.
12559 * lisp.h (create_process): Remove decl.
12560 * process.h (chan_process, Vprocess_alist): Remove decls.
12561
12562 * print.c: Make symbols static if they're not exported.
12563 (print_depth, new_backquote_output, being_printed, print_buffer):
12564 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
12565 (print_interval, print_number_index, initial_stderr_stream):
12566 Now static.
12567 * lisp.h (Fprinc): Remove decl.
12568 (debug_output_compilation_hack): Mark as externally visible.
12569
12570 * sysdep.c (croak): Move decl from here to syssignal.h.
12571 * syssignal.h (croak): Put it here, so the API can be checked when
12572 'croak' is called from dissociate_if_controlling_tty.
12573
12574 * minibuf.c: Make symbols static if they're not exported.
12575 (minibuf_save_list, choose_minibuf_frame): Now static.
12576 * lisp.h (choose_minibuf_frame): Remove decl.
12577
12578 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
12579
12580 * lread.c: Make symbols static if they're not exported.
12581 (read_objects, initial_obarray, oblookup_last_bucket_number):
12582 Now static.
12583 (make_symbol): Remove; unused.
12584 * lisp.h (initial_obarray, make_symbol): Remove decls.
12585
12586 * keyboard.c: Make symbols static if they're not exported.
12587 (single_kboard, recent_keys_index, total_keys, recent_keys):
12588 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
12589 (this_single_command_key_start, echoing, last_auto_save):
12590 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
12591 (command_loop, echo_now, keyboard_init_hook, help_char_p):
12592 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
12593 (Vlispy_mouse_stem, double_click_count):
12594 Now static.
12595 (force_auto_save_soon): Define only if SIGDANGER.
12596 (ignore_mouse_drag_p): Now static if
12597 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
12598 (print_help): Remove; unused.
12599 (stop_character, last_timer_event): Mark as externally visible.
12600 * keyboard.h (ignore_mouse_drag_p): Declare only if
12601 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
12602 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
12603 * lisp.h (echoing): Remove decl.
12604 (force_auto_save_soon): Declare only if SIGDANGER.
12605 * xdisp.c (redisplay_window): Simplify code, to make it more
12606 obvious that ignore_mouse_drag_p is not accessed if !defined
12607 USE_GTK && !defined HAVE_NS.
12608
12609 * intervals.c: Make symbols static if they're not exported.
12610 (merge_properties_sticky, merge_interval_right, delete_interval):
12611 Now static.
12612 * intervals.h (merge_interval_right, delete_interval): Remove decls.
12613
12614 * insdel.c: Make symbols static if they're not exported.
12615 However, leave prepare_to_modify_buffer alone. It's never
12616 called from outside this function, but that appears to be a bug.
12617 (combine_after_change_list, combine_after_change_buffer):
12618 (adjust_after_replace, signal_before_change): Now static.
12619 (adjust_after_replace_noundo): Remove; unused.
12620 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
12621 (signal_before_change): Remove decls.
12622
12623 * indent.c (val_compute_motion, val_vmotion): Now static.
12624
12625 * image.c: Make symbols static if they're not exported.
12626 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
12627 if USE_GTK.
12628 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
12629 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
12630
12631 * fringe.c (standard_bitmaps): Now static.
12632 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
12633
12634 * frame.c: Make symbols static if they're not exported.
12635 (x_report_frame_params, make_terminal_frame): Now static.
12636 (get_frame_param): Now static, unless HAVE_NS.
12637 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
12638 (x_get_resource_string): Remove; not used.
12639 * frame.h (make_terminal_frame, x_report_frame_params):
12640 (x_get_resource_string); Remove decls.
12641 (x_fullscreen_adjust): Declare only if WINDOWSNT.
12642 * lisp.h (get_frame_param): Declare only if HAVE_NS.
12643
12644 * font.c, fontset.c: Make symbols static if they're not exported.
12645 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
12646 (FACE_SUITABLE_FOR_CHAR_P): Use it.
12647 * font.c (font_close_object): Now static.
12648 * font.h (font_close_object): Remove.
12649 * fontset.c (FONTSET_OBJLIST): Remove.
12650 (free_realized_fontset) #if-0 the body, which does nothing.
12651 (face_suitable_for_char_p): #if-0, as it's never called.
12652 * fontset.h (face_suitable_for_char_p): Remove decl.
12653 * xfaces.c (face_at_string_position):
12654 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
12655 since 0 is always ASCII.
12656
12657 * fns.c (weak_hash_tables): Now static.
12658
12659 * fileio.c: Make symbols static if they're not exported.
12660 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
12661 (Vwrite_region_annotation_buffers): Now static.
12662
12663 * eval.c: Make symbols static if they're not exported.
12664 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
12665 * lisp.h (backtrace_list): Remove decl.
12666
12667 * emacs.c: Make symbols static if they're not exported.
12668 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
12669 (fatal_error_code, fatal_error_signal_hook, standard_args):
12670 Now static.
12671 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
12672 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
12673 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
12674 * lisp.h (fatal_error_signal_hook): Remove decl.
12675 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
12676
12677 * editfns.c: Move a (normally-unused) function to its only use.
12678 * editfns.c, lisp.h (get_operating_system_release): Remove.
12679 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
12680 worth the hassle of breaking this out.
12681
12682 * xterm.c: Make symbols static if they're not exported.
12683 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
12684 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
12685 (x_destroy_window, x_delete_display):
12686 Now static.
12687 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
12688 (x_mouse_leave): Remove; unused.
12689 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
12690 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
12691 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
12692 Remove decls.
12693 (x_mouse_leave): Declare only if WINDOWSNT.
12694 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
12695 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
12696 USE_X_TOOLKIT.
12697
12698 * ftxfont.c: Make symbols static if they're not exported.
12699 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
12700 HAVE_FREETYPE.
12701 * font.h (ftxfont_driver): Likewise.
12702
12703 * xfns.c: Make symbols static if they're not exported.
12704 (x_last_font_name, x_display_info_for_name):
12705 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
12706 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
12707 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
12708 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
12709 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
12710 (last_show_tip_args): Now static.
12711 (xic_defaut_fontset, xic_create_fontsetname): Define only if
12712 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
12713 (x_screen_planes): Remove; unused.
12714 * dispextern.h (x_screen_planes): Remove decl.
12715
12716 * dispnew.c: Make symbols static if they're not exported.
12717 * dispextern.h (redraw_garbaged_frames, scrolling):
12718 (increment_row_positions): Remove.
12719 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
12720 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
12721 Now static.
12722 (redraw_garbaged_frames): Remove; unused.
12723
12724 * xfaces.c: Make symbols static if they're not exported.
12725 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
12726 Remove decls.
12727 * xterm.h (defined_color): Remove decls.
12728 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
12729 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
12730 (menu_face_changed_default, defined_color, free_realized_face):
12731 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
12732 (ascii_face_of_lisp_face): Remove; unused.
12733
12734 * xdisp.c: Make symbols static if they're not exported.
12735 * dispextern.h (scratch_glyph_row, window_box_edges):
12736 (glyph_to_pixel_coords, set_cursor_from_row):
12737 (get_next_display_element, set_iterator_to_next):
12738 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
12739 (show_mouse_face): Remove decls
12740 * frame.h (message_buf_print): Likewise.
12741 * lisp.h (pop_message, set_message, check_point_in_composition):
12742 Likewise.
12743 * xterm.h (set_vertical_scroll_bar): Likewise.
12744 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
12745 (message_buf_print, scratch_glyph_row, displayed_buffer):
12746 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
12747 (get_next_display_element, show_mouse_face, window_box_edges):
12748 (frame_to_window_pixel_xy, check_point_in_composition):
12749 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
12750 (glyph_to_pixel_coords): Remove; unused.
12751
12752 * dired.c (file_name_completion): Now static.
12753
12754 * dbusbind.c (xd_in_read_queued_messages): Now static.
12755
12756 * lisp.h (circular_list_error, FOREACH): Remove; unused.
12757 * data.c (circular_list_error): Remove.
12758
12759 * commands.h (last_point_position, last_point_position_buffer):
12760 (last_point_position_window): Remove decls.
12761 * keyboard.c: Make these variables static.
12762
12763 * coding.h (coding, code_convert_region, encode_coding_gap):
12764 Remove decls.
12765 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
12766 (iso_code_class, detect_coding, code_convert_region): Now static.
12767 (encode_coding_gap): Remove; unused.
12768
12769 * chartab.c (chartab_chars, chartab_bits): Now static.
12770
12771 * charset.h (charset_iso_8859_1): Remove decl.
12772 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
12773 Now static.
12774
12775 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
12776 * ccl.c (Vccl_program_table): Now static.
12777 (check_ccl_update): Remove; unused.
12778
12779 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
12780 * category.h: ... from here.
12781 * category.c (check_category_table, set_category_set): Now static.
12782
12783 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
12784 * lisp.h: Remove these decls.
12785
12786 * buffer.c (buffer_count): Remove unused var.
12787
12788 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
12789 so that it's not optimized away.
12790 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
12791 * dispextern.h (bidi_dump_cached_states): Remove, since it's
12792 exported only to the debugger.
12793
12794 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
12795 * atimer.h (run_all_atimers): Remove; not exported.
12796
12797 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
12798 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
12799 was inaccessible from Lisp.
12800 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
12801 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
12802
12803 alloc.c: Import and export fewer symbols, and remove unused items.
12804 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
12805 is defined.
12806 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
12807 it's not optimized away by whole-program optimization.
12808 (message_enable_multibyte, free_misc): Remove.
12809 (catchlist, handlerlist, mark_backtrace):
12810 Declare only if BYTE_MARK_STACK.
12811 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
12812 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
12813 (message_enable_multibyte): Remove decl.
12814 (free_misc, interval_free_list, float_block, float_block_index):
12815 (n_float_blocks, float_free_list, cons_block, cons_block_index):
12816 (cons_free_list, last_marked_index):
12817 Now static.
12818 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
12819 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
12820 (mark_backtrace): Define only if BYTE_MARK_STACK.
12821 * xdisp.c (message_enable_multibyte): Now static.
12822
12823 Declare Lisp_Object Q* variables to be 'static' if not exported.
12824 This makes it easier for human readers (and static analyzers)
12825 to see whether these variables are used from other modules.
12826 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
12827 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
12828 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
12829 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
12830 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
12831 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
12832 * xmenu.c, xselect.c:
12833 Declare Q* vars static if they are not used in other modules.
12834 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
12835 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
12836 Remove decls of unexported vars.
12837 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
12838
12839 * lisp.h (DEFINE_FUNC): Make sname 'static'.
12840
12841 Make Emacs functions such as Fatom 'static' by default.
12842 This makes it easier for human readers (and static analyzers)
12843 to see whether these functions can be called from other modules.
12844 DEFUN now defines a static function. To make the function external
12845 so that it can be used in other C modules, use the new macro DEFUE.
12846 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
12847 (Finit_image_library):
12848 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
12849 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
12850 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
12851 Remove decls, since these functions are now static.
12852 (Funintern, Fget_internal_run_time): New decls, since these functions
12853 were already external.
12854
12855 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
12856 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
12857 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
12858 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
12859 * keyboard.c, keymap.c, lread.c:
12860 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
12861 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
12862 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
12863 Mark functions with DEFUE instead of DEFUN,
12864 if they are used in other modules.
12865 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
12866 decls for now-static functions.
12867 * buffer.h (Fdelete_overlay): Remove decl.
12868 * callproc.c (Fgetenv_internal): Mark as internal.
12869 * composite.c (Fremove_list_of_text_properties): Remove decl.
12870 (Fcomposition_get_gstring): New forward static decl.
12871 * composite.h (Fcomposite_get_gstring): Remove decl.
12872 * dired.c (Ffile_attributes): New forward static decl.
12873 * doc.c (Fdocumntation_property): New forward static decl.
12874 * eval.c (Ffetch_bytecode): New forward static decl.
12875 (Funintern): Remove extern decl; now in .h file where it belongs.
12876 * fileio.c (Fmake_symbolic_link): New forward static decl.
12877 * image.c (Finit_image_library): New forward static decl.
12878 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
12879 * intervals.h (Fprevious_property_change):
12880 (Fremove_list_of_text_properties): Remove decls.
12881 * keyboard.c (Fthis_command_keys): Remove decl.
12882 (Fcommand_execute): New forward static decl.
12883 * keymap.c (Flookup_key): New forward static decl.
12884 (Fcopy_keymap): Now static.
12885 * keymap.h (Flookup_key): Remove decl.
12886 * process.c (Fget_process): New forward static decl.
12887 (Fprocess_datagram_address): Mark as internal.
12888 * syntax.c (Fsyntax_table_p): New forward static decl.
12889 (skip_chars): Remove duplicate decl.
12890 * textprop.c (Fprevious_property_change): New forward static decl.
12891 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
12892 Now internal.
12893 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
12894 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
12895
12896 * editfns.c (Fformat): Remove unreachable code.
12897
12898 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
12899
12900 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
12901 change. (Bug#8496)
12902
12903 2011-04-13 Eli Zaretskii <eliz@gnu.org>
12904
12905 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
12906 when at ZV. (Bug#8487)
12907
12908 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
12909
12910 * charset.c (Fclear_charset_maps): Use xfree instead of free.
12911 (Bug#8437)
12912 * keyboard.c (parse_tool_bar_item): Likewise.
12913 * sound.c (sound_cleanup, alsa_close): Likewise.
12914 * termcap.c (tgetent): Likewise.
12915 * xfns.c (x_default_font_parameter): Likewise.
12916 * xsettings.c (read_and_apply_settings): Likewise.
12917
12918 * alloc.c (overrun_check_malloc, overrun_check_realloc)
12919 (overrun_check_free): Protoize.
12920
12921 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
12922
12923 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
12924 since callers should never pass a negative size.
12925 Change the signature to match that of plain 'read' and 'write'; see
12926 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
12927 * lisp.h: Update prototypes of emacs_write and emacs_read.
12928
12929 2011-04-11 Eli Zaretskii <eliz@gnu.org>
12930
12931 * xdisp.c (redisplay_window): Don't try to determine the character
12932 position of the scroll margin if the window start point w->startp
12933 is outside the buffer's accessible region. (Bug#8468)
12934
12935 2011-04-10 Eli Zaretskii <eliz@gnu.org>
12936
12937 Fix write-region and its subroutines for buffers > 2GB.
12938 * fileio.c (a_write, e_write): Modify declaration of arguments and
12939 local variables to support buffers larger than 2GB.
12940 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
12941
12942 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
12943 argument, local variables, and return value.
12944
12945 * lisp.h: Update prototypes of emacs_write and emacs_read.
12946
12947 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
12948
12949 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
12950
12951 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
12952
12953 Fix more problems found by GCC 4.6.0's static checks.
12954
12955 * xdisp.c (vmessage): Use a better test for character truncation.
12956
12957 * charset.c (load_charset_map): <, not <=, for optimization,
12958 and to avoid potential problems with integer overflow.
12959 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
12960 * casetab.c (set_identity, shuffle): Likewise.
12961 * editfns.c (Fformat): Likewise.
12962 * syntax.c (skip_chars): Likewise.
12963
12964 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
12965 This also lets GCC 4.6.0 generate slightly better loop code.
12966
12967 * callint.c (Fcall_interactively): <, not <=, for optimization.
12968 (Fcall_interactively): Count the number of arguments produced,
12969 not the number of arguments given. This is simpler and lets GCC
12970 4.6.0 generate slightly better code.
12971
12972 * ftfont.c: Distingish more carefully between FcChar8 and char.
12973 The previous code passed unsigned char * to a functions like
12974 strlen and xstrcasecmp that expect char *, which does not
12975 conform to the C standard.
12976 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
12977 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
12978 char * when the C standard requires it.
12979
12980 * keyboard.c (read_char): Remove unused var.
12981
12982 * eval.c: Port to Windows vsnprintf (Bug#8435).
12983 Include <limits.h>.
12984 (SIZE_MAX): Define if the headers do not.
12985 (verror): Do not give up if vsnprintf returns a negative count.
12986 Instead, grow the buffer. This ports to Windows vsnprintf, which
12987 does not conform to C99. Problem reported by Eli Zaretskii.
12988 Also, simplify the allocation scheme, by avoiding the need for
12989 calling realloc, and removing the ALLOCATED variable.
12990
12991 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
12992
12993 Remove invocations of doprnt, as Emacs now uses vsnprintf.
12994 But keep the doprint source code for now, as we might revamp it
12995 and use it again (Bug#8435).
12996 * lisp.h (doprnt): Remove.
12997 * Makefile.in (base_obj): Remove doprnt.o.
12998 * deps.mk (doprnt.o): Remove.
12999
13000 error: Print 32- and 64-bit integers portably (Bug#8435).
13001 Without this change, on typical 64-bit hosts error ("...%d...", N)
13002 was used to print both 32- and 64-bit integers N, which relied on
13003 undefined behavior.
13004 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
13005 * lisp.h (error, verror): Mark as printf-like functions.
13006 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
13007 Report overflow in size calculations when allocating printf buffer.
13008 Do not truncate output string at its first null byte.
13009 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
13010 Truncate the output at a character boundary, since vsnprintf does not
13011 do that.
13012 * charset.c (check_iso_charset_parameter): Convert internal
13013 character to string before calling 'error', since %c now has the
13014 printf meaning.
13015 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
13016 overflow when computing char to be passed to 'error'. Do not
13017 pass Lisp_Object to 'error'; pass the integer instead.
13018 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
13019 formatted with plain %d.
13020
13021 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
13022
13023 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
13024
13025 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
13026
13027 * xterm.c (x_catch_errors): Remove duplicate declaration.
13028
13029 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
13030
13031 * xdisp.c, lisp.h (message_nolog): Remove; unused.
13032
13033 2011-04-10 Jim Meyering <meyering@redhat.com>
13034
13035 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
13036 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
13037 return ssize_t not "int", and use size_t as the buffer length.
13038 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
13039 * gnutls.h: Update declarations.
13040 * process.c (read_process_output): Use ssize_t, to match.
13041 (send_process): Likewise.
13042
13043 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
13044
13045 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
13046
13047 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
13048
13049 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
13050 Use unsigned char, to match FcChar8 type definition.
13051
13052 * xterm.c (handle_one_xevent):
13053 * xmenu.c (create_and_show_popup_menu):
13054 * xselect.c (x_decline_selection_request)
13055 (x_reply_selection_request): Avoid type-punned deref of X events.
13056
13057 2011-04-09 Eli Zaretskii <eliz@gnu.org>
13058
13059 Fix some uses of `int' instead of EMACS_INT.
13060 * search.c (string_match_1, fast_string_match)
13061 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
13062 (scan_buffer, find_next_newline_no_quit)
13063 (find_before_next_newline, search_command, Freplace_match)
13064 (Fmatch_data): Make some `int' variables be EMACS_INT.
13065
13066 * xdisp.c (display_count_lines): 3rd argument and return value now
13067 EMACS_INT. All callers changed.
13068 (pint2hrstr): Last argument is now EMACS_INT.
13069
13070 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
13071 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
13072 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
13073 (decode_coding_utf_16, decode_coding_emacs_mule)
13074 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
13075 (decode_coding_ccl, decode_coding_charset)
13076 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
13077 (decode_coding_iso_2022, decode_coding_emacs_mule)
13078 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
13079 <char_offset, last_offset>: Declare EMACS_INT.
13080 (encode_coding_utf_8, encode_coding_utf_16)
13081 (encode_coding_emacs_mule, encode_invocation_designation)
13082 (encode_designation_at_bol, encode_coding_iso_2022)
13083 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
13084 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
13085 Declare EMACS_INT.
13086 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
13087 (encode_invocation_designation): Last argument P_NCHARS is now
13088 EMACS_INT.
13089 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
13090 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
13091
13092 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
13093 All users changed.
13094
13095 * ccl.c (Fccl_execute_on_string): Declare some variables
13096 EMACS_INT.
13097
13098 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
13099
13100 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
13101
13102 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
13103
13104 * process.c (Fformat_network_address): Doc fix.
13105
13106 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
13107
13108 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
13109
13110 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
13111
13112 * keyboard.c (read_char): Call Lisp function help-form-show,
13113 instead of using internal_with_output_to_temp_buffer.
13114 (Qhelp_form_show): New var.
13115 (syms_of_keyboard): Use DEFSYM macro.
13116
13117 * print.c (internal_with_output_to_temp_buffer): Function deleted.
13118
13119 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
13120
13121 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
13122
13123 * process.c (Flist_processes): Remove to Lisp.
13124 (list_processes_1): Delete.
13125
13126 2011-04-06 Eli Zaretskii <eliz@gnu.org>
13127
13128 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
13129
13130 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
13131
13132 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
13133
13134 Fix more problems found by GCC 4.6.0's static checks.
13135
13136 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
13137
13138 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
13139
13140 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
13141
13142 * xdisp.c (vmessage): Mark as a printf-like function.
13143
13144 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
13145
13146 * sound.c (sound_warning): Don't crash if arg contains a printf format.
13147
13148 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
13149 printf-like functions.
13150 (tiff_load): Add casts to remove these marks before passing them
13151 to system-supplied API.
13152
13153 * eval.c (Fsignal): Remove excess argument to 'fatal'.
13154
13155 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
13156 This avoids several warnings with gcc -Wstrict-overflow.
13157 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
13158 directly, rather than having caller test rule sign. This avoids
13159 some unnecessary tests.
13160 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
13161 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
13162 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
13163
13164 * xfont.c (xfont_text_extents): Remove var that was set but not used.
13165 (xfont_open): Avoid unnecessary tests.
13166
13167 * composite.c (composition_gstring_put_cache): Use unsigned integer.
13168
13169 * composite.h, composite.c (composition_gstring_put_cache):
13170 Use EMACS_INT, not int, for length.
13171
13172 * composite.h (COMPOSITION_DECODE_REFS): New macro,
13173 breaking out part of COMPOSITION_DECODE_RULE.
13174 (COMPOSITION_DECODE_RULE): Use it.
13175 * composite.c (get_composition_id): Remove unused local vars,
13176 by using the new macro.
13177
13178 * textprop.c (set_text_properties_1): Change while to do-while,
13179 since the condition is always true at first.
13180
13181 * intervals.c (graft_intervals_into_buffer): Mark var as used.
13182 (interval_deletion_adjustment): Return unsigned value.
13183 All uses changed.
13184
13185 * process.c (list_processes_1, create_pty, read_process_output):
13186 (exec_sentinel): Remove vars that were set but not used.
13187 (create_pty): Remove unnecessary "volatile"s.
13188 (Fnetwork_interface_info): Avoid possibility of int overflow.
13189 (read_process_output): Do adaptive read buffering even if carryover.
13190 (read_process_output): Simplify nbytes computation if buffered.
13191
13192 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
13193
13194 * syntax.c (scan_words): Remove var that was set but not used.
13195 (update_syntax_table): Use unsigned instead of int.
13196
13197 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
13198 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
13199 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
13200
13201 * print.c (print_error_message): Avoid int overflow.
13202
13203 * font.c (font_list_entities): Redo for clarity,
13204 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
13205
13206 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
13207 (font_score): Avoid potential overflow in diff calculation.
13208
13209 * fns.c (substring_both): Remove var that is set but not used.
13210 (sxhash): Redo loop for clarity and to avoid wraparound warning.
13211
13212 * eval.c (funcall_lambda): Rename local to avoid shadowing.
13213
13214 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
13215 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
13216 can always succeed if overflow has undefined behavior.
13217
13218 * search.c (boyer_moore, wordify): Remove vars set but not used.
13219 (wordify): Omit three unnecessary tests.
13220
13221 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
13222 All callers changed. This avoids the need for an unused var.
13223
13224 * casefiddle.c (casify_region): Remove var that is set but not used.
13225
13226 * dired.c (file_name_completion): Remove var that is set but not used.
13227
13228 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
13229
13230 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
13231 (Finsert_file_contents): Remove unnecessary code checking fd.
13232
13233 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
13234 Check for integer overflow on size calculations.
13235
13236 * buffer.c (Fprevious_overlay_change): Remove var that is set
13237 but not used.
13238
13239 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
13240 Remove vars that are set but not used.
13241 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
13242 (timer_check_2): Mark vars as initialized.
13243
13244 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
13245
13246 * image.c (lookup_image): Remove var that is set but not used.
13247 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
13248
13249 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
13250 that are set but not used.
13251
13252 * xfns.c (make_invisible_cursor): Don't return garbage
13253 if XCreateBitmapFromData fails (Bug#8410).
13254
13255 * xselect.c (x_get_local_selection, x_handle_property_notify):
13256 Remove vars that are set but not used.
13257
13258 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
13259 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
13260
13261 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
13262 Remove var that is set but not used.
13263 (scroll_bar_windows_size): Now size_t, not int.
13264 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
13265 Check for overflow.
13266
13267 * xfaces.c (realize_named_face): Remove vars that are set but not used.
13268 (map_tty_color) [!defined MSDOS]: Likewise.
13269
13270 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
13271
13272 * coding.c: Remove vars that are set but not used.
13273 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
13274 All callers changed.
13275 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
13276 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
13277 (decode_coding_charset): Remove vars that are set but not used.
13278
13279 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
13280 that is set but not used.
13281
13282 * print.c (print_object): Remove var that is set but not used.
13283
13284 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
13285 The gnulib version avoids calling malloc in the usual case,
13286 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
13287 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
13288 * filelock.c (current_lock_owner): Likewise.
13289 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
13290 * sysdep.c: Include allocator.h, careadlinkat.h.
13291 (emacs_no_realloc_allocator): New static constant.
13292 (emacs_readlink): New function.
13293 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
13294 ../lib/careadlinkat.h.
13295
13296 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
13297
13298 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
13299 first non-nil return value).
13300
13301 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
13302
13303 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
13304 if not defined (Bug#8403).
13305
13306 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
13307
13308 * xdisp.c (display_count_lines): Remove parameter `start',
13309 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
13310 (get_char_face_and_encoding): Remove parameter `multibyte_p',
13311 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
13312 (fill_stretch_glyph_string): Remove parameters `row' and `area',
13313 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
13314 and thereabouts. All callers changed.
13315 (get_per_char_metric): Remove parameter `f', unused since
13316 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
13317
13318 2011-04-02 Jim Meyering <meyering@redhat.com>
13319
13320 do not dereference NULL upon failed strdup
13321 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
13322 (ns_get_family): Likewise.
13323
13324 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
13325
13326 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
13327
13328 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
13329
13330 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
13331 later (Bug#8403).
13332
13333 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
13334
13335 Add lexical binding.
13336
13337 * window.c (Ftemp_output_buffer_show): New fun.
13338 (Fsave_window_excursion):
13339 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
13340
13341 * lread.c (lisp_file_lexically_bound_p): New function.
13342 (Fload): Bind Qlexical_binding.
13343 (readevalloop): Remove `evalfun' arg.
13344 Bind Qinternal_interpreter_environment.
13345 (Feval_buffer): Bind Qlexical_binding.
13346 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
13347 Mark as dynamic.
13348 (syms_of_lread): Declare `lexical-binding'.
13349
13350 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
13351
13352 * keyboard.c (eval_dyn): New fun.
13353 (menu_item_eval_property): Use it.
13354
13355 * image.c (parse_image_spec): Use Ffunctionp.
13356
13357 * fns.c (concat, mapcar1): Accept byte-code-functions.
13358
13359 * eval.c (Fsetq): Handle lexical vars.
13360 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
13361 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
13362 (FletX, Flet): Obey lexical binding.
13363 (Fcommandp): Handle closures.
13364 (Feval): New `lexical' arg.
13365 (eval_sub): New function extracted from Feval. Use it almost
13366 everywhere where Feval was used. Look up vars in lexical env.
13367 Handle closures.
13368 (Ffunctionp): Move from subr.el.
13369 (Ffuncall): Handle closures.
13370 (apply_lambda): Remove `eval_flags'.
13371 (funcall_lambda): Handle closures and new byte-code-functions.
13372 (Fspecial_variable_p): New function.
13373 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
13374 but without exporting it to Lisp.
13375
13376 * doc.c (Fdocumentation, store_function_docstring):
13377 * data.c (Finteractive_form): Handle closures.
13378
13379 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
13380 interactive spec.
13381
13382 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
13383 New byte-codes.
13384 (exec_byte_code): New function extracted from Fbyte_code to handle new
13385 calling convention for byte-code-functions. Add new byte-codes.
13386
13387 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
13388
13389 * alloc.c (Fmake_symbol): Init new `declared_special' field.
13390
13391 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
13392
13393 * xdisp.c (redisplay_internal): Fix prototype.
13394
13395 2011-03-31 Eli Zaretskii <eliz@gnu.org>
13396
13397 * xdisp.c (SCROLL_LIMIT): New macro.
13398 (try_scrolling): Use it when setting scroll_limit.
13399 Limit scrolling to 100 screen lines.
13400 (redisplay_window): Even when falling back on "recentering",
13401 position point in the window according to scroll-conservatively,
13402 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
13403
13404 (try_scrolling): When point is above the window, allow searching
13405 as far as scroll_max, or one screenful, to compute vertical
13406 distance from PT to the scroll margin position. This prevents
13407 try_scrolling from unnecessarily failing when
13408 scroll-conservatively is set to a value slightly larger than the
13409 window height. Clean up the case of PT below the margin at bottom
13410 of window: scroll_max can no longer be INT_MAX. When aggressive
13411 scrolling is in use, don't let point enter the opposite scroll
13412 margin as result of the scroll.
13413 (syms_of_xdisp) <scroll-conservatively>: Document the
13414 threshold of 100 lines for never-recentering scrolling.
13415
13416 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
13417
13418 * dispextern.h (move_it_by_lines):
13419 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
13420 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
13421 (message_log_check_duplicate): Remove parameters `prev_bol' and
13422 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
13423 (redisplay_internal): Remove parameter `preserve_echo_area',
13424 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
13425
13426 * indent.c (Fvertical_motion):
13427 * window.c (window_scroll_pixel_based, Frecenter):
13428 Don't pass `need_y_p' to `move_it_by_lines'.
13429
13430 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
13431
13432 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
13433 steal a few bits to be more compact.
13434 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
13435 Remove unneeded casts.
13436
13437 * bytecode.c (Fbyte_code): CAR and CDR can GC.
13438
13439 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
13440
13441 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
13442 binding" message (bug#7967).
13443
13444 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
13445
13446 Fix more problems found by GCC 4.6.0's static checks.
13447
13448 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
13449 Remove unused local var.
13450
13451 * editfns.c (Fmessage_box): Remove unused local var.
13452
13453 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
13454 (note_mode_line_or_margin_highlight, note_mouse_highlight):
13455 Omit unused local vars.
13456 * window.c (shrink_windows): Omit unused local var.
13457 * menu.c (digest_single_submenu): Omit unused local var.
13458 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
13459 Omit unused local var.
13460
13461 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
13462 Don't assume string length fits in int.
13463 (keyremap_step, read_key_sequence): Use size_t for sizes.
13464 (read_key_sequence): Don't check last_real_key_start redundantly.
13465
13466 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
13467 instead of alloca (Bug#8344).
13468
13469 * eval.c (Fbacktrace): Don't assume nargs fits in int.
13470 (Fbacktrace_frame): Don't assume nframes fits in int.
13471
13472 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
13473
13474 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
13475 concerns.
13476
13477 * term.c (produce_glyphless_glyph): Remove unnecessary test.
13478
13479 * cm.c (calccost): Turn while-do into do-while, for clarity.
13480
13481 * keyboard.c (syms_of_keyboard): Use the same style as later
13482 in this function when indexing through an array. This also
13483 works around GCC bug 48267.
13484
13485 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
13486
13487 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
13488
13489 * chartab.c (sub_char_table_ref_and_range): Redo for slight
13490 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
13491
13492 * keyboard.c, keyboard.h (num_input_events): Now size_t.
13493 This avoids undefined behavior on integer overflow, and is a bit
13494 more convenient anyway since it is compared to a size_t variable.
13495
13496 Variadic C functions now count arguments with size_t, not int.
13497 This avoids an unnecessary limitation on 64-bit machines, which
13498 caused (substring ...) to crash on large vectors (Bug#8344).
13499 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
13500 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
13501 All variadic functions and their callers changed accordingly.
13502 (struct gcpro.nvars): Now size_t, not int. All uses changed.
13503 * data.c (arith_driver, float_arith_driver): Likewise.
13504 * editfns.c (general_insert_function): Likewise.
13505 * eval.c (struct backtrace.nargs, interactive_p)
13506 (internal_condition_case_n, run_hook_with_args, apply_lambda)
13507 (funcall_lambda, mark_backtrace): Likewise.
13508 * fns.c (concat): Likewise.
13509 * frame.c (x_set_frame_parameters): Likewise.
13510 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
13511 0 if not found, not -1. All callers changed.
13512
13513 * alloc.c (garbage_collect): Don't assume stack size fits in int.
13514 (stack_copy_size): Now size_t, not int.
13515 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
13516
13517 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
13518
13519 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
13520 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
13521 All callers changed.
13522
13523 * lisp.h (multibyte_char_to_unibyte):
13524 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
13525 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
13526 * character.h (CHAR_TO_BYTE8):
13527 * cmds.c (internal_self_insert):
13528 * editfns.c (general_insert_function):
13529 * keymap.c (push_key_description):
13530 * search.c (Freplace_match):
13531 * xdisp.c (message_dolog, set_message_1): All callers changed.
13532
13533 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
13534
13535 * keyboard.c (safe_run_hook_funcall): New function.
13536 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
13537 don't set the hook to nil, but remove the offending function instead.
13538 (Qcommand_hook_internal): Remove, unused.
13539 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
13540 Vcommand_hook_internal.
13541
13542 * eval.c (enum run_hooks_condition): Remove.
13543 (funcall_nil, funcall_not): New functions.
13544 (run_hook_with_args): Call each function through a `funcall' argument.
13545 Remove `cond' argument, now redundant.
13546 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
13547 (Frun_hook_with_args_until_failure): Adjust accordingly.
13548 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
13549
13550 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
13551
13552 * dispextern.h (string_buffer_position): Remove declaration.
13553
13554 * print.c (strout): Remove parameter `multibyte', unused since
13555 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
13556
13557 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
13558 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
13559 All callers changed.
13560
13561 * w32.c (_wsa_errlist): Use braces for struct initializers.
13562
13563 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
13564 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
13565 All callers changed.
13566 (string_buffer_position): Likewise. Also, make static (it's never
13567 used outside xdisp.c).
13568 (cursor_row_p): Remove parameter `w', unused since
13569 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
13570 (decode_mode_spec): Remove parameter `precision', introduced during
13571 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
13572 All callers changed.
13573
13574 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
13575
13576 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
13577
13578 2011-03-27 Anders Lindgren <andlind@gmail.com>
13579
13580 * nsterm.m (ns_menu_bar_is_hidden): New variable.
13581 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
13582 (ns_update_auto_hide_menu_bar): New functions.
13583 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
13584 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
13585 ns_constrain_all_frames.
13586 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
13587 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
13588
13589 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
13590
13591 * nsmenu.m (runDialogAt): Remove argument to timer_check.
13592
13593 2011-03-27 Glenn Morris <rgm@gnu.org>
13594
13595 * syssignal.h: Replace RETSIGTYPE with void.
13596 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
13597 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
13598 Replace SIGTYPE with void everywhere.
13599 * s/usg5-4-common.h (SIGTYPE): Remove definition.
13600 * s/template.h (SIGTYPE): Remove commented out definition.
13601
13602 2011-03-26 Eli Zaretskii <eliz@gnu.org>
13603
13604 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
13605 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
13606
13607 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
13608
13609 * w32.c (read_unc_volume): Use parameter `henum', instead of
13610 global variable `wget_enum_handle'.
13611
13612 * keymap.c (describe_vector): Remove parameters `indices' and
13613 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
13614 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
13615
13616 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
13617
13618 * keyboard.c (timer_check): Remove parameter `do_it_now',
13619 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
13620 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
13621 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
13622
13623 * keyboard.c (read_char):
13624 * w32menu.c (w32_menu_display_help):
13625 * xmenu.c (show_help_event, menu_help_callback):
13626 Adjust calls to `show_help_echo'.
13627
13628 * gtkutil.c (xg_maybe_add_timer):
13629 * keyboard.c (readable_events):
13630 * process.c (wait_reading_process_output):
13631 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
13632
13633 * insdel.c (adjust_markers_gap_motion):
13634 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
13635 (gap_left, gap_right): Don't call it.
13636
13637 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
13638
13639 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
13640 incurred during fontification.
13641
13642 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
13643
13644 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
13645 (DEFVAR_PER_BUFFER): Don't pass it.
13646
13647 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
13648 (scrolling_window): Don't pass it.
13649
13650 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
13651
13652 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
13653
13654 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
13655 and `suffix'.
13656 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
13657 of variables specific to SELinux and computation of `encoded_absname'.
13658
13659 * image.c (XPutPixel): Remove unused variable `height'.
13660
13661 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
13662
13663 * unexw32.c (get_section_info): Remove unused variable `section'.
13664
13665 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
13666 (system_process_attributes): Remove unused variable `sess'.
13667 (sys_read): Remove unused variable `err'.
13668
13669 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
13670 (w32_wnd_proc): Remove unused variable `isdead'.
13671 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
13672 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
13673 (x_create_tip_frame): Remove unused variable `tem'.
13674
13675 * w32inevt.c (w32_console_read_socket):
13676 Remove unused variable `no_events'.
13677
13678 * w32term.c (x_draw_composite_glyph_string_foreground):
13679 Remove unused variable `width'.
13680
13681 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
13682
13683 * w32term.c (x_set_glyph_string_clipping):
13684 Don't pass uninitialized region to CombineRgn.
13685
13686 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
13687
13688 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
13689 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
13690 (Fx_close_connection): Remove unused variable `i'.
13691
13692 * w32font.c (w32font_draw): Return number of glyphs.
13693 (w32font_open_internal): Remove unused variable `i'.
13694 (w32font_driver): Add missing initializer.
13695
13696 * w32menu.c (utf8to16): Remove unused variable `utf16'.
13697 (fill_in_menu): Remove unused variable `items_added'.
13698
13699 * w32term.c (last_mouse_press_frame): Remove static global variable.
13700 (w32_clip_to_row): Remove unused variable `f'.
13701 (x_delete_terminal): Remove unused variable `i'.
13702
13703 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
13704 (NOTHING): Remove unused static global variable.
13705 (uniscribe_check_otf): Remove unused variable `table'.
13706 (uniscribe_font_driver): Add missing initializers.
13707
13708 2011-03-23 Julien Danjou <julien@danjou.info>
13709
13710 * term.c (Fsuspend_tty, Fresume_tty):
13711 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
13712 * window.c (temp_output_buffer_show):
13713 * insdel.c (signal_before_change):
13714 * frame.c (Fhandle_switch_frame):
13715 * fileio.c (Fdo_auto_save):
13716 * emacs.c (Fkill_emacs):
13717 * editfns.c (save_excursion_restore):
13718 * cmds.c (internal_self_insert):
13719 * callint.c (Fcall_interactively):
13720 * buffer.c (Fkill_all_local_variables):
13721 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
13722 Use Frun_hooks.
13723 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
13724 unconditionally since it does the check itself.
13725
13726 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
13727
13728 Fix more problems found by GCC 4.5.2's static checks.
13729
13730 * coding.c (encode_coding_raw_text): Avoid unnecessary test
13731 the first time through the loop, since we know p0 < p1 then.
13732 This also avoids a gcc -Wstrict-overflow warning.
13733
13734 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
13735 leading to a memory leak, possible in functions like
13736 load_charset_map_from_file that can allocate an unbounded number
13737 of objects (Bug#8318).
13738
13739 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
13740 that could (at least in theory) be that large.
13741
13742 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
13743 This is less likely to overflow, and avoids undefined behavior if
13744 overflow does occur. All callers changed. Use strtoul to scan
13745 for the unsigned long integer.
13746 (pint2hrstr): Simplify and tune code slightly.
13747 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
13748
13749 * scroll.c (do_scrolling): Work around GCC bug 48228.
13750 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
13751
13752 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
13753 This also avoids a warning with gcc -Wstrict-overflow.
13754 (validate_x_resource_name): Simplify count usage.
13755 This also avoids a warning with gcc -Wstrict-overflow.
13756
13757 * fileio.c (Fcopy_file): Report error if fchown or fchmod
13758 fail (Bug#8306).
13759
13760 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
13761
13762 * process.c (Fmake_network_process): Use socklen_t, not int,
13763 where POSIX says socklen_t is required in portable programs.
13764 This fixes a porting bug on hosts like 64-bit HP-UX, where
13765 socklen_t is wider than int (Bug#8277).
13766 (Fmake_network_process, server_accept_connection):
13767 (wait_reading_process_output, read_process_output):
13768 Likewise.
13769
13770 * process.c: Rename or move locals to avoid shadowing.
13771 (list_processes_1, Fmake_network_process):
13772 (read_process_output_error_handler, exec_sentinel_error_handler):
13773 Rename or move locals.
13774 (Fmake_network_process): Define label "retry_connect" only if needed.
13775 (Fnetwork_interface_info): Fix pointer signedness.
13776 (process_send_signal): Add cast to avoid pointer signedness problem.
13777 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
13778 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
13779
13780 Make tparam.h and terminfo.c consistent.
13781 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
13782 Include tparam.h instead, since it declares them.
13783 * cm.h (PC): Remove extern decl; tparam.h now does this.
13784 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
13785 * terminfo.c: Include tparam.h, to check interfaces.
13786 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
13787 (tparam): Adjust signature to match interface in tparam.h;
13788 this removes some undefined behavior. Check that outstring and len
13789 are zero, which they always are with Emacs.
13790 * tparam.h (PC, BC, UP): New extern decls.
13791
13792 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
13793 (xftfont_open): Rename locals to avoid shadowing.
13794
13795 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
13796 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
13797 (OTF_TAG_SYM): Omit macro if not needed.
13798 (ftfont_list): Remove unused local.
13799 (get_adstyle_property, ftfont_pattern_entity):
13800 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
13801 Rename locals to avoid shadowing.
13802
13803 * xfont.c (xfont_list_family): Mark var as initialized.
13804
13805 * xml.c (make_dom): Now static.
13806
13807 * composite.c (composition_compute_stop_pos): Rename local to
13808 avoid shadowing.
13809 (composition_reseat_it): Remove unused locals.
13810 (find_automatic_composition, composition_adjust_point): Likewise.
13811 (composition_update_it): Mark var as initialized.
13812 (find_automatic_composition): Mark vars as initialized,
13813 with a FIXME (Bug#8290).
13814
13815 character.h: Rename locals to avoid shadowing.
13816 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
13817 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
13818 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
13819 (BUF_DEC_POS): Be more systematic about renaming local temporaries
13820 to avoid shadowing.
13821
13822 * textprop.c (property_change_between_p): Remove; unused.
13823
13824 * intervals.c (interval_start_pos): Now static.
13825
13826 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
13827
13828 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
13829 Rename locals to avoid shadowing.
13830
13831 * sound.c (wav_play, au_play, Fplay_sound_internal):
13832 Fix pointer signedness.
13833 (alsa_choose_format): Remove unused local var.
13834 (wav_play): Initialize a variable to 0, to prevent undefined
13835 behavior (Bug#8278).
13836
13837 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
13838
13839 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
13840
13841 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
13842 clobbering (Bug#8298).
13843 * sysdep.c (sys_subshell): Likewise.
13844 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
13845
13846 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
13847 This should get cleaned up, so that child_setup has the
13848 same signature on all platforms.
13849
13850 * callproc.c (call_process_cleanup): Now static.
13851 (relocate_fd): Rename locals to avoid shadowing.
13852
13853 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
13854
13855 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
13856 not to be necessary, and produces flickering.
13857
13858 2011-03-20 Glenn Morris <rgm@gnu.org>
13859
13860 * config.in: Remove file.
13861
13862 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
13863
13864 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
13865 are now in src/globals.h.
13866 (syms_of_minibuf): Remove spurious & from previous change.
13867
13868 2011-03-20 Leo Liu <sdl.web@gmail.com>
13869
13870 * minibuf.c (completing-read-function): New variable.
13871 (completing-read-default): Rename from completing-read.
13872 (completing-read): Call completing-read-function.
13873
13874 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
13875
13876 * xfaces.c (Fx_load_color_file):
13877 Read color file from absolute filename (bug#8250).
13878
13879 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
13880
13881 * makefile.w32-in: Update dependencies.
13882
13883 2011-03-17 Eli Zaretskii <eliz@gnu.org>
13884
13885 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
13886
13887 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
13888
13889 Fix more problems found by GCC 4.5.2's static checks.
13890
13891 * process.c (make_serial_process_unwind, send_process_trap):
13892 (sigchld_handler): Now static.
13893
13894 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
13895 That way, the code declares only the vars that it needs.
13896 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
13897 * s/cygwin.h (PTY_ITERATION): Likewise.
13898 * s/darwin.h (PTY_ITERATION): Likewise.
13899 * s/gnu-linux.h (PTY_ITERATION): Likewise.
13900
13901 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
13902 * process.c (allocate_pty): Don't declare stb unless it's needed.
13903
13904 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
13905 (CONSTANTLIM): Remove; unused.
13906 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
13907 Define only if needed.
13908
13909 * unexelf.c (unexec): Name an expression,
13910 to avoid gcc -Wbad-function-cast warning.
13911 Use a different way to cause a compilation error if anyone uses
13912 n rather than nn, a way that does not involve shadowing.
13913 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
13914
13915 * deps.mk (unexalpha.o): Remove; unused.
13916
13917 New file unexec.h, the (simple) interface for unexec (Bug#8267).
13918 * unexec.h: New file.
13919 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
13920 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
13921 Depend on unexec.h.
13922 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
13923 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
13924 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
13925 Change as necessary to match prototype in unexec.h.
13926
13927 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
13928 shadowing.
13929 (back_comment, skip_chars): Mark vars as initialized.
13930
13931 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
13932 Rename locals to avoid shadowing.
13933
13934 * lread.c (read1): Rewrite so as not to use empty "else".
13935 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
13936
13937 * print.c (Fredirect_debugging_output): Fix pointer signedess.
13938
13939 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
13940 warning when compiling print.c.
13941
13942 * font.c (font_unparse_fcname): Abort in an "impossible" situation
13943 instead of using an uninitialized var.
13944 (font_sort_entities): Mark var as initialized.
13945
13946 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
13947
13948 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
13949 pointers to constants.
13950 (font_parse_fcname): Remove unused vars.
13951 (font_delete_unmatched): Now static.
13952 (font_get_spec): Remove; unused.
13953 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
13954 (font_update_drivers, Ffont_get_glyphs, font_add_log):
13955 Rename or move locals to avoid shadowing.
13956
13957 * fns.c (require_nesting_list, require_unwind): Now static.
13958 (Ffillarray): Rename locals to avoid shadowing.
13959
13960 * floatfns.c (domain_error2): Define only if needed.
13961 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
13962
13963 * alloc.c (mark_backtrace): Move decl from here ...
13964 * lisp.h: ... to here, so that it can be checked.
13965
13966 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
13967 (Fdefvar): Rewrite so as not to use empty "else".
13968 (lisp_indirect_variable): Name an expression,
13969 to avoid gcc -Wbad-function-cast warning.
13970 (Fdefvar): Rename locals to avoid shadowing.
13971
13972 * callint.c (quotify_arg, quotify_args): Now static.
13973 (Fcall_interactively): Rename locals to avoid shadowing.
13974 Use const pointer when appropriate.
13975
13976 * lisp.h (get_system_name, get_operating_system_release):
13977 Move decls here, to check interfaces.
13978 * process.c (get_operating_system_release): Move decl to lisp.h.
13979 * xrdb.c (get_system_name): Likewise.
13980 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
13981 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
13982 some of which prompt warnings from gcc -Wbad-function-cast.
13983 (Fformat_time_string, Fencode_time, Finsert_char):
13984 (Ftranslate_region_internal, Fformat):
13985 Rename or remove local vars to avoid shadowing.
13986 (Ftranslate_region_internal): Mark var as initialized.
13987
13988 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
13989 avoid shadowing.
13990
13991 * lisp.h (eassert): Check that the argument compiles, even if
13992 ENABLE_CHECKING is not defined.
13993
13994 * data.c (Findirect_variable): Name an expression, to avoid
13995 gcc -Wbad-function-cast warning.
13996 (default_value, arithcompare, arith_driver, arith_error): Now static.
13997 (store_symval_forwarding): Rename local to avoid shadowing.
13998 (Fmake_variable_buffer_local, Fmake_local_variable):
13999 Mark variables as initialized.
14000 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
14001
14002 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
14003 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
14004 Rename locals to avoid shadowing.
14005 (mark_stack): Move local variables into the #ifdef region where
14006 they're used.
14007 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
14008 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
14009 needed otherwise.
14010 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
14011 (GC_STRING_CHARS): Remove; not used.
14012 (Fmemory_limit): Cast sbrk's returned value to char *.
14013
14014 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
14015 avoids undefined behavior in theory.
14016
14017 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
14018
14019 Use functions, not macros, for up- and down-casing (Bug#8254).
14020 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
14021 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
14022 to use the following functions instead of these macros.
14023 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
14024 EMACS_INT, since callers assume the returned value fits in int.
14025 (upcase1): Likewise, for UPCASE_TABLE.
14026 (uppercasep, lowercasep, upcase): New static inline functions.
14027 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
14028 the race-condition problem in the old DOWNCASE.
14029
14030 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
14031 Rename locals to avoid shadowing.
14032 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
14033 (regex_compile, re_search_2, re_match_2_internal):
14034 Remove unused local vars.
14035 (FREE_VAR): Rewrite so as not to use empty "else",
14036 which gcc can warn about.
14037 (regex_compile, re_match_2_internal): Mark locals as initialized.
14038 (RETALLOC_IF): Define only if needed.
14039 (WORDCHAR_P): Likewise. This one is never needed, but is used
14040 only in a comment talking about a compiler bug, so put inside
14041 the #if 0 of that comment.
14042 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
14043 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
14044 Remove; unused.
14045
14046 * search.c (boyer_moore): Rename locals to avoid shadowing.
14047 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
14048 (PREV_CHAR_BOUNDARY): Likewise.
14049
14050 * search.c (simple_search): Remove unused var.
14051
14052 * dired.c (compile_pattern): Move decl from here ...
14053 * lisp.h: ... to here, so that it can be checked.
14054 (struct re_registers): New forward decl.
14055
14056 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
14057
14058 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
14059 All uses changed.
14060 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
14061 Rename locals to avoid shadowing.
14062 (Fvertical_motion): Mark locals as initialized.
14063
14064 * casefiddle.c (casify_object, casify_region): Now static.
14065 (casify_region): Mark local as initialized.
14066
14067 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
14068
14069 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
14070 New macros, so that the caller can use some names other than
14071 gcpro1, gcpro2, etc.
14072 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
14073 of the new macros.
14074 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
14075 argument, for consistency with GCPRO2_VAR, etc: it is now the
14076 prefix of the variable, not the variable itself. All uses
14077 changed.
14078 * dired.c (directory_files_internal, file_name_completion):
14079 Rename locals to avoid shadowing.
14080
14081 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
14082 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
14083 dired.c's scmp function, had undefined behavior.
14084 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
14085 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
14086 * buffer.h: ... to here, because these macros use current_buffer,
14087 and the new implementation with inline functions needs to have
14088 current_buffer in scope now, rather than later when the macros
14089 are used.
14090 (downcase, upcase1): New static inline functions.
14091 (DOWNCASE, UPCASE1): Reimplement using these functions.
14092 This avoids undefined behavior in expressions like
14093 DOWNCASE (x) == DOWNCASE (y), which previously suffered
14094 from race conditions in accessing the global variables
14095 case_temp1 and case_temp2.
14096 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
14097 * lisp.h (case_temp1, case_temp2): Remove their decls.
14098 * character.h (ASCII_CHAR_P): Move from here ...
14099 * lisp.h: ... to here, so that the inline functions mentioned
14100 above can use them.
14101
14102 * dired.c (directory_files_internal_unwind): Now static.
14103
14104 * fileio.c (file_name_as_directory, directory_file_name):
14105 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
14106 Now static.
14107 (file_name_as_directory): Use const pointers when appropriate.
14108 (Fexpand_file_name): Likewise. In particular, newdir might
14109 point at constant storage, so make it a const pointer.
14110 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
14111 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
14112 signedness issues.
14113 (Fset_file_times, Finsert_file_contents, auto_save_error):
14114 Rename locals to avoid shadowing.
14115
14116 * minibuf.c (choose_minibuf_frame_1): Now static.
14117 (Ftry_completion, Fall_completions): Rename or remove locals
14118 to avoid shadowing.
14119
14120 * marker.c (bytepos_to_charpos): Remove; unused.
14121
14122 * lisp.h (verify_bytepos, count_markers): New decls,
14123 so that gcc does not warn that these functions aren't declared.
14124
14125 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
14126 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
14127 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
14128 (copy_text): Remove unused local var.
14129
14130 * filelock.c (within_one_second): Now static.
14131 (lock_file_1): Rename local to avoid shadowing.
14132
14133 * buffer.c (fix_overlays_before): Mark locals as initialized.
14134 (fix_start_end_in_overlays): Likewise. This function should be
14135 simplified by using pointers-to-pointers, but that's a different
14136 matter.
14137 (switch_to_buffer_1): Now static.
14138 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
14139 (report_overlay_modification): Rename locals to avoid shadowing.
14140
14141 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
14142 Fix pointer signedness issue.
14143 (sys_subshell): Mark local as volatile if checking for lint,
14144 to suppress a gcc -Wclobbered warning that does not seem to be right.
14145 (MAXPATHLEN): Define only if needed.
14146
14147 * process.c (serial_open, serial_configure): Move decls from here ...
14148 * systty.h: ... to here, so that they can be checked.
14149
14150 * fns.c (get_random, seed_random): Move extern decls from here ...
14151 * lisp.h: ... to here, so that they can be checked.
14152
14153 * sysdep.c (reset_io): Now static.
14154 (wait_for_termination_signal): Remove; unused.
14155
14156 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
14157 (copy_keymap_item, append_key, push_text_char_description):
14158 Now static.
14159 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
14160 (DENSE_TABLE_SIZE): Remove; unused.
14161 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
14162 (describe_map_tree):
14163 Rename locals to avoid shadowing.
14164
14165 * keyboard.c: Declare functions static if they are not used elsewhere.
14166 (echo_char, echo_dash, cmd_error, top_level_2):
14167 (poll_for_input, handle_async_input): Now static.
14168 (read_char, kbd_buffer_get_event, make_lispy_position):
14169 (make_lispy_event, make_lispy_movement, apply_modifiers):
14170 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
14171 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
14172 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
14173 (read_key_sequence, read_char): Mark locals as initialized.
14174 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
14175
14176 * keyboard.h (make_ctrl_char): New decl.
14177 (mark_kboards): Move decl here ...
14178 * alloc.c (mark_kboards): ... from here.
14179
14180 * lisp.h (force_auto_save_soon): New decl.
14181
14182 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
14183 (DEFINE_DUMMY_FUNCTION): New macro.
14184 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
14185 Use it.
14186 (main): Add casts to avoid warnings
14187 if GCC considers string literals to be constants.
14188
14189 * lisp.h (fatal_error_signal): Add decl, since it's exported.
14190
14191 * dbusbind.c: Pointer signedness fixes.
14192 (xd_signature, xd_append_arg, xd_initialize):
14193 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14194 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14195 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
14196 (Fdbus_register_signal): Use SSDATA when the context wants char *.
14197
14198 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
14199 if GCC considers string literals to be constants.
14200 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
14201
14202 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
14203
14204 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
14205 (print_preprocess, print_object): New macro to fix last change.
14206
14207 * print.c (print_preprocess): Don't forget font objects.
14208
14209 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
14210
14211 * emacs.c (USAGE3): Doc fixes.
14212
14213 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
14214
14215 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
14216 structure.
14217
14218 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
14219
14220 * lisp.h (VWindow_system, Qfile_name_history):
14221 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
14222 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
14223 (w32_system_caret_x, w32_system_caret_y): Declare extern.
14224
14225 * w32select.c: Don't #include "keyboard.h".
14226 (run_protected): Add extern declaration for waiting_for_input.
14227
14228 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
14229 * w32console.c (detect_input_pending, read_input_pending)
14230 (encode_terminal_code):
14231 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
14232 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
14233 (w32_system_caret_y, Qfile_name_history):
14234 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
14235 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
14236 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
14237 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
14238 * w32proc.c (Qlocal, report_file_error):
14239 * w32term.c (Vwindow_system, updating_frame):
14240 * w32uniscribe.c (initialized, uniscribe_font_driver):
14241 Remove unneeded extern declarations.
14242
14243 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
14244
14245 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
14246
14247 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
14248
14249 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
14250 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
14251 These macros can no longer be used for assignment.
14252
14253 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
14254 Assign struct members directly, instead of using BUF_BEGV etc.
14255 (record_buffer_markers, fetch_buffer_markers): New functions for
14256 recording and fetching special buffer markers.
14257 (set_buffer_internal_1, set_buffer_temp): Use them.
14258
14259 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
14260
14261 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
14262
14263 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
14264 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
14265
14266 * xdisp.c (hscroll_window_tree):
14267 (reconsider_clip_changes): Use PT instead of BUF_PT.
14268
14269 2011-03-13 Eli Zaretskii <eliz@gnu.org>
14270
14271 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
14272 $(EMACS_ROOT)/lib/intprops.h.
14273
14274 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
14275
14276 Fix more problems found by GCC 4.5.2's static checks.
14277
14278 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
14279 to unsigned char * to avoid compiler diagnostic.
14280 (xg_free_frame_widgets): Make it clear that a local variable is
14281 needed only if USE_GTK_TOOLTIP.
14282 (gdk_window_get_screen): Make it clear that this macro is needed
14283 only if USE_GTK_TOOLTIP.
14284 (int_gtk_range_get_value): New function, which avoids a diagnostic
14285 from gcc -Wbad-function-cast.
14286 (xg_set_toolkit_scroll_bar_thumb): Use it.
14287 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
14288 diagnostic from gcc -Wbad-function-cast.
14289 (get_utf8_string, xg_get_file_with_chooser):
14290 Rename locals to avoid shadowing.
14291 (create_dialog): Move locals to avoid shadowing.
14292
14293 * xgselect.c (xg_select): Remove unused var.
14294
14295 * image.c (four_corners_best): Mark locals as initialized.
14296 (gif_load): Initialize transparent_p to zero (Bug#8238).
14297 Mark another local as initialized.
14298 (my_png_error, my_error_exit): Mark with NO_RETURN.
14299
14300 * image.c (clear_image_cache): Now static.
14301 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
14302 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
14303 (x_edge_detection): Remove unnecessary cast that
14304 gcc -Wbad-function-cast diagnoses.
14305 (gif_load): Fix pointer signedness.
14306 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
14307 (jpeg_load, gif_load): Rename locals to avoid shadowing.
14308
14309 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
14310
14311 Improve quality of tests for time stamp overflow.
14312 For example, without this patch (encode-time 0 0 0 1 1
14313 1152921504606846976) returns the obviously-bogus value (-948597
14314 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
14315 reports time overflow. See
14316 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
14317 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
14318 * editfns.c: Include limits.h and intprops.h.
14319 (TIME_T_MIN, TIME_T_MAX): New macros.
14320 (time_overflow): Move earlier, to before first use.
14321 (hi_time, lo_time): New functions, for an accurate test for
14322 out-of-range times.
14323 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
14324 (Fget_internal_run_time): Don't assume time_t fits in int.
14325 (make_time): Use list2 instead of Fcons twice.
14326 (Fdecode_time): More accurate test for out-of-range times.
14327 (check_tm_member): New function.
14328 (Fencode_time): Use it, to test for out-of-range times.
14329 (lisp_time_argument): Don't rely on undefined left-shift and
14330 right-shift behavior when checking for time stamp overflow.
14331
14332 * editfns.c (time_overflow): New function, refactoring common code.
14333 (Fformat_time_string, Fdecode_time, Fencode_time):
14334 (Fcurrent_time_string): Use it.
14335
14336 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
14337 * dired.c (make_time): Move to ...
14338 * editfns.c (make_time): ... here.
14339 * systime.h: Note the move.
14340
14341 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14342
14343 * fringe.c (update_window_fringes): Remove unused variables.
14344
14345 * unexmacosx.c (copy_data_segment): Also copy __got section.
14346 (Bug#8223)
14347
14348 2011-03-12 Eli Zaretskii <eliz@gnu.org>
14349
14350 * termcap.c [MSDOS]: Include "msdos.h".
14351 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
14352 Constify `char *' arguments and their references according to
14353 prototypes in tparam.h.
14354
14355 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
14356
14357 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
14358 Adapt all references accordingly.
14359
14360 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
14361
14362 2011-03-11 Tom Tromey <tromey@redhat.com>
14363
14364 * buffer.c (syms_of_buffer): Remove obsolete comment.
14365
14366 2011-03-11 Eli Zaretskii <eliz@gnu.org>
14367
14368 * termhooks.h (encode_terminal_code): Declare prototype.
14369
14370 * msdos.c (encode_terminal_code): Don't declare prototype.
14371
14372 * term.c (encode_terminal_code): Now external again, used by
14373 w32console.c and msdos.c.
14374
14375 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
14376 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
14377
14378 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
14379
14380 Fix some minor problems found by GCC 4.5.2's static checks.
14381
14382 * fringe.c (update_window_fringes): Mark locals as initialized
14383 (Bug#8227).
14384 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
14385
14386 * alloc.c (mark_fringe_data): Move decl from here ...
14387 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
14388 to check its interface.
14389 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
14390
14391 * fontset.c (free_realized_fontset): Now static.
14392 (Fset_fontset_font): Rename local to avoid shadowing.
14393 (fontset_font): Mark local as initialized.
14394 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
14395
14396 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
14397
14398 * xselect.c (x_disown_buffer_selections): Remove; not used.
14399 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
14400 (x_own_selection, Fx_disown_selection_internal): Rename locals
14401 to avoid shadowing.
14402 (x_handle_dnd_message): Remove local to avoid shadowing.
14403
14404 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
14405 so that the caller can use some name other than gcpro1.
14406 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
14407 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
14408 (Fx_backspace_delete_keys_p):
14409 Use them to avoid shadowing, and rename vars to avoid shadowing.
14410 (x_decode_color, x_set_name, x_window): Now static.
14411 (Fx_create_frame): Add braces to silence GCC warning.
14412 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
14413 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
14414 Remove unused locals.
14415 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
14416 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
14417 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
14418 macros.
14419
14420 * xterm.h (x_mouse_leave): New decl.
14421
14422 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
14423 Remove unused functions.
14424 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
14425 (x_calc_absolute_position): Now static.
14426 (XTread_socket): Don't define label "out" unless it's used.
14427 Don't declare local "event" unless it's used.
14428 (x_iconify_frame, x_free_frame_resources): Don't declare locals
14429 unless they are used.
14430 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
14431 (x_fatal_error_signal): Remove; not used.
14432 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
14433 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
14434 (x_error_catcher, x_connection_closed, x_error_handler):
14435 (x_error_quitter, xembed_send_message, x_iconify_frame):
14436 (my_log_handler): Rename locals to avoid shadowing.
14437 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
14438 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
14439
14440 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
14441 Rename or move locals to avoid shadowing.
14442 (tty_defined_color, merge_face_heights): Now static.
14443 (free_realized_faces_for_fontset): Remove; not used.
14444 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
14445 does not deduce is never used uninitialized.
14446 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
14447 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
14448
14449 * terminal.c (store_terminal_param): Now static.
14450
14451 * xmenu.c (menu_highlight_callback): Now static.
14452 (set_frame_menubar): Remove unused local.
14453 (xmenu_show): Rename parameter to avoid shadowing.
14454 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
14455 since they might point to immutable storage.
14456 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
14457 since it's unused otherwise.
14458
14459 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
14460 Add a FIXME, since the code still doesn't look right. (Bug#8215)
14461 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
14462 avoids a gcc -Wuninitialized diagnostic.
14463 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
14464 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
14465 does not deduce are never used uninitialized.
14466
14467 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
14468
14469 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
14470 * window.c (window_loop, size_window):
14471 (run_window_configuration_change_hook, enlarge_window): Likewise.
14472
14473 * window.c (display_buffer): Now static.
14474 (size_window): Mark variables that gcc -Wuninitialized
14475 does not deduce are never used uninitialized.
14476 * window.h (check_all_windows): New decl, to forestall
14477 gcc -Wmissing-prototypes diagnostic.
14478 * dispextern.h (bidi_dump_cached_states): Likewise.
14479
14480 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
14481 shadowing.
14482 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
14483 Include <limits.h>.
14484 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
14485 and to avoid gcc -Wuninitialized warning.
14486 (load_charset_map): Mark variables that gcc -Wuninitialized
14487 does not deduce are never used uninitialized.
14488 (load_charset): Abort instead of using uninitialized var (Bug#8229).
14489
14490 * coding.c (coding_set_source, coding_set_destination):
14491 Use "else { /* comment */ }" rather than "else /* comment */;"
14492 for clarity, and to avoid gcc -Wempty-body warning.
14493 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
14494 a block, when the outer 'i' will do.
14495 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
14496 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
14497 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
14498 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
14499 (Fdecode_sjis_char, Fdefine_coding_system_internal):
14500 Rename locals to avoid shadowing.
14501 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
14502 * coding.c (emacs_mule_char, encode_invocation_designation):
14503 Now static, since they're not used elsewhere.
14504 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
14505 (decode_coding_object, encode_coding_object, detect_coding_system):
14506 (decode_coding_emacs_mule): Mark variables that gcc
14507 -Wuninitialized does not deduce are never used uninitialized.
14508 (detect_coding_iso_2022): Initialize a local variable that might
14509 be used uninitialized. Leave a FIXME because it's not clear that
14510 this initialization is needed. (Bug#8211)
14511 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
14512 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
14513 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
14514 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
14515 Remove unused macros.
14516
14517 * category.c (hash_get_category_set): Remove unused local var.
14518 (copy_category_table): Now static, since it's not used elsewhere.
14519 * character.c (string_count_byte8): Likewise.
14520
14521 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
14522 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
14523
14524 * chartab.c (copy_sub_char_table): Now static, since it's not used
14525 elsewhere.
14526 (sub_char_table_ref_and_range, char_table_ref_and_range):
14527 Rename locals to avoid shadowing.
14528 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
14529
14530 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
14531 (BIDI_BOB): Remove unused macro.
14532
14533 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
14534 deduce are never used uninitialized.
14535 * term.c (encode_terminal_code): Likewise.
14536
14537 * term.c (encode_terminal_code): Now static. Remove unused local.
14538
14539 * tparam.h: New file.
14540 * term.c, tparam.h: Include it.
14541 * deps.mk (term.o, tparam.o): Depend on tparam.h.
14542 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
14543 Move these decls to tparam.h, and make them agree with what
14544 is actually in tparam.c. The previous trick of using incompatible
14545 decls in different modules does not conform to the C standard.
14546 All callers of tparam changed to use tparam's actual API.
14547 * tparam.c (tparam1, tparam, tgoto):
14548 Use const pointers where appropriate.
14549
14550 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
14551 * cm.h (struct cm): Likewise.
14552 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
14553 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
14554 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
14555 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
14556 (turn_on_face, init_tty): Likewise.
14557 * termchar.h (struct tty_display_info): Likewise.
14558
14559 * term.c (term_mouse_position): Rename local to avoid shadowing.
14560
14561 * alloc.c (mark_ttys): Move decl from here ...
14562 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
14563
14564 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
14565
14566 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
14567
14568 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
14569
14570 * search.c (compile_pattern_1): Remove argument regp, unused since
14571 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
14572 (compile_pattern): Don't pass it.
14573
14574 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
14575
14576 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
14577 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
14578 for ! HAVE_GTK3.
14579 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
14580
14581 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
14582
14583 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
14584 gdk_window_get_screen, gdk_window_get_geometry,
14585 gdk_x11_window_lookup_for_display and GDK_KEY_g.
14586 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
14587 (xg_get_pixbuf_from_pixmap): New function.
14588 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
14589 to Pixmap, take frame as parameter, remove GdkColormap parameter.
14590 Call xg_get_pixbuf_from_pixmap instead of
14591 gdk_pixbuf_get_from_drawable.
14592 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
14593 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
14594 (xg_check_special_colors): Use GtkStyleContext and its functions
14595 for HAVE_GTK3.
14596 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
14597 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
14598 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
14599 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
14600 Call gtk_widget_get_preferred_size.
14601 (xg_frame_resized): gdk_window_get_geometry only takes 5
14602 parameters.
14603 (xg_win_to_widget, xg_event_is_for_menubar):
14604 Call gdk_x11_window_lookup_for_display.
14605 (xg_set_widget_bg): New function.
14606 (delete_cb): New function.
14607 (xg_create_frame_widgets): Connect delete-event to delete_cb.
14608 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
14609 (xg_set_background_color): Call xg_set_widget_bg.
14610 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
14611 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
14612 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
14613 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
14614 if ! HAVE_GTK3.
14615 (update_frame_tool_bar): Call gtk_widget_hide.
14616 (xg_initialize): Use GDK_KEY_g.
14617
14618 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
14619 if ! HAVE_GTK3
14620 (x_session_initialize): Call gdk_x11_set_sm_client_id.
14621
14622 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
14623 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
14624 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
14625
14626 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
14627
14628 * w32xfns.c (select_palette): Check success of RealizePalette against
14629 GDI_ERROR, not zero.
14630
14631 See ChangeLog.11 for earlier changes.
14632
14633 ;; Local Variables:
14634 ;; coding: utf-8
14635 ;; End:
14636
14637 Copyright (C) 2011-2012 Free Software Foundation, Inc.
14638
14639 This file is part of GNU Emacs.
14640
14641 GNU Emacs is free software: you can redistribute it and/or modify
14642 it under the terms of the GNU General Public License as published by
14643 the Free Software Foundation, either version 3 of the License, or
14644 (at your option) any later version.
14645
14646 GNU Emacs is distributed in the hope that it will be useful,
14647 but WITHOUT ANY WARRANTY; without even the implied warranty of
14648 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14649 GNU General Public License for more details.
14650
14651 You should have received a copy of the GNU General Public License
14652 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.