Cleanup string bytes checking.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
e499d0ee
DA
12012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2
3 Cleanup string bytes checking.
4 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
5 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
6 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
7 (check_sblock, compact_small_strings): Simplify.
8
d5040d2d
PE
92012-07-29 Paul Eggert <eggert@cs.ucla.edu>
10
11 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
12 These macros are confusing and no longer need to be defined, as
13 the enum values now suffice. All uses replaced with definiens.
14 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
15
7f259ae6
JB
162012-07-29 Juanma Barranquero <lekktu@gmail.com>
17
18 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
19 ($(BLD)/w32console.$(O)): Update dependencies.
20
7e63e0c3
DA
212012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
22
23 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
24 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
25 time. Adjust users.
26 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
27
ffd817eb
JD
282012-07-29 Jan Djärv <jan.h.d@swipnet.se>
29
30 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
31 setting sitelisp (Bug#12010).
32
417a7a0e
EZ
332012-07-29 Eli Zaretskii <eliz@gnu.org>
34
35 * w32heap.h (OS_9X): Renamed from OS_WINDOWS_95.
36
37 * w32heap.c (cache_system_info):
38 * w32.c (sys_rename):
39 * w32proc.c (find_child_console, sys_kill): All users changed.
40
387d4d92
PE
412012-07-29 Paul Eggert <eggert@cs.ucla.edu>
42
43 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
44
55a6cca6
EZ
452012-07-29 Eli Zaretskii <eliz@gnu.org>
46
47 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
48
dbcf001c
DA
492012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
50
51 Cleanup statistics calculation in Fgarbage_collect.
52 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start. Fix
53 zombies percentage calculation. Simplify elapsed time calculation.
54
e2688e4a
DA
552012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
56
57 Generalize marker debugging code under MARKER_DEBUG and use eassert.
58 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
59 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
60 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
61 (replace_range, replace_range_2, del_range_2): Change to eassert.
62 * marker.c (byte_char_debug_check): Adjust style.
63
b46a6a83
PE
642012-07-29 Paul Eggert <eggert@cs.ucla.edu>
65
66 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
67 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
68 long-ago-commented-out code that talks about "WIN32".
69 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
70 All uses changed.
71
e32a5799
PE
722012-07-28 Paul Eggert <eggert@cs.ucla.edu>
73
74 Use Gnulib stdalign module (Bug#9772, Bug#9960).
75 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
76 Simplify by using alignof.
77 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
78 * lisp.h: Include <stdalign.h>.
79 (GCALIGNMENT): New macro and constant.
80 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
81 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
82 (stdalign): New macro, if not already defined.
83
df81cd29
EZ
842012-07-28 Eli Zaretskii <eliz@gnu.org>
85
01bd1b0d
EZ
86 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
87 * w32inevt.c: Include w32inevt.h.
88 (w32_read_console_input): New inline function, calls either
89 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
90 w32_console_unicode_input.
91 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
92 (w32_kbd_patch_key, key_event): Use the codepage returned by
93 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
94 (key_event): use uChar.UnicodeChar only if
95 w32_console_unicode_input is non-zero.
96
97 * w32console.c: Include w32heap.h.
98 <w32_console_unicode_input>: New global variable.
99 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
100 family of Windows, zero otherwise.
101
102 * w32inevt.h: Declare w32_console_unicode_input.
103
df81cd29
EZ
104 * xdisp.c (init_iterator): Don't reference tip_frame in a build
105 --without-x. (Bug#11742)
106
c20fdd9e
PE
1072012-07-27 Paul Eggert <eggert@cs.ucla.edu>
108
109 Adjust GDB to reflect pvec_type changes (Bug#12036).
110 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
111 2012-07-04 changes to pseudovector representation. Problem
112 reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
113
32770973 1142012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
115
116 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
117 bus address.
118 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
119
3438fe21
EZ
1202012-07-27 Eli Zaretskii <eliz@gnu.org>
121
bcfbc9de
EZ
122 * alloc.c (listn): Fix the order the arguments are consed onto the
123 list.
124
3438fe21
EZ
125 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
126 enumeration constants, as PURE and HEAP are too general, and clash
127 with other headers and sources, such as gmalloc.c and the
128 MS-Windows system headers. All users changed.
129
eeaea515
DA
1302012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
131
132 Revert last save_excursion_save and save_excursion_restore changes.
133 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
134 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
135
073c88c2
DA
1362012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
137
138 Fix recently-introduced typos in Windows port.
139 Reported by Martin Rudalics <rudalics@gmx.at>.
140 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 141 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 142
4706125e
PE
1432012-07-27 Paul Eggert <eggert@cs.ucla.edu>
144
145 Improve GDB symbol export (Bug#12036).
146 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
147 arms of an 'if', not using conditional expressions; otherwise GDB
148 complains about the types in the unevaluated arm when the argument
149 is an integer literal.
150 (xgetint): Simplify expression.
151 * alloc.c (gdb_make_enums_visible): New constant. This ports to
152 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
153 Zaretskii in <http://bugs.gnu.org/12036#13>.
154 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
155 needed now that we have gdb_make_enums_visible.
156 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
157 (enum enum_USE_LSB_TAG):
158 New enum types, packaging up enums that need to be exported to GDB.
159
694b6c97
DA
1602012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
161
162 Utility function to make a list from specified amount of objects.
163 * lisp.h (enum constype): New datatype.
164 (listn): New prototype.
165 * alloc.c (listn): New function.
166 (Fmemory_use_count, syms_of_alloc): Use it.
167 * buffer.c (syms_of_buffer): Likewise.
168 * callint.c (syms_of_callint): Likewise.
169 * charset.c (define_charset_internal): Likewise.
170 * coding.c (syms_of_coding): Likewise.
171 * keymap.c (syms_of_keymap): Likewise.
172 * search.c (syms_of_search): Likewise.
173 * syntax.c (syms_of_syntax): Likewise.
174 * w32.c (init_environment): Likewise.
175 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
176 * xdisp.c (syms_of_xdisp): Likewise.
177 * xfns.c (syms_of_xfns): Likewise.
178
6195f384
DA
1792012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
180
181 Fast save_excursion_save and save_excursion_restore.
182 * lisp.h (struct Lisp_Excursion): New data type.
183 (PVEC_EXCURSION): New pseudovector type.
184 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
185 to deal with it. Adjust comments.
186 (init_marker, attach_marker): New prototype.
187 (unchain_marker): Adjust prototype.
188 * marker.c (attach_marker): Change to global.
189 (init_marker): New function.
190 * alloc.c (Fmake_marker, build_marker): Use it.
191 (build_marker): More easserts.
192 (mark_object): Handle struct Lisp_Excursion.
193 * editfns.c (save_excursion_save, save_excursion_restore):
194 Reimplement to use struct Lisp_Excursion. Add comments.
195
5eceb8fb
PE
1962012-07-26 Paul Eggert <eggert@cs.ucla.edu>
197
198 Fix export of symbols to GDB (Bug#12036).
199 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
200 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
201 emacs.c, as this is a more-suitable home. Had this been done earlier
202 the fix for 12036 would have avoided some of the problems noted in
203 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
204 would have been more obvious.
562157c8
PE
205 * emacs.c: Do not include <verify.h>; no longer needed.
206 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
207 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
208 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
209 Remove; now done in lisp.h.
210 * lisp.h (PUBLISH_TO_GDB): New macro.
211 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
212 (DATA_SEG_BITS): Use it.
213 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
214 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
215 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
216 not be usable in #if. This simplifies things.
217
d6749401
JB
2182012-07-26 Juanma Barranquero <lekktu@gmail.com>
219
220 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
221
1781b9e9
PE
2222012-07-26 Paul Eggert <eggert@cs.ucla.edu>
223
d89518db 224 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
225 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
226 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
227 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
228 Adjust to changes in lisp.h and emacs.c, by using
229 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
230 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
231 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
232 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
233 instead of gdb_valbits.
234 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
235 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
236 instead of gdb_array_mark_flag.
237 (xboolvector): Get size from $->size, not $->header.size.
238 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
239 (xreload, hook-run, hookpost-run): Remove.
240 * emacs.c: Include <verify.h>.
241 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
242 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
243 Remove.
244 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
245 (gdb_USE_LSB_TAG): New enum constants.
246 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
247 Also define these as enum constants, so they're visible to GDB.
248 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
249 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
250 as constants, so they're visible to GDB.
251 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
252 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
253 Now enum constants, not macros, so they're visible to GDB.
254 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
255 more convenient now. All uses changed.
256 (VALMASK) [USE_LSB_TAG]: Also define in this case.
257 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
258
3628596a
DA
2592012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
260
261 Explicitly free restriction data that are not needed anymore.
262 * editfns.c (save_restriction_restore): Free restriction data.
263
7abaf5cc
SM
2642012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
265
266 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
267 add argument, tune behavior, and adjust all callers.
268
71f88e00
PE
2692012-07-25 Paul Eggert <eggert@cs.ucla.edu>
270
271 Use typedef for EMACS_INT, EMACS_UINT.
272 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
273 than macros. This simplifies debugging in the usual case, since
274 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
275 and it allows expressions involving EMACS_INT casts.
276 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
277
57ec3034
JD
2782012-07-25 Jan Djärv <jan.h.d@swipnet.se>
279
280 * nsterm.m (ns_read_socket): Return early if there is a modal
281 window (Bug#12043).
282
8137e7b3
MR
2832012-07-25 Martin Rudalics <rudalics@gmx.at>
284
285 * frame.c (Fredirect_frame_focus): In doc-string don't mention
286 that FOCUS-FRAME can be omitted.
287
04e9897c
DA
2882012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
289
290 Adjust buffer text indirection counters at the end of Fkill_buffer.
291 * buffer.c (Fkill_buffer): Adjust indirection counters when the
292 buffer is definitely dead. This should really fix an issue reported
293 by Christoph Scholtes again. (Bug#12007).
294 (init_buffer_once): Initialize indirection counters of
295 buffer_defaults and buffer_local_symbols (for sanity and safety).
296
8a0484e1
EZ
2972012-07-24 Eli Zaretskii <eliz@gnu.org>
298
299 * xdisp.c (init_iterator): Don't compute dimensions of truncation
300 and continuation glyphs on tooltip frames, leave them at zero.
301 Avoids continued lines in tooltips. (Bug#11832)
302
fa691a83
DA
3032012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
304
305 Simplify copy_overlay.
04e9897c 306 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
307 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
308
436bc8e0
EZ
3092012-07-23 Eli Zaretskii <eliz@gnu.org>
310
311 * print.c (print_object): Don't crash when a frame's name is nil
312 or invalid. (Bug#12025)
313
314 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
315 it signals an error when a tooltip frame is being created.
316
d7a7fda3
DA
3172012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
318
319 Cleanup miscellaneous objects allocation and initialization.
320 * alloc.c (allocate_misc): Change to static. Add argument to
321 specify the subtype. Adjust comment and users.
322 (build_overlay): New function.
323 * buffer.c (copy_overlays, Fmake_overlay): Use it.
324 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
325 (allocate_misc): Remove prototype.
326 (build_overlay): Add prototype.
327
3282012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
329
330 Swap buffer text indirection counters in Fbuffer_swap_text.
331 * buffer.c (Fbuffer_swap_text): Swap indirections too.
332 This avoids crash reported by Christoph Scholtes at
333 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
334
9d7fa573
JD
3352012-07-22 Jan Djärv <jan.h.d@swipnet.se>
336
337 * nsmenu.m (Popdown_data): New struct.
338 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
339 free Popdown_data.
340 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
341 (initWithContentRect): Make imgView and contentView non-static
342 and autorelease them. Also autorelease img and matrix (Bug#12005).
343 (dealloc): Remove (Bug#12005).
344
0dd6d66d
DA
3452012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
346
347 Adjust consing_since_gc when objects are explicitly freed.
348 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
349 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
350 (free_cons, free_misc): Subtract object size from consing_since_gc.
351
d36d71df
DA
3522012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
353
354 Simplify and cleanup markers positioning code.
355 * marker.c (attach_marker): More useful eassert.
356 (live_buffer, set_marker_internal): New function.
357 (Fset_marker, set_marker_restricted): Use set_marker_internal.
358 (set_marker_both, set_marker_restricted_both): Use live_buffer.
359
fb9ea40f
PE
3602012-07-22 Paul Eggert <eggert@cs.ucla.edu>
361
362 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
363 as it's limited by the amount of memory, not by INT_MAX.
364
2d5c5f7d
EZ
3652012-07-21 Eli Zaretskii <eliz@gnu.org>
366
07fb592e
EZ
367 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
368 in special-event-map. See the discussion at
369 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
370 for the reasons.
371
37a9eac8 372 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
2d5c5f7d
EZ
373 info.dwItemData. Fixes crashes on 64-bit Windows. Suggested by
374 Fabrice Popineau <fabrice.popineau@supelec.fr>.
375
c4328746
JD
3762012-07-21 Jan Djärv <jan.h.d@swipnet.se>
377
378 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 379 (conversationIdentifier): Return value is NSInteger.
784051c4 380 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 381
6e5d1c12
CY
3822012-07-21 Chong Yidong <cyd@gnu.org>
383
384 * window.c (decode_any_window): Signal an error if the window is
385 on a dead frame (Bug#11984).
386
9928463d
DA
3872012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
388
389 Add indirection counting to speed up Fkill_buffer.
390 * buffer.h (struct buffer): New member.
391 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
392 (Fmake_indirect_buffer): Set indirection counter to -1, increment
393 base buffer indirection counter.
394 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
395 (Fkill_buffer): Adjust indirection counters as needed, don't walk
396 through buffer list if indirection counter is 0.
397
f8643a6b
DA
3982012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
399
400 Extend the value returned by Fgarbage_collect with heap statistics.
401 * alloc.c (Qheap): New symbol.
402 (syms_of_alloc): DEFSYM it.
403 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
404 (Fmemory_free): Remove.
405 (syms_of_alloc): Don't defsubr it.
406 * buffer.c (Fcompact_buffer): Remove.
407 (syms_of_buffer): Don't defsubr it.
408
dac616ff
DA
4092012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
410
411 Make maybe_gc inline.
412 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
413 * lisp.h (consing_since_gc, gc_relative_threshold)
414 (memory_full_cons_threshold): Revert declaration.
415 (maybe_gc): Remove prototype, define as inline.
416 * alloc.c: Remove old commented-out code.
417 (consing_since_gc, gc_relative_threshold)
418 (memory_full_cons_threshold): Revert to global.
419 (maybe_gc): Remove.
420
d7ea76b4
DA
4212012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
422
423 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
424 * lisp.h (build_unibyte_string): New function.
425 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
426 * sysdep.c, w32fns.c, xfns.c: Use it.
427 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
428 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
429 Adjust users accordingly.
430 * font.h (font_open_by_name): Adjust prototype.
431
765e61e3
DA
4322012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
433
434 Cleanup calls to Fgarbage_collect.
435 * lisp.h (maybe_gc): New prototype.
436 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
437 Remove declarations.
438 * alloc.c (maybe_gc): New function.
439 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
440 Make them static.
441 * bytecode.c (MAYBE_GC): Use maybe_gc.
442 * eval.c (eval_sub, Ffuncall): Likewise.
443 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
444 to avoid dependency from auto-save feature.
445
52b852c7
PE
4462012-07-19 Paul Eggert <eggert@cs.ucla.edu>
447
448 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
449 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
450 'for_each_per_buffer_object_at'.
451 All uses changed. It's better to use upper-case for macros that
452 cannot be implemented as functions, to give the reader a clue
453 that they're special.
454
5db81e33
SM
4552012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
456
457 * alloc.c (Fgarbage_collect): Tweak docstring.
458
5b835e1d
DA
4592012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
460
461 Tweak the value returned from Fgarbage_collect again.
462 * alloc.c (Fgarbage_collect): New return value, as confirmed in
463 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
464 Adjust documentation.
465 (total_vector_bytes): Rename to total_vector_slots, adjust
466 accounting.
467 (total_free_vector_bytes): Rename to total_free_vector_slots,
468 adjust accounting.
469 (Qstring_bytes, Qvector_slots): New symbols.
470 (syms_of_alloc): DEFSYM them.
471
9cd47b72
DA
4722012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
473
474 Buffer compaction primitive which may be used from Lisp.
475 * buffer.c (compact_buffer, Fcompact_buffer): New function.
476 (syms_of_buffer): Register Fcompact_buffer.
477 * alloc.c (Fgarbage_collect): Use compact_buffer.
478 * buffer.h (compact_buffer): New prototype.
479 (struct buffer_text): New member.
480
d17337e5
DA
4812012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
482
483 New macro to iterate over all buffers, miscellaneous cleanups.
484 * lisp.h (all_buffers): Remove declaration.
485 * buffer.h (all_buffers): Add declaration, with comment.
486 (for_each_buffer): New macro.
487 * alloc.c (Fgarbage_collect, mark_object): Use it.
488 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
489 (init_buffer): Likewise.
490 * data.c (Fset_default): Likewise.
491 * coding.c (code_conversion_restore): Remove redundant check
492 for dead buffer.
493 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
494
60cfd278
AS
4952012-07-18 Andreas Schwab <schwab@linux-m68k.org>
496
497 Fix bug that created negative-length intervals.
498 * intervals.c (merge_interval_right, merge_interval_left):
499 Do not zero out this interval if it is absorbed by its children,
500 as this interval's total length doesn't change in that case. See
501 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
502
d06714cb
PE
5032012-07-18 Paul Eggert <eggert@cs.ucla.edu>
504
83713154
PE
505 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
506 when invoking (make-bool-vector N t) and N is a positive
507 multiple of 8 -- the last 8 bits were mistakenly cleared.
508
d06714cb
PE
509 Remove some struct layout assumptions in bool vectors.
510 * alloc.c (bool_header_size): New constant.
511 (header_size, word_size): Move earlier, as they're now used earlier.
512 Use 'word_size' in a few more places, where it's appropriate.
513 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
514 padding before the data member of a bool vector.
515 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
516 than doing the check by hand with an abort ().
517
464d5a5e
SM
5182012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
519
5fbc0409
SM
520 * eval.c (Fdefvar): Don't check constants since we only set the var if
521 it's not yet defined anyway (bug#11904).
522
464d5a5e
SM
523 * lisp.h (last_undo_boundary): Declare new var.
524 * keyboard.c (command_loop_1): Set it.
525 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
526 were auto-added by the command loop (bug#11774).
527
8dc2e44a
AS
5282012-07-18 Andreas Schwab <schwab@linux-m68k.org>
529
530 * w32font.c (Qsymbol): Remove local definition.
531 (syms_of_w32font): Don't DEFSYM it.
532
169925ec
DA
5332012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
534
535 Fix sweep_vectors to handle large bool vectors correctly.
536 * alloc.c (sweep_vectors): Account total_vector_bytes for
537 bool vectors larger than VBLOCK_BYTES_MAX.
538
5fbfb018
CY
5392012-07-18 Chong Yidong <cyd@gnu.org>
540
541 * frame.c (x_set_frame_parameters): Revert bogus change introduced
542 in 2012-05-25 commit by Paul Eggert (Bug#11738).
543
3ab6e069
DA
5442012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
545
546 Return more descriptive data from Fgarbage_collect.
547 Suggested by Stefan Monnier in
548 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
549 * alloc.c (bounded_number): New function.
550 (total_buffers, total_vectors): New variable.
551 (total_string_size): Rename to total_string_bytes, adjust users.
552 (total_vector_size): Rename to total_vector_bytes, adjust users.
553 (sweep_vectors): Account total_vectors and total_vector_bytes.
554 (Fgarbage_collect): New return value. Adjust documentation.
555 (gc_sweep): Account total_buffers.
556 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
557 (VECTOR_SIZE): Remove.
558 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
559 (Qinterval, Qmisc): New symbols.
560 (syms_of_data): Initialize them.
561 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
562 (Qcons, Qbuffer): New declarations.
563
6d02fe5b
PE
5642012-07-17 Paul Eggert <eggert@cs.ucla.edu>
565
566 * alloc.c (Fmemory_free): Account for memory-free's own storage.
567 Round up, not down. Improve doc.
568
b7ffe040
DA
5692012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
570
571 Restore old code in allocate_string_data to avoid Faset breakage.
572 Reported by Julien Danjou <julien@danjou.info> in
573 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
574 * alloc.c (allocate_string_data): Restore old code with minor
575 adjustments, fix comment to explain this subtle issue.
576
4dc7c8d5
SM
5772012-07-17 Eli Zaretskii <eliz@gnu.org>
578
579 Remove FILE_SYSTEM_CASE.
580 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
581
582 * fileio.c (FILE_SYSTEM_CASE): Don't define.
583 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
584 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
585 call-process-region passes it through expand-file-name.
586
587 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
588
5892012-07-17 Andreas Schwab <schwab@linux-m68k.org>
590
591 Fix crash when creating indirect buffer (Bug#11917)
592 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
593 Don't handle unbound variables specially if non-zero.
594 (Fbuffer_local_variables): Pass zero.
595 (clone_per_buffer_values): Pass non-zero.
596
5972012-07-17 Andreas Schwab <schwab@linux-m68k.org>
598
599 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
600 to make the loop interruptible.
601
6022012-07-17 Andreas Schwab <schwab@linux-m68k.org>
603
604 * gnutls.c (emacs_gnutls_handshake): Only retry if
605 GNUTLS_E_INTERRUPTED.
606
cce7fefc
DA
6072012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
608
609 Cleanup and convert miscellaneous checks to eassert.
610 * alloc.c (mark_interval): Fix comment, partially rephrase
611 old comment from intervals.h (see below).
612 * intervals.c (find_interval, adjust_intervals_for_insertion)
613 (delete_interval, adjust_intervals_for_deletion)
614 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
615 Convert to eassert.
616 (adjust_intervals_for_insertion, make_new_interval):
617 Remove obsolete and unused code.
618 * intervals.h (struct interval): Remove obsolete comment.
619 * textprotp.c (erase_properties): Remove unused code.
620 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
621 (Fremove_list_of_text_properties): Convert to eassert.
622
9ea10cc3
CY
6232012-07-17 Chong Yidong <cyd@gnu.org>
624
625 * editfns.c (Finsert_char): Doc fix.
626
3900d5de
DA
6272012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
628
629 Fix previous change to make Fmemory_free always accurate.
630 * alloc.c (make_interval): Update total_free_intervals.
631 (make_float): Likewise for total_free_floats.
632 (free_cons, Fcons): Likewise for total_free_conses.
633 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
634 Likewise for total_free_vector_bytes.
635 (Fmake_symbol): Likewise for total_free_symbols.
636 (bytes_free): Remove.
637
7098646f
DA
6382012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
639
640 Simple free memory accounting feature.
641 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
642 (sweep_vectors): Accumulate size of free vectors.
643 (Fgarbage_collect): Setup bytes_free.
644 (Fmemory_free): New function.
645 (syms_of_alloc): Register it.
646
22657b40
DA
6472012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
648
649 Cleanup overlays checking.
650 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
651 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
652 eassert and OVERLAYP.
653 (sort_overlays): Change to use OVERLAYP.
654
ddfc8813
RK
6552012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
656
657 * editfns.c (Finsert_char): Make it interactive, and make the
658 second arg optional. Copy interactive spec and docstring from
659 ucs-insert.
660
7c26cf3c
PE
6612012-07-17 Paul Eggert <eggert@cs.ucla.edu>
662
663 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
664 Unlike the other wrapped functions, fabs has an unspecified
665 effect on errno.
666
5d127af9
JD
6672012-07-16 Jan Djärv <jan.h.d@swipnet.se>
668
669 * nsterm.m (keyDown): Interpret flags without left/right bits
670 as the left key (Bug#11670).
671
6a0dd1d7
DA
6722012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
673
674 Remove empty and useless init functions.
675 * lisp.h (init_character_once, init_fns, init_image)
676 (init_filelock, init_sound): Remove prototype.
677 * character.c (init_character_once): Remove.
678 * filelock.c (init_filelock): Likewise.
679 * fns.c (init_fns): Likewise.
680 * image.c (init_image): Likewise.
681 * sound.c (init_sound): Likewise.
682 * emacs.c (main): Adjust accordingly.
683
7a6136fd
DA
6842012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
685
686 * gtkutil.h: Tiny cleanups.
687 (use_old_gtk_file_dialog): Remove useless declaration.
688 (xg_uses_old_file_dialog): Add suggested const attribute.
689
ce811ad9
EZ
6902012-07-15 Eli Zaretskii <eliz@gnu.org>
691
692 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
693 (bidi_paragraph_init): Use it to limit search forward for a strong
694 directional character in abnormally large paragraphs full of
695 neutral or weak characters. (Bug#11943)
696
c9adfeaa
SF
6972012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
698
699 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
700 the toolbar (Bug#9451).
701 (xg_make_tool_item): Give the widget event box a transparent
702 background.
703
fff62aa9
DA
7042012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
705
706 Cleanup basic allocation variables and functions.
707 * alloc.c (ignore_warnings, init_intervals, init_float)
708 (init_cons, init_symbol, init_marker): Remove.
709 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
710 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
711 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
712 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
713 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
714 (staticidx, init_alloc_once, init_strings, free_ablock):
715 Remove redundant initialization.
716 * fns.c (init_weak_hash_tables): Remove.
717 * lisp.h (init_weak_hash_tables): Remove prototype.
718
9730daca
DA
7192012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
720
721 Use zero_vector where appropriate.
722 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
723 accordingly.
724 * lisp.h (zero_vector): New declaration.
725 * font.c (null_vector): Remove.
726 (syms_of_font): Remove initialization and staticpro.
727 (font_list_entities, font_find_for_lface): Change to use zero_vector.
728 * keymap.c (Faccessible_keymaps): Likewise.
729
2e2d2a13
LL
7302012-07-15 Leo Liu <sdl.web@gmail.com>
731
732 * fringe.c: Fix typo in comments.
733
cd276f6e
LL
7342012-07-14 Leo Liu <sdl.web@gmail.com>
735
736 * fringe.c: Add a new bitmap exclamation-mark.
737
5a1131d9
EZ
7382012-07-14 Eli Zaretskii <eliz@gnu.org>
739
740 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
741
742 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
743 (HAVE_MENUS): Don't define, defined by editing config.in with
744 msdos/sed2v2.inp.
745 (GMALLOC_INHIBIT_VALLOC): Don't define.
746 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
747
22e983b7
JB
7482012-07-14 Juanma Barranquero <lekktu@gmail.com>
749
750 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
751
5b3f250f
GM
7522012-07-14 Glenn Morris <rgm@gnu.org>
753
754 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
755 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
756 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
757
33d63ff4
GM
7582012-07-13 Glenn Morris <rgm@gnu.org>
759
5b633342
GM
760 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
761
33d63ff4
GM
762 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
763 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
764
b55b9f85
JD
7652012-07-13 Jan Djärv <jan.h.d@swipnet.se>
766
0dc8cf50
JD
767 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
768 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
769 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
770 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
771 where appropriate.
772 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
773 as boolean expression.
774 (x_set_window_size): Remove unused variable toolbar.
775 (ns_get_color_default, ns_mod_to_lisp): Remove.
776 (ns_mouse_position): Remove unused variables xchar and ychar.
777 (ns_compute_glyph_string_overhangs): Remove unused variable face.
778 (ns_set_vertical_scroll_bar): Remove unused variable count.
779 (ns_delete_terminal): Remove unused variable i.
780 (ns_term_init): Remove unused variables r, g and b.
781 (mouseDown): Remove unused variable window.
782 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
783 (initFrameFromEmacs): Remove unused variable vbextra.
784 (mouseEntered): Remove unused variables p and dpyinfo.
785 (mouseExited): Remove unused variables p and r.
786 (ns_define_frame_cursor, ns_clear_frame_area)
787 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
788 (menuDown): Assign [sender tag] to variable and cast the variable.
789
790 * nsterm.h (menuDown): Add id as type to argument sender.
791 (ns_display_info_for_name): Add Lisp_Object argument.
792 (ns_term_init): Add Lisp_Object argument.
793 (ns_map_event_to_object): Add void argument.
794 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
795 prototype with arguments and only declare if __OBJC__.
796 (nxatoms_of_nsselect): Add void argument.
797 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
798 (ns_alloc_autorelease_pool): Add void argument.
799 (ns_release_autorelease_pool): Add void* argument.
800 (ns_get_defaults_value): Add const char* argument.
801
802 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
803 (initFromContents): Use SSDATA where appropriate.
804 (ns_update_menubar): Add braces to ambigous if-else.
805 (initWithTitle): Put () around assignment in if statement.
806 (ns_menu_show): Remove unused variables window and keymap.
807 (update_frame_tool_bar): Remove unused variable selected_p.
808 (initWithContentRect): Remove unused variable this_cmd_name.
809
810 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
811 appropriate.
812 (setXBMColor): Remove unused variable len.
813 (setPixmapData): Put () around assignment in loop statement.
814
815 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
816 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
817 where appropriate.
818 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
819 around assignment in loop statement.
820 (nsfont_open): Remove unused variable i.
821 (nsfont_open): Remove unused variable len.
822 (nsfont_draw): Remove unused variable cs.
823
824 * nsfns.m (x_set_icon_name, ns_set_name_internal)
825 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
826 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
827 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
828 (Fns_font_name, Fns_perform_service)
829 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
830 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
831 (ns_set_name): Remove unused variable view.
832 (x_set_menu_bar_lines): Remove unused variable olines.
833 (x_set_tool_bar_lines): Remove unused variable root_window.
834 (Fns_list_colors): Put () around assignment in while statement.
835 (Fns_perform_service): Remove unused variable len.
836 (Fns_display_usable_bounds): Remove unused variable top.
837 (syms_of_nsfns): Remove unused variable i.
838
b55b9f85
JD
839 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
840 memcpy (Bug#11907).
841
ed9265fc 8422012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
843
844 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
845 and free it with DestroyExceptionInfo (Bug#11558).
846
ef099b57
JB
8472012-07-13 Juanma Barranquero <lekktu@gmail.com>
848
849 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
850 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
851 Set here, not in nt/config.nt.
852
ea814a5d
EZ
8532012-07-13 Eli Zaretskii <eliz@gnu.org>
854
855 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
856 cursor overflow into the last glyph on display line when the right
857 fringe is off. (Bug#11832)
858
1a952767
PE
8592012-07-13 Paul Eggert <eggert@cs.ucla.edu>
860
861 * xdisp.c (produce_special_glyphs): Now static.
862 * dispextern.h (produce_special_glyphs): Remove decl.
863
983188fd
GM
8642012-07-13 Glenn Morris <rgm@gnu.org>
865
32fb4bb6
GM
866 * s/bsd-common, s/cygwin.h: Remove empty files.
867 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
868
983188fd
GM
869 * s/usg5-4-common.h (USG, USG5):
870 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
871 * s/sol2-6.h (SOLARIS2):
872 * s/irix6-5.h (IRIX6_5):
873 * s/hpux10-20.h (USG, USG5, HPUX):
874 * s/gnu-linux.h (USG, GNU_LINUX):
875 * s/freebsd.h (BSD_SYSTEM):
876 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
877 * s/cygwin.h (CYGWIN):
878 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
879 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
880
d1e68667 8812012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
882
883 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 884
6de0e799
GM
8852012-07-13 Glenn Morris <rgm@gnu.org>
886
739ae010
GM
887 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
888
dbee5793
GM
889 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
890
6de0e799
GM
891 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
892 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
893
b82da769
GM
8942012-07-12 Glenn Morris <rgm@gnu.org>
895
4fae5a7a 896 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
897
898 * process.c (init_process_emacs): Rename from init_process.
899 The old name is also the name of a Mach system call.
900 * lisp.h, emacs.c: Update for this name change.
901 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
902 longer needed.
903
5a979817
EZ
9042012-07-12 Eli Zaretskii <eliz@gnu.org>
905
906 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
907 memmove call that removes glyphs covered by the left truncation
908 glyph. Improve commentary.
909 (display_line): Fix display of continuation glyphs on GUI frames
910 when the right fringe is turned off and variable-size fonts are
911 used in the window. Move the code that appends a stretch glyph to
912 produce_special_glyphs, so that it could be used for truncation
913 and continuation glyphs alike.
914 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
915 glyph of a suitably computed width, to align the special glyphs at
916 the window margin. Code moved from display_line. (Bug#11832)
917
3e91a053
GM
9182012-07-12 Glenn Morris <rgm@gnu.org>
919
ba9e4b84
GM
920 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
921
922 * s/gnu-linux.h, s/hpux10-20.h:
923 Do not unconditionally define HAVE_XRMSETDATABASE.
924
3e91a053
GM
925 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
926
b300b1f4
PE
9272012-07-12 Paul Eggert <eggert@cs.ucla.edu>
928
929 Fix typos that broke OS X build.
930 Reported by Randal L. Schwartz in
931 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
932 * nsterm.m (ns_timeout): Add missing local decl.
933 (ns_get_color): snprintf -> sprintf, to fix typo.
934
6e777848
GM
9352012-07-12 Glenn Morris <rgm@gnu.org>
936
3f922c37
GM
937 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
938 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
939 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
940 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
941
0ab7b23a
GM
942 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
943 Move PTY_OPEN to configure.
944
6e777848
GM
945 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
946 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
947 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
948
4a7edc24
DA
9492012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
950
951 Use empty_unibyte_string where applicable.
952 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
953 * lread.c (read1): Likewise.
954 * xsettings.c (syms_of_xsettings): Likewise.
955
308aab79
GM
9562012-07-12 Glenn Morris <rgm@gnu.org>
957
42bd1719
GM
958 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
959 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
960 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
961 * s/hpux10-20.h (RUN_TIME_REMAP):
962 * s/bsd-common.h (TABDLY): Move to configure.
963
964 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
965
966 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
967
ea0bbd17 968 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 969 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
970
971 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 972
308aab79
GM
973 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
974 * s/template.h: Move NARROWPROTO to configure.
975
ee1cf5cf
GM
9762012-07-11 Glenn Morris <rgm@gnu.org>
977
30fe9bf4
GM
978 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
979 unused since 2011-01-17 change to systty.h.
980
ee1cf5cf
GM
981 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
982 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
983 Move HAVE_PTYS and HAVE_SOCKETS to configure.
984
63e47e07
PE
9852012-07-11 Paul Eggert <eggert@cs.ucla.edu>
986
987 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
988
c43fb4c3
GM
9892012-07-11 Glenn Morris <rgm@gnu.org>
990
991 * s/darwin.h, s/gnu-linux.h, s/template.h:
992 Move INTERRUPT_INPUT to configure.
993
e8df9267
DA
9942012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
995
996 Minor adjustments to interning code.
997 * lisp.h (intern, intern_c_string): Redefine as static inline
998 wrappers for intern_1 and intern_c_string_1, respectively.
999 (intern_1, intern_c_string_1): Rename prototypes.
2bce5643
DA
1000 * lread.c (intern_1, intern_c_string_1, oblookup): Simplify
1001 Vobarray checking.
e8df9267
DA
1002 * font.c (font_intern_prop): Likewise. Adjust comment.
1003 * w32font.c (intern_font_name): Likewise.
1004
34348bd4
AS
10052012-07-11 Andreas Schwab <schwab@linux-m68k.org>
1006
d96a1e0c
AS
1007 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
1008
34348bd4
AS
1009 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
1010 of Fcar/Fcdr if possible.
1011 * font.c (check_otf_features): Likewise.
1012 * fontset.c (Fnew_fontset): Likewise.
1013 * gnutls.c (Fgnutls_boot): Likewise.
1014 * minibuf.c (read_minibuf): Likewise.
1015 * msdos.c (IT_set_frame_parameters): Likewise.
1016 * xmenu.c (Fx_popup_dialog): Likewise.
1017 * w32menu.c (Fx_popup_dialog): Likewise.
1018
c8add24e
GM
10192012-07-11 Glenn Morris <rgm@gnu.org>
1020
4b575b3c
GM
1021 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
1022 since nothing has defined it on these platforms.
1023
09f4e3b0
GM
1024 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
1025 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
1026
172bedef
GM
1027 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
1028 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
1029 Move CLASH_DETECTION to configure.
1030
249685df
GM
1031 * s/gnu.h: Remove file, which is now empty.
1032
c8add24e
GM
1033 * s/gnu.h, s/gnu-linux.h:
1034 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
1035
b41253a3
JW
10362012-07-11 John Wiegley <johnw@newartisans.com>
1037
1038 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
1039 function attribute, so we only use it if it exists in the
1040 compiler.
1041
d923b542
DA
10422012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
1043
1044 Avoid call to strlen in fast_c_string_match_ignore_case.
1045 * search.c (fast_c_string_match_ignore_case): Change to use
1046 length argument. Adjust users accordingly.
1047 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
1048
5ebbef1d
PE
10492012-07-11 Paul Eggert <eggert@cs.ucla.edu>
1050
bb352260
PE
1051 Assume mkdir, rmdir.
1052 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
1053 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
1054
57054ddd
PE
1055 Assume rename.
1056 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
1057
b747d3f7
PE
1058 Assume perror.
1059 * s/hpux10-20.h (HAVE_PERROR): Remove.
1060 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
1061 Remove dummy definition, as this problem was obsolete long ago.
1062
5ebbef1d
PE
1063 Assume strerror.
1064 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
1065
984e7f30
DA
10662012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
1067
1068 Avoid calls to strlen in font processing functions.
1069 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
d923b542 1070 (font_open_by_name): Change to use length argument. Adjust
984e7f30 1071 users accordingly.
d923b542
DA
1072 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
1073 Adjust prototypes.
1074 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
1075 Change to return ptrdiff_t.
984e7f30
DA
1076 (xfont_list_pattern, xfont_match): Use length returned by
1077 xfont_decode_coding_xlfd.
1078 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
1079
20e94fdd
GM
10802012-07-11 Glenn Morris <rgm@gnu.org>
1081
9d596af3
GM
1082 * s/darwin.h, s/freebsd.h, s/netbsd.h:
1083 Move DONT_REOPEN_PTY to configure.
1084
20e94fdd
GM
1085 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
1086 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
1087
e99a530f
PE
10882012-07-10 Paul Eggert <eggert@cs.ucla.edu>
1089
22ffb973
PE
1090 Remove "#define unix" that is no longer needed (Bug#11905).
1091 * s/aix4-2.h (unix): Remove; no longer needed.
1092
e9a9ae03
PE
1093 EMACS_TIME simplification (Bug#11875).
1094 This replaces macros (which typically do not work in GDB)
1095 with functions, typedefs and enums, making the code easier to debug.
1096 The functional style also makes code easier to read and maintain.
1097 * systime.h: Include <sys/time.h> on all hosts, not just if
1098 WINDOWSNT, since 'struct timeval' is needed in general.
1099 (EMACS_TIME): Now a typedef, not a macro.
1100 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
1101 not macros.
1102 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
1103 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
1104 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
1105 (EMACS_TIME_LE): Now functions, not macros.
1106 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
1107 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
1108 which are not functions. All uses rewritten to use:
1109 (make_emacs_time): New function.
1110 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
1111 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
1112 not functions. All uses rewritten to use the following, respectively:
1113 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
1114 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 1115 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
1116 * fileio.c (Fcopy_file):
1117 * xterm.c (XTflash): Get the current time closer to when it's used.
1118 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
1119
ffacb126
PE
1120 * bytecode.c (targets): Suppress -Woverride-init warnings.
1121
e99a530f
PE
1122 Simplify by avoiding confusing use of strncpy etc.
1123 * doc.c (Fsnarf_documentation):
1124 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
1125 * frame.c (Fmake_terminal_frame):
1126 * gtkutil.c (get_utf8_string):
1127 * lread.c (openp):
1128 * nsmenu.m (ns_update_menubar):
1129 * regex.c (regerror):
1130 Prefer memcpy to strncpy and strncat when either will do.
1131 * fileio.c (Fsubstitute_in_file_name):
1132 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
1133 (menu_separator_name_p):
1134 * nsmenu.m (ns_update_menubar):
1135 Prefer memcmp to strncmp when either will do.
1136 * nsterm.m: Include <ftoastr.h>.
1137 (ns_get_color):
1138 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
1139 Prefer snprintf to strncpy.
1140 * nsterm.m (ns_term_init):
1141 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
1142 * nsterm.m (ns_term_init):
1143 Avoid the need for strncpy, by using build_string or
1144 make_unibyte_string directly. Use dtoastr, not snprintf.
1145 * process.c (Fmake_network_process): Diagnose service names that
1146 are too long, rather than silently truncating them or creating
1147 non-null-terminated names.
1148 (Fnetwork_interface_info): Likewise, for interface names.
1149 * sysdep.c (system_process_attributes) [GNU_LINUX]:
1150 Prefer sprintf to strncat.
1151 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
1152 Prefer vsnprintf to vsprintf + strncpy.
1153
c59592b3
GM
11542012-07-10 Glenn Morris <rgm@gnu.org>
1155
1156 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
1157 Clarify fallback case.
1158
7d7bbefd
DA
11592012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1160
1161 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
1162 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
1163 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 1164 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
1165 where argument type is known to be a Lisp_Cons.
1166
3a4c8000
TT
11672012-07-10 Tom Tromey <tromey@redhat.com>
1168
1169 * bytecode.c (BYTE_CODE_THREADED): New macro.
1170 (BYTE_CODES): New macro. Replaces all old byte-code defines.
1171 (enum byte_code_op): New type.
1172 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
1173 (exec_byte_code): Use them. Use token threading when applicable.
1174
2a0213a6
DA
11752012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1176
1177 Optimize pure C strings initialization.
1178 * lisp.h (make_pure_string): Fix prototype.
1179 (build_pure_c_string): New function, defined as static inline. This
1180 provides a better opportunity to optimize away calls to strlen when
1181 the function is called with compile-time constant argument.
1182 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
1183 argument, adjust users accordingly. Use build_pure_c_string where
1184 appropriate.
1185 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
1186 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
1187 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
1188
cb1caeaf
DA
11892012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1190
1191 Avoid calls to strlen in miscellaneous functions.
1192 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
1193 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
1194 * lread.c (openp): Likewise.
1195
c293e30c
DA
11962012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1197
1198 Avoid calls to strlen in path processing functions.
1199 * fileio.c (file_name_as_directory): Add comment. Change to add
1200 srclen argument and return the length of result. Adjust users
1201 accordingly.
1202 (directory_file_name): Fix comment. Change to add srclen argument,
cb1caeaf 1203 swap 1st and 2nd arguments to obey the common convention. Adjust
c293e30c
DA
1204 users accordingly.
1205 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
1206
9e059e3f
GM
12072012-07-10 Glenn Morris <rgm@gnu.org>
1208
d02eb359
GM
1209 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
1210 Move PENDING_OUTPUT_COUNT definition to configure.
1211
882cf227
GM
1212 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
1213 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
1214 * s/gnu.h (DATA_START): Move definitions to configure.
1215
af6e839f
GM
1216 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
1217 We include usg5-4-common.h, which defines them both.
1218
40289a12
GM
1219 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
1220 O_RDONLY already includes it).
1221
9e059e3f
GM
1222 Stop ns builds setting the EMACSLOADPATH environment variable.
1223 * nsterm.m (ns_load_path): Rename from ns_init_paths.
1224 Now it does not set EMACSLOADPATH, just returns the load-path string.
1225 * nsterm.h: Update accordingly.
1226 * lread.c [HAVE_NS]: Include nsterm.h.
1227 (init_lread) [HAVE_NS]: Use ns_load_path.
1228 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
1229
7c4e8ec0
GM
12302012-07-09 Glenn Morris <rgm@gnu.org>
1231
d4f600ff
GM
1232 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
1233 since the included bsd-common.h does so.
1234
cbb31951
GM
1235 Stop ns builds setting the EMACSPATH environment variable.
1236 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
1237 (ns_init_paths): Do not set EMACSPATH.
1238 * nsterm.h (ns_exec_path): Add it.
1239 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
1240 Use ns_exec_path.
1241
7c4e8ec0
GM
1242 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
1243
26bccfae
PE
12442012-07-09 Paul Eggert <eggert@cs.ucla.edu>
1245
a0bee46f
PE
1246 * process.c (wait_reading_process_output): 'waitchannels' was unset
1247 when read_kbd || !NILP (wait_for_cell); fix this.
1248
5994c183
PE
1249 Add GCC-style 'const' attribute to functions that can use it.
1250 * character.h (char_resolve_modifier_mask):
1251 * keyboard.h (make_ctrl_char):
1252 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
1253 (init_character_once, next_almost_prime, init_fns, init_image)
1254 (flush_pending_output, init_sound):
1255 * mem-limits.h (start_of_data):
1256 * menu.h (finish_menu_items):
1257 Add ATTRIBUTE_CONST.
1258 * emacs.c (DEFINE_DUMMY_FUNCTION):
1259 Declare the dummy function with ATTRIBUTE_CONST.
1260 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
1261 Add decls with ATTRIBUTE_CONST.
1262
26bccfae
PE
1263 Minor improvements to make_formatted_string.
1264 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
1265 where int is good enough, as vsprintf returns an int.
1266 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
1267
a8290ec3
DA
12682012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
1269
1270 Use make_formatted_string to avoid double length calculation.
1271 * lisp.h (make_formatted_string): New prototype.
1272 * alloc.c (make_formatted_string): New function.
1273 * buffer.c (Fgenerate_new_buffer_name): Use it.
1274 * dbus.c (syms_of_dbusbind): Likewise.
1275 * editfns.c (Fcurrent_time_zone): Likewise.
1276 * filelock.c (get_boot_time): Likewise.
1277 * frame.c (make_terminal_frame, set_term_frame_name)
1278 (x_report_frame_params): Likewise.
1279 * image.c (gs_load): Likewise.
1280 * minibuf.c (get_minibuffer): Likewise.
1281 * msdos.c (dos_set_window_size): Likewise.
1282 * process.c (make_process): Likewise.
1283 * xdisp.c (ensure_echo_area_buffers): Likewise.
1284 * xsettings.c (apply_xft_settings): Likewise.
1285
d01ba2f1
GM
12862012-07-09 Glenn Morris <rgm@gnu.org>
1287
1288 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
1289 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
1290 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
1291 * nsterm.h (ns_etc_directory): Add it.
1292 * callproc.c [HAVE_NS]: Include nsterm.h.
1293 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
1294
f1f924b6
DA
12952012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
1296
1297 Move marker debugging code under MARKER_DEBUG.
1298 * marker.c (MARKER_DEBUG): Move marker debugging code under
1299 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
1300 for bootstrap with --enable-checking (~3x slowdown reported
1301 by Juanma Barranquero <lekktu@gmail.com>).
1302 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
1303
ab531b66
PE
13042012-07-08 Paul Eggert <eggert@cs.ucla.edu>
1305
1306 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
1307 See <http://bugs.gnu.org/11825#29>.
1308
c4b3bc8a
EZ
13092012-07-08 Eli Zaretskii <eliz@gnu.org>
1310
1311 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
1312 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
1313 (display_line): Add commentary about displaying truncation glyphs
1314 on GUI frames.
1315 (produce_special_glyphs): Move here from term.c.
1316
1317 * term.c (produce_special_glyphs): Move to xdisp.c.
1318
1319 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
1320 section.
c4b3bc8a 1321
b676b881
AS
13222012-07-07 Andreas Schwab <schwab@linux-m68k.org>
1323
f17c5273
AS
1324 * xdisp.c (display_line): Avoid warning about implicit declaration
1325 of FRAME_FONT.
1326
298819b9
AS
1327 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
1328
b676b881
AS
1329 * lisp.h: Remove empty conditional.
1330
6045c4fd
PE
13312012-07-07 Paul Eggert <eggert@cs.ucla.edu>
1332
b3350bf9
PE
1333 * lread.c (load_path_check): Now static.
1334
6045c4fd
PE
1335 Fix some minor --with-ns problems found by static checking.
1336 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
1337 (x_set_font) [!HAVE_X_WINDOWS]:
1338 * image.c (xpm_load_image) [HAVE_NS]:
1339 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
1340 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
1341 Remove unused local.
1342 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
1343 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
1344 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
1345 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
1346 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
1347 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
1348 Fix pointer signedness problem.
1349 * xfaces.c (FRAME_X_FONT_TABLE):
1350 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
1351
929e7845
GM
13522012-07-07 Glenn Morris <rgm@gnu.org>
1353
1354 * lread.c (load_path_check): New function, split from init_lread.
1355 (init_lread): Reorganize. Motivation:
1356 If EMACSLOADPATH is set, check/warn about that rather than the
1357 defaults, which we are not going to use. Hence we can remove
1358 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
1359 Don't warn if site-lisp directories are missing.
1360 If not installed, start from a blank load-path, since
1361 PATH_LOADSEARCH refers to the eventual installation directories.
1362
58dd0aa4
EZ
13632012-07-07 Eli Zaretskii <eliz@gnu.org>
1364
1365 Support truncation and continuation glyphs on GUI frames, when
1366 fringes are disabled. (Bug#11832)
1367 * xdisp.c (init_iterator): Get dimensions of truncation and
1368 continuation glyphs even if on GUI frames. Adjust
1369 it->last_visible_x on GUI frames when the left or right fringes,
1370 or both, are absent.
1371 (start_display, move_it_in_display_line_to): Handle the case of a
1372 GUI frame without a fringe to display continuation or truncation
1373 glyphs.
1374 (insert_left_trunc_glyphs): Support GUI frames: make sure
1375 truncation glyphs overwrite enough glyphs from the current line to
1376 have sufficient space in pixels.
1377 (display_line): Support truncation and continuation glyphs on GUI
1378 frames. If some spare pixels are left on the line after inserting
1379 the truncation glyphs, fill that space with a stretch glyph of a
1380 suitably computed width.
1381
1382 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
1383 produce_glyphs, to support GUI sessions.
1384
31571fd7
PE
13852012-07-07 Paul Eggert <eggert@cs.ucla.edu>
1386
5a16b9bc
PE
1387 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
1388
f3047c75
PE
1389 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
1390
31571fd7
PE
1391 Do not require float-time's arg to fit in time_t (Bug#11825).
1392 This works better on hosts where time_t is unsigned, and where
1393 float-time is applied to the (negative) difference between two times.
1394 * editfns.c (decode_time_components): Last arg is now double *,
1395 not int *, and means to store all the result as a double, without
1396 worrying about whether the seconds part fits in time_t.
1397 All callers changed.
1398 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
1399 All callers changed.
1400 (Ffloat_time): Do not fail merely because the specified time falls
1401 outside of time_t range.
1402
4516fbef
GM
14032012-07-07 Glenn Morris <rgm@gnu.org>
1404
1405 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
1406 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
1407 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
1408
07adc2c6
JB
14092012-07-07 Juanma Barranquero <lekktu@gmail.com>
1410
1411 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
1412 Update dependencies.
1413
1414 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
1415
fd573f31
PE
14162012-07-06 Paul Eggert <eggert@cs.ucla.edu>
1417
fee5959d
PE
1418 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
1419 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
1420 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
1421 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
1422 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
1423 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
1424
fd573f31
PE
1425 * xfont.c (compare_font_names): Redo to omit the need for casts.
1426
ddadbc0e
AS
14272012-07-06 Andreas Schwab <schwab@linux-m68k.org>
1428
fca8d6b6
AS
1429 * xfns.c (Fx_change_window_property): Doc fix.
1430 * w32fns.c (Fx_change_window_property): Doc fix.
1431
ddadbc0e
AS
1432 * w32fns.c (Fx_window_property): Accept the same arguments as the
1433 X Windows version. Doc fix.
1434 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
1435
ed9265fc 14362012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
1437 Eli Zaretskii <eliz@gnu.org>
1438
1439 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
1440 Windows-specific code from nt/config.nt moved here.
1441 Obsolete settings removed.
1442
216ee680
PE
14432012-07-06 Paul Eggert <eggert@cs.ucla.edu>
1444
1445 * process.c: Avoid unnecessary calls to gettime.
1446 (wait_reading_process_output): Don't get the time of day
1447 when gobbling data immediately and not waiting, as there's no need
1448 for it in that case. This removes a FIXME.
1449
bdd091e4
JD
14502012-07-06 Jan Djärv <jan.h.d@swipnet.se>
1451
1452 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
1453 is defined (Bug#11768).
1454
9d44f8ce
DA
14552012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1456
1457 Fix marker debugging code.
1458 * marker.c (byte_char_debug_check): Do not perform the check
1459 if buffer is not multibyte.
090bd7cb
JB
1460 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
1461 Call byte_char_debug_check with correct arguments.
9d44f8ce 1462
90fc4786
DA
14632012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1464
1465 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
1466 * marker.c (byte_char_debug_check, count_markers):
1467 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
1468 (byte_debug_flag): Remove.
1469 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
1470 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
1471
7b7ae965
DA
14722012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1473
4e57b342
DA
1474 Avoid code repetition in marker-related functions.
1475 * marker.c (attach_marker): New function.
1476 (Fset_marker, set_marker_restricted, set_marker_both)
1477 (set_marker_restricted_both): Use it.
1478 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
1479 Consistently rename charno to charpos.
1480 (marker_position): Add eassert.
1481 (marker_byte_position): Convert to eassert.
1482
14832012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1484
1485 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 1486 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 1487 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 1488
657924ff
DA
14892012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1490
1491 Introduce fast path for the widely used marker operation.
1492 * alloc.c (build_marker): New function.
1493 * lisp.h (build_marker): New prototype.
1494 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
1495 * composite.c (autocmp_chars): Likewise.
1496 * editfns.c (buildmark): Remove.
1497 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
1498 (save_restriction_save): Use build_marker.
1499 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
1500 * window.c (save_window_save): Likewise.
1501
041a49a6
DA
15022012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1503
1504 Do not use Fdelete_overlay in delete_all_overlays
1505 to avoid redundant calls to unchain_overlay.
1506 * buffer.c (drop_overlay): New function.
1507 (delete_all_overlays, Fdelete_overlay): Use it.
1508 * minibuf.c (get_minibuffer): Fix comment.
1509
7dca65a4
PE
15102012-07-06 Paul Eggert <eggert@cs.ucla.edu>
1511
1512 Port to OpenBSD 5.1 amd64.
1513 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
1514 This is needed for OpenBSD, and should be harmless on all BSD systems.
1515 Also, include <sys/sysctl.h>, as it should be available on all
1516 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
1517 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
1518 use p_pid member, not kp_proc.pid.
1519
8eb876e2
GM
15202012-07-06 Glenn Morris <rgm@gnu.org>
1521
1522 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
1523
38182d90
PE
15242012-07-05 Paul Eggert <eggert@cs.ucla.edu>
1525
1526 More xmalloc and related cleanup.
1527 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
1528 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
1529 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
1530 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
1531 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
1532 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
1533 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
1534 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
1535 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
1536 * xterm.c:
1537 Omit needless casts involving void * pointers and allocation.
1538 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
1539 as the former is more robust if P's type is changed.
1540 Prefer xzalloc to xmalloc + memset 0.
1541 Simplify malloc-or-realloc to realloc.
1542 Don't worry about xmalloc returning a null pointer.
1543 Prefer xstrdup to xmalloc + strcpy.
1544 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
1545 growing it.
1546 * keyboard.c (apply_modifiers_uncached): Prefer local array to
1547 alloca of a constant.
1548
6dd5a677
EZ
15492012-07-05 Eli Zaretskii <eliz@gnu.org>
1550
1551 * xdisp.c (display_line): Fix horizontal pixel coordinates when
1552 hscroll is larger than the line width. Fixes long and futile
1553 looping inside extend_face_to_end_of_line (on a TTY) producing
1554 glyphs that are not needed and thrown away.
1555
6b312f0f
DA
15562012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
1557
1558 * marker.c (set_marker_restricted_both): Simplify by using
1559 clip_to_bounds.
1560
f520ef9b
PE
15612012-07-05 Paul Eggert <eggert@cs.ucla.edu>
1562
1563 * editfns.c (region_limit): Simplify by using clip_to_bounds.
1564
383b7c95
JD
15652012-07-05 Jan Djärv <jan.h.d@swipnet.se>
1566
1567 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
1568 not defined (Bug#11768).
1569 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
1570 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
1571 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
1572 followed by gtk_box_set_homogeneous (Bug#11768).
1573 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
1574 (update_theme_scrollbar_width, xg_create_scroll_bar):
1575 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
1576 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
1577 (is_box_type): New function (Bug#11768).
1578 (xg_tool_item_stale_p): Call is_box_type.
5293d758 1579 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
1580 with default display (Bug#11768).
1581
d6e7bf45
EZ
15822012-07-05 Eli Zaretskii <eliz@gnu.org>
1583
1584 * xdisp.c (window_hscroll_limited): New function.
1585 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
1586 coordinates when window's hscroll is set to insanely large
1587 values. (Bug#11857)
1588
431391ec
JB
15892012-07-05 Juanma Barranquero <lekktu@gmail.com>
1590
1591 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
1592 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
1593
23f86fce
DA
15942012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
1595
1596 Cleanup xmalloc.
1597 * lisp.h (xzalloc): New prototype. Omit needless casts.
1598 * alloc.c (xzalloc): New function. Omit needless casts.
1599 * charset.c: Omit needless casts. Convert all calls to
1600 xmalloc with following memset to xzalloc.
1601 * dispnew.c: Likewise.
1602 * fringe.c: Likewise.
1603 * image.c: Likewise.
1604 * sound.c: Likewise.
1605 * term.c: Likewise.
1606 * w32fns.c: Likewise.
1607 * w32font.c: Likewise.
1608 * w32term.c: Likewise.
1609 * xfaces.c: Likewise.
1610 * xfns.c: Likewise.
1611 * xterm.c: Likewise.
1612 * atimer.c: Omit needless casts.
1613 * buffer.c: Likewise.
1614 * callproc.c: Likewise.
1615 * ccl.c: Likewise.
1616 * coding.c: Likewise.
1617 * composite.c: Likewise.
1618 * doc.c: Likewise.
1619 * doprnt.c: Likewise.
1620 * editfns.c: Likewise.
1621 * emacs.c: Likewise.
1622 * eval.c: Likewise.
1623 * filelock.c: Likewise.
1624 * fns.c: Likewise.
1625 * gtkutil.c: Likewise.
1626 * keyboard.c: Likewise.
1627 * lisp.h: Likewise.
1628 * lread.c: Likewise.
1629 * minibuf.c: Likewise.
1630 * msdos.c: Likewise.
1631 * print.c: Likewise.
1632 * process.c: Likewise.
1633 * region-cache.c: Likewise.
1634 * search.c: Likewise.
1635 * sysdep.c: Likewise.
1636 * termcap.c: Likewise.
1637 * terminal.c: Likewise.
1638 * tparam.c: Likewise.
1639 * w16select.c: Likewise.
1640 * w32.c: Likewise.
1641 * w32reg.c: Likewise.
1642 * w32select.c: Likewise.
1643 * w32uniscribe.c: Likewise.
1644 * widget.c: Likewise.
1645 * xdisp.c: Likewise.
1646 * xmenu.c: Likewise.
1647 * xrdb.c: Likewise.
1648 * xselect.c: Likewise.
1649
0497dc44
PE
16502012-07-05 Paul Eggert <eggert@cs.ucla.edu>
1651
1652 * fileio.c (time_error_value): Check the right error number.
1653 Problem reported by Troels Nielsen in
1654 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
1655
356e7178
PE
16562012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1657
4e71fd89
PE
1658 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
1659 This should be fixed in a better way; see Eli Zaretskii in
1660 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
1661 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
1662
f0941253
PE
1663 * fileio.c (time_error_value): Rename from special_mtime.
1664 The old name's problems were noted by Eli Zaretskii in
1665 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
1666
065c9eb4
PE
1667 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
1668 This variable's comment says Emacs needs at least one GDB-visible
1669 symbol of type enum pvec_type, to work around GDB problems.
1670 The symbol's value doesn't matter.
1671
356e7178
PE
1672 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
1673 that causes compilation to fail on pre-C99 compilers.
1674
ed9265fc 16752012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
1676
1677 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
1678 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
1679
3884d954
DA
16802012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
1681
d209e2fb 1682 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
1683 headers for buffer_defaults and buffer_local_symbols.
1684 Reported by Juanma Barranquero <lekktu@gmail.com>.
1685
ee28be33
SM
16862012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
1687
1688 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
1689 * lisp.h (enum pvec_type): Use fewer bits.
1690 (PSEUDOVECTOR_SIZE_BITS): New constant.
1691 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
1692 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
1693 change in pvec_type.
1694 (PSEUDOVECTOR_TYPEP): New macro.
1695 (TYPED_PSEUDOVECTORP): Use it.
1696 * fns.c (internal_equal): Adapt code to extract pvectype.
1697 * emacs.c (gdb_pvec_type): Update type.
1698 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
1699 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
1700 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
1701 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
1702 (sweep_vectors): Use it. Use local var `total_bytes' instead of
1703 abusing vector->header.next.nbytes.
1704 (live_vector_p): Use PVEC_TYPE.
1705 (mark_object): Adapt code to extract pvectype. Use switch.
1706
c7f2cd7f
PE
17072012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1708
1709 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
1710 Tighten new eassert a bit.
1711
8ce70ed2
DA
17122012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
1713
1714 Fix compilation with --enable-gcc-warnings and -O1
1715 optimization level.
1716 * doprnt.c (doprnt): Change type of tem to int, initialize
1717 to avoid compiler warning. Add eassert.
1718 * search.c (simple_search): Initialize match_byte to avoid
1719 compiler warning. Add eassert.
1720
dea7f1e5
PE
17212012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1722
24a212eb
PE
1723 Avoid weird behavior with large horizontal scrolls.
1724 Without this change, for example, large hscroll values would
1725 mess up Emacs's display on Fedora 15 x86, presumably due to
1726 overflows in int calculations in the display code.
1727 Also, if buffers had long lines, Emacs would freeze.
1728 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
1729 (set_window_hscroll): New function, containing the old guts of
1730 Fset_window_hscroll. Return the clipped value.
1731 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
1732 This avoids the need to check against PTRDIFF_MAX.
1733
dea7f1e5
PE
1734 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
1735
76046526
DA
17362012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
1737
1738 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
1739
39adff0d
PE
17402012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1741
63807d47
PE
1742 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
1743 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
1744 since GCC 4.4.6 issues a bogus warning for them.
1745
39adff0d
PE
1746 Fix bugs in file timestamp newness comparisons.
1747 * fileio.c (Ffile_newer_than_file_p):
1748 * lread.c (Fload): Use full timestamp resolution of files,
1749 not just the 1-second resolution, so that files that are only
1750 slightly newer still count as newer.
1751 * fileio.c (Ffile_newer_than_file_p): Don't assume file
1752 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
1753
dbeed9a6
PE
17542012-07-03 Paul Eggert <eggert@cs.ucla.edu>
1755
1756 * fileio.c: Improve handling of file time marker. (Bug#11852)
1757 (special_mtime): New function.
1758 (Finsert_file_contents, Fverify_visited_file_modtime):
1759 Use it to set special mtime values consistently.
1760
636334d6
AS
17612012-07-03 Andreas Schwab <schwab@linux-m68k.org>
1762
1763 * fileio.c (Finsert_file_contents): Properly handle st_mtime
1764 marker for non-existing file. (Bug#11852)
1765
e2017fe2
GM
17662012-07-03 Glenn Morris <rgm@gnu.org>
1767
1768 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
1769 and did not make it into globals.h).
1770
404dbd37
TT
17712012-07-03 Tom Tromey <tromey@redhat.com>
1772
1773 * window.c (Fset_window_margins, Fset_window_fringes)
1774 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
1775 * textprop.c (Fprevious_property_change): No longer static.
1776 * syntax.c (Fsyntax_table_p): No longer static.
1777 * process.c (Fget_process, Fprocess_datagram_address): No longer
1778 static.
1779 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
1780 * keyboard.c (Fcommand_execute): No longer static.
1781 Remove EXFUN.
1782 * insdel.c (Fcombine_after_change_execute): No longer static.
1783 * image.c (Finit_image_library): No longer static.
1784 * fileio.c (Fmake_symbolic_link): No longer static.
1785 * eval.c (Ffetch_bytecode): No longer static.
1786 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
1787 * doc.c (Fdocumentation_property, Fsnarf_documentation):
1788 No longer static.
404dbd37
TT
1789 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
1790 static.
1791 * dired.c (Ffile_attributes): No longer static.
1792 * composite.c (Fcomposition_get_gstring): No longer static.
1793 * callproc.c (Fgetenv_internal): No longer static.
1794
1795 * ccl.h: Remove EXFUNs.
1796 * buffer.h: Remove EXFUNs.
1797 * dispextern.h: Remove EXFUNs.
1798 * intervals.h: Remove EXFUNs.
1799 * fontset.h: Remove EXFUN.
1800 * font.h: Remove EXFUNs.
1801 * dosfns.c (system_process_attributes): Remove EXFUN.
1802 * keymap.h: Remove EXFUNs.
1803 * lisp.h: Remove EXFUNs.
1804 * w32term.h: Remove EXFUNs.
1805 * window.h: Remove EXFUNs.
1806 * xsettings.h: Remove EXFUN.
1807 * xterm.h: Remove EXFUN.
1808
8e4fd1e1
GM
18092012-07-03 Glenn Morris <rgm@gnu.org>
1810
1811 * lisp.h (Frandom): Make it visible to C.
1812 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
1813 buffer for invisible buffers. (Bug#1229)
1814
ca95b3eb
DA
18152012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1816
1817 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
1818 values which aren't power of 2.
1819 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro. Verify
1820 it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
1821 accordingly.
1822
7555c33f
SM
18232012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
1824
1825 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
1826
1827 * alloc.c (mark_object): Revert part of last patch to use `switch'.
1828
d12e8f5a
DA
18292012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1830
1831 * alloc.c (allocate_vector_block): Remove redundant
1832 calls to mallopt if DOUG_LEA_MALLOC is defined.
1833 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
1834 avoid calls to mallopt if zero_vector is returned.
1835
296094c3
DA
18362012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1837
1838 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
1839 is enabled, avoid dereferencing NULL current_sblock if
1840 running undumped.
1841
36429c89
DA
18422012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1843
1844 Cleanup basic buffer management.
1845 * buffer.h (struct buffer): Change layout to use generic vector
1846 marking code. Fix some comments. Change type of 'clip_changed'
1847 to bitfield. Remove unused #ifndef old.
1848 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
1849 (GET_OVERLAYS_AT): Fix indentation.
1850 (for_each_per_buffer_object_at): New macro.
1851 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
1852 (Fbuffer_local_variables): Use it.
1853 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
1854 * alloc.c (allocate_buffer): Adjust to match new layout of
1855 struct buffer. Fix comment.
1856 (mark_overlay): New function.
1857 (mark_buffer): Use it. Use mark_vectorlike to mark normal
1858 Lisp area of struct buffer.
1859 (mark_object): Use it. Adjust marking of misc objects
1860 and related comments.
1861
3b3e4cac
PE
18622012-07-02 Paul Eggert <eggert@cs.ucla.edu>
1863
1864 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
1865 wrapper that is not needed because the wrapped code is a no-op (zero
1866 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
1867 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
1868
cf5c0175
DA
18692012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
1870
1871 * alloc.c (mark_buffer): Simplify. Remove prototype.
1872 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 1873 objects. Use CHECK_LIVE for all vector-like objects except buffers
cf5c0175
DA
1874 and subroutines when GC_CHECK_MARKED_OBJECTS is defined. Avoid
1875 redundant calls to mark_vectorlike for bool vectors.
1876
ca26824c
GM
18772012-06-30 Glenn Morris <rgm@gnu.org>
1878
2e4c5312
GM
1879 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
1880
ca26824c
GM
1881 * epaths.in (PATH_SITELOADSEARCH): New.
1882 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
1883 This is rather than relying on --enable-locallisppath elements
1884 having "site-lisp" in their names. (Bug#10208#25, 11658)
1885
0d23c240
EZ
18862012-06-30 Eli Zaretskii <eliz@gnu.org>
1887
c9240d7a
EZ
1888 * w32proc.c (sys_select): Accept and ignore one more argument.
1889
1890 * w32.c (emacs_gnutls_pull): Call select with one more argument.
1891
0d23c240 1892 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 1893 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
1894
1895 * sysdep.c: Don't include dos.h and dosfns.h.
1896
1897 * process.c (sys_select):
1898 * msdos.c (sys_select): Accept one more argument and ignore it.
1899
1900 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
1901 adapt data types and code to that.
1902
1903 * dosfns.c:
1904 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
1905 which clashes with the gnulib function of the same name.
1906
af5a5a98
AS
19072012-06-30 Andreas Schwab <schwab@linux-m68k.org>
1908
c5e4379c
AS
1909 * font.c (font_style_to_value, font_style_symbolic)
1910 (font_prop_validate_style): Add type checks for values in
1911 font_style_table.
1912
af5a5a98
AS
1913 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
1914 argument.
1915 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
1916 uses.
1917
8d38f461
EZ
19182012-06-29 Eli Zaretskii <eliz@gnu.org>
1919
2e5a6631
EZ
1920 * xdisp.c (try_window_id): Undo last change.
1921
8d38f461
EZ
1922 * w32.c (getwd): Adjust commentary about startup_dir.
1923 (init_environment): Always call sys_access, even in non-MSVC
1924 builds. Don't chdir to the directory of the Emacs executable.
1925 This undoes code from 1997 which was justified by the need to
1926 "avoid conflicts when removing and renaming directories". But its
1927 downside was that every relative file name was being interpreted
1928 relative to the directory of the Emacs executable, which can never
1929 be TRT. In particular, it broke sys_access when called with
1930 relative file names.
1931 (sys_access): Map GetLastError to errno.
1932
2af3565e
DA
19332012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1934
1935 * window.h (struct window): Change type of 'fringes_outside_margins'
1936 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 1937 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
1938 Adjust comment.
1939 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
1940 to ptrdiff_t.
1941
c8d3a25c 19422012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 1943
c8d3a25c
GM
1944 * gnutls.c (emacs_gnutls_handshake):
1945 Add QUIT to make the loop interruptible.
57570cd3 1946
c8d3a25c 19472012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 1948
c8d3a25c
GM
1949 * charset.c (init_charset): Make lack of etc/charsets fatal.
1950
3e984ee8
DA
19512012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1952
1953 * editfns.c (region_limit): Fix type mismatch.
1954
ef884f23
DA
19552012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1956
1957 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
1958 undefined. Convert from xassert to eassert.
1959 * nsmenu.m: Convert from xassert to eassert.
1960 * nsterm.m: Likewise.
1961
7d7e0027
SM
19622012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
1963
1964 * editfns.c (region_limit): Clip to narrowing (bug#11770).
1965
aa754e6a
PE
19662012-06-28 Paul Eggert <eggert@cs.ucla.edu>
1967
1968 Avoid integer overflow on scroll-left and scroll-right.
1969 * window.c (HSCROLL_MAX): New macro.
1970 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
1971 overflow when requested scroll falls outside ptrdiff_t range.
1972
80b00b08
DA
19732012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1974
1975 * window.h (struct window): Change type of 'hscroll',
1976 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
1977 'last_modified' and 'last_overlay_modified' to EMACS_INT.
1978 Adjust users accordingly.
1979 * xdisp.c (try_cursor_movement): Replace type check with eassert.
1980 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
1981 from EMACS_INT to ptrdiff_t.
1982 (make_window): Omit redundant initialization.
1983
62b2bcf6
JB
19842012-06-28 Juanma Barranquero <lekktu@gmail.com>
1985
1986 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
1987
45942c7d
DA
19882012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1989
1990 * window.h (struct window): Change type of 'use_time' and
1991 'sequence_number' from Lisp_Object to int.
1992 * frame.c (make_frame): Adjust users accordingly.
1993 * print.c (print_object): Likewise.
1994 * window.c (select_window, Fwindow_use_time, make_parent_window)
1995 (make_window): Likewise.
1996
e509cfa6
DA
19972012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1998
1999 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
2000 enabled with --enable-checking=[all,glyphs] configure option.
2001 Fix GLYPH_DEBUG usage assuming that it may be undefined,
2002 adjust comments accordingly.
2003 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
2004 undefined, adjust comments accordingly.
2005 * image.c: Likewise.
2006 * scroll.c: Likewise.
2007 * w32fns.c: Likewise.
2008 * w32term.c: Likewise.
2009 * xdisp.c: Likewise.
2010 * xfaces.c: Likewise.
2011 * xfns.c: Likewise.
2012 * xterm.c: Likewise.
2013
a54e2c05
DA
20142012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2015
2016 Generalize run-time debugging checks.
2017 * dispextern.h (XASSERTS): Remove.
2018 * fontset.c (xassert): Remove.
2019 Convert from xassert to eassert.
2020 * alloc.c: Convert from xassert to eassert.
2021 * bidi.c: Likewise.
2022 * dispnew.c: Likewise.
2023 * fns.c: Likewise.
2024 * fringe.c: Likewise.
2025 * ftfont.c: Likewise.
2026 * gtkutil.c: Likewise.
2027 * image.c: Likewise.
2028 * keyboard.c: Likewise.
2029 * menu.c: Likewise.
2030 * process.c: Likewise.
2031 * scroll.c: Likewise.
2032 * sound.c: Likewise.
2033 * term.c: Likewise.
2034 * w32console.c: Likewise.
2035 * w32fns.c: Likewise.
2036 * w32term.c: Likewise.
2037 * window.c: Likewise.
2038 * xdisp.c: Likewise.
2039 * xfaces.c: Likewise.
2040 * xfns.c: Likewise.
2041 * xselect.c: Likewise.
2042 * xterm.c: Likewise.
2043
1ec4b7b2
SM
20442012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
2045
2046 * fns.c (maybe_resize_hash_table): Output message when growing the
2047 purify-hashtable.
2048
2014308a
DA
20492012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2050
2051 * alloc.c (allocate_string_data): Remove dead code.
2052 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
2053 avoid GCC warning about unused macro.
2054
246155eb
DA
20552012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2056
2057 * alloc.c (allocate_string): Omit intervals initialization.
2058 * alloc.c (make_uninit_multibyte_string): Initialize intervals
2059 as in make_pure_string and make_pure_c_string.
2060
43184b7b
DA
20612012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2062
d209e2fb 2063 * alloc.c (allocate_string): Fix last change.
43184b7b 2064
3fe6dd74
DA
20652012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2066
d209e2fb 2067 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
2068 to memset, add explicit initialization where appropriate.
2069
1ba6038a
GM
20702012-06-27 Glenn Morris <rgm@gnu.org>
2071
2072 * lisp.mk (lisp): Remove paths.elc.
2073
c89926a5
CY
20742012-06-27 Chong Yidong <cyd@gnu.org>
2075
2076 * doc.c (Fsubstitute_command_keys): Fix punctuation.
2077
ed6b3510
JW
20782012-06-26 John Wiegley <johnw@newartisans.com>
2079
1ec4b7b2 2080 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
2081 on Mac OS X Lion: __mod_init_func and __mod_term_func.
2082
ed6b3510
JW
2083 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
2084 when building with Clang.
2085
8edd4a2b
SM
20862012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
2087
2088 * eval.c (Fapply): Allow calling it with a single argument.
2089
f6f62d1b
EZ
20902012-06-26 Eli Zaretskii <eliz@gnu.org>
2091
2092 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
2093 _stricmp and _strnicmp.
2094 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
2095
62efea5e
DA
20962012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
2097
2098 * alloc.c (allocate_window): Zero out non-Lisp part of newly
2099 allocated window.
2100 (allocate_process): Likewise for new process.
8edd4a2b 2101 (allocate_terminal): Change to use offsetof.
62efea5e
DA
2102 (allocate_frame): Likewise.
2103 * frame.c (make_frame): Omit redundant initialization.
2104 * window.c (make_parent_window): Use memset.
2105 (make_window): Omit redundant initialization.
2106 * process.c (make_process): Omit redundant initialization.
2107 * terminal.c (create_terminal): Likewise.
2108
42997f4d
DA
21092012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
2110
2111 * term.c (delete_tty): Remove redundant call to memset.
2112
1130ecfc
DA
21132012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
2114
2115 * alloc.c: Remove build_string.
2116 * lisp.h: Define build_string as static inline. This provides
2117 a better opportunity to optimize away calls to strlen when the
2118 function is called with compile-time constant argument.
2119 * image.c (imagemagick_error): Convert to build_string.
2120 * w32proc.c (sys_spawnve): Likewise.
2121 * xterm.c (x_term_init): Likewise.
2122
cf38a720
PE
21232012-06-26 Paul Eggert <eggert@cs.ucla.edu>
2124
99027bdd
PE
2125 Use sprintf return value instead of invoking strlen on result.
2126 In the old days this wasn't portable, since some sprintf
2127 implementations returned char *. But they died out years ago and
2128 Emacs already assumes sprintf returns int.
2129 Similarly for float_to_string.
2130 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
2131 * ccl.c (ccl_driver):
2132 * character.c (string_escape_byte8):
2133 * data.c (Fnumber_to_string):
2134 * doprnt.c (doprnt):
2135 * print.c (print_object):
2136 * xdisp.c (message_dolog):
2137 * xfns.c (syms_of_xfns):
2138 Use sprintf or float_to_string result to avoid need to call strlen.
2139 * data.c (Fnumber_to_string):
2140 Use make_unibyte_string, since the string must be ASCII.
2141 * lisp.h, print.c (float_to_string): Now returns int length.
2142 * term.c (produce_glyphless_glyph):
2143 Use sprintf result rather than recomputing it.
2144
cf38a720
PE
2145 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
2146 * Makefile.in (ALL_CFLAGS):
2147 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
2148 * gmalloc.c, regex.c: Include <config.h> unconditionally.
2149
3511c784
DA
21502012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
2151
0a08eb21 2152 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
2153 strcasecmp if available.
2154 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
2155
fb7da12e
AS
21562012-06-25 Andreas Schwab <schwab@linux-m68k.org>
2157
2158 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
2159 Avoid comma operator.
2160 * menu.c (push_submenu_start, push_submenu_end)
2161 (push_left_right_boundary, push_menu_pane): Likewise.
2162 * msdos.c (dos_rawgetc): Likewise.
2163
afa2ffd8
DA
21642012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
2165
2166 * xfns.c (xic_create_fontsetname): Remove redundant calls
2167 to memset.
2168
b3b4476b
PE
21692012-06-25 Paul Eggert <eggert@cs.ucla.edu>
2170
4495ff38
PE
2171 * gtkutil.c (get_utf8_string): Remove redundant assignment.
2172 sprintf already null-terminates its output.
2173
b3b4476b
PE
2174 * xfns.c (x_window): Remove redundant cast.
2175
b00876c9
DA
21762012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
2177
2178 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
2179 `const char *' to `char *' to avoid compiler warning.
2180
d188e26b
PE
21812012-06-24 Paul Eggert <eggert@cs.ucla.edu>
2182
885d1d74
PE
2183 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
2184 instead of truncating it to 63 (admittedly a generous limit).
2185
d188e26b
PE
2186 * process.c: Fix spelling and caps in comments.
2187
e2f560b1
DN
21882012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
2189
e86db54b 2190 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
2191 * sysdep.c (setpgrp): Remove definition, not used in this file.
2192
7583a3a1
JB
21932012-06-24 Juanma Barranquero <lekktu@gmail.com>
2194
2195 * makefile.w32-in: Update dependencies.
2196
696056c2
EZ
21972012-06-24 Eli Zaretskii <eliz@gnu.org>
2198
2199 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
2200 (SYSTIME_H): Add nt/inc/sys/time.h.
2201
2202 * systime.h [WINDOWSNT]: Include sys/time.h.
2203
2204 * s/ms-w32.h (struct timespec): Definition moved from
2205 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
2206
845ca893
PE
22072012-06-24 Paul Eggert <eggert@cs.ucla.edu>
2208
2209 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
2210 * buffer.h (buffer_slot_type_mismatch):
2211 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
2212 * eval.c (unwind_to_catch):
2213 * image.c (my_png_error, my_error_exit):
2214 * keyboard.c (quit_throw_to_read_char, user_error)
2215 (Fexit_recursive_edit, Fabort_recursive_edit):
2216 * lisp.h (die, args_out_of_range, args_out_of_range_3)
2217 (wrong_type_argument, buffer_overflow, __executable_start)
2218 (memory_full, buffer_memory_full, string_overflow, Fthrow)
2219 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
2220 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
2221 (fatal):
2222 (child_setup) [!DOS_NT]:
2223 * lread.c (end_of_file_error, invalid_syntax):
2224 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
2225 * puresize.h (pure_write_error):
2226 * search.c (matcher_overflow):
2227 * sound.c (sound_perror, alsa_sound_perror):
2228 * sysdep.c, syssignal.h (croak):
2229 * term.c (maybe_fatal, vfatal):
2230 * textprop.c (text_read_only):
2231 * undo.c (user_error):
2232 * unexmacosx.c (unexec_error):
2233 * xterm.c (x_ins_del_lines, x_delete_glyphs):
2234 Use _Noreturn rather than NO_RETURN.
2235 No need for separate decl merely because of _Noreturn.
2236 * sound.c (sound_warning, parse_sound):
2237 Remove unnecessary forward decls.
2238
f1dd8073
PE
22392012-06-24 Paul Eggert <eggert@cs.ucla.edu>
2240
2241 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
2242 * lisp.h (WAIT_READING_MAX): New macro.
2243 * dispnew.c (Fsleep_for, sit_for):
2244 * keyboard.c (kbd_buffer_get_event):
2245 * process.c (Faccept_process_output):
2246 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
2247 This improves on the previous patch, which introduced a bug
2248 when time_t is unsigned and as wide as intmax_t.
2249 See <http://bugs.gnu.org/9000#51>.
2250
b82c1755
EZ
22512012-06-23 Eli Zaretskii <eliz@gnu.org>
2252
2253 * dispnew.c (sit_for, Fsleep_for):
2254 * keyboard.c (kbd_buffer_get_event):
2255 * process.c (Faccept_process_output): Avoid compiler warnings when
2256 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
2257
ca300656
JB
22582012-06-23 Juanma Barranquero <lekktu@gmail.com>
2259
049ec95b
JB
2260 * makefile.w32-in: Update dependencies.
2261
ca300656
JB
2262 * w32.c (ltime): Add return type and declare static.
2263 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
2264
db7b8d06
PE
22652012-06-23 Paul Eggert <eggert@cs.ucla.edu>
2266
2267 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
2268 Privately reported by Herbert J. Skuhra.
2269 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
2270 All uses changed.
2271 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
2272 not make_lisp_timeval, when the argument is of type EMACS_TIME.
2273
0bd8297f
EZ
22742012-06-23 Eli Zaretskii <eliz@gnu.org>
2275
96512555
EZ
2276 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
2277 last argument of make_unibyte_string.
2278
0bd8297f
EZ
2279 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
2280 language ID in the event parameters.
2281
2282 * w32term.c (w32_read_socket): Put the new keyboard codepage into
2283 event.code, not the obscure "character set ID".
2284
63def6b6
CY
22852012-06-23 Chong Yidong <cyd@gnu.org>
2286
2287 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
2288
e8a02204
EZ
22892012-06-23 Eli Zaretskii <eliz@gnu.org>
2290
388cdec0
EZ
2291 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
2292 * w32.c (fdutimens): New function.
2293
2294 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
2295
2296 * s/ms-w32.h (pselect): Redirect to sys_select.
2297
2298 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
2299
e8a02204
EZ
2300 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
2301 in the logic of incrementing and decrementing the value of
2302 use_relocatable_buffers.
2303
d054f3fb
PE
23042012-06-23 Paul Eggert <eggert@cs.ucla.edu>
2305
2306 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
2307 Privately reported by Herbert J. Skuhra.
2308 [__FreeBSD__]: Remove "*/" typo after "#include".
2309 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
2310 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
2311 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
2312 Don't assume EMACS_TIME and struct timeval are the same type.
2313
d35af63c
PE
23142012-06-22 Paul Eggert <eggert@cs.ucla.edu>
2315
2316 Support higher-resolution time stamps (Bug#9000).
2317 The time stamps are only nanosecond-resolution at the C level,
2318 since that's the best that any real-world system supports now.
2319 But they are picosecond-resolution at the Lisp level, as that's
2320 easy, and leaves room for future OS improvements.
2321
2322 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
2323 (LIBES): Use it.
2324
2325 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
2326 Don't get current time unless it's needed.
2327
2328 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
2329 now provides it if it's absent.
2330 (start_atimer): Port to higher-res time stamps.
2331 Check for time stamp overflow. Don't get current time more
2332 often than is needed.
2333
2334 * buffer.h (struct buffer): Buffer modtime now has high resolution.
2335 Include systime.h, not time.h.
2336 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
2337
2338 * dired.c: Include stat-time.h.
2339 (Ffile-attributes): File times now have higher resolution.
2340
2341 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
2342 (struct image): Timestamp now has higher resolution.
2343
2344 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
2345 has at least microseconds now. All uses removed.
2346 (update_frame, update_single_window, update_window, update_frame_1)
2347 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
2348
2349 * editfns.c (time_overflow): Now extern.
2350 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
2351 (float-time, Fformat_time_string, Fcurrent_time_string)
2352 (Fcurrent_time_zone): Accept and generate higher-resolution
2353 time stamps.
2354 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
2355 (decode_time_components, lisp_seconds_argument): New functions.
2356 (make_time): Now static.
2357 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
2358 Report an error if the time is invalid, rather than having the caller
2359 do that.
2360
2361 * fileio.c: Include <stat-time.h>
2362 (Fcopy_file): Copy higher-resolution time stamps.
2363 Prefer to set the time stamp via a file descriptor if that works.
2364 (Fset_file_times, Finsert_file_contents, Fwrite_region)
2365 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
2366 (Fvisited_file_modtime, Fset_visited_file_modtime):
2367 Support higher-resolution time stamps.
2368
2369 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
2370
2371 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
2372
2373 * image.c (prepare_image_for_display, clear_image_cache)
2374 (lookup_image): Port to higer-resolution time stamps.
2375
2376 * keyboard.c (start_polling, bind_polling_period):
2377 Check for time stamp overflow.
2378 (read_char, kbd_buffer_get_event, timer_start_idle)
2379 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
2380 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
2381 Port to higher-resolution time stamps. Do not assume time_t is signed.
2382 (decode_timer): New function. Timers are now vectors of length 9,
2383 not 8, to accommodate the picosecond component.
2384 (timer_check_2): Use it.
2385
2386 * nsterm.m (select_timeout, timeval_subtract): Remove.
2387 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
2388 as they're a bit more accurate and handle overflow better.
2389 (ns_select): Change prototype to be compatible with pselect.
2390 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
2391 * nsterm.h (ns_select): Adjust prototype.
2392
2393 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
2394 us-resolution time stamps.
2395 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
2396
2397 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
2398
2399 * lisp.h (time_overflow): New decl.
2400 (wait_reading_process_output): First arg is now intmax_t, not int,
2401 to accommodate larger waits.
2402
2403 * process.h (struct Lisp_Process.read_output_delay):
2404 Now counts nanoseconds, not microseconds.
2405 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
2406 EMACS_HAS_USECS.
2407 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
2408 (wait_reading_process_output):
2409 Port to ns-resolution time stamps.
2410 (Faccept_process_output, wait_reading_process_output):
2411 Check for time stamp overflow. Do not assume time_t is signed.
2412 (select_wrapper): Remove; we now use pselect.
2413 (Fprocess_attributes): Now generates ns-resolution time stamps.
2414
2415 * sysdep.c: Include utimens.h. Don't include utime.h
2416 or worry about struct utimbuf; gnulib does that for us now.
2417 (gettimeofday): Remove; gnulib provides a substitute.
2418 (make_timeval): New function.
2419 (set_file_times): Now sets ns-resolution time stamps.
2420 New arg FD; all uses changed.
2421 (time_from_jiffies, ltime_from_jiffies, get_up_time)
2422 (system_process_attributes):
2423 Now returns ns-resolution time stamp. All uses changed.
2424 Check for time stamp overflow.
2425
2426 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
2427 provides a substitute now.
2428
2429 * systime.h: Include timespec.h rather than sys/time.h and time.h,
2430 since it guarantees struct timespec.
2431 (EMACS_TIME): Now struct timespec, so that we can support
2432 ns-resolution time stamps.
2433 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
2434 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
2435 (EMACS_USECS): Remove.
2436 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
2437 so multiply the arg by 1000 before storing it.
2438 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
2439 New macros.
2440 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
2441 Port to ns-resolution time stamps.
2442 (EMACS_TIME_NEG_P): Remove; replaced by....
2443 (EMACS_TIME_SIGN): New macro.
2444 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
2445 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
2446 (set_file_times, make_time, lisp_time_argument): Adjust signature.
2447 (make_timeval, make_lisp_time, decode_time_components): New decls.
2448 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
2449 that it mishandled time_t overflow. You can't compare by subtracting!
2450 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
2451 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
2452
2453 * term.c: Include <sys/time.h>.
2454 (timeval_to_Time): New function, for proper overflow wraparound.
2455 (term_mouse_position, term_mouse_click): Use it.
2456
2457 * undo.c (record_first_change): Support higher-resolution time stamps
2458 in the undo buffer.
2459 (Fprimitive_undo): Use them when restoring time stamps.
2460
2461 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
2462 (w32_get_internal_run_time):
2463 Port to higher-resolution Emacs time stamps.
2464 (ltime): Now accepts single 64-bit integer, as that's more convenient
2465 for callers.
2466
2467 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
2468
2469 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
2470 for compatibility with pselect. Support ns-resolution time stamps.
2471
2472 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
2473
2474 * xselect.c (wait_for_property_change, x_get_foreign_selection):
2475 Check for time stamp overflow, and support ns-resolution time stamps.
2476
2477 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
2478 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
2479 (timeval_subtract): Remove; no longer needed.
2480 (XTflash, XTring_bell, x_wait_for_event):
2481 Port to ns-resolution time stamps. Don't assume time_t is signed.
2482
b6a92dfe
CY
24832012-06-22 Chong Yidong <cyd@gnu.org>
2484
2485 * xdisp.c (x_consider_frame_title): Revert last change.
2486
d251c37c
EZ
24872012-06-22 Eli Zaretskii <eliz@gnu.org>
2488
2489 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
2490 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
2491 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
2492 staticidx goes up to 1597 out of 1600 = 0x640.)
2493
f10deafb
PE
24942012-06-20 Paul Eggert <eggert@cs.ucla.edu>
2495
2496 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
2497 Otherwise, the umask might be mistakenly 0 while handling input signals.
2498
ec6de1e2
SM
24992012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
2500
2501 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
2502
28be1ada
DA
25032012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
2504
2505 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
2506 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
2507 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
2508 access to `contents' member of Lisp_Vector objects with AREF and ASET
2509 where appropriate.
2510
c6bf3022
CY
25112012-06-19 Chong Yidong <cyd@gnu.org>
2512
2513 * frame.c (delete_frame): When selecting a frame on a different
2514 text terminal, do not alter the terminal's top-frame.
2515
2516 * xdisp.c (format_mode_line_unwind_data): Record the target
2517 frame's selected window and its terminal's top-frame.
2518 (unwind_format_mode_line): Restore them.
2519 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
2520 Callers changed.
2521 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
2522 since tty frames can be explicitly named.
2523 (prepare_menu_bars): Likewise.
2524
2525 * term.c (Ftty_top_frame): New function.
2526
defd4196
PE
25272012-06-18 Paul Eggert <eggert@cs.ucla.edu>
2528
2529 Port byte-code-meter to modern targets.
2530 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
2531 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 2532 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
2533 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
2534 (METER_1, METER_2): Simplify.
2535
1053a871
SM
25362012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
2537
2538 * data.c (Fdefalias): Return `symbol' (bug#11686).
2539
b7e8d081
MR
25402012-06-18 Martin Rudalics <rudalics@gmx.at>
2541
2542 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
2543 gets killed during executing of this function (Bug#11665).
2544 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
2545 (Vkill_buffer_query_functions): In doc-string say that functions
2546 run by this hook should not change the current buffer.
2547
7ea2b339
PE
25482012-06-18 Paul Eggert <eggert@cs.ucla.edu>
2549
2550 Fix recently-introduced process.c problems found by static checking.
2551 * process.c (write_queue_push, write_queue_pop, send_process):
2552 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
2553 (write_queue_pop): Fix pointer signedness problem.
2554 (send_process): Remove unused local.
2555
96a313a1
CY
25562012-06-17 Chong Yidong <cyd@gnu.org>
2557
2558 * xdisp.c (redisplay_internal): No need to redisplay terminal
2559 frames that are not on top.
2560
20ca2e94
TN
25612012-06-17 Troels Nielsen <bn.troels@gmail.com>
2562
2563 * process.c (make_process): Initialize write_queue.
2564 (write_queue_push, write_queue_pop): New functions.
2565 (send_process): Use them to maintain correct ordering of process
2566 writes (Bug#10815).
2567
9a900ca9
PE
25682012-06-17 Paul Eggert <eggert@cs.ucla.edu>
2569
310fbfa8
PE
2570 * lisp.h (eassert): Assume C89 or later.
2571 This removes the need for CHECK.
2572 (CHECK): Remove. Its comments about always evaluating its
2573 argument were confusing, as 'eassert' typically does not evaluate
2574 its argument.
2575
27bb1ca4
PE
2576 * coding.c (produce_chars): Use ptrdiff_t, not int.
2577
9a900ca9
PE
2578 * xterm.c (x_draw_underwave): Check for integer overflow.
2579 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
2580
41b7f8bc 25812012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
2582
2583 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
2584 referenced (Bug#11583).
2585
9b0e3eba
AA
25862012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
2587
2588 Implement wave-style variant of underlining.
2589 * dispextern.h (face_underline_type): New enum.
2590 (face): Add field for underline type.
2591 * nsterm.m (ns_draw_underwave): New function.
2592 (ns_draw_text_decoration): Use it.
2593 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
2594 New functions.
2595 (x_draw_glyph_string): Use them.
2596 * xfaces.c (Qline, Qwave): New Lisp objects.
2597 (check_lface_attrs, merge_face_ref)
1053a871
SM
2598 (Finternal_set_lisp_face_attribute, realize_x_face):
2599 Handle wave-style underline face attributes.
9b0e3eba
AA
2600 * xterm.c (x_draw_underwave): New function.
2601 (x_draw_glyph_string): Use it.
2602
0fb52f11
JB
26032012-06-16 Juanma Barranquero <lekktu@gmail.com>
2604
2605 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
2606 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
2607 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
2608 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
2609 ($(BLD)/w32select.$(O)): Update dependencies.
2610
e5560ff7
AS
26112012-06-16 Andreas Schwab <schwab@linux-m68k.org>
2612
2613 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
2614 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
2615 * character.c (_fetch_multibyte_char_p): Remove.
2616 * alloc.c: Include "character.h" before "buffer.h".
2617 * bidi.c: Likewise.
2618 * buffer.c: Likewise.
2619 * bytecode.c: Likewise.
2620 * callint.c: Likewise.
2621 * callproc.c: Likewise.
2622 * casefiddle.c: Likewise.
2623 * casetab.c: Likewise.
2624 * category.c: Likewise.
2625 * cmds.c: Likewise.
2626 * coding.c: Likewise.
2627 * composite.c: Likewise.
2628 * dired.c: Likewise.
2629 * dispnew.c: Likewise.
2630 * doc.c: Likewise.
2631 * dosfns.c: Likewise.
2632 * editfns.c: Likewise.
2633 * emacs.c: Likewise.
2634 * fileio.c: Likewise.
2635 * filelock.c: Likewise.
2636 * font.c: Likewise.
2637 * fontset.c: Likewise.
2638 * fringe.c: Likewise.
2639 * indent.c: Likewise.
2640 * insdel.c: Likewise.
2641 * intervals.c: Likewise.
2642 * keyboard.c: Likewise.
2643 * keymap.c: Likewise.
2644 * lread.c: Likewise.
2645 * macros.c: Likewise.
2646 * marker.c: Likewise.
2647 * minibuf.c: Likewise.
2648 * nsfns.m: Likewise.
2649 * nsmenu.m: Likewise.
2650 * print.c: Likewise.
2651 * process.c: Likewise.
2652 * regex.c: Likewise.
2653 * region-cache.c: Likewise.
2654 * search.c: Likewise.
2655 * syntax.c: Likewise.
2656 * term.c: Likewise.
2657 * textprop.c: Likewise.
2658 * undo.c: Likewise.
2659 * unexsol.c: Likewise.
2660 * w16select.c: Likewise.
2661 * w32fns.c: Likewise.
2662 * w32menu.c: Likewise.
2663 * window.c: Likewise.
2664 * xdisp.c: Likewise.
2665 * xfns.c: Likewise.
2666 * xmenu.c: Likewise.
2667 * xml.c: Likewise.
2668 * xselect.c: Likewise.
2669
2f07e6af
EZ
26702012-06-16 Eli Zaretskii <eliz@gnu.org>
2671
1053a871
SM
2672 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
2673 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 2674 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
2675 row.
2676 (handle_face_prop): Use chunk-relative overlay string index when
2677 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
2678 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
2679 the rightmost. (Bug#11720)
2f07e6af 2680
29b83cec
AS
26812012-06-16 Andreas Schwab <schwab@linux-m68k.org>
2682
2683 * category.h (CHAR_HAS_CATEGORY): Define as inline.
2684 (CATEGORY_MEMBER): Enforce 1/0 value.
2685 * category.c (_temp_category_set): Remove.
2686
4c5501e9
EZ
26872012-06-16 Eli Zaretskii <eliz@gnu.org>
2688
2689 * window.c (Fdelete_other_windows_internal)
2690 (Fdelete_window_internal): Don't access frame's mouse highlight
2691 info of the initial frame. (Bug#11677)
2692
2b570124
PE
26932012-06-14 Paul Eggert <eggert@cs.ucla.edu>
2694
e93864f9
PE
2695 * .gdbinit (xgetint): Fix recently-introduced paren typo.
2696 Assume USE_2_TAGS_FOR_INTS.
2697 (xreload): Adjust $tagmask width to match recent lisp.h change.
2698
2b570124
PE
2699 Simplify lisp.h in minor ways that should not affect code.
2700 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
2701 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
2702 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
2703 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
2704 (INTTYPEBITS): New macro, for clarity.
2705 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
2706 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
2707 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
2708 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
2709 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
2710
81755f69
JB
27112012-06-13 Juanma Barranquero <lekktu@gmail.com>
2712
2713 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
2714
16192a57
GM
27152012-06-13 Glenn Morris <rgm@gnu.org>
2716
2717 * s/bsd-common.h (BSD4_3):
2718 * s/usg5-4-common.h (USG5_4): No longer define; unused.
2719
646b5f55
AS
27202012-06-13 Andreas Schwab <schwab@linux-m68k.org>
2721
2722 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
2723 instead of union.
2724 (XLI, XIL): Define.
1053a871
SM
2725 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
2726 Use them.
2727 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 2728 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 2729 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
2730 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
2731 * frame.c (delete_frame): Remove outdated comment.
2732 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
2733 USE_LISP_UNION_TYPE.
2734 (Fw32_unregister_hot_key): Likewise.
2735 (Fw32_toggle_lock_key): Likewise.
2736 * w32menu.c (add_menu_item): Likewise.
2737 (w32_menu_display_help): Use XIL instead of checking
2738 USE_LISP_UNION_TYPE.
2739 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
2740 (init_heap): Likewise.
2741 * w32term.c (w32_read_socket): Update comment.
2742
1d3823c9
GM
27432012-06-13 Glenn Morris <rgm@gnu.org>
2744
c62ff706
GM
2745 * s/usg5-4-common.h, src/s/unixware.h:
2746 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
2747
1d3823c9
GM
2748 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
2749
bfe3e0a2
PE
27502012-06-13 Paul Eggert <eggert@cs.ucla.edu>
2751
2752 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
2753 * alloc.c (make_number) [!defined make_number]:
2754 Remove, as lisp.h always defines this now.
2755 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
2756 (roundup_size): Verify that it is a power of 2.
2757 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
2758 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
2759 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
2760 -DUSE_LSB_TAG=0, to override the automatically-selected default.
2761 USE_LSB_TAG now is always defined to be either 0 or 1.
2762 All uses changed.
2763 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
2764 code works fine either way, and efficiency is not a concern here,
2765 as the union type is for debugging, not for production.
2766 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
2767 Use an inline function on all platforms when using the union type,
2768 since this is simpler and 'static inline' can be used portably
2769 within Emacs now.
2770 (LISP_INITIALLY_ZERO): New macro.
2771 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
2772 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
2773
45fa9c0f
GM
27742012-06-12 Glenn Morris <rgm@gnu.org>
2775
b4492cba
GM
2776 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
2777
2778 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 2779
45fa9c0f
GM
2780 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
2781 Move BROKEN_SIGIO to configure.
2782
2783 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
2784 Move NO_TERMIO to configure.
2785
0e25d334
CY
27862012-06-12 Chong Yidong <cyd@gnu.org>
2787
2788 * image.c (imagemagick_load_image): Use MagickFlattenImage if
2789 MagickMergeImageLayers is undefined. Use pixel pusher loop if
2790 MagickExportImagePixels is undefined.
2791
43682bb6
PE
27922012-06-12 Paul Eggert <eggert@cs.ucla.edu>
2793
2794 * image.c (imagemagick_load_image): Remove unused label.
2795
a9be7d2b
GM
27962012-06-11 Glenn Morris <rgm@gnu.org>
2797
2798 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2799 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
2800 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
2801 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
2802
3017f87f
SM
28032012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
2804
2805 * alloc.c (make_byte_code): New function.
2806 (Fmake_byte_code): Use it. Don't purify here.
2807 * lread.c (read1): Use it as well to avoid extra allocation.
2808
1b9b4cf4
CY
28092012-06-11 Chong Yidong <cyd@gnu.org>
2810
2811 * image.c (imagemagick_load_image): Implement transparency.
2812
95988fcf
AS
28132012-06-10 Andreas Schwab <schwab@linux-m68k.org>
2814
2815 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
2816 account for preceding backslashes. (Bug#11663)
2817
cd4eb164
CY
28182012-06-09 Chong Yidong <cyd@gnu.org>
2819
2820 * term.c: Support italics in capable terminals (Bug#9652).
2821 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
2822 (turn_on_face): Output using TS_enter_italic_mode if available.
2823 Don't handle unused blinking and alt-charset cases.
2824 (turn_off_face): Handle italic case; discard unused tty_blinking_p
2825 and tty_alt_charset_p cases.
2826 (tty_capable_p, init_tty): Support italics.
2827
2828 * termchar.h (struct tty_display_info): Add field for italics.
2829 Remove unused blink field.
2830
2831 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
2832 Handle slant.
2833
2834 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
2835 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
2836 tty_alt_charset_p. Add tty_italic_p.
2837
ff88beb8
MA
28382012-06-09 Michael Albinus <michael.albinus@gmx.de>
2839
2840 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
2841 dbus_type_is_basic if available.
2842 (xd_extract_signed, xd_extract_unsigned): Rename from
2843 extract_signed and extract_unsigned, respectively. Adapt callers.
2844
44286096
CY
28452012-06-09 Chong Yidong <cyd@gnu.org>
2846
1682701f
CY
2847 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
2848
44286096
CY
2849 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
2850 case (Bug#9752).
2851
d86feb17
PE
28522012-06-08 Paul Eggert <eggert@cs.ucla.edu>
2853
2854 * xdisp.c (vmessage): Treat frame message as multibyte.
2855 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
2856 would generate the diagnostic "Making \302\247 buffer-local while
2857 let-bound!".
2858
d5c20fe8
EZ
28592012-06-08 Eli Zaretskii <eliz@gnu.org>
2860
2861 * dispnew.c (showing_window_margins_p): Undo last change, which
2862 was done due to an inadvertent commit.
2863 (adjust_frame_glyphs_for_frame_redisplay): Do call
2864 showing_window_margins_p.
2865
513749ee
SM
28662012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
2867
2868 * eval.c (Fmake_var_non_special): New primitive.
2869 (syms_of_eval): Defsubr it.
2870 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
2871
d4a8f5c1
JB
28722012-06-08 Juanma Barranquero <lekktu@gmail.com>
2873
2874 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
2875 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
2876
8bbbc977
EZ
28772012-06-08 Eli Zaretskii <eliz@gnu.org>
2878
2879 * alloc.c (allocate_vectorlike): Fix last change.
2880
f3372c87
DA
28812012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
2882
2883 Block-based vector allocation of small vectors.
2884 * lisp.h (struct vectorlike_header): New field `nbytes',
2885 adjust comment accordingly.
2886 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
2887 to denote vector blocks. Adjust users (live_vector_p,
2888 mark_maybe_pointer, valid_lisp_object_p) accordingly.
2889 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
2890 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
2891 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
2892 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
2893 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
2894 (roundup_size): New constant.
2895 (struct vector_block): New data type.
2896 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 2897 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
2898 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
2899 (sweep_vectors): New functions.
2900 (allocate_vectorlike): Return `zero_vector' as the only vector of
2901 0 items. Allocate new vector from block if vector size is less than
2902 or equal to VBLOCK_BYTES_MAX.
2903 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
2904 (init_alloc_once): Add call to init_vectors.
2905
4f18a4ed
SM
29062012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
2907
2908 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
2909
86f158bc
PE
29102012-06-07 Paul Eggert <eggert@cs.ucla.edu>
2911
2912 * doprnt.c (doprnt): Truncate multibyte char correctly.
2913 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
2914 would mishandle a string argument "Xc" if X was a multibyte
2915 character of length 2: it would truncate after X's first byte
2916 rather than including all of X.
2917
c5cfcbe0
CY
29182012-06-06 Chong Yidong <cyd@gnu.org>
2919
2920 * buffer.c (word_wrap): Doc fix.
2921
c05cf390
PE
29222012-06-04 Paul Eggert <eggert@cs.ucla.edu>
2923
2924 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
2925
0c3461de
GM
29262012-06-03 Glenn Morris <rgm@gnu.org>
2927
2928 * xdisp.c (tool-bar-style): Doc fix.
2929
c71232db
UM
29302012-06-03 Ulrich Müller <ulm@gentoo.org>
2931
2932 * Makefile.in (PAXCTL): Define.
2933 (temacs$(EXEEXT)): Disable memory randomization for the temacs
2934 binary via PaX flags if the paxctl utility is available.
2935 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2936 Restore PaX flags to their default. (Bug#11398)
2937
383f7350
CY
29382012-06-03 Chong Yidong <cyd@gnu.org>
2939
2940 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
2941 buffer (Bug#11226).
2942
5f2c76c6
CY
29432012-06-03 Chong Yidong <cyd@gnu.org>
2944
2945 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
2946 (note_mode_line_or_margin_highlight): If there is no help echo,
2947 use mode-line-default-help-echo. Handle the case where the mouse
2948 position is past the end of the mode line string.
2949
2950 * buffer.c (buffer_local_value_1): New function, split from
2951 Fbuffer_local_value; can return Qunbound.
2952 (Fbuffer_local_value): Use it.
2953 (Vmode_line_format): Docstring tweaks.
2954
773d47f6
PE
29552012-06-02 Paul Eggert <eggert@cs.ucla.edu>
2956
2957 * sysdep.c (system_process_attributes): Improve comment.
2958
f2d6a3df
SM
29592012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
2960
2961 * keyboard.c: Export real-this-command to Elisp.
2962 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
2963 and DEFVAR it. Update all users.
2964
63810350
PE
29652012-06-02 Paul Eggert <eggert@cs.ucla.edu>
2966
7bd5c1f4
PE
2967 * minibuf.c (Fassoc_string): Remove duplicate declaration.
2968
63810350
PE
2969 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
2970 Convert pctcpu and pctmem to Lisp float properly.
2971 Let the compiler fold better, as 100.0/0x8000 is exact.
2972
a2821611
AS
29732012-06-02 Andreas Schwab <schwab@linux-m68k.org>
2974
2975 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
2976 cons_block.
2977
5fceba1d
PE
29782012-06-01 Paul Eggert <eggert@cs.ucla.edu>
2979
2980 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
2981
c98ff5dd
DA
29822012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
2983
2984 For a 'struct window', replace some Lisp_Object fields to
2985 bitfields where appropriate, remove unused fields.
2986 * window.h (struct window): Remove unused 'last_mark_x' and
2987 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
2988 change it's type from Lisp_Object to bitfield.
2989 Change type of 'force_start', 'optional_new_start',
2990 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
2991 fields from Lisp_Object to bitfield. Adjust users accordingly.
2992
ca34e0be
PE
29932012-05-31 Paul Eggert <eggert@cs.ucla.edu>
2994
2995 Pacify gcc -Wdouble-precision when using Xaw.
2996 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
2997 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
2998 Use 'float' consistently, rather than 'float' in most places
2999 and 'double' in a couple of places.
3000
efc00ab1 30012012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
3002
3003 * xdisp.c (handle_stop): Detect whether we have overlay strings
3004 loaded by testing it->current.overlay_string_index to be
3005 non-negative, instead of checking whether n_overlay_strings is
3006 positive. (Bug#11587)
3007
efc00ab1 30082012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
3009
3010 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
3011
3012 * doc.c (Fsubstitute_command_keys): Doc fix.
3013
efc00ab1 30142012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
3015
3016 * search.c (search_buffer): Remove calls to
3017 r_alloc_inhibit_buffer_relocation, as it is now called by
3018 maybe_unify_char, which was the cause of relocation of buffer text
3019 in bug#11519.
3020
efc00ab1 30212012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
3022
3023 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
3024 for the duration of call to load_charset, to avoid problems with
3025 callers of maybe_unify_char that access buffer text through C
3026 pointers.
3027
3028 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
3029 decrement the inhibition flag, instead of just setting or
3030 resetting it.
3031
ba93a187
PE
30322012-05-31 Paul Eggert <eggert@cs.ucla.edu>
3033
3034 Remove obsolete '#define static' cruft.
3035 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
3036 This #undef was "temporary" in 2000; it is no longer needed
3037 now that '#define static' has gone away.
3038 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
3039 (gray_bitmap_bits): Remove; no longer needed.
3040 All uses replaced with definiens.
3041 * xterm.c: Include "bitmaps/gray.xbm".
3042
9e4bf381
PE
30432012-05-30 Paul Eggert <eggert@cs.ucla.edu>
3044
3045 Clean up __executable_start, monstartup when --enable-profiling.
3046 The following changes affect the code only when profiling.
3047 * dispnew.c (__executable_start): Rename from safe_bcopy.
3048 Define only on platforms that need it.
3049 * emacs.c: Include <sys/gmon.h> when profiling.
3050 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
3051 (__executable_start): Remove decl, since lisp.h does it now.
3052 (safe_bcopy): Remove decl; no longer has that name.
3053 (main): Coalesce #if into single bit of code, for simplicity.
3054 Cast pointers to uintptr_t, since standard libraries want integers
3055 and not pointers.
3056 * lisp.h (__executable_start): New decl.
3057
32d72c2f
GM
30582012-05-31 Glenn Morris <rgm@gnu.org>
3059
3060 * image.c (Fimagemagick_types): Doc fix.
3061
baac5bc7
JM
30622012-05-30 Jim Meyering <meyering@redhat.com>
3063
3064 * callproc.c (Fcall_process_region): Include directory component
3065 in mkstemp error message (Bug#11586).
3066
72cb32cf
PE
30672012-05-30 Paul Eggert <eggert@cs.ucla.edu>
3068
3069 * alloc.c, lisp.h (make_pure_vector): Now static.
3070
61b108cc
SM
30712012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
3072
3073 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
3074 Move to byte-run.el.
3075 (Fautoload): Do the hash-doc more carefully.
3076 * data.c (Fdefalias): Purify definition, except for keymaps.
3077 (Qdefun): Move from eval.c.
3078 * lisp.h (Qdefun): Remove.
3079 * lread.c (read1): Tiny simplification.
3080
471fe23d
TN
30812012-05-29 Troels Nielsen <bn.troels@gmail.com>
3082
934f3f58 3083 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
3084 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
3085 Bug#9642, but explicitly check that the buffer the overlay would
3086 be moved to is live and rearrange lines to make sure that errors
3087 will not put the overlay in an inconsistent state.
3088 (Fdelete_overlay): Cosmetics.
3089
85d0efd1
EZ
30902012-05-28 Eli Zaretskii <eliz@gnu.org>
3091
3092 * w32term.c (my_bring_window_to_top): New function.
3093 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
3094 could be different from the original one.
3095 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
3096 (Bug#11513)
3097
3098 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
3099 by calling BringWindowToTop.
3100
3101 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
3102 (WM_EMACS_END): Increase by one.
3103
da92a98c
PE
31042012-05-28 Paul Eggert <eggert@cs.ucla.edu>
3105
3106 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
3107 This avoids undefined behavior that might cause the eassert
3108 to not catch an out-of-range value.
3109
74d1f848
JB
31102012-05-28 Juanma Barranquero <lekktu@gmail.com>
3111
3112 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
3113 Update dependencies.
3114
9e1a06fc
EZ
31152012-05-27 Eli Zaretskii <eliz@gnu.org>
3116
3117 * bidi.c (bidi_mirror_char): Fix last change.
3118
f3dd7312
AS
31192012-05-27 Andreas Schwab <schwab@linux-m68k.org>
3120
3121 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
3122 when referring to sectname field in printf format.
3123
81899c91
PE
31242012-05-27 Paul Eggert <eggert@cs.ucla.edu>
3125
57b81a9f
PE
3126 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
3127 Only r_alloc_inhibit_buffer_relocation needed to be added;
3128 the others were already declared.
3129
81899c91
PE
3130 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
3131 before checking whether it's out of range. Put the check inside
3132 eassert. See
3133 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
3134
33017faf 31352012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
3136
3137 * callproc.c (Fcall_process): Restore a line that was accidentally
3138 commented out in the 2011-02-13 change (bug#11547).
3139
33017faf 31402012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
3141
3142 * lisp.h [REL_ALLOC]: Add prototypes for external functions
3143 defined on ralloc.c.
3144
3145 * buffer.c [REL_ALLOC]: Remove prototypes of
3146 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
3147 they are now on lisp.h.
3148
3149 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
3150
3151 * search.c (search_buffer): Use it to inhibit relocation of buffer
3152 text while re_search_2 is doing its job, because re_search_2 is
3153 passed C pointers to buffer text. (Bug#11519)
3154
23415acf
EZ
3155 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
3156 Update value to 24.
3157
44e27368
EZ
3158 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
3159 state after an additional call to move_it_in_display_line_to, keep
3160 the values of it->max_ascent and it->max_descent found for the
3161 entire line.
3162 (pos_visible_p): Revert the comparison against bottom_y to what it
3163 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
3164 (Bug#11464)
3165
c1892f11
PE
31662012-05-26 Paul Eggert <eggert@cs.ucla.edu>
3167
3168 Fix coding-related core dumps with gcc -ftrapv.
3169 The code was computing A - B, where A and B are pointers, and B is
3170 random garbage. This can lead to core dumps on platforms that
3171 have special pointer registers, and it also leads to core dumps on
3172 x86-64 when compiled with gcc -ftrapv. The fix is to compute
3173 A - B only when B is initialized properly.
3174 * coding.c (coding_set_source, coding_set_destination): Return void.
3175 (coding_change_source, coding_change_destinations): New functions,
3176 with the old behaviors of coding_set_source and coding_set_destination.
3177 All callers that need an offset changed to use these new functions.
3178
eb7afdad
GM
31792012-05-26 Glenn Morris <rgm@gnu.org>
3180
3181 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
3182
f12fdf02
EZ
31832012-05-26 Eli Zaretskii <eliz@gnu.org>
3184
53a63be6 3185 Extend mouse support on W32 text-mode console.
61b108cc
SM
3186 * xdisp.c (draw_row_with_mouse_face):
3187 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 3188
eb3f6f01 3189 * w32console.c: Include window.h.
61b108cc
SM
3190 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
3191 New functions.
eb3f6f01
EZ
3192 (initialize_w32_display): Initialize mouse-highlight data.
3193
53a63be6
EZ
3194 * w32inevt.c: Include termchar.h and window.h.
3195 (do_mouse_event): Support mouse-autoselect-window. When the mouse
3196 moves, call note_mouse_highlight. If help_echo changed, call
3197 gen_help_event to produce help-echo message in the echo area.
3198 Call clear_mouse_face if mouse_face_hidden is set in the mouse
3199 highlight info.
3200
4cfd81f6
PE
32012012-05-26 Paul Eggert <eggert@cs.ucla.edu>
3202
3203 * lread.c (read1): Simplify slightly to avoid an overflow warning
3204 with GCC 4.7.0 on x86-64.
3205
4446092a
EZ
32062012-05-26 Eli Zaretskii <eliz@gnu.org>
3207
3208 * bidi.c (bidi_mirror_char): Revert last change: an int is
3209 definitely wide enough here.
3210
42b2a986 32112012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 3212
42b2a986 3213 Fix integer width and related bugs (Bug#9874).
eb106a49 3214 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
3215 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
3216 (string_bytes, check_sblock, allocate_string_data):
3217 (compact_small_strings, Fmake_bool_vector, make_string)
3218 (make_unibyte_string, make_multibyte_string)
3219 (make_string_from_bytes, make_specified_string)
3220 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
3221 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
3222 (mark_vectorlike):
3223 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3224 (allocate_pseudovector):
3225 Use int, not EMACS_INT, where int is wide enough.
3226 (inhibit_garbage_collection, Fgarbage_collect):
3227 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3228 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
3229 int might not be wide enough.
3230 (bidi_cache_search, bidi_cache_find, bidi_init_it)
3231 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
3232 (bidi_at_paragraph_end, bidi_find_paragraph_start)
3233 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
3234 (bidi_level_of_next_char, bidi_move_to_visually_next):
3235 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3236 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
3237 (Fkill_buffer, Fset_buffer_major_mode)
3238 (advance_to_char_boundary, Fbuffer_swap_text)
3239 (Fset_buffer_multibyte, overlays_at, overlays_in)
3240 (overlay_touches_p, struct sortvec, record_overlay_string)
3241 (overlay_strings, recenter_overlay_lists)
3242 (adjust_overlays_for_insert, adjust_overlays_for_delete)
3243 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
3244 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
3245 (Foverlay_recenter, last_overlay_modification_hooks_used)
3246 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
3247 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
3248 (validate_region): Omit unnecessary test for b <= e,
3249 since that's guaranteed by the previous test.
d311d28c
PE
3250 (adjust_overlays_for_delete): Avoid pos + length overflow.
3251 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
3252 (report_overlay_modification):
3253 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3254 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
3255 Omit pointer cast, which isn't needed anyway, and doesn't work
3256 after the EMACS_INT -> ptrdiff_t change.
02481186 3257 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
3258 * buffer.h: Adjust decls to match defn changes elsewhere.
3259 (struct buffer_text, struct buffer):
3260 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3261 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
3262 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
3263 not int, to avoid needless 32-bit limit on 64-bit hosts.
3264 (exec_byte_code): Use tighter memory-full test, one that checks
3265 for alloca overflow. Don't compute the address of the object just
3266 before an array, as that's not portable. Use EMACS_INT, not
3267 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
3268 * callint.c (Fcall_interactively):
3269 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3270 * callproc.c (call_process_kill, Fcall_process):
3271 Don't assume pid_t fits into an Emacs fixnum.
3272 (call_process_cleanup, Fcall_process, child_setup):
3273 Don't assume pid_t fits into int.
3274 (call_process_cleanup, Fcall_process, delete_temp_file)
3275 (Fcall_process_region):
3276 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3277 (Fcall_process): Simplify handling of volatile integers.
3278 Use int, not EMACS_INT, where int will do.
3279 * casefiddle.c (casify_object, casify_region, operate_on_word)
3280 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
3281 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3282 (casify_object): Avoid integer overflow when overallocating buffer.
3283 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 3284 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
3285 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
3286 * category.h (CATEGORYP): Don't assume arg is nonnegative.
3287 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
3288 integers are now checked earlier. All uses replaced with XINT.
3289 (ccl_driver):
3290 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3291 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
3292 (ccl_driver, Fregister_code_conversion_map):
3293 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
3294 (resolve_symbol_ccl_program): Check that vector header is in range.
3295 Always copy the vector, so that we can check its contents reliably
3296 now rather than having to recheck each instruction as it's being
3297 executed. Check that vector words fit in 'int'.
3298 (ccl_get_compiled_code, Fregister_ccl_program)
3299 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
3300 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
3301 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
3302 contents are in range.
3303 (Fccl_execute_on_string): Check that status is in range.
3304 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
3305 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
3306 Accept and return EMACS_INT, not int, because callers can pass values
3307 out of 'int' range.
3308 (c_string_width, strwidth, lisp_string_width, chars_in_text)
3309 (multibyte_chars_in_text, parse_str_as_multibyte)
3310 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
3311 (str_as_unibyte, str_to_unibyte, string_count_byte8)
3312 (string_escape_byte8, Fget_byte):
3313 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 3314 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
3315 avoid mishandling large integers.
3316 * character.h: Adjust decls to match defn changes elsewhere.
3317 * charset.c (load_charset_map_from_file, find_charsets_in_text)
3318 (Ffind_charset_region):
3319 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3320 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
3321 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 3322 Don't assume fixnum fits in int.
d311d28c
PE
3323 (load_charset_map_from_vector, Fmap_charset_chars):
3324 Remove now-unnecessary CHECK_NATNUMs.
3325 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
3326 Don't rely on undefined behavior with signed left shift overflow.
3327 Don't assume unsigned int fits into fixnum, or that fixnum fits
3328 into unsigned int. Don't require max_code to be a valid fixnum;
3329 that's not true for gb10830 4-byte on a 32-bit host. Allow
3330 invalid_code to be a cons, for the same reason. Require code_offset
3331 to be a character. Avoid int overflow if max_char is close
3332 to INT_MAX.
3333 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
3334 this is intended anyway and avoids some undefined behavior.
3335 (load_charset_map): Pass unsigned, not int, as 2nd arg of
3336 INDEX_TO_CODE_POINT, as that's what it expects.
3337 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
3338 * charset.h (DECODE_CHAR): Return int, not unsigned;
3339 this is what was intended anyway, and it avoids undefined behavior.
3340 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
3341 integer-overflow issues.
3342 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
3343 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
3344 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
3345 * chartab.c (Fmake_char_table, Fset_char_table_range)
3346 (uniprop_get_decoder, uniprop_get_encoder):
3347 Don't assume fixnum fits in int.
3348 * cmds.c (move_point): New function, that does the gist of
3349 Fforward_char and Fbackward_char, but does so while checking
3350 for integer overflow more accurately.
c96e5d6a 3351 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
3352 (Fforward_line, Fend_of_line, internal_self_insert)
3353 (internal_self_insert):
3354 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3355 Fix a FIXME, by checking for integer overflow when calculating
3356 target_clm and actual_clm.
3357 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 3358 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
3359 (ASSURE_DESTINATION, coding_alloc_by_realloc)
3360 (coding_alloc_by_making_gap, alloc_destination)
3361 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
3362 (encode_coding_utf_16, detect_coding_emacs_mule)
3363 (decode_coding_emacs_mule, encode_coding_emacs_mule)
3364 (detect_coding_iso_2022, decode_coding_iso_2022)
3365 (encode_invocation_designation, encode_designation_at_bol)
3366 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
3367 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
3368 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
3369 (encode_coding_ccl, encode_coding_raw_text)
3370 (detect_coding_charset, decode_coding_charset)
3371 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
3372 (produce_composition, produce_charset, produce_annotation)
3373 (decode_coding, handle_composition_annotation)
3374 (handle_charset_annotation, consume_chars, decode_coding_gap)
3375 (decode_coding_object, encode_coding_object, detect_coding_system)
3376 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
3377 (code_convert_region, code_convert_string)
8f50130c
PE
3378 (Fdefine_coding_system_internal)
3379 (coding_set_source, coding_set_destination):
d311d28c
PE
3380 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3381 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
3382 (Fdefine_coding_system_internal):
3383 Don't assume fixnums fit in int.
3384 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 3385 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
3386 (Funencodable_char_position, Fcheck_coding_systems_region)
3387 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 3388 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 3389 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 3390 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 3391 Don't access memory outside of the args array.
d311d28c 3392 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
3393 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
3394 result of ENCODE_CHAR.
d311d28c
PE
3395 * coding.h: Adjust decls to match defn changes elsewhere.
3396 (struct coding_system):
3397 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3398 * composite.c (get_composition_id, find_composition)
3399 (run_composition_function, update_compositions)
3400 (compose_text, composition_gstring_put_cache)
3401 (composition_gstring_p, composition_gstring_width)
3402 (fill_gstring_header, fill_gstring_body, autocmp_chars)
3403 (composition_compute_stop_pos, composition_reseat_it)
3404 (composition_update_it, struct position_record)
3405 (find_automatic_composition, composition_adjust_point)
3406 (Fcomposition_get_gstring, Ffind_composition_internal):
3407 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3408 (update_compositions):
3409 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3410 * composite.h: Adjust decls to match defn changes elsewhere.
3411 (struct composition):
3412 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3413 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
3414 Do not attempt to compute the address of the object just before a
3415 buffer; this is not portable.
3416 (Faref, Faset):
3417 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3418 (Faset): Use int, not EMACS_INT, where int is wide enough.
3419 (Fstring_to_number): Don't assume fixnums fit in int.
3420 (Frem): Don't assume arg is nonnegative.
3421 * dbusbind.c (xd_append_arg): Check for integers out of range.
3422 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 3423 (extract_signed, extract_unsigned): New functions.
243e0530
PE
3424 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
3425 (xd_get_connection_references): Return ptrdiff_t, not int.
3426 All uses changed.
3427 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
3428 (xd_read_message_1):
3429 Use int, not unsigned, where the dbus API uses int.
3430 (Fdbus_message_internal): Don't overflow mtype.
3431 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
3432 * dired.c (directory_files_internal, file_name_completion, scmp)
3433 (file_name_completion_stat):
3434 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3435 (file_name_completion): Don't overflow matchcount.
3436 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
3437 * dispextern.h: Adjust decls to match defn changes elsewhere.
3438 (struct text_pos, struct glyph, struct bidi_saved_info)
3439 (struct bidi_string_data, struct bidi_it, struct composition_it)
3440 (struct it):
3441 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3442 (struct display_pos, struct composition_it, struct it):
3443 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3444 * dispnew.c (increment_matrix_positions)
3445 (increment_row_positions, mode_line_string)
3446 (marginal_area_string):
3447 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 3448 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
3449 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3450 (duration_to_sec_usec): New function, to check for overflow better.
3451 (Fsleep_for, sit_for): Use it.
3452 * doc.c (get_doc_string, store_function_docstring):
3453 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3454 (get_doc_string, Fsnarf_documentation):
3455 Use int, not EMACS_INT, where int is wide enough.
3456 (get_doc_string):
3457 Use SAFE_ALLOCA, not alloca.
3458 Check for overflow when converting EMACS_INT to off_t.
3459 * doprnt.c (doprnt):
3460 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3461 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
3462 Don't assume uid_t fits into fixnum.
3463 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
3464 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
3465 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
3466 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
3467 (general_insert_function)
3468 (Finsert_char, make_buffer_string, make_buffer_string_both)
3469 (update_buffer_properties, Fbuffer_substring)
3470 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
3471 (Fsubst_char_in_region, check_translation)
3472 (Ftranslate_region_internal, save_restriction_restore, Fformat)
3473 (transpose_markers, Ftranspose_regions):
3474 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3475 (clip_to_bounds): Move to lisp.h as an inline function).
3476 (Fconstrain_to_field): Don't assume integers are nonnegative.
3477 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
3478 (Fsubst_char_in_region, Fsave_restriction):
3479 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3480 (Femacs_pid): Don't assume pid_t fits into fixnum.
3481 (lo_time): Use int, not EMACS_INT, when int suffices.
3482 (lisp_time_argument): Check for usec out of range.
3483 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
3484 (Fuser_login_name, Fuser_full_name): Signal an error
3485 if a uid argument is out of range, rather than relying on
3486 undefined behavior.
c8d5c857
PE
3487 (Fformat_time_string): Remove now-unnecessary check.
3488 lisp_time_argument checks for out-of-range usec now.
243e0530 3489 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
3490 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
3491 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
3492 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
3493 (init_cmdargs, Fdump_emacs):
3494 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3495 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
3496 the bottom (typically) 32 bits of the fixnum.
3497 * eval.c (specpdl_size, call_debugger):
3498 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3499 (when_entered_debugger, Fbacktrace_debug):
3500 Don't assume fixnum can fit in int.
3501 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
3502 the object just before a buffer; this is not portable.
3503 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
3504 (grow_specpdl, unbind_to):
3505 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3506 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
3507 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 3508 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
3509 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
3510 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
3511 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3512 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
3513 (a_write, e_write):
3514 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3515 (Fcopy_file, non_regular_nbytes, read_non_regular)
3516 (Finsert_file_contents):
3517 Use int, not EMACS_INT, where int is wide enough.
3518 (READ_BUF_SIZE): Verify that it fits in int.
3519 (Finsert_file_contents): Check that counts are in proper range,
3520 rather than assuming fixnums fit into ptrdiff_t etc.
3521 Don't assume fixnums fit into int.
125b3835 3522 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
3523 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
3524 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
3525 (string_char_to_byte, string_byte_to_char)
3526 (string_make_multibyte, string_to_multibyte)
3527 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
3528 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
3529 (substring_both, Fdelete, internal_equal, Ffillarray)
3530 (Fclear_string, mapcar1)
3531 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
3532 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
3533 (larger_vector, make_hash_table, maybe_resize_hash_table)
3534 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
3535 (Fmaphash, secure_hash):
3536 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3537 (concat): Check for string index and length overflow.
3538 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
3539 (Frequire):
3540 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3541 (larger_vector): New API (vec, incr_min, size_max) replaces old
3542 one (vec, new_size, init). This catches size overflow.
3543 INIT was removed because it was always Qnil.
3544 All callers changed.
3545 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
3546 the upper bound on a hash table index size.
3547 (make_hash_table, maybe_resize_hash_table): Use it.
3548 (secure_hash): Computer start_byte and end_byte only after
3549 they're known to be in ptrdiff_t range.
3550 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
3551 (Ffont_get_glyphs, Ffont_at):
3552 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3553 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
3554 (Flist_fonts, Fopen_font):
3555 Don't assume fixnum can fit in int.
3556 (check_gstring): Don't assume index can fit in int.
3557 (font_match_p): Check that fixnum is a character, not a nonnegative
3558 fixnum, since the later code needs to stuff it into an int.
3559 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
3560 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
3561 conversion overflow issues.
3562 (Fopen_font): Check for integer out of range.
3563 (Ffont_get_glyphs): Don't assume index can fit in int.
3564 * font.h: Adjust decls to match defn changes elsewhere.
3565 * fontset.c (reorder_font_vector): Redo score calculation to avoid
3566 integer overflow.
3567 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
3568 printmax_t, where ptrdiff_t is wide enough.
3569 (Finternal_char_font):
3570 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3571 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
3572 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
3573 (Fset_frame_position, x_set_frame_parameters)
3574 (x_set_line_spacing, x_set_border_width)
3575 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
3576 Check that fixnums are in proper range for system types.
3577 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
3578 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3579 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
3580 Use SAFE_ALLOCA_LISP, not alloca.
3581 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
3582 intptr_t is wide enough.
3583 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
3584 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
3585 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
3586 Check for fixnum out of range.
3587 * ftfont.c (ftfont_list): Don't assume index fits in int.
3588 Check that fixnums are in proper range for system types.
3589 (ftfont_shape_by_flt):
3590 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
3591 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
3592 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3593 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
3594 Check that fixnums are in proper range for system types.
3595 * gnutls.h: Adjust decls to match defn changes elsewhere.
3596 * gtkutil.c (xg_dialog_run):
3597 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3598 (update_frame_tool_bar):
3599 Check that fixnums are in proper range for system types.
3600 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 3601 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
3602 * indent.c (last_known_column, last_known_column_point):
3603 (current_column_bol_cache):
3604 (skip_invisible, current_column, check_display_width):
3605 (check_display_width, scan_for_column, current_column_1)
3606 (Findent_to, Fcurrent_indentation, position_indentation)
3607 (indented_beyond_p, Fmove_to_column, compute_motion):
3608 (Fcompute_motion, Fvertical_motion):
3609 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3610 (last_known_column_modified): Use EMACS_INT, not int.
3611 (check_display_width):
3612 (Fcompute_motion):
3613 Check that fixnums and floats are in proper range for system types.
3614 (compute_motion): Don't assume index or fixnum fits in int.
3615 (compute_motion, Fcompute_motion):
3616 Use int, not EMACS_INT, when it is wide enough.
3617 (vmotion): Omit local var start_hpos that is always 0; that way
3618 we don't need to worry about overflow in expressions involving it.
3619 * indent.h: Adjust decls to match defn changes elsewhere.
3620 (struct position):
3621 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3622 Use int, not EMACS_INT, where int is wide enough.
3623 Remove unused members ovstring_chars_done and tab_offset;
3624 all uses removed.
3625 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
3626 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
3627 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
3628 (make_gap, copy_text, insert, insert_and_inherit)
3629 (insert_before_markers, insert_before_markers_and_inherit)
3630 (insert_1, count_combining_before, count_combining_after)
3631 (insert_1_both, insert_from_string)
3632 (insert_from_string_before_markers, insert_from_string_1)
3633 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
3634 (adjust_after_replace, adjust_after_insert, replace_range)
3635 (replace_range_2, del_range, del_range_1, del_range_byte)
3636 (del_range_both, del_range_2, modify_region)
3637 (prepare_to_modify_buffer, signal_before_change)
3638 (signal_after_change, Fcombine_after_change_execute):
3639 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3640 * intervals.c (traverse_intervals, rotate_right, rotate_left)
3641 (balance_an_interval, split_interval_right, split_interval_left)
3642 (find_interval, next_interval, update_interval)
3643 (adjust_intervals_for_insertion, delete_node, delete_interval)
3644 (interval_deletion_adjustment, adjust_intervals_for_deletion)
3645 (static_offset_intervals, offset_intervals)
3646 (merge_interval_right, merge_interval_left, make_new_interval)
3647 (graft_intervals_into_buffer, temp_set_point_both)
3648 (temp_set_point, set_point, adjust_for_invis_intang)
3649 (set_point_both, move_if_not_intangible, get_property_and_range)
3650 (get_local_map, copy_intervals, copy_intervals_to_string)
3651 (compare_string_intervals, set_intervals_multibyte_1):
3652 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3653 * intervals.h: Adjust decls to match defn changes elsewhere.
3654 (struct interval):
3655 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3656 * keyboard.c (this_command_key_count, this_single_command_key_start)
3657 (before_command_key_count, before_command_echo_length, echo_now)
3658 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
3659 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
3660 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
3661 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
3662 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3663 (last_non_minibuf_size, last_point_position, echo_truncate)
3664 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
3665 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
3666 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
3667 (stuff_buffered_input):
3668 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3669 (last_auto_save, command_loop_1, read_char):
3670 Use EMACS_INT, not int, to avoid integer overflow.
3671 (record_char): Avoid overflow in total_keys computation.
3672 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
3673 * keyboard.h: Adjust decls to match defn changes elsewhere.
3674 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
3675 (Fkey_description, Fdescribe_vector, Flookup_key):
3676 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3677 (click_position): New function, to check that positions are in range.
3678 (Fcurrent_active_maps):
3679 (describe_command):
3680 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3681 (Faccessible_keymaps, Fkey_description):
3682 (preferred_sequence_p):
3683 Don't assume fixnum can fit into int.
3684 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
3685 Check for integer overflow in size calculations.
3686 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
3687 avoid mishandling large integers.
3688 * lisp.h: Adjust decls to match defn changes elsewhere.
3689 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
3690 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
3691 (struct Lisp_Marker):
3692 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3693 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
3694 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
3695 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
3696 All callers changed.
3697 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
3698 Assume the arg has valid form, since it always does.
3699 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
3700 unsigned integer system type.
3701 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
3702 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
3703 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3704 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
3705 (duration_to_sec_usec): New decl.
3706 * lread.c (read_from_string_index, read_from_string_index_byte)
3707 (read_from_string_limit, readchar, unreadchar, openp)
3708 (read_internal_start, read1, oblookup):
3709 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3710 (Fload, readevalloop, Feval_buffer, Feval_region):
3711 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3712 (openp): Check for out-of-range argument to 'access'.
3713 (read1): Use int, not EMACS_INT, where int is wide enough.
3714 Don't assume fixnum fits into int.
6efdadfd 3715 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
3716 (read_filtered_event): Use duration_to_sec_usec
3717 to do proper overflow checking on durations.
d311d28c
PE
3718 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
3719 in size calculation.
3720 (Fexecute_kbd_macro):
3721 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3722 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
3723 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
3724 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
3725 (set_marker_both, set_marker_restricted_both, marker_position)
3726 (marker_byte_position, Fbuffer_has_markers_at):
3727 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3728 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 3729 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
3730 It now merely ensures that the menu is large enough, without
3731 necessarily growing it, as this avoids some integer overflow issues.
3732 All callers changed.
3733 (keymap_panes, parse_single_submenu, Fx_popup_menu):
3734 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3735 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
3736 Use SAFE_ALLOCA_LISP, not alloca.
3737 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
3738 to EMACS_INT. Check that fixnums are in proper range for system types.
3739 * minibuf.c (minibuf_prompt_width, string_to_object)
3740 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
3741 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
3742 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3743 (get_minibuffer, read_minibuf_unwind):
3744 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3745 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
3746 this simplifies overflow checking. All callers changed.
3747 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
3748 (Ftest_completion):
3749 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3750 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
3751 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
3752 Check that fixnums are in proper range for system types.
3753 (Fx_create_frame, Fx_show_tip):
3754 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3755 * nsfont.m (ns_findfonts, nsfont_list_family):
3756 Don't assume fixnum fits in long.
3757 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
3758 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3759 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
3760 wide enough.
17fdb222 3761 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
3762 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3763 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
3764 (PRINTDECLARE, PRINTPREPARE):
3765 (strout, print_string):
3766 (print, print_preprocess, print_check_string_charset_prop)
3767 (print_object):
3768 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3769 (PRINTDECLARE):
3770 (temp_output_buffer_setup, Fprin1_to_string, print_object):
3771 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3772 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 3773 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 3774 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
3775 (print_error_message): Use SAFE_ALLOCA, not alloca.
3776 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
3777 (print_depth, new_backquote_output, print_number_index):
3778 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
3779 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
3780 (Fset_process_window_size, Fformat_network_address)
3781 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 3782 (sigchld_handler):
d311d28c 3783 Check that fixnums are in proper range for system types.
d44287d4 3784 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
3785 Check for process-ids out of pid_t range rather than relying on
3786 undefined behavior.
e4d81efc 3787 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
3788 (Fformat_network_address, read_process_output, send_process)
3789 (Fprocess_send_region, status_notify):
3790 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3791 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
3792 (wait_reading_process_output, read_process_output, exec_sentinel):
3793 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3794 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
3795 (Faccept_process_output): Use duration_to_sec_usec to do proper
3796 overflow checking on durations.
dde14581
PE
3797 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
3798 Don't assume pid_t fits in int.
02481186
PE
3799 * process.h (struct Lisp_Process): Members tick and update_tick
3800 are now of type EMACS_INT, not int.
b62b53e8
PE
3801 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
3802 configured --with-wide-int.
d311d28c
PE
3803 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
3804 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
3805 * search.c (looking_at_1, string_match_1):
3806 (fast_string_match, fast_c_string_match_ignore_case)
3807 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
3808 (scan_newline, find_before_next_newline, search_command)
3809 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
3810 (set_search_regs, wordify):
3811 (Freplace_match):
3812 (Fmatch_data):
3813 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3814 (string_match_1, search_buffer, set_search_regs):
3815 (Fmatch_data):
3816 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3817 (wordify): Check for overflow in size calculation.
3818 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
3819 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
3820 Check that fixnums are in proper range for system types.
3821 * sound.c (struct sound_device)
3822 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
3823 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3824 (Fplay_sound_internal):
3825 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 3826 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
3827 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
3828 (Fparse_partial_sexp):
3829 Don't assume fixnums can fit in int.
3830 (struct lisp_parse_state, find_start_pos, find_start_value)
3831 (find_start_value_byte, find_start_begv)
3832 (update_syntax_table, char_quoted, dec_bytepos)
3833 (find_defun_start, prev_char_comend_first, back_comment):
3834 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
3835 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
3836 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3837 (Finternal_describe_syntax_value): Check that match_lisp is a
3838 character, not an integer, since the code stuffs it into int.
3839 (scan_words, scan_sexps_forward):
3840 Check that fixnums are in proper range for system types.
3841 (Fforward_word):
3842 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3843 (scan_sexps_forward):
3844 Use CHARACTERP, not INTEGERP, since the value must fit into int.
3845 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
3846 * syntax.h: Adjust decls to match defn changes elsewhere.
3847 (struct gl_state_s):
3848 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
3849 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
3850 MOST_POSITIVE_FIXNUM.
d311d28c
PE
3851 * sysdep.c (wait_for_termination_1, wait_for_termination)
3852 (interruptible_wait_for_termination, mkdir):
3853 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
3854 (emacs_read, emacs_write):
3855 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
3856 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
3857 and double all fit in int.
d311d28c
PE
3858 * term.c (set_tty_color_mode):
3859 Check that fixnums are in proper range for system types.
3860 * termhooks.h (struct input_event):
3861 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3862 * textprop.c (validate_interval_range, interval_of)
3863 (Fadd_text_properties, set_text_properties_1)
3864 (Fremove_text_properties, Fremove_list_of_text_properties)
3865 (Ftext_property_any, Ftext_property_not_all)
3866 (copy_text_properties, text_property_list, extend_property_ranges)
3867 (verify_interval_modification):
3868 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3869 (Fnext_single_char_property_change)
3870 (Fprevious_single_char_property_change):
3871 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
3872 (copy_text_properties):
3873 Check for integer overflow in index calculation.
d311d28c
PE
3874 * undo.c (last_boundary_position, record_point, record_insert)
3875 (record_delete, record_marker_adjustment, record_change)
3876 (record_property_change):
3877 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3878 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
3879 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3880 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
3881 (Fx_hide_tip, Fx_file_dialog):
3882 * w32menu.c (set_frame_menubar):
3883 Use ptrdiff_t, not int, for consistency with rest of code.
3884 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
3885 (select_window, Fdelete_other_windows_internal)
3886 (window_scroll_pixel_based, window_scroll_line_based)
3887 (Frecenter, Fset_window_configuration):
3888 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3889 (Fset_window_hscroll, run_window_configuration_change_hook)
3890 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 3891 (Fscroll_other_window, Frecenter):
d311d28c
PE
3892 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3893 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
3894 Don't assume fixnum fits in int.
3895 (Fset_window_scroll_bars):
3896 Check that fixnums are in proper range for system types.
3897 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
3898 (string_pos, c_string_pos, number_of_chars, init_iterator)
3899 (in_ellipses_for_invisible_text_p, init_from_display_pos)
3900 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
3901 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
3902 (face_before_or_after_it_pos, handle_invisible_prop)
3903 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
3904 (display_prop_intangible_p, string_buffer_position_lim)
3905 (string_buffer_position, handle_composition_prop, load_overlay_strings)
3906 (get_overlay_strings_1, get_overlay_strings)
3907 (iterate_out_of_display_property, forward_to_next_line_start)
3908 (back_to_previous_visible_line_start, reseat, reseat_to_string)
3909 (get_next_display_element, set_iterator_to_next)
3910 (get_visually_first_element, compute_stop_pos_backwards)
3911 (handle_stop_backwards, next_element_from_buffer)
3912 (move_it_in_display_line_to, move_it_in_display_line)
3913 (move_it_to, move_it_vertically_backward, move_it_by_lines)
3914 (add_to_log, message_dolog, message_log_check_duplicate)
3915 (message2, message2_nolog, message3, message3_nolog
3916 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
3917 (current_message_1, truncate_echo_area, truncate_message_1)
3918 (set_message, set_message_1, store_mode_line_noprop)
3919 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
3920 (text_outside_line_unchanged_p, check_point_in_composition)
3921 (reconsider_clip_changes)
3922 (redisplay_internal, set_cursor_from_row, try_scrolling)
3923 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
3924 (redisplay_window, find_last_unchanged_at_beg_row)
3925 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
3926 (trailing_whitespace_p, find_row_edges, display_line)
3927 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
3928 (display_mode_element, store_mode_line_string)
3929 (pint2str, pint2hrstr, decode_mode_spec)
3930 (display_count_lines, display_string, draw_glyphs)
3931 (x_produce_glyphs, x_insert_glyphs)
3932 (rows_from_pos_range, mouse_face_from_buffer_pos)
3933 (fast_find_string_pos, mouse_face_from_string_pos)
3934 (note_mode_line_or_margin_highlight, note_mouse_highlight):
3935 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3936 (safe_call, init_from_display_pos, handle_fontified_prop)
3937 (handle_single_display_spec, load_overlay_strings)
3938 (with_echo_area_buffer, setup_echo_area_for_printing)
3939 (display_echo_area, echo_area_display)
3940 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
3941 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
3942 (redisplay_window, dump_glyph_row, display_mode_line)
3943 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 3944 (handle_display_spec, display_prop_string_p):
d311d28c
PE
3945 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3946 (handle_single_display_spec, build_desired_tool_bar_string)
3947 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
3948 (get_specified_cursor_type):
3949 Check that fixnums are in proper range for system types.
3950 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
3951 (Flookup_image_map):
3952 Don't assume fixnums fit in int.
3953 (compare_overlay_entries):
3954 Avoid mishandling comparisons due to subtraction overflow.
3955 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
3956 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
3957 (handle_tool_bar_click):
3958 Use int, not unsigned, since we prefer signed and the signedness
3959 doesn't matter here.
3960 (get_next_display_element, next_element_from_display_vector):
3961 Use int, not EMACS_INT, when int is wide enough.
3962 (start_hourglass): Use duration_to_sec_usec to do proper
3963 overflow checking on durations.
3964 * xfaces.c (Fbitmap_spec_p):
3965 Check that fixnums are in proper range for system types.
3966 (compare_fonts_by_sort_order):
3967 Avoid mishandling comparisons due to subtraction overflow.
3968 (Fx_family_fonts, realize_basic_faces):
3969 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3970 (Fx_family_fonts):
3971 Don't assume fixnum fits in int.
3972 Use SAFE_ALLOCA_LISP, not alloca.
3973 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
3974 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
3975 (face_at_buffer_position, face_for_overlay_string)
3976 (face_at_string_position):
3977 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3978 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
3979 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
3980 (Fx_show_tip):
3981 Check that fixnums are in proper range for system types.
3982 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
3983 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
3984 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3985 (Fx_change_window_property): Don't assume fixnums fit in int.
3986 * xfont.c (xfont_chars_supported):
3987 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3988 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
3989 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
3990 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3991 * xml.c (parse_region):
3992 * xrdb.c (magic_file_p):
3993 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3994 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
3995 (x_get_local_selection, x_reply_selection_request)
3996 (x_handle_selection_request, wait_for_property_change):
3997 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3998 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
3999 short is wide enough.
4000 (x_send_client_event): Don't assume fixnum fits in int.
4001 * xterm.c (x_x_to_emacs_modifiers):
4002 Don't assume EMACS_INT overflows nicely into int.
4003 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
4004 may come from Lisp.
4005 (handle_one_xevent): NATNUMP can eval its arg twice.
4006 (x_connection_closed):
4007 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4008 * xterm.h: Adjust decls to match defn changes elsewhere.
4009 (struct scroll_bar): Use struct vectorlike_header
4010 rather than rolling our own approximation.
4011 (SCROLL_BAR_VEC_SIZE): Remove; not used.
4012
c6574eb5
GM
40132012-05-25 Glenn Morris <rgm@gnu.org>
4014
4015 * lisp.mk (lisp): Update for more files being compiled now.
4016
e8d32c7e
SM
40172012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
4018
48def666
SM
4019 * lread.c: Remove `read_pure' which makes no difference.
4020 (read_pure): Remove var.
4021 (unreadpure): Remove function.
4022 (readevalloop): Don't call read_list with -1 flag.
4023 (read1, read_vector): Don't test read_pure any more.
4024 (read_list): Simplify.
4025
e8d32c7e
SM
4026 * fileio.c, character.h: Minor style tweaks.
4027
4b2addb7
DA
40282012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
4029
4030 * window.h (clip_changed): Remove useless declaration.
4031
584461b2
JB
40322012-05-22 Juanma Barranquero <lekktu@gmail.com>
4033
4034 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
4035 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
4036
34374650
PE
40372012-05-22 Paul Eggert <eggert@cs.ucla.edu>
4038
4039 Remove src/m/*.
4040 This directory predates autoconf and is no longer needed nowadays.
4041 Move its few remaining bits of functionality to where they're needed.
4042 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
4043 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
4044 * m/template.h: Remove.
4045 * Makefile.in (M_FILE): Remove. All uses removed.
4046 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
4047 * lisp.h (USE_LSB_TAG):
4048 * mem-limits.h (EXCEEDS_LISP_PTR):
4049 Use VAL_MAX, not VALBITS, in #if.
4050 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
4051 (EMACS_UINT): Define unconditionally now.
4052 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
4053 (BITS_PER_EMACS_INT): New constants, replacing
4054 what used to be in config.h, but not useful in #if.
4055 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
4056 define them any more.
4057 (VAL_MAX): New macro.
4058 (VALMASK): Use it.
4059 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
4060 BITS_PER_EMACS_INT, in #if.
4061 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4062 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
4063 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
4064 * s/ms-w32.h (DATA_START):
4065 Move here from removed file m/intel386.h.
4066 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
4067 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
4068
261cb4bb
PE
40692012-05-21 Paul Eggert <eggert@cs.ucla.edu>
4070
4071 Assume C89 or later.
4072 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
4073 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
4074 (xrealloc):
4075 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
4076 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
4077 * textprop.c, tparam.c (NULL): Remove.
4078 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
4079 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
4080 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
4081 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
4082 * xterm.c (input_signal_count): Assume volatile works.
4083
ff23cd9f
KB
40842012-05-21 Ken Brown <kbrown@cornell.edu>
4085
4086 * xgselect.c (xg_select): Fix first argument in call to 'select'
4087 (bug#11508).
4088
1b170bc6
KB
40892012-05-20 Ken Brown <kbrown@cornell.edu>
4090
4091 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 4092 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 4093
b2f4d39f
KB
40942012-05-19 Ken Brown <kbrown@cornell.edu>
4095
4096 * xfns.c (x_in_use): Remove `static' qualifier.
4097 * xterm.h (x_in_use): Declare.
4098 * xgselect.c: Include xterm.h.
4099 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
4100 and `display_arg' (bug#9754).
4101
003fdae2
PE
41022012-05-19 Paul Eggert <eggert@cs.ucla.edu>
4103
9232a6d9
PE
4104 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
4105
003fdae2
PE
4106 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
4107 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
4108
784b56e2
EZ
41092012-05-18 Eli Zaretskii <eliz@gnu.org>
4110
4111 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
4112
4113 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 4114 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
4115
4116 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
4117 reference to image_cache->refcount.
4118 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
4119
a0a79cde
JL
41202012-05-17 Juri Linkov <juri@jurta.org>
4121
4122 * search.c (Fword_search_regexp, Fword_search_backward)
4123 (Fword_search_forward, Fword_search_backward_lax)
4124 (Fword_search_forward_lax): Move functions to isearch.el
4125 (bug#10145, bug#11381).
4126
b0572523
PE
41272012-05-16 Paul Eggert <eggert@cs.ucla.edu>
4128
4129 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
4130
9660f5fc
SM
41312012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
4132
4133 * lread.c (init_obarray): Declare Qt and Qnil as special.
4134
4374de83
GM
41352012-05-14 Glenn Morris <rgm@gnu.org>
4136
4137 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 4138 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 4139
dc44c39a
PE
41402012-05-14 Paul Eggert <eggert@cs.ucla.edu>
4141
078c97cb
PE
4142 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
4143
dc44c39a
PE
4144 * unexaix.c: Port to more-recent AIX compilers.
4145 (report_error, report_error_1, make_hdr, copy_sym)
4146 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
4147 Make arguments const char *, not char *, to avoid violations of C
4148 standard and to fix some AIX warnings reported by Gilles Pion.
4149
e18afed7 41502012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
4151
4152 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
4153 already have overlays loaded.
4154 (handle_single_display_spec): Before returning without displaying
4155 fringe bitmap, synchronize the bidi iterator with the main display
4156 iterator, by calling iterate_out_of_display_property.
4157 (iterate_out_of_display_property): Detect buffer iteration by
4158 testing that it->string is a Lisp string.
4159 (get_next_display_element): When the current object is exhausted,
4160 and there's something on it->stack, call set_iterator_to_next to
4161 proceed with what's on the stack, instead of returning zero.
4162 (set_iterator_to_next): If called at the end of a Lisp string,
4163 proceed to consider_string_end without incrementing string
4164 position. Don't increment display vector index past the end of
4165 the display vector. (Bug#11417)
c8fb9dc6
EZ
4166 (pos_visible_p): Don't report a position visible when move_it_to
4167 stopped at the last line of window, which happens to be scanned
4168 backwards by the bidi iteration. (Bug#11464)
ac268e67 4169
e18afed7 41702012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
4171
4172 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
4173 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
4174 are on a TTY, and thus unable to display on the fringes.
4175 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
4176 so we need to signal to the caller that this is a "replacing"
4177 display spec. This fixes display when the spec is invalid or we
4178 are on a TTY.
4179
e18afed7 41802012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
4181
4182 * unexaix.c (make_hdr): Fix typo in prototype.
4183 This bug broke the build on AIX. Problem reported by Gilles Pion.
4184
9d0a235a
MA
41852012-05-14 Michael Albinus <michael.albinus@gmx.de>
4186
4187 * keyboard.c (kbd_buffer_get_event): Read special events also in
4188 batch mode. (Bug#11415)
4189
9e6b06ed
GM
41902012-05-12 Glenn Morris <rgm@gnu.org>
4191
4192 * ns.mk: Update for ns_appbindir no longer having trailing "/".
4193
c1a1d7a3
EZ
41942012-05-12 Eli Zaretskii <eliz@gnu.org>
4195
4196 * lisp.mk (lisp): Add newcomment.elc.
4197
3fe7cdc8
GM
41982012-05-12 Glenn Morris <rgm@gnu.org>
4199
4200 * Makefile.in (MKDIR_P): New, set by configure.
4201 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
4202
53f7d2c0
PE
42032012-05-11 Paul Eggert <eggert@cs.ucla.edu>
4204
4205 Remove unused function hourglass_started.
4206 * dispextern.h (hourglass_started):
4207 * w32fns.c (hourglass_started):
4208 * xdisp.c (hourglass_started): Remove.
4209
75aafb17
JB
42102012-05-10 Juanma Barranquero <lekktu@gmail.com>
4211
4212 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
4213 Update dependencies.
4214
12959e8e
PE
42152012-05-10 Paul Eggert <eggert@cs.ucla.edu>
4216
97107e2e
PE
4217 * xgselect.c (xg_select): Put maxfds+1 into a var.
4218 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
4219
12959e8e
PE
4220 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
4221
836d29b3
DA
42222012-05-10 Dave Abrahams <dave@boostpro.com>
4223
4224 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
4225 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
4226
5cb67954
MA
42272012-05-09 Michael Albinus <michael.albinus@gmx.de>
4228
4229 * dbusbind.c (xd_registered_buses): New internal Lisp object.
4230 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
4231 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
4232 Initialize xd_registered_buses.
4233
3478ec45
PE
42342012-05-09 Paul Eggert <eggert@cs.ucla.edu>
4235
b263a6b0
PE
4236 Untag more efficiently if USE_LSB_TAG.
4237 This is based on a proposal by YAMAMOTO Mitsuharu in
4238 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
4239 For an admittedly artificial (nth 8000 longlist) benchmark on
4240 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
4241 Emacs's overall text size by 1%.
4242 * lisp.h (XUNTAG): New macro.
4243 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
4244 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
4245 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
4246 * eval.c (Fautoload):
4247 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
4248 * frame.h (XFRAME): Use XUNTAG.
4249
3478ec45
PE
4250 Port recent dbusbind.c changes to 32-bit --with-wide-int.
4251 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
4252 Remove unportable assumptions about print widths of types like
4253 dbus_uint32_t.
4254 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
4255 intptr_t when converting between pointer and integer, to avoid GCC
4256 warnings about wrong width.
4257
666b903b 42582012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
4259
4260 * w32proc.c (new_child): Force Windows to reserve only 64KB of
4261 stack for each reader_thread, instead of defaulting to 8MB
4262 determined by the linker. This avoids failures in creating
4263 subprocesses on Windows 7, see the discussion in this thread:
4264 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
4265
b120cc17
JC
42662012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
4267
4268 Fix up display of the *Minibuf-0* buffer in the mini window.
4269 * keyboard.c (read_char): Don't clear the echo area if there's no
4270 message to clear.
4271 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 4272 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 4273
9a4b36f8
MA
42742012-05-07 Michael Albinus <michael.albinus@gmx.de>
4275
4276 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
4277 batch mode.
4278
e5f9458f
CY
42792012-05-06 Chong Yidong <cyd@gnu.org>
4280
4281 * lisp.mk (lisp): Update.
4282
eceeb5fc 42832012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
4284
4285 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
4286
71873e2b
SM
42872012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
4288
4289 * data.c (PUT_ERROR): New macro.
4290 (syms_of_data): Use it. Add new error type `user-error'.
4291 * undo.c (user_error): New function.
4292 (Fprimitive_undo): Use it.
4293 * print.c (print_error_message): Adjust print style for `user-error'.
4294 * keyboard.c (user_error): New function.
4295 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
4296
ab0fa4e4
PE
42972012-05-03 Paul Eggert <eggert@cs.ucla.edu>
4298
4299 Do not limit current-time-string to years 1000..9999.
4300 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
4301 (Fcurrent_time_string): Support any year that is supported by the
4302 underlying localtime representation. Don't use asctime, as it
4303 has undefined behavior for years outside the range -999..9999.
4304
7ed806a7
PE
43052012-05-02 Paul Eggert <eggert@cs.ucla.edu>
4306
4307 Fix race conditions involving setenv, gmtime, localtime, asctime.
4308 Without this fix, interrupts could mess up code that uses these
4309 nonreentrant functions, since setting TZ invalidates existing
4310 tm_zone or tzname values, and since most of these functions return
4311 pointers to static storage.
4312 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
4313 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
4314 Grow the critical sections to include not just invoking
4315 localtime/gmtime, but also accessing these functions' results
4316 including their tm_zone values if any, and any related TZ setting.
4317 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
4318 so that the struct tm is saved in the critical section.
4319 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
4320 motivated by the fact that memory allocation needs to be outside
4321 the critical section.
4322
0c16dfed
DA
43232012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
4324
4325 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
4326 with RESET_INTERVAL.
4327
4328 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
4329 Remove duplicated buffer name initialization.
4330
3f83ace8
JM
43312012-05-02 Jim Meyering <jim@meyering.net>
4332
4333 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
4334
c7b8541e
JM
4335 * xfns.c (x_window): Use xstrdup (Bug#11375).
4336
90207a15 43372012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
4338
4339 * xdisp.c (pos_visible_p): If already at a newline from the
4340 display string before the 'while' loop, don't walk back the glyphs
4341 from it3.glyph_row. Solves assertion violation when the display
4342 string begins with a newline (egg.el). (Bug#11367)
4343
b593d6a9
AH
43442012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
4345
4346 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
4347 Move to simple.el.
4348
4737362e
GM
43492012-05-01 Glenn Morris <rgm@gnu.org>
4350
99cf43f9
GM
4351 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
4352 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
4353 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
4354 All were removed before 23.1.
4355
9311dcff
GM
4356 * dispnew.c: Remove HAVE_LIBNCURSES test;
4357 it is always true on relevant platforms.
4358
4d5c6349
GM
4359 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
4360 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
4361
4737362e
GM
4362 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
4363
74dd3a6b
AS
43642012-04-30 Andreas Schwab <schwab@linux-m68k.org>
4365
4366 * .gdbinit (xpr): Remove checks for no longer existing misc types.
4367 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
4368 Remove.
4369
13c379ee
PE
43702012-04-28 Paul Eggert <eggert@cs.ucla.edu>
4371
4372 Do not avoid creating empty evaporating overlays (Bug#9642).
4373 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
4374 That is, do not delete an evaporating overlay if it becomes
4375 empty after its bounds are adjusted to fit within its buffer.
4376 This fix caused other problems, and I'm reverting it until we get
4377 to the bottom of them.
4378
a8e7d6d7 43792012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
4380
4381 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
4382
a8e7d6d7 43832012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
4384
4385 * xdisp.c (pos_visible_p): If the window start position is beyond
4386 ZV, start the display from buffer beginning. Prevents assertion
4387 violation in init_iterator when the minibuffer window is scrolled
4388 via the scroll bar.
4389
4390 * window.c (window_scroll_pixel_based): Likewise.
4391
a8e7d6d7 43922012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
4393
4394 * keymap.c (where_is_internal): Doc fix (Bug#10872).
4395
a8e7d6d7 43962012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
4397
4398 * fileio.c (Fcopy_file, Fset_file_selinux_context):
4399 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
4400
a8e7d6d7 44012012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 4402
b593d6a9
AH
4403 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
4404 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 4405
1c6900d9
EZ
44062012-04-26 Eli Zaretskii <eliz@gnu.org>
4407
4c3fa1d9
EZ
4408 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
4409 display element, check also the underlying string or buffer
4410 character. (Bug#11341)
4411
1c6900d9
EZ
4412 * w32menu.c: Include w32heap.h.
4413 (add_menu_item): If the call to AppendMenuW (via
4414 unicode_append_menu) fails, disable Unicode menus only if we are
4415 running on Windows 9X/Me.
4416
42bf8205
AS
44172012-04-24 Andreas Schwab <schwab@linux-m68k.org>
4418
4419 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
4420 (xgetint): Add missing shift for LSB tags.
4421
b1bac16e
MR
44222012-04-24 Martin Rudalics <rudalics@gmx.at>
4423
4424 * keyboard.c (read_char): Don't wipe echo area for select window
4425 events: These might get delayed via `mouse-autoselect-window'
4426 (Bug#11304).
4427
d69621cc
JB
44282012-04-24 Juanma Barranquero <lekktu@gmail.com>
4429
4430 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
4431 manipulation of :loaded-from data.
4432
02fd101b
JB
44332012-04-23 Juanma Barranquero <lekktu@gmail.com>
4434
4435 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
4436 now a cons (bug#11311).
4437
888bec30
PE
44382012-04-23 Paul Eggert <eggert@cs.ucla.edu>
4439
89a438bd
PE
4440 Do not create empty overlays with the evaporate property (Bug#9642).
4441 * buffer.c (Fmove_overlay): Delete an evaporating overlay
4442 if it becomes empty after its bounds are adjusted to fit within
4443 its buffer. Without this fix, in a nonempty buffer (let ((o
4444 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
4445 yields an empty overlay that has the evaporate property, which is
4446 not supposed to happen.
4447
1068fe4d
PE
4448 Fix minor GTK3 problems found by static checking.
4449 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
4450 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
4451 (struct _EmacsFixedClass, emacs_fixed_get_type):
4452 Move decls here from emacsgtkfixed.h, since they needn't be public.
4453 (emacs_fixed_get_type): Now static.
4454 (emacs_fixed_class_init): Omit unused local.
4455 (emacs_fixed_child_type): Remove; unused.
4456 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
4457 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
4458 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
4459 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
4460 (EMACS_FIXED_GET_CLASS): Remove; unused.
4461 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
4462
888bec30
PE
4463 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
4464 Problem reported by Juanma Barranquero for Windows -Wunused-function.
4465
de85e130
PE
44662012-04-22 Paul Eggert <eggert@cs.ucla.edu>
4467
d0baac98 4468 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 4469 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
4470 (__malloc_size_t, __malloc_ptrdiff_t):
4471 Remove. All uses removed, replaced by the definiens if needed,
4472 since we can assume C89 or better now.
4473 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
4474 (protect_malloc_state, align, get_contiguous_space)
4475 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
4476 (malloc_atfork_handler_child, malloc_enable_thread)
4477 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
4478 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
4479 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
4480 (special_realloc, _realloc_internal_nolock, _realloc_internal)
4481 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
4482 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
4483 Define using prototypes, not old style.
4484 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
4485 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
4486 (align): Don't assume that signed integer overflow wraps around.
4487 Omit unused local var.
4488 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
4489 (_free_internal_nolock, memalign, mallochook, reallochook):
4490 Omit no-longer-needed casts.
4491 (valloc): Use getpagesize, not __getpagesize.
4492 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
4493 (struct hdr): The 'magic' member is now size_t, not unsigned long.
4494
de85e130
PE
4495 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
4496
dcbf5805
MA
44972012-04-22 Michael Albinus <michael.albinus@gmx.de>
4498
4499 Move functions from C to Lisp. Make non-blocking method calls
4500 the default. Implement further D-Bus standard interfaces.
4501
4502 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
4503 (QCdbus_request_name_allow_replacement)
4504 (QCdbus_request_name_replace_existing)
4505 (QCdbus_request_name_do_not_queue)
4506 (QCdbus_request_name_reply_primary_owner)
4507 (QCdbus_request_name_reply_in_queue)
4508 (QCdbus_request_name_reply_exists)
4509 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
4510 (QCdbus_registered_serial, QCdbus_registered_method)
4511 (QCdbus_registered_signal): New Lisp objects.
4512 (XD_DEBUG_MESSAGE): Use sizeof.
4513 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
4514 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
4515 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
4516 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
4517 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
4518 (xd_signature, xd_append_arg): Allow float for integer types.
4519 (xd_get_connection_references): New function.
b593d6a9
AH
4520 (xd_get_connection_address): Rename from xd_initialize.
4521 Return cached address.
dcbf5805
MA
4522 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
4523 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
4524 level.
4525 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 4526 Return number of refcounts.
dcbf5805
MA
4527 (Fdbus_get_unique_name): Make stronger parameter check.
4528 (Fdbus_message_internal): New defun.
4529 (Fdbus_call_method, Fdbus_call_method_asynchronously)
4530 (Fdbus_method_return_internal, Fdbus_method_error_internal)
4531 (Fdbus_send_signal, Fdbus_register_service)
4532 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
4533 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
4534 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
4535 (Vdbus_compiled_version, Vdbus_runtime_version)
4536 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
4537 (Vdbus_message_type_method_return, Vdbus_message_type_error)
4538 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
4539 (Vdbus_registered_buses, Vdbus_registered_objects_table):
4540 Adapt docstring.
dcbf5805 4541
52828e02
PE
45422012-04-22 Paul Eggert <eggert@cs.ucla.edu>
4543
da05bc4c
PE
4544 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
4545 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
4546 Do not assume ptrdiff_t is the same width as 'int'.
4547
52828e02
PE
4548 * alloc.c: Handle unusual debugging option combinations.
4549 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
4550 since the two debugging options are incompatible.
4551 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
4552 is defined.
4553 (mem_init, mem_insert, mem_insert_fixup):
4554 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
4555 (NEED_MEM_INSERT): Remove; no longer needed.
4556
f01769f9
LL
45572012-04-22 Leo Liu <sdl.web@gmail.com>
4558
4559 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
4560
5790543d
PE
45612012-04-22 Paul Eggert <eggert@cs.ucla.edu>
4562
4563 * sysdep.c [__FreeBSD__]: Minor cleanups.
4564 (list_system_processes, system_process_attributes) [__FreeBSD__]:
4565 Use Emacs indenting style more consistently. Avoid some casts.
4566 Use 'double' consistently rather than mixing 'float' and 'double'.
4567
b91b7e4d
EW
45682012-04-21 Eduard Wiebe <usenet@pusto.de>
4569
b593d6a9
AH
4570 * sysdep.c (list_system_processes, system_process_attributes):
4571 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 4572
6114eb15
AS
45732012-04-21 Andreas Schwab <schwab@linux-m68k.org>
4574
4575 * lisp.mk (lisp): Update.
4576
2f38dff7
PE
45772012-04-20 Paul Eggert <eggert@cs.ucla.edu>
4578
4579 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
4580 It is never used otherwise.
4581
4ae29f89
SM
45822012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
4583
4584 * print.c (print_preprocess): Only check print_depth if print-circle
4585 is nil.
4586 (print_object): Check for cycles even when print-circle is nil and
4587 print-gensym is t, but only check print_depth if print-circle is nil.
4588
f30d612a
CY
45892012-04-20 Chong Yidong <cyd@gnu.org>
4590
4591 * process.c (wait_reading_process_output): If EIO occurs on a pty,
4592 set the status to "failed" and ensure that sentinel is run.
4593
c07a4c0b 45942012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
4595
4596 * process.c (Fset_process_inherit_coding_system_flag)
4597 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 4598 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 4599
c07a4c0b 46002012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
4601
4602 * xdisp.c (string_buffer_position_lim): Limit starting position to
4603 BEGV.
4604 (set_cursor_from_row): If called for a mode-line or header-line
4605 row, return zero immediately.
4606 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
4607 farther than the first row after the header line, if any.
4608 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
4609 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
4610
c07a4c0b 46112012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 4612
4ae29f89
SM
4613 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
4614 (bug#11238).
ad3a2b41 4615
c07a4c0b 46162012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 46172012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
4618
4619 configure: new option --enable-gcc-warnings (Bug#11207)
4620 * Makefile.in (C_WARNINGS_SWITCH): Remove.
4621 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
4622 (ALL_CFLAGS): Use new macros rather than old.
4623 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
4624 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
4625 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
4626 -Wunused-result, -Wunused-variable. This should go away once
4627 the Emacs and Gnulib regex code is merged.
4628 (xmalloc, xrealloc): Now static.
4629
aba027e8
PE
46302012-04-17 Paul Eggert <eggert@cs.ucla.edu>
4631
4632 * dired.c (Fsystem_groups): Remove unused local.
4633
e5a36063
GM
46342012-04-17 Glenn Morris <rgm@gnu.org>
4635
4636 * dired.c (Fsystem_users): Doc fix.
4637
316411f0
DA
46382012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
4639
4640 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
4641 (syms_of_dired): Add them.
4642
9426aba4
PE
46432012-04-16 Paul Eggert <eggert@cs.ucla.edu>
4644
b62a57be
PE
4645 Fix minor alloc.c problems found by static checking.
4646 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
4647 New extern decls, to avoid calling undeclared functions.
4648 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
4649 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
4650 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
4651 (NEED_MEM_INSERT): New macro.
4652 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 4653 Remove one incorrect comment and fix another.
b62a57be 4654
3539f31f
PE
4655 Fix minor ralloc.c problems found by static checking.
4656 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
4657 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
4658 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
4659 (r_alloc_sbrk): Now static.
4660
a041960a
PE
4661 Improve ralloc.c interface checking.
4662 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
4663 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
4664 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
4665 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
4666 [REL_ALLOC]: ... to here, to check interface.
4667 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
4668 Remove decls. This fixes an "It stinks!".
4669
9426aba4
PE
4670 * alloc.c (which_symbols): Fix alignment issue / type clash.
4671
d55c12ed
AS
46722012-04-15 Andreas Schwab <schwab@linux-m68k.org>
4673
4674 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
4675 (struct Lisp_Misc_Any): Likewise.
4676 (struct Lisp_Free): Likewise.
4677 * alloc.c (union aligned_Lisp_Symbol): Define.
4678 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
4679 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
4680 (union aligned_Lisp_Misc): Define.
4681 (MARKER_BLOCK_SIZE, struct marker_block): Use union
4682 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 4683 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 4684
b948ce8b
PE
46852012-04-14 Paul Eggert <eggert@cs.ucla.edu>
4686
4687 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
4688 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
4689 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
4690 * s/netbsd.h, s/sol2-6.h:
4691 Remove definition of GC_MARK_STACK, since the default now works.
4692 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
4693 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
4694 no longer the default.
4695 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
4696
35dc09a1 46972012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 4698
35dc09a1
GM
4699 * lread.c (lisp_file_lexically_bound_p):
4700 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 4701
35dc09a1
GM
47022012-04-14 Eli Zaretskii <eliz@gnu.org>
4703
4704 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
4705 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
4706
47072012-04-14 Jan Djärv <jan.h.d@swipnet.se>
4708
4709 * nsterm.m (constrainFrameRect): Always constrain when there is only
4710 one screen (Bug#10962).
4711
bcd86815
KB
47122012-04-13 Ken Brown <kbrown@cornell.edu>
4713
4714 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
4715
c25df26e
RT
47162012-04-13 Reuben Thomas <rrt@sc3d.org>
4717
4718 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
4719
0fc59f1e
DC
47202012-04-11 Daniel Colascione <dancol@dancol.org>
4721
4722 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
4723 against is gone. It's better to use vfork now so that when Cygwin
4724 gains a new, working vfork, we use it automatically (bug#10398).
4725
de8c03dc
SM
47262012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
4727
4728 * window.c (save_window_save): Obey window-point-insertion-type.
4729
2f097256
GM
47302012-04-11 Glenn Morris <rgm@gnu.org>
4731
4732 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
4733
453b951e
SM
47342012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
4735
4736 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
4737
75f1671a 47382012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
4739
4740 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
4741 (force_quit_count): New var.
4742 (handle_interrupt): Use it.
4743
2a8ce227
JB
47442012-04-10 Juanma Barranquero <lekktu@gmail.com>
4745
4746 * w32.c (w32_delayed_load): Record the full path of the library
4747 being loaded (bug#10424).
4748
935396c0
GM
47492012-04-09 Glenn Morris <rgm@gnu.org>
4750
05920a43
GM
4751 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
4752 not just in the obarray, before snarfing them. (Bug#11036)
4753
935396c0
GM
4754 * Makefile.in ($(leimdir)/leim-list.el):
4755 Pass EMACS rather than BUILT_EMACS.
4756
a18ecafa
TZ
47572012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
4758
4759 * process.c (make_process):
4760 * process.h: Add integer `gnutls_handshakes_tried' member to
4761 process struct.
4762
6bbef4e5
JC
4763 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
4764 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
4765
4766 * gnutls.c (gnutls_log_function2i): Convenience log function.
4767 (emacs_gnutls_read): Use new log functions,
4768 `gnutls_handshakes_tried' process member, and
4769 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
4770 attempts per process (connection).
4771
b4d3bc10
CY
47722012-04-09 Chong Yidong <cyd@gnu.org>
4773
4774 * eval.c (Fuser_variable_p, user_variable_p_eh)
4775 (lisp_indirect_variable): Functions deleted.
4776 (Fdefvar): Caller changed.
4777
4778 * callint.c (Finteractive, Fcall_interactively):
4779 * minibuf.c (Fread_variable): Callers changed.
4780
70f4d973
EZ
47812012-04-09 Eli Zaretskii <eliz@gnu.org>
4782
4783 * xdisp.c (set_cursor_from_row): If the display string appears in
4784 the buffer at position that is closer to point than the position
4785 after the display string, display the cursor on the first glyph of
4786 the display string. Fixes cursor display when a 'display' text
4787 property immediately follows invisible text. (Bug#11094)
4788
cb3c2e3e
PE
47892012-04-09 Paul Eggert <eggert@cs.ucla.edu>
4790
4791 composite.c: use 'double' consistently
4792 * composite.c (get_composition_id): Use 'double' consistently
4793 instead of converting 'float' to 'double' and vice versa; this is
4794 easier to understand and avoids a GCC warning.
4795
fd06db5d
GM
47962012-04-09 Glenn Morris <rgm@gnu.org>
4797
50fe702a
GM
4798 * Makefile.in: Generate leim-list with bootstrap-emacs, in
4799 preparation for dumping it with emacs. (Bug#4789)
4800 (leimdir): New variable.
4801 ($(leimdir)/leim-list.el): New rule.
4802 (emacs$(EXEEXT)): Depend on leim-list.el.
4803
fd06db5d
GM
4804 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
4805 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
4806 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
4807
55c131ee
AS
48082012-04-08 Andreas Schwab <schwab@linux-m68k.org>
4809
4810 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
4811 proper alignment.
4812
9209588f
JB
48132012-04-07 Juanma Barranquero <lekktu@gmail.com>
4814
4815 * xml.c (init_libxml2_functions) [WINDOWSNT]:
4816 Remove unused local variable.
4817
e3fb2efb
PE
48182012-04-07 Paul Eggert <eggert@cs.ucla.edu>
4819
4820 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
4821 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
4822 (mark_memory): Mark Lisp_Objects only if pointers might hide in
4823 objects, as mark_maybe_pointer will catch them otherwise.
4824 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
4825 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
4826
b5385551
PE
48272012-04-07 Paul Eggert <eggert@cs.ucla.edu>
4828
4829 Fix typo that broke non-Windows builds.
4830 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
4831
9078ead6
EZ
48322012-04-07 Eli Zaretskii <eliz@gnu.org>
4833
4834 Support building on MS-Windows with libxml2.
4835
4836 * makefile.w32-in (OBJ2): Add xml.$(O).
4837 (GLOBAL_SOURCES): Add xml.c.
4838 ($(BLD)/xml.$(O)): New dependency list.
4839
4840 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
4841 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
4842 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
4843 [!WINDOWSNT]: New macros.
4844 (init_libxml2_functions, libxml2_loaded_p): New functions.
4845 (parse_region): Call fn_xmlCheckVersion instead of using the macro
4846 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
4847 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
4848 Calls xmlCleanupParser only if libxml2 was loaded (or statically
4849 linked in).
6bbef4e5
JC
4850 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
4851 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
4852 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
4853
4854 * emacs.c: Don't include libxml/parser.h.
4855 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
4856 xmlCleanupParser directly.
4857
4858 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
4859
3811fdf3
EZ
48602012-04-07 Eli Zaretskii <eliz@gnu.org>
4861
4862 * indent.c (Fvertical_motion): If there is a display string at
4863 point, use it.vpos to compute how many lines to backtrack after
4864 move_it_to point. (Bug#11133)
4865
2f8e16b2
EZ
48662012-04-06 Eli Zaretskii <eliz@gnu.org>
4867
4868 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
4869 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
4870 about subtle differences between FETCH_CHAR* and STRING_CHAR*
4871 macros related to unification of CJK characters. For the details,
4872 see the discussion following the message here:
4873 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
4874
3d439cd1
CY
48752012-04-04 Chong Yidong <cyd@gnu.org>
4876
4877 * keyboard.c (Vdelayed_warnings_list): Doc fix.
4878
8bc53d00
EZ
48792012-04-01 Eli Zaretskii <eliz@gnu.org>
4880
4881 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
4882 instead of alloca. (Bug#11138)
4883
3b0512a3
AS
48842012-04-01 Andreas Schwab <schwab@linux-m68k.org>
4885
4886 * w32menu.c (is_simple_dialog): Properly check lisp types.
4887 (Bug#11141)
4888
8427ddd2
EZ
48892012-03-31 Eli Zaretskii <eliz@gnu.org>
4890
979022ef
EZ
4891 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
4892 position we get to after a call to move_it_to fails the
4893 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
4894 only if we wind up in a string from display property. (Bug#11063)
4895
a6b1c7cc
EZ
4896 * window.c (Fdelete_other_windows_internal): Invalidate the row
4897 and column information about mouse highlight, so that redisplay
4898 restores it after reallocating the glyph matrices. (Bug#7464)
4899
8427ddd2
EZ
4900 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
4901 string comes from a `display' text property, use the buffer
4902 position of that property as if we actually saw that position in
4903 the row's glyphs.
697ba24b
EZ
4904 (move_it_by_lines): Remove the assertion that
4905 "it->current_x == 0 && it->hpos == 0" which can be legitimately
4906 violated when there's a before-string at the beginning of a line.
4907 (Bug#11063)
8427ddd2 4908
65a0a738
EZ
49092012-03-30 Eli Zaretskii <eliz@gnu.org>
4910
4911 * xdisp.c (append_space_for_newline): If the default face was
4912 remapped, use the remapped face for the appended newline.
4913 (extend_face_to_end_of_line): Use the remapped default face for
4914 extending the face to the end of the line.
4915 (display_line): Call extend_face_to_end_of_line when the default
4916 face was remapped. (Bug#11068)
4917
581355cc
EZ
49182012-03-29 Eli Zaretskii <eliz@gnu.org>
4919
4920 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
4921
e8fc049f
SM
49222012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
4923
4924 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
4925
4fb9a543
GM
49262012-03-27 Glenn Morris <rgm@gnu.org>
4927
4928 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
4929 Doc fixes.
4930
679910f1
KH
49312012-03-26 Kenichi Handa <handa@m17n.org>
4932
4933 * dispextern.h (struct glyph): Fix previous change. Change the
4934 bit length of glyphless.ch to 25 (Bug#11082).
4935
90d49b7f
CY
49362012-03-26 Chong Yidong <cyd@gnu.org>
4937
4938 * keyboard.c (Vselection_inhibit_update_commands): New variable.
4939 (command_loop_1): Use it; inhibit selection update for
4940 handle-select-window too (Bug#8996).
4941
f514f6f0
FP
49422012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
4943
e8fc049f 4944 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 4945
bf43fa51
KH
49462012-03-25 Kenichi Handa <handa@m17n.org>
4947
4948 * dispextern.h (struct glyph): Change the bit length of
4949 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
4950
8a0c01dd
EZ
49512012-03-24 Eli Zaretskii <eliz@gnu.org>
4952
4953 * s/ms-w32.h (tzname): Include time.h before redirecting to
4954 _tzname. Fixes the MSVC build. (Bug#9960)
4955
7d1c3a76
AS
49562012-03-24 Andreas Schwab <schwab@linux-m68k.org>
4957
8ed79523
AS
4958 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
4959 characters.
4960
7d1c3a76
AS
4961 * xterm.c (XTread_socket): Only modify handling_signal if
4962 !SYNC_INPUT. (Bug#11080)
4963
e99a9b8b
EZ
49642012-03-23 Eli Zaretskii <eliz@gnu.org>
4965
4966 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
4967 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
4968 when fetching a multibyte character consumes more bytes than
4969 CHAR_BYTES returns, due to unification of CJK characters in
4970 string_char. (Bug#11073)
4971
5063c0e1
TN
49722012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
4973
4974 * process.c (wait_reading_process_output): Handle pty disconnect
4975 by refraining from sending oneself a SIGCHLD (bug#10933).
4976
9f851fbd
CY
49772012-03-22 Chong Yidong <cyd@gnu.org>
4978
4979 * dispextern.h (struct it): New member string_from_prefix_prop_p.
4980
5063c0e1 4981 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
4982 Mark string as coming from a prefix property.
4983 (handle_face_prop): Use default face for prefix strings (Bug#4281).
4984 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
4985
fb5b8aca
CY
49862012-03-21 Chong Yidong <cyd@gnu.org>
4987
4988 * xfaces.c (Vface_remapping_alist): Doc fix.
4989
62356a1b
EZ
49902012-03-20 Eli Zaretskii <eliz@gnu.org>
4991
4992 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
4993 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
4994 Doc fixes.
62356a1b 4995
025de85b
CY
49962012-03-20 Chong Yidong <cyd@gnu.org>
4997
4998 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
4999 to reflect default non-nil value of redisplay-dont-pause.
5000
4827f94e
KH
50012012-03-19 Kenichi Handa <handa@m17n.org>
5002
5003 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
5004 it fit in a valid range (Bug#11003).
5005
e50a24a2
EZ
50062012-03-18 Eli Zaretskii <eliz@gnu.org>
5007
5008 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
5009 that is not from display property, accept the row as a "cursor
5010 row" if one of the string's character has a non-nil `cursor'
5011 property. Fixes cursor positioning when there are newlines in
5012 overlay strings, e.g. in icomplete.el. (Bug#11035)
5013
9af5ed87
PE
50142012-03-12 Paul Eggert <eggert@cs.ucla.edu>
5015
5016 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
5017
d1f55f16
CY
50182012-03-12 Chong Yidong <cyd@gnu.org>
5019
5020 * eval.c (inhibit_lisp_code): Rename from
5021 inhibit_window_configuration_change_hook; move from window.c.
5022
5023 * xfns.c (unwind_create_frame_1, Fx_create_frame):
5024 * window.c (run_window_configuration_change_hook)
5025 (syms_of_window): Callers changed.
5026
66c5eebd
CY
50272012-03-11 Chong Yidong <cyd@gnu.org>
5028
413df973
CY
5029 * keymap.c (Fkey_description): Doc fix (Bug#9700).
5030
66c5eebd
CY
5031 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
5032
1de11f56
CY
50332012-03-10 Chong Yidong <cyd@gnu.org>
5034
5035 * frame.c (other_visible_frames): Don't assume the selected frame
5036 is visible (Bug#10955).
5037
cae07000
SM
50382012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
5039
5040 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
5041
89c94350
JD
50422012-03-08 Jan Djärv <jan.h.d@swipnet.se>
5043
5044 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
5045 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
5046 zero (Bug#10954).
5047
999dd333
GM
50482012-03-03 Glenn Morris <rgm@gnu.org>
5049
01a6dcc8 5050 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 5051
de0100f2
EZ
50522012-03-02 Eli Zaretskii <eliz@gnu.org>
5053
5054 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
5055 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
5056 (redisplay_window, next_element_from_string): Fix typos in
5057 comments.
3e441275
EZ
5058 (redisplay_window): Pass to move_it_vertically the margin in
5059 pixels, not in screen lines.
de0100f2 5060
96a72ee9
GM
50612012-03-02 Glenn Morris <rgm@gnu.org>
5062
5063 * buffer.c (buffer-list-update-hook): Doc fix.
5064
312508d7
EZ
50652012-02-29 Eli Zaretskii <eliz@gnu.org>
5066
5067 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
5068 push_it before setting up the iterator for the first overlay
5069 string, even if we have an empty string loaded.
5070 (next_overlay_string): If there's an empty string on the iterator
5071 stack, pop the stack. (Bug#10903)
5072
27f3c637
PE
50732012-02-25 Paul Eggert <eggert@cs.ucla.edu>
5074
5075 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
5076 Suggested by Stefan Monnier in
5077 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
5078 * alloc.c (widen_to_Lisp_Object): New static function.
5079 (mark_memory): Also mark Lisp_Objects by fetching pointer words
5080 and widening them to Lisp_Objects. This would work even if
5081 USE_LSB_TAG is defined and wide integers are used, which might
5082 happen in a future version of Emacs.
5083
3c9dfce6
CY
50842012-02-25 Chong Yidong <cyd@gnu.org>
5085
fa74b241
CY
5086 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
5087 Doc fix.
5088
3c9dfce6
CY
5089 * xselect.c (Fx_selection_exists_p): Doc fix.
5090 (x_clipboard_manager_save_all): Print an informative message
5091 before saving to clipboard manager.
5092
9486df08
CY
50932012-02-24 Chong Yidong <cyd@gnu.org>
5094
5095 * keyboard.c (process_special_events): Handle all X selection
5096 requests in kbd_buffer, not just the next one (Bug#8869).
5097
f01d3321
CY
50982012-02-23 Chong Yidong <cyd@gnu.org>
5099
5100 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
5101 call when setting menu-bar-lines and tool-bar-lines parameters.
5102 (unwind_create_frame_1): New helper function.
5103
5104 * window.c (inhibit_window_configuration_change_hook): New var.
5105 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 5106 (syms_of_window): Initialize it.
f01d3321 5107
86b847b6
CY
51082012-02-22 Chong Yidong <cyd@gnu.org>
5109
5110 * xterm.c (x_draw_image_relief): Add missing type check for
5111 Vtool_bar_button_margin (Bug#10743).
5112
a59225b1
CY
51132012-02-21 Chong Yidong <cyd@gnu.org>
5114
5115 * fileio.c (Vfile_name_handler_alist): Doc fix.
5116
5117 * buffer.c (Fget_file_buffer): Protect against invalid file
5118 handler return value.
5119
310f5bd4
PE
51202012-02-20 Paul Eggert <eggert@cs.ucla.edu>
5121
cb3a28cc
PE
5122 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
5123 when computing $valmask.
5124
310f5bd4
PE
5125 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
5126 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
5127 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
5128 It's useless in that case, and it can cause problems on hosts
5129 that allocate halves of EMACS_INT values separately.
5130 Reported by Dan Horák. Diagnosed by Andreas Schwab in
5131 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
5132 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
5133 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
5134 it avoids undefined behavior on hosts where shifting right by more
5135 than the word width has undefined behavior.
5136
2375c96a
CY
51372012-02-19 Chong Yidong <cyd@gnu.org>
5138
5139 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
5140 (Funhandled_file_name_directory, Ffile_name_as_directory)
5141 (Fdirectory_file_name, Fexpand_file_name)
5142 (Fsubstitute_in_file_name): Protect against invalid file handler
5143 return values (Bug#10845).
5144
3eb49e71
EZ
51452012-02-18 Eli Zaretskii <eliz@gnu.org>
5146
5147 * .gdbinit (pitx): Fix incorrect references to fields of the
5148 iterator stack.
5149
7b926f3f
CY
51502012-02-17 Chong Yidong <cyd@gnu.org>
5151
5152 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
5153
11273115
PE
51542012-02-15 Paul Eggert <eggert@cs.ucla.edu>
5155
5156 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
5157 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
5158
c3a70e2b
CY
51592012-02-15 Chong Yidong <cyd@gnu.org>
5160
5161 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
5162 marked as special. Also, starting docstrings with * is obsolete.
5163
0ca43699
AS
51642012-02-13 Andreas Schwab <schwab@linux-m68k.org>
5165
5166 * gnutls.c (emacs_gnutls_write): Fix last change.
5167
2e8f3c56
LI
51682012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
5169
5170 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
5171 send_process.
5172
af70074f
SM
51732012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
5174
5175 * keymap.c (Fsingle_key_description): Handle char ranges.
5176
95986d52
CY
51772012-02-12 Chong Yidong <cyd@gnu.org>
5178
afd83bd1
CY
5179 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
5180 as that creates a dangerous corner case.
5181
95986d52
CY
5182 * window.c (Fdelete_window_internal): Invalidate the mouse
5183 highlight (Bug#9904).
5184
bd7da63e
GM
51852012-02-12 Glenn Morris <rgm@gnu.org>
5186
5187 * xselect.c (Fx_own_selection_internal)
5188 (Fx_get_selection_internal, Fx_disown_selection_internal)
5189 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
5190 * nsselect.m (Fx_own_selection_internal)
5191 (Fx_disown_selection_internal, Fx_selection_exists_p)
5192 (Fx_selection_owner_p, Fx_get_selection_internal):
5193 Sync docs and argument specs with the xselect.c versions.
5194
77abcbc2
LI
51952012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
5196
5197 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
5198
90b671e2
EZ
51992012-02-11 Eli Zaretskii <eliz@gnu.org>
5200
1c0ca0b7
EZ
5201 * w32select.c (Fx_selection_exists_p): Sync doc string and
5202 argument list with xselect.c. (Bug#10783)
5203
5204 * w16select.c (Fx_selection_exists_p): Sync doc string and
5205 argument list with xselect.c. (Bug#10783)
90b671e2 5206
49241268
GM
52072012-02-10 Glenn Morris <rgm@gnu.org>
5208
5209 * fns.c (Fsecure_hash): Doc fix.
5210
f998bbe7 52112012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
5212
5213 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
5214
0992bd9c
CY
52152012-02-07 Chong Yidong <cyd@gnu.org>
5216
5217 * buffer.c (Fbuffer_local_variables)
5218 (buffer_lisp_local_variables): Handle unbound vars correctly;
5219 don't let Qunbound leak into Lisp.
5220
af008560
GM
52212012-02-07 Glenn Morris <rgm@gnu.org>
5222
dd605cc4
GM
5223 * image.c (Fimagemagick_types): Doc fix.
5224
af008560
GM
5225 * image.c (imagemagick-render-type): Change it from a lisp object
5226 to an integer. Move the doc here from the lisp manual.
5227 Treat all values not equal to 0 the same.
5228
1449fa1d
CY
52292012-02-06 Chong Yidong <cyd@gnu.org>
5230
5231 * doc.c (store_function_docstring): Avoid applying docstring of
5232 alias to base function (Bug#2603).
5233
3723ec07
AS
52342012-02-04 Andreas Schwab <schwab@linux-m68k.org>
5235
5236 * .gdbinit (pp1, pv1): Remove redundant defines.
5237 (pr): Use pp.
5238
79c1cc1e
CY
52392012-02-04 Chong Yidong <cyd@gnu.org>
5240
5241 * nsterm.m: Declare a global (Bug#10694).
5242
d7f29f8e
EZ
52432012-02-04 Eli Zaretskii <eliz@gnu.org>
5244
cae07000
SM
5245 * w32.c (get_emacs_configuration_options):
5246 Include --enable-checking, if specified, in the return value.
d7f29f8e 5247
3b95a6f9
MR
52482012-02-04 Martin Rudalics <rudalics@gmx.at>
5249
5250 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
5251 after rounding frame sizes. (Bug#9723)
5252
d6fa96a6
EZ
52532012-02-04 Eli Zaretskii <eliz@gnu.org>
5254
5255 * keyboard.c (adjust_point_for_property): Don't position point
5256 before BEGV. (Bug#10696)
5257
df0b2940
PE
52582012-02-03 Paul Eggert <eggert@cs.ucla.edu>
5259
5260 Handle overflow when computing char display width (Bug#9496).
5261 * character.c (char_width): Return EMACS_INT, not int.
5262 (char_width, c_string_width): Check for overflow when
5263 computing the width; this is possible now that individual
5264 characters can have unbounded width. Problem introduced
5265 by merge from Emacs 23 on 2012-01-19.
5266
6bee44d6
MA
52672012-02-02 Michael Albinus <michael.albinus@gmx.de>
5268
5269 * dbusbind.c (Fdbus_register_method): Mention the return value
5270 :ignore in the docstring.
5271
44f92739
GM
52722012-02-02 Glenn Morris <rgm@gnu.org>
5273
1b9f60cc
GM
5274 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
5275
44f92739
GM
5276 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
5277 Unconditionally set to t. (Bug#10673)
5278 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
5279 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
5280 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
5281
c5d3843c
KH
52822012-02-02 Kenichi Handa <handa@m17n.org>
5283
5284 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
5285 0, do not call append_composite_glyph.
5286
159462d4 52872012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
5288
5289 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
5290 NULL (Bug#6988).
5291 (x_produce_glyphs): If the component of a composition is a null
5292 string, set it->pixel_width to 1 to avoid zero-width glyph.
5293
78cef877
EZ
52942012-02-01 Eli Zaretskii <eliz@gnu.org>
5295
5296 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
5297 first 2 arguments are identical. This makes inserting large
5298 output from a subprocess an order of magnitude faster on
5299 MS-Windows, where all sbrk'ed memory is always contiguous.
5300
97897668
GM
53012012-01-31 Glenn Morris <rgm@gnu.org>
5302
5303 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 5304 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
5305 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
5306
31fd3586
GM
53072012-01-29 Glenn Morris <rgm@gnu.org>
5308
5309 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
5310
0e24a8b2
CY
53112012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
5312
5313 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
5314
cc0adcb0
CY
53152012-01-28 Chong Yidong <cyd@gnu.org>
5316
5317 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
5318
acc28cb9
CY
53192012-01-26 Chong Yidong <cyd@gnu.org>
5320
9c69cfb7
CY
5321 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
5322
acc28cb9
CY
5323 * search.c (Fsearch_forward, Fsearch_backward): Document negative
5324 repeat counts (Bug#10507).
5325
48da7392
GM
53262012-01-26 Glenn Morris <rgm@gnu.org>
5327
5328 * lread.c (syms_of_lread): Doc fix.
5329
14af5f7f
CY
53302012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
5331
5332 * coding.c (encode_designation_at_bol): Change return value to
5333 EMACS_INT.
5334
0b21c100
CY
53352012-01-25 Chong Yidong <cyd@gnu.org>
5336
5337 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
5338
3c2907f7
CY
53392012-01-21 Chong Yidong <cyd@gnu.org>
5340
5341 * floatfns.c (Fcopysign): Make the second argument non-optional,
5342 since nil is not allowed anyway.
5343
959ad23f
AS
53442012-01-21 Andreas Schwab <schwab@linux-m68k.org>
5345
5346 * process.c (read_process_output): Use p instead of XPROCESS (proc).
5347 (send_process): Likewise.
5348
34a02f46
MR
53492012-01-19 Martin Rudalics <rudalics@gmx.at>
5350
5351 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
5352 (Vwindow_persistent_parameters): Do not use Qstate.
5353 Rewrite doc-strings.
34a02f46 5354
1259009a 53552012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
5356
5357 * character.c (char_width): New function.
70d4fdf6
GM
5358 (Fchar_width, c_string_width, lisp_string_width):
5359 Use char_width (Bug#9496).
25ed9e61 5360
6a6ee00d
MR
53612012-01-16 Martin Rudalics <rudalics@gmx.at>
5362
5363 * window.c (Vwindow_persistent_parameters): New variable.
5364 (Fset_window_configuration, save_window_save): Handle persistent
5365 window parameters.
5366
c85efaf7
EZ
53672012-01-14 Eli Zaretskii <eliz@gnu.org>
5368
5369 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
5370 thrashing the stack of the thread. (Bug#9087)
5371
5944709e
PE
53722012-01-12 Paul Eggert <eggert@cs.ucla.edu>
5373
5374 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
5375
e71f5d99
EZ
53762012-01-11 Eli Zaretskii <eliz@gnu.org>
5377
5378 * xdisp.c (rows_from_pos_range): Handle the case where the
5379 highlight ends on a newline. (Bug#10464)
5380 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
5381 he end column for display of highlight that ends on a newline
5382 before a R2L line.
5383
ce316182
GM
53842012-01-11 Glenn Morris <rgm@gnu.org>
5385
5386 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
5387 from load-path also when installation-directory is nil. (Bug#10208)
5388
5b43da69
GM
53892012-01-10 Glenn Morris <rgm@gnu.org>
5390
74cc8ff9
GM
5391 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
5392
7d8d6e4e
GM
5393 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
5394 Update template values to be closer to their typical values these days.
5b43da69 5395
a0db8d43
EZ
53962012-01-09 Eli Zaretskii <eliz@gnu.org>
5397
5398 * xdisp.c (rows_from_pos_range): Accept additional argument
5399 DISP_STRING, and accept any glyph in a row whose object is that
5400 string as eligible for mouse highlight. Fixes mouse highlight of
5401 display strings from overlays. (Bug#10464)
5402
9a0115ab 54032012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 5404
b9110d6a 5405 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
5406 * fileio.c (auto_saving_dir_umask): New static var.
5407 (Fmake_directory_internal): Use it.
5408 (do_auto_save_make_dir): Set it, instead of invoking chmod after
5409 creating the directory. The old code temporarily assigns
5410 too-generous permissions to the directory.
5411 (do_auto_save_eh): Clear it.
b9110d6a 5412 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
5413 that the var is always cleared.
5414
6c1bd3f3
EZ
54152012-01-07 Eli Zaretskii <eliz@gnu.org>
5416
5417 * search.c (scan_buffer): Pass character positions to
5418 know_region_cache, not byte positions. (Bug#6540)
5419
069d2b50
L
54202012-01-07 LynX <_LynX@bk.ru> (tiny change)
5421
5422 * w32.c (sys_rename): Report EXDEV when rename of a directory
5423 fails because the target is on another logical disk. (Bug#10284)
5424
75bf0d33
DB
54252012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
5426
5427 * xterm.c (x_embed_request_focus): New function.
5428
5429 * xterm.h: Add prototype.
5430
5431 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
5432
1c6e5a32
GM
54332012-01-05 Glenn Morris <rgm@gnu.org>
5434
5435 * emacs.c (emacs_copyright): Update short copyright year to 2012.
5436
651e947e
EZ
54372012-01-01 Eli Zaretskii <eliz@gnu.org>
5438
5439 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
5440 Load gnutls_transport_set_lowat only if GnuTLS version is below
5441 2.11.1.
5442 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
5443 GnuTLS versions below 2.11.1.
5444
3778cdd8
AL
54452011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
5446
5447 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
5448 to the doc string advising against its use for altering the way
5449 windows are scrolled.
5450
0e5317f7
KH
54512011-12-28 Kenichi Handa <handa@m17n.org>
5452
5453 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
5454 coding-system ASCII compatible only when it does not produce BOM
5455 on encoding (Bug#10383).
5456
93d5ca1f
JD
54572011-12-26 Jan Djärv <jan.h.d@swipnet.se>
5458
5459 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
5460 can scroll.
5461 (create_and_show_popup_menu): Always use menu_position_func for
5462 Gtk3 (Bug#10361).
5463
ca22b785
AS
54642011-12-24 Andreas Schwab <schwab@linux-m68k.org>
5465
5466 * callint.c (Fcall_interactively): Don't truncate prompt string.
5467
d048e1e6
EZ
54682011-12-23 Eli Zaretskii <eliz@gnu.org>
5469
5470 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
5471 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 5472 resumed from there (after widening). (Bug#10360)
d048e1e6 5473
5ccaba1f
JD
54742011-12-22 Jan Djärv <jan.h.d@swipnet.se>
5475
5476 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
5477
204ee57f
JD
54782011-12-21 Jan Djärv <jan.h.d@swipnet.se>
5479
b81d40f0
JB
5480 * nsterm.m (x_free_frame_resources):
5481 Release f->output_data.ns->miniimage.
204ee57f
JD
5482 (ns_index_color): Fix indentation. Do not retain
5483 color_table->colors[i].
5484
5485 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
5486 before returning.
5487
5488 * nsfns.m (x_set_background_color): Assign return value from
5489 ns_index_color to face-background instead of NSColor*.
5490 (ns_implicitly_set_icon_type): Fix indentation.
5491 Change assignment in for loop to comparison.
5492
5493 * emacs.c (ns_pool): New variable.
5494 (main): Assign ns_pool.
5495 (Fkill_emacs): Call ns_release_autorelease_pool.
5496
5497 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
5498 autorelease fdesc, release fdAttrs and tdict.
5499 (ns_get_covering_families): Release charset.
5500 (ns_findfonts): Release NSFontDescriptor created with new.
5501 (ns_uni_to_glyphs): Fix indentation.
5502 (setString): Release attrStr before assigning new value.
5503
c803b2b7
JD
55042011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5505
678f4426
JD
5506 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
5507 and NS_IMPL_COCOA.
5508 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
5509 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
5510
cd394be1 55112011-12-18 David Reitter <reitter@cmu.edu>
678f4426 5512
5fecd5fc
JD
5513 * nsterm.m (ns_term_init): Subscribe for notifications
5514 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
5515 to method trackingNotification in EmacsMenu.
5516
5517 * nsmenu.m (trackingMenu): New variable.
3771cb17 5518 (trackingNotification): New method (from Aquamacs).
5fecd5fc 5519 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 5520 from Aquamacs (Bug#7030).
678f4426
JD
5521
55222011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 5523
c803b2b7
JD
5524 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
5525 (symbol_to_nsstring): Fix indentation.
5526 (ns_symbol_to_pb): New function.
cae07000
SM
5527 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
5528 (Fns_rotate_cut_buffers_internal): Remove.
5529 (Fns_store_selection_internal): Rename from
c803b2b7
JD
5530 Fns_store_cut_buffer_internal.
5531 (ns_get_foreign_selection, Fx_own_selection_internal)
5532 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
5533 (Fns_get_selection_internal, Fns_store_selection_internal):
5534 Use ns_symbol_to_pb and check if return value is nil.
5535 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
5536 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
5537 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
5538 renamed to Sns_store_selection_internal.
5539 (ns_handle_selection_request): Move code to Fx_own_selection_internal
5540 and remove this function.
5541 (ns_handle_selection_clear): Remove, never used.
5542 (Fx_own_selection_internal): Move code from ns_handle_selection_request
5543 here.
5544
e1b01a3a
KB
55452011-12-17 Ken Brown <kbrown@cornell.edu>
5546
5547 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
5548 GID is unknown (Bug#10257).
5549
2adb6e85
PE
55502011-12-17 Paul Eggert <eggert@cs.ucla.edu>
5551
5552 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
5553 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
5554 which caused a build failure on GNU/Linux IA-64. This problem was
5555 introduced by my 2011-10-07 patch.
5556
d1d7b339
JL
55572011-12-15 Juri Linkov <juri@jurta.org>
5558
5559 * image.c (imagemagick_error): New function. (Bug#10112)
5560 (imagemagick_load_image): Comment out `MagickSetResolution' call.
5561 Use `imagemagick_error' where ImageMagick functions return
5562 `MagickFalse'.
5563 (Fimagemagick_types): Add `Fnreverse' to return the list in the
5564 proper order.
5565
100d5755
KH
55662011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5567
5568 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
5569 fill background (Bug#8992).
5570
454592a6
MR
55712011-12-13 Martin Rudalics <rudalics@gmx.at>
5572
5573 * window.c (Vwindow_combination_resize)
5574 (Vwindow_combination_limit): Use t instead of non-nil in
5575 doc-strings.
61d4b438
MR
5576 (Vrecenter_redisplay): Add first sentence of doc-string on
5577 separate line.
53524d93 5578 (Frecenter): Fix doc-string typo.
454592a6 5579
3633e3aa
KH
55802011-12-11 Kenichi Handa <handa@m17n.org>
5581
5582 * coding.c (Funencodable_char_position): Pay attention to the
5583 buffer text relocation (Bug#9389).
5584
7b9d523a 55852011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 5586
7b9d523a
JD
5587 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
5588 gtk_init (Bug#10100).
5589
b73189c6
EZ
55902011-12-10 Eli Zaretskii <eliz@gnu.org>
5591
5592 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
5593 IT->string is nil. (Bug#10263)
5594
f7dfe5d6
JD
55952011-12-10 Jan Djärv <jan.h.d@swipnet.se>
5596
83faebb4
JD
5597 * nsterm.h (x_free_frame_resources): Declare.
5598
f7dfe5d6
JD
5599 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
5600 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
5601
5602 * nsterm.h (ns_get_defaults_value): Declare.
5603
5604 * nsterm.m (ns_default): Call ns_get_defaults_value.
5605
7cd4e72c
EZ
56062011-12-09 Eli Zaretskii <eliz@gnu.org>
5607
5608 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
5609 (Bug#10170)
5610
b34d7317
YM
56112011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5612
5613 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
5614 that where the value of an _OBJC_* symbol points to is in the .bss
5615 section (Bug#10240).
5616
76470ad1
KH
56172011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
5618
5619 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 5620 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 5621
745fff94
KH
56222011-12-08 Kenichi Handa <handa@m17n.org>
5623
5624 * ftfont.c (get_adstyle_property): Fix previous change
5625 (Bug#10233).
5626
6e44397c
JB
56272011-12-07 Juanma Barranquero <lekktu@gmail.com>
5628
5629 * w32.c (init_environment): If no_site_lisp, remove site-lisp
5630 dirs from the default value of EMACSLOADPATH (bug#10208).
5631
7efa6272
GM
56322011-12-07 Glenn Morris <rgm@gnu.org>
5633
5634 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
5635 installation and source directories as well. (Bug#10208)
5636
f6fc4d87
CY
56372011-12-06 Chong Yidong <cyd@gnu.org>
5638
5639 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
5640
2bf26180
GM
56412011-12-06 Glenn Morris <rgm@gnu.org>
5642
5643 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
5644 as an error, not just -1. (Bug#10217)
5645
3a6ad4f0
CY
56462011-12-05 Chong Yidong <cyd@gnu.org>
5647
5648 * keyboard.c (process_special_events): New function.
5649 (swallow_events, Finput_pending_p): Use it (Bug#10195).
5650
75a3b399
PE
56512011-12-05 Paul Eggert <eggert@cs.ucla.edu>
5652
5653 * coding.c (encode_designation_at_bol): Don't use uninitialized
5654 local variable (Bug#9318).
5655
c3c9e25e
KH
56562011-12-05 Kenichi Handa <handa@m17n.org>
5657
5658 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
5659 return Qnil (Bug#8046, Bug#10193).
5660
5eb05ea3
KH
56612011-12-05 Kenichi Handa <handa@m17n.org>
5662
5663 * coding.c (encode_designation_at_bol): New args charbuf_end and
5664 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
5665 (coding_set_source): Return how many bytes coding->source was
5666 relocated.
5667 (coding_set_destination): Return how many bytes
5668 coding->destination was relocated.
5669 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 5670 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
5671
56722011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
5673
5674 * coding.c (CODING_CHAR_CHARSET_P): New macro.
5675 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
5676 macro (Bug#9318).
5677
56782011-12-05 Andreas Schwab <schwab@linux-m68k.org>
5679
5680 The following changes are to fix Bug#9318.
5681
a79703f5 5682 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
5683 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
5684 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 5685 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 5686
7dbda6df
JB
56872011-12-05 Juanma Barranquero <lekktu@gmail.com>
5688
5689 * lisp.h (process_quit_flag): Fix external declaration.
5690
6d5eb5b0
SM
56912011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
5692
5693 Don't macro-inline non-performance-critical code.
5694 * eval.c (process_quit_flag): New function.
5695 * lisp.h (QUIT): Use it.
5696
a0c3fad0
JD
56972011-12-04 Jan Djärv <jan.h.d@swipnet.se>
5698
5699 * nsfns.m (get_geometry_from_preferences): New function.
5700 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
5701
6c07aac2
AS
57022011-12-04 Andreas Schwab <schwab@linux-m68k.org>
5703
5704 * emacs.c (Qkill_emacs): Define.
5705 (syms_of_emacs): Initialize it.
5706 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
5707 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
5708 (quit_throw_to_read_char): Add parameter `from_signal'.
5709 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
5710 * lisp.h (QUIT): Call Fkill_emacs if requested.
5711
c052ead4
JD
57122011-12-03 Jan Djärv <jan.h.d@swipnet.se>
5713
5714 * widget.c (update_wm_hints): Return if wmshell is null.
5715 (widget_update_wm_size_hints): New function.
5716
5717 * widget.h (widget_update_wm_size_hints): Declare.
5718
5719 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
5720 widget_update_wm_size_hints (Bug#10104).
5721
9e49252b
EZ
57222011-12-03 Eli Zaretskii <eliz@gnu.org>
5723
5724 * xdisp.c (handle_invisible_prop): If the invisible text ends just
5725 before a newline, prepare the bidi iterator for consuming the
5726 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 5727 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 5728
02b16839
JL
57292011-12-02 Juri Linkov <juri@jurta.org>
5730
5731 * search.c (Fword_search_regexp): New Lisp function created from
5732 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
5733 (Fword_search_backward, Fword_search_forward)
5734 (Fword_search_backward_lax, Fword_search_forward_lax):
5735 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
5736 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
5737
0068070e
SM
57382011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
5739
5740 * fileio.c (Finsert_file_contents): Move after-change-function call
5741 to before the "handled:" label, since all "goto handled" appear in
5742 cases where the *-change-functions have already been properly called
5743 (bug#10117).
5744
3360a3fc
AS
57452011-12-01 Andreas Schwab <schwab@linux-m68k.org>
5746
5747 * keyboard.c (interrupt_signal): Don't call kill-emacs when
5748 waiting for input. (Bug#10169)
5749
73d6c093
EZ
57502011-11-30 Eli Zaretskii <eliz@gnu.org>
5751
5752 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
5753 verifies glyph row's hash code--we have just reallocated the
5754 glyphs, so their contents can be complete garbage. (Bug#10164)
5755
febe6bea
JB
57562011-11-30 Juanma Barranquero <lekktu@gmail.com>
5757
5758 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
5759
801a4313
EZ
57602011-11-30 Eli Zaretskii <eliz@gnu.org>
5761
5762 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
5763 attributes are tested _before_ calling verify_row_hash, to protect
5764 against GCC re-ordering of the tests. (Bug#10164)
5765
2b56b87e
JD
57662011-11-29 Jan Djärv <jan.h.d@swipnet.se>
5767
5768 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
5769
5770 * xterm.c (handle_one_xevent): Only set async_visible and friends
5771 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 5772 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
5773 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
5774
dbf31225
PE
57752011-11-28 Paul Eggert <eggert@cs.ucla.edu>
5776
5777 Remove GCPRO-related macros that exist only to avoid shadowing locals.
5778 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
5779 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
5780 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
5781 All uses changed to use GCPRO1 etc.
5782 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
5783 Revert to old implementation (i.e., before 2011-03-11).
5784
1305621b
YM
57852011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5786
5787 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
5788 of scroll runs so as to avoid assigning disabled bogus rows and
5789 unnecessary graphics copy operations.
5790
8c9afb46
EZ
57912011-11-27 Eli Zaretskii <eliz@gnu.org>
5792
5793 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
5794 (snprintf) [_MSC_VER]: Redirect to _snprintf.
5795 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
5796 (malloc, free, realloc, calloc): Redirect to e_* only when
5797 compiling Emacs.
5798
5799 * lisp.h (GCTYPEBITS): Move before first use.
5800 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
5801 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
5802 this macro definition.
5803
5804 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
5805 _MSC_VER.
5806
54e9e3bf
JD
58072011-11-27 Jan Djärv <jan.h.d@swipnet.se>
5808
6d5eb5b0
SM
5809 * gtkutil.c (xg_create_frame_widgets):
5810 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
5811 present with Gtk+ 2.0.
5812
83aca1cb
PE
58132011-11-26 Paul Eggert <eggert@cs.ucla.edu>
5814
5815 * fileio.c (Finsert_file_contents): Undo previous change; see
5816 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
5817
5b76caa4
PE
58182011-11-26 Paul Eggert <eggert@cs.ucla.edu>
5819
5820 Rename locals to avoid shadowing.
5821 * fileio.c (Finsert_file_contents):
5822 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
5823 * process.c (wait_reading_process_output):
5824 Rename inner 'proc' to 'p' to avoid shadowing.
5825 Indent for consistency with usual Emacs style.
5826
8c535114
EZ
58272011-11-25 Eli Zaretskii <eliz@gnu.org>
5828
5829 * xdisp.c (redisplay_window): If cursor row is not fully visible
5830 after recentering, and scroll-conservatively is set to a large
5831 number, scroll window by a few more lines to make the cursor fully
5832 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
5833 (start_display): Don't move to the next line if the display should
5834 start at a newline that is part of a display vector or an overlay
5835 string. (Bug#10119)
8c535114 5836
fa4fdb5c
JL
58372011-11-24 Juri Linkov <juri@jurta.org>
5838
5839 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
5840 after the `MagickPingImage' call. (Bug#10112)
5841
90ec88df
CY
58422011-11-23 Chong Yidong <cyd@gnu.org>
5843
5844 * window.c (Fcoordinates_in_window_p): Accept only live windows.
5845
56e2e794
MR
58462011-11-23 Martin Rudalics <rudalics@gmx.at>
5847
5848 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
5849 making another buffer current. (Bug#10114)
5850
b6e64c41
GM
58512011-11-23 Glenn Morris <rgm@gnu.org>
5852
5853 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
5854
6b21de18
CY
58552011-11-23 Chong Yidong <cyd@gnu.org>
5856
5857 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
5858 using it (Bug#5984).
5859
b12cd789
EZ
58602011-11-22 Eli Zaretskii <eliz@gnu.org>
5861
5862 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
5863 and header-lines, as they don't have one computed for them.
5864 (Bug#10098)
5865
5866 * .gdbinit (prow): Make displayed values more self-explaining.
5867 Add row's hash code.
5868
261b6fd4
LMI
58692011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
5870
5871 * process.c (wait_reading_process_output): Fix asynchrounous
5872 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 5873 (wait_reading_process_output): Add comment and URL.
261b6fd4 5874
e7cfd277
JD
58752011-11-21 Jan Djärv <jan.h.d@swipnet.se>
5876
5877 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
5878
a9b9b7f5
CY
58792011-11-21 Chong Yidong <cyd@gnu.org>
5880
5881 * window.c (Fnext_window, Fprevious_window): Doc fix.
5882
b0d15b4f
SM
58832011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
5884
5885 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
5886
fe7a3057
JB
58872011-11-20 Juanma Barranquero <lekktu@gmail.com>
5888
5889 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
5890
d2999b1a
MR
58912011-11-20 Martin Rudalics <rudalics@gmx.at>
5892
5893 * window.c (Fset_window_combination_limit): Rename argument
5894 STATUS to LIMIT.
5895 (Vwindow_combination_limit): Remove "status" from doc-string.
5896
d5ff9cd0
AS
58972011-11-20 Andreas Schwab <schwab@linux-m68k.org>
5898
5899 * m/ibms390.h: Remove.
5900 * m/ibms390x.h: Don't include "ibms390.h".
5901
a5bb9bd3
SM
59022011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
5903
5904 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
5905 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
5906
cd1181db
JB
59072011-11-20 Juanma Barranquero <lekktu@gmail.com>
5908
5909 * casetab.c (Fset_case_table):
5910 * charset.c (Fcharset_after): Fix typos.
5911
615a3b8d 59122011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 5913
17e845af
PE
5914 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
5915 Otherwise, valgrind does not work on some platforms.
5916 Problem reported by Andreas Schwab in
6a0bf43d
PE
5917 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
5918 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
5919 is set, removing the need for VIRT_ADDRESS_VARIES.
5920 (PURE_P): Use a more-efficient implementation that needs just one
5921 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
5922 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
5923 to 4 (xorl, subq, cmpq, setbe).
5924 * alloc.c (pure): Always extern now, since that's the
5925 VIRT_ADDR_VARIES behavior.
5926 (PURE_POINTER_P): Use a single comparison, not two, for
5927 consistency with the new puresize.h.
5928 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
5929 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
5930 Remove VIRT_ADDR_VARIES no longer needed.
5931
f8fe6f96
EZ
59322011-11-19 Eli Zaretskii <eliz@gnu.org>
5933
5934 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
5935 (erase_phys_cursor, update_window_cursor, show_mouse_face)
5936 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
5937 behave as if the cursor position were at the window margin.
5938
5939 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
5940 and the cursor position is out of bounds, behave as if the cursor
5941 position were at the window margin. (Bug#10075)
5942
df05a53c
CY
59432011-11-18 Chong Yidong <cyd@gnu.org>
5944
5945 * window.c (Fwindow_combination_limit): Make first argument
5946 non-optional, since it is meaningless for live windows like the
5947 selected window.
61ccba97 5948
2071918e
DA
59492011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
5950
5951 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
5952
b50a28de
SM
59532011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
5954
5955 * intervals.c: Fix grafting over the whole buffer (bug#10071).
5956 (graft_intervals_into_buffer): Simplify.
5957
015137db
EZ
59582011-11-18 Eli Zaretskii <eliz@gnu.org>
5959
5960 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
5961 hash values of the two rows.
5962 (copy_row_except_pointers): Preserve the used[] arrays and the
5963 hash values of the two rows. (Bug#10035)
68c95424 5964 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
5965
5966 * xdisp.c (row_hash): New function, body extracted from
5967 compute_line_metrics.
5968 (compute_line_metrics): Call row_hash, instead of computing the
5969 hash code inline.
5970
5971 * dispnew.c (verify_row_hash): Call row_hash for computing the
5972 hash code of a row, instead of duplicating code from xdisp.c.
5973
5974 * dispextern.h (row_hash): Add prototype.
5975
a2addb04
TH
59762011-11-18 Tassilo Horn <tassilo@member.fsf.org>
5977
5978 * frame.c (delete_frame): Don't delete the terminal when the last
5979 X frame is closed if emacs is built with GTK toolkit.
5980
df85d315
JB
59812011-11-17 Juanma Barranquero <lekktu@gmail.com>
5982
5983 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
5984
a0c2d0ae
MR
59852011-11-17 Martin Rudalics <rudalics@gmx.at>
5986
5987 * window.c (Vwindow_splits): Rename to
5988 Vwindow_combination_resize. Suggested by Juri Linkov.
5989 (Fsplit_window_internal): Use Vwindow_combination_resize instead
5990 of Vwindow_splits.
5991
58179cce
JB
59922011-11-16 Juanma Barranquero <lekktu@gmail.com>
5993
7877f373
JB
5994 * nsfns.m (Fns_font_name):
5995 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 5996
b6f67890
MR
59972011-11-16 Martin Rudalics <rudalics@gmx.at>
5998
5999 * window.h (window): Rename slot "nest" to "combination_limit".
6000 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
6001 (Fset_window_nest): Rename to Fset_window_combination_limit.
6002 (Vwindow_nest): Rename to Vwindow_combination_limit.
6003 (recombine_windows, make_parent_window, make_window)
6004 (Fsplit_window_internal, saved_window)
6005 (Fset_window_configuration, save_window_save): Rename all
6006 occurrences of window_nest to window_combination_limit.
6007
c7015153
JB
60082011-11-15 Juanma Barranquero <lekktu@gmail.com>
6009
6010 * image.c (imagemagick_load_image): Fix typo.
6011
322ad6ec
EZ
60122011-11-14 Eli Zaretskii <eliz@gnu.org>
6013
6014 * xdisp.c (display_line): Move the call to
6015 highlight_trailing_whitespace before the call to
6016 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
6017 faces of all the glyphs to compute ROW's hash value.
6018 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 6019
f067b8ec
JB
60202011-11-14 Juanma Barranquero <lekktu@gmail.com>
6021
6022 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
6023 just return (bug#10044).
6024
1e5b2111
EZ
60252011-11-12 Eli Zaretskii <eliz@gnu.org>
6026
7ef3cbd5
EZ
6027 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
6028 with user-defined heap size. Bump the default size of the temacs
6029 heap to 27MB, to avoid memory warning when running temacs.
6030 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
6031
1e5b2111
EZ
6032 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
6033 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
6034 (verify_row_hash) [XASSERTS]: New function.
6035 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
6036 that the hash value of glyph rows is correct.
1e5b2111 6037
89d61221
MR
60382011-11-12 Martin Rudalics <rudalics@gmx.at>
6039
6040 * window.h (window): Remove splits slot.
6041 * window.c (Fwindow_splits, Fset_window_splits): Remove.
6042 (Fdelete_other_windows_internal, make_parent_window)
6043 (make_window, Fsplit_window_internal, Fdelete_window_internal)
6044 (Fset_window_configuration, save_window_save): Don't deal with
6045 split status of windows.
6046 (saved_window): Remove splits slot.
6047 (Vwindow_splits): Rewrite doc-string.
6048
97f18cc8
JD
60492011-11-11 Jan Djärv <jan.h.d@swipnet.se>
6050
6051 * xfns.c (unwind_create_frame):
6052 * nsfns.m (unwind_create_frame):
6053 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
6054 Vframe_list (Bug#9999).
6055
22a648b4
DA
60562011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
6057
0b381c7e 6058 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 6059
659afede
KH
60602011-11-11 Kenichi Handa <handa@m17n.org>
6061
6062 * callproc.c (Fcall_process): Set the member dst_multibyte of
6063 process_coding.
6064
9ac0394b
KH
60652011-11-11 Johan Bockgård <bojohan@gnu.org>
6066
6067 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
6068 avoid a crash (bug#9496).
6069
2fbdc249
CY
60702011-11-09 Chong Yidong <cyd@gnu.org>
6071
6072 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
6073 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
6074
ac6b1f81
PE
60752011-11-08 Paul Eggert <eggert@cs.ucla.edu>
6076
6077 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
6078
09db192c
PE
60792011-11-08 Paul Eggert <eggert@cs.ucla.edu>
6080
6081 Avoid some portability problems by eschewing 'extern inline' functions.
6082 The trivial performance wins aren't worth the portability hassles; see
6083 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
6084 et seq.
6085 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
6086 (window_box_width, window_box_left, window_box_left_offset)
6087 (window_box_right, window_box_right_offset): Undo previous change,
6088 by removing the "extern"s.
6089 * intervals.c (adjust_intervals_for_insertion)
6090 (adjust_intervals_for_deletion): Undo previous change,
6091 making these static again.
6092 (offset_intervals, temp_set_point_both, temp_set_point)
6093 (copy_intervals_to_string): No longer inline.
6094 * xdisp.c (window_text_bottom_y, window_box_width)
6095 (window_box_height, window_box_left_offset)
6096 (window_box_right_offset, window_box_left, window_box_right)
6097 (window_box): No longer inline.
6098
105216ed
CY
60992011-11-08 Chong Yidong <cyd@gnu.org>
6100
6101 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
6102 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
6103 Signal an error if not a live window.
105216ed
CY
6104 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
6105 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
6106
ae9e237f
JB
61072011-11-07 Juanma Barranquero <lekktu@gmail.com>
6108
6109 * lisp.h (syms_of_abbrev): Remove declaration.
6110 Reported by CHENG Gao <chenggao@royau.me>.
6111
c7aa8333
EZ
61122011-11-07 Eli Zaretskii <eliz@gnu.org>
6113
6114 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
6115 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
6116 of temacs in GUI mode.
6117
be7f5545
MR
61182011-11-07 Martin Rudalics <rudalics@gmx.at>
6119
6120 * window.h: Declare delete_all_child_windows instead of
6121 delete_all_subwindows.
6122 * window.c (Fwindow_nest, Fset_window_nest)
6123 (Fset_window_new_total, Fset_window_new_normal)
6124 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
6125 (delete_all_subwindows): Rename to delete_all_child_windows.
6126 (Fdelete_other_windows_internal, Fset_window_configuration):
6127 Call delete_all_child_windows instead of delete_all_subwindows.
6128 * frame.c (delete_frame): Call delete_all_child_windows instead
6129 of delete_all_subwindows.
6130
ca78dc43
PE
61312011-11-07 Paul Eggert <eggert@cs.ucla.edu>
6132
6133 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
6134 This is also needed for porting to any host where GC_MARK_STACK is
6135 not GC_MAKE_GCPROS_NOOPS.
6136 (which_symbols): Use it.
6137
a0241d01
KH
61382011-11-07 Kenichi Handa <handa@m17n.org>
6139
6140 * coding.c (coding_set_destination): Check coding->src_pos only
6141 when coding->src_object is a buffer (bug#9910).
6142
6143 * process.c (send_process): Set the member src_multibyte of coding
6144 to 0 (bug#9911) when sending a unibyte text.
6145
6146 * callproc.c (Fcall_process): Set the member src_multibyte of
6147 process_coding to 0 (bug#9912).
6148
a64bfdfa 61492011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
6150
6151 * xmenu.c (cleanup_widget_value_tree): New function.
6152 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
6153 calling free_menubar_widget_value_tree directly (Bug#9830).
6154
cb41b32a
PE
61552011-11-06 Paul Eggert <eggert@cs.ucla.edu>
6156
6157 Fix some portability problems with 'inline'.
6158 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
6159 (window_box_width, window_box_left, window_box_left_offset)
6160 (window_box_right, window_box_right_offset): Declare extern.
6161 Otherwise, these inline functions do not conform to C99 and
6162 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
6163 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
6164 * intervals.c (adjust_intervals_for_insertion)
6165 (adjust_intervals_for_deletion): Now extern, because otherwise the
6166 extern inline functions 'offset_intervals' couldn't refer to it.
6167 (static_offset_intervals): Remove.
6168 (offset_intervals): Rewrite using the old contents of
6169 static_offset_intervals. The old version didn't conform to C99
6170 because an extern inline function contained a reference to an
6171 identifier with static linkage.
6172
b7041366
AS
61732011-11-06 Andreas Schwab <schwab@linux-m68k.org>
6174
6175 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
6176 GC.
6177
88a37c4d
EZ
61782011-11-06 Eli Zaretskii <eliz@gnu.org>
6179
6180 * xdisp.c (init_iterator, reseat_to_string): Don't set the
6181 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
6182 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
6183 return Qleft_to_right.
6184
49745b39
CY
61852011-11-06 Chong Yidong <cyd@gnu.org>
6186
6187 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
6188 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
6189 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
6190 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
6191 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
6192 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
6193 (Fwindow_vscroll): Doc fix.
6194 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
6195 argument, since it makes no sense to pass a live window and for
6196 consistency with window-child.
6197
1f05cd82
CS
61982011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
6199
6200 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
6201 support MSVC.
6202
22610910
JR
62032011-11-05 Jason Rumney <jasonr@gnu.org>
6204
6205 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
6206 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
6207 fonts (Bug#6029).
6208 (add_font_entity_to_list): Fix logic errors in mixed boolean and
6209 bitwise arithmetic preventing use of unicode-sip and non-truetype
6210 opentype fonts.
6211
a06776b2
EZ
62122011-11-05 Eli Zaretskii <eliz@gnu.org>
6213
3ad924ba
EZ
6214 * s/ms-w32.h (fstat, stat, utime): Move redirections to
6215 "emacs"-only part.
6216
a06776b2
EZ
6217 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
6218 initialization code to keep similarity to xfns.c after changes
6219 from 2011-11-05.
6220
c9e7db78
JD
62212011-11-05 Jan Djärv <jan.h.d@swipnet.se>
6222
a97f8f3f
JD
6223 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
6224 (unwind_create_frame): New function (Bug#9943).
6225 (Fx_create_frame): Restructure code to be more similar to the one in
6226 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
6227 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
6228 Move terminal->reference_count++ just before making the frame official
6229 (Bug#9943).
6230
6231 * nsterm.m (x_free_frame_resources): New function.
6232 (x_destroy_window): Move code to x_free_frame_resources.
6233
c9e7db78 6234 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
6235 (Fx_create_frame, x_create_tip_frame):
6236 Move terminal->reference_count++ just before making the frame
75f1671a 6237 official. Move initialization of image_cache_refcount and
c9e7db78
JD
6238 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
6239
a6fc3b5c
EZ
62402011-11-05 Eli Zaretskii <eliz@gnu.org>
6241
6242 Support MSVC build with newer versions of Visual Studio.
6243 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
6244 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
6245 nt/gmake.defs.
6246
6247 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
6248 which are not supported by MSVC.
6249 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
6250 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
6251 bitfields.
6252 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
6253 types in bitfields.
6254 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
6255
6256 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
6257
58179cce 62582011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
6259
6260 Support MSVC build with newer versions of Visual Studio.
6261 * w32.c: Don't include w32api.h for MSVC.
6262 (init_environment) [_MSC_VER]: Call sys_access, not _access.
6263
6264 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
6265 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
6266 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
6267 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
6268 e_* cousins.
6269 (alloca) [_MSC_VER]: Define to _alloca.
6270
6271 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
6272
6273 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
6274
a58c13ed
EZ
62752011-11-04 Eli Zaretskii <eliz@gnu.org>
6276
6277 * xdisp.c (note_mouse_highlight): If either of
6278 previous/next-single-property-change returns nil, treat that as
6279 the beginning or the end of the buffer. (Bug#9955)
6280
fe0b6370
JD
62812011-11-04 Jan Djärv <jan.h.d@swipnet.se>
6282
a58c13ed 6283 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
6284 label is not null (Bug#9951).
6285 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
6286 may be NULL.
6287
89bd5ee1
EZ
62882011-11-04 Eli Zaretskii <eliz@gnu.org>
6289
6290 * window.c (Fwindow_body_size): Mention in the doc string that the
6291 return value is in frame's canonical units. (Bug#9949)
6292
84c3edb9
EZ
62932011-11-03 Eli Zaretskii <eliz@gnu.org>
6294
4e2fb5c7
EZ
6295 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
6296
84c3edb9 6297 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 6298 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 6299 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 6300
bc17a887
EZ
63012011-11-01 Eli Zaretskii <eliz@gnu.org>
6302
6303 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
6304 Don't stop backward scan on the continuation glyph, even though
6305 its CHARPOS is positive.
6d5eb5b0
SM
6306 (mouse_face_from_buffer_pos, note_mouse_highlight):
6307 Rename cover_string to disp_string.
bc17a887 6308
4ee88440
MR
63092011-11-01 Martin Rudalics <rudalics@gmx.at>
6310
6311 * window.c (temp_output_buffer_show): Don't use
6312 Vtemp_buffer_show_specifiers.
6313 (Vtemp_buffer_show_specifiers): Remove unused variable.
6314
c2ff3c02
EZ
63152011-10-30 Eli Zaretskii <eliz@gnu.org>
6316
6317 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
6318 past the beginning of the current glyph matrix.
6319
58179cce 63202011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
6321
6322 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
6323 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
6324 HAVE_GTK3 (Bug#9869).
b77a6a7f 6325
3b574623
JD
6326 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
6327 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
6328
b77a6a7f
JD
6329 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
6330
6331 * xterm.c: Declare x_handle_net_wm_state to return int.
6332 (handle_one_xevent): Check if we are iconified but don't have
6333 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
6334 (get_current_wm_state): Return non-zero if not hidden,
6335 check for _NET_WM_STATE_HIDDEN (Bug#9893).
6336 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
6337 (x_handle_net_wm_state): Return what get_current_wm_state returns.
6338 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
6339
196e41e4
PE
63402011-10-29 Paul Eggert <eggert@cs.ucla.edu>
6341
6342 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
6343 so that this new function doesn't get optimized away by a
6344 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
6345
021f2e1a
AS
63462011-10-29 Andreas Schwab <schwab@linux-m68k.org>
6347
6348 * frame.h (MOUSE_HL_INFO): Remove excess parens.
6349
8b058d44
EZ
63502011-10-29 Eli Zaretskii <eliz@gnu.org>
6351
6352 Fix the `xbytecode' command.
6353 * .gdbinit (xprintbytestr): New command.
b50a28de 6354 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
6355 (xbytecode): Print the byte-code string as well.
6356
4452fb80
EZ
63572011-10-29 Kim Storm <storm@cua.dk>
6358
8b058d44
EZ
6359 * alloc.c (which_symbols): New function.
6360
21b72067
AS
63612011-10-29 Andreas Schwab <schwab@linux-m68k.org>
6362
6363 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
6364 line. (Bug#9903)
6365
83ed7b5c
GM
63662011-10-29 Glenn Morris <rgm@gnu.org>
6367
6368 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
6369 Not clear what it was for, and it causes various bugs. (Bug#9839)
6370
5a7a728b
EZ
63712011-10-28 Eli Zaretskii <eliz@gnu.org>
6372
6373 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
6374 possible random value that matches one of those tested as
6375 condition to clear the mouse face.
6376
d3d0842f
CY
63772011-10-28 Chong Yidong <cyd@gnu.org>
6378
6379 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
6380
31b39d13
DN
63812011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
6382
6383 * window.c (make_window): Initialize phys_cursor_on_p.
6384
9aba6043
SM
63852011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
6386
6387 * lisp.h (struct Lisp_Symbol): Update comments.
6388
c20992f4
JB
63892011-10-28 Juanma Barranquero <lekktu@gmail.com>
6390
6391 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
6392
db4f02f2
EZ
63932011-10-28 Eli Zaretskii <eliz@gnu.org>
6394
6395 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
6396 <oslsachem@gmail.com> for helping to debug this.
6397
6398 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
6399 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
6400 (g_b_init_get_glyph_outline_w): New static variables.
6401 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
6402 (GetGlyphOutlineW_Proc): New typedefs.
6403 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
6404 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
6405 New functions.
6406 (w32font_open_internal, compute_metrics):
6407 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
6408 instead of calling the "wide" APIs directly.
6409
6410 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
6411
6412 * w32.h (syms_of_w32font): Add prototype.
6413
87e68db4
JB
64142011-10-27 Juanma Barranquero <lekktu@gmail.com>
6415
6416 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
6417 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
6418 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
6419 (Fmove_to_window_line): Doc fix.
6420
435c1d67
CY
64212011-10-27 Chong Yidong <cyd@gnu.org>
6422
6423 * process.c (make_process): Set gnutls_state to NULL.
6424
6425 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
6426 non-NULL, regardless of GNUTLS_INITSTAGE.
6427 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
6428 an error. Set process slots as soon as we allocate them.
6429
6430 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
6431
9c6c6f49
CY
64322011-10-27 Chong Yidong <cyd@gnu.org>
6433
9aba6043
SM
6434 * gnutls.c (emacs_gnutls_deinit): New function.
6435 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
6436 (Fgnutls_deinit, Fgnutls_boot): Use it.
6437
6438 * process.c (make_process): Initialize GnuTLS credentials to NULL.
6439 (deactivate_process): Call emacs_gnutls_deinit.
6440
657d08d3
JB
64412011-10-27 Juanma Barranquero <lekktu@gmail.com>
6442
6443 * image.c (x_create_x_image_and_pixmap):
6444 * w32.c (sys_rename, w32_delayed_load):
6445 * w32font.c (fill_in_logfont):
6446 * w32reg.c (x_get_string_resource): Silence compiler warnings.
6447
5430d399
JB
64482011-10-26 Juanma Barranquero <lekktu@gmail.com>
6449
6450 * w32fns.c (w32_default_color_map): New function,
6451 extracted from Fw32_default_color_map.
a7ef684b 6452 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 6453
fe0055fa
PE
64542011-10-25 Paul Eggert <eggert@cs.ucla.edu>
6455
6456 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
6457
e6346438
SM
64582011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
6459
6460 * keyboard.c (test_undefined): New function (bug#9751).
6461 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
6462
e112cc37
ET
64632011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
6464
6465 * sysdep.c (init_sys_modes): Fix the check for the controlling
6466 terminal (Bug#6649).
6467
7b5d6677
EZ
64682011-10-20 Eli Zaretskii <eliz@gnu.org>
6469
6470 * dispextern.h (struct bidi_it): New member next_en_type.
6471
6472 * bidi.c (bidi_line_init): Initialize the next_en_type member.
6473 (bidi_resolve_explicit_1): When next_en_pos is valid for the
6474 current character, check also for next_en_type being WEAK_EN.
6475 (bidi_resolve_weak): Don't enter the expensive loop if the current
6476 position is before next_en_pos. Record the bidi type of the first
6477 non-ET, non-BN character we find, in addition to its position.
6478 (bidi_level_of_next_char): Invalidate next_en_type when
6479 next_en_pos is over-stepped.
6480
7da0b018
PE
64812011-10-20 Paul Eggert <eggert@cs.ucla.edu>
6482
6483 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
6484 * editfns.c: Rewrite current-time-zone so that it invokes
6485 the equivalent of (format-time-string "%Z") to get the time zone name.
6486 This fixes a bug when the time zone name contains characters that
6487 need converting from the system time locale to Emacs internal format.
6488 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
6489 that patch fixed format-time-string to do the conversion, but
6490 I forgot to fix current-time-zone.
6491 (format_time_string): New function, containing most of
6492 what Fformat_time_string used to contain.
6493 (Fformat_time_string): Rewrite in terms of format_time_string.
6494 This doesn't change this function's behavior.
6495 (current-time-zone): Rewrite to use format_time_string.
6496 This fixes the bug reported by Michael Schierl in
6497 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
6498 Jason Rumney's 2007-06-07 change worked around this bug, but
6499 didn't fix it.
6500 * systime.h (tzname, timezone): Remove no-longer-used declarations.
6501
8547b010
EZ
65022011-10-19 Eli Zaretskii <eliz@gnu.org>
6503
6504 * xdisp.c (start_display): If the character at POS is displayed
6505 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
6506 (try_window_reusing_current_matrix): If a line ends in a display
6507 vector or the next line starts in a display vector, continue
6508 redrawing the window even though the character position of
6509 start_row was reached.
8547b010
EZ
6510 (Bug#9771, part 2)
6511
4e948d15
CY
65122011-10-18 Chong Yidong <cyd@gnu.org>
6513
6514 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
6515 with nobreak-char-display too.
6516
4787455f
EZ
65172011-10-18 Eli Zaretskii <eliz@gnu.org>
6518
6519 Fix part 3 of bug#9771.
6520 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
6521 (bidi_resolve_neutral): Don't enter the expensive loop looking for
6522 non-neutral characters if the current character is a paragraph
6523 separator (a.k.a. Newline). This avoids running the same
6524 expensive loop twice, once when we consume the preceding newline
6525 and the other time when the line actually needs to be displayed.
6526 Avoid the loop when we see neutrals on the base embedding level
6527 following a character whose directionality is the same as the
6528 paragraph's. This avoids running the expensive loop when a line
6529 ends in a long sequence of neutrals, like control characters.
6530 Add assertion against STRONG_AL type. Slightly rearrange code
6531 that determines the type of a neutral given the first non-neutral
6532 that follows it.
6533 (bidi_level_of_next_char): Set next_en_pos to zero when
6534 invalidating its info.
6535
2c91f553
EZ
65362011-10-17 Eli Zaretskii <eliz@gnu.org>
6537
6538 * xdisp.c (push_display_prop): Determine whether to record string
6539 or buffer position by IT->string, not by IT->method. Allow
6540 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
6541 (move_it_vertically_backward): Don't look for character position
6542 immediately after the newline when in a continuation line.
6543 (Bug#9771, part 1)
2c91f553 6544
c7b08b0d
MR
65452011-10-15 Martin Rudalics <rudalics@gmx.at>
6546
6547 * window.c (coordinates_in_window): Rewrite and delabelize
6548 vertical border check. (Bug#5357) (Bug#9618)
6549
6b02f655
SM
65502011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
6551
6552 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
6553 errors in XSetWindowBorder (bug#9310).
6554
81d40c92
DA
65552011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
6556
6557 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
6558 avoid crash when xmalloc overrun checking is enabled.
6559
d4172c3b
EZ
65602011-10-13 Eli Zaretskii <eliz@gnu.org>
6561
6562 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
6563 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
6564 cursor motion with <left> and <right> arrow keys.
6565
6566 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
6567 some callers set that themselves.
6568
b00eea75
EZ
65692011-10-12 Eli Zaretskii <eliz@gnu.org>
6570
6571 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
6572 display string and the previous row comes from the same string and
6573 is empty. (Bug#9739) (Bug#9738)
6574
8fe012c4
SM
65752011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
6576
6577 * doc.c (get_doc_string): Encode file name (bug#9735).
6578
0074aef2
EZ
65792011-10-12 Eli Zaretskii <eliz@gnu.org>
6580
79beb178
EZ
6581 * bidi.c (bidi_level_of_next_char):
6582 * xdisp.c (get_visually_first_element): Remove old incorrect
6583 comments regarding the Unicode Line Separator character.
6584
0074aef2
EZ
6585 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
6586
6e4b3fbe
DA
65872011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
6588
6589 * alloc.c (Fgc_status): Do not access beyond zombies array
6590 boundary if nzombies > MAX_ZOMBIES.
6591 * alloc.c (dump_zombies): Add missing format specifier.
6592
0324f3af
PE
65932011-10-12 Paul Eggert <eggert@cs.ucla.edu>
6594
b5525cac
PE
6595 * xdisp.c (set_cursor_from_row): Simplify conditionals,
6596 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
6597
0324f3af
PE
6598 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
6599 Some packages use them to denote characters with modifiers.
6600
e9b5f888
AS
66012011-10-11 Andreas Schwab <schwab@linux-m68k.org>
6602
6603 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
6604 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
6605 matching a pp-number. Rename parameter var to var1.
6606
127827c0
SM
66072011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
6608
6609 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
6610
c8fd3bd0
GM
66112011-10-08 Glenn Morris <rgm@gnu.org>
6612
6613 * callint.c (Fcall_interactively): Give a more explicit error for the
6614 'c' case with a non-character input. (Bug#8479)
6615
352ec8ff
EZ
66162011-10-08 Eli Zaretskii <eliz@gnu.org>
6617
03669ccb
EZ
6618 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
6619 lines.
7061c986
EZ
6620 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
6621 lines that are hscrolled on the left.
03669ccb 6622
352ec8ff
EZ
6623 * dispnew.c (buffer_posn_from_coords): Account for a possible
6624 presence of header-line. (Bug#4426)
6625
a66cfb1c
SM
66262011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
6627
6b02f655
SM
6628 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
6629 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 6630
7c5ee88e
PE
66312011-10-07 Paul Eggert <eggert@cs.ucla.edu>
6632
6633 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
6634 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
6635 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
6636 this makes Emacs dump core during garbage collection on rare
6637 occasions. sizeof is obviously inferior to offsetof here, so
6638 stick with offsetof.
6639 (GC_POINTER_ALIGNMENT): New macro.
6640 (mark_memory): Omit 3rd (offset) arg; caller changed.
6641 Don't assume EMACS_INT alignment is the same as pointer alignment.
6642
df1bbe5b
SM
66432011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
6644
6645 * keyboard.c (read_key_sequence_remapped): New var.
6646 (read_key_sequence): Compute remapping in the right buffer.
6647 (command_loop_1): Use read_key_sequence's remapping directly.
6648
51553db6
SM
66492011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
6650
32c1fffd
SM
6651 * dired.c (file_name_completion): Don't expand file name.
6652 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
6653 before checking file name handler.
6654
51553db6
SM
6655 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
6656 they've been requested explicitly (bug#9591).
6657
b6bd1599 66582011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
6659
6660 * keymap.c (Fsingle_key_description): Use make_specified_string
6661 instead of build_string to build string from push_key_description.
6662 (Bug#5193)
6663
f701dc2a
PE
66642011-09-30 Paul Eggert <eggert@cs.ucla.edu>
6665
4222c55d
PE
6666 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
6667 This fixes a Y2038 bug on 64-bit hosts.
6668 * buffer.c (reset_buffer):
6669 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
6670 (Fclear_buffer_auto_save_failure):
6671 Use 0, not -1, to represent an unset failure time, since time_t
6672 might not be signed.
6673
f701dc2a
PE
6674 Remove dependency on glibc malloc internals.
6675 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6676 Move back here from lisp.h, but with their new implementations.
6677 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
6678 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
6679 * charset.c (charset_table_init): New static var.
6680 (syms_of_charset): Use it instead of xmalloc. This removes a
6681 dependency on glibc malloc internals. See Eli Zaretskii's comment in
6682 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
6683 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6684 Move back to alloc.c.
6685 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
6686 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
6687
9ceebf39
JD
66882011-09-30 Jan Djärv <jan.h.d@swipnet.se>
6689
6690 * nsterm.m (windowDidResize): Call x_set_window_size only when
6691 ns_in_resize is true. Otherwise set pixelwidth/height and
6692 call change_frame_size (Bug#9628).
6693
cb993c58
PE
66942011-09-30 Paul Eggert <eggert@cs.ucla.edu>
6695
3930c88b
PE
6696 Port --enable-checking=all to Fedora 14 x86-64.
6697 * charset.c (syms_of_charset): Also account for glibc malloc's
6698 internal overhead when calculating the initial malloc maximum.
6699
cb993c58
PE
6700 Port --enable-checking=all to Fedora 14 x86.
6701 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6702 Move to lisp.h.
6703 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
6704 (overrun_check_realloc, overrun_check_free):
6705 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
6706 That way, xmalloc returns a properly-aligned pointer even if
6707 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
6708 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
6709 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
6710 into account when calculating the initial malloc maximum.
6711 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6712 Move here from alloc.c, so that charset.c can use it too.
6713 Properly align; the old code wasn't right for common 32-bit hosts
6714 when configured with --enable-checking=all.
6715 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
6716 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
6717
31bed486
EZ
67182011-09-29 Eli Zaretskii <eliz@gnu.org>
6719
04c70788 6720 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
6721 use EDOM.
6722
fbcaa2f3
EZ
67232011-09-28 Eli Zaretskii <eliz@gnu.org>
6724
6725 * xdisp.c (compute_display_string_end): If there's no display
6726 string at CHARPOS, return -1.
6727
6728 * bidi.c (bidi_fetch_char): When compute_display_string_end
6729 returns a negative value, treat the character as a normal
6730 character not covered by a display string. (Bug#9624)
6731
a239d4e9
JB
67322011-09-28 Juanma Barranquero <lekktu@gmail.com>
6733
6734 * lread.c (Fread_from_string): Fix typo in docstring.
6735
88652fd5
EZ
67362011-09-27 Eli Zaretskii <eliz@gnu.org>
6737
6738 * xdisp.c (handle_invisible_prop): If invisible text ends on a
6739 newline, reseat the iterator instead of bidi-iterating there one
6740 character at a time. (Bug#9610)
32c1fffd
SM
6741 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
6742 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 6743
ed497dd4
AS
67442011-09-27 Andreas Schwab <schwab@linux-m68k.org>
6745
6746 * lread.c (readevalloop): Use correct code for NBSP.
6747 (read1): Likewise. (Bug#9608)
6748
b2bf61aa
MA
67492011-09-25 Michael Albinus <michael.albinus@gmx.de>
6750
6751 * dbusbind.c (Fdbus_register_signal): When service is not
6752 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
6753
32bbb17c
GM
67542011-09-25 Glenn Morris <rgm@gnu.org>
6755
6756 * buffer.c (truncate-lines): Doc fix.
6757
94e0933e
CY
67582011-09-24 Chong Yidong <cyd@stupidchicken.com>
6759
6760 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
6761 (Fset_window_next_buffers): Doc fix.
6762
cddde921
GM
67632011-09-24 Glenn Morris <rgm@gnu.org>
6764
6765 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
6766
1260aef1
PE
67672011-09-24 Paul Eggert <eggert@cs.ucla.edu>
6768
25b4bfa0
PE
6769 Fix minor problems found by static checking.
6770 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
6771 * indent.c (Fvertical_motion): Fix == vs = typo.
6772
e3cbd34b
EZ
67732011-09-24 Eli Zaretskii <eliz@gnu.org>
6774
a66cfb1c
SM
6775 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
6776 Default value is now t. Doc fix.
6bf7006f 6777
e3cbd34b 6778 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 6779 logic when moving up, not only when moving down. Fix the
e3cbd34b 6780 confusing name and values of the it_overshoot_expected variable;
32c1fffd 6781 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
6782
6783 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
6784 CHARPOS is covered by a display string which includes newlines.
6785 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
6786 is covered by a display string with embedded newlines.
6787
a3de0cbd
MA
67882011-09-24 Michael Albinus <michael.albinus@gmx.de>
6789
6790 * dbusbind.c (Fdbus_register_signal): Add match rule to
6791 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
6792 (Fdbus_register_method, Vdbus_registered_objects_table):
6793 Fix docstring.
a3de0cbd 6794
b260039d
JM
67952011-09-24 Jim Meyering <meyering@redhat.com>
6796
32c1fffd 6797 do not ignore write error for any output size
b260039d
JM
6798 The previous change was incomplete.
6799 While it makes emacs --batch detect the vast majority of stdout
6800 write failures, errors were still ignored whenever the output size is
6801 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
6802 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
6803 && echo FAIL: ignored write error
6804 FAIL: ignored write error
6805 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
6806 && echo FAIL: ignored write error
6807 FAIL: ignored write error
6808 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
6809
8eca8a7c
AS
68102011-09-23 Andreas Schwab <schwab@linux-m68k.org>
6811
6812 * emacs.c (Fkill_emacs): In noninteractive mode exit
6813 non-successfully if a write error occurred on stdout. (Bug#9574)
6814
3341db62
EZ
68152011-09-21 Eli Zaretskii <eliz@gnu.org>
6816
6817 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
6818 the xassert test.
6819
6820 * dispextern.h (struct it): Update the comment documenting what
6821 can it->OBJECT be.
6822
8c203dbf
EZ
68232011-09-20 Eli Zaretskii <eliz@gnu.org>
6824
6825 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
6826 a display string, extend search for cursor position to end of row.
6827 (find_row_edges): If the row ends in a newline from a display
6828 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
6829 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
6830 (Fcurrent_bidi_paragraph_direction): Fix search for previous
6831 non-empty line. Fixes confusing cursor motion with arrow keys at
6832 the beginning of a line that starts with whitespace.
8c203dbf 6833
a4824228
LMI
68342011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
6835
6836 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
6837 (bug#9493).
6838
33ed493b
CY
68392011-09-18 Chong Yidong <cyd@stupidchicken.com>
6840
6841 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
6842 boolean (Bug#9154).
6843
56cd55c8
EZ
68442011-09-18 Eli Zaretskii <eliz@gnu.org>
6845
6846 * xdisp.c (display_line): Record maximum and minimum buffer
6847 positions even if no glyphs were produced (e.g., by a zero-width
6848 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
6849 buffer positions that will be removed from the glyph row because
6850 they don't fit.
c02dcedf
EZ
6851 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
6852 column is beyond frame width: don't subtract 1 "pixel" when
6853 computing width of the stretch.
3e62b7e0
EZ
6854 (reseat_at_next_visible_line_start): Undo the change made on
6855 2011-09-17 that saved paragraph information and restored it after
6856 the call to `reseat'. (Bug#9545)
56cd55c8 6857
5ed99d36 68582011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
6859
6860 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
6861 and turn window cursor on if cleared (Bug#9415).
6862
5ed99d36 68632011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
6864
6865 * search.c (boyer_moore): Take unibyte characters from pattern
6866 literally. (Bug#9458)
6867
9bade7b2
EZ
68682011-09-18 Eli Zaretskii <eliz@gnu.org>
6869
6870 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
6871
e5e9d610
PE
68722011-09-18 Paul Eggert <eggert@cs.ucla.edu>
6873
87e4427a
PE
6874 Fix minor problem found by static checking.
6875 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
6876 initialized, to pacify gcc -Wuninitialized.
6877
e5e9d610
PE
6878 * fileio.c: Report proper errno when syscall falls.
6879 (Finsert_file_contents): Save and restore errno,
6880 so that report_file_error outputs the correct diagnostic.
6881 (Fwrite_region) [CLASH_DETECTION]: Likewise.
6882
a1674f0b
EZ
68832011-09-18 Eli Zaretskii <eliz@gnu.org>
6884
6885 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
6886
fbfb6dd4
EZ
68872011-09-17 Eli Zaretskii <eliz@gnu.org>
6888
6889 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
6890 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
6891
bb187662
EZ
68922011-09-17 Eli Zaretskii <eliz@gnu.org>
6893
1137e8b8 6894 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 6895 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
6896
6897 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
6898 (bidi_find_paragraph_start): Search back for paragraph beginning
6899 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
6900 (bidi_move_to_visually_next): Only trigger paragraph-related
6901 computations when the last character is a newline or at EOB, not
6902 just any NEUTRAL_B. (Bug#9470)
6903
bb187662
EZ
6904 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
6905 truncated lines if point is covered by a display string. (Bug#9524)
6906
2e621251
PE
69072011-09-16 Paul Eggert <eggert@cs.ucla.edu>
6908
6909 * xselect.c: Relax test for outgoing X longs (Bug#9498).
6910 (cons_to_x_long): New function.
6911 (lisp_data_to_selection_data): Use it. Correct the test for
6912 short-versus-long data; it was negated. Break out of vector
6913 loop, for efficiency, when a long datum is discovered.
6914
91a15bc6
SM
69152011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
6916
6917 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
6918
b41c3a35
EZ
69192011-09-16 Eli Zaretskii <eliz@gnu.org>
6920
6921 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
6922 GCC PR/17406) by declaring this function with external scope.
6923
7812ba2d
PE
69242011-09-15 Paul Eggert <eggert@cs.ucla.edu>
6925
6926 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
6927 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
6928
cf7edc2a
AS
69292011-09-15 Andreas Schwab <schwab@linux-m68k.org>
6930
6931 * editfns.c (Fformat): Correctly handle text properties on "%%".
6932
bd01620e
EZ
69332011-09-15 Eli Zaretskii <eliz@gnu.org>
6934
6935 * xterm.c (x_draw_composite_glyph_string_foreground):
6936 * w32term.c (x_draw_composite_glyph_string_foreground):
6937 * term.c (encode_terminal_code):
6938 * composite.c (composition_update_it, get_composition_id):
6939 * xdisp.c (get_next_display_element)
6940 (fill_composite_glyph_string): Add comments about special meaning
6941 of TAB characters in a composition.
6942
a02719a3
PE
69432011-09-15 Paul Eggert <eggert@cs.ucla.edu>
6944
6945 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
6946 This occurs when processing a multibyte format.
6947 Problem reported by Wolfgang Jenker.
a02719a3 6948
72589a3c
JB
69492011-09-15 Johan Bockgård <bojohan@gnu.org>
6950
6951 * xdisp.c (try_cursor_movement): Only check for exact match if
6952 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
6953
1c14176c
PE
69542011-09-14 Paul Eggert <eggert@cs.ucla.edu>
6955
6956 Remove unused external symbols.
6957 * dispextern.h (calc_pixel_width_or_height): Remove decl.
6958 * xdisp.c (calc_pixel_width_or_height): Now static.
6959 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
6960 * indent.c (check_display_width):
6961 * w32term.c: Fix comment to match code.
6962 * xterm.c, xterm.h (x_catching_errors): Remove.
6963
d2eea5b5
PE
69642011-09-14 Paul Eggert <eggert@cs.ucla.edu>
6965
6966 * xselect.c: Use signed conversions more consistently (Bug#9498).
6967 (selection_data_to_lisp_data): Assume incoming selection data are
6968 signed integers, not unsigned. This is to be consistent with
6969 outgoing selection data, which was modified to use signed integers
6970 in as part of the fix to Bug#9196 in response to Jan D.'s comment
6971 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
6972 expects long, not unsigned long.
6973
46888499
EZ
69742011-09-14 Eli Zaretskii <eliz@gnu.org>
6975
6976 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
6977 computation of loop end. Reported by Johan Bockgård
6978 <bojohan@gnu.org>.
6979
ef8ef9fb
CY
69802011-09-13 Chong Yidong <cyd@stupidchicken.com>
6981
6982 * frame.c (Fother_visible_frames_p): Function deleted.
6983
fa819fed
EZ
69842011-09-12 Eli Zaretskii <eliz@gnu.org>
6985
6986 * indent.c (compute_motion): Process display vector front to back
6987 rather than the other way around. (Bug#2496)
6988
2ba8e008
SM
69892011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6990
6991 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
6992
20f53c69
CY
69932011-09-11 Chong Yidong <cyd@stupidchicken.com>
6994
6995 * minibuf.c (Fread_from_minibuffer): Doc fix.
6996
d562d7a4
EZ
69972011-09-11 Eli Zaretskii <eliz@gnu.org>
6998
6999 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
7000 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
7001
1c4d7f3d
LMI
70022011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
7003
7004 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
7005 value for non-existent files.
7006
b885bf36
EZ
70072011-09-11 Eli Zaretskii <eliz@gnu.org>
7008
7009 * fileio.c (Finsert_file_contents): If the file cannot be opened,
7010 set its "size" to -1. This will set the modtime_size field of
7011 the corresponding buffer to -1, which is what
7012 verify-visited-file-modtime expects for files that do not exist.
7013 (Bug#9139)
7014
6612f0bf
PE
70152011-09-11 Paul Eggert <eggert@cs.ucla.edu>
7016
7017 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
7018 here ...
7019 * lisp.h: ... from here. push_key_description is no longer
7020 defined in keyboard.c, so its declaration should not be in
7021 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
7022 logically belongs with push_key_description.
7023
dfb3f755
PE
70242011-09-10 Paul Eggert <eggert@cs.ucla.edu>
7025
7026 * buffer.h: Include <sys/types.h> instead of <time.h>.
7027 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
7028 Problem reported by Herbert J. Skuhra.
7029
3134906c
LMI
70302011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
7031
7032 * xml.c (parse_region): Make the parsing work for
7033 non-comment-starting XML files again (bug#9144).
7034
8d903f4e
AS
70352011-09-10 Andreas Schwab <schwab@linux-m68k.org>
7036
7037 * image.c (gif_load): Fix calculation of bottom and right corner.
7038 (Bug#9468)
7039
80ad64f4
EZ
70402011-09-10 Eli Zaretskii <eliz@gnu.org>
7041
7042 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
7043 redisplay in small windows.
7044
208a048d
EZ
70452011-09-09 Eli Zaretskii <eliz@gnu.org>
7046
7047 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
7048
9b1c252e
MR
70492011-09-08 Martin Rudalics <rudalics@gmx.at>
7050
7051 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
7052 Operate on live windows only.
7053
2949f33b
JB
70542011-09-08 Juanma Barranquero <lekktu@gmail.com>
7055
7056 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
7057
e08dcafd
EZ
70582011-09-07 Eli Zaretskii <eliz@gnu.org>
7059
7060 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
7061 only under bidi iteration.
7062
115b96bd
JD
70632011-09-07 Jan Djärv <jan.h.d@swipnet.se>
7064
7065 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
7066
c8199d0f
PE
70672011-09-06 Paul Eggert <eggert@cs.ucla.edu>
7068
7069 isnan: Fix porting problem to Solaris 10 with bundled gcc.
7070 Without this fix, the command to link temacs failed due to an
7071 undefined symbol __builtin_isnan. This is because
7072 /usr/include/iso/math_c99.h #defines isnan(x) to
7073 __builtin_isnan(x), but the bundled gcc, which identifies itself
7074 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
7075 a __builtin_isnan.
7076 * floatfns.c (isnan): #undef, and then #define to a clone of
7077 what's in data.c.
7078 (Fisnan): Always define, since it's always available now.
7079 (syms_of_floatfns): Always define isnan at the Lisp level.
7080
e39b275c 70812011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
7082
7083 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
7084
b2db44d9 70852011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 7086
f4af5137 7087 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
7088 The previous code assumed that file offsets (off_t values) fit in
7089 EMACS_INT variables, which is not true on typical 32-bit hosts.
7090 The code messed up by falsely reporting buffer overflow in cases
7091 such as (insert-file-contents "big" nil 1 2) into an empty buffer
7092 when "big" contains more than 2**29 bytes, even though this
7093 inserts just one byte and does not overflow the buffer.
7094 (Finsert_file_contents): Store file offsets as off_t
7095 values, not as EMACS_INT values. Check for overflow when
7096 converting between EMACS_INT and off_t. When checking for
7097 buffer overflow or for overlap, take the offsets into account.
7098 Don't use EMACS_INT for small values where int suffices.
7099 When checking for overlap, fix a typo: ZV was used where
7100 ZV_BYTE was intended.
7101 (Fwrite_region): Don't assume off_t fits into 'long'.
7102 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
7103
ecfc0a49
MA
71042011-09-05 Michael Albinus <michael.albinus@gmx.de>
7105
7106 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
7107
6511acf2 71082011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 7109
0999621a 7110 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
7111
7112 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 7113 (esprintf, exprintf, evxprintf): New functions.
62f19c19 7114 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 7115 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
7116 (modify_event_symbol): Do not assume that the length of
7117 name_alist_or_stem is safe to alloca and fits in int.
7118 (Fexecute_extended_command): Likewise for function name and binding.
7119 (Frecursion_depth): Wrap around reliably on integer overflow.
7120 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
7121 since some callers pass EMACS_INT values.
7122 (Fsingle_key_description): Don't crash if symbol name contains more
7123 than MAX_ALLOCA bytes.
7124 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
7125 (get_minibuffer): Arg is now EMACS_INT, not int.
7126 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 7127 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
7128 * window.h (command_loop_level, minibuf_level): Reflect API changes.
7129
2be7d702
PE
7130 * dbusbind.c (signature_cat): New function.
7131 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
7132 Do not overrun buffer; instead, report string overflow.
7133
9d1df220
PE
7134 * dispnew.c (add_window_display_history): Don't overrun buffer.
7135 Truncate instead; this is OK since it's just a log.
7136
33ef5c64
PE
7137 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
7138 even if the time zone offset is outlandishly large.
7139 Don't mishandle offset == INT_MIN.
7140
66c6fdd5
PE
7141 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
7142 when creating daemon; the previous buffer-overflow check was incorrect.
7143
d749b01b
PE
7144 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
7145 which has the guts of the old verror function.
7146
b5cd1905
PE
7147 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
7148 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
7149
6e1a67fb
PE
7150 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
7151 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 7152 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 7153 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
7154 length of string rather than counting it via multiple sprintfs;
7155 that's simpler and more reliable.
c21721cc
PE
7156 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
7157 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
7158 sprintf, in case result does not fit in int.
7159
c57b67fc
PE
7160 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
7161 (fontset_from_font): Print it.
7162
8a401434
PE
7163 * frame.c (tty_frame_count): Now printmax_t, not int.
7164 (make_terminal_frame, set_term_frame_name): Print it.
7165 (x_report_frame_params): In X, window IDs are unsigned long,
7166 not signed long, so print them as unsigned.
7167 (validate_x_resource_name): Check for implausibly long names,
7168 and don't assume name length fits in 'int'.
7169 (x_get_resource_string): Don't blindly alloca invocation name;
7170 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
7171 not fit in int.
7172
6e1a67fb
PE
7173 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
7174 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
7175 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
7176
0df02bf3
PE
7177 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
7178 Use esprintf, not sprintf, in case result does not fit in int.
7179
48e30793
PE
7180 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
7181 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
7182 it as a large positive number.
7183 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
7184 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
7185
a66ff6d8
PE
7186 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
7187 in case result does not fit in int.
7188
aca216ff
PE
7189 * print.c (float_to_string): Detect width overflow more reliably.
7190 (print_object): Make sprintf buffer a bit bigger, to avoid potential
7191 buffer overrun. Don't assume list length fits in 'int'. Treat
7192 print length of 0 as 0, not as infinity; to be consistent with other
7193 uses of print length in this function. Don't overflow print length
7194 index. Don't assume hash table size fits in 'long', or that
7195 vectorlike size fits in 'unsigned long'.
7196
31c286f7
PE
7197 * process.c (make_process): Use printmax_t, not int, to format
7198 process-name gensyms.
7199
55e5faa1
PE
7200 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
7201
80f2e268
PE
7202 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
7203 to avoid potential buffer overrun.
7204
670741ab
PE
7205 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
7206 if X resource line is longer than 512 bytes.
7207
b7163a50
PE
7208 * xfns.c (x_window): Make sprintf buffer a bit bigger
7209 to avoid potential buffer overrun.
7210
ae58ff1f
PE
7211 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
7212
c43c8a6a
PE
7213 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
7214
3f8236f4
PE
72152011-09-04 Paul Eggert <eggert@cs.ucla.edu>
7216
53e9fe90 7217 Integer overflow fixes for scrolling, etc.
6511acf2
PE
7218 Without these, Emacs silently mishandles large integers sometimes.
7219 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
7220 it were "C-u 1 M-x recenter" on a typical 64-bit host.
7221
6511acf2
PE
7222 * xdisp.c (try_window_id): Check Emacs fixnum range before
7223 converting to 'int'.
806add1d 7224
6511acf2 7225 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
7226 Check that an Emacs fixnum is in range before assigning it to 'int'.
7227 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
7228 values converted from Emacs fixnums.
7229 (Frecenter): Don't wrap around a line count if it is out of 'int'
7230 range; instead, treat it as an extreme value.
7231 (Fset_window_configuration, compare_window_configurations):
7232 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
7233
6511acf2
PE
7234 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
7235 that can exceed INT_MAX. Check that EMACS_INT value is in range
7236 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
7237 (match_limit): Don't assume that a fixnum can fit in 'int'.
7238
6511acf2 7239 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
7240 exceed INT_MAX.
7241
6511acf2 7242 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
7243 (Fvertical_motion): Don't wrap around LINES values that don't fit
7244 in 'int'. Instead, treat them as extreme values. This is good
7245 enough for windows, which can't have more than INT_MAX lines anyway.
7246
fcb901a7
LMI
72472011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
7248
0f2f6b6d
LMI
7249 * Require libxml/parser.h to avoid compilation warning.
7250
fcb901a7
LMI
7251 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
7252
7253 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
7254 since this reportedly can destroy thread storage.
7255
6e20a0d4
CY
72562011-08-30 Chong Yidong <cyd@stupidchicken.com>
7257
7258 * syntax.c (find_defun_start): Update all cache variables if
7259 exiting early (Bug#9401).
7260
148ae00e
EZ
72612011-08-30 Eli Zaretskii <eliz@gnu.org>
7262
f6cfbd8f
EZ
7263 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
7264
148ae00e
EZ
7265 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
7266 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
7267 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
7268
7269 * term.c (tty_append_glyph): New function.
7270 (produce_stretch_glyph): Static function and its prototype deleted.
7271
a66cfb1c
SM
7272 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
7273 Add prototypes.
148ae00e 7274
c4a07a4c
PE
72752011-08-29 Paul Eggert <eggert@cs.ucla.edu>
7276
7277 * image.c (parse_image_spec): Check for nonnegative, not for positive,
7278 when checking :margin (Bug#9390).
7279 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 7280 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
7281 so that the name doesn't mislead. All uses changed.
7282
6bc8cd65
JB
72832011-08-28 Johan Bockgård <bojohan@gnu.org>
7284
7285 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
7286 set_tty_hooks.
7287
dca4927e
EZ
72882011-08-27 Eli Zaretskii <eliz@gnu.org>
7289
7290 * xdisp.c (move_it_to): Don't bail out early when reaching
7291 position beyond to_charpos, if we are scanning backwards.
7292 (move_it_vertically_backward): When DY == 0, make sure we get to
7293 the first character in the line after the newline.
7294
f2cad773
PE
72952011-08-27 Paul Eggert <eggert@cs.ucla.edu>
7296
7297 * ccl.c: Improve and simplify overflow checking (Bug#9196).
7298 (ccl_driver): Do not generate an out-of-range pointer.
7299 (Fccl_execute_on_string): Remove unnecessary check for
7300 integer overflow, noted by Stefan Monnier in
7301 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
7302 Remove a FIXME that didn't need fixing.
7303 Simplify the newly-introduced buffer reallocation code.
7304
0cae2cdb
JB
73052011-08-27 Juanma Barranquero <lekktu@gmail.com>
7306
7307 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
7308
5fc295a4 73092011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 7310
70c60eb2 7311 Integer and memory overflow issues (Bug#9196).
726e0ab1 7312
d31850da
PE
7313 * doc.c (get_doc_string): Rework so that
7314 get_doc_string_buffer_size is the actual buffer size, rather than
7315 being 1 less than the actual buffer size; this makes xpalloc more
7316 convenient.
7317
a69fbedb
PE
7318 * image.c (x_allocate_bitmap_record, cache_image):
7319 * xselect.c (Fx_register_dnd_atom):
7320 Simplify previous changes by using xpalloc.
7321
fe5c5d37
PE
7322 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
7323 since either will do and ptrdiff_t is convenient with xpalloc.
7324
0065d054
PE
7325 * charset.c (charset_table_size)
7326 (struct charset_sort_data.priority): Now ptrdiff_t.
7327 (charset_compare): Don't overflow if priorities differ greatly.
7328 (Fsort_charsets): Don't assume list length fits in int.
7329 Check for size-calculation overflow when allocating sort data.
7330 (syms_of_charset): Allocate an initial charset table that is
7331 just under 64 KiB, to avoid problems with glibc malloc and mmap.
7332
7333 * cmds.c (internal_self_insert): Check for size-calculation overflow.
7334
7335 * composite.h (struct composition.glyph_len): Now int, not unsigned.
7336 The actual value is always <= INT_MAX, and leaving it unsigned made
7337 overflow checking harder.
7338
7339 * dispextern.h (struct glyph_matrix.rows_allocated)
7340 (struct face_cache.size): Now ptrdiff_t, for convenience in use
7341 with xpalloc. The values are still always <= INT_MAX.
7342
7343 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
7344
7345 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
7346 (SAFE_NALLOCA): New macro.
7347
7348 * region-cache.c (struct boundary.pos, find_cache_boundary)
7349 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
7350 (set_cache_region, invalidate_region_cache)
7351 (revalidate_region_cache, know_region_cache, region_cache_forward)
7352 (region_cache_backward, pp_cache):
7353 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
7354 so that ptrdiff_t * can be passed to xpalloc.
7355 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
7356 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
7357 (pp_cache): Don't assume cache_len fits in int.
7358 * region-cache.h: Adjust extern decls to match.
7359
7360 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
7361 EMACS_INT, since either will do, for xpalloc.
7362
7363 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
7364 (xnmalloc, xnrealloc, xpalloc): New functions.
7365
726e0ab1
PE
7366 * bidi.c (bidi_shelve_header_size): New constant.
7367 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
7368 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
7369
51f30bc5 7370 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
7371 * buffer.c (overlays_at, overlays_in, record_overlay_string)
7372 (overlay_strings):
7373 Don't update size of array until after memory allocation succeeds,
7374 because xmalloc/xrealloc may not return.
0065d054
PE
7375 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
7376 now that we have proper integer overflow checking.
7377 (record_overlay_string, overlay_strings): Catch overflows when
7378 calculating size of overlay_str_buf.
726e0ab1 7379
0065d054
PE
7380 * callproc.c (Fcall_process): Check for size overflow when
7381 calculating size of args2.
7382 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
7383 Normally we prefer signed values, but sticking with ptrdiff_t would
7384 require adding more-complicated checks.
726e0ab1
PE
7385
7386 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
7387 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
7388 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 7389 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
7390
7391 * character.c (Fstring): Check for size-calculation overflow.
7392
7393 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
7394 unnecessary integer overflow. Check for size overflow.
7395 (encode_coding_object): Don't update size until xmalloc succeeds.
7396
7397 * composite.c (get_composition_id): Check for overflow in glyph
7398 length calculations.
7399
7400 Integer and memory overflow fixes for display code.
7401 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
7402 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
7403 (scrolling_window): Check for overflow in size calculations.
7404 (line_draw_cost, realloc_glyph_pool, add_row_entry):
7405 Don't assume glyph table len fits in int.
7406 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
7407 (row_table_size): Now ptrdiff_t, not int.
7408 (scrolling_window): Avoid overflow in size calculations.
7409 Don't update size until allocation succeeds.
7410 * fns.c (concat): Check for overflow in size calculations.
7411 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
7412 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
7413 (NEXT_ALMOST_PRIME_LIMIT): New constant.
7414
7415 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
7416 (get_doc_string): Check for size calculation overflow.
7417 Don't update size until allocation succeeds.
7418 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
7419 EMACS_INT, where ptrdiff_t will do.
7420 (Fsubstitute_command_keys): Check for string overflow.
7421
7422 * editfns.c (set_time_zone_rule): Don't assume environment length
7423 fits in int.
7424 (message_length): Now ptrdiff_t, not int.
7425 (Fmessage_box): Don't update size until allocation succeeds.
7426 Don't assume message length fits in int.
7427 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
7428
0065d054
PE
7429 * emacs.c (main): Do not reallocate argv, since there is a null at
7430 the end that can be overwritten, and this way there's no need to
7431 worry about size-calculation overflow.
7432 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
7433
7434 * eval.c (init_eval_once, grow_specpdl): Don't update size until
7435 alloc succeeds.
7436 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
7437
7438 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
7439 (x_set_scroll_bar_width, x_figure_window_size):
7440 Check for integer overflow.
7441 (x_set_alpha): Do not assume XINT fits in int.
7442
7443 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
7444 This is for the members text_lines, text_cols, total_lines, total_cols,
7445 where the system imposes an 'int' limit.
7446
7447 * fringe.c (Fdefine_fringe_bitmap):
7448 Don't update size until alloc works.
7449
7450 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
7451 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
7452
7453 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
7454 Check for size-calculation overflow.
7455 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
7456 do, as we prefer signed integers.
7457 (id_to_widget.max_size, id_to_widget.used)
7458 (xg_store_widget_in_map, xg_remove_widget_from_map)
7459 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
7460 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
7461 Use and return ptrdiff_t, not int.
7462 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
7463 * gtkutil.h: Change prototypes to match the above.
7464
7465 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
7466 are duplicate now that they've been promoted to lisp.h.
7467 (x_allocate_bitmap_record, x_alloc_image_color)
7468 (make_image_cache, cache_image, xpm_load):
7469 Don't update size until alloc is done.
7470 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
7471 (x_detect_edges):
3256efce 7472 Check for size calculation overflow.
726e0ab1
PE
7473 (ct_colors_allocated_max): New constant.
7474 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
7475 overflow.
3256efce 7476
726e0ab1
PE
7477 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
7478 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
7479 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
7480 Use ptrdiff_t, not int, to count maps.
7481 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
7482 calculations. Don't update size until allocation succeeds.
7483 Redo calculations to avoid overflow.
726e0ab1
PE
7484 * keyboard.h: Change prototypes to match the above.
7485
7486 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
7487 to count maps.
7488 (current_minor_maps): Check for size calculation overflow.
7489 * keymap.h: Change prototypes to match the above.
7490
7491 * lread.c (read1, init_obarray): Don't update size until alloc done.
7492
7493 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
7494 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
7495
726e0ab1
PE
7496 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
7497 Now ptrdiff_t, not int.
7498 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
7499 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
7500
7501 * process.c (Fnetwork_interface_list): Check for overflow
7502 in size calculation.
7503
7504 * region-cache.c (move_cache_gap): Check for size calculation overflow.
7505
7506 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
7507 overflow. Don't bother calling xmalloc when xrealloc will do.
7508
7509 * search.c (Freplace_match): Check for size calculation overflow.
7510 (Fset_match_data): Don't assume list lengths fit in 'int'.
7511
7512 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
7513 for command line length. Do not attempt to address one before the
7514 beginning of an array, as that's not portable.
7515
7516 * term.c (max_frame_lines): Remove; unused.
7517 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
7518 not int.
7519 (encode_terminal_code, calculate_costs): Check for size
7520 calculation overflow.
7521 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
7522 table lengths and related sizes. Don't update size until alloc
7523 done. Redo calculations to avoid overflow.
7524 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
7525
7526 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
7527 subtracting pointers.
7528 (gobble_line): Check for overflow more carefully. Don't update size
7529 until alloc done.
7530
7531 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
7532 Don't update size until alloc done.
7533 Redo size calculations to avoid overflow.
7534 Check for size calculation overflow.
0065d054 7535 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
7536
7537 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
7538 Use ptrdiff_t, not int, for sizes.
7539 (store_mode_line_noprop_char): Don't update size until alloc done.
7540
0065d054
PE
7541 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
7542 Use ptrdiff_t, not int, for sizes.
7543 (Finternal_make_lisp_face, cache_face):
7544 Check for size calculation overflow.
7545 (cache_face): Treat size calculation overflows as if they were
7546 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
7547
7548 * xfns.c (x_encode_text, x_set_name_internal)
7549 (Fx_change_window_property): Use ptrdiff_t, not int, to count
7550 sizes, since they can exceed INT_MAX in size. Check for size
7551 calculation overflow.
7552
0065d054
PE
7553 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
7554 (xg_select): Check for size calculation overflow.
726e0ab1
PE
7555 Don't update size until alloc done.
7556
0065d054 7557 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 7558 as sprintf is limited to int lengths.
1d526e2f 7559
252c5ee1
PE
7560 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
7561 (X_LONG_MIN): New macros.
864d7ce7
PE
7562 Use them to make the following changes clearer.
7563 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
7564 This change doesn't affect the value now, but it may help remind
7565 future maintainers not to raise the value too much later.
7566 (SELECTION_QUANTUM): Remove, replacing with ...
7567 (selection_quantum): ... new function, which avoids overflow.
7568 All uses changed.
7569 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
7570 assumption that selection length fits in 'int'.
7571 (x_reply_selection_request, x_handle_selection_request)
7572 (x_get_window_property, receive_incremental_selection)
7573 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
7574 (lisp_data_to_selection_data, clean_local_selection_data):
7575 Use ptrdiff_t, not int, to record length of selection.
7576 (x_reply_selection_request, x_get_window_property)
7577 (receive_incremental_selection, x_property_data_to_lisp):
7578 Redo calculations to avoid overflow.
7579 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 7580 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
7581 something.
7582 (x_get_window_property, receive_incremental_selection)
7583 (lisp_data_to_selection_data, x_property_data_to_lisp):
7584 Check for size-calculation overflow.
7585 (x_get_window_property, receive_incremental_selection)
7586 (lisp_data_to_selection_data, Fx_register_dnd_atom):
7587 Don't store size until memory allocation succeeds.
7588 (x_get_window_property): Plug memory leak on memory exhaustion.
7589 Don't double-block input; malloc is safe here. Don't assume 2**34
7590 - 4 fits in unsigned long. Add an xassert to check
7591 XGetWindowProperty overflow. Be more careful about overflow
7592 calculations, and distinguish size from memory overflow better.
7593 (receive_incremental_selection): When tracing, don't assume
7594 unsigned int is less than INT_MAX.
7595 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
7596 harmful) conversions of unsigned short to int.
7597 (lisp_data_to_selection_data): Don't assume that integers
7598 in the range -65535 through -1 fit in an X unsigned short.
7599 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
7600 result parameters unless successful. Rely on cons_to_unsigned
7601 to report problems with elements; the old code wasn't right anyway.
7602 (x_check_property_data): Check for int overflow; we cannot use
7603 a wider type due to X limits.
7604 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
7605
726e0ab1 7606 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 7607
0065d054
PE
7608 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
7609 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
7610 (x_color_cells): Don't store size until memory allocation succeeds.
7611 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 7612 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
7613 (x_term_init): Don't assume length fits in int (sprintf is limited
7614 to int size).
bc18e09d 7615
ebfa62c0
PE
7616 Use ptrdiff_t for composition IDs.
7617 * character.c (lisp_string_width):
7618 * composite.c (composition_table_size, n_compositions)
7619 (get_composition_id, composition_gstring_from_id):
7620 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
7621 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
7622 * window.c (Frecenter):
7623 Use ptrdiff_t, not int, for composition IDs.
7624 * composite.c (get_composition_id): Check for integer overflow.
7625 * composite.h: Adjust prototypes to match the above changes.
7626
d3411f89
PE
7627 Use ptrdiff_t for hash table indexes.
7628 * category.c (hash_get_category_set):
7629 * ccl.c (ccl_driver):
7630 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
7631 * coding.c (coding_system_charset_list, detect_coding_system):
7632 * coding.h (struct coding_system.id):
7633 * composite.c (get_composition_id, gstring_lookup_cache):
7634 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
7635 * image.c (xpm_get_color_table_h):
7636 * lisp.h (hash_lookup, hash_put):
7637 * minibuf.c (Ftest_completion):
7638 Use ptrdiff_t for hash table indexes, not int (which is too
7639 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
7640 32-bit --with-wide-int hosts).
7641
e097a6fa
PE
7642 * charset.c (Fdefine_charset_internal): Check for integer overflow.
7643 Add a FIXME comment about memory leaks.
7644 (syms_of_charset): Don't assume xmalloc returns.
7645
5637687f
PE
7646 Don't assume that stated character widths fit in int.
7647 * character.c (Fchar_width, c_string_width, lisp_string_width):
7648 * character.h (CHAR_WIDTH):
7649 * indent.c (MULTIBYTE_BYTES_WIDTH):
7650 Use sanitize_char_width to avoid undefined and/or bad behavior
7651 with outlandish widths.
a66cfb1c 7652 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
7653 now that we have two such functions. All uses changed.
7654 (sanitize_char_width): New inline function.
7655
a2271ba2
PE
7656 Don't assume that tab-width fits in int.
7657 * character.h (sanitize_width): New inline function.
7658 (SANE_TAB_WIDTH): New macro.
7659 (ASCII_CHAR_WIDTH): Use it.
7660 * indent.c (sane_tab_width): Remove. All uses replaced by
7661 SANE_TAB_WIDTH (current_buffer).
7662 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
7663
18c52557
PE
7664 * fileio.c: Integer overflow issues with file modes.
7665 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
7666
caeeedc1
PE
7667 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
7668 Remove unreachable code.
7669 (read_hex, load_charset_map_from_file): Check for integer overflow.
7670
6df6ae42 7671 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
7672 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
7673 (x_send_scroll_bar_event): Likewise. Check that the size does not
7674 exceed limits imposed by XClientMessageEvent, as well as the usual
7675 ptrdiff_t and size_t limits.
7676
b13995db
PE
7677 * keyboard.c: Overflow, signedness and related fixes.
7678 (make_lispy_movement): Use same integer type in forward decl
7679 that is used in the definition.
7680 (read_key_sequence, keyremap_step):
7681 Change bufsize argument back to int, undoing my 2011-03-30 change.
7682 We prefer signed types, and int is wide enough here.
7683 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
7684 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
7685 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
7686 length, not size_t. Use ptrdiff_t for index, not int.
7687 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
7688 possibility of integer overflow.
7689
13464394
PE
7690 Overflow, signedness and related fixes for images.
7691
7692 * dispextern.h (struct it.stack[0].u.image.image_id)
7693 (struct_it.image_id, struct image.id, struct image_cache.size)
7694 (struct image_cache.used, struct image_cache.ref_count):
7695 * gtkutil.c (update_frame_tool_bar):
7696 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
7697 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
7698 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
7699 * nsmenu.m (update_frame_tool_bar):
7700 * xdisp.c (calc_pixel_width_or_height):
7701 * xfns.c (image_cache_refcount):
7702 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
7703 on typical 64-bit hosts.
7704
7705 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
7706 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
7707 Omit unnecessary casts to int.
7708 (parse_image_spec): Check that integers fall into 'int' range
7709 when the callers expect that.
7710 (image_ascent): Redo ascent calculation to avoid int overflow.
7711 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
7712 (lookup_image): Remove unnecessary tests.
7713 (xbm_image_p): Locals are now of int, not EMACS_INT,
7714 since parse_image_check makes sure they fit into int.
7715 (png_load, gif_load, svg_load_image):
7716 Prefer int to unsigned where either will do.
7717 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
7718 old tiff_error_handler and tiff_warning_handler.
7719 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
7720 stack buffer overflows. It uses only the features of vsnprintf
7721 that are common to both POSIX and native Microsoft.
7722 (tiff_error_handler, tiff_warning_handler): Use it.
7723 (tiff_load, gif_load, imagemagick_load_image):
7724 Don't assume :index value fits in 'int'.
7725 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
7726 (imagemagick_load_image): Check that crop parameters fit into
7727 the integer types that MagickCropImage accepts. Don't assume
7728 Vimagemagick_render_type has a nonnegative value. Don't assume
7729 size_t fits in 'long'.
7730 (gs_load): Use printmax_t to print the widest integers possible.
7731 Check for integer overflow when computing image height and width.
7732
c11821d4
EZ
77332011-08-26 Eli Zaretskii <eliz@gnu.org>
7734
7735 * xdisp.c (redisplay_window): Don't force window start if point
7736 will be invisible in the resulting window. (Bug#9324)
7737
0c95fcf7
EZ
77382011-08-25 Eli Zaretskii <eliz@gnu.org>
7739
7740 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
7741 the display spec is of the form `(space ...)'.
7742 (handle_display_spec): Return the value returned by
7743 handle_single_display_spec, not just 1 or zero.
7744 (handle_single_display_spec): If the display spec is of the form
7745 `(space ...)', and specifies display in the text area, return 2
7746 rather than 1.
fee65a97 7747 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
7748 accurately, and prefer exact match for point under bidi.
7749 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
7750
7751 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
7752 into disp_prop; all users changed.
7753
7754 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
7755 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
7756 for the text covered by the display property.
7757
e4ed06f1
CY
77582011-08-25 Chong Yidong <cyd@stupidchicken.com>
7759
7760 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
7761 Change return value to nil.
7762 (Frecord_buffer): Delete unused function.
7763
f67cdd7f
EZ
77642011-08-24 Eli Zaretskii <eliz@gnu.org>
7765
5980d4c6
EZ
7766 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
7767 buffers, return left-to-right.
8610fe8b
EZ
7768 (set_cursor_from_row): Consider candidate row a win if its glyph
7769 represents a newline and point is on that newline. Fixes cursor
7770 positioning on the newline at EOL of R2L text within L2R
7771 paragraph, and vice versa.
7772 (try_cursor_movement): Check continued rows, in addition to
7773 continuation rows. Fixes unwarranted scroll when point enters a
7774 continued line of R2L text within an L2R paragraph, or vice versa.
7775 (cursor_row_p): Consider the case of point being equal to
7776 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
7777 from the end of a short line to the beginning of a continued line
7778 of R2L text within L2R paragraph.
7779 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
7780 composed characters.
5980d4c6 7781
f67cdd7f
EZ
7782 * bidi.c (bidi_check_type): Use xassert.
7783 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
7784 members.
7785
bca633fb
EZ
77862011-08-23 Eli Zaretskii <eliz@gnu.org>
7787
7788 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
7789 a character.
7790
4a5885a7
CY
77912011-08-23 Chong Yidong <cyd@stupidchicken.com>
7792
7793 * nsfont.m (ns_otf_to_script): Fix typo.
7794
0902a04e
KH
77952011-08-22 Kenichi Handa <handa@m17n.org>
7796
7797 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
7798 extra slot even if the purpose is char-code-property-table.
7799
1a2e6670
EZ
78002011-08-23 Eli Zaretskii <eliz@gnu.org>
7801
8ddde651
EZ
7802 * xdisp.c (redisplay_window): When computing centering_position,
7803 account for the height of the header line. (Bug#8874)
7804
425cc014
EZ
7805 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
7806 instead of CHAR_TO_BYTE. Fixes a crash when a completion
7807 candidate is selected by the mouse, and that candidate has a
7808 composed character under the mouse.
7809
1a2e6670
EZ
7810 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
7811 coordinates reported by pos-visible-in-window-p for a composed
7812 character in column zero.
7813
8b76d6f8
SM
78142011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
7815
7816 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
7817
dac347dd
EZ
78182011-08-22 Eli Zaretskii <eliz@gnu.org>
7819
7820 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
7821 consider it a hit if to_charpos is anywhere in the range of the
7822 composed buffer positions.
7823
e013fb34
CY
78242011-08-22 Chong Yidong <cyd@stupidchicken.com>
7825
7826 * image.c (gif_load): Don't assume that each subimage has the same
7827 dimensions as the base image. Handle disposal method that is
7828 "undefined" by the gif spec (Bug#9335).
7829
bd1ba3e8
CY
78302011-08-20 Chong Yidong <cyd@stupidchicken.com>
7831
7832 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 7833 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 7834
54a1215b
EZ
78352011-08-19 Eli Zaretskii <eliz@gnu.org>
7836
823564e5
EZ
7837 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
7838 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
7839 from an Org mode buffer to a Speedbar frame.
7840
54a1215b
EZ
7841 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
7842 a composition, take its buffer position from IT->cmp_it.charpos.
7843 Fixes cursor positioning at the beginning of a line that begins
7844 with a composed character.
7845
9778ebcc
EZ
78462011-08-18 Eli Zaretskii <eliz@gnu.org>
7847
0be6ee06
EZ
7848 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
7849 character bidirectional type, use STRONG_L instead. Fixes crashes
7850 in a buffer produced by `describe-categories'.
7851
9778ebcc
EZ
7852 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
7853 members before the level stack, so they would be saved and
7854 restored when copying iterator state. Fixes incorrect reordering
7855 around TABs covered by display properties.
7856
156bffbe
AS
78572011-08-18 Andreas Schwab <schwab@linux-m68k.org>
7858
6b02f655 7859 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 7860
72ad093b
CY
78612011-08-17 Chong Yidong <cyd@stupidchicken.com>
7862
7863 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
7864 (internal_condition_case_2, internal_condition_case_n):
7865 Remove unnecessary aborts (Bug#9081).
72ad093b 7866
35774242
EZ
78672011-08-17 Eli Zaretskii <eliz@gnu.org>
7868
7869 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
7870 has no `load' handler, try opening the file locally. (Bug#9311)
7871
db76dd85
KB
78722011-08-16 Ken Brown <kbrown@cornell.edu>
7873
7874 * gmalloc.c: Expand comment.
7875
b215eee5
EZ
78762011-08-16 Eli Zaretskii <eliz@gnu.org>
7877
7878 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
7879 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
7880
a4579d33
KB
78812011-08-16 Ken Brown <kbrown@cornell.edu>
7882
7883 Fix memory allocation problems in Cygwin build (Bug#9273).
7884
7885 * unexcw.c ( __malloc_initialized): Declare external variable.
7886 (fixup_executable): Force the dumped emacs to reinitialize malloc.
7887
8b76d6f8
SM
7888 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
7889 New variables.
a4579d33
KB
7890 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
7891 dumped emacs.
7892 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
7893 in the static heap.
7894 [CYGWIN] (special_realloc): New function.
7895 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
7896 requests to realloc storage in the static heap.
7897
3ebec551
PE
78982011-08-15 Paul Eggert <eggert@cs.ucla.edu>
7899
7900 * bidi.c (bidi_initialize): Remove unused local.
7901
9fd8be00
EZ
79022011-08-15 Eli Zaretskii <eliz@gnu.org>
7903
6b02f655
SM
7904 * bidimirror.h:
7905 * biditype.h: Remove file.
7906 * makefile.w32-in ($(BLD)/bidi.$(O)):
7907 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
7908
7909 * dispextern.h: Fix a typo in the comment to bidi_type_t.
7910
7911 * chartab.c: Improve commentary for the uniprop_table API.
7912
32413314
EZ
7913 * bidi.c (bidi_paragraph_init): Support zero value of
7914 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
7915 (bidi_initialize): Use uniprop_table instead of including
7916 biditype.h and bidimirror.h.
32413314 7917
9fd8be00
EZ
7918 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
7919 coordinates of the iterator when restoring from ppos_it.
7920 (Bug#9296)
7921
5cf2b69b
KH
79222011-08-14 Kenichi Handa <handa@m17n.org>
7923
7924 * process.c (create_process): Call setup_process_coding_systems
72ad093b 7925 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 7926
daf17d00
EZ
79272011-08-14 Eli Zaretskii <eliz@gnu.org>
7928
7929 * xdisp.c (move_it_in_display_line_to): Don't invoke
7930 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
7931 ppos_it. Fixes vertical cursor motion when line beginning is
7932 covered by an image. (Bug#9296)
7933
08e3161a
JD
79342011-08-14 Jan Djärv <jan.h.d@swipnet.se>
7935
7936 * nsterm.h (ns_run_ascript): Declare.
7937 (NSAPP_DATA2_RUNASSCRIPT): Define.
7938
7939 * nsfns.m (as_script, as_result, as_status): New static variables.
7940 (ns_run_ascript): New function.
5e617bc2 7941 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
7942 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
7943 the event loop. Get status from as_status (Bug#7276).
7944
7945 * nsterm.m (sendEvent): If event is NSApplicationDefined and
7946 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
7947 the event loop (Bug#7276).
7948
a3720aa2
AS
79492011-08-14 Andreas Schwab <schwab@linux-m68k.org>
7950
7951 * gnutls.c (QCgnutls_bootprop_priority)
7952 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
7953 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
7954 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
7955 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
7956 (QCgnutls_bootprop_verify_hostname_error)
7957 (QCgnutls_bootprop_callbacks_verify): Rename from
7958 Qgnutls_bootprop_..., all uses changed.
7959
7960 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
7961 uses changed.
7962
0a0d27fb
PE
79632011-08-14 Paul Eggert <eggert@cs.ucla.edu>
7964
19d5c50c
PE
7965 * xfaces.c (Qframe_set_background_mode): Now static.
7966 * dispextern.h (Qframe_set_background_mode): Remove decl.
7967
0a0d27fb
PE
7968 * process.c (Fnetwork_interface_info): Declare local only if needed.
7969
377538cb
JD
79702011-08-13 Jan Djärv <jan.h.d@swipnet.se>
7971
7972 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
7973 (Fnetwork_interface_list): Allocate in increments of bytes instead
7974 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
7975 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
7976 sockaddr.
7977 (struct ifflag_def): notrailers is smart on OSX.
7978 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
7979 Get hardware address with getifaddrs if available.
7980
08fff70c
EZ
79812011-08-12 Eli Zaretskii <eliz@gnu.org>
7982
7983 * xdisp.c (iterate_out_of_display_property): xassert that
7984 IT->position is set to within IT->object's boundaries. Break from
7985 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
7986 when IT->position is set up wrongly due to some bug.
7987 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
7988 (push_display_prop): Allow GET_FROM_STRING as IT->method on
7989 entry. Force push_it to save on the stack the current
7990 buffer/string position, to be restored by pop_it. Fix flags in
7991 the iterator structure wrt the object coming from a display
7992 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
7993 properties. (Bug#9284)
7994
7be1c708 79952011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 7996
7be1c708
CY
7997 * fontset.c (fontset_get_font_group): Add proper type checks.
7998 (Bug#9172)
aac0c6e3 7999
7be1c708 80002011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 8001
7be1c708
CY
8002 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
8003 and LC_VERSION_MIN_MACOSX.
8004 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
8005 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 8006
97bb72a6
EZ
80072011-08-08 Eli Zaretskii <eliz@gnu.org>
8008
8009 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
8010 no-display-properties-and-no-overlays under bidi display.
8011 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 8012 properties and overlays.
97bb72a6 8013
d5617611
CY
80142011-08-08 Chong Yidong <cyd@stupidchicken.com>
8015
37e11a63
CY
8016 * editfns.c (Fset_time_zone_rule): Document relationship with the
8017 setenv function.
8018
d5617611
CY
8019 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
8020 the font entity extracted from the cache (Bug#8109).
8021
58872834
CY
80222011-08-07 Chong Yidong <cyd@stupidchicken.com>
8023
8024 * composite.c (autocmp_chars): Don't reset point. That is done by
8025 restore_point_unwind (Bug#5984).
8026
75bfc667
JL
80272011-08-07 Juri Linkov <juri@jurta.org>
8028
8029 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
8030 to show the arg `TIME' instead of `TIMEVAL'.
8031
d1410150
EZ
80322011-08-06 Eli Zaretskii <eliz@gnu.org>
8033
8034 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
8035 display property strides EOL and includes a newline, as in
8036 longlines-mode. (Bug#9254)
75b771e4
EZ
8037 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
8038 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
8039
8040 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
8041 is non-zero, even if the data buffer is NULL. Fixes a crash in
8042 vertical-motion with longlines-mode. (Bug#9254)
8043
35928349
EZ
80442011-08-05 Eli Zaretskii <eliz@gnu.org>
8045
ec7cc85b
EZ
8046 * bidi.c <bidi_cache_total_alloc>: Now static.
8047 (bidi_initialize): Initialize bidi_cache_total_alloc.
8048
8b76d6f8 8049 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
8050 cache. (Bug#9221)
8051
8052 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
8053 amount allocated this far in `bidi_cache_total_alloc'.
8054 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
8055 non-zero, only free the data buffer without restoring the cache
8056 contents. All callers changed.
8057
8058 * dispextern.h (bidi_unshelve_cache): Update prototype.
8059
8060 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
8061 (move_it_in_display_line, move_it_to)
8062 (move_it_vertically_backward, move_it_by_lines): Replace the call
8063 to xfree to an equivalent call to bidi_unshelve_cache.
8064 (move_it_in_display_line_to): Fix logic of returning
412b6358 8065 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 8066
e2e2423b
EZ
80672011-08-05 Eli Zaretskii <eliz@gnu.org>
8068
8069 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
8070 came from a string character with a `cursor' property. (Bug#9229)
8071
ae9e757a
JD
80722011-08-04 Jan Djärv <jan.h.d@swipnet.se>
8073
8074 * Makefile.in (LIB_PTHREAD): New variable.
8075 (LIBES): Add LIB_PTHREAD (Bug#9216).
8076
8077 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
8078 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
8079
213bd7f2
AS
80802011-08-04 Andreas Schwab <schwab@linux-m68k.org>
8081
6b02f655 8082 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 8083
99aaf75f
JD
80842011-08-04 Jan Djärv <jan.h.d@swipnet.se>
8085
8086 * xterm.c (x_find_topmost_parent): New function.
8087 (x_set_frame_alpha): Find topmost parent window with
8088 x_find_topmost_parent and set the property there also (bug#9181).
8089 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
8090
c74e9d86
PE
80912011-08-04 Paul Eggert <eggert@cs.ucla.edu>
8092
8093 * callproc.c (Fcall_process): Avoid vfork clobbering
8094 the local vars buffer, coding_systems, current_dir.
8095
640c8776
SM
80962011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
8097
8098 * keymap.c (Fmake_composed_keymap): Move to subr.el.
8099
f26d0e4c
PE
81002011-08-03 Paul Eggert <eggert@cs.ucla.edu>
8101
8a10d76c
PE
8102 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
8103 so that it is not optimized away.
8104
f26d0e4c
PE
8105 * xdisp.c (compute_display_string_pos): Remove unused local.
8106
55439c61
EZ
81072011-08-02 Eli Zaretskii <eliz@gnu.org>
8108
8109 Fix slow cursor motion and scrolling in large buffers with
8110 selective display, like Org Mode buffers. (Bug#9218)
8111
8112 * dispextern.h (struct bidi_it): New member disp_prop_p.
8113
8114 * xdisp.c: Remove one-slot cache of display string positions.
8115 (compute_display_string_pos): Accept an additional argument
5e617bc2 8116 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
8117 for a display string or property. If found, set DISP_PROP_P
8118 non-zero.
8119
8120 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
8121 DISP_PROP_P, and pass it to compute_display_string_pos.
8122 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
8123 non-zero. All callers of bidi_fetch_char changed.
8124
fb33fa43
SM
81252011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
8126
8127 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
8128
b099e063
DM
81292010-12-03 Don March <don@ohspite.net>
8130
8131 * keymap.c (Fdefine_key): Fix non-prefix key error message when
8132 last character M-[char] is translated to ESC [char] (bug#7541).
8133
5cc7f7af
KH
81342011-08-02 Kenichi Handa <handa@m17n.org>
8135
d0fffa3f 8136 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
8137
8138 * chartab.c (uniprop_table): Make it non-static.
8139
525d5e6e
EZ
81402011-08-01 Eli Zaretskii <eliz@gnu.org>
8141
8142 * xdisp.c (forward_to_next_line_start): Accept additional argument
8143 BIDI_IT_PREV, and store into it the state of the bidi iterator had
8144 on the newline.
8145 (reseat_at_next_visible_line_start): Use the bidi iterator state
8146 returned by forward_to_next_line_start to restore the state of
8147 it->bidi_it after backing up to previous newline. (Bug#9212)
8148
31011111
AS
81492011-07-30 Andreas Schwab <schwab@linux-m68k.org>
8150
8151 * regex.c (re_comp): Protoize.
8152 (re_exec): Fix return type.
8153 (regexec): Fix type of `ret'. (Bug#9203)
8154
476371c4
PE
81552011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8156
e5d76069
PE
8157 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
8158 This is needed if max-image-size is a floating-point number.
8159
9a79b20c
AS
81602011-07-28 Andreas Schwab <schwab@linux-m68k.org>
8161
8162 * print.c (print_object): Print empty symbol as ##.
8163
8164 * lread.c (read1): Read ## as empty symbol.
8165
d8c2fa78
AA
81662011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
8167
8168 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
8169 setting frame foreground color (Bug#9175).
8170 (x_set_background_color): Likewise.
8171
ffe57a7a
AA
8172 * nsmenu.m (-setText): Size tooltip dimensions precisely to
8173 contents (Bug#9176).
8174 (EmacsTooltip -init): Remove bezels and add shadows to
8175 tooltip windows.
8176
bf3492a5
AA
8177 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
8178 or scroll bar (Bug#8470).
8179
d55e9c53
AA
8180 * nsfont.m (nsfont_open): Remove assignment to voffset and
8181 unnecessary vars hshink, expand, hd, full_height, min_height.
8182 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
8183
8184 * nsterm.h (nsfont_info): Remove voffset field.
8185
d8c2fa78 81862011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
8187
8188 Implement strike-through and overline on NextStep (Bug#8863).
8189
8190 * nsfont.m (nsfont_open): Use underline position provided by font,
8191 instead of hard-coded value of 2.
8192 (nsfont_draw): Call ns_draw_text_decoration instead.
8193
8194 * nsterm.h: Add declaration for ns_draw_text_decoration.
8195
8196 * nsterm.m (ns_draw_text_decoration): New function for drawing
8197 underline, overline, and strike-through.
8198 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
8199 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 8200 accommodate underlining, etc.
4843aac3 8201
4cc60b9b
EZ
82022011-07-28 Eli Zaretskii <eliz@gnu.org>
8203
bc7ece87
EZ
8204 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
8205 default.
4cc60b9b 8206
476371c4
PE
82072011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8208
66606eea
PE
8209 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
8210 Without this fix, if a signal arrives just after memory fills up,
8211 'malloc' might be invoked reentrantly.
8212
476371c4
PE
8213 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
8214 In other words, assume that every image size is allowed, on non-X
8215 hosts. This assumption is probably wrong, but it lets Emacs compile.
8216
f3fcc40d
AS
82172011-07-28 Andreas Schwab <schwab@linux-m68k.org>
8218
8219 * regex.c (re_iswctype): Convert return values to boolean.
8220
350c992f
EZ
82212011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
8222
8223 * xdisp.c (compute_display_string_pos): Don't use cached display
8224 string position if the buffer had its restriction changed.
8225 (Bug#9184)
8226
5266b4bb
PE
82272011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8228
8229 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
8230
2573a837 82312011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 8232
41f55ccd 8233 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 8234
39e378da
PE
8235 * bidi.c: Integer size and overflow fixes.
8236 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
8237 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
8238 (bidi_cache_find_level_change, bidi_cache_ensure_space)
8239 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
8240 (bidi_find_other_level_edge):
8241 Use ptrdiff_t instead of EMACS_INT where either will do.
8242 This works better on 32-bit hosts configured --with-wide-int.
8243 (bidi_cache_ensure_space): Check for size-calculation overflow.
8244 Use % rather than repeated addition, for better worst-case speed.
8245 Don't set bidi_cache_size until after xrealloc returns, because it
8246 might not return.
8247 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
8248 (bidi_cache_ensure_space): Also check that the bidi cache size
8249 does not exceed that of the largest Lisp string or buffer. See Eli
8250 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 8251
5e927815
PE
8252 * alloc.c (__malloc_size_t): Remove.
8253 All uses replaced by size_t. See Andreas Schwab's note
8254 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
8255
ca4aa935
PE
8256 * image.c: Improve checking for integer overflow.
8257 (check_image_size): Assume that f is nonnull, since
8258 it is always nonnull in practice. This is one less thing to
8259 worry about when checking for integer overflow later.
8260 (x_check_image_size): New function, which checks for integer
8261 overflow issues inside X.
8262 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
8263 This removes the need for a memory_full check.
8264 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
8265 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
8266 (xbm_read_bitmap_data): Change locals back to 'int', since
8267 their values must fit in 'int'.
8268 (xpm_load_image, png_load, tiff_load):
8269 Invoke x_create_x_image_and_pixmap earlier,
8270 to avoid much needless work if the image is too large.
8271 (tiff_load): Treat overly large images as if
8272 x_create_x_image_and_pixmap failed, not as malloc failures.
8273 (gs_load): Use x_check_image_size.
8274
5f8f9cc2
PE
8275 * gtkutil.c: Omit integer casts.
8276 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
8277 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
8278
5adf60bc
PE
8279 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
8280
c8907a93
PE
8281 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
8282 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
8283 would wrongly return t on a 64-bit host.
8284
e3c25c68
PE
8285 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
8286 The plain *_OVERFLOW macros run afoul of GCC bug 49705
8287 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
8288 and therefore cause GCC to emit a bogus diagnostic in some cases.
8289
3f791afe
PE
8290 * image.c: Integer signedness and overflow and related fixes.
8291 This is not an exhaustive set of fixes, but it's time to
8292 record what I've got.
8293 (lookup_pixel_color, check_image_size): Remove redundant decls.
8294 (check_image_size): Don't assume that arbitrary EMACS_INT values
8295 fit in 'int', or that arbitrary 'double' values fit in 'int'.
8296 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
8297 (tiff_load, imagemagick_load_image):
8298 Check for overflow in size calculations.
8299 (x_create_x_image_and_pixmap): Remove unnecessary test for
8300 xmalloc returning NULL; that can't happen.
8301 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
8302 (xpm_color_bucket): Use better integer hashing function.
8303 (xpm_cache_color): Don't possibly over-allocate memory.
8304 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
8305 (gif_memory_source):
8306 Use ptrdiff_t, not int or size_t, to record sizes.
8307 (png_load): Don't assume values greater than 2**31 fit in 'int'.
8308 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
8309 either works, as we prefer signed integers.
8310 (tiff_read_from_memory, tiff_write_from_memory):
8311 Return tsize_t, not size_t, since that's what the TIFF API wants.
8312 (tiff_read_from_memory): Don't fail simply because the read would
8313 go past EOF; instead, return a short read.
8314 (tiff_load): Omit no-longer-needed casts.
8315 (Fimagemagick_types): Don't assume size fits into 'int'.
8316
3cc5a532
PE
8317 Improve hashing quality when configured --with-wide-int.
8318 * fns.c (hash_string): New function, taken from sxhash_string.
8319 Do not discard information about ASCII character case; this
8320 discarding is no longer needed.
8321 (sxhash-string): Use it. Change sig to match it. Caller changed.
8322 * lisp.h: Declare it.
8323 * lread.c (hash_string): Remove, since we now use fns.c's version.
8324 The fns.c version returns a wider integer if --with-wide-int is
8325 specified, so this should help the quality of the hashing a bit.
8326
b312a492
PE
8327 * emacs.c: Integer overflow minor fix.
8328 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
8329 Define only if GNU_LINUX.
8330 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
8331
dfd153ae
PE
8332 * dispnew.c: Integer signedness and overflow fixes.
8333 Remove unnecessary forward decls, that were a maintenance hassle.
8334 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
8335 All uses changed.
8336 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
8337 (scrolling_window): Use ptrdiff_t, not int, for byte count.
8338 (prepare_desired_row, line_draw_cost):
8339 Use int, not unsigned, where either works.
8340 (save_current_matrix, restore_current_matrix):
8341 Use ptrdiff_t, not size_t, where either works.
8342 (init_display): Check for overflow more accurately, and without
8343 relying on undefined behavior.
8344
a81d11a3
PE
8345 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
8346 Remove, replacing with the new symbols in lisp.h. All uses changed.
8347 * fileio.c (make_temp_name):
8348 * filelock.c (lock_file_1, lock_file):
8349 * xdisp.c (message_dolog):
8350 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
8351 Use pMd etc. instead.
8352 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
8353 replacing the pWIDE etc. symbols removed from editfns.c.
8354
3300e6fd
PE
8355 * keyboard.h (num_input_events): Now uintmax_t.
8356 This is (very slightly) less likely to mess up due to wraparound.
8357 All uses changed.
8358
fd05c7e9
PE
8359 * buffer.c: Integer signedness fixes.
8360 (alloc_buffer_text, enlarge_buffer_text):
8361 Use ptrdiff_t rather than size_t when either will do, as we prefer
8362 signed integers.
8363
903fe15d
PE
8364 * alloc.c: Integer signedness and overflow fixes.
8365 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
8366 (__malloc_size_t): Default to size_t, not to int.
8367 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
8368 (Fgarbage_collect, mark_object_loop_halt, mark_object):
8369 Prefer ptrdiff_t to size_t when either would do, as we prefer
8370 signed integers.
8371 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
8372 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
8373 Now const. Initialize with values that are in range even if char
8374 is signed.
8375 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
8376 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
8377 These functions do the right thing with sizes > 2**32.
8378 (check_depth): Now ptrdiff_t, not int.
8379 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
8380 Adjust to new way of storing sizes. Check for size overflow bugs
8381 in rest of code.
8382 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
8383 slightly wrong anyway, as it missed one instance of
8384 XMALLOC_OVERRUN_CHECK_OVERHEAD.
8385 (refill_memory_reserve): Omit needless cast to size_t.
8386 (mark_object_loop_halt): Mark as externally visible.
8387
ac82cc6a
PE
8388 * xselect.c: Integer signedness and overflow fixes.
8389 (Fx_register_dnd_atom, x_handle_dnd_message):
8390 Use ptrdiff_t, not size_t, since we prefer signed.
8391 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
8392 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
8393 x_dnd_atoms_size and x_dnd_atoms_length.
8394
c2d1e36d
PE
8395 * doprnt.c: Prefer signed to unsigned when either works.
8396 * eval.c (verror):
8397 * doprnt.c (doprnt):
8398 * lisp.h (doprnt):
8399 * xdisp.c (vmessage):
8400 Use ptrdiff_t, not size_t, when using or implementing doprnt,
8401 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
8402 prefer signed arithmetic to avoid comparison confusion.
8403 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
8404 but is a bit tricky.
8405
0e926e56
PE
8406 Assume freestanding C89 headers, string.h, stdlib.h.
8407 * data.c, doprnt.c, floatfns.c, print.c:
8408 Include float.h unconditionally.
8409 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
8410 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
8411 * regex.c: Likewise for stddef.h, string.h.
8412 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
8413 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
8414 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
8415 (STDC_HEADERS): Remove obsolete defines.
8416 * sysdep.c: Include limits.h unconditionally.
8417
9cfdb3ec
PE
8418 Assume support for memcmp, memcpy, memmove, memset.
8419 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
8420 * regex.c (memcmp, memcpy):
8421 Remove; we assume C89 now.
8422
8423 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
8424 (__malloc_safe_bcopy): Remove; no longer needed.
8425
cf950e6b 8426 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
8427 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
8428 well either way, and we prefer signed to unsigned.
8429
dbf38e02
LMI
84302011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
8431
8432 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
8433 closes the connection while we're reading (bug#9182).
8434
d6f0886c 84352011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 8436
d6f0886c
JD
8437 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
8438 are specified (Bug#9168).
24e0f6b1 8439
2eb1f9e6
PE
84402011-07-25 Paul Eggert <eggert@cs.ucla.edu>
8441
8442 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
8443 Found by GCC static checking and --with-wide-int on a 32-bit host.
8444
22381272 84452011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
8446
8447 * xdisp.c (compute_display_string_pos): Fix logic of caching
8448 previous display string position. Initialize cached_prev_pos to
8449 -1. Fixes slow-down at the beginning of a buffer.
8450
f25e39b4
EZ
84512011-07-24 Eli Zaretskii <eliz@gnu.org>
8452
8453 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
8454 for attrs[LFACE_FONTSET_INDEX].
8455
04c4b52e
PE
84562011-07-23 Paul Eggert <eggert@cs.ucla.edu>
8457
8458 * xml.c (parse_region): Remove unused local
8459 that was recently introduced.
8460
c1734fbd
EZ
84612011-07-23 Eli Zaretskii <eliz@gnu.org>
8462
be18c5a5
EZ
8463 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
8464 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
8465
c1734fbd
EZ
8466 * xdisp.c (move_it_in_display_line_to): Record the best matching
8467 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
8468 exit if none of the characters scanned was an exact match.
8469 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
8470 when exact match is impossible due to invisible text, and the
8471 lines are truncated.
8472
a258d627
JD
84732011-07-23 Jan Djärv <jan.h.d@swipnet.se>
8474
8475 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
8476 for OSX >= 10.7.
8477
b6d5a689
EZ
84782011-07-22 Eli Zaretskii <eliz@gnu.org>
8479
0f74f785
EZ
8480 Fix a significant slow-down of cursor motion with C-n, C-p,
8481 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
8482 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 8483 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
8484 (next_element_from_buffer): Call compute_stop_pos_backwards to
8485 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
8486 base_level_stop.
8487 (reseat): Don't look for prev_stop, as that could mean a very long
8488 run.
8489 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
8490 <cached_disp_overlay_modiff>: Cache for last found display string
8491 position.
551918c1 8492 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
8493 about the same buffer in the same area of character positions, and
8494 the buffer wasn't changed since the time the display string
8495 position was cached.
551918c1 8496
b2d0c91a
EZ
84972011-07-22 Eli Zaretskii <eliz@gnu.org>
8498
8499 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
8500 is an integer, which is important for empty lines. (Bug#9149)
8501
043604ee
CY
85022011-07-22 Chong Yidong <cyd@stupidchicken.com>
8503
8504 * frame.c (Fmodify_frame_parameters): In tty case, update the
8505 default face if necessary (Bug#4238).
8506
da4adb04
CY
85072011-07-21 Chong Yidong <cyd@stupidchicken.com>
8508
8509 * editfns.c (Fstring_to_char): No need to explain what a character
8510 is in the docstring (Bug#6576).
8511
9abd0532
LMI
85122011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
8513
8514 * xml.c (parse_region): Make sure we always return a tree.
8515
36881d16
HK
85162011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
8517
8518 * xml.c (parse_region): If a document contains only comments,
8519 return that, too.
8520
1e98674d
LMI
85212011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
8522
8523 * xml.c (make_dom): Return comments, too.
8524
590bd467
PE
85252011-07-19 Paul Eggert <eggert@cs.ucla.edu>
8526
8527 Port to OpenBSD.
8528 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
8529 and the surrounding thread.
8530 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
8531 rather than fgets, and retry after EINTR. Otherwise, 'emacs
8532 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
8533 timer goes off.
8534 * s/openbsd.h (BROKEN_SIGIO): Define.
8535 * unexelf.c (unexec) [__OpenBSD__]:
8536 Don't update the .mdebug section of the Alpha COFF symbol table.
8537
f41628b2
LMI
85382011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
8539
8540 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
8541 (bug#8460).
8542
b59b67c5
PE
85432011-07-18 Paul Eggert <eggert@cs.ucla.edu>
8544
15e3a074
PE
8545 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
8546 This fixes some race conditions on the permissions of any newly
8547 created file.
8548
41bed37d
PE
8549 * alloc.c (valid_pointer_p): Use pipe, not open.
8550 This fixes some permissions issues when debugging.
8551
b59b67c5
PE
8552 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
8553 If fchown fails to set both uid and gid, try to set just gid,
8554 as that is sometimes allowed. Adjust the file's mode to eliminate
8555 setuid or setgid bits that are inappropriate if fchown fails.
8556
925a6be7
SM
85572011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
8558
8559 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
8560 to compare Lisp_Objects.
8561 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
8562 global_gnutls_log_level, don't mistake it for a Lisp_Object.
8563 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
8564
52968808
AS
85652011-07-17 Andreas Schwab <schwab@linux-m68k.org>
8566
0a6a104b
AS
8567 * lread.c (read_integer): Unread even EOF character.
8568 (read1): Likewise. Properly record start position of symbol.
8569
52968808
AS
8570 * lread.c (read1): Read `#:' as empty uninterned symbol if no
8571 symbol character follows.
8572
9e381cdd
PE
85732011-07-17 Paul Eggert <eggert@cs.ucla.edu>
8574
8575 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
8576 This works around a problem with the previous change to Fcopy_file.
8577 Recent glibc declares fchown with __attribute__((warn_unused_result)),
8578 and without this change, GCC might complain about discarding
8579 fchown's return value.
8580
b5641435
JB
85812011-07-16 Juanma Barranquero <lekktu@gmail.com>
8582
8583 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
8584
a8031457
PE
85852011-07-16 Paul Eggert <eggert@cs.ucla.edu>
8586
8587 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
8588
dd889327
LMI
85892011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
8590
750c33f7
LMI
8591 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
8592 it's used from the C level.
8593
dd889327
LMI
8594 * process.c: Use the same condition for POLL_FOR_INPUT in both
8595 keyboard.c and process.c (bug#1858).
8596
87e86684
LM
85972011-07-09 Lawrence Mitchell <wence@gmx.li>
8598
8599 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
8600 (Fgnutls_boot): Use it.
8601
64348f40
AS
86022011-07-15 Andreas Schwab <schwab@linux-m68k.org>
8603
8604 * doc.c (Fsubstitute_command_keys): Revert last change.
8605
1d698799
LMI
86062011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
8607
f863868c
LMI
8608 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
8609 quotes the next character, and doesn't affect other longer
8610 sequences (bug#8935).
8611
1d698799
LMI
8612 * lread.c (syms_of_lread): Clarify that is isn't only
8613 `eval-buffer' and `eval-defun' that's affected by
8614 `lexical-binding' (bug#8460).
8615
aa4b6df6
EZ
86162011-07-15 Eli Zaretskii <eliz@gnu.org>
8617
8618 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 8619 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 8620
5d856da6
PE
86212011-07-14 Paul Eggert <eggert@cs.ucla.edu>
8622
ad6042bb
PE
8623 Fix minor problems found by static checking.
8624 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
8625 (elsz): Now a signed constant, not a size_t var. We prefer signed
8626 types to unsigned, to avoid integer comparison confusion. Without
8627 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
8628 "cannot optimize loop, the loop counter may overflow", a symptom
8629 of the confusion.
f00bbb22 8630 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
8631 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
8632
6468f31c
LMI
86332011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
8634
49080b10
LMI
8635 * search.c (Fre_search_backward): Mention `case-fold-search' in
8636 all the re_search_* functions (bug#8138).
8637
6468f31c
LMI
8638 * keyboard.c (Fopen_dribble_file): Document when the file is
8639 closed (bug#8056).
8640
c965adc5
EZ
86412011-07-14 Eli Zaretskii <eliz@gnu.org>
8642
df9733bf
EZ
8643 * bidi.c (bidi_dump_cached_states): Fix format of displaying
8644 bidi_cache_idx.
8645
0bb23927
EZ
8646 Support bidi reordering of display and overlay strings.
8647 * xdisp.c (compute_display_string_pos)
8648 (compute_display_string_end): Accept additional argument STRING.
8649 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
8650 (reseat_to_string): Initialize bidi_it->string.s and
8651 bidi_it->string.schars.
8652 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
8653 NULL (avoids a crash in bidi_paragraph_init).
8654 Initialize itb.string.lstring.
0bb23927
EZ
8655 (init_iterator): Call bidi_init_it only of a valid
8656 buffer position was specified. Initialize paragraph_embedding to
8657 L2R.
8658 (reseat_to_string): Initialize the bidi iterator.
8659 (display_string): If we need to ignore text properties of
8660 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
8661 original value of -1 will not work with bidi.)
8662 (compute_display_string_pos): First arg is now struct
8663 `text_pos *'; all callers changed. Support display properties on
8664 Lisp strings.
8665 (compute_display_string_end): Support display properties on Lisp
8666 strings.
8667 (init_iterator, reseat_1, reseat_to_string): Initialize the
8668 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
8669 when iterating on a string not from display properties).
640c8776
SM
8670 (compute_display_string_pos, compute_display_string_end):
8671 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
8672 arrow keys.
8673 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
8674 base_level_stop; instead, set base_level_stop to BEGV.
8675 Fixes crashes in vertical-motion.
0bb23927
EZ
8676 (next_element_from_buffer): Improve commentary for when
8677 the iterator is before prev_stop.
8678 (init_iterator): Initialize bidi_p from the default value of
8679 bidi-display-reordering, not from buffer-local value. Use the
8680 buffer-local value only if initializing for buffer iteration.
8681 (handle_invisible_prop): Support invisible properties on strings
8682 that are being bidi-reordered.
8683 (set_iterator_to_next): Support bidi reordering of C strings and
8684 Lisp strings.
8685 (next_element_from_string): Support bidi reordering of Lisp
8686 strings.
8687 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
8688 (display_string): Support display of R2L glyph rows.
8689 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
8690 (init_iterator): Don't initialize it->bidi_p for strings
8691 here.
8692 (reseat_to_string): Initialize it->bidi_p for strings here.
8693 (next_element_from_string, next_element_from_c_string)
8694 (next_element_from_buffer): Add xassert's for correspondence
8695 between IT's object being iterated and it->bidi_it.string
8696 structure.
8697 (face_before_or_after_it_pos): Support bidi iteration.
8698 (next_element_from_c_string): Handle the case of the first string
8699 character that is not the first one in the visual order.
8700 (get_visually_first_element): New function, refactored from common
8701 parts of next_element_from_buffer, next_element_from_string, and
8702 next_element_from_c_string.
8703 (tool_bar_lines_needed, redisplay_tool_bar)
8704 (display_menu_bar): Force left-to-right direction. Add a FIXME
8705 comment for making that be controlled by a user option.
8706 (push_it, pop_it): Save and restore the state of the
8707 bidi iterator. Save and restore the bidi_p flag.
8708 (pop_it): Iterate out of display property for string iteration as
8709 well.
8710 (iterate_out_of_display_property): Support iteration over strings.
8711 (handle_single_display_spec): Set up it->bidi_it for iteration
8712 over a display string, and call bidi_init_it.
8713 (handle_single_display_spec, next_overlay_string)
8714 (get_overlay_strings_1, push_display_prop): Set up the bidi
8715 iterator for displaying display or overlay strings.
8716 (forward_to_next_line_start): Don't use the shortcut if
8717 bidi-iterating.
8718 (back_to_previous_visible_line_start): If handle_display_prop
8719 pushed the iterator stack, restore the internal state of the bidi
8720 iterator by calling bidi_pop_it same number of times.
8721 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
8722 and we are bidi-iterating, don't decrement the iterator position;
8723 instead, set the first_elt flag in the bidi iterator, to produce
8724 the same effect.
8725 (reseat_1): Remove redundant setting of string_from_display_prop_p.
8726 (push_display_prop): xassert that we are iterating a buffer.
8727 (push_it, pop_it): Save and restore paragraph_embedding member.
8728 (handle_single_display_spec, next_overlay_string)
8729 (get_overlay_strings_1, reseat_1, reseat_to_string)
8730 (push_display_prop): Set up the `unibyte' member of bidi_it.string
8731 correctly. Don't assume unibyte strings are not bidi-reordered.
8732 (compute_display_string_pos)
8733 (compute_display_string_end): Fix handling the case of C string.
8734 (push_it, pop_it): Save and restore from_disp_prop_p.
8735 (handle_single_display_spec, push_display_prop): Set the
8736 from_disp_prop_p flag.
8737 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
8738 (pop_it): Call iterate_out_of_display_property only if we are
8739 popping after iteration over a string that came from a display
8740 property. Fix a typo in popping stretch info. Add an assertion
8741 for verifying that the iterator position is in sync with the bidi
8742 iterator.
8743 (handle_single_display_spec, get_overlay_strings_1)
8744 (push_display_prop): Fix initialization of paragraph direction for
8745 string when that of the parent object is not yet determined.
8746 (reseat_1): Call bidi_init_it to resync the bidi
8747 iterator with IT's position. (Bug#7616)
8748 (find_row_edges): If ROW->start.pos gives position
8749 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
8750 (handle_stop, back_to_previous_visible_line_start, reseat_1):
8751 Reset the from_disp_prop_p flag.
8752 (SAVE_IT, RESTORE_IT): New macros.
8753 (pos_visible_p, face_before_or_after_it_pos)
8754 (back_to_previous_visible_line_start)
8755 (move_it_in_display_line_to, move_it_in_display_line)
8756 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8757 (try_scrolling, redisplay_window, display_line): Use them when
8758 saving a temporary copy of the iterator and restoring it back.
8759 (back_to_previous_visible_line_start, reseat_1)
8760 (init_iterator): Empty the bidi cache "stack".
8761 (move_it_in_display_line_to): If iterator ended up at
8762 EOL, but we never saw any buffer positions smaller than
8763 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
8764 motion in bidi-reordered lines.
8765 (move_it_in_display_line_to): Record prev_method and prev_pos
8766 immediately before the call to set_iterator_to_next. Fixes cursor
8767 motion in bidi-reordered lines with stretch glyphs and strings
8768 displayed in margins. (Bug#8133) (Bug#8867)
8769 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
8770 TO_CHARPOS.
640c8776
SM
8771 (pos_visible_p): Support positions in bidi-reordered lines.
8772 Save and restore bidi cache.
0bb23927
EZ
8773
8774 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
8775 (bidi_paragraph_info): Delete unused struct.
8776 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
8777 (bidi_cache_start): New variable.
8778 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
8779 to zero.
8780 (bidi_cache_fetch_state, bidi_cache_search)
8781 (bidi_cache_find_level_change, bidi_cache_iterator_state)
8782 (bidi_cache_find, bidi_peek_at_next_level)
8783 (bidi_level_of_next_char, bidi_find_other_level_edge)
8784 (bidi_move_to_visually_next): Compare cache index with
8785 bidi_cache_start rather than with zero.
8786 (bidi_fetch_char): Accept new argument STRING; all callers
8787 changed. Support iteration over a string. Support strings with
8788 display properties. Support unibyte strings. Fix the type of
8789 `len' according to what STRING_CHAR_AND_LENGTH expects.
8790 (bidi_paragraph_init, bidi_resolve_explicit_1)
8791 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
8792 (bidi_level_of_next_char, bidi_move_to_visually_next):
8793 Support iteration over a string.
0bb23927
EZ
8794 (bidi_set_sor_type, bidi_resolve_explicit_1)
8795 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
8796 can now be zero (for strings); special values 0 and -1 were
8797 changed to -1 and -2, respectively.
8798 (bidi_char_at_pos): New function.
8799 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
8800 Call it instead of FETCH_MULTIBYTE_CHAR.
8801 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
8802 initialized to valid values.
8803 (bidi_init_it): Don't initialize charpos and bytepos with invalid
8804 values.
8805 (bidi_level_of_next_char): Allow the sentinel "position" to pass
8806 the test for valid cached positions. Fix the logic for looking up
8807 the sentinel state in the cache. GCPRO the Lisp string we are
8808 iterating.
8809 (bidi_push_it, bidi_pop_it): New functions.
8810 (bidi_initialize): Initialize the bidi cache start stack pointer.
8811 (bidi_cache_ensure_space): New function, refactored from part of
8812 bidi_cache_iterator_state. Don't assume the required size is just
8813 one BIDI_CACHE_CHUNK away.
8814 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
8815 (bidi_count_bytes, bidi_char_at_pos): New functions.
8816 (bidi_cache_search): Don't assume bidi_cache_last_idx is
8817 always valid if bidi_cache_idx is valid.
8818 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
8819 is valid if it's going to be used.
8820 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
8821 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
8822 (bidi_cache_find_level_change, bidi_cache_ensure_space)
8823 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
8824 (bidi_find_other_level_edge, bidi_cache_start_stack):
8825 All variables related to cache indices are now EMACS_INT.
c965adc5 8826
0bb23927
EZ
8827 * dispextern.h (struct bidi_string_data): New structure.
8828 (struct bidi_it): New member `string'. Make flag members be 1-bit
8829 fields, and put them last in the struct.
640c8776
SM
8830 (compute_display_string_pos, compute_display_string_end):
8831 Update prototypes.
0bb23927
EZ
8832 (bidi_push_it, bidi_pop_it): Add prototypes.
8833 (struct iterator_stack_entry): New members bidi_p,
8834 paragraph_embedding, and from_disp_prop_p.
8835 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
8836 (bidi_shelve_cache, bidi_unshelve_cache):
8837 Declare prototypes.
0bb23927
EZ
8838
8839 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
8840 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
8841 and vector-like objects.
8842
8843 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
8844 cache around display iteration.
8845
8846 * window.c (Fwindow_end, window_scroll_pixel_based)
8847 (displayed_window_lines, Frecenter): Save and restore the bidi
8848 cache around display iteration.
8849
3bbd2265
LMI
88502011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
8851
8852 * editfns.c (Fdelete_region): Clarify the use of the named
8853 parameters (bug#6788).
8854
adc47434
MR
88552011-07-14 Martin Rudalics <rudalics@gmx.at>
8856
8857 * indent.c (Fvertical_motion): Set and restore w->pointm when
8858 saving and restoring the window's buffer (Bug#9006).
8859
837c31f8
LMI
88602011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
8861
8862 * editfns.c (Fstring_to_char): Clarify just what is returned
8863 (bug#6576). Text by Eli Zaretskii.
8864
ac389d0c
JB
88652011-07-13 Juanma Barranquero <lekktu@gmail.com>
8866
8867 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
8868
0be0ce47
EZ
88692011-07-13 Eli Zaretskii <eliz@gnu.org>
8870
8871 * buffer.c (mmap_find): Fix a typo.
8872
cd18e7e3
JB
88732011-07-13 Johan Bockgård <bojohan@gnu.org>
8874
8875 Fix execution of x selection hooks.
8876 * xselect.c (Qx_lost_selection_functions)
8877 (Qx_sent_selection_functions): New vars.
8878 (syms_of_xselect): DEFSYM them.
8879 (x_handle_selection_request): Pass Qx_sent_selection_functions
8880 rather than Vx_sent_selection_functions to Frun_hook_with_args.
8881 (x_handle_selection_clear,x_clear_frame_selections):
8882 Pass Qx_lost_selection_functions rather than
8883 Vx_lost_selection_functions to Frun_hook_with_args.
8884
47ea7f44
PE
88852011-07-13 Paul Eggert <eggert@cs.ucla.edu>
8886
ac389d0c 8887 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
8888 The old code sometimes used this field without initializing it.
8889
47ea7f44
PE
8890 * alloc.c (gc_sweep): Don't read past end of array.
8891 In theory, the old code could also have corrupted Emacs internals,
8892 though it'd be very unlikely.
8893
bc985c87
AS
88942011-07-12 Andreas Schwab <schwab@linux-m68k.org>
8895
8896 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 8897 argument. (Bug#4026)
bc985c87 8898
0cf34688
LMI
88992011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
8900
b3dadd76
LMI
8901 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
8902 key" (bug#4257).
8903
0cf34688
LMI
8904 * window.c (Fset_window_start): Doc fix (bug#4199).
8905 (Fset_window_hscroll): Ditto.
8906
270768cd
PE
89072011-07-12 Paul Eggert <eggert@cs.ucla.edu>
8908
077e3dda 8909 Fix minor new problems caught by GCC 4.6.1.
270768cd 8910 * term.c (init_tty): Remove unused local.
490011a6 8911 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 8912 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 8913 not used otherwise.
270768cd 8914
b1f58454
CY
89152011-07-12 Chong Yidong <cyd@stupidchicken.com>
8916
8917 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
8918
22b9578d
LMI
89192011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
8920
6e70ab07
LMI
8921 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
8922 are the mini-buffer and the echo area (bug#3320).
8923
22b9578d
LMI
8924 * term.c (init_tty): Remove support for supdup, c10 and perq
8925 terminals, which are no longer supported (bug#1482).
8926
8974cc9f
JB
89272011-07-10 Johan Bockgård <bojohan@gnu.org>
8928
8929 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
8930
a560d974
JD
89312011-07-10 Jan Djärv <jan.h.d@swipnet.se>
8932
8933 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
8934 for non-popups (Bug#3642).
8935
1dae0f0a
AS
89362011-07-10 Andreas Schwab <schwab@linux-m68k.org>
8937
268c2c36 8938 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 8939 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
8940 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
8941 * cm.c (losecursor): Likewise.
1dae0f0a
AS
8942 * data.c (fmod): Likewise.
8943 * dispnew.c (swap_glyphs_in_rows): Likewise.
8944 * emacs.c (memory_warning_signal): Likewise.
8945 * floatfns.c (float_error): Likewise.
8946 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
8947 (otf_open, font_otf_capability, generate_otf_features)
8948 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
8949 Likewise.
8950 * image.c (pbm_read_file): Likewise.
8951 * indent.c (string_display_width): Likewise.
8952 * intervals.c (check_for_interval, search_for_interval)
8953 (inc_interval_count, count_intervals, root_interval)
8954 (adjust_intervals_for_insertion, make_new_interval): Likewise.
8955 * lread.c (defalias): Likewise.
268c2c36 8956 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
8957 * regex.c (set_image_of_range_1, set_image_of_range)
8958 (regex_grow_registers): Likewise.
8959 * sysdep.c (strerror): Likewise.
8960 * termcap.c (valid_filename_p, tprint, main): Likewise.
8961 * tparam.c (main): Likewise.
8962 * unexhp9k800.c (run_time_remap, save_data_space)
8963 (update_file_ptrs, read_header, write_header, calculate_checksum)
8964 (copy_file, copy_rest, display_header): Likewise.
8965 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
8966 Likewise.
8967 * xdisp.c (check_it): Likewise.
8968 * xfaces.c (register_color, unregister_color, unregister_colors):
8969 Likewise.
8970 * xfns.c (print_fontset_result): Likewise.
8971 * xrdb.c (member, fatal, main): Likewise.
8972
99033785
PE
89732011-07-10 Paul Eggert <eggert@cs.ucla.edu>
8974
8975 Fix minor problems found by static checking (Bug#9031).
8976 * chartab.c (char_table_set_range, map_sub_char_table):
8977 Remove unused locals.
8978 (uniprop_table): Now static.
8979 * composite.c (_work_char): Remove unused static var.
8980
9cb2ac56
JB
89812011-07-09 Juanma Barranquero <lekktu@gmail.com>
8982
8983 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
8984
f25661f0
JD
89852011-07-09 Jan Djärv <jan.h.d@swipnet.se>
8986
8987 * gtkutil.c (qttip_cb): Remove code without function.
8988
8278c4fe
EZ
89892011-07-09 Eli Zaretskii <eliz@gnu.org>
8990
8991 * w32.c (pthread_sigmask): New stub.
8992
1692ae2d 89932011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 8994
8a6ebd58 8995 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
8996 sigprocmask is portable only for single-threaded applications, and
8997 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
8998 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
8999 (LIBES): Use it.
9000 * callproc.c (Fcall_process):
9001 * process.c (create_process):
9002 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
9003 Use pthread_sigmask, not sigprocmask.
123403e4 9004
1b854618
JD
90052011-07-08 Jan Djärv <jan.h.d@swipnet.se>
9006
9007 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
9008 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
9009 wrong (Bug#8591).
9010
3fe4b549
JD
90112011-07-08 Jan Djärv <jan.h.d@swipnet.se>
9012
0ce7e563
JD
9013 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
9014 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
9015 (xg_hide_tooltip): Fix comment.
9016
3fe4b549
JD
9017 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
9018 in registerServicesMenuSendTypes.
9019 (validRequestorForSendType): Don't check ns_return_types.
9020
9021 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
9022 ns_return_type.
9023
5df75e47
JR
90242011-07-08 Jason Rumney <jasonr@gnu.org>
9025
22610910
JR
9026 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
9027 SH_SHOW for hidden windows (Bug#5482).
9028
5df75e47
JR
9029 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
9030 frame struct members of non-existent frames (Bug#6284).
9031
699c10bd
JD
90322011-07-08 Jan Djärv <jan.h.d@swipnet.se>
9033
4393663b
JD
9034 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
9035 variable firstTime not needed on OSX >= 10.6.
9036 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
9037 >= 10.5. Use setKnobProportion, setDoubleValue.
9038
9039 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
9040 (MAC_OS_X_VERSION_10_5): Define if not defined.
9041 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
9042 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
9043 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
9044
9045 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 9046 cString and lossyCString on OSX >= 10.4.
4393663b 9047
58179cce 9048 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
9049 sizeToFit on OSX >= 10.2.
9050
9051 * nsimage.m (allocInitFromFile): Don't use deprecated method
9052 bestRepresentationForDevice on OSX >= 10.6.
9053
9054 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
9055 to avoid warning.
9056
9057 * emacs.c: Declare unexec_init_emacs_zone.
9058
a63e0781
JD
9059 * nsgui.h: Fix compiler warning about gnulib redefining verify.
9060
699c10bd
JD
9061 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
9062
9063 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
9064 on svcsMenu (Bug#8842).
9065
9066 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
9067 ns_return_types.
9068 (Fns_list_services): Just return Qnil on 10.6, code not working there.
9069
9070 * nsterm.m (QUTF8_STRING): Declare.
9071 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
9072 (validRequestorForSendType): Return type is (id).
9073 Change indexOfObjectIdenticalTo to indexOfObject.
9074 Check if we have local selection before returning self (Bug#8842).
9075 (writeSelectionToPasteboard): Put local selection into paste board
9076 if we have a local selection (Bug#8842).
9077 (syms_of_nsterm): DEFSYM QUTF8_STRING.
9078
9079 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
9080 (ns_get_local_selection): Declare.
9081
54e10184
LMI
90822011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
9083
9888ff71
LMI
9084 * keymap.c (describe_map_tree): Don't insert a double newline at
9085 the end of the buffer (bug#1169) and return whether we inserted
9086 something.
9087
54e10184
LMI
9088 * callint.c (Fcall_interactively): Change "reading args" to
9089 "providing args" to try to clarify what it does (bug#1010).
9090
15fa4783
KH
90912011-07-07 Kenichi Handa <handa@m17n.org>
9092
9093 * composite.c (composition_compute_stop_pos): Ignore a static
9094 composition starting before CHARPOS (Bug#8915).
9095
9096 * xdisp.c (handle_composition_prop): Likewise.
9097
a8815b00
EZ
90982011-07-07 Eli Zaretskii <eliz@gnu.org>
9099
9100 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
9101 (Bug#9015)
9102
ef7b981d 91032011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
9104
9105 * character.h (unicode_category_t): New enum type.
9106
9107 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
9108 (Qchar_code_property_table): New variable.
9109 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
9110 (UNIPROP_COMPRESSED_FORM_P): New macros.
9111 (char_table_ascii): Uncompress the compressed values.
9112 (sub_char_table_ref): New arg is_uniprop. Callers changed.
9113 Uncompress the compressed values.
ac389d0c 9114 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
9115 (char_table_ref_and_range): Uncompress the compressed values.
9116 (sub_char_table_set): New arg is_uniprop. Callers changed.
9117 Uncompress the compressed values.
9118 (sub_char_table_set_range): Args changed. Callers changed.
9119 (char_table_set_range): Adjuted for the above change.
9120 (map_sub_char_table): Delete args default_val and parent. Add arg
9121 top. Give decoded values to a Lisp function.
640c8776 9122 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
9123 values to a Lisp function. Gcpro more variables.
9124 (uniprop_table_uncompress)
9125 (uniprop_decode_value_run_length): New functions.
9126 (uniprop_decoder, uniprop_decoder_count): New variables.
9127 (uniprop_get_decoder, uniprop_encode_value_character)
9128 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
9129 New functions.
9130 (uniprop_encoder, uniprop_encoder_count): New variables.
9131 (uniprop_get_encoder, uniprop_table)
9132 (Funicode_property_table_internal, Fget_unicode_property_internal)
9133 (Fput_unicode_property_internal): New functions.
9134 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
9135 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 9136 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
9137 char-code-property-alist.
9138
640c8776 9139 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
9140 Vunicode_category_table.
9141
640c8776 9142 * font.c (font_range): Adjust for the change of
c805dec0
KH
9143 Vunicode_category_table.
9144
76b397fb
DN
91452011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
9146
9147 * m/iris4d.h: Remove file, move contents ...
9148 * s/irix6-5.h: ... here.
9149
22b4128e
PE
91502011-07-06 Paul Eggert <eggert@cs.ucla.edu>
9151
9152 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
9153 * alloc.c (mark_buffer):
9154 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
9155 (clone_per_buffer_values): Don't assume that
22b4128e
PE
9156 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
9157 This isn't true in general, and it's particularly not true
9158 if Emacs is configured with --with-wide-int.
9159 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
9160 New macros, used in the buffer.c change.
9161
869795d6
JD
91622011-07-05 Jan Djärv <jan.h.d@swipnet.se>
9163
9164 * xsettings.c: Use both GConf and GSettings if both are available.
9165 (store_config_changed_event): Add comment.
9166 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
9167 (store_tool_bar_style_changed): New functions.
5e617bc2 9168 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
9169 (struct xsettings): Move font inside HAVE_XFT.
9170 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 9171 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 9172 Move inside HAVE_XFT.
640c8776 9173 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
9174 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
9175 also.
9176 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 9177 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 9178 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
9179 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
9180 (parse_settings): Move check for font inside HAVE_XFT.
9181 (read_settings, apply_xft_settings): Add comment.
9182 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
9183 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
9184 call store_font_name_changed.
9185 (xft_settings_event): Add comment.
9186 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
9187 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
9188 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
9189 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
9190 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
9191 (xsettings_get_system_font, xsettings_get_system_normal_font):
9192 Add comment.
869795d6 9193
d8ed26bd
PE
91942011-07-05 Paul Eggert <eggert@cs.ucla.edu>
9195
9196 Random fixes. E.g., (random) never returned negative values.
9197 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
9198 subseconds part to the entropy, as that's a bit more random.
9199 Prefer signed to unsigned, since the signedness doesn't matter and
9200 in general we prefer signed. When given a limit, use a
9201 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
9202 latter isn't right if USE_2_TAGS_FOR_INTS.
9203 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
9204 not 0..VALMASK. Don't discard "excess" bits that random () returns.
9205
cabf1cac
SM
92062011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
9207
9208 * textprop.c (text_property_stickiness):
9209 Obey Vtext_property_default_nonsticky.
9210 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
9211 * w32fns.c (syms_of_w32fns):
9212 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
9213
6e9b2be9
PE
92142011-07-04 Paul Eggert <eggert@cs.ucla.edu>
9215
9216 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
9217 This is more efficient than Ffile_directory_p and avoids a minor race.
9218
90186c68
LMI
92192011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
9220
7c301272
LMI
9221 * buffer.c (Foverlay_put): Say what the return value is
9222 (bug#7835).
9223
c4f2d8d4
LMI
9224 * fileio.c (barf_or_query_if_file_exists): Check first if the file
9225 is a directory before asking whether to use the file name
9226 (bug#7564).
ad637907
LMI
9227 (barf_or_query_if_file_exists): Make the "File is a directory"
9228 error be more correct.
c4f2d8d4 9229
90186c68
LMI
9230 * fns.c (Frequire): Remove the mention of the .gz files, since
9231 that's installation-specific, but keep the mention of
9232 `get-load-suffixes'.
9233
da64016e
PE
92342011-07-04 Paul Eggert <eggert@cs.ucla.edu>
9235
9236 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
9237 Report string overflow if the output is too long.
9238
7d47b580
JB
92392011-07-04 Juanma Barranquero <lekktu@gmail.com>
9240
a555cb87
JB
9241 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
9242 (syms_of_gnutls): Remove duplicate DEFSYM for
9243 Qgnutls_bootprop_verify_hostname_error, an error for
9244 Qgnutls_bootprop_verify_error (which is no longer used).
9245
7d47b580
JB
9246 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
9247 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
9248 Also (re)move comments that are misplaced or no longer relevant.
9249
1e49bfab
LMI
92502011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
9251
9252 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
9253
1485f4c0
CY
92542011-07-03 Chong Yidong <cyd@stupidchicken.com>
9255
9256 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
9257 and background color parameters if they have been changed.
9258
a9ab721e
LMI
92592011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
9260
9261 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
9262
cf7cff57
PE
92632011-07-03 Paul Eggert <eggert@cs.ucla.edu>
9264
2e13213d
PE
9265 * xsettings.c (SYSTEM_FONT): Define only when used.
9266 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
9267
cf7cff57
PE
9268 * keymap.c (access_keymap_1): Now static.
9269
7a8e04f7
CY
92702011-07-02 Chong Yidong <cyd@stupidchicken.com>
9271
9272 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
9273 leave any prefix arg for the up event (Bug#1586).
9274
61352f62
LMI
92752011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
9276
69bb1ef7
LMI
9277 * lread.c (syms_of_lread): Mention single symbols defined by
9278 `defvar' or `defconst' (bug#7154).
9279
61352f62 9280 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 9281 (Frequire): Mention get-load-suffixes.
61352f62 9282
28545e04
MR
92832011-07-02 Martin Rudalics <rudalics@gmx.at>
9284
9285 * window.h (window): Remove clone_number slot.
9286 * window.c (Fwindow_clone_number, Fset_window_clone_number):
9287 Remove.
9288 (make_parent_window, make_window, saved_window)
9289 (Fset_window_configuration, save_window_save): Don't deal with
9290 clone numbers.
9291 * buffer.c (Qclone_number): Remove declaration.
9292 (sort_overlays, overlay_strings): Don't deal with clone numbers.
9293
3349e122
SM
92942011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
9295
9296 Add multiple inheritance to keymaps.
9297 * keymap.c (Fmake_composed_keymap): New function.
9298 (Fset_keymap_parent): Simplify.
9299 (fix_submap_inheritance): Remove.
9300 (access_keymap_1): New function extracted from access_keymap to handle
9301 embedded parents and handle lists of maps.
9302 (access_keymap): Use it.
9303 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
9304 (Fcopy_keymap): Handle embedded parents.
9305 (Fcommand_remapping, define_as_prefix): Simplify.
9306 (Fkey_binding): Simplify.
9307 (syms_of_keymap): Move minibuffer-local-completion-map,
9308 minibuffer-local-filename-completion-map,
9309 minibuffer-local-must-match-map, and
9310 minibuffer-local-filename-must-match-map to Elisp.
9311 (syms_of_keymap): Defsubr make-composed-keymap.
9312 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
9313 (parse_menu_item): Trivial simplification.
9314
3279eb87
GM
93152011-07-01 Glenn Morris <rgm@gnu.org>
9316
9317 * Makefile.in (SETTINGS_LIBS): Fix typo.
9318
4550efdf
KI
93192011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
9320
9321 * coding.c (Fencode_coding_string): Record the last coding system
9322 used, as the function doc string says (bug#8738).
9323
0949d2b6
JD
93242011-07-01 Jan Djärv <jan.h.d@swipnet.se>
9325
9326 * xsettings.c (store_monospaced_changed): Take new font as arg and
9327 check for change against current_mono_font.
9328 (EMACS_TYPE_SETTINGS): Remove this and related defines.
9329 (emacs_settings_constructor, emacs_settings_get_property)
9330 (emacs_settings_set_property, emacs_settings_class_init)
9331 (emacs_settings_init, gsettings_obj): Remove.
9332 (something_changedCB): New function for HAVE_GSETTINGS.
9333 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
9334 with value as argument.
9335 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
9336 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 9337 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
9338 "changed".
9339
9340 * xgselect.c: Add defined (HAVE_GSETTINGS).
9341 (xgselect_initialize): Ditto.
9342
9343 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
9344 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
9345 xg_select.
9346
bbc6b304
PE
93472011-07-01 Paul Eggert <eggert@cs.ucla.edu>
9348
9349 * eval.c (struct backtrace): Simplify and port the data structure.
9350 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
9351 signed bit field, as this assumption is not portable and it makes
9352 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
9353 "char debug_on_exit : 1" as this is not portable either; instead,
9354 use the portable "unsigned int debug_on_exit : 1". Remove unused
9355 member evalargs. Remove obsolete comments about cc bombing out.
9356
9851bfc5
JD
93572011-06-30 Jan Djärv <jan.h.d@swipnet.se>
9358
51bb811f 9359 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
9360 Let HAVE_GSETTINGS override HAVE_GCONF.
9361 (store_monospaced_changed): New function.
9362 (EMACS_SETTINGS): A new type derived from GObject to handle
9363 GSettings notifications.
9364 (emacs_settings_constructor, emacs_settings_get_property)
9365 (emacs_settings_set_property, emacs_settings_class_init):
9366 New functions.
9367 (gsettings_client, gsettings_obj): New variables.
9368 (GSETTINGS_SCHEMA): New define.
9369 (something_changedCB): Call store_monospaced_changed.
9370 (init_gsettings): New function.
9371 (xsettings_initialize): Call init_gsettings.
9372 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
9373 to NULL.
9374
640c8776 9375 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
9376 GCONF_CFLAGS/LIBS.
9377
5386012d
MR
93782011-06-29 Martin Rudalics <rudalics@gmx.at>
9379
9380 * window.c (resize_root_window, grow_mini_window)
9381 (shrink_mini_window): Rename Qresize_root_window to
9382 Qwindow_resize_root_window and Qresize_root_window_vertically to
9383 Qwindow_resize_root_window_vertically.
9384
f13e0b08
PE
93852011-06-28 Paul Eggert <eggert@cs.ucla.edu>
9386
9387 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
9388
94515237
JB
93892011-06-27 Juanma Barranquero <lekktu@gmail.com>
9390
9391 * makefile.w32-in: Redesign dependencies so they reflect more
9392 clearly which files are directly included by each source file,
9393 and not through other includes.
9394
e43b6e43
MR
93952011-06-27 Martin Rudalics <rudalics@gmx.at>
9396
9397 * buffer.c (Qclone_number): Declare static and DEFSYM it.
9398 (sort_overlays, overlay_strings): When an overlay's clone number
9399 matches the window's clone number process the overlay even if
9400 the overlay's window property doesn't match the current window.
9401
d68443dc
MR
9402 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
9403 (Fwindow_hchild): Rename to Fwindow_left_child.
9404 (Fwindow_next): Rename to Fwindow_next_sibling.
9405 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
9406 (resize_window_check): Rename to window_resize_check.
9407 (resize_window_apply): Rename to window_resize_apply.
9408 (Fresize_window_apply): Rename to Fwindow_resize_apply.
9409 (Fdelete_other_windows_internal, resize_frame_windows)
9410 (Fsplit_window_internal, Fdelete_window_internal)
9411 (grow_mini_window, shrink_mini_window)
9412 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 9413
c7e73be5
JD
94142011-06-26 Jan Djärv <jan.h.d@swipnet.se>
9415
9416 * emacsgtkfixed.h: State that this is only used with Gtk+3.
9417 (emacs_fixed_set_min_size): Remove.
9418 (emacs_fixed_new): Take frame as argument.
9419
9420 * emacsgtkfixed.c: State that this is only used with Gtk+3.
9421 (_EmacsFixedPrivate): Remove minwidth/height.
9422 Add struct frame *f.
9423 (emacs_fixed_init): Initialize priv->f.
9424 (get_parent_class, emacs_fixed_set_min_size): Remove.
9425 (emacs_fixed_new): Set priv->f to argument.
9426 (emacs_fixed_get_preferred_width)
9427 (emacs_fixed_get_preferred_height): Use min_width/height from
9428 frames size_hint to set minimum and natural (Bug#8919).
9429 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
9430 and use min_width/height from frames size_hint to set
9431 min_width/height (Bug#8919).
9432
9433 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
9434 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
9435 Fix indentation.
c7e73be5 9436
cf99dcf8
EZ
94372011-06-26 Eli Zaretskii <eliz@gnu.org>
9438
9439 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
9440 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
9441 called at ZV.
9442
029529ac
CY
94432011-06-26 Chong Yidong <cyd@stupidchicken.com>
9444
9445 * process.c (wait_reading_process_output): Bypass select if
9446 waiting for a cell while ignoring keyboard input, and input is
9447 pending. Suggested by Jan Djärv (Bug#8869).
9448
7a7ef429
PE
94492011-06-25 Paul Eggert <eggert@cs.ucla.edu>
9450
9451 Use gnulib's dup2 module instead of rolling our own.
9452 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
9453
11fdef7d 94542011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
9455
9456 * dispnew.c (scrolling_window): Before scrolling, turn off a
9457 mouse-highlight in the window being scrolled.
9458
cd3520a4
JB
94592011-06-24 Juanma Barranquero <lekktu@gmail.com>
9460
9461 Move DEFSYM to lisp.h and use everywhere.
9462
9463 * character.h (DEFSYM): Move declaration...
9464 * lisp.h (DEFSYM): ...here.
9465
9466 * gnutls.c:
9467 * minibuf.c:
9468 * w32menu.c:
9469 * w32proc.c:
9470 * w32select.c: Don't include character.h.
9471
9472 * alloc.c (syms_of_alloc):
9473 * buffer.c (syms_of_buffer):
9474 * bytecode.c (syms_of_bytecode):
9475 * callint.c (syms_of_callint):
9476 * casefiddle.c (syms_of_casefiddle):
9477 * casetab.c (init_casetab_once):
9478 * category.c (init_category_once, syms_of_category):
9479 * ccl.c (syms_of_ccl):
9480 * cmds.c (syms_of_cmds):
9481 * composite.c (syms_of_composite):
9482 * dbusbind.c (syms_of_dbusbind):
9483 * dired.c (syms_of_dired):
9484 * dispnew.c (syms_of_display):
9485 * doc.c (syms_of_doc):
9486 * editfns.c (syms_of_editfns):
9487 * emacs.c (syms_of_emacs):
9488 * eval.c (syms_of_eval):
9489 * fileio.c (syms_of_fileio):
9490 * fns.c (syms_of_fns):
9491 * frame.c (syms_of_frame):
9492 * fringe.c (syms_of_fringe):
9493 * insdel.c (syms_of_insdel):
9494 * keymap.c (syms_of_keymap):
9495 * lread.c (init_obarray, syms_of_lread):
9496 * macros.c (syms_of_macros):
9497 * msdos.c (syms_of_msdos):
9498 * print.c (syms_of_print):
9499 * process.c (syms_of_process):
9500 * search.c (syms_of_search):
9501 * sound.c (syms_of_sound):
9502 * syntax.c (init_syntax_once, syms_of_syntax):
9503 * terminal.c (syms_of_terminal):
9504 * textprop.c (syms_of_textprop):
9505 * undo.c (syms_of_undo):
9506 * w32.c (globals_of_w32):
9507 * window.c (syms_of_window):
9508 * xdisp.c (syms_of_xdisp):
9509 * xfaces.c (syms_of_xfaces):
9510 * xfns.c (syms_of_xfns):
9511 * xmenu.c (syms_of_xmenu):
9512 * xsettings.c (syms_of_xsettings):
9513 * xterm.c (syms_of_xterm): Use DEFSYM.
9514
4228cf16
TZ
95152011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
9516
cd3520a4 9517 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 9518
7fcccf1e
PE
95192011-06-23 Paul Eggert <eggert@cs.ucla.edu>
9520
7efb4e0e
PE
9521 Integer and buffer overflow fixes (Bug#8873).
9522
ff5844ad
PE
9523 * print.c (printchar, strout): Check for string overflow.
9524 (PRINTPREPARE, printchar, strout):
9525 Don't set size unless allocation succeeds.
9526
90532f02
PE
9527 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
9528 for sizes. Check for string overflow more accurately.
9529 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
9530
6d84508d
PE
9531 * macros.c: Integer and buffer overflow fixes.
9532 * keyboard.h (struct keyboard.kbd_macro_bufsize):
9533 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
9534 Use ptrdiff_t, not int, for sizes.
9535 Don't increment bufsize until after realloc succeeds.
9536 Check for size-calculation overflow.
9537 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
9538
437b2cb4
PE
9539 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
9540
8b9ac8b4
PE
9541 * lread.c: Integer overflow fixes.
9542 (read_integer): Radix is now EMACS_INT, not int,
9543 to improve quality of diagnostics for out-of-range radices.
9544 Calculate buffer size correctly for out-of-range radices.
9545 (read1): Check for integer overflow in radices, and in
9546 read-circle numbers.
82cb60d3
PE
9547 (read_escape): Avoid int overflow.
9548 (Fload, openp, read_buffer_size, read1)
9549 (substitute_object_recurse, read_vector, read_list, map_obarray):
9550 Use ptrdiff_t, not int, for sizes.
9551 (read1): Use EMACS_INT, not int, for sizes.
20270765 9552 Check for size overflow.
8b9ac8b4 9553
7fcccf1e
PE
9554 * image.c (cache_image): Check for size arithmetic overflow.
9555
bfbbd7e7
PE
9556 * lread.c: Integer overflow issues.
9557 (saved_doc_string_size, saved_doc_string_length)
9558 (prev_saved_doc_string_size, prev_saved_doc_string_length):
9559 Now ptrdiff_t, not int.
9560 (read1): Don't assume doc string length fits in int. Check for
9561 out-of-range doc string lengths.
9562 (read_list): Don't assume file position fits in int.
39019e54 9563 (read_escape): Check for hex character overflow.
bfbbd7e7 9564
4e323265
LL
95652011-06-22 Leo Liu <sdl.web@gmail.com>
9566
9567 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
9568 Move to minibuffer.el.
9569
85fece3e
PE
95702011-06-22 Paul Eggert <eggert@cs.ucla.edu>
9571
20b84ce9 9572 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
9573 The following patches are for when GLYPH_DEBUG && !XASSERT.
9574 * dispextern.h (trace_redisplay_p, dump_glyph_string):
9575 * dispnew.c (flush_stdout):
9576 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
9577 Mark as externally visible.
9578 * dispnew.c (check_window_matrix_pointers): Now static.
9579 * dispnew.c (window_to_frame_vpos):
9580 * xfns.c (unwind_create_frame):
9581 * xterm.c (x_check_font): Remove unused local.
9582 * scroll.c (CHECK_BOUNDS):
9583 * xfaces.c (cache_fache): Rename local to avoid shadowing.
9584 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
9585 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
9586 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
9587 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
9588 Now static.
9589 (debug_method_add): Use va_list and vsprintf rather than relying
9590 on undefined behavior with wrong number of arguments.
9591 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
9592 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
9593 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
9594 since we're not interested in debugging glyphs with old libraries.
9595 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
9596 GCC 4.6.0's static checking.
9597
0766b489
PE
95982011-06-22 Paul Eggert <eggert@cs.ucla.edu>
9599
31fd4b32
PE
9600 Integer overflow and signedness fixes (Bug#8873).
9601 A few related buffer overrun fixes, too.
9602
b79e8648
PE
9603 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
9604
0766b489
PE
9605 * dispextern.h (struct face.stipple):
9606 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
9607 (x_bitmap_mask, x_allocate_bitmap_record)
9608 (x_create_bitmap_from_data, x_create_bitmap_from_file)
9609 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
9610 (x_create_bitmap_from_xpm_data):
9611 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
9612 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
9613 (.bitmaps_last):
9614 * xfaces.c (load_pixmap):
9615 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
9616 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
9617 (.bitmaps_last, struct x_output.icon_bitmap):
9618 Use ptrdiff_t, not int, for bitmap indexes.
9619 (x_allocate_bitmap_record): Check for size overflow.
9620 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
9621
b081724f
PE
9622 Use ptrdiff_t, not int, for overlay counts.
9623 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
9624 * editfns.c (overlays_around, get_pos_property):
9625 * textprop.c (get_char_property_and_overlay):
9626 * xdisp.c (next_overlay_change, note_mouse_highlight):
9627 * xfaces.c (face_at_buffer_position):
21514da7
PE
9628 * buffer.c (OVERLAY_COUNT_MAX): New macro.
9629 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
9630 (Fnext_overlay_change, Fprevious_overlay_change)
9631 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 9632 Use ptrdiff_t, not int, for sizes.
21514da7 9633 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 9634
3de73e5e
PE
9635 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
9636
2606c57b
PE
9637 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
9638 (x_session_initialize): Do not assume string length fits in int.
9639
aaafe47a
PE
9640 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
9641 This is unlikely, but can occur if DPI is outlandish.
9642
2674ddc8 9643 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
9644 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
9645
28154962
PE
9646 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
9647 * xrdb.c (magic_file_p, search_magic_path):
9648 Omit last arg SUFFIX; it was always 0. All callers changed.
9649 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
9650
7de51af5
PE
9651 * xfont.c (xfont_match): Avoid need for strlen.
9652
25ed6cc3
PE
9653 * xfns.c: Don't assume strlen fits in int.
9654 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
9655
4eab31dd
PE
9656 * xdisp.c (message_log_check_duplicate): Return intmax_t,
9657 not unsigned long, as we prefer signed integers. All callers changed.
9658 Detect integer overflow in repeat count.
9659 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 9660 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 9661
171e2a58
PE
9662 * termcap.c: Don't assume sizes fit in int and never overflow.
9663 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
9664 (gobble_line): Check for size-calculation overflow.
9665
ad39faca 9666 * minibuf.c (Fread_buffer):
6e5bb2dc 9667 * lread.c (intern, intern_c_string):
74ca2eb3
PE
9668 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
9669 Don't assume string length fits in int.
9670
52c61c22 9671 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
9672 * gtkutil.c (style_changed_cb): Avoid need for strlen.
9673
b5b8c9e5
PE
9674 * font.c: Don't assume string length fits in int.
9675 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
9676 Use ptrdiff_t, not int.
ccd6111c
PE
9677 (font_intern_prop): Don't assume string length fits in int.
9678 Don't assume integer property fits in fixnum.
9679 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 9680
882f0d81 9681 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 9682 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
9683 Reformulate so as not to need the command string.
9684 Invoke gzip -cd rather than gunzip, as it's more portable.
9685 (lock_info_type, lock_file_1, lock_file):
9686 Don't assume pid_t and time_t fit in unsigned long.
9687 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
9688 (current_lock_owner): Prefer signed type for sizes.
9689 Use memcpy, not strncpy, where memcpy is what is really wanted.
9690 Don't assume (via atoi) that time_t and pid_t fit in int.
9691 Check for time_t and/or pid_t out of range, e.g., via a network share.
9692 Don't alloca where an auto var works fine.
9693
93f4cf88
PE
9694 * fileio.c: Fix some integer overflow issues.
9695 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
9696 Don't assume string length fits in int.
9697 (directory_file_name): Don't assume string length fits in long.
9698 (make_temp_name): Don't assume pid fits in int, or that its print
9699 length is less than 20.
9700
f3e92b69
PE
9701 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
9702
1bfdaf10
PE
9703 * coding.c (make_subsidiaries): Don't assume string length fits in int.
9704
35016e9a
PE
9705 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
9706
3d1e65a1
PE
9707 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
9708 We prefer signed integers, even for size calculations.
9709
0b963a93
PE
9710 * emacs.c: Don't assume string length fits in 'int'.
9711 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
9712 (main): Don't invoke strlen when not needed.
9713
573f4b54
PE
9714 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
9715 (XD_DEBUG_MESSAGE): Don't waste a byte.
9716
989f33ba
PE
9717 * callproc.c (getenv_internal_1, getenv_internal)
9718 (Fgetenv_internal):
965d34eb
PE
9719 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
9720
e4d29b33
PE
9721 * lread.c (invalid_syntax): Omit length argument.
9722 All uses changed. This doesn't fix a bug, but it simplifies the
9723 code away from its former Hollerith-constant appearance, and it's
9724 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 9725 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 9726
eb49b136
PE
9727 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
9728 This didn't break anything, but it didn't help either.
9729 It's confusing to put a bogus integer in a place where the actual
9730 value does not matter.
9f62aeb1 9731 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 9732 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 9733
15375a22
PE
9734 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
9735 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
9736 implementation.
b61cc01c
PE
9737 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
9738 We prefer signed types, and the value cannot exceed the EMACS_INT
9739 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
9740 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
9741 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
9742 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 9743
53b2623d
PE
9744 * indent.c (sane_tab_width): New function.
9745 (current_column, scan_for_column, Findent_to, position_indentation)
9746 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 9747 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 9748
51cab52b 9749 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 9750
f2ed8a70
PE
9751 * lisp.h (lint_assume): New macro.
9752 * composite.c (composition_gstring_put_cache):
9753 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
9754
abe80cc6
PE
9755 * editfns.c, insdel.c:
9756 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 9757
b02c740e
PE
9758 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
9759
ebc96716
PE
9760 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
9761
b4e50fa0 9762 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 9763 Use much-faster test for byte-length change.
311d5d7c 9764 Don't assume string byte-length fits in 'int'.
a4cf38e4 9765 Check that character arg fits in 'int'.
85461888 9766 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 9767
c0c1ee9f
PE
9768 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
9769
a498d7f4
PE
9770 * fns.c (concat): Catch string overflow earlier.
9771 Do not rely on integer wraparound.
9772
51cab52b
PE
9773 * dispextern.h (struct it.overlay_strings_charpos)
9774 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
9775 * xdisp.c (forward_to_next_line_start)
9776 (back_to_previous_visible_line_start)
9777 (reseat_at_next_visible_line_start, next_element_from_buffer):
9778 Don't arbitrarily truncate the value of 'selective' to int.
9779
76031fad
PE
9780 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
9781
5eb55db9
PE
9782 * composite.c: Don't truncate sizes to 'int'.
9783 (composition_gstring_p, composition_reseat_it)
9784 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
9785 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
9786 not EMACS_UINT, for indexes.
5eb55db9 9787
0703a717
PE
9788 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
9789
d6202519
PE
9790 * buffer.c: Include <verify.h>.
9791 (struct sortvec.priority, struct sortstr.priority):
8961a454 9792 Now EMACS_INT, not int.
c20998a7 9793 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
9794 (struct sortstr.size, record_overlay_string)
9795 (struct sortstrlist.size, struct sortlist.used):
9796 Don't truncate size to int.
9797 (record_overlay_string): Check for size-calculation overflow.
d6202519 9798 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 9799
d5a19415
JM
98002011-06-22 Jim Meyering <meyering@redhat.com>
9801
029529ac 9802 Don't leak an XBM-image-sized buffer
d5a19415
JM
9803 * image.c (xbm_load): Free the image buffer after using it.
9804
a9041e6c
PE
98052011-06-21 Paul Eggert <eggert@cs.ucla.edu>
9806
9807 Port to Sun C.
9808 * composite.c (find_automatic_composition): Omit needless 'return 0;'
9809 that Sun C diagnosed.
9810 * fns.c (secure_hash): Fix pointer signedness issue.
9811 * intervals.c (static_offset_intervals): New function.
9812 (offset_intervals): Use it.
9813
7f3f739f
LL
98142011-06-21 Leo Liu <sdl.web@gmail.com>
9815
9816 * deps.mk (fns.o):
9817 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
9818 sha512.h.
9819
9820 * fns.c (secure_hash): Rename from crypto_hash_function and change
9821 the first arg to accept symbols.
5b66d427 9822 (Fsecure_hash): New primitive.
7f3f739f
LL
9823 (syms_of_fns): New symbols.
9824
76147d94
DD
98252011-06-20 Deniz Dogan <deniz@dogan.se>
9826
9827 * process.c (Fset_process_buffer): Clarify return value in
9828 docstring.
9829
7d7d0045
CY
98302011-06-18 Chong Yidong <cyd@stupidchicken.com>
9831
9832 * dispnew.c (add_window_display_history): Use BVAR.
9833
9834 * xdisp.c (debug_method_add): Use BVAR.
9835 (check_window_end, dump_glyph_matrix, dump_glyph)
9836 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
9837
9838 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
9839 Likewise.
9840
9841 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
9842 check till after the cache is created in init_frame_faces.
9843
ff2bc410
SM
98442011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
9845
9846 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
9847
28177add
PE
98482011-06-16 Paul Eggert <eggert@cs.ucla.edu>
9849
dd3482fe
PE
9850 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
9851 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
9852 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
9853
393d71f3 9854 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
9855 * fileio.c (Finsert_file_contents):
9856 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
9857 Remove the old (too-loose) buffer overflow checks.
9858 They weren't needed, since make_gap checks for buffer overflow.
9859 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
9860 The old code merely checked for Emacs fixnum overflow, and relied
9861 on undefined (wraparound) behavior. The new code avoids undefined
9862 behavior, and also checks for ptrdiff_t and/or size_t overflow.
9863
2e6813b0 9864 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
9865 Tune. Don't use wider integers than needed. Don't use alloca.
9866 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 9867
599a9e4f
PE
9868 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
9869
99561444
PE
9870 * insdel.c, lisp.h (buffer_overflow): New function.
9871 (insert_from_buffer_1, replace_range, replace_range_2):
9872 * insdel.c (make_gap_larger):
9873 * editfns.c (Finsert_char):
9874 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
9875
28177add
PE
9876 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
9877
e69dafad
PE
98782011-06-15 Paul Eggert <eggert@cs.ucla.edu>
9879
4baa020d 9880 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 9881
b1c46f02
PE
9882 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
9883 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
9884
e69dafad
PE
9885 * fileio.c: Don't assume EMACS_INT fits in off_t.
9886 (emacs_lseek): New static function.
9887 (Finsert_file_contents, Fwrite_region): Use it.
9888 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
9889
566684ea
PE
9890 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
9891
e6966cd6
PE
9892 * fns.c: Don't overflow int when computing a list length.
9893 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
9894 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
9895 truncation on 64-bit hosts. Check for QUIT every
9896 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
9897 faster and is responsive enough.
9898 (Flength): Report an error instead of overflowing an integer.
9899 (Fsafe_length): Return a float if the value is not representable
9900 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 9901 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 9902 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 9903
dd0b0efb
PE
9904 * alloc.c: Check that resized vectors' lengths fit in fixnums.
9905 (header_size, word_size): New constants.
9906 (allocate_vectorlike): Don't check size overflow here.
9907 (allocate_vector): Check it here instead, since this is the only
9908 caller of allocate_vectorlike that could cause overflow.
9909 Check that the new vector's length is representable as a fixnum.
9910
86fe5cfe
PE
9911 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
9912 The previous code was bogus. For example, next_almost_prime (32)
9913 returned 39, which is undesirable as it is a multiple of 3; and
9914 next_almost_prime (24) returned 25, which is a multiple of 5 so
9915 why was the code bothering to check for multiples of 7?
9916
80e88859
PE
9917 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
9918
4a2f0ad6
PE
9919 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
9920
f66c7cf8
PE
9921 Variadic C functions now count arguments with ptrdiff_t.
9922 This partly undoes my 2011-03-30 change, which replaced int with size_t.
9923 Back then I didn't know that the Emacs coding style prefers signed int.
9924 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
9925 were being counted with int, which may truncate counts on 64-bit
9926 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
9927 * lisp.h (struct Lisp_Subr.function.aMANY)
9928 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
9929 Arg counts are now ptrdiff_t, not size_t.
9930 All variadic functions and their callers changed accordingly.
9931 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
9932 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
9933 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
9934 * callint.c (Fcall_interactively): Check arg count for overflow,
9935 to avoid potential buffer overrun. Use signed char, not 'int',
9936 for 'varies' array, so that we needn't bother to check its size
9937 calculation for overflow.
9938 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
9939 * eval.c (apply_lambda):
9940 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
9941 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
9942 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
9943
a1759b76
PE
9944 * callint.c (Fcall_interactively): Don't use index var as event count.
9945
d96be9fc
PE
9946 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
9947 * mem-limits.h (SIZE): Remove; no longer used.
9948
a690a978 9949 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 9950
578c21e6
PE
9951 Remove unnecessary casts.
9952 * xterm.c (x_term_init):
9953 * xfns.c (x_set_border_pixel):
9954 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
9955 These aren't needed now that we assume ANSI C.
9956
96f53c6c
PE
9957 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
9958 It's more likely to cause problems (due to unsigned overflow)
9959 than to cure them.
9960
83c77d31
PE
9961 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
9962
ee2079f1
PE
9963 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
9964
6da65536
PE
9965 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
9966
7147c4a4
PE
9967 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
9968
193e32d9
PE
9969 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
9970
e5533da6
PE
9971 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
9972
9910e595
PE
9973 GLYPH_CODE_FACE returns EMACS_INT, not int.
9974 * dispextern.h (merge_faces):
9975 * xfaces.c (merge_faces):
01103c44
PE
9976 * xdisp.c (get_next_display_element, next_element_from_display_vector):
9977 Don't assume EMACS_INT fits in int.
9910e595 9978
2638320e
PE
9979 * character.h (CHAR_VALID_P): Remove unused parameter.
9980 * fontset.c, lisp.h, xdisp.c: All uses changed.
9981
045eb8d9
PE
9982 * editfns.c (Ftranslate_region_internal): Omit redundant test.
9983
c1f134b5
PE
9984 * fns.c (concat): Minor tuning based on overflow analysis.
9985 This doesn't fix any bugs. Use int to hold character, instead
9986 of constantly refetching from Emacs object. Use XFASTINT, not
9987 XINT, for value known to be a character. Don't bother comparing
9988 a single byte to 0400, as it's always less.
9989
395fcb93 9990 * floatfns.c (Fexpt):
327eeec8
PE
9991 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
9992
abbd3d23
PE
9993 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
9994 for characters.
9995
684a03ef
PE
9996 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
9997
0fed43f3
PE
9998 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
9999 Without this fix, on a 64-bit host (aset S 0 4294967386) would
10000 incorrectly succeed when S was a string, because 4294967386 was
10001 truncated before it was used.
10002
8fd02eb7
PE
10003 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
10004 Otherwise, an out-of-range integer could cause undefined behavior
10005 on a 64-bit host.
10006
f8c86b69
PE
10007 * composite.c: Use int, not EMACS_INT, for characters.
10008 (fill_gstring_body, composition_compute_stop_pos): Use int, not
10009 EMACS_INT, for values that are known to be in character range.
10010 This doesn't fix any bugs but is the usual style inside Emacs and
10011 may generate better code on 32-bit machines.
10012
34206dd2
PE
10013 Make sure a 64-bit char is never passed to ENCODE_CHAR.
10014 This is for reasons similar to the recent CHAR_STRING fix.
10015 * charset.c (Fencode_char): Check that character arg is actually
10016 a character. Pass an int to ENCODE_CHAR.
10017 * charset.h (ENCODE_CHAR): Verify that the character argument is no
10018 wider than 'int', as a compile-time check to prevent future regressions
10019 in this area.
10020
c5958d4c 10021 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
10022
10023 Make sure a 64-bit char is never passed to CHAR_STRING.
10024 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
10025 by silently ignoring the top 32 bits, allowing some values
10026 that were far too large to be valid characters.
10027 * character.h: Include <verify.h>.
10028 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
10029 arguments are no wider than unsigned, as a compile-time check
10030 to prevent future regressions in this area.
10031 * data.c (Faset):
01103c44 10032 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
10033 (Fsubst_char_in_region):
10034 * fns.c (concat):
10035 * xdisp.c (decode_mode_spec_coding):
10036 Adjust to CHAR_STRING's new requirement.
10037 * editfns.c (Finsert_char, Fsubst_char_in_region):
10038 * fns.c (concat): Check that character args are actually
10039 characters. Without this test, these functions did the wrong
10040 thing with wildly out-of-range values on 64-bit hosts.
10041
d37ca623
PE
10042 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
10043 These casts should not be needed on 32-bit hosts, either.
10044 * keyboard.c (read_char):
10045 * lread.c (Fload): Remove casts to unsigned.
10046
ea204efb
PE
10047 * lisp.h (UNSIGNED_CMP): New macro.
10048 This fixes comparison bugs on 64-bit hosts.
10049 (ASCII_CHAR_P): Use it.
10050 * casefiddle.c (casify_object):
01103c44 10051 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
10052 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
10053 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
10054 * dispextern.h (FACE_FROM_ID):
10055 * keyboard.c (read_char): Use UNSIGNED_CMP.
10056
41cb286c
PE
10057 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
10058 not to EMACS_INT, to avoid GCC warning.
10059
4a1b9832
PE
10060 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
10061
55daad71
PE
10062 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
10063 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
10064 isn't needed on 32-bit machines.
8f95c75c 10065
01103c44
PE
10066 * buffer.c (Fgenerate_new_buffer_name):
10067 Use EMACS_INT for count, not int.
0ceccced 10068 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
10069
10070 * data.c (Qcompiled_function): Now static.
10071
c6f072e7
PE
10072 * window.c (window_body_lines): Now static.
10073
20ce5912
PE
10074 * image.c (gif_load): Rename local to avoid shadowing.
10075
9c4c5f81
PE
10076 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
10077 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
10078 * alloc.c (make_save_value): Integer argument is now of type
10079 ptrdiff_t, not int.
10080 (mark_object): Use ptrdiff_t, not int.
10081 * lisp.h (pD): New macro.
10082 * print.c (print_object): Use it.
10083
c0c5c8ae
PE
10084 * alloc.c: Use EMACS_INT, not int, to count objects.
10085 (total_conses, total_markers, total_symbols, total_vector_size)
10086 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
10087 (total_free_floats, total_floats, total_free_intervals)
10088 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
10089 Now EMACS_INT, not int. All uses changed.
10090 (Fgarbage_collect): Compute overall total using a double, so that
10091 integer overflow is less likely to be a problem. Check for overflow
10092 when converting back to an integer.
5a25e253
PE
10093 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
10094 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
10095 These were 'int' variables that could overflow on 64-bit hosts;
10096 they were never used, so remove them instead of repairing them.
211a0b2a 10097 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
10098 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
10099 Previously, this ceilinged at INT_MAX, but that doesn't work on
10100 64-bit machines.
e46bb31a 10101 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 10102
c78baabf 10103 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 10104 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
10105 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
10106 when a (possibly-narrower) signed value would do just as well.
10107 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 10108
c9d624c6
PE
10109 * alloc.c: Catch some string size overflows that we were missing.
10110 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
10111 for convenience in STRING_BYTES_MAX.
10112 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
10113 The definition here is exact; the one in lisp.h was approximate.
10114 (allocate_string_data): Check for string overflow. This catches
10115 some instances we weren't catching before. Also, it catches
10116 size_t overflow on (unusual) hosts where SIZE_MAX <= min
10117 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
10118 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 10119
c9d624c6
PE
10120 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
10121 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 10122 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 10123
353032ce
PE
10124 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
10125
2bccce07
PE
10126 * alloc.c (Fmake_string): Check for out-of-range init.
10127
0ac30604
SM
101282011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
10129
10130 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
10131
c195f2de
JD
101322011-06-14 Jan Djärv <jan.h.d@swipnet.se>
10133
10134 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
10135 xg_get_default_scrollbar_width.
10136
10137 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
10138 (int_gtk_range_get_value): Move to the scroll bar part of the file.
10139 (style_changed_cb): Call update_theme_scrollbar_width and call
10140 x_set_scroll_bar_default_width and xg_frame_set_char_size for
10141 all frames (Bug#8505).
10142 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
10143 Call gtk_window_set_resizable if HAVE_GTK3.
10144 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
10145 and height if HAVE_GTK3 (Bug#8505).
10146 (scroll_bar_width_for_theme): New variable.
10147 (update_theme_scrollbar_width): New function.
10148 (xg_get_default_scrollbar_width): Move code to
10149 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
10150 (xg_initialize): Call update_theme_scrollbar_width.
10151
10152 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
10153
10154 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
10155
e10ac9f1
MR
101562011-06-12 Martin Rudalics <rudalics@gmx.at>
10157
10158 * frame.c (make_frame): Call other_buffer_safely instead of
10159 other_buffer.
10160
10161 * window.c (temp_output_buffer_show): Call display_buffer with
10162 second argument Vtemp_buffer_show_specifiers and reset latter
10163 immediately after the call.
10164 (Vtemp_buffer_show_specifiers): New variable.
10165 (auto_window_vscroll_p, next_screen_context_lines)
10166 (Vscroll_preserve_screen_position): Remove leading asterisks from
10167 doc-strings.
10168
2d3c217e 101692011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 10170
7b7f97e8 10171 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
10172 * buffer.c (Qclone_number): Remove for now, as it's unused.
10173 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
10174 (record_buffer): Remove unused local.
10175 * frame.c (other_visible_frames, frame_buffer_list): Now static.
10176 (set_frame_buffer_list): Remove; unused.
10177 * frame.h (other_visible_frames): Remove decl.
10178 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
10179 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
10180 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
10181 if HAVE_GPM.
10182 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
10183 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
10184 Define only if HAVE_GPM.
10185 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
10186 (update_hints_inhibit): Remove; never set. All uses removed.
10187 * widgetprv.h (emacsFrameClassRec): Remove decl.
10188 * window.c (delete_deletable_window): Now returns void, since it
10189 wasn't returning anything.
10190 (compare_window_configurations): Remove unused locals.
10191 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
10192 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
10193 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
10194 the same widths as pointers. This follows up on the 2011-05-06 patch.
10195 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
10196 * xterm.h: Likewise.
10197 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
10198
1384b89e
JB
101992011-06-12 Juanma Barranquero <lekktu@gmail.com>
10200
10201 * makefile.w32-in: Update dependencies.
10202 (LISP_H): Add lib/intprops.h.
10203
1100a63c
CY
102042011-06-11 Chong Yidong <cyd@stupidchicken.com>
10205
10206 * image.c (gif_load): Add animation frame delay to the metadata.
10207 (syms_of_image): Use DEFSYM. New symbol `delay'.
10208
6198ccd0
MR
102092011-06-11 Martin Rudalics <rudalics@gmx.at>
10210
10211 * window.c (delete_deletable_window): Re-add.
10212 (Fset_window_configuration): Rewrite to handle dead buffers and
10213 consequently deletable windows.
10214 (window_tree, Fwindow_tree): Remove. Supply functionality in
10215 window.el.
10216 (compare_window_configurations): Simplify code.
10217
b6e3633c
AS
102182011-06-11 Andreas Schwab <schwab@linux-m68k.org>
10219
1ab0dee5
AS
10220 * image.c (imagemagick_load_image): Fix type mismatch.
10221 (Fimagemagick_types): Likewise.
10222
b6e3633c
AS
10223 * window.h (replace_buffer_in_windows): Declare.
10224
9397e56f
MR
102252011-06-11 Martin Rudalics <rudalics@gmx.at>
10226
10227 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
10228 Qclone_number. Remove external declaration of Qdelete_window.
10229 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
10230 code.
640c8776
SM
10231 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
10232 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
10233 (Fother_buffer): Rewrite doc-string. Major rewrite for new
10234 buffer list implementation.
10235 (other_buffer_safely): New function.
10236 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
10237 calls to replace_buffer_in_windows and
10238 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
10239 if allowed.
10240 (record_buffer): Inhibit quitting and rewrite using quittable
10241 functions. Run Qbuffer_list_update_hook if allowed.
10242 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
10243 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
10244 Move switch-to-buffer to window.el.
9397e56f
MR
10245 (bury-buffer): Move to window.el.
10246 (Vbuffer_list_update_hook): New variable.
10247
10248 * lisp.h (other_buffer_safely): Add prototype in buffer.c
10249 section.
10250
10251 * window.h (resize_frame_windows): Move up in code.
10252 (Fwindow_frame): Remove EXFUN.
10253 (replace_buffer_in_all_windows): Remove prototype.
10254 (replace_buffer_in_windows_safely): Add prototype.
10255
10256 * window.c: Declare Qdelete_window static again. Move down
10257 declaration of select_count.
10258 (Fnext_window, Fprevious_window): Rewrite doc-strings.
10259 (Fother_window): Move to window.el.
10260 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
10261 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
10262 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
10263 window.el.
10264 (replace_buffer_in_windows): Implement by calling
10265 Qreplace_buffer_in_windows.
10266 (replace_buffer_in_all_windows): Remove with some functionality
10267 moved into replace_buffer_in_windows_safely.
10268 (replace_buffer_in_windows_safely): New function.
10269 (select_window_norecord, select_frame_norecord): Move in front
10270 of run_window_configuration_change_hook. Remove now obsolete
10271 declarations.
640c8776
SM
10272 (Fset_window_buffer): Rewrite doc-string.
10273 Call Qrecord_window_buffer.
9397e56f
MR
10274 (keys_of_window): Move binding for other-window to window.el.
10275
b50691aa
CY
102762011-06-11 Chong Yidong <cyd@stupidchicken.com>
10277
10278 * dispextern.h (struct image): Replace data member, whose int_val
10279 and ptr_val fields were not used by anything, with a single
10280 lisp_val object.
10281
10282 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
10283 (gif_clear_image, gif_load, imagemagick_load_image)
10284 (gs_clear_image, gs_load): Callers changed.
10285
3f754b86
PE
102862011-06-10 Paul Eggert <eggert@cs.ucla.edu>
10287
cca69397
PE
10288 * buffer.h: Include <time.h>, for time_t.
10289 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
10290
109e28d0
PE
10291 Fix minor problems found by static checking.
10292
60737f02
PE
10293 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
10294
4b66faf3
PE
10295 Make identifiers static if they are not used in other modules.
10296 * data.c (Qcompiled_function, Qframe, Qvector):
10297 * image.c (QimageMagick, Qsvg):
10298 * minibuf.c (Qmetadata):
10299 * window.c (resize_window_check, resize_root_window): Now static.
10300 * window.h (resize_window_check, resize_root_window): Remove decls.
10301
109e28d0
PE
10302 * window.c (window_deletion_count, delete_deletable_window):
10303 Remove; unused.
46a4ce9e
PE
10304 (window_body_lines): Now static.
10305 (Fdelete_other_windows_internal): Mark vars as initialized.
10306 Make sure 'resize_failed' is initialized.
10307 (run_window_configuration_change_hook): Rename local to avoid shadowing.
10308 (resize_window_apply): Remove unused local.
10309 * window.h (delete_deletable_window): Remove decl.
10310
109e28d0 10311 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
10312 (imagemagick_load_image): Fix pointer signedness problem by changing
10313 last arg from unsigned char * to char *. All uses changed.
10314 Also, fix a local for similar reasons.
10315 Remove unused locals. Remove locals to avoid shadowing.
10316 (fn_rsvg_handle_free): Remove; unused.
10317 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 10318 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 10319
3f754b86
PE
10320 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
10321
2547adb1
CY
103222011-06-10 Chong Yidong <cyd@stupidchicken.com>
10323
10324 * image.c (gif_load): Fix omitted cast error introduced by
10325 2011-06-06 change.
10326
2c8e37d4
MR
103272011-06-10 Martin Rudalics <rudalics@gmx.at>
10328
10329 * window.h (resize_proportionally, orig_total_lines)
10330 (orig_top_line): Remove from window structure.
10331 (set_window_height, set_window_width, change_window_heights)
10332 (Fdelete_window): Remove prototypes.
10333 (resize_frame_windows): Remove duplicate declaration.
10334
440a42e3
EZ
103352011-06-10 Eli Zaretskii <eliz@gnu.org>
10336
10337 * window.h (resize_frame_windows, resize_window_check)
10338 (delete_deletable_window, resize_root_window)
10339 (resize_frame_windows): Declare prototypes.
10340
10341 * window.c (resize_window_apply): Make definition be "static" to
10342 match the prototype.
10343
562dd5e9
MR
103442011-06-10 Martin Rudalics <rudalics@gmx.at>
10345
10346 * window.c: Remove declarations of Qwindow_size_fixed,
10347 window_min_size_1, window_min_size_2, window_min_size,
10348 size_window, window_fixed_size_p, enlarge_window, delete_window.
10349 Remove static from declaration of Qdelete_window, it's
10350 temporarily needed by Fbury_buffer.
10351 (replace_window): Don't assign orig_top_line and
10352 orig_total_lines.
10353 (Fdelete_window, delete_window): Remove. Window deletion is
10354 handled by window.el.
640c8776
SM
10355 (window_loop): Remove DELETE_OTHER_WINDOWS case.
10356 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
10357 (Fdelete_other_windows): Remove. Deleting other windows is
10358 handled by window.el.
10359 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
10360 handled in window.el.
10361 (window_min_size_2, window_min_size_1, window_min_size): Remove.
10362 Window minimum sizes are handled in window.el.
10363 (shrink_windows, size_window, set_window_height)
10364 (set_window_width, change_window_heights, window_height)
10365 (window_width, CURBEG, CURSIZE, enlarge_window)
10366 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
10367 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
10368 handled in window.el.
10369 (make_dummy_parent): Rename to make_parent_window and give it a
10370 second argument horflag.
10371 (make_window): Don't set resize_proportionally any more.
10372 (Fsplit_window): Remove. Windows are split in window.el.
10373 (save_restore_action, save_restore_orig_size)
10374 (shrink_window_lowest_first, save_restore_orig_size): Remove.
10375 Resize mini windows in window.el.
10376 (grow_mini_window, shrink_mini_window): Implement by calling
10377 Qresize_root_window_vertically, resize_window_check and
10378 resize_window_apply.
640c8776
SM
10379 (saved_window, Fset_window_configuration, save_window_save):
10380 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
10381 resize_proportionally.
10382 (window_min_height, window_min_width): Move to window.el.
10383 (keys_of_window): Move bindings for delete-other-windows,
10384 split-window, delete-window and enlarge-window to window.el.
10385
10386 * buffer.c: Temporarily extern Qdelete_window.
10387 (Fbury_buffer): Temporarily call Qdelete_window instead of
10388 Fdelete_window (Fbury_buffer will move to window.el soon).
10389
10390 * frame.c (set_menu_bar_lines_1): Remove code handling
10391 orig_top_line and orig_total_lines.
10392
10393 * dispnew.c (adjust_frame_glyphs_initially): Don't use
10394 set_window_height but set heights directly.
10395 (change_frame_size_1): Use resize_frame_windows.
10396
10397 * xdisp.c (init_xdisp): Don't use set_window_height but set
10398 heights directly.
10399
640c8776
SM
10400 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
10401 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
10402 run_window_configuration_change_hook.
10403
10404 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
10405 instead of change_window_heights and run
10406 run_window_configuration_change_hook.
10407
1a13852e
MR
104082011-06-09 Martin Rudalics <rudalics@gmx.at>
10409
10410 * window.c (replace_window): Rename second argument REPLACEMENT to
10411 NEW. New third argument SETFLAG. Rewrite.
10412 (delete_window, make_dummy_parent): Call replace_window with
10413 third argument 1.
10414 (window_list_1): Move down in code.
10415 (run_window_configuration_change_hook): Move set_buffer part
10416 before select_frame_norecord part in order to unwind correctly.
10417 Rename count1 to count.
10418 (recombine_windows, delete_deletable_window, resize_root_window)
10419 (Fdelete_other_windows_internal)
10420 (Frun_window_configuration_change_hook, make_parent_window)
10421 (resize_window_check, resize_window_apply, Fresize_window_apply)
10422 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
10423 (Fdelete_window_internal, Fresize_mini_window_internal):
10424 New functions.
1a13852e
MR
10425 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
10426
f3d1777e
MR
104272011-06-08 Martin Rudalics <rudalics@gmx.at>
10428
496e208e
MR
10429 * window.h (window): Add some new members to window structure -
10430 normal_lines, normal_cols, new_total, new_normal, clone_number,
10431 splits, nest, prev_buffers, next_buffers.
10432 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 10433 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 10434
f3d1777e
MR
10435 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
10436 Remove.
496e208e
MR
10437 (make_dummy_parent): Set new members of windows structure.
10438 (make_window): Move down in code. Handle new members of window
10439 structure.
10440 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
10441 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
10442 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
10443 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
10444 (Fset_window_next_buffers, Fset_window_clone_number):
10445 New functions.
496e208e
MR
10446 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
10447 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
10448 Doc-string fixes.
10449 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
10450 Argument WINDOW can be now internal window too.
10451 (Fwindow_use_time): Move up in code.
10452 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
10453 Rewrite doc-string.
10454 (Fset_window_configuration, saved_window)
10455 (Fcurrent_window_configuration, save_window_save): Handle new
10456 members of window structure.
b9e809c2
MR
10457 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
10458 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
10459 (syms_of_window): New Lisp objects Qrecord_window_buffer,
10460 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
10461 Qget_mru_window, Qresize_root_window,
10462 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
10463 Qauto_buffer_name; staticpro them.
f3d1777e 10464
abde8f8c
MR
104652011-06-07 Martin Rudalics <rudalics@gmx.at>
10466
10467 * window.c (Fwindow_total_size, Fwindow_left_column)
10468 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
10469 (Fwindow_list_1): New functions.
10470 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
10471 (Fwindow_width, Fscroll_left, Fscroll_right):
10472 Use window_body_cols instead of window_box_text_cols.
10473 (delete_window, Fset_window_configuration):
10474 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
10475 (delete_all_subwindows): Take a window as argument and not a
10476 structure. Rewrite.
190b47e6
MR
10477 (window_loop): Remove handling of GET_LRU_WINDOW and
10478 GET_LARGEST_WINDOW.
10479 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
10480
10481 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
10482 window_box_text_cols. delete_all_subwindows now takes a
10483 Lisp_Object as argument.
abde8f8c 10484
640c8776
SM
10485 * indent.c (compute_motion, Fcompute_motion):
10486 Use window_body_cols instead of window_box_text_cols.
abde8f8c 10487
fa8a67e6
MR
10488 * frame.c (delete_frame): Call delete_all_subwindows with root
10489 window as argument.
10490
a54e3482
DC
104912011-06-07 Daniel Colascione <dan.colascione@gmail.com>
10492
10493 * fns.c (Fputhash): Document return value.
10494
60002bf5
CY
104952011-06-06 Chong Yidong <cyd@stupidchicken.com>
10496
10497 * image.c (gif_load): Implement gif89a spec "no disposal" method.
10498
0c671da6 104992011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 10500
b862a52a 10501 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 10502
be44ca6c
PE
10503 Check for overflow when converting integer to cons and back.
10504 * charset.c (Fdefine_charset_internal, Fdecode_char):
10505 Use cons_to_unsigned to catch overflow.
10506 (Fencode_char): Use INTEGER_TO_CONS.
10507 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
10508 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
10509 * data.c (long_to_cons, cons_to_long): Remove.
10510 (cons_to_unsigned, cons_to_signed): New functions.
10511 These signal an error for invalid or out-of-range values.
10512 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
10513 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
10514 * font.c (Ffont_variation_glyphs):
10515 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
10516 * lisp.h: Include <intprops.h>.
10517 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
10518 (cons_to_signed, cons_to_unsigned): New decls.
10519 (long_to_cons, cons_to_long): Remove decls.
10520 * undo.c (record_first_change): Use INTEGER_TO_CONS.
10521 (Fprimitive_undo): Use CONS_TO_INTEGER.
10522 * xfns.c (Fx_window_property): Likewise.
10523 * xselect.c: Include <limits.h>.
10524 (x_own_selection, selection_data_to_lisp_data):
10525 Use INTEGER_TO_CONS.
10526 (x_handle_selection_request, x_handle_selection_clear)
10527 (x_get_foreign_selection, Fx_disown_selection_internal)
10528 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
10529 (lisp_data_to_selection_data): Use cons_to_unsigned.
10530 (x_fill_property_data): Use cons_to_signed.
10531 Report values out of range.
10532
d1f3d2af
PE
10533 Check for buffer and string overflow more precisely.
10534 * buffer.h (BUF_BYTES_MAX): New macro.
10535 * lisp.h (STRING_BYTES_MAX): New macro.
10536 * alloc.c (Fmake_string):
10537 * character.c (string_escape_byte8):
10538 * coding.c (coding_alloc_by_realloc):
10539 * doprnt.c (doprnt):
10540 * editfns.c (Fformat):
10541 * eval.c (verror):
10542 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
10543 since they may not be the same number.
10544 * editfns.c (Finsert_char):
10545 * fileio.c (Finsert_file_contents):
10546 Likewise for BUF_BYTES_MAX.
10547
dd52fcea
PE
10548 * image.c: Use ptrdiff_t, not int, for sizes.
10549 (slurp_file): Switch from int to ptrdiff_t.
10550 All uses changed.
10551 (slurp_file): Check that file size fits in both size_t (for
10552 malloc) and ptrdiff_t (for sanity and safety).
10553
7f9bbdbb
PE
10554 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
10555 if b->modtime has its maximal value.
10556
dfe18f82
PE
10557 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
10558
84acfcf0
PE
10559 Don't assume time_t can fit into int.
10560 * buffer.h (struct buffer.modtime): Now time_t, not int.
10561 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
10562 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
10563
ccd9a01a
PE
10564 Minor fixes for signed vs unsigned integers.
10565 * character.h (MAYBE_UNIFY_CHAR):
10566 * charset.c (maybe_unify_char):
10567 * keyboard.c (read_char, reorder_modifiers):
10568 XINT -> XFASTINT, since the integer must be nonnegative.
10569 * ftfont.c (ftfont_spec_pattern):
10570 * keymap.c (access_keymap, silly_event_symbol_error):
10571 XUINT -> XFASTINT, since the integer must be nonnegative.
10572 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
10573 since it makes no difference and we prefer signed.
10574 * keyboard.c (record_char): Use XUINT when all the neighbors do.
10575 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
10576 nonnegative.
10577
d6d100dd
SM
105782011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
10579
10580 * window.h (Fwindow_frame): Declare.
10581
2b6148e4
PE
105822011-06-06 Paul Eggert <eggert@cs.ucla.edu>
10583
10584 * alloc.c: Simplify handling of large-request failures (Bug#8800).
10585 (SPARE_MEMORY): Always define.
10586 (LARGE_REQUEST): Remove.
10587 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
10588
f230ecc9
MR
105892011-06-06 Martin Rudalics <rudalics@gmx.at>
10590
727e958e
MR
10591 * lisp.h: Move EXFUNS for Fframe_root_window,
10592 Fframe_first_window and Fset_frame_selected_window to window.h.
10593
10594 * window.h: Move EXFUNS for Fframe_root_window,
10595 Fframe_first_window and Fset_frame_selected_window here from
10596 lisp.h.
10597
10598 * frame.c (Fwindow_frame, Fframe_first_window)
10599 (Fframe_root_window, Fframe_selected_window)
10600 (Fset_frame_selected_window): Move to window.c.
10601 (Factive_minibuffer_window): Move to minibuf.c.
10602 (Fother_visible_frames_p): New function.
10603
10604 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
10605
f230ecc9
MR
10606 * window.c (decode_window, decode_any_window): Move up in code.
10607 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
10608 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
10609 (Fwindow_buffer): Move up and rewrite doc-string.
10610 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
10611 (Fwindow_prev): New functions.
727e958e
MR
10612 (Fwindow_frame): Move here from frame.c. Accept any window as
10613 argument.
10614 (Fframe_root_window, Fframe_first_window)
10615 (Fframe_selected_window): Move here from frame.c. Accept frame
10616 or arbitrary window as argument. Update doc-strings.
10617 (Fminibuffer_window): Move up in code.
10618 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
10619 (Fset_frame_selected_window): Move here from frame.c.
10620 Marginal rewrite.
727e958e
MR
10621 (Fselected_window, select_window, Fselect_window): Move up in
10622 code. Minor doc-string fixes.
f230ecc9 10623
4d09bcf6
PE
106242011-06-06 Paul Eggert <eggert@cs.ucla.edu>
10625
10626 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
10627 Do not assume that spare memory exists; that assumption is valid
10628 only if SYSTEM_MALLOC.
10629 (LARGE_REQUEST): New macro, so that the issue of large requests
10630 is separated from the issue of spare memory.
10631
810928a2
AS
106322011-06-05 Andreas Schwab <schwab@linux-m68k.org>
10633
172418ad
AS
10634 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
10635 format. (Bug#8806)
10636
43f862f7
AS
10637 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
10638
810928a2
AS
10639 * xfns.c (x_set_scroll_bar_default_width): Move declarations
10640 before statements.
10641
a059fe24
JD
106422011-06-05 Jan Djärv <jan.h.d@swipnet.se>
10643
10644 * gtkutil.c (xg_get_default_scrollbar_width): New function.
10645
10646 * gtkutil.h: Declare xg_get_default_scrollbar_width.
10647
10648 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
10649 min width by calling x_set_scroll_bar_default_width (Bug#8505).
10650
989bf368
JB
106512011-06-05 Juanma Barranquero <lekktu@gmail.com>
10652
10653 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
10654
4b80f674
CY
106552011-06-04 Chong Yidong <cyd@stupidchicken.com>
10656
10657 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
10658 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
10659 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
10660 New error handlers.
4b80f674
CY
10661 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
10662 Obey Vx_select_enable_clipboard_manager. Catch errors in
10663 x_clipboard_manager_save (Bug#8779).
10664 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 10665 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 10666
99a33b77 106672011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
10668
10669 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
10670
99a33b77 106712011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
10672
10673 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
10674 in the current matrix if keep_current_p is non-zero.
10675
8264569d
EZ
106762011-06-04 Eli Zaretskii <eliz@gnu.org>
10677
10678 * bidi.c (bidi_level_of_next_char): Fix last change.
10679
57f97249
EZ
106802011-06-03 Eli Zaretskii <eliz@gnu.org>
10681
fec2107c 10682 Support bidi reordering of text covered by display properties.
57f97249 10683
fec2107c
EZ
10684 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
10685 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
10686 (bidi_cache_search, bidi_cache_iterator_state)
10687 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
10688 (bidi_level_of_next_char, bidi_move_to_visually_next):
10689 Support character positions inside a run of characters covered by a
fec2107c
EZ
10690 display string.
10691 (bidi_paragraph_init, bidi_resolve_explicit_1)
10692 (bidi_level_of_next_char): Call bidi_fetch_char and
10693 bidi_fetch_char_advance instead of FETCH_CHAR and
10694 FETCH_CHAR_ADVANCE.
10695 (bidi_init_it): Initialize new members.
10696 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
10697 definitions.
10698 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
10699 instead of using explicit *_CHAR codes.
d6d100dd
SM
10700 (bidi_resolve_explicit, bidi_resolve_weak):
10701 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
10702 bidirectional text is supported only in multibyte buffers.
10703 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
10704 it to initialize the frame_window_p member of struct bidi_it.
10705 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
10706 (bidi_resolve_explicit, bidi_resolve_weak)
10707 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
10708 bidi_it->nchars is non-positive.
10709 (bidi_level_of_next_char): Don't try to lookup the cache for the
10710 next/previous character if nothing is cached there yet, or if we
10711 were just reseat()'ed to a new position.
c40e2fb2 10712
0e14fe90
EZ
10713 * xdisp.c (set_cursor_from_row): Set start and stop points
10714 according to the row's direction when priming the loop that looks
10715 for the glyph on which to display cursor.
10716 (single_display_spec_intangible_p): Function deleted.
10717 (display_prop_intangible_p): Reimplement to call
10718 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
10719 Accept 3 additional arguments needed by handle_display_spec.
10720 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
10721 values: lists, `(when COND...)' forms, etc.
10722 (single_display_spec_string_p): Support property values that are
10723 lists with the argument STRING its top-level element.
10724 (display_prop_string_p): Fix the condition for processing a
10725 property that is a list to be consistent with handle_display_spec.
fec2107c 10726 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
10727 last portion of handle_display_prop.
10728 (compute_display_string_pos): Accept additional argument
10729 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
10730 value of a `display' property is a "replacing spec".
10731 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
10732 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
10733 the display property, but just return a value indicating whether
10734 the display property will replace the characters it covers.
10735 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
10736 frame_window_p members of struct bidi_it.
d6d100dd
SM
10737 (compute_display_string_pos, compute_display_string_end):
10738 New functions.
fec2107c
EZ
10739 (push_it): Accept second argument POSITION, where pop_it should
10740 jump to continue iteration.
10741 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 10742
fec2107c
EZ
10743 * keyboard.c (adjust_point_for_property): Adjust the call to
10744 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
10745
10746 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
10747 (bidi_init_it): Update prototypes.
10748 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
10749 (compute_display_string_pos, compute_display_string_end):
10750 Declare prototypes.
fec2107c
EZ
10751 (struct bidi_it): New members nchars and disp_pos. ch_len is now
10752 EMACS_INT.
fc6f18ce 10753
40087514 107542011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 10755
57f53182
PE
10756 Malloc failure behavior now depends on size of allocation.
10757 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
10758 * lisp.h: Change signatures accordingly.
10759 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
10760 All callers changed. (Bug#8762)
10761
10762 * gnutls.c: Use Emacs's memory allocators.
10763 Without this change, the gnutls library would invoke malloc etc.
10764 directly, which causes problems on non-SYNC_INPUT hosts, and which
10765 runs afoul of improving memory_full behavior. (Bug#8761)
10766 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
10767 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
10768 xfree instead of the default malloc, realloc, free.
10769 (Fgnutls_boot): No need to check for memory allocation failure,
10770 since xmalloc does that for us.
10771
ac32cd99 10772 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
10773 * category.c (hash_get_category_set):
10774 * ccl.c (ccl_driver):
10775 * charset.c (Fdefine_charset_internal):
10776 * charset.h (struct charset.hash_index):
10777 * composite.c (get_composition_id, gstring_lookup_cache)
10778 (composition_gstring_put_cache):
10779 * composite.h (struct composition.hash_index):
10780 * dispextern.h (struct image.hash):
10781 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
10782 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
10783 (hashfn_equal, hashfn_user_defined, make_hash_table)
10784 (maybe_resize_hash_table, hash_lookup, hash_put)
10785 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
10786 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
10787 (Fsxhash, Fgethash, Fputhash, Fmaphash):
10788 * image.c (make_image, search_image_cache, lookup_image)
10789 (xpm_put_color_table_h):
10790 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 10791 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 10792 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 10793 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
10794 * alloc.c (allocate_vectorlike):
10795 Check for overflow in vector size calculations.
10796 * ccl.c (ccl_driver):
10797 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
10798 * fns.c, image.c: Remove unnecessary static decls that would otherwise
10799 need to be updated by these changes.
40087514
PE
10800 * fns.c (make_hash_table, maybe_resize_hash_table):
10801 Check for integer overflow with large hash tables.
0de4bb68
PE
10802 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
10803 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
10804 (SXHASH_REDUCE): New macro.
10805 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
10806 Use it instead of discarding useful hash info with large hash values.
10807 (sxhash_float): New function.
10808 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
10809 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
10810 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
10811 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
10812 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
10813 Adjust signatures to match updated version of code.
10814 (consing_since_gc): Now EMACS_INT, since a single hash table can
10815 use more than INT_MAX bytes.
10816
698d32e2
DN
108172011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
10818
10819 Make it possible to build with GCC-4.6+ -O2 -flto.
10820
10821 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
10822
fd6fa53f
SM
108232011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
10824
10825 * minibuf.c (get_minibuffer, read_minibuf_unwind):
10826 Call minibuffer-inactive-mode.
10827
864db017
JB
108282011-05-31 Juanma Barranquero <lekktu@gmail.com>
10829
10830 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
10831 Update dependencies.
10832
2ad0baf4
DN
108332011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10834
10835 * data.c (init_data): Remove code for UTS, this system is not
10836 supported anymore.
10837
4fcc2638
DN
108382011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10839
10840 Don't force ./temacs to start in terminal mode.
10841
10842 * frame.c (make_initial_frame): Initialize faces in all cases, not
10843 only when CANNOT_DUMP is defined.
10844 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
10845
c56e0fd5
DN
108462011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10847
10848 * dispnew.c (add_window_display_history): Use const for the string
10849 pointer. Remove declaration, not needed.
10850
333d54da 108512011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 10852
55d4c1b2 10853 Use 'inline', not 'INLINE'.
333d54da 10854 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
10855 * alloc.c, fontset.c (INLINE): Remove.
10856 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
10857 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
10858 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
10859 * gmalloc.c (register_heapinfo): Use inline unconditionally.
10860 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
10861
738db178
DN
108622011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10863
10864 Make it possible to run ./temacs.
10865
10866 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
10867 syms_of_callproc does the same thing. Remove test for
10868 "initialized", do it in the caller.
10869 * emacs.c (main): Avoid calling set_initial_environment when dumping.
10870
620c53a6
SM
108712011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
10872
10873 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
10874 (read_minibuf): Use get_minibuffer.
10875 (syms_of_minibuf): Use DEFSYM.
10876 (Qmetadata): New var.
10877 * data.c (Qbuffer): Don't make it static.
10878 (syms_of_data): Use DEFSYM.
10879
e003a292
PE
108802011-05-31 Paul Eggert <eggert@cs.ucla.edu>
10881
10882 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
10883 (CCL_CODE_MIN): New macro.
10884
ed008a6d
PE
108852011-05-30 Paul Eggert <eggert@cs.ucla.edu>
10886
3687c2ef
PE
10887 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
10888
ed008a6d
PE
10889 * eval.c (Qdebug): Now static.
10890 * lisp.h (Qdebug): Remove decl. This reverts a part of the
10891 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
10892 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
10893
d66c4c7c
CY
108942011-05-29 Chong Yidong <cyd@stupidchicken.com>
10895
10896 * image.c: Various fixes to ImageMagick code comments.
10897 (Fimagemagick_types): Doc fix.
10898
5fbc2025
PE
108992011-05-29 Paul Eggert <eggert@cs.ucla.edu>
10900
0196f88a
PE
10901 Minor fixes prompted by GCC 4.6.0 warnings.
10902
10903 * xselect.c (converted_selections, conversion_fail_tag): Now static.
10904
5fbc2025
PE
10905 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
10906 (x_clipboard_manager_save_all): Move extern decl to ...
10907 * xterm.h: ... here, so that it can be checked for consistency.
10908
1dd3c2d9
CY
109092011-05-29 Chong Yidong <cyd@stupidchicken.com>
10910
10911 * xselect.c (x_clipboard_manager_save_frame)
10912 (x_clipboard_manager_save_all): New functions.
10913 (Fx_clipboard_manager_save): Lisp function deleted.
10914
10915 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
10916 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
10917
10918 * xterm.h: Update prototype.
10919
5ba6571d
WX
109202011-05-28 William Xu <william.xwl@gmail.com>
10921
10922 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
10923 exiting (Bug#8239).
10924
3eaff834
JM
109252011-05-28 Jim Meyering <meyering@redhat.com>
10926
e1900994 10927 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
10928 * fns.c (to_uchar): Define.
10929 (crypto_hash_function): Use it to convert some newly-signed
10930 variables to unsigned, to avoid sign-extension bugs. For example,
10931 without this change, (md5 "truc") would evaluate to
10932 45723a2aff78ff4fff7fff1114760e62 rather than the expected
10933 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 10934 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 10935
0f6990a7
PE
109362011-05-27 Paul Eggert <eggert@cs.ucla.edu>
10937
10938 Integer overflow fixes.
c8a9ca5a 10939
08686060
PE
10940 * dbusbind.c: Serial number integer overflow fixes.
10941 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
10942 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
10943 to hold a serial number that is too large for a fixnum.
10944 (Fdbus_method_return_internal, Fdbus_method_error_internal):
10945 Check for serial numbers out of range. Decode any serial number
59568bf0 10946 that was so large that it became a float. (Bug#8722)
08686060 10947
2d1fc3c7
PE
10948 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
10949 (Fdbus_call_method, Fdbus_call_method_asynchronously):
10950 Use XFASTINT rather than XUINT when numbers are nonnegative.
10951 (xd_append_arg, Fdbus_method_return_internal):
10952 (Fdbus_method_error_internal): Likewise. Also, for unsigned
10953 arguments, check that Lisp number is nonnegative, rather than
59568bf0 10954 silently wrapping negative numbers around. (Bug#8722)
30217ff0 10955 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 10956 (Bug#8722)
2d1fc3c7 10957
c8a9ca5a
PE
10958 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
10959
519e1d69
PE
10960 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
10961
6df6ae42 10962 ccl: Add integer overflow checks.
30569699
PE
10963 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
10964 (IN_INT_RANGE): New macros.
10965 (ccl_driver): Use them to check for integer overflow when
10966 decoding a CCL program. Many of the new checks are whether XINT (x)
10967 fits in int; it doesn't always, on 64-bit hosts. The new version
10968 doesn't catch all possible integer overflows, but it's an
847044ea 10969 improvement. (Bug#8719)
30569699 10970
c11285dc
PE
10971 * alloc.c (make_event_array): Use XINT, not XUINT.
10972 There's no need for unsigned here.
10973
fdccd48e
PE
10974 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
10975 This follows up to the 2011-05-06 change that substituted uintptr_t
10976 for EMACS_INT. This case wasn't caught back then.
10977
37910ab2
PE
10978 Rework Fformat to avoid integer overflow issues.
10979 * editfns.c: Include <float.h> unconditionally, as it's everywhere
10980 now (part of C89). Include <verify.h>.
10981 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
10982 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
10983 (Fformat): Avoid the prepass trying to compute sizes; it was only
10984 approximate and thus did not catch overflow reliably. Instead, walk
10985 through the format just once, formatting and computing sizes as we go,
10986 checking for integer overflow at every step, and allocating a larger
10987 buffer as needed. Keep track separately whether the format is
10988 multibyte. Keep only the most-recently calculated precision, rather
10989 than them all. Record whether each argument has been converted to
10990 string. Use EMACS_INT, not int, for byte and char and arg counts.
10991 Support field widths and precisions larger than INT_MAX. Avoid
10992 sprintf's undefined behavior with conversion specifications such as %#d
10993 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
10994 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
10995 formatting out-of-range floating point numbers with int
9173deec 10996 formats. (Bug#8668)
37910ab2 10997
2e6578fb
PE
10998 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
10999
0ae6bdee
PE
11000 * data.c: Avoid integer truncation in expressions involving floats.
11001 * data.c: Include <intprops.h>.
11002 (arith_driver): When there's an integer overflow in an expression
11003 involving floating point, convert the integers to floating point
11004 so that the resulting value does not suffer from catastrophic
11005 integer truncation. For example, on a 64-bit host (* 4
11006 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
11007 Do not rely on undefined behavior after integer overflow.
11008
de883a70
PE
11009 merge count_size_as_multibyte, parse_str_to_multibyte
11010 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 11011 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
11012 Check for integer overflow.
11013 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
11014 since it's now a duplicate of the other. This is more of
11015 a character than a buffer op, so better that it's in character.c.
11016 * fns.c, print.c: Adjust to above changes.
11017
2ff916cb
PE
110182011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
11019
11020 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
11021
f1b54466
PE
110222011-05-27 Paul Eggert <eggert@cs.ucla.edu>
11023
fb1ac845
PE
11024 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
11025 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
11026 (x_clipboard_manager_save): Now static.
11027 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
11028
f1b54466
PE
11029 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
11030 (crypto_hash_function): Now static.
11031 Fix pointer signedness problems. Avoid unnecessary initializations.
11032
a9f737ee
CY
110332011-05-27 Chong Yidong <cyd@stupidchicken.com>
11034
11035 * termhooks.h (Vselection_alist): Make it terminal-local.
11036
11037 * terminal.c (create_terminal): Initialize it.
11038
11039 * xselect.c: Support for clipboard managers.
11040 (Vselection_alist): Move to termhooks.h as terminal-local var.
11041 (LOCAL_SELECTION): New macro.
11042 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
11043 (symbol_to_x_atom): Remove gratuitous arg.
11044 (x_handle_selection_request, lisp_data_to_selection_data)
11045 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
11046 (x_own_selection, x_get_local_selection, x_convert_selection):
11047 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
11048 (some_frame_on_display): Delete unused function.
11049 (Fx_own_selection_internal, Fx_get_selection_internal)
11050 (Fx_disown_selection_internal, Fx_selection_owner_p)
11051 (Fx_selection_exists_p): New optional frame arg.
11052 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
11053 (x_handle_selection_clear): Don't treat other terminals with the
11054 same keyboard specially. Use the terminal-local Vselection_alist.
11055 (x_clear_frame_selections): Use Frun_hook_with_args.
11056
11057 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
11058
11059 * xterm.h: Add support for those atoms.
11060
e067f0c1
CY
110612011-05-26 Chong Yidong <cyd@stupidchicken.com>
11062
11063 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
11064 (converted_selections, conversion_fail_tag): New global variables.
11065 (x_selection_request_lisp_error): Free the above.
11066 (x_get_local_selection): Remove unnecessary code.
11067 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
11068 of converted selections stored in converted_selections.
11069 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
11070 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
11071 (x_convert_selection): New function.
11072 (x_handle_selection_event): Simplify.
11073 (x_get_foreign_selection): Don't ignore incoming requests while
11074 waiting for an answer; this will fail when we implement
11075 SAVE_TARGETS, and seems unnecessary anyway.
11076 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
11077 (Vx_sent_selection_functions): Doc fix.
11078
0f4aebc0
LL
110792011-05-26 Leo Liu <sdl.web@gmail.com>
11080
11081 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
11082
e61124cd
YM
110832011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11084
11085 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
11086
11087 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
11088 for fringe update if it has periodic bitmap.
ac389d0c 11089 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
11090 and fringe_bitmap_periodic_p.
11091
11092 * fringe.c (get_fringe_bitmap_data): New function.
11093 (draw_fringe_bitmap_1, update_window_fringes): Use it.
11094 (update_window_fringes): Record periodicity of fringe bitmap in glyph
11095 row. Mark glyph row for fringe update if periodicity changed.
11096
11097 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
11098 for fringe update unless it has periodic bitmap.
11099
f16d9837
KH
111002011-05-25 Kenichi Handa <handa@m17n.org>
11101
11102 * xdisp.c (get_next_display_element): Set correct it->face_id for
11103 a static composition.
11104
e1b90ef6
LL
111052011-05-24 Leo Liu <sdl.web@gmail.com>
11106
11107 * deps.mk (fns.o):
11108 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
11109
11110 * fns.c (crypto_hash_function, Fsha1): New function.
11111 (Fmd5): Use crypto_hash_function.
11112 (syms_of_fns): Add Ssha1.
11113
7400048f
PE
111142011-05-22 Paul Eggert <eggert@cs.ucla.edu>
11115
11116 * gnutls.c: Remove unused macros.
11117 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
11118 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
11119 Remove macros that are defined and never used.
11120 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
11121
abb71cf4
CY
111222011-05-22 Chong Yidong <cyd@stupidchicken.com>
11123
11124 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
11125 (Fx_get_selection_internal): Minor cleanup.
11126 (Fx_own_selection_internal): Rename arguments for consistency with
11127 select.el.
11128
6307db39
PE
111292011-05-22 Paul Eggert <eggert@cs.ucla.edu>
11130
11131 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
11132
f3d4e0a4
CY
111332011-05-22 Chong Yidong <cyd@stupidchicken.com>
11134
11135 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
11136
4d8ade89
YM
111372011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11138
11139 * dispnew.c (scrolling_window): Don't exclude the case that the
11140 last enabled row in the desired matrix touches the bottom boundary.
11141
32078c8d
GM
111422011-05-21 Glenn Morris <rgm@gnu.org>
11143
11144 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
11145 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
11146 and add some more files.
32078c8d 11147
7285dc67
EZ
111482011-05-20 Eli Zaretskii <eliz@gnu.org>
11149
11150 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
11151 report_file_error introduced by the change from 2011-05-07.
11152
89d1bd22
PE
111532011-05-20 Paul Eggert <eggert@cs.ucla.edu>
11154
11155 * systime.h (Time): Define only if emacs is defined.
11156 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
11157 where the include path doesn't have X11/X.h by default. See
11158 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
11159
cd394be1 111602011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
11161
11162 * composite.c (find_automatic_composition): Fix previous change.
11163
b9704ad9
GM
111642011-05-20 Glenn Morris <rgm@gnu.org>
11165
11166 * lisp.mk: New file, split from Makefile.in.
11167 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
11168 (shortlisp): Remove.
11169 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
11170
4a720484
GM
111712011-05-19 Glenn Morris <rgm@gnu.org>
11172
11173 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
11174 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
11175 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
11176 (lisp): Set the order to that of loadup.el.
11177 (shortlisp): Make it a copy of $lisp.
11178 (SOME_MACHINE_LISP): Remove.
11179 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
11180 Use just $shortlisp, not $SOME_MACHINE_LISP too.
11181
a28d4396
KH
111822011-05-18 Kenichi Handa <handa@m17n.org>
11183
11184 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
11185 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
11186 (find_automatic_composition): Mostly rewrite for efficiency.
11187
a2b1fa8e
JB
111882011-05-18 Juanma Barranquero <lekktu@gmail.com>
11189
11190 * makefile.w32-in: Update dependencies.
11191
8e1f5610
CS
111922011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
11193
11194 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 11195 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 11196
7025ee00 111972011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 11198
cdfa6eab
PE
11199 Fix some integer overflow issues, such as string length overflow.
11200
06d6db33
PE
11201 * insdel.c (count_size_as_multibyte): Check for string overflow.
11202
2b4560a8
PE
11203 * character.c (lisp_string_width): Check for string overflow.
11204 Use EMACS_INT, not int, for string indexes and lengths; in
11205 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
11206 the resulting string length overflows an EMACS_INT; instead,
11207 report a string overflow if no precision given. When checking for
11208 precision exhaustion, use a check that cannot possibly have
11209 integer overflow. (Bug#8675)
11210 * character.h (lisp_string_width): Adjust to new signature.
11211
cb93f9be
PE
11212 * alloc.c (string_overflow): New function.
11213 (Fmake_string): Use it. This doesn't change behavior, but saves
11214 a few bytes and will simplify future changes.
11215 * character.c (string_escape_byte8): Likewise.
11216 * lisp.h (string_overflow): New decl.
11217
1a1f3366
PE
11218 Fixups, following up to the user-interface timestamp change.
11219 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
11220 for UI timestamps, instead of unsigned long.
9fbd6841
PE
11221 * msdos.c (mouse_get_pos): Likewise.
11222 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
11223 * w32gui.h (Time): Define by including "systime.h" rather than by
11224 declaring it ourselves. (Bug#8664)
11225
d4e3e4d3
PE
11226 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
11227 * image.c (clear_image_cache): Likewise.
11228
f6a24d19
PE
11229 * term.c (term_mouse_position): Don't assume time_t wraparound.
11230
08dc5ae6
PE
11231 Be more systematic about user-interface timestamps.
11232 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
11233 and sometimes 'EMACS_UINT', to represent these timestamps.
11234 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
11235 This makes the code easier to follow, and makes it easier to catch
11236 integer overflow bugs such as Bug#8664.
11237 * frame.c (Fmouse_position, Fmouse_pixel_position):
11238 Use Time, not unsigned long, for user-interface timestamps.
11239 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
11240 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
11241 * keyboard.h (last_event_timestamp): Likewise.
11242 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
11243 * menu.h (xmenu_show): Likewise.
11244 * term.c (term_mouse_position): Likewise.
11245 * termhooks.h (struct input_event.timestamp): Likewise.
11246 (struct terminal.mouse_position_hook): Likewise.
11247 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
11248 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
11249 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
11250 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
11251 what it was before.
11252 * menu.h, termhooks.h: Include "systime.h", for Time.
11253
8e55734a
PE
11254 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
11255 Don't assume that the difference between two unsigned long values
11256 can fit into an integer. At this point, we know button_down_time
11257 <= event->timestamp, so the difference must be nonnegative, so
11258 there's no need to cast the result if double-click-time is
11259 nonnegative, as it should be; check that it's nonnegative, just in
11260 case. This bug is triggered when events are more than 2**31 ms
86db42d2 11261 apart (about 25 days). (Bug#8664)
8e55734a 11262
841f1b75 11263 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 11264 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 11265
3e26f69c
PE
11266 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
11267 that always fit in int. Use a sentinel instead of a counter, to
11268 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
11269 * frame.h (struct frame): Use int for menu_bar_items_used
11270 instead of EMACS_INT, since it always fits in int.
3e26f69c 11271
5cc152c0
PE
11272 * menu.c (grow_menu_items): Check for int overflow.
11273
d89eb65e
PE
11274 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
11275
5235bd3e
PE
11276 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
11277 Before, the code was not consistent. These values cannot exceed
11278 2**31 - 1 so there's no need to make them unsigned.
11279 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
11280 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
11281 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
11282 as modifiers.
11283 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
11284
bc827e23
PE
11285 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
11286 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
11287 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
11288 presumably because the widths might not match.
11289
78eb494e
PE
11290 * window.c (size_window): Avoid needless test at loop start.
11291
04f2d78b
CB
112922011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
11293
11294 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
11295
d2fc7e3d 112962011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
11297
11298 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
11299
d2fc7e3d 113002011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
11301
11302 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
11303 `width' to `bar_area_x' and `bar_area_width', respectively.
11304 (x_scroll_run): Take account of fringe background extension.
11305
04f2d78b
CB
11306 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
11307 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
11308 `bar_area_width', respectively.
11309 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
11310 background extension.
11311
79b70037
GM
113122011-05-10 Jim Meyering <meyering@redhat.com>
11313
11314 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
11315
2f142cc5
JB
113162011-05-10 Juanma Barranquero <lekktu@gmail.com>
11317
11318 * image.c (Finit_image_library): Return t for built-in image types,
11319 like pbm and xbm. (Bug#8640)
11320
57679c86
AS
113212011-05-09 Andreas Schwab <schwab@linux-m68k.org>
11322
11323 * w32menu.c (set_frame_menubar): Fix submenu allocation.
11324
888c9e86
EZ
113252011-05-07 Eli Zaretskii <eliz@gnu.org>
11326
b0512a1d
EZ
11327 * w32console.c (Fset_screen_color): Doc fix.
11328 (Fget_screen_color): New function.
11329 (syms_of_ntterm): Defsubr it.
11330
7285dc67
EZ
11331 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
11332 unlink the temporary file if Fcall_process didn't create it in the
11333 first place.
11334 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
11335 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
11336 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
11337 cue to call_process_cleanup not to close that handle.
11338
4d3fcc8e
BK
113392011-05-07 Ben Key <bkey76@gmail.com>
11340
11341 * makefile.w32-in: The bootstrap-temacs rule now makes use of
11342 one of two shell specific rules, either bootstrap-temacs-CMD or
11343 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
11344 to the previous implementation of the bootstrap-temacs rule.
11345 The bootstrap-temacs-CMD rule is similar to the previous
11346 implementation of the bootstrap-temacs rule except that it
11347 makes use of the ESC_CFLAGS variable instead of the CFLAGS
11348 variable.
11349
11350 These changes, along with some changes to nt/configure.bat,
11351 nt/gmake.defs, and nt/nmake.defs, are required to extend my
11352 earlier fix to add support for --cflags and --ldflags options
11353 that include quotes so that it works whether make uses cmd or
11354 sh as the shell.
11355
b4289b64
MA
113562011-05-06 Michael Albinus <michael.albinus@gmx.de>
11357
11358 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
11359 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
11360 is a constant.
11361 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
11362 a string. Handle both cases.
11363 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
11364 (Fdbus_register_method): Use Qinvalid_function.
11365
af4c0e28
JB
113662011-05-06 Juanma Barranquero <lekktu@gmail.com>
11367
11368 * makefile.w32-in: Update dependencies.
11369 (LISP_H): Add inttypes.h and stdin.h.
11370 (PROCESS_H): Add unistd.h.
11371
c51453d9
EZ
113722011-05-06 Eli Zaretskii <eliz@gnu.org>
11373
11374 * lread.c: Include limits.h (fixes the MS-Windows build broken by
11375 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
11376
8ff0ac3c 113772011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 11378
4c4b566b
PE
11379 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
11380
aab2b9b5
PE
11381 * term.c (vfatal): Remove stray call to va_end.
11382 It's not needed and the C Standard doesn't allow it here anyway.
11383
c378da0b
PE
11384 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
11385 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
11386
288b08c7
PE
11387 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
11388 bytes.
11389
e3601888
PE
11390 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
11391
db6c0e74
PE
11392 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11393
dd5963ea
PE
11394 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
11395
88c9450f
PE
11396 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
11397
2f9442b8
PE
11398 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
11399
c032b5f8
PE
11400 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
11401 * charset.c (Fdefine_charset_internal): Don't initialize
11402 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 11403 32-bit int (Bug#8600).
a108c10b
PE
11404
11405 * lread.c (read_integer): Be more consistent with string-to-number.
11406 Use string_to_number to do the actual conversion; this avoids
11407 rounding errors and fixes some other screwups. Without this fix,
11408 for example, #x1fffffffffffffff was misread as -2305843009213693952.
11409 (digit_to_number): Move earlier, for benefit of read_integer.
11410 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 11411 not a digit in any supported base. (Bug#8602)
a108c10b 11412
ad5f9eea
PE
11413 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
11414
aec1708a
PE
11415 * dispnew.c (scrolling_window): Return 1 if we scrolled,
11416 to match comment at start of function. This also removes a
11417 GCC warning about overflow in a 32+64-bit port.
11418
47be4ab5
PE
11419 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
11420
371cac43
PE
11421 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
11422 Reported by Stefan Monnier in
11423 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
11424 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
11425 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 11426
d01a7826
PE
11427 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
11428 (EMACS_UINTPTR): Likewise, with uintptr_t.
11429
7fd47d5c
PE
11430 * lisp.h: Prefer 64-bit EMACS_INT if available.
11431 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
11432 on 32-bit hosts that have 64-bit int, so that they can access
11433 large files.
122b0c86
PE
11434 However, temporarily disable this change unless the temporary
11435 symbol WIDE_EMACS_INT is defined.
7fd47d5c 11436
8727937b
PE
11437 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
11438
8ac068ac
PE
11439 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
11440 This removes an assumption that EMACS_INT and long are the same
11441 width as pointers. The assumption is true for Emacs porting targets
11442 now, but we want to make other targets possible.
11443 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
11444 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
11445 In the rest of the code, change types of integers that hold casted
11446 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
11447 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
11448 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
11449 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
11450 No need to cast type when ORing.
11451 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
11452 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
11453 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
11454 assume EMACS_INT is the same width as char *.
11455 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
11456 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
11457 Remove no-longer-needed casts.
11458 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
11459 (xg_tool_bar_help_callback, xg_make_tool_item):
11460 Use EMACS_INTPTR to hold an integer
11461 that will be cast to void *; this can avoid a GCC warning
11462 if EMACS_INT is not the same width as void *.
11463 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
11464 * xdisp.c (display_echo_area_1, resize_mini_window_1):
11465 (current_message_1, set_message_1):
11466 Use a local to convert to proper width without a cast.
11467 * xmenu.c (dialog_selection_callback): Likewise.
11468
ede49d71
PE
11469 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
11470 Also, don't assume VALBITS / RAND_BITS is less than 5,
11471 and don't rely on undefined behavior when shifting a 1 left into
11472 the sign bit.
11473 * lisp.h (get_random): Change signature to match.
11474
2f30ecd0
PE
11475 * lread.c (hash_string): Use size_t, not int, for hash computation.
11476 Normally we prefer signed values; but hashing is special, because
11477 it's better to use unsigned division on hash table sizes so that
11478 the remainder is nonnegative. Also, size_t is the natural width
11479 for hashing into memory. The previous code used 'int', which doesn't
11480 retain enough info to hash well into very large tables.
11481 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
11482
2a866e7b
PE
11483 * dbusbind.c: Don't possibly lose pointer info when converting.
11484 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
11485 Use XPNTR rather than XHASH, so that the high-order bits of
11486 the pointer aren't lost when converting through void *.
11487
51639eac
PE
11488 * eval.c (Fautoload): Don't double-shift a pointer.
11489
92394119
PE
11490 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
11491
dbdb9a7c
JB
114922011-05-06 Juanma Barranquero <lekktu@gmail.com>
11493
11494 * gnutls.c (DEF_GNUTLS_FN):
11495 * image.c (DEF_IMGLIB_FN): Make function pointers static.
11496
db7a0b4f
AS
114972011-05-05 Andreas Schwab <schwab@linux-m68k.org>
11498
11499 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
11500 marker. (Bug#8610)
11501
cd394be1 115022011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
11503
11504 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
11505 New version that can reserve upto 2GB of heap space.
11506
f7ff1b0f 115072011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
11508
11509 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
11510
639c109b
TZ
115112011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
11512
11513 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
11514 `gnutls_certificate_set_x509_key_file'.
11515
d2127135
JB
115162011-05-05 Juanma Barranquero <lekktu@gmail.com>
11517
11518 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
11519 Update dependencies.
11520
e968f4f3
JB
115212011-05-04 Juanma Barranquero <lekktu@gmail.com>
11522
11523 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
11524 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
11525 Remove unused parameter `fildes'.
11526 * process.c (read_process_output, send_process): Don't pass it.
11527
84d358f0
JB
115282011-05-04 Juanma Barranquero <lekktu@gmail.com>
11529
11530 Fix previous change: the library cache is defined in w32.c.
11531 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
11532 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
11533
0898ca10
JB
115342011-05-04 Juanma Barranquero <lekktu@gmail.com>
11535
11536 Implement dynamic loading of GnuTLS on Windows.
11537
11538 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
11539 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
11540 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
11541 Declare.
11542
11543 * gnutls.c (Qgnutls_dll): Define.
11544 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
11545 (gnutls_*): Declare function pointers.
11546 (init_gnutls_functions): New function to initialize function pointers.
11547 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
11548 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
11549 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
11550 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
11551 (emacs_gnutls_write, emacs_gnutls_read)
11552 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
11553 (Fgnutls_available_p): New function.
11554 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
11555 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
11556 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
11557
11558 * image.c: Include w32.h.
11559 (Vimage_type_cache): Delete.
11560 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
11561 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
11562 (w32_delayed_load): Move to w32.c.
11563
11564 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
11565
11566 * w32.c (QCloaded_from, Vlibrary_cache): Define.
11567 (w32_delayed_load): Move from image.c. When loading a library, record
11568 its filename in the :loaded-from property of the library id.
11569 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
11570 Initialize and staticpro them.
11571 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
11572
11573 * process.c: Include lisp.h before w32.h, not after.
11574 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
11575 instead of gnutls_record_check_pending.
11576
11577 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
11578
ff4de4aa
TZ
115792011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
11580
11581 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
11582 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
11583 as passed in.
11584
abe95abb
JD
115852011-05-03 Jan Djärv <jan.h.d@swipnet.se>
11586
11587 * xterm.c (x_set_frame_alpha): Do not set property on anything
11588 else than FRAME_X_OUTER_WINDOW (Bug#8608).
11589
e16e55d4
JB
115902011-05-02 Juanma Barranquero <lekktu@gmail.com>
11591
11592 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
11593
bafcf6a5
JB
115942011-05-02 Juanma Barranquero <lekktu@gmail.com>
11595
11596 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
11597 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
11598 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
11599 (gnutls_global_initialized, Qgnutls_bootprop_priority)
11600 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
11601 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
11602 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
11603 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
11604 (Qgnutls_bootprop_callbacks_verify): Make static.
11605
e7a6747f
AS
116062011-05-01 Andreas Schwab <schwab@linux-m68k.org>
11607
19ed11ba
AS
11608 * callproc.c: Indentation fixup.
11609
e7a6747f 11610 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
11611 (wait_for_termination, interruptible_wait_for_termination):
11612 Move after wait_for_termination_1.
e7a6747f 11613
1ef14cb4
LMI
116142011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
11615
11616 * sysdep.c (interruptible_wait_for_termination): New function
11617 which is like wait_for_termination, but allows keyboard
11618 interruptions.
11619
11620 * callproc.c (Fcall_process): Add (:file "file") as an option for
11621 the STDOUT buffer.
11622 (Fcall_process_region): Ditto.
11623
330d880c
EZ
116242011-04-30 Eli Zaretskii <eliz@gnu.org>
11625
8db90b73
EZ
11626 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
11627 rather than `XVECTOR (FOO)->size'.
11628
330d880c
EZ
11629 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
11630 inttypes.h, as a gnulib replacement is used if it not available in
11631 system headers.
11632
15cbd324
EZ
116332011-04-21 Eli Zaretskii <eliz@gnu.org>
11634
11635 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
11636 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
11637 of MOST_POSITIVE_FIXNUM. (Bug#8528)
11638
11639 * coding.c (coding_alloc_by_realloc): Error out if destination
11640 will grow beyond MOST_POSITIVE_FIXNUM.
11641 (decode_coding_emacs_mule): Abort if there isn't enough place in
11642 charbuf for the composition carryover bytes. Reserve an extra
11643 space for up to 2 characters produced in a loop.
11644 (decode_coding_iso_2022): Abort if there isn't enough place in
11645 charbuf for the composition carryover bytes.
11646
116472011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 11648
ae940cca
EZ
11649 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
11650 aborting when %lld or %lll format is passed.
11651 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
11652 %llo or %llx format is passed. (Bug#8545)
11653
03ab8921
EZ
11654 * window.c (window_scroll_line_based): Use a marker instead of
11655 simple variables to record original value of point. (Bug#7952)
11656
afda1437
EZ
11657 * doprnt.c (doprnt): Fix the case where a multibyte sequence
11658 produced by %s or %c overflows available buffer space. (Bug#8545)
11659
f76dee0c
PE
116602011-04-28 Paul Eggert <eggert@cs.ucla.edu>
11661
11662 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 11663 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 11664
fdc5744d
JB
116652011-04-28 Juanma Barranquero <lekktu@gmail.com>
11666
11667 * w32.c (init_environment): Warn about defaulting HOME to C:\.
11668
638f053a
JB
116692011-04-28 Juanma Barranquero <lekktu@gmail.com>
11670
11671 * keyboard.c (Qdelayed_warnings_hook): Define.
11672 (command_loop_1): Run `delayed-warnings-hook'
11673 if Vdelayed_warnings_list is non-nil.
11674 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
11675 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
11676
d178f871
EZ
116772011-04-28 Eli Zaretskii <eliz@gnu.org>
11678
11679 * doprnt.c (doprnt): Don't return value smaller than the buffer
11680 size if the message was truncated. (Bug#8545).
11681
b124fd93
JB
116822011-04-28 Juanma Barranquero <lekktu@gmail.com>
11683
11684 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
11685 (Fx_window_property): #if-0 the whole functions, not just the bodies.
11686
e810457d
PE
116872011-04-27 Paul Eggert <eggert@cs.ucla.edu>
11688
11689 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
11690
ea51cceb
JB
116912011-04-27 Juanma Barranquero <lekktu@gmail.com>
11692
11693 * makefile.w32-in: Update dependencies.
11694
94dcfacf
EZ
116952011-04-27 Eli Zaretskii <eliz@gnu.org>
11696
11697 Improve `doprnt' and its usage. (Bug#8545)
11698 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
11699 `format_end'. Remove support for %l as a conversion specifier.
11700 Don't use xrealloc. Improve diagnostics when the %l size modifier
11701 is used. Update the commentary.
11702
11703 * eval.c (verror): Simplify calculation of size_t.
11704
11705 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
11706 messages.
11707
f61f41d7
PE
117082011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
11709
11710 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
11711 change.
11712
96fb4434
PE
117132011-04-27 Paul Eggert <eggert@cs.ucla.edu>
11714
11715 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
11716 This makes this file independent of the recent pseudovector change.
11717
671875da 117182011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 11719
69e9b5a3
PE
11720 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
11721
b5f869a7 11722 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 11723 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 11724 Remove unused local.
c8926152 11725 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 11726
841a1577 11727 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
11728 GCC 4.6.0 optimizes based on type-based alias analysis.
11729 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
11730 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
11731 != &v->size, and therefore "v->size = 1; b->size = 2; return
11732 v->size;" must therefore return 1. This assumption is incorrect
11733 for Emacs, since it type-puns struct Lisp_Vector * with many other
11734 types. To fix this problem, this patch adds a new type struct
f904488f 11735 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
11736 and pseudovectors, and helps optimizing compilers not get fooled
11737 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
11738 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
11739 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
11740 the size member.
eab3844f
PE
11741 (XSETPVECTYPE): Rewrite in terms of new macro.
11742 (XSETPVECTYPESIZE): New macro, specifying both type and size.
11743 This is a bit clearer, and further avoids the possibility of
11744 undesirable aliasing.
11745 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 11746 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
11747 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
11748 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
11749 (ASIZE): Now uses header.size rather than size.
11750 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
11751 to avoid the hassle of writing XVECTOR (foo)->header.size.
11752 (struct vectorlike_header): New type.
eab3844f
PE
11753 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
11754 object, to help avoid aliasing.
11755 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
11756 (SUBRP): Likewise, since Lisp_Subr is a special case.
11757 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
11758 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
11759 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 11760 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
11761 changed to be "header.size" and "header.next".
11762 * buffer.h (struct buffer): Likewise.
11763 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
11764 * frame.h (struct frame): Likewise.
11765 * process.h (struct Lisp_Process): Likewise.
11766 * termhooks.h (struct terminal): Likewise.
11767 * window.c (struct save_window_data, struct saved_window): Likewise.
11768 * window.h (struct window): Likewise.
11769 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
11770 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
11771 * buffer.c (init_buffer_once): Likewise.
11772 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
11773 special case.
11774 * process.c (Fformat_network_address): Use local var for size,
11775 for brevity.
11776
0df1eac5
PE
11777 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
11778
847ab9d1 11779 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
11780 * data.c (atof): Remove decl; no longer used or needed.
11781 (digit_to_number): Move to lread.c.
11782 (Fstring_to_number): Use new string_to_number function, to be
11783 consistent with how the Lisp reader treats infinities and NaNs.
11784 Do not assume that floating-point numbers represent EMACS_INT
11785 without losing information; this is not true on most 64-bit hosts.
11786 Avoid double-rounding errors, by insisting on integers when
11787 parsing non-base-10 numbers, as the documentation specifies.
11788 * lisp.h (string_to_number): New decl, replacing ...
11789 (isfloat_string): Remove.
bc0a5c13 11790 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 11791 (read1): Do not accept +. and -. as integers; this
452f4150
PE
11792 appears to have been a coding error. Similarly, do not accept
11793 strings like +-1e0 as floating point numbers. Do not report
11794 overflow for integer overflows unless the base is not 10 which
11795 means we have no simple and reliable way to continue.
11796 Break out the floating-point parsing into a new
11797 function string_to_number, so that Fstring_to_number parses
11798 floating point numbers consistently with the Lisp reader.
04f2d78b 11799 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
11800 (E_CHAR, EXP_INT): Remove, replacing with ...
11801 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
11802 (string_to_number): New function, replacing isfloat_string.
11803 This function checks for valid syntax and produces the resulting
11804 Lisp float number too. Rework it so that string-to-number
bc0a5c13 11805 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
11806 so that overflow for non-base-10 numbers is reported only when
11807 there's no portable and simple way to convert to floating point.
452f4150 11808
67769ffc
PE
11809 * textprop.c (set_text_properties_1): Rewrite for clarity,
11810 and to avoid GCC warning about integer overflow.
11811
c20db43f
PE
11812 * intervals.h (struct interval): Use EMACS_INT for members
11813 where EMACS_UINT might cause problems. See
11814 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
11815 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
11816 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
11817 All uses changed.
37aa2f85
PE
11818 (offset_intervals): Tell GCC not to worry about length overflow
11819 when negating a negative length.
c20db43f 11820
2538aa2f
PE
11821 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
11822 (overrun_check_free): Likewise.
11823
f2d3008d
PE
11824 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
11825 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
11826 word size.
11827
ec8df744
PE
11828 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
11829 (gnutls_make_error): Rename local to avoid shadowing.
11830 (gnutls_emacs_global_deinit): ifdef out; not used.
11831 (Fgnutls_boot): Use const for pointer to readonly storage.
11832 Comment out unused local. Fix pointer signedness problems.
11833
640ee02d
PE
11834 * lread.c (openp): Don't stuff size_t into an 'int'.
11835 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
11836 about possible signed overflow.
11837
6048fb2a
PE
11838 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
11839 (GDK_KEY_g): Don't define if already defined.
11840 (xg_prepare_tooltip): Avoid pointer signedness problem.
11841 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
11842
fa3c87e1
PE
11843 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
11844 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
11845
2172544b
PE
11846 * xfns.c (Fx_window_property): Simplify a bit,
11847 to make a bit faster and to avoid GCC 4.6.0 warning.
11848 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
11849
9b821a21
PE
11850 * fns.c (internal_equal): Don't assume size_t fits in int.
11851
3c616cfa
PE
11852 * alloc.c (compact_small_strings): Tighten assertion a little.
11853
c2982e87
PE
11854 Replace pEd with more-general pI, and fix some printf arg casts.
11855 * lisp.h (pI): New macro, generalizing old pEd macro to other
11856 conversion specifiers. For example, use "...%"pI"d..." rather
11857 than "...%"pEd"...".
11858 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 11859 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
11860 * alloc.c (check_pure_size): Don't overflow by converting size to int.
11861 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
11862 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
11863 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
11864 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
11865 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
11866 64-bit hosts.
11867 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
11868 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
11869 * print.c (safe_debug_print, print_object): Likewise.
11870 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
11871 to int.
6f04d126
PE
11872 Use pI instead of if-then-else-abort. Use %p to avoid casts,
11873 avoiding the 0 flag, which is not portable.
c2982e87
PE
11874 * process.c (Fmake_network_process): Use pI to avoid cast.
11875 * region-cache.c (pp_cache): Likewise.
11876 * xdisp.c (decode_mode_spec): Likewise.
11877 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
11878 behavior on 64-bit hosts with printf arg.
6f04d126 11879 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
11880 (x_stop_queuing_selection_requests): Likewise.
11881 (x_get_window_property): Don't truncate byte count to an 'int'
11882 when tracing.
0b432f21 11883
5e073ec7
PE
11884 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
11885 here, since it parses constructs like leading '-' and spaces,
11886 which are not wanted; and it overflows with large numbers.
11887 Instead, simply match F[0-9]+, which is what is wanted anyway.
11888
36372bf9
PE
11889 * alloc.c: Remove unportable assumptions about struct layout.
11890 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
11891 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
11892 (allocate_vectorlike, make_pure_vector): Use the new macros,
11893 plus offsetof, to remove unportable assumptions about struct layout.
11894 These assumptions hold on all porting targets that I know of, but
11895 they are not guaranteed, they're easy to remove, and removing them
11896 makes further changes easier.
11897
0b432f21
PE
11898 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
11899 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
11900 (string_overrun_cookie): Now const. Use initializers that
11901 don't formally overflow signed char, to avoid warnings.
000098c1
PE
11902 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
11903 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
11904 (allocate_buffer): Don't assume sizeof (struct buffer) is a
11905 multiple of sizeof (EMACS_INT); it need not be, if
11906 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 11907 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 11908
895009e1
JB
119092011-04-26 Juanma Barranquero <lekktu@gmail.com>
11910
11911 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
11912
6a7a1b0b
TZ
119132011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
11914
11915 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 11916 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
11917 Reported by Paul Eggert <eggert@cs.ucla.edu>.
11918
841a1577 119192011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
11920
11921 * lisp.h (Qdebug): List symbol.
895009e1 11922 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
11923 * keyboard.c (debug-on-event): New variable.
11924 (handle_user_signal): Break into debugger when debug-on-event
11925 matches the current signal symbol.
11926
f2d3ba6f
DN
119272011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
11928
11929 * alloc.c (check_sblock, check_string_bytes)
11930 (check_string_free_list): Convert to standard C.
11931
42ce4c63
TZ
119322011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
11933
11934 * w32.c (emacs_gnutls_push): Fix typo.
11935
825cd63c
EZ
119362011-04-25 Eli Zaretskii <eliz@gnu.org>
11937
fb11d64d
EZ
11938 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
11939 "cast to pointer from integer of different size".
11940
825cd63c
EZ
11941 Improve doprnt and its use in verror. (Bug#8545)
11942 * doprnt.c (doprnt): Document the set of format control sequences
11943 supported by the function. Use SAFE_ALLOCA instead of always
11944 using `alloca'.
11945
11946 * eval.c (verror): Don't limit the buffer size at size_max-1, that
11947 is one byte too soon. Don't use xrealloc; instead xfree and
11948 xmalloc anew.
11949
e061a11b
TZ
119502011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
11951
11952 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
11953 callbacks stage.
11954
11955 * gnutls.c: Renamed global_initialized to
11956 gnutls_global_initialized. Added internals for the
11957 :verify-hostname-error, :verify-error, and :verify-flags
11958 parameters of `gnutls-boot' and documented those parameters in the
11959 docstring. Start callback support.
9173deec
JB
11960 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
11961 unless a fatal error occurred. Call gnutls_alert_send_appropriate
11962 on error. Return error code.
e061a11b
TZ
11963 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
11964 (emacs_gnutls_read): Likewise.
11965 (Fgnutls_boot): Return handshake error code.
11966 (emacs_gnutls_handle_error): New function.
11967 (wsaerror_to_errno): Likewise.
11968
11969 * w32.h (emacs_gnutls_pull): Add prototype.
11970 (emacs_gnutls_push): Likewise.
11971
11972 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
11973 (emacs_gnutls_push): Likewise.
11974
119752011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
11976
11977 * process.c (wait_reading_process_output): Check if GnuTLS
11978 buffered some data internally if no FDs are set for TLS
11979 connections.
11980
11981 * makefile.w32-in (OBJ2): Add gnutls.$(O).
11982 (LIBS): Link to USER_LIBS.
11983 ($(BLD)/gnutls.$(0)): New target.
11984
fa6996bc
EZ
119852011-04-24 Eli Zaretskii <eliz@gnu.org>
11986
eb35682e
EZ
11987 * xdisp.c (handle_single_display_spec): Rename the
11988 display_replaced_before_p argument into display_replaced_p, to
11989 make it consistent with the commentary. Fix typos in the
11990 commentary.
11991
e2ad650c
EZ
11992 * textprop.c (syms_of_textprop): Remove dead code.
11993 (copy_text_properties): Delete obsolete commentary about an
11994 interface that was deleted long ago. Fix typos in the description
11995 of arguments.
11996
1b2de274
EZ
11997 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
11998 to changes in oldXMenu/XMenu.h from 2011-04-16.
11999 <menu_help_message, prev_menu_help_message>: Constify.
12000 (IT_menu_make_room): menu->help_text is now `const char **';
12001 adjust.
12002
12003 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
12004 to changes in oldXMenu/XMenu.h from 2011-04-16.
12005 (struct XMenu): Declare `help_text' `const char **'.
12006
12007 * xfaces.c <Qunspecified>: Make extern again.
12008
12009 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 12010 required by POSIX.
1b2de274 12011
762b15be
EZ
12012 * doc.c (get_doc_string): Improve the format passed to `error'.
12013
12014 * doprnt.c (doprnt): Improve commentary.
12015
12016 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
12017
12018 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
12019 them with etags.
12020
f1052e5d
EZ
12021 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
12022 changes in globals.h immediately force recompilation.
762b15be
EZ
12023 (TAGS): Depend on $(CURDIR)/m/intel386.h and
12024 $(CURDIR)/s/ms-w32.h.
12025 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 12026
fa6996bc
EZ
12027 * character.c (Fchar_direction): Function deleted.
12028 (syms_of_character): Don't defsubr it.
12029 <char-direction-table>: Deleted.
12030
e6c3da20
EZ
120312011-04-23 Eli Zaretskii <eliz@gnu.org>
12032
12033 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
12034 * doprnt.c: Include limits.h.
12035 (SIZE_MAX): New macro.
04f2d78b
CB
12036 (doprnt): Return a size_t value. 2nd arg is now size_t.
12037 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
12038 Improve overflow protection. Support `l' modifier for integer
12039 conversions. Support %l conversion. Don't assume an EMACS_INT
12040 argument for integer conversions and for %c.
12041
12042 * lisp.h (doprnt): Restore prototype.
12043
12044 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
12045 $(SRC)/character.h.
12046
12047 * Makefile.in (base_obj): Add back doprnt.o.
12048
12049 * deps.mk (doprnt.o): Add back prerequisites.
12050 (callint.o): Depend on character.h.
12051
12052 * eval.c (internal_lisp_condition_case): Include the handler
12053 representation in the error message.
12054 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
12055 when breaking from the loop.
12056
12057 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
12058
12059 * callint.c (Fcall_interactively): When displaying error message
12060 about invalid control letter, pass the character's codepoint, not
12061 a pointer to its multibyte form. Improve display of the character
12062 in octal and display also its hex code.
12063
12064 * character.c (char_string): Use %x to display the (unsigned)
12065 codepoint of an invalid character, to avoid displaying a bogus
12066 negative value.
12067
12068 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
12069 `error', not SYMBOL_NAME itself.
12070
12071 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
12072 character arguments to `error'.
12073
12074 * charset.c (check_iso_charset_parameter): Fix incorrect argument
12075 to `error' in error message about FINAL_CHAR argument. Make sure
12076 FINAL_CHAR is a character, and use %c when it is passed as
12077 argument to `error'.
12078
4ffd0d6b 120792011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
12080
12081 * s/ms-w32.h (localtime): Redirect to sys_localtime.
12082
12083 * w32.c: Include <time.h>.
12084 (sys_localtime): New function.
12085
4ffd0d6b 120862011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
12087
12088 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
12089
4ffd0d6b 12090 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 12091
4ffd0d6b 120922011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 12093
4ffd0d6b
GM
12094 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
12095 zombies (Bug#8467).
aac0c6e3 12096
04c56954
EZ
120972011-04-19 Eli Zaretskii <eliz@gnu.org>
12098
12099 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
12100 gl_state.e_property when gl_state.object is Qt.
12101
12102 * insdel.c (make_gap_larger): Remove limitation of buffer size
12103 to <= INT_MAX.
12104
16a43933
CY
121052011-04-18 Chong Yidong <cyd@stupidchicken.com>
12106
12107 * xdisp.c (lookup_glyphless_char_display)
12108 (produce_glyphless_glyph): Handle cons cell entry in
12109 glyphless-char-display.
12110 (Vglyphless_char_display): Document it.
12111
12112 * term.c (produce_glyphless_glyph): Handle cons cell entry in
12113 glyphless-char-display.
12114
4581706e
CY
121152011-04-17 Chong Yidong <cyd@stupidchicken.com>
12116
12117 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
12118
12119 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
12120
12121 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
12122 definition for no-X builds.
12123
4887c6e2 121242011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 12125
fd35b6f9
PE
12126 Static checks with GCC 4.6.0 and non-default toolkits.
12127
5c1ccb01
PE
12128 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
12129
006c5daa
PE
12130 * process.c (keyboard_bit_set): Define only if SIGIO.
12131 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
12132 (send_process): Repair possible setjmp clobbering.
12133
efc736d3
PE
12134 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
12135
4e2fe2e6
PE
12136 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
12137
f97334a2
PE
12138 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
12139
4e75f29d
PE
12140 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
12141 Define only if needed.
12142
90efadd1
PE
12143 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
12144 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 12145 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 12146
3c647824
PE
12147 * dispextern.h (struct redisplay_interface): Rename param
12148 to avoid shadowing.
e264f262 12149 * termhooks.h (struct terminal): Likewise.
761383f4 12150 * xterm.c (xembed_send_message): Likewise.
3c647824 12151
b58c5c4a
PE
12152 * insdel.c (make_gap_smaller): Define only if
12153 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
12154
cad59032
PE
12155 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
12156 it.
12157
c339dc2e
PE
12158 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
12159 so that we aren't warned about unused symbols.
12160
91a3e27b
PE
12161 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
12162
399c71d3 12163 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 12164
8ffc96f5
PE
12165 * xfns.c (x_real_positions): Mark locals as initialized.
12166
eef9bc79
PE
12167 * xmenu.c (xmenu_show): Don't use uninitialized vars.
12168
098db9dd
PE
12169 * xterm.c: Fix problems found by static analysis with other toolkits.
12170 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
12171 (x_dispatch_event): Declare static if USE_GTK, and
12172 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 12173 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 12174 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
12175 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
12176 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 12177
eb18f6cc
PE
12178 * xmenu.c (menu_help_callback): Pointer type fixes.
12179 Use const pointers when pointing at readonly data. Avoid pointer
12180 signedness clashes.
12181 (FALSE): Remove unused macro.
12182 (update_frame_menubar): Remove unused decl.
12183
1fe72bf8
PE
12184 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
12185
60d9e1db
PE
12186 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
12187 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
12188 (single_menu_item): Rename local to avoid shadowing.
12189
39261c26
PE
12190 * keyboard.c (make_lispy_event): Remove unused local var.
12191
018c5e19
PE
12192 * frame.c, frame.h (x_get_resource_string): Bring this back, but
12193 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
12194
63d2b86e
PE
12195 * bitmaps: Change bitmaps from unsigned char back to the X11
12196 compatible char. Avoid the old compiler warnings about
12197 out-of-range initializers by using, for example, '\xab' rather
12198 than 0xab.
12199
aefd87e1
PE
12200 * xgselect.c (xgselect_initialize): Check vs interface
12201 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
12202
bf501fb9
PE
12203 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
12204
e9829fdf
PE
12205 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
12206 to read-only memory.
12207
1086c095
PE
12208 * fns.c (vector): Remove; this old hack is no longer needed.
12209
2baccd04 12210 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 12211 Remove unused var.
dde42981 12212 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 12213
72391843 12214 * xrdb.c (x_load_resources): Omit unused local.
3565b346 12215
436c16df 12216 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 12217 (x_window): Rename locals to avoid shadowing.
dc5ddd85 12218 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 12219
92bb796d 12220 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 12221 (x_term_init): Remove local to avoid shadowing.
92bb796d 12222
764430a3 12223 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
12224
12225 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
12226 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
12227
d1dfb56c
EZ
122282011-04-16 Eli Zaretskii <eliz@gnu.org>
12229
c4354cb4
EZ
12230 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
12231
d1dfb56c
EZ
12232 Fix regex.c, syntax.c and friends for buffers > 2GB.
12233 * syntax.h (struct gl_state_s): Declare character position members
12234 EMACS_INT.
12235
12236 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
12237
04f2d78b
CB
12238 * textprop.c (verify_interval_modification, interval_of):
12239 Declare arguments EMACS_INT.
d1dfb56c
EZ
12240
12241 * intervals.c (adjust_intervals_for_insertion): Declare arguments
12242 EMACS_INT.
12243
12244 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
12245
12246 * indent.c (Fvertical_motion): Local variable it_start is now
12247 EMACS_INT.
12248
12249 * regex.c (re_match, re_match_2, re_match_2_internal)
12250 (bcmp_translate, regcomp, regexec, print_double_string)
12251 (group_in_compile_stack, re_search, re_search_2, regex_compile)
12252 (re_compile_pattern, re_exec): Declare arguments and local
12253 variables `size_t' and `ssize_t' and return values `regoff_t', as
12254 appropriate.
12255 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
12256 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
12257 <compile_stack_type>: `size' and `avail' are now `size_t'.
12258
12259 * regex.h <regoff_t>: Use ssize_t, not int.
12260 (re_search, re_search_2, re_match, re_match_2): Arguments that
12261 specify buffer/string position and length are now ssize_t and
12262 size_t. Return type is regoff_t.
12263
613052cd
BK
122642011-04-16 Ben Key <bkey76@gmail.com>
12265
12266 * nsfont.m: Fixed bugs in ns_get_family and
12267 ns_descriptor_to_entity that were caused by using free to
12268 deallocate memory blocks that were allocated by xmalloc (via
12269 xstrdup). This caused Emacs to crash when compiled with
12270 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
12271 --enable-checking=xmallocoverrun). xfree is now used to
12272 deallocate these memory blocks.
12273
4170f62f 122742011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 12275
71b41406
PE
12276 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
12277
9587a89d
PE
12278 emacs_write: Accept and return EMACS_INT for sizes.
12279 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
12280 et seq.
12281 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
12282 Accept and return EMACS_INT.
12283 (emacs_gnutls_write): Return the number of bytes written on
12284 partial writes.
12285 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
12286 (emacs_read, emacs_write): Remove check for negative size, as the
12287 Emacs source code has been audited now.
9587a89d
PE
12288 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
12289 (emacs_read, emacs_write): Use it.
273a5f82
PE
12290 * process.c (send_process): Adjust to the new signatures of
12291 emacs_write and emacs_gnutls_write. Do not attempt to store
12292 a byte offset into an 'int'; it might overflow.
9587a89d 12293 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 12294
3e047f51
PE
12295 * sound.c: Don't assume sizes fit in 'int'.
12296 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 12297 Return EMACS_INT, not int.
3e047f51 12298 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
12299 Accept EMACS_INT, not int.
12300 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
12301 record read return values.
12302
cc39a9db
BK
123032011-04-15 Ben Key <bkey76@gmail.com>
12304
c9d0ec6d
JB
12305 * keyboard.c (Qundefined): Don't declare static since it is used
12306 in nsfns.m.
12307 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
12308 static since they are used in nsfont.m.
cc39a9db 12309
6c60eb9f
SM
123102011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
12311
12312 * process.c (Qprocessp): Don't declare static.
12313 * lisp.h (Qprocessp): Declare again.
12314
7990b61a
JB
123152011-04-15 Juanma Barranquero <lekktu@gmail.com>
12316
12317 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
12318
5d4cb038
PE
123192011-04-14 Paul Eggert <eggert@cs.ucla.edu>
12320
8bd7b830 12321 Improve C-level modularity by making more things 'static'.
cd64ea1d 12322
e3b27b31
PE
12323 Don't publish debugger-only interfaces to other modules.
12324 * lisp.h (safe_debug_print, debug_output_compilation_hack):
12325 (verify_bytepos, count_markers): Move decls to the only modules
12326 that need them.
12327 * region-cache.h (pp_cache): Likewise.
12328 * window.h (check_all_windows): Likewise.
12329 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
12330
5d4cb038
PE
12331 * sysdep.c (croak): Now static, if
12332 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
12333 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
12334
12335 * alloc.c (refill_memory_reserve): Now static if
12336 !defined REL_ALLOC || defined SYSTEM_MALLOC.
12337 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 12338
e87b6180
PE
12339 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
12340 Define only if USE_LUCID.
12341
ac64929e
PE
12342 * xrdb.c (x_customization_string, x_rm_string): Now static.
12343
6f37259d
PE
12344 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
12345 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
12346
1683e3ab
PE
12347 * xdisp.c (draw_row_with_mouse_face): Now static.
12348 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
12349
de9c2632
PE
12350 * window.h (check_all_windows): Mark externally visible.
12351
2b96acb7
PE
12352 * window.c (window_deletion_count): Now static.
12353
12354 * undo.c: Make symbols static if they're not exported.
12355 (last_undo_buffer, last_boundary_position, pending_boundary):
12356 Now static.
12357
50436f33
PE
12358 * textprop.c (interval_insert_behind_hooks): Now static.
12359 (interval_insert_in_front_hooks): Likewise.
12360
64520e5c
PE
12361 * term.c: Make symbols static if they're not exported.
12362 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
12363 (max_frame_lines, tty_set_terminal_modes):
12364 (tty_reset_terminal_modes, tty_turn_off_highlight):
12365 (get_tty_terminal): Now static.
12366 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
12367 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 12368 HAVE_WINDOW_SYSTEM.
64520e5c
PE
12369 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
12370 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
12371
1fa53021
PE
12372 * sysdep.c: Make symbols static if they're not exported.
12373 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
12374 Now static.
12375 (sigprocmask_set, full_mask): Remove; unused.
12376 (wait_debugging): Mark as visible.
12377 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
12378 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
12379
d4b43b22
PE
12380 * syntax.c (syntax_temp): Define only if !__GNUC__.
12381
b7c513d0
PE
12382 * sound.c (current_sound_device, current_sound): Now static.
12383
989b29ad
PE
12384 * search.c (searchbufs, searchbuf_head): Now static.
12385
13a55a78
PE
12386 * scroll.c (scroll_cost): Remove; unused.
12387 * dispextern.h (scroll_cost): Remove decl.
12388
de68a1fc
PE
12389 * region-cache.h (pp_cache): Mark as externally visible.
12390
40ccffa6
PE
12391 * process.c: Make symbols static if they're not exported.
12392 (process_tick, update_tick, create_process, chan_process):
12393 (Vprocess_alist, proc_buffered_char, datagram_access):
12394 (fd_callback_data, send_process_frame, process_sent_to): Now static.
12395 (deactivate_process): Mark defn as static, as well as decl.
12396 * lisp.h (create_process): Remove decl.
12397 * process.h (chan_process, Vprocess_alist): Remove decls.
12398
ad64fc97
PE
12399 * print.c: Make symbols static if they're not exported.
12400 (print_depth, new_backquote_output, being_printed, print_buffer):
12401 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
12402 (print_interval, print_number_index, initial_stderr_stream):
12403 Now static.
12404 * lisp.h (Fprinc): Remove decl.
12405 (debug_output_compilation_hack): Mark as externally visible.
12406
adddb265
PE
12407 * sysdep.c (croak): Move decl from here to syssignal.h.
12408 * syssignal.h (croak): Put it here, so the API can be checked when
12409 'croak' is called from dissociate_if_controlling_tty.
12410
1717ede2
PE
12411 * minibuf.c: Make symbols static if they're not exported.
12412 (minibuf_save_list, choose_minibuf_frame): Now static.
12413 * lisp.h (choose_minibuf_frame): Remove decl.
12414
fa5fb2bc
PE
12415 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
12416
1e3890d1
PE
12417 * lread.c: Make symbols static if they're not exported.
12418 (read_objects, initial_obarray, oblookup_last_bucket_number):
12419 Now static.
12420 (make_symbol): Remove; unused.
12421 * lisp.h (initial_obarray, make_symbol): Remove decls.
12422
8a1414fa
PE
12423 * keyboard.c: Make symbols static if they're not exported.
12424 (single_kboard, recent_keys_index, total_keys, recent_keys):
12425 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
12426 (this_single_command_key_start, echoing, last_auto_save):
12427 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
12428 (command_loop, echo_now, keyboard_init_hook, help_char_p):
12429 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
12430 (Vlispy_mouse_stem, double_click_count):
12431 Now static.
12432 (force_auto_save_soon): Define only if SIGDANGER.
12433 (ignore_mouse_drag_p): Now static if
12434 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
12435 (print_help): Remove; unused.
12436 (stop_character, last_timer_event): Mark as externally visible.
12437 * keyboard.h (ignore_mouse_drag_p): Declare only if
12438 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
12439 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
12440 * lisp.h (echoing): Remove decl.
12441 (force_auto_save_soon): Declare only if SIGDANGER.
12442 * xdisp.c (redisplay_window): Simplify code, to make it more
12443 obvious that ignore_mouse_drag_p is not accessed if !defined
12444 USE_GTK && !defined HAVE_NS.
12445
93ea6e8f
PE
12446 * intervals.c: Make symbols static if they're not exported.
12447 (merge_properties_sticky, merge_interval_right, delete_interval):
12448 Now static.
12449 * intervals.h (merge_interval_right, delete_interval): Remove decls.
12450
77382fcc
PE
12451 * insdel.c: Make symbols static if they're not exported.
12452 However, leave prepare_to_modify_buffer alone. It's never
12453 called from outside this function, but that appears to be a bug.
12454 (combine_after_change_list, combine_after_change_buffer):
4889fc82 12455 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
12456 (adjust_after_replace_noundo): Remove; unused.
12457 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 12458 (signal_before_change): Remove decls.
77382fcc 12459
9306c32e
PE
12460 * indent.c (val_compute_motion, val_vmotion): Now static.
12461
cd44d2eb
PE
12462 * image.c: Make symbols static if they're not exported.
12463 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
12464 if USE_GTK.
12465 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
12466 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
12467
ad9a7a06
PE
12468 * fringe.c (standard_bitmaps): Now static.
12469 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
12470
81626931
PE
12471 * frame.c: Make symbols static if they're not exported.
12472 (x_report_frame_params, make_terminal_frame): Now static.
12473 (get_frame_param): Now static, unless HAVE_NS.
12474 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
12475 (x_get_resource_string): Remove; not used.
12476 * frame.h (make_terminal_frame, x_report_frame_params):
12477 (x_get_resource_string); Remove decls.
12478 (x_fullscreen_adjust): Declare only if WINDOWSNT.
12479 * lisp.h (get_frame_param): Declare only if HAVE_NS.
12480
239f9db9
PE
12481 * font.c, fontset.c: Make symbols static if they're not exported.
12482 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
12483 (FACE_SUITABLE_FOR_CHAR_P): Use it.
12484 * font.c (font_close_object): Now static.
12485 * font.h (font_close_object): Remove.
12486 * fontset.c (FONTSET_OBJLIST): Remove.
12487 (free_realized_fontset) #if-0 the body, which does nothing.
12488 (face_suitable_for_char_p): #if-0, as it's never called.
12489 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
12490 * xfaces.c (face_at_string_position):
12491 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
12492 since 0 is always ASCII.
12493
dfcf3579
PE
12494 * fns.c (weak_hash_tables): Now static.
12495
5045092b
PE
12496 * fileio.c: Make symbols static if they're not exported.
12497 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
12498 (Vwrite_region_annotation_buffers): Now static.
12499
57a96f5c
PE
12500 * eval.c: Make symbols static if they're not exported.
12501 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
12502 * lisp.h (backtrace_list): Remove decl.
12503
35f08c38
PE
12504 * emacs.c: Make symbols static if they're not exported.
12505 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
12506 (fatal_error_code, fatal_error_signal_hook, standard_args):
12507 Now static.
12508 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
12509 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
12510 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
12511 * lisp.h (fatal_error_signal_hook): Remove decl.
12512 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
12513
f44bd759
PE
12514 * editfns.c: Move a (normally-unused) function to its only use.
12515 * editfns.c, lisp.h (get_operating_system_release): Remove.
12516 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
12517 worth the hassle of breaking this out.
12518
b532497d
PE
12519 * xterm.c: Make symbols static if they're not exported.
12520 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
12521 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
12522 (x_destroy_window, x_delete_display):
12523 Now static.
12524 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
12525 (x_mouse_leave): Remove; unused.
12526 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
12527 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
12528 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
12529 Remove decls.
12530 (x_mouse_leave): Declare only if WINDOWSNT.
12531 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
12532 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
12533 USE_X_TOOLKIT.
12534
1675728f
PE
12535 * ftxfont.c: Make symbols static if they're not exported.
12536 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
12537 HAVE_FREETYPE.
12538 * font.h (ftxfont_driver): Likewise.
12539
e4cebfca
PE
12540 * xfns.c: Make symbols static if they're not exported.
12541 (x_last_font_name, x_display_info_for_name):
12542 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
12543 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
12544 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
12545 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
12546 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
12547 (last_show_tip_args): Now static.
12548 (xic_defaut_fontset, xic_create_fontsetname): Define only if
12549 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
12550 (x_screen_planes): Remove; unused.
12551 * dispextern.h (x_screen_planes): Remove decl.
12552
5bf46f05
PE
12553 * dispnew.c: Make symbols static if they're not exported.
12554 * dispextern.h (redraw_garbaged_frames, scrolling):
12555 (increment_row_positions): Remove.
12556 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
12557 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
12558 Now static.
12559 (redraw_garbaged_frames): Remove; unused.
12560
435f4c28
PE
12561 * xfaces.c: Make symbols static if they're not exported.
12562 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
12563 Remove decls.
12564 * xterm.h (defined_color): Remove decls.
12565 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
12566 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
12567 (menu_face_changed_default, defined_color, free_realized_face):
12568 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
12569 (ascii_face_of_lisp_face): Remove; unused.
12570
8524aef3
PE
12571 * xdisp.c: Make symbols static if they're not exported.
12572 * dispextern.h (scratch_glyph_row, window_box_edges):
12573 (glyph_to_pixel_coords, set_cursor_from_row):
12574 (get_next_display_element, set_iterator_to_next):
12575 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
12576 (show_mouse_face): Remove decls
12577 * frame.h (message_buf_print): Likewise.
12578 * lisp.h (pop_message, set_message, check_point_in_composition):
12579 Likewise.
12580 * xterm.h (set_vertical_scroll_bar): Likewise.
12581 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
12582 (message_buf_print, scratch_glyph_row, displayed_buffer):
12583 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
12584 (get_next_display_element, show_mouse_face, window_box_edges):
12585 (frame_to_window_pixel_xy, check_point_in_composition):
12586 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
12587 (glyph_to_pixel_coords): Remove; unused.
12588
16390cd2
PE
12589 * dired.c (file_name_completion): Now static.
12590
12591 * dbusbind.c (xd_in_read_queued_messages): Now static.
12592
a25f4dfa
PE
12593 * lisp.h (circular_list_error, FOREACH): Remove; unused.
12594 * data.c (circular_list_error): Remove.
12595
14a9c8df
PE
12596 * commands.h (last_point_position, last_point_position_buffer):
12597 (last_point_position_window): Remove decls.
12598 * keyboard.c: Make these variables static.
12599
04f2d78b
CB
12600 * coding.h (coding, code_convert_region, encode_coding_gap):
12601 Remove decls.
74ab6df5
PE
12602 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
12603 (iso_code_class, detect_coding, code_convert_region): Now static.
12604 (encode_coding_gap): Remove; unused.
12605
38dfbee1
PE
12606 * chartab.c (chartab_chars, chartab_bits): Now static.
12607
a2cb4e63
PE
12608 * charset.h (charset_iso_8859_1): Remove decl.
12609 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
12610 Now static.
12611
127198fd
PE
12612 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
12613 * ccl.c (Vccl_program_table): Now static.
12614 (check_ccl_update): Remove; unused.
12615
d85b608f
PE
12616 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
12617 * category.h: ... from here.
12618 * category.c (check_category_table, set_category_set): Now static.
12619
31cd66f3
PE
12620 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
12621 * lisp.h: Remove these decls.
12622
c358e587
PE
12623 * buffer.c (buffer_count): Remove unused var.
12624
e78aecca
PE
12625 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
12626 so that it's not optimized away.
12627 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
12628 * dispextern.h (bidi_dump_cached_states): Remove, since it's
12629 exported only to the debugger.
12630
e192d7d3 12631 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 12632 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 12633
92470028
PE
12634 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
12635 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
12636 was inaccessible from Lisp.
12637 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
12638 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
12639
244ed907
PE
12640 alloc.c: Import and export fewer symbols, and remove unused items.
12641 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
12642 is defined.
12643 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
12644 it's not optimized away by whole-program optimization.
12645 (message_enable_multibyte, free_misc): Remove.
12646 (catchlist, handlerlist, mark_backtrace):
12647 Declare only if BYTE_MARK_STACK.
12648 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
12649 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
12650 (message_enable_multibyte): Remove decl.
12651 (free_misc, interval_free_list, float_block, float_block_index):
12652 (n_float_blocks, float_free_list, cons_block, cons_block_index):
12653 (cons_free_list, last_marked_index):
12654 Now static.
12655 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
12656 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
12657 (mark_backtrace): Define only if BYTE_MARK_STACK.
12658 * xdisp.c (message_enable_multibyte): Now static.
12659
61c2b50e 12660 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
12661 This makes it easier for human readers (and static analyzers)
12662 to see whether these variables are used from other modules.
12663 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
12664 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
12665 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
12666 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
12667 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
12668 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
12669 * xmenu.c, xselect.c:
12670 Declare Q* vars static if they are not used in other modules.
12671 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
12672 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
12673 Remove decls of unexported vars.
12674 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
12675
95c82688
PE
12676 * lisp.h (DEFINE_FUNC): Make sname 'static'.
12677
16a97296
PE
12678 Make Emacs functions such as Fatom 'static' by default.
12679 This makes it easier for human readers (and static analyzers)
12680 to see whether these functions can be called from other modules.
12681 DEFUN now defines a static function. To make the function external
12682 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
12683 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
12684 (Finit_image_library):
16a97296
PE
12685 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
12686 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
12687 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
12688 Remove decls, since these functions are now static.
12689 (Funintern, Fget_internal_run_time): New decls, since these functions
12690 were already external.
95c82688 12691
16a97296
PE
12692 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
12693 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
12694 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
12695 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
12696 * keyboard.c, keymap.c, lread.c:
12697 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
12698 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
12699 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
12700 Mark functions with DEFUE instead of DEFUN,
12701 if they are used in other modules.
12702 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
12703 decls for now-static functions.
12704 * buffer.h (Fdelete_overlay): Remove decl.
12705 * callproc.c (Fgetenv_internal): Mark as internal.
12706 * composite.c (Fremove_list_of_text_properties): Remove decl.
12707 (Fcomposition_get_gstring): New forward static decl.
12708 * composite.h (Fcomposite_get_gstring): Remove decl.
12709 * dired.c (Ffile_attributes): New forward static decl.
12710 * doc.c (Fdocumntation_property): New forward static decl.
12711 * eval.c (Ffetch_bytecode): New forward static decl.
12712 (Funintern): Remove extern decl; now in .h file where it belongs.
12713 * fileio.c (Fmake_symbolic_link): New forward static decl.
12714 * image.c (Finit_image_library): New forward static decl.
12715 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
12716 * intervals.h (Fprevious_property_change):
12717 (Fremove_list_of_text_properties): Remove decls.
12718 * keyboard.c (Fthis_command_keys): Remove decl.
12719 (Fcommand_execute): New forward static decl.
12720 * keymap.c (Flookup_key): New forward static decl.
12721 (Fcopy_keymap): Now static.
12722 * keymap.h (Flookup_key): Remove decl.
12723 * process.c (Fget_process): New forward static decl.
12724 (Fprocess_datagram_address): Mark as internal.
12725 * syntax.c (Fsyntax_table_p): New forward static decl.
12726 (skip_chars): Remove duplicate decl.
12727 * textprop.c (Fprevious_property_change): New forward static decl.
12728 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
12729 Now internal.
12730 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
12731 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
12732
785bbd42
PE
12733 * editfns.c (Fformat): Remove unreachable code.
12734
8b913b57
AS
127352011-04-14 Andreas Schwab <schwab@linux-m68k.org>
12736
12737 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
12738 change. (Bug#8496)
12739
a6744a35
EZ
127402011-04-13 Eli Zaretskii <eliz@gnu.org>
12741
12742 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
12743 when at ZV. (Bug#8487)
12744
e7974947
AS
127452011-04-12 Andreas Schwab <schwab@linux-m68k.org>
12746
baad03f0
AS
12747 * charset.c (Fclear_charset_maps): Use xfree instead of free.
12748 (Bug#8437)
12749 * keyboard.c (parse_tool_bar_item): Likewise.
12750 * sound.c (sound_cleanup, alsa_close): Likewise.
12751 * termcap.c (tgetent): Likewise.
12752 * xfns.c (x_default_font_parameter): Likewise.
12753 * xsettings.c (read_and_apply_settings): Likewise.
12754
e7974947
AS
12755 * alloc.c (overrun_check_malloc, overrun_check_realloc)
12756 (overrun_check_free): Protoize.
12757
28272684
PE
127582011-04-12 Paul Eggert <eggert@cs.ucla.edu>
12759
12760 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
12761 since callers should never pass a negative size.
12762 Change the signature to match that of plain 'read' and 'write'; see
12763 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
12764 * lisp.h: Update prototypes of emacs_write and emacs_read.
12765
11997c76
EZ
127662011-04-11 Eli Zaretskii <eliz@gnu.org>
12767
12768 * xdisp.c (redisplay_window): Don't try to determine the character
12769 position of the scroll margin if the window start point w->startp
e896f03c 12770 is outside the buffer's accessible region. (Bug#8468)
11997c76 12771
8a2cbd72
EZ
127722011-04-10 Eli Zaretskii <eliz@gnu.org>
12773
12774 Fix write-region and its subroutines for buffers > 2GB.
12775 * fileio.c (a_write, e_write): Modify declaration of arguments and
12776 local variables to support buffers larger than 2GB.
12777 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
12778
12779 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
12780 argument, local variables, and return value.
12781
12782 * lisp.h: Update prototypes of emacs_write and emacs_read.
12783
12784 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
12785
4073e537 127862011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 12787
1ebfdcb6
PE
12788 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
12789
b2ded58d
PE
12790 Fix more problems found by GCC 4.6.0's static checks.
12791
7d66342c
PE
12792 * xdisp.c (vmessage): Use a better test for character truncation.
12793
bbf47d44
PE
12794 * charset.c (load_charset_map): <, not <=, for optimization,
12795 and to avoid potential problems with integer overflow.
9248994d 12796 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 12797 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 12798 * editfns.c (Fformat): Likewise.
1e69125e 12799 * syntax.c (skip_chars): Likewise.
3befa583 12800
e3019616
PE
12801 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
12802 This also lets GCC 4.6.0 generate slightly better loop code.
12803
becfa255
PE
12804 * callint.c (Fcall_interactively): <, not <=, for optimization.
12805 (Fcall_interactively): Count the number of arguments produced,
12806 not the number of arguments given. This is simpler and lets GCC
12807 4.6.0 generate slightly better code.
12808
dae0cd48
PE
12809 * ftfont.c: Distingish more carefully between FcChar8 and char.
12810 The previous code passed unsigned char * to a functions like
12811 strlen and xstrcasecmp that expect char *, which does not
12812 conform to the C standard.
12813 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
12814 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
12815 char * when the C standard requires it.
12816
76032d70
PE
12817 * keyboard.c (read_char): Remove unused var.
12818
eb3f1cc8
PE
12819 * eval.c: Port to Windows vsnprintf (Bug#8435).
12820 Include <limits.h>.
12821 (SIZE_MAX): Define if the headers do not.
12822 (verror): Do not give up if vsnprintf returns a negative count.
12823 Instead, grow the buffer. This ports to Windows vsnprintf, which
12824 does not conform to C99. Problem reported by Eli Zaretskii.
12825 Also, simplify the allocation scheme, by avoiding the need for
12826 calling realloc, and removing the ALLOCATED variable.
12827
70476b54
PE
12828 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
12829
12020a9e
PE
12830 Remove invocations of doprnt, as Emacs now uses vsnprintf.
12831 But keep the doprint source code for now, as we might revamp it
12832 and use it again (Bug#8435).
ea6c7ae6
PE
12833 * lisp.h (doprnt): Remove.
12834 * Makefile.in (base_obj): Remove doprnt.o.
12835 * deps.mk (doprnt.o): Remove.
12836
5fdb398c
PE
12837 error: Print 32- and 64-bit integers portably (Bug#8435).
12838 Without this change, on typical 64-bit hosts error ("...%d...", N)
12839 was used to print both 32- and 64-bit integers N, which relied on
12840 undefined behavior.
61bdb816 12841 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
12842 * lisp.h (error, verror): Mark as printf-like functions.
12843 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
12844 Report overflow in size calculations when allocating printf buffer.
12845 Do not truncate output string at its first null byte.
12846 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
12847 Truncate the output at a character boundary, since vsnprintf does not
12848 do that.
12849 * charset.c (check_iso_charset_parameter): Convert internal
12850 character to string before calling 'error', since %c now has the
12851 printf meaning.
12852 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
12853 overflow when computing char to be passed to 'error'. Do not
12854 pass Lisp_Object to 'error'; pass the integer instead.
12855 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
12856 formatted with plain %d.
12857
b189fa66
PE
12858 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
12859
bff87ef0
PE
12860 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
12861
7e2cac20
PE
12862 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
12863
ce4d90b5
PE
12864 * xterm.c (x_catch_errors): Remove duplicate declaration.
12865
266c9547
PE
12866 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
12867
79c49ad2
PE
12868 * xdisp.c, lisp.h (message_nolog): Remove; unused.
12869
368f4090
JM
128702011-04-10 Jim Meyering <meyering@redhat.com>
12871
12872 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
12873 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
12874 return ssize_t not "int", and use size_t as the buffer length.
12875 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
12876 * gnutls.h: Update declarations.
12877 * process.c (read_process_output): Use ssize_t, to match.
12878 (send_process): Likewise.
12879
a32d4040
CY
128802011-04-09 Chong Yidong <cyd@stupidchicken.com>
12881
12882 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
12883
8546720e 128842011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 12885
04f2d78b
CB
12886 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
12887 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 12888
8546720e
GM
12889 * xterm.c (handle_one_xevent):
12890 * xmenu.c (create_and_show_popup_menu):
12891 * xselect.c (x_decline_selection_request)
12892 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 12893
0a2f5c1a 128942011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
12895
12896 Fix some uses of `int' instead of EMACS_INT.
12897 * search.c (string_match_1, fast_string_match)
12898 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
12899 (scan_buffer, find_next_newline_no_quit)
12900 (find_before_next_newline, search_command, Freplace_match)
12901 (Fmatch_data): Make some `int' variables be EMACS_INT.
12902
12903 * xdisp.c (display_count_lines): 3rd argument and return value now
12904 EMACS_INT. All callers changed.
12905 (pint2hrstr): Last argument is now EMACS_INT.
12906
12907 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
12908 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
12909 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
12910 (decode_coding_utf_16, decode_coding_emacs_mule)
12911 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
12912 (decode_coding_ccl, decode_coding_charset)
12913 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
12914 (decode_coding_iso_2022, decode_coding_emacs_mule)
12915 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
12916 <char_offset, last_offset>: Declare EMACS_INT.
12917 (encode_coding_utf_8, encode_coding_utf_16)
12918 (encode_coding_emacs_mule, encode_invocation_designation)
12919 (encode_designation_at_bol, encode_coding_iso_2022)
12920 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
12921 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
12922 Declare EMACS_INT.
12923 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
12924 (encode_invocation_designation): Last argument P_NCHARS is now
12925 EMACS_INT.
12926 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
12927 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
12928
12929 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
12930 All users changed.
12931
12932 * ccl.c (Fccl_execute_on_string): Declare some variables
12933 EMACS_INT.
12934
8546720e 129352011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
12936
12937 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
12938
4e19a977
CS
129392011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
12940
12941 * process.c (Fformat_network_address): Doc fix.
12942
87302331
R
129432011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
12944
ee7683eb 12945 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 12946
cbb59342
CY
129472011-04-08 Chong Yidong <cyd@stupidchicken.com>
12948
12949 * keyboard.c (read_char): Call Lisp function help-form-show,
12950 instead of using internal_with_output_to_temp_buffer.
12951 (Qhelp_form_show): New var.
e0d38eeb 12952 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
12953
12954 * print.c (internal_with_output_to_temp_buffer): Function deleted.
12955
12956 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
12957
e67a13ab
CY
129582011-04-06 Chong Yidong <cyd@stupidchicken.com>
12959
04f2d78b
CB
12960 * process.c (Flist_processes): Remove to Lisp.
12961 (list_processes_1): Delete.
e67a13ab 12962
973f782d
EZ
129632011-04-06 Eli Zaretskii <eliz@gnu.org>
12964
7c106b1e
EZ
12965 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
12966
973f782d
EZ
12967 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
12968
41cf7d1a 129692011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 12970
ca23cc88
PE
12971 Fix more problems found by GCC 4.6.0's static checks.
12972
f390e2d5
PE
12973 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
12974
42eea0d0
PE
12975 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
12976
b69769da 12977 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 12978
f9541e84
PE
12979 * xdisp.c (vmessage): Mark as a printf-like function.
12980
13841b55
PE
12981 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
12982
c136c10f
PE
12983 * sound.c (sound_warning): Don't crash if arg contains a printf format.
12984
5e2d4a30
PE
12985 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
12986 printf-like functions.
12987 (tiff_load): Add casts to remove these marks before passing them
12988 to system-supplied API.
12989
583f48b9
PE
12990 * eval.c (Fsignal): Remove excess argument to 'fatal'.
12991
b25d760e
PE
12992 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
12993 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
12994 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
12995 directly, rather than having caller test rule sign. This avoids
12996 some unnecessary tests.
12997 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
12998 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
12999 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 13000
bc7b6697 13001 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 13002 (xfont_open): Avoid unnecessary tests.
bc7b6697 13003
27ccc379
PE
13004 * composite.c (composition_gstring_put_cache): Use unsigned integer.
13005
dcd5c89a
PE
13006 * composite.h, composite.c (composition_gstring_put_cache):
13007 Use EMACS_INT, not int, for length.
13008
b13a45c6
PE
13009 * composite.h (COMPOSITION_DECODE_REFS): New macro,
13010 breaking out part of COMPOSITION_DECODE_RULE.
13011 (COMPOSITION_DECODE_RULE): Use it.
13012 * composite.c (get_composition_id): Remove unused local vars,
13013 by using the new macro.
13014
1e792e4d
PE
13015 * textprop.c (set_text_properties_1): Change while to do-while,
13016 since the condition is always true at first.
13017
dc6c6455 13018 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
13019 (interval_deletion_adjustment): Return unsigned value.
13020 All uses changed.
dc6c6455 13021
aba7731a
PE
13022 * process.c (list_processes_1, create_pty, read_process_output):
13023 (exec_sentinel): Remove vars that were set but not used.
afd4052b 13024 (create_pty): Remove unnecessary "volatile"s.
bc57d757 13025 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 13026 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 13027 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 13028
fdfc4bf3
PE
13029 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
13030
fca8fe46 13031 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 13032 (update_syntax_table): Use unsigned instead of int.
fca8fe46 13033
06a0259a 13034 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 13035 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 13036 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 13037
e7b9e80f
PE
13038 * print.c (print_error_message): Avoid int overflow.
13039
56201685
PE
13040 * font.c (font_list_entities): Redo for clarity,
13041 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
13042
78834453 13043 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 13044 (font_score): Avoid potential overflow in diff calculation.
78834453 13045
0bc0b309 13046 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 13047 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 13048
e610eaca
PE
13049 * eval.c (funcall_lambda): Rename local to avoid shadowing.
13050
b895abce
PE
13051 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
13052 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
13053 can always succeed if overflow has undefined behavior.
13054
1f1d9321 13055 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 13056 (wordify): Omit three unnecessary tests.
1f1d9321 13057
c59478bc
PE
13058 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
13059 All callers changed. This avoids the need for an unused var.
13060
79b73827
PE
13061 * casefiddle.c (casify_region): Remove var that is set but not used.
13062
a4db5dfe
PE
13063 * dired.c (file_name_completion): Remove var that is set but not used.
13064
43aae36e
PE
13065 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
13066
2a47c44d 13067 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 13068 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 13069
a37c69bf
PE
13070 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
13071 Check for integer overflow on size calculations.
13072
328ab8e7
PE
13073 * buffer.c (Fprevious_overlay_change): Remove var that is set
13074 but not used.
13075
e5a2a5cb
PE
13076 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
13077 Remove vars that are set but not used.
8d84a6eb 13078 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 13079 (timer_check_2): Mark vars as initialized.
e5a2a5cb 13080
a60e5f68
PE
13081 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
13082
f661cb61 13083 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 13084 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 13085
f0397f5a
PE
13086 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
13087 that are set but not used.
13088
8664db06 13089 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 13090 if XCreateBitmapFromData fails (Bug#8410).
8664db06 13091
6abdaa4a
PE
13092 * xselect.c (x_get_local_selection, x_handle_property_notify):
13093 Remove vars that are set but not used.
13094
0ce7538d 13095 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 13096 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 13097
9ae848fc
PE
13098 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
13099 Remove var that is set but not used.
0b918413
PE
13100 (scroll_bar_windows_size): Now size_t, not int.
13101 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
13102 Check for overflow.
9ae848fc 13103
a5a62657
PE
13104 * xfaces.c (realize_named_face): Remove vars that are set but not used.
13105 (map_tty_color) [!defined MSDOS]: Likewise.
13106
5c5cdd39
PE
13107 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
13108
66ebf983
PE
13109 * coding.c: Remove vars that are set but not used.
13110 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
13111 All callers changed.
13112 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
13113 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
13114 (decode_coding_charset): Remove vars that are set but not used.
13115
1be4d761
PE
13116 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
13117 that is set but not used.
13118
47553fa8
PE
13119 * print.c (print_object): Remove var that is set but not used.
13120
1f7196bf 13121 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
13122 The gnulib version avoids calling malloc in the usual case,
13123 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
13124 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
13125 * filelock.c (current_lock_owner): Likewise.
13126 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
13127 * sysdep.c: Include allocator.h, careadlinkat.h.
13128 (emacs_no_realloc_allocator): New static constant.
13129 (emacs_readlink): New function.
fdb61804
PE
13130 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
13131 ../lib/careadlinkat.h.
d1fdcab7 13132
f84c17c7
SM
131332011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
13134
13135 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
13136 first non-nil return value).
13137
ef3862ad
JD
131382011-04-03 Jan Djärv <jan.h.d@swipnet.se>
13139
13140 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
13141 if not defined (Bug#8403).
13142
376a7006
JB
131432011-04-02 Juanma Barranquero <lekktu@gmail.com>
13144
13145 * xdisp.c (display_count_lines): Remove parameter `start',
13146 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
13147 (get_char_face_and_encoding): Remove parameter `multibyte_p',
13148 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
13149 (fill_stretch_glyph_string): Remove parameters `row' and `area',
13150 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
13151 and thereabouts. All callers changed.
13152 (get_per_char_metric): Remove parameter `f', unused since
13153 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
13154
6ca3801d
JM
131552011-04-02 Jim Meyering <meyering@redhat.com>
13156
13157 do not dereference NULL upon failed strdup
13158 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
13159 (ns_get_family): Likewise.
13160
d8e2b5ba
JB
131612011-04-02 Juanma Barranquero <lekktu@gmail.com>
13162
13163 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
13164
8c74fcbd
JD
131652011-04-02 Jan Djärv <jan.h.d@swipnet.se>
13166
13167 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
13168 later (Bug#8403).
13169
7200d79c
SM
131702011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
13171
03408648 13172 Add lexical binding.
7200d79c 13173
03408648
SM
13174 * window.c (Ftemp_output_buffer_show): New fun.
13175 (Fsave_window_excursion):
13176 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
13177
13178 * lread.c (lisp_file_lexically_bound_p): New function.
13179 (Fload): Bind Qlexical_binding.
13180 (readevalloop): Remove `evalfun' arg.
13181 Bind Qinternal_interpreter_environment.
13182 (Feval_buffer): Bind Qlexical_binding.
13183 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
13184 Mark as dynamic.
13185 (syms_of_lread): Declare `lexical-binding'.
13186
13187 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
13188
13189 * keyboard.c (eval_dyn): New fun.
13190 (menu_item_eval_property): Use it.
ca105506
SM
13191
13192 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 13193
03408648
SM
13194 * fns.c (concat, mapcar1): Accept byte-code-functions.
13195
13196 * eval.c (Fsetq): Handle lexical vars.
13197 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
13198 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
13199 (FletX, Flet): Obey lexical binding.
13200 (Fcommandp): Handle closures.
13201 (Feval): New `lexical' arg.
13202 (eval_sub): New function extracted from Feval. Use it almost
13203 everywhere where Feval was used. Look up vars in lexical env.
13204 Handle closures.
13205 (Ffunctionp): Move from subr.el.
13206 (Ffuncall): Handle closures.
13207 (apply_lambda): Remove `eval_flags'.
13208 (funcall_lambda): Handle closures and new byte-code-functions.
13209 (Fspecial_variable_p): New function.
13210 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
13211 but without exporting it to Lisp.
23aba0ea 13212
23aba0ea 13213 * doc.c (Fdocumentation, store_function_docstring):
03408648 13214 * data.c (Finteractive_form): Handle closures.
23aba0ea 13215
03408648
SM
13216 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
13217 interactive spec.
ba83908c 13218
04f2d78b
CB
13219 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
13220 New byte-codes.
03408648
SM
13221 (exec_byte_code): New function extracted from Fbyte_code to handle new
13222 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 13223
03408648 13224 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 13225
03408648 13226 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 13227
e2abce01
JB
132282011-03-31 Juanma Barranquero <lekktu@gmail.com>
13229
13230 * xdisp.c (redisplay_internal): Fix prototype.
13231
63696a73 132322011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 13233
63696a73 13234 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
13235 (try_scrolling): Use it when setting scroll_limit.
13236 Limit scrolling to 100 screen lines.
63696a73
EZ
13237 (redisplay_window): Even when falling back on "recentering",
13238 position point in the window according to scroll-conservatively,
13239 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
13240
13241 (try_scrolling): When point is above the window, allow searching
13242 as far as scroll_max, or one screenful, to compute vertical
13243 distance from PT to the scroll margin position. This prevents
13244 try_scrolling from unnecessarily failing when
13245 scroll-conservatively is set to a value slightly larger than the
13246 window height. Clean up the case of PT below the margin at bottom
13247 of window: scroll_max can no longer be INT_MAX. When aggressive
13248 scrolling is in use, don't let point enter the opposite scroll
13249 margin as result of the scroll.
13250 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
13251 threshold of 100 lines for never-recentering scrolling.
13252
e4cc2dfc
JB
132532011-03-31 Juanma Barranquero <lekktu@gmail.com>
13254
13255 * dispextern.h (move_it_by_lines):
13256 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
13257 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
13258 (message_log_check_duplicate): Remove parameters `prev_bol' and
13259 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
13260 (redisplay_internal): Remove parameter `preserve_echo_area',
13261 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
13262
13263 * indent.c (Fvertical_motion):
13264 * window.c (window_scroll_pixel_based, Frecenter):
13265 Don't pass `need_y_p' to `move_it_by_lines'.
13266
1c470562
SM
132672011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
13268
44f230aa
SM
13269 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
13270 steal a few bits to be more compact.
13271 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
13272 Remove unneeded casts.
13273
1c470562
SM
13274 * bytecode.c (Fbyte_code): CAR and CDR can GC.
13275
888adce9
ZK
132762011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
13277
13278 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
13279 binding" message (bug#7967).
13280
f838ed7b
PE
132812011-03-30 Paul Eggert <eggert@cs.ucla.edu>
13282
77861b95
PE
13283 Fix more problems found by GCC 4.6.0's static checks.
13284
de6dbc14
PE
13285 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
13286 Remove unused local var.
13287
f838ed7b
PE
13288 * editfns.c (Fmessage_box): Remove unused local var.
13289
792c7b2b
PE
13290 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
13291 (note_mode_line_or_margin_highlight, note_mouse_highlight):
13292 Omit unused local vars.
c499e557 13293 * window.c (shrink_windows): Omit unused local var.
b01a1c29 13294 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
13295 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
13296 Omit unused local var.
13297
ba0165e1
PE
13298 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
13299 Don't assume string length fits in int.
32ad8845 13300 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 13301 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 13302
3c59b4c9
PE
13303 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
13304 instead of alloca (Bug#8344).
13305
a3eed478 13306 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 13307 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 13308
eb4d412d
PE
13309 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
13310
1658b401
PE
13311 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
13312 concerns.
13313
13314 * term.c (produce_glyphless_glyph): Remove unnecessary test.
13315
13316 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 13317
9a2c6e05
PE
13318 * keyboard.c (syms_of_keyboard): Use the same style as later
13319 in this function when indexing through an array. This also
13320 works around GCC bug 48267.
13321
03d0a109
PE
13322 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
13323
44f730c8
PE
13324 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
13325
fe75f926
PE
13326 * chartab.c (sub_char_table_ref_and_range): Redo for slight
13327 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
13328
ffa8c828
PE
13329 * keyboard.c, keyboard.h (num_input_events): Now size_t.
13330 This avoids undefined behavior on integer overflow, and is a bit
13331 more convenient anyway since it is compared to a size_t variable.
13332
c5101a77
PE
13333 Variadic C functions now count arguments with size_t, not int.
13334 This avoids an unnecessary limitation on 64-bit machines, which
13335 caused (substring ...) to crash on large vectors (Bug#8344).
13336 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
13337 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 13338 All variadic functions and their callers changed accordingly.
c5101a77
PE
13339 (struct gcpro.nvars): Now size_t, not int. All uses changed.
13340 * data.c (arith_driver, float_arith_driver): Likewise.
13341 * editfns.c (general_insert_function): Likewise.
13342 * eval.c (struct backtrace.nargs, interactive_p)
13343 (internal_condition_case_n, run_hook_with_args, apply_lambda)
13344 (funcall_lambda, mark_backtrace): Likewise.
13345 * fns.c (concat): Likewise.
13346 * frame.c (x_set_frame_parameters): Likewise.
13347 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
13348 0 if not found, not -1. All callers changed.
13349
dd3f25f7
PE
13350 * alloc.c (garbage_collect): Don't assume stack size fits in int.
13351 (stack_copy_size): Now size_t, not int.
13352 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
13353
461c2ab9
JB
133542011-03-28 Juanma Barranquero <lekktu@gmail.com>
13355
13356 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
13357 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
13358 All callers changed.
13359
13360 * lisp.h (multibyte_char_to_unibyte):
13361 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
13362 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
13363 * character.h (CHAR_TO_BYTE8):
13364 * cmds.c (internal_self_insert):
13365 * editfns.c (general_insert_function):
13366 * keymap.c (push_key_description):
13367 * search.c (Freplace_match):
13368 * xdisp.c (message_dolog, set_message_1): All callers changed.
13369
f6d62986
SM
133702011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
13371
13372 * keyboard.c (safe_run_hook_funcall): New function.
13373 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
13374 don't set the hook to nil, but remove the offending function instead.
13375 (Qcommand_hook_internal): Remove, unused.
13376 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
13377 Vcommand_hook_internal.
13378
13379 * eval.c (enum run_hooks_condition): Remove.
13380 (funcall_nil, funcall_not): New functions.
13381 (run_hook_with_args): Call each function through a `funcall' argument.
13382 Remove `cond' argument, now redundant.
13383 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
13384 (Frun_hook_with_args_until_failure): Adjust accordingly.
13385 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
13386
1db5b1ad
JB
133872011-03-28 Juanma Barranquero <lekktu@gmail.com>
13388
13389 * dispextern.h (string_buffer_position): Remove declaration.
13390
13391 * print.c (strout): Remove parameter `multibyte', unused since
13392 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
13393
13394 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
13395 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
13396 All callers changed.
13397
13398 * w32.c (_wsa_errlist): Use braces for struct initializers.
13399
13400 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
13401 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
13402 All callers changed.
13403 (string_buffer_position): Likewise. Also, make static (it's never
13404 used outside xdisp.c).
13405 (cursor_row_p): Remove parameter `w', unused since
13406 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
13407 (decode_mode_spec): Remove parameter `precision', introduced during
13408 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
13409 All callers changed.
13410
5ffb62aa
JD
134112011-03-27 Jan Djärv <jan.h.d@swipnet.se>
13412
13413 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
13414
461c2ab9 134152011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
13416
13417 * nsterm.m (ns_menu_bar_is_hidden): New variable.
13418 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
13419 (ns_update_auto_hide_menu_bar): New functions.
13420 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
13421 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
13422 ns_constrain_all_frames.
13423 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
13424 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
13425
5c380ffb
JD
134262011-03-27 Jan Djärv <jan.h.d@swipnet.se>
13427
13428 * nsmenu.m (runDialogAt): Remove argument to timer_check.
13429
9af30bdf
GM
134302011-03-27 Glenn Morris <rgm@gnu.org>
13431
13432 * syssignal.h: Replace RETSIGTYPE with void.
13433 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
13434 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
13435 Replace SIGTYPE with void everywhere.
13436 * s/usg5-4-common.h (SIGTYPE): Remove definition.
13437 * s/template.h (SIGTYPE): Remove commented out definition.
13438
e2abce01
JB
134392011-03-26 Eli Zaretskii <eliz@gnu.org>
13440
13441 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
13442 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
13443
f868cd8a
JB
134442011-03-26 Juanma Barranquero <lekktu@gmail.com>
13445
59eb0929
JB
13446 * w32.c (read_unc_volume): Use parameter `henum', instead of
13447 global variable `wget_enum_handle'.
13448
13449 * keymap.c (describe_vector): Remove parameters `indices' and
13450 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
13451 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
13452
f868cd8a
JB
13453 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
13454
13455 * keyboard.c (timer_check): Remove parameter `do_it_now',
13456 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
13457 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
13458 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
13459
13460 * keyboard.c (read_char):
13461 * w32menu.c (w32_menu_display_help):
13462 * xmenu.c (show_help_event, menu_help_callback):
13463 Adjust calls to `show_help_echo'.
13464
13465 * gtkutil.c (xg_maybe_add_timer):
13466 * keyboard.c (readable_events):
13467 * process.c (wait_reading_process_output):
13468 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
13469
13470 * insdel.c (adjust_markers_gap_motion):
13471 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
13472 (gap_left, gap_right): Don't call it.
13473
2ecf6fdb
CY
134742011-03-25 Chong Yidong <cyd@stupidchicken.com>
13475
13476 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
13477 incurred during fontification.
13478
6b1f9ba4
JB
134792011-03-25 Juanma Barranquero <lekktu@gmail.com>
13480
13481 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
13482 (DEFVAR_PER_BUFFER): Don't pass it.
13483
13484 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
13485 (scrolling_window): Don't pass it.
13486
0f4a96b5
JB
134872011-03-25 Juanma Barranquero <lekktu@gmail.com>
13488
13489 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
13490
13491 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
13492 and `suffix'.
13493 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
13494 of variables specific to SELinux and computation of `encoded_absname'.
13495
13496 * image.c (XPutPixel): Remove unused variable `height'.
13497
13498 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
13499
13500 * unexw32.c (get_section_info): Remove unused variable `section'.
13501
13502 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
13503 (system_process_attributes): Remove unused variable `sess'.
13504 (sys_read): Remove unused variable `err'.
13505
13506 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
13507 (w32_wnd_proc): Remove unused variable `isdead'.
13508 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
13509 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
13510 (x_create_tip_frame): Remove unused variable `tem'.
13511
13512 * w32inevt.c (w32_console_read_socket):
13513 Remove unused variable `no_events'.
13514
13515 * w32term.c (x_draw_composite_glyph_string_foreground):
13516 Remove unused variable `width'.
13517
1149507c
JB
135182011-03-24 Juanma Barranquero <lekktu@gmail.com>
13519
13520 * w32term.c (x_set_glyph_string_clipping):
13521 Don't pass uninitialized region to CombineRgn.
13522
9c88f339
JB
135232011-03-23 Juanma Barranquero <lekktu@gmail.com>
13524
13525 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
13526 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
13527 (Fx_close_connection): Remove unused variable `i'.
13528
13529 * w32font.c (w32font_draw): Return number of glyphs.
13530 (w32font_open_internal): Remove unused variable `i'.
13531 (w32font_driver): Add missing initializer.
13532
13533 * w32menu.c (utf8to16): Remove unused variable `utf16'.
13534 (fill_in_menu): Remove unused variable `items_added'.
13535
13536 * w32term.c (last_mouse_press_frame): Remove static global variable.
13537 (w32_clip_to_row): Remove unused variable `f'.
13538 (x_delete_terminal): Remove unused variable `i'.
13539
13540 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
13541 (NOTHING): Remove unused static global variable.
13542 (uniscribe_check_otf): Remove unused variable `table'.
13543 (uniscribe_font_driver): Add missing initializers.
13544
dee091a3
JD
135452011-03-23 Julien Danjou <julien@danjou.info>
13546
13547 * term.c (Fsuspend_tty, Fresume_tty):
13548 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
13549 * window.c (temp_output_buffer_show):
13550 * insdel.c (signal_before_change):
13551 * frame.c (Fhandle_switch_frame):
13552 * fileio.c (Fdo_auto_save):
13553 * emacs.c (Fkill_emacs):
13554 * editfns.c (save_excursion_restore):
13555 * cmds.c (internal_self_insert):
13556 * callint.c (Fcall_interactively):
13557 * buffer.c (Fkill_all_local_variables):
13558 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
13559 Use Frun_hooks.
0f4a96b5 13560 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 13561 unconditionally since it does the check itself.
dee091a3 13562
2c520ab5 135632011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 13564
c9c49752
PE
13565 Fix more problems found by GCC 4.5.2's static checks.
13566
8abc3f12
PE
13567 * coding.c (encode_coding_raw_text): Avoid unnecessary test
13568 the first time through the loop, since we know p0 < p1 then.
13569 This also avoids a gcc -Wstrict-overflow warning.
13570
a2d26660
PE
13571 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
13572 leading to a memory leak, possible in functions like
13573 load_charset_map_from_file that can allocate an unbounded number
b12ef411 13574 of objects (Bug#8318).
a2d26660 13575
916c72e9
PE
13576 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
13577 that could (at least in theory) be that large.
13578
19ab8a18
PE
13579 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
13580 This is less likely to overflow, and avoids undefined behavior if
13581 overflow does occur. All callers changed. Use strtoul to scan
13582 for the unsigned long integer.
b7cbbd6f
PE
13583 (pint2hrstr): Simplify and tune code slightly.
13584 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 13585
f0641eff
PE
13586 * scroll.c (do_scrolling): Work around GCC bug 48228.
13587 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
13588
7f650bb9
PE
13589 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
13590 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
13591 (validate_x_resource_name): Simplify count usage.
13592 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 13593
37dd57d1
PE
13594 * fileio.c (Fcopy_file): Report error if fchown or fchmod
13595 fail (Bug#8306).
81e56e61 13596
699979fc 13597 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 13598
401bf9b4
PE
13599 * process.c (Fmake_network_process): Use socklen_t, not int,
13600 where POSIX says socklen_t is required in portable programs.
13601 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 13602 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
13603 (Fmake_network_process, server_accept_connection):
13604 (wait_reading_process_output, read_process_output):
13605 Likewise.
13606
b93aacde
PE
13607 * process.c: Rename or move locals to avoid shadowing.
13608 (list_processes_1, Fmake_network_process):
13609 (read_process_output_error_handler, exec_sentinel_error_handler):
13610 Rename or move locals.
4dc343ee 13611 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 13612 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 13613 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 13614 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 13615 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 13616
af8a867c 13617 Make tparam.h and terminfo.c consistent.
44f230aa
SM
13618 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
13619 Include tparam.h instead, since it declares them.
af8a867c
PE
13620 * cm.h (PC): Remove extern decl; tparam.h now does this.
13621 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
13622 * terminfo.c: Include tparam.h, to check interfaces.
13623 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
13624 (tparam): Adjust signature to match interface in tparam.h;
13625 this removes some undefined behavior. Check that outstring and len
13626 are zero, which they always are with Emacs.
13627 * tparam.h (PC, BC, UP): New extern decls.
13628
0248044d 13629 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 13630 (xftfont_open): Rename locals to avoid shadowing.
0248044d 13631
8ff096c1 13632 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
13633 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
13634 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 13635 (ftfont_list): Remove unused local.
49eaafba
PE
13636 (get_adstyle_property, ftfont_pattern_entity):
13637 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
13638 Rename locals to avoid shadowing.
8ff096c1 13639
e2be39f6
PE
13640 * xfont.c (xfont_list_family): Mark var as initialized.
13641
c9735e30
PE
13642 * xml.c (make_dom): Now static.
13643
8f5201ae
PE
13644 * composite.c (composition_compute_stop_pos): Rename local to
13645 avoid shadowing.
b246f932
PE
13646 (composition_reseat_it): Remove unused locals.
13647 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 13648 (composition_update_it): Mark var as initialized.
11b61122
PE
13649 (find_automatic_composition): Mark vars as initialized,
13650 with a FIXME (Bug#8290).
8f5201ae 13651
760fbc2c
PE
13652 character.h: Rename locals to avoid shadowing.
13653 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
13654 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
13655 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
13656 (BUF_DEC_POS): Be more systematic about renaming local temporaries
13657 to avoid shadowing.
13658
ff08eb85
PE
13659 * textprop.c (property_change_between_p): Remove; unused.
13660
fc7bf025
PE
13661 * intervals.c (interval_start_pos): Now static.
13662
235d7abc
PE
13663 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
13664
44f230aa
SM
13665 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
13666 Rename locals to avoid shadowing.
3e7d6594 13667
50060332
PE
13668 * sound.c (wav_play, au_play, Fplay_sound_internal):
13669 Fix pointer signedness.
d01f234b 13670 (alsa_choose_format): Remove unused local var.
c83b8872
PE
13671 (wav_play): Initialize a variable to 0, to prevent undefined
13672 behavior (Bug#8278).
50060332 13673
c4fc4e30
PE
13674 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
13675
918436ed
PE
13676 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
13677
c939f91b
PE
13678 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
13679 clobbering (Bug#8298).
b9c7f648
PE
13680 * sysdep.c (sys_subshell): Likewise.
13681 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 13682
6bd8c144
PE
13683 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
13684 This should get cleaned up, so that child_setup has the
13685 same signature on all platforms.
13686
7710357c 13687 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 13688 (relocate_fd): Rename locals to avoid shadowing.
7710357c 13689
c59da222
CY
136902011-03-22 Chong Yidong <cyd@stupidchicken.com>
13691
13692 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
13693 not to be necessary, and produces flickering.
13694
66b87493
GM
136952011-03-20 Glenn Morris <rgm@gnu.org>
13696
13697 * config.in: Remove file.
13698
45b6f6d5
JB
136992011-03-20 Juanma Barranquero <lekktu@gmail.com>
13700
13701 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
13702 are now in src/globals.h.
13703 (syms_of_minibuf): Remove spurious & from previous change.
13704
cd394be1 137052011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
13706
13707 * minibuf.c (completing-read-function): New variable.
13708 (completing-read-default): Rename from completing-read.
13709 (completing-read): Call completing-read-function.
13710
b14e3e21
CY
137112011-03-19 Juanma Barranquero <lekktu@gmail.com>
13712
13713 * xfaces.c (Fx_load_color_file):
13714 Read color file from absolute filename (bug#8250).
13715
f2b726e6
JB
137162011-03-19 Juanma Barranquero <lekktu@gmail.com>
13717
13718 * makefile.w32-in: Update dependencies.
13719
09f6ff02
EZ
137202011-03-17 Eli Zaretskii <eliz@gnu.org>
13721
13722 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
13723
29a6015a
PE
137242011-03-17 Paul Eggert <eggert@cs.ucla.edu>
13725
a3a6c54e
PE
13726 Fix more problems found by GCC 4.5.2's static checks.
13727
b766f867
PE
13728 * process.c (make_serial_process_unwind, send_process_trap):
13729 (sigchld_handler): Now static.
13730
be02381c
PE
13731 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
13732 That way, the code declares only the vars that it needs.
13733 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
13734 * s/cygwin.h (PTY_ITERATION): Likewise.
13735 * s/darwin.h (PTY_ITERATION): Likewise.
13736 * s/gnu-linux.h (PTY_ITERATION): Likewise.
13737
57048744
PE
13738 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
13739 * process.c (allocate_pty): Don't declare stb unless it's needed.
13740
7914961c 13741 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
13742 (CONSTANTLIM): Remove; unused.
13743 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
13744 Define only if needed.
7914961c 13745
b3967b18
PE
13746 * unexelf.c (unexec): Name an expression,
13747 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
13748 Use a different way to cause a compilation error if anyone uses
13749 n rather than nn, a way that does not involve shadowing.
73366a00 13750 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 13751
29a6015a
PE
13752 * deps.mk (unexalpha.o): Remove; unused.
13753
43cfc33e 13754 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 13755 * unexec.h: New file.
ce701a33
PE
13756 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
13757 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
13758 Depend on unexec.h.
13759 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
13760 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
13761 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 13762 Change as necessary to match prototype in unexec.h.
ce701a33 13763
01f44d5a
PE
13764 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
13765 shadowing.
4f63c6bb 13766 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 13767
a6670b0b
PE
13768 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
13769 Rename locals to avoid shadowing.
13770
cef2010d 13771 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 13772 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 13773
d4d7173a
PE
13774 * print.c (Fredirect_debugging_output): Fix pointer signedess.
13775
f08b802a
PE
13776 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
13777 warning when compiling print.c.
13778
3ddb0639
PE
13779 * font.c (font_unparse_fcname): Abort in an "impossible" situation
13780 instead of using an uninitialized var.
5ad03b97 13781 (font_sort_entities): Mark var as initialized.
3ddb0639 13782
170a2692
PE
13783 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
13784
e663c700
PE
13785 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
13786 pointers to constants.
89bc529a 13787 (font_parse_fcname): Remove unused vars.
7b81e2d0 13788 (font_delete_unmatched): Now static.
ea838e10 13789 (font_get_spec): Remove; unused.
13a547c6
PE
13790 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
13791 (font_update_drivers, Ffont_get_glyphs, font_add_log):
13792 Rename or move locals to avoid shadowing.
e663c700 13793
2a80c887 13794 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 13795 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 13796
1384fa33 13797 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 13798 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 13799
8b2c52e9
PE
13800 * alloc.c (mark_backtrace): Move decl from here ...
13801 * lisp.h: ... to here, so that it can be checked.
13802
475545b5 13803 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 13804 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
13805 (lisp_indirect_variable): Name an expression,
13806 to avoid gcc -Wbad-function-cast warning.
1faed8ae 13807 (Fdefvar): Rename locals to avoid shadowing.
475545b5 13808
b1349114 13809 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 13810 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 13811 Use const pointer when appropriate.
b1349114 13812
a2928364
PE
13813 * lisp.h (get_system_name, get_operating_system_release):
13814 Move decls here, to check interfaces.
13815 * process.c (get_operating_system_release): Move decl to lisp.h.
13816 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
13817 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
13818 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
13819 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
13820 (Fformat_time_string, Fencode_time, Finsert_char):
13821 (Ftranslate_region_internal, Fformat):
13822 Rename or remove local vars to avoid shadowing.
9710023e 13823 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 13824
a415e694
PE
13825 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
13826 avoid shadowing.
13827
8ef4622d
PE
13828 * lisp.h (eassert): Check that the argument compiles, even if
13829 ENABLE_CHECKING is not defined.
13830
946f9a5b
PE
13831 * data.c (Findirect_variable): Name an expression, to avoid
13832 gcc -Wbad-function-cast warning.
112396d6 13833 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 13834 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
13835 (Fmake_variable_buffer_local, Fmake_local_variable):
13836 Mark variables as initialized.
52746918 13837 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 13838
e5aab7e7 13839 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
13840 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
13841 Rename locals to avoid shadowing.
dff45157
PE
13842 (mark_stack): Move local variables into the #ifdef region where
13843 they're used.
7bc26fdb
PE
13844 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
13845 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
13846 needed otherwise.
13847 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
13848 (GC_STRING_CHARS): Remove; not used.
d40d4be1 13849 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 13850
e5aab7e7
PE
13851 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
13852 avoids undefined behavior in theory.
13853
4da60324
PE
13854 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
13855
88043301
PE
13856 Use functions, not macros, for up- and down-casing (Bug#8254).
13857 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
13858 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
13859 to use the following functions instead of these macros.
13860 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
13861 EMACS_INT, since callers assume the returned value fits in int.
13862 (upcase1): Likewise, for UPCASE_TABLE.
13863 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 13864 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 13865 the race-condition problem in the old DOWNCASE.
88043301 13866
19ed5445
PE
13867 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
13868 Rename locals to avoid shadowing.
13869 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
13870 (regex_compile, re_search_2, re_match_2_internal):
13871 Remove unused local vars.
952db0d7
PE
13872 (FREE_VAR): Rewrite so as not to use empty "else",
13873 which gcc can warn about.
da053e48 13874 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
13875 (RETALLOC_IF): Define only if needed.
13876 (WORDCHAR_P): Likewise. This one is never needed, but is used
13877 only in a comment talking about a compiler bug, so put inside
13878 the #if 0 of that comment.
13879 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
13880 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
13881 Remove; unused.
19ed5445 13882
1f3561e4 13883 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
13884 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
13885 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 13886
ded6f8f7
PE
13887 * search.c (simple_search): Remove unused var.
13888
dbd37a95
PE
13889 * dired.c (compile_pattern): Move decl from here ...
13890 * lisp.h: ... to here, so that it can be checked.
13891 (struct re_registers): New forward decl.
13892
7e47afad
PE
13893 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
13894
85f24f61
PE
13895 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
13896 All uses changed.
13897 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
13898 Rename locals to avoid shadowing.
5671df8f 13899 (Fvertical_motion): Mark locals as initialized.
85f24f61 13900
181aa2be 13901 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 13902 (casify_region): Mark local as initialized.
181aa2be 13903
930d429c
PE
13904 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
13905
7082eac6
PE
13906 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
13907 New macros, so that the caller can use some names other than
13908 gcpro1, gcpro2, etc.
13909 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
13910 of the new macros.
13911 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
13912 argument, for consistency with GCPRO2_VAR, etc: it is now the
13913 prefix of the variable, not the variable itself. All uses
13914 changed.
38b2c076
PE
13915 * dired.c (directory_files_internal, file_name_completion):
13916 Rename locals to avoid shadowing.
13917
15206ed9
PE
13918 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
13919 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
13920 dired.c's scmp function, had undefined behavior.
13921 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
13922 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
13923 * buffer.h: ... to here, because these macros use current_buffer,
13924 and the new implementation with inline functions needs to have
13925 current_buffer in scope now, rather than later when the macros
13926 are used.
13927 (downcase, upcase1): New static inline functions.
13928 (DOWNCASE, UPCASE1): Reimplement using these functions.
13929 This avoids undefined behavior in expressions like
13930 DOWNCASE (x) == DOWNCASE (y), which previously suffered
13931 from race conditions in accessing the global variables
13932 case_temp1 and case_temp2.
13933 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
13934 * lisp.h (case_temp1, case_temp2): Remove their decls.
13935 * character.h (ASCII_CHAR_P): Move from here ...
13936 * lisp.h: ... to here, so that the inline functions mentioned
13937 above can use them.
13938
4a6bea26
PE
13939 * dired.c (directory_files_internal_unwind): Now static.
13940
f14b7e14
PE
13941 * fileio.c (file_name_as_directory, directory_file_name):
13942 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
13943 Now static.
2893f146
PE
13944 (file_name_as_directory): Use const pointers when appropriate.
13945 (Fexpand_file_name): Likewise. In particular, newdir might
13946 point at constant storage, so make it a const pointer.
fd4ead52 13947 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
13948 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
13949 signedness issues.
f839df0c
PE
13950 (Fset_file_times, Finsert_file_contents, auto_save_error):
13951 Rename locals to avoid shadowing.
f14b7e14 13952
5716756e 13953 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
13954 (Ftry_completion, Fall_completions): Rename or remove locals
13955 to avoid shadowing.
5716756e 13956
b4c3046a
PE
13957 * marker.c (bytepos_to_charpos): Remove; unused.
13958
b45db522
PE
13959 * lisp.h (verify_bytepos, count_markers): New decls,
13960 so that gcc does not warn that these functions aren't declared.
13961
85876d07
PE
13962 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
13963 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 13964 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 13965 (copy_text): Remove unused local var.
85876d07 13966
03d78a21 13967 * filelock.c (within_one_second): Now static.
b3dd38ab 13968 (lock_file_1): Rename local to avoid shadowing.
03d78a21 13969
5df8f01b
PE
13970 * buffer.c (fix_overlays_before): Mark locals as initialized.
13971 (fix_start_end_in_overlays): Likewise. This function should be
13972 simplified by using pointers-to-pointers, but that's a different
13973 matter.
b1d876f1 13974 (switch_to_buffer_1): Now static.
8f54f30a
PE
13975 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
13976 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 13977
a70072c9 13978 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 13979 Fix pointer signedness issue.
edced198
PE
13980 (sys_subshell): Mark local as volatile if checking for lint,
13981 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 13982 (MAXPATHLEN): Define only if needed.
a70072c9 13983
a0977c44
PE
13984 * process.c (serial_open, serial_configure): Move decls from here ...
13985 * systty.h: ... to here, so that they can be checked.
13986
a884fdcc
PE
13987 * fns.c (get_random, seed_random): Move extern decls from here ...
13988 * lisp.h: ... to here, so that they can be checked.
13989
604efe86 13990 * sysdep.c (reset_io): Now static.
b8950c94 13991 (wait_for_termination_signal): Remove; unused.
604efe86 13992
38fc62d9
PE
13993 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
13994 (copy_keymap_item, append_key, push_text_char_description):
13995 Now static.
1004a21a 13996 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 13997 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
13998 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
13999 (describe_map_tree):
14000 Rename locals to avoid shadowing.
38fc62d9 14001
2f2650da
PE
14002 * keyboard.c: Declare functions static if they are not used elsewhere.
14003 (echo_char, echo_dash, cmd_error, top_level_2):
14004 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
14005 (read_char, kbd_buffer_get_event, make_lispy_position):
14006 (make_lispy_event, make_lispy_movement, apply_modifiers):
14007 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
14008 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
14009 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 14010 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 14011 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 14012
a053e86c 14013 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
14014 (mark_kboards): Move decl here ...
14015 * alloc.c (mark_kboards): ... from here.
a053e86c 14016
4752793e
PE
14017 * lisp.h (force_auto_save_soon): New decl.
14018
74f10ca7 14019 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
14020 (DEFINE_DUMMY_FUNCTION): New macro.
14021 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
14022 Use it.
c03cd23f
PE
14023 (main): Add casts to avoid warnings
14024 if GCC considers string literals to be constants.
74f10ca7 14025
022e70d4
PE
14026 * lisp.h (fatal_error_signal): Add decl, since it's exported.
14027
59d6fe83
PE
14028 * dbusbind.c: Pointer signedness fixes.
14029 (xd_signature, xd_append_arg, xd_initialize):
14030 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14031 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14032 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
14033 (Fdbus_register_signal): Use SSDATA when the context wants char *.
14034
78320123
PE
14035 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
14036 if GCC considers string literals to be constants.
49cebcca 14037 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 14038
35ac2a97
SM
140392011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
14040
fb103ca9
SM
14041 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
14042 (print_preprocess, print_object): New macro to fix last change.
14043
35ac2a97
SM
14044 * print.c (print_preprocess): Don't forget font objects.
14045
62973b41
JB
140462011-03-16 Juanma Barranquero <lekktu@gmail.com>
14047
14048 * emacs.c (USAGE3): Doc fixes.
14049
0e48bb22
AS
140502011-03-15 Andreas Schwab <schwab@linux-m68k.org>
14051
14052 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
14053 structure.
14054
7684e57b
JB
140552011-03-14 Juanma Barranquero <lekktu@gmail.com>
14056
14057 * lisp.h (VWindow_system, Qfile_name_history):
14058 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
14059 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
14060 (w32_system_caret_x, w32_system_caret_y): Declare extern.
14061
14062 * w32select.c: Don't #include "keyboard.h".
c96bbc66 14063 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
14064
14065 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
14066 * w32console.c (detect_input_pending, read_input_pending)
14067 (encode_terminal_code):
14068 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
14069 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
14070 (w32_system_caret_y, Qfile_name_history):
14071 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
14072 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
14073 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
14074 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
14075 * w32proc.c (Qlocal, report_file_error):
14076 * w32term.c (Vwindow_system, updating_frame):
14077 * w32uniscribe.c (initialized, uniscribe_font_driver):
14078 Remove unneeded extern declarations.
14079
2aa46d6c
CY
140802011-03-14 Chong Yidong <cyd@stupidchicken.com>
14081
c96bbc66 14082 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 14083
cffc6f3b
CY
140842011-03-13 Chong Yidong <cyd@stupidchicken.com>
14085
14086 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
14087 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
14088 These macros can no longer be used for assignment.
14089
44f230aa
SM
14090 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
14091 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
14092 (record_buffer_markers, fetch_buffer_markers): New functions for
14093 recording and fetching special buffer markers.
14094 (set_buffer_internal_1, set_buffer_temp): Use them.
14095
14096 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
14097
14098 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
14099
14100 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
14101 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
14102
14103 * xdisp.c (hscroll_window_tree):
14104 (reconsider_clip_changes): Use PT instead of BUF_PT.
14105
d251f04b
EZ
141062011-03-13 Eli Zaretskii <eliz@gnu.org>
14107
14108 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
14109 $(EMACS_ROOT)/lib/intprops.h.
14110
f0c77cd1
PE
141112011-03-13 Paul Eggert <eggert@cs.ucla.edu>
14112
3eca4629
PE
14113 Fix more problems found by GCC 4.5.2's static checks.
14114
7c86ee98
PE
14115 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
14116 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
14117 (xg_free_frame_widgets): Make it clear that a local variable is
14118 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
14119 (gdk_window_get_screen): Make it clear that this macro is needed
14120 only if USE_GTK_TOOLTIP.
1e5524e7
PE
14121 (int_gtk_range_get_value): New function, which avoids a diagnostic
14122 from gcc -Wbad-function-cast.
14123 (xg_set_toolkit_scroll_bar_thumb): Use it.
14124 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
14125 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
14126 (get_utf8_string, xg_get_file_with_chooser):
14127 Rename locals to avoid shadowing.
14128 (create_dialog): Move locals to avoid shadowing.
7c86ee98 14129
41729b81
PE
14130 * xgselect.c (xg_select): Remove unused var.
14131
f0c77cd1
PE
14132 * image.c (four_corners_best): Mark locals as initialized.
14133 (gif_load): Initialize transparent_p to zero (Bug#8238).
14134 Mark another local as initialized.
ec6cf4c6 14135 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 14136
ce0ad53d 14137 * image.c (clear_image_cache): Now static.
d5d5a617 14138 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 14139 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
14140 (x_edge_detection): Remove unnecessary cast that
14141 gcc -Wbad-function-cast diagnoses.
2037898d 14142 (gif_load): Fix pointer signedness.
6ae141d6
PE
14143 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
14144 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 14145
33383987 141462011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 14147
d32df629
PE
14148 Improve quality of tests for time stamp overflow.
14149 For example, without this patch (encode-time 0 0 0 1 1
14150 1152921504606846976) returns the obviously-bogus value (-948597
14151 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
14152 reports time overflow. See
14153 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
14154 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
14155 * editfns.c: Include limits.h and intprops.h.
14156 (TIME_T_MIN, TIME_T_MAX): New macros.
14157 (time_overflow): Move earlier, to before first use.
14158 (hi_time, lo_time): New functions, for an accurate test for
14159 out-of-range times.
14160 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
14161 (Fget_internal_run_time): Don't assume time_t fits in int.
14162 (make_time): Use list2 instead of Fcons twice.
14163 (Fdecode_time): More accurate test for out-of-range times.
14164 (check_tm_member): New function.
14165 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
14166 (lisp_time_argument): Don't rely on undefined left-shift and
14167 right-shift behavior when checking for time stamp overflow.
8be6f318 14168
fe31d94c
PE
14169 * editfns.c (time_overflow): New function, refactoring common code.
14170 (Fformat_time_string, Fdecode_time, Fencode_time):
14171 (Fcurrent_time_string): Use it.
14172
8be6f318
PE
14173 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
14174 * dired.c (make_time): Move to ...
14175 * editfns.c (make_time): ... here.
14176 * systime.h: Note the move.
14177
09d9db2c 141782011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 14179
126bc0dc
YM
14180 * fringe.c (update_window_fringes): Remove unused variables.
14181
c47cbdfd
YM
14182 * unexmacosx.c (copy_data_segment): Also copy __got section.
14183 (Bug#8223)
14184
7ac80be9
EZ
141852011-03-12 Eli Zaretskii <eliz@gnu.org>
14186
c96bbc66 14187 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
14188 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
14189 Constify `char *' arguments and their references according to
14190 prototypes in tparam.h.
14191
ecb0f94d 14192 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 14193
7ac80be9
EZ
14194 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
14195 Adapt all references accordingly.
14196
14197 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
14198
ef1fd07e
TT
141992011-03-11 Tom Tromey <tromey@redhat.com>
14200
14201 * buffer.c (syms_of_buffer): Remove obsolete comment.
14202
7ef4b50c
EZ
142032011-03-11 Eli Zaretskii <eliz@gnu.org>
14204
14205 * termhooks.h (encode_terminal_code): Declare prototype.
14206
14207 * msdos.c (encode_terminal_code): Don't declare prototype.
14208
14209 * term.c (encode_terminal_code): Now external again, used by
14210 w32console.c and msdos.c.
14211
44f230aa
SM
14212 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
14213 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 14214
4b1ec863 142152011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 14216
1714f52b 14217 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 14218
4b1ec863
PE
14219 * fringe.c (update_window_fringes): Mark locals as initialized
14220 (Bug#8227).
14221 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 14222
524c7aa6
PE
14223 * alloc.c (mark_fringe_data): Move decl from here ...
14224 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
14225 to check its interface.
14226 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
14227
a5c0af81 14228 * fontset.c (free_realized_fontset): Now static.
7519b8cd 14229 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 14230 (fontset_font): Mark local as initialized.
a9a06e0b 14231 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 14232
b4716021
PE
14233 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
14234
811e9bac 14235 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 14236 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
14237 (x_own_selection, Fx_disown_selection_internal): Rename locals
14238 to avoid shadowing.
14239 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 14240
7e3ab302
PE
14241 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
14242 so that the caller can use some name other than gcpro1.
14243 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
14244 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
14245 (Fx_backspace_delete_keys_p):
14246 Use them to avoid shadowing, and rename vars to avoid shadowing.
14247 (x_decode_color, x_set_name, x_window): Now static.
6b437900 14248 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 14249 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
14250 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
14251 Remove unused locals.
7e3ab302
PE
14252 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
14253 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
14254 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
14255 macros.
f78faa98 14256
e2b13473
PE
14257 * xterm.h (x_mouse_leave): New decl.
14258
77f23912
PE
14259 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
14260 Remove unused functions.
cdf4ba58
PE
14261 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
14262 (x_calc_absolute_position): Now static.
7411c686 14263 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 14264 Don't declare local "event" unless it's used.
ed7bf3a5
PE
14265 (x_iconify_frame, x_free_frame_resources): Don't declare locals
14266 unless they are used.
38d0b34a
PE
14267 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
14268 (x_fatal_error_signal): Remove; not used.
a6067996
PE
14269 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
14270 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
14271 (x_error_catcher, x_connection_closed, x_error_handler):
14272 (x_error_quitter, xembed_send_message, x_iconify_frame):
14273 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 14274 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 14275 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 14276
44f230aa
SM
14277 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
14278 Rename or move locals to avoid shadowing.
6b463e58 14279 (tty_defined_color, merge_face_heights): Now static.
5967d051 14280 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
14281 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
14282 does not deduce is never used uninitialized.
73719eba
PE
14283 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
14284 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 14285
426994c3 14286 * terminal.c (store_terminal_param): Now static.
5489860b 14287
032f1620 14288 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 14289 (set_frame_menubar): Remove unused local.
d4323972 14290 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
14291 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
14292 since they might point to immutable storage.
281585b0
PE
14293 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
14294 since it's unused otherwise.
032f1620 14295
367c19e5 14296 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 14297 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
14298 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
14299 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 14300 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
14301 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
14302 does not deduce are never used uninitialized.
70739cbe 14303
07b48fa9
PE
14304 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
14305
8868a238 14306 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
14307 * window.c (window_loop, size_window):
14308 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 14309
7e5cf297 14310 * window.c (display_buffer): Now static.
d6550a9f
PE
14311 (size_window): Mark variables that gcc -Wuninitialized
14312 does not deduce are never used uninitialized.
a586633d
PE
14313 * window.h (check_all_windows): New decl, to forestall
14314 gcc -Wmissing-prototypes diagnostic.
5b555da1 14315 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 14316
f6095868
PE
14317 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
14318 shadowing.
14319 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
14320 Include <limits.h>.
14321 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
14322 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
14323 (load_charset_map): Mark variables that gcc -Wuninitialized
14324 does not deduce are never used uninitialized.
53df7c11 14325 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 14326
f38b440c
PE
14327 * coding.c (coding_set_source, coding_set_destination):
14328 Use "else { /* comment */ }" rather than "else /* comment */;"
14329 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
14330 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
14331 a block, when the outer 'i' will do.
14332 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
14333 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
14334 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
14335 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
14336 (Fdecode_sjis_char, Fdefine_coding_system_internal):
14337 Rename locals to avoid shadowing.
14338 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
14339 * coding.c (emacs_mule_char, encode_invocation_designation):
14340 Now static, since they're not used elsewhere.
413bb2db 14341 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 14342 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
14343 (decode_coding_emacs_mule): Mark variables that gcc
14344 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
14345 (detect_coding_iso_2022): Initialize a local variable that might
14346 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 14347 this initialization is needed. (Bug#8211)
5f58e762
PE
14348 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
14349 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
14350 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
14351 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
14352 Remove unused macros.
f38b440c 14353
232b38b9 14354 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 14355 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 14356 * character.c (string_count_byte8): Likewise.
232b38b9 14357
fb90da1b
PE
14358 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
14359 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
14360
fb93dbc2
PE
14361 * chartab.c (copy_sub_char_table): Now static, since it's not used
14362 elsewhere.
5c156ace
PE
14363 (sub_char_table_ref_and_range, char_table_ref_and_range):
14364 Rename locals to avoid shadowing.
bbcd0949 14365 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 14366
7d3b3862 14367 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 14368 (BIDI_BOB): Remove unused macro.
7d3b3862 14369
6be7d3da
PE
14370 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
14371 deduce are never used uninitialized.
c2ed9c8b 14372 * term.c (encode_terminal_code): Likewise.
6be7d3da 14373
75f8807f 14374 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 14375
50938595
PE
14376 * tparam.h: New file.
14377 * term.c, tparam.h: Include it.
14378 * deps.mk (term.o, tparam.o): Depend on tparam.h.
14379 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
14380 Move these decls to tparam.h, and make them agree with what
14381 is actually in tparam.c. The previous trick of using incompatible
14382 decls in different modules does not conform to the C standard.
14383 All callers of tparam changed to use tparam's actual API.
14384 * tparam.c (tparam1, tparam, tgoto):
14385 Use const pointers where appropriate.
14386
fbceeba2
PE
14387 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
14388 * cm.h (struct cm): Likewise.
14389 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
14390 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
14391 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
14392 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
14393 (turn_on_face, init_tty): Likewise.
14394 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 14395
7f3f1250
PE
14396 * term.c (term_mouse_position): Rename local to avoid shadowing.
14397
e6ca6543
PE
14398 * alloc.c (mark_ttys): Move decl from here ...
14399 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
14400
c40f8d15
AS
144012011-03-11 Andreas Schwab <schwab@linux-m68k.org>
14402
14403 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
14404
cfe0661d
JB
144052011-03-09 Juanma Barranquero <lekktu@gmail.com>
14406
14407 * search.c (compile_pattern_1): Remove argument regp, unused since
14408 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
14409 (compile_pattern): Don't pass it.
14410
0afb4571
J
144112011-03-08 Jan Djärv <jan.h.d@swipnet.se>
14412
14413 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
14414 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
14415 for ! HAVE_GTK3.
14416 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
14417
14418 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
14419
14420 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
14421 gdk_window_get_screen, gdk_window_get_geometry,
14422 gdk_x11_window_lookup_for_display and GDK_KEY_g.
14423 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
14424 (xg_get_pixbuf_from_pixmap): New function.
14425 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
14426 to Pixmap, take frame as parameter, remove GdkColormap parameter.
14427 Call xg_get_pixbuf_from_pixmap instead of
14428 gdk_pixbuf_get_from_drawable.
14429 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
14430 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
14431 (xg_check_special_colors): Use GtkStyleContext and its functions
14432 for HAVE_GTK3.
14433 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
14434 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
14435 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
14436 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
14437 Call gtk_widget_get_preferred_size.
0afb4571
J
14438 (xg_frame_resized): gdk_window_get_geometry only takes 5
14439 parameters.
44f230aa
SM
14440 (xg_win_to_widget, xg_event_is_for_menubar):
14441 Call gdk_x11_window_lookup_for_display.
0afb4571
J
14442 (xg_set_widget_bg): New function.
14443 (delete_cb): New function.
895009e1 14444 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 14445 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
14446 (xg_set_background_color): Call xg_set_widget_bg.
14447 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
14448 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
14449 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
14450 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
14451 if ! HAVE_GTK3.
14452 (update_frame_tool_bar): Call gtk_widget_hide.
14453 (xg_initialize): Use GDK_KEY_g.
14454
14455 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
14456 if ! HAVE_GTK3
14457 (x_session_initialize): Call gdk_x11_set_sm_client_id.
14458
14459 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
14460 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
14461 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
14462
1c2cc4ef
JB
144632011-03-08 Juanma Barranquero <lekktu@gmail.com>
14464
14465 * w32xfns.c (select_palette): Check success of RealizePalette against
14466 GDI_ERROR, not zero.
14467
33383987 14468See ChangeLog.11 for earlier changes.
aac0c6e3
MR
14469
14470;; Local Variables:
14471;; coding: utf-8
aac0c6e3
MR
14472;; End:
14473
2f097256 14474 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
14475
14476 This file is part of GNU Emacs.
14477
14478 GNU Emacs is free software: you can redistribute it and/or modify
14479 it under the terms of the GNU General Public License as published by
14480 the Free Software Foundation, either version 3 of the License, or
14481 (at your option) any later version.
14482
14483 GNU Emacs is distributed in the hope that it will be useful,
14484 but WITHOUT ANY WARRANTY; without even the implied warranty of
14485 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14486 GNU General Public License for more details.
14487
14488 You should have received a copy of the GNU General Public License
14489 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.