In Fset_window_configuration revert first part of last change.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
95072a94
MR
12012-08-27 Martin Rudalics <rudalics@gmx.at>
2
3 * window.c (Fset_window_configuration): Revert first part of
4 last change.
5
0f19feff
JD
62012-08-27 Jan Djärv <jan.h.d@swipnet.se>
7
8 * nsterm.h (NSPanel): New class variable dialog_return.
9
10 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
11 dialog_return.
12 (windowShouldClose:): Use stop instead of stopModalWithCode.
13 (clicked:): Ditto, and also set dialog_return (Bug#12258).
14 (timeout_handler:): Use stop instead of abortModal. Send a dummy
15 event.
16 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
17 modal loop returns.
18
f10fe38f
PE
192012-08-27 Paul Eggert <eggert@cs.ucla.edu>
20
de1339b0
PE
21 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
22 * composite.c (find_composition, composition_gstring_p)
23 (composition_reseat_it, find_automatic_composition):
24 * data.c (let_shadows_buffer_binding_p)
25 (let_shadows_global_binding_p, set_internal, make_blv)
26 (Fmake_variable_buffer_local, Fmake_local_variable)
27 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
28 (cons_to_signed, arith_driver):
29 * dbusbind.c (xd_in_read_queued_messages):
30 * dired.c (directory_files_internal, file_name_completion):
31 Use bool for booleans.
32 * dired.c (file_name_completion):
33 * process.h (fd_callback):
34 Omit int (actually boolean) argument. It wasn't being used.
35 All uses changed.
36 * composite.h, lisp.h: Reflect above API changes.
37
f10fe38f
PE
38 * cmds.c, coding.c: Use bool for booleans.
39 * cmds.c (move_point, Fself_insert_command):
40 * coding.h (struct composition status, struct coding_system):
41 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
42 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
43 (emacs_mule_char, decode_coding_emacs_mule)
44 (encode_coding_emacs_mule, detect_coding_iso_2022)
45 (decode_coding_iso_2022, encode_invocation_designation)
46 (encode_designation_at_bol, encode_coding_iso_2022)
47 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
48 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
49 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
50 (encode_coding_raw_text, detect_coding_charset)
51 (decode_coding_charset, encode_coding_charset, detect_eol)
52 (detect_coding, get_translation_table, produce_chars)
53 (consume_chars, reused_workbuf_in_use)
54 (make_conversion_work_buffer, code_conversion_save)
55 (decode_coding_object, encode_coding_object)
56 (detect_coding_system, char_encodable_p)
57 (Funencodable_char_position, code_convert_region)
58 (code_convert_string, code_convert_string_norecord)
59 (Fset_coding_system_priority):
60 * fileio.c (Finsert_file_contents):
61 Use bool for booleans.
62 * coding.h, lisp.h: Reflect above API changes.
63 * coding.c: Remove unnecessary static function decls.
64 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
65 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
66 not a boolean 'int', since callers never look at the return value.
67 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
68 * coding.h (decoding_buffer_size, encoding_buffer_size)
69 (emacs_mule_string_char): Remove unused extern decls.
70 (struct iso_2022_spec, struct coding_system):
71 Use 'unsigned int : 1' for boolean fields, since there's more than one.
72 (struct emacs_mule_spec): Remove unused field 'full_support'.
73 All initializations removed.
74 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
75
5474c384
DA
762012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
77
f10fe38f 78 Fix spare memory change (Bug#12286).
5474c384
DA
79 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
80 (valid_lisp_object_p): Likewise.
81
c4b6914d
MR
822012-08-27 Martin Rudalics <rudalics@gmx.at>
83
84 * window.c (Fset_window_configuration): Record any window's old
85 buffer if it's replaced (see Bug#8789). If the new current
86 buffer doesn't appear in the selected window, go to its old
87 point (Bug#12208).
88
35aaa1ea
DA
892012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
90
91 Special MEM_TYPE_SPARE to denote reserved memory.
92 * alloc.c (enum mem_type): New memory type.
93 (refill_memory_reserve): Use new type for spare memory.
94 This prevents live_cons_p and live_string_p from incorrect
95 detection of uninitialized objects from spare memory as live.
96
6af64513
PE
972012-08-26 Paul Eggert <eggert@cs.ucla.edu>
98
8b2e00a3
PE
99 Spelling fixes.
100 * Makefile.in (.PHONY): versioclean -> versionclean.
101
b52d6985
PE
102 Remove unused external symbols.
103 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
104 * window.c (Qwindow_valid_p, decode_valid_window):
105 Now static, not extern.
106 * data.c (Qinterval): Remove; unused.
107 (syms_of_data): Do not define 'interval'.
108 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
109 * window.h (decode_valid_window):
110 Remove decls.
111
d5172d4f
PE
112 * character.c, charset.c, chartab.c: Use bool for booleans.
113 * character.c (lisp_string_width, string_count_byte8)
114 (string_escape_byte8):
115 * charset.c (charset_map_loaded, load_charset_map, read_hex):
116 (load_charset_map_from_file, map_charset_chars)
117 (Fdefine_charset_internal, define_charset_internal)
118 (Fdeclare_equiv_charset, find_charsets_in_text)
119 (Ffind_charset_region, char_charset, Fiso_charset):
120 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
121 (sub_char_table_set, sub_char_table_set_range)
122 (char_table_set_range, optimize_sub_char_table)
123 (map_sub_char_table):
124 Use bool for boolean.
125 * character.c (str_to_unibyte): Omit last boolean argument; it was
126 always 0. All callers changed.
127 * character.h, charset.h: Adjust to match previous changes.
128 * character.h (char_printable_p): Remove decl of nonexistent function.
129 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
130 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
131 are all boolean, so make them single-bit bitfields.
132
6af64513
PE
133 * lisp.h (ASET): Remove attempt to detect side effects.
134 It was meant to be temporary and it often doesn't work,
135 because when IDX has side effects the behavior of IDX==IDX
136 is undefined. See Stefan Monnier in
137 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
138
e1f29348
BR
1392012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
140
141 * lisp.h (functionp): New function (extracted from Ffunctionp).
142 (FUNCTIONP): Use it.
143 * eval.c (Ffunctionp): Use it.
144
17c05d74
PE
1452012-08-25 Paul Eggert <eggert@cs.ucla.edu>
146
0f46bc75
PE
147 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
148 as that's faster and simpler than static storage. Don't bother
149 with the g_main_context_query overhead if g_main_context_pending
150 says no events are pending.
151 (gfds, gfds_size): Remove these static vars.
152 (xgselect_initialize): Remove; no longer needed.
153 All uses and decls removed.
154
ee4c0f69
PE
155 * emacs.c (fatal_error_signal_hook): Remove.
156 All uses removed. This leftover from old code was always 0.
157
17c05d74
PE
158 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
159 * casefiddle.c (casify_object, casify_region):
160 * casetab.c (set_case_table):
161 * category.c, category.h (word_boundary_p):
162 * category.h (CHAR_HAS_CATEGORY):
163 Use bool for booleans, instead of int.
164
391ceac5
EZ
1652012-08-25 Eli Zaretskii <eliz@gnu.org>
166
167 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
168
2f221583
PE
1692012-08-25 Paul Eggert <eggert@cs.ucla.edu>
170
f4a681b0
PE
171 On assertion failure, print backtrace if available.
172 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
173 (die) [ENABLE_CHECKING]: Print a backtrace if available.
174 * Makefile.in (LIB_EXECINFO): New macro.
175 (LIBES): Use it.
176
2f221583
PE
177 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
178 * bytecode.c (exec_byte_code):
179 * callint.c (check_mark, Fcall_interactively):
180 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
181 (getenv_internal, sync_process_alive, call_process_exited):
182 * lisp.h (USE_SAFE_ALLOCA):
183 Use bool for booleans, instead of int.
184 * lisp.h, process.h: Adjust prototypes to match above changes.
185 * callint.c (Fcall_interactively): Don't assume the mark's
186 offset fits in 'int'.
187
37ef52bb
PE
1882012-08-24 Paul Eggert <eggert@cs.ucla.edu>
189
190 * buffer.c, buffer.h: Use bool for boolean.
191 * buffer.c (reset_buffer_local_variables)
192 (buffer_lisp_local_variables, Fset_buffer_modified_p)
193 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
194 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
195 (overlay_touches_p, overlay_strings, Foverlay_put)
196 (report_overlay_modification, call_overlay_mod_hooks):
197 (mmap_enlarge, mmap_set_vars):
198 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
199 Use bool for booleans, instead of int.
200 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
201 since the 1-or-0 return value is always ignored anyway.
202 (mmap_initialized_p):
203 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
204 * buffer.h, lisp.h: Adjust prototypes to match above changes.
205
2cc21167
PE
2062012-08-23 Paul Eggert <eggert@cs.ucla.edu>
207
208 * bidi.c: Use bool for boolean.
209 This is a bit more readable, and makes the text segment of bidi.o
210 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
211 Presumably it's faster too.
212 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
213 Now bool.
214 (bidi_cache_find_level_change, bidi_cache_iterator_state)
215 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
216 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
217 (bidi_explicit_dir_char, bidi_level_of_next_char)
218 (bidi_find_other_level_edge, bidi_move_to_visually_next):
219 Use bool for booleans, instead of int.
220 * dispextern.h (bidi_init_it, bidi_paragraph_init)
221 (bidi_unshelve_cache): Adjust decls to match code.
222
7db4ddf4
MR
2232012-08-23 Martin Rudalics <rudalics@gmx.at>
224
225 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
226 argument.
227
b1bb8011
PE
2282012-08-23 Paul Eggert <eggert@cs.ucla.edu>
229
230 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
231 * atimer.h: Include <stdbool.h>.
232
ff687885
DN
2332012-08-22 Dan Nicolaescu <dann@gnu.org>
234
235 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
236 compile time tests instead of run time tests on systems that do
237 not use them.
238 (FRAME_MAC_P): Remove leftover from deleted code.
239 * frame.c (syms_of_frame): Remove leftover from deleted code.
240
4ce7a138
JD
2412012-08-22 Jan Djärv <jan.h.d@swipnet.se>
242
243 * nsterm.m (insertText:): Don't clear modifiers if code is space.
244
d733ec6d
PE
2452012-08-22 Paul Eggert <eggert@cs.ucla.edu>
246
247 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
248 Otherwise, the compiler complains about (A?B:C) where B is void
249 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
250 (fontset_add): Return void, for FONTSET_ADD.
251
d0d2d26f
PE
2522012-08-21 Paul Eggert <eggert@cs.ucla.edu>
253
fce31d69
PE
254 * alloc.c: Use bool for booleans.
255 (gc_in_progress, abort_on_gc)
256 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
257 (dont_register_blocks) [GC_MALLOC_CHECK]:
258 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
259 (check_string_bytes, make_specified_string, memory_full)
260 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
261 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
262 (mark_stack, valid_pointer_p, make_pure_string)
263 (Fgarbage_collect, survives_gc_p, gc_sweep):
264 Use bool for booleans, instead of int.
265 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
266 Remove unused local.
267 * alloc.c (PURE_POINTER_P):
268 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
269 * editfns.c (Fformat):
270 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
271 (Fdo_auto_save):
272 * fns.c (sweep_weak_table):
273 * lisp.h (suppress_checking, push_message, survives_gc_p)
274 (make_pure_string, gc_in_progress, abort_on_gc):
275 * lread.c (readchar, read1):
276 * print.c (Fprin1_to_string):
277 * xdisp.c (push_message):
278 Use bool for booleans affected directly or indirectly by
279 alloc.c's changes.
280
d0d2d26f
PE
281 Make recently-introduced setters macros.
282 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
283 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
284 (set_fontset_default, set_fontset_fallback): Rename from their
285 upper-case counterparts, and make them functions rather than macros.
286 This is more consistent with the other recently-introduced setters.
287 These don't need to be inline, since they're local.
288
d18e2bb6
JD
2892012-08-21 Jan Djärv <jan.h.d@swipnet.se>
290
291 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
292 the loop (Bug#12247).
293
1b9d9d16
PE
2942012-08-21 Paul Eggert <eggert@cs.ucla.edu>
295
296 * lisp.h (vcopy): Use memcpy rather than our own loop.
297 This fixes a performance regression introduced by the recent
298 addition of vcopy. This means 'vcopy' will need to be modified
299 for a copying collector, but that's OK. Also, tighten the
300 checking in the assertion.
301
b2f09701
EZ
3022012-08-21 Eli Zaretskii <eliz@gnu.org>
303
304 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
305 components for RTL text (Bug#11860). Adjust X-OFFSET of each
306 non-base glyph for the width of the base character, according to
e1f29348
BR
307 what x_draw_composite_glyph_string_foreground expects.
308 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
309 expectations, to produce correct width of the composed character.
310 Reverse the sign of the DU offset produced by ScriptPlace.
311
9b994fed
PE
3122012-08-21 Paul Eggert <eggert@cs.ucla.edu>
313
314 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
315
086ca913
DA
3162012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
317
318 Avoid direct writes to contents member of struct Lisp_Vector.
319 * lisp.h (vcopy): New function to copy data into vector.
320 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
321 * fns.c (Ffillarray): Use ASET.
322 * keyboard.c (timer_check_2): Use AREF and ASET.
323 (append_tool_bar_item, Frecent_keys): Use vcopy.
324 * lread.c (read_vector): Use ASET.
325 * msdos.c (Frecent_doskeys): Use vcopy.
326 * xface.c (Finternal_copy_lisp_face): Use vcopy.
327 (Finternal_merge_in_global_face): Use ASET and vcopy.
328 * xfont.c (xfont_list_pattern): Likewise.
329
5481664a
MR
3302012-08-21 Martin Rudalics <rudalics@gmx.at>
331
332 * window.c (Fwindow_point): For the selected window always return
333 the position of its buffer's point.
334 (Fset_window_point): For the selected window always go in its
335 buffer to the specified position.
336
6d470bdd
DA
3372012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
338
339 Setter macros for fontsets.
340 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
341 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
342 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
343 Adjust users.
344
24564fe1
GM
3452012-08-20 Glenn Morris <rgm@gnu.org>
346
347 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
348 Don't assume that `ln -f' works.
349
0a05a035
EZ
3502012-08-20 Eli Zaretskii <eliz@gnu.org>
351
352 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
353 and later about non-assignments with no effect. See discussion at
354 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
355 details.
356
e46f2325
DA
3572012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
358
359 Inline setter functions for Lisp_Objects slots of struct specbinding.
360 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
361 Adjust users.
362
734fbd86
MR
3632012-08-20 Martin Rudalics <rudalics@gmx.at>
364
365 * window.c (select_window): Always make selected window's buffer
366 current.
367
f1a95992
DA
3682012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
369
370 Use AREF and ASET for docstrings of category tables.
371 * category.h (CATEGORY_DOCSTRING): Use AREF.
372 (SET_CATEGORY_DOCSTRING): Use ASET.
373 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
374
e83064be
DA
3752012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
376
377 Inline setter functions for hash table members.
378 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
379 (set_hash_hash, set_hash_index): Rename with _slot suffix.
380 (set_hash_key_and_value, set_hash_index, set_hash_next)
381 (set_hash_hash): New functions.
382 * charset.c, fns.c: Adjust users.
383
4ce60d2e
DA
3842012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
385
386 Inline getter and setter functions for per-buffer values.
387 * buffer.h (per_buffer_default, set_per_buffer_default)
388 (per_buffer_value, set_per_buffer_value): New functions.
389 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
390 * buffer.c, data.c: Adjust users.
391
c06c9690
JB
3922012-08-20 Juanma Barranquero <lekktu@gmail.com>
393
394 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
395
32bd4250
PE
3962012-08-19 Paul Eggert <eggert@cs.ucla.edu>
397
bad03192 398 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
399 as gnulib does this if the system doesn't.
400 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
401 Remove declaration. MS-Windows declares it on stdlib.h which is
402 included by conf_post.h.
b69a6d22
PE
403 * emacs.c (environ) [DOUG_LEA_MALLOC]:
404 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
405 * vm-limit.c: Include <unistd.h>, for 'environ'.
406
22d7feb2
PE
407 * unexaix.c, unexcoff.c: Include "mem-limits.h".
408 (start_of_data): Remove decl; mem-limits.h provides it.
409
32bd4250
PE
410 * xdisp.c (handle_invisible_prop): Make it a bit faster
411 and avoid a gcc -Wmaybe-uninitialized diagnostic.
412
450809af
CY
4132012-08-19 Chong Yidong <cyd@gnu.org>
414
415 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
416 ends (Bug#3874).
417
9e677988
AS
4182012-08-19 Andreas Schwab <schwab@linux-m68k.org>
419
6b1319ce
AS
420 * .gdbinit: Use call instead of set when calling a function in the
421 inferior.
422
9e677988
AS
423 * data.c (set_internal): Don't use set_blv_found.
424 (Fkill_local_variable): Likewise.
425
d7191076
AA
4262012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
427
428 * nsfont.m (ns_ascii_average_width): Ensure the string
429 ascii_printable is initialized with a null-terminated character
430 array. Otherwise, it can contain undesired extra characters.
431
e757f1c6
PE
4322012-08-18 Paul Eggert <eggert@cs.ucla.edu>
433
434 port new setting code to Sun C 5.8 2005/10/13
435 * chartab.c, lisp.h (char_table_set, char_table_set_range):
436 Return void, not Lisp_Object. Otherwise, the compiler
437 complains about (A?B:C) where B is void and C is Lisp_Object
438 when compiling CHAR_TABLE_SET, due to the recent change to
439 the API of sub_char_table_set_contents.
440
a999ce26
CY
4412012-08-18 Chong Yidong <cyd@gnu.org>
442
443 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
444 for the string case (Bug#3874).
445
3f22b86f
PE
4462012-08-18 Paul Eggert <eggert@cs.ucla.edu>
447
39eb03f1
PE
448 * buffer.h (BSET): Remove (Bug#12215).
449 Replace all uses with calls to new setter functions.
450 (bset_bidi_paragraph_direction, bset_case_canon_table)
451 (bset_case_eqv_table, bset_directory, bset_display_count)
452 (bset_display_time, bset_downcase_table)
453 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
454 (bset_last_selected_window, bset_local_var_alist)
455 (bset_mark_active, bset_point_before_scroll, bset_read_only)
456 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
457 (bset_width_table):
458 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
459 (bset_auto_fill_function, bset_auto_save_file_format)
460 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
461 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
462 (bset_cache_long_line_scans, bset_case_fold_search)
463 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
464 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
465 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
466 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
467 (bset_header_line_format, bset_indicate_buffer_boundaries)
468 (bset_indicate_empty_lines, bset_invisibility_spec)
469 (bset_left_fringe_width, bset_major_mode, bset_mark)
470 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
471 (bset_name, bset_overwrite_mode, bset_pt_marker)
472 (bset_right_fringe_width, bset_save_length)
473 (bset_scroll_bar_width, bset_scroll_down_aggressively)
474 (bset_scroll_up_aggressively, bset_selective_display)
475 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
476 (bset_word_wrap, bset_zv_marker):
477 * category.c (bset_category_table):
478 * syntax.c (bset_syntax_table):
479 New setter functions.
480
6a09a33b
PE
481 * process.h (PSET): Remove (Bug#12215).
482 Replace all uses with calls to new setter functions.
483 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
484 (PROCESS_INLINE): New macro.
485 (pset_childp): New setter function.
486 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
487 * process.c (PROCESS_INLINE):
488 Define to EXTERN_INLINE, so that the corresponding functions
489 are compiled into code.
490 (pset_buffer, pset_command, pset_decode_coding_system)
491 (pset_decoding_buf, pset_encode_coding_system)
492 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
493 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
494 (pset_type, pset_write_queue): New setter functions.
495
e8c17b81
PE
496 * window.h (WSET): Remove (Bug#12215).
497 Replace all uses with calls to new setter functions.
498 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
499 (WINDOW_INLINE): New macro.
500 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
501 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
502 (wset_total_lines, wset_vertical_scroll_bar)
503 (wset_window_end_pos, wset_window_end_valid)
504 (wset_window_end_vpos): New setter functions.
505 * window.c (WINDOW_INLINE):
506 Define to EXTERN_INLINE, so that the corresponding functions
507 are compiled into code.
508 (wset_combination_limit, wset_dedicated, wset_display_table)
509 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
510 (wset_new_normal, wset_new_total, wset_next_buffers)
511 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
512 (wset_prev_buffers, wset_right_fringe_width)
513 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
514 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
515 (wset_window_parameters):
516 * xdisp.c (wset_base_line_number, wset_base_line_pos)
517 (wset_column_number_displayed, wset_region_showing):
518 New setter functions.
519
3f22b86f
PE
520 * termhooks.h (TSET): Remove (Bug#12215).
521 Replace all uses with calls to new setter functions.
522 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
523 (TERMHOOKS_INLINE): New macro.
524 (tset_charset_list, tset_selection_alist): New setter functions.
525 * terminal.c (TERMHOOKS_INLINE):
526 Define to EXTERN_INLINE, so that the corresponding functions
527 are compiled into code.
528 (tset_param_alist): New setter function.
529
742af32f
PE
5302012-08-17 Paul Eggert <eggert@cs.ucla.edu>
531
15dbb4d6
PE
532 * keyboard.h (KSET): Remove (Bug#12215).
533 Replace all uses with calls to new setter functions.
534 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
535 (KEYBOARD_INLINE): New macro.
536 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
537 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
538 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
539 New setter functions.
540 * keyboard.c (KEYBOARD_INLINE):
541 Define to EXTERN_INLINE, so that the corresponding functions
542 are compiled into code.
543 (kset_echo_string, kset_kbd_queue)
544 (kset_keyboard_translate_table, kset_last_prefix_arg)
545 (kset_last_repeatable_command, kset_local_function_key_map)
546 (kset_overriding_terminal_local_map, kset_real_last_command)
547 (kset_system_key_syms): New setter functions.
548
f00af5b1
PE
549 * frame.h (FSET): Remove (Bug#12215).
550 Replace all uses with calls to new setter functions.
551 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
552 (FRAME_INLINE): New macro.
553 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
554 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
555 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
556 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
557 (fset_param_alist, fset_root_window, fset_scroll_bars)
558 (fset_selected_window, fset_title, fset_tool_bar_items)
559 (fset_tool_bar_position, fset_tool_bar_window): New functions.
560 * frame.c (FRAME_INLINE):
561 Define to EXTERN_INLINE, so that the corresponding functions
562 are compiled into code.
563 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
564
0c94c8d6
PE
565 A few more naming-convention fixes for getters and setters.
566 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
567 and rename from buffer_overlays_set_before.
568 (set_buffer_overlays_after): Move here from buffer.h, and rename
569 from buffer_overlays_set_after.
570 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
571 All uses changed.
572 (set_buffer_intervals): Rename from buffer_set_intervals.
573 * intervals.c (set_interval_object): Move here from intervals.h,
574 and rename from interval_set_object.
575 (set_interval_left): Move here from intervals.h, and rename from
576 interval_set_left.
577 (set_interval_right): Move here from intervals.h, and rename from
578 interval_set_right.
579 (copy_interval_parent): Move here from intervals.h, and rename from
580 interval_copy_parent.
581 * intervals.h (set_interval_parent): Rename from interval_set_parent.
582 (set_interval_plist): Rename from interval_set_plist.
583 Return void, not Lisp_Object, since no caller uses the result.
584 * lisp.h (string_intervals): Rename from string_get_intervals.
585 (set_string_intervals): Rename from string_set_intervals.
586
34dabdb7
PE
587 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
588 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 589 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
590 All uses changed. See the end of
591 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
592
742af32f
PE
593 * lisp.h (CSET): Remove (Bug#12215).
594 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
595 (set_char_table_purpose): New functions,
596 replacing CSET. All uses changed. For example, replace
597 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 598 "set_char_table_parent (char_table, parent);".
742af32f
PE
599 The old version was confusing because it used the same name
600 'parent' for two different things.
601
a04e2c62
DA
6022012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
603
604 Functions to get and set Lisp_Object fields of buffer-local variables.
605 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
606 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
607 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
608 * data.c, eval.c, frame.c: Adjust users.
609
383dcbf9
CY
6102012-08-17 Chong Yidong <cyd@gnu.org>
611
612 * xfaces.c (merge_face_vectors): If the target font specfies a
613 font spec, make the font's attributes take precedence over
614 directly-specified attributes.
615 (merge_face_ref): Recognize :font.
616
44386687
DA
6172012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
618
619 Do not use memcpy for copying intervals.
620 * intervals.c (reproduce_interval): New function.
621 (reproduce_tree, reproduce_tree_obj): Use it.
622 (reproduce_tree_obj): Remove prototype.
623
927c7216
PE
6242012-08-17 Paul Eggert <eggert@cs.ucla.edu>
625
626 * lisp.h (duration_to_sec_usec): Remove unused decl.
627
93044f7b
AA
6282012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
629
630 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
631 to an allocated instance of NSString, not to the class itself.
632
9851e4a5
JB
6332012-08-17 Juanma Barranquero <lekktu@gmail.com>
634
635 * makefile.w32-in (C_CTYPE_H): New macro.
636 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
637 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
638 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
639
620f13b0
PE
6402012-08-16 Paul Eggert <eggert@cs.ucla.edu>
641
642 Use ASCII tests for character types.
643 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
644 * xfns.c, xterm.c:
645 Don't include <ctype.h>; was not needed.
646 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
647 * sysdep.c, xfaces.c:
648 Include <c-ctype.h> instead of <ctype.h>.
649 * nsterm.m: Include <c-ctype.h>.
650 * charset.c (read_hex):
651 * doc.c (Fsnarf_documentation):
652 * fileio.c (IS_DRIVE) [WINDOWSNT]:
653 (DRIVE_LETTER) [DOS_NT]:
654 (Ffile_name_directory, Fexpand_file_name)
655 (Fsubstitute_in_file_name):
656 * font.c (font_parse_xlfd, font_parse_fcname):
657 * frame.c (x_set_font_backend):
658 * gtkutil.c (xg_get_font):
659 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
660 * nsimage.m (hexchar):
661 * nsterm.m (ns_xlfd_to_fontname):
662 * sysdep.c (system_process_attributes):
663 * xfaces.c (hash_string_case_insensitive):
664 Use C-locale tests instead of locale-specific tests for character
665 types, since we want the ASCII interpretation here, not the
666 interpretation suitable for whatever happens to be the current locale.
667
52162052
MR
6682012-08-16 Martin Rudalics <rudalics@gmx.at>
669
670 Consistently check windows for validity/liveness
671 (Bug#11984, Bug#12025, Bug#12026).
672 * lisp.h (CHECK_VALID_WINDOW): New macro.
673 * window.c (decode_window): Rename to decode_live_window.
674 (decode_valid_window, Fwindow_valid_p): New functions.
675 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
676 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
677 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
678 (Fwindow_prev_sibling, Fwindow_combination_limit)
679 (Fset_window_combination_limit, Fwindow_use_time)
680 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
681 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
682 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
683 (Fwindow_hscroll, Fset_window_hscroll)
684 (Fwindow_redisplay_end_trigger)
685 (Fset_window_redisplay_end_trigger, Fwindow_edges)
686 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
687 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
688 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
689 (Fwindow_end, Fset_window_point, Fset_window_start)
690 (Fpos_visible_in_window_p, Fwindow_line_height)
691 (Fwindow_dedicated_p, Fset_window_dedicated_p)
692 (Fwindow_prev_buffers, Fset_window_prev_buffers)
693 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
694 (Fset_window_parameter, Fwindow_display_table)
695 (Fset_window_display_table, Fdelete_other_windows_internal)
696 (Fset_window_buffer, Fset_window_new_total)
697 (Fset_window_new_normal, Fdelete_window_internal)
698 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
699 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
700 (Fwindow_scroll_bars): Check whether argument window is a valid or
701 live window. Update doc-strings.
702 (syms_of_window): New symbol Qwindow_valid_p.
703 * keyboard.c (Fposn_at_x_y): Check whether argument
704 frame_or_window denotes a valid window.
705
2751c80f
DA
7062012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
707
708 Fix previous char table change.
709 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
710 * chartab.c (optimize_sub_char_table): Likewise.
711
032a42c8
CY
7122012-08-16 Chong Yidong <cyd@gnu.org>
713
a2d19368
CY
714 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
715
032a42c8
CY
716 * xfont.c (xfont_open):
717 * xftfont.c (xftfont_open): Set the font's max_width field.
718
719 * nsfont.m (nsfont_open): Similar to the Xft backend, set
720 min_width to space_width and average_width to the average over
721 printable ASCII characters.
722 (ns_char_width): Code cleanup.
723 (ns_ascii_average_width): New utility function.
724
725 * font.h (struct font): Update comments.
726
a098c930
DA
7272012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
728
032a42c8 729 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
730 * lisp.h (CSET): New macro.
731 (char_table_set_extras, char_table_set_contents)
732 (sub_char_table_set_contents): New function.
733 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
734 * syntax.c: Adjust users.
735
8be3a09c
SM
7362012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
737
738 * eval.c (eval_sub): Bind lexical-binding.
739 * lread.c (Qlexical_binding): Make non-static.
740
ac4845a6
JD
7412012-08-15 Jan Djärv <jan.h.d@swipnet.se>
742
ddee6515
JD
743 * nsmenu.m (popupSession): Remove.
744 (pop_down_menu): Remove endModalSession.
745 (timeout_handler:): New method.
746 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
747 Call runModalForWindow. Check timer_fired when it returns.
748 If not set, cancel timer and break out of loop.
749 Otherwise loop again, with a new timeout.
750
751 * nsterm.m: Include fcntl.h if present.
752 (fd_entry, t_readfds, inNsSelect): Remove.
753 (select_writefds, select_valid, select_timeout, selfds)
754 (select_mutex, apploopnr): Add.
755 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
756 Otherwise call kbd_buffer_store_event.
757 (ns_send_appdefined): Remove release of fd_entry.
758 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
759 Increment and decrement apploopnr.
760 (ns_select): If no file descriptors, just do a NSTimer.
761 Otherwise copy read/write masks and start select thread (fd_handler).
762 Start main loop and wait for application defined event.
763 Inform select thread to stop selecting after main loop is exited.
764 (ns_term_init): Create selfds pipe and set non-blocking.
765 Initialize select_mutex. Start the select thread (fd_handler).
766 (fd_handler:): Loop forever, wait for info from the main thread
767 to either start or stop selecting. When select returns, send
768 and appdefined event.
769 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
770 If not call kbd_buffer_store_event.
771
772 * nsterm.h (EmacsApp): fd_handler takes id argument.
773 (EmacsDialogPanel): Add timer_fired and timeout_handler.
774
ac4845a6
JD
775 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
776
eb424fe3
EZ
7772012-08-15 Eli Zaretskii <eliz@gnu.org>
778
779 * region-cache.c (move_cache_gap): Update gap_len using the actual
780 growth of the boundaries array. Do not change cache_len.
781 (Bug#12196)
782
4e6a86c6
DA
7832012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
784
785 Generalize and cleanup font subsystem checks.
786 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
787 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
788 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 789
5bf192ca
DA
7902012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
791
792 * gtkutil.c (xg_get_font): Use pango_units_to_double.
793
f2045622
CY
7942012-08-15 Chong Yidong <cyd@gnu.org>
795
8be3a09c
SM
796 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
797 When using the new font chooser, use gtk_font_chooser_get_font_desc to
798 extract the font descriptor instead of just the font name.
799 In that case, return a font spec instead of a string.
f2045622
CY
800 (x_last_font_name): Move to this file from xfns.c.
801
802 * xfns.c (Fx_select_font): The return value can also be a font
803 spec. Move x_last_font_name management to gtkutil.c.
804
805 * xfaces.c: Make font weight and style symbols non-static.
806
7f6feb56
SM
8072012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
808
809 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
810 (bug#12117).
811
fecbd8ff
SM
8122012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
813
814 * alloc.c (Fgarbage_collect): Use plural form consistently.
815
9b8d5165
EZ
8162012-08-14 Eli Zaretskii <eliz@gnu.org>
817
818 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
819 iteration through the command loop. Fixes a problem whereby mouse
820 movements are ignored until the first mouse click.
821
f5d9e83a
PE
8222012-08-14 Paul Eggert <eggert@cs.ucla.edu>
823
824 Use bool, not int, for Lisp booleans.
825 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
826 makes Emacs a bit smaller and presumably a bit faster.
827 * lisp.h: Include <stdbool.h>.
828 (struct Lisp_Boolfwd, defvar_bool):
829 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
830 * regex.c [!emacs]: Include <stdbool.h>.
831 (false, true): Remove; <stdbool.h> does this for us now.
832
55802e4a
CY
8332012-08-14 Chong Yidong <cyd@gnu.org>
834
4abcdac8
CY
835 * character.c (Fcharacterp): Doc fix (Bug#12076).
836
837 * data.c (Findirect_variable): Doc fix (Bug#11040).
838
55802e4a
CY
839 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
840
841 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 842 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 843
8e99d072
BR
8442012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
845
846 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
847 (bug#12022).
848
08908aca
MR
8492012-08-14 Martin Rudalics <rudalics@gmx.at>
850
851 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
852 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
853 * minibuf.c (choose_minibuf_frame, read_minibuf):
854 * w32fns.c (x_create_tip_frame):
855 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
856 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
857
56120d6f
PE
8582012-08-14 Paul Eggert <eggert@cs.ucla.edu>
859
860 * intervals.c (offset_intervals): Remove obsolete comment.
861
67b77c0b
AS
8622012-08-14 Andreas Schwab <schwab@linux-m68k.org>
863
864 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
865
f48b82fd
GR
8662012-08-14 Gergely Risko <gergely@risko.hu>
867
868 * coding.c (decode_coding): Record buffer modification before
869 disabling undo_list (Bug#11773).
870
fd318b54
DA
8712012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
872
873 Revert and cleanup some recent overlay changes.
874 * buffer.h (enum overlay_type): Remove.
875 (buffer_get_overlays, buffer_set_overlays): Likewise.
876 (buffer_set_overlays_before, buffer_set_overlays_after):
877 New function. Adjust users.
878 (unchain_both): Add eassert.
879
41a62dd9
DA
8802012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
881
882 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
883
5884c324
PE
8842012-08-14 Paul Eggert <eggert@cs.ucla.edu>
885
886 * gtkutil.c (xg_mark_data): Don't assume C99.
887
ca06f160
JD
8882012-08-13 Jan Djärv <jan.h.d@swipnet.se>
889
890 * gtkutil.c (xg_frame_tb_info): New struct.
891 (TB_INFO_KEY): New define.
892 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
893 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
894 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
895 if not present.
896 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
897 is up to date. Otherwise store new data.
898 (free_frame_tool_bar): Free xg_frame_tb_info if present.
899
7864a3f7
DA
9002012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
901
902 Use KSET for write access to Lisp_Object members of struct kboard.
903 * keyboard.h (KSET): New macro.
904 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
905 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
906 * xterm.c: Adjust users.
907
4c31be61
DA
9082012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
909
910 Use BSET for write access to Lisp_Object members of struct buffer.
911 * buffer.h (BSET): New macro.
912 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
913 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
914 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
915 * window.c, xdisp.c, xfns.c: Adjust users.
916
14ae4239
BT
9172012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
918
919 * lread.c (syms_of_lread): Initialize Vlexical_binding.
920
32bcadb4
JD
9212012-08-11 Jan Djärv <jan.h.d@swipnet.se>
922
3d29b2ce
JD
923 * nsterm.m (not_in_argv): New function.
924 (application:openFile, application:openTempFile:):
925 (application:openFileWithoutUI:, application:openFiles:): Open file
926 if not_in_argv returns non-zero (bug#12171).
927
32bcadb4 928 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
929 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
930 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
931 (xg_get_font_name): Use those functions/macros here.
932 Reported by Frans Oilinki <moilinki@gmail.com>.
933
9ff9402d 9342012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
935
936 * unexmacosx.c (copy_data_segment): Copy initialized data in
937 statically linked libraries from input file rather than memory.
938
db74a5fc
YM
939 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
940 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
941 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
942
25e65510
GM
9432012-08-10 Glenn Morris <rgm@gnu.org>
944
945 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
946 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
947
7961135c
DA
9482012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
949
950 Fix last change to allow compilation with low optimization levels.
951 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
952 Reported by Jan Djärv <jan.h.d@swipnet.se>.
953
42b3a444
DA
9542012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
955
956 Use common inline syntax in intervals.h.
957 * intervals.h (INTERVALS_INLINE): New macro.
958 Change all users from LISP_INLINE.
959
9fb0c957
DA
9602012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
961
962 Define Qnone once for all platforms.
963 * frame.c (Qnone): Define here.
964 (syms_of_frame): DEFSYM it.
965 * lisp.h (Qnone): New declaration.
966 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
967 * xfns.c: Remove duplication. Adjust users.
968
65e8ee52
DA
9692012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
970
971 Remove unused macros from intervals.h.
972 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
973 * intervals.c: Adjust comment.
974
9b855fd6
EZ
9752012-08-10 Eli Zaretskii <eliz@gnu.org>
976
977 * w32fns.c <w32_unicode_gui>: New static variable.
978 (globals_of_w32fns): Initialize it according to os_subtype.
979 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
980 testing os_subtype.
981
39cb9e56 9822012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
983 Eli Zaretskii <eliz@gnu.org>
984
985 Fix bug #10299 with Unicode characters sent by customized
986 keyboards created by MSKLC.
987 * w32fns.c (INIT_WINDOW_CLASS): New macro.
988 (w32_init_class): Use it to initialize the Emacs class with either
989 ANSI or Unicode API calls.
990 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
991 later.
992 (w32_wnd_proc): If the character code sent by WM_CHAR or
993 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
994 original message. Call DefWindowProcW on NT and later.
995
9374581a
GM
9962012-08-10 Glenn Morris <rgm@gnu.org>
997
4b94e8cf
GM
998 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
999
9374581a
GM
1000 * lisp.h (DIRECTORY_SEP): Let configure set it.
1001
a2752828
DA
10022012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
1003
1004 Use TSET for write access to Lisp_Object slots of struct terminal.
1005 * termhooks.h (TSET): New macro.
1006 * coding.c, terminal.c, xselect.c: Adjust users.
1007
cc92c454
SM
10082012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
1009
1010 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
1011 the failing expression, include them in the error message.
1012 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
1013 * lisp.h (internal_condition_case_n): Update declaration.
1014
4cb3e6b3
DA
10152012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1016
1017 Inline functions to examine and change buffer overlays.
1018 * buffer.c (unchain_both): New function.
1019 * buffer.h (buffer_get_overlays, buffer_set_overlays):
1020 (buffer_has_overlays): New function.
1021 (enum overlay_type): New enum.
1022 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
1023 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
1024
8707c1e5
DA
10252012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1026
1027 Inline functions to examine and change buffer intervals.
1028 * alloc.c (mark_interval_tree): Remove.
1029 (MARK_INTERVAL_TREE): Simplify.
1030 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
1031 * intervals.c (buffer_balance_intervals): New function.
1032 (graft_intervals_into_buffer): Adjust indentation.
1033 (set_intervals_multibyte): Simplify.
1034 * buffer.h (BUF_INTERVALS): Remove.
1035 (buffer_get_intervals, buffer_set_intervals): New function.
1036 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
1037 * intervals.c, textprop.c: Adjust users.
1038
ad8c997f
DA
10392012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1040
1041 Inline functions to examine and change string intervals.
1042 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
1043 (string_get_intervals, string_set_intervals): New function.
1044 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1045 * lread.c, print.c, textprop.c: Adjust users.
1046
32ac3a6b
GM
10472012-08-08 Glenn Morris <rgm@gnu.org>
1048
1049 * lisp.mk (lisp): Remove language/persian.elc.
1050
77c7bcb1
DA
10512012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1052
1053 Cleanup intervals.
1054 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
1055 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
1056 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
1057 Adjust comment. Move under #if 0.
77c7bcb1
DA
1058 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1059 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
1060
9c08a8d4
DA
10612012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1062
1063 Check total length of intervals with eassert.
1064 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
1065 * intervals.c: Change all users to eassert.
1066
26d16b35
EZ
10672012-08-07 Eli Zaretskii <eliz@gnu.org>
1068
14ae4239
BT
1069 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
1070 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
1071 INTERNAL_FIELD in Lisp_Cons.
1072
c644523b
DA
10732012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1074
1075 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
1076 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
1077 name since all xname users are fixed long time ago. Do not
1078 use INTERNAL_FIELD.
1079 (set_symbol_name, set_symbol_function, set_symbol_plist):
1080 (set_symbol_next, set_overlay_plist): New function.
1081 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
1082 (struct Lisp_Overlay): Likewise.
1083 (CVAR, MVAR, SVAR): Remove.
1084 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
1085 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
1086 * xterm.c: Adjust users.
1087 * .gdbinit: Change to use name field of struct Lisp_Symbol
1088 where appropriate.
1089
6a3d20cc
DA
10902012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1091
1092 Basic functions to set Lisp_Object and pointer slots of intervals.
1093 * intervals.h (interval_set_parent, interval_set_object):
1094 (interval_set_left, interval_set_right, interval_set_plist):
1095 (interval_copy_parent): New function.
1096 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
1097 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
1098 Adjust indentation.
6a3d20cc
DA
1099 (INTERVAL_SIZE): Remove. Adjust users.
1100 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
1101
4d2b044c
DA
11022012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1103
1104 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
1105 * process.h (PGET): Remove.
1106 (struct Lisp_Process): Do not use INTERNAL_FIELD.
1107 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1108
d3d50620
DA
11092012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1110
1111 Drop WGET and revert read access to Lisp_Objects slots of struct window.
1112 * window.h (WGET): Remove.
1113 (struct window): Do not use INTERNAL_FIELD.
1114 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1115 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1116 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1117 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1118 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1119 Adjust users.
1120
d10a51dc
CY
11212012-08-07 Chong Yidong <cyd@gnu.org>
1122
1123 * window.c (Fwindow_edges, Fwindow_pixel_edges)
1124 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
1125 (Fdelete_window_internal): Signal an error if the window is not on
1126 a live frame (Bug#12025).
1127
e69b0960
DA
11282012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1129
1130 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
1131 * frame.h (FGET): Remove.
1132 (struct frame): Do not use INTERNAL_FIELD.
1133 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1134 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1135 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1136 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1137
25a20a3a
JB
11382012-08-06 Juanma Barranquero <lekktu@gmail.com>
1139
1140 * w32.c: Silence compiler warnings.
1141 (map_w32_filename): Remove unused variable `is_fat'.
1142 (chase_symlinks): Add parentheses around expression.
1143
1c6f11f4
GM
11442012-08-06 Glenn Morris <rgm@gnu.org>
1145
1db4583a
GM
1146 * sysdep.c: Respect BROKEN_GETWD.
1147
1c6f11f4
GM
1148 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
1149 Let configure handle it.
1150 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
1151
2b90362b
DA
11522012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1153
1154 Use GCALIGNMENT where appropriate.
1155 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
1156 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
1157 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
1158
5f50daf2
EZ
11592012-08-06 Eli Zaretskii <eliz@gnu.org>
1160
14ae4239
BT
1161 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
1162 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 1163
cbcc7007
SM
11642012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
1165
1166 * buffer.h (struct buffer): Revert `indirections' to a simple int;
1167 that should be sufficient for everyone.
1168
4d365fa4
JD
11692012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1170
1171 * keyboard.c (timer_check_2): Add break so timer_check returns next
1172 timeout.
1173
dd86bd82
DA
11742012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1175
1176 Fix Windows build errors introduced after converting to WGET and WSET.
1177 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
1178 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1179
054e1668
JD
11802012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1181
1182 * nsterm.m (ns_frame_rehighlight): Use FSET.
1183
1184 * nsmenu.m (ns_update_menubar): Use FSET.
1185
21238f11
DA
11862012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1187
1188 Separate read and write access to Lisp_Object slots of Lisp_Process.
1189 * process.h (PGET, PSET): New macros similar to AREF and ASET.
1190 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1191
077288cf
DA
11922012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1193
1194 Separate read and write access to Lisp_Object slots of struct window.
1195 * window.h (WGET, WSET): New macros similar to AREF and ASET.
1196 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1197 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1198 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1199 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1200 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1201 Adjust users.
1202
71688bd7
DA
12032012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1204
1205 Fix Windows build errors introduced after converting to FGET and FSET.
1206 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
1207 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
1208 (w32_judge_scroll_bars): Change to use FSET.
1209 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1210
f99bac93
DA
12112012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1212
1213 Fix replacement typo.
1214 * window.c (replace_window): Set root_window instead of
1215 selected_window. This fixes a total window subsystem
1216 malfunction reported by Bastien Guerry <bzg@gnu.org>.
1217
8c2a0f2d
GM
12182012-08-06 Glenn Morris <rgm@gnu.org>
1219
1220 * lisp.mk (lisp): Add language/persian.elc.
1221
edd74c35
DA
12222012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1223
1224 Separate read and write access to Lisp_Object slots of struct frame.
1225 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
1226 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1227 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1228 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1229 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1230
8671676c
AS
12312012-08-05 Andreas Schwab <schwab@linux-m68k.org>
1232
1233 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
1234
663e2b3f
DA
12352012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
1236
1237 Generalize common compile-time constants.
1238 * lisp.h (header_size, bool_header_size, word_size): Now here.
1239 (struct Lisp_Vector): Add comment.
1240 (struct Lisp_Bool_Vector): Move up to define handy constants.
1241 (VECSIZE, PSEUDOVECSIZE): Simplify.
1242 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
1243 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
1244 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
1245 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
1246 * xfont.c, xmenu.c: Use word_size where appropriate.
1247
d32e47af
LM
12482012-08-05 Lawrence Mitchell <wence@gmx.li>
1249
1250 * search.c (Freplace_match): Treat \? in the replacement text
1251 literally (Bug#8161).
1252
e5d9c0d1
CY
12532012-08-05 Chong Yidong <cyd@gnu.org>
1254
1255 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
1256 * frame.c (Vdelete_frame_functions):
1257 * emacs.c (Vkill_emacs_hook): Doc fix.
1258
8da0576b
EZ
12592012-08-04 Eli Zaretskii <eliz@gnu.org>
1260
1261 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
1262 --with-x-toolkit=no builds.
1263 Reported by Carsten Mattner <carstenmattner@gmail.com>.
1264
02676e5d
CY
12652012-08-04 Chong Yidong <cyd@gnu.org>
1266
1267 * syntax.c (Fmodify_syntax_entry): Doc fix.
1268
97147da9
EZ
12692012-08-04 Eli Zaretskii <eliz@gnu.org>
1270
76151e2c
EZ
1271 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
1272 * w32.c (init_environment): Change the default values of many
1273 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
1274 them into environment when they were not already defined.
1275 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 1276 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
1277 (check_windows_init_file): Now external, not static.
1278 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
1279 called when Vload_path is already set up.
1280
1281 * w32.h (check_windows_init_file): Add prototype.
1282
1283 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
1284 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
1285 compatibility with Posix platforms.
1286 (main): Move the call to check_windows_init_file to here from
1287 w32.c.
1288 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
1289 any, in the DEFALT argument into the root of the Emacs build or
1290 installation tree, as appropriate.
1291
1292 * callproc.c (init_callproc_1): Call decode_env_path instead of
1293 doing its equivalent by hand.
1294 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
1295 the code that sets Vexec_path run on MS-Windows.
1296
1297 * lread.c (init_lread): Add comments to #ifdef's.
1298
97147da9
EZ
1299 * msdos.c (dos_set_window_size, IT_update_begin)
1300 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
1301 instead of direct references.
1302
185ee146
PE
13032012-08-04 Paul Eggert <eggert@cs.ucla.edu>
1304
1305 Export DEFAULT_REHASH_* to GDB.
1306 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
1307 Now constants, not macros.
1308
8834c57a
PE
13092012-08-03 Paul Eggert <eggert@cs.ucla.edu>
1310
98c6f1e3
PE
1311 Remove unnecessary casts involving pointers.
1312 These casts are no longer needed now that we assume C89 or later,
1313 since they involve casting to or from void *.
1314 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
1315 (make_pure_float, make_pure_vector):
1316 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
1317 * macros.c (Fstart_kbd_macro):
1318 * menu.c (find_and_return_menu_selection):
1319 * minibuf.c (read_minibuf_noninteractive):
1320 * sysdep.c (closedir):
1321 * xdisp.c (x_produce_glyphs):
1322 * xfaces.c (compare_fonts_by_sort_order):
1323 * xfns.c (x_real_positions, select_visual):
1324 * xselect.c (x_stop_queuing_selection_requests)
1325 (x_get_window_property, x_get_window_property_as_lisp_data):
1326 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
1327 Remove unnecessary pointer casts.
1328 * alloc.c (record_xmalloc): New function.
1329 * lisp.h (record_xmalloc): New decl.
1330 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
1331 more like a function. This is because the pointer cast is not
1332 needed. All uses changed.
1333 * print.c (print_string, print_error_message): Avoid length recalc.
1334
8834c57a
PE
1335 Improve fix for macroexp crash with debugging (Bug#12118).
1336 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
1337 ARRAY_MARK_FLAG when checking subscripts, because ASET is
1338 not supposed to be invoked from the garbage collector.
1339 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
1340 (gc_aset): New function, which is like ASET but can be
1341 used in the garbage collector.
1342 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1343 (set_hash_index): Use it instead of ASET.
1344
6dad7178
EZ
13452012-08-03 Eli Zaretskii <eliz@gnu.org>
1346
1347 Support symlinks on latest versions of MS-Windows.
1348 * w32.c: Include winioctl.h and aclapi.h.
1349 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
1350 (revert_to_self): Forward declarations of static functions.
1351 <static BOOL g_b_init_get_security_info>:
1352 <g_b_init_create_symbolic_link>: New static flags.
1353 (globals_of_w32): Initialize them to zero.
1354 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
1355 (map_w32_filename): Improve commentary. Simplify switch.
1356 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
1357 headers (most versions of MinGW w32api don't).
1358 (get_security_info, create_symbolic_link)
1359 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
1360 New functions.
1361 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
1362 in the argument file name.
1363 (sys_access): Call unc_volume_file_attributes only if
1364 GetFileAttributes fails with network-related error codes.
1365 (sys_rename): Diagnose renaming of a symlink when the user doesn't
1366 have the required privileges.
14ae4239 1367 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
1368 get_file_security_desc.
1369 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
1370 with addition of handling of symlinks and support for 'lstat'.
1371 If possible, get file's attributes and security information by
6dad7178
EZ
1372 handle, not by name. Produce S_IFLNK bit for symlinks, when
1373 called from 'lstat'.
1374 (stat, lstat): New functions, call 'stat_worker'.
1375 (symlink, readlink, careadlinkat): Rewritten to create and resolve
1376 symlinks when the underlying filesystem supports them.
1377
f162bcc3
PE
13782012-08-02 Paul Eggert <eggert@cs.ucla.edu>
1379
79ea6c20
PE
1380 Fix macroexp crash on Windows with debugging (Bug#12118).
1381 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
1382 checking subscripts; problem introduced with the recent
1383 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
1384 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
1385 since it's used in non-static inline functions now.
1386
c0ce93fd
PE
1387 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
1388 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 1389
f162bcc3
PE
1390 Use C99-style 'extern inline' if available.
1391 * buffer.h (BUFFER_INLINE):
1392 * category.h (CATEGORY_INLINE):
1393 * character.h (CHARACTER_INLINE):
1394 * charset.h (CHARSET_INLINE):
1395 * composite.h (COMPOSITE_INLINE):
1396 * dispextern.h (DISPEXTERN_INLINE):
1397 * lisp.h (LISP_INLINE):
1398 * systime.h (SYSTIME_INLINE):
1399 New macro, replacing 'static inline' in this header.
1400 * buffer.h, category.h, character.h, charset.h, composite.h:
1401 * dispextern.h, lisp.h, systime.h:
1402 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1403 * alloc.c (LISP_INLINE):
1404 * buffer.c (BUFFER_INLINE):
1405 * category.c (CATEGORY_INLINE):
1406 * character.c (CHARACTER_INLINE):
1407 * charset.c (CHARSET_INLINE):
1408 * composite.c (COMPOSITE_INLINE):
1409 * dispnew.c (DISPEXTERN_INLINE):
1410 * sysdep.c (SYSTIME_INLINE):
1411 Define to EXTERN_INLINE, so that the corresponding functions
1412 are compiled into code.
1413 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
1414 (INLINE_HEADER_END): New macros.
1415 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
1416 since it's used in non-static inline functions now.
a8333d03 1417 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 1418
837b365b
GM
14192012-08-02 Glenn Morris <rgm@gnu.org>
1420
d66b744d
GM
1421 * s/: Remove empty directory.
1422
837b365b
GM
1423 * s/ms-w32.h: Move to ../nt/inc.
1424 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
1425 Update for new ms-w32.h location.
1426
13294f95
PE
14272012-08-02 Paul Eggert <eggert@cs.ucla.edu>
1428
1429 Port to Solaris 8.
1430 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
1431
90df0db3
GM
14322012-08-02 Glenn Morris <rgm@gnu.org>
1433
1434 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
1435 hard-coding the path separator.
1436
4939150c
PE
14372012-08-01 Paul Eggert <eggert@cs.ucla.edu>
1438
1439 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
1440 This how ASET and AREF are supposed to work, and makes
1441 it easier to think about future improvements. See
1442 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
1443 * charset.h (set_charset_attr): New function.
1444 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
1445 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
1446 (aref_addr): New function. All uses of &AREF(...) changed.
1447 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1448 (set_hash_index): New functions. All lvalue-style uses of
1449 HASH_KEY etc. changed.
1450 * keyboard.c (set_prop): New function. All lvalue-style uses
1451 of PROP changed.
1452
947b2afd
AA
14532012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
1454
1455 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
1456 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1457 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
1458 * nsfns.m (ns_set_name_as_filename): Likewise.
1459 * nsmenu.m (ns_update_menubar): Likewise.
1460 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
1461
4f5d0325
EZ
14622012-08-01 Eli Zaretskii <eliz@gnu.org>
1463
2008beae
EZ
1464 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
1465 Adapt to latest changes in field names of the corresponding Lisp
288479f6 1466 objects.
2008beae 1467
4f5d0325
EZ
1468 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
1469
fe3cc771
GM
14702012-08-01 Glenn Morris <rgm@gnu.org>
1471
1472 * s/msdos.h: Remove file.
1473 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
1474 * Makefile.in (S_FILE): Remove.
1475 (config_h): Remove S_FILE.
1476
c90acc54
JB
14772012-08-01 Juanma Barranquero <lekktu@gmail.com>
1478
1479 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
1480 Remove; moved to nt/config.nt.
1481
d8a05828
DA
14822012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1483
1484 Use INTERNAL_FIELD for conses and overlays.
1485 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
1486 Remove obsolete comment.
1487 (MVAR): New macro.
1488 (struct Lisp_Overlay): Use INTERNAL_FIELD.
1489 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
1490
8271d590
DA
14912012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1492
1493 Use INTERNAL_FIELD for symbols.
1494 * lisp.h (SVAR): New macro. Adjust users.
1495 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
1496 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
1497
3193acd2
DA
14982012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1499
1500 Use INTERNAL_FIELD for processes.
1501 * process.h (PVAR): New macro. Adjust style.
1502 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
1503 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
1504
3a45383a
DA
15052012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1506
1507 Use INTERNAL_FIELD for windows.
1508 * window.h (WVAR): New macro.
1509 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
1510 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1511 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1512 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
1513 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
1514 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
1515
c1dbc63c
PE
15162012-08-01 Paul Eggert <eggert@cs.ucla.edu>
1517
1518 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
1519
5c0c0e8a
GM
15202012-08-01 Glenn Morris <rgm@gnu.org>
1521
1522 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
1523 Move to configure.ac.
1524
552a99b4
JB
15252012-08-01 Juanma Barranquero <lekktu@gmail.com>
1526
1527 * makefile.w32-in (CONFIG_H): Update dependencies.
1528 (CONF_POST_H): New macro.
1529
1530 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
1531
8d8e2dfe
GM
15322012-07-31 Glenn Morris <rgm@gnu.org>
1533
bc96620a
GM
1534 * Makefile.in (S_FILE): No longer set by configure.
1535
476b1b2d
GM
1536 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
1537 is available.
1538 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
1539
b2c7a106
GM
1540 * process.h (NULL_DEVICE):
1541 * emacs.c (SEPCHAR):
1542 * editfns.c (USER_FULL_NAME): Let configure set them.
1543
d53d062a
GM
1544 * s/README, s/template.h: Remove files.
1545
4515017f
GM
1546 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
1547
8d8e2dfe
GM
1548 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
1549 Move to configure.ac.
1550
5b20b3cc
EZ
15512012-07-31 Eli Zaretskii <eliz@gnu.org>
1552
1e0afd9a
EZ
1553 * .gdbinit (xframe): Adapt to introduction of FVAR and the
1554 resulting renaming of 'struct frame' members.
1555
5b20b3cc
EZ
1556 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
1557
1558 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
1559 after introduction of FVAR.
1560
f1310128
JD
15612012-07-31 Jan Djärv <jan.h.d@swipnet.se>
1562
79e721e0
JD
1563 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
1564
1565 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
1566 instead of compositeToPoint.
1567 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
1568
8d7c7eed 1569 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 1570
e34f7f79
DA
15712012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
1572
1573 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
1574 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 1575 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
1576 (BVAR): Change to use INTERNAL_FIELD.
1577 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
1578 (KVAR): Change to use INTERNAL_FIELD.
1579 * frame.h (FVAR): New macro.
1580 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
1581 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
1582 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
1583 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
1584 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
1585
c09bfb2f
DA
15862012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
1587
1588 Miscellaneous fixes for non-default X toolkits.
1589 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
1590 * xterm.c (x_frame_of_widget): Remove redundant prototype.
1591 Move under #ifdef USE_LUCID.
1592 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
1593 definition and usage to avoid warnings.
1594
14c114ae
JD
15952012-07-31 Jan Djärv <jan.h.d@swipnet.se>
1596
1597 * nsterm.m (openFiles): Fix previous checkin.
1598
3bd21e82
PE
15992012-07-31 Paul Eggert <eggert@cs.ucla.edu>
1600
1601 * indent.c (compute_motion): Remove unused local.
1602
c1529ded
GM
16032012-07-31 Glenn Morris <rgm@gnu.org>
1604
400d5621
GM
1605 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
1606
268e2432
GM
1607 * conf_post.h [USG5_4]:
1608 Move remaining contents of s/usg5-4-common.h here.
1609 * s/usg5-4-common.h: Remove file.
1610
7552f3ee
GM
1611 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
1612 * s/irix6-5.h: Remove file.
1613
6a381852
GM
1614 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
1615 * s/darwin.h: Remove file.
1616
c1529ded
GM
1617 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
1618 * s/hpux10-20.h: Remove file, which is now empty.
1619
b429a4ee
GM
16202012-07-30 Glenn Morris <rgm@gnu.org>
1621
1622 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
1623 * Makefile.in (config_h): Add conf_post.h.
1624 * makefile.w32-in (CONFIG_H): Add conf_post.h.
1625
adff3182
JD
16262012-07-30 Jan Djärv <jan.h.d@swipnet.se>
1627
1628 * nsterm.m (ns_do_open_file): New variable.
b9031d69 1629 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
1630 (openFile, openTempFile, openFileWithoutUI, openFiles):
1631 Open files only if ns_do_open_file.
adff3182 1632
c32af1e4
PE
16332012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1634
7393bcbb
PE
1635 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
1636 This no-op macro hasn't been needed for many years.
1637 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
1638
c32af1e4
PE
1639 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
1640 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
1641 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
1642 gdb_make_enums_visible.
1643 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
1644 (DIRECTORY_SEP): Now a constant, not a macro.
1645
302fc036
EZ
16462012-07-30 Eli Zaretskii <eliz@gnu.org>
1647
1648 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
1649 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
1650
1651 * w32term.c <w32_keyboard_codepage>: Renamed from
1652 keyboard_codepage and now external. All users changed.
1653
1654 * w32term.h: Add declaration of w32_keyboard_codepage.
1655
1656 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
1657 the codepage to translate keys to Unicode. If this argument is
1658 -1, use the value returned by GetConsoleCP. All callers changed.
1659
88fb40b4
PE
16602012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1661
0aee6912
PE
1662 Update .PHONY listings in makefiles.
1663 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
1664 bootstrap-clean, distclean, maintainer-clean, versioclean,
1665 extraclean, frc.
1666
88fb40b4
PE
1667 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
1668 This is a bit clearer. Fix some commentary typos.
1669
0a763bd1
GM
16702012-07-30 Glenn Morris <rgm@gnu.org>
1671
32bac6d6
GM
1672 * s/netbsd.h: Let configure include signal.h if needed.
1673 Remove file, which is now empty.
1674
b65e7c46
GM
1675 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
1676 Let configure set them.
1677 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
1678 No more need to undefine.
0a763bd1 1679
169304bd
AS
16802012-07-30 Andreas Schwab <schwab@linux-m68k.org>
1681
1682 * keymap.c (Fkey_description): Don't remove 0x80 bit from
1683 non-single-byte char when adding meta modifier. (Bug#12090)
1684
6cd7a139
DA
16852012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
1686
1687 Convert safe_call to use variable number of arguments.
1688 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
1689 (safe_call2): Fix comment.
1690 * lisp.h (safe_call): Adjust prototype.
1691 * coding.c (encode_coding_object): Change to use safe_call2.
1692 * xfaces.c (merge_face_heights): Change to use safe_call1.
1693
d34d6ffc
GM
16942012-07-30 Glenn Morris <rgm@gnu.org>
1695
7b8a48e4 1696 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 1697 does that unconditionally. Remove file, which is now empty.
7b8a48e4 1698
d34d6ffc
GM
1699 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
1700 Remove empty files.
1701
03a660a6
PE
17022012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1703
1704 Export to GDB most of lisp.h's remaining object-like macros.
1705 * lisp.h (min, max): Move earlier, because they're used earlier now.
1706 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
1707 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
1708 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
1709 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
1710 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
1711 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
1712 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
1713 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
1714 Now constants, for GDB. They need not be macros.
1715 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
1716 Now constants, for GDB, as well as macros, for static initializers.
1717 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
1718 Move to after the definition of struct Lisp_Char_Table,
1719 since the former now needs that type defined.
1720 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
1721 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
1722 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
1723 New enums, for gdb_make_enums_visible.
1724 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 1725 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
1726 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
1727 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
1728 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
1729 enum maxargs, enum MAX_ALLOCA.
1730 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
1731 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
1732 no longer needed, now that they are done in lisp.h.
1733
e499d0ee
DA
17342012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
1735
1736 Cleanup string bytes checking.
1737 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
1738 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
1739 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
1740 (check_sblock, compact_small_strings): Simplify.
1741
d5040d2d
PE
17422012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1743
1744 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
1745 These macros are confusing and no longer need to be defined, as
1746 the enum values now suffice. All uses replaced with definiens.
1747 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
1748
7f259ae6
JB
17492012-07-29 Juanma Barranquero <lekktu@gmail.com>
1750
1751 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
1752 ($(BLD)/w32console.$(O)): Update dependencies.
1753
7e63e0c3
DA
17542012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1755
1756 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
1757 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
1758 time. Adjust users.
1759 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
1760
ffd817eb
JD
17612012-07-29 Jan Djärv <jan.h.d@swipnet.se>
1762
1763 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
1764 setting sitelisp (Bug#12010).
1765
417a7a0e
EZ
17662012-07-29 Eli Zaretskii <eliz@gnu.org>
1767
14ae4239 1768 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
1769
1770 * w32heap.c (cache_system_info):
1771 * w32.c (sys_rename):
1772 * w32proc.c (find_child_console, sys_kill): All users changed.
1773
387d4d92
PE
17742012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1775
1776 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
1777
55a6cca6
EZ
17782012-07-29 Eli Zaretskii <eliz@gnu.org>
1779
1780 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
1781
dbcf001c
DA
17822012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1783
1784 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
1785 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
1786 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 1787
e2688e4a
DA
17882012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1789
1790 Generalize marker debugging code under MARKER_DEBUG and use eassert.
1791 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
1792 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
1793 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
1794 (replace_range, replace_range_2, del_range_2): Change to eassert.
1795 * marker.c (byte_char_debug_check): Adjust style.
1796
b46a6a83
PE
17972012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1798
1799 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
1800 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
1801 long-ago-commented-out code that talks about "WIN32".
1802 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
1803 All uses changed.
1804
e32a5799
PE
18052012-07-28 Paul Eggert <eggert@cs.ucla.edu>
1806
1807 Use Gnulib stdalign module (Bug#9772, Bug#9960).
1808 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
1809 Simplify by using alignof.
1810 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
1811 * lisp.h: Include <stdalign.h>.
1812 (GCALIGNMENT): New macro and constant.
1813 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
1814 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
1815 (stdalign): New macro, if not already defined.
1816
df81cd29
EZ
18172012-07-28 Eli Zaretskii <eliz@gnu.org>
1818
01bd1b0d
EZ
1819 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
1820 * w32inevt.c: Include w32inevt.h.
1821 (w32_read_console_input): New inline function, calls either
1822 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
1823 w32_console_unicode_input.
1824 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
1825 (w32_kbd_patch_key, key_event): Use the codepage returned by
1826 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
1827 (key_event): use uChar.UnicodeChar only if
1828 w32_console_unicode_input is non-zero.
1829
1830 * w32console.c: Include w32heap.h.
1831 <w32_console_unicode_input>: New global variable.
1832 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
1833 family of Windows, zero otherwise.
1834
1835 * w32inevt.h: Declare w32_console_unicode_input.
1836
df81cd29
EZ
1837 * xdisp.c (init_iterator): Don't reference tip_frame in a build
1838 --without-x. (Bug#11742)
1839
c20fdd9e
PE
18402012-07-27 Paul Eggert <eggert@cs.ucla.edu>
1841
1842 Adjust GDB to reflect pvec_type changes (Bug#12036).
1843 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
1844 2012-07-04 changes to pseudovector representation.
1845 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 1846
32770973 18472012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
1848
1849 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
1850 bus address.
1851 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
1852
3438fe21
EZ
18532012-07-27 Eli Zaretskii <eliz@gnu.org>
1854
bcfbc9de
EZ
1855 * alloc.c (listn): Fix the order the arguments are consed onto the
1856 list.
1857
3438fe21
EZ
1858 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
1859 enumeration constants, as PURE and HEAP are too general, and clash
1860 with other headers and sources, such as gmalloc.c and the
1861 MS-Windows system headers. All users changed.
1862
eeaea515
DA
18632012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1864
1865 Revert last save_excursion_save and save_excursion_restore changes.
1866 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
1867 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
1868
073c88c2
DA
18692012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1870
1871 Fix recently-introduced typos in Windows port.
1872 Reported by Martin Rudalics <rudalics@gmx.at>.
1873 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 1874 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 1875
4706125e
PE
18762012-07-27 Paul Eggert <eggert@cs.ucla.edu>
1877
1878 Improve GDB symbol export (Bug#12036).
1879 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
1880 arms of an 'if', not using conditional expressions; otherwise GDB
1881 complains about the types in the unevaluated arm when the argument
1882 is an integer literal.
1883 (xgetint): Simplify expression.
1884 * alloc.c (gdb_make_enums_visible): New constant. This ports to
1885 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
1886 Zaretskii in <http://bugs.gnu.org/12036#13>.
1887 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
1888 needed now that we have gdb_make_enums_visible.
1889 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
1890 (enum enum_USE_LSB_TAG):
1891 New enum types, packaging up enums that need to be exported to GDB.
1892
694b6c97
DA
18932012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1894
1895 Utility function to make a list from specified amount of objects.
1896 * lisp.h (enum constype): New datatype.
1897 (listn): New prototype.
1898 * alloc.c (listn): New function.
1899 (Fmemory_use_count, syms_of_alloc): Use it.
1900 * buffer.c (syms_of_buffer): Likewise.
1901 * callint.c (syms_of_callint): Likewise.
1902 * charset.c (define_charset_internal): Likewise.
1903 * coding.c (syms_of_coding): Likewise.
1904 * keymap.c (syms_of_keymap): Likewise.
1905 * search.c (syms_of_search): Likewise.
1906 * syntax.c (syms_of_syntax): Likewise.
1907 * w32.c (init_environment): Likewise.
1908 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
1909 * xdisp.c (syms_of_xdisp): Likewise.
1910 * xfns.c (syms_of_xfns): Likewise.
1911
6195f384
DA
19122012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1913
1914 Fast save_excursion_save and save_excursion_restore.
1915 * lisp.h (struct Lisp_Excursion): New data type.
1916 (PVEC_EXCURSION): New pseudovector type.
1917 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
1918 to deal with it. Adjust comments.
1919 (init_marker, attach_marker): New prototype.
1920 (unchain_marker): Adjust prototype.
1921 * marker.c (attach_marker): Change to global.
1922 (init_marker): New function.
1923 * alloc.c (Fmake_marker, build_marker): Use it.
1924 (build_marker): More easserts.
1925 (mark_object): Handle struct Lisp_Excursion.
1926 * editfns.c (save_excursion_save, save_excursion_restore):
1927 Reimplement to use struct Lisp_Excursion. Add comments.
1928
5eceb8fb
PE
19292012-07-26 Paul Eggert <eggert@cs.ucla.edu>
1930
1931 Fix export of symbols to GDB (Bug#12036).
1932 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
1933 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
1934 emacs.c, as this is a more-suitable home. Had this been done earlier
1935 the fix for 12036 would have avoided some of the problems noted in
1936 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
1937 would have been more obvious.
562157c8
PE
1938 * emacs.c: Do not include <verify.h>; no longer needed.
1939 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
1940 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
1941 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
1942 Remove; now done in lisp.h.
1943 * lisp.h (PUBLISH_TO_GDB): New macro.
1944 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
1945 (DATA_SEG_BITS): Use it.
1946 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
1947 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
1948 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
1949 not be usable in #if. This simplifies things.
1950
d6749401
JB
19512012-07-26 Juanma Barranquero <lekktu@gmail.com>
1952
1953 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
1954
1781b9e9
PE
19552012-07-26 Paul Eggert <eggert@cs.ucla.edu>
1956
d89518db 1957 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
1958 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
1959 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
1960 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
1961 Adjust to changes in lisp.h and emacs.c, by using
1962 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
1963 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
1964 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
1965 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
1966 instead of gdb_valbits.
1967 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
1968 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
1969 instead of gdb_array_mark_flag.
1970 (xboolvector): Get size from $->size, not $->header.size.
1971 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
1972 (xreload, hook-run, hookpost-run): Remove.
1973 * emacs.c: Include <verify.h>.
1974 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
1975 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
1976 Remove.
1977 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
1978 (gdb_USE_LSB_TAG): New enum constants.
1979 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
1980 Also define these as enum constants, so they're visible to GDB.
1981 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
1982 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
1983 as constants, so they're visible to GDB.
1984 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
1985 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
1986 Now enum constants, not macros, so they're visible to GDB.
1987 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
1988 more convenient now. All uses changed.
1989 (VALMASK) [USE_LSB_TAG]: Also define in this case.
1990 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
1991
3628596a
DA
19922012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
1993
1994 Explicitly free restriction data that are not needed anymore.
1995 * editfns.c (save_restriction_restore): Free restriction data.
1996
7abaf5cc
SM
19972012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
1998
1999 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
2000 add argument, tune behavior, and adjust all callers.
2001
71f88e00
PE
20022012-07-25 Paul Eggert <eggert@cs.ucla.edu>
2003
2004 Use typedef for EMACS_INT, EMACS_UINT.
2005 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
2006 than macros. This simplifies debugging in the usual case, since
2007 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
2008 and it allows expressions involving EMACS_INT casts.
2009 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
2010
57ec3034
JD
20112012-07-25 Jan Djärv <jan.h.d@swipnet.se>
2012
2013 * nsterm.m (ns_read_socket): Return early if there is a modal
2014 window (Bug#12043).
2015
8137e7b3
MR
20162012-07-25 Martin Rudalics <rudalics@gmx.at>
2017
2018 * frame.c (Fredirect_frame_focus): In doc-string don't mention
2019 that FOCUS-FRAME can be omitted.
2020
04e9897c
DA
20212012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
2022
2023 Adjust buffer text indirection counters at the end of Fkill_buffer.
2024 * buffer.c (Fkill_buffer): Adjust indirection counters when the
2025 buffer is definitely dead. This should really fix an issue reported
2026 by Christoph Scholtes again. (Bug#12007).
2027 (init_buffer_once): Initialize indirection counters of
2028 buffer_defaults and buffer_local_symbols (for sanity and safety).
2029
8a0484e1
EZ
20302012-07-24 Eli Zaretskii <eliz@gnu.org>
2031
2032 * xdisp.c (init_iterator): Don't compute dimensions of truncation
2033 and continuation glyphs on tooltip frames, leave them at zero.
2034 Avoids continued lines in tooltips. (Bug#11832)
2035
fa691a83
DA
20362012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
2037
2038 Simplify copy_overlay.
04e9897c 2039 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
2040 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
2041
436bc8e0
EZ
20422012-07-23 Eli Zaretskii <eliz@gnu.org>
2043
2044 * print.c (print_object): Don't crash when a frame's name is nil
2045 or invalid. (Bug#12025)
2046
2047 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
2048 it signals an error when a tooltip frame is being created.
2049
d7a7fda3
DA
20502012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
2051
2052 Cleanup miscellaneous objects allocation and initialization.
2053 * alloc.c (allocate_misc): Change to static. Add argument to
2054 specify the subtype. Adjust comment and users.
2055 (build_overlay): New function.
2056 * buffer.c (copy_overlays, Fmake_overlay): Use it.
2057 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
2058 (allocate_misc): Remove prototype.
2059 (build_overlay): Add prototype.
2060
20612012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
2062
2063 Swap buffer text indirection counters in Fbuffer_swap_text.
2064 * buffer.c (Fbuffer_swap_text): Swap indirections too.
2065 This avoids crash reported by Christoph Scholtes at
2066 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
2067
9d7fa573
JD
20682012-07-22 Jan Djärv <jan.h.d@swipnet.se>
2069
2070 * nsmenu.m (Popdown_data): New struct.
2071 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
2072 free Popdown_data.
2073 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
2074 (initWithContentRect): Make imgView and contentView non-static
2075 and autorelease them. Also autorelease img and matrix (Bug#12005).
2076 (dealloc): Remove (Bug#12005).
2077
0dd6d66d
DA
20782012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2079
2080 Adjust consing_since_gc when objects are explicitly freed.
2081 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
2082 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
2083 (free_cons, free_misc): Subtract object size from consing_since_gc.
2084
d36d71df
DA
20852012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2086
2087 Simplify and cleanup markers positioning code.
2088 * marker.c (attach_marker): More useful eassert.
2089 (live_buffer, set_marker_internal): New function.
2090 (Fset_marker, set_marker_restricted): Use set_marker_internal.
2091 (set_marker_both, set_marker_restricted_both): Use live_buffer.
2092
fb9ea40f
PE
20932012-07-22 Paul Eggert <eggert@cs.ucla.edu>
2094
2095 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
2096 as it's limited by the amount of memory, not by INT_MAX.
2097
2d5c5f7d
EZ
20982012-07-21 Eli Zaretskii <eliz@gnu.org>
2099
07fb592e
EZ
2100 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
2101 in special-event-map. See the discussion at
2102 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
2103 for the reasons.
2104
37a9eac8 2105 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
2106 info.dwItemData. Fixes crashes on 64-bit Windows.
2107 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 2108
c4328746
JD
21092012-07-21 Jan Djärv <jan.h.d@swipnet.se>
2110
2111 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 2112 (conversationIdentifier): Return value is NSInteger.
784051c4 2113 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 2114
6e5d1c12
CY
21152012-07-21 Chong Yidong <cyd@gnu.org>
2116
2117 * window.c (decode_any_window): Signal an error if the window is
2118 on a dead frame (Bug#11984).
2119
9928463d
DA
21202012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2121
2122 Add indirection counting to speed up Fkill_buffer.
2123 * buffer.h (struct buffer): New member.
2124 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
2125 (Fmake_indirect_buffer): Set indirection counter to -1, increment
2126 base buffer indirection counter.
2127 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
2128 (Fkill_buffer): Adjust indirection counters as needed, don't walk
2129 through buffer list if indirection counter is 0.
2130
f8643a6b
DA
21312012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2132
2133 Extend the value returned by Fgarbage_collect with heap statistics.
2134 * alloc.c (Qheap): New symbol.
2135 (syms_of_alloc): DEFSYM it.
2136 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
2137 (Fmemory_free): Remove.
2138 (syms_of_alloc): Don't defsubr it.
2139 * buffer.c (Fcompact_buffer): Remove.
2140 (syms_of_buffer): Don't defsubr it.
2141
dac616ff
DA
21422012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2143
2144 Make maybe_gc inline.
2145 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
2146 * lisp.h (consing_since_gc, gc_relative_threshold)
2147 (memory_full_cons_threshold): Revert declaration.
2148 (maybe_gc): Remove prototype, define as inline.
2149 * alloc.c: Remove old commented-out code.
2150 (consing_since_gc, gc_relative_threshold)
2151 (memory_full_cons_threshold): Revert to global.
2152 (maybe_gc): Remove.
2153
d7ea76b4
DA
21542012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2155
2156 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
2157 * lisp.h (build_unibyte_string): New function.
2158 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
2159 * sysdep.c, w32fns.c, xfns.c: Use it.
2160 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
2161 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
2162 Adjust users accordingly.
2163 * font.h (font_open_by_name): Adjust prototype.
2164
765e61e3
DA
21652012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2166
2167 Cleanup calls to Fgarbage_collect.
2168 * lisp.h (maybe_gc): New prototype.
2169 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2170 Remove declarations.
2171 * alloc.c (maybe_gc): New function.
2172 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2173 Make them static.
2174 * bytecode.c (MAYBE_GC): Use maybe_gc.
2175 * eval.c (eval_sub, Ffuncall): Likewise.
2176 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
2177 to avoid dependency from auto-save feature.
2178
52b852c7
PE
21792012-07-19 Paul Eggert <eggert@cs.ucla.edu>
2180
2181 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
2182 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
2183 'for_each_per_buffer_object_at'.
2184 All uses changed. It's better to use upper-case for macros that
2185 cannot be implemented as functions, to give the reader a clue
2186 that they're special.
2187
5db81e33
SM
21882012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
2189
2190 * alloc.c (Fgarbage_collect): Tweak docstring.
2191
5b835e1d
DA
21922012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2193
2194 Tweak the value returned from Fgarbage_collect again.
2195 * alloc.c (Fgarbage_collect): New return value, as confirmed in
2196 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
2197 Adjust documentation.
2198 (total_vector_bytes): Rename to total_vector_slots, adjust
2199 accounting.
2200 (total_free_vector_bytes): Rename to total_free_vector_slots,
2201 adjust accounting.
2202 (Qstring_bytes, Qvector_slots): New symbols.
2203 (syms_of_alloc): DEFSYM them.
2204
9cd47b72
DA
22052012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2206
2207 Buffer compaction primitive which may be used from Lisp.
2208 * buffer.c (compact_buffer, Fcompact_buffer): New function.
2209 (syms_of_buffer): Register Fcompact_buffer.
2210 * alloc.c (Fgarbage_collect): Use compact_buffer.
2211 * buffer.h (compact_buffer): New prototype.
2212 (struct buffer_text): New member.
2213
d17337e5
DA
22142012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2215
2216 New macro to iterate over all buffers, miscellaneous cleanups.
2217 * lisp.h (all_buffers): Remove declaration.
2218 * buffer.h (all_buffers): Add declaration, with comment.
2219 (for_each_buffer): New macro.
2220 * alloc.c (Fgarbage_collect, mark_object): Use it.
2221 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
2222 (init_buffer): Likewise.
2223 * data.c (Fset_default): Likewise.
2224 * coding.c (code_conversion_restore): Remove redundant check
2225 for dead buffer.
2226 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
2227
60cfd278
AS
22282012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2229
2230 Fix bug that created negative-length intervals.
2231 * intervals.c (merge_interval_right, merge_interval_left):
2232 Do not zero out this interval if it is absorbed by its children,
2233 as this interval's total length doesn't change in that case. See
2234 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
2235
d06714cb
PE
22362012-07-18 Paul Eggert <eggert@cs.ucla.edu>
2237
83713154
PE
2238 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
2239 when invoking (make-bool-vector N t) and N is a positive
2240 multiple of 8 -- the last 8 bits were mistakenly cleared.
2241
d06714cb
PE
2242 Remove some struct layout assumptions in bool vectors.
2243 * alloc.c (bool_header_size): New constant.
2244 (header_size, word_size): Move earlier, as they're now used earlier.
2245 Use 'word_size' in a few more places, where it's appropriate.
2246 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
2247 padding before the data member of a bool vector.
2248 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
2249 than doing the check by hand with an abort ().
2250
464d5a5e
SM
22512012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
2252
5fbc0409
SM
2253 * eval.c (Fdefvar): Don't check constants since we only set the var if
2254 it's not yet defined anyway (bug#11904).
2255
464d5a5e
SM
2256 * lisp.h (last_undo_boundary): Declare new var.
2257 * keyboard.c (command_loop_1): Set it.
2258 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
2259 were auto-added by the command loop (bug#11774).
2260
8dc2e44a
AS
22612012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2262
2263 * w32font.c (Qsymbol): Remove local definition.
2264 (syms_of_w32font): Don't DEFSYM it.
2265
169925ec
DA
22662012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2267
2268 Fix sweep_vectors to handle large bool vectors correctly.
2269 * alloc.c (sweep_vectors): Account total_vector_bytes for
2270 bool vectors larger than VBLOCK_BYTES_MAX.
2271
5fbfb018
CY
22722012-07-18 Chong Yidong <cyd@gnu.org>
2273
2274 * frame.c (x_set_frame_parameters): Revert bogus change introduced
2275 in 2012-05-25 commit by Paul Eggert (Bug#11738).
2276
3ab6e069
DA
22772012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2278
2279 Return more descriptive data from Fgarbage_collect.
2280 Suggested by Stefan Monnier in
2281 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
2282 * alloc.c (bounded_number): New function.
2283 (total_buffers, total_vectors): New variable.
2284 (total_string_size): Rename to total_string_bytes, adjust users.
2285 (total_vector_size): Rename to total_vector_bytes, adjust users.
2286 (sweep_vectors): Account total_vectors and total_vector_bytes.
2287 (Fgarbage_collect): New return value. Adjust documentation.
2288 (gc_sweep): Account total_buffers.
2289 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
2290 (VECTOR_SIZE): Remove.
2291 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
2292 (Qinterval, Qmisc): New symbols.
2293 (syms_of_data): Initialize them.
2294 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
2295 (Qcons, Qbuffer): New declarations.
2296
6d02fe5b
PE
22972012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2298
2299 * alloc.c (Fmemory_free): Account for memory-free's own storage.
2300 Round up, not down. Improve doc.
2301
b7ffe040
DA
23022012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2303
2304 Restore old code in allocate_string_data to avoid Faset breakage.
2305 Reported by Julien Danjou <julien@danjou.info> in
2306 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
2307 * alloc.c (allocate_string_data): Restore old code with minor
2308 adjustments, fix comment to explain this subtle issue.
2309
4dc7c8d5
SM
23102012-07-17 Eli Zaretskii <eliz@gnu.org>
2311
2312 Remove FILE_SYSTEM_CASE.
2313 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
2314
2315 * fileio.c (FILE_SYSTEM_CASE): Don't define.
2316 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
2317 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
2318 call-process-region passes it through expand-file-name.
2319
2320 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
2321
23222012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2323
2324 Fix crash when creating indirect buffer (Bug#11917)
2325 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
2326 Don't handle unbound variables specially if non-zero.
2327 (Fbuffer_local_variables): Pass zero.
2328 (clone_per_buffer_values): Pass non-zero.
2329
23302012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2331
2332 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
2333 to make the loop interruptible.
2334
23352012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2336
2337 * gnutls.c (emacs_gnutls_handshake): Only retry if
2338 GNUTLS_E_INTERRUPTED.
2339
cce7fefc
DA
23402012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2341
2342 Cleanup and convert miscellaneous checks to eassert.
2343 * alloc.c (mark_interval): Fix comment, partially rephrase
2344 old comment from intervals.h (see below).
2345 * intervals.c (find_interval, adjust_intervals_for_insertion)
2346 (delete_interval, adjust_intervals_for_deletion)
2347 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
2348 Convert to eassert.
2349 (adjust_intervals_for_insertion, make_new_interval):
2350 Remove obsolete and unused code.
2351 * intervals.h (struct interval): Remove obsolete comment.
2352 * textprotp.c (erase_properties): Remove unused code.
2353 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
2354 (Fremove_list_of_text_properties): Convert to eassert.
2355
9ea10cc3
CY
23562012-07-17 Chong Yidong <cyd@gnu.org>
2357
2358 * editfns.c (Finsert_char): Doc fix.
2359
3900d5de
DA
23602012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2361
2362 Fix previous change to make Fmemory_free always accurate.
2363 * alloc.c (make_interval): Update total_free_intervals.
2364 (make_float): Likewise for total_free_floats.
2365 (free_cons, Fcons): Likewise for total_free_conses.
2366 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
2367 Likewise for total_free_vector_bytes.
2368 (Fmake_symbol): Likewise for total_free_symbols.
2369 (bytes_free): Remove.
2370
7098646f
DA
23712012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2372
2373 Simple free memory accounting feature.
2374 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
2375 (sweep_vectors): Accumulate size of free vectors.
2376 (Fgarbage_collect): Setup bytes_free.
2377 (Fmemory_free): New function.
2378 (syms_of_alloc): Register it.
2379
22657b40
DA
23802012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2381
2382 Cleanup overlays checking.
2383 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
2384 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
2385 eassert and OVERLAYP.
2386 (sort_overlays): Change to use OVERLAYP.
2387
ddfc8813
RK
23882012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
2389
2390 * editfns.c (Finsert_char): Make it interactive, and make the
2391 second arg optional. Copy interactive spec and docstring from
2392 ucs-insert.
2393
7c26cf3c
PE
23942012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2395
2396 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
2397 Unlike the other wrapped functions, fabs has an unspecified
2398 effect on errno.
2399
5d127af9
JD
24002012-07-16 Jan Djärv <jan.h.d@swipnet.se>
2401
2402 * nsterm.m (keyDown): Interpret flags without left/right bits
2403 as the left key (Bug#11670).
2404
6a0dd1d7
DA
24052012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
2406
2407 Remove empty and useless init functions.
2408 * lisp.h (init_character_once, init_fns, init_image)
2409 (init_filelock, init_sound): Remove prototype.
2410 * character.c (init_character_once): Remove.
2411 * filelock.c (init_filelock): Likewise.
2412 * fns.c (init_fns): Likewise.
2413 * image.c (init_image): Likewise.
2414 * sound.c (init_sound): Likewise.
2415 * emacs.c (main): Adjust accordingly.
2416
7a6136fd
DA
24172012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
2418
2419 * gtkutil.h: Tiny cleanups.
2420 (use_old_gtk_file_dialog): Remove useless declaration.
2421 (xg_uses_old_file_dialog): Add suggested const attribute.
2422
ce811ad9
EZ
24232012-07-15 Eli Zaretskii <eliz@gnu.org>
2424
2425 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
2426 (bidi_paragraph_init): Use it to limit search forward for a strong
2427 directional character in abnormally large paragraphs full of
2428 neutral or weak characters. (Bug#11943)
2429
c9adfeaa
SF
24302012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
2431
2432 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
2433 the toolbar (Bug#9451).
2434 (xg_make_tool_item): Give the widget event box a transparent
2435 background.
2436
fff62aa9
DA
24372012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
2438
2439 Cleanup basic allocation variables and functions.
2440 * alloc.c (ignore_warnings, init_intervals, init_float)
2441 (init_cons, init_symbol, init_marker): Remove.
2442 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
2443 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
2444 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
2445 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
2446 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
2447 (staticidx, init_alloc_once, init_strings, free_ablock):
2448 Remove redundant initialization.
2449 * fns.c (init_weak_hash_tables): Remove.
2450 * lisp.h (init_weak_hash_tables): Remove prototype.
2451
9730daca
DA
24522012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
2453
2454 Use zero_vector where appropriate.
2455 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
2456 accordingly.
2457 * lisp.h (zero_vector): New declaration.
2458 * font.c (null_vector): Remove.
2459 (syms_of_font): Remove initialization and staticpro.
2460 (font_list_entities, font_find_for_lface): Change to use zero_vector.
2461 * keymap.c (Faccessible_keymaps): Likewise.
2462
2e2d2a13
LL
24632012-07-15 Leo Liu <sdl.web@gmail.com>
2464
2465 * fringe.c: Fix typo in comments.
2466
cd276f6e
LL
24672012-07-14 Leo Liu <sdl.web@gmail.com>
2468
2469 * fringe.c: Add a new bitmap exclamation-mark.
2470
5a1131d9
EZ
24712012-07-14 Eli Zaretskii <eliz@gnu.org>
2472
2473 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
2474
2475 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
2476 (HAVE_MENUS): Don't define, defined by editing config.in with
2477 msdos/sed2v2.inp.
2478 (GMALLOC_INHIBIT_VALLOC): Don't define.
2479 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
2480
22e983b7
JB
24812012-07-14 Juanma Barranquero <lekktu@gmail.com>
2482
2483 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
2484
5b3f250f
GM
24852012-07-14 Glenn Morris <rgm@gnu.org>
2486
2487 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
2488 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
2489 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
2490
33d63ff4
GM
24912012-07-13 Glenn Morris <rgm@gnu.org>
2492
5b633342
GM
2493 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
2494
33d63ff4
GM
2495 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
2496 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
2497
b55b9f85
JD
24982012-07-13 Jan Djärv <jan.h.d@swipnet.se>
2499
0dc8cf50
JD
2500 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
2501 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
2502 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
2503 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
2504 where appropriate.
2505 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
2506 as boolean expression.
2507 (x_set_window_size): Remove unused variable toolbar.
2508 (ns_get_color_default, ns_mod_to_lisp): Remove.
2509 (ns_mouse_position): Remove unused variables xchar and ychar.
2510 (ns_compute_glyph_string_overhangs): Remove unused variable face.
2511 (ns_set_vertical_scroll_bar): Remove unused variable count.
2512 (ns_delete_terminal): Remove unused variable i.
2513 (ns_term_init): Remove unused variables r, g and b.
2514 (mouseDown): Remove unused variable window.
2515 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
2516 (initFrameFromEmacs): Remove unused variable vbextra.
2517 (mouseEntered): Remove unused variables p and dpyinfo.
2518 (mouseExited): Remove unused variables p and r.
2519 (ns_define_frame_cursor, ns_clear_frame_area)
2520 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
2521 (menuDown): Assign [sender tag] to variable and cast the variable.
2522
2523 * nsterm.h (menuDown): Add id as type to argument sender.
2524 (ns_display_info_for_name): Add Lisp_Object argument.
2525 (ns_term_init): Add Lisp_Object argument.
2526 (ns_map_event_to_object): Add void argument.
2527 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
2528 prototype with arguments and only declare if __OBJC__.
2529 (nxatoms_of_nsselect): Add void argument.
2530 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
2531 (ns_alloc_autorelease_pool): Add void argument.
2532 (ns_release_autorelease_pool): Add void* argument.
2533 (ns_get_defaults_value): Add const char* argument.
2534
2535 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
2536 (initFromContents): Use SSDATA where appropriate.
2537 (ns_update_menubar): Add braces to ambigous if-else.
2538 (initWithTitle): Put () around assignment in if statement.
2539 (ns_menu_show): Remove unused variables window and keymap.
2540 (update_frame_tool_bar): Remove unused variable selected_p.
2541 (initWithContentRect): Remove unused variable this_cmd_name.
2542
2543 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
2544 appropriate.
2545 (setXBMColor): Remove unused variable len.
2546 (setPixmapData): Put () around assignment in loop statement.
2547
2548 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
2549 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
2550 where appropriate.
2551 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
2552 around assignment in loop statement.
2553 (nsfont_open): Remove unused variable i.
2554 (nsfont_open): Remove unused variable len.
2555 (nsfont_draw): Remove unused variable cs.
2556
2557 * nsfns.m (x_set_icon_name, ns_set_name_internal)
2558 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
2559 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
2560 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
2561 (Fns_font_name, Fns_perform_service)
2562 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
2563 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
2564 (ns_set_name): Remove unused variable view.
2565 (x_set_menu_bar_lines): Remove unused variable olines.
2566 (x_set_tool_bar_lines): Remove unused variable root_window.
2567 (Fns_list_colors): Put () around assignment in while statement.
2568 (Fns_perform_service): Remove unused variable len.
2569 (Fns_display_usable_bounds): Remove unused variable top.
2570 (syms_of_nsfns): Remove unused variable i.
2571
b55b9f85
JD
2572 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
2573 memcpy (Bug#11907).
2574
ed9265fc 25752012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
2576
2577 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
2578 and free it with DestroyExceptionInfo (Bug#11558).
2579
ef099b57
JB
25802012-07-13 Juanma Barranquero <lekktu@gmail.com>
2581
2582 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
2583 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
2584 Set here, not in nt/config.nt.
2585
ea814a5d
EZ
25862012-07-13 Eli Zaretskii <eliz@gnu.org>
2587
2588 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
2589 cursor overflow into the last glyph on display line when the right
2590 fringe is off. (Bug#11832)
2591
1a952767
PE
25922012-07-13 Paul Eggert <eggert@cs.ucla.edu>
2593
2594 * xdisp.c (produce_special_glyphs): Now static.
2595 * dispextern.h (produce_special_glyphs): Remove decl.
2596
983188fd
GM
25972012-07-13 Glenn Morris <rgm@gnu.org>
2598
8d7c7eed 2599 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
2600 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
2601
983188fd
GM
2602 * s/usg5-4-common.h (USG, USG5):
2603 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
2604 * s/sol2-6.h (SOLARIS2):
2605 * s/irix6-5.h (IRIX6_5):
2606 * s/hpux10-20.h (USG, USG5, HPUX):
2607 * s/gnu-linux.h (USG, GNU_LINUX):
2608 * s/freebsd.h (BSD_SYSTEM):
2609 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
2610 * s/cygwin.h (CYGWIN):
2611 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
2612 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
2613
d1e68667 26142012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
2615
2616 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 2617
6de0e799
GM
26182012-07-13 Glenn Morris <rgm@gnu.org>
2619
739ae010
GM
2620 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
2621
dbee5793
GM
2622 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
2623
6de0e799
GM
2624 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
2625 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
2626
b82da769
GM
26272012-07-12 Glenn Morris <rgm@gnu.org>
2628
4fae5a7a 2629 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
2630
2631 * process.c (init_process_emacs): Rename from init_process.
2632 The old name is also the name of a Mach system call.
2633 * lisp.h, emacs.c: Update for this name change.
2634 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
2635 longer needed.
2636
5a979817
EZ
26372012-07-12 Eli Zaretskii <eliz@gnu.org>
2638
2639 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
2640 memmove call that removes glyphs covered by the left truncation
2641 glyph. Improve commentary.
2642 (display_line): Fix display of continuation glyphs on GUI frames
2643 when the right fringe is turned off and variable-size fonts are
2644 used in the window. Move the code that appends a stretch glyph to
2645 produce_special_glyphs, so that it could be used for truncation
2646 and continuation glyphs alike.
2647 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
2648 glyph of a suitably computed width, to align the special glyphs at
2649 the window margin. Code moved from display_line. (Bug#11832)
2650
3e91a053
GM
26512012-07-12 Glenn Morris <rgm@gnu.org>
2652
ba9e4b84
GM
2653 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
2654
2655 * s/gnu-linux.h, s/hpux10-20.h:
2656 Do not unconditionally define HAVE_XRMSETDATABASE.
2657
3e91a053
GM
2658 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
2659
b300b1f4
PE
26602012-07-12 Paul Eggert <eggert@cs.ucla.edu>
2661
2662 Fix typos that broke OS X build.
2663 Reported by Randal L. Schwartz in
2664 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
2665 * nsterm.m (ns_timeout): Add missing local decl.
2666 (ns_get_color): snprintf -> sprintf, to fix typo.
2667
6e777848
GM
26682012-07-12 Glenn Morris <rgm@gnu.org>
2669
3f922c37
GM
2670 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
2671 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
2672 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
2673 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
2674
0ab7b23a
GM
2675 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
2676 Move PTY_OPEN to configure.
2677
6e777848
GM
2678 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2679 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
2680 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
2681
4a7edc24
DA
26822012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
2683
2684 Use empty_unibyte_string where applicable.
2685 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
2686 * lread.c (read1): Likewise.
2687 * xsettings.c (syms_of_xsettings): Likewise.
2688
308aab79
GM
26892012-07-12 Glenn Morris <rgm@gnu.org>
2690
42bd1719
GM
2691 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
2692 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
2693 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
2694 * s/hpux10-20.h (RUN_TIME_REMAP):
2695 * s/bsd-common.h (TABDLY): Move to configure.
2696
2697 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
2698
2699 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
2700
ea0bbd17 2701 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 2702 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
2703
2704 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 2705
308aab79
GM
2706 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
2707 * s/template.h: Move NARROWPROTO to configure.
2708
ee1cf5cf
GM
27092012-07-11 Glenn Morris <rgm@gnu.org>
2710
30fe9bf4
GM
2711 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
2712 unused since 2011-01-17 change to systty.h.
2713
ee1cf5cf
GM
2714 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
2715 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
2716 Move HAVE_PTYS and HAVE_SOCKETS to configure.
2717
63e47e07
PE
27182012-07-11 Paul Eggert <eggert@cs.ucla.edu>
2719
2720 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
2721
c43fb4c3
GM
27222012-07-11 Glenn Morris <rgm@gnu.org>
2723
2724 * s/darwin.h, s/gnu-linux.h, s/template.h:
2725 Move INTERRUPT_INPUT to configure.
2726
e8df9267
DA
27272012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2728
2729 Minor adjustments to interning code.
2730 * lisp.h (intern, intern_c_string): Redefine as static inline
2731 wrappers for intern_1 and intern_c_string_1, respectively.
2732 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
2733 * lread.c (intern_1, intern_c_string_1, oblookup):
2734 Simplify Vobarray checking.
e8df9267
DA
2735 * font.c (font_intern_prop): Likewise. Adjust comment.
2736 * w32font.c (intern_font_name): Likewise.
2737
34348bd4
AS
27382012-07-11 Andreas Schwab <schwab@linux-m68k.org>
2739
d96a1e0c
AS
2740 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
2741
34348bd4
AS
2742 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
2743 of Fcar/Fcdr if possible.
2744 * font.c (check_otf_features): Likewise.
2745 * fontset.c (Fnew_fontset): Likewise.
2746 * gnutls.c (Fgnutls_boot): Likewise.
2747 * minibuf.c (read_minibuf): Likewise.
2748 * msdos.c (IT_set_frame_parameters): Likewise.
2749 * xmenu.c (Fx_popup_dialog): Likewise.
2750 * w32menu.c (Fx_popup_dialog): Likewise.
2751
c8add24e
GM
27522012-07-11 Glenn Morris <rgm@gnu.org>
2753
4b575b3c
GM
2754 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
2755 since nothing has defined it on these platforms.
2756
09f4e3b0
GM
2757 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
2758 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
2759
172bedef
GM
2760 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2761 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
2762 Move CLASH_DETECTION to configure.
2763
249685df
GM
2764 * s/gnu.h: Remove file, which is now empty.
2765
c8add24e
GM
2766 * s/gnu.h, s/gnu-linux.h:
2767 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
2768
b41253a3
JW
27692012-07-11 John Wiegley <johnw@newartisans.com>
2770
2771 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
2772 function attribute, so we only use it if it exists in the
2773 compiler.
2774
d923b542
DA
27752012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2776
2777 Avoid call to strlen in fast_c_string_match_ignore_case.
2778 * search.c (fast_c_string_match_ignore_case): Change to use
2779 length argument. Adjust users accordingly.
2780 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
2781
5ebbef1d
PE
27822012-07-11 Paul Eggert <eggert@cs.ucla.edu>
2783
bb352260
PE
2784 Assume mkdir, rmdir.
2785 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
2786 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
2787
57054ddd
PE
2788 Assume rename.
2789 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
2790
b747d3f7
PE
2791 Assume perror.
2792 * s/hpux10-20.h (HAVE_PERROR): Remove.
2793 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
2794 Remove dummy definition, as this problem was obsolete long ago.
2795
5ebbef1d
PE
2796 Assume strerror.
2797 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
2798
984e7f30
DA
27992012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2800
2801 Avoid calls to strlen in font processing functions.
2802 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
2803 (font_open_by_name): Change to use length argument.
2804 Adjust users accordingly.
d923b542
DA
2805 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
2806 Adjust prototypes.
2807 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
2808 Change to return ptrdiff_t.
984e7f30
DA
2809 (xfont_list_pattern, xfont_match): Use length returned by
2810 xfont_decode_coding_xlfd.
2811 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
2812
20e94fdd
GM
28132012-07-11 Glenn Morris <rgm@gnu.org>
2814
9d596af3
GM
2815 * s/darwin.h, s/freebsd.h, s/netbsd.h:
2816 Move DONT_REOPEN_PTY to configure.
2817
20e94fdd
GM
2818 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
2819 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
2820
e99a530f
PE
28212012-07-10 Paul Eggert <eggert@cs.ucla.edu>
2822
22ffb973
PE
2823 Remove "#define unix" that is no longer needed (Bug#11905).
2824 * s/aix4-2.h (unix): Remove; no longer needed.
2825
e9a9ae03
PE
2826 EMACS_TIME simplification (Bug#11875).
2827 This replaces macros (which typically do not work in GDB)
2828 with functions, typedefs and enums, making the code easier to debug.
2829 The functional style also makes code easier to read and maintain.
2830 * systime.h: Include <sys/time.h> on all hosts, not just if
2831 WINDOWSNT, since 'struct timeval' is needed in general.
2832 (EMACS_TIME): Now a typedef, not a macro.
2833 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
2834 not macros.
2835 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
2836 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
2837 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
2838 (EMACS_TIME_LE): Now functions, not macros.
2839 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
2840 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
2841 which are not functions. All uses rewritten to use:
2842 (make_emacs_time): New function.
2843 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
2844 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
2845 not functions. All uses rewritten to use the following, respectively:
2846 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
2847 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 2848 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
2849 * fileio.c (Fcopy_file):
2850 * xterm.c (XTflash): Get the current time closer to when it's used.
2851 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
2852
ffacb126
PE
2853 * bytecode.c (targets): Suppress -Woverride-init warnings.
2854
e99a530f
PE
2855 Simplify by avoiding confusing use of strncpy etc.
2856 * doc.c (Fsnarf_documentation):
2857 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
2858 * frame.c (Fmake_terminal_frame):
2859 * gtkutil.c (get_utf8_string):
2860 * lread.c (openp):
2861 * nsmenu.m (ns_update_menubar):
2862 * regex.c (regerror):
2863 Prefer memcpy to strncpy and strncat when either will do.
2864 * fileio.c (Fsubstitute_in_file_name):
2865 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
2866 (menu_separator_name_p):
2867 * nsmenu.m (ns_update_menubar):
2868 Prefer memcmp to strncmp when either will do.
2869 * nsterm.m: Include <ftoastr.h>.
2870 (ns_get_color):
2871 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
2872 Prefer snprintf to strncpy.
2873 * nsterm.m (ns_term_init):
2874 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
2875 * nsterm.m (ns_term_init):
2876 Avoid the need for strncpy, by using build_string or
2877 make_unibyte_string directly. Use dtoastr, not snprintf.
2878 * process.c (Fmake_network_process): Diagnose service names that
2879 are too long, rather than silently truncating them or creating
2880 non-null-terminated names.
2881 (Fnetwork_interface_info): Likewise, for interface names.
2882 * sysdep.c (system_process_attributes) [GNU_LINUX]:
2883 Prefer sprintf to strncat.
2884 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
2885 Prefer vsnprintf to vsprintf + strncpy.
2886
c59592b3
GM
28872012-07-10 Glenn Morris <rgm@gnu.org>
2888
2889 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
2890 Clarify fallback case.
2891
7d7bbefd
DA
28922012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2893
2894 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
2895 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
2896 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 2897 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
2898 where argument type is known to be a Lisp_Cons.
2899
3a4c8000
TT
29002012-07-10 Tom Tromey <tromey@redhat.com>
2901
2902 * bytecode.c (BYTE_CODE_THREADED): New macro.
2903 (BYTE_CODES): New macro. Replaces all old byte-code defines.
2904 (enum byte_code_op): New type.
2905 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
2906 (exec_byte_code): Use them. Use token threading when applicable.
2907
2a0213a6
DA
29082012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2909
2910 Optimize pure C strings initialization.
2911 * lisp.h (make_pure_string): Fix prototype.
2912 (build_pure_c_string): New function, defined as static inline. This
2913 provides a better opportunity to optimize away calls to strlen when
2914 the function is called with compile-time constant argument.
2915 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
2916 argument, adjust users accordingly. Use build_pure_c_string where
2917 appropriate.
2918 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
2919 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
2920 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
2921
cb1caeaf
DA
29222012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2923
2924 Avoid calls to strlen in miscellaneous functions.
2925 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
2926 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
2927 * lread.c (openp): Likewise.
2928
c293e30c
DA
29292012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2930
2931 Avoid calls to strlen in path processing functions.
2932 * fileio.c (file_name_as_directory): Add comment. Change to add
2933 srclen argument and return the length of result. Adjust users
2934 accordingly.
2935 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
2936 swap 1st and 2nd arguments to obey the common convention.
2937 Adjust users accordingly.
c293e30c
DA
2938 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
2939
9e059e3f
GM
29402012-07-10 Glenn Morris <rgm@gnu.org>
2941
d02eb359
GM
2942 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
2943 Move PENDING_OUTPUT_COUNT definition to configure.
2944
882cf227
GM
2945 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
2946 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
2947 * s/gnu.h (DATA_START): Move definitions to configure.
2948
af6e839f
GM
2949 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
2950 We include usg5-4-common.h, which defines them both.
2951
40289a12
GM
2952 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
2953 O_RDONLY already includes it).
2954
9e059e3f
GM
2955 Stop ns builds setting the EMACSLOADPATH environment variable.
2956 * nsterm.m (ns_load_path): Rename from ns_init_paths.
2957 Now it does not set EMACSLOADPATH, just returns the load-path string.
2958 * nsterm.h: Update accordingly.
2959 * lread.c [HAVE_NS]: Include nsterm.h.
2960 (init_lread) [HAVE_NS]: Use ns_load_path.
2961 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
2962
7c4e8ec0
GM
29632012-07-09 Glenn Morris <rgm@gnu.org>
2964
d4f600ff
GM
2965 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
2966 since the included bsd-common.h does so.
2967
cbb31951
GM
2968 Stop ns builds setting the EMACSPATH environment variable.
2969 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
2970 (ns_init_paths): Do not set EMACSPATH.
2971 * nsterm.h (ns_exec_path): Add it.
2972 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
2973 Use ns_exec_path.
2974
7c4e8ec0
GM
2975 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
2976
26bccfae
PE
29772012-07-09 Paul Eggert <eggert@cs.ucla.edu>
2978
a0bee46f
PE
2979 * process.c (wait_reading_process_output): 'waitchannels' was unset
2980 when read_kbd || !NILP (wait_for_cell); fix this.
2981
5994c183
PE
2982 Add GCC-style 'const' attribute to functions that can use it.
2983 * character.h (char_resolve_modifier_mask):
2984 * keyboard.h (make_ctrl_char):
2985 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
2986 (init_character_once, next_almost_prime, init_fns, init_image)
2987 (flush_pending_output, init_sound):
2988 * mem-limits.h (start_of_data):
2989 * menu.h (finish_menu_items):
2990 Add ATTRIBUTE_CONST.
2991 * emacs.c (DEFINE_DUMMY_FUNCTION):
2992 Declare the dummy function with ATTRIBUTE_CONST.
2993 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
2994 Add decls with ATTRIBUTE_CONST.
2995
26bccfae
PE
2996 Minor improvements to make_formatted_string.
2997 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
2998 where int is good enough, as vsprintf returns an int.
2999 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
3000
a8290ec3
DA
30012012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
3002
3003 Use make_formatted_string to avoid double length calculation.
3004 * lisp.h (make_formatted_string): New prototype.
3005 * alloc.c (make_formatted_string): New function.
3006 * buffer.c (Fgenerate_new_buffer_name): Use it.
3007 * dbus.c (syms_of_dbusbind): Likewise.
3008 * editfns.c (Fcurrent_time_zone): Likewise.
3009 * filelock.c (get_boot_time): Likewise.
3010 * frame.c (make_terminal_frame, set_term_frame_name)
3011 (x_report_frame_params): Likewise.
3012 * image.c (gs_load): Likewise.
3013 * minibuf.c (get_minibuffer): Likewise.
3014 * msdos.c (dos_set_window_size): Likewise.
3015 * process.c (make_process): Likewise.
3016 * xdisp.c (ensure_echo_area_buffers): Likewise.
3017 * xsettings.c (apply_xft_settings): Likewise.
3018
d01ba2f1
GM
30192012-07-09 Glenn Morris <rgm@gnu.org>
3020
3021 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
3022 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
3023 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
3024 * nsterm.h (ns_etc_directory): Add it.
3025 * callproc.c [HAVE_NS]: Include nsterm.h.
3026 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
3027
f1f924b6
DA
30282012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
3029
3030 Move marker debugging code under MARKER_DEBUG.
3031 * marker.c (MARKER_DEBUG): Move marker debugging code under
3032 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
3033 for bootstrap with --enable-checking (~3x slowdown reported
3034 by Juanma Barranquero <lekktu@gmail.com>).
3035 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
3036
ab531b66
PE
30372012-07-08 Paul Eggert <eggert@cs.ucla.edu>
3038
3039 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
3040 See <http://bugs.gnu.org/11825#29>.
3041
c4b3bc8a
EZ
30422012-07-08 Eli Zaretskii <eliz@gnu.org>
3043
3044 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
3045 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
3046 (display_line): Add commentary about displaying truncation glyphs
3047 on GUI frames.
3048 (produce_special_glyphs): Move here from term.c.
3049
3050 * term.c (produce_special_glyphs): Move to xdisp.c.
3051
3052 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
3053 section.
c4b3bc8a 3054
b676b881
AS
30552012-07-07 Andreas Schwab <schwab@linux-m68k.org>
3056
f17c5273
AS
3057 * xdisp.c (display_line): Avoid warning about implicit declaration
3058 of FRAME_FONT.
3059
298819b9
AS
3060 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
3061
b676b881
AS
3062 * lisp.h: Remove empty conditional.
3063
6045c4fd
PE
30642012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3065
b3350bf9
PE
3066 * lread.c (load_path_check): Now static.
3067
6045c4fd
PE
3068 Fix some minor --with-ns problems found by static checking.
3069 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
3070 (x_set_font) [!HAVE_X_WINDOWS]:
3071 * image.c (xpm_load_image) [HAVE_NS]:
3072 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
3073 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
3074 Remove unused local.
3075 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
3076 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
3077 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
3078 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
3079 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
3080 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
3081 Fix pointer signedness problem.
3082 * xfaces.c (FRAME_X_FONT_TABLE):
3083 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
3084
929e7845
GM
30852012-07-07 Glenn Morris <rgm@gnu.org>
3086
3087 * lread.c (load_path_check): New function, split from init_lread.
3088 (init_lread): Reorganize. Motivation:
3089 If EMACSLOADPATH is set, check/warn about that rather than the
3090 defaults, which we are not going to use. Hence we can remove
3091 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
3092 Don't warn if site-lisp directories are missing.
3093 If not installed, start from a blank load-path, since
3094 PATH_LOADSEARCH refers to the eventual installation directories.
3095
58dd0aa4
EZ
30962012-07-07 Eli Zaretskii <eliz@gnu.org>
3097
3098 Support truncation and continuation glyphs on GUI frames, when
3099 fringes are disabled. (Bug#11832)
3100 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
3101 continuation glyphs even if on GUI frames.
3102 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
3103 or both, are absent.
3104 (start_display, move_it_in_display_line_to): Handle the case of a
3105 GUI frame without a fringe to display continuation or truncation
3106 glyphs.
3107 (insert_left_trunc_glyphs): Support GUI frames: make sure
3108 truncation glyphs overwrite enough glyphs from the current line to
3109 have sufficient space in pixels.
3110 (display_line): Support truncation and continuation glyphs on GUI
3111 frames. If some spare pixels are left on the line after inserting
3112 the truncation glyphs, fill that space with a stretch glyph of a
3113 suitably computed width.
3114
3115 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
3116 produce_glyphs, to support GUI sessions.
3117
31571fd7
PE
31182012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3119
5a16b9bc
PE
3120 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
3121
f3047c75
PE
3122 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
3123
31571fd7
PE
3124 Do not require float-time's arg to fit in time_t (Bug#11825).
3125 This works better on hosts where time_t is unsigned, and where
3126 float-time is applied to the (negative) difference between two times.
3127 * editfns.c (decode_time_components): Last arg is now double *,
3128 not int *, and means to store all the result as a double, without
3129 worrying about whether the seconds part fits in time_t.
3130 All callers changed.
3131 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
3132 All callers changed.
3133 (Ffloat_time): Do not fail merely because the specified time falls
3134 outside of time_t range.
3135
4516fbef
GM
31362012-07-07 Glenn Morris <rgm@gnu.org>
3137
3138 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
3139 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
3140 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
3141
07adc2c6
JB
31422012-07-07 Juanma Barranquero <lekktu@gmail.com>
3143
3144 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
3145 Update dependencies.
3146
3147 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
3148
fd573f31
PE
31492012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3150
fee5959d
PE
3151 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
3152 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
3153 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
3154 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
3155 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
3156 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
3157
fd573f31
PE
3158 * xfont.c (compare_font_names): Redo to omit the need for casts.
3159
ddadbc0e
AS
31602012-07-06 Andreas Schwab <schwab@linux-m68k.org>
3161
fca8d6b6
AS
3162 * xfns.c (Fx_change_window_property): Doc fix.
3163 * w32fns.c (Fx_change_window_property): Doc fix.
3164
ddadbc0e
AS
3165 * w32fns.c (Fx_window_property): Accept the same arguments as the
3166 X Windows version. Doc fix.
3167 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
3168
ed9265fc 31692012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
3170 Eli Zaretskii <eliz@gnu.org>
3171
3172 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
3173 Windows-specific code from nt/config.nt moved here.
3174 Obsolete settings removed.
3175
216ee680
PE
31762012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3177
3178 * process.c: Avoid unnecessary calls to gettime.
3179 (wait_reading_process_output): Don't get the time of day
3180 when gobbling data immediately and not waiting, as there's no need
3181 for it in that case. This removes a FIXME.
3182
bdd091e4
JD
31832012-07-06 Jan Djärv <jan.h.d@swipnet.se>
3184
3185 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
3186 is defined (Bug#11768).
3187
9d44f8ce
DA
31882012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3189
3190 Fix marker debugging code.
3191 * marker.c (byte_char_debug_check): Do not perform the check
3192 if buffer is not multibyte.
090bd7cb
JB
3193 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3194 Call byte_char_debug_check with correct arguments.
9d44f8ce 3195
90fc4786
DA
31962012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3197
3198 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
3199 * marker.c (byte_char_debug_check, count_markers):
3200 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
3201 (byte_debug_flag): Remove.
3202 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3203 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
3204
7b7ae965
DA
32052012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3206
4e57b342
DA
3207 Avoid code repetition in marker-related functions.
3208 * marker.c (attach_marker): New function.
3209 (Fset_marker, set_marker_restricted, set_marker_both)
3210 (set_marker_restricted_both): Use it.
3211 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
3212 Consistently rename charno to charpos.
3213 (marker_position): Add eassert.
3214 (marker_byte_position): Convert to eassert.
3215
32162012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3217
3218 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 3219 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 3220 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 3221
657924ff
DA
32222012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3223
3224 Introduce fast path for the widely used marker operation.
3225 * alloc.c (build_marker): New function.
3226 * lisp.h (build_marker): New prototype.
3227 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
3228 * composite.c (autocmp_chars): Likewise.
3229 * editfns.c (buildmark): Remove.
3230 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
3231 (save_restriction_save): Use build_marker.
3232 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
3233 * window.c (save_window_save): Likewise.
3234
041a49a6
DA
32352012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3236
3237 Do not use Fdelete_overlay in delete_all_overlays
3238 to avoid redundant calls to unchain_overlay.
3239 * buffer.c (drop_overlay): New function.
3240 (delete_all_overlays, Fdelete_overlay): Use it.
3241 * minibuf.c (get_minibuffer): Fix comment.
3242
7dca65a4
PE
32432012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3244
3245 Port to OpenBSD 5.1 amd64.
3246 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
3247 This is needed for OpenBSD, and should be harmless on all BSD systems.
3248 Also, include <sys/sysctl.h>, as it should be available on all
3249 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
3250 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
3251 use p_pid member, not kp_proc.pid.
3252
8eb876e2
GM
32532012-07-06 Glenn Morris <rgm@gnu.org>
3254
3255 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
3256
38182d90
PE
32572012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3258
3259 More xmalloc and related cleanup.
3260 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
3261 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
3262 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
3263 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
3264 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
3265 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
3266 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
3267 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
3268 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
3269 * xterm.c:
3270 Omit needless casts involving void * pointers and allocation.
3271 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
3272 as the former is more robust if P's type is changed.
3273 Prefer xzalloc to xmalloc + memset 0.
3274 Simplify malloc-or-realloc to realloc.
3275 Don't worry about xmalloc returning a null pointer.
3276 Prefer xstrdup to xmalloc + strcpy.
3277 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
3278 growing it.
3279 * keyboard.c (apply_modifiers_uncached): Prefer local array to
3280 alloca of a constant.
3281
6dd5a677
EZ
32822012-07-05 Eli Zaretskii <eliz@gnu.org>
3283
3284 * xdisp.c (display_line): Fix horizontal pixel coordinates when
3285 hscroll is larger than the line width. Fixes long and futile
3286 looping inside extend_face_to_end_of_line (on a TTY) producing
3287 glyphs that are not needed and thrown away.
3288
6b312f0f
DA
32892012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3290
3291 * marker.c (set_marker_restricted_both): Simplify by using
3292 clip_to_bounds.
3293
f520ef9b
PE
32942012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3295
3296 * editfns.c (region_limit): Simplify by using clip_to_bounds.
3297
383b7c95
JD
32982012-07-05 Jan Djärv <jan.h.d@swipnet.se>
3299
3300 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
3301 not defined (Bug#11768).
3302 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
3303 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
3304 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
3305 followed by gtk_box_set_homogeneous (Bug#11768).
3306 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
3307 (update_theme_scrollbar_width, xg_create_scroll_bar):
3308 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
3309 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
3310 (is_box_type): New function (Bug#11768).
3311 (xg_tool_item_stale_p): Call is_box_type.
5293d758 3312 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
3313 with default display (Bug#11768).
3314
d6e7bf45
EZ
33152012-07-05 Eli Zaretskii <eliz@gnu.org>
3316
3317 * xdisp.c (window_hscroll_limited): New function.
3318 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
3319 coordinates when window's hscroll is set to insanely large
3320 values. (Bug#11857)
3321
431391ec
JB
33222012-07-05 Juanma Barranquero <lekktu@gmail.com>
3323
3324 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
3325 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
3326
23f86fce
DA
33272012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3328
3329 Cleanup xmalloc.
3330 * lisp.h (xzalloc): New prototype. Omit needless casts.
3331 * alloc.c (xzalloc): New function. Omit needless casts.
3332 * charset.c: Omit needless casts. Convert all calls to
3333 xmalloc with following memset to xzalloc.
3334 * dispnew.c: Likewise.
3335 * fringe.c: Likewise.
3336 * image.c: Likewise.
3337 * sound.c: Likewise.
3338 * term.c: Likewise.
3339 * w32fns.c: Likewise.
3340 * w32font.c: Likewise.
3341 * w32term.c: Likewise.
3342 * xfaces.c: Likewise.
3343 * xfns.c: Likewise.
3344 * xterm.c: Likewise.
3345 * atimer.c: Omit needless casts.
3346 * buffer.c: Likewise.
3347 * callproc.c: Likewise.
3348 * ccl.c: Likewise.
3349 * coding.c: Likewise.
3350 * composite.c: Likewise.
3351 * doc.c: Likewise.
3352 * doprnt.c: Likewise.
3353 * editfns.c: Likewise.
3354 * emacs.c: Likewise.
3355 * eval.c: Likewise.
3356 * filelock.c: Likewise.
3357 * fns.c: Likewise.
3358 * gtkutil.c: Likewise.
3359 * keyboard.c: Likewise.
3360 * lisp.h: Likewise.
3361 * lread.c: Likewise.
3362 * minibuf.c: Likewise.
3363 * msdos.c: Likewise.
3364 * print.c: Likewise.
3365 * process.c: Likewise.
3366 * region-cache.c: Likewise.
3367 * search.c: Likewise.
3368 * sysdep.c: Likewise.
3369 * termcap.c: Likewise.
3370 * terminal.c: Likewise.
3371 * tparam.c: Likewise.
3372 * w16select.c: Likewise.
3373 * w32.c: Likewise.
3374 * w32reg.c: Likewise.
3375 * w32select.c: Likewise.
3376 * w32uniscribe.c: Likewise.
3377 * widget.c: Likewise.
3378 * xdisp.c: Likewise.
3379 * xmenu.c: Likewise.
3380 * xrdb.c: Likewise.
3381 * xselect.c: Likewise.
3382
0497dc44
PE
33832012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3384
3385 * fileio.c (time_error_value): Check the right error number.
3386 Problem reported by Troels Nielsen in
3387 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
3388
356e7178
PE
33892012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3390
4e71fd89
PE
3391 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
3392 This should be fixed in a better way; see Eli Zaretskii in
3393 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
3394 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
3395
f0941253
PE
3396 * fileio.c (time_error_value): Rename from special_mtime.
3397 The old name's problems were noted by Eli Zaretskii in
3398 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
3399
065c9eb4
PE
3400 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
3401 This variable's comment says Emacs needs at least one GDB-visible
3402 symbol of type enum pvec_type, to work around GDB problems.
3403 The symbol's value doesn't matter.
3404
356e7178
PE
3405 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
3406 that causes compilation to fail on pre-C99 compilers.
3407
ed9265fc 34082012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
3409
3410 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
3411 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
3412
3884d954
DA
34132012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3414
d209e2fb 3415 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
3416 headers for buffer_defaults and buffer_local_symbols.
3417 Reported by Juanma Barranquero <lekktu@gmail.com>.
3418
ee28be33
SM
34192012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
3420
3421 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
3422 * lisp.h (enum pvec_type): Use fewer bits.
3423 (PSEUDOVECTOR_SIZE_BITS): New constant.
3424 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
3425 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
3426 change in pvec_type.
3427 (PSEUDOVECTOR_TYPEP): New macro.
3428 (TYPED_PSEUDOVECTORP): Use it.
3429 * fns.c (internal_equal): Adapt code to extract pvectype.
3430 * emacs.c (gdb_pvec_type): Update type.
3431 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
3432 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
3433 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
3434 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
3435 (sweep_vectors): Use it. Use local var `total_bytes' instead of
3436 abusing vector->header.next.nbytes.
3437 (live_vector_p): Use PVEC_TYPE.
3438 (mark_object): Adapt code to extract pvectype. Use switch.
3439
c7f2cd7f
PE
34402012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3441
3442 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
3443 Tighten new eassert a bit.
3444
8ce70ed2
DA
34452012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3446
3447 Fix compilation with --enable-gcc-warnings and -O1
3448 optimization level.
3449 * doprnt.c (doprnt): Change type of tem to int, initialize
3450 to avoid compiler warning. Add eassert.
3451 * search.c (simple_search): Initialize match_byte to avoid
3452 compiler warning. Add eassert.
3453
dea7f1e5
PE
34542012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3455
24a212eb
PE
3456 Avoid weird behavior with large horizontal scrolls.
3457 Without this change, for example, large hscroll values would
3458 mess up Emacs's display on Fedora 15 x86, presumably due to
3459 overflows in int calculations in the display code.
3460 Also, if buffers had long lines, Emacs would freeze.
3461 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
3462 (set_window_hscroll): New function, containing the old guts of
3463 Fset_window_hscroll. Return the clipped value.
3464 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
3465 This avoids the need to check against PTRDIFF_MAX.
3466
dea7f1e5
PE
3467 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
3468
76046526
DA
34692012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3470
3471 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
3472
39adff0d
PE
34732012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3474
63807d47
PE
3475 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
3476 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
3477 since GCC 4.4.6 issues a bogus warning for them.
3478
39adff0d
PE
3479 Fix bugs in file timestamp newness comparisons.
3480 * fileio.c (Ffile_newer_than_file_p):
3481 * lread.c (Fload): Use full timestamp resolution of files,
3482 not just the 1-second resolution, so that files that are only
3483 slightly newer still count as newer.
3484 * fileio.c (Ffile_newer_than_file_p): Don't assume file
3485 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
3486
dbeed9a6
PE
34872012-07-03 Paul Eggert <eggert@cs.ucla.edu>
3488
3489 * fileio.c: Improve handling of file time marker. (Bug#11852)
3490 (special_mtime): New function.
3491 (Finsert_file_contents, Fverify_visited_file_modtime):
3492 Use it to set special mtime values consistently.
3493
636334d6
AS
34942012-07-03 Andreas Schwab <schwab@linux-m68k.org>
3495
3496 * fileio.c (Finsert_file_contents): Properly handle st_mtime
3497 marker for non-existing file. (Bug#11852)
3498
e2017fe2
GM
34992012-07-03 Glenn Morris <rgm@gnu.org>
3500
3501 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
3502 and did not make it into globals.h).
3503
404dbd37
TT
35042012-07-03 Tom Tromey <tromey@redhat.com>
3505
3506 * window.c (Fset_window_margins, Fset_window_fringes)
3507 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
3508 * textprop.c (Fprevious_property_change): No longer static.
3509 * syntax.c (Fsyntax_table_p): No longer static.
3510 * process.c (Fget_process, Fprocess_datagram_address): No longer
3511 static.
3512 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
3513 * keyboard.c (Fcommand_execute): No longer static.
3514 Remove EXFUN.
3515 * insdel.c (Fcombine_after_change_execute): No longer static.
3516 * image.c (Finit_image_library): No longer static.
3517 * fileio.c (Fmake_symbolic_link): No longer static.
3518 * eval.c (Ffetch_bytecode): No longer static.
3519 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
3520 * doc.c (Fdocumentation_property, Fsnarf_documentation):
3521 No longer static.
404dbd37
TT
3522 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
3523 static.
3524 * dired.c (Ffile_attributes): No longer static.
3525 * composite.c (Fcomposition_get_gstring): No longer static.
3526 * callproc.c (Fgetenv_internal): No longer static.
3527
3528 * ccl.h: Remove EXFUNs.
3529 * buffer.h: Remove EXFUNs.
3530 * dispextern.h: Remove EXFUNs.
3531 * intervals.h: Remove EXFUNs.
3532 * fontset.h: Remove EXFUN.
3533 * font.h: Remove EXFUNs.
3534 * dosfns.c (system_process_attributes): Remove EXFUN.
3535 * keymap.h: Remove EXFUNs.
3536 * lisp.h: Remove EXFUNs.
3537 * w32term.h: Remove EXFUNs.
3538 * window.h: Remove EXFUNs.
3539 * xsettings.h: Remove EXFUN.
3540 * xterm.h: Remove EXFUN.
3541
8e4fd1e1
GM
35422012-07-03 Glenn Morris <rgm@gnu.org>
3543
3544 * lisp.h (Frandom): Make it visible to C.
3545 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
3546 buffer for invisible buffers. (Bug#1229)
3547
ca95b3eb
DA
35482012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3549
3550 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
3551 values which aren't power of 2.
14ae4239
BT
3552 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
3553 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
3554 accordingly.
3555
7555c33f
SM
35562012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
3557
3558 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
3559
3560 * alloc.c (mark_object): Revert part of last patch to use `switch'.
3561
d12e8f5a
DA
35622012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3563
3564 * alloc.c (allocate_vector_block): Remove redundant
3565 calls to mallopt if DOUG_LEA_MALLOC is defined.
3566 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
3567 avoid calls to mallopt if zero_vector is returned.
3568
296094c3
DA
35692012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3570
3571 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
3572 is enabled, avoid dereferencing NULL current_sblock if
3573 running undumped.
3574
36429c89
DA
35752012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3576
3577 Cleanup basic buffer management.
3578 * buffer.h (struct buffer): Change layout to use generic vector
3579 marking code. Fix some comments. Change type of 'clip_changed'
3580 to bitfield. Remove unused #ifndef old.
3581 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
3582 (GET_OVERLAYS_AT): Fix indentation.
3583 (for_each_per_buffer_object_at): New macro.
3584 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
3585 (Fbuffer_local_variables): Use it.
3586 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
3587 * alloc.c (allocate_buffer): Adjust to match new layout of
3588 struct buffer. Fix comment.
3589 (mark_overlay): New function.
3590 (mark_buffer): Use it. Use mark_vectorlike to mark normal
3591 Lisp area of struct buffer.
3592 (mark_object): Use it. Adjust marking of misc objects
3593 and related comments.
3594
3b3e4cac
PE
35952012-07-02 Paul Eggert <eggert@cs.ucla.edu>
3596
3597 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
3598 wrapper that is not needed because the wrapped code is a no-op (zero
3599 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
3600 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
3601
cf5c0175
DA
36022012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
3603
3604 * alloc.c (mark_buffer): Simplify. Remove prototype.
3605 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 3606 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
3607 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
3608 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 3609
ca26824c
GM
36102012-06-30 Glenn Morris <rgm@gnu.org>
3611
2e4c5312
GM
3612 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
3613
ca26824c
GM
3614 * epaths.in (PATH_SITELOADSEARCH): New.
3615 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
3616 This is rather than relying on --enable-locallisppath elements
3617 having "site-lisp" in their names. (Bug#10208#25, 11658)
3618
0d23c240
EZ
36192012-06-30 Eli Zaretskii <eliz@gnu.org>
3620
c9240d7a
EZ
3621 * w32proc.c (sys_select): Accept and ignore one more argument.
3622
3623 * w32.c (emacs_gnutls_pull): Call select with one more argument.
3624
0d23c240 3625 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 3626 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
3627
3628 * sysdep.c: Don't include dos.h and dosfns.h.
3629
3630 * process.c (sys_select):
3631 * msdos.c (sys_select): Accept one more argument and ignore it.
3632
3633 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
3634 adapt data types and code to that.
3635
3636 * dosfns.c:
3637 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
3638 which clashes with the gnulib function of the same name.
3639
af5a5a98
AS
36402012-06-30 Andreas Schwab <schwab@linux-m68k.org>
3641
c5e4379c
AS
3642 * font.c (font_style_to_value, font_style_symbolic)
3643 (font_prop_validate_style): Add type checks for values in
3644 font_style_table.
3645
af5a5a98
AS
3646 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
3647 argument.
3648 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
3649 uses.
3650
8d38f461
EZ
36512012-06-29 Eli Zaretskii <eliz@gnu.org>
3652
2e5a6631
EZ
3653 * xdisp.c (try_window_id): Undo last change.
3654
8d38f461
EZ
3655 * w32.c (getwd): Adjust commentary about startup_dir.
3656 (init_environment): Always call sys_access, even in non-MSVC
3657 builds. Don't chdir to the directory of the Emacs executable.
3658 This undoes code from 1997 which was justified by the need to
3659 "avoid conflicts when removing and renaming directories". But its
3660 downside was that every relative file name was being interpreted
3661 relative to the directory of the Emacs executable, which can never
3662 be TRT. In particular, it broke sys_access when called with
3663 relative file names.
3664 (sys_access): Map GetLastError to errno.
3665
2af3565e
DA
36662012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3667
3668 * window.h (struct window): Change type of 'fringes_outside_margins'
3669 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 3670 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
3671 Adjust comment.
3672 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
3673 to ptrdiff_t.
3674
c8d3a25c 36752012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 3676
c8d3a25c
GM
3677 * gnutls.c (emacs_gnutls_handshake):
3678 Add QUIT to make the loop interruptible.
57570cd3 3679
c8d3a25c 36802012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 3681
c8d3a25c
GM
3682 * charset.c (init_charset): Make lack of etc/charsets fatal.
3683
3e984ee8
DA
36842012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3685
3686 * editfns.c (region_limit): Fix type mismatch.
3687
ef884f23
DA
36882012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3689
3690 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
3691 undefined. Convert from xassert to eassert.
3692 * nsmenu.m: Convert from xassert to eassert.
3693 * nsterm.m: Likewise.
3694
7d7e0027
SM
36952012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
3696
3697 * editfns.c (region_limit): Clip to narrowing (bug#11770).
3698
aa754e6a
PE
36992012-06-28 Paul Eggert <eggert@cs.ucla.edu>
3700
3701 Avoid integer overflow on scroll-left and scroll-right.
3702 * window.c (HSCROLL_MAX): New macro.
3703 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
3704 overflow when requested scroll falls outside ptrdiff_t range.
3705
80b00b08
DA
37062012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3707
3708 * window.h (struct window): Change type of 'hscroll',
3709 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
3710 'last_modified' and 'last_overlay_modified' to EMACS_INT.
3711 Adjust users accordingly.
3712 * xdisp.c (try_cursor_movement): Replace type check with eassert.
3713 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
3714 from EMACS_INT to ptrdiff_t.
3715 (make_window): Omit redundant initialization.
3716
62b2bcf6
JB
37172012-06-28 Juanma Barranquero <lekktu@gmail.com>
3718
3719 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
3720
45942c7d
DA
37212012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3722
3723 * window.h (struct window): Change type of 'use_time' and
3724 'sequence_number' from Lisp_Object to int.
3725 * frame.c (make_frame): Adjust users accordingly.
3726 * print.c (print_object): Likewise.
3727 * window.c (select_window, Fwindow_use_time, make_parent_window)
3728 (make_window): Likewise.
3729
e509cfa6
DA
37302012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3731
3732 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
3733 enabled with --enable-checking=[all,glyphs] configure option.
3734 Fix GLYPH_DEBUG usage assuming that it may be undefined,
3735 adjust comments accordingly.
3736 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
3737 undefined, adjust comments accordingly.
3738 * image.c: Likewise.
3739 * scroll.c: Likewise.
3740 * w32fns.c: Likewise.
3741 * w32term.c: Likewise.
3742 * xdisp.c: Likewise.
3743 * xfaces.c: Likewise.
3744 * xfns.c: Likewise.
3745 * xterm.c: Likewise.
3746
a54e2c05
DA
37472012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3748
3749 Generalize run-time debugging checks.
3750 * dispextern.h (XASSERTS): Remove.
3751 * fontset.c (xassert): Remove.
3752 Convert from xassert to eassert.
3753 * alloc.c: Convert from xassert to eassert.
3754 * bidi.c: Likewise.
3755 * dispnew.c: Likewise.
3756 * fns.c: Likewise.
3757 * fringe.c: Likewise.
3758 * ftfont.c: Likewise.
3759 * gtkutil.c: Likewise.
3760 * image.c: Likewise.
3761 * keyboard.c: Likewise.
3762 * menu.c: Likewise.
3763 * process.c: Likewise.
3764 * scroll.c: Likewise.
3765 * sound.c: Likewise.
3766 * term.c: Likewise.
3767 * w32console.c: Likewise.
3768 * w32fns.c: Likewise.
3769 * w32term.c: Likewise.
3770 * window.c: Likewise.
3771 * xdisp.c: Likewise.
3772 * xfaces.c: Likewise.
3773 * xfns.c: Likewise.
3774 * xselect.c: Likewise.
3775 * xterm.c: Likewise.
3776
1ec4b7b2
SM
37772012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
3778
3779 * fns.c (maybe_resize_hash_table): Output message when growing the
3780 purify-hashtable.
3781
2014308a
DA
37822012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3783
3784 * alloc.c (allocate_string_data): Remove dead code.
3785 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
3786 avoid GCC warning about unused macro.
3787
246155eb
DA
37882012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3789
3790 * alloc.c (allocate_string): Omit intervals initialization.
3791 * alloc.c (make_uninit_multibyte_string): Initialize intervals
3792 as in make_pure_string and make_pure_c_string.
3793
43184b7b
DA
37942012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3795
d209e2fb 3796 * alloc.c (allocate_string): Fix last change.
43184b7b 3797
3fe6dd74
DA
37982012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3799
d209e2fb 3800 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
3801 to memset, add explicit initialization where appropriate.
3802
1ba6038a
GM
38032012-06-27 Glenn Morris <rgm@gnu.org>
3804
3805 * lisp.mk (lisp): Remove paths.elc.
3806
c89926a5
CY
38072012-06-27 Chong Yidong <cyd@gnu.org>
3808
3809 * doc.c (Fsubstitute_command_keys): Fix punctuation.
3810
ed6b3510
JW
38112012-06-26 John Wiegley <johnw@newartisans.com>
3812
1ec4b7b2 3813 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
3814 on Mac OS X Lion: __mod_init_func and __mod_term_func.
3815
ed6b3510
JW
3816 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
3817 when building with Clang.
3818
8edd4a2b
SM
38192012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
3820
3821 * eval.c (Fapply): Allow calling it with a single argument.
3822
f6f62d1b
EZ
38232012-06-26 Eli Zaretskii <eliz@gnu.org>
3824
3825 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
3826 _stricmp and _strnicmp.
3827 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
3828
62efea5e
DA
38292012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3830
3831 * alloc.c (allocate_window): Zero out non-Lisp part of newly
3832 allocated window.
3833 (allocate_process): Likewise for new process.
8edd4a2b 3834 (allocate_terminal): Change to use offsetof.
62efea5e
DA
3835 (allocate_frame): Likewise.
3836 * frame.c (make_frame): Omit redundant initialization.
3837 * window.c (make_parent_window): Use memset.
3838 (make_window): Omit redundant initialization.
3839 * process.c (make_process): Omit redundant initialization.
3840 * terminal.c (create_terminal): Likewise.
3841
42997f4d
DA
38422012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3843
3844 * term.c (delete_tty): Remove redundant call to memset.
3845
1130ecfc
DA
38462012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3847
3848 * alloc.c: Remove build_string.
3849 * lisp.h: Define build_string as static inline. This provides
3850 a better opportunity to optimize away calls to strlen when the
3851 function is called with compile-time constant argument.
3852 * image.c (imagemagick_error): Convert to build_string.
3853 * w32proc.c (sys_spawnve): Likewise.
3854 * xterm.c (x_term_init): Likewise.
3855
cf38a720
PE
38562012-06-26 Paul Eggert <eggert@cs.ucla.edu>
3857
99027bdd
PE
3858 Use sprintf return value instead of invoking strlen on result.
3859 In the old days this wasn't portable, since some sprintf
3860 implementations returned char *. But they died out years ago and
3861 Emacs already assumes sprintf returns int.
3862 Similarly for float_to_string.
3863 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
3864 * ccl.c (ccl_driver):
3865 * character.c (string_escape_byte8):
3866 * data.c (Fnumber_to_string):
3867 * doprnt.c (doprnt):
3868 * print.c (print_object):
3869 * xdisp.c (message_dolog):
3870 * xfns.c (syms_of_xfns):
3871 Use sprintf or float_to_string result to avoid need to call strlen.
3872 * data.c (Fnumber_to_string):
3873 Use make_unibyte_string, since the string must be ASCII.
3874 * lisp.h, print.c (float_to_string): Now returns int length.
3875 * term.c (produce_glyphless_glyph):
3876 Use sprintf result rather than recomputing it.
3877
cf38a720
PE
3878 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
3879 * Makefile.in (ALL_CFLAGS):
3880 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
3881 * gmalloc.c, regex.c: Include <config.h> unconditionally.
3882
3511c784
DA
38832012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
3884
0a08eb21 3885 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
3886 strcasecmp if available.
3887 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
3888
fb7da12e
AS
38892012-06-25 Andreas Schwab <schwab@linux-m68k.org>
3890
3891 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
3892 Avoid comma operator.
3893 * menu.c (push_submenu_start, push_submenu_end)
3894 (push_left_right_boundary, push_menu_pane): Likewise.
3895 * msdos.c (dos_rawgetc): Likewise.
3896
afa2ffd8
DA
38972012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
3898
3899 * xfns.c (xic_create_fontsetname): Remove redundant calls
3900 to memset.
3901
b3b4476b
PE
39022012-06-25 Paul Eggert <eggert@cs.ucla.edu>
3903
4495ff38
PE
3904 * gtkutil.c (get_utf8_string): Remove redundant assignment.
3905 sprintf already null-terminates its output.
3906
b3b4476b
PE
3907 * xfns.c (x_window): Remove redundant cast.
3908
b00876c9
DA
39092012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
3910
3911 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
3912 `const char *' to `char *' to avoid compiler warning.
3913
d188e26b
PE
39142012-06-24 Paul Eggert <eggert@cs.ucla.edu>
3915
885d1d74
PE
3916 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
3917 instead of truncating it to 63 (admittedly a generous limit).
3918
d188e26b
PE
3919 * process.c: Fix spelling and caps in comments.
3920
e2f560b1
DN
39212012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
3922
e86db54b 3923 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
3924 * sysdep.c (setpgrp): Remove definition, not used in this file.
3925
7583a3a1
JB
39262012-06-24 Juanma Barranquero <lekktu@gmail.com>
3927
3928 * makefile.w32-in: Update dependencies.
3929
696056c2
EZ
39302012-06-24 Eli Zaretskii <eliz@gnu.org>
3931
3932 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
3933 (SYSTIME_H): Add nt/inc/sys/time.h.
3934
3935 * systime.h [WINDOWSNT]: Include sys/time.h.
3936
3937 * s/ms-w32.h (struct timespec): Definition moved from
3938 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
3939
845ca893
PE
39402012-06-24 Paul Eggert <eggert@cs.ucla.edu>
3941
3942 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
3943 * buffer.h (buffer_slot_type_mismatch):
3944 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
3945 * eval.c (unwind_to_catch):
3946 * image.c (my_png_error, my_error_exit):
3947 * keyboard.c (quit_throw_to_read_char, user_error)
3948 (Fexit_recursive_edit, Fabort_recursive_edit):
3949 * lisp.h (die, args_out_of_range, args_out_of_range_3)
3950 (wrong_type_argument, buffer_overflow, __executable_start)
3951 (memory_full, buffer_memory_full, string_overflow, Fthrow)
3952 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
3953 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
3954 (fatal):
3955 (child_setup) [!DOS_NT]:
3956 * lread.c (end_of_file_error, invalid_syntax):
3957 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
3958 * puresize.h (pure_write_error):
3959 * search.c (matcher_overflow):
3960 * sound.c (sound_perror, alsa_sound_perror):
3961 * sysdep.c, syssignal.h (croak):
3962 * term.c (maybe_fatal, vfatal):
3963 * textprop.c (text_read_only):
3964 * undo.c (user_error):
3965 * unexmacosx.c (unexec_error):
3966 * xterm.c (x_ins_del_lines, x_delete_glyphs):
3967 Use _Noreturn rather than NO_RETURN.
3968 No need for separate decl merely because of _Noreturn.
3969 * sound.c (sound_warning, parse_sound):
3970 Remove unnecessary forward decls.
3971
f1dd8073
PE
39722012-06-24 Paul Eggert <eggert@cs.ucla.edu>
3973
3974 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
3975 * lisp.h (WAIT_READING_MAX): New macro.
3976 * dispnew.c (Fsleep_for, sit_for):
3977 * keyboard.c (kbd_buffer_get_event):
3978 * process.c (Faccept_process_output):
3979 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
3980 This improves on the previous patch, which introduced a bug
3981 when time_t is unsigned and as wide as intmax_t.
3982 See <http://bugs.gnu.org/9000#51>.
3983
b82c1755
EZ
39842012-06-23 Eli Zaretskii <eliz@gnu.org>
3985
3986 * dispnew.c (sit_for, Fsleep_for):
3987 * keyboard.c (kbd_buffer_get_event):
3988 * process.c (Faccept_process_output): Avoid compiler warnings when
3989 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
3990
ca300656
JB
39912012-06-23 Juanma Barranquero <lekktu@gmail.com>
3992
049ec95b
JB
3993 * makefile.w32-in: Update dependencies.
3994
ca300656
JB
3995 * w32.c (ltime): Add return type and declare static.
3996 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
3997
db7b8d06
PE
39982012-06-23 Paul Eggert <eggert@cs.ucla.edu>
3999
4000 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
4001 Privately reported by Herbert J. Skuhra.
4002 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
4003 All uses changed.
4004 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
4005 not make_lisp_timeval, when the argument is of type EMACS_TIME.
4006
0bd8297f
EZ
40072012-06-23 Eli Zaretskii <eliz@gnu.org>
4008
96512555
EZ
4009 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
4010 last argument of make_unibyte_string.
4011
0bd8297f
EZ
4012 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
4013 language ID in the event parameters.
4014
4015 * w32term.c (w32_read_socket): Put the new keyboard codepage into
4016 event.code, not the obscure "character set ID".
4017
63def6b6
CY
40182012-06-23 Chong Yidong <cyd@gnu.org>
4019
4020 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
4021
e8a02204
EZ
40222012-06-23 Eli Zaretskii <eliz@gnu.org>
4023
388cdec0
EZ
4024 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
4025 * w32.c (fdutimens): New function.
4026
4027 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
4028
4029 * s/ms-w32.h (pselect): Redirect to sys_select.
4030
4031 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
4032
e8a02204
EZ
4033 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
4034 in the logic of incrementing and decrementing the value of
4035 use_relocatable_buffers.
4036
d054f3fb
PE
40372012-06-23 Paul Eggert <eggert@cs.ucla.edu>
4038
4039 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
4040 Privately reported by Herbert J. Skuhra.
4041 [__FreeBSD__]: Remove "*/" typo after "#include".
4042 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
4043 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
4044 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
4045 Don't assume EMACS_TIME and struct timeval are the same type.
4046
d35af63c
PE
40472012-06-22 Paul Eggert <eggert@cs.ucla.edu>
4048
4049 Support higher-resolution time stamps (Bug#9000).
4050 The time stamps are only nanosecond-resolution at the C level,
4051 since that's the best that any real-world system supports now.
4052 But they are picosecond-resolution at the Lisp level, as that's
4053 easy, and leaves room for future OS improvements.
4054
4055 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
4056 (LIBES): Use it.
4057
4058 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
4059 Don't get current time unless it's needed.
4060
4061 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
4062 now provides it if it's absent.
4063 (start_atimer): Port to higher-res time stamps.
4064 Check for time stamp overflow. Don't get current time more
4065 often than is needed.
4066
4067 * buffer.h (struct buffer): Buffer modtime now has high resolution.
4068 Include systime.h, not time.h.
4069 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
4070
4071 * dired.c: Include stat-time.h.
4072 (Ffile-attributes): File times now have higher resolution.
4073
4074 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
4075 (struct image): Timestamp now has higher resolution.
4076
4077 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
4078 has at least microseconds now. All uses removed.
4079 (update_frame, update_single_window, update_window, update_frame_1)
4080 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 4081 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
4082
4083 * editfns.c (time_overflow): Now extern.
4084 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
4085 (float-time, Fformat_time_string, Fcurrent_time_string)
4086 (Fcurrent_time_zone): Accept and generate higher-resolution
4087 time stamps.
4088 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
4089 (decode_time_components, lisp_seconds_argument): New functions.
4090 (make_time): Now static.
4091 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
4092 Report an error if the time is invalid, rather than having the caller
4093 do that.
4094
4095 * fileio.c: Include <stat-time.h>
4096 (Fcopy_file): Copy higher-resolution time stamps.
4097 Prefer to set the time stamp via a file descriptor if that works.
4098 (Fset_file_times, Finsert_file_contents, Fwrite_region)
4099 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
4100 (Fvisited_file_modtime, Fset_visited_file_modtime):
4101 Support higher-resolution time stamps.
4102
4103 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
4104
4105 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
4106
4107 * image.c (prepare_image_for_display, clear_image_cache)
4108 (lookup_image): Port to higer-resolution time stamps.
4109
4110 * keyboard.c (start_polling, bind_polling_period):
4111 Check for time stamp overflow.
4112 (read_char, kbd_buffer_get_event, timer_start_idle)
4113 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
4114 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
4115 Port to higher-resolution time stamps. Do not assume time_t is signed.
4116 (decode_timer): New function. Timers are now vectors of length 9,
4117 not 8, to accommodate the picosecond component.
4118 (timer_check_2): Use it.
4119
4120 * nsterm.m (select_timeout, timeval_subtract): Remove.
4121 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
4122 as they're a bit more accurate and handle overflow better.
4123 (ns_select): Change prototype to be compatible with pselect.
4124 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
4125 * nsterm.h (ns_select): Adjust prototype.
4126
4127 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
4128 us-resolution time stamps.
4129 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
4130
4131 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
4132
4133 * lisp.h (time_overflow): New decl.
4134 (wait_reading_process_output): First arg is now intmax_t, not int,
4135 to accommodate larger waits.
4136
4137 * process.h (struct Lisp_Process.read_output_delay):
4138 Now counts nanoseconds, not microseconds.
4139 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
4140 EMACS_HAS_USECS.
4141 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
4142 (wait_reading_process_output):
4143 Port to ns-resolution time stamps.
4144 (Faccept_process_output, wait_reading_process_output):
4145 Check for time stamp overflow. Do not assume time_t is signed.
4146 (select_wrapper): Remove; we now use pselect.
4147 (Fprocess_attributes): Now generates ns-resolution time stamps.
4148
4149 * sysdep.c: Include utimens.h. Don't include utime.h
4150 or worry about struct utimbuf; gnulib does that for us now.
4151 (gettimeofday): Remove; gnulib provides a substitute.
4152 (make_timeval): New function.
4153 (set_file_times): Now sets ns-resolution time stamps.
4154 New arg FD; all uses changed.
4155 (time_from_jiffies, ltime_from_jiffies, get_up_time)
4156 (system_process_attributes):
4157 Now returns ns-resolution time stamp. All uses changed.
4158 Check for time stamp overflow.
4159
4160 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
4161 provides a substitute now.
4162
4163 * systime.h: Include timespec.h rather than sys/time.h and time.h,
4164 since it guarantees struct timespec.
4165 (EMACS_TIME): Now struct timespec, so that we can support
4166 ns-resolution time stamps.
4167 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
4168 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
4169 (EMACS_USECS): Remove.
4170 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
4171 so multiply the arg by 1000 before storing it.
4172 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
4173 New macros.
4174 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
4175 Port to ns-resolution time stamps.
4176 (EMACS_TIME_NEG_P): Remove; replaced by....
4177 (EMACS_TIME_SIGN): New macro.
4178 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
4179 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
4180 (set_file_times, make_time, lisp_time_argument): Adjust signature.
4181 (make_timeval, make_lisp_time, decode_time_components): New decls.
4182 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
4183 that it mishandled time_t overflow. You can't compare by subtracting!
4184 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
4185 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
4186
4187 * term.c: Include <sys/time.h>.
4188 (timeval_to_Time): New function, for proper overflow wraparound.
4189 (term_mouse_position, term_mouse_click): Use it.
4190
4191 * undo.c (record_first_change): Support higher-resolution time stamps
4192 in the undo buffer.
4193 (Fprimitive_undo): Use them when restoring time stamps.
4194
4195 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
4196 (w32_get_internal_run_time):
4197 Port to higher-resolution Emacs time stamps.
4198 (ltime): Now accepts single 64-bit integer, as that's more convenient
4199 for callers.
4200
4201 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
4202
4203 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
4204 for compatibility with pselect. Support ns-resolution time stamps.
4205
4206 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
4207
4208 * xselect.c (wait_for_property_change, x_get_foreign_selection):
4209 Check for time stamp overflow, and support ns-resolution time stamps.
4210
4211 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
4212 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
4213 (timeval_subtract): Remove; no longer needed.
4214 (XTflash, XTring_bell, x_wait_for_event):
4215 Port to ns-resolution time stamps. Don't assume time_t is signed.
4216
b6a92dfe
CY
42172012-06-22 Chong Yidong <cyd@gnu.org>
4218
4219 * xdisp.c (x_consider_frame_title): Revert last change.
4220
d251c37c
EZ
42212012-06-22 Eli Zaretskii <eliz@gnu.org>
4222
4223 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
4224 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
4225 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
4226 staticidx goes up to 1597 out of 1600 = 0x640.)
4227
f10deafb
PE
42282012-06-20 Paul Eggert <eggert@cs.ucla.edu>
4229
4230 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
4231 Otherwise, the umask might be mistakenly 0 while handling input signals.
4232
ec6de1e2
SM
42332012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
4234
4235 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
4236
28be1ada
DA
42372012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
4238
4239 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
4240 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
4241 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
4242 access to `contents' member of Lisp_Vector objects with AREF and ASET
4243 where appropriate.
4244
c6bf3022
CY
42452012-06-19 Chong Yidong <cyd@gnu.org>
4246
4247 * frame.c (delete_frame): When selecting a frame on a different
4248 text terminal, do not alter the terminal's top-frame.
4249
4250 * xdisp.c (format_mode_line_unwind_data): Record the target
4251 frame's selected window and its terminal's top-frame.
4252 (unwind_format_mode_line): Restore them.
4253 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
4254 Callers changed.
4255 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
4256 since tty frames can be explicitly named.
4257 (prepare_menu_bars): Likewise.
4258
4259 * term.c (Ftty_top_frame): New function.
4260
defd4196
PE
42612012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4262
4263 Port byte-code-meter to modern targets.
4264 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
4265 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 4266 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
4267 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
4268 (METER_1, METER_2): Simplify.
4269
1053a871
SM
42702012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
4271
4272 * data.c (Fdefalias): Return `symbol' (bug#11686).
4273
b7e8d081
MR
42742012-06-18 Martin Rudalics <rudalics@gmx.at>
4275
4276 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
4277 gets killed during executing of this function (Bug#11665).
4278 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
4279 (Vkill_buffer_query_functions): In doc-string say that functions
4280 run by this hook should not change the current buffer.
4281
7ea2b339
PE
42822012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4283
4284 Fix recently-introduced process.c problems found by static checking.
4285 * process.c (write_queue_push, write_queue_pop, send_process):
4286 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
4287 (write_queue_pop): Fix pointer signedness problem.
4288 (send_process): Remove unused local.
4289
96a313a1
CY
42902012-06-17 Chong Yidong <cyd@gnu.org>
4291
4292 * xdisp.c (redisplay_internal): No need to redisplay terminal
4293 frames that are not on top.
4294
20ca2e94
TN
42952012-06-17 Troels Nielsen <bn.troels@gmail.com>
4296
4297 * process.c (make_process): Initialize write_queue.
4298 (write_queue_push, write_queue_pop): New functions.
4299 (send_process): Use them to maintain correct ordering of process
4300 writes (Bug#10815).
4301
9a900ca9
PE
43022012-06-17 Paul Eggert <eggert@cs.ucla.edu>
4303
310fbfa8
PE
4304 * lisp.h (eassert): Assume C89 or later.
4305 This removes the need for CHECK.
4306 (CHECK): Remove. Its comments about always evaluating its
4307 argument were confusing, as 'eassert' typically does not evaluate
4308 its argument.
4309
27bb1ca4
PE
4310 * coding.c (produce_chars): Use ptrdiff_t, not int.
4311
9a900ca9
PE
4312 * xterm.c (x_draw_underwave): Check for integer overflow.
4313 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
4314
41b7f8bc 43152012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
4316
4317 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
4318 referenced (Bug#11583).
4319
9b0e3eba
AA
43202012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
4321
4322 Implement wave-style variant of underlining.
4323 * dispextern.h (face_underline_type): New enum.
4324 (face): Add field for underline type.
4325 * nsterm.m (ns_draw_underwave): New function.
4326 (ns_draw_text_decoration): Use it.
4327 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
4328 New functions.
4329 (x_draw_glyph_string): Use them.
4330 * xfaces.c (Qline, Qwave): New Lisp objects.
4331 (check_lface_attrs, merge_face_ref)
1053a871
SM
4332 (Finternal_set_lisp_face_attribute, realize_x_face):
4333 Handle wave-style underline face attributes.
9b0e3eba
AA
4334 * xterm.c (x_draw_underwave): New function.
4335 (x_draw_glyph_string): Use it.
4336
0fb52f11
JB
43372012-06-16 Juanma Barranquero <lekktu@gmail.com>
4338
4339 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
4340 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
4341 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
4342 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
4343 ($(BLD)/w32select.$(O)): Update dependencies.
4344
e5560ff7
AS
43452012-06-16 Andreas Schwab <schwab@linux-m68k.org>
4346
4347 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
4348 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
4349 * character.c (_fetch_multibyte_char_p): Remove.
4350 * alloc.c: Include "character.h" before "buffer.h".
4351 * bidi.c: Likewise.
4352 * buffer.c: Likewise.
4353 * bytecode.c: Likewise.
4354 * callint.c: Likewise.
4355 * callproc.c: Likewise.
4356 * casefiddle.c: Likewise.
4357 * casetab.c: Likewise.
4358 * category.c: Likewise.
4359 * cmds.c: Likewise.
4360 * coding.c: Likewise.
4361 * composite.c: Likewise.
4362 * dired.c: Likewise.
4363 * dispnew.c: Likewise.
4364 * doc.c: Likewise.
4365 * dosfns.c: Likewise.
4366 * editfns.c: Likewise.
4367 * emacs.c: Likewise.
4368 * fileio.c: Likewise.
4369 * filelock.c: Likewise.
4370 * font.c: Likewise.
4371 * fontset.c: Likewise.
4372 * fringe.c: Likewise.
4373 * indent.c: Likewise.
4374 * insdel.c: Likewise.
4375 * intervals.c: Likewise.
4376 * keyboard.c: Likewise.
4377 * keymap.c: Likewise.
4378 * lread.c: Likewise.
4379 * macros.c: Likewise.
4380 * marker.c: Likewise.
4381 * minibuf.c: Likewise.
4382 * nsfns.m: Likewise.
4383 * nsmenu.m: Likewise.
4384 * print.c: Likewise.
4385 * process.c: Likewise.
4386 * regex.c: Likewise.
4387 * region-cache.c: Likewise.
4388 * search.c: Likewise.
4389 * syntax.c: Likewise.
4390 * term.c: Likewise.
4391 * textprop.c: Likewise.
4392 * undo.c: Likewise.
4393 * unexsol.c: Likewise.
4394 * w16select.c: Likewise.
4395 * w32fns.c: Likewise.
4396 * w32menu.c: Likewise.
4397 * window.c: Likewise.
4398 * xdisp.c: Likewise.
4399 * xfns.c: Likewise.
4400 * xmenu.c: Likewise.
4401 * xml.c: Likewise.
4402 * xselect.c: Likewise.
4403
2f07e6af
EZ
44042012-06-16 Eli Zaretskii <eliz@gnu.org>
4405
1053a871
SM
4406 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
4407 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 4408 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
4409 row.
4410 (handle_face_prop): Use chunk-relative overlay string index when
4411 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
4412 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
4413 the rightmost. (Bug#11720)
2f07e6af 4414
29b83cec
AS
44152012-06-16 Andreas Schwab <schwab@linux-m68k.org>
4416
4417 * category.h (CHAR_HAS_CATEGORY): Define as inline.
4418 (CATEGORY_MEMBER): Enforce 1/0 value.
4419 * category.c (_temp_category_set): Remove.
4420
4c5501e9
EZ
44212012-06-16 Eli Zaretskii <eliz@gnu.org>
4422
4423 * window.c (Fdelete_other_windows_internal)
4424 (Fdelete_window_internal): Don't access frame's mouse highlight
4425 info of the initial frame. (Bug#11677)
4426
2b570124
PE
44272012-06-14 Paul Eggert <eggert@cs.ucla.edu>
4428
e93864f9
PE
4429 * .gdbinit (xgetint): Fix recently-introduced paren typo.
4430 Assume USE_2_TAGS_FOR_INTS.
4431 (xreload): Adjust $tagmask width to match recent lisp.h change.
4432
2b570124
PE
4433 Simplify lisp.h in minor ways that should not affect code.
4434 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
4435 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
4436 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
4437 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
4438 (INTTYPEBITS): New macro, for clarity.
4439 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
4440 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
4441 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
4442 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
4443 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
4444
81755f69
JB
44452012-06-13 Juanma Barranquero <lekktu@gmail.com>
4446
4447 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
4448
16192a57
GM
44492012-06-13 Glenn Morris <rgm@gnu.org>
4450
4451 * s/bsd-common.h (BSD4_3):
4452 * s/usg5-4-common.h (USG5_4): No longer define; unused.
4453
646b5f55
AS
44542012-06-13 Andreas Schwab <schwab@linux-m68k.org>
4455
4456 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
4457 instead of union.
4458 (XLI, XIL): Define.
1053a871
SM
4459 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
4460 Use them.
4461 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 4462 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 4463 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
4464 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
4465 * frame.c (delete_frame): Remove outdated comment.
4466 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
4467 USE_LISP_UNION_TYPE.
4468 (Fw32_unregister_hot_key): Likewise.
4469 (Fw32_toggle_lock_key): Likewise.
4470 * w32menu.c (add_menu_item): Likewise.
4471 (w32_menu_display_help): Use XIL instead of checking
4472 USE_LISP_UNION_TYPE.
4473 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
4474 (init_heap): Likewise.
4475 * w32term.c (w32_read_socket): Update comment.
4476
1d3823c9
GM
44772012-06-13 Glenn Morris <rgm@gnu.org>
4478
c62ff706
GM
4479 * s/usg5-4-common.h, src/s/unixware.h:
4480 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
4481
1d3823c9
GM
4482 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
4483
bfe3e0a2
PE
44842012-06-13 Paul Eggert <eggert@cs.ucla.edu>
4485
4486 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
4487 * alloc.c (make_number) [!defined make_number]:
4488 Remove, as lisp.h always defines this now.
4489 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
4490 (roundup_size): Verify that it is a power of 2.
4491 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
4492 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
4493 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
4494 -DUSE_LSB_TAG=0, to override the automatically-selected default.
4495 USE_LSB_TAG now is always defined to be either 0 or 1.
4496 All uses changed.
4497 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
4498 code works fine either way, and efficiency is not a concern here,
4499 as the union type is for debugging, not for production.
4500 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
4501 Use an inline function on all platforms when using the union type,
4502 since this is simpler and 'static inline' can be used portably
4503 within Emacs now.
4504 (LISP_INITIALLY_ZERO): New macro.
4505 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
4506 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
4507
45fa9c0f
GM
45082012-06-12 Glenn Morris <rgm@gnu.org>
4509
b4492cba
GM
4510 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
4511
4512 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 4513
45fa9c0f
GM
4514 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
4515 Move BROKEN_SIGIO to configure.
4516
4517 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
4518 Move NO_TERMIO to configure.
4519
0e25d334
CY
45202012-06-12 Chong Yidong <cyd@gnu.org>
4521
4522 * image.c (imagemagick_load_image): Use MagickFlattenImage if
4523 MagickMergeImageLayers is undefined. Use pixel pusher loop if
4524 MagickExportImagePixels is undefined.
4525
43682bb6
PE
45262012-06-12 Paul Eggert <eggert@cs.ucla.edu>
4527
4528 * image.c (imagemagick_load_image): Remove unused label.
4529
a9be7d2b
GM
45302012-06-11 Glenn Morris <rgm@gnu.org>
4531
4532 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4533 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
4534 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
4535 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
4536
3017f87f
SM
45372012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
4538
4539 * alloc.c (make_byte_code): New function.
4540 (Fmake_byte_code): Use it. Don't purify here.
4541 * lread.c (read1): Use it as well to avoid extra allocation.
4542
1b9b4cf4
CY
45432012-06-11 Chong Yidong <cyd@gnu.org>
4544
4545 * image.c (imagemagick_load_image): Implement transparency.
4546
95988fcf
AS
45472012-06-10 Andreas Schwab <schwab@linux-m68k.org>
4548
4549 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
4550 account for preceding backslashes. (Bug#11663)
4551
cd4eb164
CY
45522012-06-09 Chong Yidong <cyd@gnu.org>
4553
4554 * term.c: Support italics in capable terminals (Bug#9652).
4555 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
4556 (turn_on_face): Output using TS_enter_italic_mode if available.
4557 Don't handle unused blinking and alt-charset cases.
4558 (turn_off_face): Handle italic case; discard unused tty_blinking_p
4559 and tty_alt_charset_p cases.
4560 (tty_capable_p, init_tty): Support italics.
4561
4562 * termchar.h (struct tty_display_info): Add field for italics.
4563 Remove unused blink field.
4564
4565 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
4566 Handle slant.
4567
4568 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
4569 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
4570 tty_alt_charset_p. Add tty_italic_p.
4571
ff88beb8
MA
45722012-06-09 Michael Albinus <michael.albinus@gmx.de>
4573
4574 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
4575 dbus_type_is_basic if available.
4576 (xd_extract_signed, xd_extract_unsigned): Rename from
4577 extract_signed and extract_unsigned, respectively. Adapt callers.
4578
44286096
CY
45792012-06-09 Chong Yidong <cyd@gnu.org>
4580
1682701f
CY
4581 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
4582
44286096
CY
4583 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
4584 case (Bug#9752).
4585
d86feb17
PE
45862012-06-08 Paul Eggert <eggert@cs.ucla.edu>
4587
4588 * xdisp.c (vmessage): Treat frame message as multibyte.
4589 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
4590 would generate the diagnostic "Making \302\247 buffer-local while
4591 let-bound!".
4592
d5c20fe8
EZ
45932012-06-08 Eli Zaretskii <eliz@gnu.org>
4594
4595 * dispnew.c (showing_window_margins_p): Undo last change, which
4596 was done due to an inadvertent commit.
4597 (adjust_frame_glyphs_for_frame_redisplay): Do call
4598 showing_window_margins_p.
4599
513749ee
SM
46002012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
4601
4602 * eval.c (Fmake_var_non_special): New primitive.
4603 (syms_of_eval): Defsubr it.
4604 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
4605
d4a8f5c1
JB
46062012-06-08 Juanma Barranquero <lekktu@gmail.com>
4607
4608 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
4609 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
4610
8bbbc977
EZ
46112012-06-08 Eli Zaretskii <eliz@gnu.org>
4612
4613 * alloc.c (allocate_vectorlike): Fix last change.
4614
f3372c87
DA
46152012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
4616
4617 Block-based vector allocation of small vectors.
4618 * lisp.h (struct vectorlike_header): New field `nbytes',
4619 adjust comment accordingly.
4620 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
4621 to denote vector blocks. Adjust users (live_vector_p,
4622 mark_maybe_pointer, valid_lisp_object_p) accordingly.
4623 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
4624 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
4625 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
4626 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
4627 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
4628 (roundup_size): New constant.
4629 (struct vector_block): New data type.
4630 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 4631 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
4632 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
4633 (sweep_vectors): New functions.
4634 (allocate_vectorlike): Return `zero_vector' as the only vector of
4635 0 items. Allocate new vector from block if vector size is less than
4636 or equal to VBLOCK_BYTES_MAX.
4637 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
4638 (init_alloc_once): Add call to init_vectors.
4639
4f18a4ed
SM
46402012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
4641
4642 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
4643
86f158bc
PE
46442012-06-07 Paul Eggert <eggert@cs.ucla.edu>
4645
4646 * doprnt.c (doprnt): Truncate multibyte char correctly.
4647 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
4648 would mishandle a string argument "Xc" if X was a multibyte
4649 character of length 2: it would truncate after X's first byte
4650 rather than including all of X.
4651
c5cfcbe0
CY
46522012-06-06 Chong Yidong <cyd@gnu.org>
4653
4654 * buffer.c (word_wrap): Doc fix.
4655
c05cf390
PE
46562012-06-04 Paul Eggert <eggert@cs.ucla.edu>
4657
4658 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
4659
0c3461de
GM
46602012-06-03 Glenn Morris <rgm@gnu.org>
4661
4662 * xdisp.c (tool-bar-style): Doc fix.
4663
c71232db
UM
46642012-06-03 Ulrich Müller <ulm@gentoo.org>
4665
4666 * Makefile.in (PAXCTL): Define.
4667 (temacs$(EXEEXT)): Disable memory randomization for the temacs
4668 binary via PaX flags if the paxctl utility is available.
4669 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
4670 Restore PaX flags to their default. (Bug#11398)
4671
383f7350
CY
46722012-06-03 Chong Yidong <cyd@gnu.org>
4673
4674 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
4675 buffer (Bug#11226).
4676
5f2c76c6
CY
46772012-06-03 Chong Yidong <cyd@gnu.org>
4678
4679 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
4680 (note_mode_line_or_margin_highlight): If there is no help echo,
4681 use mode-line-default-help-echo. Handle the case where the mouse
4682 position is past the end of the mode line string.
4683
4684 * buffer.c (buffer_local_value_1): New function, split from
4685 Fbuffer_local_value; can return Qunbound.
4686 (Fbuffer_local_value): Use it.
4687 (Vmode_line_format): Docstring tweaks.
4688
773d47f6
PE
46892012-06-02 Paul Eggert <eggert@cs.ucla.edu>
4690
4691 * sysdep.c (system_process_attributes): Improve comment.
4692
f2d6a3df
SM
46932012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
4694
4695 * keyboard.c: Export real-this-command to Elisp.
4696 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
4697 and DEFVAR it. Update all users.
4698
63810350
PE
46992012-06-02 Paul Eggert <eggert@cs.ucla.edu>
4700
7bd5c1f4
PE
4701 * minibuf.c (Fassoc_string): Remove duplicate declaration.
4702
63810350
PE
4703 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
4704 Convert pctcpu and pctmem to Lisp float properly.
4705 Let the compiler fold better, as 100.0/0x8000 is exact.
4706
a2821611
AS
47072012-06-02 Andreas Schwab <schwab@linux-m68k.org>
4708
4709 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
4710 cons_block.
4711
5fceba1d
PE
47122012-06-01 Paul Eggert <eggert@cs.ucla.edu>
4713
4714 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
4715
c98ff5dd
DA
47162012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
4717
4718 For a 'struct window', replace some Lisp_Object fields to
4719 bitfields where appropriate, remove unused fields.
4720 * window.h (struct window): Remove unused 'last_mark_x' and
4721 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
4722 change it's type from Lisp_Object to bitfield.
4723 Change type of 'force_start', 'optional_new_start',
4724 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
4725 fields from Lisp_Object to bitfield. Adjust users accordingly.
4726
ca34e0be
PE
47272012-05-31 Paul Eggert <eggert@cs.ucla.edu>
4728
4729 Pacify gcc -Wdouble-precision when using Xaw.
4730 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
4731 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
4732 Use 'float' consistently, rather than 'float' in most places
4733 and 'double' in a couple of places.
4734
efc00ab1 47352012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
4736
4737 * xdisp.c (handle_stop): Detect whether we have overlay strings
4738 loaded by testing it->current.overlay_string_index to be
4739 non-negative, instead of checking whether n_overlay_strings is
4740 positive. (Bug#11587)
4741
efc00ab1 47422012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
4743
4744 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
4745
4746 * doc.c (Fsubstitute_command_keys): Doc fix.
4747
efc00ab1 47482012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
4749
4750 * search.c (search_buffer): Remove calls to
4751 r_alloc_inhibit_buffer_relocation, as it is now called by
4752 maybe_unify_char, which was the cause of relocation of buffer text
4753 in bug#11519.
4754
efc00ab1 47552012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
4756
4757 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
4758 for the duration of call to load_charset, to avoid problems with
4759 callers of maybe_unify_char that access buffer text through C
4760 pointers.
4761
4762 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
4763 decrement the inhibition flag, instead of just setting or
4764 resetting it.
4765
ba93a187
PE
47662012-05-31 Paul Eggert <eggert@cs.ucla.edu>
4767
4768 Remove obsolete '#define static' cruft.
4769 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
4770 This #undef was "temporary" in 2000; it is no longer needed
4771 now that '#define static' has gone away.
4772 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
4773 (gray_bitmap_bits): Remove; no longer needed.
4774 All uses replaced with definiens.
4775 * xterm.c: Include "bitmaps/gray.xbm".
4776
9e4bf381
PE
47772012-05-30 Paul Eggert <eggert@cs.ucla.edu>
4778
4779 Clean up __executable_start, monstartup when --enable-profiling.
4780 The following changes affect the code only when profiling.
4781 * dispnew.c (__executable_start): Rename from safe_bcopy.
4782 Define only on platforms that need it.
4783 * emacs.c: Include <sys/gmon.h> when profiling.
4784 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
4785 (__executable_start): Remove decl, since lisp.h does it now.
4786 (safe_bcopy): Remove decl; no longer has that name.
4787 (main): Coalesce #if into single bit of code, for simplicity.
4788 Cast pointers to uintptr_t, since standard libraries want integers
4789 and not pointers.
4790 * lisp.h (__executable_start): New decl.
4791
32d72c2f
GM
47922012-05-31 Glenn Morris <rgm@gnu.org>
4793
4794 * image.c (Fimagemagick_types): Doc fix.
4795
baac5bc7
JM
47962012-05-30 Jim Meyering <meyering@redhat.com>
4797
4798 * callproc.c (Fcall_process_region): Include directory component
4799 in mkstemp error message (Bug#11586).
4800
72cb32cf
PE
48012012-05-30 Paul Eggert <eggert@cs.ucla.edu>
4802
4803 * alloc.c, lisp.h (make_pure_vector): Now static.
4804
61b108cc
SM
48052012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
4806
4807 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
4808 Move to byte-run.el.
4809 (Fautoload): Do the hash-doc more carefully.
4810 * data.c (Fdefalias): Purify definition, except for keymaps.
4811 (Qdefun): Move from eval.c.
4812 * lisp.h (Qdefun): Remove.
4813 * lread.c (read1): Tiny simplification.
4814
471fe23d
TN
48152012-05-29 Troels Nielsen <bn.troels@gmail.com>
4816
934f3f58 4817 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
4818 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
4819 Bug#9642, but explicitly check that the buffer the overlay would
4820 be moved to is live and rearrange lines to make sure that errors
4821 will not put the overlay in an inconsistent state.
4822 (Fdelete_overlay): Cosmetics.
4823
85d0efd1
EZ
48242012-05-28 Eli Zaretskii <eliz@gnu.org>
4825
4826 * w32term.c (my_bring_window_to_top): New function.
4827 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
4828 could be different from the original one.
4829 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
4830 (Bug#11513)
4831
4832 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
4833 by calling BringWindowToTop.
4834
4835 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
4836 (WM_EMACS_END): Increase by one.
4837
da92a98c
PE
48382012-05-28 Paul Eggert <eggert@cs.ucla.edu>
4839
4840 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
4841 This avoids undefined behavior that might cause the eassert
4842 to not catch an out-of-range value.
4843
74d1f848
JB
48442012-05-28 Juanma Barranquero <lekktu@gmail.com>
4845
4846 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
4847 Update dependencies.
4848
9e1a06fc
EZ
48492012-05-27 Eli Zaretskii <eliz@gnu.org>
4850
4851 * bidi.c (bidi_mirror_char): Fix last change.
4852
f3dd7312
AS
48532012-05-27 Andreas Schwab <schwab@linux-m68k.org>
4854
4855 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
4856 when referring to sectname field in printf format.
4857
81899c91
PE
48582012-05-27 Paul Eggert <eggert@cs.ucla.edu>
4859
57b81a9f
PE
4860 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
4861 Only r_alloc_inhibit_buffer_relocation needed to be added;
4862 the others were already declared.
4863
81899c91
PE
4864 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
4865 before checking whether it's out of range. Put the check inside
4866 eassert. See
4867 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
4868
33017faf 48692012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
4870
4871 * callproc.c (Fcall_process): Restore a line that was accidentally
4872 commented out in the 2011-02-13 change (bug#11547).
4873
33017faf 48742012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
4875
4876 * lisp.h [REL_ALLOC]: Add prototypes for external functions
4877 defined on ralloc.c.
4878
4879 * buffer.c [REL_ALLOC]: Remove prototypes of
4880 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
4881 they are now on lisp.h.
4882
4883 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
4884
4885 * search.c (search_buffer): Use it to inhibit relocation of buffer
4886 text while re_search_2 is doing its job, because re_search_2 is
4887 passed C pointers to buffer text. (Bug#11519)
4888
23415acf
EZ
4889 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
4890 Update value to 24.
4891
44e27368
EZ
4892 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
4893 state after an additional call to move_it_in_display_line_to, keep
4894 the values of it->max_ascent and it->max_descent found for the
4895 entire line.
4896 (pos_visible_p): Revert the comparison against bottom_y to what it
4897 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
4898 (Bug#11464)
4899
c1892f11
PE
49002012-05-26 Paul Eggert <eggert@cs.ucla.edu>
4901
4902 Fix coding-related core dumps with gcc -ftrapv.
4903 The code was computing A - B, where A and B are pointers, and B is
4904 random garbage. This can lead to core dumps on platforms that
4905 have special pointer registers, and it also leads to core dumps on
4906 x86-64 when compiled with gcc -ftrapv. The fix is to compute
4907 A - B only when B is initialized properly.
4908 * coding.c (coding_set_source, coding_set_destination): Return void.
4909 (coding_change_source, coding_change_destinations): New functions,
4910 with the old behaviors of coding_set_source and coding_set_destination.
4911 All callers that need an offset changed to use these new functions.
4912
eb7afdad
GM
49132012-05-26 Glenn Morris <rgm@gnu.org>
4914
4915 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
4916
f12fdf02
EZ
49172012-05-26 Eli Zaretskii <eliz@gnu.org>
4918
53a63be6 4919 Extend mouse support on W32 text-mode console.
61b108cc
SM
4920 * xdisp.c (draw_row_with_mouse_face):
4921 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 4922
eb3f6f01 4923 * w32console.c: Include window.h.
61b108cc
SM
4924 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
4925 New functions.
eb3f6f01
EZ
4926 (initialize_w32_display): Initialize mouse-highlight data.
4927
53a63be6
EZ
4928 * w32inevt.c: Include termchar.h and window.h.
4929 (do_mouse_event): Support mouse-autoselect-window. When the mouse
4930 moves, call note_mouse_highlight. If help_echo changed, call
4931 gen_help_event to produce help-echo message in the echo area.
4932 Call clear_mouse_face if mouse_face_hidden is set in the mouse
4933 highlight info.
4934
4cfd81f6
PE
49352012-05-26 Paul Eggert <eggert@cs.ucla.edu>
4936
4937 * lread.c (read1): Simplify slightly to avoid an overflow warning
4938 with GCC 4.7.0 on x86-64.
4939
4446092a
EZ
49402012-05-26 Eli Zaretskii <eliz@gnu.org>
4941
4942 * bidi.c (bidi_mirror_char): Revert last change: an int is
4943 definitely wide enough here.
4944
42b2a986 49452012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 4946
42b2a986 4947 Fix integer width and related bugs (Bug#9874).
eb106a49 4948 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
4949 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
4950 (string_bytes, check_sblock, allocate_string_data):
4951 (compact_small_strings, Fmake_bool_vector, make_string)
4952 (make_unibyte_string, make_multibyte_string)
4953 (make_string_from_bytes, make_specified_string)
4954 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
4955 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
4956 (mark_vectorlike):
4957 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4958 (allocate_pseudovector):
4959 Use int, not EMACS_INT, where int is wide enough.
4960 (inhibit_garbage_collection, Fgarbage_collect):
4961 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4962 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
4963 int might not be wide enough.
4964 (bidi_cache_search, bidi_cache_find, bidi_init_it)
4965 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
4966 (bidi_at_paragraph_end, bidi_find_paragraph_start)
4967 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
4968 (bidi_level_of_next_char, bidi_move_to_visually_next):
4969 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4970 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
4971 (Fkill_buffer, Fset_buffer_major_mode)
4972 (advance_to_char_boundary, Fbuffer_swap_text)
4973 (Fset_buffer_multibyte, overlays_at, overlays_in)
4974 (overlay_touches_p, struct sortvec, record_overlay_string)
4975 (overlay_strings, recenter_overlay_lists)
4976 (adjust_overlays_for_insert, adjust_overlays_for_delete)
4977 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
4978 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
4979 (Foverlay_recenter, last_overlay_modification_hooks_used)
4980 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
4981 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
4982 (validate_region): Omit unnecessary test for b <= e,
4983 since that's guaranteed by the previous test.
d311d28c
PE
4984 (adjust_overlays_for_delete): Avoid pos + length overflow.
4985 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
4986 (report_overlay_modification):
4987 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4988 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
4989 Omit pointer cast, which isn't needed anyway, and doesn't work
4990 after the EMACS_INT -> ptrdiff_t change.
02481186 4991 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
4992 * buffer.h: Adjust decls to match defn changes elsewhere.
4993 (struct buffer_text, struct buffer):
4994 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4995 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
4996 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
4997 not int, to avoid needless 32-bit limit on 64-bit hosts.
4998 (exec_byte_code): Use tighter memory-full test, one that checks
4999 for alloca overflow. Don't compute the address of the object just
5000 before an array, as that's not portable. Use EMACS_INT, not
5001 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
5002 * callint.c (Fcall_interactively):
5003 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5004 * callproc.c (call_process_kill, Fcall_process):
5005 Don't assume pid_t fits into an Emacs fixnum.
5006 (call_process_cleanup, Fcall_process, child_setup):
5007 Don't assume pid_t fits into int.
5008 (call_process_cleanup, Fcall_process, delete_temp_file)
5009 (Fcall_process_region):
5010 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5011 (Fcall_process): Simplify handling of volatile integers.
5012 Use int, not EMACS_INT, where int will do.
5013 * casefiddle.c (casify_object, casify_region, operate_on_word)
5014 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
5015 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5016 (casify_object): Avoid integer overflow when overallocating buffer.
5017 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 5018 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
5019 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
5020 * category.h (CATEGORYP): Don't assume arg is nonnegative.
5021 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
5022 integers are now checked earlier. All uses replaced with XINT.
5023 (ccl_driver):
5024 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5025 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
5026 (ccl_driver, Fregister_code_conversion_map):
5027 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
5028 (resolve_symbol_ccl_program): Check that vector header is in range.
5029 Always copy the vector, so that we can check its contents reliably
5030 now rather than having to recheck each instruction as it's being
5031 executed. Check that vector words fit in 'int'.
5032 (ccl_get_compiled_code, Fregister_ccl_program)
5033 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
5034 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
5035 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
5036 contents are in range.
5037 (Fccl_execute_on_string): Check that status is in range.
5038 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
5039 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
5040 Accept and return EMACS_INT, not int, because callers can pass values
5041 out of 'int' range.
5042 (c_string_width, strwidth, lisp_string_width, chars_in_text)
5043 (multibyte_chars_in_text, parse_str_as_multibyte)
5044 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
5045 (str_as_unibyte, str_to_unibyte, string_count_byte8)
5046 (string_escape_byte8, Fget_byte):
5047 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 5048 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
5049 avoid mishandling large integers.
5050 * character.h: Adjust decls to match defn changes elsewhere.
5051 * charset.c (load_charset_map_from_file, find_charsets_in_text)
5052 (Ffind_charset_region):
5053 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5054 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
5055 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 5056 Don't assume fixnum fits in int.
d311d28c
PE
5057 (load_charset_map_from_vector, Fmap_charset_chars):
5058 Remove now-unnecessary CHECK_NATNUMs.
5059 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
5060 Don't rely on undefined behavior with signed left shift overflow.
5061 Don't assume unsigned int fits into fixnum, or that fixnum fits
5062 into unsigned int. Don't require max_code to be a valid fixnum;
5063 that's not true for gb10830 4-byte on a 32-bit host. Allow
5064 invalid_code to be a cons, for the same reason. Require code_offset
5065 to be a character. Avoid int overflow if max_char is close
5066 to INT_MAX.
5067 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
5068 this is intended anyway and avoids some undefined behavior.
5069 (load_charset_map): Pass unsigned, not int, as 2nd arg of
5070 INDEX_TO_CODE_POINT, as that's what it expects.
5071 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
5072 * charset.h (DECODE_CHAR): Return int, not unsigned;
5073 this is what was intended anyway, and it avoids undefined behavior.
5074 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
5075 integer-overflow issues.
5076 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
5077 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
5078 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
5079 * chartab.c (Fmake_char_table, Fset_char_table_range)
5080 (uniprop_get_decoder, uniprop_get_encoder):
5081 Don't assume fixnum fits in int.
5082 * cmds.c (move_point): New function, that does the gist of
5083 Fforward_char and Fbackward_char, but does so while checking
5084 for integer overflow more accurately.
c96e5d6a 5085 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
5086 (Fforward_line, Fend_of_line, internal_self_insert)
5087 (internal_self_insert):
5088 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5089 Fix a FIXME, by checking for integer overflow when calculating
5090 target_clm and actual_clm.
5091 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 5092 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
5093 (ASSURE_DESTINATION, coding_alloc_by_realloc)
5094 (coding_alloc_by_making_gap, alloc_destination)
5095 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
5096 (encode_coding_utf_16, detect_coding_emacs_mule)
5097 (decode_coding_emacs_mule, encode_coding_emacs_mule)
5098 (detect_coding_iso_2022, decode_coding_iso_2022)
5099 (encode_invocation_designation, encode_designation_at_bol)
5100 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
5101 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
5102 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
5103 (encode_coding_ccl, encode_coding_raw_text)
5104 (detect_coding_charset, decode_coding_charset)
5105 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
5106 (produce_composition, produce_charset, produce_annotation)
5107 (decode_coding, handle_composition_annotation)
5108 (handle_charset_annotation, consume_chars, decode_coding_gap)
5109 (decode_coding_object, encode_coding_object, detect_coding_system)
5110 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
5111 (code_convert_region, code_convert_string)
8f50130c
PE
5112 (Fdefine_coding_system_internal)
5113 (coding_set_source, coding_set_destination):
d311d28c
PE
5114 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5115 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
5116 (Fdefine_coding_system_internal):
5117 Don't assume fixnums fit in int.
5118 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 5119 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
5120 (Funencodable_char_position, Fcheck_coding_systems_region)
5121 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 5122 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 5123 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 5124 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 5125 Don't access memory outside of the args array.
d311d28c 5126 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
5127 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
5128 result of ENCODE_CHAR.
d311d28c
PE
5129 * coding.h: Adjust decls to match defn changes elsewhere.
5130 (struct coding_system):
5131 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5132 * composite.c (get_composition_id, find_composition)
5133 (run_composition_function, update_compositions)
5134 (compose_text, composition_gstring_put_cache)
5135 (composition_gstring_p, composition_gstring_width)
5136 (fill_gstring_header, fill_gstring_body, autocmp_chars)
5137 (composition_compute_stop_pos, composition_reseat_it)
5138 (composition_update_it, struct position_record)
5139 (find_automatic_composition, composition_adjust_point)
5140 (Fcomposition_get_gstring, Ffind_composition_internal):
5141 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5142 (update_compositions):
5143 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5144 * composite.h: Adjust decls to match defn changes elsewhere.
5145 (struct composition):
5146 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5147 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
5148 Do not attempt to compute the address of the object just before a
5149 buffer; this is not portable.
5150 (Faref, Faset):
5151 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5152 (Faset): Use int, not EMACS_INT, where int is wide enough.
5153 (Fstring_to_number): Don't assume fixnums fit in int.
5154 (Frem): Don't assume arg is nonnegative.
5155 * dbusbind.c (xd_append_arg): Check for integers out of range.
5156 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 5157 (extract_signed, extract_unsigned): New functions.
243e0530
PE
5158 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
5159 (xd_get_connection_references): Return ptrdiff_t, not int.
5160 All uses changed.
5161 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
5162 (xd_read_message_1):
5163 Use int, not unsigned, where the dbus API uses int.
5164 (Fdbus_message_internal): Don't overflow mtype.
5165 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
5166 * dired.c (directory_files_internal, file_name_completion, scmp)
5167 (file_name_completion_stat):
5168 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5169 (file_name_completion): Don't overflow matchcount.
5170 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
5171 * dispextern.h: Adjust decls to match defn changes elsewhere.
5172 (struct text_pos, struct glyph, struct bidi_saved_info)
5173 (struct bidi_string_data, struct bidi_it, struct composition_it)
5174 (struct it):
5175 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5176 (struct display_pos, struct composition_it, struct it):
5177 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5178 * dispnew.c (increment_matrix_positions)
5179 (increment_row_positions, mode_line_string)
5180 (marginal_area_string):
5181 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 5182 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
5183 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5184 (duration_to_sec_usec): New function, to check for overflow better.
5185 (Fsleep_for, sit_for): Use it.
5186 * doc.c (get_doc_string, store_function_docstring):
5187 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5188 (get_doc_string, Fsnarf_documentation):
5189 Use int, not EMACS_INT, where int is wide enough.
5190 (get_doc_string):
5191 Use SAFE_ALLOCA, not alloca.
5192 Check for overflow when converting EMACS_INT to off_t.
5193 * doprnt.c (doprnt):
5194 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5195 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
5196 Don't assume uid_t fits into fixnum.
5197 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
5198 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
5199 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
5200 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
5201 (general_insert_function)
5202 (Finsert_char, make_buffer_string, make_buffer_string_both)
5203 (update_buffer_properties, Fbuffer_substring)
5204 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
5205 (Fsubst_char_in_region, check_translation)
5206 (Ftranslate_region_internal, save_restriction_restore, Fformat)
5207 (transpose_markers, Ftranspose_regions):
5208 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5209 (clip_to_bounds): Move to lisp.h as an inline function).
5210 (Fconstrain_to_field): Don't assume integers are nonnegative.
5211 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
5212 (Fsubst_char_in_region, Fsave_restriction):
5213 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5214 (Femacs_pid): Don't assume pid_t fits into fixnum.
5215 (lo_time): Use int, not EMACS_INT, when int suffices.
5216 (lisp_time_argument): Check for usec out of range.
5217 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
5218 (Fuser_login_name, Fuser_full_name): Signal an error
5219 if a uid argument is out of range, rather than relying on
5220 undefined behavior.
c8d5c857
PE
5221 (Fformat_time_string): Remove now-unnecessary check.
5222 lisp_time_argument checks for out-of-range usec now.
243e0530 5223 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
5224 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
5225 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
5226 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
5227 (init_cmdargs, Fdump_emacs):
5228 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5229 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
5230 the bottom (typically) 32 bits of the fixnum.
5231 * eval.c (specpdl_size, call_debugger):
5232 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5233 (when_entered_debugger, Fbacktrace_debug):
5234 Don't assume fixnum can fit in int.
5235 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
5236 the object just before a buffer; this is not portable.
5237 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
5238 (grow_specpdl, unbind_to):
5239 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5240 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
5241 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 5242 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
5243 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
5244 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
5245 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5246 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
5247 (a_write, e_write):
5248 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5249 (Fcopy_file, non_regular_nbytes, read_non_regular)
5250 (Finsert_file_contents):
5251 Use int, not EMACS_INT, where int is wide enough.
5252 (READ_BUF_SIZE): Verify that it fits in int.
5253 (Finsert_file_contents): Check that counts are in proper range,
5254 rather than assuming fixnums fit into ptrdiff_t etc.
5255 Don't assume fixnums fit into int.
125b3835 5256 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
5257 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
5258 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
5259 (string_char_to_byte, string_byte_to_char)
5260 (string_make_multibyte, string_to_multibyte)
5261 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
5262 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
5263 (substring_both, Fdelete, internal_equal, Ffillarray)
5264 (Fclear_string, mapcar1)
5265 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
5266 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
5267 (larger_vector, make_hash_table, maybe_resize_hash_table)
5268 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
5269 (Fmaphash, secure_hash):
5270 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5271 (concat): Check for string index and length overflow.
5272 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
5273 (Frequire):
5274 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5275 (larger_vector): New API (vec, incr_min, size_max) replaces old
5276 one (vec, new_size, init). This catches size overflow.
5277 INIT was removed because it was always Qnil.
5278 All callers changed.
5279 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
5280 the upper bound on a hash table index size.
5281 (make_hash_table, maybe_resize_hash_table): Use it.
5282 (secure_hash): Computer start_byte and end_byte only after
5283 they're known to be in ptrdiff_t range.
5284 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
5285 (Ffont_get_glyphs, Ffont_at):
5286 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5287 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
5288 (Flist_fonts, Fopen_font):
5289 Don't assume fixnum can fit in int.
5290 (check_gstring): Don't assume index can fit in int.
5291 (font_match_p): Check that fixnum is a character, not a nonnegative
5292 fixnum, since the later code needs to stuff it into an int.
5293 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
5294 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
5295 conversion overflow issues.
5296 (Fopen_font): Check for integer out of range.
5297 (Ffont_get_glyphs): Don't assume index can fit in int.
5298 * font.h: Adjust decls to match defn changes elsewhere.
5299 * fontset.c (reorder_font_vector): Redo score calculation to avoid
5300 integer overflow.
5301 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
5302 printmax_t, where ptrdiff_t is wide enough.
5303 (Finternal_char_font):
5304 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5305 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
5306 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
5307 (Fset_frame_position, x_set_frame_parameters)
5308 (x_set_line_spacing, x_set_border_width)
5309 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
5310 Check that fixnums are in proper range for system types.
5311 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
5312 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5313 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
5314 Use SAFE_ALLOCA_LISP, not alloca.
5315 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
5316 intptr_t is wide enough.
5317 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
5318 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
5319 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
5320 Check for fixnum out of range.
5321 * ftfont.c (ftfont_list): Don't assume index fits in int.
5322 Check that fixnums are in proper range for system types.
5323 (ftfont_shape_by_flt):
5324 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
5325 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
5326 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5327 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
5328 Check that fixnums are in proper range for system types.
5329 * gnutls.h: Adjust decls to match defn changes elsewhere.
5330 * gtkutil.c (xg_dialog_run):
5331 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5332 (update_frame_tool_bar):
5333 Check that fixnums are in proper range for system types.
5334 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 5335 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
5336 * indent.c (last_known_column, last_known_column_point):
5337 (current_column_bol_cache):
5338 (skip_invisible, current_column, check_display_width):
5339 (check_display_width, scan_for_column, current_column_1)
5340 (Findent_to, Fcurrent_indentation, position_indentation)
5341 (indented_beyond_p, Fmove_to_column, compute_motion):
5342 (Fcompute_motion, Fvertical_motion):
5343 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5344 (last_known_column_modified): Use EMACS_INT, not int.
5345 (check_display_width):
5346 (Fcompute_motion):
5347 Check that fixnums and floats are in proper range for system types.
5348 (compute_motion): Don't assume index or fixnum fits in int.
5349 (compute_motion, Fcompute_motion):
5350 Use int, not EMACS_INT, when it is wide enough.
5351 (vmotion): Omit local var start_hpos that is always 0; that way
5352 we don't need to worry about overflow in expressions involving it.
5353 * indent.h: Adjust decls to match defn changes elsewhere.
5354 (struct position):
5355 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5356 Use int, not EMACS_INT, where int is wide enough.
5357 Remove unused members ovstring_chars_done and tab_offset;
5358 all uses removed.
5359 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
5360 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
5361 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
5362 (make_gap, copy_text, insert, insert_and_inherit)
5363 (insert_before_markers, insert_before_markers_and_inherit)
5364 (insert_1, count_combining_before, count_combining_after)
5365 (insert_1_both, insert_from_string)
5366 (insert_from_string_before_markers, insert_from_string_1)
5367 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
5368 (adjust_after_replace, adjust_after_insert, replace_range)
5369 (replace_range_2, del_range, del_range_1, del_range_byte)
5370 (del_range_both, del_range_2, modify_region)
5371 (prepare_to_modify_buffer, signal_before_change)
5372 (signal_after_change, Fcombine_after_change_execute):
5373 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5374 * intervals.c (traverse_intervals, rotate_right, rotate_left)
5375 (balance_an_interval, split_interval_right, split_interval_left)
5376 (find_interval, next_interval, update_interval)
5377 (adjust_intervals_for_insertion, delete_node, delete_interval)
5378 (interval_deletion_adjustment, adjust_intervals_for_deletion)
5379 (static_offset_intervals, offset_intervals)
5380 (merge_interval_right, merge_interval_left, make_new_interval)
5381 (graft_intervals_into_buffer, temp_set_point_both)
5382 (temp_set_point, set_point, adjust_for_invis_intang)
5383 (set_point_both, move_if_not_intangible, get_property_and_range)
5384 (get_local_map, copy_intervals, copy_intervals_to_string)
5385 (compare_string_intervals, set_intervals_multibyte_1):
5386 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5387 * intervals.h: Adjust decls to match defn changes elsewhere.
5388 (struct interval):
5389 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5390 * keyboard.c (this_command_key_count, this_single_command_key_start)
5391 (before_command_key_count, before_command_echo_length, echo_now)
5392 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
5393 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
5394 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
5395 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
5396 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5397 (last_non_minibuf_size, last_point_position, echo_truncate)
5398 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
5399 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
5400 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
5401 (stuff_buffered_input):
5402 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5403 (last_auto_save, command_loop_1, read_char):
5404 Use EMACS_INT, not int, to avoid integer overflow.
5405 (record_char): Avoid overflow in total_keys computation.
5406 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
5407 * keyboard.h: Adjust decls to match defn changes elsewhere.
5408 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
5409 (Fkey_description, Fdescribe_vector, Flookup_key):
5410 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5411 (click_position): New function, to check that positions are in range.
5412 (Fcurrent_active_maps):
5413 (describe_command):
5414 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5415 (Faccessible_keymaps, Fkey_description):
5416 (preferred_sequence_p):
5417 Don't assume fixnum can fit into int.
5418 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
5419 Check for integer overflow in size calculations.
5420 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
5421 avoid mishandling large integers.
5422 * lisp.h: Adjust decls to match defn changes elsewhere.
5423 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
5424 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
5425 (struct Lisp_Marker):
5426 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5427 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
5428 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
5429 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
5430 All callers changed.
5431 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
5432 Assume the arg has valid form, since it always does.
5433 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
5434 unsigned integer system type.
5435 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
5436 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
5437 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5438 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
5439 (duration_to_sec_usec): New decl.
5440 * lread.c (read_from_string_index, read_from_string_index_byte)
5441 (read_from_string_limit, readchar, unreadchar, openp)
5442 (read_internal_start, read1, oblookup):
5443 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5444 (Fload, readevalloop, Feval_buffer, Feval_region):
5445 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5446 (openp): Check for out-of-range argument to 'access'.
5447 (read1): Use int, not EMACS_INT, where int is wide enough.
5448 Don't assume fixnum fits into int.
6efdadfd 5449 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
5450 (read_filtered_event): Use duration_to_sec_usec
5451 to do proper overflow checking on durations.
d311d28c
PE
5452 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
5453 in size calculation.
5454 (Fexecute_kbd_macro):
5455 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5456 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
5457 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
5458 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
5459 (set_marker_both, set_marker_restricted_both, marker_position)
5460 (marker_byte_position, Fbuffer_has_markers_at):
5461 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5462 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 5463 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
5464 It now merely ensures that the menu is large enough, without
5465 necessarily growing it, as this avoids some integer overflow issues.
5466 All callers changed.
5467 (keymap_panes, parse_single_submenu, Fx_popup_menu):
5468 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5469 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
5470 Use SAFE_ALLOCA_LISP, not alloca.
5471 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
5472 to EMACS_INT. Check that fixnums are in proper range for system types.
5473 * minibuf.c (minibuf_prompt_width, string_to_object)
5474 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
5475 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
5476 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5477 (get_minibuffer, read_minibuf_unwind):
5478 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5479 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
5480 this simplifies overflow checking. All callers changed.
5481 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
5482 (Ftest_completion):
5483 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5484 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
5485 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
5486 Check that fixnums are in proper range for system types.
5487 (Fx_create_frame, Fx_show_tip):
5488 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5489 * nsfont.m (ns_findfonts, nsfont_list_family):
5490 Don't assume fixnum fits in long.
5491 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
5492 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5493 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
5494 wide enough.
17fdb222 5495 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
5496 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5497 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
5498 (PRINTDECLARE, PRINTPREPARE):
5499 (strout, print_string):
5500 (print, print_preprocess, print_check_string_charset_prop)
5501 (print_object):
5502 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5503 (PRINTDECLARE):
5504 (temp_output_buffer_setup, Fprin1_to_string, print_object):
5505 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5506 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 5507 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 5508 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
5509 (print_error_message): Use SAFE_ALLOCA, not alloca.
5510 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
5511 (print_depth, new_backquote_output, print_number_index):
5512 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
5513 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
5514 (Fset_process_window_size, Fformat_network_address)
5515 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 5516 (sigchld_handler):
d311d28c 5517 Check that fixnums are in proper range for system types.
d44287d4 5518 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
5519 Check for process-ids out of pid_t range rather than relying on
5520 undefined behavior.
e4d81efc 5521 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
5522 (Fformat_network_address, read_process_output, send_process)
5523 (Fprocess_send_region, status_notify):
5524 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5525 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
5526 (wait_reading_process_output, read_process_output, exec_sentinel):
5527 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5528 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
5529 (Faccept_process_output): Use duration_to_sec_usec to do proper
5530 overflow checking on durations.
dde14581
PE
5531 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
5532 Don't assume pid_t fits in int.
02481186
PE
5533 * process.h (struct Lisp_Process): Members tick and update_tick
5534 are now of type EMACS_INT, not int.
b62b53e8
PE
5535 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
5536 configured --with-wide-int.
d311d28c
PE
5537 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
5538 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
5539 * search.c (looking_at_1, string_match_1):
5540 (fast_string_match, fast_c_string_match_ignore_case)
5541 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
5542 (scan_newline, find_before_next_newline, search_command)
5543 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
5544 (set_search_regs, wordify):
5545 (Freplace_match):
5546 (Fmatch_data):
5547 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5548 (string_match_1, search_buffer, set_search_regs):
5549 (Fmatch_data):
5550 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5551 (wordify): Check for overflow in size calculation.
5552 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
5553 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
5554 Check that fixnums are in proper range for system types.
5555 * sound.c (struct sound_device)
5556 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
5557 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5558 (Fplay_sound_internal):
5559 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 5560 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
5561 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
5562 (Fparse_partial_sexp):
5563 Don't assume fixnums can fit in int.
5564 (struct lisp_parse_state, find_start_pos, find_start_value)
5565 (find_start_value_byte, find_start_begv)
5566 (update_syntax_table, char_quoted, dec_bytepos)
5567 (find_defun_start, prev_char_comend_first, back_comment):
5568 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
5569 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
5570 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5571 (Finternal_describe_syntax_value): Check that match_lisp is a
5572 character, not an integer, since the code stuffs it into int.
5573 (scan_words, scan_sexps_forward):
5574 Check that fixnums are in proper range for system types.
5575 (Fforward_word):
5576 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5577 (scan_sexps_forward):
5578 Use CHARACTERP, not INTEGERP, since the value must fit into int.
5579 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
5580 * syntax.h: Adjust decls to match defn changes elsewhere.
5581 (struct gl_state_s):
5582 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
5583 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
5584 MOST_POSITIVE_FIXNUM.
d311d28c
PE
5585 * sysdep.c (wait_for_termination_1, wait_for_termination)
5586 (interruptible_wait_for_termination, mkdir):
5587 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
5588 (emacs_read, emacs_write):
5589 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
5590 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
5591 and double all fit in int.
d311d28c
PE
5592 * term.c (set_tty_color_mode):
5593 Check that fixnums are in proper range for system types.
5594 * termhooks.h (struct input_event):
5595 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5596 * textprop.c (validate_interval_range, interval_of)
5597 (Fadd_text_properties, set_text_properties_1)
5598 (Fremove_text_properties, Fremove_list_of_text_properties)
5599 (Ftext_property_any, Ftext_property_not_all)
5600 (copy_text_properties, text_property_list, extend_property_ranges)
5601 (verify_interval_modification):
5602 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5603 (Fnext_single_char_property_change)
5604 (Fprevious_single_char_property_change):
5605 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
5606 (copy_text_properties):
5607 Check for integer overflow in index calculation.
d311d28c
PE
5608 * undo.c (last_boundary_position, record_point, record_insert)
5609 (record_delete, record_marker_adjustment, record_change)
5610 (record_property_change):
5611 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5612 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
5613 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5614 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
5615 (Fx_hide_tip, Fx_file_dialog):
5616 * w32menu.c (set_frame_menubar):
5617 Use ptrdiff_t, not int, for consistency with rest of code.
5618 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
5619 (select_window, Fdelete_other_windows_internal)
5620 (window_scroll_pixel_based, window_scroll_line_based)
5621 (Frecenter, Fset_window_configuration):
5622 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5623 (Fset_window_hscroll, run_window_configuration_change_hook)
5624 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 5625 (Fscroll_other_window, Frecenter):
d311d28c
PE
5626 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5627 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
5628 Don't assume fixnum fits in int.
5629 (Fset_window_scroll_bars):
5630 Check that fixnums are in proper range for system types.
5631 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
5632 (string_pos, c_string_pos, number_of_chars, init_iterator)
5633 (in_ellipses_for_invisible_text_p, init_from_display_pos)
5634 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
5635 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
5636 (face_before_or_after_it_pos, handle_invisible_prop)
5637 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
5638 (display_prop_intangible_p, string_buffer_position_lim)
5639 (string_buffer_position, handle_composition_prop, load_overlay_strings)
5640 (get_overlay_strings_1, get_overlay_strings)
5641 (iterate_out_of_display_property, forward_to_next_line_start)
5642 (back_to_previous_visible_line_start, reseat, reseat_to_string)
5643 (get_next_display_element, set_iterator_to_next)
5644 (get_visually_first_element, compute_stop_pos_backwards)
5645 (handle_stop_backwards, next_element_from_buffer)
5646 (move_it_in_display_line_to, move_it_in_display_line)
5647 (move_it_to, move_it_vertically_backward, move_it_by_lines)
5648 (add_to_log, message_dolog, message_log_check_duplicate)
5649 (message2, message2_nolog, message3, message3_nolog
5650 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
5651 (current_message_1, truncate_echo_area, truncate_message_1)
5652 (set_message, set_message_1, store_mode_line_noprop)
5653 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
5654 (text_outside_line_unchanged_p, check_point_in_composition)
5655 (reconsider_clip_changes)
5656 (redisplay_internal, set_cursor_from_row, try_scrolling)
5657 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
5658 (redisplay_window, find_last_unchanged_at_beg_row)
5659 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
5660 (trailing_whitespace_p, find_row_edges, display_line)
5661 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
5662 (display_mode_element, store_mode_line_string)
5663 (pint2str, pint2hrstr, decode_mode_spec)
5664 (display_count_lines, display_string, draw_glyphs)
5665 (x_produce_glyphs, x_insert_glyphs)
5666 (rows_from_pos_range, mouse_face_from_buffer_pos)
5667 (fast_find_string_pos, mouse_face_from_string_pos)
5668 (note_mode_line_or_margin_highlight, note_mouse_highlight):
5669 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5670 (safe_call, init_from_display_pos, handle_fontified_prop)
5671 (handle_single_display_spec, load_overlay_strings)
5672 (with_echo_area_buffer, setup_echo_area_for_printing)
5673 (display_echo_area, echo_area_display)
5674 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
5675 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
5676 (redisplay_window, dump_glyph_row, display_mode_line)
5677 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 5678 (handle_display_spec, display_prop_string_p):
d311d28c
PE
5679 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5680 (handle_single_display_spec, build_desired_tool_bar_string)
5681 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
5682 (get_specified_cursor_type):
5683 Check that fixnums are in proper range for system types.
5684 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
5685 (Flookup_image_map):
5686 Don't assume fixnums fit in int.
5687 (compare_overlay_entries):
5688 Avoid mishandling comparisons due to subtraction overflow.
5689 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
5690 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
5691 (handle_tool_bar_click):
5692 Use int, not unsigned, since we prefer signed and the signedness
5693 doesn't matter here.
5694 (get_next_display_element, next_element_from_display_vector):
5695 Use int, not EMACS_INT, when int is wide enough.
5696 (start_hourglass): Use duration_to_sec_usec to do proper
5697 overflow checking on durations.
5698 * xfaces.c (Fbitmap_spec_p):
5699 Check that fixnums are in proper range for system types.
5700 (compare_fonts_by_sort_order):
5701 Avoid mishandling comparisons due to subtraction overflow.
5702 (Fx_family_fonts, realize_basic_faces):
5703 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5704 (Fx_family_fonts):
5705 Don't assume fixnum fits in int.
5706 Use SAFE_ALLOCA_LISP, not alloca.
5707 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
5708 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
5709 (face_at_buffer_position, face_for_overlay_string)
5710 (face_at_string_position):
5711 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5712 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
5713 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
5714 (Fx_show_tip):
5715 Check that fixnums are in proper range for system types.
5716 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
5717 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
5718 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5719 (Fx_change_window_property): Don't assume fixnums fit in int.
5720 * xfont.c (xfont_chars_supported):
5721 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5722 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
5723 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
5724 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5725 * xml.c (parse_region):
5726 * xrdb.c (magic_file_p):
5727 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5728 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
5729 (x_get_local_selection, x_reply_selection_request)
5730 (x_handle_selection_request, wait_for_property_change):
5731 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5732 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
5733 short is wide enough.
5734 (x_send_client_event): Don't assume fixnum fits in int.
5735 * xterm.c (x_x_to_emacs_modifiers):
5736 Don't assume EMACS_INT overflows nicely into int.
5737 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
5738 may come from Lisp.
5739 (handle_one_xevent): NATNUMP can eval its arg twice.
5740 (x_connection_closed):
5741 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5742 * xterm.h: Adjust decls to match defn changes elsewhere.
5743 (struct scroll_bar): Use struct vectorlike_header
5744 rather than rolling our own approximation.
5745 (SCROLL_BAR_VEC_SIZE): Remove; not used.
5746
c6574eb5
GM
57472012-05-25 Glenn Morris <rgm@gnu.org>
5748
5749 * lisp.mk (lisp): Update for more files being compiled now.
5750
e8d32c7e
SM
57512012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
5752
48def666
SM
5753 * lread.c: Remove `read_pure' which makes no difference.
5754 (read_pure): Remove var.
5755 (unreadpure): Remove function.
5756 (readevalloop): Don't call read_list with -1 flag.
5757 (read1, read_vector): Don't test read_pure any more.
5758 (read_list): Simplify.
5759
e8d32c7e
SM
5760 * fileio.c, character.h: Minor style tweaks.
5761
4b2addb7
DA
57622012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
5763
5764 * window.h (clip_changed): Remove useless declaration.
5765
584461b2
JB
57662012-05-22 Juanma Barranquero <lekktu@gmail.com>
5767
5768 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
5769 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
5770
34374650
PE
57712012-05-22 Paul Eggert <eggert@cs.ucla.edu>
5772
5773 Remove src/m/*.
5774 This directory predates autoconf and is no longer needed nowadays.
5775 Move its few remaining bits of functionality to where they're needed.
5776 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
5777 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
5778 * m/template.h: Remove.
5779 * Makefile.in (M_FILE): Remove. All uses removed.
5780 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
5781 * lisp.h (USE_LSB_TAG):
5782 * mem-limits.h (EXCEEDS_LISP_PTR):
5783 Use VAL_MAX, not VALBITS, in #if.
5784 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
5785 (EMACS_UINT): Define unconditionally now.
5786 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
5787 (BITS_PER_EMACS_INT): New constants, replacing
5788 what used to be in config.h, but not useful in #if.
5789 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
5790 define them any more.
5791 (VAL_MAX): New macro.
5792 (VALMASK): Use it.
5793 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
5794 BITS_PER_EMACS_INT, in #if.
5795 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
5796 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
5797 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
5798 * s/ms-w32.h (DATA_START):
5799 Move here from removed file m/intel386.h.
5800 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
5801 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
5802
261cb4bb
PE
58032012-05-21 Paul Eggert <eggert@cs.ucla.edu>
5804
5805 Assume C89 or later.
5806 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
5807 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
5808 (xrealloc):
5809 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
5810 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
5811 * textprop.c, tparam.c (NULL): Remove.
5812 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
5813 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
5814 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
5815 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
5816 * xterm.c (input_signal_count): Assume volatile works.
5817
ff23cd9f
KB
58182012-05-21 Ken Brown <kbrown@cornell.edu>
5819
5820 * xgselect.c (xg_select): Fix first argument in call to 'select'
5821 (bug#11508).
5822
1b170bc6
KB
58232012-05-20 Ken Brown <kbrown@cornell.edu>
5824
5825 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 5826 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 5827
b2f4d39f
KB
58282012-05-19 Ken Brown <kbrown@cornell.edu>
5829
5830 * xfns.c (x_in_use): Remove `static' qualifier.
5831 * xterm.h (x_in_use): Declare.
5832 * xgselect.c: Include xterm.h.
5833 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
5834 and `display_arg' (bug#9754).
5835
003fdae2
PE
58362012-05-19 Paul Eggert <eggert@cs.ucla.edu>
5837
9232a6d9
PE
5838 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
5839
003fdae2
PE
5840 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
5841 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
5842
784b56e2
EZ
58432012-05-18 Eli Zaretskii <eliz@gnu.org>
5844
5845 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
5846
5847 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 5848 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
5849
5850 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
5851 reference to image_cache->refcount.
5852 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
5853
a0a79cde
JL
58542012-05-17 Juri Linkov <juri@jurta.org>
5855
5856 * search.c (Fword_search_regexp, Fword_search_backward)
5857 (Fword_search_forward, Fword_search_backward_lax)
5858 (Fword_search_forward_lax): Move functions to isearch.el
5859 (bug#10145, bug#11381).
5860
b0572523
PE
58612012-05-16 Paul Eggert <eggert@cs.ucla.edu>
5862
5863 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
5864
9660f5fc
SM
58652012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
5866
5867 * lread.c (init_obarray): Declare Qt and Qnil as special.
5868
4374de83
GM
58692012-05-14 Glenn Morris <rgm@gnu.org>
5870
5871 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 5872 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 5873
dc44c39a
PE
58742012-05-14 Paul Eggert <eggert@cs.ucla.edu>
5875
078c97cb
PE
5876 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
5877
dc44c39a
PE
5878 * unexaix.c: Port to more-recent AIX compilers.
5879 (report_error, report_error_1, make_hdr, copy_sym)
5880 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
5881 Make arguments const char *, not char *, to avoid violations of C
5882 standard and to fix some AIX warnings reported by Gilles Pion.
5883
e18afed7 58842012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
5885
5886 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
5887 already have overlays loaded.
5888 (handle_single_display_spec): Before returning without displaying
5889 fringe bitmap, synchronize the bidi iterator with the main display
5890 iterator, by calling iterate_out_of_display_property.
5891 (iterate_out_of_display_property): Detect buffer iteration by
5892 testing that it->string is a Lisp string.
5893 (get_next_display_element): When the current object is exhausted,
5894 and there's something on it->stack, call set_iterator_to_next to
5895 proceed with what's on the stack, instead of returning zero.
5896 (set_iterator_to_next): If called at the end of a Lisp string,
5897 proceed to consider_string_end without incrementing string
5898 position. Don't increment display vector index past the end of
5899 the display vector. (Bug#11417)
c8fb9dc6
EZ
5900 (pos_visible_p): Don't report a position visible when move_it_to
5901 stopped at the last line of window, which happens to be scanned
5902 backwards by the bidi iteration. (Bug#11464)
ac268e67 5903
e18afed7 59042012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
5905
5906 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
5907 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
5908 are on a TTY, and thus unable to display on the fringes.
5909 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
5910 so we need to signal to the caller that this is a "replacing"
5911 display spec. This fixes display when the spec is invalid or we
5912 are on a TTY.
5913
e18afed7 59142012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
5915
5916 * unexaix.c (make_hdr): Fix typo in prototype.
5917 This bug broke the build on AIX. Problem reported by Gilles Pion.
5918
9d0a235a
MA
59192012-05-14 Michael Albinus <michael.albinus@gmx.de>
5920
5921 * keyboard.c (kbd_buffer_get_event): Read special events also in
5922 batch mode. (Bug#11415)
5923
9e6b06ed
GM
59242012-05-12 Glenn Morris <rgm@gnu.org>
5925
5926 * ns.mk: Update for ns_appbindir no longer having trailing "/".
5927
c1a1d7a3
EZ
59282012-05-12 Eli Zaretskii <eliz@gnu.org>
5929
5930 * lisp.mk (lisp): Add newcomment.elc.
5931
3fe7cdc8
GM
59322012-05-12 Glenn Morris <rgm@gnu.org>
5933
5934 * Makefile.in (MKDIR_P): New, set by configure.
5935 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
5936
53f7d2c0
PE
59372012-05-11 Paul Eggert <eggert@cs.ucla.edu>
5938
5939 Remove unused function hourglass_started.
5940 * dispextern.h (hourglass_started):
5941 * w32fns.c (hourglass_started):
5942 * xdisp.c (hourglass_started): Remove.
5943
75aafb17
JB
59442012-05-10 Juanma Barranquero <lekktu@gmail.com>
5945
5946 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
5947 Update dependencies.
5948
12959e8e
PE
59492012-05-10 Paul Eggert <eggert@cs.ucla.edu>
5950
97107e2e
PE
5951 * xgselect.c (xg_select): Put maxfds+1 into a var.
5952 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
5953
12959e8e
PE
5954 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
5955
836d29b3
DA
59562012-05-10 Dave Abrahams <dave@boostpro.com>
5957
5958 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
5959 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
5960
5cb67954
MA
59612012-05-09 Michael Albinus <michael.albinus@gmx.de>
5962
5963 * dbusbind.c (xd_registered_buses): New internal Lisp object.
5964 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
5965 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
5966 Initialize xd_registered_buses.
5967
3478ec45
PE
59682012-05-09 Paul Eggert <eggert@cs.ucla.edu>
5969
b263a6b0
PE
5970 Untag more efficiently if USE_LSB_TAG.
5971 This is based on a proposal by YAMAMOTO Mitsuharu in
5972 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
5973 For an admittedly artificial (nth 8000 longlist) benchmark on
5974 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
5975 Emacs's overall text size by 1%.
5976 * lisp.h (XUNTAG): New macro.
5977 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
5978 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
5979 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
5980 * eval.c (Fautoload):
5981 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
5982 * frame.h (XFRAME): Use XUNTAG.
5983
3478ec45
PE
5984 Port recent dbusbind.c changes to 32-bit --with-wide-int.
5985 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
5986 Remove unportable assumptions about print widths of types like
5987 dbus_uint32_t.
5988 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
5989 intptr_t when converting between pointer and integer, to avoid GCC
5990 warnings about wrong width.
5991
666b903b 59922012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
5993
5994 * w32proc.c (new_child): Force Windows to reserve only 64KB of
5995 stack for each reader_thread, instead of defaulting to 8MB
5996 determined by the linker. This avoids failures in creating
5997 subprocesses on Windows 7, see the discussion in this thread:
5998 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
5999
b120cc17
JC
60002012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
6001
6002 Fix up display of the *Minibuf-0* buffer in the mini window.
6003 * keyboard.c (read_char): Don't clear the echo area if there's no
6004 message to clear.
6005 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 6006 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 6007
9a4b36f8
MA
60082012-05-07 Michael Albinus <michael.albinus@gmx.de>
6009
6010 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
6011 batch mode.
6012
e5f9458f
CY
60132012-05-06 Chong Yidong <cyd@gnu.org>
6014
6015 * lisp.mk (lisp): Update.
6016
eceeb5fc 60172012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
6018
6019 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
6020
71873e2b
SM
60212012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
6022
6023 * data.c (PUT_ERROR): New macro.
6024 (syms_of_data): Use it. Add new error type `user-error'.
6025 * undo.c (user_error): New function.
6026 (Fprimitive_undo): Use it.
6027 * print.c (print_error_message): Adjust print style for `user-error'.
6028 * keyboard.c (user_error): New function.
6029 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
6030
ab0fa4e4
PE
60312012-05-03 Paul Eggert <eggert@cs.ucla.edu>
6032
6033 Do not limit current-time-string to years 1000..9999.
6034 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
6035 (Fcurrent_time_string): Support any year that is supported by the
6036 underlying localtime representation. Don't use asctime, as it
6037 has undefined behavior for years outside the range -999..9999.
6038
7ed806a7
PE
60392012-05-02 Paul Eggert <eggert@cs.ucla.edu>
6040
6041 Fix race conditions involving setenv, gmtime, localtime, asctime.
6042 Without this fix, interrupts could mess up code that uses these
6043 nonreentrant functions, since setting TZ invalidates existing
6044 tm_zone or tzname values, and since most of these functions return
6045 pointers to static storage.
6046 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
6047 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
6048 Grow the critical sections to include not just invoking
6049 localtime/gmtime, but also accessing these functions' results
6050 including their tm_zone values if any, and any related TZ setting.
6051 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
6052 so that the struct tm is saved in the critical section.
6053 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
6054 motivated by the fact that memory allocation needs to be outside
6055 the critical section.
6056
0c16dfed
DA
60572012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
6058
6059 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
6060 with RESET_INTERVAL.
6061
6062 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
6063 Remove duplicated buffer name initialization.
6064
3f83ace8
JM
60652012-05-02 Jim Meyering <jim@meyering.net>
6066
6067 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
6068
c7b8541e
JM
6069 * xfns.c (x_window): Use xstrdup (Bug#11375).
6070
90207a15 60712012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
6072
6073 * xdisp.c (pos_visible_p): If already at a newline from the
6074 display string before the 'while' loop, don't walk back the glyphs
6075 from it3.glyph_row. Solves assertion violation when the display
6076 string begins with a newline (egg.el). (Bug#11367)
6077
b593d6a9
AH
60782012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
6079
6080 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
6081 Move to simple.el.
6082
4737362e
GM
60832012-05-01 Glenn Morris <rgm@gnu.org>
6084
99cf43f9
GM
6085 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
6086 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
6087 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
6088 All were removed before 23.1.
6089
9311dcff
GM
6090 * dispnew.c: Remove HAVE_LIBNCURSES test;
6091 it is always true on relevant platforms.
6092
4d5c6349
GM
6093 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
6094 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
6095
4737362e
GM
6096 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
6097
74dd3a6b
AS
60982012-04-30 Andreas Schwab <schwab@linux-m68k.org>
6099
6100 * .gdbinit (xpr): Remove checks for no longer existing misc types.
6101 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
6102 Remove.
6103
13c379ee
PE
61042012-04-28 Paul Eggert <eggert@cs.ucla.edu>
6105
6106 Do not avoid creating empty evaporating overlays (Bug#9642).
6107 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
6108 That is, do not delete an evaporating overlay if it becomes
6109 empty after its bounds are adjusted to fit within its buffer.
6110 This fix caused other problems, and I'm reverting it until we get
6111 to the bottom of them.
6112
a8e7d6d7 61132012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
6114
6115 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
6116
a8e7d6d7 61172012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
6118
6119 * xdisp.c (pos_visible_p): If the window start position is beyond
6120 ZV, start the display from buffer beginning. Prevents assertion
6121 violation in init_iterator when the minibuffer window is scrolled
6122 via the scroll bar.
6123
6124 * window.c (window_scroll_pixel_based): Likewise.
6125
a8e7d6d7 61262012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
6127
6128 * keymap.c (where_is_internal): Doc fix (Bug#10872).
6129
a8e7d6d7 61302012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
6131
6132 * fileio.c (Fcopy_file, Fset_file_selinux_context):
6133 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
6134
a8e7d6d7 61352012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 6136
b593d6a9
AH
6137 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
6138 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 6139
1c6900d9
EZ
61402012-04-26 Eli Zaretskii <eliz@gnu.org>
6141
4c3fa1d9
EZ
6142 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
6143 display element, check also the underlying string or buffer
6144 character. (Bug#11341)
6145
1c6900d9
EZ
6146 * w32menu.c: Include w32heap.h.
6147 (add_menu_item): If the call to AppendMenuW (via
6148 unicode_append_menu) fails, disable Unicode menus only if we are
6149 running on Windows 9X/Me.
6150
42bf8205
AS
61512012-04-24 Andreas Schwab <schwab@linux-m68k.org>
6152
6153 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
6154 (xgetint): Add missing shift for LSB tags.
6155
b1bac16e
MR
61562012-04-24 Martin Rudalics <rudalics@gmx.at>
6157
6158 * keyboard.c (read_char): Don't wipe echo area for select window
6159 events: These might get delayed via `mouse-autoselect-window'
6160 (Bug#11304).
6161
d69621cc
JB
61622012-04-24 Juanma Barranquero <lekktu@gmail.com>
6163
6164 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
6165 manipulation of :loaded-from data.
6166
02fd101b
JB
61672012-04-23 Juanma Barranquero <lekktu@gmail.com>
6168
6169 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
6170 now a cons (bug#11311).
6171
888bec30
PE
61722012-04-23 Paul Eggert <eggert@cs.ucla.edu>
6173
89a438bd
PE
6174 Do not create empty overlays with the evaporate property (Bug#9642).
6175 * buffer.c (Fmove_overlay): Delete an evaporating overlay
6176 if it becomes empty after its bounds are adjusted to fit within
6177 its buffer. Without this fix, in a nonempty buffer (let ((o
6178 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
6179 yields an empty overlay that has the evaporate property, which is
6180 not supposed to happen.
6181
1068fe4d
PE
6182 Fix minor GTK3 problems found by static checking.
6183 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6184 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6185 (struct _EmacsFixedClass, emacs_fixed_get_type):
6186 Move decls here from emacsgtkfixed.h, since they needn't be public.
6187 (emacs_fixed_get_type): Now static.
6188 (emacs_fixed_class_init): Omit unused local.
6189 (emacs_fixed_child_type): Remove; unused.
6190 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6191 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6192 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
6193 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
6194 (EMACS_FIXED_GET_CLASS): Remove; unused.
6195 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
6196
888bec30
PE
6197 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
6198 Problem reported by Juanma Barranquero for Windows -Wunused-function.
6199
de85e130
PE
62002012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6201
d0baac98 6202 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 6203 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
6204 (__malloc_size_t, __malloc_ptrdiff_t):
6205 Remove. All uses removed, replaced by the definiens if needed,
6206 since we can assume C89 or better now.
6207 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
6208 (protect_malloc_state, align, get_contiguous_space)
6209 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
6210 (malloc_atfork_handler_child, malloc_enable_thread)
6211 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
6212 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
6213 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
6214 (special_realloc, _realloc_internal_nolock, _realloc_internal)
6215 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
6216 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
6217 Define using prototypes, not old style.
6218 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
6219 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
6220 (align): Don't assume that signed integer overflow wraps around.
6221 Omit unused local var.
6222 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
6223 (_free_internal_nolock, memalign, mallochook, reallochook):
6224 Omit no-longer-needed casts.
6225 (valloc): Use getpagesize, not __getpagesize.
6226 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
6227 (struct hdr): The 'magic' member is now size_t, not unsigned long.
6228
de85e130
PE
6229 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
6230
dcbf5805
MA
62312012-04-22 Michael Albinus <michael.albinus@gmx.de>
6232
6233 Move functions from C to Lisp. Make non-blocking method calls
6234 the default. Implement further D-Bus standard interfaces.
6235
6236 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
6237 (QCdbus_request_name_allow_replacement)
6238 (QCdbus_request_name_replace_existing)
6239 (QCdbus_request_name_do_not_queue)
6240 (QCdbus_request_name_reply_primary_owner)
6241 (QCdbus_request_name_reply_in_queue)
6242 (QCdbus_request_name_reply_exists)
6243 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
6244 (QCdbus_registered_serial, QCdbus_registered_method)
6245 (QCdbus_registered_signal): New Lisp objects.
6246 (XD_DEBUG_MESSAGE): Use sizeof.
6247 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
6248 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
6249 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
6250 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
6251 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
6252 (xd_signature, xd_append_arg): Allow float for integer types.
6253 (xd_get_connection_references): New function.
b593d6a9
AH
6254 (xd_get_connection_address): Rename from xd_initialize.
6255 Return cached address.
dcbf5805
MA
6256 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
6257 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
6258 level.
6259 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 6260 Return number of refcounts.
dcbf5805
MA
6261 (Fdbus_get_unique_name): Make stronger parameter check.
6262 (Fdbus_message_internal): New defun.
6263 (Fdbus_call_method, Fdbus_call_method_asynchronously)
6264 (Fdbus_method_return_internal, Fdbus_method_error_internal)
6265 (Fdbus_send_signal, Fdbus_register_service)
6266 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
6267 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
6268 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
6269 (Vdbus_compiled_version, Vdbus_runtime_version)
6270 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
6271 (Vdbus_message_type_method_return, Vdbus_message_type_error)
6272 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
6273 (Vdbus_registered_buses, Vdbus_registered_objects_table):
6274 Adapt docstring.
dcbf5805 6275
52828e02
PE
62762012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6277
da05bc4c
PE
6278 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
6279 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
6280 Do not assume ptrdiff_t is the same width as 'int'.
6281
52828e02
PE
6282 * alloc.c: Handle unusual debugging option combinations.
6283 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
6284 since the two debugging options are incompatible.
6285 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
6286 is defined.
6287 (mem_init, mem_insert, mem_insert_fixup):
6288 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
6289 (NEED_MEM_INSERT): Remove; no longer needed.
6290
f01769f9
LL
62912012-04-22 Leo Liu <sdl.web@gmail.com>
6292
6293 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
6294
5790543d
PE
62952012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6296
6297 * sysdep.c [__FreeBSD__]: Minor cleanups.
6298 (list_system_processes, system_process_attributes) [__FreeBSD__]:
6299 Use Emacs indenting style more consistently. Avoid some casts.
6300 Use 'double' consistently rather than mixing 'float' and 'double'.
6301
b91b7e4d
EW
63022012-04-21 Eduard Wiebe <usenet@pusto.de>
6303
b593d6a9
AH
6304 * sysdep.c (list_system_processes, system_process_attributes):
6305 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 6306
6114eb15
AS
63072012-04-21 Andreas Schwab <schwab@linux-m68k.org>
6308
6309 * lisp.mk (lisp): Update.
6310
2f38dff7
PE
63112012-04-20 Paul Eggert <eggert@cs.ucla.edu>
6312
6313 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
6314 It is never used otherwise.
6315
4ae29f89
SM
63162012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
6317
6318 * print.c (print_preprocess): Only check print_depth if print-circle
6319 is nil.
6320 (print_object): Check for cycles even when print-circle is nil and
6321 print-gensym is t, but only check print_depth if print-circle is nil.
6322
f30d612a
CY
63232012-04-20 Chong Yidong <cyd@gnu.org>
6324
6325 * process.c (wait_reading_process_output): If EIO occurs on a pty,
6326 set the status to "failed" and ensure that sentinel is run.
6327
c07a4c0b 63282012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
6329
6330 * process.c (Fset_process_inherit_coding_system_flag)
6331 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 6332 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 6333
c07a4c0b 63342012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
6335
6336 * xdisp.c (string_buffer_position_lim): Limit starting position to
6337 BEGV.
6338 (set_cursor_from_row): If called for a mode-line or header-line
6339 row, return zero immediately.
6340 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
6341 farther than the first row after the header line, if any.
6342 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
6343 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
6344
c07a4c0b 63452012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 6346
4ae29f89
SM
6347 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
6348 (bug#11238).
ad3a2b41 6349
c07a4c0b 63502012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 63512012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
6352
6353 configure: new option --enable-gcc-warnings (Bug#11207)
6354 * Makefile.in (C_WARNINGS_SWITCH): Remove.
6355 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
6356 (ALL_CFLAGS): Use new macros rather than old.
6357 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
6358 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
6359 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
6360 -Wunused-result, -Wunused-variable. This should go away once
6361 the Emacs and Gnulib regex code is merged.
6362 (xmalloc, xrealloc): Now static.
6363
aba027e8
PE
63642012-04-17 Paul Eggert <eggert@cs.ucla.edu>
6365
6366 * dired.c (Fsystem_groups): Remove unused local.
6367
e5a36063
GM
63682012-04-17 Glenn Morris <rgm@gnu.org>
6369
6370 * dired.c (Fsystem_users): Doc fix.
6371
316411f0
DA
63722012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
6373
6374 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
6375 (syms_of_dired): Add them.
6376
9426aba4
PE
63772012-04-16 Paul Eggert <eggert@cs.ucla.edu>
6378
b62a57be
PE
6379 Fix minor alloc.c problems found by static checking.
6380 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
6381 New extern decls, to avoid calling undeclared functions.
6382 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
6383 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
6384 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
6385 (NEED_MEM_INSERT): New macro.
6386 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 6387 Remove one incorrect comment and fix another.
b62a57be 6388
3539f31f
PE
6389 Fix minor ralloc.c problems found by static checking.
6390 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6391 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
6392 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
6393 (r_alloc_sbrk): Now static.
6394
a041960a
PE
6395 Improve ralloc.c interface checking.
6396 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6397 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
6398 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
6399 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
6400 [REL_ALLOC]: ... to here, to check interface.
6401 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
6402 Remove decls. This fixes an "It stinks!".
6403
9426aba4
PE
6404 * alloc.c (which_symbols): Fix alignment issue / type clash.
6405
d55c12ed
AS
64062012-04-15 Andreas Schwab <schwab@linux-m68k.org>
6407
6408 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
6409 (struct Lisp_Misc_Any): Likewise.
6410 (struct Lisp_Free): Likewise.
6411 * alloc.c (union aligned_Lisp_Symbol): Define.
6412 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
6413 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
6414 (union aligned_Lisp_Misc): Define.
6415 (MARKER_BLOCK_SIZE, struct marker_block): Use union
6416 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 6417 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 6418
b948ce8b
PE
64192012-04-14 Paul Eggert <eggert@cs.ucla.edu>
6420
6421 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
6422 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
6423 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
6424 * s/netbsd.h, s/sol2-6.h:
6425 Remove definition of GC_MARK_STACK, since the default now works.
6426 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
6427 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
6428 no longer the default.
6429 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
6430
35dc09a1 64312012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 6432
35dc09a1
GM
6433 * lread.c (lisp_file_lexically_bound_p):
6434 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 6435
35dc09a1
GM
64362012-04-14 Eli Zaretskii <eliz@gnu.org>
6437
6438 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
6439 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
6440
64412012-04-14 Jan Djärv <jan.h.d@swipnet.se>
6442
6443 * nsterm.m (constrainFrameRect): Always constrain when there is only
6444 one screen (Bug#10962).
6445
bcd86815
KB
64462012-04-13 Ken Brown <kbrown@cornell.edu>
6447
6448 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
6449
c25df26e
RT
64502012-04-13 Reuben Thomas <rrt@sc3d.org>
6451
6452 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
6453
0fc59f1e
DC
64542012-04-11 Daniel Colascione <dancol@dancol.org>
6455
6456 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
6457 against is gone. It's better to use vfork now so that when Cygwin
6458 gains a new, working vfork, we use it automatically (bug#10398).
6459
de8c03dc
SM
64602012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
6461
6462 * window.c (save_window_save): Obey window-point-insertion-type.
6463
2f097256
GM
64642012-04-11 Glenn Morris <rgm@gnu.org>
6465
6466 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
6467
453b951e
SM
64682012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
6469
6470 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
6471
75f1671a 64722012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
6473
6474 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
6475 (force_quit_count): New var.
6476 (handle_interrupt): Use it.
6477
2a8ce227
JB
64782012-04-10 Juanma Barranquero <lekktu@gmail.com>
6479
6480 * w32.c (w32_delayed_load): Record the full path of the library
6481 being loaded (bug#10424).
6482
935396c0
GM
64832012-04-09 Glenn Morris <rgm@gnu.org>
6484
05920a43
GM
6485 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
6486 not just in the obarray, before snarfing them. (Bug#11036)
6487
935396c0
GM
6488 * Makefile.in ($(leimdir)/leim-list.el):
6489 Pass EMACS rather than BUILT_EMACS.
6490
a18ecafa
TZ
64912012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
6492
6493 * process.c (make_process):
6494 * process.h: Add integer `gnutls_handshakes_tried' member to
6495 process struct.
6496
6bbef4e5
JC
6497 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
6498 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
6499
6500 * gnutls.c (gnutls_log_function2i): Convenience log function.
6501 (emacs_gnutls_read): Use new log functions,
6502 `gnutls_handshakes_tried' process member, and
6503 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
6504 attempts per process (connection).
6505
b4d3bc10
CY
65062012-04-09 Chong Yidong <cyd@gnu.org>
6507
6508 * eval.c (Fuser_variable_p, user_variable_p_eh)
6509 (lisp_indirect_variable): Functions deleted.
6510 (Fdefvar): Caller changed.
6511
6512 * callint.c (Finteractive, Fcall_interactively):
6513 * minibuf.c (Fread_variable): Callers changed.
6514
70f4d973
EZ
65152012-04-09 Eli Zaretskii <eliz@gnu.org>
6516
6517 * xdisp.c (set_cursor_from_row): If the display string appears in
6518 the buffer at position that is closer to point than the position
6519 after the display string, display the cursor on the first glyph of
6520 the display string. Fixes cursor display when a 'display' text
6521 property immediately follows invisible text. (Bug#11094)
6522
cb3c2e3e
PE
65232012-04-09 Paul Eggert <eggert@cs.ucla.edu>
6524
6525 composite.c: use 'double' consistently
6526 * composite.c (get_composition_id): Use 'double' consistently
6527 instead of converting 'float' to 'double' and vice versa; this is
6528 easier to understand and avoids a GCC warning.
6529
fd06db5d
GM
65302012-04-09 Glenn Morris <rgm@gnu.org>
6531
50fe702a
GM
6532 * Makefile.in: Generate leim-list with bootstrap-emacs, in
6533 preparation for dumping it with emacs. (Bug#4789)
6534 (leimdir): New variable.
6535 ($(leimdir)/leim-list.el): New rule.
6536 (emacs$(EXEEXT)): Depend on leim-list.el.
6537
fd06db5d
GM
6538 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
6539 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
6540 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
6541
55c131ee
AS
65422012-04-08 Andreas Schwab <schwab@linux-m68k.org>
6543
6544 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
6545 proper alignment.
6546
9209588f
JB
65472012-04-07 Juanma Barranquero <lekktu@gmail.com>
6548
6549 * xml.c (init_libxml2_functions) [WINDOWSNT]:
6550 Remove unused local variable.
6551
e3fb2efb
PE
65522012-04-07 Paul Eggert <eggert@cs.ucla.edu>
6553
6554 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
6555 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
6556 (mark_memory): Mark Lisp_Objects only if pointers might hide in
6557 objects, as mark_maybe_pointer will catch them otherwise.
6558 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
6559 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
6560
b5385551
PE
65612012-04-07 Paul Eggert <eggert@cs.ucla.edu>
6562
6563 Fix typo that broke non-Windows builds.
6564 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
6565
9078ead6
EZ
65662012-04-07 Eli Zaretskii <eliz@gnu.org>
6567
6568 Support building on MS-Windows with libxml2.
6569
6570 * makefile.w32-in (OBJ2): Add xml.$(O).
6571 (GLOBAL_SOURCES): Add xml.c.
6572 ($(BLD)/xml.$(O)): New dependency list.
6573
6574 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
6575 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
6576 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
6577 [!WINDOWSNT]: New macros.
6578 (init_libxml2_functions, libxml2_loaded_p): New functions.
6579 (parse_region): Call fn_xmlCheckVersion instead of using the macro
6580 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
6581 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
6582 Calls xmlCleanupParser only if libxml2 was loaded (or statically
6583 linked in).
6bbef4e5
JC
6584 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
6585 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
6586 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
6587
6588 * emacs.c: Don't include libxml/parser.h.
6589 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
6590 xmlCleanupParser directly.
6591
6592 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
6593
3811fdf3
EZ
65942012-04-07 Eli Zaretskii <eliz@gnu.org>
6595
6596 * indent.c (Fvertical_motion): If there is a display string at
6597 point, use it.vpos to compute how many lines to backtrack after
6598 move_it_to point. (Bug#11133)
6599
2f8e16b2
EZ
66002012-04-06 Eli Zaretskii <eliz@gnu.org>
6601
6602 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
6603 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
6604 about subtle differences between FETCH_CHAR* and STRING_CHAR*
6605 macros related to unification of CJK characters. For the details,
6606 see the discussion following the message here:
6607 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
6608
3d439cd1
CY
66092012-04-04 Chong Yidong <cyd@gnu.org>
6610
6611 * keyboard.c (Vdelayed_warnings_list): Doc fix.
6612
8bc53d00
EZ
66132012-04-01 Eli Zaretskii <eliz@gnu.org>
6614
6615 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
6616 instead of alloca. (Bug#11138)
6617
3b0512a3
AS
66182012-04-01 Andreas Schwab <schwab@linux-m68k.org>
6619
6620 * w32menu.c (is_simple_dialog): Properly check lisp types.
6621 (Bug#11141)
6622
8427ddd2
EZ
66232012-03-31 Eli Zaretskii <eliz@gnu.org>
6624
979022ef
EZ
6625 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
6626 position we get to after a call to move_it_to fails the
6627 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
6628 only if we wind up in a string from display property. (Bug#11063)
6629
a6b1c7cc
EZ
6630 * window.c (Fdelete_other_windows_internal): Invalidate the row
6631 and column information about mouse highlight, so that redisplay
6632 restores it after reallocating the glyph matrices. (Bug#7464)
6633
8427ddd2
EZ
6634 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
6635 string comes from a `display' text property, use the buffer
6636 position of that property as if we actually saw that position in
6637 the row's glyphs.
697ba24b
EZ
6638 (move_it_by_lines): Remove the assertion that
6639 "it->current_x == 0 && it->hpos == 0" which can be legitimately
6640 violated when there's a before-string at the beginning of a line.
6641 (Bug#11063)
8427ddd2 6642
65a0a738
EZ
66432012-03-30 Eli Zaretskii <eliz@gnu.org>
6644
6645 * xdisp.c (append_space_for_newline): If the default face was
6646 remapped, use the remapped face for the appended newline.
6647 (extend_face_to_end_of_line): Use the remapped default face for
6648 extending the face to the end of the line.
6649 (display_line): Call extend_face_to_end_of_line when the default
6650 face was remapped. (Bug#11068)
6651
581355cc
EZ
66522012-03-29 Eli Zaretskii <eliz@gnu.org>
6653
6654 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
6655
e8fc049f
SM
66562012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
6657
6658 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
6659
4fb9a543
GM
66602012-03-27 Glenn Morris <rgm@gnu.org>
6661
6662 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
6663 Doc fixes.
6664
679910f1
KH
66652012-03-26 Kenichi Handa <handa@m17n.org>
6666
6667 * dispextern.h (struct glyph): Fix previous change. Change the
6668 bit length of glyphless.ch to 25 (Bug#11082).
6669
90d49b7f
CY
66702012-03-26 Chong Yidong <cyd@gnu.org>
6671
6672 * keyboard.c (Vselection_inhibit_update_commands): New variable.
6673 (command_loop_1): Use it; inhibit selection update for
6674 handle-select-window too (Bug#8996).
6675
f514f6f0
FP
66762012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
6677
e8fc049f 6678 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 6679
bf43fa51
KH
66802012-03-25 Kenichi Handa <handa@m17n.org>
6681
6682 * dispextern.h (struct glyph): Change the bit length of
6683 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
6684
8a0c01dd
EZ
66852012-03-24 Eli Zaretskii <eliz@gnu.org>
6686
6687 * s/ms-w32.h (tzname): Include time.h before redirecting to
6688 _tzname. Fixes the MSVC build. (Bug#9960)
6689
7d1c3a76
AS
66902012-03-24 Andreas Schwab <schwab@linux-m68k.org>
6691
8ed79523
AS
6692 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
6693 characters.
6694
7d1c3a76
AS
6695 * xterm.c (XTread_socket): Only modify handling_signal if
6696 !SYNC_INPUT. (Bug#11080)
6697
e99a9b8b
EZ
66982012-03-23 Eli Zaretskii <eliz@gnu.org>
6699
6700 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
6701 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
6702 when fetching a multibyte character consumes more bytes than
6703 CHAR_BYTES returns, due to unification of CJK characters in
6704 string_char. (Bug#11073)
6705
5063c0e1
TN
67062012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
6707
6708 * process.c (wait_reading_process_output): Handle pty disconnect
6709 by refraining from sending oneself a SIGCHLD (bug#10933).
6710
9f851fbd
CY
67112012-03-22 Chong Yidong <cyd@gnu.org>
6712
6713 * dispextern.h (struct it): New member string_from_prefix_prop_p.
6714
5063c0e1 6715 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
6716 Mark string as coming from a prefix property.
6717 (handle_face_prop): Use default face for prefix strings (Bug#4281).
6718 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
6719
fb5b8aca
CY
67202012-03-21 Chong Yidong <cyd@gnu.org>
6721
6722 * xfaces.c (Vface_remapping_alist): Doc fix.
6723
62356a1b
EZ
67242012-03-20 Eli Zaretskii <eliz@gnu.org>
6725
6726 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
6727 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
6728 Doc fixes.
62356a1b 6729
025de85b
CY
67302012-03-20 Chong Yidong <cyd@gnu.org>
6731
6732 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
6733 to reflect default non-nil value of redisplay-dont-pause.
6734
4827f94e
KH
67352012-03-19 Kenichi Handa <handa@m17n.org>
6736
6737 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
6738 it fit in a valid range (Bug#11003).
6739
e50a24a2
EZ
67402012-03-18 Eli Zaretskii <eliz@gnu.org>
6741
6742 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
6743 that is not from display property, accept the row as a "cursor
6744 row" if one of the string's character has a non-nil `cursor'
6745 property. Fixes cursor positioning when there are newlines in
6746 overlay strings, e.g. in icomplete.el. (Bug#11035)
6747
9af5ed87
PE
67482012-03-12 Paul Eggert <eggert@cs.ucla.edu>
6749
6750 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
6751
d1f55f16
CY
67522012-03-12 Chong Yidong <cyd@gnu.org>
6753
6754 * eval.c (inhibit_lisp_code): Rename from
6755 inhibit_window_configuration_change_hook; move from window.c.
6756
6757 * xfns.c (unwind_create_frame_1, Fx_create_frame):
6758 * window.c (run_window_configuration_change_hook)
6759 (syms_of_window): Callers changed.
6760
66c5eebd
CY
67612012-03-11 Chong Yidong <cyd@gnu.org>
6762
413df973
CY
6763 * keymap.c (Fkey_description): Doc fix (Bug#9700).
6764
66c5eebd
CY
6765 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
6766
1de11f56
CY
67672012-03-10 Chong Yidong <cyd@gnu.org>
6768
6769 * frame.c (other_visible_frames): Don't assume the selected frame
6770 is visible (Bug#10955).
6771
cae07000
SM
67722012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
6773
6774 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
6775
89c94350
JD
67762012-03-08 Jan Djärv <jan.h.d@swipnet.se>
6777
6778 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
6779 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
6780 zero (Bug#10954).
6781
999dd333
GM
67822012-03-03 Glenn Morris <rgm@gnu.org>
6783
01a6dcc8 6784 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 6785
de0100f2
EZ
67862012-03-02 Eli Zaretskii <eliz@gnu.org>
6787
6788 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
6789 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
6790 (redisplay_window, next_element_from_string): Fix typos in
6791 comments.
3e441275
EZ
6792 (redisplay_window): Pass to move_it_vertically the margin in
6793 pixels, not in screen lines.
de0100f2 6794
96a72ee9
GM
67952012-03-02 Glenn Morris <rgm@gnu.org>
6796
6797 * buffer.c (buffer-list-update-hook): Doc fix.
6798
312508d7
EZ
67992012-02-29 Eli Zaretskii <eliz@gnu.org>
6800
6801 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
6802 push_it before setting up the iterator for the first overlay
6803 string, even if we have an empty string loaded.
6804 (next_overlay_string): If there's an empty string on the iterator
6805 stack, pop the stack. (Bug#10903)
6806
27f3c637
PE
68072012-02-25 Paul Eggert <eggert@cs.ucla.edu>
6808
6809 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
6810 Suggested by Stefan Monnier in
6811 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
6812 * alloc.c (widen_to_Lisp_Object): New static function.
6813 (mark_memory): Also mark Lisp_Objects by fetching pointer words
6814 and widening them to Lisp_Objects. This would work even if
6815 USE_LSB_TAG is defined and wide integers are used, which might
6816 happen in a future version of Emacs.
6817
3c9dfce6
CY
68182012-02-25 Chong Yidong <cyd@gnu.org>
6819
fa74b241
CY
6820 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
6821 Doc fix.
6822
3c9dfce6
CY
6823 * xselect.c (Fx_selection_exists_p): Doc fix.
6824 (x_clipboard_manager_save_all): Print an informative message
6825 before saving to clipboard manager.
6826
9486df08
CY
68272012-02-24 Chong Yidong <cyd@gnu.org>
6828
6829 * keyboard.c (process_special_events): Handle all X selection
6830 requests in kbd_buffer, not just the next one (Bug#8869).
6831
f01d3321
CY
68322012-02-23 Chong Yidong <cyd@gnu.org>
6833
6834 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
6835 call when setting menu-bar-lines and tool-bar-lines parameters.
6836 (unwind_create_frame_1): New helper function.
6837
6838 * window.c (inhibit_window_configuration_change_hook): New var.
6839 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 6840 (syms_of_window): Initialize it.
f01d3321 6841
86b847b6
CY
68422012-02-22 Chong Yidong <cyd@gnu.org>
6843
6844 * xterm.c (x_draw_image_relief): Add missing type check for
6845 Vtool_bar_button_margin (Bug#10743).
6846
a59225b1
CY
68472012-02-21 Chong Yidong <cyd@gnu.org>
6848
6849 * fileio.c (Vfile_name_handler_alist): Doc fix.
6850
6851 * buffer.c (Fget_file_buffer): Protect against invalid file
6852 handler return value.
6853
310f5bd4
PE
68542012-02-20 Paul Eggert <eggert@cs.ucla.edu>
6855
cb3a28cc
PE
6856 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
6857 when computing $valmask.
6858
310f5bd4
PE
6859 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
6860 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
6861 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
6862 It's useless in that case, and it can cause problems on hosts
6863 that allocate halves of EMACS_INT values separately.
6864 Reported by Dan Horák. Diagnosed by Andreas Schwab in
6865 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
6866 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
6867 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
6868 it avoids undefined behavior on hosts where shifting right by more
6869 than the word width has undefined behavior.
6870
2375c96a
CY
68712012-02-19 Chong Yidong <cyd@gnu.org>
6872
6873 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
6874 (Funhandled_file_name_directory, Ffile_name_as_directory)
6875 (Fdirectory_file_name, Fexpand_file_name)
6876 (Fsubstitute_in_file_name): Protect against invalid file handler
6877 return values (Bug#10845).
6878
3eb49e71
EZ
68792012-02-18 Eli Zaretskii <eliz@gnu.org>
6880
6881 * .gdbinit (pitx): Fix incorrect references to fields of the
6882 iterator stack.
6883
7b926f3f
CY
68842012-02-17 Chong Yidong <cyd@gnu.org>
6885
6886 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
6887
11273115
PE
68882012-02-15 Paul Eggert <eggert@cs.ucla.edu>
6889
6890 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
6891 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
6892
c3a70e2b
CY
68932012-02-15 Chong Yidong <cyd@gnu.org>
6894
6895 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
6896 marked as special. Also, starting docstrings with * is obsolete.
6897
0ca43699
AS
68982012-02-13 Andreas Schwab <schwab@linux-m68k.org>
6899
6900 * gnutls.c (emacs_gnutls_write): Fix last change.
6901
2e8f3c56
LI
69022012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
6903
6904 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
6905 send_process.
6906
af70074f
SM
69072012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
6908
6909 * keymap.c (Fsingle_key_description): Handle char ranges.
6910
95986d52
CY
69112012-02-12 Chong Yidong <cyd@gnu.org>
6912
afd83bd1
CY
6913 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
6914 as that creates a dangerous corner case.
6915
95986d52
CY
6916 * window.c (Fdelete_window_internal): Invalidate the mouse
6917 highlight (Bug#9904).
6918
bd7da63e
GM
69192012-02-12 Glenn Morris <rgm@gnu.org>
6920
6921 * xselect.c (Fx_own_selection_internal)
6922 (Fx_get_selection_internal, Fx_disown_selection_internal)
6923 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
6924 * nsselect.m (Fx_own_selection_internal)
6925 (Fx_disown_selection_internal, Fx_selection_exists_p)
6926 (Fx_selection_owner_p, Fx_get_selection_internal):
6927 Sync docs and argument specs with the xselect.c versions.
6928
77abcbc2
LI
69292012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
6930
6931 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
6932
90b671e2
EZ
69332012-02-11 Eli Zaretskii <eliz@gnu.org>
6934
1c0ca0b7
EZ
6935 * w32select.c (Fx_selection_exists_p): Sync doc string and
6936 argument list with xselect.c. (Bug#10783)
6937
6938 * w16select.c (Fx_selection_exists_p): Sync doc string and
6939 argument list with xselect.c. (Bug#10783)
90b671e2 6940
49241268
GM
69412012-02-10 Glenn Morris <rgm@gnu.org>
6942
6943 * fns.c (Fsecure_hash): Doc fix.
6944
f998bbe7 69452012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
6946
6947 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
6948
0992bd9c
CY
69492012-02-07 Chong Yidong <cyd@gnu.org>
6950
6951 * buffer.c (Fbuffer_local_variables)
6952 (buffer_lisp_local_variables): Handle unbound vars correctly;
6953 don't let Qunbound leak into Lisp.
6954
af008560
GM
69552012-02-07 Glenn Morris <rgm@gnu.org>
6956
dd605cc4
GM
6957 * image.c (Fimagemagick_types): Doc fix.
6958
af008560
GM
6959 * image.c (imagemagick-render-type): Change it from a lisp object
6960 to an integer. Move the doc here from the lisp manual.
6961 Treat all values not equal to 0 the same.
6962
1449fa1d
CY
69632012-02-06 Chong Yidong <cyd@gnu.org>
6964
6965 * doc.c (store_function_docstring): Avoid applying docstring of
6966 alias to base function (Bug#2603).
6967
3723ec07
AS
69682012-02-04 Andreas Schwab <schwab@linux-m68k.org>
6969
6970 * .gdbinit (pp1, pv1): Remove redundant defines.
6971 (pr): Use pp.
6972
79c1cc1e
CY
69732012-02-04 Chong Yidong <cyd@gnu.org>
6974
6975 * nsterm.m: Declare a global (Bug#10694).
6976
d7f29f8e
EZ
69772012-02-04 Eli Zaretskii <eliz@gnu.org>
6978
cae07000
SM
6979 * w32.c (get_emacs_configuration_options):
6980 Include --enable-checking, if specified, in the return value.
d7f29f8e 6981
3b95a6f9
MR
69822012-02-04 Martin Rudalics <rudalics@gmx.at>
6983
6984 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
6985 after rounding frame sizes. (Bug#9723)
6986
d6fa96a6
EZ
69872012-02-04 Eli Zaretskii <eliz@gnu.org>
6988
6989 * keyboard.c (adjust_point_for_property): Don't position point
6990 before BEGV. (Bug#10696)
6991
df0b2940
PE
69922012-02-03 Paul Eggert <eggert@cs.ucla.edu>
6993
6994 Handle overflow when computing char display width (Bug#9496).
6995 * character.c (char_width): Return EMACS_INT, not int.
6996 (char_width, c_string_width): Check for overflow when
6997 computing the width; this is possible now that individual
6998 characters can have unbounded width. Problem introduced
6999 by merge from Emacs 23 on 2012-01-19.
7000
6bee44d6
MA
70012012-02-02 Michael Albinus <michael.albinus@gmx.de>
7002
7003 * dbusbind.c (Fdbus_register_method): Mention the return value
7004 :ignore in the docstring.
7005
44f92739
GM
70062012-02-02 Glenn Morris <rgm@gnu.org>
7007
1b9f60cc
GM
7008 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
7009
44f92739
GM
7010 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7011 Unconditionally set to t. (Bug#10673)
7012 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7013 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
7014 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
7015
c5d3843c
KH
70162012-02-02 Kenichi Handa <handa@m17n.org>
7017
7018 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
7019 0, do not call append_composite_glyph.
7020
159462d4 70212012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
7022
7023 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
7024 NULL (Bug#6988).
7025 (x_produce_glyphs): If the component of a composition is a null
7026 string, set it->pixel_width to 1 to avoid zero-width glyph.
7027
78cef877
EZ
70282012-02-01 Eli Zaretskii <eliz@gnu.org>
7029
7030 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
7031 first 2 arguments are identical. This makes inserting large
7032 output from a subprocess an order of magnitude faster on
7033 MS-Windows, where all sbrk'ed memory is always contiguous.
7034
97897668
GM
70352012-01-31 Glenn Morris <rgm@gnu.org>
7036
7037 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 7038 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
7039 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
7040
31fd3586
GM
70412012-01-29 Glenn Morris <rgm@gnu.org>
7042
7043 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
7044
0e24a8b2
CY
70452012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
7046
7047 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
7048
cc0adcb0
CY
70492012-01-28 Chong Yidong <cyd@gnu.org>
7050
7051 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
7052
acc28cb9
CY
70532012-01-26 Chong Yidong <cyd@gnu.org>
7054
9c69cfb7
CY
7055 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
7056
acc28cb9
CY
7057 * search.c (Fsearch_forward, Fsearch_backward): Document negative
7058 repeat counts (Bug#10507).
7059
48da7392
GM
70602012-01-26 Glenn Morris <rgm@gnu.org>
7061
7062 * lread.c (syms_of_lread): Doc fix.
7063
14af5f7f
CY
70642012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
7065
7066 * coding.c (encode_designation_at_bol): Change return value to
7067 EMACS_INT.
7068
0b21c100
CY
70692012-01-25 Chong Yidong <cyd@gnu.org>
7070
7071 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
7072
3c2907f7
CY
70732012-01-21 Chong Yidong <cyd@gnu.org>
7074
7075 * floatfns.c (Fcopysign): Make the second argument non-optional,
7076 since nil is not allowed anyway.
7077
959ad23f
AS
70782012-01-21 Andreas Schwab <schwab@linux-m68k.org>
7079
7080 * process.c (read_process_output): Use p instead of XPROCESS (proc).
7081 (send_process): Likewise.
7082
34a02f46
MR
70832012-01-19 Martin Rudalics <rudalics@gmx.at>
7084
7085 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
7086 (Vwindow_persistent_parameters): Do not use Qstate.
7087 Rewrite doc-strings.
34a02f46 7088
1259009a 70892012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
7090
7091 * character.c (char_width): New function.
70d4fdf6
GM
7092 (Fchar_width, c_string_width, lisp_string_width):
7093 Use char_width (Bug#9496).
25ed9e61 7094
6a6ee00d
MR
70952012-01-16 Martin Rudalics <rudalics@gmx.at>
7096
7097 * window.c (Vwindow_persistent_parameters): New variable.
7098 (Fset_window_configuration, save_window_save): Handle persistent
7099 window parameters.
7100
c85efaf7
EZ
71012012-01-14 Eli Zaretskii <eliz@gnu.org>
7102
7103 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
7104 thrashing the stack of the thread. (Bug#9087)
7105
5944709e
PE
71062012-01-12 Paul Eggert <eggert@cs.ucla.edu>
7107
7108 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
7109
e71f5d99
EZ
71102012-01-11 Eli Zaretskii <eliz@gnu.org>
7111
7112 * xdisp.c (rows_from_pos_range): Handle the case where the
7113 highlight ends on a newline. (Bug#10464)
7114 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
7115 he end column for display of highlight that ends on a newline
7116 before a R2L line.
7117
ce316182
GM
71182012-01-11 Glenn Morris <rgm@gnu.org>
7119
7120 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
7121 from load-path also when installation-directory is nil. (Bug#10208)
7122
5b43da69
GM
71232012-01-10 Glenn Morris <rgm@gnu.org>
7124
74cc8ff9
GM
7125 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
7126
7d8d6e4e
GM
7127 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
7128 Update template values to be closer to their typical values these days.
5b43da69 7129
a0db8d43
EZ
71302012-01-09 Eli Zaretskii <eliz@gnu.org>
7131
7132 * xdisp.c (rows_from_pos_range): Accept additional argument
7133 DISP_STRING, and accept any glyph in a row whose object is that
7134 string as eligible for mouse highlight. Fixes mouse highlight of
7135 display strings from overlays. (Bug#10464)
7136
9a0115ab 71372012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 7138
b9110d6a 7139 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
7140 * fileio.c (auto_saving_dir_umask): New static var.
7141 (Fmake_directory_internal): Use it.
7142 (do_auto_save_make_dir): Set it, instead of invoking chmod after
7143 creating the directory. The old code temporarily assigns
7144 too-generous permissions to the directory.
7145 (do_auto_save_eh): Clear it.
b9110d6a 7146 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
7147 that the var is always cleared.
7148
6c1bd3f3
EZ
71492012-01-07 Eli Zaretskii <eliz@gnu.org>
7150
7151 * search.c (scan_buffer): Pass character positions to
7152 know_region_cache, not byte positions. (Bug#6540)
7153
069d2b50
L
71542012-01-07 LynX <_LynX@bk.ru> (tiny change)
7155
7156 * w32.c (sys_rename): Report EXDEV when rename of a directory
7157 fails because the target is on another logical disk. (Bug#10284)
7158
75bf0d33
DB
71592012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
7160
7161 * xterm.c (x_embed_request_focus): New function.
7162
7163 * xterm.h: Add prototype.
7164
7165 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
7166
1c6e5a32
GM
71672012-01-05 Glenn Morris <rgm@gnu.org>
7168
7169 * emacs.c (emacs_copyright): Update short copyright year to 2012.
7170
651e947e
EZ
71712012-01-01 Eli Zaretskii <eliz@gnu.org>
7172
7173 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
7174 Load gnutls_transport_set_lowat only if GnuTLS version is below
7175 2.11.1.
7176 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
7177 GnuTLS versions below 2.11.1.
7178
3778cdd8
AL
71792011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
7180
7181 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
7182 to the doc string advising against its use for altering the way
7183 windows are scrolled.
7184
0e5317f7
KH
71852011-12-28 Kenichi Handa <handa@m17n.org>
7186
7187 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
7188 coding-system ASCII compatible only when it does not produce BOM
7189 on encoding (Bug#10383).
7190
93d5ca1f
JD
71912011-12-26 Jan Djärv <jan.h.d@swipnet.se>
7192
7193 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
7194 can scroll.
7195 (create_and_show_popup_menu): Always use menu_position_func for
7196 Gtk3 (Bug#10361).
7197
ca22b785
AS
71982011-12-24 Andreas Schwab <schwab@linux-m68k.org>
7199
7200 * callint.c (Fcall_interactively): Don't truncate prompt string.
7201
d048e1e6
EZ
72022011-12-23 Eli Zaretskii <eliz@gnu.org>
7203
7204 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
7205 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 7206 resumed from there (after widening). (Bug#10360)
d048e1e6 7207
5ccaba1f
JD
72082011-12-22 Jan Djärv <jan.h.d@swipnet.se>
7209
7210 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
7211
204ee57f
JD
72122011-12-21 Jan Djärv <jan.h.d@swipnet.se>
7213
b81d40f0
JB
7214 * nsterm.m (x_free_frame_resources):
7215 Release f->output_data.ns->miniimage.
204ee57f
JD
7216 (ns_index_color): Fix indentation. Do not retain
7217 color_table->colors[i].
7218
7219 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
7220 before returning.
7221
7222 * nsfns.m (x_set_background_color): Assign return value from
7223 ns_index_color to face-background instead of NSColor*.
7224 (ns_implicitly_set_icon_type): Fix indentation.
7225 Change assignment in for loop to comparison.
7226
7227 * emacs.c (ns_pool): New variable.
7228 (main): Assign ns_pool.
7229 (Fkill_emacs): Call ns_release_autorelease_pool.
7230
7231 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
7232 autorelease fdesc, release fdAttrs and tdict.
7233 (ns_get_covering_families): Release charset.
7234 (ns_findfonts): Release NSFontDescriptor created with new.
7235 (ns_uni_to_glyphs): Fix indentation.
7236 (setString): Release attrStr before assigning new value.
7237
c803b2b7
JD
72382011-12-18 Jan Djärv <jan.h.d@swipnet.se>
7239
678f4426
JD
7240 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
7241 and NS_IMPL_COCOA.
7242 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
7243 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
7244
cd394be1 72452011-12-18 David Reitter <reitter@cmu.edu>
678f4426 7246
5fecd5fc
JD
7247 * nsterm.m (ns_term_init): Subscribe for notifications
7248 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
7249 to method trackingNotification in EmacsMenu.
7250
7251 * nsmenu.m (trackingMenu): New variable.
3771cb17 7252 (trackingNotification): New method (from Aquamacs).
5fecd5fc 7253 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 7254 from Aquamacs (Bug#7030).
678f4426
JD
7255
72562011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 7257
c803b2b7
JD
7258 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
7259 (symbol_to_nsstring): Fix indentation.
7260 (ns_symbol_to_pb): New function.
cae07000
SM
7261 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
7262 (Fns_rotate_cut_buffers_internal): Remove.
7263 (Fns_store_selection_internal): Rename from
c803b2b7
JD
7264 Fns_store_cut_buffer_internal.
7265 (ns_get_foreign_selection, Fx_own_selection_internal)
7266 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
7267 (Fns_get_selection_internal, Fns_store_selection_internal):
7268 Use ns_symbol_to_pb and check if return value is nil.
7269 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
7270 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
7271 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
7272 renamed to Sns_store_selection_internal.
7273 (ns_handle_selection_request): Move code to Fx_own_selection_internal
7274 and remove this function.
7275 (ns_handle_selection_clear): Remove, never used.
7276 (Fx_own_selection_internal): Move code from ns_handle_selection_request
7277 here.
7278
e1b01a3a
KB
72792011-12-17 Ken Brown <kbrown@cornell.edu>
7280
7281 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
7282 GID is unknown (Bug#10257).
7283
2adb6e85
PE
72842011-12-17 Paul Eggert <eggert@cs.ucla.edu>
7285
7286 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
7287 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
7288 which caused a build failure on GNU/Linux IA-64. This problem was
7289 introduced by my 2011-10-07 patch.
7290
d1d7b339
JL
72912011-12-15 Juri Linkov <juri@jurta.org>
7292
7293 * image.c (imagemagick_error): New function. (Bug#10112)
7294 (imagemagick_load_image): Comment out `MagickSetResolution' call.
7295 Use `imagemagick_error' where ImageMagick functions return
7296 `MagickFalse'.
7297 (Fimagemagick_types): Add `Fnreverse' to return the list in the
7298 proper order.
7299
100d5755
KH
73002011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7301
7302 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
7303 fill background (Bug#8992).
7304
454592a6
MR
73052011-12-13 Martin Rudalics <rudalics@gmx.at>
7306
7307 * window.c (Vwindow_combination_resize)
7308 (Vwindow_combination_limit): Use t instead of non-nil in
7309 doc-strings.
61d4b438
MR
7310 (Vrecenter_redisplay): Add first sentence of doc-string on
7311 separate line.
53524d93 7312 (Frecenter): Fix doc-string typo.
454592a6 7313
3633e3aa
KH
73142011-12-11 Kenichi Handa <handa@m17n.org>
7315
7316 * coding.c (Funencodable_char_position): Pay attention to the
7317 buffer text relocation (Bug#9389).
7318
7b9d523a 73192011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 7320
7b9d523a
JD
7321 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
7322 gtk_init (Bug#10100).
7323
b73189c6
EZ
73242011-12-10 Eli Zaretskii <eliz@gnu.org>
7325
7326 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
7327 IT->string is nil. (Bug#10263)
7328
f7dfe5d6
JD
73292011-12-10 Jan Djärv <jan.h.d@swipnet.se>
7330
83faebb4
JD
7331 * nsterm.h (x_free_frame_resources): Declare.
7332
f7dfe5d6
JD
7333 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
7334 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
7335
7336 * nsterm.h (ns_get_defaults_value): Declare.
7337
7338 * nsterm.m (ns_default): Call ns_get_defaults_value.
7339
7cd4e72c
EZ
73402011-12-09 Eli Zaretskii <eliz@gnu.org>
7341
7342 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
7343 (Bug#10170)
7344
b34d7317
YM
73452011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7346
7347 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
7348 that where the value of an _OBJC_* symbol points to is in the .bss
7349 section (Bug#10240).
7350
76470ad1
KH
73512011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
7352
7353 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 7354 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 7355
745fff94
KH
73562011-12-08 Kenichi Handa <handa@m17n.org>
7357
7358 * ftfont.c (get_adstyle_property): Fix previous change
7359 (Bug#10233).
7360
6e44397c
JB
73612011-12-07 Juanma Barranquero <lekktu@gmail.com>
7362
7363 * w32.c (init_environment): If no_site_lisp, remove site-lisp
7364 dirs from the default value of EMACSLOADPATH (bug#10208).
7365
7efa6272
GM
73662011-12-07 Glenn Morris <rgm@gnu.org>
7367
7368 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
7369 installation and source directories as well. (Bug#10208)
7370
f6fc4d87
CY
73712011-12-06 Chong Yidong <cyd@gnu.org>
7372
7373 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
7374
2bf26180
GM
73752011-12-06 Glenn Morris <rgm@gnu.org>
7376
7377 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
7378 as an error, not just -1. (Bug#10217)
7379
3a6ad4f0
CY
73802011-12-05 Chong Yidong <cyd@gnu.org>
7381
7382 * keyboard.c (process_special_events): New function.
7383 (swallow_events, Finput_pending_p): Use it (Bug#10195).
7384
75a3b399
PE
73852011-12-05 Paul Eggert <eggert@cs.ucla.edu>
7386
7387 * coding.c (encode_designation_at_bol): Don't use uninitialized
7388 local variable (Bug#9318).
7389
c3c9e25e
KH
73902011-12-05 Kenichi Handa <handa@m17n.org>
7391
7392 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
7393 return Qnil (Bug#8046, Bug#10193).
7394
5eb05ea3
KH
73952011-12-05 Kenichi Handa <handa@m17n.org>
7396
7397 * coding.c (encode_designation_at_bol): New args charbuf_end and
7398 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
7399 (coding_set_source): Return how many bytes coding->source was
7400 relocated.
7401 (coding_set_destination): Return how many bytes
7402 coding->destination was relocated.
7403 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 7404 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
7405
74062011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
7407
7408 * coding.c (CODING_CHAR_CHARSET_P): New macro.
7409 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
7410 macro (Bug#9318).
7411
74122011-12-05 Andreas Schwab <schwab@linux-m68k.org>
7413
7414 The following changes are to fix Bug#9318.
7415
a79703f5 7416 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
7417 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
7418 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 7419 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 7420
7dbda6df
JB
74212011-12-05 Juanma Barranquero <lekktu@gmail.com>
7422
7423 * lisp.h (process_quit_flag): Fix external declaration.
7424
6d5eb5b0
SM
74252011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
7426
7427 Don't macro-inline non-performance-critical code.
7428 * eval.c (process_quit_flag): New function.
7429 * lisp.h (QUIT): Use it.
7430
a0c3fad0
JD
74312011-12-04 Jan Djärv <jan.h.d@swipnet.se>
7432
7433 * nsfns.m (get_geometry_from_preferences): New function.
7434 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
7435
6c07aac2
AS
74362011-12-04 Andreas Schwab <schwab@linux-m68k.org>
7437
7438 * emacs.c (Qkill_emacs): Define.
7439 (syms_of_emacs): Initialize it.
7440 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
7441 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
7442 (quit_throw_to_read_char): Add parameter `from_signal'.
7443 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
7444 * lisp.h (QUIT): Call Fkill_emacs if requested.
7445
c052ead4
JD
74462011-12-03 Jan Djärv <jan.h.d@swipnet.se>
7447
7448 * widget.c (update_wm_hints): Return if wmshell is null.
7449 (widget_update_wm_size_hints): New function.
7450
7451 * widget.h (widget_update_wm_size_hints): Declare.
7452
7453 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
7454 widget_update_wm_size_hints (Bug#10104).
7455
9e49252b
EZ
74562011-12-03 Eli Zaretskii <eliz@gnu.org>
7457
7458 * xdisp.c (handle_invisible_prop): If the invisible text ends just
7459 before a newline, prepare the bidi iterator for consuming the
7460 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 7461 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 7462
02b16839
JL
74632011-12-02 Juri Linkov <juri@jurta.org>
7464
7465 * search.c (Fword_search_regexp): New Lisp function created from
7466 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
7467 (Fword_search_backward, Fword_search_forward)
7468 (Fword_search_backward_lax, Fword_search_forward_lax):
7469 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
7470 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
7471
0068070e
SM
74722011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
7473
7474 * fileio.c (Finsert_file_contents): Move after-change-function call
7475 to before the "handled:" label, since all "goto handled" appear in
7476 cases where the *-change-functions have already been properly called
7477 (bug#10117).
7478
3360a3fc
AS
74792011-12-01 Andreas Schwab <schwab@linux-m68k.org>
7480
7481 * keyboard.c (interrupt_signal): Don't call kill-emacs when
7482 waiting for input. (Bug#10169)
7483
73d6c093
EZ
74842011-11-30 Eli Zaretskii <eliz@gnu.org>
7485
7486 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
7487 verifies glyph row's hash code--we have just reallocated the
7488 glyphs, so their contents can be complete garbage. (Bug#10164)
7489
febe6bea
JB
74902011-11-30 Juanma Barranquero <lekktu@gmail.com>
7491
7492 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
7493
801a4313
EZ
74942011-11-30 Eli Zaretskii <eliz@gnu.org>
7495
7496 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
7497 attributes are tested _before_ calling verify_row_hash, to protect
7498 against GCC re-ordering of the tests. (Bug#10164)
7499
2b56b87e
JD
75002011-11-29 Jan Djärv <jan.h.d@swipnet.se>
7501
7502 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
7503
7504 * xterm.c (handle_one_xevent): Only set async_visible and friends
7505 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 7506 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
7507 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
7508
dbf31225
PE
75092011-11-28 Paul Eggert <eggert@cs.ucla.edu>
7510
7511 Remove GCPRO-related macros that exist only to avoid shadowing locals.
7512 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
7513 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
7514 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
7515 All uses changed to use GCPRO1 etc.
7516 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
7517 Revert to old implementation (i.e., before 2011-03-11).
7518
1305621b
YM
75192011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7520
7521 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
7522 of scroll runs so as to avoid assigning disabled bogus rows and
7523 unnecessary graphics copy operations.
7524
8c9afb46
EZ
75252011-11-27 Eli Zaretskii <eliz@gnu.org>
7526
7527 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
7528 (snprintf) [_MSC_VER]: Redirect to _snprintf.
7529 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
7530 (malloc, free, realloc, calloc): Redirect to e_* only when
7531 compiling Emacs.
7532
7533 * lisp.h (GCTYPEBITS): Move before first use.
7534 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
7535 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
7536 this macro definition.
7537
7538 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
7539 _MSC_VER.
7540
54e9e3bf
JD
75412011-11-27 Jan Djärv <jan.h.d@swipnet.se>
7542
6d5eb5b0
SM
7543 * gtkutil.c (xg_create_frame_widgets):
7544 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
7545 present with Gtk+ 2.0.
7546
83aca1cb
PE
75472011-11-26 Paul Eggert <eggert@cs.ucla.edu>
7548
7549 * fileio.c (Finsert_file_contents): Undo previous change; see
7550 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
7551
5b76caa4
PE
75522011-11-26 Paul Eggert <eggert@cs.ucla.edu>
7553
7554 Rename locals to avoid shadowing.
7555 * fileio.c (Finsert_file_contents):
7556 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
7557 * process.c (wait_reading_process_output):
7558 Rename inner 'proc' to 'p' to avoid shadowing.
7559 Indent for consistency with usual Emacs style.
7560
8c535114
EZ
75612011-11-25 Eli Zaretskii <eliz@gnu.org>
7562
7563 * xdisp.c (redisplay_window): If cursor row is not fully visible
7564 after recentering, and scroll-conservatively is set to a large
7565 number, scroll window by a few more lines to make the cursor fully
7566 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
7567 (start_display): Don't move to the next line if the display should
7568 start at a newline that is part of a display vector or an overlay
7569 string. (Bug#10119)
8c535114 7570
fa4fdb5c
JL
75712011-11-24 Juri Linkov <juri@jurta.org>
7572
7573 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
7574 after the `MagickPingImage' call. (Bug#10112)
7575
90ec88df
CY
75762011-11-23 Chong Yidong <cyd@gnu.org>
7577
7578 * window.c (Fcoordinates_in_window_p): Accept only live windows.
7579
56e2e794
MR
75802011-11-23 Martin Rudalics <rudalics@gmx.at>
7581
7582 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
7583 making another buffer current. (Bug#10114)
7584
b6e64c41
GM
75852011-11-23 Glenn Morris <rgm@gnu.org>
7586
7587 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
7588
6b21de18
CY
75892011-11-23 Chong Yidong <cyd@gnu.org>
7590
7591 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
7592 using it (Bug#5984).
7593
b12cd789
EZ
75942011-11-22 Eli Zaretskii <eliz@gnu.org>
7595
7596 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
7597 and header-lines, as they don't have one computed for them.
7598 (Bug#10098)
7599
7600 * .gdbinit (prow): Make displayed values more self-explaining.
7601 Add row's hash code.
7602
261b6fd4
LMI
76032011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
7604
7605 * process.c (wait_reading_process_output): Fix asynchrounous
7606 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 7607 (wait_reading_process_output): Add comment and URL.
261b6fd4 7608
e7cfd277
JD
76092011-11-21 Jan Djärv <jan.h.d@swipnet.se>
7610
7611 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
7612
a9b9b7f5
CY
76132011-11-21 Chong Yidong <cyd@gnu.org>
7614
7615 * window.c (Fnext_window, Fprevious_window): Doc fix.
7616
b0d15b4f
SM
76172011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
7618
7619 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
7620
fe7a3057
JB
76212011-11-20 Juanma Barranquero <lekktu@gmail.com>
7622
7623 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
7624
d2999b1a
MR
76252011-11-20 Martin Rudalics <rudalics@gmx.at>
7626
7627 * window.c (Fset_window_combination_limit): Rename argument
7628 STATUS to LIMIT.
7629 (Vwindow_combination_limit): Remove "status" from doc-string.
7630
d5ff9cd0
AS
76312011-11-20 Andreas Schwab <schwab@linux-m68k.org>
7632
7633 * m/ibms390.h: Remove.
7634 * m/ibms390x.h: Don't include "ibms390.h".
7635
a5bb9bd3
SM
76362011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
7637
7638 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
7639 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
7640
cd1181db
JB
76412011-11-20 Juanma Barranquero <lekktu@gmail.com>
7642
7643 * casetab.c (Fset_case_table):
7644 * charset.c (Fcharset_after): Fix typos.
7645
615a3b8d 76462011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 7647
17e845af
PE
7648 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
7649 Otherwise, valgrind does not work on some platforms.
7650 Problem reported by Andreas Schwab in
6a0bf43d
PE
7651 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
7652 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
7653 is set, removing the need for VIRT_ADDRESS_VARIES.
7654 (PURE_P): Use a more-efficient implementation that needs just one
7655 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
7656 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
7657 to 4 (xorl, subq, cmpq, setbe).
7658 * alloc.c (pure): Always extern now, since that's the
7659 VIRT_ADDR_VARIES behavior.
7660 (PURE_POINTER_P): Use a single comparison, not two, for
7661 consistency with the new puresize.h.
7662 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
7663 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
7664 Remove VIRT_ADDR_VARIES no longer needed.
7665
f8fe6f96
EZ
76662011-11-19 Eli Zaretskii <eliz@gnu.org>
7667
7668 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
7669 (erase_phys_cursor, update_window_cursor, show_mouse_face)
7670 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
7671 behave as if the cursor position were at the window margin.
7672
7673 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
7674 and the cursor position is out of bounds, behave as if the cursor
7675 position were at the window margin. (Bug#10075)
7676
df05a53c
CY
76772011-11-18 Chong Yidong <cyd@gnu.org>
7678
7679 * window.c (Fwindow_combination_limit): Make first argument
7680 non-optional, since it is meaningless for live windows like the
7681 selected window.
61ccba97 7682
2071918e
DA
76832011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
7684
7685 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
7686
b50a28de
SM
76872011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
7688
7689 * intervals.c: Fix grafting over the whole buffer (bug#10071).
7690 (graft_intervals_into_buffer): Simplify.
7691
015137db
EZ
76922011-11-18 Eli Zaretskii <eliz@gnu.org>
7693
7694 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
7695 hash values of the two rows.
7696 (copy_row_except_pointers): Preserve the used[] arrays and the
7697 hash values of the two rows. (Bug#10035)
68c95424 7698 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
7699
7700 * xdisp.c (row_hash): New function, body extracted from
7701 compute_line_metrics.
7702 (compute_line_metrics): Call row_hash, instead of computing the
7703 hash code inline.
7704
7705 * dispnew.c (verify_row_hash): Call row_hash for computing the
7706 hash code of a row, instead of duplicating code from xdisp.c.
7707
7708 * dispextern.h (row_hash): Add prototype.
7709
a2addb04
TH
77102011-11-18 Tassilo Horn <tassilo@member.fsf.org>
7711
7712 * frame.c (delete_frame): Don't delete the terminal when the last
7713 X frame is closed if emacs is built with GTK toolkit.
7714
df85d315
JB
77152011-11-17 Juanma Barranquero <lekktu@gmail.com>
7716
7717 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
7718
a0c2d0ae
MR
77192011-11-17 Martin Rudalics <rudalics@gmx.at>
7720
7721 * window.c (Vwindow_splits): Rename to
7722 Vwindow_combination_resize. Suggested by Juri Linkov.
7723 (Fsplit_window_internal): Use Vwindow_combination_resize instead
7724 of Vwindow_splits.
7725
58179cce
JB
77262011-11-16 Juanma Barranquero <lekktu@gmail.com>
7727
7877f373
JB
7728 * nsfns.m (Fns_font_name):
7729 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 7730
b6f67890
MR
77312011-11-16 Martin Rudalics <rudalics@gmx.at>
7732
7733 * window.h (window): Rename slot "nest" to "combination_limit".
7734 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
7735 (Fset_window_nest): Rename to Fset_window_combination_limit.
7736 (Vwindow_nest): Rename to Vwindow_combination_limit.
7737 (recombine_windows, make_parent_window, make_window)
7738 (Fsplit_window_internal, saved_window)
7739 (Fset_window_configuration, save_window_save): Rename all
7740 occurrences of window_nest to window_combination_limit.
7741
c7015153
JB
77422011-11-15 Juanma Barranquero <lekktu@gmail.com>
7743
7744 * image.c (imagemagick_load_image): Fix typo.
7745
322ad6ec
EZ
77462011-11-14 Eli Zaretskii <eliz@gnu.org>
7747
7748 * xdisp.c (display_line): Move the call to
7749 highlight_trailing_whitespace before the call to
7750 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
7751 faces of all the glyphs to compute ROW's hash value.
7752 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 7753
f067b8ec
JB
77542011-11-14 Juanma Barranquero <lekktu@gmail.com>
7755
7756 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
7757 just return (bug#10044).
7758
1e5b2111
EZ
77592011-11-12 Eli Zaretskii <eliz@gnu.org>
7760
7ef3cbd5
EZ
7761 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
7762 with user-defined heap size. Bump the default size of the temacs
7763 heap to 27MB, to avoid memory warning when running temacs.
7764 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
7765
1e5b2111
EZ
7766 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
7767 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
7768 (verify_row_hash) [XASSERTS]: New function.
7769 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
7770 that the hash value of glyph rows is correct.
1e5b2111 7771
89d61221
MR
77722011-11-12 Martin Rudalics <rudalics@gmx.at>
7773
7774 * window.h (window): Remove splits slot.
7775 * window.c (Fwindow_splits, Fset_window_splits): Remove.
7776 (Fdelete_other_windows_internal, make_parent_window)
7777 (make_window, Fsplit_window_internal, Fdelete_window_internal)
7778 (Fset_window_configuration, save_window_save): Don't deal with
7779 split status of windows.
7780 (saved_window): Remove splits slot.
7781 (Vwindow_splits): Rewrite doc-string.
7782
97f18cc8
JD
77832011-11-11 Jan Djärv <jan.h.d@swipnet.se>
7784
7785 * xfns.c (unwind_create_frame):
7786 * nsfns.m (unwind_create_frame):
7787 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
7788 Vframe_list (Bug#9999).
7789
22a648b4
DA
77902011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
7791
0b381c7e 7792 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 7793
659afede
KH
77942011-11-11 Kenichi Handa <handa@m17n.org>
7795
7796 * callproc.c (Fcall_process): Set the member dst_multibyte of
7797 process_coding.
7798
9ac0394b
KH
77992011-11-11 Johan Bockgård <bojohan@gnu.org>
7800
7801 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
7802 avoid a crash (bug#9496).
7803
2fbdc249
CY
78042011-11-09 Chong Yidong <cyd@gnu.org>
7805
7806 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
7807 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
7808
ac6b1f81
PE
78092011-11-08 Paul Eggert <eggert@cs.ucla.edu>
7810
7811 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
7812
09db192c
PE
78132011-11-08 Paul Eggert <eggert@cs.ucla.edu>
7814
7815 Avoid some portability problems by eschewing 'extern inline' functions.
7816 The trivial performance wins aren't worth the portability hassles; see
7817 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
7818 et seq.
7819 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
7820 (window_box_width, window_box_left, window_box_left_offset)
7821 (window_box_right, window_box_right_offset): Undo previous change,
7822 by removing the "extern"s.
7823 * intervals.c (adjust_intervals_for_insertion)
7824 (adjust_intervals_for_deletion): Undo previous change,
7825 making these static again.
7826 (offset_intervals, temp_set_point_both, temp_set_point)
7827 (copy_intervals_to_string): No longer inline.
7828 * xdisp.c (window_text_bottom_y, window_box_width)
7829 (window_box_height, window_box_left_offset)
7830 (window_box_right_offset, window_box_left, window_box_right)
7831 (window_box): No longer inline.
7832
105216ed
CY
78332011-11-08 Chong Yidong <cyd@gnu.org>
7834
7835 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
7836 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
7837 Signal an error if not a live window.
105216ed
CY
7838 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
7839 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
7840
ae9e237f
JB
78412011-11-07 Juanma Barranquero <lekktu@gmail.com>
7842
7843 * lisp.h (syms_of_abbrev): Remove declaration.
7844 Reported by CHENG Gao <chenggao@royau.me>.
7845
c7aa8333
EZ
78462011-11-07 Eli Zaretskii <eliz@gnu.org>
7847
7848 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
7849 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
7850 of temacs in GUI mode.
7851
be7f5545
MR
78522011-11-07 Martin Rudalics <rudalics@gmx.at>
7853
7854 * window.h: Declare delete_all_child_windows instead of
7855 delete_all_subwindows.
7856 * window.c (Fwindow_nest, Fset_window_nest)
7857 (Fset_window_new_total, Fset_window_new_normal)
7858 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
7859 (delete_all_subwindows): Rename to delete_all_child_windows.
7860 (Fdelete_other_windows_internal, Fset_window_configuration):
7861 Call delete_all_child_windows instead of delete_all_subwindows.
7862 * frame.c (delete_frame): Call delete_all_child_windows instead
7863 of delete_all_subwindows.
7864
ca78dc43
PE
78652011-11-07 Paul Eggert <eggert@cs.ucla.edu>
7866
7867 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
7868 This is also needed for porting to any host where GC_MARK_STACK is
7869 not GC_MAKE_GCPROS_NOOPS.
7870 (which_symbols): Use it.
7871
a0241d01
KH
78722011-11-07 Kenichi Handa <handa@m17n.org>
7873
7874 * coding.c (coding_set_destination): Check coding->src_pos only
7875 when coding->src_object is a buffer (bug#9910).
7876
7877 * process.c (send_process): Set the member src_multibyte of coding
7878 to 0 (bug#9911) when sending a unibyte text.
7879
7880 * callproc.c (Fcall_process): Set the member src_multibyte of
7881 process_coding to 0 (bug#9912).
7882
a64bfdfa 78832011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
7884
7885 * xmenu.c (cleanup_widget_value_tree): New function.
7886 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
7887 calling free_menubar_widget_value_tree directly (Bug#9830).
7888
cb41b32a
PE
78892011-11-06 Paul Eggert <eggert@cs.ucla.edu>
7890
7891 Fix some portability problems with 'inline'.
7892 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
7893 (window_box_width, window_box_left, window_box_left_offset)
7894 (window_box_right, window_box_right_offset): Declare extern.
7895 Otherwise, these inline functions do not conform to C99 and
7896 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
7897 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
7898 * intervals.c (adjust_intervals_for_insertion)
7899 (adjust_intervals_for_deletion): Now extern, because otherwise the
7900 extern inline functions 'offset_intervals' couldn't refer to it.
7901 (static_offset_intervals): Remove.
7902 (offset_intervals): Rewrite using the old contents of
7903 static_offset_intervals. The old version didn't conform to C99
7904 because an extern inline function contained a reference to an
7905 identifier with static linkage.
7906
b7041366
AS
79072011-11-06 Andreas Schwab <schwab@linux-m68k.org>
7908
7909 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
7910 GC.
7911
88a37c4d
EZ
79122011-11-06 Eli Zaretskii <eliz@gnu.org>
7913
7914 * xdisp.c (init_iterator, reseat_to_string): Don't set the
7915 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
7916 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
7917 return Qleft_to_right.
7918
49745b39
CY
79192011-11-06 Chong Yidong <cyd@gnu.org>
7920
7921 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
7922 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
7923 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
7924 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
7925 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
7926 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
7927 (Fwindow_vscroll): Doc fix.
7928 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
7929 argument, since it makes no sense to pass a live window and for
7930 consistency with window-child.
7931
1f05cd82
CS
79322011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
7933
7934 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
7935 support MSVC.
7936
22610910
JR
79372011-11-05 Jason Rumney <jasonr@gnu.org>
7938
7939 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
7940 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
7941 fonts (Bug#6029).
7942 (add_font_entity_to_list): Fix logic errors in mixed boolean and
7943 bitwise arithmetic preventing use of unicode-sip and non-truetype
7944 opentype fonts.
7945
a06776b2
EZ
79462011-11-05 Eli Zaretskii <eliz@gnu.org>
7947
3ad924ba
EZ
7948 * s/ms-w32.h (fstat, stat, utime): Move redirections to
7949 "emacs"-only part.
7950
a06776b2
EZ
7951 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
7952 initialization code to keep similarity to xfns.c after changes
7953 from 2011-11-05.
7954
c9e7db78
JD
79552011-11-05 Jan Djärv <jan.h.d@swipnet.se>
7956
a97f8f3f
JD
7957 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
7958 (unwind_create_frame): New function (Bug#9943).
7959 (Fx_create_frame): Restructure code to be more similar to the one in
7960 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
7961 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
7962 Move terminal->reference_count++ just before making the frame official
7963 (Bug#9943).
7964
7965 * nsterm.m (x_free_frame_resources): New function.
7966 (x_destroy_window): Move code to x_free_frame_resources.
7967
c9e7db78 7968 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
7969 (Fx_create_frame, x_create_tip_frame):
7970 Move terminal->reference_count++ just before making the frame
75f1671a 7971 official. Move initialization of image_cache_refcount and
c9e7db78
JD
7972 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
7973
a6fc3b5c
EZ
79742011-11-05 Eli Zaretskii <eliz@gnu.org>
7975
7976 Support MSVC build with newer versions of Visual Studio.
7977 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
7978 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
7979 nt/gmake.defs.
7980
7981 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
7982 which are not supported by MSVC.
7983 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
7984 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
7985 bitfields.
7986 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
7987 types in bitfields.
7988 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
7989
7990 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
7991
58179cce 79922011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
7993
7994 Support MSVC build with newer versions of Visual Studio.
7995 * w32.c: Don't include w32api.h for MSVC.
7996 (init_environment) [_MSC_VER]: Call sys_access, not _access.
7997
7998 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
7999 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
8000 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
8001 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
8002 e_* cousins.
8003 (alloca) [_MSC_VER]: Define to _alloca.
8004
8005 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
8006
8007 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
8008
a58c13ed
EZ
80092011-11-04 Eli Zaretskii <eliz@gnu.org>
8010
8011 * xdisp.c (note_mouse_highlight): If either of
8012 previous/next-single-property-change returns nil, treat that as
8013 the beginning or the end of the buffer. (Bug#9955)
8014
fe0b6370
JD
80152011-11-04 Jan Djärv <jan.h.d@swipnet.se>
8016
a58c13ed 8017 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
8018 label is not null (Bug#9951).
8019 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
8020 may be NULL.
8021
89bd5ee1
EZ
80222011-11-04 Eli Zaretskii <eliz@gnu.org>
8023
8024 * window.c (Fwindow_body_size): Mention in the doc string that the
8025 return value is in frame's canonical units. (Bug#9949)
8026
84c3edb9
EZ
80272011-11-03 Eli Zaretskii <eliz@gnu.org>
8028
4e2fb5c7
EZ
8029 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
8030
84c3edb9 8031 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 8032 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 8033 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 8034
bc17a887
EZ
80352011-11-01 Eli Zaretskii <eliz@gnu.org>
8036
8037 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
8038 Don't stop backward scan on the continuation glyph, even though
8039 its CHARPOS is positive.
6d5eb5b0
SM
8040 (mouse_face_from_buffer_pos, note_mouse_highlight):
8041 Rename cover_string to disp_string.
bc17a887 8042
4ee88440
MR
80432011-11-01 Martin Rudalics <rudalics@gmx.at>
8044
8045 * window.c (temp_output_buffer_show): Don't use
8046 Vtemp_buffer_show_specifiers.
8047 (Vtemp_buffer_show_specifiers): Remove unused variable.
8048
c2ff3c02
EZ
80492011-10-30 Eli Zaretskii <eliz@gnu.org>
8050
8051 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
8052 past the beginning of the current glyph matrix.
8053
58179cce 80542011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
8055
8056 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
8057 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
8058 HAVE_GTK3 (Bug#9869).
b77a6a7f 8059
3b574623
JD
8060 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
8061 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
8062
b77a6a7f
JD
8063 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
8064
8065 * xterm.c: Declare x_handle_net_wm_state to return int.
8066 (handle_one_xevent): Check if we are iconified but don't have
8067 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
8068 (get_current_wm_state): Return non-zero if not hidden,
8069 check for _NET_WM_STATE_HIDDEN (Bug#9893).
8070 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
8071 (x_handle_net_wm_state): Return what get_current_wm_state returns.
8072 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
8073
196e41e4
PE
80742011-10-29 Paul Eggert <eggert@cs.ucla.edu>
8075
8076 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
8077 so that this new function doesn't get optimized away by a
8078 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
8079
021f2e1a
AS
80802011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8081
8082 * frame.h (MOUSE_HL_INFO): Remove excess parens.
8083
8b058d44
EZ
80842011-10-29 Eli Zaretskii <eliz@gnu.org>
8085
8086 Fix the `xbytecode' command.
8087 * .gdbinit (xprintbytestr): New command.
b50a28de 8088 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
8089 (xbytecode): Print the byte-code string as well.
8090
4452fb80
EZ
80912011-10-29 Kim Storm <storm@cua.dk>
8092
8b058d44
EZ
8093 * alloc.c (which_symbols): New function.
8094
21b72067
AS
80952011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8096
8097 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
8098 line. (Bug#9903)
8099
83ed7b5c
GM
81002011-10-29 Glenn Morris <rgm@gnu.org>
8101
8102 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
8103 Not clear what it was for, and it causes various bugs. (Bug#9839)
8104
5a7a728b
EZ
81052011-10-28 Eli Zaretskii <eliz@gnu.org>
8106
8107 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
8108 possible random value that matches one of those tested as
8109 condition to clear the mouse face.
8110
d3d0842f
CY
81112011-10-28 Chong Yidong <cyd@gnu.org>
8112
8113 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
8114
31b39d13
DN
81152011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
8116
8117 * window.c (make_window): Initialize phys_cursor_on_p.
8118
9aba6043
SM
81192011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
8120
8121 * lisp.h (struct Lisp_Symbol): Update comments.
8122
c20992f4
JB
81232011-10-28 Juanma Barranquero <lekktu@gmail.com>
8124
8125 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
8126
db4f02f2
EZ
81272011-10-28 Eli Zaretskii <eliz@gnu.org>
8128
8129 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
8130 <oslsachem@gmail.com> for helping to debug this.
8131
8132 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
8133 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
8134 (g_b_init_get_glyph_outline_w): New static variables.
8135 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
8136 (GetGlyphOutlineW_Proc): New typedefs.
8137 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
8138 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
8139 New functions.
8140 (w32font_open_internal, compute_metrics):
8141 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
8142 instead of calling the "wide" APIs directly.
8143
8144 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
8145
8146 * w32.h (syms_of_w32font): Add prototype.
8147
87e68db4
JB
81482011-10-27 Juanma Barranquero <lekktu@gmail.com>
8149
8150 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
8151 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
8152 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
8153 (Fmove_to_window_line): Doc fix.
8154
435c1d67
CY
81552011-10-27 Chong Yidong <cyd@gnu.org>
8156
8157 * process.c (make_process): Set gnutls_state to NULL.
8158
8159 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
8160 non-NULL, regardless of GNUTLS_INITSTAGE.
8161 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
8162 an error. Set process slots as soon as we allocate them.
8163
8164 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
8165
9c6c6f49
CY
81662011-10-27 Chong Yidong <cyd@gnu.org>
8167
9aba6043
SM
8168 * gnutls.c (emacs_gnutls_deinit): New function.
8169 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
8170 (Fgnutls_deinit, Fgnutls_boot): Use it.
8171
8172 * process.c (make_process): Initialize GnuTLS credentials to NULL.
8173 (deactivate_process): Call emacs_gnutls_deinit.
8174
657d08d3
JB
81752011-10-27 Juanma Barranquero <lekktu@gmail.com>
8176
8177 * image.c (x_create_x_image_and_pixmap):
8178 * w32.c (sys_rename, w32_delayed_load):
8179 * w32font.c (fill_in_logfont):
8180 * w32reg.c (x_get_string_resource): Silence compiler warnings.
8181
5430d399
JB
81822011-10-26 Juanma Barranquero <lekktu@gmail.com>
8183
8184 * w32fns.c (w32_default_color_map): New function,
8185 extracted from Fw32_default_color_map.
a7ef684b 8186 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 8187
fe0055fa
PE
81882011-10-25 Paul Eggert <eggert@cs.ucla.edu>
8189
8190 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
8191
e6346438
SM
81922011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
8193
8194 * keyboard.c (test_undefined): New function (bug#9751).
8195 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
8196
e112cc37
ET
81972011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
8198
8199 * sysdep.c (init_sys_modes): Fix the check for the controlling
8200 terminal (Bug#6649).
8201
7b5d6677
EZ
82022011-10-20 Eli Zaretskii <eliz@gnu.org>
8203
8204 * dispextern.h (struct bidi_it): New member next_en_type.
8205
8206 * bidi.c (bidi_line_init): Initialize the next_en_type member.
8207 (bidi_resolve_explicit_1): When next_en_pos is valid for the
8208 current character, check also for next_en_type being WEAK_EN.
8209 (bidi_resolve_weak): Don't enter the expensive loop if the current
8210 position is before next_en_pos. Record the bidi type of the first
8211 non-ET, non-BN character we find, in addition to its position.
8212 (bidi_level_of_next_char): Invalidate next_en_type when
8213 next_en_pos is over-stepped.
8214
7da0b018
PE
82152011-10-20 Paul Eggert <eggert@cs.ucla.edu>
8216
8217 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
8218 * editfns.c: Rewrite current-time-zone so that it invokes
8219 the equivalent of (format-time-string "%Z") to get the time zone name.
8220 This fixes a bug when the time zone name contains characters that
8221 need converting from the system time locale to Emacs internal format.
8222 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
8223 that patch fixed format-time-string to do the conversion, but
8224 I forgot to fix current-time-zone.
8225 (format_time_string): New function, containing most of
8226 what Fformat_time_string used to contain.
8227 (Fformat_time_string): Rewrite in terms of format_time_string.
8228 This doesn't change this function's behavior.
8229 (current-time-zone): Rewrite to use format_time_string.
8230 This fixes the bug reported by Michael Schierl in
8231 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
8232 Jason Rumney's 2007-06-07 change worked around this bug, but
8233 didn't fix it.
8234 * systime.h (tzname, timezone): Remove no-longer-used declarations.
8235
8547b010
EZ
82362011-10-19 Eli Zaretskii <eliz@gnu.org>
8237
8238 * xdisp.c (start_display): If the character at POS is displayed
8239 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
8240 (try_window_reusing_current_matrix): If a line ends in a display
8241 vector or the next line starts in a display vector, continue
8242 redrawing the window even though the character position of
8243 start_row was reached.
8547b010
EZ
8244 (Bug#9771, part 2)
8245
4e948d15
CY
82462011-10-18 Chong Yidong <cyd@gnu.org>
8247
8248 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
8249 with nobreak-char-display too.
8250
4787455f
EZ
82512011-10-18 Eli Zaretskii <eliz@gnu.org>
8252
8253 Fix part 3 of bug#9771.
8254 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
8255 (bidi_resolve_neutral): Don't enter the expensive loop looking for
8256 non-neutral characters if the current character is a paragraph
8257 separator (a.k.a. Newline). This avoids running the same
8258 expensive loop twice, once when we consume the preceding newline
8259 and the other time when the line actually needs to be displayed.
8260 Avoid the loop when we see neutrals on the base embedding level
8261 following a character whose directionality is the same as the
8262 paragraph's. This avoids running the expensive loop when a line
8263 ends in a long sequence of neutrals, like control characters.
8264 Add assertion against STRONG_AL type. Slightly rearrange code
8265 that determines the type of a neutral given the first non-neutral
8266 that follows it.
8267 (bidi_level_of_next_char): Set next_en_pos to zero when
8268 invalidating its info.
8269
2c91f553
EZ
82702011-10-17 Eli Zaretskii <eliz@gnu.org>
8271
8272 * xdisp.c (push_display_prop): Determine whether to record string
8273 or buffer position by IT->string, not by IT->method. Allow
8274 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
8275 (move_it_vertically_backward): Don't look for character position
8276 immediately after the newline when in a continuation line.
8277 (Bug#9771, part 1)
2c91f553 8278
c7b08b0d
MR
82792011-10-15 Martin Rudalics <rudalics@gmx.at>
8280
8281 * window.c (coordinates_in_window): Rewrite and delabelize
8282 vertical border check. (Bug#5357) (Bug#9618)
8283
6b02f655
SM
82842011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
8285
8286 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
8287 errors in XSetWindowBorder (bug#9310).
8288
81d40c92
DA
82892011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
8290
8291 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
8292 avoid crash when xmalloc overrun checking is enabled.
8293
d4172c3b
EZ
82942011-10-13 Eli Zaretskii <eliz@gnu.org>
8295
8296 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
8297 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
8298 cursor motion with <left> and <right> arrow keys.
8299
8300 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
8301 some callers set that themselves.
8302
b00eea75
EZ
83032011-10-12 Eli Zaretskii <eliz@gnu.org>
8304
8305 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
8306 display string and the previous row comes from the same string and
8307 is empty. (Bug#9739) (Bug#9738)
8308
8fe012c4
SM
83092011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
8310
8311 * doc.c (get_doc_string): Encode file name (bug#9735).
8312
0074aef2
EZ
83132011-10-12 Eli Zaretskii <eliz@gnu.org>
8314
79beb178
EZ
8315 * bidi.c (bidi_level_of_next_char):
8316 * xdisp.c (get_visually_first_element): Remove old incorrect
8317 comments regarding the Unicode Line Separator character.
8318
0074aef2
EZ
8319 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
8320
6e4b3fbe
DA
83212011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
8322
8323 * alloc.c (Fgc_status): Do not access beyond zombies array
8324 boundary if nzombies > MAX_ZOMBIES.
8325 * alloc.c (dump_zombies): Add missing format specifier.
8326
0324f3af
PE
83272011-10-12 Paul Eggert <eggert@cs.ucla.edu>
8328
b5525cac
PE
8329 * xdisp.c (set_cursor_from_row): Simplify conditionals,
8330 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
8331
0324f3af
PE
8332 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
8333 Some packages use them to denote characters with modifiers.
8334
e9b5f888
AS
83352011-10-11 Andreas Schwab <schwab@linux-m68k.org>
8336
8337 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
8338 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
8339 matching a pp-number. Rename parameter var to var1.
8340
127827c0
SM
83412011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
8342
8343 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
8344
c8fd3bd0
GM
83452011-10-08 Glenn Morris <rgm@gnu.org>
8346
8347 * callint.c (Fcall_interactively): Give a more explicit error for the
8348 'c' case with a non-character input. (Bug#8479)
8349
352ec8ff
EZ
83502011-10-08 Eli Zaretskii <eliz@gnu.org>
8351
03669ccb
EZ
8352 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
8353 lines.
7061c986
EZ
8354 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
8355 lines that are hscrolled on the left.
03669ccb 8356
352ec8ff
EZ
8357 * dispnew.c (buffer_posn_from_coords): Account for a possible
8358 presence of header-line. (Bug#4426)
8359
a66cfb1c
SM
83602011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
8361
6b02f655
SM
8362 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
8363 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 8364
7c5ee88e
PE
83652011-10-07 Paul Eggert <eggert@cs.ucla.edu>
8366
8367 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
8368 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
8369 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
8370 this makes Emacs dump core during garbage collection on rare
8371 occasions. sizeof is obviously inferior to offsetof here, so
8372 stick with offsetof.
8373 (GC_POINTER_ALIGNMENT): New macro.
8374 (mark_memory): Omit 3rd (offset) arg; caller changed.
8375 Don't assume EMACS_INT alignment is the same as pointer alignment.
8376
df1bbe5b
SM
83772011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
8378
8379 * keyboard.c (read_key_sequence_remapped): New var.
8380 (read_key_sequence): Compute remapping in the right buffer.
8381 (command_loop_1): Use read_key_sequence's remapping directly.
8382
51553db6
SM
83832011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
8384
32c1fffd
SM
8385 * dired.c (file_name_completion): Don't expand file name.
8386 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
8387 before checking file name handler.
8388
51553db6
SM
8389 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
8390 they've been requested explicitly (bug#9591).
8391
b6bd1599 83922011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
8393
8394 * keymap.c (Fsingle_key_description): Use make_specified_string
8395 instead of build_string to build string from push_key_description.
8396 (Bug#5193)
8397
f701dc2a
PE
83982011-09-30 Paul Eggert <eggert@cs.ucla.edu>
8399
4222c55d
PE
8400 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
8401 This fixes a Y2038 bug on 64-bit hosts.
8402 * buffer.c (reset_buffer):
8403 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
8404 (Fclear_buffer_auto_save_failure):
8405 Use 0, not -1, to represent an unset failure time, since time_t
8406 might not be signed.
8407
f701dc2a
PE
8408 Remove dependency on glibc malloc internals.
8409 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8410 Move back here from lisp.h, but with their new implementations.
8411 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8412 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
8413 * charset.c (charset_table_init): New static var.
8414 (syms_of_charset): Use it instead of xmalloc. This removes a
8415 dependency on glibc malloc internals. See Eli Zaretskii's comment in
8416 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
8417 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8418 Move back to alloc.c.
8419 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8420 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
8421
9ceebf39
JD
84222011-09-30 Jan Djärv <jan.h.d@swipnet.se>
8423
8424 * nsterm.m (windowDidResize): Call x_set_window_size only when
8425 ns_in_resize is true. Otherwise set pixelwidth/height and
8426 call change_frame_size (Bug#9628).
8427
cb993c58
PE
84282011-09-30 Paul Eggert <eggert@cs.ucla.edu>
8429
3930c88b
PE
8430 Port --enable-checking=all to Fedora 14 x86-64.
8431 * charset.c (syms_of_charset): Also account for glibc malloc's
8432 internal overhead when calculating the initial malloc maximum.
8433
cb993c58
PE
8434 Port --enable-checking=all to Fedora 14 x86.
8435 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8436 Move to lisp.h.
8437 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
8438 (overrun_check_realloc, overrun_check_free):
8439 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
8440 That way, xmalloc returns a properly-aligned pointer even if
8441 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
8442 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
8443 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
8444 into account when calculating the initial malloc maximum.
8445 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8446 Move here from alloc.c, so that charset.c can use it too.
8447 Properly align; the old code wasn't right for common 32-bit hosts
8448 when configured with --enable-checking=all.
8449 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8450 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
8451
31bed486
EZ
84522011-09-29 Eli Zaretskii <eliz@gnu.org>
8453
04c70788 8454 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
8455 use EDOM.
8456
fbcaa2f3
EZ
84572011-09-28 Eli Zaretskii <eliz@gnu.org>
8458
8459 * xdisp.c (compute_display_string_end): If there's no display
8460 string at CHARPOS, return -1.
8461
8462 * bidi.c (bidi_fetch_char): When compute_display_string_end
8463 returns a negative value, treat the character as a normal
8464 character not covered by a display string. (Bug#9624)
8465
a239d4e9
JB
84662011-09-28 Juanma Barranquero <lekktu@gmail.com>
8467
8468 * lread.c (Fread_from_string): Fix typo in docstring.
8469
88652fd5
EZ
84702011-09-27 Eli Zaretskii <eliz@gnu.org>
8471
8472 * xdisp.c (handle_invisible_prop): If invisible text ends on a
8473 newline, reseat the iterator instead of bidi-iterating there one
8474 character at a time. (Bug#9610)
32c1fffd
SM
8475 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
8476 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 8477
ed497dd4
AS
84782011-09-27 Andreas Schwab <schwab@linux-m68k.org>
8479
8480 * lread.c (readevalloop): Use correct code for NBSP.
8481 (read1): Likewise. (Bug#9608)
8482
b2bf61aa
MA
84832011-09-25 Michael Albinus <michael.albinus@gmx.de>
8484
8485 * dbusbind.c (Fdbus_register_signal): When service is not
8486 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
8487
32bbb17c
GM
84882011-09-25 Glenn Morris <rgm@gnu.org>
8489
8490 * buffer.c (truncate-lines): Doc fix.
8491
94e0933e
CY
84922011-09-24 Chong Yidong <cyd@stupidchicken.com>
8493
8494 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
8495 (Fset_window_next_buffers): Doc fix.
8496
cddde921
GM
84972011-09-24 Glenn Morris <rgm@gnu.org>
8498
8499 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
8500
1260aef1
PE
85012011-09-24 Paul Eggert <eggert@cs.ucla.edu>
8502
25b4bfa0
PE
8503 Fix minor problems found by static checking.
8504 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
8505 * indent.c (Fvertical_motion): Fix == vs = typo.
8506
e3cbd34b
EZ
85072011-09-24 Eli Zaretskii <eliz@gnu.org>
8508
a66cfb1c
SM
8509 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
8510 Default value is now t. Doc fix.
6bf7006f 8511
e3cbd34b 8512 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 8513 logic when moving up, not only when moving down. Fix the
e3cbd34b 8514 confusing name and values of the it_overshoot_expected variable;
32c1fffd 8515 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
8516
8517 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
8518 CHARPOS is covered by a display string which includes newlines.
8519 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
8520 is covered by a display string with embedded newlines.
8521
a3de0cbd
MA
85222011-09-24 Michael Albinus <michael.albinus@gmx.de>
8523
8524 * dbusbind.c (Fdbus_register_signal): Add match rule to
8525 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
8526 (Fdbus_register_method, Vdbus_registered_objects_table):
8527 Fix docstring.
a3de0cbd 8528
b260039d
JM
85292011-09-24 Jim Meyering <meyering@redhat.com>
8530
32c1fffd 8531 do not ignore write error for any output size
b260039d
JM
8532 The previous change was incomplete.
8533 While it makes emacs --batch detect the vast majority of stdout
8534 write failures, errors were still ignored whenever the output size is
8535 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
8536 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
8537 && echo FAIL: ignored write error
8538 FAIL: ignored write error
8539 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
8540 && echo FAIL: ignored write error
8541 FAIL: ignored write error
8542 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
8543
8eca8a7c
AS
85442011-09-23 Andreas Schwab <schwab@linux-m68k.org>
8545
8546 * emacs.c (Fkill_emacs): In noninteractive mode exit
8547 non-successfully if a write error occurred on stdout. (Bug#9574)
8548
3341db62
EZ
85492011-09-21 Eli Zaretskii <eliz@gnu.org>
8550
8551 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
8552 the xassert test.
8553
8554 * dispextern.h (struct it): Update the comment documenting what
8555 can it->OBJECT be.
8556
8c203dbf
EZ
85572011-09-20 Eli Zaretskii <eliz@gnu.org>
8558
8559 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
8560 a display string, extend search for cursor position to end of row.
8561 (find_row_edges): If the row ends in a newline from a display
8562 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
8563 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
8564 (Fcurrent_bidi_paragraph_direction): Fix search for previous
8565 non-empty line. Fixes confusing cursor motion with arrow keys at
8566 the beginning of a line that starts with whitespace.
8c203dbf 8567
a4824228
LMI
85682011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
8569
8570 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
8571 (bug#9493).
8572
33ed493b
CY
85732011-09-18 Chong Yidong <cyd@stupidchicken.com>
8574
8575 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
8576 boolean (Bug#9154).
8577
56cd55c8
EZ
85782011-09-18 Eli Zaretskii <eliz@gnu.org>
8579
8580 * xdisp.c (display_line): Record maximum and minimum buffer
8581 positions even if no glyphs were produced (e.g., by a zero-width
8582 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
8583 buffer positions that will be removed from the glyph row because
8584 they don't fit.
c02dcedf
EZ
8585 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
8586 column is beyond frame width: don't subtract 1 "pixel" when
8587 computing width of the stretch.
3e62b7e0
EZ
8588 (reseat_at_next_visible_line_start): Undo the change made on
8589 2011-09-17 that saved paragraph information and restored it after
8590 the call to `reseat'. (Bug#9545)
56cd55c8 8591
5ed99d36 85922011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
8593
8594 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
8595 and turn window cursor on if cleared (Bug#9415).
8596
5ed99d36 85972011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
8598
8599 * search.c (boyer_moore): Take unibyte characters from pattern
8600 literally. (Bug#9458)
8601
9bade7b2
EZ
86022011-09-18 Eli Zaretskii <eliz@gnu.org>
8603
8604 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
8605
e5e9d610
PE
86062011-09-18 Paul Eggert <eggert@cs.ucla.edu>
8607
87e4427a
PE
8608 Fix minor problem found by static checking.
8609 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
8610 initialized, to pacify gcc -Wuninitialized.
8611
e5e9d610
PE
8612 * fileio.c: Report proper errno when syscall falls.
8613 (Finsert_file_contents): Save and restore errno,
8614 so that report_file_error outputs the correct diagnostic.
8615 (Fwrite_region) [CLASH_DETECTION]: Likewise.
8616
a1674f0b
EZ
86172011-09-18 Eli Zaretskii <eliz@gnu.org>
8618
8619 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
8620
fbfb6dd4
EZ
86212011-09-17 Eli Zaretskii <eliz@gnu.org>
8622
8623 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
8624 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
8625
bb187662
EZ
86262011-09-17 Eli Zaretskii <eliz@gnu.org>
8627
1137e8b8 8628 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 8629 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
8630
8631 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
8632 (bidi_find_paragraph_start): Search back for paragraph beginning
8633 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
8634 (bidi_move_to_visually_next): Only trigger paragraph-related
8635 computations when the last character is a newline or at EOB, not
8636 just any NEUTRAL_B. (Bug#9470)
8637
bb187662
EZ
8638 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
8639 truncated lines if point is covered by a display string. (Bug#9524)
8640
2e621251
PE
86412011-09-16 Paul Eggert <eggert@cs.ucla.edu>
8642
8643 * xselect.c: Relax test for outgoing X longs (Bug#9498).
8644 (cons_to_x_long): New function.
8645 (lisp_data_to_selection_data): Use it. Correct the test for
8646 short-versus-long data; it was negated. Break out of vector
8647 loop, for efficiency, when a long datum is discovered.
8648
91a15bc6
SM
86492011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
8650
8651 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
8652
b41c3a35
EZ
86532011-09-16 Eli Zaretskii <eliz@gnu.org>
8654
8655 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
8656 GCC PR/17406) by declaring this function with external scope.
8657
7812ba2d
PE
86582011-09-15 Paul Eggert <eggert@cs.ucla.edu>
8659
8660 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
8661 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
8662
cf7edc2a
AS
86632011-09-15 Andreas Schwab <schwab@linux-m68k.org>
8664
8665 * editfns.c (Fformat): Correctly handle text properties on "%%".
8666
bd01620e
EZ
86672011-09-15 Eli Zaretskii <eliz@gnu.org>
8668
8669 * xterm.c (x_draw_composite_glyph_string_foreground):
8670 * w32term.c (x_draw_composite_glyph_string_foreground):
8671 * term.c (encode_terminal_code):
8672 * composite.c (composition_update_it, get_composition_id):
8673 * xdisp.c (get_next_display_element)
8674 (fill_composite_glyph_string): Add comments about special meaning
8675 of TAB characters in a composition.
8676
a02719a3
PE
86772011-09-15 Paul Eggert <eggert@cs.ucla.edu>
8678
8679 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
8680 This occurs when processing a multibyte format.
8681 Problem reported by Wolfgang Jenker.
a02719a3 8682
72589a3c
JB
86832011-09-15 Johan Bockgård <bojohan@gnu.org>
8684
8685 * xdisp.c (try_cursor_movement): Only check for exact match if
8686 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
8687
1c14176c
PE
86882011-09-14 Paul Eggert <eggert@cs.ucla.edu>
8689
8690 Remove unused external symbols.
8691 * dispextern.h (calc_pixel_width_or_height): Remove decl.
8692 * xdisp.c (calc_pixel_width_or_height): Now static.
8693 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
8694 * indent.c (check_display_width):
8695 * w32term.c: Fix comment to match code.
8696 * xterm.c, xterm.h (x_catching_errors): Remove.
8697
d2eea5b5
PE
86982011-09-14 Paul Eggert <eggert@cs.ucla.edu>
8699
8700 * xselect.c: Use signed conversions more consistently (Bug#9498).
8701 (selection_data_to_lisp_data): Assume incoming selection data are
8702 signed integers, not unsigned. This is to be consistent with
8703 outgoing selection data, which was modified to use signed integers
8704 in as part of the fix to Bug#9196 in response to Jan D.'s comment
8705 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
8706 expects long, not unsigned long.
8707
46888499
EZ
87082011-09-14 Eli Zaretskii <eliz@gnu.org>
8709
8710 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
8711 computation of loop end. Reported by Johan Bockgård
8712 <bojohan@gnu.org>.
8713
ef8ef9fb
CY
87142011-09-13 Chong Yidong <cyd@stupidchicken.com>
8715
8716 * frame.c (Fother_visible_frames_p): Function deleted.
8717
fa819fed
EZ
87182011-09-12 Eli Zaretskii <eliz@gnu.org>
8719
8720 * indent.c (compute_motion): Process display vector front to back
8721 rather than the other way around. (Bug#2496)
8722
2ba8e008
SM
87232011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
8724
8725 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
8726
20f53c69
CY
87272011-09-11 Chong Yidong <cyd@stupidchicken.com>
8728
8729 * minibuf.c (Fread_from_minibuffer): Doc fix.
8730
d562d7a4
EZ
87312011-09-11 Eli Zaretskii <eliz@gnu.org>
8732
8733 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
8734 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
8735
1c4d7f3d
LMI
87362011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
8737
8738 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
8739 value for non-existent files.
8740
b885bf36
EZ
87412011-09-11 Eli Zaretskii <eliz@gnu.org>
8742
8743 * fileio.c (Finsert_file_contents): If the file cannot be opened,
8744 set its "size" to -1. This will set the modtime_size field of
8745 the corresponding buffer to -1, which is what
8746 verify-visited-file-modtime expects for files that do not exist.
8747 (Bug#9139)
8748
6612f0bf
PE
87492011-09-11 Paul Eggert <eggert@cs.ucla.edu>
8750
8751 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
8752 here ...
8753 * lisp.h: ... from here. push_key_description is no longer
8754 defined in keyboard.c, so its declaration should not be in
8755 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
8756 logically belongs with push_key_description.
8757
dfb3f755
PE
87582011-09-10 Paul Eggert <eggert@cs.ucla.edu>
8759
8760 * buffer.h: Include <sys/types.h> instead of <time.h>.
8761 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
8762 Problem reported by Herbert J. Skuhra.
8763
3134906c
LMI
87642011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
8765
8766 * xml.c (parse_region): Make the parsing work for
8767 non-comment-starting XML files again (bug#9144).
8768
8d903f4e
AS
87692011-09-10 Andreas Schwab <schwab@linux-m68k.org>
8770
8771 * image.c (gif_load): Fix calculation of bottom and right corner.
8772 (Bug#9468)
8773
80ad64f4
EZ
87742011-09-10 Eli Zaretskii <eliz@gnu.org>
8775
8776 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
8777 redisplay in small windows.
8778
208a048d
EZ
87792011-09-09 Eli Zaretskii <eliz@gnu.org>
8780
8781 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
8782
9b1c252e
MR
87832011-09-08 Martin Rudalics <rudalics@gmx.at>
8784
8785 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
8786 Operate on live windows only.
8787
2949f33b
JB
87882011-09-08 Juanma Barranquero <lekktu@gmail.com>
8789
8790 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
8791
e08dcafd
EZ
87922011-09-07 Eli Zaretskii <eliz@gnu.org>
8793
8794 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
8795 only under bidi iteration.
8796
115b96bd
JD
87972011-09-07 Jan Djärv <jan.h.d@swipnet.se>
8798
8799 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
8800
c8199d0f
PE
88012011-09-06 Paul Eggert <eggert@cs.ucla.edu>
8802
8803 isnan: Fix porting problem to Solaris 10 with bundled gcc.
8804 Without this fix, the command to link temacs failed due to an
8805 undefined symbol __builtin_isnan. This is because
8806 /usr/include/iso/math_c99.h #defines isnan(x) to
8807 __builtin_isnan(x), but the bundled gcc, which identifies itself
8808 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
8809 a __builtin_isnan.
8810 * floatfns.c (isnan): #undef, and then #define to a clone of
8811 what's in data.c.
8812 (Fisnan): Always define, since it's always available now.
8813 (syms_of_floatfns): Always define isnan at the Lisp level.
8814
e39b275c 88152011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
8816
8817 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
8818
b2db44d9 88192011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 8820
f4af5137 8821 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
8822 The previous code assumed that file offsets (off_t values) fit in
8823 EMACS_INT variables, which is not true on typical 32-bit hosts.
8824 The code messed up by falsely reporting buffer overflow in cases
8825 such as (insert-file-contents "big" nil 1 2) into an empty buffer
8826 when "big" contains more than 2**29 bytes, even though this
8827 inserts just one byte and does not overflow the buffer.
8828 (Finsert_file_contents): Store file offsets as off_t
8829 values, not as EMACS_INT values. Check for overflow when
8830 converting between EMACS_INT and off_t. When checking for
8831 buffer overflow or for overlap, take the offsets into account.
8832 Don't use EMACS_INT for small values where int suffices.
8833 When checking for overlap, fix a typo: ZV was used where
8834 ZV_BYTE was intended.
8835 (Fwrite_region): Don't assume off_t fits into 'long'.
8836 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
8837
ecfc0a49
MA
88382011-09-05 Michael Albinus <michael.albinus@gmx.de>
8839
8840 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
8841
6511acf2 88422011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 8843
0999621a 8844 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
8845
8846 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 8847 (esprintf, exprintf, evxprintf): New functions.
62f19c19 8848 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 8849 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
8850 (modify_event_symbol): Do not assume that the length of
8851 name_alist_or_stem is safe to alloca and fits in int.
8852 (Fexecute_extended_command): Likewise for function name and binding.
8853 (Frecursion_depth): Wrap around reliably on integer overflow.
8854 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
8855 since some callers pass EMACS_INT values.
8856 (Fsingle_key_description): Don't crash if symbol name contains more
8857 than MAX_ALLOCA bytes.
8858 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
8859 (get_minibuffer): Arg is now EMACS_INT, not int.
8860 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 8861 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
8862 * window.h (command_loop_level, minibuf_level): Reflect API changes.
8863
2be7d702
PE
8864 * dbusbind.c (signature_cat): New function.
8865 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
8866 Do not overrun buffer; instead, report string overflow.
8867
9d1df220
PE
8868 * dispnew.c (add_window_display_history): Don't overrun buffer.
8869 Truncate instead; this is OK since it's just a log.
8870
33ef5c64
PE
8871 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
8872 even if the time zone offset is outlandishly large.
8873 Don't mishandle offset == INT_MIN.
8874
66c6fdd5
PE
8875 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
8876 when creating daemon; the previous buffer-overflow check was incorrect.
8877
d749b01b
PE
8878 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
8879 which has the guts of the old verror function.
8880
b5cd1905
PE
8881 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
8882 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
8883
6e1a67fb
PE
8884 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
8885 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 8886 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 8887 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
8888 length of string rather than counting it via multiple sprintfs;
8889 that's simpler and more reliable.
c21721cc
PE
8890 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
8891 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
8892 sprintf, in case result does not fit in int.
8893
c57b67fc
PE
8894 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
8895 (fontset_from_font): Print it.
8896
8a401434
PE
8897 * frame.c (tty_frame_count): Now printmax_t, not int.
8898 (make_terminal_frame, set_term_frame_name): Print it.
8899 (x_report_frame_params): In X, window IDs are unsigned long,
8900 not signed long, so print them as unsigned.
8901 (validate_x_resource_name): Check for implausibly long names,
8902 and don't assume name length fits in 'int'.
8903 (x_get_resource_string): Don't blindly alloca invocation name;
8904 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
8905 not fit in int.
8906
6e1a67fb
PE
8907 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
8908 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
8909 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
8910
0df02bf3
PE
8911 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
8912 Use esprintf, not sprintf, in case result does not fit in int.
8913
48e30793
PE
8914 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
8915 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
8916 it as a large positive number.
8917 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
8918 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
8919
a66ff6d8
PE
8920 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
8921 in case result does not fit in int.
8922
aca216ff
PE
8923 * print.c (float_to_string): Detect width overflow more reliably.
8924 (print_object): Make sprintf buffer a bit bigger, to avoid potential
8925 buffer overrun. Don't assume list length fits in 'int'. Treat
8926 print length of 0 as 0, not as infinity; to be consistent with other
8927 uses of print length in this function. Don't overflow print length
8928 index. Don't assume hash table size fits in 'long', or that
8929 vectorlike size fits in 'unsigned long'.
8930
31c286f7
PE
8931 * process.c (make_process): Use printmax_t, not int, to format
8932 process-name gensyms.
8933
55e5faa1
PE
8934 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
8935
80f2e268
PE
8936 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
8937 to avoid potential buffer overrun.
8938
670741ab
PE
8939 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
8940 if X resource line is longer than 512 bytes.
8941
b7163a50
PE
8942 * xfns.c (x_window): Make sprintf buffer a bit bigger
8943 to avoid potential buffer overrun.
8944
ae58ff1f
PE
8945 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
8946
c43c8a6a
PE
8947 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
8948
3f8236f4
PE
89492011-09-04 Paul Eggert <eggert@cs.ucla.edu>
8950
53e9fe90 8951 Integer overflow fixes for scrolling, etc.
6511acf2
PE
8952 Without these, Emacs silently mishandles large integers sometimes.
8953 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
8954 it were "C-u 1 M-x recenter" on a typical 64-bit host.
8955
6511acf2
PE
8956 * xdisp.c (try_window_id): Check Emacs fixnum range before
8957 converting to 'int'.
806add1d 8958
6511acf2 8959 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
8960 Check that an Emacs fixnum is in range before assigning it to 'int'.
8961 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
8962 values converted from Emacs fixnums.
8963 (Frecenter): Don't wrap around a line count if it is out of 'int'
8964 range; instead, treat it as an extreme value.
8965 (Fset_window_configuration, compare_window_configurations):
8966 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
8967
6511acf2
PE
8968 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
8969 that can exceed INT_MAX. Check that EMACS_INT value is in range
8970 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
8971 (match_limit): Don't assume that a fixnum can fit in 'int'.
8972
6511acf2 8973 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
8974 exceed INT_MAX.
8975
6511acf2 8976 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
8977 (Fvertical_motion): Don't wrap around LINES values that don't fit
8978 in 'int'. Instead, treat them as extreme values. This is good
8979 enough for windows, which can't have more than INT_MAX lines anyway.
8980
fcb901a7
LMI
89812011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
8982
0f2f6b6d
LMI
8983 * Require libxml/parser.h to avoid compilation warning.
8984
fcb901a7
LMI
8985 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
8986
8987 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
8988 since this reportedly can destroy thread storage.
8989
6e20a0d4
CY
89902011-08-30 Chong Yidong <cyd@stupidchicken.com>
8991
8992 * syntax.c (find_defun_start): Update all cache variables if
8993 exiting early (Bug#9401).
8994
148ae00e
EZ
89952011-08-30 Eli Zaretskii <eliz@gnu.org>
8996
f6cfbd8f
EZ
8997 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
8998
148ae00e
EZ
8999 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
9000 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
9001 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
9002
9003 * term.c (tty_append_glyph): New function.
9004 (produce_stretch_glyph): Static function and its prototype deleted.
9005
a66cfb1c
SM
9006 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
9007 Add prototypes.
148ae00e 9008
c4a07a4c
PE
90092011-08-29 Paul Eggert <eggert@cs.ucla.edu>
9010
9011 * image.c (parse_image_spec): Check for nonnegative, not for positive,
9012 when checking :margin (Bug#9390).
9013 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 9014 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
9015 so that the name doesn't mislead. All uses changed.
9016
6bc8cd65
JB
90172011-08-28 Johan Bockgård <bojohan@gnu.org>
9018
9019 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
9020 set_tty_hooks.
9021
dca4927e
EZ
90222011-08-27 Eli Zaretskii <eliz@gnu.org>
9023
9024 * xdisp.c (move_it_to): Don't bail out early when reaching
9025 position beyond to_charpos, if we are scanning backwards.
9026 (move_it_vertically_backward): When DY == 0, make sure we get to
9027 the first character in the line after the newline.
9028
f2cad773
PE
90292011-08-27 Paul Eggert <eggert@cs.ucla.edu>
9030
9031 * ccl.c: Improve and simplify overflow checking (Bug#9196).
9032 (ccl_driver): Do not generate an out-of-range pointer.
9033 (Fccl_execute_on_string): Remove unnecessary check for
9034 integer overflow, noted by Stefan Monnier in
9035 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
9036 Remove a FIXME that didn't need fixing.
9037 Simplify the newly-introduced buffer reallocation code.
9038
0cae2cdb
JB
90392011-08-27 Juanma Barranquero <lekktu@gmail.com>
9040
9041 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
9042
5fc295a4 90432011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 9044
70c60eb2 9045 Integer and memory overflow issues (Bug#9196).
726e0ab1 9046
d31850da
PE
9047 * doc.c (get_doc_string): Rework so that
9048 get_doc_string_buffer_size is the actual buffer size, rather than
9049 being 1 less than the actual buffer size; this makes xpalloc more
9050 convenient.
9051
a69fbedb
PE
9052 * image.c (x_allocate_bitmap_record, cache_image):
9053 * xselect.c (Fx_register_dnd_atom):
9054 Simplify previous changes by using xpalloc.
9055
fe5c5d37
PE
9056 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
9057 since either will do and ptrdiff_t is convenient with xpalloc.
9058
0065d054
PE
9059 * charset.c (charset_table_size)
9060 (struct charset_sort_data.priority): Now ptrdiff_t.
9061 (charset_compare): Don't overflow if priorities differ greatly.
9062 (Fsort_charsets): Don't assume list length fits in int.
9063 Check for size-calculation overflow when allocating sort data.
9064 (syms_of_charset): Allocate an initial charset table that is
9065 just under 64 KiB, to avoid problems with glibc malloc and mmap.
9066
9067 * cmds.c (internal_self_insert): Check for size-calculation overflow.
9068
9069 * composite.h (struct composition.glyph_len): Now int, not unsigned.
9070 The actual value is always <= INT_MAX, and leaving it unsigned made
9071 overflow checking harder.
9072
9073 * dispextern.h (struct glyph_matrix.rows_allocated)
9074 (struct face_cache.size): Now ptrdiff_t, for convenience in use
9075 with xpalloc. The values are still always <= INT_MAX.
9076
9077 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
9078
9079 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
9080 (SAFE_NALLOCA): New macro.
9081
9082 * region-cache.c (struct boundary.pos, find_cache_boundary)
9083 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
9084 (set_cache_region, invalidate_region_cache)
9085 (revalidate_region_cache, know_region_cache, region_cache_forward)
9086 (region_cache_backward, pp_cache):
9087 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
9088 so that ptrdiff_t * can be passed to xpalloc.
9089 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
9090 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
9091 (pp_cache): Don't assume cache_len fits in int.
9092 * region-cache.h: Adjust extern decls to match.
9093
9094 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
9095 EMACS_INT, since either will do, for xpalloc.
9096
9097 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
9098 (xnmalloc, xnrealloc, xpalloc): New functions.
9099
726e0ab1
PE
9100 * bidi.c (bidi_shelve_header_size): New constant.
9101 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
9102 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
9103
51f30bc5 9104 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
9105 * buffer.c (overlays_at, overlays_in, record_overlay_string)
9106 (overlay_strings):
9107 Don't update size of array until after memory allocation succeeds,
9108 because xmalloc/xrealloc may not return.
0065d054
PE
9109 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
9110 now that we have proper integer overflow checking.
9111 (record_overlay_string, overlay_strings): Catch overflows when
9112 calculating size of overlay_str_buf.
726e0ab1 9113
0065d054
PE
9114 * callproc.c (Fcall_process): Check for size overflow when
9115 calculating size of args2.
9116 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
9117 Normally we prefer signed values, but sticking with ptrdiff_t would
9118 require adding more-complicated checks.
726e0ab1
PE
9119
9120 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
9121 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
9122 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 9123 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
9124
9125 * character.c (Fstring): Check for size-calculation overflow.
9126
9127 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
9128 unnecessary integer overflow. Check for size overflow.
9129 (encode_coding_object): Don't update size until xmalloc succeeds.
9130
9131 * composite.c (get_composition_id): Check for overflow in glyph
9132 length calculations.
9133
9134 Integer and memory overflow fixes for display code.
9135 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
9136 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
9137 (scrolling_window): Check for overflow in size calculations.
9138 (line_draw_cost, realloc_glyph_pool, add_row_entry):
9139 Don't assume glyph table len fits in int.
9140 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
9141 (row_table_size): Now ptrdiff_t, not int.
9142 (scrolling_window): Avoid overflow in size calculations.
9143 Don't update size until allocation succeeds.
9144 * fns.c (concat): Check for overflow in size calculations.
9145 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
9146 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9147 (NEXT_ALMOST_PRIME_LIMIT): New constant.
9148
9149 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
9150 (get_doc_string): Check for size calculation overflow.
9151 Don't update size until allocation succeeds.
9152 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
9153 EMACS_INT, where ptrdiff_t will do.
9154 (Fsubstitute_command_keys): Check for string overflow.
9155
9156 * editfns.c (set_time_zone_rule): Don't assume environment length
9157 fits in int.
9158 (message_length): Now ptrdiff_t, not int.
9159 (Fmessage_box): Don't update size until allocation succeeds.
9160 Don't assume message length fits in int.
9161 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
9162
0065d054
PE
9163 * emacs.c (main): Do not reallocate argv, since there is a null at
9164 the end that can be overwritten, and this way there's no need to
9165 worry about size-calculation overflow.
9166 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
9167
9168 * eval.c (init_eval_once, grow_specpdl): Don't update size until
9169 alloc succeeds.
9170 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
9171
9172 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
9173 (x_set_scroll_bar_width, x_figure_window_size):
9174 Check for integer overflow.
9175 (x_set_alpha): Do not assume XINT fits in int.
9176
9177 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
9178 This is for the members text_lines, text_cols, total_lines, total_cols,
9179 where the system imposes an 'int' limit.
9180
9181 * fringe.c (Fdefine_fringe_bitmap):
9182 Don't update size until alloc works.
9183
9184 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
9185 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
9186
9187 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
9188 Check for size-calculation overflow.
9189 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
9190 do, as we prefer signed integers.
9191 (id_to_widget.max_size, id_to_widget.used)
9192 (xg_store_widget_in_map, xg_remove_widget_from_map)
9193 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
9194 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
9195 Use and return ptrdiff_t, not int.
9196 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
9197 * gtkutil.h: Change prototypes to match the above.
9198
9199 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
9200 are duplicate now that they've been promoted to lisp.h.
9201 (x_allocate_bitmap_record, x_alloc_image_color)
9202 (make_image_cache, cache_image, xpm_load):
9203 Don't update size until alloc is done.
9204 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
9205 (x_detect_edges):
3256efce 9206 Check for size calculation overflow.
726e0ab1
PE
9207 (ct_colors_allocated_max): New constant.
9208 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
9209 overflow.
3256efce 9210
726e0ab1
PE
9211 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
9212 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
9213 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
9214 Use ptrdiff_t, not int, to count maps.
9215 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
9216 calculations. Don't update size until allocation succeeds.
9217 Redo calculations to avoid overflow.
726e0ab1
PE
9218 * keyboard.h: Change prototypes to match the above.
9219
9220 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
9221 to count maps.
9222 (current_minor_maps): Check for size calculation overflow.
9223 * keymap.h: Change prototypes to match the above.
9224
9225 * lread.c (read1, init_obarray): Don't update size until alloc done.
9226
9227 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
9228 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
9229
726e0ab1
PE
9230 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
9231 Now ptrdiff_t, not int.
9232 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
9233 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
9234
9235 * process.c (Fnetwork_interface_list): Check for overflow
9236 in size calculation.
9237
9238 * region-cache.c (move_cache_gap): Check for size calculation overflow.
9239
9240 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
9241 overflow. Don't bother calling xmalloc when xrealloc will do.
9242
9243 * search.c (Freplace_match): Check for size calculation overflow.
9244 (Fset_match_data): Don't assume list lengths fit in 'int'.
9245
9246 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
9247 for command line length. Do not attempt to address one before the
9248 beginning of an array, as that's not portable.
9249
9250 * term.c (max_frame_lines): Remove; unused.
9251 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
9252 not int.
9253 (encode_terminal_code, calculate_costs): Check for size
9254 calculation overflow.
9255 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
9256 table lengths and related sizes. Don't update size until alloc
9257 done. Redo calculations to avoid overflow.
9258 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
9259
9260 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
9261 subtracting pointers.
9262 (gobble_line): Check for overflow more carefully. Don't update size
9263 until alloc done.
9264
9265 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
9266 Don't update size until alloc done.
9267 Redo size calculations to avoid overflow.
9268 Check for size calculation overflow.
0065d054 9269 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
9270
9271 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
9272 Use ptrdiff_t, not int, for sizes.
9273 (store_mode_line_noprop_char): Don't update size until alloc done.
9274
0065d054
PE
9275 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
9276 Use ptrdiff_t, not int, for sizes.
9277 (Finternal_make_lisp_face, cache_face):
9278 Check for size calculation overflow.
9279 (cache_face): Treat size calculation overflows as if they were
9280 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
9281
9282 * xfns.c (x_encode_text, x_set_name_internal)
9283 (Fx_change_window_property): Use ptrdiff_t, not int, to count
9284 sizes, since they can exceed INT_MAX in size. Check for size
9285 calculation overflow.
9286
0065d054
PE
9287 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
9288 (xg_select): Check for size calculation overflow.
726e0ab1
PE
9289 Don't update size until alloc done.
9290
0065d054 9291 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 9292 as sprintf is limited to int lengths.
1d526e2f 9293
252c5ee1
PE
9294 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
9295 (X_LONG_MIN): New macros.
864d7ce7
PE
9296 Use them to make the following changes clearer.
9297 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
9298 This change doesn't affect the value now, but it may help remind
9299 future maintainers not to raise the value too much later.
9300 (SELECTION_QUANTUM): Remove, replacing with ...
9301 (selection_quantum): ... new function, which avoids overflow.
9302 All uses changed.
9303 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
9304 assumption that selection length fits in 'int'.
9305 (x_reply_selection_request, x_handle_selection_request)
9306 (x_get_window_property, receive_incremental_selection)
9307 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
9308 (lisp_data_to_selection_data, clean_local_selection_data):
9309 Use ptrdiff_t, not int, to record length of selection.
9310 (x_reply_selection_request, x_get_window_property)
9311 (receive_incremental_selection, x_property_data_to_lisp):
9312 Redo calculations to avoid overflow.
9313 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 9314 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
9315 something.
9316 (x_get_window_property, receive_incremental_selection)
9317 (lisp_data_to_selection_data, x_property_data_to_lisp):
9318 Check for size-calculation overflow.
9319 (x_get_window_property, receive_incremental_selection)
9320 (lisp_data_to_selection_data, Fx_register_dnd_atom):
9321 Don't store size until memory allocation succeeds.
9322 (x_get_window_property): Plug memory leak on memory exhaustion.
9323 Don't double-block input; malloc is safe here. Don't assume 2**34
9324 - 4 fits in unsigned long. Add an xassert to check
9325 XGetWindowProperty overflow. Be more careful about overflow
9326 calculations, and distinguish size from memory overflow better.
9327 (receive_incremental_selection): When tracing, don't assume
9328 unsigned int is less than INT_MAX.
9329 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
9330 harmful) conversions of unsigned short to int.
9331 (lisp_data_to_selection_data): Don't assume that integers
9332 in the range -65535 through -1 fit in an X unsigned short.
9333 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
9334 result parameters unless successful. Rely on cons_to_unsigned
9335 to report problems with elements; the old code wasn't right anyway.
9336 (x_check_property_data): Check for int overflow; we cannot use
9337 a wider type due to X limits.
9338 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
9339
726e0ab1 9340 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 9341
0065d054
PE
9342 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
9343 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
9344 (x_color_cells): Don't store size until memory allocation succeeds.
9345 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 9346 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
9347 (x_term_init): Don't assume length fits in int (sprintf is limited
9348 to int size).
bc18e09d 9349
ebfa62c0
PE
9350 Use ptrdiff_t for composition IDs.
9351 * character.c (lisp_string_width):
9352 * composite.c (composition_table_size, n_compositions)
9353 (get_composition_id, composition_gstring_from_id):
9354 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
9355 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
9356 * window.c (Frecenter):
9357 Use ptrdiff_t, not int, for composition IDs.
9358 * composite.c (get_composition_id): Check for integer overflow.
9359 * composite.h: Adjust prototypes to match the above changes.
9360
d3411f89
PE
9361 Use ptrdiff_t for hash table indexes.
9362 * category.c (hash_get_category_set):
9363 * ccl.c (ccl_driver):
9364 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
9365 * coding.c (coding_system_charset_list, detect_coding_system):
9366 * coding.h (struct coding_system.id):
9367 * composite.c (get_composition_id, gstring_lookup_cache):
9368 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
9369 * image.c (xpm_get_color_table_h):
9370 * lisp.h (hash_lookup, hash_put):
9371 * minibuf.c (Ftest_completion):
9372 Use ptrdiff_t for hash table indexes, not int (which is too
9373 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
9374 32-bit --with-wide-int hosts).
9375
e097a6fa
PE
9376 * charset.c (Fdefine_charset_internal): Check for integer overflow.
9377 Add a FIXME comment about memory leaks.
9378 (syms_of_charset): Don't assume xmalloc returns.
9379
5637687f
PE
9380 Don't assume that stated character widths fit in int.
9381 * character.c (Fchar_width, c_string_width, lisp_string_width):
9382 * character.h (CHAR_WIDTH):
9383 * indent.c (MULTIBYTE_BYTES_WIDTH):
9384 Use sanitize_char_width to avoid undefined and/or bad behavior
9385 with outlandish widths.
a66cfb1c 9386 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
9387 now that we have two such functions. All uses changed.
9388 (sanitize_char_width): New inline function.
9389
a2271ba2
PE
9390 Don't assume that tab-width fits in int.
9391 * character.h (sanitize_width): New inline function.
9392 (SANE_TAB_WIDTH): New macro.
9393 (ASCII_CHAR_WIDTH): Use it.
9394 * indent.c (sane_tab_width): Remove. All uses replaced by
9395 SANE_TAB_WIDTH (current_buffer).
9396 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
9397
18c52557
PE
9398 * fileio.c: Integer overflow issues with file modes.
9399 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
9400
caeeedc1
PE
9401 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
9402 Remove unreachable code.
9403 (read_hex, load_charset_map_from_file): Check for integer overflow.
9404
6df6ae42 9405 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
9406 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
9407 (x_send_scroll_bar_event): Likewise. Check that the size does not
9408 exceed limits imposed by XClientMessageEvent, as well as the usual
9409 ptrdiff_t and size_t limits.
9410
b13995db
PE
9411 * keyboard.c: Overflow, signedness and related fixes.
9412 (make_lispy_movement): Use same integer type in forward decl
9413 that is used in the definition.
9414 (read_key_sequence, keyremap_step):
9415 Change bufsize argument back to int, undoing my 2011-03-30 change.
9416 We prefer signed types, and int is wide enough here.
9417 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
9418 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
9419 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
9420 length, not size_t. Use ptrdiff_t for index, not int.
9421 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
9422 possibility of integer overflow.
9423
13464394
PE
9424 Overflow, signedness and related fixes for images.
9425
9426 * dispextern.h (struct it.stack[0].u.image.image_id)
9427 (struct_it.image_id, struct image.id, struct image_cache.size)
9428 (struct image_cache.used, struct image_cache.ref_count):
9429 * gtkutil.c (update_frame_tool_bar):
9430 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
9431 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
9432 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
9433 * nsmenu.m (update_frame_tool_bar):
9434 * xdisp.c (calc_pixel_width_or_height):
9435 * xfns.c (image_cache_refcount):
9436 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
9437 on typical 64-bit hosts.
9438
9439 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9440 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
9441 Omit unnecessary casts to int.
9442 (parse_image_spec): Check that integers fall into 'int' range
9443 when the callers expect that.
9444 (image_ascent): Redo ascent calculation to avoid int overflow.
9445 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
9446 (lookup_image): Remove unnecessary tests.
9447 (xbm_image_p): Locals are now of int, not EMACS_INT,
9448 since parse_image_check makes sure they fit into int.
9449 (png_load, gif_load, svg_load_image):
9450 Prefer int to unsigned where either will do.
9451 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
9452 old tiff_error_handler and tiff_warning_handler.
9453 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
9454 stack buffer overflows. It uses only the features of vsnprintf
9455 that are common to both POSIX and native Microsoft.
9456 (tiff_error_handler, tiff_warning_handler): Use it.
9457 (tiff_load, gif_load, imagemagick_load_image):
9458 Don't assume :index value fits in 'int'.
9459 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
9460 (imagemagick_load_image): Check that crop parameters fit into
9461 the integer types that MagickCropImage accepts. Don't assume
9462 Vimagemagick_render_type has a nonnegative value. Don't assume
9463 size_t fits in 'long'.
9464 (gs_load): Use printmax_t to print the widest integers possible.
9465 Check for integer overflow when computing image height and width.
9466
c11821d4
EZ
94672011-08-26 Eli Zaretskii <eliz@gnu.org>
9468
9469 * xdisp.c (redisplay_window): Don't force window start if point
9470 will be invisible in the resulting window. (Bug#9324)
9471
0c95fcf7
EZ
94722011-08-25 Eli Zaretskii <eliz@gnu.org>
9473
9474 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
9475 the display spec is of the form `(space ...)'.
9476 (handle_display_spec): Return the value returned by
9477 handle_single_display_spec, not just 1 or zero.
9478 (handle_single_display_spec): If the display spec is of the form
9479 `(space ...)', and specifies display in the text area, return 2
9480 rather than 1.
fee65a97 9481 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
9482 accurately, and prefer exact match for point under bidi.
9483 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
9484
9485 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
9486 into disp_prop; all users changed.
9487
9488 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
9489 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
9490 for the text covered by the display property.
9491
e4ed06f1
CY
94922011-08-25 Chong Yidong <cyd@stupidchicken.com>
9493
9494 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
9495 Change return value to nil.
9496 (Frecord_buffer): Delete unused function.
9497
f67cdd7f
EZ
94982011-08-24 Eli Zaretskii <eliz@gnu.org>
9499
5980d4c6
EZ
9500 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
9501 buffers, return left-to-right.
8610fe8b
EZ
9502 (set_cursor_from_row): Consider candidate row a win if its glyph
9503 represents a newline and point is on that newline. Fixes cursor
9504 positioning on the newline at EOL of R2L text within L2R
9505 paragraph, and vice versa.
9506 (try_cursor_movement): Check continued rows, in addition to
9507 continuation rows. Fixes unwarranted scroll when point enters a
9508 continued line of R2L text within an L2R paragraph, or vice versa.
9509 (cursor_row_p): Consider the case of point being equal to
9510 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
9511 from the end of a short line to the beginning of a continued line
9512 of R2L text within L2R paragraph.
9513 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
9514 composed characters.
5980d4c6 9515
f67cdd7f
EZ
9516 * bidi.c (bidi_check_type): Use xassert.
9517 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
9518 members.
9519
bca633fb
EZ
95202011-08-23 Eli Zaretskii <eliz@gnu.org>
9521
9522 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
9523 a character.
9524
4a5885a7
CY
95252011-08-23 Chong Yidong <cyd@stupidchicken.com>
9526
9527 * nsfont.m (ns_otf_to_script): Fix typo.
9528
0902a04e
KH
95292011-08-22 Kenichi Handa <handa@m17n.org>
9530
9531 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
9532 extra slot even if the purpose is char-code-property-table.
9533
1a2e6670
EZ
95342011-08-23 Eli Zaretskii <eliz@gnu.org>
9535
8ddde651
EZ
9536 * xdisp.c (redisplay_window): When computing centering_position,
9537 account for the height of the header line. (Bug#8874)
9538
425cc014
EZ
9539 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
9540 instead of CHAR_TO_BYTE. Fixes a crash when a completion
9541 candidate is selected by the mouse, and that candidate has a
9542 composed character under the mouse.
9543
1a2e6670
EZ
9544 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
9545 coordinates reported by pos-visible-in-window-p for a composed
9546 character in column zero.
9547
8b76d6f8
SM
95482011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
9549
9550 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
9551
dac347dd
EZ
95522011-08-22 Eli Zaretskii <eliz@gnu.org>
9553
9554 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
9555 consider it a hit if to_charpos is anywhere in the range of the
9556 composed buffer positions.
9557
e013fb34
CY
95582011-08-22 Chong Yidong <cyd@stupidchicken.com>
9559
9560 * image.c (gif_load): Don't assume that each subimage has the same
9561 dimensions as the base image. Handle disposal method that is
9562 "undefined" by the gif spec (Bug#9335).
9563
bd1ba3e8
CY
95642011-08-20 Chong Yidong <cyd@stupidchicken.com>
9565
9566 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 9567 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 9568
54a1215b
EZ
95692011-08-19 Eli Zaretskii <eliz@gnu.org>
9570
823564e5
EZ
9571 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
9572 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
9573 from an Org mode buffer to a Speedbar frame.
9574
54a1215b
EZ
9575 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
9576 a composition, take its buffer position from IT->cmp_it.charpos.
9577 Fixes cursor positioning at the beginning of a line that begins
9578 with a composed character.
9579
9778ebcc
EZ
95802011-08-18 Eli Zaretskii <eliz@gnu.org>
9581
0be6ee06
EZ
9582 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
9583 character bidirectional type, use STRONG_L instead. Fixes crashes
9584 in a buffer produced by `describe-categories'.
9585
9778ebcc
EZ
9586 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
9587 members before the level stack, so they would be saved and
9588 restored when copying iterator state. Fixes incorrect reordering
9589 around TABs covered by display properties.
9590
156bffbe
AS
95912011-08-18 Andreas Schwab <schwab@linux-m68k.org>
9592
6b02f655 9593 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 9594
72ad093b
CY
95952011-08-17 Chong Yidong <cyd@stupidchicken.com>
9596
9597 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
9598 (internal_condition_case_2, internal_condition_case_n):
9599 Remove unnecessary aborts (Bug#9081).
72ad093b 9600
35774242
EZ
96012011-08-17 Eli Zaretskii <eliz@gnu.org>
9602
9603 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
9604 has no `load' handler, try opening the file locally. (Bug#9311)
9605
db76dd85
KB
96062011-08-16 Ken Brown <kbrown@cornell.edu>
9607
9608 * gmalloc.c: Expand comment.
9609
b215eee5
EZ
96102011-08-16 Eli Zaretskii <eliz@gnu.org>
9611
9612 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
9613 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
9614
a4579d33
KB
96152011-08-16 Ken Brown <kbrown@cornell.edu>
9616
9617 Fix memory allocation problems in Cygwin build (Bug#9273).
9618
9619 * unexcw.c ( __malloc_initialized): Declare external variable.
9620 (fixup_executable): Force the dumped emacs to reinitialize malloc.
9621
8b76d6f8
SM
9622 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
9623 New variables.
a4579d33
KB
9624 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
9625 dumped emacs.
9626 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
9627 in the static heap.
9628 [CYGWIN] (special_realloc): New function.
9629 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
9630 requests to realloc storage in the static heap.
9631
3ebec551
PE
96322011-08-15 Paul Eggert <eggert@cs.ucla.edu>
9633
9634 * bidi.c (bidi_initialize): Remove unused local.
9635
9fd8be00
EZ
96362011-08-15 Eli Zaretskii <eliz@gnu.org>
9637
6b02f655
SM
9638 * bidimirror.h:
9639 * biditype.h: Remove file.
9640 * makefile.w32-in ($(BLD)/bidi.$(O)):
9641 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
9642
9643 * dispextern.h: Fix a typo in the comment to bidi_type_t.
9644
9645 * chartab.c: Improve commentary for the uniprop_table API.
9646
32413314
EZ
9647 * bidi.c (bidi_paragraph_init): Support zero value of
9648 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
9649 (bidi_initialize): Use uniprop_table instead of including
9650 biditype.h and bidimirror.h.
32413314 9651
9fd8be00
EZ
9652 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
9653 coordinates of the iterator when restoring from ppos_it.
9654 (Bug#9296)
9655
5cf2b69b
KH
96562011-08-14 Kenichi Handa <handa@m17n.org>
9657
9658 * process.c (create_process): Call setup_process_coding_systems
72ad093b 9659 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 9660
daf17d00
EZ
96612011-08-14 Eli Zaretskii <eliz@gnu.org>
9662
9663 * xdisp.c (move_it_in_display_line_to): Don't invoke
9664 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
9665 ppos_it. Fixes vertical cursor motion when line beginning is
9666 covered by an image. (Bug#9296)
9667
08e3161a
JD
96682011-08-14 Jan Djärv <jan.h.d@swipnet.se>
9669
9670 * nsterm.h (ns_run_ascript): Declare.
9671 (NSAPP_DATA2_RUNASSCRIPT): Define.
9672
9673 * nsfns.m (as_script, as_result, as_status): New static variables.
9674 (ns_run_ascript): New function.
5e617bc2 9675 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
9676 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
9677 the event loop. Get status from as_status (Bug#7276).
9678
9679 * nsterm.m (sendEvent): If event is NSApplicationDefined and
9680 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
9681 the event loop (Bug#7276).
9682
a3720aa2
AS
96832011-08-14 Andreas Schwab <schwab@linux-m68k.org>
9684
9685 * gnutls.c (QCgnutls_bootprop_priority)
9686 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
9687 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
9688 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
9689 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
9690 (QCgnutls_bootprop_verify_hostname_error)
9691 (QCgnutls_bootprop_callbacks_verify): Rename from
9692 Qgnutls_bootprop_..., all uses changed.
9693
9694 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
9695 uses changed.
9696
0a0d27fb
PE
96972011-08-14 Paul Eggert <eggert@cs.ucla.edu>
9698
19d5c50c
PE
9699 * xfaces.c (Qframe_set_background_mode): Now static.
9700 * dispextern.h (Qframe_set_background_mode): Remove decl.
9701
0a0d27fb
PE
9702 * process.c (Fnetwork_interface_info): Declare local only if needed.
9703
377538cb
JD
97042011-08-13 Jan Djärv <jan.h.d@swipnet.se>
9705
9706 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
9707 (Fnetwork_interface_list): Allocate in increments of bytes instead
9708 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
9709 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
9710 sockaddr.
9711 (struct ifflag_def): notrailers is smart on OSX.
9712 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
9713 Get hardware address with getifaddrs if available.
9714
08fff70c
EZ
97152011-08-12 Eli Zaretskii <eliz@gnu.org>
9716
9717 * xdisp.c (iterate_out_of_display_property): xassert that
9718 IT->position is set to within IT->object's boundaries. Break from
9719 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
9720 when IT->position is set up wrongly due to some bug.
9721 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
9722 (push_display_prop): Allow GET_FROM_STRING as IT->method on
9723 entry. Force push_it to save on the stack the current
9724 buffer/string position, to be restored by pop_it. Fix flags in
9725 the iterator structure wrt the object coming from a display
9726 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
9727 properties. (Bug#9284)
9728
7be1c708 97292011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 9730
7be1c708
CY
9731 * fontset.c (fontset_get_font_group): Add proper type checks.
9732 (Bug#9172)
aac0c6e3 9733
7be1c708 97342011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 9735
7be1c708
CY
9736 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
9737 and LC_VERSION_MIN_MACOSX.
9738 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
9739 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 9740
97bb72a6
EZ
97412011-08-08 Eli Zaretskii <eliz@gnu.org>
9742
9743 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
9744 no-display-properties-and-no-overlays under bidi display.
9745 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 9746 properties and overlays.
97bb72a6 9747
d5617611
CY
97482011-08-08 Chong Yidong <cyd@stupidchicken.com>
9749
37e11a63
CY
9750 * editfns.c (Fset_time_zone_rule): Document relationship with the
9751 setenv function.
9752
d5617611
CY
9753 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
9754 the font entity extracted from the cache (Bug#8109).
9755
58872834
CY
97562011-08-07 Chong Yidong <cyd@stupidchicken.com>
9757
9758 * composite.c (autocmp_chars): Don't reset point. That is done by
9759 restore_point_unwind (Bug#5984).
9760
75bfc667
JL
97612011-08-07 Juri Linkov <juri@jurta.org>
9762
9763 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
9764 to show the arg `TIME' instead of `TIMEVAL'.
9765
d1410150
EZ
97662011-08-06 Eli Zaretskii <eliz@gnu.org>
9767
9768 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
9769 display property strides EOL and includes a newline, as in
9770 longlines-mode. (Bug#9254)
75b771e4
EZ
9771 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
9772 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
9773
9774 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
9775 is non-zero, even if the data buffer is NULL. Fixes a crash in
9776 vertical-motion with longlines-mode. (Bug#9254)
9777
35928349
EZ
97782011-08-05 Eli Zaretskii <eliz@gnu.org>
9779
ec7cc85b
EZ
9780 * bidi.c <bidi_cache_total_alloc>: Now static.
9781 (bidi_initialize): Initialize bidi_cache_total_alloc.
9782
8b76d6f8 9783 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
9784 cache. (Bug#9221)
9785
9786 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
9787 amount allocated this far in `bidi_cache_total_alloc'.
9788 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
9789 non-zero, only free the data buffer without restoring the cache
9790 contents. All callers changed.
9791
9792 * dispextern.h (bidi_unshelve_cache): Update prototype.
9793
9794 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
9795 (move_it_in_display_line, move_it_to)
9796 (move_it_vertically_backward, move_it_by_lines): Replace the call
9797 to xfree to an equivalent call to bidi_unshelve_cache.
9798 (move_it_in_display_line_to): Fix logic of returning
412b6358 9799 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 9800
e2e2423b
EZ
98012011-08-05 Eli Zaretskii <eliz@gnu.org>
9802
9803 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
9804 came from a string character with a `cursor' property. (Bug#9229)
9805
ae9e757a
JD
98062011-08-04 Jan Djärv <jan.h.d@swipnet.se>
9807
9808 * Makefile.in (LIB_PTHREAD): New variable.
9809 (LIBES): Add LIB_PTHREAD (Bug#9216).
9810
9811 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
9812 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
9813
213bd7f2
AS
98142011-08-04 Andreas Schwab <schwab@linux-m68k.org>
9815
6b02f655 9816 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 9817
99aaf75f
JD
98182011-08-04 Jan Djärv <jan.h.d@swipnet.se>
9819
9820 * xterm.c (x_find_topmost_parent): New function.
9821 (x_set_frame_alpha): Find topmost parent window with
9822 x_find_topmost_parent and set the property there also (bug#9181).
9823 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
9824
c74e9d86
PE
98252011-08-04 Paul Eggert <eggert@cs.ucla.edu>
9826
9827 * callproc.c (Fcall_process): Avoid vfork clobbering
9828 the local vars buffer, coding_systems, current_dir.
9829
640c8776
SM
98302011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
9831
9832 * keymap.c (Fmake_composed_keymap): Move to subr.el.
9833
f26d0e4c
PE
98342011-08-03 Paul Eggert <eggert@cs.ucla.edu>
9835
8a10d76c
PE
9836 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
9837 so that it is not optimized away.
9838
f26d0e4c
PE
9839 * xdisp.c (compute_display_string_pos): Remove unused local.
9840
55439c61
EZ
98412011-08-02 Eli Zaretskii <eliz@gnu.org>
9842
9843 Fix slow cursor motion and scrolling in large buffers with
9844 selective display, like Org Mode buffers. (Bug#9218)
9845
9846 * dispextern.h (struct bidi_it): New member disp_prop_p.
9847
9848 * xdisp.c: Remove one-slot cache of display string positions.
9849 (compute_display_string_pos): Accept an additional argument
5e617bc2 9850 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
9851 for a display string or property. If found, set DISP_PROP_P
9852 non-zero.
9853
9854 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
9855 DISP_PROP_P, and pass it to compute_display_string_pos.
9856 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
9857 non-zero. All callers of bidi_fetch_char changed.
9858
fb33fa43
SM
98592011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
9860
9861 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
9862
b099e063
DM
98632010-12-03 Don March <don@ohspite.net>
9864
9865 * keymap.c (Fdefine_key): Fix non-prefix key error message when
9866 last character M-[char] is translated to ESC [char] (bug#7541).
9867
5cc7f7af
KH
98682011-08-02 Kenichi Handa <handa@m17n.org>
9869
d0fffa3f 9870 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
9871
9872 * chartab.c (uniprop_table): Make it non-static.
9873
525d5e6e
EZ
98742011-08-01 Eli Zaretskii <eliz@gnu.org>
9875
9876 * xdisp.c (forward_to_next_line_start): Accept additional argument
9877 BIDI_IT_PREV, and store into it the state of the bidi iterator had
9878 on the newline.
9879 (reseat_at_next_visible_line_start): Use the bidi iterator state
9880 returned by forward_to_next_line_start to restore the state of
9881 it->bidi_it after backing up to previous newline. (Bug#9212)
9882
31011111
AS
98832011-07-30 Andreas Schwab <schwab@linux-m68k.org>
9884
9885 * regex.c (re_comp): Protoize.
9886 (re_exec): Fix return type.
9887 (regexec): Fix type of `ret'. (Bug#9203)
9888
476371c4
PE
98892011-07-28 Paul Eggert <eggert@cs.ucla.edu>
9890
e5d76069
PE
9891 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
9892 This is needed if max-image-size is a floating-point number.
9893
9a79b20c
AS
98942011-07-28 Andreas Schwab <schwab@linux-m68k.org>
9895
9896 * print.c (print_object): Print empty symbol as ##.
9897
9898 * lread.c (read1): Read ## as empty symbol.
9899
d8c2fa78
AA
99002011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
9901
9902 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
9903 setting frame foreground color (Bug#9175).
9904 (x_set_background_color): Likewise.
9905
ffe57a7a
AA
9906 * nsmenu.m (-setText): Size tooltip dimensions precisely to
9907 contents (Bug#9176).
9908 (EmacsTooltip -init): Remove bezels and add shadows to
9909 tooltip windows.
9910
bf3492a5
AA
9911 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
9912 or scroll bar (Bug#8470).
9913
d55e9c53
AA
9914 * nsfont.m (nsfont_open): Remove assignment to voffset and
9915 unnecessary vars hshink, expand, hd, full_height, min_height.
9916 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
9917
9918 * nsterm.h (nsfont_info): Remove voffset field.
9919
d8c2fa78 99202011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
9921
9922 Implement strike-through and overline on NextStep (Bug#8863).
9923
9924 * nsfont.m (nsfont_open): Use underline position provided by font,
9925 instead of hard-coded value of 2.
9926 (nsfont_draw): Call ns_draw_text_decoration instead.
9927
9928 * nsterm.h: Add declaration for ns_draw_text_decoration.
9929
9930 * nsterm.m (ns_draw_text_decoration): New function for drawing
9931 underline, overline, and strike-through.
9932 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
9933 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 9934 accommodate underlining, etc.
4843aac3 9935
4cc60b9b
EZ
99362011-07-28 Eli Zaretskii <eliz@gnu.org>
9937
bc7ece87
EZ
9938 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
9939 default.
4cc60b9b 9940
476371c4
PE
99412011-07-28 Paul Eggert <eggert@cs.ucla.edu>
9942
66606eea
PE
9943 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
9944 Without this fix, if a signal arrives just after memory fills up,
9945 'malloc' might be invoked reentrantly.
9946
476371c4
PE
9947 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
9948 In other words, assume that every image size is allowed, on non-X
9949 hosts. This assumption is probably wrong, but it lets Emacs compile.
9950
f3fcc40d
AS
99512011-07-28 Andreas Schwab <schwab@linux-m68k.org>
9952
9953 * regex.c (re_iswctype): Convert return values to boolean.
9954
350c992f
EZ
99552011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
9956
9957 * xdisp.c (compute_display_string_pos): Don't use cached display
9958 string position if the buffer had its restriction changed.
9959 (Bug#9184)
9960
5266b4bb
PE
99612011-07-28 Paul Eggert <eggert@cs.ucla.edu>
9962
9963 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
9964
2573a837 99652011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 9966
41f55ccd 9967 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 9968
39e378da
PE
9969 * bidi.c: Integer size and overflow fixes.
9970 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
9971 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
9972 (bidi_cache_find_level_change, bidi_cache_ensure_space)
9973 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
9974 (bidi_find_other_level_edge):
9975 Use ptrdiff_t instead of EMACS_INT where either will do.
9976 This works better on 32-bit hosts configured --with-wide-int.
9977 (bidi_cache_ensure_space): Check for size-calculation overflow.
9978 Use % rather than repeated addition, for better worst-case speed.
9979 Don't set bidi_cache_size until after xrealloc returns, because it
9980 might not return.
9981 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
9982 (bidi_cache_ensure_space): Also check that the bidi cache size
9983 does not exceed that of the largest Lisp string or buffer. See Eli
9984 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 9985
5e927815
PE
9986 * alloc.c (__malloc_size_t): Remove.
9987 All uses replaced by size_t. See Andreas Schwab's note
9988 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
9989
ca4aa935
PE
9990 * image.c: Improve checking for integer overflow.
9991 (check_image_size): Assume that f is nonnull, since
9992 it is always nonnull in practice. This is one less thing to
9993 worry about when checking for integer overflow later.
9994 (x_check_image_size): New function, which checks for integer
9995 overflow issues inside X.
9996 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
9997 This removes the need for a memory_full check.
9998 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
9999 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
10000 (xbm_read_bitmap_data): Change locals back to 'int', since
10001 their values must fit in 'int'.
10002 (xpm_load_image, png_load, tiff_load):
10003 Invoke x_create_x_image_and_pixmap earlier,
10004 to avoid much needless work if the image is too large.
10005 (tiff_load): Treat overly large images as if
10006 x_create_x_image_and_pixmap failed, not as malloc failures.
10007 (gs_load): Use x_check_image_size.
10008
5f8f9cc2
PE
10009 * gtkutil.c: Omit integer casts.
10010 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
10011 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
10012
5adf60bc
PE
10013 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
10014
c8907a93
PE
10015 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
10016 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
10017 would wrongly return t on a 64-bit host.
10018
e3c25c68
PE
10019 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
10020 The plain *_OVERFLOW macros run afoul of GCC bug 49705
10021 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
10022 and therefore cause GCC to emit a bogus diagnostic in some cases.
10023
3f791afe
PE
10024 * image.c: Integer signedness and overflow and related fixes.
10025 This is not an exhaustive set of fixes, but it's time to
10026 record what I've got.
10027 (lookup_pixel_color, check_image_size): Remove redundant decls.
10028 (check_image_size): Don't assume that arbitrary EMACS_INT values
10029 fit in 'int', or that arbitrary 'double' values fit in 'int'.
10030 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
10031 (tiff_load, imagemagick_load_image):
10032 Check for overflow in size calculations.
10033 (x_create_x_image_and_pixmap): Remove unnecessary test for
10034 xmalloc returning NULL; that can't happen.
10035 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
10036 (xpm_color_bucket): Use better integer hashing function.
10037 (xpm_cache_color): Don't possibly over-allocate memory.
10038 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
10039 (gif_memory_source):
10040 Use ptrdiff_t, not int or size_t, to record sizes.
10041 (png_load): Don't assume values greater than 2**31 fit in 'int'.
10042 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
10043 either works, as we prefer signed integers.
10044 (tiff_read_from_memory, tiff_write_from_memory):
10045 Return tsize_t, not size_t, since that's what the TIFF API wants.
10046 (tiff_read_from_memory): Don't fail simply because the read would
10047 go past EOF; instead, return a short read.
10048 (tiff_load): Omit no-longer-needed casts.
10049 (Fimagemagick_types): Don't assume size fits into 'int'.
10050
3cc5a532
PE
10051 Improve hashing quality when configured --with-wide-int.
10052 * fns.c (hash_string): New function, taken from sxhash_string.
10053 Do not discard information about ASCII character case; this
10054 discarding is no longer needed.
10055 (sxhash-string): Use it. Change sig to match it. Caller changed.
10056 * lisp.h: Declare it.
10057 * lread.c (hash_string): Remove, since we now use fns.c's version.
10058 The fns.c version returns a wider integer if --with-wide-int is
10059 specified, so this should help the quality of the hashing a bit.
10060
b312a492
PE
10061 * emacs.c: Integer overflow minor fix.
10062 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
10063 Define only if GNU_LINUX.
10064 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
10065
dfd153ae
PE
10066 * dispnew.c: Integer signedness and overflow fixes.
10067 Remove unnecessary forward decls, that were a maintenance hassle.
10068 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
10069 All uses changed.
10070 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
10071 (scrolling_window): Use ptrdiff_t, not int, for byte count.
10072 (prepare_desired_row, line_draw_cost):
10073 Use int, not unsigned, where either works.
10074 (save_current_matrix, restore_current_matrix):
10075 Use ptrdiff_t, not size_t, where either works.
10076 (init_display): Check for overflow more accurately, and without
10077 relying on undefined behavior.
10078
a81d11a3
PE
10079 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
10080 Remove, replacing with the new symbols in lisp.h. All uses changed.
10081 * fileio.c (make_temp_name):
10082 * filelock.c (lock_file_1, lock_file):
10083 * xdisp.c (message_dolog):
10084 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
10085 Use pMd etc. instead.
10086 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
10087 replacing the pWIDE etc. symbols removed from editfns.c.
10088
3300e6fd
PE
10089 * keyboard.h (num_input_events): Now uintmax_t.
10090 This is (very slightly) less likely to mess up due to wraparound.
10091 All uses changed.
10092
fd05c7e9
PE
10093 * buffer.c: Integer signedness fixes.
10094 (alloc_buffer_text, enlarge_buffer_text):
10095 Use ptrdiff_t rather than size_t when either will do, as we prefer
10096 signed integers.
10097
903fe15d
PE
10098 * alloc.c: Integer signedness and overflow fixes.
10099 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
10100 (__malloc_size_t): Default to size_t, not to int.
10101 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
10102 (Fgarbage_collect, mark_object_loop_halt, mark_object):
10103 Prefer ptrdiff_t to size_t when either would do, as we prefer
10104 signed integers.
10105 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
10106 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
10107 Now const. Initialize with values that are in range even if char
10108 is signed.
10109 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
10110 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
10111 These functions do the right thing with sizes > 2**32.
10112 (check_depth): Now ptrdiff_t, not int.
10113 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
10114 Adjust to new way of storing sizes. Check for size overflow bugs
10115 in rest of code.
10116 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
10117 slightly wrong anyway, as it missed one instance of
10118 XMALLOC_OVERRUN_CHECK_OVERHEAD.
10119 (refill_memory_reserve): Omit needless cast to size_t.
10120 (mark_object_loop_halt): Mark as externally visible.
10121
ac82cc6a
PE
10122 * xselect.c: Integer signedness and overflow fixes.
10123 (Fx_register_dnd_atom, x_handle_dnd_message):
10124 Use ptrdiff_t, not size_t, since we prefer signed.
10125 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
10126 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
10127 x_dnd_atoms_size and x_dnd_atoms_length.
10128
c2d1e36d
PE
10129 * doprnt.c: Prefer signed to unsigned when either works.
10130 * eval.c (verror):
10131 * doprnt.c (doprnt):
10132 * lisp.h (doprnt):
10133 * xdisp.c (vmessage):
10134 Use ptrdiff_t, not size_t, when using or implementing doprnt,
10135 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
10136 prefer signed arithmetic to avoid comparison confusion.
10137 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
10138 but is a bit tricky.
10139
0e926e56
PE
10140 Assume freestanding C89 headers, string.h, stdlib.h.
10141 * data.c, doprnt.c, floatfns.c, print.c:
10142 Include float.h unconditionally.
10143 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
10144 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
10145 * regex.c: Likewise for stddef.h, string.h.
10146 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
10147 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
10148 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
10149 (STDC_HEADERS): Remove obsolete defines.
10150 * sysdep.c: Include limits.h unconditionally.
10151
9cfdb3ec
PE
10152 Assume support for memcmp, memcpy, memmove, memset.
10153 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
10154 * regex.c (memcmp, memcpy):
10155 Remove; we assume C89 now.
10156
10157 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
10158 (__malloc_safe_bcopy): Remove; no longer needed.
10159
cf950e6b 10160 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
10161 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
10162 well either way, and we prefer signed to unsigned.
10163
dbf38e02
LMI
101642011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
10165
10166 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
10167 closes the connection while we're reading (bug#9182).
10168
d6f0886c 101692011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 10170
d6f0886c
JD
10171 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
10172 are specified (Bug#9168).
24e0f6b1 10173
2eb1f9e6
PE
101742011-07-25 Paul Eggert <eggert@cs.ucla.edu>
10175
10176 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
10177 Found by GCC static checking and --with-wide-int on a 32-bit host.
10178
22381272 101792011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
10180
10181 * xdisp.c (compute_display_string_pos): Fix logic of caching
10182 previous display string position. Initialize cached_prev_pos to
10183 -1. Fixes slow-down at the beginning of a buffer.
10184
f25e39b4
EZ
101852011-07-24 Eli Zaretskii <eliz@gnu.org>
10186
10187 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
10188 for attrs[LFACE_FONTSET_INDEX].
10189
04c4b52e
PE
101902011-07-23 Paul Eggert <eggert@cs.ucla.edu>
10191
10192 * xml.c (parse_region): Remove unused local
10193 that was recently introduced.
10194
c1734fbd
EZ
101952011-07-23 Eli Zaretskii <eliz@gnu.org>
10196
be18c5a5
EZ
10197 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
10198 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
10199
c1734fbd
EZ
10200 * xdisp.c (move_it_in_display_line_to): Record the best matching
10201 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
10202 exit if none of the characters scanned was an exact match.
10203 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
10204 when exact match is impossible due to invisible text, and the
10205 lines are truncated.
10206
a258d627
JD
102072011-07-23 Jan Djärv <jan.h.d@swipnet.se>
10208
10209 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
10210 for OSX >= 10.7.
10211
b6d5a689
EZ
102122011-07-22 Eli Zaretskii <eliz@gnu.org>
10213
0f74f785
EZ
10214 Fix a significant slow-down of cursor motion with C-n, C-p,
10215 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
10216 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 10217 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
10218 (next_element_from_buffer): Call compute_stop_pos_backwards to
10219 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
10220 base_level_stop.
10221 (reseat): Don't look for prev_stop, as that could mean a very long
10222 run.
10223 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
10224 <cached_disp_overlay_modiff>: Cache for last found display string
10225 position.
551918c1 10226 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
10227 about the same buffer in the same area of character positions, and
10228 the buffer wasn't changed since the time the display string
10229 position was cached.
551918c1 10230
b2d0c91a
EZ
102312011-07-22 Eli Zaretskii <eliz@gnu.org>
10232
10233 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
10234 is an integer, which is important for empty lines. (Bug#9149)
10235
043604ee
CY
102362011-07-22 Chong Yidong <cyd@stupidchicken.com>
10237
10238 * frame.c (Fmodify_frame_parameters): In tty case, update the
10239 default face if necessary (Bug#4238).
10240
da4adb04
CY
102412011-07-21 Chong Yidong <cyd@stupidchicken.com>
10242
10243 * editfns.c (Fstring_to_char): No need to explain what a character
10244 is in the docstring (Bug#6576).
10245
9abd0532
LMI
102462011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10247
10248 * xml.c (parse_region): Make sure we always return a tree.
10249
36881d16
HK
102502011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
10251
10252 * xml.c (parse_region): If a document contains only comments,
10253 return that, too.
10254
1e98674d
LMI
102552011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10256
10257 * xml.c (make_dom): Return comments, too.
10258
590bd467
PE
102592011-07-19 Paul Eggert <eggert@cs.ucla.edu>
10260
10261 Port to OpenBSD.
10262 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
10263 and the surrounding thread.
10264 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
10265 rather than fgets, and retry after EINTR. Otherwise, 'emacs
10266 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
10267 timer goes off.
10268 * s/openbsd.h (BROKEN_SIGIO): Define.
10269 * unexelf.c (unexec) [__OpenBSD__]:
10270 Don't update the .mdebug section of the Alpha COFF symbol table.
10271
f41628b2
LMI
102722011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10273
10274 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
10275 (bug#8460).
10276
b59b67c5
PE
102772011-07-18 Paul Eggert <eggert@cs.ucla.edu>
10278
15e3a074
PE
10279 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
10280 This fixes some race conditions on the permissions of any newly
10281 created file.
10282
41bed37d
PE
10283 * alloc.c (valid_pointer_p): Use pipe, not open.
10284 This fixes some permissions issues when debugging.
10285
b59b67c5
PE
10286 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
10287 If fchown fails to set both uid and gid, try to set just gid,
10288 as that is sometimes allowed. Adjust the file's mode to eliminate
10289 setuid or setgid bits that are inappropriate if fchown fails.
10290
925a6be7
SM
102912011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10292
10293 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
10294 to compare Lisp_Objects.
10295 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
10296 global_gnutls_log_level, don't mistake it for a Lisp_Object.
10297 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
10298
52968808
AS
102992011-07-17 Andreas Schwab <schwab@linux-m68k.org>
10300
0a6a104b
AS
10301 * lread.c (read_integer): Unread even EOF character.
10302 (read1): Likewise. Properly record start position of symbol.
10303
52968808
AS
10304 * lread.c (read1): Read `#:' as empty uninterned symbol if no
10305 symbol character follows.
10306
9e381cdd
PE
103072011-07-17 Paul Eggert <eggert@cs.ucla.edu>
10308
10309 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
10310 This works around a problem with the previous change to Fcopy_file.
10311 Recent glibc declares fchown with __attribute__((warn_unused_result)),
10312 and without this change, GCC might complain about discarding
10313 fchown's return value.
10314
b5641435
JB
103152011-07-16 Juanma Barranquero <lekktu@gmail.com>
10316
10317 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
10318
a8031457
PE
103192011-07-16 Paul Eggert <eggert@cs.ucla.edu>
10320
10321 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
10322
dd889327
LMI
103232011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
10324
750c33f7
LMI
10325 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
10326 it's used from the C level.
10327
dd889327
LMI
10328 * process.c: Use the same condition for POLL_FOR_INPUT in both
10329 keyboard.c and process.c (bug#1858).
10330
87e86684
LM
103312011-07-09 Lawrence Mitchell <wence@gmx.li>
10332
10333 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
10334 (Fgnutls_boot): Use it.
10335
64348f40
AS
103362011-07-15 Andreas Schwab <schwab@linux-m68k.org>
10337
10338 * doc.c (Fsubstitute_command_keys): Revert last change.
10339
1d698799
LMI
103402011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
10341
f863868c
LMI
10342 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
10343 quotes the next character, and doesn't affect other longer
10344 sequences (bug#8935).
10345
1d698799
LMI
10346 * lread.c (syms_of_lread): Clarify that is isn't only
10347 `eval-buffer' and `eval-defun' that's affected by
10348 `lexical-binding' (bug#8460).
10349
aa4b6df6
EZ
103502011-07-15 Eli Zaretskii <eliz@gnu.org>
10351
10352 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 10353 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 10354
5d856da6
PE
103552011-07-14 Paul Eggert <eggert@cs.ucla.edu>
10356
ad6042bb
PE
10357 Fix minor problems found by static checking.
10358 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
10359 (elsz): Now a signed constant, not a size_t var. We prefer signed
10360 types to unsigned, to avoid integer comparison confusion. Without
10361 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
10362 "cannot optimize loop, the loop counter may overflow", a symptom
10363 of the confusion.
f00bbb22 10364 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
10365 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
10366
6468f31c
LMI
103672011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
10368
49080b10
LMI
10369 * search.c (Fre_search_backward): Mention `case-fold-search' in
10370 all the re_search_* functions (bug#8138).
10371
6468f31c
LMI
10372 * keyboard.c (Fopen_dribble_file): Document when the file is
10373 closed (bug#8056).
10374
c965adc5
EZ
103752011-07-14 Eli Zaretskii <eliz@gnu.org>
10376
df9733bf
EZ
10377 * bidi.c (bidi_dump_cached_states): Fix format of displaying
10378 bidi_cache_idx.
10379
0bb23927
EZ
10380 Support bidi reordering of display and overlay strings.
10381 * xdisp.c (compute_display_string_pos)
10382 (compute_display_string_end): Accept additional argument STRING.
10383 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
10384 (reseat_to_string): Initialize bidi_it->string.s and
10385 bidi_it->string.schars.
10386 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
10387 NULL (avoids a crash in bidi_paragraph_init).
10388 Initialize itb.string.lstring.
0bb23927
EZ
10389 (init_iterator): Call bidi_init_it only of a valid
10390 buffer position was specified. Initialize paragraph_embedding to
10391 L2R.
10392 (reseat_to_string): Initialize the bidi iterator.
10393 (display_string): If we need to ignore text properties of
10394 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
10395 original value of -1 will not work with bidi.)
10396 (compute_display_string_pos): First arg is now struct
10397 `text_pos *'; all callers changed. Support display properties on
10398 Lisp strings.
10399 (compute_display_string_end): Support display properties on Lisp
10400 strings.
10401 (init_iterator, reseat_1, reseat_to_string): Initialize the
10402 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
10403 when iterating on a string not from display properties).
640c8776
SM
10404 (compute_display_string_pos, compute_display_string_end):
10405 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
10406 arrow keys.
10407 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
10408 base_level_stop; instead, set base_level_stop to BEGV.
10409 Fixes crashes in vertical-motion.
0bb23927
EZ
10410 (next_element_from_buffer): Improve commentary for when
10411 the iterator is before prev_stop.
10412 (init_iterator): Initialize bidi_p from the default value of
10413 bidi-display-reordering, not from buffer-local value. Use the
10414 buffer-local value only if initializing for buffer iteration.
10415 (handle_invisible_prop): Support invisible properties on strings
10416 that are being bidi-reordered.
10417 (set_iterator_to_next): Support bidi reordering of C strings and
10418 Lisp strings.
10419 (next_element_from_string): Support bidi reordering of Lisp
10420 strings.
10421 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
10422 (display_string): Support display of R2L glyph rows.
10423 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
10424 (init_iterator): Don't initialize it->bidi_p for strings
10425 here.
10426 (reseat_to_string): Initialize it->bidi_p for strings here.
10427 (next_element_from_string, next_element_from_c_string)
10428 (next_element_from_buffer): Add xassert's for correspondence
10429 between IT's object being iterated and it->bidi_it.string
10430 structure.
10431 (face_before_or_after_it_pos): Support bidi iteration.
10432 (next_element_from_c_string): Handle the case of the first string
10433 character that is not the first one in the visual order.
10434 (get_visually_first_element): New function, refactored from common
10435 parts of next_element_from_buffer, next_element_from_string, and
10436 next_element_from_c_string.
10437 (tool_bar_lines_needed, redisplay_tool_bar)
10438 (display_menu_bar): Force left-to-right direction. Add a FIXME
10439 comment for making that be controlled by a user option.
10440 (push_it, pop_it): Save and restore the state of the
10441 bidi iterator. Save and restore the bidi_p flag.
10442 (pop_it): Iterate out of display property for string iteration as
10443 well.
10444 (iterate_out_of_display_property): Support iteration over strings.
10445 (handle_single_display_spec): Set up it->bidi_it for iteration
10446 over a display string, and call bidi_init_it.
10447 (handle_single_display_spec, next_overlay_string)
10448 (get_overlay_strings_1, push_display_prop): Set up the bidi
10449 iterator for displaying display or overlay strings.
10450 (forward_to_next_line_start): Don't use the shortcut if
10451 bidi-iterating.
10452 (back_to_previous_visible_line_start): If handle_display_prop
10453 pushed the iterator stack, restore the internal state of the bidi
10454 iterator by calling bidi_pop_it same number of times.
10455 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
10456 and we are bidi-iterating, don't decrement the iterator position;
10457 instead, set the first_elt flag in the bidi iterator, to produce
10458 the same effect.
10459 (reseat_1): Remove redundant setting of string_from_display_prop_p.
10460 (push_display_prop): xassert that we are iterating a buffer.
10461 (push_it, pop_it): Save and restore paragraph_embedding member.
10462 (handle_single_display_spec, next_overlay_string)
10463 (get_overlay_strings_1, reseat_1, reseat_to_string)
10464 (push_display_prop): Set up the `unibyte' member of bidi_it.string
10465 correctly. Don't assume unibyte strings are not bidi-reordered.
10466 (compute_display_string_pos)
10467 (compute_display_string_end): Fix handling the case of C string.
10468 (push_it, pop_it): Save and restore from_disp_prop_p.
10469 (handle_single_display_spec, push_display_prop): Set the
10470 from_disp_prop_p flag.
10471 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
10472 (pop_it): Call iterate_out_of_display_property only if we are
10473 popping after iteration over a string that came from a display
10474 property. Fix a typo in popping stretch info. Add an assertion
10475 for verifying that the iterator position is in sync with the bidi
10476 iterator.
10477 (handle_single_display_spec, get_overlay_strings_1)
10478 (push_display_prop): Fix initialization of paragraph direction for
10479 string when that of the parent object is not yet determined.
10480 (reseat_1): Call bidi_init_it to resync the bidi
10481 iterator with IT's position. (Bug#7616)
10482 (find_row_edges): If ROW->start.pos gives position
10483 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
10484 (handle_stop, back_to_previous_visible_line_start, reseat_1):
10485 Reset the from_disp_prop_p flag.
10486 (SAVE_IT, RESTORE_IT): New macros.
10487 (pos_visible_p, face_before_or_after_it_pos)
10488 (back_to_previous_visible_line_start)
10489 (move_it_in_display_line_to, move_it_in_display_line)
10490 (move_it_to, move_it_vertically_backward, move_it_by_lines)
10491 (try_scrolling, redisplay_window, display_line): Use them when
10492 saving a temporary copy of the iterator and restoring it back.
10493 (back_to_previous_visible_line_start, reseat_1)
10494 (init_iterator): Empty the bidi cache "stack".
10495 (move_it_in_display_line_to): If iterator ended up at
10496 EOL, but we never saw any buffer positions smaller than
10497 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
10498 motion in bidi-reordered lines.
10499 (move_it_in_display_line_to): Record prev_method and prev_pos
10500 immediately before the call to set_iterator_to_next. Fixes cursor
10501 motion in bidi-reordered lines with stretch glyphs and strings
10502 displayed in margins. (Bug#8133) (Bug#8867)
10503 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
10504 TO_CHARPOS.
640c8776
SM
10505 (pos_visible_p): Support positions in bidi-reordered lines.
10506 Save and restore bidi cache.
0bb23927
EZ
10507
10508 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
10509 (bidi_paragraph_info): Delete unused struct.
10510 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
10511 (bidi_cache_start): New variable.
10512 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
10513 to zero.
10514 (bidi_cache_fetch_state, bidi_cache_search)
10515 (bidi_cache_find_level_change, bidi_cache_iterator_state)
10516 (bidi_cache_find, bidi_peek_at_next_level)
10517 (bidi_level_of_next_char, bidi_find_other_level_edge)
10518 (bidi_move_to_visually_next): Compare cache index with
10519 bidi_cache_start rather than with zero.
10520 (bidi_fetch_char): Accept new argument STRING; all callers
10521 changed. Support iteration over a string. Support strings with
10522 display properties. Support unibyte strings. Fix the type of
10523 `len' according to what STRING_CHAR_AND_LENGTH expects.
10524 (bidi_paragraph_init, bidi_resolve_explicit_1)
10525 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
10526 (bidi_level_of_next_char, bidi_move_to_visually_next):
10527 Support iteration over a string.
0bb23927
EZ
10528 (bidi_set_sor_type, bidi_resolve_explicit_1)
10529 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
10530 can now be zero (for strings); special values 0 and -1 were
10531 changed to -1 and -2, respectively.
10532 (bidi_char_at_pos): New function.
10533 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
10534 Call it instead of FETCH_MULTIBYTE_CHAR.
10535 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
10536 initialized to valid values.
10537 (bidi_init_it): Don't initialize charpos and bytepos with invalid
10538 values.
10539 (bidi_level_of_next_char): Allow the sentinel "position" to pass
10540 the test for valid cached positions. Fix the logic for looking up
10541 the sentinel state in the cache. GCPRO the Lisp string we are
10542 iterating.
10543 (bidi_push_it, bidi_pop_it): New functions.
10544 (bidi_initialize): Initialize the bidi cache start stack pointer.
10545 (bidi_cache_ensure_space): New function, refactored from part of
10546 bidi_cache_iterator_state. Don't assume the required size is just
10547 one BIDI_CACHE_CHUNK away.
10548 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
10549 (bidi_count_bytes, bidi_char_at_pos): New functions.
10550 (bidi_cache_search): Don't assume bidi_cache_last_idx is
10551 always valid if bidi_cache_idx is valid.
10552 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
10553 is valid if it's going to be used.
10554 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
10555 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
10556 (bidi_cache_find_level_change, bidi_cache_ensure_space)
10557 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
10558 (bidi_find_other_level_edge, bidi_cache_start_stack):
10559 All variables related to cache indices are now EMACS_INT.
c965adc5 10560
0bb23927
EZ
10561 * dispextern.h (struct bidi_string_data): New structure.
10562 (struct bidi_it): New member `string'. Make flag members be 1-bit
10563 fields, and put them last in the struct.
640c8776
SM
10564 (compute_display_string_pos, compute_display_string_end):
10565 Update prototypes.
0bb23927
EZ
10566 (bidi_push_it, bidi_pop_it): Add prototypes.
10567 (struct iterator_stack_entry): New members bidi_p,
10568 paragraph_embedding, and from_disp_prop_p.
10569 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
10570 (bidi_shelve_cache, bidi_unshelve_cache):
10571 Declare prototypes.
0bb23927
EZ
10572
10573 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
10574 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
10575 and vector-like objects.
10576
10577 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
10578 cache around display iteration.
10579
10580 * window.c (Fwindow_end, window_scroll_pixel_based)
10581 (displayed_window_lines, Frecenter): Save and restore the bidi
10582 cache around display iteration.
10583
3bbd2265
LMI
105842011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
10585
10586 * editfns.c (Fdelete_region): Clarify the use of the named
10587 parameters (bug#6788).
10588
adc47434
MR
105892011-07-14 Martin Rudalics <rudalics@gmx.at>
10590
10591 * indent.c (Fvertical_motion): Set and restore w->pointm when
10592 saving and restoring the window's buffer (Bug#9006).
10593
837c31f8
LMI
105942011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
10595
10596 * editfns.c (Fstring_to_char): Clarify just what is returned
10597 (bug#6576). Text by Eli Zaretskii.
10598
ac389d0c
JB
105992011-07-13 Juanma Barranquero <lekktu@gmail.com>
10600
10601 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
10602
0be0ce47
EZ
106032011-07-13 Eli Zaretskii <eliz@gnu.org>
10604
10605 * buffer.c (mmap_find): Fix a typo.
10606
cd18e7e3
JB
106072011-07-13 Johan Bockgård <bojohan@gnu.org>
10608
10609 Fix execution of x selection hooks.
10610 * xselect.c (Qx_lost_selection_functions)
10611 (Qx_sent_selection_functions): New vars.
10612 (syms_of_xselect): DEFSYM them.
10613 (x_handle_selection_request): Pass Qx_sent_selection_functions
10614 rather than Vx_sent_selection_functions to Frun_hook_with_args.
10615 (x_handle_selection_clear,x_clear_frame_selections):
10616 Pass Qx_lost_selection_functions rather than
10617 Vx_lost_selection_functions to Frun_hook_with_args.
10618
47ea7f44
PE
106192011-07-13 Paul Eggert <eggert@cs.ucla.edu>
10620
ac389d0c 10621 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
10622 The old code sometimes used this field without initializing it.
10623
47ea7f44
PE
10624 * alloc.c (gc_sweep): Don't read past end of array.
10625 In theory, the old code could also have corrupted Emacs internals,
10626 though it'd be very unlikely.
10627
bc985c87
AS
106282011-07-12 Andreas Schwab <schwab@linux-m68k.org>
10629
10630 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 10631 argument. (Bug#4026)
bc985c87 10632
0cf34688
LMI
106332011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
10634
b3dadd76
LMI
10635 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
10636 key" (bug#4257).
10637
0cf34688
LMI
10638 * window.c (Fset_window_start): Doc fix (bug#4199).
10639 (Fset_window_hscroll): Ditto.
10640
270768cd
PE
106412011-07-12 Paul Eggert <eggert@cs.ucla.edu>
10642
077e3dda 10643 Fix minor new problems caught by GCC 4.6.1.
270768cd 10644 * term.c (init_tty): Remove unused local.
490011a6 10645 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 10646 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 10647 not used otherwise.
270768cd 10648
b1f58454
CY
106492011-07-12 Chong Yidong <cyd@stupidchicken.com>
10650
10651 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
10652
22b9578d
LMI
106532011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10654
6e70ab07
LMI
10655 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
10656 are the mini-buffer and the echo area (bug#3320).
10657
22b9578d
LMI
10658 * term.c (init_tty): Remove support for supdup, c10 and perq
10659 terminals, which are no longer supported (bug#1482).
10660
8974cc9f
JB
106612011-07-10 Johan Bockgård <bojohan@gnu.org>
10662
10663 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
10664
a560d974
JD
106652011-07-10 Jan Djärv <jan.h.d@swipnet.se>
10666
10667 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
10668 for non-popups (Bug#3642).
10669
1dae0f0a
AS
106702011-07-10 Andreas Schwab <schwab@linux-m68k.org>
10671
268c2c36 10672 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 10673 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
10674 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
10675 * cm.c (losecursor): Likewise.
1dae0f0a
AS
10676 * data.c (fmod): Likewise.
10677 * dispnew.c (swap_glyphs_in_rows): Likewise.
10678 * emacs.c (memory_warning_signal): Likewise.
10679 * floatfns.c (float_error): Likewise.
10680 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
10681 (otf_open, font_otf_capability, generate_otf_features)
10682 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
10683 Likewise.
10684 * image.c (pbm_read_file): Likewise.
10685 * indent.c (string_display_width): Likewise.
10686 * intervals.c (check_for_interval, search_for_interval)
10687 (inc_interval_count, count_intervals, root_interval)
10688 (adjust_intervals_for_insertion, make_new_interval): Likewise.
10689 * lread.c (defalias): Likewise.
268c2c36 10690 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
10691 * regex.c (set_image_of_range_1, set_image_of_range)
10692 (regex_grow_registers): Likewise.
10693 * sysdep.c (strerror): Likewise.
10694 * termcap.c (valid_filename_p, tprint, main): Likewise.
10695 * tparam.c (main): Likewise.
10696 * unexhp9k800.c (run_time_remap, save_data_space)
10697 (update_file_ptrs, read_header, write_header, calculate_checksum)
10698 (copy_file, copy_rest, display_header): Likewise.
10699 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
10700 Likewise.
10701 * xdisp.c (check_it): Likewise.
10702 * xfaces.c (register_color, unregister_color, unregister_colors):
10703 Likewise.
10704 * xfns.c (print_fontset_result): Likewise.
10705 * xrdb.c (member, fatal, main): Likewise.
10706
99033785
PE
107072011-07-10 Paul Eggert <eggert@cs.ucla.edu>
10708
10709 Fix minor problems found by static checking (Bug#9031).
10710 * chartab.c (char_table_set_range, map_sub_char_table):
10711 Remove unused locals.
10712 (uniprop_table): Now static.
10713 * composite.c (_work_char): Remove unused static var.
10714
9cb2ac56
JB
107152011-07-09 Juanma Barranquero <lekktu@gmail.com>
10716
10717 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
10718
f25661f0
JD
107192011-07-09 Jan Djärv <jan.h.d@swipnet.se>
10720
10721 * gtkutil.c (qttip_cb): Remove code without function.
10722
8278c4fe
EZ
107232011-07-09 Eli Zaretskii <eliz@gnu.org>
10724
10725 * w32.c (pthread_sigmask): New stub.
10726
1692ae2d 107272011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 10728
8a6ebd58 10729 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
10730 sigprocmask is portable only for single-threaded applications, and
10731 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
10732 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
10733 (LIBES): Use it.
10734 * callproc.c (Fcall_process):
10735 * process.c (create_process):
10736 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
10737 Use pthread_sigmask, not sigprocmask.
123403e4 10738
1b854618
JD
107392011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10740
10741 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
10742 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
10743 wrong (Bug#8591).
10744
3fe4b549
JD
107452011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10746
0ce7e563
JD
10747 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
10748 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
10749 (xg_hide_tooltip): Fix comment.
10750
3fe4b549
JD
10751 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
10752 in registerServicesMenuSendTypes.
10753 (validRequestorForSendType): Don't check ns_return_types.
10754
10755 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
10756 ns_return_type.
10757
5df75e47
JR
107582011-07-08 Jason Rumney <jasonr@gnu.org>
10759
22610910
JR
10760 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
10761 SH_SHOW for hidden windows (Bug#5482).
10762
5df75e47
JR
10763 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
10764 frame struct members of non-existent frames (Bug#6284).
10765
699c10bd
JD
107662011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10767
4393663b
JD
10768 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
10769 variable firstTime not needed on OSX >= 10.6.
10770 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
10771 >= 10.5. Use setKnobProportion, setDoubleValue.
10772
10773 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
10774 (MAC_OS_X_VERSION_10_5): Define if not defined.
10775 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
10776 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
10777 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
10778
10779 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 10780 cString and lossyCString on OSX >= 10.4.
4393663b 10781
58179cce 10782 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
10783 sizeToFit on OSX >= 10.2.
10784
10785 * nsimage.m (allocInitFromFile): Don't use deprecated method
10786 bestRepresentationForDevice on OSX >= 10.6.
10787
10788 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
10789 to avoid warning.
10790
10791 * emacs.c: Declare unexec_init_emacs_zone.
10792
a63e0781
JD
10793 * nsgui.h: Fix compiler warning about gnulib redefining verify.
10794
699c10bd
JD
10795 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
10796
10797 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
10798 on svcsMenu (Bug#8842).
10799
10800 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
10801 ns_return_types.
10802 (Fns_list_services): Just return Qnil on 10.6, code not working there.
10803
10804 * nsterm.m (QUTF8_STRING): Declare.
10805 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
10806 (validRequestorForSendType): Return type is (id).
10807 Change indexOfObjectIdenticalTo to indexOfObject.
10808 Check if we have local selection before returning self (Bug#8842).
10809 (writeSelectionToPasteboard): Put local selection into paste board
10810 if we have a local selection (Bug#8842).
10811 (syms_of_nsterm): DEFSYM QUTF8_STRING.
10812
10813 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
10814 (ns_get_local_selection): Declare.
10815
54e10184
LMI
108162011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
10817
9888ff71
LMI
10818 * keymap.c (describe_map_tree): Don't insert a double newline at
10819 the end of the buffer (bug#1169) and return whether we inserted
10820 something.
10821
54e10184
LMI
10822 * callint.c (Fcall_interactively): Change "reading args" to
10823 "providing args" to try to clarify what it does (bug#1010).
10824
15fa4783
KH
108252011-07-07 Kenichi Handa <handa@m17n.org>
10826
10827 * composite.c (composition_compute_stop_pos): Ignore a static
10828 composition starting before CHARPOS (Bug#8915).
10829
10830 * xdisp.c (handle_composition_prop): Likewise.
10831
a8815b00
EZ
108322011-07-07 Eli Zaretskii <eliz@gnu.org>
10833
10834 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
10835 (Bug#9015)
10836
ef7b981d 108372011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
10838
10839 * character.h (unicode_category_t): New enum type.
10840
10841 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
10842 (Qchar_code_property_table): New variable.
10843 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
10844 (UNIPROP_COMPRESSED_FORM_P): New macros.
10845 (char_table_ascii): Uncompress the compressed values.
10846 (sub_char_table_ref): New arg is_uniprop. Callers changed.
10847 Uncompress the compressed values.
ac389d0c 10848 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
10849 (char_table_ref_and_range): Uncompress the compressed values.
10850 (sub_char_table_set): New arg is_uniprop. Callers changed.
10851 Uncompress the compressed values.
10852 (sub_char_table_set_range): Args changed. Callers changed.
10853 (char_table_set_range): Adjuted for the above change.
10854 (map_sub_char_table): Delete args default_val and parent. Add arg
10855 top. Give decoded values to a Lisp function.
640c8776 10856 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
10857 values to a Lisp function. Gcpro more variables.
10858 (uniprop_table_uncompress)
10859 (uniprop_decode_value_run_length): New functions.
10860 (uniprop_decoder, uniprop_decoder_count): New variables.
10861 (uniprop_get_decoder, uniprop_encode_value_character)
10862 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
10863 New functions.
10864 (uniprop_encoder, uniprop_encoder_count): New variables.
10865 (uniprop_get_encoder, uniprop_table)
10866 (Funicode_property_table_internal, Fget_unicode_property_internal)
10867 (Fput_unicode_property_internal): New functions.
10868 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
10869 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 10870 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
10871 char-code-property-alist.
10872
640c8776 10873 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
10874 Vunicode_category_table.
10875
640c8776 10876 * font.c (font_range): Adjust for the change of
c805dec0
KH
10877 Vunicode_category_table.
10878
76b397fb
DN
108792011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
10880
10881 * m/iris4d.h: Remove file, move contents ...
10882 * s/irix6-5.h: ... here.
10883
22b4128e
PE
108842011-07-06 Paul Eggert <eggert@cs.ucla.edu>
10885
10886 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
10887 * alloc.c (mark_buffer):
10888 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
10889 (clone_per_buffer_values): Don't assume that
22b4128e
PE
10890 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
10891 This isn't true in general, and it's particularly not true
10892 if Emacs is configured with --with-wide-int.
10893 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
10894 New macros, used in the buffer.c change.
10895
869795d6
JD
108962011-07-05 Jan Djärv <jan.h.d@swipnet.se>
10897
10898 * xsettings.c: Use both GConf and GSettings if both are available.
10899 (store_config_changed_event): Add comment.
10900 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
10901 (store_tool_bar_style_changed): New functions.
5e617bc2 10902 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
10903 (struct xsettings): Move font inside HAVE_XFT.
10904 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 10905 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 10906 Move inside HAVE_XFT.
640c8776 10907 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
10908 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
10909 also.
10910 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 10911 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 10912 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
10913 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
10914 (parse_settings): Move check for font inside HAVE_XFT.
10915 (read_settings, apply_xft_settings): Add comment.
10916 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
10917 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
10918 call store_font_name_changed.
10919 (xft_settings_event): Add comment.
10920 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
10921 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
10922 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
10923 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
10924 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
10925 (xsettings_get_system_font, xsettings_get_system_normal_font):
10926 Add comment.
869795d6 10927
d8ed26bd
PE
109282011-07-05 Paul Eggert <eggert@cs.ucla.edu>
10929
10930 Random fixes. E.g., (random) never returned negative values.
10931 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
10932 subseconds part to the entropy, as that's a bit more random.
10933 Prefer signed to unsigned, since the signedness doesn't matter and
10934 in general we prefer signed. When given a limit, use a
10935 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
10936 latter isn't right if USE_2_TAGS_FOR_INTS.
10937 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
10938 not 0..VALMASK. Don't discard "excess" bits that random () returns.
10939
cabf1cac
SM
109402011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
10941
10942 * textprop.c (text_property_stickiness):
10943 Obey Vtext_property_default_nonsticky.
10944 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
10945 * w32fns.c (syms_of_w32fns):
10946 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
10947
6e9b2be9
PE
109482011-07-04 Paul Eggert <eggert@cs.ucla.edu>
10949
10950 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
10951 This is more efficient than Ffile_directory_p and avoids a minor race.
10952
90186c68
LMI
109532011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
10954
7c301272
LMI
10955 * buffer.c (Foverlay_put): Say what the return value is
10956 (bug#7835).
10957
c4f2d8d4
LMI
10958 * fileio.c (barf_or_query_if_file_exists): Check first if the file
10959 is a directory before asking whether to use the file name
10960 (bug#7564).
ad637907
LMI
10961 (barf_or_query_if_file_exists): Make the "File is a directory"
10962 error be more correct.
c4f2d8d4 10963
90186c68
LMI
10964 * fns.c (Frequire): Remove the mention of the .gz files, since
10965 that's installation-specific, but keep the mention of
10966 `get-load-suffixes'.
10967
da64016e
PE
109682011-07-04 Paul Eggert <eggert@cs.ucla.edu>
10969
10970 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
10971 Report string overflow if the output is too long.
10972
7d47b580
JB
109732011-07-04 Juanma Barranquero <lekktu@gmail.com>
10974
a555cb87
JB
10975 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
10976 (syms_of_gnutls): Remove duplicate DEFSYM for
10977 Qgnutls_bootprop_verify_hostname_error, an error for
10978 Qgnutls_bootprop_verify_error (which is no longer used).
10979
7d47b580
JB
10980 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
10981 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
10982 Also (re)move comments that are misplaced or no longer relevant.
10983
1e49bfab
LMI
109842011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10985
10986 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
10987
1485f4c0
CY
109882011-07-03 Chong Yidong <cyd@stupidchicken.com>
10989
10990 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
10991 and background color parameters if they have been changed.
10992
a9ab721e
LMI
109932011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10994
10995 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
10996
cf7cff57
PE
109972011-07-03 Paul Eggert <eggert@cs.ucla.edu>
10998
2e13213d
PE
10999 * xsettings.c (SYSTEM_FONT): Define only when used.
11000 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
11001
cf7cff57
PE
11002 * keymap.c (access_keymap_1): Now static.
11003
7a8e04f7
CY
110042011-07-02 Chong Yidong <cyd@stupidchicken.com>
11005
11006 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
11007 leave any prefix arg for the up event (Bug#1586).
11008
61352f62
LMI
110092011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
11010
69bb1ef7
LMI
11011 * lread.c (syms_of_lread): Mention single symbols defined by
11012 `defvar' or `defconst' (bug#7154).
11013
61352f62 11014 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 11015 (Frequire): Mention get-load-suffixes.
61352f62 11016
28545e04
MR
110172011-07-02 Martin Rudalics <rudalics@gmx.at>
11018
11019 * window.h (window): Remove clone_number slot.
11020 * window.c (Fwindow_clone_number, Fset_window_clone_number):
11021 Remove.
11022 (make_parent_window, make_window, saved_window)
11023 (Fset_window_configuration, save_window_save): Don't deal with
11024 clone numbers.
11025 * buffer.c (Qclone_number): Remove declaration.
11026 (sort_overlays, overlay_strings): Don't deal with clone numbers.
11027
3349e122
SM
110282011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
11029
11030 Add multiple inheritance to keymaps.
11031 * keymap.c (Fmake_composed_keymap): New function.
11032 (Fset_keymap_parent): Simplify.
11033 (fix_submap_inheritance): Remove.
11034 (access_keymap_1): New function extracted from access_keymap to handle
11035 embedded parents and handle lists of maps.
11036 (access_keymap): Use it.
11037 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
11038 (Fcopy_keymap): Handle embedded parents.
11039 (Fcommand_remapping, define_as_prefix): Simplify.
11040 (Fkey_binding): Simplify.
11041 (syms_of_keymap): Move minibuffer-local-completion-map,
11042 minibuffer-local-filename-completion-map,
11043 minibuffer-local-must-match-map, and
11044 minibuffer-local-filename-must-match-map to Elisp.
11045 (syms_of_keymap): Defsubr make-composed-keymap.
11046 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
11047 (parse_menu_item): Trivial simplification.
11048
3279eb87
GM
110492011-07-01 Glenn Morris <rgm@gnu.org>
11050
11051 * Makefile.in (SETTINGS_LIBS): Fix typo.
11052
39cb9e56 110532011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
11054
11055 * coding.c (Fencode_coding_string): Record the last coding system
11056 used, as the function doc string says (bug#8738).
11057
0949d2b6
JD
110582011-07-01 Jan Djärv <jan.h.d@swipnet.se>
11059
11060 * xsettings.c (store_monospaced_changed): Take new font as arg and
11061 check for change against current_mono_font.
11062 (EMACS_TYPE_SETTINGS): Remove this and related defines.
11063 (emacs_settings_constructor, emacs_settings_get_property)
11064 (emacs_settings_set_property, emacs_settings_class_init)
11065 (emacs_settings_init, gsettings_obj): Remove.
11066 (something_changedCB): New function for HAVE_GSETTINGS.
11067 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
11068 with value as argument.
11069 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
11070 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 11071 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
11072 "changed".
11073
11074 * xgselect.c: Add defined (HAVE_GSETTINGS).
11075 (xgselect_initialize): Ditto.
11076
11077 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
11078 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
11079 xg_select.
11080
bbc6b304
PE
110812011-07-01 Paul Eggert <eggert@cs.ucla.edu>
11082
11083 * eval.c (struct backtrace): Simplify and port the data structure.
11084 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
11085 signed bit field, as this assumption is not portable and it makes
11086 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
11087 "char debug_on_exit : 1" as this is not portable either; instead,
11088 use the portable "unsigned int debug_on_exit : 1". Remove unused
11089 member evalargs. Remove obsolete comments about cc bombing out.
11090
9851bfc5
JD
110912011-06-30 Jan Djärv <jan.h.d@swipnet.se>
11092
51bb811f 11093 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
11094 Let HAVE_GSETTINGS override HAVE_GCONF.
11095 (store_monospaced_changed): New function.
11096 (EMACS_SETTINGS): A new type derived from GObject to handle
11097 GSettings notifications.
11098 (emacs_settings_constructor, emacs_settings_get_property)
11099 (emacs_settings_set_property, emacs_settings_class_init):
11100 New functions.
11101 (gsettings_client, gsettings_obj): New variables.
11102 (GSETTINGS_SCHEMA): New define.
11103 (something_changedCB): Call store_monospaced_changed.
11104 (init_gsettings): New function.
11105 (xsettings_initialize): Call init_gsettings.
11106 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
11107 to NULL.
11108
640c8776 11109 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
11110 GCONF_CFLAGS/LIBS.
11111
5386012d
MR
111122011-06-29 Martin Rudalics <rudalics@gmx.at>
11113
11114 * window.c (resize_root_window, grow_mini_window)
11115 (shrink_mini_window): Rename Qresize_root_window to
11116 Qwindow_resize_root_window and Qresize_root_window_vertically to
11117 Qwindow_resize_root_window_vertically.
11118
f13e0b08
PE
111192011-06-28 Paul Eggert <eggert@cs.ucla.edu>
11120
11121 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
11122
94515237
JB
111232011-06-27 Juanma Barranquero <lekktu@gmail.com>
11124
11125 * makefile.w32-in: Redesign dependencies so they reflect more
11126 clearly which files are directly included by each source file,
11127 and not through other includes.
11128
e43b6e43
MR
111292011-06-27 Martin Rudalics <rudalics@gmx.at>
11130
11131 * buffer.c (Qclone_number): Declare static and DEFSYM it.
11132 (sort_overlays, overlay_strings): When an overlay's clone number
11133 matches the window's clone number process the overlay even if
11134 the overlay's window property doesn't match the current window.
11135
d68443dc
MR
11136 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
11137 (Fwindow_hchild): Rename to Fwindow_left_child.
11138 (Fwindow_next): Rename to Fwindow_next_sibling.
11139 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
11140 (resize_window_check): Rename to window_resize_check.
11141 (resize_window_apply): Rename to window_resize_apply.
11142 (Fresize_window_apply): Rename to Fwindow_resize_apply.
11143 (Fdelete_other_windows_internal, resize_frame_windows)
11144 (Fsplit_window_internal, Fdelete_window_internal)
11145 (grow_mini_window, shrink_mini_window)
11146 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 11147
c7e73be5
JD
111482011-06-26 Jan Djärv <jan.h.d@swipnet.se>
11149
11150 * emacsgtkfixed.h: State that this is only used with Gtk+3.
11151 (emacs_fixed_set_min_size): Remove.
11152 (emacs_fixed_new): Take frame as argument.
11153
11154 * emacsgtkfixed.c: State that this is only used with Gtk+3.
11155 (_EmacsFixedPrivate): Remove minwidth/height.
11156 Add struct frame *f.
11157 (emacs_fixed_init): Initialize priv->f.
11158 (get_parent_class, emacs_fixed_set_min_size): Remove.
11159 (emacs_fixed_new): Set priv->f to argument.
11160 (emacs_fixed_get_preferred_width)
11161 (emacs_fixed_get_preferred_height): Use min_width/height from
11162 frames size_hint to set minimum and natural (Bug#8919).
11163 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
11164 and use min_width/height from frames size_hint to set
11165 min_width/height (Bug#8919).
11166
11167 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
11168 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
11169 Fix indentation.
c7e73be5 11170
cf99dcf8
EZ
111712011-06-26 Eli Zaretskii <eliz@gnu.org>
11172
11173 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
11174 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
11175 called at ZV.
11176
029529ac
CY
111772011-06-26 Chong Yidong <cyd@stupidchicken.com>
11178
11179 * process.c (wait_reading_process_output): Bypass select if
11180 waiting for a cell while ignoring keyboard input, and input is
11181 pending. Suggested by Jan Djärv (Bug#8869).
11182
7a7ef429
PE
111832011-06-25 Paul Eggert <eggert@cs.ucla.edu>
11184
11185 Use gnulib's dup2 module instead of rolling our own.
11186 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
11187
11fdef7d 111882011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
11189
11190 * dispnew.c (scrolling_window): Before scrolling, turn off a
11191 mouse-highlight in the window being scrolled.
11192
cd3520a4
JB
111932011-06-24 Juanma Barranquero <lekktu@gmail.com>
11194
11195 Move DEFSYM to lisp.h and use everywhere.
11196
11197 * character.h (DEFSYM): Move declaration...
11198 * lisp.h (DEFSYM): ...here.
11199
11200 * gnutls.c:
11201 * minibuf.c:
11202 * w32menu.c:
11203 * w32proc.c:
11204 * w32select.c: Don't include character.h.
11205
11206 * alloc.c (syms_of_alloc):
11207 * buffer.c (syms_of_buffer):
11208 * bytecode.c (syms_of_bytecode):
11209 * callint.c (syms_of_callint):
11210 * casefiddle.c (syms_of_casefiddle):
11211 * casetab.c (init_casetab_once):
11212 * category.c (init_category_once, syms_of_category):
11213 * ccl.c (syms_of_ccl):
11214 * cmds.c (syms_of_cmds):
11215 * composite.c (syms_of_composite):
11216 * dbusbind.c (syms_of_dbusbind):
11217 * dired.c (syms_of_dired):
11218 * dispnew.c (syms_of_display):
11219 * doc.c (syms_of_doc):
11220 * editfns.c (syms_of_editfns):
11221 * emacs.c (syms_of_emacs):
11222 * eval.c (syms_of_eval):
11223 * fileio.c (syms_of_fileio):
11224 * fns.c (syms_of_fns):
11225 * frame.c (syms_of_frame):
11226 * fringe.c (syms_of_fringe):
11227 * insdel.c (syms_of_insdel):
11228 * keymap.c (syms_of_keymap):
11229 * lread.c (init_obarray, syms_of_lread):
11230 * macros.c (syms_of_macros):
11231 * msdos.c (syms_of_msdos):
11232 * print.c (syms_of_print):
11233 * process.c (syms_of_process):
11234 * search.c (syms_of_search):
11235 * sound.c (syms_of_sound):
11236 * syntax.c (init_syntax_once, syms_of_syntax):
11237 * terminal.c (syms_of_terminal):
11238 * textprop.c (syms_of_textprop):
11239 * undo.c (syms_of_undo):
11240 * w32.c (globals_of_w32):
11241 * window.c (syms_of_window):
11242 * xdisp.c (syms_of_xdisp):
11243 * xfaces.c (syms_of_xfaces):
11244 * xfns.c (syms_of_xfns):
11245 * xmenu.c (syms_of_xmenu):
11246 * xsettings.c (syms_of_xsettings):
11247 * xterm.c (syms_of_xterm): Use DEFSYM.
11248
4228cf16
TZ
112492011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
11250
cd3520a4 11251 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 11252
7fcccf1e
PE
112532011-06-23 Paul Eggert <eggert@cs.ucla.edu>
11254
7efb4e0e
PE
11255 Integer and buffer overflow fixes (Bug#8873).
11256
ff5844ad
PE
11257 * print.c (printchar, strout): Check for string overflow.
11258 (PRINTPREPARE, printchar, strout):
11259 Don't set size unless allocation succeeds.
11260
90532f02
PE
11261 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
11262 for sizes. Check for string overflow more accurately.
11263 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
11264
6d84508d
PE
11265 * macros.c: Integer and buffer overflow fixes.
11266 * keyboard.h (struct keyboard.kbd_macro_bufsize):
11267 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
11268 Use ptrdiff_t, not int, for sizes.
11269 Don't increment bufsize until after realloc succeeds.
11270 Check for size-calculation overflow.
11271 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
11272
437b2cb4
PE
11273 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
11274
8b9ac8b4
PE
11275 * lread.c: Integer overflow fixes.
11276 (read_integer): Radix is now EMACS_INT, not int,
11277 to improve quality of diagnostics for out-of-range radices.
11278 Calculate buffer size correctly for out-of-range radices.
11279 (read1): Check for integer overflow in radices, and in
11280 read-circle numbers.
82cb60d3
PE
11281 (read_escape): Avoid int overflow.
11282 (Fload, openp, read_buffer_size, read1)
11283 (substitute_object_recurse, read_vector, read_list, map_obarray):
11284 Use ptrdiff_t, not int, for sizes.
11285 (read1): Use EMACS_INT, not int, for sizes.
20270765 11286 Check for size overflow.
8b9ac8b4 11287
7fcccf1e
PE
11288 * image.c (cache_image): Check for size arithmetic overflow.
11289
bfbbd7e7
PE
11290 * lread.c: Integer overflow issues.
11291 (saved_doc_string_size, saved_doc_string_length)
11292 (prev_saved_doc_string_size, prev_saved_doc_string_length):
11293 Now ptrdiff_t, not int.
11294 (read1): Don't assume doc string length fits in int. Check for
11295 out-of-range doc string lengths.
11296 (read_list): Don't assume file position fits in int.
39019e54 11297 (read_escape): Check for hex character overflow.
bfbbd7e7 11298
4e323265
LL
112992011-06-22 Leo Liu <sdl.web@gmail.com>
11300
11301 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
11302 Move to minibuffer.el.
11303
85fece3e
PE
113042011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11305
20b84ce9 11306 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
11307 The following patches are for when GLYPH_DEBUG && !XASSERT.
11308 * dispextern.h (trace_redisplay_p, dump_glyph_string):
11309 * dispnew.c (flush_stdout):
11310 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
11311 Mark as externally visible.
11312 * dispnew.c (check_window_matrix_pointers): Now static.
11313 * dispnew.c (window_to_frame_vpos):
11314 * xfns.c (unwind_create_frame):
11315 * xterm.c (x_check_font): Remove unused local.
11316 * scroll.c (CHECK_BOUNDS):
11317 * xfaces.c (cache_fache): Rename local to avoid shadowing.
11318 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
11319 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
11320 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
11321 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
11322 Now static.
11323 (debug_method_add): Use va_list and vsprintf rather than relying
11324 on undefined behavior with wrong number of arguments.
11325 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
11326 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
11327 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
11328 since we're not interested in debugging glyphs with old libraries.
11329 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
11330 GCC 4.6.0's static checking.
11331
0766b489
PE
113322011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11333
31fd4b32
PE
11334 Integer overflow and signedness fixes (Bug#8873).
11335 A few related buffer overrun fixes, too.
11336
b79e8648
PE
11337 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
11338
0766b489
PE
11339 * dispextern.h (struct face.stipple):
11340 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
11341 (x_bitmap_mask, x_allocate_bitmap_record)
11342 (x_create_bitmap_from_data, x_create_bitmap_from_file)
11343 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
11344 (x_create_bitmap_from_xpm_data):
11345 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
11346 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
11347 (.bitmaps_last):
11348 * xfaces.c (load_pixmap):
11349 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
11350 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
11351 (.bitmaps_last, struct x_output.icon_bitmap):
11352 Use ptrdiff_t, not int, for bitmap indexes.
11353 (x_allocate_bitmap_record): Check for size overflow.
11354 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
11355
b081724f
PE
11356 Use ptrdiff_t, not int, for overlay counts.
11357 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
11358 * editfns.c (overlays_around, get_pos_property):
11359 * textprop.c (get_char_property_and_overlay):
11360 * xdisp.c (next_overlay_change, note_mouse_highlight):
11361 * xfaces.c (face_at_buffer_position):
21514da7
PE
11362 * buffer.c (OVERLAY_COUNT_MAX): New macro.
11363 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
11364 (Fnext_overlay_change, Fprevious_overlay_change)
11365 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 11366 Use ptrdiff_t, not int, for sizes.
21514da7 11367 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 11368
3de73e5e
PE
11369 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
11370
2606c57b
PE
11371 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
11372 (x_session_initialize): Do not assume string length fits in int.
11373
aaafe47a
PE
11374 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
11375 This is unlikely, but can occur if DPI is outlandish.
11376
2674ddc8 11377 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
11378 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
11379
28154962
PE
11380 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
11381 * xrdb.c (magic_file_p, search_magic_path):
11382 Omit last arg SUFFIX; it was always 0. All callers changed.
11383 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
11384
7de51af5
PE
11385 * xfont.c (xfont_match): Avoid need for strlen.
11386
25ed6cc3
PE
11387 * xfns.c: Don't assume strlen fits in int.
11388 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
11389
4eab31dd
PE
11390 * xdisp.c (message_log_check_duplicate): Return intmax_t,
11391 not unsigned long, as we prefer signed integers. All callers changed.
11392 Detect integer overflow in repeat count.
11393 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 11394 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 11395
171e2a58
PE
11396 * termcap.c: Don't assume sizes fit in int and never overflow.
11397 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
11398 (gobble_line): Check for size-calculation overflow.
11399
ad39faca 11400 * minibuf.c (Fread_buffer):
6e5bb2dc 11401 * lread.c (intern, intern_c_string):
74ca2eb3
PE
11402 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
11403 Don't assume string length fits in int.
11404
52c61c22 11405 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
11406 * gtkutil.c (style_changed_cb): Avoid need for strlen.
11407
b5b8c9e5
PE
11408 * font.c: Don't assume string length fits in int.
11409 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
11410 Use ptrdiff_t, not int.
ccd6111c
PE
11411 (font_intern_prop): Don't assume string length fits in int.
11412 Don't assume integer property fits in fixnum.
11413 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 11414
882f0d81 11415 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 11416 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
11417 Reformulate so as not to need the command string.
11418 Invoke gzip -cd rather than gunzip, as it's more portable.
11419 (lock_info_type, lock_file_1, lock_file):
11420 Don't assume pid_t and time_t fit in unsigned long.
11421 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
11422 (current_lock_owner): Prefer signed type for sizes.
11423 Use memcpy, not strncpy, where memcpy is what is really wanted.
11424 Don't assume (via atoi) that time_t and pid_t fit in int.
11425 Check for time_t and/or pid_t out of range, e.g., via a network share.
11426 Don't alloca where an auto var works fine.
11427
93f4cf88
PE
11428 * fileio.c: Fix some integer overflow issues.
11429 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
11430 Don't assume string length fits in int.
11431 (directory_file_name): Don't assume string length fits in long.
11432 (make_temp_name): Don't assume pid fits in int, or that its print
11433 length is less than 20.
11434
f3e92b69
PE
11435 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
11436
1bfdaf10
PE
11437 * coding.c (make_subsidiaries): Don't assume string length fits in int.
11438
35016e9a
PE
11439 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
11440
3d1e65a1
PE
11441 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
11442 We prefer signed integers, even for size calculations.
11443
0b963a93
PE
11444 * emacs.c: Don't assume string length fits in 'int'.
11445 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
11446 (main): Don't invoke strlen when not needed.
11447
573f4b54
PE
11448 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
11449 (XD_DEBUG_MESSAGE): Don't waste a byte.
11450
989f33ba
PE
11451 * callproc.c (getenv_internal_1, getenv_internal)
11452 (Fgetenv_internal):
965d34eb
PE
11453 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
11454
e4d29b33
PE
11455 * lread.c (invalid_syntax): Omit length argument.
11456 All uses changed. This doesn't fix a bug, but it simplifies the
11457 code away from its former Hollerith-constant appearance, and it's
11458 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 11459 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 11460
eb49b136
PE
11461 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
11462 This didn't break anything, but it didn't help either.
11463 It's confusing to put a bogus integer in a place where the actual
11464 value does not matter.
9f62aeb1 11465 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 11466 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 11467
15375a22
PE
11468 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
11469 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
11470 implementation.
b61cc01c
PE
11471 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
11472 We prefer signed types, and the value cannot exceed the EMACS_INT
11473 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
11474 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
11475 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
11476 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 11477
53b2623d
PE
11478 * indent.c (sane_tab_width): New function.
11479 (current_column, scan_for_column, Findent_to, position_indentation)
11480 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 11481 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 11482
51cab52b 11483 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 11484
f2ed8a70
PE
11485 * lisp.h (lint_assume): New macro.
11486 * composite.c (composition_gstring_put_cache):
11487 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
11488
abe80cc6
PE
11489 * editfns.c, insdel.c:
11490 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 11491
b02c740e
PE
11492 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
11493
ebc96716
PE
11494 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
11495
b4e50fa0 11496 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 11497 Use much-faster test for byte-length change.
311d5d7c 11498 Don't assume string byte-length fits in 'int'.
a4cf38e4 11499 Check that character arg fits in 'int'.
85461888 11500 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 11501
c0c1ee9f
PE
11502 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
11503
a498d7f4
PE
11504 * fns.c (concat): Catch string overflow earlier.
11505 Do not rely on integer wraparound.
11506
51cab52b
PE
11507 * dispextern.h (struct it.overlay_strings_charpos)
11508 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
11509 * xdisp.c (forward_to_next_line_start)
11510 (back_to_previous_visible_line_start)
11511 (reseat_at_next_visible_line_start, next_element_from_buffer):
11512 Don't arbitrarily truncate the value of 'selective' to int.
11513
76031fad
PE
11514 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
11515
5eb55db9
PE
11516 * composite.c: Don't truncate sizes to 'int'.
11517 (composition_gstring_p, composition_reseat_it)
11518 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
11519 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
11520 not EMACS_UINT, for indexes.
5eb55db9 11521
0703a717
PE
11522 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
11523
d6202519
PE
11524 * buffer.c: Include <verify.h>.
11525 (struct sortvec.priority, struct sortstr.priority):
8961a454 11526 Now EMACS_INT, not int.
c20998a7 11527 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
11528 (struct sortstr.size, record_overlay_string)
11529 (struct sortstrlist.size, struct sortlist.used):
11530 Don't truncate size to int.
11531 (record_overlay_string): Check for size-calculation overflow.
d6202519 11532 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 11533
d5a19415
JM
115342011-06-22 Jim Meyering <meyering@redhat.com>
11535
029529ac 11536 Don't leak an XBM-image-sized buffer
d5a19415
JM
11537 * image.c (xbm_load): Free the image buffer after using it.
11538
a9041e6c
PE
115392011-06-21 Paul Eggert <eggert@cs.ucla.edu>
11540
11541 Port to Sun C.
11542 * composite.c (find_automatic_composition): Omit needless 'return 0;'
11543 that Sun C diagnosed.
11544 * fns.c (secure_hash): Fix pointer signedness issue.
11545 * intervals.c (static_offset_intervals): New function.
11546 (offset_intervals): Use it.
11547
7f3f739f
LL
115482011-06-21 Leo Liu <sdl.web@gmail.com>
11549
11550 * deps.mk (fns.o):
11551 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
11552 sha512.h.
11553
11554 * fns.c (secure_hash): Rename from crypto_hash_function and change
11555 the first arg to accept symbols.
5b66d427 11556 (Fsecure_hash): New primitive.
7f3f739f
LL
11557 (syms_of_fns): New symbols.
11558
76147d94
DD
115592011-06-20 Deniz Dogan <deniz@dogan.se>
11560
11561 * process.c (Fset_process_buffer): Clarify return value in
11562 docstring.
11563
7d7d0045
CY
115642011-06-18 Chong Yidong <cyd@stupidchicken.com>
11565
11566 * dispnew.c (add_window_display_history): Use BVAR.
11567
11568 * xdisp.c (debug_method_add): Use BVAR.
11569 (check_window_end, dump_glyph_matrix, dump_glyph)
11570 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
11571
11572 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
11573 Likewise.
11574
11575 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
11576 check till after the cache is created in init_frame_faces.
11577
ff2bc410
SM
115782011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
11579
11580 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
11581
28177add
PE
115822011-06-16 Paul Eggert <eggert@cs.ucla.edu>
11583
dd3482fe
PE
11584 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
11585 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
11586 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
11587
393d71f3 11588 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
11589 * fileio.c (Finsert_file_contents):
11590 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
11591 Remove the old (too-loose) buffer overflow checks.
11592 They weren't needed, since make_gap checks for buffer overflow.
11593 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
11594 The old code merely checked for Emacs fixnum overflow, and relied
11595 on undefined (wraparound) behavior. The new code avoids undefined
11596 behavior, and also checks for ptrdiff_t and/or size_t overflow.
11597
2e6813b0 11598 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
11599 Tune. Don't use wider integers than needed. Don't use alloca.
11600 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 11601
599a9e4f
PE
11602 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
11603
99561444
PE
11604 * insdel.c, lisp.h (buffer_overflow): New function.
11605 (insert_from_buffer_1, replace_range, replace_range_2):
11606 * insdel.c (make_gap_larger):
11607 * editfns.c (Finsert_char):
11608 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
11609
28177add
PE
11610 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
11611
e69dafad
PE
116122011-06-15 Paul Eggert <eggert@cs.ucla.edu>
11613
4baa020d 11614 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 11615
b1c46f02
PE
11616 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
11617 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
11618
e69dafad
PE
11619 * fileio.c: Don't assume EMACS_INT fits in off_t.
11620 (emacs_lseek): New static function.
11621 (Finsert_file_contents, Fwrite_region): Use it.
11622 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
11623
566684ea
PE
11624 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
11625
e6966cd6
PE
11626 * fns.c: Don't overflow int when computing a list length.
11627 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
11628 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
11629 truncation on 64-bit hosts. Check for QUIT every
11630 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
11631 faster and is responsive enough.
11632 (Flength): Report an error instead of overflowing an integer.
11633 (Fsafe_length): Return a float if the value is not representable
11634 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 11635 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 11636 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 11637
dd0b0efb
PE
11638 * alloc.c: Check that resized vectors' lengths fit in fixnums.
11639 (header_size, word_size): New constants.
11640 (allocate_vectorlike): Don't check size overflow here.
11641 (allocate_vector): Check it here instead, since this is the only
11642 caller of allocate_vectorlike that could cause overflow.
11643 Check that the new vector's length is representable as a fixnum.
11644
86fe5cfe
PE
11645 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
11646 The previous code was bogus. For example, next_almost_prime (32)
11647 returned 39, which is undesirable as it is a multiple of 3; and
11648 next_almost_prime (24) returned 25, which is a multiple of 5 so
11649 why was the code bothering to check for multiples of 7?
11650
80e88859
PE
11651 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
11652
4a2f0ad6
PE
11653 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
11654
f66c7cf8
PE
11655 Variadic C functions now count arguments with ptrdiff_t.
11656 This partly undoes my 2011-03-30 change, which replaced int with size_t.
11657 Back then I didn't know that the Emacs coding style prefers signed int.
11658 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
11659 were being counted with int, which may truncate counts on 64-bit
11660 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
11661 * lisp.h (struct Lisp_Subr.function.aMANY)
11662 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
11663 Arg counts are now ptrdiff_t, not size_t.
11664 All variadic functions and their callers changed accordingly.
11665 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
11666 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
11667 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
11668 * callint.c (Fcall_interactively): Check arg count for overflow,
11669 to avoid potential buffer overrun. Use signed char, not 'int',
11670 for 'varies' array, so that we needn't bother to check its size
11671 calculation for overflow.
11672 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
11673 * eval.c (apply_lambda):
11674 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
11675 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
11676 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
11677
a1759b76
PE
11678 * callint.c (Fcall_interactively): Don't use index var as event count.
11679
d96be9fc
PE
11680 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
11681 * mem-limits.h (SIZE): Remove; no longer used.
11682
a690a978 11683 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 11684
578c21e6
PE
11685 Remove unnecessary casts.
11686 * xterm.c (x_term_init):
11687 * xfns.c (x_set_border_pixel):
11688 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
11689 These aren't needed now that we assume ANSI C.
11690
96f53c6c
PE
11691 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
11692 It's more likely to cause problems (due to unsigned overflow)
11693 than to cure them.
11694
83c77d31
PE
11695 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
11696
ee2079f1
PE
11697 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
11698
6da65536
PE
11699 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
11700
7147c4a4
PE
11701 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
11702
193e32d9
PE
11703 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
11704
e5533da6
PE
11705 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
11706
9910e595
PE
11707 GLYPH_CODE_FACE returns EMACS_INT, not int.
11708 * dispextern.h (merge_faces):
11709 * xfaces.c (merge_faces):
01103c44
PE
11710 * xdisp.c (get_next_display_element, next_element_from_display_vector):
11711 Don't assume EMACS_INT fits in int.
9910e595 11712
2638320e
PE
11713 * character.h (CHAR_VALID_P): Remove unused parameter.
11714 * fontset.c, lisp.h, xdisp.c: All uses changed.
11715
045eb8d9
PE
11716 * editfns.c (Ftranslate_region_internal): Omit redundant test.
11717
c1f134b5
PE
11718 * fns.c (concat): Minor tuning based on overflow analysis.
11719 This doesn't fix any bugs. Use int to hold character, instead
11720 of constantly refetching from Emacs object. Use XFASTINT, not
11721 XINT, for value known to be a character. Don't bother comparing
11722 a single byte to 0400, as it's always less.
11723
395fcb93 11724 * floatfns.c (Fexpt):
327eeec8
PE
11725 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
11726
abbd3d23
PE
11727 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
11728 for characters.
11729
684a03ef
PE
11730 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
11731
0fed43f3
PE
11732 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
11733 Without this fix, on a 64-bit host (aset S 0 4294967386) would
11734 incorrectly succeed when S was a string, because 4294967386 was
11735 truncated before it was used.
11736
8fd02eb7
PE
11737 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
11738 Otherwise, an out-of-range integer could cause undefined behavior
11739 on a 64-bit host.
11740
f8c86b69
PE
11741 * composite.c: Use int, not EMACS_INT, for characters.
11742 (fill_gstring_body, composition_compute_stop_pos): Use int, not
11743 EMACS_INT, for values that are known to be in character range.
11744 This doesn't fix any bugs but is the usual style inside Emacs and
11745 may generate better code on 32-bit machines.
11746
34206dd2
PE
11747 Make sure a 64-bit char is never passed to ENCODE_CHAR.
11748 This is for reasons similar to the recent CHAR_STRING fix.
11749 * charset.c (Fencode_char): Check that character arg is actually
11750 a character. Pass an int to ENCODE_CHAR.
11751 * charset.h (ENCODE_CHAR): Verify that the character argument is no
11752 wider than 'int', as a compile-time check to prevent future regressions
11753 in this area.
11754
c5958d4c 11755 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
11756
11757 Make sure a 64-bit char is never passed to CHAR_STRING.
11758 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
11759 by silently ignoring the top 32 bits, allowing some values
11760 that were far too large to be valid characters.
11761 * character.h: Include <verify.h>.
11762 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
11763 arguments are no wider than unsigned, as a compile-time check
11764 to prevent future regressions in this area.
11765 * data.c (Faset):
01103c44 11766 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
11767 (Fsubst_char_in_region):
11768 * fns.c (concat):
11769 * xdisp.c (decode_mode_spec_coding):
11770 Adjust to CHAR_STRING's new requirement.
11771 * editfns.c (Finsert_char, Fsubst_char_in_region):
11772 * fns.c (concat): Check that character args are actually
11773 characters. Without this test, these functions did the wrong
11774 thing with wildly out-of-range values on 64-bit hosts.
11775
d37ca623
PE
11776 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
11777 These casts should not be needed on 32-bit hosts, either.
11778 * keyboard.c (read_char):
11779 * lread.c (Fload): Remove casts to unsigned.
11780
ea204efb
PE
11781 * lisp.h (UNSIGNED_CMP): New macro.
11782 This fixes comparison bugs on 64-bit hosts.
11783 (ASCII_CHAR_P): Use it.
11784 * casefiddle.c (casify_object):
01103c44 11785 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
11786 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
11787 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
11788 * dispextern.h (FACE_FROM_ID):
11789 * keyboard.c (read_char): Use UNSIGNED_CMP.
11790
41cb286c
PE
11791 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
11792 not to EMACS_INT, to avoid GCC warning.
11793
4a1b9832
PE
11794 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
11795
55daad71
PE
11796 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
11797 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
11798 isn't needed on 32-bit machines.
8f95c75c 11799
01103c44
PE
11800 * buffer.c (Fgenerate_new_buffer_name):
11801 Use EMACS_INT for count, not int.
0ceccced 11802 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
11803
11804 * data.c (Qcompiled_function): Now static.
11805
c6f072e7
PE
11806 * window.c (window_body_lines): Now static.
11807
20ce5912
PE
11808 * image.c (gif_load): Rename local to avoid shadowing.
11809
9c4c5f81
PE
11810 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
11811 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
11812 * alloc.c (make_save_value): Integer argument is now of type
11813 ptrdiff_t, not int.
11814 (mark_object): Use ptrdiff_t, not int.
11815 * lisp.h (pD): New macro.
11816 * print.c (print_object): Use it.
11817
c0c5c8ae
PE
11818 * alloc.c: Use EMACS_INT, not int, to count objects.
11819 (total_conses, total_markers, total_symbols, total_vector_size)
11820 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
11821 (total_free_floats, total_floats, total_free_intervals)
11822 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
11823 Now EMACS_INT, not int. All uses changed.
11824 (Fgarbage_collect): Compute overall total using a double, so that
11825 integer overflow is less likely to be a problem. Check for overflow
11826 when converting back to an integer.
5a25e253
PE
11827 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
11828 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
11829 These were 'int' variables that could overflow on 64-bit hosts;
11830 they were never used, so remove them instead of repairing them.
211a0b2a 11831 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
11832 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
11833 Previously, this ceilinged at INT_MAX, but that doesn't work on
11834 64-bit machines.
e46bb31a 11835 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 11836
c78baabf 11837 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 11838 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
11839 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
11840 when a (possibly-narrower) signed value would do just as well.
11841 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 11842
c9d624c6
PE
11843 * alloc.c: Catch some string size overflows that we were missing.
11844 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
11845 for convenience in STRING_BYTES_MAX.
11846 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
11847 The definition here is exact; the one in lisp.h was approximate.
11848 (allocate_string_data): Check for string overflow. This catches
11849 some instances we weren't catching before. Also, it catches
11850 size_t overflow on (unusual) hosts where SIZE_MAX <= min
11851 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
11852 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 11853
c9d624c6
PE
11854 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
11855 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 11856 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 11857
353032ce
PE
11858 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
11859
2bccce07
PE
11860 * alloc.c (Fmake_string): Check for out-of-range init.
11861
0ac30604
SM
118622011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
11863
11864 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
11865
c195f2de
JD
118662011-06-14 Jan Djärv <jan.h.d@swipnet.se>
11867
11868 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
11869 xg_get_default_scrollbar_width.
11870
11871 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
11872 (int_gtk_range_get_value): Move to the scroll bar part of the file.
11873 (style_changed_cb): Call update_theme_scrollbar_width and call
11874 x_set_scroll_bar_default_width and xg_frame_set_char_size for
11875 all frames (Bug#8505).
11876 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
11877 Call gtk_window_set_resizable if HAVE_GTK3.
11878 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
11879 and height if HAVE_GTK3 (Bug#8505).
11880 (scroll_bar_width_for_theme): New variable.
11881 (update_theme_scrollbar_width): New function.
11882 (xg_get_default_scrollbar_width): Move code to
11883 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
11884 (xg_initialize): Call update_theme_scrollbar_width.
11885
11886 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
11887
11888 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
11889
e10ac9f1
MR
118902011-06-12 Martin Rudalics <rudalics@gmx.at>
11891
11892 * frame.c (make_frame): Call other_buffer_safely instead of
11893 other_buffer.
11894
11895 * window.c (temp_output_buffer_show): Call display_buffer with
11896 second argument Vtemp_buffer_show_specifiers and reset latter
11897 immediately after the call.
11898 (Vtemp_buffer_show_specifiers): New variable.
11899 (auto_window_vscroll_p, next_screen_context_lines)
11900 (Vscroll_preserve_screen_position): Remove leading asterisks from
11901 doc-strings.
11902
2d3c217e 119032011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 11904
7b7f97e8 11905 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
11906 * buffer.c (Qclone_number): Remove for now, as it's unused.
11907 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
11908 (record_buffer): Remove unused local.
11909 * frame.c (other_visible_frames, frame_buffer_list): Now static.
11910 (set_frame_buffer_list): Remove; unused.
11911 * frame.h (other_visible_frames): Remove decl.
11912 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
11913 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
11914 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
11915 if HAVE_GPM.
11916 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
11917 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
11918 Define only if HAVE_GPM.
11919 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
11920 (update_hints_inhibit): Remove; never set. All uses removed.
11921 * widgetprv.h (emacsFrameClassRec): Remove decl.
11922 * window.c (delete_deletable_window): Now returns void, since it
11923 wasn't returning anything.
11924 (compare_window_configurations): Remove unused locals.
11925 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
11926 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
11927 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
11928 the same widths as pointers. This follows up on the 2011-05-06 patch.
11929 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
11930 * xterm.h: Likewise.
11931 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
11932
1384b89e
JB
119332011-06-12 Juanma Barranquero <lekktu@gmail.com>
11934
11935 * makefile.w32-in: Update dependencies.
11936 (LISP_H): Add lib/intprops.h.
11937
1100a63c
CY
119382011-06-11 Chong Yidong <cyd@stupidchicken.com>
11939
11940 * image.c (gif_load): Add animation frame delay to the metadata.
11941 (syms_of_image): Use DEFSYM. New symbol `delay'.
11942
6198ccd0
MR
119432011-06-11 Martin Rudalics <rudalics@gmx.at>
11944
11945 * window.c (delete_deletable_window): Re-add.
11946 (Fset_window_configuration): Rewrite to handle dead buffers and
11947 consequently deletable windows.
11948 (window_tree, Fwindow_tree): Remove. Supply functionality in
11949 window.el.
11950 (compare_window_configurations): Simplify code.
11951
b6e3633c
AS
119522011-06-11 Andreas Schwab <schwab@linux-m68k.org>
11953
1ab0dee5
AS
11954 * image.c (imagemagick_load_image): Fix type mismatch.
11955 (Fimagemagick_types): Likewise.
11956
b6e3633c
AS
11957 * window.h (replace_buffer_in_windows): Declare.
11958
9397e56f
MR
119592011-06-11 Martin Rudalics <rudalics@gmx.at>
11960
11961 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
11962 Qclone_number. Remove external declaration of Qdelete_window.
11963 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
11964 code.
640c8776
SM
11965 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
11966 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
11967 (Fother_buffer): Rewrite doc-string. Major rewrite for new
11968 buffer list implementation.
11969 (other_buffer_safely): New function.
11970 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
11971 calls to replace_buffer_in_windows and
11972 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
11973 if allowed.
11974 (record_buffer): Inhibit quitting and rewrite using quittable
11975 functions. Run Qbuffer_list_update_hook if allowed.
11976 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
11977 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
11978 Move switch-to-buffer to window.el.
9397e56f
MR
11979 (bury-buffer): Move to window.el.
11980 (Vbuffer_list_update_hook): New variable.
11981
11982 * lisp.h (other_buffer_safely): Add prototype in buffer.c
11983 section.
11984
11985 * window.h (resize_frame_windows): Move up in code.
11986 (Fwindow_frame): Remove EXFUN.
11987 (replace_buffer_in_all_windows): Remove prototype.
11988 (replace_buffer_in_windows_safely): Add prototype.
11989
11990 * window.c: Declare Qdelete_window static again. Move down
11991 declaration of select_count.
11992 (Fnext_window, Fprevious_window): Rewrite doc-strings.
11993 (Fother_window): Move to window.el.
11994 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
11995 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
11996 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
11997 window.el.
11998 (replace_buffer_in_windows): Implement by calling
11999 Qreplace_buffer_in_windows.
12000 (replace_buffer_in_all_windows): Remove with some functionality
12001 moved into replace_buffer_in_windows_safely.
12002 (replace_buffer_in_windows_safely): New function.
12003 (select_window_norecord, select_frame_norecord): Move in front
12004 of run_window_configuration_change_hook. Remove now obsolete
12005 declarations.
640c8776
SM
12006 (Fset_window_buffer): Rewrite doc-string.
12007 Call Qrecord_window_buffer.
9397e56f
MR
12008 (keys_of_window): Move binding for other-window to window.el.
12009
b50691aa
CY
120102011-06-11 Chong Yidong <cyd@stupidchicken.com>
12011
12012 * dispextern.h (struct image): Replace data member, whose int_val
12013 and ptr_val fields were not used by anything, with a single
12014 lisp_val object.
12015
12016 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
12017 (gif_clear_image, gif_load, imagemagick_load_image)
12018 (gs_clear_image, gs_load): Callers changed.
12019
3f754b86
PE
120202011-06-10 Paul Eggert <eggert@cs.ucla.edu>
12021
cca69397
PE
12022 * buffer.h: Include <time.h>, for time_t.
12023 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
12024
109e28d0
PE
12025 Fix minor problems found by static checking.
12026
60737f02
PE
12027 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
12028
4b66faf3
PE
12029 Make identifiers static if they are not used in other modules.
12030 * data.c (Qcompiled_function, Qframe, Qvector):
12031 * image.c (QimageMagick, Qsvg):
12032 * minibuf.c (Qmetadata):
12033 * window.c (resize_window_check, resize_root_window): Now static.
12034 * window.h (resize_window_check, resize_root_window): Remove decls.
12035
109e28d0
PE
12036 * window.c (window_deletion_count, delete_deletable_window):
12037 Remove; unused.
46a4ce9e
PE
12038 (window_body_lines): Now static.
12039 (Fdelete_other_windows_internal): Mark vars as initialized.
12040 Make sure 'resize_failed' is initialized.
12041 (run_window_configuration_change_hook): Rename local to avoid shadowing.
12042 (resize_window_apply): Remove unused local.
12043 * window.h (delete_deletable_window): Remove decl.
12044
109e28d0 12045 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
12046 (imagemagick_load_image): Fix pointer signedness problem by changing
12047 last arg from unsigned char * to char *. All uses changed.
12048 Also, fix a local for similar reasons.
12049 Remove unused locals. Remove locals to avoid shadowing.
12050 (fn_rsvg_handle_free): Remove; unused.
12051 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 12052 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 12053
3f754b86
PE
12054 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
12055
2547adb1
CY
120562011-06-10 Chong Yidong <cyd@stupidchicken.com>
12057
12058 * image.c (gif_load): Fix omitted cast error introduced by
12059 2011-06-06 change.
12060
2c8e37d4
MR
120612011-06-10 Martin Rudalics <rudalics@gmx.at>
12062
12063 * window.h (resize_proportionally, orig_total_lines)
12064 (orig_top_line): Remove from window structure.
12065 (set_window_height, set_window_width, change_window_heights)
12066 (Fdelete_window): Remove prototypes.
12067 (resize_frame_windows): Remove duplicate declaration.
12068
440a42e3
EZ
120692011-06-10 Eli Zaretskii <eliz@gnu.org>
12070
12071 * window.h (resize_frame_windows, resize_window_check)
12072 (delete_deletable_window, resize_root_window)
12073 (resize_frame_windows): Declare prototypes.
12074
12075 * window.c (resize_window_apply): Make definition be "static" to
12076 match the prototype.
12077
562dd5e9
MR
120782011-06-10 Martin Rudalics <rudalics@gmx.at>
12079
12080 * window.c: Remove declarations of Qwindow_size_fixed,
12081 window_min_size_1, window_min_size_2, window_min_size,
12082 size_window, window_fixed_size_p, enlarge_window, delete_window.
12083 Remove static from declaration of Qdelete_window, it's
12084 temporarily needed by Fbury_buffer.
12085 (replace_window): Don't assign orig_top_line and
12086 orig_total_lines.
12087 (Fdelete_window, delete_window): Remove. Window deletion is
12088 handled by window.el.
640c8776
SM
12089 (window_loop): Remove DELETE_OTHER_WINDOWS case.
12090 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
12091 (Fdelete_other_windows): Remove. Deleting other windows is
12092 handled by window.el.
12093 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
12094 handled in window.el.
12095 (window_min_size_2, window_min_size_1, window_min_size): Remove.
12096 Window minimum sizes are handled in window.el.
12097 (shrink_windows, size_window, set_window_height)
12098 (set_window_width, change_window_heights, window_height)
12099 (window_width, CURBEG, CURSIZE, enlarge_window)
12100 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
12101 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
12102 handled in window.el.
12103 (make_dummy_parent): Rename to make_parent_window and give it a
12104 second argument horflag.
12105 (make_window): Don't set resize_proportionally any more.
12106 (Fsplit_window): Remove. Windows are split in window.el.
12107 (save_restore_action, save_restore_orig_size)
12108 (shrink_window_lowest_first, save_restore_orig_size): Remove.
12109 Resize mini windows in window.el.
12110 (grow_mini_window, shrink_mini_window): Implement by calling
12111 Qresize_root_window_vertically, resize_window_check and
12112 resize_window_apply.
640c8776
SM
12113 (saved_window, Fset_window_configuration, save_window_save):
12114 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
12115 resize_proportionally.
12116 (window_min_height, window_min_width): Move to window.el.
12117 (keys_of_window): Move bindings for delete-other-windows,
12118 split-window, delete-window and enlarge-window to window.el.
12119
12120 * buffer.c: Temporarily extern Qdelete_window.
12121 (Fbury_buffer): Temporarily call Qdelete_window instead of
12122 Fdelete_window (Fbury_buffer will move to window.el soon).
12123
12124 * frame.c (set_menu_bar_lines_1): Remove code handling
12125 orig_top_line and orig_total_lines.
12126
12127 * dispnew.c (adjust_frame_glyphs_initially): Don't use
12128 set_window_height but set heights directly.
12129 (change_frame_size_1): Use resize_frame_windows.
12130
12131 * xdisp.c (init_xdisp): Don't use set_window_height but set
12132 heights directly.
12133
640c8776
SM
12134 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
12135 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
12136 run_window_configuration_change_hook.
12137
12138 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
12139 instead of change_window_heights and run
12140 run_window_configuration_change_hook.
12141
1a13852e
MR
121422011-06-09 Martin Rudalics <rudalics@gmx.at>
12143
12144 * window.c (replace_window): Rename second argument REPLACEMENT to
12145 NEW. New third argument SETFLAG. Rewrite.
12146 (delete_window, make_dummy_parent): Call replace_window with
12147 third argument 1.
12148 (window_list_1): Move down in code.
12149 (run_window_configuration_change_hook): Move set_buffer part
12150 before select_frame_norecord part in order to unwind correctly.
12151 Rename count1 to count.
12152 (recombine_windows, delete_deletable_window, resize_root_window)
12153 (Fdelete_other_windows_internal)
12154 (Frun_window_configuration_change_hook, make_parent_window)
12155 (resize_window_check, resize_window_apply, Fresize_window_apply)
12156 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
12157 (Fdelete_window_internal, Fresize_mini_window_internal):
12158 New functions.
1a13852e
MR
12159 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
12160
f3d1777e
MR
121612011-06-08 Martin Rudalics <rudalics@gmx.at>
12162
496e208e
MR
12163 * window.h (window): Add some new members to window structure -
12164 normal_lines, normal_cols, new_total, new_normal, clone_number,
12165 splits, nest, prev_buffers, next_buffers.
12166 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 12167 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 12168
f3d1777e
MR
12169 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
12170 Remove.
496e208e
MR
12171 (make_dummy_parent): Set new members of windows structure.
12172 (make_window): Move down in code. Handle new members of window
12173 structure.
12174 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
12175 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
12176 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
12177 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
12178 (Fset_window_next_buffers, Fset_window_clone_number):
12179 New functions.
496e208e
MR
12180 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
12181 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
12182 Doc-string fixes.
12183 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
12184 Argument WINDOW can be now internal window too.
12185 (Fwindow_use_time): Move up in code.
12186 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
12187 Rewrite doc-string.
12188 (Fset_window_configuration, saved_window)
12189 (Fcurrent_window_configuration, save_window_save): Handle new
12190 members of window structure.
b9e809c2
MR
12191 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
12192 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
12193 (syms_of_window): New Lisp objects Qrecord_window_buffer,
12194 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
12195 Qget_mru_window, Qresize_root_window,
12196 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
12197 Qauto_buffer_name; staticpro them.
f3d1777e 12198
abde8f8c
MR
121992011-06-07 Martin Rudalics <rudalics@gmx.at>
12200
12201 * window.c (Fwindow_total_size, Fwindow_left_column)
12202 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
12203 (Fwindow_list_1): New functions.
12204 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
12205 (Fwindow_width, Fscroll_left, Fscroll_right):
12206 Use window_body_cols instead of window_box_text_cols.
12207 (delete_window, Fset_window_configuration):
12208 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
12209 (delete_all_subwindows): Take a window as argument and not a
12210 structure. Rewrite.
190b47e6
MR
12211 (window_loop): Remove handling of GET_LRU_WINDOW and
12212 GET_LARGEST_WINDOW.
12213 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
12214
12215 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
12216 window_box_text_cols. delete_all_subwindows now takes a
12217 Lisp_Object as argument.
abde8f8c 12218
640c8776
SM
12219 * indent.c (compute_motion, Fcompute_motion):
12220 Use window_body_cols instead of window_box_text_cols.
abde8f8c 12221
fa8a67e6
MR
12222 * frame.c (delete_frame): Call delete_all_subwindows with root
12223 window as argument.
12224
a54e3482
DC
122252011-06-07 Daniel Colascione <dan.colascione@gmail.com>
12226
12227 * fns.c (Fputhash): Document return value.
12228
60002bf5
CY
122292011-06-06 Chong Yidong <cyd@stupidchicken.com>
12230
12231 * image.c (gif_load): Implement gif89a spec "no disposal" method.
12232
0c671da6 122332011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 12234
b862a52a 12235 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 12236
be44ca6c
PE
12237 Check for overflow when converting integer to cons and back.
12238 * charset.c (Fdefine_charset_internal, Fdecode_char):
12239 Use cons_to_unsigned to catch overflow.
12240 (Fencode_char): Use INTEGER_TO_CONS.
12241 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
12242 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
12243 * data.c (long_to_cons, cons_to_long): Remove.
12244 (cons_to_unsigned, cons_to_signed): New functions.
12245 These signal an error for invalid or out-of-range values.
12246 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
12247 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
12248 * font.c (Ffont_variation_glyphs):
12249 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
12250 * lisp.h: Include <intprops.h>.
12251 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
12252 (cons_to_signed, cons_to_unsigned): New decls.
12253 (long_to_cons, cons_to_long): Remove decls.
12254 * undo.c (record_first_change): Use INTEGER_TO_CONS.
12255 (Fprimitive_undo): Use CONS_TO_INTEGER.
12256 * xfns.c (Fx_window_property): Likewise.
12257 * xselect.c: Include <limits.h>.
12258 (x_own_selection, selection_data_to_lisp_data):
12259 Use INTEGER_TO_CONS.
12260 (x_handle_selection_request, x_handle_selection_clear)
12261 (x_get_foreign_selection, Fx_disown_selection_internal)
12262 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
12263 (lisp_data_to_selection_data): Use cons_to_unsigned.
12264 (x_fill_property_data): Use cons_to_signed.
12265 Report values out of range.
12266
d1f3d2af
PE
12267 Check for buffer and string overflow more precisely.
12268 * buffer.h (BUF_BYTES_MAX): New macro.
12269 * lisp.h (STRING_BYTES_MAX): New macro.
12270 * alloc.c (Fmake_string):
12271 * character.c (string_escape_byte8):
12272 * coding.c (coding_alloc_by_realloc):
12273 * doprnt.c (doprnt):
12274 * editfns.c (Fformat):
12275 * eval.c (verror):
12276 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
12277 since they may not be the same number.
12278 * editfns.c (Finsert_char):
12279 * fileio.c (Finsert_file_contents):
12280 Likewise for BUF_BYTES_MAX.
12281
dd52fcea
PE
12282 * image.c: Use ptrdiff_t, not int, for sizes.
12283 (slurp_file): Switch from int to ptrdiff_t.
12284 All uses changed.
12285 (slurp_file): Check that file size fits in both size_t (for
12286 malloc) and ptrdiff_t (for sanity and safety).
12287
7f9bbdbb
PE
12288 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
12289 if b->modtime has its maximal value.
12290
dfe18f82
PE
12291 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
12292
84acfcf0
PE
12293 Don't assume time_t can fit into int.
12294 * buffer.h (struct buffer.modtime): Now time_t, not int.
12295 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
12296 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
12297
ccd9a01a
PE
12298 Minor fixes for signed vs unsigned integers.
12299 * character.h (MAYBE_UNIFY_CHAR):
12300 * charset.c (maybe_unify_char):
12301 * keyboard.c (read_char, reorder_modifiers):
12302 XINT -> XFASTINT, since the integer must be nonnegative.
12303 * ftfont.c (ftfont_spec_pattern):
12304 * keymap.c (access_keymap, silly_event_symbol_error):
12305 XUINT -> XFASTINT, since the integer must be nonnegative.
12306 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
12307 since it makes no difference and we prefer signed.
12308 * keyboard.c (record_char): Use XUINT when all the neighbors do.
12309 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
12310 nonnegative.
12311
d6d100dd
SM
123122011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
12313
12314 * window.h (Fwindow_frame): Declare.
12315
2b6148e4
PE
123162011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12317
12318 * alloc.c: Simplify handling of large-request failures (Bug#8800).
12319 (SPARE_MEMORY): Always define.
12320 (LARGE_REQUEST): Remove.
12321 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
12322
f230ecc9
MR
123232011-06-06 Martin Rudalics <rudalics@gmx.at>
12324
727e958e
MR
12325 * lisp.h: Move EXFUNS for Fframe_root_window,
12326 Fframe_first_window and Fset_frame_selected_window to window.h.
12327
12328 * window.h: Move EXFUNS for Fframe_root_window,
12329 Fframe_first_window and Fset_frame_selected_window here from
12330 lisp.h.
12331
12332 * frame.c (Fwindow_frame, Fframe_first_window)
12333 (Fframe_root_window, Fframe_selected_window)
12334 (Fset_frame_selected_window): Move to window.c.
12335 (Factive_minibuffer_window): Move to minibuf.c.
12336 (Fother_visible_frames_p): New function.
12337
12338 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
12339
f230ecc9
MR
12340 * window.c (decode_window, decode_any_window): Move up in code.
12341 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
12342 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
12343 (Fwindow_buffer): Move up and rewrite doc-string.
12344 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
12345 (Fwindow_prev): New functions.
727e958e
MR
12346 (Fwindow_frame): Move here from frame.c. Accept any window as
12347 argument.
12348 (Fframe_root_window, Fframe_first_window)
12349 (Fframe_selected_window): Move here from frame.c. Accept frame
12350 or arbitrary window as argument. Update doc-strings.
12351 (Fminibuffer_window): Move up in code.
12352 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
12353 (Fset_frame_selected_window): Move here from frame.c.
12354 Marginal rewrite.
727e958e
MR
12355 (Fselected_window, select_window, Fselect_window): Move up in
12356 code. Minor doc-string fixes.
f230ecc9 12357
4d09bcf6
PE
123582011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12359
12360 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
12361 Do not assume that spare memory exists; that assumption is valid
12362 only if SYSTEM_MALLOC.
12363 (LARGE_REQUEST): New macro, so that the issue of large requests
12364 is separated from the issue of spare memory.
12365
810928a2
AS
123662011-06-05 Andreas Schwab <schwab@linux-m68k.org>
12367
172418ad
AS
12368 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
12369 format. (Bug#8806)
12370
43f862f7
AS
12371 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
12372
810928a2
AS
12373 * xfns.c (x_set_scroll_bar_default_width): Move declarations
12374 before statements.
12375
a059fe24
JD
123762011-06-05 Jan Djärv <jan.h.d@swipnet.se>
12377
12378 * gtkutil.c (xg_get_default_scrollbar_width): New function.
12379
12380 * gtkutil.h: Declare xg_get_default_scrollbar_width.
12381
12382 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
12383 min width by calling x_set_scroll_bar_default_width (Bug#8505).
12384
989bf368
JB
123852011-06-05 Juanma Barranquero <lekktu@gmail.com>
12386
12387 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
12388
4b80f674
CY
123892011-06-04 Chong Yidong <cyd@stupidchicken.com>
12390
12391 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
12392 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
12393 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
12394 New error handlers.
4b80f674
CY
12395 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
12396 Obey Vx_select_enable_clipboard_manager. Catch errors in
12397 x_clipboard_manager_save (Bug#8779).
12398 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 12399 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 12400
99a33b77 124012011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
12402
12403 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
12404
99a33b77 124052011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
12406
12407 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
12408 in the current matrix if keep_current_p is non-zero.
12409
8264569d
EZ
124102011-06-04 Eli Zaretskii <eliz@gnu.org>
12411
12412 * bidi.c (bidi_level_of_next_char): Fix last change.
12413
57f97249
EZ
124142011-06-03 Eli Zaretskii <eliz@gnu.org>
12415
fec2107c 12416 Support bidi reordering of text covered by display properties.
57f97249 12417
fec2107c
EZ
12418 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
12419 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
12420 (bidi_cache_search, bidi_cache_iterator_state)
12421 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
12422 (bidi_level_of_next_char, bidi_move_to_visually_next):
12423 Support character positions inside a run of characters covered by a
fec2107c
EZ
12424 display string.
12425 (bidi_paragraph_init, bidi_resolve_explicit_1)
12426 (bidi_level_of_next_char): Call bidi_fetch_char and
12427 bidi_fetch_char_advance instead of FETCH_CHAR and
12428 FETCH_CHAR_ADVANCE.
12429 (bidi_init_it): Initialize new members.
12430 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
12431 definitions.
12432 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
12433 instead of using explicit *_CHAR codes.
d6d100dd
SM
12434 (bidi_resolve_explicit, bidi_resolve_weak):
12435 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
12436 bidirectional text is supported only in multibyte buffers.
12437 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
12438 it to initialize the frame_window_p member of struct bidi_it.
12439 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
12440 (bidi_resolve_explicit, bidi_resolve_weak)
12441 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
12442 bidi_it->nchars is non-positive.
12443 (bidi_level_of_next_char): Don't try to lookup the cache for the
12444 next/previous character if nothing is cached there yet, or if we
12445 were just reseat()'ed to a new position.
c40e2fb2 12446
0e14fe90
EZ
12447 * xdisp.c (set_cursor_from_row): Set start and stop points
12448 according to the row's direction when priming the loop that looks
12449 for the glyph on which to display cursor.
12450 (single_display_spec_intangible_p): Function deleted.
12451 (display_prop_intangible_p): Reimplement to call
12452 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
12453 Accept 3 additional arguments needed by handle_display_spec.
12454 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
12455 values: lists, `(when COND...)' forms, etc.
12456 (single_display_spec_string_p): Support property values that are
12457 lists with the argument STRING its top-level element.
12458 (display_prop_string_p): Fix the condition for processing a
12459 property that is a list to be consistent with handle_display_spec.
fec2107c 12460 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
12461 last portion of handle_display_prop.
12462 (compute_display_string_pos): Accept additional argument
12463 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
12464 value of a `display' property is a "replacing spec".
12465 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
12466 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
12467 the display property, but just return a value indicating whether
12468 the display property will replace the characters it covers.
12469 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
12470 frame_window_p members of struct bidi_it.
d6d100dd
SM
12471 (compute_display_string_pos, compute_display_string_end):
12472 New functions.
fec2107c
EZ
12473 (push_it): Accept second argument POSITION, where pop_it should
12474 jump to continue iteration.
12475 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 12476
fec2107c
EZ
12477 * keyboard.c (adjust_point_for_property): Adjust the call to
12478 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
12479
12480 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
12481 (bidi_init_it): Update prototypes.
12482 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
12483 (compute_display_string_pos, compute_display_string_end):
12484 Declare prototypes.
fec2107c
EZ
12485 (struct bidi_it): New members nchars and disp_pos. ch_len is now
12486 EMACS_INT.
fc6f18ce 12487
40087514 124882011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 12489
57f53182
PE
12490 Malloc failure behavior now depends on size of allocation.
12491 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
12492 * lisp.h: Change signatures accordingly.
12493 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
12494 All callers changed. (Bug#8762)
12495
12496 * gnutls.c: Use Emacs's memory allocators.
12497 Without this change, the gnutls library would invoke malloc etc.
12498 directly, which causes problems on non-SYNC_INPUT hosts, and which
12499 runs afoul of improving memory_full behavior. (Bug#8761)
12500 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
12501 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
12502 xfree instead of the default malloc, realloc, free.
12503 (Fgnutls_boot): No need to check for memory allocation failure,
12504 since xmalloc does that for us.
12505
ac32cd99 12506 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
12507 * category.c (hash_get_category_set):
12508 * ccl.c (ccl_driver):
12509 * charset.c (Fdefine_charset_internal):
12510 * charset.h (struct charset.hash_index):
12511 * composite.c (get_composition_id, gstring_lookup_cache)
12512 (composition_gstring_put_cache):
12513 * composite.h (struct composition.hash_index):
12514 * dispextern.h (struct image.hash):
12515 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
12516 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
12517 (hashfn_equal, hashfn_user_defined, make_hash_table)
12518 (maybe_resize_hash_table, hash_lookup, hash_put)
12519 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
12520 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
12521 (Fsxhash, Fgethash, Fputhash, Fmaphash):
12522 * image.c (make_image, search_image_cache, lookup_image)
12523 (xpm_put_color_table_h):
12524 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 12525 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 12526 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 12527 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
12528 * alloc.c (allocate_vectorlike):
12529 Check for overflow in vector size calculations.
12530 * ccl.c (ccl_driver):
12531 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
12532 * fns.c, image.c: Remove unnecessary static decls that would otherwise
12533 need to be updated by these changes.
40087514
PE
12534 * fns.c (make_hash_table, maybe_resize_hash_table):
12535 Check for integer overflow with large hash tables.
0de4bb68
PE
12536 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
12537 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
12538 (SXHASH_REDUCE): New macro.
12539 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
12540 Use it instead of discarding useful hash info with large hash values.
12541 (sxhash_float): New function.
12542 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
12543 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
12544 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
12545 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
12546 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
12547 Adjust signatures to match updated version of code.
12548 (consing_since_gc): Now EMACS_INT, since a single hash table can
12549 use more than INT_MAX bytes.
12550
698d32e2
DN
125512011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
12552
12553 Make it possible to build with GCC-4.6+ -O2 -flto.
12554
12555 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
12556
fd6fa53f
SM
125572011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
12558
12559 * minibuf.c (get_minibuffer, read_minibuf_unwind):
12560 Call minibuffer-inactive-mode.
12561
864db017
JB
125622011-05-31 Juanma Barranquero <lekktu@gmail.com>
12563
12564 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
12565 Update dependencies.
12566
2ad0baf4
DN
125672011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12568
12569 * data.c (init_data): Remove code for UTS, this system is not
12570 supported anymore.
12571
4fcc2638
DN
125722011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12573
12574 Don't force ./temacs to start in terminal mode.
12575
12576 * frame.c (make_initial_frame): Initialize faces in all cases, not
12577 only when CANNOT_DUMP is defined.
12578 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
12579
c56e0fd5
DN
125802011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12581
12582 * dispnew.c (add_window_display_history): Use const for the string
12583 pointer. Remove declaration, not needed.
12584
333d54da 125852011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 12586
55d4c1b2 12587 Use 'inline', not 'INLINE'.
333d54da 12588 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
12589 * alloc.c, fontset.c (INLINE): Remove.
12590 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
12591 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
12592 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
12593 * gmalloc.c (register_heapinfo): Use inline unconditionally.
12594 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
12595
738db178
DN
125962011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12597
12598 Make it possible to run ./temacs.
12599
12600 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
12601 syms_of_callproc does the same thing. Remove test for
12602 "initialized", do it in the caller.
12603 * emacs.c (main): Avoid calling set_initial_environment when dumping.
12604
620c53a6
SM
126052011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
12606
12607 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
12608 (read_minibuf): Use get_minibuffer.
12609 (syms_of_minibuf): Use DEFSYM.
12610 (Qmetadata): New var.
12611 * data.c (Qbuffer): Don't make it static.
12612 (syms_of_data): Use DEFSYM.
12613
e003a292
PE
126142011-05-31 Paul Eggert <eggert@cs.ucla.edu>
12615
12616 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
12617 (CCL_CODE_MIN): New macro.
12618
ed008a6d
PE
126192011-05-30 Paul Eggert <eggert@cs.ucla.edu>
12620
3687c2ef
PE
12621 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
12622
ed008a6d
PE
12623 * eval.c (Qdebug): Now static.
12624 * lisp.h (Qdebug): Remove decl. This reverts a part of the
12625 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
12626 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
12627
d66c4c7c
CY
126282011-05-29 Chong Yidong <cyd@stupidchicken.com>
12629
12630 * image.c: Various fixes to ImageMagick code comments.
12631 (Fimagemagick_types): Doc fix.
12632
5fbc2025
PE
126332011-05-29 Paul Eggert <eggert@cs.ucla.edu>
12634
0196f88a
PE
12635 Minor fixes prompted by GCC 4.6.0 warnings.
12636
12637 * xselect.c (converted_selections, conversion_fail_tag): Now static.
12638
5fbc2025
PE
12639 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
12640 (x_clipboard_manager_save_all): Move extern decl to ...
12641 * xterm.h: ... here, so that it can be checked for consistency.
12642
1dd3c2d9
CY
126432011-05-29 Chong Yidong <cyd@stupidchicken.com>
12644
12645 * xselect.c (x_clipboard_manager_save_frame)
12646 (x_clipboard_manager_save_all): New functions.
12647 (Fx_clipboard_manager_save): Lisp function deleted.
12648
12649 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
12650 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
12651
12652 * xterm.h: Update prototype.
12653
5ba6571d
WX
126542011-05-28 William Xu <william.xwl@gmail.com>
12655
12656 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
12657 exiting (Bug#8239).
12658
3eaff834
JM
126592011-05-28 Jim Meyering <meyering@redhat.com>
12660
e1900994 12661 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
12662 * fns.c (to_uchar): Define.
12663 (crypto_hash_function): Use it to convert some newly-signed
12664 variables to unsigned, to avoid sign-extension bugs. For example,
12665 without this change, (md5 "truc") would evaluate to
12666 45723a2aff78ff4fff7fff1114760e62 rather than the expected
12667 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 12668 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 12669
0f6990a7
PE
126702011-05-27 Paul Eggert <eggert@cs.ucla.edu>
12671
12672 Integer overflow fixes.
c8a9ca5a 12673
08686060
PE
12674 * dbusbind.c: Serial number integer overflow fixes.
12675 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
12676 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
12677 to hold a serial number that is too large for a fixnum.
12678 (Fdbus_method_return_internal, Fdbus_method_error_internal):
12679 Check for serial numbers out of range. Decode any serial number
59568bf0 12680 that was so large that it became a float. (Bug#8722)
08686060 12681
2d1fc3c7
PE
12682 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
12683 (Fdbus_call_method, Fdbus_call_method_asynchronously):
12684 Use XFASTINT rather than XUINT when numbers are nonnegative.
12685 (xd_append_arg, Fdbus_method_return_internal):
12686 (Fdbus_method_error_internal): Likewise. Also, for unsigned
12687 arguments, check that Lisp number is nonnegative, rather than
59568bf0 12688 silently wrapping negative numbers around. (Bug#8722)
30217ff0 12689 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 12690 (Bug#8722)
2d1fc3c7 12691
c8a9ca5a
PE
12692 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
12693
519e1d69
PE
12694 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
12695
6df6ae42 12696 ccl: Add integer overflow checks.
30569699
PE
12697 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
12698 (IN_INT_RANGE): New macros.
12699 (ccl_driver): Use them to check for integer overflow when
12700 decoding a CCL program. Many of the new checks are whether XINT (x)
12701 fits in int; it doesn't always, on 64-bit hosts. The new version
12702 doesn't catch all possible integer overflows, but it's an
847044ea 12703 improvement. (Bug#8719)
30569699 12704
c11285dc
PE
12705 * alloc.c (make_event_array): Use XINT, not XUINT.
12706 There's no need for unsigned here.
12707
fdccd48e
PE
12708 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
12709 This follows up to the 2011-05-06 change that substituted uintptr_t
12710 for EMACS_INT. This case wasn't caught back then.
12711
37910ab2
PE
12712 Rework Fformat to avoid integer overflow issues.
12713 * editfns.c: Include <float.h> unconditionally, as it's everywhere
12714 now (part of C89). Include <verify.h>.
12715 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
12716 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
12717 (Fformat): Avoid the prepass trying to compute sizes; it was only
12718 approximate and thus did not catch overflow reliably. Instead, walk
12719 through the format just once, formatting and computing sizes as we go,
12720 checking for integer overflow at every step, and allocating a larger
12721 buffer as needed. Keep track separately whether the format is
12722 multibyte. Keep only the most-recently calculated precision, rather
12723 than them all. Record whether each argument has been converted to
12724 string. Use EMACS_INT, not int, for byte and char and arg counts.
12725 Support field widths and precisions larger than INT_MAX. Avoid
12726 sprintf's undefined behavior with conversion specifications such as %#d
12727 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
12728 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
12729 formatting out-of-range floating point numbers with int
9173deec 12730 formats. (Bug#8668)
37910ab2 12731
2e6578fb
PE
12732 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
12733
0ae6bdee
PE
12734 * data.c: Avoid integer truncation in expressions involving floats.
12735 * data.c: Include <intprops.h>.
12736 (arith_driver): When there's an integer overflow in an expression
12737 involving floating point, convert the integers to floating point
12738 so that the resulting value does not suffer from catastrophic
12739 integer truncation. For example, on a 64-bit host (* 4
12740 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
12741 Do not rely on undefined behavior after integer overflow.
12742
de883a70
PE
12743 merge count_size_as_multibyte, parse_str_to_multibyte
12744 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 12745 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
12746 Check for integer overflow.
12747 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
12748 since it's now a duplicate of the other. This is more of
12749 a character than a buffer op, so better that it's in character.c.
12750 * fns.c, print.c: Adjust to above changes.
12751
2ff916cb
PE
127522011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
12753
12754 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
12755
f1b54466
PE
127562011-05-27 Paul Eggert <eggert@cs.ucla.edu>
12757
fb1ac845
PE
12758 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
12759 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
12760 (x_clipboard_manager_save): Now static.
12761 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
12762
f1b54466
PE
12763 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
12764 (crypto_hash_function): Now static.
12765 Fix pointer signedness problems. Avoid unnecessary initializations.
12766
a9f737ee
CY
127672011-05-27 Chong Yidong <cyd@stupidchicken.com>
12768
12769 * termhooks.h (Vselection_alist): Make it terminal-local.
12770
12771 * terminal.c (create_terminal): Initialize it.
12772
12773 * xselect.c: Support for clipboard managers.
12774 (Vselection_alist): Move to termhooks.h as terminal-local var.
12775 (LOCAL_SELECTION): New macro.
12776 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
12777 (symbol_to_x_atom): Remove gratuitous arg.
12778 (x_handle_selection_request, lisp_data_to_selection_data)
12779 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
12780 (x_own_selection, x_get_local_selection, x_convert_selection):
12781 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
12782 (some_frame_on_display): Delete unused function.
12783 (Fx_own_selection_internal, Fx_get_selection_internal)
12784 (Fx_disown_selection_internal, Fx_selection_owner_p)
12785 (Fx_selection_exists_p): New optional frame arg.
12786 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
12787 (x_handle_selection_clear): Don't treat other terminals with the
12788 same keyboard specially. Use the terminal-local Vselection_alist.
12789 (x_clear_frame_selections): Use Frun_hook_with_args.
12790
12791 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
12792
12793 * xterm.h: Add support for those atoms.
12794
e067f0c1
CY
127952011-05-26 Chong Yidong <cyd@stupidchicken.com>
12796
12797 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
12798 (converted_selections, conversion_fail_tag): New global variables.
12799 (x_selection_request_lisp_error): Free the above.
12800 (x_get_local_selection): Remove unnecessary code.
12801 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
12802 of converted selections stored in converted_selections.
12803 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
12804 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
12805 (x_convert_selection): New function.
12806 (x_handle_selection_event): Simplify.
12807 (x_get_foreign_selection): Don't ignore incoming requests while
12808 waiting for an answer; this will fail when we implement
12809 SAVE_TARGETS, and seems unnecessary anyway.
12810 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
12811 (Vx_sent_selection_functions): Doc fix.
12812
0f4aebc0
LL
128132011-05-26 Leo Liu <sdl.web@gmail.com>
12814
12815 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
12816
e61124cd
YM
128172011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12818
12819 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
12820
12821 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
12822 for fringe update if it has periodic bitmap.
ac389d0c 12823 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
12824 and fringe_bitmap_periodic_p.
12825
12826 * fringe.c (get_fringe_bitmap_data): New function.
12827 (draw_fringe_bitmap_1, update_window_fringes): Use it.
12828 (update_window_fringes): Record periodicity of fringe bitmap in glyph
12829 row. Mark glyph row for fringe update if periodicity changed.
12830
12831 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
12832 for fringe update unless it has periodic bitmap.
12833
f16d9837
KH
128342011-05-25 Kenichi Handa <handa@m17n.org>
12835
12836 * xdisp.c (get_next_display_element): Set correct it->face_id for
12837 a static composition.
12838
e1b90ef6
LL
128392011-05-24 Leo Liu <sdl.web@gmail.com>
12840
12841 * deps.mk (fns.o):
12842 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
12843
12844 * fns.c (crypto_hash_function, Fsha1): New function.
12845 (Fmd5): Use crypto_hash_function.
12846 (syms_of_fns): Add Ssha1.
12847
7400048f
PE
128482011-05-22 Paul Eggert <eggert@cs.ucla.edu>
12849
12850 * gnutls.c: Remove unused macros.
12851 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
12852 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
12853 Remove macros that are defined and never used.
12854 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
12855
abb71cf4
CY
128562011-05-22 Chong Yidong <cyd@stupidchicken.com>
12857
12858 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
12859 (Fx_get_selection_internal): Minor cleanup.
12860 (Fx_own_selection_internal): Rename arguments for consistency with
12861 select.el.
12862
6307db39
PE
128632011-05-22 Paul Eggert <eggert@cs.ucla.edu>
12864
12865 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
12866
f3d4e0a4
CY
128672011-05-22 Chong Yidong <cyd@stupidchicken.com>
12868
12869 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
12870
4d8ade89
YM
128712011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12872
12873 * dispnew.c (scrolling_window): Don't exclude the case that the
12874 last enabled row in the desired matrix touches the bottom boundary.
12875
32078c8d
GM
128762011-05-21 Glenn Morris <rgm@gnu.org>
12877
12878 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
12879 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
12880 and add some more files.
32078c8d 12881
7285dc67
EZ
128822011-05-20 Eli Zaretskii <eliz@gnu.org>
12883
12884 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
12885 report_file_error introduced by the change from 2011-05-07.
12886
89d1bd22
PE
128872011-05-20 Paul Eggert <eggert@cs.ucla.edu>
12888
12889 * systime.h (Time): Define only if emacs is defined.
12890 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
12891 where the include path doesn't have X11/X.h by default. See
12892 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
12893
cd394be1 128942011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
12895
12896 * composite.c (find_automatic_composition): Fix previous change.
12897
b9704ad9
GM
128982011-05-20 Glenn Morris <rgm@gnu.org>
12899
12900 * lisp.mk: New file, split from Makefile.in.
12901 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
12902 (shortlisp): Remove.
12903 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
12904
4a720484
GM
129052011-05-19 Glenn Morris <rgm@gnu.org>
12906
12907 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
12908 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
12909 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
12910 (lisp): Set the order to that of loadup.el.
12911 (shortlisp): Make it a copy of $lisp.
12912 (SOME_MACHINE_LISP): Remove.
12913 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
12914 Use just $shortlisp, not $SOME_MACHINE_LISP too.
12915
a28d4396
KH
129162011-05-18 Kenichi Handa <handa@m17n.org>
12917
12918 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
12919 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
12920 (find_automatic_composition): Mostly rewrite for efficiency.
12921
a2b1fa8e
JB
129222011-05-18 Juanma Barranquero <lekktu@gmail.com>
12923
12924 * makefile.w32-in: Update dependencies.
12925
8e1f5610
CS
129262011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
12927
12928 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 12929 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 12930
7025ee00 129312011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 12932
cdfa6eab
PE
12933 Fix some integer overflow issues, such as string length overflow.
12934
06d6db33
PE
12935 * insdel.c (count_size_as_multibyte): Check for string overflow.
12936
2b4560a8
PE
12937 * character.c (lisp_string_width): Check for string overflow.
12938 Use EMACS_INT, not int, for string indexes and lengths; in
12939 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
12940 the resulting string length overflows an EMACS_INT; instead,
12941 report a string overflow if no precision given. When checking for
12942 precision exhaustion, use a check that cannot possibly have
12943 integer overflow. (Bug#8675)
12944 * character.h (lisp_string_width): Adjust to new signature.
12945
cb93f9be
PE
12946 * alloc.c (string_overflow): New function.
12947 (Fmake_string): Use it. This doesn't change behavior, but saves
12948 a few bytes and will simplify future changes.
12949 * character.c (string_escape_byte8): Likewise.
12950 * lisp.h (string_overflow): New decl.
12951
1a1f3366
PE
12952 Fixups, following up to the user-interface timestamp change.
12953 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
12954 for UI timestamps, instead of unsigned long.
9fbd6841
PE
12955 * msdos.c (mouse_get_pos): Likewise.
12956 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
12957 * w32gui.h (Time): Define by including "systime.h" rather than by
12958 declaring it ourselves. (Bug#8664)
12959
d4e3e4d3
PE
12960 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
12961 * image.c (clear_image_cache): Likewise.
12962
f6a24d19
PE
12963 * term.c (term_mouse_position): Don't assume time_t wraparound.
12964
08dc5ae6
PE
12965 Be more systematic about user-interface timestamps.
12966 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
12967 and sometimes 'EMACS_UINT', to represent these timestamps.
12968 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
12969 This makes the code easier to follow, and makes it easier to catch
12970 integer overflow bugs such as Bug#8664.
12971 * frame.c (Fmouse_position, Fmouse_pixel_position):
12972 Use Time, not unsigned long, for user-interface timestamps.
12973 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
12974 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
12975 * keyboard.h (last_event_timestamp): Likewise.
12976 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
12977 * menu.h (xmenu_show): Likewise.
12978 * term.c (term_mouse_position): Likewise.
12979 * termhooks.h (struct input_event.timestamp): Likewise.
12980 (struct terminal.mouse_position_hook): Likewise.
12981 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
12982 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
12983 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
12984 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
12985 what it was before.
12986 * menu.h, termhooks.h: Include "systime.h", for Time.
12987
8e55734a
PE
12988 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
12989 Don't assume that the difference between two unsigned long values
12990 can fit into an integer. At this point, we know button_down_time
12991 <= event->timestamp, so the difference must be nonnegative, so
12992 there's no need to cast the result if double-click-time is
12993 nonnegative, as it should be; check that it's nonnegative, just in
12994 case. This bug is triggered when events are more than 2**31 ms
86db42d2 12995 apart (about 25 days). (Bug#8664)
8e55734a 12996
841f1b75 12997 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 12998 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 12999
3e26f69c
PE
13000 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
13001 that always fit in int. Use a sentinel instead of a counter, to
13002 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
13003 * frame.h (struct frame): Use int for menu_bar_items_used
13004 instead of EMACS_INT, since it always fits in int.
3e26f69c 13005
5cc152c0
PE
13006 * menu.c (grow_menu_items): Check for int overflow.
13007
d89eb65e
PE
13008 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
13009
5235bd3e
PE
13010 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
13011 Before, the code was not consistent. These values cannot exceed
13012 2**31 - 1 so there's no need to make them unsigned.
13013 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
13014 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
13015 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
13016 as modifiers.
13017 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
13018
bc827e23
PE
13019 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
13020 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
13021 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
13022 presumably because the widths might not match.
13023
78eb494e
PE
13024 * window.c (size_window): Avoid needless test at loop start.
13025
04f2d78b
CB
130262011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
13027
13028 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
13029
d2fc7e3d 130302011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
13031
13032 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
13033
d2fc7e3d 130342011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
13035
13036 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
13037 `width' to `bar_area_x' and `bar_area_width', respectively.
13038 (x_scroll_run): Take account of fringe background extension.
13039
04f2d78b
CB
13040 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
13041 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
13042 `bar_area_width', respectively.
13043 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
13044 background extension.
13045
79b70037
GM
130462011-05-10 Jim Meyering <meyering@redhat.com>
13047
13048 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
13049
2f142cc5
JB
130502011-05-10 Juanma Barranquero <lekktu@gmail.com>
13051
13052 * image.c (Finit_image_library): Return t for built-in image types,
13053 like pbm and xbm. (Bug#8640)
13054
57679c86
AS
130552011-05-09 Andreas Schwab <schwab@linux-m68k.org>
13056
13057 * w32menu.c (set_frame_menubar): Fix submenu allocation.
13058
888c9e86
EZ
130592011-05-07 Eli Zaretskii <eliz@gnu.org>
13060
b0512a1d
EZ
13061 * w32console.c (Fset_screen_color): Doc fix.
13062 (Fget_screen_color): New function.
13063 (syms_of_ntterm): Defsubr it.
13064
7285dc67
EZ
13065 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
13066 unlink the temporary file if Fcall_process didn't create it in the
13067 first place.
13068 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
13069 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
13070 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
13071 cue to call_process_cleanup not to close that handle.
13072
4d3fcc8e
BK
130732011-05-07 Ben Key <bkey76@gmail.com>
13074
13075 * makefile.w32-in: The bootstrap-temacs rule now makes use of
13076 one of two shell specific rules, either bootstrap-temacs-CMD or
13077 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
13078 to the previous implementation of the bootstrap-temacs rule.
13079 The bootstrap-temacs-CMD rule is similar to the previous
13080 implementation of the bootstrap-temacs rule except that it
13081 makes use of the ESC_CFLAGS variable instead of the CFLAGS
13082 variable.
13083
13084 These changes, along with some changes to nt/configure.bat,
13085 nt/gmake.defs, and nt/nmake.defs, are required to extend my
13086 earlier fix to add support for --cflags and --ldflags options
13087 that include quotes so that it works whether make uses cmd or
13088 sh as the shell.
13089
b4289b64
MA
130902011-05-06 Michael Albinus <michael.albinus@gmx.de>
13091
13092 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
13093 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
13094 is a constant.
13095 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
13096 a string. Handle both cases.
13097 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
13098 (Fdbus_register_method): Use Qinvalid_function.
13099
af4c0e28
JB
131002011-05-06 Juanma Barranquero <lekktu@gmail.com>
13101
13102 * makefile.w32-in: Update dependencies.
13103 (LISP_H): Add inttypes.h and stdin.h.
13104 (PROCESS_H): Add unistd.h.
13105
c51453d9
EZ
131062011-05-06 Eli Zaretskii <eliz@gnu.org>
13107
13108 * lread.c: Include limits.h (fixes the MS-Windows build broken by
13109 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
13110
8ff0ac3c 131112011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 13112
4c4b566b
PE
13113 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
13114
aab2b9b5
PE
13115 * term.c (vfatal): Remove stray call to va_end.
13116 It's not needed and the C Standard doesn't allow it here anyway.
13117
c378da0b
PE
13118 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
13119 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
13120
288b08c7
PE
13121 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
13122 bytes.
13123
e3601888
PE
13124 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
13125
db6c0e74
PE
13126 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13127
dd5963ea
PE
13128 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
13129
88c9450f
PE
13130 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
13131
2f9442b8
PE
13132 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
13133
c032b5f8
PE
13134 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
13135 * charset.c (Fdefine_charset_internal): Don't initialize
13136 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 13137 32-bit int (Bug#8600).
a108c10b
PE
13138
13139 * lread.c (read_integer): Be more consistent with string-to-number.
13140 Use string_to_number to do the actual conversion; this avoids
13141 rounding errors and fixes some other screwups. Without this fix,
13142 for example, #x1fffffffffffffff was misread as -2305843009213693952.
13143 (digit_to_number): Move earlier, for benefit of read_integer.
13144 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 13145 not a digit in any supported base. (Bug#8602)
a108c10b 13146
ad5f9eea
PE
13147 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
13148
aec1708a
PE
13149 * dispnew.c (scrolling_window): Return 1 if we scrolled,
13150 to match comment at start of function. This also removes a
13151 GCC warning about overflow in a 32+64-bit port.
13152
47be4ab5
PE
13153 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
13154
371cac43
PE
13155 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
13156 Reported by Stefan Monnier in
13157 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
13158 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13159 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 13160
d01a7826
PE
13161 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
13162 (EMACS_UINTPTR): Likewise, with uintptr_t.
13163
7fd47d5c
PE
13164 * lisp.h: Prefer 64-bit EMACS_INT if available.
13165 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
13166 on 32-bit hosts that have 64-bit int, so that they can access
13167 large files.
122b0c86
PE
13168 However, temporarily disable this change unless the temporary
13169 symbol WIDE_EMACS_INT is defined.
7fd47d5c 13170
8727937b
PE
13171 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
13172
8ac068ac
PE
13173 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
13174 This removes an assumption that EMACS_INT and long are the same
13175 width as pointers. The assumption is true for Emacs porting targets
13176 now, but we want to make other targets possible.
13177 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
13178 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
13179 In the rest of the code, change types of integers that hold casted
13180 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
13181 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
13182 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
13183 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
13184 No need to cast type when ORing.
13185 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
13186 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
13187 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
13188 assume EMACS_INT is the same width as char *.
13189 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
13190 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
13191 Remove no-longer-needed casts.
13192 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
13193 (xg_tool_bar_help_callback, xg_make_tool_item):
13194 Use EMACS_INTPTR to hold an integer
13195 that will be cast to void *; this can avoid a GCC warning
13196 if EMACS_INT is not the same width as void *.
13197 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
13198 * xdisp.c (display_echo_area_1, resize_mini_window_1):
13199 (current_message_1, set_message_1):
13200 Use a local to convert to proper width without a cast.
13201 * xmenu.c (dialog_selection_callback): Likewise.
13202
ede49d71
PE
13203 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
13204 Also, don't assume VALBITS / RAND_BITS is less than 5,
13205 and don't rely on undefined behavior when shifting a 1 left into
13206 the sign bit.
13207 * lisp.h (get_random): Change signature to match.
13208
2f30ecd0
PE
13209 * lread.c (hash_string): Use size_t, not int, for hash computation.
13210 Normally we prefer signed values; but hashing is special, because
13211 it's better to use unsigned division on hash table sizes so that
13212 the remainder is nonnegative. Also, size_t is the natural width
13213 for hashing into memory. The previous code used 'int', which doesn't
13214 retain enough info to hash well into very large tables.
13215 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
13216
2a866e7b
PE
13217 * dbusbind.c: Don't possibly lose pointer info when converting.
13218 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13219 Use XPNTR rather than XHASH, so that the high-order bits of
13220 the pointer aren't lost when converting through void *.
13221
51639eac
PE
13222 * eval.c (Fautoload): Don't double-shift a pointer.
13223
92394119
PE
13224 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
13225
dbdb9a7c
JB
132262011-05-06 Juanma Barranquero <lekktu@gmail.com>
13227
13228 * gnutls.c (DEF_GNUTLS_FN):
13229 * image.c (DEF_IMGLIB_FN): Make function pointers static.
13230
db7a0b4f
AS
132312011-05-05 Andreas Schwab <schwab@linux-m68k.org>
13232
13233 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
13234 marker. (Bug#8610)
13235
cd394be1 132362011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
13237
13238 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
13239 New version that can reserve upto 2GB of heap space.
13240
f7ff1b0f 132412011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
13242
13243 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
13244
639c109b
TZ
132452011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
13246
13247 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
13248 `gnutls_certificate_set_x509_key_file'.
13249
d2127135
JB
132502011-05-05 Juanma Barranquero <lekktu@gmail.com>
13251
13252 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
13253 Update dependencies.
13254
e968f4f3
JB
132552011-05-04 Juanma Barranquero <lekktu@gmail.com>
13256
13257 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
13258 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13259 Remove unused parameter `fildes'.
13260 * process.c (read_process_output, send_process): Don't pass it.
13261
84d358f0
JB
132622011-05-04 Juanma Barranquero <lekktu@gmail.com>
13263
13264 Fix previous change: the library cache is defined in w32.c.
13265 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
13266 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
13267
0898ca10
JB
132682011-05-04 Juanma Barranquero <lekktu@gmail.com>
13269
13270 Implement dynamic loading of GnuTLS on Windows.
13271
13272 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
13273 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
13274 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13275 Declare.
13276
13277 * gnutls.c (Qgnutls_dll): Define.
13278 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
13279 (gnutls_*): Declare function pointers.
13280 (init_gnutls_functions): New function to initialize function pointers.
13281 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
13282 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
13283 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13284 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
13285 (emacs_gnutls_write, emacs_gnutls_read)
13286 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
13287 (Fgnutls_available_p): New function.
13288 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
13289 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
13290 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
13291
13292 * image.c: Include w32.h.
13293 (Vimage_type_cache): Delete.
13294 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
13295 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
13296 (w32_delayed_load): Move to w32.c.
13297
13298 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
13299
13300 * w32.c (QCloaded_from, Vlibrary_cache): Define.
13301 (w32_delayed_load): Move from image.c. When loading a library, record
13302 its filename in the :loaded-from property of the library id.
13303 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
13304 Initialize and staticpro them.
13305 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
13306
13307 * process.c: Include lisp.h before w32.h, not after.
13308 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
13309 instead of gnutls_record_check_pending.
13310
13311 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
13312
ff4de4aa
TZ
133132011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
13314
13315 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
13316 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
13317 as passed in.
13318
abe95abb
JD
133192011-05-03 Jan Djärv <jan.h.d@swipnet.se>
13320
13321 * xterm.c (x_set_frame_alpha): Do not set property on anything
13322 else than FRAME_X_OUTER_WINDOW (Bug#8608).
13323
e16e55d4
JB
133242011-05-02 Juanma Barranquero <lekktu@gmail.com>
13325
13326 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
13327
bafcf6a5
JB
133282011-05-02 Juanma Barranquero <lekktu@gmail.com>
13329
13330 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
13331 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
13332 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
13333 (gnutls_global_initialized, Qgnutls_bootprop_priority)
13334 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
13335 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
13336 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
13337 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
13338 (Qgnutls_bootprop_callbacks_verify): Make static.
13339
e7a6747f
AS
133402011-05-01 Andreas Schwab <schwab@linux-m68k.org>
13341
19ed11ba
AS
13342 * callproc.c: Indentation fixup.
13343
e7a6747f 13344 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
13345 (wait_for_termination, interruptible_wait_for_termination):
13346 Move after wait_for_termination_1.
e7a6747f 13347
1ef14cb4
LMI
133482011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
13349
13350 * sysdep.c (interruptible_wait_for_termination): New function
13351 which is like wait_for_termination, but allows keyboard
13352 interruptions.
13353
13354 * callproc.c (Fcall_process): Add (:file "file") as an option for
13355 the STDOUT buffer.
13356 (Fcall_process_region): Ditto.
13357
330d880c
EZ
133582011-04-30 Eli Zaretskii <eliz@gnu.org>
13359
8db90b73
EZ
13360 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
13361 rather than `XVECTOR (FOO)->size'.
13362
330d880c
EZ
13363 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
13364 inttypes.h, as a gnulib replacement is used if it not available in
13365 system headers.
13366
15cbd324
EZ
133672011-04-21 Eli Zaretskii <eliz@gnu.org>
13368
13369 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
13370 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
13371 of MOST_POSITIVE_FIXNUM. (Bug#8528)
13372
13373 * coding.c (coding_alloc_by_realloc): Error out if destination
13374 will grow beyond MOST_POSITIVE_FIXNUM.
13375 (decode_coding_emacs_mule): Abort if there isn't enough place in
13376 charbuf for the composition carryover bytes. Reserve an extra
13377 space for up to 2 characters produced in a loop.
13378 (decode_coding_iso_2022): Abort if there isn't enough place in
13379 charbuf for the composition carryover bytes.
13380
133812011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 13382
ae940cca
EZ
13383 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
13384 aborting when %lld or %lll format is passed.
13385 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
13386 %llo or %llx format is passed. (Bug#8545)
13387
03ab8921
EZ
13388 * window.c (window_scroll_line_based): Use a marker instead of
13389 simple variables to record original value of point. (Bug#7952)
13390
afda1437
EZ
13391 * doprnt.c (doprnt): Fix the case where a multibyte sequence
13392 produced by %s or %c overflows available buffer space. (Bug#8545)
13393
f76dee0c
PE
133942011-04-28 Paul Eggert <eggert@cs.ucla.edu>
13395
13396 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 13397 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 13398
fdc5744d
JB
133992011-04-28 Juanma Barranquero <lekktu@gmail.com>
13400
13401 * w32.c (init_environment): Warn about defaulting HOME to C:\.
13402
638f053a
JB
134032011-04-28 Juanma Barranquero <lekktu@gmail.com>
13404
13405 * keyboard.c (Qdelayed_warnings_hook): Define.
13406 (command_loop_1): Run `delayed-warnings-hook'
13407 if Vdelayed_warnings_list is non-nil.
13408 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
13409 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
13410
d178f871
EZ
134112011-04-28 Eli Zaretskii <eliz@gnu.org>
13412
13413 * doprnt.c (doprnt): Don't return value smaller than the buffer
13414 size if the message was truncated. (Bug#8545).
13415
b124fd93
JB
134162011-04-28 Juanma Barranquero <lekktu@gmail.com>
13417
13418 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
13419 (Fx_window_property): #if-0 the whole functions, not just the bodies.
13420
e810457d
PE
134212011-04-27 Paul Eggert <eggert@cs.ucla.edu>
13422
13423 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
13424
ea51cceb
JB
134252011-04-27 Juanma Barranquero <lekktu@gmail.com>
13426
13427 * makefile.w32-in: Update dependencies.
13428
94dcfacf
EZ
134292011-04-27 Eli Zaretskii <eliz@gnu.org>
13430
13431 Improve `doprnt' and its usage. (Bug#8545)
13432 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
13433 `format_end'. Remove support for %l as a conversion specifier.
13434 Don't use xrealloc. Improve diagnostics when the %l size modifier
13435 is used. Update the commentary.
13436
13437 * eval.c (verror): Simplify calculation of size_t.
13438
13439 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
13440 messages.
13441
f61f41d7
PE
134422011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
13443
13444 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
13445 change.
13446
96fb4434
PE
134472011-04-27 Paul Eggert <eggert@cs.ucla.edu>
13448
13449 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
13450 This makes this file independent of the recent pseudovector change.
13451
671875da 134522011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 13453
69e9b5a3
PE
13454 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
13455
b5f869a7 13456 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 13457 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 13458 Remove unused local.
c8926152 13459 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 13460
841a1577 13461 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
13462 GCC 4.6.0 optimizes based on type-based alias analysis.
13463 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
13464 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
13465 != &v->size, and therefore "v->size = 1; b->size = 2; return
13466 v->size;" must therefore return 1. This assumption is incorrect
13467 for Emacs, since it type-puns struct Lisp_Vector * with many other
13468 types. To fix this problem, this patch adds a new type struct
f904488f 13469 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
13470 and pseudovectors, and helps optimizing compilers not get fooled
13471 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
13472 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
13473 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
13474 the size member.
eab3844f
PE
13475 (XSETPVECTYPE): Rewrite in terms of new macro.
13476 (XSETPVECTYPESIZE): New macro, specifying both type and size.
13477 This is a bit clearer, and further avoids the possibility of
13478 undesirable aliasing.
13479 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 13480 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
13481 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
13482 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
13483 (ASIZE): Now uses header.size rather than size.
13484 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
13485 to avoid the hassle of writing XVECTOR (foo)->header.size.
13486 (struct vectorlike_header): New type.
eab3844f
PE
13487 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
13488 object, to help avoid aliasing.
13489 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
13490 (SUBRP): Likewise, since Lisp_Subr is a special case.
13491 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
13492 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
13493 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 13494 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
13495 changed to be "header.size" and "header.next".
13496 * buffer.h (struct buffer): Likewise.
13497 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
13498 * frame.h (struct frame): Likewise.
13499 * process.h (struct Lisp_Process): Likewise.
13500 * termhooks.h (struct terminal): Likewise.
13501 * window.c (struct save_window_data, struct saved_window): Likewise.
13502 * window.h (struct window): Likewise.
13503 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
13504 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
13505 * buffer.c (init_buffer_once): Likewise.
13506 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
13507 special case.
13508 * process.c (Fformat_network_address): Use local var for size,
13509 for brevity.
13510
0df1eac5
PE
13511 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
13512
847ab9d1 13513 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
13514 * data.c (atof): Remove decl; no longer used or needed.
13515 (digit_to_number): Move to lread.c.
13516 (Fstring_to_number): Use new string_to_number function, to be
13517 consistent with how the Lisp reader treats infinities and NaNs.
13518 Do not assume that floating-point numbers represent EMACS_INT
13519 without losing information; this is not true on most 64-bit hosts.
13520 Avoid double-rounding errors, by insisting on integers when
13521 parsing non-base-10 numbers, as the documentation specifies.
13522 * lisp.h (string_to_number): New decl, replacing ...
13523 (isfloat_string): Remove.
bc0a5c13 13524 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 13525 (read1): Do not accept +. and -. as integers; this
452f4150
PE
13526 appears to have been a coding error. Similarly, do not accept
13527 strings like +-1e0 as floating point numbers. Do not report
13528 overflow for integer overflows unless the base is not 10 which
13529 means we have no simple and reliable way to continue.
13530 Break out the floating-point parsing into a new
13531 function string_to_number, so that Fstring_to_number parses
13532 floating point numbers consistently with the Lisp reader.
04f2d78b 13533 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
13534 (E_CHAR, EXP_INT): Remove, replacing with ...
13535 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
13536 (string_to_number): New function, replacing isfloat_string.
13537 This function checks for valid syntax and produces the resulting
13538 Lisp float number too. Rework it so that string-to-number
bc0a5c13 13539 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
13540 so that overflow for non-base-10 numbers is reported only when
13541 there's no portable and simple way to convert to floating point.
452f4150 13542
67769ffc
PE
13543 * textprop.c (set_text_properties_1): Rewrite for clarity,
13544 and to avoid GCC warning about integer overflow.
13545
c20db43f
PE
13546 * intervals.h (struct interval): Use EMACS_INT for members
13547 where EMACS_UINT might cause problems. See
13548 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
13549 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
13550 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
13551 All uses changed.
37aa2f85
PE
13552 (offset_intervals): Tell GCC not to worry about length overflow
13553 when negating a negative length.
c20db43f 13554
2538aa2f
PE
13555 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
13556 (overrun_check_free): Likewise.
13557
f2d3008d
PE
13558 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
13559 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
13560 word size.
13561
ec8df744
PE
13562 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
13563 (gnutls_make_error): Rename local to avoid shadowing.
13564 (gnutls_emacs_global_deinit): ifdef out; not used.
13565 (Fgnutls_boot): Use const for pointer to readonly storage.
13566 Comment out unused local. Fix pointer signedness problems.
13567
640ee02d
PE
13568 * lread.c (openp): Don't stuff size_t into an 'int'.
13569 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
13570 about possible signed overflow.
13571
6048fb2a
PE
13572 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
13573 (GDK_KEY_g): Don't define if already defined.
13574 (xg_prepare_tooltip): Avoid pointer signedness problem.
13575 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
13576
fa3c87e1
PE
13577 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
13578 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
13579
2172544b
PE
13580 * xfns.c (Fx_window_property): Simplify a bit,
13581 to make a bit faster and to avoid GCC 4.6.0 warning.
13582 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
13583
9b821a21
PE
13584 * fns.c (internal_equal): Don't assume size_t fits in int.
13585
3c616cfa
PE
13586 * alloc.c (compact_small_strings): Tighten assertion a little.
13587
c2982e87
PE
13588 Replace pEd with more-general pI, and fix some printf arg casts.
13589 * lisp.h (pI): New macro, generalizing old pEd macro to other
13590 conversion specifiers. For example, use "...%"pI"d..." rather
13591 than "...%"pEd"...".
13592 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 13593 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
13594 * alloc.c (check_pure_size): Don't overflow by converting size to int.
13595 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
13596 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
13597 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
13598 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
13599 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
13600 64-bit hosts.
13601 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
13602 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
13603 * print.c (safe_debug_print, print_object): Likewise.
13604 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
13605 to int.
6f04d126
PE
13606 Use pI instead of if-then-else-abort. Use %p to avoid casts,
13607 avoiding the 0 flag, which is not portable.
c2982e87
PE
13608 * process.c (Fmake_network_process): Use pI to avoid cast.
13609 * region-cache.c (pp_cache): Likewise.
13610 * xdisp.c (decode_mode_spec): Likewise.
13611 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
13612 behavior on 64-bit hosts with printf arg.
6f04d126 13613 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
13614 (x_stop_queuing_selection_requests): Likewise.
13615 (x_get_window_property): Don't truncate byte count to an 'int'
13616 when tracing.
0b432f21 13617
5e073ec7
PE
13618 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
13619 here, since it parses constructs like leading '-' and spaces,
13620 which are not wanted; and it overflows with large numbers.
13621 Instead, simply match F[0-9]+, which is what is wanted anyway.
13622
36372bf9
PE
13623 * alloc.c: Remove unportable assumptions about struct layout.
13624 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
13625 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
13626 (allocate_vectorlike, make_pure_vector): Use the new macros,
13627 plus offsetof, to remove unportable assumptions about struct layout.
13628 These assumptions hold on all porting targets that I know of, but
13629 they are not guaranteed, they're easy to remove, and removing them
13630 makes further changes easier.
13631
0b432f21
PE
13632 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
13633 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
13634 (string_overrun_cookie): Now const. Use initializers that
13635 don't formally overflow signed char, to avoid warnings.
000098c1
PE
13636 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
13637 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
13638 (allocate_buffer): Don't assume sizeof (struct buffer) is a
13639 multiple of sizeof (EMACS_INT); it need not be, if
13640 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 13641 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 13642
895009e1
JB
136432011-04-26 Juanma Barranquero <lekktu@gmail.com>
13644
13645 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
13646
6a7a1b0b
TZ
136472011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
13648
13649 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 13650 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
13651 Reported by Paul Eggert <eggert@cs.ucla.edu>.
13652
841a1577 136532011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
13654
13655 * lisp.h (Qdebug): List symbol.
895009e1 13656 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
13657 * keyboard.c (debug-on-event): New variable.
13658 (handle_user_signal): Break into debugger when debug-on-event
13659 matches the current signal symbol.
13660
f2d3ba6f
DN
136612011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
13662
13663 * alloc.c (check_sblock, check_string_bytes)
13664 (check_string_free_list): Convert to standard C.
13665
42ce4c63
TZ
136662011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
13667
13668 * w32.c (emacs_gnutls_push): Fix typo.
13669
825cd63c
EZ
136702011-04-25 Eli Zaretskii <eliz@gnu.org>
13671
fb11d64d
EZ
13672 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
13673 "cast to pointer from integer of different size".
13674
825cd63c
EZ
13675 Improve doprnt and its use in verror. (Bug#8545)
13676 * doprnt.c (doprnt): Document the set of format control sequences
13677 supported by the function. Use SAFE_ALLOCA instead of always
13678 using `alloca'.
13679
13680 * eval.c (verror): Don't limit the buffer size at size_max-1, that
13681 is one byte too soon. Don't use xrealloc; instead xfree and
13682 xmalloc anew.
13683
e061a11b
TZ
136842011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
13685
13686 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
13687 callbacks stage.
13688
13689 * gnutls.c: Renamed global_initialized to
13690 gnutls_global_initialized. Added internals for the
13691 :verify-hostname-error, :verify-error, and :verify-flags
13692 parameters of `gnutls-boot' and documented those parameters in the
13693 docstring. Start callback support.
9173deec
JB
13694 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
13695 unless a fatal error occurred. Call gnutls_alert_send_appropriate
13696 on error. Return error code.
e061a11b
TZ
13697 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
13698 (emacs_gnutls_read): Likewise.
13699 (Fgnutls_boot): Return handshake error code.
13700 (emacs_gnutls_handle_error): New function.
13701 (wsaerror_to_errno): Likewise.
13702
13703 * w32.h (emacs_gnutls_pull): Add prototype.
13704 (emacs_gnutls_push): Likewise.
13705
13706 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
13707 (emacs_gnutls_push): Likewise.
13708
137092011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
13710
13711 * process.c (wait_reading_process_output): Check if GnuTLS
13712 buffered some data internally if no FDs are set for TLS
13713 connections.
13714
13715 * makefile.w32-in (OBJ2): Add gnutls.$(O).
13716 (LIBS): Link to USER_LIBS.
13717 ($(BLD)/gnutls.$(0)): New target.
13718
fa6996bc
EZ
137192011-04-24 Eli Zaretskii <eliz@gnu.org>
13720
eb35682e
EZ
13721 * xdisp.c (handle_single_display_spec): Rename the
13722 display_replaced_before_p argument into display_replaced_p, to
13723 make it consistent with the commentary. Fix typos in the
13724 commentary.
13725
e2ad650c
EZ
13726 * textprop.c (syms_of_textprop): Remove dead code.
13727 (copy_text_properties): Delete obsolete commentary about an
13728 interface that was deleted long ago. Fix typos in the description
13729 of arguments.
13730
1b2de274
EZ
13731 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
13732 to changes in oldXMenu/XMenu.h from 2011-04-16.
13733 <menu_help_message, prev_menu_help_message>: Constify.
13734 (IT_menu_make_room): menu->help_text is now `const char **';
13735 adjust.
13736
13737 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
13738 to changes in oldXMenu/XMenu.h from 2011-04-16.
13739 (struct XMenu): Declare `help_text' `const char **'.
13740
13741 * xfaces.c <Qunspecified>: Make extern again.
13742
13743 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 13744 required by POSIX.
1b2de274 13745
762b15be
EZ
13746 * doc.c (get_doc_string): Improve the format passed to `error'.
13747
13748 * doprnt.c (doprnt): Improve commentary.
13749
13750 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
13751
13752 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
13753 them with etags.
13754
f1052e5d
EZ
13755 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
13756 changes in globals.h immediately force recompilation.
762b15be
EZ
13757 (TAGS): Depend on $(CURDIR)/m/intel386.h and
13758 $(CURDIR)/s/ms-w32.h.
13759 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 13760
fa6996bc
EZ
13761 * character.c (Fchar_direction): Function deleted.
13762 (syms_of_character): Don't defsubr it.
13763 <char-direction-table>: Deleted.
13764
e6c3da20
EZ
137652011-04-23 Eli Zaretskii <eliz@gnu.org>
13766
13767 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
13768 * doprnt.c: Include limits.h.
13769 (SIZE_MAX): New macro.
04f2d78b
CB
13770 (doprnt): Return a size_t value. 2nd arg is now size_t.
13771 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
13772 Improve overflow protection. Support `l' modifier for integer
13773 conversions. Support %l conversion. Don't assume an EMACS_INT
13774 argument for integer conversions and for %c.
13775
13776 * lisp.h (doprnt): Restore prototype.
13777
13778 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
13779 $(SRC)/character.h.
13780
13781 * Makefile.in (base_obj): Add back doprnt.o.
13782
13783 * deps.mk (doprnt.o): Add back prerequisites.
13784 (callint.o): Depend on character.h.
13785
13786 * eval.c (internal_lisp_condition_case): Include the handler
13787 representation in the error message.
13788 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
13789 when breaking from the loop.
13790
13791 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
13792
13793 * callint.c (Fcall_interactively): When displaying error message
13794 about invalid control letter, pass the character's codepoint, not
13795 a pointer to its multibyte form. Improve display of the character
13796 in octal and display also its hex code.
13797
13798 * character.c (char_string): Use %x to display the (unsigned)
13799 codepoint of an invalid character, to avoid displaying a bogus
13800 negative value.
13801
13802 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
13803 `error', not SYMBOL_NAME itself.
13804
13805 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
13806 character arguments to `error'.
13807
13808 * charset.c (check_iso_charset_parameter): Fix incorrect argument
13809 to `error' in error message about FINAL_CHAR argument. Make sure
13810 FINAL_CHAR is a character, and use %c when it is passed as
13811 argument to `error'.
13812
4ffd0d6b 138132011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
13814
13815 * s/ms-w32.h (localtime): Redirect to sys_localtime.
13816
13817 * w32.c: Include <time.h>.
13818 (sys_localtime): New function.
13819
4ffd0d6b 138202011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
13821
13822 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
13823
4ffd0d6b 13824 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 13825
4ffd0d6b 138262011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 13827
4ffd0d6b
GM
13828 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
13829 zombies (Bug#8467).
aac0c6e3 13830
04c56954
EZ
138312011-04-19 Eli Zaretskii <eliz@gnu.org>
13832
13833 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
13834 gl_state.e_property when gl_state.object is Qt.
13835
13836 * insdel.c (make_gap_larger): Remove limitation of buffer size
13837 to <= INT_MAX.
13838
16a43933
CY
138392011-04-18 Chong Yidong <cyd@stupidchicken.com>
13840
13841 * xdisp.c (lookup_glyphless_char_display)
13842 (produce_glyphless_glyph): Handle cons cell entry in
13843 glyphless-char-display.
13844 (Vglyphless_char_display): Document it.
13845
13846 * term.c (produce_glyphless_glyph): Handle cons cell entry in
13847 glyphless-char-display.
13848
4581706e
CY
138492011-04-17 Chong Yidong <cyd@stupidchicken.com>
13850
13851 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
13852
13853 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
13854
13855 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
13856 definition for no-X builds.
13857
4887c6e2 138582011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 13859
fd35b6f9
PE
13860 Static checks with GCC 4.6.0 and non-default toolkits.
13861
5c1ccb01
PE
13862 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
13863
006c5daa
PE
13864 * process.c (keyboard_bit_set): Define only if SIGIO.
13865 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
13866 (send_process): Repair possible setjmp clobbering.
13867
efc736d3
PE
13868 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
13869
4e2fe2e6
PE
13870 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
13871
f97334a2
PE
13872 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
13873
4e75f29d
PE
13874 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
13875 Define only if needed.
13876
90efadd1
PE
13877 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
13878 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 13879 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 13880
3c647824
PE
13881 * dispextern.h (struct redisplay_interface): Rename param
13882 to avoid shadowing.
e264f262 13883 * termhooks.h (struct terminal): Likewise.
761383f4 13884 * xterm.c (xembed_send_message): Likewise.
3c647824 13885
b58c5c4a
PE
13886 * insdel.c (make_gap_smaller): Define only if
13887 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
13888
cad59032
PE
13889 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
13890 it.
13891
c339dc2e
PE
13892 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
13893 so that we aren't warned about unused symbols.
13894
91a3e27b
PE
13895 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
13896
399c71d3 13897 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 13898
8ffc96f5
PE
13899 * xfns.c (x_real_positions): Mark locals as initialized.
13900
eef9bc79
PE
13901 * xmenu.c (xmenu_show): Don't use uninitialized vars.
13902
098db9dd
PE
13903 * xterm.c: Fix problems found by static analysis with other toolkits.
13904 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
13905 (x_dispatch_event): Declare static if USE_GTK, and
13906 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 13907 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 13908 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
13909 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
13910 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 13911
eb18f6cc
PE
13912 * xmenu.c (menu_help_callback): Pointer type fixes.
13913 Use const pointers when pointing at readonly data. Avoid pointer
13914 signedness clashes.
13915 (FALSE): Remove unused macro.
13916 (update_frame_menubar): Remove unused decl.
13917
1fe72bf8
PE
13918 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
13919
60d9e1db
PE
13920 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
13921 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
13922 (single_menu_item): Rename local to avoid shadowing.
13923
39261c26
PE
13924 * keyboard.c (make_lispy_event): Remove unused local var.
13925
018c5e19
PE
13926 * frame.c, frame.h (x_get_resource_string): Bring this back, but
13927 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
13928
63d2b86e
PE
13929 * bitmaps: Change bitmaps from unsigned char back to the X11
13930 compatible char. Avoid the old compiler warnings about
13931 out-of-range initializers by using, for example, '\xab' rather
13932 than 0xab.
13933
aefd87e1
PE
13934 * xgselect.c (xgselect_initialize): Check vs interface
13935 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
13936
bf501fb9
PE
13937 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
13938
e9829fdf
PE
13939 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
13940 to read-only memory.
13941
1086c095
PE
13942 * fns.c (vector): Remove; this old hack is no longer needed.
13943
2baccd04 13944 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 13945 Remove unused var.
dde42981 13946 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 13947
72391843 13948 * xrdb.c (x_load_resources): Omit unused local.
3565b346 13949
436c16df 13950 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 13951 (x_window): Rename locals to avoid shadowing.
dc5ddd85 13952 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 13953
92bb796d 13954 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 13955 (x_term_init): Remove local to avoid shadowing.
92bb796d 13956
764430a3 13957 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
13958
13959 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
13960 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
13961
d1dfb56c
EZ
139622011-04-16 Eli Zaretskii <eliz@gnu.org>
13963
c4354cb4
EZ
13964 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
13965
d1dfb56c
EZ
13966 Fix regex.c, syntax.c and friends for buffers > 2GB.
13967 * syntax.h (struct gl_state_s): Declare character position members
13968 EMACS_INT.
13969
13970 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
13971
04f2d78b
CB
13972 * textprop.c (verify_interval_modification, interval_of):
13973 Declare arguments EMACS_INT.
d1dfb56c
EZ
13974
13975 * intervals.c (adjust_intervals_for_insertion): Declare arguments
13976 EMACS_INT.
13977
13978 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
13979
13980 * indent.c (Fvertical_motion): Local variable it_start is now
13981 EMACS_INT.
13982
13983 * regex.c (re_match, re_match_2, re_match_2_internal)
13984 (bcmp_translate, regcomp, regexec, print_double_string)
13985 (group_in_compile_stack, re_search, re_search_2, regex_compile)
13986 (re_compile_pattern, re_exec): Declare arguments and local
13987 variables `size_t' and `ssize_t' and return values `regoff_t', as
13988 appropriate.
13989 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
13990 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
13991 <compile_stack_type>: `size' and `avail' are now `size_t'.
13992
13993 * regex.h <regoff_t>: Use ssize_t, not int.
13994 (re_search, re_search_2, re_match, re_match_2): Arguments that
13995 specify buffer/string position and length are now ssize_t and
13996 size_t. Return type is regoff_t.
13997
613052cd
BK
139982011-04-16 Ben Key <bkey76@gmail.com>
13999
14000 * nsfont.m: Fixed bugs in ns_get_family and
14001 ns_descriptor_to_entity that were caused by using free to
14002 deallocate memory blocks that were allocated by xmalloc (via
14003 xstrdup). This caused Emacs to crash when compiled with
14004 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
14005 --enable-checking=xmallocoverrun). xfree is now used to
14006 deallocate these memory blocks.
14007
4170f62f 140082011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 14009
71b41406
PE
14010 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
14011
9587a89d
PE
14012 emacs_write: Accept and return EMACS_INT for sizes.
14013 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
14014 et seq.
14015 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
14016 Accept and return EMACS_INT.
14017 (emacs_gnutls_write): Return the number of bytes written on
14018 partial writes.
14019 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
14020 (emacs_read, emacs_write): Remove check for negative size, as the
14021 Emacs source code has been audited now.
9587a89d
PE
14022 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
14023 (emacs_read, emacs_write): Use it.
273a5f82
PE
14024 * process.c (send_process): Adjust to the new signatures of
14025 emacs_write and emacs_gnutls_write. Do not attempt to store
14026 a byte offset into an 'int'; it might overflow.
9587a89d 14027 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 14028
3e047f51
PE
14029 * sound.c: Don't assume sizes fit in 'int'.
14030 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 14031 Return EMACS_INT, not int.
3e047f51 14032 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
14033 Accept EMACS_INT, not int.
14034 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
14035 record read return values.
14036
cc39a9db
BK
140372011-04-15 Ben Key <bkey76@gmail.com>
14038
c9d0ec6d
JB
14039 * keyboard.c (Qundefined): Don't declare static since it is used
14040 in nsfns.m.
14041 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
14042 static since they are used in nsfont.m.
cc39a9db 14043
6c60eb9f
SM
140442011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
14045
14046 * process.c (Qprocessp): Don't declare static.
14047 * lisp.h (Qprocessp): Declare again.
14048
7990b61a
JB
140492011-04-15 Juanma Barranquero <lekktu@gmail.com>
14050
14051 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
14052
5d4cb038
PE
140532011-04-14 Paul Eggert <eggert@cs.ucla.edu>
14054
8bd7b830 14055 Improve C-level modularity by making more things 'static'.
cd64ea1d 14056
e3b27b31
PE
14057 Don't publish debugger-only interfaces to other modules.
14058 * lisp.h (safe_debug_print, debug_output_compilation_hack):
14059 (verify_bytepos, count_markers): Move decls to the only modules
14060 that need them.
14061 * region-cache.h (pp_cache): Likewise.
14062 * window.h (check_all_windows): Likewise.
14063 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
14064
5d4cb038
PE
14065 * sysdep.c (croak): Now static, if
14066 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
14067 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
14068
14069 * alloc.c (refill_memory_reserve): Now static if
14070 !defined REL_ALLOC || defined SYSTEM_MALLOC.
14071 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 14072
e87b6180
PE
14073 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
14074 Define only if USE_LUCID.
14075
ac64929e
PE
14076 * xrdb.c (x_customization_string, x_rm_string): Now static.
14077
6f37259d
PE
14078 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
14079 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
14080
1683e3ab
PE
14081 * xdisp.c (draw_row_with_mouse_face): Now static.
14082 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
14083
de9c2632
PE
14084 * window.h (check_all_windows): Mark externally visible.
14085
2b96acb7
PE
14086 * window.c (window_deletion_count): Now static.
14087
14088 * undo.c: Make symbols static if they're not exported.
14089 (last_undo_buffer, last_boundary_position, pending_boundary):
14090 Now static.
14091
50436f33
PE
14092 * textprop.c (interval_insert_behind_hooks): Now static.
14093 (interval_insert_in_front_hooks): Likewise.
14094
64520e5c
PE
14095 * term.c: Make symbols static if they're not exported.
14096 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
14097 (max_frame_lines, tty_set_terminal_modes):
14098 (tty_reset_terminal_modes, tty_turn_off_highlight):
14099 (get_tty_terminal): Now static.
14100 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
14101 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 14102 HAVE_WINDOW_SYSTEM.
64520e5c
PE
14103 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
14104 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
14105
1fa53021
PE
14106 * sysdep.c: Make symbols static if they're not exported.
14107 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
14108 Now static.
14109 (sigprocmask_set, full_mask): Remove; unused.
14110 (wait_debugging): Mark as visible.
14111 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
14112 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
14113
d4b43b22
PE
14114 * syntax.c (syntax_temp): Define only if !__GNUC__.
14115
b7c513d0
PE
14116 * sound.c (current_sound_device, current_sound): Now static.
14117
989b29ad
PE
14118 * search.c (searchbufs, searchbuf_head): Now static.
14119
13a55a78
PE
14120 * scroll.c (scroll_cost): Remove; unused.
14121 * dispextern.h (scroll_cost): Remove decl.
14122
de68a1fc
PE
14123 * region-cache.h (pp_cache): Mark as externally visible.
14124
40ccffa6
PE
14125 * process.c: Make symbols static if they're not exported.
14126 (process_tick, update_tick, create_process, chan_process):
14127 (Vprocess_alist, proc_buffered_char, datagram_access):
14128 (fd_callback_data, send_process_frame, process_sent_to): Now static.
14129 (deactivate_process): Mark defn as static, as well as decl.
14130 * lisp.h (create_process): Remove decl.
14131 * process.h (chan_process, Vprocess_alist): Remove decls.
14132
ad64fc97
PE
14133 * print.c: Make symbols static if they're not exported.
14134 (print_depth, new_backquote_output, being_printed, print_buffer):
14135 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
14136 (print_interval, print_number_index, initial_stderr_stream):
14137 Now static.
14138 * lisp.h (Fprinc): Remove decl.
14139 (debug_output_compilation_hack): Mark as externally visible.
14140
adddb265
PE
14141 * sysdep.c (croak): Move decl from here to syssignal.h.
14142 * syssignal.h (croak): Put it here, so the API can be checked when
14143 'croak' is called from dissociate_if_controlling_tty.
14144
1717ede2
PE
14145 * minibuf.c: Make symbols static if they're not exported.
14146 (minibuf_save_list, choose_minibuf_frame): Now static.
14147 * lisp.h (choose_minibuf_frame): Remove decl.
14148
fa5fb2bc
PE
14149 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
14150
1e3890d1
PE
14151 * lread.c: Make symbols static if they're not exported.
14152 (read_objects, initial_obarray, oblookup_last_bucket_number):
14153 Now static.
14154 (make_symbol): Remove; unused.
14155 * lisp.h (initial_obarray, make_symbol): Remove decls.
14156
8a1414fa
PE
14157 * keyboard.c: Make symbols static if they're not exported.
14158 (single_kboard, recent_keys_index, total_keys, recent_keys):
14159 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
14160 (this_single_command_key_start, echoing, last_auto_save):
14161 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
14162 (command_loop, echo_now, keyboard_init_hook, help_char_p):
14163 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
14164 (Vlispy_mouse_stem, double_click_count):
14165 Now static.
14166 (force_auto_save_soon): Define only if SIGDANGER.
14167 (ignore_mouse_drag_p): Now static if
14168 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
14169 (print_help): Remove; unused.
14170 (stop_character, last_timer_event): Mark as externally visible.
14171 * keyboard.h (ignore_mouse_drag_p): Declare only if
14172 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
14173 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
14174 * lisp.h (echoing): Remove decl.
14175 (force_auto_save_soon): Declare only if SIGDANGER.
14176 * xdisp.c (redisplay_window): Simplify code, to make it more
14177 obvious that ignore_mouse_drag_p is not accessed if !defined
14178 USE_GTK && !defined HAVE_NS.
14179
93ea6e8f
PE
14180 * intervals.c: Make symbols static if they're not exported.
14181 (merge_properties_sticky, merge_interval_right, delete_interval):
14182 Now static.
14183 * intervals.h (merge_interval_right, delete_interval): Remove decls.
14184
77382fcc
PE
14185 * insdel.c: Make symbols static if they're not exported.
14186 However, leave prepare_to_modify_buffer alone. It's never
14187 called from outside this function, but that appears to be a bug.
14188 (combine_after_change_list, combine_after_change_buffer):
4889fc82 14189 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
14190 (adjust_after_replace_noundo): Remove; unused.
14191 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 14192 (signal_before_change): Remove decls.
77382fcc 14193
9306c32e
PE
14194 * indent.c (val_compute_motion, val_vmotion): Now static.
14195
cd44d2eb
PE
14196 * image.c: Make symbols static if they're not exported.
14197 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
14198 if USE_GTK.
14199 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
14200 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
14201
ad9a7a06
PE
14202 * fringe.c (standard_bitmaps): Now static.
14203 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
14204
81626931
PE
14205 * frame.c: Make symbols static if they're not exported.
14206 (x_report_frame_params, make_terminal_frame): Now static.
14207 (get_frame_param): Now static, unless HAVE_NS.
14208 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
14209 (x_get_resource_string): Remove; not used.
14210 * frame.h (make_terminal_frame, x_report_frame_params):
14211 (x_get_resource_string); Remove decls.
14212 (x_fullscreen_adjust): Declare only if WINDOWSNT.
14213 * lisp.h (get_frame_param): Declare only if HAVE_NS.
14214
239f9db9
PE
14215 * font.c, fontset.c: Make symbols static if they're not exported.
14216 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
14217 (FACE_SUITABLE_FOR_CHAR_P): Use it.
14218 * font.c (font_close_object): Now static.
14219 * font.h (font_close_object): Remove.
14220 * fontset.c (FONTSET_OBJLIST): Remove.
14221 (free_realized_fontset) #if-0 the body, which does nothing.
14222 (face_suitable_for_char_p): #if-0, as it's never called.
14223 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
14224 * xfaces.c (face_at_string_position):
14225 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
14226 since 0 is always ASCII.
14227
dfcf3579
PE
14228 * fns.c (weak_hash_tables): Now static.
14229
5045092b
PE
14230 * fileio.c: Make symbols static if they're not exported.
14231 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
14232 (Vwrite_region_annotation_buffers): Now static.
14233
57a96f5c
PE
14234 * eval.c: Make symbols static if they're not exported.
14235 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
14236 * lisp.h (backtrace_list): Remove decl.
14237
35f08c38
PE
14238 * emacs.c: Make symbols static if they're not exported.
14239 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
14240 (fatal_error_code, fatal_error_signal_hook, standard_args):
14241 Now static.
14242 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
14243 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
14244 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
14245 * lisp.h (fatal_error_signal_hook): Remove decl.
14246 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
14247
f44bd759
PE
14248 * editfns.c: Move a (normally-unused) function to its only use.
14249 * editfns.c, lisp.h (get_operating_system_release): Remove.
14250 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
14251 worth the hassle of breaking this out.
14252
b532497d
PE
14253 * xterm.c: Make symbols static if they're not exported.
14254 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
14255 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
14256 (x_destroy_window, x_delete_display):
14257 Now static.
14258 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
14259 (x_mouse_leave): Remove; unused.
14260 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
14261 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
14262 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
14263 Remove decls.
14264 (x_mouse_leave): Declare only if WINDOWSNT.
14265 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
14266 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
14267 USE_X_TOOLKIT.
14268
1675728f
PE
14269 * ftxfont.c: Make symbols static if they're not exported.
14270 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
14271 HAVE_FREETYPE.
14272 * font.h (ftxfont_driver): Likewise.
14273
e4cebfca
PE
14274 * xfns.c: Make symbols static if they're not exported.
14275 (x_last_font_name, x_display_info_for_name):
14276 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
14277 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
14278 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
14279 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
14280 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
14281 (last_show_tip_args): Now static.
14282 (xic_defaut_fontset, xic_create_fontsetname): Define only if
14283 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
14284 (x_screen_planes): Remove; unused.
14285 * dispextern.h (x_screen_planes): Remove decl.
14286
5bf46f05
PE
14287 * dispnew.c: Make symbols static if they're not exported.
14288 * dispextern.h (redraw_garbaged_frames, scrolling):
14289 (increment_row_positions): Remove.
14290 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
14291 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
14292 Now static.
14293 (redraw_garbaged_frames): Remove; unused.
14294
435f4c28
PE
14295 * xfaces.c: Make symbols static if they're not exported.
14296 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
14297 Remove decls.
14298 * xterm.h (defined_color): Remove decls.
14299 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
14300 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
14301 (menu_face_changed_default, defined_color, free_realized_face):
14302 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
14303 (ascii_face_of_lisp_face): Remove; unused.
14304
8524aef3
PE
14305 * xdisp.c: Make symbols static if they're not exported.
14306 * dispextern.h (scratch_glyph_row, window_box_edges):
14307 (glyph_to_pixel_coords, set_cursor_from_row):
14308 (get_next_display_element, set_iterator_to_next):
14309 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
14310 (show_mouse_face): Remove decls
14311 * frame.h (message_buf_print): Likewise.
14312 * lisp.h (pop_message, set_message, check_point_in_composition):
14313 Likewise.
14314 * xterm.h (set_vertical_scroll_bar): Likewise.
14315 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
14316 (message_buf_print, scratch_glyph_row, displayed_buffer):
14317 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
14318 (get_next_display_element, show_mouse_face, window_box_edges):
14319 (frame_to_window_pixel_xy, check_point_in_composition):
14320 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
14321 (glyph_to_pixel_coords): Remove; unused.
14322
16390cd2
PE
14323 * dired.c (file_name_completion): Now static.
14324
14325 * dbusbind.c (xd_in_read_queued_messages): Now static.
14326
a25f4dfa
PE
14327 * lisp.h (circular_list_error, FOREACH): Remove; unused.
14328 * data.c (circular_list_error): Remove.
14329
14a9c8df
PE
14330 * commands.h (last_point_position, last_point_position_buffer):
14331 (last_point_position_window): Remove decls.
14332 * keyboard.c: Make these variables static.
14333
04f2d78b
CB
14334 * coding.h (coding, code_convert_region, encode_coding_gap):
14335 Remove decls.
74ab6df5
PE
14336 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
14337 (iso_code_class, detect_coding, code_convert_region): Now static.
14338 (encode_coding_gap): Remove; unused.
14339
38dfbee1
PE
14340 * chartab.c (chartab_chars, chartab_bits): Now static.
14341
a2cb4e63
PE
14342 * charset.h (charset_iso_8859_1): Remove decl.
14343 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
14344 Now static.
14345
127198fd
PE
14346 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
14347 * ccl.c (Vccl_program_table): Now static.
14348 (check_ccl_update): Remove; unused.
14349
d85b608f
PE
14350 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
14351 * category.h: ... from here.
14352 * category.c (check_category_table, set_category_set): Now static.
14353
31cd66f3
PE
14354 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
14355 * lisp.h: Remove these decls.
14356
c358e587
PE
14357 * buffer.c (buffer_count): Remove unused var.
14358
e78aecca
PE
14359 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
14360 so that it's not optimized away.
14361 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
14362 * dispextern.h (bidi_dump_cached_states): Remove, since it's
14363 exported only to the debugger.
14364
e192d7d3 14365 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 14366 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 14367
92470028
PE
14368 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
14369 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
14370 was inaccessible from Lisp.
14371 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
14372 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
14373
244ed907
PE
14374 alloc.c: Import and export fewer symbols, and remove unused items.
14375 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
14376 is defined.
14377 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
14378 it's not optimized away by whole-program optimization.
14379 (message_enable_multibyte, free_misc): Remove.
14380 (catchlist, handlerlist, mark_backtrace):
14381 Declare only if BYTE_MARK_STACK.
14382 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
14383 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
14384 (message_enable_multibyte): Remove decl.
14385 (free_misc, interval_free_list, float_block, float_block_index):
14386 (n_float_blocks, float_free_list, cons_block, cons_block_index):
14387 (cons_free_list, last_marked_index):
14388 Now static.
14389 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
14390 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
14391 (mark_backtrace): Define only if BYTE_MARK_STACK.
14392 * xdisp.c (message_enable_multibyte): Now static.
14393
61c2b50e 14394 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
14395 This makes it easier for human readers (and static analyzers)
14396 to see whether these variables are used from other modules.
14397 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
14398 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
14399 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
14400 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
14401 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
14402 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
14403 * xmenu.c, xselect.c:
14404 Declare Q* vars static if they are not used in other modules.
14405 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
14406 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
14407 Remove decls of unexported vars.
14408 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
14409
95c82688
PE
14410 * lisp.h (DEFINE_FUNC): Make sname 'static'.
14411
16a97296
PE
14412 Make Emacs functions such as Fatom 'static' by default.
14413 This makes it easier for human readers (and static analyzers)
14414 to see whether these functions can be called from other modules.
14415 DEFUN now defines a static function. To make the function external
14416 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
14417 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
14418 (Finit_image_library):
16a97296
PE
14419 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
14420 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
14421 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
14422 Remove decls, since these functions are now static.
14423 (Funintern, Fget_internal_run_time): New decls, since these functions
14424 were already external.
95c82688 14425
16a97296
PE
14426 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
14427 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
14428 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
14429 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
14430 * keyboard.c, keymap.c, lread.c:
14431 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
14432 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
14433 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
14434 Mark functions with DEFUE instead of DEFUN,
14435 if they are used in other modules.
14436 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
14437 decls for now-static functions.
14438 * buffer.h (Fdelete_overlay): Remove decl.
14439 * callproc.c (Fgetenv_internal): Mark as internal.
14440 * composite.c (Fremove_list_of_text_properties): Remove decl.
14441 (Fcomposition_get_gstring): New forward static decl.
14442 * composite.h (Fcomposite_get_gstring): Remove decl.
14443 * dired.c (Ffile_attributes): New forward static decl.
14444 * doc.c (Fdocumntation_property): New forward static decl.
14445 * eval.c (Ffetch_bytecode): New forward static decl.
14446 (Funintern): Remove extern decl; now in .h file where it belongs.
14447 * fileio.c (Fmake_symbolic_link): New forward static decl.
14448 * image.c (Finit_image_library): New forward static decl.
14449 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
14450 * intervals.h (Fprevious_property_change):
14451 (Fremove_list_of_text_properties): Remove decls.
14452 * keyboard.c (Fthis_command_keys): Remove decl.
14453 (Fcommand_execute): New forward static decl.
14454 * keymap.c (Flookup_key): New forward static decl.
14455 (Fcopy_keymap): Now static.
14456 * keymap.h (Flookup_key): Remove decl.
14457 * process.c (Fget_process): New forward static decl.
14458 (Fprocess_datagram_address): Mark as internal.
14459 * syntax.c (Fsyntax_table_p): New forward static decl.
14460 (skip_chars): Remove duplicate decl.
14461 * textprop.c (Fprevious_property_change): New forward static decl.
14462 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
14463 Now internal.
14464 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
14465 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
14466
785bbd42
PE
14467 * editfns.c (Fformat): Remove unreachable code.
14468
8b913b57
AS
144692011-04-14 Andreas Schwab <schwab@linux-m68k.org>
14470
14471 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
14472 change. (Bug#8496)
14473
a6744a35
EZ
144742011-04-13 Eli Zaretskii <eliz@gnu.org>
14475
14476 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
14477 when at ZV. (Bug#8487)
14478
e7974947
AS
144792011-04-12 Andreas Schwab <schwab@linux-m68k.org>
14480
baad03f0
AS
14481 * charset.c (Fclear_charset_maps): Use xfree instead of free.
14482 (Bug#8437)
14483 * keyboard.c (parse_tool_bar_item): Likewise.
14484 * sound.c (sound_cleanup, alsa_close): Likewise.
14485 * termcap.c (tgetent): Likewise.
14486 * xfns.c (x_default_font_parameter): Likewise.
14487 * xsettings.c (read_and_apply_settings): Likewise.
14488
e7974947
AS
14489 * alloc.c (overrun_check_malloc, overrun_check_realloc)
14490 (overrun_check_free): Protoize.
14491
28272684
PE
144922011-04-12 Paul Eggert <eggert@cs.ucla.edu>
14493
14494 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
14495 since callers should never pass a negative size.
14496 Change the signature to match that of plain 'read' and 'write'; see
14497 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
14498 * lisp.h: Update prototypes of emacs_write and emacs_read.
14499
11997c76
EZ
145002011-04-11 Eli Zaretskii <eliz@gnu.org>
14501
14502 * xdisp.c (redisplay_window): Don't try to determine the character
14503 position of the scroll margin if the window start point w->startp
e896f03c 14504 is outside the buffer's accessible region. (Bug#8468)
11997c76 14505
8a2cbd72
EZ
145062011-04-10 Eli Zaretskii <eliz@gnu.org>
14507
14508 Fix write-region and its subroutines for buffers > 2GB.
14509 * fileio.c (a_write, e_write): Modify declaration of arguments and
14510 local variables to support buffers larger than 2GB.
14511 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
14512
14513 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
14514 argument, local variables, and return value.
14515
14516 * lisp.h: Update prototypes of emacs_write and emacs_read.
14517
14518 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
14519
4073e537 145202011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 14521
1ebfdcb6
PE
14522 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
14523
b2ded58d
PE
14524 Fix more problems found by GCC 4.6.0's static checks.
14525
7d66342c
PE
14526 * xdisp.c (vmessage): Use a better test for character truncation.
14527
bbf47d44
PE
14528 * charset.c (load_charset_map): <, not <=, for optimization,
14529 and to avoid potential problems with integer overflow.
9248994d 14530 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 14531 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 14532 * editfns.c (Fformat): Likewise.
1e69125e 14533 * syntax.c (skip_chars): Likewise.
3befa583 14534
e3019616
PE
14535 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
14536 This also lets GCC 4.6.0 generate slightly better loop code.
14537
becfa255
PE
14538 * callint.c (Fcall_interactively): <, not <=, for optimization.
14539 (Fcall_interactively): Count the number of arguments produced,
14540 not the number of arguments given. This is simpler and lets GCC
14541 4.6.0 generate slightly better code.
14542
dae0cd48
PE
14543 * ftfont.c: Distingish more carefully between FcChar8 and char.
14544 The previous code passed unsigned char * to a functions like
14545 strlen and xstrcasecmp that expect char *, which does not
14546 conform to the C standard.
14547 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
14548 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
14549 char * when the C standard requires it.
14550
76032d70
PE
14551 * keyboard.c (read_char): Remove unused var.
14552
eb3f1cc8
PE
14553 * eval.c: Port to Windows vsnprintf (Bug#8435).
14554 Include <limits.h>.
14555 (SIZE_MAX): Define if the headers do not.
14556 (verror): Do not give up if vsnprintf returns a negative count.
14557 Instead, grow the buffer. This ports to Windows vsnprintf, which
14558 does not conform to C99. Problem reported by Eli Zaretskii.
14559 Also, simplify the allocation scheme, by avoiding the need for
14560 calling realloc, and removing the ALLOCATED variable.
14561
70476b54
PE
14562 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
14563
12020a9e
PE
14564 Remove invocations of doprnt, as Emacs now uses vsnprintf.
14565 But keep the doprint source code for now, as we might revamp it
14566 and use it again (Bug#8435).
ea6c7ae6
PE
14567 * lisp.h (doprnt): Remove.
14568 * Makefile.in (base_obj): Remove doprnt.o.
14569 * deps.mk (doprnt.o): Remove.
14570
5fdb398c
PE
14571 error: Print 32- and 64-bit integers portably (Bug#8435).
14572 Without this change, on typical 64-bit hosts error ("...%d...", N)
14573 was used to print both 32- and 64-bit integers N, which relied on
14574 undefined behavior.
61bdb816 14575 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
14576 * lisp.h (error, verror): Mark as printf-like functions.
14577 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
14578 Report overflow in size calculations when allocating printf buffer.
14579 Do not truncate output string at its first null byte.
14580 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
14581 Truncate the output at a character boundary, since vsnprintf does not
14582 do that.
14583 * charset.c (check_iso_charset_parameter): Convert internal
14584 character to string before calling 'error', since %c now has the
14585 printf meaning.
14586 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
14587 overflow when computing char to be passed to 'error'. Do not
14588 pass Lisp_Object to 'error'; pass the integer instead.
14589 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
14590 formatted with plain %d.
14591
b189fa66
PE
14592 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
14593
bff87ef0
PE
14594 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
14595
7e2cac20
PE
14596 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
14597
ce4d90b5
PE
14598 * xterm.c (x_catch_errors): Remove duplicate declaration.
14599
266c9547
PE
14600 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
14601
79c49ad2
PE
14602 * xdisp.c, lisp.h (message_nolog): Remove; unused.
14603
368f4090
JM
146042011-04-10 Jim Meyering <meyering@redhat.com>
14605
14606 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
14607 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
14608 return ssize_t not "int", and use size_t as the buffer length.
14609 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
14610 * gnutls.h: Update declarations.
14611 * process.c (read_process_output): Use ssize_t, to match.
14612 (send_process): Likewise.
14613
a32d4040
CY
146142011-04-09 Chong Yidong <cyd@stupidchicken.com>
14615
14616 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
14617
8546720e 146182011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 14619
04f2d78b
CB
14620 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
14621 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 14622
8546720e
GM
14623 * xterm.c (handle_one_xevent):
14624 * xmenu.c (create_and_show_popup_menu):
14625 * xselect.c (x_decline_selection_request)
14626 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 14627
0a2f5c1a 146282011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
14629
14630 Fix some uses of `int' instead of EMACS_INT.
14631 * search.c (string_match_1, fast_string_match)
14632 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
14633 (scan_buffer, find_next_newline_no_quit)
14634 (find_before_next_newline, search_command, Freplace_match)
14635 (Fmatch_data): Make some `int' variables be EMACS_INT.
14636
14637 * xdisp.c (display_count_lines): 3rd argument and return value now
14638 EMACS_INT. All callers changed.
14639 (pint2hrstr): Last argument is now EMACS_INT.
14640
14641 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
14642 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
14643 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
14644 (decode_coding_utf_16, decode_coding_emacs_mule)
14645 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
14646 (decode_coding_ccl, decode_coding_charset)
14647 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
14648 (decode_coding_iso_2022, decode_coding_emacs_mule)
14649 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
14650 <char_offset, last_offset>: Declare EMACS_INT.
14651 (encode_coding_utf_8, encode_coding_utf_16)
14652 (encode_coding_emacs_mule, encode_invocation_designation)
14653 (encode_designation_at_bol, encode_coding_iso_2022)
14654 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
14655 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
14656 Declare EMACS_INT.
14657 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
14658 (encode_invocation_designation): Last argument P_NCHARS is now
14659 EMACS_INT.
14660 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
14661 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
14662
14663 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
14664 All users changed.
14665
14666 * ccl.c (Fccl_execute_on_string): Declare some variables
14667 EMACS_INT.
14668
8546720e 146692011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
14670
14671 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
14672
4e19a977
CS
146732011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
14674
14675 * process.c (Fformat_network_address): Doc fix.
14676
87302331
R
146772011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
14678
ee7683eb 14679 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 14680
cbb59342
CY
146812011-04-08 Chong Yidong <cyd@stupidchicken.com>
14682
14683 * keyboard.c (read_char): Call Lisp function help-form-show,
14684 instead of using internal_with_output_to_temp_buffer.
14685 (Qhelp_form_show): New var.
e0d38eeb 14686 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
14687
14688 * print.c (internal_with_output_to_temp_buffer): Function deleted.
14689
14690 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
14691
e67a13ab
CY
146922011-04-06 Chong Yidong <cyd@stupidchicken.com>
14693
04f2d78b
CB
14694 * process.c (Flist_processes): Remove to Lisp.
14695 (list_processes_1): Delete.
e67a13ab 14696
973f782d
EZ
146972011-04-06 Eli Zaretskii <eliz@gnu.org>
14698
7c106b1e
EZ
14699 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
14700
973f782d
EZ
14701 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
14702
41cf7d1a 147032011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 14704
ca23cc88
PE
14705 Fix more problems found by GCC 4.6.0's static checks.
14706
f390e2d5
PE
14707 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
14708
42eea0d0
PE
14709 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
14710
b69769da 14711 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 14712
f9541e84
PE
14713 * xdisp.c (vmessage): Mark as a printf-like function.
14714
13841b55
PE
14715 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
14716
c136c10f
PE
14717 * sound.c (sound_warning): Don't crash if arg contains a printf format.
14718
5e2d4a30
PE
14719 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
14720 printf-like functions.
14721 (tiff_load): Add casts to remove these marks before passing them
14722 to system-supplied API.
14723
583f48b9
PE
14724 * eval.c (Fsignal): Remove excess argument to 'fatal'.
14725
b25d760e
PE
14726 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
14727 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
14728 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
14729 directly, rather than having caller test rule sign. This avoids
14730 some unnecessary tests.
14731 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
14732 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
14733 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 14734
bc7b6697 14735 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 14736 (xfont_open): Avoid unnecessary tests.
bc7b6697 14737
27ccc379
PE
14738 * composite.c (composition_gstring_put_cache): Use unsigned integer.
14739
dcd5c89a
PE
14740 * composite.h, composite.c (composition_gstring_put_cache):
14741 Use EMACS_INT, not int, for length.
14742
b13a45c6
PE
14743 * composite.h (COMPOSITION_DECODE_REFS): New macro,
14744 breaking out part of COMPOSITION_DECODE_RULE.
14745 (COMPOSITION_DECODE_RULE): Use it.
14746 * composite.c (get_composition_id): Remove unused local vars,
14747 by using the new macro.
14748
1e792e4d
PE
14749 * textprop.c (set_text_properties_1): Change while to do-while,
14750 since the condition is always true at first.
14751
dc6c6455 14752 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
14753 (interval_deletion_adjustment): Return unsigned value.
14754 All uses changed.
dc6c6455 14755
aba7731a
PE
14756 * process.c (list_processes_1, create_pty, read_process_output):
14757 (exec_sentinel): Remove vars that were set but not used.
afd4052b 14758 (create_pty): Remove unnecessary "volatile"s.
bc57d757 14759 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 14760 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 14761 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 14762
fdfc4bf3
PE
14763 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
14764
fca8fe46 14765 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 14766 (update_syntax_table): Use unsigned instead of int.
fca8fe46 14767
06a0259a 14768 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 14769 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 14770 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 14771
e7b9e80f
PE
14772 * print.c (print_error_message): Avoid int overflow.
14773
56201685
PE
14774 * font.c (font_list_entities): Redo for clarity,
14775 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
14776
78834453 14777 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 14778 (font_score): Avoid potential overflow in diff calculation.
78834453 14779
0bc0b309 14780 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 14781 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 14782
e610eaca
PE
14783 * eval.c (funcall_lambda): Rename local to avoid shadowing.
14784
b895abce
PE
14785 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
14786 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
14787 can always succeed if overflow has undefined behavior.
14788
1f1d9321 14789 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 14790 (wordify): Omit three unnecessary tests.
1f1d9321 14791
c59478bc
PE
14792 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
14793 All callers changed. This avoids the need for an unused var.
14794
79b73827
PE
14795 * casefiddle.c (casify_region): Remove var that is set but not used.
14796
a4db5dfe
PE
14797 * dired.c (file_name_completion): Remove var that is set but not used.
14798
43aae36e
PE
14799 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
14800
2a47c44d 14801 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 14802 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 14803
a37c69bf
PE
14804 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
14805 Check for integer overflow on size calculations.
14806
328ab8e7
PE
14807 * buffer.c (Fprevious_overlay_change): Remove var that is set
14808 but not used.
14809
e5a2a5cb
PE
14810 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
14811 Remove vars that are set but not used.
8d84a6eb 14812 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 14813 (timer_check_2): Mark vars as initialized.
e5a2a5cb 14814
a60e5f68
PE
14815 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
14816
f661cb61 14817 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 14818 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 14819
f0397f5a
PE
14820 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
14821 that are set but not used.
14822
8664db06 14823 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 14824 if XCreateBitmapFromData fails (Bug#8410).
8664db06 14825
6abdaa4a
PE
14826 * xselect.c (x_get_local_selection, x_handle_property_notify):
14827 Remove vars that are set but not used.
14828
0ce7538d 14829 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 14830 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 14831
9ae848fc
PE
14832 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
14833 Remove var that is set but not used.
0b918413
PE
14834 (scroll_bar_windows_size): Now size_t, not int.
14835 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
14836 Check for overflow.
9ae848fc 14837
a5a62657
PE
14838 * xfaces.c (realize_named_face): Remove vars that are set but not used.
14839 (map_tty_color) [!defined MSDOS]: Likewise.
14840
5c5cdd39
PE
14841 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
14842
66ebf983
PE
14843 * coding.c: Remove vars that are set but not used.
14844 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
14845 All callers changed.
14846 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
14847 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
14848 (decode_coding_charset): Remove vars that are set but not used.
14849
1be4d761
PE
14850 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
14851 that is set but not used.
14852
47553fa8
PE
14853 * print.c (print_object): Remove var that is set but not used.
14854
1f7196bf 14855 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
14856 The gnulib version avoids calling malloc in the usual case,
14857 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
14858 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
14859 * filelock.c (current_lock_owner): Likewise.
14860 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
14861 * sysdep.c: Include allocator.h, careadlinkat.h.
14862 (emacs_no_realloc_allocator): New static constant.
14863 (emacs_readlink): New function.
fdb61804
PE
14864 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
14865 ../lib/careadlinkat.h.
d1fdcab7 14866
f84c17c7
SM
148672011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
14868
14869 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
14870 first non-nil return value).
14871
ef3862ad
JD
148722011-04-03 Jan Djärv <jan.h.d@swipnet.se>
14873
14874 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
14875 if not defined (Bug#8403).
14876
376a7006
JB
148772011-04-02 Juanma Barranquero <lekktu@gmail.com>
14878
14879 * xdisp.c (display_count_lines): Remove parameter `start',
14880 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
14881 (get_char_face_and_encoding): Remove parameter `multibyte_p',
14882 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
14883 (fill_stretch_glyph_string): Remove parameters `row' and `area',
14884 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
14885 and thereabouts. All callers changed.
14886 (get_per_char_metric): Remove parameter `f', unused since
14887 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
14888
6ca3801d
JM
148892011-04-02 Jim Meyering <meyering@redhat.com>
14890
14891 do not dereference NULL upon failed strdup
14892 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
14893 (ns_get_family): Likewise.
14894
d8e2b5ba
JB
148952011-04-02 Juanma Barranquero <lekktu@gmail.com>
14896
14897 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
14898
8c74fcbd
JD
148992011-04-02 Jan Djärv <jan.h.d@swipnet.se>
14900
14901 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
14902 later (Bug#8403).
14903
7200d79c
SM
149042011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
14905
03408648 14906 Add lexical binding.
7200d79c 14907
03408648
SM
14908 * window.c (Ftemp_output_buffer_show): New fun.
14909 (Fsave_window_excursion):
14910 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
14911
14912 * lread.c (lisp_file_lexically_bound_p): New function.
14913 (Fload): Bind Qlexical_binding.
14914 (readevalloop): Remove `evalfun' arg.
14915 Bind Qinternal_interpreter_environment.
14916 (Feval_buffer): Bind Qlexical_binding.
14917 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
14918 Mark as dynamic.
14919 (syms_of_lread): Declare `lexical-binding'.
14920
14921 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
14922
14923 * keyboard.c (eval_dyn): New fun.
14924 (menu_item_eval_property): Use it.
ca105506
SM
14925
14926 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 14927
03408648
SM
14928 * fns.c (concat, mapcar1): Accept byte-code-functions.
14929
14930 * eval.c (Fsetq): Handle lexical vars.
14931 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
14932 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
14933 (FletX, Flet): Obey lexical binding.
14934 (Fcommandp): Handle closures.
14935 (Feval): New `lexical' arg.
14936 (eval_sub): New function extracted from Feval. Use it almost
14937 everywhere where Feval was used. Look up vars in lexical env.
14938 Handle closures.
14939 (Ffunctionp): Move from subr.el.
14940 (Ffuncall): Handle closures.
14941 (apply_lambda): Remove `eval_flags'.
14942 (funcall_lambda): Handle closures and new byte-code-functions.
14943 (Fspecial_variable_p): New function.
14944 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
14945 but without exporting it to Lisp.
23aba0ea 14946
23aba0ea 14947 * doc.c (Fdocumentation, store_function_docstring):
03408648 14948 * data.c (Finteractive_form): Handle closures.
23aba0ea 14949
03408648
SM
14950 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
14951 interactive spec.
ba83908c 14952
04f2d78b
CB
14953 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
14954 New byte-codes.
03408648
SM
14955 (exec_byte_code): New function extracted from Fbyte_code to handle new
14956 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 14957
03408648 14958 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 14959
03408648 14960 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 14961
e2abce01
JB
149622011-03-31 Juanma Barranquero <lekktu@gmail.com>
14963
14964 * xdisp.c (redisplay_internal): Fix prototype.
14965
63696a73 149662011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 14967
63696a73 14968 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
14969 (try_scrolling): Use it when setting scroll_limit.
14970 Limit scrolling to 100 screen lines.
63696a73
EZ
14971 (redisplay_window): Even when falling back on "recentering",
14972 position point in the window according to scroll-conservatively,
14973 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
14974
14975 (try_scrolling): When point is above the window, allow searching
14976 as far as scroll_max, or one screenful, to compute vertical
14977 distance from PT to the scroll margin position. This prevents
14978 try_scrolling from unnecessarily failing when
14979 scroll-conservatively is set to a value slightly larger than the
14980 window height. Clean up the case of PT below the margin at bottom
14981 of window: scroll_max can no longer be INT_MAX. When aggressive
14982 scrolling is in use, don't let point enter the opposite scroll
14983 margin as result of the scroll.
14984 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
14985 threshold of 100 lines for never-recentering scrolling.
14986
e4cc2dfc
JB
149872011-03-31 Juanma Barranquero <lekktu@gmail.com>
14988
14989 * dispextern.h (move_it_by_lines):
14990 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
14991 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
14992 (message_log_check_duplicate): Remove parameters `prev_bol' and
14993 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
14994 (redisplay_internal): Remove parameter `preserve_echo_area',
14995 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
14996
14997 * indent.c (Fvertical_motion):
14998 * window.c (window_scroll_pixel_based, Frecenter):
14999 Don't pass `need_y_p' to `move_it_by_lines'.
15000
1c470562
SM
150012011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
15002
44f230aa
SM
15003 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
15004 steal a few bits to be more compact.
15005 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
15006 Remove unneeded casts.
15007
1c470562
SM
15008 * bytecode.c (Fbyte_code): CAR and CDR can GC.
15009
888adce9
ZK
150102011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
15011
15012 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
15013 binding" message (bug#7967).
15014
f838ed7b
PE
150152011-03-30 Paul Eggert <eggert@cs.ucla.edu>
15016
77861b95
PE
15017 Fix more problems found by GCC 4.6.0's static checks.
15018
de6dbc14
PE
15019 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
15020 Remove unused local var.
15021
f838ed7b
PE
15022 * editfns.c (Fmessage_box): Remove unused local var.
15023
792c7b2b
PE
15024 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
15025 (note_mode_line_or_margin_highlight, note_mouse_highlight):
15026 Omit unused local vars.
c499e557 15027 * window.c (shrink_windows): Omit unused local var.
b01a1c29 15028 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
15029 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
15030 Omit unused local var.
15031
ba0165e1
PE
15032 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
15033 Don't assume string length fits in int.
32ad8845 15034 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 15035 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 15036
3c59b4c9
PE
15037 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
15038 instead of alloca (Bug#8344).
15039
a3eed478 15040 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 15041 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 15042
eb4d412d
PE
15043 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
15044
1658b401
PE
15045 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
15046 concerns.
15047
15048 * term.c (produce_glyphless_glyph): Remove unnecessary test.
15049
15050 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 15051
9a2c6e05
PE
15052 * keyboard.c (syms_of_keyboard): Use the same style as later
15053 in this function when indexing through an array. This also
15054 works around GCC bug 48267.
15055
03d0a109
PE
15056 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
15057
44f730c8
PE
15058 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
15059
fe75f926
PE
15060 * chartab.c (sub_char_table_ref_and_range): Redo for slight
15061 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
15062
ffa8c828
PE
15063 * keyboard.c, keyboard.h (num_input_events): Now size_t.
15064 This avoids undefined behavior on integer overflow, and is a bit
15065 more convenient anyway since it is compared to a size_t variable.
15066
c5101a77
PE
15067 Variadic C functions now count arguments with size_t, not int.
15068 This avoids an unnecessary limitation on 64-bit machines, which
15069 caused (substring ...) to crash on large vectors (Bug#8344).
15070 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
15071 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 15072 All variadic functions and their callers changed accordingly.
c5101a77
PE
15073 (struct gcpro.nvars): Now size_t, not int. All uses changed.
15074 * data.c (arith_driver, float_arith_driver): Likewise.
15075 * editfns.c (general_insert_function): Likewise.
15076 * eval.c (struct backtrace.nargs, interactive_p)
15077 (internal_condition_case_n, run_hook_with_args, apply_lambda)
15078 (funcall_lambda, mark_backtrace): Likewise.
15079 * fns.c (concat): Likewise.
15080 * frame.c (x_set_frame_parameters): Likewise.
15081 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
15082 0 if not found, not -1. All callers changed.
15083
dd3f25f7
PE
15084 * alloc.c (garbage_collect): Don't assume stack size fits in int.
15085 (stack_copy_size): Now size_t, not int.
15086 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
15087
461c2ab9
JB
150882011-03-28 Juanma Barranquero <lekktu@gmail.com>
15089
15090 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
15091 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
15092 All callers changed.
15093
15094 * lisp.h (multibyte_char_to_unibyte):
15095 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
15096 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
15097 * character.h (CHAR_TO_BYTE8):
15098 * cmds.c (internal_self_insert):
15099 * editfns.c (general_insert_function):
15100 * keymap.c (push_key_description):
15101 * search.c (Freplace_match):
15102 * xdisp.c (message_dolog, set_message_1): All callers changed.
15103
f6d62986
SM
151042011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
15105
15106 * keyboard.c (safe_run_hook_funcall): New function.
15107 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
15108 don't set the hook to nil, but remove the offending function instead.
15109 (Qcommand_hook_internal): Remove, unused.
15110 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
15111 Vcommand_hook_internal.
15112
15113 * eval.c (enum run_hooks_condition): Remove.
15114 (funcall_nil, funcall_not): New functions.
15115 (run_hook_with_args): Call each function through a `funcall' argument.
15116 Remove `cond' argument, now redundant.
15117 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
15118 (Frun_hook_with_args_until_failure): Adjust accordingly.
15119 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
15120
1db5b1ad
JB
151212011-03-28 Juanma Barranquero <lekktu@gmail.com>
15122
15123 * dispextern.h (string_buffer_position): Remove declaration.
15124
15125 * print.c (strout): Remove parameter `multibyte', unused since
15126 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
15127
15128 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
15129 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
15130 All callers changed.
15131
15132 * w32.c (_wsa_errlist): Use braces for struct initializers.
15133
15134 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
15135 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
15136 All callers changed.
15137 (string_buffer_position): Likewise. Also, make static (it's never
15138 used outside xdisp.c).
15139 (cursor_row_p): Remove parameter `w', unused since
15140 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
15141 (decode_mode_spec): Remove parameter `precision', introduced during
15142 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
15143 All callers changed.
15144
5ffb62aa
JD
151452011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15146
15147 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
15148
461c2ab9 151492011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
15150
15151 * nsterm.m (ns_menu_bar_is_hidden): New variable.
15152 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
15153 (ns_update_auto_hide_menu_bar): New functions.
15154 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
15155 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
15156 ns_constrain_all_frames.
15157 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
15158 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
15159
5c380ffb
JD
151602011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15161
15162 * nsmenu.m (runDialogAt): Remove argument to timer_check.
15163
9af30bdf
GM
151642011-03-27 Glenn Morris <rgm@gnu.org>
15165
15166 * syssignal.h: Replace RETSIGTYPE with void.
15167 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
15168 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
15169 Replace SIGTYPE with void everywhere.
15170 * s/usg5-4-common.h (SIGTYPE): Remove definition.
15171 * s/template.h (SIGTYPE): Remove commented out definition.
15172
e2abce01
JB
151732011-03-26 Eli Zaretskii <eliz@gnu.org>
15174
15175 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
15176 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
15177
f868cd8a
JB
151782011-03-26 Juanma Barranquero <lekktu@gmail.com>
15179
59eb0929
JB
15180 * w32.c (read_unc_volume): Use parameter `henum', instead of
15181 global variable `wget_enum_handle'.
15182
15183 * keymap.c (describe_vector): Remove parameters `indices' and
15184 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
15185 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
15186
f868cd8a
JB
15187 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
15188
15189 * keyboard.c (timer_check): Remove parameter `do_it_now',
15190 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
15191 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
15192 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
15193
15194 * keyboard.c (read_char):
15195 * w32menu.c (w32_menu_display_help):
15196 * xmenu.c (show_help_event, menu_help_callback):
15197 Adjust calls to `show_help_echo'.
15198
15199 * gtkutil.c (xg_maybe_add_timer):
15200 * keyboard.c (readable_events):
15201 * process.c (wait_reading_process_output):
15202 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
15203
15204 * insdel.c (adjust_markers_gap_motion):
15205 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
15206 (gap_left, gap_right): Don't call it.
15207
2ecf6fdb
CY
152082011-03-25 Chong Yidong <cyd@stupidchicken.com>
15209
15210 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
15211 incurred during fontification.
15212
6b1f9ba4
JB
152132011-03-25 Juanma Barranquero <lekktu@gmail.com>
15214
15215 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
15216 (DEFVAR_PER_BUFFER): Don't pass it.
15217
15218 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
15219 (scrolling_window): Don't pass it.
15220
0f4a96b5
JB
152212011-03-25 Juanma Barranquero <lekktu@gmail.com>
15222
15223 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
15224
15225 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
15226 and `suffix'.
15227 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
15228 of variables specific to SELinux and computation of `encoded_absname'.
15229
15230 * image.c (XPutPixel): Remove unused variable `height'.
15231
15232 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
15233
15234 * unexw32.c (get_section_info): Remove unused variable `section'.
15235
15236 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
15237 (system_process_attributes): Remove unused variable `sess'.
15238 (sys_read): Remove unused variable `err'.
15239
15240 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
15241 (w32_wnd_proc): Remove unused variable `isdead'.
15242 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
15243 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
15244 (x_create_tip_frame): Remove unused variable `tem'.
15245
15246 * w32inevt.c (w32_console_read_socket):
15247 Remove unused variable `no_events'.
15248
15249 * w32term.c (x_draw_composite_glyph_string_foreground):
15250 Remove unused variable `width'.
15251
1149507c
JB
152522011-03-24 Juanma Barranquero <lekktu@gmail.com>
15253
15254 * w32term.c (x_set_glyph_string_clipping):
15255 Don't pass uninitialized region to CombineRgn.
15256
9c88f339
JB
152572011-03-23 Juanma Barranquero <lekktu@gmail.com>
15258
15259 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
15260 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
15261 (Fx_close_connection): Remove unused variable `i'.
15262
15263 * w32font.c (w32font_draw): Return number of glyphs.
15264 (w32font_open_internal): Remove unused variable `i'.
15265 (w32font_driver): Add missing initializer.
15266
15267 * w32menu.c (utf8to16): Remove unused variable `utf16'.
15268 (fill_in_menu): Remove unused variable `items_added'.
15269
15270 * w32term.c (last_mouse_press_frame): Remove static global variable.
15271 (w32_clip_to_row): Remove unused variable `f'.
15272 (x_delete_terminal): Remove unused variable `i'.
15273
15274 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
15275 (NOTHING): Remove unused static global variable.
15276 (uniscribe_check_otf): Remove unused variable `table'.
15277 (uniscribe_font_driver): Add missing initializers.
15278
dee091a3
JD
152792011-03-23 Julien Danjou <julien@danjou.info>
15280
15281 * term.c (Fsuspend_tty, Fresume_tty):
15282 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
15283 * window.c (temp_output_buffer_show):
15284 * insdel.c (signal_before_change):
15285 * frame.c (Fhandle_switch_frame):
15286 * fileio.c (Fdo_auto_save):
15287 * emacs.c (Fkill_emacs):
15288 * editfns.c (save_excursion_restore):
15289 * cmds.c (internal_self_insert):
15290 * callint.c (Fcall_interactively):
15291 * buffer.c (Fkill_all_local_variables):
15292 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
15293 Use Frun_hooks.
0f4a96b5 15294 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 15295 unconditionally since it does the check itself.
dee091a3 15296
2c520ab5 152972011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 15298
c9c49752
PE
15299 Fix more problems found by GCC 4.5.2's static checks.
15300
8abc3f12
PE
15301 * coding.c (encode_coding_raw_text): Avoid unnecessary test
15302 the first time through the loop, since we know p0 < p1 then.
15303 This also avoids a gcc -Wstrict-overflow warning.
15304
a2d26660
PE
15305 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
15306 leading to a memory leak, possible in functions like
15307 load_charset_map_from_file that can allocate an unbounded number
b12ef411 15308 of objects (Bug#8318).
a2d26660 15309
916c72e9
PE
15310 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
15311 that could (at least in theory) be that large.
15312
19ab8a18
PE
15313 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
15314 This is less likely to overflow, and avoids undefined behavior if
15315 overflow does occur. All callers changed. Use strtoul to scan
15316 for the unsigned long integer.
b7cbbd6f
PE
15317 (pint2hrstr): Simplify and tune code slightly.
15318 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 15319
f0641eff
PE
15320 * scroll.c (do_scrolling): Work around GCC bug 48228.
15321 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
15322
7f650bb9
PE
15323 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
15324 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
15325 (validate_x_resource_name): Simplify count usage.
15326 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 15327
37dd57d1
PE
15328 * fileio.c (Fcopy_file): Report error if fchown or fchmod
15329 fail (Bug#8306).
81e56e61 15330
699979fc 15331 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 15332
401bf9b4
PE
15333 * process.c (Fmake_network_process): Use socklen_t, not int,
15334 where POSIX says socklen_t is required in portable programs.
15335 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 15336 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
15337 (Fmake_network_process, server_accept_connection):
15338 (wait_reading_process_output, read_process_output):
15339 Likewise.
15340
b93aacde
PE
15341 * process.c: Rename or move locals to avoid shadowing.
15342 (list_processes_1, Fmake_network_process):
15343 (read_process_output_error_handler, exec_sentinel_error_handler):
15344 Rename or move locals.
4dc343ee 15345 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 15346 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 15347 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 15348 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 15349 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 15350
af8a867c 15351 Make tparam.h and terminfo.c consistent.
44f230aa
SM
15352 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
15353 Include tparam.h instead, since it declares them.
af8a867c
PE
15354 * cm.h (PC): Remove extern decl; tparam.h now does this.
15355 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
15356 * terminfo.c: Include tparam.h, to check interfaces.
15357 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
15358 (tparam): Adjust signature to match interface in tparam.h;
15359 this removes some undefined behavior. Check that outstring and len
15360 are zero, which they always are with Emacs.
15361 * tparam.h (PC, BC, UP): New extern decls.
15362
0248044d 15363 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 15364 (xftfont_open): Rename locals to avoid shadowing.
0248044d 15365
8ff096c1 15366 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
15367 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
15368 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 15369 (ftfont_list): Remove unused local.
49eaafba
PE
15370 (get_adstyle_property, ftfont_pattern_entity):
15371 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
15372 Rename locals to avoid shadowing.
8ff096c1 15373
e2be39f6
PE
15374 * xfont.c (xfont_list_family): Mark var as initialized.
15375
c9735e30
PE
15376 * xml.c (make_dom): Now static.
15377
8f5201ae
PE
15378 * composite.c (composition_compute_stop_pos): Rename local to
15379 avoid shadowing.
b246f932
PE
15380 (composition_reseat_it): Remove unused locals.
15381 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 15382 (composition_update_it): Mark var as initialized.
11b61122
PE
15383 (find_automatic_composition): Mark vars as initialized,
15384 with a FIXME (Bug#8290).
8f5201ae 15385
760fbc2c
PE
15386 character.h: Rename locals to avoid shadowing.
15387 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
15388 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
15389 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
15390 (BUF_DEC_POS): Be more systematic about renaming local temporaries
15391 to avoid shadowing.
15392
ff08eb85
PE
15393 * textprop.c (property_change_between_p): Remove; unused.
15394
fc7bf025
PE
15395 * intervals.c (interval_start_pos): Now static.
15396
235d7abc
PE
15397 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
15398
44f230aa
SM
15399 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
15400 Rename locals to avoid shadowing.
3e7d6594 15401
50060332
PE
15402 * sound.c (wav_play, au_play, Fplay_sound_internal):
15403 Fix pointer signedness.
d01f234b 15404 (alsa_choose_format): Remove unused local var.
c83b8872
PE
15405 (wav_play): Initialize a variable to 0, to prevent undefined
15406 behavior (Bug#8278).
50060332 15407
c4fc4e30
PE
15408 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
15409
918436ed
PE
15410 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
15411
c939f91b
PE
15412 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
15413 clobbering (Bug#8298).
b9c7f648
PE
15414 * sysdep.c (sys_subshell): Likewise.
15415 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 15416
6bd8c144
PE
15417 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
15418 This should get cleaned up, so that child_setup has the
15419 same signature on all platforms.
15420
7710357c 15421 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 15422 (relocate_fd): Rename locals to avoid shadowing.
7710357c 15423
c59da222
CY
154242011-03-22 Chong Yidong <cyd@stupidchicken.com>
15425
15426 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
15427 not to be necessary, and produces flickering.
15428
66b87493
GM
154292011-03-20 Glenn Morris <rgm@gnu.org>
15430
15431 * config.in: Remove file.
15432
45b6f6d5
JB
154332011-03-20 Juanma Barranquero <lekktu@gmail.com>
15434
15435 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
15436 are now in src/globals.h.
15437 (syms_of_minibuf): Remove spurious & from previous change.
15438
cd394be1 154392011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
15440
15441 * minibuf.c (completing-read-function): New variable.
15442 (completing-read-default): Rename from completing-read.
15443 (completing-read): Call completing-read-function.
15444
b14e3e21
CY
154452011-03-19 Juanma Barranquero <lekktu@gmail.com>
15446
15447 * xfaces.c (Fx_load_color_file):
15448 Read color file from absolute filename (bug#8250).
15449
f2b726e6
JB
154502011-03-19 Juanma Barranquero <lekktu@gmail.com>
15451
15452 * makefile.w32-in: Update dependencies.
15453
09f6ff02
EZ
154542011-03-17 Eli Zaretskii <eliz@gnu.org>
15455
15456 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
15457
29a6015a
PE
154582011-03-17 Paul Eggert <eggert@cs.ucla.edu>
15459
a3a6c54e
PE
15460 Fix more problems found by GCC 4.5.2's static checks.
15461
b766f867
PE
15462 * process.c (make_serial_process_unwind, send_process_trap):
15463 (sigchld_handler): Now static.
15464
be02381c
PE
15465 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
15466 That way, the code declares only the vars that it needs.
15467 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
15468 * s/cygwin.h (PTY_ITERATION): Likewise.
15469 * s/darwin.h (PTY_ITERATION): Likewise.
15470 * s/gnu-linux.h (PTY_ITERATION): Likewise.
15471
57048744
PE
15472 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
15473 * process.c (allocate_pty): Don't declare stb unless it's needed.
15474
7914961c 15475 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
15476 (CONSTANTLIM): Remove; unused.
15477 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
15478 Define only if needed.
7914961c 15479
b3967b18
PE
15480 * unexelf.c (unexec): Name an expression,
15481 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
15482 Use a different way to cause a compilation error if anyone uses
15483 n rather than nn, a way that does not involve shadowing.
73366a00 15484 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 15485
29a6015a
PE
15486 * deps.mk (unexalpha.o): Remove; unused.
15487
43cfc33e 15488 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 15489 * unexec.h: New file.
ce701a33
PE
15490 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
15491 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
15492 Depend on unexec.h.
15493 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
15494 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
15495 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 15496 Change as necessary to match prototype in unexec.h.
ce701a33 15497
01f44d5a
PE
15498 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
15499 shadowing.
4f63c6bb 15500 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 15501
a6670b0b
PE
15502 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
15503 Rename locals to avoid shadowing.
15504
cef2010d 15505 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 15506 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 15507
d4d7173a
PE
15508 * print.c (Fredirect_debugging_output): Fix pointer signedess.
15509
f08b802a
PE
15510 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
15511 warning when compiling print.c.
15512
3ddb0639
PE
15513 * font.c (font_unparse_fcname): Abort in an "impossible" situation
15514 instead of using an uninitialized var.
5ad03b97 15515 (font_sort_entities): Mark var as initialized.
3ddb0639 15516
170a2692
PE
15517 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
15518
e663c700
PE
15519 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
15520 pointers to constants.
89bc529a 15521 (font_parse_fcname): Remove unused vars.
7b81e2d0 15522 (font_delete_unmatched): Now static.
ea838e10 15523 (font_get_spec): Remove; unused.
13a547c6
PE
15524 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
15525 (font_update_drivers, Ffont_get_glyphs, font_add_log):
15526 Rename or move locals to avoid shadowing.
e663c700 15527
2a80c887 15528 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 15529 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 15530
1384fa33 15531 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 15532 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 15533
8b2c52e9
PE
15534 * alloc.c (mark_backtrace): Move decl from here ...
15535 * lisp.h: ... to here, so that it can be checked.
15536
475545b5 15537 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 15538 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
15539 (lisp_indirect_variable): Name an expression,
15540 to avoid gcc -Wbad-function-cast warning.
1faed8ae 15541 (Fdefvar): Rename locals to avoid shadowing.
475545b5 15542
b1349114 15543 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 15544 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 15545 Use const pointer when appropriate.
b1349114 15546
a2928364
PE
15547 * lisp.h (get_system_name, get_operating_system_release):
15548 Move decls here, to check interfaces.
15549 * process.c (get_operating_system_release): Move decl to lisp.h.
15550 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
15551 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
15552 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
15553 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
15554 (Fformat_time_string, Fencode_time, Finsert_char):
15555 (Ftranslate_region_internal, Fformat):
15556 Rename or remove local vars to avoid shadowing.
9710023e 15557 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 15558
a415e694
PE
15559 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
15560 avoid shadowing.
15561
8ef4622d
PE
15562 * lisp.h (eassert): Check that the argument compiles, even if
15563 ENABLE_CHECKING is not defined.
15564
946f9a5b
PE
15565 * data.c (Findirect_variable): Name an expression, to avoid
15566 gcc -Wbad-function-cast warning.
112396d6 15567 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 15568 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
15569 (Fmake_variable_buffer_local, Fmake_local_variable):
15570 Mark variables as initialized.
52746918 15571 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 15572
e5aab7e7 15573 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
15574 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
15575 Rename locals to avoid shadowing.
dff45157
PE
15576 (mark_stack): Move local variables into the #ifdef region where
15577 they're used.
7bc26fdb
PE
15578 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
15579 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
15580 needed otherwise.
15581 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
15582 (GC_STRING_CHARS): Remove; not used.
d40d4be1 15583 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 15584
e5aab7e7
PE
15585 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
15586 avoids undefined behavior in theory.
15587
4da60324
PE
15588 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
15589
88043301
PE
15590 Use functions, not macros, for up- and down-casing (Bug#8254).
15591 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
15592 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
15593 to use the following functions instead of these macros.
15594 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
15595 EMACS_INT, since callers assume the returned value fits in int.
15596 (upcase1): Likewise, for UPCASE_TABLE.
15597 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 15598 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 15599 the race-condition problem in the old DOWNCASE.
88043301 15600
19ed5445
PE
15601 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
15602 Rename locals to avoid shadowing.
15603 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
15604 (regex_compile, re_search_2, re_match_2_internal):
15605 Remove unused local vars.
952db0d7
PE
15606 (FREE_VAR): Rewrite so as not to use empty "else",
15607 which gcc can warn about.
da053e48 15608 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
15609 (RETALLOC_IF): Define only if needed.
15610 (WORDCHAR_P): Likewise. This one is never needed, but is used
15611 only in a comment talking about a compiler bug, so put inside
15612 the #if 0 of that comment.
15613 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
15614 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
15615 Remove; unused.
19ed5445 15616
1f3561e4 15617 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
15618 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
15619 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 15620
ded6f8f7
PE
15621 * search.c (simple_search): Remove unused var.
15622
dbd37a95
PE
15623 * dired.c (compile_pattern): Move decl from here ...
15624 * lisp.h: ... to here, so that it can be checked.
15625 (struct re_registers): New forward decl.
15626
7e47afad
PE
15627 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
15628
85f24f61
PE
15629 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
15630 All uses changed.
15631 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
15632 Rename locals to avoid shadowing.
5671df8f 15633 (Fvertical_motion): Mark locals as initialized.
85f24f61 15634
181aa2be 15635 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 15636 (casify_region): Mark local as initialized.
181aa2be 15637
930d429c
PE
15638 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
15639
7082eac6
PE
15640 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
15641 New macros, so that the caller can use some names other than
15642 gcpro1, gcpro2, etc.
15643 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
15644 of the new macros.
15645 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
15646 argument, for consistency with GCPRO2_VAR, etc: it is now the
15647 prefix of the variable, not the variable itself. All uses
15648 changed.
38b2c076
PE
15649 * dired.c (directory_files_internal, file_name_completion):
15650 Rename locals to avoid shadowing.
15651
15206ed9
PE
15652 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
15653 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
15654 dired.c's scmp function, had undefined behavior.
15655 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
15656 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
15657 * buffer.h: ... to here, because these macros use current_buffer,
15658 and the new implementation with inline functions needs to have
15659 current_buffer in scope now, rather than later when the macros
15660 are used.
15661 (downcase, upcase1): New static inline functions.
15662 (DOWNCASE, UPCASE1): Reimplement using these functions.
15663 This avoids undefined behavior in expressions like
15664 DOWNCASE (x) == DOWNCASE (y), which previously suffered
15665 from race conditions in accessing the global variables
15666 case_temp1 and case_temp2.
15667 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
15668 * lisp.h (case_temp1, case_temp2): Remove their decls.
15669 * character.h (ASCII_CHAR_P): Move from here ...
15670 * lisp.h: ... to here, so that the inline functions mentioned
15671 above can use them.
15672
4a6bea26
PE
15673 * dired.c (directory_files_internal_unwind): Now static.
15674
f14b7e14
PE
15675 * fileio.c (file_name_as_directory, directory_file_name):
15676 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
15677 Now static.
2893f146
PE
15678 (file_name_as_directory): Use const pointers when appropriate.
15679 (Fexpand_file_name): Likewise. In particular, newdir might
15680 point at constant storage, so make it a const pointer.
fd4ead52 15681 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
15682 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
15683 signedness issues.
f839df0c
PE
15684 (Fset_file_times, Finsert_file_contents, auto_save_error):
15685 Rename locals to avoid shadowing.
f14b7e14 15686
5716756e 15687 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
15688 (Ftry_completion, Fall_completions): Rename or remove locals
15689 to avoid shadowing.
5716756e 15690
b4c3046a
PE
15691 * marker.c (bytepos_to_charpos): Remove; unused.
15692
b45db522
PE
15693 * lisp.h (verify_bytepos, count_markers): New decls,
15694 so that gcc does not warn that these functions aren't declared.
15695
85876d07
PE
15696 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
15697 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 15698 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 15699 (copy_text): Remove unused local var.
85876d07 15700
03d78a21 15701 * filelock.c (within_one_second): Now static.
b3dd38ab 15702 (lock_file_1): Rename local to avoid shadowing.
03d78a21 15703
5df8f01b
PE
15704 * buffer.c (fix_overlays_before): Mark locals as initialized.
15705 (fix_start_end_in_overlays): Likewise. This function should be
15706 simplified by using pointers-to-pointers, but that's a different
15707 matter.
b1d876f1 15708 (switch_to_buffer_1): Now static.
8f54f30a
PE
15709 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
15710 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 15711
a70072c9 15712 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 15713 Fix pointer signedness issue.
edced198
PE
15714 (sys_subshell): Mark local as volatile if checking for lint,
15715 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 15716 (MAXPATHLEN): Define only if needed.
a70072c9 15717
a0977c44
PE
15718 * process.c (serial_open, serial_configure): Move decls from here ...
15719 * systty.h: ... to here, so that they can be checked.
15720
a884fdcc
PE
15721 * fns.c (get_random, seed_random): Move extern decls from here ...
15722 * lisp.h: ... to here, so that they can be checked.
15723
604efe86 15724 * sysdep.c (reset_io): Now static.
b8950c94 15725 (wait_for_termination_signal): Remove; unused.
604efe86 15726
38fc62d9
PE
15727 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
15728 (copy_keymap_item, append_key, push_text_char_description):
15729 Now static.
1004a21a 15730 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 15731 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
15732 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
15733 (describe_map_tree):
15734 Rename locals to avoid shadowing.
38fc62d9 15735
2f2650da
PE
15736 * keyboard.c: Declare functions static if they are not used elsewhere.
15737 (echo_char, echo_dash, cmd_error, top_level_2):
15738 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
15739 (read_char, kbd_buffer_get_event, make_lispy_position):
15740 (make_lispy_event, make_lispy_movement, apply_modifiers):
15741 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
15742 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
15743 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 15744 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 15745 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 15746
a053e86c 15747 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
15748 (mark_kboards): Move decl here ...
15749 * alloc.c (mark_kboards): ... from here.
a053e86c 15750
4752793e
PE
15751 * lisp.h (force_auto_save_soon): New decl.
15752
74f10ca7 15753 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
15754 (DEFINE_DUMMY_FUNCTION): New macro.
15755 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
15756 Use it.
c03cd23f
PE
15757 (main): Add casts to avoid warnings
15758 if GCC considers string literals to be constants.
74f10ca7 15759
022e70d4
PE
15760 * lisp.h (fatal_error_signal): Add decl, since it's exported.
15761
59d6fe83
PE
15762 * dbusbind.c: Pointer signedness fixes.
15763 (xd_signature, xd_append_arg, xd_initialize):
15764 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15765 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15766 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
15767 (Fdbus_register_signal): Use SSDATA when the context wants char *.
15768
78320123
PE
15769 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
15770 if GCC considers string literals to be constants.
49cebcca 15771 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 15772
35ac2a97
SM
157732011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
15774
fb103ca9
SM
15775 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
15776 (print_preprocess, print_object): New macro to fix last change.
15777
35ac2a97
SM
15778 * print.c (print_preprocess): Don't forget font objects.
15779
62973b41
JB
157802011-03-16 Juanma Barranquero <lekktu@gmail.com>
15781
15782 * emacs.c (USAGE3): Doc fixes.
15783
0e48bb22
AS
157842011-03-15 Andreas Schwab <schwab@linux-m68k.org>
15785
15786 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
15787 structure.
15788
7684e57b
JB
157892011-03-14 Juanma Barranquero <lekktu@gmail.com>
15790
15791 * lisp.h (VWindow_system, Qfile_name_history):
15792 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
15793 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
15794 (w32_system_caret_x, w32_system_caret_y): Declare extern.
15795
15796 * w32select.c: Don't #include "keyboard.h".
c96bbc66 15797 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
15798
15799 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
15800 * w32console.c (detect_input_pending, read_input_pending)
15801 (encode_terminal_code):
15802 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
15803 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
15804 (w32_system_caret_y, Qfile_name_history):
15805 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
15806 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
15807 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
15808 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
15809 * w32proc.c (Qlocal, report_file_error):
15810 * w32term.c (Vwindow_system, updating_frame):
15811 * w32uniscribe.c (initialized, uniscribe_font_driver):
15812 Remove unneeded extern declarations.
15813
2aa46d6c
CY
158142011-03-14 Chong Yidong <cyd@stupidchicken.com>
15815
c96bbc66 15816 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 15817
cffc6f3b
CY
158182011-03-13 Chong Yidong <cyd@stupidchicken.com>
15819
15820 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
15821 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
15822 These macros can no longer be used for assignment.
15823
44f230aa
SM
15824 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
15825 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
15826 (record_buffer_markers, fetch_buffer_markers): New functions for
15827 recording and fetching special buffer markers.
15828 (set_buffer_internal_1, set_buffer_temp): Use them.
15829
15830 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
15831
15832 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
15833
15834 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
15835 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
15836
15837 * xdisp.c (hscroll_window_tree):
15838 (reconsider_clip_changes): Use PT instead of BUF_PT.
15839
d251f04b
EZ
158402011-03-13 Eli Zaretskii <eliz@gnu.org>
15841
15842 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
15843 $(EMACS_ROOT)/lib/intprops.h.
15844
f0c77cd1
PE
158452011-03-13 Paul Eggert <eggert@cs.ucla.edu>
15846
3eca4629
PE
15847 Fix more problems found by GCC 4.5.2's static checks.
15848
7c86ee98
PE
15849 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
15850 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
15851 (xg_free_frame_widgets): Make it clear that a local variable is
15852 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
15853 (gdk_window_get_screen): Make it clear that this macro is needed
15854 only if USE_GTK_TOOLTIP.
1e5524e7
PE
15855 (int_gtk_range_get_value): New function, which avoids a diagnostic
15856 from gcc -Wbad-function-cast.
15857 (xg_set_toolkit_scroll_bar_thumb): Use it.
15858 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
15859 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
15860 (get_utf8_string, xg_get_file_with_chooser):
15861 Rename locals to avoid shadowing.
15862 (create_dialog): Move locals to avoid shadowing.
7c86ee98 15863
41729b81
PE
15864 * xgselect.c (xg_select): Remove unused var.
15865
f0c77cd1
PE
15866 * image.c (four_corners_best): Mark locals as initialized.
15867 (gif_load): Initialize transparent_p to zero (Bug#8238).
15868 Mark another local as initialized.
ec6cf4c6 15869 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 15870
ce0ad53d 15871 * image.c (clear_image_cache): Now static.
d5d5a617 15872 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 15873 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
15874 (x_edge_detection): Remove unnecessary cast that
15875 gcc -Wbad-function-cast diagnoses.
2037898d 15876 (gif_load): Fix pointer signedness.
6ae141d6
PE
15877 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
15878 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 15879
33383987 158802011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 15881
d32df629
PE
15882 Improve quality of tests for time stamp overflow.
15883 For example, without this patch (encode-time 0 0 0 1 1
15884 1152921504606846976) returns the obviously-bogus value (-948597
15885 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
15886 reports time overflow. See
15887 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
15888 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
15889 * editfns.c: Include limits.h and intprops.h.
15890 (TIME_T_MIN, TIME_T_MAX): New macros.
15891 (time_overflow): Move earlier, to before first use.
15892 (hi_time, lo_time): New functions, for an accurate test for
15893 out-of-range times.
15894 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
15895 (Fget_internal_run_time): Don't assume time_t fits in int.
15896 (make_time): Use list2 instead of Fcons twice.
15897 (Fdecode_time): More accurate test for out-of-range times.
15898 (check_tm_member): New function.
15899 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
15900 (lisp_time_argument): Don't rely on undefined left-shift and
15901 right-shift behavior when checking for time stamp overflow.
8be6f318 15902
fe31d94c
PE
15903 * editfns.c (time_overflow): New function, refactoring common code.
15904 (Fformat_time_string, Fdecode_time, Fencode_time):
15905 (Fcurrent_time_string): Use it.
15906
8be6f318
PE
15907 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
15908 * dired.c (make_time): Move to ...
15909 * editfns.c (make_time): ... here.
15910 * systime.h: Note the move.
15911
09d9db2c 159122011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 15913
126bc0dc
YM
15914 * fringe.c (update_window_fringes): Remove unused variables.
15915
c47cbdfd
YM
15916 * unexmacosx.c (copy_data_segment): Also copy __got section.
15917 (Bug#8223)
15918
7ac80be9
EZ
159192011-03-12 Eli Zaretskii <eliz@gnu.org>
15920
c96bbc66 15921 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
15922 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
15923 Constify `char *' arguments and their references according to
15924 prototypes in tparam.h.
15925
ecb0f94d 15926 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 15927
7ac80be9
EZ
15928 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
15929 Adapt all references accordingly.
15930
15931 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
15932
ef1fd07e
TT
159332011-03-11 Tom Tromey <tromey@redhat.com>
15934
15935 * buffer.c (syms_of_buffer): Remove obsolete comment.
15936
7ef4b50c
EZ
159372011-03-11 Eli Zaretskii <eliz@gnu.org>
15938
15939 * termhooks.h (encode_terminal_code): Declare prototype.
15940
15941 * msdos.c (encode_terminal_code): Don't declare prototype.
15942
15943 * term.c (encode_terminal_code): Now external again, used by
15944 w32console.c and msdos.c.
15945
44f230aa
SM
15946 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
15947 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 15948
4b1ec863 159492011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 15950
1714f52b 15951 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 15952
4b1ec863
PE
15953 * fringe.c (update_window_fringes): Mark locals as initialized
15954 (Bug#8227).
15955 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 15956
524c7aa6
PE
15957 * alloc.c (mark_fringe_data): Move decl from here ...
15958 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
15959 to check its interface.
15960 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
15961
a5c0af81 15962 * fontset.c (free_realized_fontset): Now static.
7519b8cd 15963 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 15964 (fontset_font): Mark local as initialized.
a9a06e0b 15965 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 15966
b4716021
PE
15967 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
15968
811e9bac 15969 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 15970 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
15971 (x_own_selection, Fx_disown_selection_internal): Rename locals
15972 to avoid shadowing.
15973 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 15974
7e3ab302
PE
15975 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
15976 so that the caller can use some name other than gcpro1.
15977 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
15978 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
15979 (Fx_backspace_delete_keys_p):
15980 Use them to avoid shadowing, and rename vars to avoid shadowing.
15981 (x_decode_color, x_set_name, x_window): Now static.
6b437900 15982 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 15983 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
15984 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
15985 Remove unused locals.
7e3ab302
PE
15986 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
15987 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
15988 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
15989 macros.
f78faa98 15990
e2b13473
PE
15991 * xterm.h (x_mouse_leave): New decl.
15992
77f23912
PE
15993 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
15994 Remove unused functions.
cdf4ba58
PE
15995 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
15996 (x_calc_absolute_position): Now static.
7411c686 15997 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 15998 Don't declare local "event" unless it's used.
ed7bf3a5
PE
15999 (x_iconify_frame, x_free_frame_resources): Don't declare locals
16000 unless they are used.
38d0b34a
PE
16001 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
16002 (x_fatal_error_signal): Remove; not used.
a6067996
PE
16003 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
16004 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
16005 (x_error_catcher, x_connection_closed, x_error_handler):
16006 (x_error_quitter, xembed_send_message, x_iconify_frame):
16007 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 16008 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 16009 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 16010
44f230aa
SM
16011 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
16012 Rename or move locals to avoid shadowing.
6b463e58 16013 (tty_defined_color, merge_face_heights): Now static.
5967d051 16014 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
16015 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
16016 does not deduce is never used uninitialized.
73719eba
PE
16017 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
16018 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 16019
426994c3 16020 * terminal.c (store_terminal_param): Now static.
5489860b 16021
032f1620 16022 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 16023 (set_frame_menubar): Remove unused local.
d4323972 16024 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
16025 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
16026 since they might point to immutable storage.
281585b0
PE
16027 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
16028 since it's unused otherwise.
032f1620 16029
367c19e5 16030 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 16031 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
16032 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
16033 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 16034 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
16035 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
16036 does not deduce are never used uninitialized.
70739cbe 16037
07b48fa9
PE
16038 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
16039
8868a238 16040 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
16041 * window.c (window_loop, size_window):
16042 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 16043
7e5cf297 16044 * window.c (display_buffer): Now static.
d6550a9f
PE
16045 (size_window): Mark variables that gcc -Wuninitialized
16046 does not deduce are never used uninitialized.
a586633d
PE
16047 * window.h (check_all_windows): New decl, to forestall
16048 gcc -Wmissing-prototypes diagnostic.
5b555da1 16049 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 16050
f6095868
PE
16051 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
16052 shadowing.
16053 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
16054 Include <limits.h>.
16055 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
16056 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
16057 (load_charset_map): Mark variables that gcc -Wuninitialized
16058 does not deduce are never used uninitialized.
53df7c11 16059 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 16060
f38b440c
PE
16061 * coding.c (coding_set_source, coding_set_destination):
16062 Use "else { /* comment */ }" rather than "else /* comment */;"
16063 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
16064 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
16065 a block, when the outer 'i' will do.
16066 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
16067 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
16068 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
16069 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
16070 (Fdecode_sjis_char, Fdefine_coding_system_internal):
16071 Rename locals to avoid shadowing.
16072 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
16073 * coding.c (emacs_mule_char, encode_invocation_designation):
16074 Now static, since they're not used elsewhere.
413bb2db 16075 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 16076 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
16077 (decode_coding_emacs_mule): Mark variables that gcc
16078 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
16079 (detect_coding_iso_2022): Initialize a local variable that might
16080 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 16081 this initialization is needed. (Bug#8211)
5f58e762
PE
16082 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
16083 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
16084 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
16085 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
16086 Remove unused macros.
f38b440c 16087
232b38b9 16088 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 16089 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 16090 * character.c (string_count_byte8): Likewise.
232b38b9 16091
fb90da1b
PE
16092 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
16093 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
16094
fb93dbc2
PE
16095 * chartab.c (copy_sub_char_table): Now static, since it's not used
16096 elsewhere.
5c156ace
PE
16097 (sub_char_table_ref_and_range, char_table_ref_and_range):
16098 Rename locals to avoid shadowing.
bbcd0949 16099 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 16100
7d3b3862 16101 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 16102 (BIDI_BOB): Remove unused macro.
7d3b3862 16103
6be7d3da
PE
16104 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
16105 deduce are never used uninitialized.
c2ed9c8b 16106 * term.c (encode_terminal_code): Likewise.
6be7d3da 16107
75f8807f 16108 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 16109
50938595
PE
16110 * tparam.h: New file.
16111 * term.c, tparam.h: Include it.
16112 * deps.mk (term.o, tparam.o): Depend on tparam.h.
16113 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
16114 Move these decls to tparam.h, and make them agree with what
16115 is actually in tparam.c. The previous trick of using incompatible
16116 decls in different modules does not conform to the C standard.
16117 All callers of tparam changed to use tparam's actual API.
16118 * tparam.c (tparam1, tparam, tgoto):
16119 Use const pointers where appropriate.
16120
fbceeba2
PE
16121 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
16122 * cm.h (struct cm): Likewise.
16123 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
16124 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
16125 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
16126 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
16127 (turn_on_face, init_tty): Likewise.
16128 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 16129
7f3f1250
PE
16130 * term.c (term_mouse_position): Rename local to avoid shadowing.
16131
e6ca6543
PE
16132 * alloc.c (mark_ttys): Move decl from here ...
16133 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
16134
c40f8d15
AS
161352011-03-11 Andreas Schwab <schwab@linux-m68k.org>
16136
16137 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
16138
cfe0661d
JB
161392011-03-09 Juanma Barranquero <lekktu@gmail.com>
16140
16141 * search.c (compile_pattern_1): Remove argument regp, unused since
16142 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
16143 (compile_pattern): Don't pass it.
16144
0afb4571
J
161452011-03-08 Jan Djärv <jan.h.d@swipnet.se>
16146
16147 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
16148 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
16149 for ! HAVE_GTK3.
16150 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
16151
16152 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
16153
16154 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
16155 gdk_window_get_screen, gdk_window_get_geometry,
16156 gdk_x11_window_lookup_for_display and GDK_KEY_g.
16157 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
16158 (xg_get_pixbuf_from_pixmap): New function.
16159 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
16160 to Pixmap, take frame as parameter, remove GdkColormap parameter.
16161 Call xg_get_pixbuf_from_pixmap instead of
16162 gdk_pixbuf_get_from_drawable.
16163 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
16164 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
16165 (xg_check_special_colors): Use GtkStyleContext and its functions
16166 for HAVE_GTK3.
16167 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
16168 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
16169 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
16170 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
16171 Call gtk_widget_get_preferred_size.
0afb4571
J
16172 (xg_frame_resized): gdk_window_get_geometry only takes 5
16173 parameters.
44f230aa
SM
16174 (xg_win_to_widget, xg_event_is_for_menubar):
16175 Call gdk_x11_window_lookup_for_display.
0afb4571
J
16176 (xg_set_widget_bg): New function.
16177 (delete_cb): New function.
895009e1 16178 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 16179 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
16180 (xg_set_background_color): Call xg_set_widget_bg.
16181 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
16182 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
16183 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
16184 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
16185 if ! HAVE_GTK3.
16186 (update_frame_tool_bar): Call gtk_widget_hide.
16187 (xg_initialize): Use GDK_KEY_g.
16188
16189 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
16190 if ! HAVE_GTK3
16191 (x_session_initialize): Call gdk_x11_set_sm_client_id.
16192
16193 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
16194 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
16195 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
16196
1c2cc4ef
JB
161972011-03-08 Juanma Barranquero <lekktu@gmail.com>
16198
16199 * w32xfns.c (select_palette): Check success of RealizePalette against
16200 GDI_ERROR, not zero.
16201
33383987 16202See ChangeLog.11 for earlier changes.
aac0c6e3
MR
16203
16204;; Local Variables:
16205;; coding: utf-8
aac0c6e3
MR
16206;; End:
16207
2f097256 16208 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
16209
16210 This file is part of GNU Emacs.
16211
16212 GNU Emacs is free software: you can redistribute it and/or modify
16213 it under the terms of the GNU General Public License as published by
16214 the Free Software Foundation, either version 3 of the License, or
16215 (at your option) any later version.
16216
16217 GNU Emacs is distributed in the hope that it will be useful,
16218 but WITHOUT ANY WARRANTY; without even the implied warranty of
16219 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16220 GNU General Public License for more details.
16221
16222 You should have received a copy of the GNU General Public License
16223 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.