Explicitly mark buffer_defaults and buffer_local_symbols.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
c752cfa9
DA
12012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2
3 Explicitly mark buffer_defaults and buffer_local_symbols.
4 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
5 mark_local_symbols here.
6 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
7 since special buffers aren't marked here any more.
8 (allocate_buffer): Chain new buffer with all_buffers here...
9 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
10 not here.
11 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
12 (syms_of_buffer): Remove staticpro of the above.
13 (init_buffer_once): Set names for buffer_defaults and
14 buffer_local_symbols.
15
a864ef14
PE
162012-09-06 Paul Eggert <eggert@cs.ucla.edu>
17
18 Use bool for booleans in font-related modules.
19 * font.c (font_intern_prop, font_style_to_value)
20 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
21 (generate_otf_features, font_check_otf_features, font_check_otf)
22 (font_match_p, font_list_entities, font_at):
23 * fontset.c (fontset_id_valid_p, reorder_font_vector
24 (fontset_find_font, Fset_fontset_font)
25 (face_suitable_for_char_p) [0]:
26 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
27 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
28 (m17n_flt_initialized, ftfont_shape_by_flt):
29 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
30 * nsfont.m (nsfont_draw):
31 * w32font.c (w32font_draw):
32 * w32term.c (x_draw_glyphless_glyph_string_foreground):
33 Use bool for booleans.
34 * font.h: Adjust to above API changes.
35 (struct font, struct font_driver, struct font_driver_list):
36 Use bool for booleans.
37 (struct font): Remove useless member encoding_type.
38 All users removed.
39 * fontset.c, xftfont.c: Omit unnecessary static decls.
40
0699fc18
DA
412012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
42
43 * alloc.c (mark_object): Revert window marking code
44 since it's unsafe for the Fset_window_configuration.
45
20ef56db
PE
462012-09-05 Paul Eggert <eggert@cs.ucla.edu>
47
48 Fix race conditions with signal handlers and errno.
49 Be more systematic about preserving errno whenever a signal
50 handler returns, even if it's not in the main thread. Do this by
51 renaming signal handlers to distinguish between signal delivery
52 and signal handling. All uses changed.
53 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
54 * data.c (deliver_arith_signal): Rename from arith_error.
55 * dispnew.c (deliver_window_change_signal): Rename from
56 window_change_signal.
57 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
58 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
59 * keyboard.c (deliver_input_available_signal): Rename from
60 input_available_signal.
61 (deliver_user_signal): Rename from handle_user_signal.
62 (deliver_interrupt_signal): Rename from interrupt_signal.
63 * process.c (deliver_pipe_signal): Rename from send_process_trap.
64 (deliver_child_signal): Rename from sigchld_handler.
65 * atimer.c (handle_alarm_signal):
66 * data.c (handle_arith_signal):
67 * dispnew.c (handle_window_change_signal):
68 * emacs.c (handle_fatal_signal, handle_danger_signal):
69 * keyboard.c (handle_input_available_signal):
70 * keyboard.c (handle_user_signal, handle_interrupt_signal):
71 * process.c (handle_pipe_signal, handle_child_signal):
72 New functions, with the actual signal-handling code taken from the
73 original respective signal handlers, sans the sporadic attempts to
74 preserve errno, since that's now done by handle_on_main_thread.
75 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
76 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
77 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
78 Move to sysdep.c.
79 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
80 Move initialization of main_thread to sysdep.c's init_signals.
81 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
82 our usage, and simplifies the mainline code.
83 (record_child_status_change): New static function, as a helper
84 for handle_child_signal, and with most of the old child handler's
85 contents.
86 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
87 (handle_child_signal): Use the above.
88 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
89 Moved here from emacs.c.
90 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
91 code moved here from emacs.c's main function.
92 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
93 replacing the old SIGNAL_THREAD_CHECK. All uses changed. This
94 lets callers save and restore errno properly.
95
e3ccf108
DA
962012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
97
98 Remove redundant or unused things here and there.
99 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
100 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
101 * editfns.c (Fcompare_buffer_substrings): Likewise.
102 * frame.h (struct terminal, struct font_driver_list):
103 Remove redundant declarations.
104 * window.h (Qleft, Qright): Likewise.
105
697e1e39
DA
1062012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
107
108 Do not mark objects from deleted buffers, windows and frames.
109 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
110 (mark_object): Likewise for windows and frames.
111
c1ca42ca
DA
1122012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
113
114 * alloc.c (valid_lisp_object_p): Treat killed buffers,
115 buffer_defaults and buffer_local_symbols as valid objects.
116 Return special value to denote them.
117
014d93be
PE
1182012-09-05 Paul Eggert <eggert@cs.ucla.edu>
119
f75d7a91
PE
120 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
121 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
122 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
123 (file_name_absolute_p, Fsubstitute_in_file_name):
124 (check_executable, check_writable, Ffile_accessible_directory_p)
125 (Fset_file_selinux_context, Fdefault_file_modes)
126 (Finsert_file_contents, choose_write_coding_system)
127 (Fwrite_region, build_annotations, a_write, e_write)
128 (Fdo_auto_save):
129 * filelock.c (boot_time_initialized, get_boot_time)
130 (get_boot_time_1, lock_file_1, within_one_second):
131 * floatfns.c (in_float):
132 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
133 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
134 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
135 * lisp.h (struct Lisp_Hash_Table.cmpfn):
136 * window.c (compare_window_configurations):
137 Use bool for booleans.
138 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
139 (Fdefault_file_modes): Now mode_t, not int, for modes.
140 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
141 (internal_delete_file): Now returns void, not a (boolean) int,
142 since nobody was looking at the return value.
143 * lisp.h, window.h: Adjust to above API changes.
144
014d93be
PE
145 * xdisp.c (set_message): Simplify and reindent last change.
146
776f29e1
JB
1472012-09-05 Juanma Barranquero <lekktu@gmail.com>
148
149 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
150
7f7e0167
LI
1512012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
152
153 * eval.c (call_debugger): Make the function non-static so that we
154 can call it from set_message.
155
156 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
157 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
158
cf29dd84
PE
1592012-09-04 Paul Eggert <eggert@cs.ucla.edu>
160
161 Give more-useful info on a fatal error (Bug#12328).
162 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
163 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
164 of doing the work ourselves.
165 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
166 do most of the work.
167 (fatal_error_backtrace): New function, taken from the guts
168 of the old fatal_error_signal, but with a new option to output
169 a backtrace.
170 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
171 info about the signal than just its number.
172 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
173 * sysdep.c: Include <execinfo.h>
174 (emacs_backtrace): New function, taken partly from the previous
175 code of the 'die' function.
176 (emacs_abort): Call fatal_error_backtrace rather than abort.
177
972debf2
SM
1782012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
179
180 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
181 eager (load-time) macro-expansion.
182 * lisp.mk (lisp): Add macroexp.
183
1088b922
PE
1842012-09-04 Paul Eggert <eggert@cs.ucla.edu>
185
186 Simplify redefinition of 'abort' (Bug#12316).
187 Do not try to redefine the 'abort' function. Instead, redo
188 the code so that it calls 'emacs_abort' rather than 'abort'.
189 This removes the need for the NO_ABORT configure-time macro
190 and makes it easier to change the abort code to do a backtrace.
191 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
192 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
193 Remove; sysdep.c's emacs_abort now takes its place.
194 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
195 'abort' changed to use 'emacs_abort'.
196 * msdos.c (dos_abort) [defined abort]: Remove; not used.
197 (abort) [!defined abort]: Rename to ...
198 (emacs_abort): ... new name.
199 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
200 the place of the old 'abort' in emacs.c.
201 * w32.c, w32fns.c (abort): Do not #undef.
202 * w32.c (emacs_abort): Rename from w32_abort.
203
30934d33
EZ
2042012-09-04 Eli Zaretskii <eliz@gnu.org>
205
206 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
207 offsets[j].dv, since the y axis of the screen coordinates points
208 down, while the y axis of the font definition coordinates points
209 up. This fixes display of Arabic diacritics such as KASRA and
210 KASRATAN. (Bug#11860)
211
af26b72c
PE
2122012-09-04 Paul Eggert <eggert@cs.ucla.edu>
213
214 Be more systematic about _setjmp vs setjmp.
215 * alloc.c (test_setjmp, mark_stack):
216 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
217 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
218 (png_load, my_error_exit, jpeg_load):
219 * process.c (send_process_trap, send_process):
220 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
221 The underscored versions are up to 30x faster on some hosts.
222 Formerly, the code used setjmp+longjmp sometimes and
223 _setjmp+_longjmp at other times, with no particular reason to
224 prefer setjmp+longjmp.
225
26d4541d
PE
2262012-09-03 Paul Eggert <eggert@cs.ucla.edu>
227
d42f4f0f 228 Fix minor problem found by static checking.
26d4541d 229 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 230
c5e28e39
MR
2312012-09-03 Martin Rudalics <rudalics@gmx.at>
232
233 * buffer.c (Fdelete_all_overlays): New function.
234
3eab3ca9
CY
2352012-09-03 Chong Yidong <cyd@gnu.org>
236
237 * gtkutil.c: Add extern decl for Qxft.
238
c04889f8
PE
2392012-09-02 Paul Eggert <eggert@cs.ucla.edu>
240
1882aa38
PE
241 * emacs.c, eval.c: Use bool for boolean.
242 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
243 (malloc_using_checking) [DOUG_LEA_MALLOC]:
244 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
245 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
246 (main, decode_env_path, Fdaemon_initialized):
247 * eval.c (call_debugger, Finteractive_p, interactive_p):
248 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
249 (maybe_call_debugger, Fbacktrace):
250 * process.c (read_process_output, exec_sentinel):
251 Use bool for booleans.
252 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
253 All callers changed.
254 * eval.c (interactive_p): Omit always-true boolean argument
255 EXCLUDE_SUBRS_P. All callers changed.
256 * dispextern.h, lisp.h: Reflect above API changes.
257 * firstfile.c (dummy): Use the address of 'main', whose signature
258 won't change, instead of the address of 'initialize', whose
259 signature just changed from int to bool.
260 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
261 * msdos.c (fatal_error_in_progress): ... from here.
262 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
263 of incrementing it.
264 (redisplay_internal, unwind_redisplay): Simply clear
265 REDISPLAYING_P when unwinding, instead of saving its previous,
266 always-false value and then restoring it.
267
a411ac43
PE
268 Clean up some extern decls.
269 Mostly, this hoists extern decls out of .c files and into .h files.
270 That way, we're more likely to catch errors if the interfaces change.
271 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
272 declare xg_mark_data.
273 * dispextern.h (x_frame_parm_handlers):
274 * font.h (Qxft):
275 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
276 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
277 (Qultra_bold, Qoblique, Qitalic):
278 Move extern decl here from .c file.
279 * alloc.c (xg_mark_data) [USE_GTK]:
280 * doc.c (Qclosure):
281 * eval.c (Qlexical_binding):
282 * fns.c (time) [!HAVE_UNISTD_H]:
283 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
284 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
285 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
286 * lread.c (Qinternal_interpreter_environment):
287 * minibuf.c (Qbuffer):
288 * process.c (QCfamily, QCfilter):
289 * widget.c (free_frame_faces):
290 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
291 * xfont.c (x_clear_errors):
292 * xterm.c (x_frame_parm_handlers):
293 Remove now-redundant extern decls.
294 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
295 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
296 Now static.
297 * xfaces.c: Remove unnecessary static decls.
298 * xterm.c (updating_frame): Remove decl of nonexistent object.
299
c04889f8
PE
300 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
301 when building globals.h, as the objects that are not built on
302 this host are not needed to compile C files on this host.
303
8b339673
JD
3042012-09-02 Jan Djärv <jan.h.d@swipnet.se>
305
306 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
307
308 * frame.h: Add missing prototype for x_wm_set_size_hint.
309
a08d4ba7
PE
3102012-09-02 Paul Eggert <eggert@cs.ucla.edu>
311
312 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
313 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
314 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
315 (Fsubstitute_command_keys):
316 * editfns.c (region_limit, find_field, Fconstrain_to_field)
317 (save_excursion_save, save_excursion_restore)
318 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
319 (format_time_string, general_insert_function)
320 (make_buffer_string, make_buffer_string_both)
321 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
322 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
323 (copy_text, insert_1, insert_1_both, insert_from_string)
324 (insert_from_string_before_markers, insert_from_string_1)
325 (insert_from_buffer, insert_from_buffer_1, replace_range)
326 (replace_range_2, del_range_1, del_range_byte, del_range_both)
327 (del_range_2, modify_region):
328 * intervals.c (intervals_equal, balance_possible_root_interval)
329 (adjust_intervals_for_insertion, merge_properties_sticky)
330 (graft_intervals_into_buffer, lookup_char_property)
331 (adjust_for_invis_intang, set_point_both)
332 (get_property_and_range, compare_string_intervals)
333 (set_intervals_multibyte_1, set_intervals_multibyte):
334 * keyboard.c (decode_timer):
335 Use bool for boolean.
336 * intervals.h, lisp.h, systime.h: Reflect above API changes.
337 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
338
48c948de
CY
3392012-09-02 Chong Yidong <cyd@gnu.org>
340
341 * keymap.c (push_key_description): Print M-TAB as C-M-i
342 (Bug#11758).
343
6c49a40b
JB
3442012-09-02 Juanma Barranquero <lekktu@gmail.com>
345
346 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
347 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
348 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
349 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
350 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
351 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
352 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
353
4dfbd238
EZ
3542012-09-01 Eli Zaretskii <eliz@gnu.org>
355
7e510e28
EZ
356 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
357 more than one grapheme cluster passed to the shaper: compute the
358 offset adjustment values separately for each cluster. (Bug#11860)
359
4dfbd238
EZ
360 * image.c: Restore mistakenly removed inclusion of w32.h. Without
361 it, GCC doesn't see prototypes of w32_delayed_load, and complains
362 about implicit conversions from integer to pointer.
363
86571ae0
DC
3642012-09-01 Daniel Colascione <dancol@dancol.org>
365
366 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
367 system used too early.
368
0e23ef9d
PE
3692012-09-01 Paul Eggert <eggert@cs.ucla.edu>
370
371 Better seed support for (random).
372 * emacs.c (main): Call init_random.
373 * fns.c (Frandom): Set the seed from a string argument, if given.
374 Remove long-obsolete Gentzel cruft.
375 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
376 (init_random): New function.
377
17a2cbbd
DC
3782012-09-01 Daniel Colascione <dancol@dancol.org>
379
380 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
381 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
382 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
383 x_wm_set_size_hint, x_query_colors, x_real_positions,
384 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
385 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
386 all of which have been moved to common code.
387
388 * xfaces.c: Include TERM_HEADER instead of listing all possible
389 window-system headers.
390
391 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
392 to match header.
393
394 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
395 directly accessing frame internals.
396
f18cbb28 397 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
398 globals_of_w32font.
399
400 * process.c: Include TERM_HEADER instead of listing all possible
401 window-system headers.
402
403 * nsterm.h: Remove declarations now in frame.h. Define
404 FRAME_X_SCREEN, FRAME_X_VISUAL.
405
406 * menu.c: Include TERM_HEADER instead of listing all possible
407 window-system headers.
408
409 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
410 window system.
411
412 * keyboard.c: Include TERM_HEADER instead of listing all possible
413 window-system headers.
414
415 * image.c: Include TERM_HEADER instead of listing all possible
416 window-system headers. Declare Vlibrary_cache when compiling for
417 Windows.
418
419 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
420 window system declarations.
421
422 * frame.h: Move common functions here: set_frame_menubar,
423 x_set_window_size, x_sync, x_get_focus_frame,
424 x_set_mouse_position, x_set_mouse_pixel_position,
425 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
426 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
427 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
428 x_activate_menubar, x_real_positions, x_bitmap_icon,
429 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
430 and x_query_colors.
431
432 * frame.c: Include TERM_HEADER instead of listing all possible
433 window-system headers.
434
435 * font.c: Include TERM_HEADER instead of listing all possible
436 window-system headers.
437
438 * emacs.c: Include TERM_HEADER.
439
f18cbb28
EZ
440 * dispnew.c: Include TERM_HEADER instead of listing all possible
441 window-system headers.
17a2cbbd 442
f18cbb28 443 * ccl.h: Include character.h.
17a2cbbd
DC
444
445 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
446 the current window system; include in list of objects to link into
447 Emacs.
448
c650a5de
DA
4492012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
450
451 Remove mark_ttys function and fix tty_display_info initialization.
452 * lisp.h (mark_ttys): Remove prototype.
453 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
454 to mark_ttys because all possible values of 'top_frame' slot are
455 the frames which are reachable from Vframe_list.
456 * term.c (mark_ttys): Remove.
457 (init_tty): Safely initialize 'top_frame' slot with Qnil.
458
4e0f6479
DA
4592012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
460
461 Change struct frame bitfields from unsigned char to unsigned.
462 * frame.h (struct frame): Change type of 'display_preempted',
463 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
464 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
465 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
466 bitfields from unsigned char to unsigned.
467
8b96a52c
DA
4682012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
469
470 Remove unused member of struct x_output and struct w32_output.
471 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
472 * w32term.h (struct w32_output): Likewise.
473
b4444c8a
JD
4742012-08-30 Jan Djärv <jan.h.d@swipnet.se>
475
476 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
477 does not become zero (Bug#12234).
478
b98521db
PE
4792012-08-30 Paul Eggert <eggert@cs.ucla.edu>
480
481 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
482 for GCC 4.7.1 x86-64.
483
31d02438
GM
4842012-08-30 Glenn Morris <rgm@gnu.org>
485
486 * lread.c (init_lread): For out-of-tree builds, only add the
487 source directory's site-lisp dir to the load-path if it exists,
488 consistent with in-tree builds. (Bug#12302)
489
7f8941d8
JD
4902012-08-28 Jan Djärv <jan.h.d@swipnet.se>
491
492 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
493 button_values to NULL. Call setStykeMask so dialogs get a close button.
494 (windowShouldClose:): Set window_closed.
495 (dealloc): New member, free button_values.
496 (process_dialog:): Make member function. Remove window argument,
497 replace window with self. Count buttons and allocate and store values
498 in button_values.
499 (addButton:value:row:): value is int with the name tag. Call setTag
500 with tag. Remove return self, declare return value as void.
501 (addString:row:): Remove return self, declare return value as void.
502 (addSplit): Remove return self, declare return value as void.
503 (clicked:): Remove return self, declare return value as void.
504 Set dialog_return to button_values[seltag]. Code formatting change.
505 (initFromContents:isQuestion:): Adjust call to process_dialog.
506 Code formatting change.
507 (timeout_handler:): Set timer_fired to YES.
508 (runDialogAt:): Set timer_fired to NO.
509 Handle click on close button as quit.
510
511 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
512 Add window_closed and button_values. Add void as return value for
513 add(Button|String|Split). addButton takes int instead of Lisp_Object.
514 Add process_dialog as new member.
515
eada0861 5162012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 517
eada0861
GM
518 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
519 is not one of the heaps we manage. (Bug#12242)
520
5212012-08-28 Glenn Morris <rgm@gnu.org>
522
523 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
524
457294dd
MR
5252012-08-28 Martin Rudalics <rudalics@gmx.at>
526
527 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
528 auto-buffer-name window parameter. Install revision of reverted
529 fix.
457294dd 530
4f2daf31
DA
5312012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
532
533 Do not allow to set major mode for a dead buffer.
534 * buffer.c (Fset_buffer_major_mode): Signal an error
535 if the buffer is dead.
536 (Fother_buffer, other_buffer_safely): Remove redundant
537 nested declaration.
538
66322887
DA
5392012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
540
541 Always use set_buffer_if_live to restore original buffer at unwind.
542 * buffer.h (record_unwind_current_buffer): New function.
543 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
544 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
545 * undo.c, window.c: Adjust users.
546 * buffer.c (set_buffer_if_live): Fix comment.
547
a3d794a1
DA
5482012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
549
550 Fix usage of set_buffer_internal.
551 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
552 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
553 * coding.c (decode_coding): Omit redundant test.
554 * fileio.c (decide_coding_unwind): Likewise.
555 * fns.c (secure_hash): Likewise.
556 * insdel.c (modify_region): Likewise.
557 * keyboard.c (command_loop_1): Likewise.
558 * print.c (PRINTFINISH): Likewise.
559 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
560
59ea14cd
PE
5612012-08-27 Paul Eggert <eggert@cs.ucla.edu>
562
563 * dispnew.c: Use bool for boolean.
564 (frame_garbaged, display_completed, delayed_size_change)
565 (fonts_changed_p, add_window_display_history)
566 (add_frame_display_history, verify_row_hash)
567 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
568 (row_equal_p, realloc_glyph_pool)
569 (allocate_matrices_for_frame_redisplay)
570 (showing_window_margins_p)
571 (adjust_frame_glyphs_for_frame_redisplay)
572 (build_frame_matrix_from_leaf_window, make_current)
573 (mirrored_line_dance, mirror_line_dance, update_frame)
574 (update_window_tree, update_single_window)
575 (check_current_matrix_flags, update_window, update_text_area)
576 (update_window_line, set_window_update_flags, scrolling_window)
577 (update_frame_1, scrolling, buffer_posn_from_coords)
578 (do_pending_window_change, change_frame_size)
579 (change_frame_size_1, sit_for):
580 Use bool for boolean.
581 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
582 and remove last int (actually boolean) argument, which was always 0.
583 All callers changed.
584 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
585 * dispextern.h (struct composition_it): Use bool for boolean.
586 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
587 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
588 * dired.c (file_name_completion):
589 Use bool for boolean. (This was missed in an earlier change.)
590
95072a94
MR
5912012-08-27 Martin Rudalics <rudalics@gmx.at>
592
593 * window.c (Fset_window_configuration): Revert first part of
594 last change.
595
0f19feff
JD
5962012-08-27 Jan Djärv <jan.h.d@swipnet.se>
597
598 * nsterm.h (NSPanel): New class variable dialog_return.
599
600 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
601 dialog_return.
602 (windowShouldClose:): Use stop instead of stopModalWithCode.
603 (clicked:): Ditto, and also set dialog_return (Bug#12258).
604 (timeout_handler:): Use stop instead of abortModal. Send a dummy
605 event.
606 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
607 modal loop returns.
608
f10fe38f
PE
6092012-08-27 Paul Eggert <eggert@cs.ucla.edu>
610
de1339b0
PE
611 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
612 * composite.c (find_composition, composition_gstring_p)
613 (composition_reseat_it, find_automatic_composition):
614 * data.c (let_shadows_buffer_binding_p)
615 (let_shadows_global_binding_p, set_internal, make_blv)
616 (Fmake_variable_buffer_local, Fmake_local_variable)
617 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
618 (cons_to_signed, arith_driver):
619 * dbusbind.c (xd_in_read_queued_messages):
620 * dired.c (directory_files_internal, file_name_completion):
621 Use bool for booleans.
622 * dired.c (file_name_completion):
623 * process.h (fd_callback):
624 Omit int (actually boolean) argument. It wasn't being used.
625 All uses changed.
626 * composite.h, lisp.h: Reflect above API changes.
627
f10fe38f
PE
628 * cmds.c, coding.c: Use bool for booleans.
629 * cmds.c (move_point, Fself_insert_command):
630 * coding.h (struct composition status, struct coding_system):
631 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
632 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
633 (emacs_mule_char, decode_coding_emacs_mule)
634 (encode_coding_emacs_mule, detect_coding_iso_2022)
635 (decode_coding_iso_2022, encode_invocation_designation)
636 (encode_designation_at_bol, encode_coding_iso_2022)
637 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
638 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
639 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
640 (encode_coding_raw_text, detect_coding_charset)
641 (decode_coding_charset, encode_coding_charset, detect_eol)
642 (detect_coding, get_translation_table, produce_chars)
643 (consume_chars, reused_workbuf_in_use)
644 (make_conversion_work_buffer, code_conversion_save)
645 (decode_coding_object, encode_coding_object)
646 (detect_coding_system, char_encodable_p)
647 (Funencodable_char_position, code_convert_region)
648 (code_convert_string, code_convert_string_norecord)
649 (Fset_coding_system_priority):
650 * fileio.c (Finsert_file_contents):
651 Use bool for booleans.
652 * coding.h, lisp.h: Reflect above API changes.
653 * coding.c: Remove unnecessary static function decls.
654 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
655 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
656 not a boolean 'int', since callers never look at the return value.
657 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
658 * coding.h (decoding_buffer_size, encoding_buffer_size)
659 (emacs_mule_string_char): Remove unused extern decls.
660 (struct iso_2022_spec, struct coding_system):
661 Use 'unsigned int : 1' for boolean fields, since there's more than one.
662 (struct emacs_mule_spec): Remove unused field 'full_support'.
663 All initializations removed.
664 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
665
5474c384
DA
6662012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
667
f10fe38f 668 Fix spare memory change (Bug#12286).
5474c384
DA
669 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
670 (valid_lisp_object_p): Likewise.
671
c4b6914d
MR
6722012-08-27 Martin Rudalics <rudalics@gmx.at>
673
674 * window.c (Fset_window_configuration): Record any window's old
675 buffer if it's replaced (see Bug#8789). If the new current
676 buffer doesn't appear in the selected window, go to its old
677 point (Bug#12208).
678
35aaa1ea
DA
6792012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
680
681 Special MEM_TYPE_SPARE to denote reserved memory.
682 * alloc.c (enum mem_type): New memory type.
683 (refill_memory_reserve): Use new type for spare memory.
684 This prevents live_cons_p and live_string_p from incorrect
685 detection of uninitialized objects from spare memory as live.
686
6af64513
PE
6872012-08-26 Paul Eggert <eggert@cs.ucla.edu>
688
8b2e00a3
PE
689 Spelling fixes.
690 * Makefile.in (.PHONY): versioclean -> versionclean.
691
b52d6985
PE
692 Remove unused external symbols.
693 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
694 * window.c (Qwindow_valid_p, decode_valid_window):
695 Now static, not extern.
696 * data.c (Qinterval): Remove; unused.
697 (syms_of_data): Do not define 'interval'.
698 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
699 * window.h (decode_valid_window):
700 Remove decls.
701
d5172d4f
PE
702 * character.c, charset.c, chartab.c: Use bool for booleans.
703 * character.c (lisp_string_width, string_count_byte8)
704 (string_escape_byte8):
705 * charset.c (charset_map_loaded, load_charset_map, read_hex):
706 (load_charset_map_from_file, map_charset_chars)
707 (Fdefine_charset_internal, define_charset_internal)
708 (Fdeclare_equiv_charset, find_charsets_in_text)
709 (Ffind_charset_region, char_charset, Fiso_charset):
710 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
711 (sub_char_table_set, sub_char_table_set_range)
712 (char_table_set_range, optimize_sub_char_table)
713 (map_sub_char_table):
714 Use bool for boolean.
715 * character.c (str_to_unibyte): Omit last boolean argument; it was
716 always 0. All callers changed.
717 * character.h, charset.h: Adjust to match previous changes.
718 * character.h (char_printable_p): Remove decl of nonexistent function.
719 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
720 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
721 are all boolean, so make them single-bit bitfields.
722
6af64513
PE
723 * lisp.h (ASET): Remove attempt to detect side effects.
724 It was meant to be temporary and it often doesn't work,
725 because when IDX has side effects the behavior of IDX==IDX
726 is undefined. See Stefan Monnier in
727 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
728
e1f29348
BR
7292012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
730
731 * lisp.h (functionp): New function (extracted from Ffunctionp).
732 (FUNCTIONP): Use it.
733 * eval.c (Ffunctionp): Use it.
734
17c05d74
PE
7352012-08-25 Paul Eggert <eggert@cs.ucla.edu>
736
0f46bc75
PE
737 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
738 as that's faster and simpler than static storage. Don't bother
739 with the g_main_context_query overhead if g_main_context_pending
740 says no events are pending.
741 (gfds, gfds_size): Remove these static vars.
742 (xgselect_initialize): Remove; no longer needed.
743 All uses and decls removed.
744
ee4c0f69
PE
745 * emacs.c (fatal_error_signal_hook): Remove.
746 All uses removed. This leftover from old code was always 0.
747
17c05d74
PE
748 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
749 * casefiddle.c (casify_object, casify_region):
750 * casetab.c (set_case_table):
751 * category.c, category.h (word_boundary_p):
752 * category.h (CHAR_HAS_CATEGORY):
753 Use bool for booleans, instead of int.
754
391ceac5
EZ
7552012-08-25 Eli Zaretskii <eliz@gnu.org>
756
757 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
758
2f221583
PE
7592012-08-25 Paul Eggert <eggert@cs.ucla.edu>
760
f4a681b0
PE
761 On assertion failure, print backtrace if available.
762 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
763 (die) [ENABLE_CHECKING]: Print a backtrace if available.
764 * Makefile.in (LIB_EXECINFO): New macro.
765 (LIBES): Use it.
766
2f221583
PE
767 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
768 * bytecode.c (exec_byte_code):
769 * callint.c (check_mark, Fcall_interactively):
770 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
771 (getenv_internal, sync_process_alive, call_process_exited):
772 * lisp.h (USE_SAFE_ALLOCA):
773 Use bool for booleans, instead of int.
774 * lisp.h, process.h: Adjust prototypes to match above changes.
775 * callint.c (Fcall_interactively): Don't assume the mark's
776 offset fits in 'int'.
777
37ef52bb
PE
7782012-08-24 Paul Eggert <eggert@cs.ucla.edu>
779
780 * buffer.c, buffer.h: Use bool for boolean.
781 * buffer.c (reset_buffer_local_variables)
782 (buffer_lisp_local_variables, Fset_buffer_modified_p)
783 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
784 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
785 (overlay_touches_p, overlay_strings, Foverlay_put)
786 (report_overlay_modification, call_overlay_mod_hooks):
787 (mmap_enlarge, mmap_set_vars):
788 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
789 Use bool for booleans, instead of int.
790 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
791 since the 1-or-0 return value is always ignored anyway.
792 (mmap_initialized_p):
793 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
794 * buffer.h, lisp.h: Adjust prototypes to match above changes.
795
2cc21167
PE
7962012-08-23 Paul Eggert <eggert@cs.ucla.edu>
797
798 * bidi.c: Use bool for boolean.
799 This is a bit more readable, and makes the text segment of bidi.o
800 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
801 Presumably it's faster too.
802 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
803 Now bool.
804 (bidi_cache_find_level_change, bidi_cache_iterator_state)
805 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
806 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
807 (bidi_explicit_dir_char, bidi_level_of_next_char)
808 (bidi_find_other_level_edge, bidi_move_to_visually_next):
809 Use bool for booleans, instead of int.
810 * dispextern.h (bidi_init_it, bidi_paragraph_init)
811 (bidi_unshelve_cache): Adjust decls to match code.
812
7db4ddf4
MR
8132012-08-23 Martin Rudalics <rudalics@gmx.at>
814
815 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
816 argument.
817
b1bb8011
PE
8182012-08-23 Paul Eggert <eggert@cs.ucla.edu>
819
820 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
821 * atimer.h: Include <stdbool.h>.
822
ff687885
DN
8232012-08-22 Dan Nicolaescu <dann@gnu.org>
824
825 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
826 compile time tests instead of run time tests on systems that do
827 not use them.
828 (FRAME_MAC_P): Remove leftover from deleted code.
829 * frame.c (syms_of_frame): Remove leftover from deleted code.
830
4ce7a138
JD
8312012-08-22 Jan Djärv <jan.h.d@swipnet.se>
832
833 * nsterm.m (insertText:): Don't clear modifiers if code is space.
834
d733ec6d
PE
8352012-08-22 Paul Eggert <eggert@cs.ucla.edu>
836
837 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
838 Otherwise, the compiler complains about (A?B:C) where B is void
839 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
840 (fontset_add): Return void, for FONTSET_ADD.
841
d0d2d26f
PE
8422012-08-21 Paul Eggert <eggert@cs.ucla.edu>
843
fce31d69
PE
844 * alloc.c: Use bool for booleans.
845 (gc_in_progress, abort_on_gc)
846 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
847 (dont_register_blocks) [GC_MALLOC_CHECK]:
848 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
849 (check_string_bytes, make_specified_string, memory_full)
850 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
851 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
852 (mark_stack, valid_pointer_p, make_pure_string)
853 (Fgarbage_collect, survives_gc_p, gc_sweep):
854 Use bool for booleans, instead of int.
855 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
856 Remove unused local.
857 * alloc.c (PURE_POINTER_P):
858 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
859 * editfns.c (Fformat):
860 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
861 (Fdo_auto_save):
862 * fns.c (sweep_weak_table):
863 * lisp.h (suppress_checking, push_message, survives_gc_p)
864 (make_pure_string, gc_in_progress, abort_on_gc):
865 * lread.c (readchar, read1):
866 * print.c (Fprin1_to_string):
867 * xdisp.c (push_message):
868 Use bool for booleans affected directly or indirectly by
869 alloc.c's changes.
870
d0d2d26f
PE
871 Make recently-introduced setters macros.
872 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
873 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
874 (set_fontset_default, set_fontset_fallback): Rename from their
875 upper-case counterparts, and make them functions rather than macros.
876 This is more consistent with the other recently-introduced setters.
877 These don't need to be inline, since they're local.
878
d18e2bb6
JD
8792012-08-21 Jan Djärv <jan.h.d@swipnet.se>
880
881 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
882 the loop (Bug#12247).
883
1b9d9d16
PE
8842012-08-21 Paul Eggert <eggert@cs.ucla.edu>
885
886 * lisp.h (vcopy): Use memcpy rather than our own loop.
887 This fixes a performance regression introduced by the recent
888 addition of vcopy. This means 'vcopy' will need to be modified
889 for a copying collector, but that's OK. Also, tighten the
890 checking in the assertion.
891
b2f09701
EZ
8922012-08-21 Eli Zaretskii <eliz@gnu.org>
893
894 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
895 components for RTL text (Bug#11860). Adjust X-OFFSET of each
896 non-base glyph for the width of the base character, according to
e1f29348
BR
897 what x_draw_composite_glyph_string_foreground expects.
898 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
899 expectations, to produce correct width of the composed character.
900 Reverse the sign of the DU offset produced by ScriptPlace.
901
9b994fed
PE
9022012-08-21 Paul Eggert <eggert@cs.ucla.edu>
903
904 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
905
086ca913
DA
9062012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
907
908 Avoid direct writes to contents member of struct Lisp_Vector.
909 * lisp.h (vcopy): New function to copy data into vector.
910 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
911 * fns.c (Ffillarray): Use ASET.
912 * keyboard.c (timer_check_2): Use AREF and ASET.
913 (append_tool_bar_item, Frecent_keys): Use vcopy.
914 * lread.c (read_vector): Use ASET.
915 * msdos.c (Frecent_doskeys): Use vcopy.
916 * xface.c (Finternal_copy_lisp_face): Use vcopy.
917 (Finternal_merge_in_global_face): Use ASET and vcopy.
918 * xfont.c (xfont_list_pattern): Likewise.
919
5481664a
MR
9202012-08-21 Martin Rudalics <rudalics@gmx.at>
921
922 * window.c (Fwindow_point): For the selected window always return
923 the position of its buffer's point.
924 (Fset_window_point): For the selected window always go in its
925 buffer to the specified position.
926
6d470bdd
DA
9272012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
928
929 Setter macros for fontsets.
930 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
931 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
932 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
933 Adjust users.
934
24564fe1
GM
9352012-08-20 Glenn Morris <rgm@gnu.org>
936
937 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
938 Don't assume that `ln -f' works.
939
0a05a035
EZ
9402012-08-20 Eli Zaretskii <eliz@gnu.org>
941
942 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
943 and later about non-assignments with no effect. See discussion at
944 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
945 details.
946
e46f2325
DA
9472012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
948
949 Inline setter functions for Lisp_Objects slots of struct specbinding.
950 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
951 Adjust users.
952
734fbd86
MR
9532012-08-20 Martin Rudalics <rudalics@gmx.at>
954
955 * window.c (select_window): Always make selected window's buffer
956 current.
957
f1a95992
DA
9582012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
959
960 Use AREF and ASET for docstrings of category tables.
961 * category.h (CATEGORY_DOCSTRING): Use AREF.
962 (SET_CATEGORY_DOCSTRING): Use ASET.
963 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
964
e83064be
DA
9652012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
966
967 Inline setter functions for hash table members.
968 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
969 (set_hash_hash, set_hash_index): Rename with _slot suffix.
970 (set_hash_key_and_value, set_hash_index, set_hash_next)
971 (set_hash_hash): New functions.
972 * charset.c, fns.c: Adjust users.
973
4ce60d2e
DA
9742012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
975
976 Inline getter and setter functions for per-buffer values.
977 * buffer.h (per_buffer_default, set_per_buffer_default)
978 (per_buffer_value, set_per_buffer_value): New functions.
979 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
980 * buffer.c, data.c: Adjust users.
981
c06c9690
JB
9822012-08-20 Juanma Barranquero <lekktu@gmail.com>
983
984 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
985
32bd4250
PE
9862012-08-19 Paul Eggert <eggert@cs.ucla.edu>
987
bad03192 988 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
989 as gnulib does this if the system doesn't.
990 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
991 Remove declaration. MS-Windows declares it on stdlib.h which is
992 included by conf_post.h.
b69a6d22
PE
993 * emacs.c (environ) [DOUG_LEA_MALLOC]:
994 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
995 * vm-limit.c: Include <unistd.h>, for 'environ'.
996
22d7feb2
PE
997 * unexaix.c, unexcoff.c: Include "mem-limits.h".
998 (start_of_data): Remove decl; mem-limits.h provides it.
999
32bd4250
PE
1000 * xdisp.c (handle_invisible_prop): Make it a bit faster
1001 and avoid a gcc -Wmaybe-uninitialized diagnostic.
1002
450809af
CY
10032012-08-19 Chong Yidong <cyd@gnu.org>
1004
1005 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
1006 ends (Bug#3874).
1007
9e677988
AS
10082012-08-19 Andreas Schwab <schwab@linux-m68k.org>
1009
6b1319ce
AS
1010 * .gdbinit: Use call instead of set when calling a function in the
1011 inferior.
1012
9e677988
AS
1013 * data.c (set_internal): Don't use set_blv_found.
1014 (Fkill_local_variable): Likewise.
1015
d7191076
AA
10162012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
1017
1018 * nsfont.m (ns_ascii_average_width): Ensure the string
1019 ascii_printable is initialized with a null-terminated character
1020 array. Otherwise, it can contain undesired extra characters.
1021
e757f1c6
PE
10222012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1023
1024 port new setting code to Sun C 5.8 2005/10/13
1025 * chartab.c, lisp.h (char_table_set, char_table_set_range):
1026 Return void, not Lisp_Object. Otherwise, the compiler
1027 complains about (A?B:C) where B is void and C is Lisp_Object
1028 when compiling CHAR_TABLE_SET, due to the recent change to
1029 the API of sub_char_table_set_contents.
1030
a999ce26
CY
10312012-08-18 Chong Yidong <cyd@gnu.org>
1032
1033 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
1034 for the string case (Bug#3874).
1035
3f22b86f
PE
10362012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1037
39eb03f1
PE
1038 * buffer.h (BSET): Remove (Bug#12215).
1039 Replace all uses with calls to new setter functions.
1040 (bset_bidi_paragraph_direction, bset_case_canon_table)
1041 (bset_case_eqv_table, bset_directory, bset_display_count)
1042 (bset_display_time, bset_downcase_table)
1043 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
1044 (bset_last_selected_window, bset_local_var_alist)
1045 (bset_mark_active, bset_point_before_scroll, bset_read_only)
1046 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
1047 (bset_width_table):
1048 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1049 (bset_auto_fill_function, bset_auto_save_file_format)
1050 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1051 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1052 (bset_cache_long_line_scans, bset_case_fold_search)
1053 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1054 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1055 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1056 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1057 (bset_header_line_format, bset_indicate_buffer_boundaries)
1058 (bset_indicate_empty_lines, bset_invisibility_spec)
1059 (bset_left_fringe_width, bset_major_mode, bset_mark)
1060 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1061 (bset_name, bset_overwrite_mode, bset_pt_marker)
1062 (bset_right_fringe_width, bset_save_length)
1063 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1064 (bset_scroll_up_aggressively, bset_selective_display)
1065 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1066 (bset_word_wrap, bset_zv_marker):
1067 * category.c (bset_category_table):
1068 * syntax.c (bset_syntax_table):
1069 New setter functions.
1070
6a09a33b
PE
1071 * process.h (PSET): Remove (Bug#12215).
1072 Replace all uses with calls to new setter functions.
1073 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1074 (PROCESS_INLINE): New macro.
1075 (pset_childp): New setter function.
1076 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
1077 * process.c (PROCESS_INLINE):
1078 Define to EXTERN_INLINE, so that the corresponding functions
1079 are compiled into code.
1080 (pset_buffer, pset_command, pset_decode_coding_system)
1081 (pset_decoding_buf, pset_encode_coding_system)
1082 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
1083 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
1084 (pset_type, pset_write_queue): New setter functions.
1085
e8c17b81
PE
1086 * window.h (WSET): Remove (Bug#12215).
1087 Replace all uses with calls to new setter functions.
1088 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1089 (WINDOW_INLINE): New macro.
1090 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
1091 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
1092 (wset_total_lines, wset_vertical_scroll_bar)
1093 (wset_window_end_pos, wset_window_end_valid)
1094 (wset_window_end_vpos): New setter functions.
1095 * window.c (WINDOW_INLINE):
1096 Define to EXTERN_INLINE, so that the corresponding functions
1097 are compiled into code.
1098 (wset_combination_limit, wset_dedicated, wset_display_table)
1099 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
1100 (wset_new_normal, wset_new_total, wset_next_buffers)
1101 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1102 (wset_prev_buffers, wset_right_fringe_width)
1103 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
1104 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
1105 (wset_window_parameters):
1106 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1107 (wset_column_number_displayed, wset_region_showing):
1108 New setter functions.
1109
3f22b86f
PE
1110 * termhooks.h (TSET): Remove (Bug#12215).
1111 Replace all uses with calls to new setter functions.
1112 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1113 (TERMHOOKS_INLINE): New macro.
1114 (tset_charset_list, tset_selection_alist): New setter functions.
1115 * terminal.c (TERMHOOKS_INLINE):
1116 Define to EXTERN_INLINE, so that the corresponding functions
1117 are compiled into code.
1118 (tset_param_alist): New setter function.
1119
742af32f
PE
11202012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1121
15dbb4d6
PE
1122 * keyboard.h (KSET): Remove (Bug#12215).
1123 Replace all uses with calls to new setter functions.
1124 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1125 (KEYBOARD_INLINE): New macro.
1126 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
1127 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
1128 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
1129 New setter functions.
1130 * keyboard.c (KEYBOARD_INLINE):
1131 Define to EXTERN_INLINE, so that the corresponding functions
1132 are compiled into code.
1133 (kset_echo_string, kset_kbd_queue)
1134 (kset_keyboard_translate_table, kset_last_prefix_arg)
1135 (kset_last_repeatable_command, kset_local_function_key_map)
1136 (kset_overriding_terminal_local_map, kset_real_last_command)
1137 (kset_system_key_syms): New setter functions.
1138
f00af5b1
PE
1139 * frame.h (FSET): Remove (Bug#12215).
1140 Replace all uses with calls to new setter functions.
1141 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1142 (FRAME_INLINE): New macro.
1143 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
1144 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
1145 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
1146 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
1147 (fset_param_alist, fset_root_window, fset_scroll_bars)
1148 (fset_selected_window, fset_title, fset_tool_bar_items)
1149 (fset_tool_bar_position, fset_tool_bar_window): New functions.
1150 * frame.c (FRAME_INLINE):
1151 Define to EXTERN_INLINE, so that the corresponding functions
1152 are compiled into code.
1153 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
1154
0c94c8d6
PE
1155 A few more naming-convention fixes for getters and setters.
1156 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
1157 and rename from buffer_overlays_set_before.
1158 (set_buffer_overlays_after): Move here from buffer.h, and rename
1159 from buffer_overlays_set_after.
1160 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
1161 All uses changed.
1162 (set_buffer_intervals): Rename from buffer_set_intervals.
1163 * intervals.c (set_interval_object): Move here from intervals.h,
1164 and rename from interval_set_object.
1165 (set_interval_left): Move here from intervals.h, and rename from
1166 interval_set_left.
1167 (set_interval_right): Move here from intervals.h, and rename from
1168 interval_set_right.
1169 (copy_interval_parent): Move here from intervals.h, and rename from
1170 interval_copy_parent.
1171 * intervals.h (set_interval_parent): Rename from interval_set_parent.
1172 (set_interval_plist): Rename from interval_set_plist.
1173 Return void, not Lisp_Object, since no caller uses the result.
1174 * lisp.h (string_intervals): Rename from string_get_intervals.
1175 (set_string_intervals): Rename from string_set_intervals.
1176
34dabdb7
PE
1177 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
1178 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 1179 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
1180 All uses changed. See the end of
1181 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
1182
742af32f
PE
1183 * lisp.h (CSET): Remove (Bug#12215).
1184 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
1185 (set_char_table_purpose): New functions,
1186 replacing CSET. All uses changed. For example, replace
1187 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 1188 "set_char_table_parent (char_table, parent);".
742af32f
PE
1189 The old version was confusing because it used the same name
1190 'parent' for two different things.
1191
a04e2c62
DA
11922012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1193
1194 Functions to get and set Lisp_Object fields of buffer-local variables.
1195 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
1196 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
1197 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
1198 * data.c, eval.c, frame.c: Adjust users.
1199
383dcbf9
CY
12002012-08-17 Chong Yidong <cyd@gnu.org>
1201
1202 * xfaces.c (merge_face_vectors): If the target font specfies a
1203 font spec, make the font's attributes take precedence over
1204 directly-specified attributes.
1205 (merge_face_ref): Recognize :font.
1206
44386687
DA
12072012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1208
1209 Do not use memcpy for copying intervals.
1210 * intervals.c (reproduce_interval): New function.
1211 (reproduce_tree, reproduce_tree_obj): Use it.
1212 (reproduce_tree_obj): Remove prototype.
1213
927c7216
PE
12142012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1215
1216 * lisp.h (duration_to_sec_usec): Remove unused decl.
1217
93044f7b
AA
12182012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
1219
1220 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
1221 to an allocated instance of NSString, not to the class itself.
1222
9851e4a5
JB
12232012-08-17 Juanma Barranquero <lekktu@gmail.com>
1224
1225 * makefile.w32-in (C_CTYPE_H): New macro.
1226 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
1227 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
1228 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1229
620f13b0
PE
12302012-08-16 Paul Eggert <eggert@cs.ucla.edu>
1231
1232 Use ASCII tests for character types.
1233 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
1234 * xfns.c, xterm.c:
1235 Don't include <ctype.h>; was not needed.
1236 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
1237 * sysdep.c, xfaces.c:
1238 Include <c-ctype.h> instead of <ctype.h>.
1239 * nsterm.m: Include <c-ctype.h>.
1240 * charset.c (read_hex):
1241 * doc.c (Fsnarf_documentation):
1242 * fileio.c (IS_DRIVE) [WINDOWSNT]:
1243 (DRIVE_LETTER) [DOS_NT]:
1244 (Ffile_name_directory, Fexpand_file_name)
1245 (Fsubstitute_in_file_name):
1246 * font.c (font_parse_xlfd, font_parse_fcname):
1247 * frame.c (x_set_font_backend):
1248 * gtkutil.c (xg_get_font):
1249 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
1250 * nsimage.m (hexchar):
1251 * nsterm.m (ns_xlfd_to_fontname):
1252 * sysdep.c (system_process_attributes):
1253 * xfaces.c (hash_string_case_insensitive):
1254 Use C-locale tests instead of locale-specific tests for character
1255 types, since we want the ASCII interpretation here, not the
1256 interpretation suitable for whatever happens to be the current locale.
1257
52162052
MR
12582012-08-16 Martin Rudalics <rudalics@gmx.at>
1259
1260 Consistently check windows for validity/liveness
1261 (Bug#11984, Bug#12025, Bug#12026).
1262 * lisp.h (CHECK_VALID_WINDOW): New macro.
1263 * window.c (decode_window): Rename to decode_live_window.
1264 (decode_valid_window, Fwindow_valid_p): New functions.
1265 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
1266 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
1267 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
1268 (Fwindow_prev_sibling, Fwindow_combination_limit)
1269 (Fset_window_combination_limit, Fwindow_use_time)
1270 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
1271 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
1272 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
1273 (Fwindow_hscroll, Fset_window_hscroll)
1274 (Fwindow_redisplay_end_trigger)
1275 (Fset_window_redisplay_end_trigger, Fwindow_edges)
1276 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
1277 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
1278 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
1279 (Fwindow_end, Fset_window_point, Fset_window_start)
1280 (Fpos_visible_in_window_p, Fwindow_line_height)
1281 (Fwindow_dedicated_p, Fset_window_dedicated_p)
1282 (Fwindow_prev_buffers, Fset_window_prev_buffers)
1283 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
1284 (Fset_window_parameter, Fwindow_display_table)
1285 (Fset_window_display_table, Fdelete_other_windows_internal)
1286 (Fset_window_buffer, Fset_window_new_total)
1287 (Fset_window_new_normal, Fdelete_window_internal)
1288 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
1289 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
1290 (Fwindow_scroll_bars): Check whether argument window is a valid or
1291 live window. Update doc-strings.
1292 (syms_of_window): New symbol Qwindow_valid_p.
1293 * keyboard.c (Fposn_at_x_y): Check whether argument
1294 frame_or_window denotes a valid window.
1295
2751c80f
DA
12962012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1297
1298 Fix previous char table change.
1299 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
1300 * chartab.c (optimize_sub_char_table): Likewise.
1301
032a42c8
CY
13022012-08-16 Chong Yidong <cyd@gnu.org>
1303
a2d19368
CY
1304 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
1305
032a42c8
CY
1306 * xfont.c (xfont_open):
1307 * xftfont.c (xftfont_open): Set the font's max_width field.
1308
1309 * nsfont.m (nsfont_open): Similar to the Xft backend, set
1310 min_width to space_width and average_width to the average over
1311 printable ASCII characters.
1312 (ns_char_width): Code cleanup.
1313 (ns_ascii_average_width): New utility function.
1314
1315 * font.h (struct font): Update comments.
1316
a098c930
DA
13172012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1318
032a42c8 1319 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
1320 * lisp.h (CSET): New macro.
1321 (char_table_set_extras, char_table_set_contents)
1322 (sub_char_table_set_contents): New function.
1323 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
1324 * syntax.c: Adjust users.
1325
8be3a09c
SM
13262012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
1327
1328 * eval.c (eval_sub): Bind lexical-binding.
1329 * lread.c (Qlexical_binding): Make non-static.
1330
ac4845a6
JD
13312012-08-15 Jan Djärv <jan.h.d@swipnet.se>
1332
ddee6515
JD
1333 * nsmenu.m (popupSession): Remove.
1334 (pop_down_menu): Remove endModalSession.
1335 (timeout_handler:): New method.
1336 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
1337 Call runModalForWindow. Check timer_fired when it returns.
1338 If not set, cancel timer and break out of loop.
1339 Otherwise loop again, with a new timeout.
1340
1341 * nsterm.m: Include fcntl.h if present.
1342 (fd_entry, t_readfds, inNsSelect): Remove.
1343 (select_writefds, select_valid, select_timeout, selfds)
1344 (select_mutex, apploopnr): Add.
1345 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
1346 Otherwise call kbd_buffer_store_event.
1347 (ns_send_appdefined): Remove release of fd_entry.
1348 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
1349 Increment and decrement apploopnr.
1350 (ns_select): If no file descriptors, just do a NSTimer.
1351 Otherwise copy read/write masks and start select thread (fd_handler).
1352 Start main loop and wait for application defined event.
1353 Inform select thread to stop selecting after main loop is exited.
1354 (ns_term_init): Create selfds pipe and set non-blocking.
1355 Initialize select_mutex. Start the select thread (fd_handler).
1356 (fd_handler:): Loop forever, wait for info from the main thread
1357 to either start or stop selecting. When select returns, send
1358 and appdefined event.
1359 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
1360 If not call kbd_buffer_store_event.
1361
1362 * nsterm.h (EmacsApp): fd_handler takes id argument.
1363 (EmacsDialogPanel): Add timer_fired and timeout_handler.
1364
ac4845a6
JD
1365 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
1366
eb424fe3
EZ
13672012-08-15 Eli Zaretskii <eliz@gnu.org>
1368
1369 * region-cache.c (move_cache_gap): Update gap_len using the actual
1370 growth of the boundaries array. Do not change cache_len.
1371 (Bug#12196)
1372
4e6a86c6
DA
13732012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1374
1375 Generalize and cleanup font subsystem checks.
1376 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
1377 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
1378 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 1379
5bf192ca
DA
13802012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1381
1382 * gtkutil.c (xg_get_font): Use pango_units_to_double.
1383
f2045622
CY
13842012-08-15 Chong Yidong <cyd@gnu.org>
1385
8be3a09c
SM
1386 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
1387 When using the new font chooser, use gtk_font_chooser_get_font_desc to
1388 extract the font descriptor instead of just the font name.
1389 In that case, return a font spec instead of a string.
f2045622
CY
1390 (x_last_font_name): Move to this file from xfns.c.
1391
1392 * xfns.c (Fx_select_font): The return value can also be a font
1393 spec. Move x_last_font_name management to gtkutil.c.
1394
1395 * xfaces.c: Make font weight and style symbols non-static.
1396
7f6feb56
SM
13972012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
1398
1399 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
1400 (bug#12117).
1401
fecbd8ff
SM
14022012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
1403
1404 * alloc.c (Fgarbage_collect): Use plural form consistently.
1405
9b8d5165
EZ
14062012-08-14 Eli Zaretskii <eliz@gnu.org>
1407
1408 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
1409 iteration through the command loop. Fixes a problem whereby mouse
1410 movements are ignored until the first mouse click.
1411
f5d9e83a
PE
14122012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1413
1414 Use bool, not int, for Lisp booleans.
1415 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
1416 makes Emacs a bit smaller and presumably a bit faster.
1417 * lisp.h: Include <stdbool.h>.
1418 (struct Lisp_Boolfwd, defvar_bool):
1419 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
1420 * regex.c [!emacs]: Include <stdbool.h>.
1421 (false, true): Remove; <stdbool.h> does this for us now.
1422
55802e4a
CY
14232012-08-14 Chong Yidong <cyd@gnu.org>
1424
4abcdac8
CY
1425 * character.c (Fcharacterp): Doc fix (Bug#12076).
1426
1427 * data.c (Findirect_variable): Doc fix (Bug#11040).
1428
55802e4a
CY
1429 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
1430
1431 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 1432 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 1433
8e99d072
BR
14342012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1435
1436 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
1437 (bug#12022).
1438
08908aca
MR
14392012-08-14 Martin Rudalics <rudalics@gmx.at>
1440
1441 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
1442 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
1443 * minibuf.c (choose_minibuf_frame, read_minibuf):
1444 * w32fns.c (x_create_tip_frame):
1445 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
1446 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
1447
56120d6f
PE
14482012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1449
1450 * intervals.c (offset_intervals): Remove obsolete comment.
1451
67b77c0b
AS
14522012-08-14 Andreas Schwab <schwab@linux-m68k.org>
1453
1454 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
1455
f48b82fd
GR
14562012-08-14 Gergely Risko <gergely@risko.hu>
1457
1458 * coding.c (decode_coding): Record buffer modification before
1459 disabling undo_list (Bug#11773).
1460
fd318b54
DA
14612012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1462
1463 Revert and cleanup some recent overlay changes.
1464 * buffer.h (enum overlay_type): Remove.
1465 (buffer_get_overlays, buffer_set_overlays): Likewise.
1466 (buffer_set_overlays_before, buffer_set_overlays_after):
1467 New function. Adjust users.
1468 (unchain_both): Add eassert.
1469
41a62dd9
DA
14702012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1471
1472 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
1473
5884c324
PE
14742012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1475
1476 * gtkutil.c (xg_mark_data): Don't assume C99.
1477
ca06f160
JD
14782012-08-13 Jan Djärv <jan.h.d@swipnet.se>
1479
1480 * gtkutil.c (xg_frame_tb_info): New struct.
1481 (TB_INFO_KEY): New define.
1482 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
1483 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
1484 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
1485 if not present.
1486 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
1487 is up to date. Otherwise store new data.
1488 (free_frame_tool_bar): Free xg_frame_tb_info if present.
1489
7864a3f7
DA
14902012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1491
1492 Use KSET for write access to Lisp_Object members of struct kboard.
1493 * keyboard.h (KSET): New macro.
1494 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
1495 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
1496 * xterm.c: Adjust users.
1497
4c31be61
DA
14982012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1499
1500 Use BSET for write access to Lisp_Object members of struct buffer.
1501 * buffer.h (BSET): New macro.
1502 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
1503 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
1504 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
1505 * window.c, xdisp.c, xfns.c: Adjust users.
1506
14ae4239
BT
15072012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
1508
1509 * lread.c (syms_of_lread): Initialize Vlexical_binding.
1510
32bcadb4
JD
15112012-08-11 Jan Djärv <jan.h.d@swipnet.se>
1512
3d29b2ce
JD
1513 * nsterm.m (not_in_argv): New function.
1514 (application:openFile, application:openTempFile:):
1515 (application:openFileWithoutUI:, application:openFiles:): Open file
1516 if not_in_argv returns non-zero (bug#12171).
1517
32bcadb4 1518 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
1519 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
1520 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
1521 (xg_get_font_name): Use those functions/macros here.
1522 Reported by Frans Oilinki <moilinki@gmail.com>.
1523
9ff9402d 15242012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
1525
1526 * unexmacosx.c (copy_data_segment): Copy initialized data in
1527 statically linked libraries from input file rather than memory.
1528
db74a5fc
YM
1529 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
1530 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
1531 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
1532
25e65510
GM
15332012-08-10 Glenn Morris <rgm@gnu.org>
1534
1535 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
1536 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
1537
7961135c
DA
15382012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1539
1540 Fix last change to allow compilation with low optimization levels.
1541 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
1542 Reported by Jan Djärv <jan.h.d@swipnet.se>.
1543
42b3a444
DA
15442012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1545
1546 Use common inline syntax in intervals.h.
1547 * intervals.h (INTERVALS_INLINE): New macro.
1548 Change all users from LISP_INLINE.
1549
9fb0c957
DA
15502012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1551
1552 Define Qnone once for all platforms.
1553 * frame.c (Qnone): Define here.
1554 (syms_of_frame): DEFSYM it.
1555 * lisp.h (Qnone): New declaration.
1556 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
1557 * xfns.c: Remove duplication. Adjust users.
1558
65e8ee52
DA
15592012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1560
1561 Remove unused macros from intervals.h.
1562 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
1563 * intervals.c: Adjust comment.
1564
9b855fd6
EZ
15652012-08-10 Eli Zaretskii <eliz@gnu.org>
1566
1567 * w32fns.c <w32_unicode_gui>: New static variable.
1568 (globals_of_w32fns): Initialize it according to os_subtype.
1569 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
1570 testing os_subtype.
1571
39cb9e56 15722012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
1573 Eli Zaretskii <eliz@gnu.org>
1574
1575 Fix bug #10299 with Unicode characters sent by customized
1576 keyboards created by MSKLC.
1577 * w32fns.c (INIT_WINDOW_CLASS): New macro.
1578 (w32_init_class): Use it to initialize the Emacs class with either
1579 ANSI or Unicode API calls.
1580 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
1581 later.
1582 (w32_wnd_proc): If the character code sent by WM_CHAR or
1583 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
1584 original message. Call DefWindowProcW on NT and later.
1585
9374581a
GM
15862012-08-10 Glenn Morris <rgm@gnu.org>
1587
4b94e8cf
GM
1588 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
1589
9374581a
GM
1590 * lisp.h (DIRECTORY_SEP): Let configure set it.
1591
a2752828
DA
15922012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
1593
1594 Use TSET for write access to Lisp_Object slots of struct terminal.
1595 * termhooks.h (TSET): New macro.
1596 * coding.c, terminal.c, xselect.c: Adjust users.
1597
cc92c454
SM
15982012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
1599
1600 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
1601 the failing expression, include them in the error message.
1602 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
1603 * lisp.h (internal_condition_case_n): Update declaration.
1604
4cb3e6b3
DA
16052012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1606
1607 Inline functions to examine and change buffer overlays.
1608 * buffer.c (unchain_both): New function.
1609 * buffer.h (buffer_get_overlays, buffer_set_overlays):
1610 (buffer_has_overlays): New function.
1611 (enum overlay_type): New enum.
1612 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
1613 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
1614
8707c1e5
DA
16152012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1616
1617 Inline functions to examine and change buffer intervals.
1618 * alloc.c (mark_interval_tree): Remove.
1619 (MARK_INTERVAL_TREE): Simplify.
1620 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
1621 * intervals.c (buffer_balance_intervals): New function.
1622 (graft_intervals_into_buffer): Adjust indentation.
1623 (set_intervals_multibyte): Simplify.
1624 * buffer.h (BUF_INTERVALS): Remove.
1625 (buffer_get_intervals, buffer_set_intervals): New function.
1626 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
1627 * intervals.c, textprop.c: Adjust users.
1628
ad8c997f
DA
16292012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1630
1631 Inline functions to examine and change string intervals.
1632 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
1633 (string_get_intervals, string_set_intervals): New function.
1634 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1635 * lread.c, print.c, textprop.c: Adjust users.
1636
32ac3a6b
GM
16372012-08-08 Glenn Morris <rgm@gnu.org>
1638
1639 * lisp.mk (lisp): Remove language/persian.elc.
1640
77c7bcb1
DA
16412012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1642
1643 Cleanup intervals.
1644 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
1645 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
1646 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
1647 Adjust comment. Move under #if 0.
77c7bcb1
DA
1648 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1649 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
1650
9c08a8d4
DA
16512012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1652
1653 Check total length of intervals with eassert.
1654 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
1655 * intervals.c: Change all users to eassert.
1656
26d16b35
EZ
16572012-08-07 Eli Zaretskii <eliz@gnu.org>
1658
14ae4239
BT
1659 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
1660 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
1661 INTERNAL_FIELD in Lisp_Cons.
1662
c644523b
DA
16632012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1664
1665 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
1666 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
1667 name since all xname users are fixed long time ago. Do not
1668 use INTERNAL_FIELD.
1669 (set_symbol_name, set_symbol_function, set_symbol_plist):
1670 (set_symbol_next, set_overlay_plist): New function.
1671 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
1672 (struct Lisp_Overlay): Likewise.
1673 (CVAR, MVAR, SVAR): Remove.
1674 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
1675 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
1676 * xterm.c: Adjust users.
1677 * .gdbinit: Change to use name field of struct Lisp_Symbol
1678 where appropriate.
1679
6a3d20cc
DA
16802012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1681
1682 Basic functions to set Lisp_Object and pointer slots of intervals.
1683 * intervals.h (interval_set_parent, interval_set_object):
1684 (interval_set_left, interval_set_right, interval_set_plist):
1685 (interval_copy_parent): New function.
1686 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
1687 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
1688 Adjust indentation.
6a3d20cc
DA
1689 (INTERVAL_SIZE): Remove. Adjust users.
1690 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
1691
4d2b044c
DA
16922012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1693
1694 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
1695 * process.h (PGET): Remove.
1696 (struct Lisp_Process): Do not use INTERNAL_FIELD.
1697 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1698
d3d50620
DA
16992012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1700
1701 Drop WGET and revert read access to Lisp_Objects slots of struct window.
1702 * window.h (WGET): Remove.
1703 (struct window): Do not use INTERNAL_FIELD.
1704 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1705 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1706 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1707 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1708 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1709 Adjust users.
1710
d10a51dc
CY
17112012-08-07 Chong Yidong <cyd@gnu.org>
1712
1713 * window.c (Fwindow_edges, Fwindow_pixel_edges)
1714 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
1715 (Fdelete_window_internal): Signal an error if the window is not on
1716 a live frame (Bug#12025).
1717
e69b0960
DA
17182012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1719
1720 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
1721 * frame.h (FGET): Remove.
1722 (struct frame): Do not use INTERNAL_FIELD.
1723 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1724 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1725 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1726 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1727
25a20a3a
JB
17282012-08-06 Juanma Barranquero <lekktu@gmail.com>
1729
1730 * w32.c: Silence compiler warnings.
1731 (map_w32_filename): Remove unused variable `is_fat'.
1732 (chase_symlinks): Add parentheses around expression.
1733
1c6f11f4
GM
17342012-08-06 Glenn Morris <rgm@gnu.org>
1735
1db4583a
GM
1736 * sysdep.c: Respect BROKEN_GETWD.
1737
1c6f11f4
GM
1738 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
1739 Let configure handle it.
1740 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
1741
2b90362b
DA
17422012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1743
1744 Use GCALIGNMENT where appropriate.
1745 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
1746 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
1747 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
1748
5f50daf2
EZ
17492012-08-06 Eli Zaretskii <eliz@gnu.org>
1750
14ae4239
BT
1751 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
1752 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 1753
cbcc7007
SM
17542012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
1755
1756 * buffer.h (struct buffer): Revert `indirections' to a simple int;
1757 that should be sufficient for everyone.
1758
4d365fa4
JD
17592012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1760
1761 * keyboard.c (timer_check_2): Add break so timer_check returns next
1762 timeout.
1763
dd86bd82
DA
17642012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1765
1766 Fix Windows build errors introduced after converting to WGET and WSET.
1767 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
1768 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1769
054e1668
JD
17702012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1771
1772 * nsterm.m (ns_frame_rehighlight): Use FSET.
1773
1774 * nsmenu.m (ns_update_menubar): Use FSET.
1775
21238f11
DA
17762012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1777
1778 Separate read and write access to Lisp_Object slots of Lisp_Process.
1779 * process.h (PGET, PSET): New macros similar to AREF and ASET.
1780 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1781
077288cf
DA
17822012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1783
1784 Separate read and write access to Lisp_Object slots of struct window.
1785 * window.h (WGET, WSET): New macros similar to AREF and ASET.
1786 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1787 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1788 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1789 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1790 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1791 Adjust users.
1792
71688bd7
DA
17932012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1794
1795 Fix Windows build errors introduced after converting to FGET and FSET.
1796 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
1797 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
1798 (w32_judge_scroll_bars): Change to use FSET.
1799 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1800
f99bac93
DA
18012012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1802
1803 Fix replacement typo.
1804 * window.c (replace_window): Set root_window instead of
1805 selected_window. This fixes a total window subsystem
1806 malfunction reported by Bastien Guerry <bzg@gnu.org>.
1807
8c2a0f2d
GM
18082012-08-06 Glenn Morris <rgm@gnu.org>
1809
1810 * lisp.mk (lisp): Add language/persian.elc.
1811
edd74c35
DA
18122012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1813
1814 Separate read and write access to Lisp_Object slots of struct frame.
1815 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
1816 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1817 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1818 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1819 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1820
8671676c
AS
18212012-08-05 Andreas Schwab <schwab@linux-m68k.org>
1822
1823 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
1824
663e2b3f
DA
18252012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
1826
1827 Generalize common compile-time constants.
1828 * lisp.h (header_size, bool_header_size, word_size): Now here.
1829 (struct Lisp_Vector): Add comment.
1830 (struct Lisp_Bool_Vector): Move up to define handy constants.
1831 (VECSIZE, PSEUDOVECSIZE): Simplify.
1832 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
1833 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
1834 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
1835 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
1836 * xfont.c, xmenu.c: Use word_size where appropriate.
1837
d32e47af
LM
18382012-08-05 Lawrence Mitchell <wence@gmx.li>
1839
1840 * search.c (Freplace_match): Treat \? in the replacement text
1841 literally (Bug#8161).
1842
e5d9c0d1
CY
18432012-08-05 Chong Yidong <cyd@gnu.org>
1844
1845 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
1846 * frame.c (Vdelete_frame_functions):
1847 * emacs.c (Vkill_emacs_hook): Doc fix.
1848
8da0576b
EZ
18492012-08-04 Eli Zaretskii <eliz@gnu.org>
1850
1851 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
1852 --with-x-toolkit=no builds.
1853 Reported by Carsten Mattner <carstenmattner@gmail.com>.
1854
02676e5d
CY
18552012-08-04 Chong Yidong <cyd@gnu.org>
1856
1857 * syntax.c (Fmodify_syntax_entry): Doc fix.
1858
97147da9
EZ
18592012-08-04 Eli Zaretskii <eliz@gnu.org>
1860
76151e2c
EZ
1861 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
1862 * w32.c (init_environment): Change the default values of many
1863 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
1864 them into environment when they were not already defined.
1865 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 1866 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
1867 (check_windows_init_file): Now external, not static.
1868 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
1869 called when Vload_path is already set up.
1870
1871 * w32.h (check_windows_init_file): Add prototype.
1872
1873 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
1874 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
1875 compatibility with Posix platforms.
1876 (main): Move the call to check_windows_init_file to here from
1877 w32.c.
1878 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
1879 any, in the DEFALT argument into the root of the Emacs build or
1880 installation tree, as appropriate.
1881
1882 * callproc.c (init_callproc_1): Call decode_env_path instead of
1883 doing its equivalent by hand.
1884 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
1885 the code that sets Vexec_path run on MS-Windows.
1886
1887 * lread.c (init_lread): Add comments to #ifdef's.
1888
97147da9
EZ
1889 * msdos.c (dos_set_window_size, IT_update_begin)
1890 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
1891 instead of direct references.
1892
185ee146
PE
18932012-08-04 Paul Eggert <eggert@cs.ucla.edu>
1894
1895 Export DEFAULT_REHASH_* to GDB.
1896 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
1897 Now constants, not macros.
1898
8834c57a
PE
18992012-08-03 Paul Eggert <eggert@cs.ucla.edu>
1900
98c6f1e3
PE
1901 Remove unnecessary casts involving pointers.
1902 These casts are no longer needed now that we assume C89 or later,
1903 since they involve casting to or from void *.
1904 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
1905 (make_pure_float, make_pure_vector):
1906 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
1907 * macros.c (Fstart_kbd_macro):
1908 * menu.c (find_and_return_menu_selection):
1909 * minibuf.c (read_minibuf_noninteractive):
1910 * sysdep.c (closedir):
1911 * xdisp.c (x_produce_glyphs):
1912 * xfaces.c (compare_fonts_by_sort_order):
1913 * xfns.c (x_real_positions, select_visual):
1914 * xselect.c (x_stop_queuing_selection_requests)
1915 (x_get_window_property, x_get_window_property_as_lisp_data):
1916 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
1917 Remove unnecessary pointer casts.
1918 * alloc.c (record_xmalloc): New function.
1919 * lisp.h (record_xmalloc): New decl.
1920 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
1921 more like a function. This is because the pointer cast is not
1922 needed. All uses changed.
1923 * print.c (print_string, print_error_message): Avoid length recalc.
1924
8834c57a
PE
1925 Improve fix for macroexp crash with debugging (Bug#12118).
1926 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
1927 ARRAY_MARK_FLAG when checking subscripts, because ASET is
1928 not supposed to be invoked from the garbage collector.
1929 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
1930 (gc_aset): New function, which is like ASET but can be
1931 used in the garbage collector.
1932 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1933 (set_hash_index): Use it instead of ASET.
1934
6dad7178
EZ
19352012-08-03 Eli Zaretskii <eliz@gnu.org>
1936
1937 Support symlinks on latest versions of MS-Windows.
1938 * w32.c: Include winioctl.h and aclapi.h.
1939 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
1940 (revert_to_self): Forward declarations of static functions.
1941 <static BOOL g_b_init_get_security_info>:
1942 <g_b_init_create_symbolic_link>: New static flags.
1943 (globals_of_w32): Initialize them to zero.
1944 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
1945 (map_w32_filename): Improve commentary. Simplify switch.
1946 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
1947 headers (most versions of MinGW w32api don't).
1948 (get_security_info, create_symbolic_link)
1949 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
1950 New functions.
1951 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
1952 in the argument file name.
1953 (sys_access): Call unc_volume_file_attributes only if
1954 GetFileAttributes fails with network-related error codes.
1955 (sys_rename): Diagnose renaming of a symlink when the user doesn't
1956 have the required privileges.
14ae4239 1957 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
1958 get_file_security_desc.
1959 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
1960 with addition of handling of symlinks and support for 'lstat'.
1961 If possible, get file's attributes and security information by
6dad7178
EZ
1962 handle, not by name. Produce S_IFLNK bit for symlinks, when
1963 called from 'lstat'.
1964 (stat, lstat): New functions, call 'stat_worker'.
1965 (symlink, readlink, careadlinkat): Rewritten to create and resolve
1966 symlinks when the underlying filesystem supports them.
1967
f162bcc3
PE
19682012-08-02 Paul Eggert <eggert@cs.ucla.edu>
1969
79ea6c20
PE
1970 Fix macroexp crash on Windows with debugging (Bug#12118).
1971 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
1972 checking subscripts; problem introduced with the recent
1973 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
1974 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
1975 since it's used in non-static inline functions now.
1976
c0ce93fd
PE
1977 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
1978 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 1979
f162bcc3
PE
1980 Use C99-style 'extern inline' if available.
1981 * buffer.h (BUFFER_INLINE):
1982 * category.h (CATEGORY_INLINE):
1983 * character.h (CHARACTER_INLINE):
1984 * charset.h (CHARSET_INLINE):
1985 * composite.h (COMPOSITE_INLINE):
1986 * dispextern.h (DISPEXTERN_INLINE):
1987 * lisp.h (LISP_INLINE):
1988 * systime.h (SYSTIME_INLINE):
1989 New macro, replacing 'static inline' in this header.
1990 * buffer.h, category.h, character.h, charset.h, composite.h:
1991 * dispextern.h, lisp.h, systime.h:
1992 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1993 * alloc.c (LISP_INLINE):
1994 * buffer.c (BUFFER_INLINE):
1995 * category.c (CATEGORY_INLINE):
1996 * character.c (CHARACTER_INLINE):
1997 * charset.c (CHARSET_INLINE):
1998 * composite.c (COMPOSITE_INLINE):
1999 * dispnew.c (DISPEXTERN_INLINE):
2000 * sysdep.c (SYSTIME_INLINE):
2001 Define to EXTERN_INLINE, so that the corresponding functions
2002 are compiled into code.
2003 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
2004 (INLINE_HEADER_END): New macros.
2005 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
2006 since it's used in non-static inline functions now.
a8333d03 2007 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 2008
837b365b
GM
20092012-08-02 Glenn Morris <rgm@gnu.org>
2010
d66b744d
GM
2011 * s/: Remove empty directory.
2012
837b365b
GM
2013 * s/ms-w32.h: Move to ../nt/inc.
2014 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
2015 Update for new ms-w32.h location.
2016
13294f95
PE
20172012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2018
2019 Port to Solaris 8.
2020 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
2021
90df0db3
GM
20222012-08-02 Glenn Morris <rgm@gnu.org>
2023
2024 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
2025 hard-coding the path separator.
2026
4939150c
PE
20272012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2028
2029 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
2030 This how ASET and AREF are supposed to work, and makes
2031 it easier to think about future improvements. See
2032 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
2033 * charset.h (set_charset_attr): New function.
2034 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
2035 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
2036 (aref_addr): New function. All uses of &AREF(...) changed.
2037 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2038 (set_hash_index): New functions. All lvalue-style uses of
2039 HASH_KEY etc. changed.
2040 * keyboard.c (set_prop): New function. All lvalue-style uses
2041 of PROP changed.
2042
947b2afd
AA
20432012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
2044
2045 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
2046 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
2047 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
2048 * nsfns.m (ns_set_name_as_filename): Likewise.
2049 * nsmenu.m (ns_update_menubar): Likewise.
2050 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
2051
4f5d0325
EZ
20522012-08-01 Eli Zaretskii <eliz@gnu.org>
2053
2008beae
EZ
2054 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
2055 Adapt to latest changes in field names of the corresponding Lisp
288479f6 2056 objects.
2008beae 2057
4f5d0325
EZ
2058 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
2059
fe3cc771
GM
20602012-08-01 Glenn Morris <rgm@gnu.org>
2061
2062 * s/msdos.h: Remove file.
2063 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
2064 * Makefile.in (S_FILE): Remove.
2065 (config_h): Remove S_FILE.
2066
c90acc54
JB
20672012-08-01 Juanma Barranquero <lekktu@gmail.com>
2068
2069 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
2070 Remove; moved to nt/config.nt.
2071
d8a05828
DA
20722012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2073
2074 Use INTERNAL_FIELD for conses and overlays.
2075 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
2076 Remove obsolete comment.
2077 (MVAR): New macro.
2078 (struct Lisp_Overlay): Use INTERNAL_FIELD.
2079 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
2080
8271d590
DA
20812012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2082
2083 Use INTERNAL_FIELD for symbols.
2084 * lisp.h (SVAR): New macro. Adjust users.
2085 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
2086 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
2087
3193acd2
DA
20882012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2089
2090 Use INTERNAL_FIELD for processes.
2091 * process.h (PVAR): New macro. Adjust style.
2092 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
2093 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
2094
3a45383a
DA
20952012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2096
2097 Use INTERNAL_FIELD for windows.
2098 * window.h (WVAR): New macro.
2099 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
2100 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2101 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2102 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
2103 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
2104 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2105
c1dbc63c
PE
21062012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2107
2108 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
2109
5c0c0e8a
GM
21102012-08-01 Glenn Morris <rgm@gnu.org>
2111
2112 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
2113 Move to configure.ac.
2114
552a99b4
JB
21152012-08-01 Juanma Barranquero <lekktu@gmail.com>
2116
2117 * makefile.w32-in (CONFIG_H): Update dependencies.
2118 (CONF_POST_H): New macro.
2119
2120 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
2121
8d8e2dfe
GM
21222012-07-31 Glenn Morris <rgm@gnu.org>
2123
bc96620a
GM
2124 * Makefile.in (S_FILE): No longer set by configure.
2125
476b1b2d
GM
2126 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
2127 is available.
2128 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
2129
b2c7a106
GM
2130 * process.h (NULL_DEVICE):
2131 * emacs.c (SEPCHAR):
2132 * editfns.c (USER_FULL_NAME): Let configure set them.
2133
d53d062a
GM
2134 * s/README, s/template.h: Remove files.
2135
4515017f
GM
2136 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
2137
8d8e2dfe
GM
2138 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
2139 Move to configure.ac.
2140
5b20b3cc
EZ
21412012-07-31 Eli Zaretskii <eliz@gnu.org>
2142
1e0afd9a
EZ
2143 * .gdbinit (xframe): Adapt to introduction of FVAR and the
2144 resulting renaming of 'struct frame' members.
2145
5b20b3cc
EZ
2146 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
2147
2148 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
2149 after introduction of FVAR.
2150
f1310128
JD
21512012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2152
79e721e0
JD
2153 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
2154
2155 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
2156 instead of compositeToPoint.
2157 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
2158
8d7c7eed 2159 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 2160
e34f7f79
DA
21612012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2162
2163 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
2164 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 2165 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
2166 (BVAR): Change to use INTERNAL_FIELD.
2167 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
2168 (KVAR): Change to use INTERNAL_FIELD.
2169 * frame.h (FVAR): New macro.
2170 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
2171 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
2172 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
2173 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
2174 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2175
c09bfb2f
DA
21762012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2177
2178 Miscellaneous fixes for non-default X toolkits.
2179 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
2180 * xterm.c (x_frame_of_widget): Remove redundant prototype.
2181 Move under #ifdef USE_LUCID.
2182 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
2183 definition and usage to avoid warnings.
2184
14c114ae
JD
21852012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2186
2187 * nsterm.m (openFiles): Fix previous checkin.
2188
3bd21e82
PE
21892012-07-31 Paul Eggert <eggert@cs.ucla.edu>
2190
2191 * indent.c (compute_motion): Remove unused local.
2192
c1529ded
GM
21932012-07-31 Glenn Morris <rgm@gnu.org>
2194
400d5621
GM
2195 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
2196
268e2432
GM
2197 * conf_post.h [USG5_4]:
2198 Move remaining contents of s/usg5-4-common.h here.
2199 * s/usg5-4-common.h: Remove file.
2200
7552f3ee
GM
2201 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
2202 * s/irix6-5.h: Remove file.
2203
6a381852
GM
2204 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
2205 * s/darwin.h: Remove file.
2206
c1529ded
GM
2207 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
2208 * s/hpux10-20.h: Remove file, which is now empty.
2209
b429a4ee
GM
22102012-07-30 Glenn Morris <rgm@gnu.org>
2211
2212 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
2213 * Makefile.in (config_h): Add conf_post.h.
2214 * makefile.w32-in (CONFIG_H): Add conf_post.h.
2215
adff3182
JD
22162012-07-30 Jan Djärv <jan.h.d@swipnet.se>
2217
2218 * nsterm.m (ns_do_open_file): New variable.
b9031d69 2219 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
2220 (openFile, openTempFile, openFileWithoutUI, openFiles):
2221 Open files only if ns_do_open_file.
adff3182 2222
c32af1e4
PE
22232012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2224
7393bcbb
PE
2225 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
2226 This no-op macro hasn't been needed for many years.
2227 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
2228
c32af1e4
PE
2229 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
2230 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
2231 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
2232 gdb_make_enums_visible.
2233 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
2234 (DIRECTORY_SEP): Now a constant, not a macro.
2235
302fc036
EZ
22362012-07-30 Eli Zaretskii <eliz@gnu.org>
2237
2238 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
2239 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
2240
2241 * w32term.c <w32_keyboard_codepage>: Renamed from
2242 keyboard_codepage and now external. All users changed.
2243
2244 * w32term.h: Add declaration of w32_keyboard_codepage.
2245
2246 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
2247 the codepage to translate keys to Unicode. If this argument is
2248 -1, use the value returned by GetConsoleCP. All callers changed.
2249
88fb40b4
PE
22502012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2251
0aee6912
PE
2252 Update .PHONY listings in makefiles.
2253 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
2254 bootstrap-clean, distclean, maintainer-clean, versioclean,
2255 extraclean, frc.
2256
88fb40b4
PE
2257 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
2258 This is a bit clearer. Fix some commentary typos.
2259
0a763bd1
GM
22602012-07-30 Glenn Morris <rgm@gnu.org>
2261
32bac6d6
GM
2262 * s/netbsd.h: Let configure include signal.h if needed.
2263 Remove file, which is now empty.
2264
b65e7c46
GM
2265 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
2266 Let configure set them.
2267 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
2268 No more need to undefine.
0a763bd1 2269
169304bd
AS
22702012-07-30 Andreas Schwab <schwab@linux-m68k.org>
2271
2272 * keymap.c (Fkey_description): Don't remove 0x80 bit from
2273 non-single-byte char when adding meta modifier. (Bug#12090)
2274
6cd7a139
DA
22752012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2276
2277 Convert safe_call to use variable number of arguments.
2278 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
2279 (safe_call2): Fix comment.
2280 * lisp.h (safe_call): Adjust prototype.
2281 * coding.c (encode_coding_object): Change to use safe_call2.
2282 * xfaces.c (merge_face_heights): Change to use safe_call1.
2283
d34d6ffc
GM
22842012-07-30 Glenn Morris <rgm@gnu.org>
2285
7b8a48e4 2286 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 2287 does that unconditionally. Remove file, which is now empty.
7b8a48e4 2288
d34d6ffc
GM
2289 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
2290 Remove empty files.
2291
03a660a6
PE
22922012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2293
2294 Export to GDB most of lisp.h's remaining object-like macros.
2295 * lisp.h (min, max): Move earlier, because they're used earlier now.
2296 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
2297 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
2298 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
2299 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
2300 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
2301 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
2302 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
2303 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
2304 Now constants, for GDB. They need not be macros.
2305 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
2306 Now constants, for GDB, as well as macros, for static initializers.
2307 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
2308 Move to after the definition of struct Lisp_Char_Table,
2309 since the former now needs that type defined.
2310 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
2311 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
2312 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
2313 New enums, for gdb_make_enums_visible.
2314 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 2315 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
2316 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
2317 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
2318 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
2319 enum maxargs, enum MAX_ALLOCA.
2320 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
2321 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
2322 no longer needed, now that they are done in lisp.h.
2323
e499d0ee
DA
23242012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2325
2326 Cleanup string bytes checking.
2327 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
2328 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
2329 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
2330 (check_sblock, compact_small_strings): Simplify.
2331
d5040d2d
PE
23322012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2333
2334 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
2335 These macros are confusing and no longer need to be defined, as
2336 the enum values now suffice. All uses replaced with definiens.
2337 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
2338
7f259ae6
JB
23392012-07-29 Juanma Barranquero <lekktu@gmail.com>
2340
2341 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
2342 ($(BLD)/w32console.$(O)): Update dependencies.
2343
7e63e0c3
DA
23442012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2345
2346 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
2347 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
2348 time. Adjust users.
2349 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
2350
ffd817eb
JD
23512012-07-29 Jan Djärv <jan.h.d@swipnet.se>
2352
2353 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
2354 setting sitelisp (Bug#12010).
2355
417a7a0e
EZ
23562012-07-29 Eli Zaretskii <eliz@gnu.org>
2357
14ae4239 2358 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
2359
2360 * w32heap.c (cache_system_info):
2361 * w32.c (sys_rename):
2362 * w32proc.c (find_child_console, sys_kill): All users changed.
2363
387d4d92
PE
23642012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2365
2366 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
2367
55a6cca6
EZ
23682012-07-29 Eli Zaretskii <eliz@gnu.org>
2369
2370 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
2371
dbcf001c
DA
23722012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2373
2374 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
2375 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
2376 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 2377
e2688e4a
DA
23782012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2379
2380 Generalize marker debugging code under MARKER_DEBUG and use eassert.
2381 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
2382 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
2383 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
2384 (replace_range, replace_range_2, del_range_2): Change to eassert.
2385 * marker.c (byte_char_debug_check): Adjust style.
2386
b46a6a83
PE
23872012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2388
2389 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
2390 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
2391 long-ago-commented-out code that talks about "WIN32".
2392 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
2393 All uses changed.
2394
e32a5799
PE
23952012-07-28 Paul Eggert <eggert@cs.ucla.edu>
2396
2397 Use Gnulib stdalign module (Bug#9772, Bug#9960).
2398 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
2399 Simplify by using alignof.
2400 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
2401 * lisp.h: Include <stdalign.h>.
2402 (GCALIGNMENT): New macro and constant.
2403 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
2404 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
2405 (stdalign): New macro, if not already defined.
2406
df81cd29
EZ
24072012-07-28 Eli Zaretskii <eliz@gnu.org>
2408
01bd1b0d
EZ
2409 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
2410 * w32inevt.c: Include w32inevt.h.
2411 (w32_read_console_input): New inline function, calls either
2412 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
2413 w32_console_unicode_input.
2414 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
2415 (w32_kbd_patch_key, key_event): Use the codepage returned by
2416 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
2417 (key_event): use uChar.UnicodeChar only if
2418 w32_console_unicode_input is non-zero.
2419
2420 * w32console.c: Include w32heap.h.
2421 <w32_console_unicode_input>: New global variable.
2422 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
2423 family of Windows, zero otherwise.
2424
2425 * w32inevt.h: Declare w32_console_unicode_input.
2426
df81cd29
EZ
2427 * xdisp.c (init_iterator): Don't reference tip_frame in a build
2428 --without-x. (Bug#11742)
2429
c20fdd9e
PE
24302012-07-27 Paul Eggert <eggert@cs.ucla.edu>
2431
2432 Adjust GDB to reflect pvec_type changes (Bug#12036).
2433 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
2434 2012-07-04 changes to pseudovector representation.
2435 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 2436
32770973 24372012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
2438
2439 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
2440 bus address.
2441 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
2442
3438fe21
EZ
24432012-07-27 Eli Zaretskii <eliz@gnu.org>
2444
bcfbc9de
EZ
2445 * alloc.c (listn): Fix the order the arguments are consed onto the
2446 list.
2447
3438fe21
EZ
2448 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
2449 enumeration constants, as PURE and HEAP are too general, and clash
2450 with other headers and sources, such as gmalloc.c and the
2451 MS-Windows system headers. All users changed.
2452
eeaea515
DA
24532012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2454
2455 Revert last save_excursion_save and save_excursion_restore changes.
2456 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
2457 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
2458
073c88c2
DA
24592012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2460
2461 Fix recently-introduced typos in Windows port.
2462 Reported by Martin Rudalics <rudalics@gmx.at>.
2463 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 2464 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 2465
4706125e
PE
24662012-07-27 Paul Eggert <eggert@cs.ucla.edu>
2467
2468 Improve GDB symbol export (Bug#12036).
2469 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
2470 arms of an 'if', not using conditional expressions; otherwise GDB
2471 complains about the types in the unevaluated arm when the argument
2472 is an integer literal.
2473 (xgetint): Simplify expression.
2474 * alloc.c (gdb_make_enums_visible): New constant. This ports to
2475 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
2476 Zaretskii in <http://bugs.gnu.org/12036#13>.
2477 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
2478 needed now that we have gdb_make_enums_visible.
2479 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
2480 (enum enum_USE_LSB_TAG):
2481 New enum types, packaging up enums that need to be exported to GDB.
2482
694b6c97
DA
24832012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2484
2485 Utility function to make a list from specified amount of objects.
2486 * lisp.h (enum constype): New datatype.
2487 (listn): New prototype.
2488 * alloc.c (listn): New function.
2489 (Fmemory_use_count, syms_of_alloc): Use it.
2490 * buffer.c (syms_of_buffer): Likewise.
2491 * callint.c (syms_of_callint): Likewise.
2492 * charset.c (define_charset_internal): Likewise.
2493 * coding.c (syms_of_coding): Likewise.
2494 * keymap.c (syms_of_keymap): Likewise.
2495 * search.c (syms_of_search): Likewise.
2496 * syntax.c (syms_of_syntax): Likewise.
2497 * w32.c (init_environment): Likewise.
2498 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
2499 * xdisp.c (syms_of_xdisp): Likewise.
2500 * xfns.c (syms_of_xfns): Likewise.
2501
6195f384
DA
25022012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2503
2504 Fast save_excursion_save and save_excursion_restore.
2505 * lisp.h (struct Lisp_Excursion): New data type.
2506 (PVEC_EXCURSION): New pseudovector type.
2507 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
2508 to deal with it. Adjust comments.
2509 (init_marker, attach_marker): New prototype.
2510 (unchain_marker): Adjust prototype.
2511 * marker.c (attach_marker): Change to global.
2512 (init_marker): New function.
2513 * alloc.c (Fmake_marker, build_marker): Use it.
2514 (build_marker): More easserts.
2515 (mark_object): Handle struct Lisp_Excursion.
2516 * editfns.c (save_excursion_save, save_excursion_restore):
2517 Reimplement to use struct Lisp_Excursion. Add comments.
2518
5eceb8fb
PE
25192012-07-26 Paul Eggert <eggert@cs.ucla.edu>
2520
2521 Fix export of symbols to GDB (Bug#12036).
2522 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
2523 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
2524 emacs.c, as this is a more-suitable home. Had this been done earlier
2525 the fix for 12036 would have avoided some of the problems noted in
2526 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
2527 would have been more obvious.
562157c8
PE
2528 * emacs.c: Do not include <verify.h>; no longer needed.
2529 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
2530 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
2531 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
2532 Remove; now done in lisp.h.
2533 * lisp.h (PUBLISH_TO_GDB): New macro.
2534 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
2535 (DATA_SEG_BITS): Use it.
2536 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
2537 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
2538 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
2539 not be usable in #if. This simplifies things.
2540
d6749401
JB
25412012-07-26 Juanma Barranquero <lekktu@gmail.com>
2542
2543 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
2544
1781b9e9
PE
25452012-07-26 Paul Eggert <eggert@cs.ucla.edu>
2546
d89518db 2547 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
2548 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
2549 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
2550 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
2551 Adjust to changes in lisp.h and emacs.c, by using
2552 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
2553 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
2554 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
2555 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
2556 instead of gdb_valbits.
2557 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
2558 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
2559 instead of gdb_array_mark_flag.
2560 (xboolvector): Get size from $->size, not $->header.size.
2561 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
2562 (xreload, hook-run, hookpost-run): Remove.
2563 * emacs.c: Include <verify.h>.
2564 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
2565 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
2566 Remove.
2567 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
2568 (gdb_USE_LSB_TAG): New enum constants.
2569 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
2570 Also define these as enum constants, so they're visible to GDB.
2571 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
2572 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
2573 as constants, so they're visible to GDB.
2574 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
2575 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
2576 Now enum constants, not macros, so they're visible to GDB.
2577 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
2578 more convenient now. All uses changed.
2579 (VALMASK) [USE_LSB_TAG]: Also define in this case.
2580 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
2581
3628596a
DA
25822012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
2583
2584 Explicitly free restriction data that are not needed anymore.
2585 * editfns.c (save_restriction_restore): Free restriction data.
2586
7abaf5cc
SM
25872012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
2588
2589 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
2590 add argument, tune behavior, and adjust all callers.
2591
71f88e00
PE
25922012-07-25 Paul Eggert <eggert@cs.ucla.edu>
2593
2594 Use typedef for EMACS_INT, EMACS_UINT.
2595 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
2596 than macros. This simplifies debugging in the usual case, since
2597 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
2598 and it allows expressions involving EMACS_INT casts.
2599 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
2600
57ec3034
JD
26012012-07-25 Jan Djärv <jan.h.d@swipnet.se>
2602
2603 * nsterm.m (ns_read_socket): Return early if there is a modal
2604 window (Bug#12043).
2605
8137e7b3
MR
26062012-07-25 Martin Rudalics <rudalics@gmx.at>
2607
2608 * frame.c (Fredirect_frame_focus): In doc-string don't mention
2609 that FOCUS-FRAME can be omitted.
2610
04e9897c
DA
26112012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
2612
2613 Adjust buffer text indirection counters at the end of Fkill_buffer.
2614 * buffer.c (Fkill_buffer): Adjust indirection counters when the
2615 buffer is definitely dead. This should really fix an issue reported
2616 by Christoph Scholtes again. (Bug#12007).
2617 (init_buffer_once): Initialize indirection counters of
2618 buffer_defaults and buffer_local_symbols (for sanity and safety).
2619
8a0484e1
EZ
26202012-07-24 Eli Zaretskii <eliz@gnu.org>
2621
2622 * xdisp.c (init_iterator): Don't compute dimensions of truncation
2623 and continuation glyphs on tooltip frames, leave them at zero.
2624 Avoids continued lines in tooltips. (Bug#11832)
2625
fa691a83
DA
26262012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
2627
2628 Simplify copy_overlay.
04e9897c 2629 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
2630 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
2631
436bc8e0
EZ
26322012-07-23 Eli Zaretskii <eliz@gnu.org>
2633
2634 * print.c (print_object): Don't crash when a frame's name is nil
2635 or invalid. (Bug#12025)
2636
2637 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
2638 it signals an error when a tooltip frame is being created.
2639
d7a7fda3
DA
26402012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
2641
2642 Cleanup miscellaneous objects allocation and initialization.
2643 * alloc.c (allocate_misc): Change to static. Add argument to
2644 specify the subtype. Adjust comment and users.
2645 (build_overlay): New function.
2646 * buffer.c (copy_overlays, Fmake_overlay): Use it.
2647 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
2648 (allocate_misc): Remove prototype.
2649 (build_overlay): Add prototype.
2650
26512012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
2652
2653 Swap buffer text indirection counters in Fbuffer_swap_text.
2654 * buffer.c (Fbuffer_swap_text): Swap indirections too.
2655 This avoids crash reported by Christoph Scholtes at
2656 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
2657
9d7fa573
JD
26582012-07-22 Jan Djärv <jan.h.d@swipnet.se>
2659
2660 * nsmenu.m (Popdown_data): New struct.
2661 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
2662 free Popdown_data.
2663 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
2664 (initWithContentRect): Make imgView and contentView non-static
2665 and autorelease them. Also autorelease img and matrix (Bug#12005).
2666 (dealloc): Remove (Bug#12005).
2667
0dd6d66d
DA
26682012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2669
2670 Adjust consing_since_gc when objects are explicitly freed.
2671 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
2672 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
2673 (free_cons, free_misc): Subtract object size from consing_since_gc.
2674
d36d71df
DA
26752012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2676
2677 Simplify and cleanup markers positioning code.
2678 * marker.c (attach_marker): More useful eassert.
2679 (live_buffer, set_marker_internal): New function.
2680 (Fset_marker, set_marker_restricted): Use set_marker_internal.
2681 (set_marker_both, set_marker_restricted_both): Use live_buffer.
2682
fb9ea40f
PE
26832012-07-22 Paul Eggert <eggert@cs.ucla.edu>
2684
2685 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
2686 as it's limited by the amount of memory, not by INT_MAX.
2687
2d5c5f7d
EZ
26882012-07-21 Eli Zaretskii <eliz@gnu.org>
2689
07fb592e
EZ
2690 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
2691 in special-event-map. See the discussion at
2692 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
2693 for the reasons.
2694
37a9eac8 2695 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
2696 info.dwItemData. Fixes crashes on 64-bit Windows.
2697 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 2698
c4328746
JD
26992012-07-21 Jan Djärv <jan.h.d@swipnet.se>
2700
2701 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 2702 (conversationIdentifier): Return value is NSInteger.
784051c4 2703 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 2704
6e5d1c12
CY
27052012-07-21 Chong Yidong <cyd@gnu.org>
2706
2707 * window.c (decode_any_window): Signal an error if the window is
2708 on a dead frame (Bug#11984).
2709
9928463d
DA
27102012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2711
2712 Add indirection counting to speed up Fkill_buffer.
2713 * buffer.h (struct buffer): New member.
2714 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
2715 (Fmake_indirect_buffer): Set indirection counter to -1, increment
2716 base buffer indirection counter.
2717 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
2718 (Fkill_buffer): Adjust indirection counters as needed, don't walk
2719 through buffer list if indirection counter is 0.
2720
f8643a6b
DA
27212012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2722
2723 Extend the value returned by Fgarbage_collect with heap statistics.
2724 * alloc.c (Qheap): New symbol.
2725 (syms_of_alloc): DEFSYM it.
2726 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
2727 (Fmemory_free): Remove.
2728 (syms_of_alloc): Don't defsubr it.
2729 * buffer.c (Fcompact_buffer): Remove.
2730 (syms_of_buffer): Don't defsubr it.
2731
dac616ff
DA
27322012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2733
2734 Make maybe_gc inline.
2735 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
2736 * lisp.h (consing_since_gc, gc_relative_threshold)
2737 (memory_full_cons_threshold): Revert declaration.
2738 (maybe_gc): Remove prototype, define as inline.
2739 * alloc.c: Remove old commented-out code.
2740 (consing_since_gc, gc_relative_threshold)
2741 (memory_full_cons_threshold): Revert to global.
2742 (maybe_gc): Remove.
2743
d7ea76b4
DA
27442012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2745
2746 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
2747 * lisp.h (build_unibyte_string): New function.
2748 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
2749 * sysdep.c, w32fns.c, xfns.c: Use it.
2750 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
2751 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
2752 Adjust users accordingly.
2753 * font.h (font_open_by_name): Adjust prototype.
2754
765e61e3
DA
27552012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2756
2757 Cleanup calls to Fgarbage_collect.
2758 * lisp.h (maybe_gc): New prototype.
2759 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2760 Remove declarations.
2761 * alloc.c (maybe_gc): New function.
2762 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2763 Make them static.
2764 * bytecode.c (MAYBE_GC): Use maybe_gc.
2765 * eval.c (eval_sub, Ffuncall): Likewise.
2766 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
2767 to avoid dependency from auto-save feature.
2768
52b852c7
PE
27692012-07-19 Paul Eggert <eggert@cs.ucla.edu>
2770
2771 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
2772 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
2773 'for_each_per_buffer_object_at'.
2774 All uses changed. It's better to use upper-case for macros that
2775 cannot be implemented as functions, to give the reader a clue
2776 that they're special.
2777
5db81e33
SM
27782012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
2779
2780 * alloc.c (Fgarbage_collect): Tweak docstring.
2781
5b835e1d
DA
27822012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2783
2784 Tweak the value returned from Fgarbage_collect again.
2785 * alloc.c (Fgarbage_collect): New return value, as confirmed in
2786 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
2787 Adjust documentation.
2788 (total_vector_bytes): Rename to total_vector_slots, adjust
2789 accounting.
2790 (total_free_vector_bytes): Rename to total_free_vector_slots,
2791 adjust accounting.
2792 (Qstring_bytes, Qvector_slots): New symbols.
2793 (syms_of_alloc): DEFSYM them.
2794
9cd47b72
DA
27952012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2796
2797 Buffer compaction primitive which may be used from Lisp.
2798 * buffer.c (compact_buffer, Fcompact_buffer): New function.
2799 (syms_of_buffer): Register Fcompact_buffer.
2800 * alloc.c (Fgarbage_collect): Use compact_buffer.
2801 * buffer.h (compact_buffer): New prototype.
2802 (struct buffer_text): New member.
2803
d17337e5
DA
28042012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2805
2806 New macro to iterate over all buffers, miscellaneous cleanups.
2807 * lisp.h (all_buffers): Remove declaration.
2808 * buffer.h (all_buffers): Add declaration, with comment.
2809 (for_each_buffer): New macro.
2810 * alloc.c (Fgarbage_collect, mark_object): Use it.
2811 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
2812 (init_buffer): Likewise.
2813 * data.c (Fset_default): Likewise.
2814 * coding.c (code_conversion_restore): Remove redundant check
2815 for dead buffer.
2816 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
2817
60cfd278
AS
28182012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2819
2820 Fix bug that created negative-length intervals.
2821 * intervals.c (merge_interval_right, merge_interval_left):
2822 Do not zero out this interval if it is absorbed by its children,
2823 as this interval's total length doesn't change in that case. See
2824 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
2825
d06714cb
PE
28262012-07-18 Paul Eggert <eggert@cs.ucla.edu>
2827
83713154
PE
2828 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
2829 when invoking (make-bool-vector N t) and N is a positive
2830 multiple of 8 -- the last 8 bits were mistakenly cleared.
2831
d06714cb
PE
2832 Remove some struct layout assumptions in bool vectors.
2833 * alloc.c (bool_header_size): New constant.
2834 (header_size, word_size): Move earlier, as they're now used earlier.
2835 Use 'word_size' in a few more places, where it's appropriate.
2836 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
2837 padding before the data member of a bool vector.
2838 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
2839 than doing the check by hand with an abort ().
2840
464d5a5e
SM
28412012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
2842
5fbc0409
SM
2843 * eval.c (Fdefvar): Don't check constants since we only set the var if
2844 it's not yet defined anyway (bug#11904).
2845
464d5a5e
SM
2846 * lisp.h (last_undo_boundary): Declare new var.
2847 * keyboard.c (command_loop_1): Set it.
2848 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
2849 were auto-added by the command loop (bug#11774).
2850
8dc2e44a
AS
28512012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2852
2853 * w32font.c (Qsymbol): Remove local definition.
2854 (syms_of_w32font): Don't DEFSYM it.
2855
169925ec
DA
28562012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2857
2858 Fix sweep_vectors to handle large bool vectors correctly.
2859 * alloc.c (sweep_vectors): Account total_vector_bytes for
2860 bool vectors larger than VBLOCK_BYTES_MAX.
2861
5fbfb018
CY
28622012-07-18 Chong Yidong <cyd@gnu.org>
2863
2864 * frame.c (x_set_frame_parameters): Revert bogus change introduced
2865 in 2012-05-25 commit by Paul Eggert (Bug#11738).
2866
3ab6e069
DA
28672012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2868
2869 Return more descriptive data from Fgarbage_collect.
2870 Suggested by Stefan Monnier in
2871 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
2872 * alloc.c (bounded_number): New function.
2873 (total_buffers, total_vectors): New variable.
2874 (total_string_size): Rename to total_string_bytes, adjust users.
2875 (total_vector_size): Rename to total_vector_bytes, adjust users.
2876 (sweep_vectors): Account total_vectors and total_vector_bytes.
2877 (Fgarbage_collect): New return value. Adjust documentation.
2878 (gc_sweep): Account total_buffers.
2879 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
2880 (VECTOR_SIZE): Remove.
2881 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
2882 (Qinterval, Qmisc): New symbols.
2883 (syms_of_data): Initialize them.
2884 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
2885 (Qcons, Qbuffer): New declarations.
2886
6d02fe5b
PE
28872012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2888
2889 * alloc.c (Fmemory_free): Account for memory-free's own storage.
2890 Round up, not down. Improve doc.
2891
b7ffe040
DA
28922012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2893
2894 Restore old code in allocate_string_data to avoid Faset breakage.
2895 Reported by Julien Danjou <julien@danjou.info> in
2896 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
2897 * alloc.c (allocate_string_data): Restore old code with minor
2898 adjustments, fix comment to explain this subtle issue.
2899
4dc7c8d5
SM
29002012-07-17 Eli Zaretskii <eliz@gnu.org>
2901
2902 Remove FILE_SYSTEM_CASE.
2903 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
2904
2905 * fileio.c (FILE_SYSTEM_CASE): Don't define.
2906 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
2907 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
2908 call-process-region passes it through expand-file-name.
2909
2910 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
2911
29122012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2913
2914 Fix crash when creating indirect buffer (Bug#11917)
2915 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
2916 Don't handle unbound variables specially if non-zero.
2917 (Fbuffer_local_variables): Pass zero.
2918 (clone_per_buffer_values): Pass non-zero.
2919
29202012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2921
2922 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
2923 to make the loop interruptible.
2924
29252012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2926
2927 * gnutls.c (emacs_gnutls_handshake): Only retry if
2928 GNUTLS_E_INTERRUPTED.
2929
cce7fefc
DA
29302012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2931
2932 Cleanup and convert miscellaneous checks to eassert.
2933 * alloc.c (mark_interval): Fix comment, partially rephrase
2934 old comment from intervals.h (see below).
2935 * intervals.c (find_interval, adjust_intervals_for_insertion)
2936 (delete_interval, adjust_intervals_for_deletion)
2937 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
2938 Convert to eassert.
2939 (adjust_intervals_for_insertion, make_new_interval):
2940 Remove obsolete and unused code.
2941 * intervals.h (struct interval): Remove obsolete comment.
2942 * textprotp.c (erase_properties): Remove unused code.
2943 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
2944 (Fremove_list_of_text_properties): Convert to eassert.
2945
9ea10cc3
CY
29462012-07-17 Chong Yidong <cyd@gnu.org>
2947
2948 * editfns.c (Finsert_char): Doc fix.
2949
3900d5de
DA
29502012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2951
2952 Fix previous change to make Fmemory_free always accurate.
2953 * alloc.c (make_interval): Update total_free_intervals.
2954 (make_float): Likewise for total_free_floats.
2955 (free_cons, Fcons): Likewise for total_free_conses.
2956 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
2957 Likewise for total_free_vector_bytes.
2958 (Fmake_symbol): Likewise for total_free_symbols.
2959 (bytes_free): Remove.
2960
7098646f
DA
29612012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2962
2963 Simple free memory accounting feature.
2964 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
2965 (sweep_vectors): Accumulate size of free vectors.
2966 (Fgarbage_collect): Setup bytes_free.
2967 (Fmemory_free): New function.
2968 (syms_of_alloc): Register it.
2969
22657b40
DA
29702012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2971
2972 Cleanup overlays checking.
2973 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
2974 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
2975 eassert and OVERLAYP.
2976 (sort_overlays): Change to use OVERLAYP.
2977
ddfc8813
RK
29782012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
2979
2980 * editfns.c (Finsert_char): Make it interactive, and make the
2981 second arg optional. Copy interactive spec and docstring from
2982 ucs-insert.
2983
7c26cf3c
PE
29842012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2985
2986 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
2987 Unlike the other wrapped functions, fabs has an unspecified
2988 effect on errno.
2989
5d127af9
JD
29902012-07-16 Jan Djärv <jan.h.d@swipnet.se>
2991
2992 * nsterm.m (keyDown): Interpret flags without left/right bits
2993 as the left key (Bug#11670).
2994
6a0dd1d7
DA
29952012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
2996
2997 Remove empty and useless init functions.
2998 * lisp.h (init_character_once, init_fns, init_image)
2999 (init_filelock, init_sound): Remove prototype.
3000 * character.c (init_character_once): Remove.
3001 * filelock.c (init_filelock): Likewise.
3002 * fns.c (init_fns): Likewise.
3003 * image.c (init_image): Likewise.
3004 * sound.c (init_sound): Likewise.
3005 * emacs.c (main): Adjust accordingly.
3006
7a6136fd
DA
30072012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3008
3009 * gtkutil.h: Tiny cleanups.
3010 (use_old_gtk_file_dialog): Remove useless declaration.
3011 (xg_uses_old_file_dialog): Add suggested const attribute.
3012
ce811ad9
EZ
30132012-07-15 Eli Zaretskii <eliz@gnu.org>
3014
3015 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
3016 (bidi_paragraph_init): Use it to limit search forward for a strong
3017 directional character in abnormally large paragraphs full of
3018 neutral or weak characters. (Bug#11943)
3019
c9adfeaa
SF
30202012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
3021
3022 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
3023 the toolbar (Bug#9451).
3024 (xg_make_tool_item): Give the widget event box a transparent
3025 background.
3026
fff62aa9
DA
30272012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3028
3029 Cleanup basic allocation variables and functions.
3030 * alloc.c (ignore_warnings, init_intervals, init_float)
3031 (init_cons, init_symbol, init_marker): Remove.
3032 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
3033 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
3034 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
3035 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
3036 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
3037 (staticidx, init_alloc_once, init_strings, free_ablock):
3038 Remove redundant initialization.
3039 * fns.c (init_weak_hash_tables): Remove.
3040 * lisp.h (init_weak_hash_tables): Remove prototype.
3041
9730daca
DA
30422012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3043
3044 Use zero_vector where appropriate.
3045 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
3046 accordingly.
3047 * lisp.h (zero_vector): New declaration.
3048 * font.c (null_vector): Remove.
3049 (syms_of_font): Remove initialization and staticpro.
3050 (font_list_entities, font_find_for_lface): Change to use zero_vector.
3051 * keymap.c (Faccessible_keymaps): Likewise.
3052
2e2d2a13
LL
30532012-07-15 Leo Liu <sdl.web@gmail.com>
3054
3055 * fringe.c: Fix typo in comments.
3056
cd276f6e
LL
30572012-07-14 Leo Liu <sdl.web@gmail.com>
3058
3059 * fringe.c: Add a new bitmap exclamation-mark.
3060
5a1131d9
EZ
30612012-07-14 Eli Zaretskii <eliz@gnu.org>
3062
3063 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
3064
3065 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
3066 (HAVE_MENUS): Don't define, defined by editing config.in with
3067 msdos/sed2v2.inp.
3068 (GMALLOC_INHIBIT_VALLOC): Don't define.
3069 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
3070
22e983b7
JB
30712012-07-14 Juanma Barranquero <lekktu@gmail.com>
3072
3073 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
3074
5b3f250f
GM
30752012-07-14 Glenn Morris <rgm@gnu.org>
3076
3077 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
3078 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
3079 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
3080
33d63ff4
GM
30812012-07-13 Glenn Morris <rgm@gnu.org>
3082
5b633342
GM
3083 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
3084
33d63ff4
GM
3085 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
3086 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
3087
b55b9f85
JD
30882012-07-13 Jan Djärv <jan.h.d@swipnet.se>
3089
0dc8cf50
JD
3090 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
3091 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
3092 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
3093 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
3094 where appropriate.
3095 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
3096 as boolean expression.
3097 (x_set_window_size): Remove unused variable toolbar.
3098 (ns_get_color_default, ns_mod_to_lisp): Remove.
3099 (ns_mouse_position): Remove unused variables xchar and ychar.
3100 (ns_compute_glyph_string_overhangs): Remove unused variable face.
3101 (ns_set_vertical_scroll_bar): Remove unused variable count.
3102 (ns_delete_terminal): Remove unused variable i.
3103 (ns_term_init): Remove unused variables r, g and b.
3104 (mouseDown): Remove unused variable window.
3105 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
3106 (initFrameFromEmacs): Remove unused variable vbextra.
3107 (mouseEntered): Remove unused variables p and dpyinfo.
3108 (mouseExited): Remove unused variables p and r.
3109 (ns_define_frame_cursor, ns_clear_frame_area)
3110 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
3111 (menuDown): Assign [sender tag] to variable and cast the variable.
3112
3113 * nsterm.h (menuDown): Add id as type to argument sender.
3114 (ns_display_info_for_name): Add Lisp_Object argument.
3115 (ns_term_init): Add Lisp_Object argument.
3116 (ns_map_event_to_object): Add void argument.
3117 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
3118 prototype with arguments and only declare if __OBJC__.
3119 (nxatoms_of_nsselect): Add void argument.
3120 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
3121 (ns_alloc_autorelease_pool): Add void argument.
3122 (ns_release_autorelease_pool): Add void* argument.
3123 (ns_get_defaults_value): Add const char* argument.
3124
3125 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
3126 (initFromContents): Use SSDATA where appropriate.
3127 (ns_update_menubar): Add braces to ambigous if-else.
3128 (initWithTitle): Put () around assignment in if statement.
3129 (ns_menu_show): Remove unused variables window and keymap.
3130 (update_frame_tool_bar): Remove unused variable selected_p.
3131 (initWithContentRect): Remove unused variable this_cmd_name.
3132
3133 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
3134 appropriate.
3135 (setXBMColor): Remove unused variable len.
3136 (setPixmapData): Put () around assignment in loop statement.
3137
3138 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
3139 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
3140 where appropriate.
3141 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
3142 around assignment in loop statement.
3143 (nsfont_open): Remove unused variable i.
3144 (nsfont_open): Remove unused variable len.
3145 (nsfont_draw): Remove unused variable cs.
3146
3147 * nsfns.m (x_set_icon_name, ns_set_name_internal)
3148 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
3149 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
3150 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
3151 (Fns_font_name, Fns_perform_service)
3152 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
3153 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
3154 (ns_set_name): Remove unused variable view.
3155 (x_set_menu_bar_lines): Remove unused variable olines.
3156 (x_set_tool_bar_lines): Remove unused variable root_window.
3157 (Fns_list_colors): Put () around assignment in while statement.
3158 (Fns_perform_service): Remove unused variable len.
3159 (Fns_display_usable_bounds): Remove unused variable top.
3160 (syms_of_nsfns): Remove unused variable i.
3161
b55b9f85
JD
3162 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
3163 memcpy (Bug#11907).
3164
ed9265fc 31652012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
3166
3167 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
3168 and free it with DestroyExceptionInfo (Bug#11558).
3169
ef099b57
JB
31702012-07-13 Juanma Barranquero <lekktu@gmail.com>
3171
3172 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
3173 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
3174 Set here, not in nt/config.nt.
3175
ea814a5d
EZ
31762012-07-13 Eli Zaretskii <eliz@gnu.org>
3177
3178 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
3179 cursor overflow into the last glyph on display line when the right
3180 fringe is off. (Bug#11832)
3181
1a952767
PE
31822012-07-13 Paul Eggert <eggert@cs.ucla.edu>
3183
3184 * xdisp.c (produce_special_glyphs): Now static.
3185 * dispextern.h (produce_special_glyphs): Remove decl.
3186
983188fd
GM
31872012-07-13 Glenn Morris <rgm@gnu.org>
3188
8d7c7eed 3189 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
3190 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
3191
983188fd
GM
3192 * s/usg5-4-common.h (USG, USG5):
3193 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
3194 * s/sol2-6.h (SOLARIS2):
3195 * s/irix6-5.h (IRIX6_5):
3196 * s/hpux10-20.h (USG, USG5, HPUX):
3197 * s/gnu-linux.h (USG, GNU_LINUX):
3198 * s/freebsd.h (BSD_SYSTEM):
3199 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
3200 * s/cygwin.h (CYGWIN):
3201 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
3202 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
3203
d1e68667 32042012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
3205
3206 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 3207
6de0e799
GM
32082012-07-13 Glenn Morris <rgm@gnu.org>
3209
739ae010
GM
3210 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
3211
dbee5793
GM
3212 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
3213
6de0e799
GM
3214 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
3215 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
3216
b82da769
GM
32172012-07-12 Glenn Morris <rgm@gnu.org>
3218
4fae5a7a 3219 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
3220
3221 * process.c (init_process_emacs): Rename from init_process.
3222 The old name is also the name of a Mach system call.
3223 * lisp.h, emacs.c: Update for this name change.
3224 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
3225 longer needed.
3226
5a979817
EZ
32272012-07-12 Eli Zaretskii <eliz@gnu.org>
3228
3229 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
3230 memmove call that removes glyphs covered by the left truncation
3231 glyph. Improve commentary.
3232 (display_line): Fix display of continuation glyphs on GUI frames
3233 when the right fringe is turned off and variable-size fonts are
3234 used in the window. Move the code that appends a stretch glyph to
3235 produce_special_glyphs, so that it could be used for truncation
3236 and continuation glyphs alike.
3237 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
3238 glyph of a suitably computed width, to align the special glyphs at
3239 the window margin. Code moved from display_line. (Bug#11832)
3240
3e91a053
GM
32412012-07-12 Glenn Morris <rgm@gnu.org>
3242
ba9e4b84
GM
3243 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
3244
3245 * s/gnu-linux.h, s/hpux10-20.h:
3246 Do not unconditionally define HAVE_XRMSETDATABASE.
3247
3e91a053
GM
3248 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
3249
b300b1f4
PE
32502012-07-12 Paul Eggert <eggert@cs.ucla.edu>
3251
3252 Fix typos that broke OS X build.
3253 Reported by Randal L. Schwartz in
3254 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
3255 * nsterm.m (ns_timeout): Add missing local decl.
3256 (ns_get_color): snprintf -> sprintf, to fix typo.
3257
6e777848
GM
32582012-07-12 Glenn Morris <rgm@gnu.org>
3259
3f922c37
GM
3260 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
3261 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
3262 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
3263 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
3264
0ab7b23a
GM
3265 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
3266 Move PTY_OPEN to configure.
3267
6e777848
GM
3268 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3269 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
3270 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
3271
4a7edc24
DA
32722012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
3273
3274 Use empty_unibyte_string where applicable.
3275 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
3276 * lread.c (read1): Likewise.
3277 * xsettings.c (syms_of_xsettings): Likewise.
3278
308aab79
GM
32792012-07-12 Glenn Morris <rgm@gnu.org>
3280
42bd1719
GM
3281 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
3282 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
3283 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
3284 * s/hpux10-20.h (RUN_TIME_REMAP):
3285 * s/bsd-common.h (TABDLY): Move to configure.
3286
3287 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
3288
3289 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
3290
ea0bbd17 3291 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 3292 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
3293
3294 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 3295
308aab79
GM
3296 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
3297 * s/template.h: Move NARROWPROTO to configure.
3298
ee1cf5cf
GM
32992012-07-11 Glenn Morris <rgm@gnu.org>
3300
30fe9bf4
GM
3301 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
3302 unused since 2011-01-17 change to systty.h.
3303
ee1cf5cf
GM
3304 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
3305 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
3306 Move HAVE_PTYS and HAVE_SOCKETS to configure.
3307
63e47e07
PE
33082012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3309
3310 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
3311
c43fb4c3
GM
33122012-07-11 Glenn Morris <rgm@gnu.org>
3313
3314 * s/darwin.h, s/gnu-linux.h, s/template.h:
3315 Move INTERRUPT_INPUT to configure.
3316
e8df9267
DA
33172012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3318
3319 Minor adjustments to interning code.
3320 * lisp.h (intern, intern_c_string): Redefine as static inline
3321 wrappers for intern_1 and intern_c_string_1, respectively.
3322 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
3323 * lread.c (intern_1, intern_c_string_1, oblookup):
3324 Simplify Vobarray checking.
e8df9267
DA
3325 * font.c (font_intern_prop): Likewise. Adjust comment.
3326 * w32font.c (intern_font_name): Likewise.
3327
34348bd4
AS
33282012-07-11 Andreas Schwab <schwab@linux-m68k.org>
3329
d96a1e0c
AS
3330 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
3331
34348bd4
AS
3332 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
3333 of Fcar/Fcdr if possible.
3334 * font.c (check_otf_features): Likewise.
3335 * fontset.c (Fnew_fontset): Likewise.
3336 * gnutls.c (Fgnutls_boot): Likewise.
3337 * minibuf.c (read_minibuf): Likewise.
3338 * msdos.c (IT_set_frame_parameters): Likewise.
3339 * xmenu.c (Fx_popup_dialog): Likewise.
3340 * w32menu.c (Fx_popup_dialog): Likewise.
3341
c8add24e
GM
33422012-07-11 Glenn Morris <rgm@gnu.org>
3343
4b575b3c
GM
3344 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
3345 since nothing has defined it on these platforms.
3346
09f4e3b0
GM
3347 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
3348 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
3349
172bedef
GM
3350 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3351 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
3352 Move CLASH_DETECTION to configure.
3353
249685df
GM
3354 * s/gnu.h: Remove file, which is now empty.
3355
c8add24e
GM
3356 * s/gnu.h, s/gnu-linux.h:
3357 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
3358
b41253a3
JW
33592012-07-11 John Wiegley <johnw@newartisans.com>
3360
3361 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
3362 function attribute, so we only use it if it exists in the
3363 compiler.
3364
d923b542
DA
33652012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3366
3367 Avoid call to strlen in fast_c_string_match_ignore_case.
3368 * search.c (fast_c_string_match_ignore_case): Change to use
3369 length argument. Adjust users accordingly.
3370 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
3371
5ebbef1d
PE
33722012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3373
bb352260
PE
3374 Assume mkdir, rmdir.
3375 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
3376 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
3377
57054ddd
PE
3378 Assume rename.
3379 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
3380
b747d3f7
PE
3381 Assume perror.
3382 * s/hpux10-20.h (HAVE_PERROR): Remove.
3383 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
3384 Remove dummy definition, as this problem was obsolete long ago.
3385
5ebbef1d
PE
3386 Assume strerror.
3387 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
3388
984e7f30
DA
33892012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3390
3391 Avoid calls to strlen in font processing functions.
3392 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
3393 (font_open_by_name): Change to use length argument.
3394 Adjust users accordingly.
d923b542
DA
3395 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
3396 Adjust prototypes.
3397 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
3398 Change to return ptrdiff_t.
984e7f30
DA
3399 (xfont_list_pattern, xfont_match): Use length returned by
3400 xfont_decode_coding_xlfd.
3401 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
3402
20e94fdd
GM
34032012-07-11 Glenn Morris <rgm@gnu.org>
3404
9d596af3
GM
3405 * s/darwin.h, s/freebsd.h, s/netbsd.h:
3406 Move DONT_REOPEN_PTY to configure.
3407
20e94fdd
GM
3408 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
3409 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
3410
e99a530f
PE
34112012-07-10 Paul Eggert <eggert@cs.ucla.edu>
3412
22ffb973
PE
3413 Remove "#define unix" that is no longer needed (Bug#11905).
3414 * s/aix4-2.h (unix): Remove; no longer needed.
3415
e9a9ae03
PE
3416 EMACS_TIME simplification (Bug#11875).
3417 This replaces macros (which typically do not work in GDB)
3418 with functions, typedefs and enums, making the code easier to debug.
3419 The functional style also makes code easier to read and maintain.
3420 * systime.h: Include <sys/time.h> on all hosts, not just if
3421 WINDOWSNT, since 'struct timeval' is needed in general.
3422 (EMACS_TIME): Now a typedef, not a macro.
3423 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
3424 not macros.
3425 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
3426 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
3427 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
3428 (EMACS_TIME_LE): Now functions, not macros.
3429 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
3430 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
3431 which are not functions. All uses rewritten to use:
3432 (make_emacs_time): New function.
3433 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
3434 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
3435 not functions. All uses rewritten to use the following, respectively:
3436 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
3437 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 3438 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
3439 * fileio.c (Fcopy_file):
3440 * xterm.c (XTflash): Get the current time closer to when it's used.
3441 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
3442
ffacb126
PE
3443 * bytecode.c (targets): Suppress -Woverride-init warnings.
3444
e99a530f
PE
3445 Simplify by avoiding confusing use of strncpy etc.
3446 * doc.c (Fsnarf_documentation):
3447 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
3448 * frame.c (Fmake_terminal_frame):
3449 * gtkutil.c (get_utf8_string):
3450 * lread.c (openp):
3451 * nsmenu.m (ns_update_menubar):
3452 * regex.c (regerror):
3453 Prefer memcpy to strncpy and strncat when either will do.
3454 * fileio.c (Fsubstitute_in_file_name):
3455 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
3456 (menu_separator_name_p):
3457 * nsmenu.m (ns_update_menubar):
3458 Prefer memcmp to strncmp when either will do.
3459 * nsterm.m: Include <ftoastr.h>.
3460 (ns_get_color):
3461 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
3462 Prefer snprintf to strncpy.
3463 * nsterm.m (ns_term_init):
3464 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
3465 * nsterm.m (ns_term_init):
3466 Avoid the need for strncpy, by using build_string or
3467 make_unibyte_string directly. Use dtoastr, not snprintf.
3468 * process.c (Fmake_network_process): Diagnose service names that
3469 are too long, rather than silently truncating them or creating
3470 non-null-terminated names.
3471 (Fnetwork_interface_info): Likewise, for interface names.
3472 * sysdep.c (system_process_attributes) [GNU_LINUX]:
3473 Prefer sprintf to strncat.
3474 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
3475 Prefer vsnprintf to vsprintf + strncpy.
3476
c59592b3
GM
34772012-07-10 Glenn Morris <rgm@gnu.org>
3478
3479 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
3480 Clarify fallback case.
3481
7d7bbefd
DA
34822012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3483
3484 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
3485 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
3486 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 3487 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
3488 where argument type is known to be a Lisp_Cons.
3489
3a4c8000
TT
34902012-07-10 Tom Tromey <tromey@redhat.com>
3491
3492 * bytecode.c (BYTE_CODE_THREADED): New macro.
3493 (BYTE_CODES): New macro. Replaces all old byte-code defines.
3494 (enum byte_code_op): New type.
3495 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
3496 (exec_byte_code): Use them. Use token threading when applicable.
3497
2a0213a6
DA
34982012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3499
3500 Optimize pure C strings initialization.
3501 * lisp.h (make_pure_string): Fix prototype.
3502 (build_pure_c_string): New function, defined as static inline. This
3503 provides a better opportunity to optimize away calls to strlen when
3504 the function is called with compile-time constant argument.
3505 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
3506 argument, adjust users accordingly. Use build_pure_c_string where
3507 appropriate.
3508 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
3509 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
3510 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
3511
cb1caeaf
DA
35122012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3513
3514 Avoid calls to strlen in miscellaneous functions.
3515 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
3516 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
3517 * lread.c (openp): Likewise.
3518
c293e30c
DA
35192012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3520
3521 Avoid calls to strlen in path processing functions.
3522 * fileio.c (file_name_as_directory): Add comment. Change to add
3523 srclen argument and return the length of result. Adjust users
3524 accordingly.
3525 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
3526 swap 1st and 2nd arguments to obey the common convention.
3527 Adjust users accordingly.
c293e30c
DA
3528 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
3529
9e059e3f
GM
35302012-07-10 Glenn Morris <rgm@gnu.org>
3531
d02eb359
GM
3532 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
3533 Move PENDING_OUTPUT_COUNT definition to configure.
3534
882cf227
GM
3535 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
3536 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
3537 * s/gnu.h (DATA_START): Move definitions to configure.
3538
af6e839f
GM
3539 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
3540 We include usg5-4-common.h, which defines them both.
3541
40289a12
GM
3542 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
3543 O_RDONLY already includes it).
3544
9e059e3f
GM
3545 Stop ns builds setting the EMACSLOADPATH environment variable.
3546 * nsterm.m (ns_load_path): Rename from ns_init_paths.
3547 Now it does not set EMACSLOADPATH, just returns the load-path string.
3548 * nsterm.h: Update accordingly.
3549 * lread.c [HAVE_NS]: Include nsterm.h.
3550 (init_lread) [HAVE_NS]: Use ns_load_path.
3551 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
3552
7c4e8ec0
GM
35532012-07-09 Glenn Morris <rgm@gnu.org>
3554
d4f600ff
GM
3555 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
3556 since the included bsd-common.h does so.
3557
cbb31951
GM
3558 Stop ns builds setting the EMACSPATH environment variable.
3559 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
3560 (ns_init_paths): Do not set EMACSPATH.
3561 * nsterm.h (ns_exec_path): Add it.
3562 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
3563 Use ns_exec_path.
3564
7c4e8ec0
GM
3565 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
3566
26bccfae
PE
35672012-07-09 Paul Eggert <eggert@cs.ucla.edu>
3568
a0bee46f
PE
3569 * process.c (wait_reading_process_output): 'waitchannels' was unset
3570 when read_kbd || !NILP (wait_for_cell); fix this.
3571
5994c183
PE
3572 Add GCC-style 'const' attribute to functions that can use it.
3573 * character.h (char_resolve_modifier_mask):
3574 * keyboard.h (make_ctrl_char):
3575 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
3576 (init_character_once, next_almost_prime, init_fns, init_image)
3577 (flush_pending_output, init_sound):
3578 * mem-limits.h (start_of_data):
3579 * menu.h (finish_menu_items):
3580 Add ATTRIBUTE_CONST.
3581 * emacs.c (DEFINE_DUMMY_FUNCTION):
3582 Declare the dummy function with ATTRIBUTE_CONST.
3583 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
3584 Add decls with ATTRIBUTE_CONST.
3585
26bccfae
PE
3586 Minor improvements to make_formatted_string.
3587 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
3588 where int is good enough, as vsprintf returns an int.
3589 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
3590
a8290ec3
DA
35912012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
3592
3593 Use make_formatted_string to avoid double length calculation.
3594 * lisp.h (make_formatted_string): New prototype.
3595 * alloc.c (make_formatted_string): New function.
3596 * buffer.c (Fgenerate_new_buffer_name): Use it.
3597 * dbus.c (syms_of_dbusbind): Likewise.
3598 * editfns.c (Fcurrent_time_zone): Likewise.
3599 * filelock.c (get_boot_time): Likewise.
3600 * frame.c (make_terminal_frame, set_term_frame_name)
3601 (x_report_frame_params): Likewise.
3602 * image.c (gs_load): Likewise.
3603 * minibuf.c (get_minibuffer): Likewise.
3604 * msdos.c (dos_set_window_size): Likewise.
3605 * process.c (make_process): Likewise.
3606 * xdisp.c (ensure_echo_area_buffers): Likewise.
3607 * xsettings.c (apply_xft_settings): Likewise.
3608
d01ba2f1
GM
36092012-07-09 Glenn Morris <rgm@gnu.org>
3610
3611 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
3612 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
3613 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
3614 * nsterm.h (ns_etc_directory): Add it.
3615 * callproc.c [HAVE_NS]: Include nsterm.h.
3616 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
3617
f1f924b6
DA
36182012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
3619
3620 Move marker debugging code under MARKER_DEBUG.
3621 * marker.c (MARKER_DEBUG): Move marker debugging code under
3622 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
3623 for bootstrap with --enable-checking (~3x slowdown reported
3624 by Juanma Barranquero <lekktu@gmail.com>).
3625 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
3626
ab531b66
PE
36272012-07-08 Paul Eggert <eggert@cs.ucla.edu>
3628
3629 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
3630 See <http://bugs.gnu.org/11825#29>.
3631
c4b3bc8a
EZ
36322012-07-08 Eli Zaretskii <eliz@gnu.org>
3633
3634 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
3635 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
3636 (display_line): Add commentary about displaying truncation glyphs
3637 on GUI frames.
3638 (produce_special_glyphs): Move here from term.c.
3639
3640 * term.c (produce_special_glyphs): Move to xdisp.c.
3641
3642 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
3643 section.
c4b3bc8a 3644
b676b881
AS
36452012-07-07 Andreas Schwab <schwab@linux-m68k.org>
3646
f17c5273
AS
3647 * xdisp.c (display_line): Avoid warning about implicit declaration
3648 of FRAME_FONT.
3649
298819b9
AS
3650 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
3651
b676b881
AS
3652 * lisp.h: Remove empty conditional.
3653
6045c4fd
PE
36542012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3655
b3350bf9
PE
3656 * lread.c (load_path_check): Now static.
3657
6045c4fd
PE
3658 Fix some minor --with-ns problems found by static checking.
3659 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
3660 (x_set_font) [!HAVE_X_WINDOWS]:
3661 * image.c (xpm_load_image) [HAVE_NS]:
3662 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
3663 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
3664 Remove unused local.
3665 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
3666 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
3667 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
3668 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
3669 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
3670 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
3671 Fix pointer signedness problem.
3672 * xfaces.c (FRAME_X_FONT_TABLE):
3673 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
3674
929e7845
GM
36752012-07-07 Glenn Morris <rgm@gnu.org>
3676
3677 * lread.c (load_path_check): New function, split from init_lread.
3678 (init_lread): Reorganize. Motivation:
3679 If EMACSLOADPATH is set, check/warn about that rather than the
3680 defaults, which we are not going to use. Hence we can remove
3681 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
3682 Don't warn if site-lisp directories are missing.
3683 If not installed, start from a blank load-path, since
3684 PATH_LOADSEARCH refers to the eventual installation directories.
3685
58dd0aa4
EZ
36862012-07-07 Eli Zaretskii <eliz@gnu.org>
3687
3688 Support truncation and continuation glyphs on GUI frames, when
3689 fringes are disabled. (Bug#11832)
3690 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
3691 continuation glyphs even if on GUI frames.
3692 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
3693 or both, are absent.
3694 (start_display, move_it_in_display_line_to): Handle the case of a
3695 GUI frame without a fringe to display continuation or truncation
3696 glyphs.
3697 (insert_left_trunc_glyphs): Support GUI frames: make sure
3698 truncation glyphs overwrite enough glyphs from the current line to
3699 have sufficient space in pixels.
3700 (display_line): Support truncation and continuation glyphs on GUI
3701 frames. If some spare pixels are left on the line after inserting
3702 the truncation glyphs, fill that space with a stretch glyph of a
3703 suitably computed width.
3704
3705 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
3706 produce_glyphs, to support GUI sessions.
3707
31571fd7
PE
37082012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3709
5a16b9bc
PE
3710 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
3711
f3047c75
PE
3712 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
3713
31571fd7
PE
3714 Do not require float-time's arg to fit in time_t (Bug#11825).
3715 This works better on hosts where time_t is unsigned, and where
3716 float-time is applied to the (negative) difference between two times.
3717 * editfns.c (decode_time_components): Last arg is now double *,
3718 not int *, and means to store all the result as a double, without
3719 worrying about whether the seconds part fits in time_t.
3720 All callers changed.
3721 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
3722 All callers changed.
3723 (Ffloat_time): Do not fail merely because the specified time falls
3724 outside of time_t range.
3725
4516fbef
GM
37262012-07-07 Glenn Morris <rgm@gnu.org>
3727
3728 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
3729 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
3730 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
3731
07adc2c6
JB
37322012-07-07 Juanma Barranquero <lekktu@gmail.com>
3733
3734 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
3735 Update dependencies.
3736
3737 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
3738
fd573f31
PE
37392012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3740
fee5959d
PE
3741 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
3742 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
3743 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
3744 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
3745 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
3746 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
3747
fd573f31
PE
3748 * xfont.c (compare_font_names): Redo to omit the need for casts.
3749
ddadbc0e
AS
37502012-07-06 Andreas Schwab <schwab@linux-m68k.org>
3751
fca8d6b6
AS
3752 * xfns.c (Fx_change_window_property): Doc fix.
3753 * w32fns.c (Fx_change_window_property): Doc fix.
3754
ddadbc0e
AS
3755 * w32fns.c (Fx_window_property): Accept the same arguments as the
3756 X Windows version. Doc fix.
3757 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
3758
ed9265fc 37592012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
3760 Eli Zaretskii <eliz@gnu.org>
3761
3762 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
3763 Windows-specific code from nt/config.nt moved here.
3764 Obsolete settings removed.
3765
216ee680
PE
37662012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3767
3768 * process.c: Avoid unnecessary calls to gettime.
3769 (wait_reading_process_output): Don't get the time of day
3770 when gobbling data immediately and not waiting, as there's no need
3771 for it in that case. This removes a FIXME.
3772
bdd091e4
JD
37732012-07-06 Jan Djärv <jan.h.d@swipnet.se>
3774
3775 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
3776 is defined (Bug#11768).
3777
9d44f8ce
DA
37782012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3779
3780 Fix marker debugging code.
3781 * marker.c (byte_char_debug_check): Do not perform the check
3782 if buffer is not multibyte.
090bd7cb
JB
3783 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3784 Call byte_char_debug_check with correct arguments.
9d44f8ce 3785
90fc4786
DA
37862012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3787
3788 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
3789 * marker.c (byte_char_debug_check, count_markers):
3790 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
3791 (byte_debug_flag): Remove.
3792 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3793 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
3794
7b7ae965
DA
37952012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3796
4e57b342
DA
3797 Avoid code repetition in marker-related functions.
3798 * marker.c (attach_marker): New function.
3799 (Fset_marker, set_marker_restricted, set_marker_both)
3800 (set_marker_restricted_both): Use it.
3801 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
3802 Consistently rename charno to charpos.
3803 (marker_position): Add eassert.
3804 (marker_byte_position): Convert to eassert.
3805
38062012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3807
3808 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 3809 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 3810 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 3811
657924ff
DA
38122012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3813
3814 Introduce fast path for the widely used marker operation.
3815 * alloc.c (build_marker): New function.
3816 * lisp.h (build_marker): New prototype.
3817 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
3818 * composite.c (autocmp_chars): Likewise.
3819 * editfns.c (buildmark): Remove.
3820 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
3821 (save_restriction_save): Use build_marker.
3822 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
3823 * window.c (save_window_save): Likewise.
3824
041a49a6
DA
38252012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3826
3827 Do not use Fdelete_overlay in delete_all_overlays
3828 to avoid redundant calls to unchain_overlay.
3829 * buffer.c (drop_overlay): New function.
3830 (delete_all_overlays, Fdelete_overlay): Use it.
3831 * minibuf.c (get_minibuffer): Fix comment.
3832
7dca65a4
PE
38332012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3834
3835 Port to OpenBSD 5.1 amd64.
3836 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
3837 This is needed for OpenBSD, and should be harmless on all BSD systems.
3838 Also, include <sys/sysctl.h>, as it should be available on all
3839 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
3840 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
3841 use p_pid member, not kp_proc.pid.
3842
8eb876e2
GM
38432012-07-06 Glenn Morris <rgm@gnu.org>
3844
3845 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
3846
38182d90
PE
38472012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3848
3849 More xmalloc and related cleanup.
3850 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
3851 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
3852 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
3853 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
3854 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
3855 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
3856 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
3857 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
3858 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
3859 * xterm.c:
3860 Omit needless casts involving void * pointers and allocation.
3861 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
3862 as the former is more robust if P's type is changed.
3863 Prefer xzalloc to xmalloc + memset 0.
3864 Simplify malloc-or-realloc to realloc.
3865 Don't worry about xmalloc returning a null pointer.
3866 Prefer xstrdup to xmalloc + strcpy.
3867 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
3868 growing it.
3869 * keyboard.c (apply_modifiers_uncached): Prefer local array to
3870 alloca of a constant.
3871
6dd5a677
EZ
38722012-07-05 Eli Zaretskii <eliz@gnu.org>
3873
3874 * xdisp.c (display_line): Fix horizontal pixel coordinates when
3875 hscroll is larger than the line width. Fixes long and futile
3876 looping inside extend_face_to_end_of_line (on a TTY) producing
3877 glyphs that are not needed and thrown away.
3878
6b312f0f
DA
38792012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3880
3881 * marker.c (set_marker_restricted_both): Simplify by using
3882 clip_to_bounds.
3883
f520ef9b
PE
38842012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3885
3886 * editfns.c (region_limit): Simplify by using clip_to_bounds.
3887
383b7c95
JD
38882012-07-05 Jan Djärv <jan.h.d@swipnet.se>
3889
3890 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
3891 not defined (Bug#11768).
3892 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
3893 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
3894 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
3895 followed by gtk_box_set_homogeneous (Bug#11768).
3896 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
3897 (update_theme_scrollbar_width, xg_create_scroll_bar):
3898 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
3899 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
3900 (is_box_type): New function (Bug#11768).
3901 (xg_tool_item_stale_p): Call is_box_type.
5293d758 3902 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
3903 with default display (Bug#11768).
3904
d6e7bf45
EZ
39052012-07-05 Eli Zaretskii <eliz@gnu.org>
3906
3907 * xdisp.c (window_hscroll_limited): New function.
3908 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
3909 coordinates when window's hscroll is set to insanely large
3910 values. (Bug#11857)
3911
431391ec
JB
39122012-07-05 Juanma Barranquero <lekktu@gmail.com>
3913
3914 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
3915 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
3916
23f86fce
DA
39172012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3918
3919 Cleanup xmalloc.
3920 * lisp.h (xzalloc): New prototype. Omit needless casts.
3921 * alloc.c (xzalloc): New function. Omit needless casts.
3922 * charset.c: Omit needless casts. Convert all calls to
3923 xmalloc with following memset to xzalloc.
3924 * dispnew.c: Likewise.
3925 * fringe.c: Likewise.
3926 * image.c: Likewise.
3927 * sound.c: Likewise.
3928 * term.c: Likewise.
3929 * w32fns.c: Likewise.
3930 * w32font.c: Likewise.
3931 * w32term.c: Likewise.
3932 * xfaces.c: Likewise.
3933 * xfns.c: Likewise.
3934 * xterm.c: Likewise.
3935 * atimer.c: Omit needless casts.
3936 * buffer.c: Likewise.
3937 * callproc.c: Likewise.
3938 * ccl.c: Likewise.
3939 * coding.c: Likewise.
3940 * composite.c: Likewise.
3941 * doc.c: Likewise.
3942 * doprnt.c: Likewise.
3943 * editfns.c: Likewise.
3944 * emacs.c: Likewise.
3945 * eval.c: Likewise.
3946 * filelock.c: Likewise.
3947 * fns.c: Likewise.
3948 * gtkutil.c: Likewise.
3949 * keyboard.c: Likewise.
3950 * lisp.h: Likewise.
3951 * lread.c: Likewise.
3952 * minibuf.c: Likewise.
3953 * msdos.c: Likewise.
3954 * print.c: Likewise.
3955 * process.c: Likewise.
3956 * region-cache.c: Likewise.
3957 * search.c: Likewise.
3958 * sysdep.c: Likewise.
3959 * termcap.c: Likewise.
3960 * terminal.c: Likewise.
3961 * tparam.c: Likewise.
3962 * w16select.c: Likewise.
3963 * w32.c: Likewise.
3964 * w32reg.c: Likewise.
3965 * w32select.c: Likewise.
3966 * w32uniscribe.c: Likewise.
3967 * widget.c: Likewise.
3968 * xdisp.c: Likewise.
3969 * xmenu.c: Likewise.
3970 * xrdb.c: Likewise.
3971 * xselect.c: Likewise.
3972
0497dc44
PE
39732012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3974
3975 * fileio.c (time_error_value): Check the right error number.
3976 Problem reported by Troels Nielsen in
3977 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
3978
356e7178
PE
39792012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3980
4e71fd89
PE
3981 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
3982 This should be fixed in a better way; see Eli Zaretskii in
3983 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
3984 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
3985
f0941253
PE
3986 * fileio.c (time_error_value): Rename from special_mtime.
3987 The old name's problems were noted by Eli Zaretskii in
3988 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
3989
065c9eb4
PE
3990 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
3991 This variable's comment says Emacs needs at least one GDB-visible
3992 symbol of type enum pvec_type, to work around GDB problems.
3993 The symbol's value doesn't matter.
3994
356e7178
PE
3995 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
3996 that causes compilation to fail on pre-C99 compilers.
3997
ed9265fc 39982012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
3999
4000 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
4001 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
4002
3884d954
DA
40032012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4004
d209e2fb 4005 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
4006 headers for buffer_defaults and buffer_local_symbols.
4007 Reported by Juanma Barranquero <lekktu@gmail.com>.
4008
ee28be33
SM
40092012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
4010
4011 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
4012 * lisp.h (enum pvec_type): Use fewer bits.
4013 (PSEUDOVECTOR_SIZE_BITS): New constant.
4014 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
4015 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
4016 change in pvec_type.
4017 (PSEUDOVECTOR_TYPEP): New macro.
4018 (TYPED_PSEUDOVECTORP): Use it.
4019 * fns.c (internal_equal): Adapt code to extract pvectype.
4020 * emacs.c (gdb_pvec_type): Update type.
4021 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
4022 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
4023 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
4024 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
4025 (sweep_vectors): Use it. Use local var `total_bytes' instead of
4026 abusing vector->header.next.nbytes.
4027 (live_vector_p): Use PVEC_TYPE.
4028 (mark_object): Adapt code to extract pvectype. Use switch.
4029
c7f2cd7f
PE
40302012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4031
4032 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
4033 Tighten new eassert a bit.
4034
8ce70ed2
DA
40352012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4036
4037 Fix compilation with --enable-gcc-warnings and -O1
4038 optimization level.
4039 * doprnt.c (doprnt): Change type of tem to int, initialize
4040 to avoid compiler warning. Add eassert.
4041 * search.c (simple_search): Initialize match_byte to avoid
4042 compiler warning. Add eassert.
4043
dea7f1e5
PE
40442012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4045
24a212eb
PE
4046 Avoid weird behavior with large horizontal scrolls.
4047 Without this change, for example, large hscroll values would
4048 mess up Emacs's display on Fedora 15 x86, presumably due to
4049 overflows in int calculations in the display code.
4050 Also, if buffers had long lines, Emacs would freeze.
4051 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
4052 (set_window_hscroll): New function, containing the old guts of
4053 Fset_window_hscroll. Return the clipped value.
4054 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
4055 This avoids the need to check against PTRDIFF_MAX.
4056
dea7f1e5
PE
4057 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
4058
76046526
DA
40592012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4060
4061 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
4062
39adff0d
PE
40632012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4064
63807d47
PE
4065 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
4066 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
4067 since GCC 4.4.6 issues a bogus warning for them.
4068
39adff0d
PE
4069 Fix bugs in file timestamp newness comparisons.
4070 * fileio.c (Ffile_newer_than_file_p):
4071 * lread.c (Fload): Use full timestamp resolution of files,
4072 not just the 1-second resolution, so that files that are only
4073 slightly newer still count as newer.
4074 * fileio.c (Ffile_newer_than_file_p): Don't assume file
4075 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
4076
dbeed9a6
PE
40772012-07-03 Paul Eggert <eggert@cs.ucla.edu>
4078
4079 * fileio.c: Improve handling of file time marker. (Bug#11852)
4080 (special_mtime): New function.
4081 (Finsert_file_contents, Fverify_visited_file_modtime):
4082 Use it to set special mtime values consistently.
4083
636334d6
AS
40842012-07-03 Andreas Schwab <schwab@linux-m68k.org>
4085
4086 * fileio.c (Finsert_file_contents): Properly handle st_mtime
4087 marker for non-existing file. (Bug#11852)
4088
e2017fe2
GM
40892012-07-03 Glenn Morris <rgm@gnu.org>
4090
4091 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
4092 and did not make it into globals.h).
4093
404dbd37
TT
40942012-07-03 Tom Tromey <tromey@redhat.com>
4095
4096 * window.c (Fset_window_margins, Fset_window_fringes)
4097 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
4098 * textprop.c (Fprevious_property_change): No longer static.
4099 * syntax.c (Fsyntax_table_p): No longer static.
4100 * process.c (Fget_process, Fprocess_datagram_address): No longer
4101 static.
4102 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
4103 * keyboard.c (Fcommand_execute): No longer static.
4104 Remove EXFUN.
4105 * insdel.c (Fcombine_after_change_execute): No longer static.
4106 * image.c (Finit_image_library): No longer static.
4107 * fileio.c (Fmake_symbolic_link): No longer static.
4108 * eval.c (Ffetch_bytecode): No longer static.
4109 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
4110 * doc.c (Fdocumentation_property, Fsnarf_documentation):
4111 No longer static.
404dbd37
TT
4112 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
4113 static.
4114 * dired.c (Ffile_attributes): No longer static.
4115 * composite.c (Fcomposition_get_gstring): No longer static.
4116 * callproc.c (Fgetenv_internal): No longer static.
4117
4118 * ccl.h: Remove EXFUNs.
4119 * buffer.h: Remove EXFUNs.
4120 * dispextern.h: Remove EXFUNs.
4121 * intervals.h: Remove EXFUNs.
4122 * fontset.h: Remove EXFUN.
4123 * font.h: Remove EXFUNs.
4124 * dosfns.c (system_process_attributes): Remove EXFUN.
4125 * keymap.h: Remove EXFUNs.
4126 * lisp.h: Remove EXFUNs.
4127 * w32term.h: Remove EXFUNs.
4128 * window.h: Remove EXFUNs.
4129 * xsettings.h: Remove EXFUN.
4130 * xterm.h: Remove EXFUN.
4131
8e4fd1e1
GM
41322012-07-03 Glenn Morris <rgm@gnu.org>
4133
4134 * lisp.h (Frandom): Make it visible to C.
4135 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
4136 buffer for invisible buffers. (Bug#1229)
4137
ca95b3eb
DA
41382012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4139
4140 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
4141 values which aren't power of 2.
14ae4239
BT
4142 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
4143 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
4144 accordingly.
4145
7555c33f
SM
41462012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
4147
4148 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
4149
4150 * alloc.c (mark_object): Revert part of last patch to use `switch'.
4151
d12e8f5a
DA
41522012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4153
4154 * alloc.c (allocate_vector_block): Remove redundant
4155 calls to mallopt if DOUG_LEA_MALLOC is defined.
4156 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
4157 avoid calls to mallopt if zero_vector is returned.
4158
296094c3
DA
41592012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4160
4161 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
4162 is enabled, avoid dereferencing NULL current_sblock if
4163 running undumped.
4164
36429c89
DA
41652012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4166
4167 Cleanup basic buffer management.
4168 * buffer.h (struct buffer): Change layout to use generic vector
4169 marking code. Fix some comments. Change type of 'clip_changed'
4170 to bitfield. Remove unused #ifndef old.
4171 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
4172 (GET_OVERLAYS_AT): Fix indentation.
4173 (for_each_per_buffer_object_at): New macro.
4174 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
4175 (Fbuffer_local_variables): Use it.
4176 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
4177 * alloc.c (allocate_buffer): Adjust to match new layout of
4178 struct buffer. Fix comment.
4179 (mark_overlay): New function.
4180 (mark_buffer): Use it. Use mark_vectorlike to mark normal
4181 Lisp area of struct buffer.
4182 (mark_object): Use it. Adjust marking of misc objects
4183 and related comments.
4184
3b3e4cac
PE
41852012-07-02 Paul Eggert <eggert@cs.ucla.edu>
4186
4187 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
4188 wrapper that is not needed because the wrapped code is a no-op (zero
4189 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
4190 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
4191
cf5c0175
DA
41922012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
4193
4194 * alloc.c (mark_buffer): Simplify. Remove prototype.
4195 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 4196 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
4197 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
4198 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 4199
ca26824c
GM
42002012-06-30 Glenn Morris <rgm@gnu.org>
4201
2e4c5312
GM
4202 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
4203
ca26824c
GM
4204 * epaths.in (PATH_SITELOADSEARCH): New.
4205 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
4206 This is rather than relying on --enable-locallisppath elements
4207 having "site-lisp" in their names. (Bug#10208#25, 11658)
4208
0d23c240
EZ
42092012-06-30 Eli Zaretskii <eliz@gnu.org>
4210
c9240d7a
EZ
4211 * w32proc.c (sys_select): Accept and ignore one more argument.
4212
4213 * w32.c (emacs_gnutls_pull): Call select with one more argument.
4214
0d23c240 4215 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 4216 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
4217
4218 * sysdep.c: Don't include dos.h and dosfns.h.
4219
4220 * process.c (sys_select):
4221 * msdos.c (sys_select): Accept one more argument and ignore it.
4222
4223 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
4224 adapt data types and code to that.
4225
4226 * dosfns.c:
4227 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
4228 which clashes with the gnulib function of the same name.
4229
af5a5a98
AS
42302012-06-30 Andreas Schwab <schwab@linux-m68k.org>
4231
c5e4379c
AS
4232 * font.c (font_style_to_value, font_style_symbolic)
4233 (font_prop_validate_style): Add type checks for values in
4234 font_style_table.
4235
af5a5a98
AS
4236 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
4237 argument.
4238 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
4239 uses.
4240
8d38f461
EZ
42412012-06-29 Eli Zaretskii <eliz@gnu.org>
4242
2e5a6631
EZ
4243 * xdisp.c (try_window_id): Undo last change.
4244
8d38f461
EZ
4245 * w32.c (getwd): Adjust commentary about startup_dir.
4246 (init_environment): Always call sys_access, even in non-MSVC
4247 builds. Don't chdir to the directory of the Emacs executable.
4248 This undoes code from 1997 which was justified by the need to
4249 "avoid conflicts when removing and renaming directories". But its
4250 downside was that every relative file name was being interpreted
4251 relative to the directory of the Emacs executable, which can never
4252 be TRT. In particular, it broke sys_access when called with
4253 relative file names.
4254 (sys_access): Map GetLastError to errno.
4255
2af3565e
DA
42562012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4257
4258 * window.h (struct window): Change type of 'fringes_outside_margins'
4259 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 4260 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
4261 Adjust comment.
4262 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
4263 to ptrdiff_t.
4264
c8d3a25c 42652012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 4266
c8d3a25c
GM
4267 * gnutls.c (emacs_gnutls_handshake):
4268 Add QUIT to make the loop interruptible.
57570cd3 4269
c8d3a25c 42702012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 4271
c8d3a25c
GM
4272 * charset.c (init_charset): Make lack of etc/charsets fatal.
4273
3e984ee8
DA
42742012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4275
4276 * editfns.c (region_limit): Fix type mismatch.
4277
ef884f23
DA
42782012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4279
4280 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
4281 undefined. Convert from xassert to eassert.
4282 * nsmenu.m: Convert from xassert to eassert.
4283 * nsterm.m: Likewise.
4284
7d7e0027
SM
42852012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
4286
4287 * editfns.c (region_limit): Clip to narrowing (bug#11770).
4288
aa754e6a
PE
42892012-06-28 Paul Eggert <eggert@cs.ucla.edu>
4290
4291 Avoid integer overflow on scroll-left and scroll-right.
4292 * window.c (HSCROLL_MAX): New macro.
4293 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
4294 overflow when requested scroll falls outside ptrdiff_t range.
4295
80b00b08
DA
42962012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4297
4298 * window.h (struct window): Change type of 'hscroll',
4299 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
4300 'last_modified' and 'last_overlay_modified' to EMACS_INT.
4301 Adjust users accordingly.
4302 * xdisp.c (try_cursor_movement): Replace type check with eassert.
4303 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
4304 from EMACS_INT to ptrdiff_t.
4305 (make_window): Omit redundant initialization.
4306
62b2bcf6
JB
43072012-06-28 Juanma Barranquero <lekktu@gmail.com>
4308
4309 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
4310
45942c7d
DA
43112012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4312
4313 * window.h (struct window): Change type of 'use_time' and
4314 'sequence_number' from Lisp_Object to int.
4315 * frame.c (make_frame): Adjust users accordingly.
4316 * print.c (print_object): Likewise.
4317 * window.c (select_window, Fwindow_use_time, make_parent_window)
4318 (make_window): Likewise.
4319
e509cfa6
DA
43202012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4321
4322 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
4323 enabled with --enable-checking=[all,glyphs] configure option.
4324 Fix GLYPH_DEBUG usage assuming that it may be undefined,
4325 adjust comments accordingly.
4326 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
4327 undefined, adjust comments accordingly.
4328 * image.c: Likewise.
4329 * scroll.c: Likewise.
4330 * w32fns.c: Likewise.
4331 * w32term.c: Likewise.
4332 * xdisp.c: Likewise.
4333 * xfaces.c: Likewise.
4334 * xfns.c: Likewise.
4335 * xterm.c: Likewise.
4336
a54e2c05
DA
43372012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4338
4339 Generalize run-time debugging checks.
4340 * dispextern.h (XASSERTS): Remove.
4341 * fontset.c (xassert): Remove.
4342 Convert from xassert to eassert.
4343 * alloc.c: Convert from xassert to eassert.
4344 * bidi.c: Likewise.
4345 * dispnew.c: Likewise.
4346 * fns.c: Likewise.
4347 * fringe.c: Likewise.
4348 * ftfont.c: Likewise.
4349 * gtkutil.c: Likewise.
4350 * image.c: Likewise.
4351 * keyboard.c: Likewise.
4352 * menu.c: Likewise.
4353 * process.c: Likewise.
4354 * scroll.c: Likewise.
4355 * sound.c: Likewise.
4356 * term.c: Likewise.
4357 * w32console.c: Likewise.
4358 * w32fns.c: Likewise.
4359 * w32term.c: Likewise.
4360 * window.c: Likewise.
4361 * xdisp.c: Likewise.
4362 * xfaces.c: Likewise.
4363 * xfns.c: Likewise.
4364 * xselect.c: Likewise.
4365 * xterm.c: Likewise.
4366
1ec4b7b2
SM
43672012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
4368
4369 * fns.c (maybe_resize_hash_table): Output message when growing the
4370 purify-hashtable.
4371
2014308a
DA
43722012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4373
4374 * alloc.c (allocate_string_data): Remove dead code.
4375 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
4376 avoid GCC warning about unused macro.
4377
246155eb
DA
43782012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4379
4380 * alloc.c (allocate_string): Omit intervals initialization.
4381 * alloc.c (make_uninit_multibyte_string): Initialize intervals
4382 as in make_pure_string and make_pure_c_string.
4383
43184b7b
DA
43842012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4385
d209e2fb 4386 * alloc.c (allocate_string): Fix last change.
43184b7b 4387
3fe6dd74
DA
43882012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4389
d209e2fb 4390 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
4391 to memset, add explicit initialization where appropriate.
4392
1ba6038a
GM
43932012-06-27 Glenn Morris <rgm@gnu.org>
4394
4395 * lisp.mk (lisp): Remove paths.elc.
4396
c89926a5
CY
43972012-06-27 Chong Yidong <cyd@gnu.org>
4398
4399 * doc.c (Fsubstitute_command_keys): Fix punctuation.
4400
ed6b3510
JW
44012012-06-26 John Wiegley <johnw@newartisans.com>
4402
1ec4b7b2 4403 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
4404 on Mac OS X Lion: __mod_init_func and __mod_term_func.
4405
ed6b3510
JW
4406 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
4407 when building with Clang.
4408
8edd4a2b
SM
44092012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
4410
4411 * eval.c (Fapply): Allow calling it with a single argument.
4412
f6f62d1b
EZ
44132012-06-26 Eli Zaretskii <eliz@gnu.org>
4414
4415 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
4416 _stricmp and _strnicmp.
4417 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
4418
62efea5e
DA
44192012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4420
4421 * alloc.c (allocate_window): Zero out non-Lisp part of newly
4422 allocated window.
4423 (allocate_process): Likewise for new process.
8edd4a2b 4424 (allocate_terminal): Change to use offsetof.
62efea5e
DA
4425 (allocate_frame): Likewise.
4426 * frame.c (make_frame): Omit redundant initialization.
4427 * window.c (make_parent_window): Use memset.
4428 (make_window): Omit redundant initialization.
4429 * process.c (make_process): Omit redundant initialization.
4430 * terminal.c (create_terminal): Likewise.
4431
42997f4d
DA
44322012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4433
4434 * term.c (delete_tty): Remove redundant call to memset.
4435
1130ecfc
DA
44362012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4437
4438 * alloc.c: Remove build_string.
4439 * lisp.h: Define build_string as static inline. This provides
4440 a better opportunity to optimize away calls to strlen when the
4441 function is called with compile-time constant argument.
4442 * image.c (imagemagick_error): Convert to build_string.
4443 * w32proc.c (sys_spawnve): Likewise.
4444 * xterm.c (x_term_init): Likewise.
4445
cf38a720
PE
44462012-06-26 Paul Eggert <eggert@cs.ucla.edu>
4447
99027bdd
PE
4448 Use sprintf return value instead of invoking strlen on result.
4449 In the old days this wasn't portable, since some sprintf
4450 implementations returned char *. But they died out years ago and
4451 Emacs already assumes sprintf returns int.
4452 Similarly for float_to_string.
4453 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
4454 * ccl.c (ccl_driver):
4455 * character.c (string_escape_byte8):
4456 * data.c (Fnumber_to_string):
4457 * doprnt.c (doprnt):
4458 * print.c (print_object):
4459 * xdisp.c (message_dolog):
4460 * xfns.c (syms_of_xfns):
4461 Use sprintf or float_to_string result to avoid need to call strlen.
4462 * data.c (Fnumber_to_string):
4463 Use make_unibyte_string, since the string must be ASCII.
4464 * lisp.h, print.c (float_to_string): Now returns int length.
4465 * term.c (produce_glyphless_glyph):
4466 Use sprintf result rather than recomputing it.
4467
cf38a720
PE
4468 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
4469 * Makefile.in (ALL_CFLAGS):
4470 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
4471 * gmalloc.c, regex.c: Include <config.h> unconditionally.
4472
3511c784
DA
44732012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4474
0a08eb21 4475 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
4476 strcasecmp if available.
4477 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
4478
fb7da12e
AS
44792012-06-25 Andreas Schwab <schwab@linux-m68k.org>
4480
4481 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
4482 Avoid comma operator.
4483 * menu.c (push_submenu_start, push_submenu_end)
4484 (push_left_right_boundary, push_menu_pane): Likewise.
4485 * msdos.c (dos_rawgetc): Likewise.
4486
afa2ffd8
DA
44872012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4488
4489 * xfns.c (xic_create_fontsetname): Remove redundant calls
4490 to memset.
4491
b3b4476b
PE
44922012-06-25 Paul Eggert <eggert@cs.ucla.edu>
4493
4495ff38
PE
4494 * gtkutil.c (get_utf8_string): Remove redundant assignment.
4495 sprintf already null-terminates its output.
4496
b3b4476b
PE
4497 * xfns.c (x_window): Remove redundant cast.
4498
b00876c9
DA
44992012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4500
4501 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
4502 `const char *' to `char *' to avoid compiler warning.
4503
d188e26b
PE
45042012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4505
885d1d74
PE
4506 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
4507 instead of truncating it to 63 (admittedly a generous limit).
4508
d188e26b
PE
4509 * process.c: Fix spelling and caps in comments.
4510
e2f560b1
DN
45112012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
4512
e86db54b 4513 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
4514 * sysdep.c (setpgrp): Remove definition, not used in this file.
4515
7583a3a1
JB
45162012-06-24 Juanma Barranquero <lekktu@gmail.com>
4517
4518 * makefile.w32-in: Update dependencies.
4519
696056c2
EZ
45202012-06-24 Eli Zaretskii <eliz@gnu.org>
4521
4522 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
4523 (SYSTIME_H): Add nt/inc/sys/time.h.
4524
4525 * systime.h [WINDOWSNT]: Include sys/time.h.
4526
4527 * s/ms-w32.h (struct timespec): Definition moved from
4528 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4529
845ca893
PE
45302012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4531
4532 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
4533 * buffer.h (buffer_slot_type_mismatch):
4534 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
4535 * eval.c (unwind_to_catch):
4536 * image.c (my_png_error, my_error_exit):
4537 * keyboard.c (quit_throw_to_read_char, user_error)
4538 (Fexit_recursive_edit, Fabort_recursive_edit):
4539 * lisp.h (die, args_out_of_range, args_out_of_range_3)
4540 (wrong_type_argument, buffer_overflow, __executable_start)
4541 (memory_full, buffer_memory_full, string_overflow, Fthrow)
4542 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
4543 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
4544 (fatal):
4545 (child_setup) [!DOS_NT]:
4546 * lread.c (end_of_file_error, invalid_syntax):
4547 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
4548 * puresize.h (pure_write_error):
4549 * search.c (matcher_overflow):
4550 * sound.c (sound_perror, alsa_sound_perror):
4551 * sysdep.c, syssignal.h (croak):
4552 * term.c (maybe_fatal, vfatal):
4553 * textprop.c (text_read_only):
4554 * undo.c (user_error):
4555 * unexmacosx.c (unexec_error):
4556 * xterm.c (x_ins_del_lines, x_delete_glyphs):
4557 Use _Noreturn rather than NO_RETURN.
4558 No need for separate decl merely because of _Noreturn.
4559 * sound.c (sound_warning, parse_sound):
4560 Remove unnecessary forward decls.
4561
f1dd8073
PE
45622012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4563
4564 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
4565 * lisp.h (WAIT_READING_MAX): New macro.
4566 * dispnew.c (Fsleep_for, sit_for):
4567 * keyboard.c (kbd_buffer_get_event):
4568 * process.c (Faccept_process_output):
4569 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
4570 This improves on the previous patch, which introduced a bug
4571 when time_t is unsigned and as wide as intmax_t.
4572 See <http://bugs.gnu.org/9000#51>.
4573
b82c1755
EZ
45742012-06-23 Eli Zaretskii <eliz@gnu.org>
4575
4576 * dispnew.c (sit_for, Fsleep_for):
4577 * keyboard.c (kbd_buffer_get_event):
4578 * process.c (Faccept_process_output): Avoid compiler warnings when
4579 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
4580
ca300656
JB
45812012-06-23 Juanma Barranquero <lekktu@gmail.com>
4582
049ec95b
JB
4583 * makefile.w32-in: Update dependencies.
4584
ca300656
JB
4585 * w32.c (ltime): Add return type and declare static.
4586 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
4587
db7b8d06
PE
45882012-06-23 Paul Eggert <eggert@cs.ucla.edu>
4589
4590 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
4591 Privately reported by Herbert J. Skuhra.
4592 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
4593 All uses changed.
4594 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
4595 not make_lisp_timeval, when the argument is of type EMACS_TIME.
4596
0bd8297f
EZ
45972012-06-23 Eli Zaretskii <eliz@gnu.org>
4598
96512555
EZ
4599 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
4600 last argument of make_unibyte_string.
4601
0bd8297f
EZ
4602 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
4603 language ID in the event parameters.
4604
4605 * w32term.c (w32_read_socket): Put the new keyboard codepage into
4606 event.code, not the obscure "character set ID".
4607
63def6b6
CY
46082012-06-23 Chong Yidong <cyd@gnu.org>
4609
4610 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
4611
e8a02204
EZ
46122012-06-23 Eli Zaretskii <eliz@gnu.org>
4613
388cdec0
EZ
4614 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
4615 * w32.c (fdutimens): New function.
4616
4617 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
4618
4619 * s/ms-w32.h (pselect): Redirect to sys_select.
4620
4621 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
4622
e8a02204
EZ
4623 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
4624 in the logic of incrementing and decrementing the value of
4625 use_relocatable_buffers.
4626
d054f3fb
PE
46272012-06-23 Paul Eggert <eggert@cs.ucla.edu>
4628
4629 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
4630 Privately reported by Herbert J. Skuhra.
4631 [__FreeBSD__]: Remove "*/" typo after "#include".
4632 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
4633 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
4634 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
4635 Don't assume EMACS_TIME and struct timeval are the same type.
4636
d35af63c
PE
46372012-06-22 Paul Eggert <eggert@cs.ucla.edu>
4638
4639 Support higher-resolution time stamps (Bug#9000).
4640 The time stamps are only nanosecond-resolution at the C level,
4641 since that's the best that any real-world system supports now.
4642 But they are picosecond-resolution at the Lisp level, as that's
4643 easy, and leaves room for future OS improvements.
4644
4645 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
4646 (LIBES): Use it.
4647
4648 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
4649 Don't get current time unless it's needed.
4650
4651 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
4652 now provides it if it's absent.
4653 (start_atimer): Port to higher-res time stamps.
4654 Check for time stamp overflow. Don't get current time more
4655 often than is needed.
4656
4657 * buffer.h (struct buffer): Buffer modtime now has high resolution.
4658 Include systime.h, not time.h.
4659 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
4660
4661 * dired.c: Include stat-time.h.
4662 (Ffile-attributes): File times now have higher resolution.
4663
4664 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
4665 (struct image): Timestamp now has higher resolution.
4666
4667 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
4668 has at least microseconds now. All uses removed.
4669 (update_frame, update_single_window, update_window, update_frame_1)
4670 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 4671 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
4672
4673 * editfns.c (time_overflow): Now extern.
4674 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
4675 (float-time, Fformat_time_string, Fcurrent_time_string)
4676 (Fcurrent_time_zone): Accept and generate higher-resolution
4677 time stamps.
4678 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
4679 (decode_time_components, lisp_seconds_argument): New functions.
4680 (make_time): Now static.
4681 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
4682 Report an error if the time is invalid, rather than having the caller
4683 do that.
4684
4685 * fileio.c: Include <stat-time.h>
4686 (Fcopy_file): Copy higher-resolution time stamps.
4687 Prefer to set the time stamp via a file descriptor if that works.
4688 (Fset_file_times, Finsert_file_contents, Fwrite_region)
4689 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
4690 (Fvisited_file_modtime, Fset_visited_file_modtime):
4691 Support higher-resolution time stamps.
4692
4693 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
4694
4695 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
4696
4697 * image.c (prepare_image_for_display, clear_image_cache)
4698 (lookup_image): Port to higer-resolution time stamps.
4699
4700 * keyboard.c (start_polling, bind_polling_period):
4701 Check for time stamp overflow.
4702 (read_char, kbd_buffer_get_event, timer_start_idle)
4703 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
4704 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
4705 Port to higher-resolution time stamps. Do not assume time_t is signed.
4706 (decode_timer): New function. Timers are now vectors of length 9,
4707 not 8, to accommodate the picosecond component.
4708 (timer_check_2): Use it.
4709
4710 * nsterm.m (select_timeout, timeval_subtract): Remove.
4711 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
4712 as they're a bit more accurate and handle overflow better.
4713 (ns_select): Change prototype to be compatible with pselect.
4714 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
4715 * nsterm.h (ns_select): Adjust prototype.
4716
4717 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
4718 us-resolution time stamps.
4719 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
4720
4721 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
4722
4723 * lisp.h (time_overflow): New decl.
4724 (wait_reading_process_output): First arg is now intmax_t, not int,
4725 to accommodate larger waits.
4726
4727 * process.h (struct Lisp_Process.read_output_delay):
4728 Now counts nanoseconds, not microseconds.
4729 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
4730 EMACS_HAS_USECS.
4731 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
4732 (wait_reading_process_output):
4733 Port to ns-resolution time stamps.
4734 (Faccept_process_output, wait_reading_process_output):
4735 Check for time stamp overflow. Do not assume time_t is signed.
4736 (select_wrapper): Remove; we now use pselect.
4737 (Fprocess_attributes): Now generates ns-resolution time stamps.
4738
4739 * sysdep.c: Include utimens.h. Don't include utime.h
4740 or worry about struct utimbuf; gnulib does that for us now.
4741 (gettimeofday): Remove; gnulib provides a substitute.
4742 (make_timeval): New function.
4743 (set_file_times): Now sets ns-resolution time stamps.
4744 New arg FD; all uses changed.
4745 (time_from_jiffies, ltime_from_jiffies, get_up_time)
4746 (system_process_attributes):
4747 Now returns ns-resolution time stamp. All uses changed.
4748 Check for time stamp overflow.
4749
4750 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
4751 provides a substitute now.
4752
4753 * systime.h: Include timespec.h rather than sys/time.h and time.h,
4754 since it guarantees struct timespec.
4755 (EMACS_TIME): Now struct timespec, so that we can support
4756 ns-resolution time stamps.
4757 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
4758 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
4759 (EMACS_USECS): Remove.
4760 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
4761 so multiply the arg by 1000 before storing it.
4762 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
4763 New macros.
4764 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
4765 Port to ns-resolution time stamps.
4766 (EMACS_TIME_NEG_P): Remove; replaced by....
4767 (EMACS_TIME_SIGN): New macro.
4768 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
4769 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
4770 (set_file_times, make_time, lisp_time_argument): Adjust signature.
4771 (make_timeval, make_lisp_time, decode_time_components): New decls.
4772 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
4773 that it mishandled time_t overflow. You can't compare by subtracting!
4774 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
4775 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
4776
4777 * term.c: Include <sys/time.h>.
4778 (timeval_to_Time): New function, for proper overflow wraparound.
4779 (term_mouse_position, term_mouse_click): Use it.
4780
4781 * undo.c (record_first_change): Support higher-resolution time stamps
4782 in the undo buffer.
4783 (Fprimitive_undo): Use them when restoring time stamps.
4784
4785 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
4786 (w32_get_internal_run_time):
4787 Port to higher-resolution Emacs time stamps.
4788 (ltime): Now accepts single 64-bit integer, as that's more convenient
4789 for callers.
4790
4791 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
4792
4793 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
4794 for compatibility with pselect. Support ns-resolution time stamps.
4795
4796 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
4797
4798 * xselect.c (wait_for_property_change, x_get_foreign_selection):
4799 Check for time stamp overflow, and support ns-resolution time stamps.
4800
4801 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
4802 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
4803 (timeval_subtract): Remove; no longer needed.
4804 (XTflash, XTring_bell, x_wait_for_event):
4805 Port to ns-resolution time stamps. Don't assume time_t is signed.
4806
b6a92dfe
CY
48072012-06-22 Chong Yidong <cyd@gnu.org>
4808
4809 * xdisp.c (x_consider_frame_title): Revert last change.
4810
d251c37c
EZ
48112012-06-22 Eli Zaretskii <eliz@gnu.org>
4812
4813 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
4814 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
4815 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
4816 staticidx goes up to 1597 out of 1600 = 0x640.)
4817
f10deafb
PE
48182012-06-20 Paul Eggert <eggert@cs.ucla.edu>
4819
4820 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
4821 Otherwise, the umask might be mistakenly 0 while handling input signals.
4822
ec6de1e2
SM
48232012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
4824
4825 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
4826
28be1ada
DA
48272012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
4828
4829 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
4830 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
4831 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
4832 access to `contents' member of Lisp_Vector objects with AREF and ASET
4833 where appropriate.
4834
c6bf3022
CY
48352012-06-19 Chong Yidong <cyd@gnu.org>
4836
4837 * frame.c (delete_frame): When selecting a frame on a different
4838 text terminal, do not alter the terminal's top-frame.
4839
4840 * xdisp.c (format_mode_line_unwind_data): Record the target
4841 frame's selected window and its terminal's top-frame.
4842 (unwind_format_mode_line): Restore them.
4843 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
4844 Callers changed.
4845 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
4846 since tty frames can be explicitly named.
4847 (prepare_menu_bars): Likewise.
4848
4849 * term.c (Ftty_top_frame): New function.
4850
defd4196
PE
48512012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4852
4853 Port byte-code-meter to modern targets.
4854 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
4855 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 4856 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
4857 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
4858 (METER_1, METER_2): Simplify.
4859
1053a871
SM
48602012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
4861
4862 * data.c (Fdefalias): Return `symbol' (bug#11686).
4863
b7e8d081
MR
48642012-06-18 Martin Rudalics <rudalics@gmx.at>
4865
4866 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
4867 gets killed during executing of this function (Bug#11665).
4868 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
4869 (Vkill_buffer_query_functions): In doc-string say that functions
4870 run by this hook should not change the current buffer.
4871
7ea2b339
PE
48722012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4873
4874 Fix recently-introduced process.c problems found by static checking.
4875 * process.c (write_queue_push, write_queue_pop, send_process):
4876 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
4877 (write_queue_pop): Fix pointer signedness problem.
4878 (send_process): Remove unused local.
4879
96a313a1
CY
48802012-06-17 Chong Yidong <cyd@gnu.org>
4881
4882 * xdisp.c (redisplay_internal): No need to redisplay terminal
4883 frames that are not on top.
4884
20ca2e94
TN
48852012-06-17 Troels Nielsen <bn.troels@gmail.com>
4886
4887 * process.c (make_process): Initialize write_queue.
4888 (write_queue_push, write_queue_pop): New functions.
4889 (send_process): Use them to maintain correct ordering of process
4890 writes (Bug#10815).
4891
9a900ca9
PE
48922012-06-17 Paul Eggert <eggert@cs.ucla.edu>
4893
310fbfa8
PE
4894 * lisp.h (eassert): Assume C89 or later.
4895 This removes the need for CHECK.
4896 (CHECK): Remove. Its comments about always evaluating its
4897 argument were confusing, as 'eassert' typically does not evaluate
4898 its argument.
4899
27bb1ca4
PE
4900 * coding.c (produce_chars): Use ptrdiff_t, not int.
4901
9a900ca9
PE
4902 * xterm.c (x_draw_underwave): Check for integer overflow.
4903 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
4904
41b7f8bc 49052012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
4906
4907 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
4908 referenced (Bug#11583).
4909
9b0e3eba
AA
49102012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
4911
4912 Implement wave-style variant of underlining.
4913 * dispextern.h (face_underline_type): New enum.
4914 (face): Add field for underline type.
4915 * nsterm.m (ns_draw_underwave): New function.
4916 (ns_draw_text_decoration): Use it.
4917 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
4918 New functions.
4919 (x_draw_glyph_string): Use them.
4920 * xfaces.c (Qline, Qwave): New Lisp objects.
4921 (check_lface_attrs, merge_face_ref)
1053a871
SM
4922 (Finternal_set_lisp_face_attribute, realize_x_face):
4923 Handle wave-style underline face attributes.
9b0e3eba
AA
4924 * xterm.c (x_draw_underwave): New function.
4925 (x_draw_glyph_string): Use it.
4926
0fb52f11
JB
49272012-06-16 Juanma Barranquero <lekktu@gmail.com>
4928
4929 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
4930 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
4931 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
4932 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
4933 ($(BLD)/w32select.$(O)): Update dependencies.
4934
e5560ff7
AS
49352012-06-16 Andreas Schwab <schwab@linux-m68k.org>
4936
4937 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
4938 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
4939 * character.c (_fetch_multibyte_char_p): Remove.
4940 * alloc.c: Include "character.h" before "buffer.h".
4941 * bidi.c: Likewise.
4942 * buffer.c: Likewise.
4943 * bytecode.c: Likewise.
4944 * callint.c: Likewise.
4945 * callproc.c: Likewise.
4946 * casefiddle.c: Likewise.
4947 * casetab.c: Likewise.
4948 * category.c: Likewise.
4949 * cmds.c: Likewise.
4950 * coding.c: Likewise.
4951 * composite.c: Likewise.
4952 * dired.c: Likewise.
4953 * dispnew.c: Likewise.
4954 * doc.c: Likewise.
4955 * dosfns.c: Likewise.
4956 * editfns.c: Likewise.
4957 * emacs.c: Likewise.
4958 * fileio.c: Likewise.
4959 * filelock.c: Likewise.
4960 * font.c: Likewise.
4961 * fontset.c: Likewise.
4962 * fringe.c: Likewise.
4963 * indent.c: Likewise.
4964 * insdel.c: Likewise.
4965 * intervals.c: Likewise.
4966 * keyboard.c: Likewise.
4967 * keymap.c: Likewise.
4968 * lread.c: Likewise.
4969 * macros.c: Likewise.
4970 * marker.c: Likewise.
4971 * minibuf.c: Likewise.
4972 * nsfns.m: Likewise.
4973 * nsmenu.m: Likewise.
4974 * print.c: Likewise.
4975 * process.c: Likewise.
4976 * regex.c: Likewise.
4977 * region-cache.c: Likewise.
4978 * search.c: Likewise.
4979 * syntax.c: Likewise.
4980 * term.c: Likewise.
4981 * textprop.c: Likewise.
4982 * undo.c: Likewise.
4983 * unexsol.c: Likewise.
4984 * w16select.c: Likewise.
4985 * w32fns.c: Likewise.
4986 * w32menu.c: Likewise.
4987 * window.c: Likewise.
4988 * xdisp.c: Likewise.
4989 * xfns.c: Likewise.
4990 * xmenu.c: Likewise.
4991 * xml.c: Likewise.
4992 * xselect.c: Likewise.
4993
2f07e6af
EZ
49942012-06-16 Eli Zaretskii <eliz@gnu.org>
4995
1053a871
SM
4996 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
4997 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 4998 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
4999 row.
5000 (handle_face_prop): Use chunk-relative overlay string index when
5001 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
5002 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
5003 the rightmost. (Bug#11720)
2f07e6af 5004
29b83cec
AS
50052012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5006
5007 * category.h (CHAR_HAS_CATEGORY): Define as inline.
5008 (CATEGORY_MEMBER): Enforce 1/0 value.
5009 * category.c (_temp_category_set): Remove.
5010
4c5501e9
EZ
50112012-06-16 Eli Zaretskii <eliz@gnu.org>
5012
5013 * window.c (Fdelete_other_windows_internal)
5014 (Fdelete_window_internal): Don't access frame's mouse highlight
5015 info of the initial frame. (Bug#11677)
5016
2b570124
PE
50172012-06-14 Paul Eggert <eggert@cs.ucla.edu>
5018
e93864f9
PE
5019 * .gdbinit (xgetint): Fix recently-introduced paren typo.
5020 Assume USE_2_TAGS_FOR_INTS.
5021 (xreload): Adjust $tagmask width to match recent lisp.h change.
5022
2b570124
PE
5023 Simplify lisp.h in minor ways that should not affect code.
5024 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
5025 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
5026 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
5027 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
5028 (INTTYPEBITS): New macro, for clarity.
5029 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
5030 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
5031 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
5032 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
5033 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
5034
81755f69
JB
50352012-06-13 Juanma Barranquero <lekktu@gmail.com>
5036
5037 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
5038
16192a57
GM
50392012-06-13 Glenn Morris <rgm@gnu.org>
5040
5041 * s/bsd-common.h (BSD4_3):
5042 * s/usg5-4-common.h (USG5_4): No longer define; unused.
5043
646b5f55
AS
50442012-06-13 Andreas Schwab <schwab@linux-m68k.org>
5045
5046 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
5047 instead of union.
5048 (XLI, XIL): Define.
1053a871
SM
5049 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
5050 Use them.
5051 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 5052 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 5053 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
5054 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
5055 * frame.c (delete_frame): Remove outdated comment.
5056 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
5057 USE_LISP_UNION_TYPE.
5058 (Fw32_unregister_hot_key): Likewise.
5059 (Fw32_toggle_lock_key): Likewise.
5060 * w32menu.c (add_menu_item): Likewise.
5061 (w32_menu_display_help): Use XIL instead of checking
5062 USE_LISP_UNION_TYPE.
5063 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
5064 (init_heap): Likewise.
5065 * w32term.c (w32_read_socket): Update comment.
5066
1d3823c9
GM
50672012-06-13 Glenn Morris <rgm@gnu.org>
5068
c62ff706
GM
5069 * s/usg5-4-common.h, src/s/unixware.h:
5070 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
5071
1d3823c9
GM
5072 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
5073
bfe3e0a2
PE
50742012-06-13 Paul Eggert <eggert@cs.ucla.edu>
5075
5076 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
5077 * alloc.c (make_number) [!defined make_number]:
5078 Remove, as lisp.h always defines this now.
5079 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
5080 (roundup_size): Verify that it is a power of 2.
5081 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
5082 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
5083 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
5084 -DUSE_LSB_TAG=0, to override the automatically-selected default.
5085 USE_LSB_TAG now is always defined to be either 0 or 1.
5086 All uses changed.
5087 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
5088 code works fine either way, and efficiency is not a concern here,
5089 as the union type is for debugging, not for production.
5090 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
5091 Use an inline function on all platforms when using the union type,
5092 since this is simpler and 'static inline' can be used portably
5093 within Emacs now.
5094 (LISP_INITIALLY_ZERO): New macro.
5095 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
5096 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
5097
45fa9c0f
GM
50982012-06-12 Glenn Morris <rgm@gnu.org>
5099
b4492cba
GM
5100 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
5101
5102 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 5103
45fa9c0f
GM
5104 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
5105 Move BROKEN_SIGIO to configure.
5106
5107 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
5108 Move NO_TERMIO to configure.
5109
0e25d334
CY
51102012-06-12 Chong Yidong <cyd@gnu.org>
5111
5112 * image.c (imagemagick_load_image): Use MagickFlattenImage if
5113 MagickMergeImageLayers is undefined. Use pixel pusher loop if
5114 MagickExportImagePixels is undefined.
5115
43682bb6
PE
51162012-06-12 Paul Eggert <eggert@cs.ucla.edu>
5117
5118 * image.c (imagemagick_load_image): Remove unused label.
5119
a9be7d2b
GM
51202012-06-11 Glenn Morris <rgm@gnu.org>
5121
5122 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5123 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
5124 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
5125 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
5126
3017f87f
SM
51272012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
5128
5129 * alloc.c (make_byte_code): New function.
5130 (Fmake_byte_code): Use it. Don't purify here.
5131 * lread.c (read1): Use it as well to avoid extra allocation.
5132
1b9b4cf4
CY
51332012-06-11 Chong Yidong <cyd@gnu.org>
5134
5135 * image.c (imagemagick_load_image): Implement transparency.
5136
95988fcf
AS
51372012-06-10 Andreas Schwab <schwab@linux-m68k.org>
5138
5139 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
5140 account for preceding backslashes. (Bug#11663)
5141
cd4eb164
CY
51422012-06-09 Chong Yidong <cyd@gnu.org>
5143
5144 * term.c: Support italics in capable terminals (Bug#9652).
5145 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
5146 (turn_on_face): Output using TS_enter_italic_mode if available.
5147 Don't handle unused blinking and alt-charset cases.
5148 (turn_off_face): Handle italic case; discard unused tty_blinking_p
5149 and tty_alt_charset_p cases.
5150 (tty_capable_p, init_tty): Support italics.
5151
5152 * termchar.h (struct tty_display_info): Add field for italics.
5153 Remove unused blink field.
5154
5155 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
5156 Handle slant.
5157
5158 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
5159 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
5160 tty_alt_charset_p. Add tty_italic_p.
5161
ff88beb8
MA
51622012-06-09 Michael Albinus <michael.albinus@gmx.de>
5163
5164 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
5165 dbus_type_is_basic if available.
5166 (xd_extract_signed, xd_extract_unsigned): Rename from
5167 extract_signed and extract_unsigned, respectively. Adapt callers.
5168
44286096
CY
51692012-06-09 Chong Yidong <cyd@gnu.org>
5170
1682701f
CY
5171 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
5172
44286096
CY
5173 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
5174 case (Bug#9752).
5175
d86feb17
PE
51762012-06-08 Paul Eggert <eggert@cs.ucla.edu>
5177
5178 * xdisp.c (vmessage): Treat frame message as multibyte.
5179 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
5180 would generate the diagnostic "Making \302\247 buffer-local while
5181 let-bound!".
5182
d5c20fe8
EZ
51832012-06-08 Eli Zaretskii <eliz@gnu.org>
5184
5185 * dispnew.c (showing_window_margins_p): Undo last change, which
5186 was done due to an inadvertent commit.
5187 (adjust_frame_glyphs_for_frame_redisplay): Do call
5188 showing_window_margins_p.
5189
513749ee
SM
51902012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5191
5192 * eval.c (Fmake_var_non_special): New primitive.
5193 (syms_of_eval): Defsubr it.
5194 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
5195
d4a8f5c1
JB
51962012-06-08 Juanma Barranquero <lekktu@gmail.com>
5197
5198 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
5199 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
5200
8bbbc977
EZ
52012012-06-08 Eli Zaretskii <eliz@gnu.org>
5202
5203 * alloc.c (allocate_vectorlike): Fix last change.
5204
f3372c87
DA
52052012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
5206
5207 Block-based vector allocation of small vectors.
5208 * lisp.h (struct vectorlike_header): New field `nbytes',
5209 adjust comment accordingly.
5210 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
5211 to denote vector blocks. Adjust users (live_vector_p,
5212 mark_maybe_pointer, valid_lisp_object_p) accordingly.
5213 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
5214 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
5215 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
5216 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
5217 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
5218 (roundup_size): New constant.
5219 (struct vector_block): New data type.
5220 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 5221 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
5222 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
5223 (sweep_vectors): New functions.
5224 (allocate_vectorlike): Return `zero_vector' as the only vector of
5225 0 items. Allocate new vector from block if vector size is less than
5226 or equal to VBLOCK_BYTES_MAX.
5227 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
5228 (init_alloc_once): Add call to init_vectors.
5229
4f18a4ed
SM
52302012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5231
5232 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
5233
86f158bc
PE
52342012-06-07 Paul Eggert <eggert@cs.ucla.edu>
5235
5236 * doprnt.c (doprnt): Truncate multibyte char correctly.
5237 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
5238 would mishandle a string argument "Xc" if X was a multibyte
5239 character of length 2: it would truncate after X's first byte
5240 rather than including all of X.
5241
c5cfcbe0
CY
52422012-06-06 Chong Yidong <cyd@gnu.org>
5243
5244 * buffer.c (word_wrap): Doc fix.
5245
c05cf390
PE
52462012-06-04 Paul Eggert <eggert@cs.ucla.edu>
5247
5248 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
5249
0c3461de
GM
52502012-06-03 Glenn Morris <rgm@gnu.org>
5251
5252 * xdisp.c (tool-bar-style): Doc fix.
5253
c71232db
UM
52542012-06-03 Ulrich Müller <ulm@gentoo.org>
5255
5256 * Makefile.in (PAXCTL): Define.
5257 (temacs$(EXEEXT)): Disable memory randomization for the temacs
5258 binary via PaX flags if the paxctl utility is available.
5259 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
5260 Restore PaX flags to their default. (Bug#11398)
5261
383f7350
CY
52622012-06-03 Chong Yidong <cyd@gnu.org>
5263
5264 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
5265 buffer (Bug#11226).
5266
5f2c76c6
CY
52672012-06-03 Chong Yidong <cyd@gnu.org>
5268
5269 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
5270 (note_mode_line_or_margin_highlight): If there is no help echo,
5271 use mode-line-default-help-echo. Handle the case where the mouse
5272 position is past the end of the mode line string.
5273
5274 * buffer.c (buffer_local_value_1): New function, split from
5275 Fbuffer_local_value; can return Qunbound.
5276 (Fbuffer_local_value): Use it.
5277 (Vmode_line_format): Docstring tweaks.
5278
773d47f6
PE
52792012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5280
5281 * sysdep.c (system_process_attributes): Improve comment.
5282
f2d6a3df
SM
52832012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
5284
5285 * keyboard.c: Export real-this-command to Elisp.
5286 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
5287 and DEFVAR it. Update all users.
5288
63810350
PE
52892012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5290
7bd5c1f4
PE
5291 * minibuf.c (Fassoc_string): Remove duplicate declaration.
5292
63810350
PE
5293 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
5294 Convert pctcpu and pctmem to Lisp float properly.
5295 Let the compiler fold better, as 100.0/0x8000 is exact.
5296
a2821611
AS
52972012-06-02 Andreas Schwab <schwab@linux-m68k.org>
5298
5299 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
5300 cons_block.
5301
5fceba1d
PE
53022012-06-01 Paul Eggert <eggert@cs.ucla.edu>
5303
5304 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
5305
c98ff5dd
DA
53062012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
5307
5308 For a 'struct window', replace some Lisp_Object fields to
5309 bitfields where appropriate, remove unused fields.
5310 * window.h (struct window): Remove unused 'last_mark_x' and
5311 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
5312 change it's type from Lisp_Object to bitfield.
5313 Change type of 'force_start', 'optional_new_start',
5314 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
5315 fields from Lisp_Object to bitfield. Adjust users accordingly.
5316
ca34e0be
PE
53172012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5318
5319 Pacify gcc -Wdouble-precision when using Xaw.
5320 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
5321 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
5322 Use 'float' consistently, rather than 'float' in most places
5323 and 'double' in a couple of places.
5324
efc00ab1 53252012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
5326
5327 * xdisp.c (handle_stop): Detect whether we have overlay strings
5328 loaded by testing it->current.overlay_string_index to be
5329 non-negative, instead of checking whether n_overlay_strings is
5330 positive. (Bug#11587)
5331
efc00ab1 53322012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
5333
5334 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
5335
5336 * doc.c (Fsubstitute_command_keys): Doc fix.
5337
efc00ab1 53382012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
5339
5340 * search.c (search_buffer): Remove calls to
5341 r_alloc_inhibit_buffer_relocation, as it is now called by
5342 maybe_unify_char, which was the cause of relocation of buffer text
5343 in bug#11519.
5344
efc00ab1 53452012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
5346
5347 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
5348 for the duration of call to load_charset, to avoid problems with
5349 callers of maybe_unify_char that access buffer text through C
5350 pointers.
5351
5352 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
5353 decrement the inhibition flag, instead of just setting or
5354 resetting it.
5355
ba93a187
PE
53562012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5357
5358 Remove obsolete '#define static' cruft.
5359 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
5360 This #undef was "temporary" in 2000; it is no longer needed
5361 now that '#define static' has gone away.
5362 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
5363 (gray_bitmap_bits): Remove; no longer needed.
5364 All uses replaced with definiens.
5365 * xterm.c: Include "bitmaps/gray.xbm".
5366
9e4bf381
PE
53672012-05-30 Paul Eggert <eggert@cs.ucla.edu>
5368
5369 Clean up __executable_start, monstartup when --enable-profiling.
5370 The following changes affect the code only when profiling.
5371 * dispnew.c (__executable_start): Rename from safe_bcopy.
5372 Define only on platforms that need it.
5373 * emacs.c: Include <sys/gmon.h> when profiling.
5374 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
5375 (__executable_start): Remove decl, since lisp.h does it now.
5376 (safe_bcopy): Remove decl; no longer has that name.
5377 (main): Coalesce #if into single bit of code, for simplicity.
5378 Cast pointers to uintptr_t, since standard libraries want integers
5379 and not pointers.
5380 * lisp.h (__executable_start): New decl.
5381
32d72c2f
GM
53822012-05-31 Glenn Morris <rgm@gnu.org>
5383
5384 * image.c (Fimagemagick_types): Doc fix.
5385
baac5bc7
JM
53862012-05-30 Jim Meyering <meyering@redhat.com>
5387
5388 * callproc.c (Fcall_process_region): Include directory component
5389 in mkstemp error message (Bug#11586).
5390
72cb32cf
PE
53912012-05-30 Paul Eggert <eggert@cs.ucla.edu>
5392
5393 * alloc.c, lisp.h (make_pure_vector): Now static.
5394
61b108cc
SM
53952012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
5396
5397 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
5398 Move to byte-run.el.
5399 (Fautoload): Do the hash-doc more carefully.
5400 * data.c (Fdefalias): Purify definition, except for keymaps.
5401 (Qdefun): Move from eval.c.
5402 * lisp.h (Qdefun): Remove.
5403 * lread.c (read1): Tiny simplification.
5404
471fe23d
TN
54052012-05-29 Troels Nielsen <bn.troels@gmail.com>
5406
934f3f58 5407 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
5408 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
5409 Bug#9642, but explicitly check that the buffer the overlay would
5410 be moved to is live and rearrange lines to make sure that errors
5411 will not put the overlay in an inconsistent state.
5412 (Fdelete_overlay): Cosmetics.
5413
85d0efd1
EZ
54142012-05-28 Eli Zaretskii <eliz@gnu.org>
5415
5416 * w32term.c (my_bring_window_to_top): New function.
5417 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
5418 could be different from the original one.
5419 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
5420 (Bug#11513)
5421
5422 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
5423 by calling BringWindowToTop.
5424
5425 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
5426 (WM_EMACS_END): Increase by one.
5427
da92a98c
PE
54282012-05-28 Paul Eggert <eggert@cs.ucla.edu>
5429
5430 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
5431 This avoids undefined behavior that might cause the eassert
5432 to not catch an out-of-range value.
5433
74d1f848
JB
54342012-05-28 Juanma Barranquero <lekktu@gmail.com>
5435
5436 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
5437 Update dependencies.
5438
9e1a06fc
EZ
54392012-05-27 Eli Zaretskii <eliz@gnu.org>
5440
5441 * bidi.c (bidi_mirror_char): Fix last change.
5442
f3dd7312
AS
54432012-05-27 Andreas Schwab <schwab@linux-m68k.org>
5444
5445 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
5446 when referring to sectname field in printf format.
5447
81899c91
PE
54482012-05-27 Paul Eggert <eggert@cs.ucla.edu>
5449
57b81a9f
PE
5450 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
5451 Only r_alloc_inhibit_buffer_relocation needed to be added;
5452 the others were already declared.
5453
81899c91
PE
5454 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
5455 before checking whether it's out of range. Put the check inside
5456 eassert. See
5457 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
5458
33017faf 54592012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
5460
5461 * callproc.c (Fcall_process): Restore a line that was accidentally
5462 commented out in the 2011-02-13 change (bug#11547).
5463
33017faf 54642012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
5465
5466 * lisp.h [REL_ALLOC]: Add prototypes for external functions
5467 defined on ralloc.c.
5468
5469 * buffer.c [REL_ALLOC]: Remove prototypes of
5470 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
5471 they are now on lisp.h.
5472
5473 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
5474
5475 * search.c (search_buffer): Use it to inhibit relocation of buffer
5476 text while re_search_2 is doing its job, because re_search_2 is
5477 passed C pointers to buffer text. (Bug#11519)
5478
23415acf
EZ
5479 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
5480 Update value to 24.
5481
44e27368
EZ
5482 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
5483 state after an additional call to move_it_in_display_line_to, keep
5484 the values of it->max_ascent and it->max_descent found for the
5485 entire line.
5486 (pos_visible_p): Revert the comparison against bottom_y to what it
5487 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
5488 (Bug#11464)
5489
c1892f11
PE
54902012-05-26 Paul Eggert <eggert@cs.ucla.edu>
5491
5492 Fix coding-related core dumps with gcc -ftrapv.
5493 The code was computing A - B, where A and B are pointers, and B is
5494 random garbage. This can lead to core dumps on platforms that
5495 have special pointer registers, and it also leads to core dumps on
5496 x86-64 when compiled with gcc -ftrapv. The fix is to compute
5497 A - B only when B is initialized properly.
5498 * coding.c (coding_set_source, coding_set_destination): Return void.
5499 (coding_change_source, coding_change_destinations): New functions,
5500 with the old behaviors of coding_set_source and coding_set_destination.
5501 All callers that need an offset changed to use these new functions.
5502
eb7afdad
GM
55032012-05-26 Glenn Morris <rgm@gnu.org>
5504
5505 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
5506
f12fdf02
EZ
55072012-05-26 Eli Zaretskii <eliz@gnu.org>
5508
53a63be6 5509 Extend mouse support on W32 text-mode console.
61b108cc
SM
5510 * xdisp.c (draw_row_with_mouse_face):
5511 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 5512
eb3f6f01 5513 * w32console.c: Include window.h.
61b108cc
SM
5514 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
5515 New functions.
eb3f6f01
EZ
5516 (initialize_w32_display): Initialize mouse-highlight data.
5517
53a63be6
EZ
5518 * w32inevt.c: Include termchar.h and window.h.
5519 (do_mouse_event): Support mouse-autoselect-window. When the mouse
5520 moves, call note_mouse_highlight. If help_echo changed, call
5521 gen_help_event to produce help-echo message in the echo area.
5522 Call clear_mouse_face if mouse_face_hidden is set in the mouse
5523 highlight info.
5524
4cfd81f6
PE
55252012-05-26 Paul Eggert <eggert@cs.ucla.edu>
5526
5527 * lread.c (read1): Simplify slightly to avoid an overflow warning
5528 with GCC 4.7.0 on x86-64.
5529
4446092a
EZ
55302012-05-26 Eli Zaretskii <eliz@gnu.org>
5531
5532 * bidi.c (bidi_mirror_char): Revert last change: an int is
5533 definitely wide enough here.
5534
42b2a986 55352012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 5536
42b2a986 5537 Fix integer width and related bugs (Bug#9874).
eb106a49 5538 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
5539 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
5540 (string_bytes, check_sblock, allocate_string_data):
5541 (compact_small_strings, Fmake_bool_vector, make_string)
5542 (make_unibyte_string, make_multibyte_string)
5543 (make_string_from_bytes, make_specified_string)
5544 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
5545 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
5546 (mark_vectorlike):
5547 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5548 (allocate_pseudovector):
5549 Use int, not EMACS_INT, where int is wide enough.
5550 (inhibit_garbage_collection, Fgarbage_collect):
5551 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5552 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
5553 int might not be wide enough.
5554 (bidi_cache_search, bidi_cache_find, bidi_init_it)
5555 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5556 (bidi_at_paragraph_end, bidi_find_paragraph_start)
5557 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
5558 (bidi_level_of_next_char, bidi_move_to_visually_next):
5559 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5560 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
5561 (Fkill_buffer, Fset_buffer_major_mode)
5562 (advance_to_char_boundary, Fbuffer_swap_text)
5563 (Fset_buffer_multibyte, overlays_at, overlays_in)
5564 (overlay_touches_p, struct sortvec, record_overlay_string)
5565 (overlay_strings, recenter_overlay_lists)
5566 (adjust_overlays_for_insert, adjust_overlays_for_delete)
5567 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
5568 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
5569 (Foverlay_recenter, last_overlay_modification_hooks_used)
5570 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
5571 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
5572 (validate_region): Omit unnecessary test for b <= e,
5573 since that's guaranteed by the previous test.
d311d28c
PE
5574 (adjust_overlays_for_delete): Avoid pos + length overflow.
5575 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
5576 (report_overlay_modification):
5577 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5578 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
5579 Omit pointer cast, which isn't needed anyway, and doesn't work
5580 after the EMACS_INT -> ptrdiff_t change.
02481186 5581 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
5582 * buffer.h: Adjust decls to match defn changes elsewhere.
5583 (struct buffer_text, struct buffer):
5584 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5585 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
5586 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
5587 not int, to avoid needless 32-bit limit on 64-bit hosts.
5588 (exec_byte_code): Use tighter memory-full test, one that checks
5589 for alloca overflow. Don't compute the address of the object just
5590 before an array, as that's not portable. Use EMACS_INT, not
5591 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
5592 * callint.c (Fcall_interactively):
5593 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5594 * callproc.c (call_process_kill, Fcall_process):
5595 Don't assume pid_t fits into an Emacs fixnum.
5596 (call_process_cleanup, Fcall_process, child_setup):
5597 Don't assume pid_t fits into int.
5598 (call_process_cleanup, Fcall_process, delete_temp_file)
5599 (Fcall_process_region):
5600 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5601 (Fcall_process): Simplify handling of volatile integers.
5602 Use int, not EMACS_INT, where int will do.
5603 * casefiddle.c (casify_object, casify_region, operate_on_word)
5604 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
5605 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5606 (casify_object): Avoid integer overflow when overallocating buffer.
5607 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 5608 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
5609 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
5610 * category.h (CATEGORYP): Don't assume arg is nonnegative.
5611 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
5612 integers are now checked earlier. All uses replaced with XINT.
5613 (ccl_driver):
5614 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5615 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
5616 (ccl_driver, Fregister_code_conversion_map):
5617 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
5618 (resolve_symbol_ccl_program): Check that vector header is in range.
5619 Always copy the vector, so that we can check its contents reliably
5620 now rather than having to recheck each instruction as it's being
5621 executed. Check that vector words fit in 'int'.
5622 (ccl_get_compiled_code, Fregister_ccl_program)
5623 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
5624 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
5625 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
5626 contents are in range.
5627 (Fccl_execute_on_string): Check that status is in range.
5628 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
5629 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
5630 Accept and return EMACS_INT, not int, because callers can pass values
5631 out of 'int' range.
5632 (c_string_width, strwidth, lisp_string_width, chars_in_text)
5633 (multibyte_chars_in_text, parse_str_as_multibyte)
5634 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
5635 (str_as_unibyte, str_to_unibyte, string_count_byte8)
5636 (string_escape_byte8, Fget_byte):
5637 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 5638 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
5639 avoid mishandling large integers.
5640 * character.h: Adjust decls to match defn changes elsewhere.
5641 * charset.c (load_charset_map_from_file, find_charsets_in_text)
5642 (Ffind_charset_region):
5643 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5644 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
5645 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 5646 Don't assume fixnum fits in int.
d311d28c
PE
5647 (load_charset_map_from_vector, Fmap_charset_chars):
5648 Remove now-unnecessary CHECK_NATNUMs.
5649 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
5650 Don't rely on undefined behavior with signed left shift overflow.
5651 Don't assume unsigned int fits into fixnum, or that fixnum fits
5652 into unsigned int. Don't require max_code to be a valid fixnum;
5653 that's not true for gb10830 4-byte on a 32-bit host. Allow
5654 invalid_code to be a cons, for the same reason. Require code_offset
5655 to be a character. Avoid int overflow if max_char is close
5656 to INT_MAX.
5657 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
5658 this is intended anyway and avoids some undefined behavior.
5659 (load_charset_map): Pass unsigned, not int, as 2nd arg of
5660 INDEX_TO_CODE_POINT, as that's what it expects.
5661 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
5662 * charset.h (DECODE_CHAR): Return int, not unsigned;
5663 this is what was intended anyway, and it avoids undefined behavior.
5664 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
5665 integer-overflow issues.
5666 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
5667 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
5668 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
5669 * chartab.c (Fmake_char_table, Fset_char_table_range)
5670 (uniprop_get_decoder, uniprop_get_encoder):
5671 Don't assume fixnum fits in int.
5672 * cmds.c (move_point): New function, that does the gist of
5673 Fforward_char and Fbackward_char, but does so while checking
5674 for integer overflow more accurately.
c96e5d6a 5675 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
5676 (Fforward_line, Fend_of_line, internal_self_insert)
5677 (internal_self_insert):
5678 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5679 Fix a FIXME, by checking for integer overflow when calculating
5680 target_clm and actual_clm.
5681 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 5682 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
5683 (ASSURE_DESTINATION, coding_alloc_by_realloc)
5684 (coding_alloc_by_making_gap, alloc_destination)
5685 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
5686 (encode_coding_utf_16, detect_coding_emacs_mule)
5687 (decode_coding_emacs_mule, encode_coding_emacs_mule)
5688 (detect_coding_iso_2022, decode_coding_iso_2022)
5689 (encode_invocation_designation, encode_designation_at_bol)
5690 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
5691 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
5692 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
5693 (encode_coding_ccl, encode_coding_raw_text)
5694 (detect_coding_charset, decode_coding_charset)
5695 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
5696 (produce_composition, produce_charset, produce_annotation)
5697 (decode_coding, handle_composition_annotation)
5698 (handle_charset_annotation, consume_chars, decode_coding_gap)
5699 (decode_coding_object, encode_coding_object, detect_coding_system)
5700 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
5701 (code_convert_region, code_convert_string)
8f50130c
PE
5702 (Fdefine_coding_system_internal)
5703 (coding_set_source, coding_set_destination):
d311d28c
PE
5704 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5705 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
5706 (Fdefine_coding_system_internal):
5707 Don't assume fixnums fit in int.
5708 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 5709 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
5710 (Funencodable_char_position, Fcheck_coding_systems_region)
5711 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 5712 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 5713 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 5714 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 5715 Don't access memory outside of the args array.
d311d28c 5716 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
5717 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
5718 result of ENCODE_CHAR.
d311d28c
PE
5719 * coding.h: Adjust decls to match defn changes elsewhere.
5720 (struct coding_system):
5721 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5722 * composite.c (get_composition_id, find_composition)
5723 (run_composition_function, update_compositions)
5724 (compose_text, composition_gstring_put_cache)
5725 (composition_gstring_p, composition_gstring_width)
5726 (fill_gstring_header, fill_gstring_body, autocmp_chars)
5727 (composition_compute_stop_pos, composition_reseat_it)
5728 (composition_update_it, struct position_record)
5729 (find_automatic_composition, composition_adjust_point)
5730 (Fcomposition_get_gstring, Ffind_composition_internal):
5731 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5732 (update_compositions):
5733 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5734 * composite.h: Adjust decls to match defn changes elsewhere.
5735 (struct composition):
5736 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5737 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
5738 Do not attempt to compute the address of the object just before a
5739 buffer; this is not portable.
5740 (Faref, Faset):
5741 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5742 (Faset): Use int, not EMACS_INT, where int is wide enough.
5743 (Fstring_to_number): Don't assume fixnums fit in int.
5744 (Frem): Don't assume arg is nonnegative.
5745 * dbusbind.c (xd_append_arg): Check for integers out of range.
5746 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 5747 (extract_signed, extract_unsigned): New functions.
243e0530
PE
5748 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
5749 (xd_get_connection_references): Return ptrdiff_t, not int.
5750 All uses changed.
5751 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
5752 (xd_read_message_1):
5753 Use int, not unsigned, where the dbus API uses int.
5754 (Fdbus_message_internal): Don't overflow mtype.
5755 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
5756 * dired.c (directory_files_internal, file_name_completion, scmp)
5757 (file_name_completion_stat):
5758 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5759 (file_name_completion): Don't overflow matchcount.
5760 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
5761 * dispextern.h: Adjust decls to match defn changes elsewhere.
5762 (struct text_pos, struct glyph, struct bidi_saved_info)
5763 (struct bidi_string_data, struct bidi_it, struct composition_it)
5764 (struct it):
5765 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5766 (struct display_pos, struct composition_it, struct it):
5767 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5768 * dispnew.c (increment_matrix_positions)
5769 (increment_row_positions, mode_line_string)
5770 (marginal_area_string):
5771 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 5772 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
5773 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5774 (duration_to_sec_usec): New function, to check for overflow better.
5775 (Fsleep_for, sit_for): Use it.
5776 * doc.c (get_doc_string, store_function_docstring):
5777 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5778 (get_doc_string, Fsnarf_documentation):
5779 Use int, not EMACS_INT, where int is wide enough.
5780 (get_doc_string):
5781 Use SAFE_ALLOCA, not alloca.
5782 Check for overflow when converting EMACS_INT to off_t.
5783 * doprnt.c (doprnt):
5784 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5785 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
5786 Don't assume uid_t fits into fixnum.
5787 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
5788 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
5789 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
5790 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
5791 (general_insert_function)
5792 (Finsert_char, make_buffer_string, make_buffer_string_both)
5793 (update_buffer_properties, Fbuffer_substring)
5794 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
5795 (Fsubst_char_in_region, check_translation)
5796 (Ftranslate_region_internal, save_restriction_restore, Fformat)
5797 (transpose_markers, Ftranspose_regions):
5798 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5799 (clip_to_bounds): Move to lisp.h as an inline function).
5800 (Fconstrain_to_field): Don't assume integers are nonnegative.
5801 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
5802 (Fsubst_char_in_region, Fsave_restriction):
5803 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5804 (Femacs_pid): Don't assume pid_t fits into fixnum.
5805 (lo_time): Use int, not EMACS_INT, when int suffices.
5806 (lisp_time_argument): Check for usec out of range.
5807 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
5808 (Fuser_login_name, Fuser_full_name): Signal an error
5809 if a uid argument is out of range, rather than relying on
5810 undefined behavior.
c8d5c857
PE
5811 (Fformat_time_string): Remove now-unnecessary check.
5812 lisp_time_argument checks for out-of-range usec now.
243e0530 5813 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
5814 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
5815 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
5816 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
5817 (init_cmdargs, Fdump_emacs):
5818 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5819 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
5820 the bottom (typically) 32 bits of the fixnum.
5821 * eval.c (specpdl_size, call_debugger):
5822 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5823 (when_entered_debugger, Fbacktrace_debug):
5824 Don't assume fixnum can fit in int.
5825 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
5826 the object just before a buffer; this is not portable.
5827 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
5828 (grow_specpdl, unbind_to):
5829 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5830 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
5831 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 5832 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
5833 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
5834 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
5835 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5836 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
5837 (a_write, e_write):
5838 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5839 (Fcopy_file, non_regular_nbytes, read_non_regular)
5840 (Finsert_file_contents):
5841 Use int, not EMACS_INT, where int is wide enough.
5842 (READ_BUF_SIZE): Verify that it fits in int.
5843 (Finsert_file_contents): Check that counts are in proper range,
5844 rather than assuming fixnums fit into ptrdiff_t etc.
5845 Don't assume fixnums fit into int.
125b3835 5846 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
5847 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
5848 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
5849 (string_char_to_byte, string_byte_to_char)
5850 (string_make_multibyte, string_to_multibyte)
5851 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
5852 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
5853 (substring_both, Fdelete, internal_equal, Ffillarray)
5854 (Fclear_string, mapcar1)
5855 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
5856 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
5857 (larger_vector, make_hash_table, maybe_resize_hash_table)
5858 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
5859 (Fmaphash, secure_hash):
5860 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5861 (concat): Check for string index and length overflow.
5862 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
5863 (Frequire):
5864 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5865 (larger_vector): New API (vec, incr_min, size_max) replaces old
5866 one (vec, new_size, init). This catches size overflow.
5867 INIT was removed because it was always Qnil.
5868 All callers changed.
5869 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
5870 the upper bound on a hash table index size.
5871 (make_hash_table, maybe_resize_hash_table): Use it.
5872 (secure_hash): Computer start_byte and end_byte only after
5873 they're known to be in ptrdiff_t range.
5874 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
5875 (Ffont_get_glyphs, Ffont_at):
5876 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5877 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
5878 (Flist_fonts, Fopen_font):
5879 Don't assume fixnum can fit in int.
5880 (check_gstring): Don't assume index can fit in int.
5881 (font_match_p): Check that fixnum is a character, not a nonnegative
5882 fixnum, since the later code needs to stuff it into an int.
5883 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
5884 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
5885 conversion overflow issues.
5886 (Fopen_font): Check for integer out of range.
5887 (Ffont_get_glyphs): Don't assume index can fit in int.
5888 * font.h: Adjust decls to match defn changes elsewhere.
5889 * fontset.c (reorder_font_vector): Redo score calculation to avoid
5890 integer overflow.
5891 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
5892 printmax_t, where ptrdiff_t is wide enough.
5893 (Finternal_char_font):
5894 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5895 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
5896 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
5897 (Fset_frame_position, x_set_frame_parameters)
5898 (x_set_line_spacing, x_set_border_width)
5899 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
5900 Check that fixnums are in proper range for system types.
5901 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
5902 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5903 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
5904 Use SAFE_ALLOCA_LISP, not alloca.
5905 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
5906 intptr_t is wide enough.
5907 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
5908 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
5909 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
5910 Check for fixnum out of range.
5911 * ftfont.c (ftfont_list): Don't assume index fits in int.
5912 Check that fixnums are in proper range for system types.
5913 (ftfont_shape_by_flt):
5914 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
5915 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
5916 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5917 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
5918 Check that fixnums are in proper range for system types.
5919 * gnutls.h: Adjust decls to match defn changes elsewhere.
5920 * gtkutil.c (xg_dialog_run):
5921 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5922 (update_frame_tool_bar):
5923 Check that fixnums are in proper range for system types.
5924 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 5925 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
5926 * indent.c (last_known_column, last_known_column_point):
5927 (current_column_bol_cache):
5928 (skip_invisible, current_column, check_display_width):
5929 (check_display_width, scan_for_column, current_column_1)
5930 (Findent_to, Fcurrent_indentation, position_indentation)
5931 (indented_beyond_p, Fmove_to_column, compute_motion):
5932 (Fcompute_motion, Fvertical_motion):
5933 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5934 (last_known_column_modified): Use EMACS_INT, not int.
5935 (check_display_width):
5936 (Fcompute_motion):
5937 Check that fixnums and floats are in proper range for system types.
5938 (compute_motion): Don't assume index or fixnum fits in int.
5939 (compute_motion, Fcompute_motion):
5940 Use int, not EMACS_INT, when it is wide enough.
5941 (vmotion): Omit local var start_hpos that is always 0; that way
5942 we don't need to worry about overflow in expressions involving it.
5943 * indent.h: Adjust decls to match defn changes elsewhere.
5944 (struct position):
5945 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5946 Use int, not EMACS_INT, where int is wide enough.
5947 Remove unused members ovstring_chars_done and tab_offset;
5948 all uses removed.
5949 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
5950 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
5951 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
5952 (make_gap, copy_text, insert, insert_and_inherit)
5953 (insert_before_markers, insert_before_markers_and_inherit)
5954 (insert_1, count_combining_before, count_combining_after)
5955 (insert_1_both, insert_from_string)
5956 (insert_from_string_before_markers, insert_from_string_1)
5957 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
5958 (adjust_after_replace, adjust_after_insert, replace_range)
5959 (replace_range_2, del_range, del_range_1, del_range_byte)
5960 (del_range_both, del_range_2, modify_region)
5961 (prepare_to_modify_buffer, signal_before_change)
5962 (signal_after_change, Fcombine_after_change_execute):
5963 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5964 * intervals.c (traverse_intervals, rotate_right, rotate_left)
5965 (balance_an_interval, split_interval_right, split_interval_left)
5966 (find_interval, next_interval, update_interval)
5967 (adjust_intervals_for_insertion, delete_node, delete_interval)
5968 (interval_deletion_adjustment, adjust_intervals_for_deletion)
5969 (static_offset_intervals, offset_intervals)
5970 (merge_interval_right, merge_interval_left, make_new_interval)
5971 (graft_intervals_into_buffer, temp_set_point_both)
5972 (temp_set_point, set_point, adjust_for_invis_intang)
5973 (set_point_both, move_if_not_intangible, get_property_and_range)
5974 (get_local_map, copy_intervals, copy_intervals_to_string)
5975 (compare_string_intervals, set_intervals_multibyte_1):
5976 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5977 * intervals.h: Adjust decls to match defn changes elsewhere.
5978 (struct interval):
5979 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5980 * keyboard.c (this_command_key_count, this_single_command_key_start)
5981 (before_command_key_count, before_command_echo_length, echo_now)
5982 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
5983 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
5984 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
5985 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
5986 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5987 (last_non_minibuf_size, last_point_position, echo_truncate)
5988 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
5989 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
5990 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
5991 (stuff_buffered_input):
5992 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5993 (last_auto_save, command_loop_1, read_char):
5994 Use EMACS_INT, not int, to avoid integer overflow.
5995 (record_char): Avoid overflow in total_keys computation.
5996 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
5997 * keyboard.h: Adjust decls to match defn changes elsewhere.
5998 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
5999 (Fkey_description, Fdescribe_vector, Flookup_key):
6000 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6001 (click_position): New function, to check that positions are in range.
6002 (Fcurrent_active_maps):
6003 (describe_command):
6004 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6005 (Faccessible_keymaps, Fkey_description):
6006 (preferred_sequence_p):
6007 Don't assume fixnum can fit into int.
6008 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
6009 Check for integer overflow in size calculations.
6010 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
6011 avoid mishandling large integers.
6012 * lisp.h: Adjust decls to match defn changes elsewhere.
6013 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
6014 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
6015 (struct Lisp_Marker):
6016 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6017 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
6018 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
6019 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
6020 All callers changed.
6021 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
6022 Assume the arg has valid form, since it always does.
6023 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
6024 unsigned integer system type.
6025 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
6026 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
6027 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6028 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
6029 (duration_to_sec_usec): New decl.
6030 * lread.c (read_from_string_index, read_from_string_index_byte)
6031 (read_from_string_limit, readchar, unreadchar, openp)
6032 (read_internal_start, read1, oblookup):
6033 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6034 (Fload, readevalloop, Feval_buffer, Feval_region):
6035 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6036 (openp): Check for out-of-range argument to 'access'.
6037 (read1): Use int, not EMACS_INT, where int is wide enough.
6038 Don't assume fixnum fits into int.
6efdadfd 6039 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
6040 (read_filtered_event): Use duration_to_sec_usec
6041 to do proper overflow checking on durations.
d311d28c
PE
6042 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
6043 in size calculation.
6044 (Fexecute_kbd_macro):
6045 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6046 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
6047 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
6048 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
6049 (set_marker_both, set_marker_restricted_both, marker_position)
6050 (marker_byte_position, Fbuffer_has_markers_at):
6051 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6052 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 6053 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
6054 It now merely ensures that the menu is large enough, without
6055 necessarily growing it, as this avoids some integer overflow issues.
6056 All callers changed.
6057 (keymap_panes, parse_single_submenu, Fx_popup_menu):
6058 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6059 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
6060 Use SAFE_ALLOCA_LISP, not alloca.
6061 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
6062 to EMACS_INT. Check that fixnums are in proper range for system types.
6063 * minibuf.c (minibuf_prompt_width, string_to_object)
6064 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
6065 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
6066 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6067 (get_minibuffer, read_minibuf_unwind):
6068 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6069 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
6070 this simplifies overflow checking. All callers changed.
6071 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
6072 (Ftest_completion):
6073 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6074 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
6075 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
6076 Check that fixnums are in proper range for system types.
6077 (Fx_create_frame, Fx_show_tip):
6078 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6079 * nsfont.m (ns_findfonts, nsfont_list_family):
6080 Don't assume fixnum fits in long.
6081 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
6082 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6083 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
6084 wide enough.
17fdb222 6085 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
6086 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6087 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
6088 (PRINTDECLARE, PRINTPREPARE):
6089 (strout, print_string):
6090 (print, print_preprocess, print_check_string_charset_prop)
6091 (print_object):
6092 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6093 (PRINTDECLARE):
6094 (temp_output_buffer_setup, Fprin1_to_string, print_object):
6095 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6096 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 6097 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 6098 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
6099 (print_error_message): Use SAFE_ALLOCA, not alloca.
6100 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
6101 (print_depth, new_backquote_output, print_number_index):
6102 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
6103 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
6104 (Fset_process_window_size, Fformat_network_address)
6105 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 6106 (sigchld_handler):
d311d28c 6107 Check that fixnums are in proper range for system types.
d44287d4 6108 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
6109 Check for process-ids out of pid_t range rather than relying on
6110 undefined behavior.
e4d81efc 6111 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
6112 (Fformat_network_address, read_process_output, send_process)
6113 (Fprocess_send_region, status_notify):
6114 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6115 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
6116 (wait_reading_process_output, read_process_output, exec_sentinel):
6117 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6118 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
6119 (Faccept_process_output): Use duration_to_sec_usec to do proper
6120 overflow checking on durations.
dde14581
PE
6121 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
6122 Don't assume pid_t fits in int.
02481186
PE
6123 * process.h (struct Lisp_Process): Members tick and update_tick
6124 are now of type EMACS_INT, not int.
b62b53e8
PE
6125 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
6126 configured --with-wide-int.
d311d28c
PE
6127 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
6128 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
6129 * search.c (looking_at_1, string_match_1):
6130 (fast_string_match, fast_c_string_match_ignore_case)
6131 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
6132 (scan_newline, find_before_next_newline, search_command)
6133 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
6134 (set_search_regs, wordify):
6135 (Freplace_match):
6136 (Fmatch_data):
6137 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6138 (string_match_1, search_buffer, set_search_regs):
6139 (Fmatch_data):
6140 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6141 (wordify): Check for overflow in size calculation.
6142 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
6143 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
6144 Check that fixnums are in proper range for system types.
6145 * sound.c (struct sound_device)
6146 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
6147 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6148 (Fplay_sound_internal):
6149 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 6150 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
6151 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
6152 (Fparse_partial_sexp):
6153 Don't assume fixnums can fit in int.
6154 (struct lisp_parse_state, find_start_pos, find_start_value)
6155 (find_start_value_byte, find_start_begv)
6156 (update_syntax_table, char_quoted, dec_bytepos)
6157 (find_defun_start, prev_char_comend_first, back_comment):
6158 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
6159 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
6160 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6161 (Finternal_describe_syntax_value): Check that match_lisp is a
6162 character, not an integer, since the code stuffs it into int.
6163 (scan_words, scan_sexps_forward):
6164 Check that fixnums are in proper range for system types.
6165 (Fforward_word):
6166 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6167 (scan_sexps_forward):
6168 Use CHARACTERP, not INTEGERP, since the value must fit into int.
6169 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
6170 * syntax.h: Adjust decls to match defn changes elsewhere.
6171 (struct gl_state_s):
6172 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
6173 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
6174 MOST_POSITIVE_FIXNUM.
d311d28c
PE
6175 * sysdep.c (wait_for_termination_1, wait_for_termination)
6176 (interruptible_wait_for_termination, mkdir):
6177 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
6178 (emacs_read, emacs_write):
6179 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
6180 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
6181 and double all fit in int.
d311d28c
PE
6182 * term.c (set_tty_color_mode):
6183 Check that fixnums are in proper range for system types.
6184 * termhooks.h (struct input_event):
6185 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6186 * textprop.c (validate_interval_range, interval_of)
6187 (Fadd_text_properties, set_text_properties_1)
6188 (Fremove_text_properties, Fremove_list_of_text_properties)
6189 (Ftext_property_any, Ftext_property_not_all)
6190 (copy_text_properties, text_property_list, extend_property_ranges)
6191 (verify_interval_modification):
6192 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6193 (Fnext_single_char_property_change)
6194 (Fprevious_single_char_property_change):
6195 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
6196 (copy_text_properties):
6197 Check for integer overflow in index calculation.
d311d28c
PE
6198 * undo.c (last_boundary_position, record_point, record_insert)
6199 (record_delete, record_marker_adjustment, record_change)
6200 (record_property_change):
6201 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6202 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
6203 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6204 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6205 (Fx_hide_tip, Fx_file_dialog):
6206 * w32menu.c (set_frame_menubar):
6207 Use ptrdiff_t, not int, for consistency with rest of code.
6208 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
6209 (select_window, Fdelete_other_windows_internal)
6210 (window_scroll_pixel_based, window_scroll_line_based)
6211 (Frecenter, Fset_window_configuration):
6212 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6213 (Fset_window_hscroll, run_window_configuration_change_hook)
6214 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 6215 (Fscroll_other_window, Frecenter):
d311d28c
PE
6216 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6217 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
6218 Don't assume fixnum fits in int.
6219 (Fset_window_scroll_bars):
6220 Check that fixnums are in proper range for system types.
6221 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
6222 (string_pos, c_string_pos, number_of_chars, init_iterator)
6223 (in_ellipses_for_invisible_text_p, init_from_display_pos)
6224 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
6225 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
6226 (face_before_or_after_it_pos, handle_invisible_prop)
6227 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
6228 (display_prop_intangible_p, string_buffer_position_lim)
6229 (string_buffer_position, handle_composition_prop, load_overlay_strings)
6230 (get_overlay_strings_1, get_overlay_strings)
6231 (iterate_out_of_display_property, forward_to_next_line_start)
6232 (back_to_previous_visible_line_start, reseat, reseat_to_string)
6233 (get_next_display_element, set_iterator_to_next)
6234 (get_visually_first_element, compute_stop_pos_backwards)
6235 (handle_stop_backwards, next_element_from_buffer)
6236 (move_it_in_display_line_to, move_it_in_display_line)
6237 (move_it_to, move_it_vertically_backward, move_it_by_lines)
6238 (add_to_log, message_dolog, message_log_check_duplicate)
6239 (message2, message2_nolog, message3, message3_nolog
6240 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
6241 (current_message_1, truncate_echo_area, truncate_message_1)
6242 (set_message, set_message_1, store_mode_line_noprop)
6243 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
6244 (text_outside_line_unchanged_p, check_point_in_composition)
6245 (reconsider_clip_changes)
6246 (redisplay_internal, set_cursor_from_row, try_scrolling)
6247 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
6248 (redisplay_window, find_last_unchanged_at_beg_row)
6249 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
6250 (trailing_whitespace_p, find_row_edges, display_line)
6251 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
6252 (display_mode_element, store_mode_line_string)
6253 (pint2str, pint2hrstr, decode_mode_spec)
6254 (display_count_lines, display_string, draw_glyphs)
6255 (x_produce_glyphs, x_insert_glyphs)
6256 (rows_from_pos_range, mouse_face_from_buffer_pos)
6257 (fast_find_string_pos, mouse_face_from_string_pos)
6258 (note_mode_line_or_margin_highlight, note_mouse_highlight):
6259 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6260 (safe_call, init_from_display_pos, handle_fontified_prop)
6261 (handle_single_display_spec, load_overlay_strings)
6262 (with_echo_area_buffer, setup_echo_area_for_printing)
6263 (display_echo_area, echo_area_display)
6264 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
6265 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
6266 (redisplay_window, dump_glyph_row, display_mode_line)
6267 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 6268 (handle_display_spec, display_prop_string_p):
d311d28c
PE
6269 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6270 (handle_single_display_spec, build_desired_tool_bar_string)
6271 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
6272 (get_specified_cursor_type):
6273 Check that fixnums are in proper range for system types.
6274 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
6275 (Flookup_image_map):
6276 Don't assume fixnums fit in int.
6277 (compare_overlay_entries):
6278 Avoid mishandling comparisons due to subtraction overflow.
6279 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
6280 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
6281 (handle_tool_bar_click):
6282 Use int, not unsigned, since we prefer signed and the signedness
6283 doesn't matter here.
6284 (get_next_display_element, next_element_from_display_vector):
6285 Use int, not EMACS_INT, when int is wide enough.
6286 (start_hourglass): Use duration_to_sec_usec to do proper
6287 overflow checking on durations.
6288 * xfaces.c (Fbitmap_spec_p):
6289 Check that fixnums are in proper range for system types.
6290 (compare_fonts_by_sort_order):
6291 Avoid mishandling comparisons due to subtraction overflow.
6292 (Fx_family_fonts, realize_basic_faces):
6293 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6294 (Fx_family_fonts):
6295 Don't assume fixnum fits in int.
6296 Use SAFE_ALLOCA_LISP, not alloca.
6297 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
6298 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
6299 (face_at_buffer_position, face_for_overlay_string)
6300 (face_at_string_position):
6301 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6302 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
6303 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
6304 (Fx_show_tip):
6305 Check that fixnums are in proper range for system types.
6306 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6307 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
6308 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6309 (Fx_change_window_property): Don't assume fixnums fit in int.
6310 * xfont.c (xfont_chars_supported):
6311 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6312 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
6313 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
6314 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6315 * xml.c (parse_region):
6316 * xrdb.c (magic_file_p):
6317 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6318 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
6319 (x_get_local_selection, x_reply_selection_request)
6320 (x_handle_selection_request, wait_for_property_change):
6321 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6322 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
6323 short is wide enough.
6324 (x_send_client_event): Don't assume fixnum fits in int.
6325 * xterm.c (x_x_to_emacs_modifiers):
6326 Don't assume EMACS_INT overflows nicely into int.
6327 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
6328 may come from Lisp.
6329 (handle_one_xevent): NATNUMP can eval its arg twice.
6330 (x_connection_closed):
6331 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6332 * xterm.h: Adjust decls to match defn changes elsewhere.
6333 (struct scroll_bar): Use struct vectorlike_header
6334 rather than rolling our own approximation.
6335 (SCROLL_BAR_VEC_SIZE): Remove; not used.
6336
c6574eb5
GM
63372012-05-25 Glenn Morris <rgm@gnu.org>
6338
6339 * lisp.mk (lisp): Update for more files being compiled now.
6340
e8d32c7e
SM
63412012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
6342
48def666
SM
6343 * lread.c: Remove `read_pure' which makes no difference.
6344 (read_pure): Remove var.
6345 (unreadpure): Remove function.
6346 (readevalloop): Don't call read_list with -1 flag.
6347 (read1, read_vector): Don't test read_pure any more.
6348 (read_list): Simplify.
6349
e8d32c7e
SM
6350 * fileio.c, character.h: Minor style tweaks.
6351
4b2addb7
DA
63522012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
6353
6354 * window.h (clip_changed): Remove useless declaration.
6355
584461b2
JB
63562012-05-22 Juanma Barranquero <lekktu@gmail.com>
6357
6358 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
6359 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
6360
34374650
PE
63612012-05-22 Paul Eggert <eggert@cs.ucla.edu>
6362
6363 Remove src/m/*.
6364 This directory predates autoconf and is no longer needed nowadays.
6365 Move its few remaining bits of functionality to where they're needed.
6366 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
6367 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
6368 * m/template.h: Remove.
6369 * Makefile.in (M_FILE): Remove. All uses removed.
6370 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
6371 * lisp.h (USE_LSB_TAG):
6372 * mem-limits.h (EXCEEDS_LISP_PTR):
6373 Use VAL_MAX, not VALBITS, in #if.
6374 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
6375 (EMACS_UINT): Define unconditionally now.
6376 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
6377 (BITS_PER_EMACS_INT): New constants, replacing
6378 what used to be in config.h, but not useful in #if.
6379 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
6380 define them any more.
6381 (VAL_MAX): New macro.
6382 (VALMASK): Use it.
6383 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
6384 BITS_PER_EMACS_INT, in #if.
6385 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
6386 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
6387 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
6388 * s/ms-w32.h (DATA_START):
6389 Move here from removed file m/intel386.h.
6390 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
6391 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
6392
261cb4bb
PE
63932012-05-21 Paul Eggert <eggert@cs.ucla.edu>
6394
6395 Assume C89 or later.
6396 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
6397 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
6398 (xrealloc):
6399 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
6400 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
6401 * textprop.c, tparam.c (NULL): Remove.
6402 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
6403 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
6404 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
6405 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
6406 * xterm.c (input_signal_count): Assume volatile works.
6407
ff23cd9f
KB
64082012-05-21 Ken Brown <kbrown@cornell.edu>
6409
6410 * xgselect.c (xg_select): Fix first argument in call to 'select'
6411 (bug#11508).
6412
1b170bc6
KB
64132012-05-20 Ken Brown <kbrown@cornell.edu>
6414
6415 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 6416 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 6417
b2f4d39f
KB
64182012-05-19 Ken Brown <kbrown@cornell.edu>
6419
6420 * xfns.c (x_in_use): Remove `static' qualifier.
6421 * xterm.h (x_in_use): Declare.
6422 * xgselect.c: Include xterm.h.
6423 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
6424 and `display_arg' (bug#9754).
6425
003fdae2
PE
64262012-05-19 Paul Eggert <eggert@cs.ucla.edu>
6427
9232a6d9
PE
6428 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
6429
003fdae2
PE
6430 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
6431 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
6432
784b56e2
EZ
64332012-05-18 Eli Zaretskii <eliz@gnu.org>
6434
6435 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
6436
6437 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 6438 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
6439
6440 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
6441 reference to image_cache->refcount.
6442 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
6443
a0a79cde
JL
64442012-05-17 Juri Linkov <juri@jurta.org>
6445
6446 * search.c (Fword_search_regexp, Fword_search_backward)
6447 (Fword_search_forward, Fword_search_backward_lax)
6448 (Fword_search_forward_lax): Move functions to isearch.el
6449 (bug#10145, bug#11381).
6450
b0572523
PE
64512012-05-16 Paul Eggert <eggert@cs.ucla.edu>
6452
6453 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
6454
9660f5fc
SM
64552012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
6456
6457 * lread.c (init_obarray): Declare Qt and Qnil as special.
6458
4374de83
GM
64592012-05-14 Glenn Morris <rgm@gnu.org>
6460
6461 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 6462 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 6463
dc44c39a
PE
64642012-05-14 Paul Eggert <eggert@cs.ucla.edu>
6465
078c97cb
PE
6466 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
6467
dc44c39a
PE
6468 * unexaix.c: Port to more-recent AIX compilers.
6469 (report_error, report_error_1, make_hdr, copy_sym)
6470 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
6471 Make arguments const char *, not char *, to avoid violations of C
6472 standard and to fix some AIX warnings reported by Gilles Pion.
6473
e18afed7 64742012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
6475
6476 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
6477 already have overlays loaded.
6478 (handle_single_display_spec): Before returning without displaying
6479 fringe bitmap, synchronize the bidi iterator with the main display
6480 iterator, by calling iterate_out_of_display_property.
6481 (iterate_out_of_display_property): Detect buffer iteration by
6482 testing that it->string is a Lisp string.
6483 (get_next_display_element): When the current object is exhausted,
6484 and there's something on it->stack, call set_iterator_to_next to
6485 proceed with what's on the stack, instead of returning zero.
6486 (set_iterator_to_next): If called at the end of a Lisp string,
6487 proceed to consider_string_end without incrementing string
6488 position. Don't increment display vector index past the end of
6489 the display vector. (Bug#11417)
c8fb9dc6
EZ
6490 (pos_visible_p): Don't report a position visible when move_it_to
6491 stopped at the last line of window, which happens to be scanned
6492 backwards by the bidi iteration. (Bug#11464)
ac268e67 6493
e18afed7 64942012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
6495
6496 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
6497 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
6498 are on a TTY, and thus unable to display on the fringes.
6499 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
6500 so we need to signal to the caller that this is a "replacing"
6501 display spec. This fixes display when the spec is invalid or we
6502 are on a TTY.
6503
e18afed7 65042012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
6505
6506 * unexaix.c (make_hdr): Fix typo in prototype.
6507 This bug broke the build on AIX. Problem reported by Gilles Pion.
6508
9d0a235a
MA
65092012-05-14 Michael Albinus <michael.albinus@gmx.de>
6510
6511 * keyboard.c (kbd_buffer_get_event): Read special events also in
6512 batch mode. (Bug#11415)
6513
9e6b06ed
GM
65142012-05-12 Glenn Morris <rgm@gnu.org>
6515
6516 * ns.mk: Update for ns_appbindir no longer having trailing "/".
6517
c1a1d7a3
EZ
65182012-05-12 Eli Zaretskii <eliz@gnu.org>
6519
6520 * lisp.mk (lisp): Add newcomment.elc.
6521
3fe7cdc8
GM
65222012-05-12 Glenn Morris <rgm@gnu.org>
6523
6524 * Makefile.in (MKDIR_P): New, set by configure.
6525 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
6526
53f7d2c0
PE
65272012-05-11 Paul Eggert <eggert@cs.ucla.edu>
6528
6529 Remove unused function hourglass_started.
6530 * dispextern.h (hourglass_started):
6531 * w32fns.c (hourglass_started):
6532 * xdisp.c (hourglass_started): Remove.
6533
75aafb17
JB
65342012-05-10 Juanma Barranquero <lekktu@gmail.com>
6535
6536 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
6537 Update dependencies.
6538
12959e8e
PE
65392012-05-10 Paul Eggert <eggert@cs.ucla.edu>
6540
97107e2e
PE
6541 * xgselect.c (xg_select): Put maxfds+1 into a var.
6542 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
6543
12959e8e
PE
6544 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
6545
836d29b3
DA
65462012-05-10 Dave Abrahams <dave@boostpro.com>
6547
6548 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
6549 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
6550
5cb67954
MA
65512012-05-09 Michael Albinus <michael.albinus@gmx.de>
6552
6553 * dbusbind.c (xd_registered_buses): New internal Lisp object.
6554 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
6555 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
6556 Initialize xd_registered_buses.
6557
3478ec45
PE
65582012-05-09 Paul Eggert <eggert@cs.ucla.edu>
6559
b263a6b0
PE
6560 Untag more efficiently if USE_LSB_TAG.
6561 This is based on a proposal by YAMAMOTO Mitsuharu in
6562 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
6563 For an admittedly artificial (nth 8000 longlist) benchmark on
6564 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
6565 Emacs's overall text size by 1%.
6566 * lisp.h (XUNTAG): New macro.
6567 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
6568 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
6569 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
6570 * eval.c (Fautoload):
6571 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
6572 * frame.h (XFRAME): Use XUNTAG.
6573
3478ec45
PE
6574 Port recent dbusbind.c changes to 32-bit --with-wide-int.
6575 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
6576 Remove unportable assumptions about print widths of types like
6577 dbus_uint32_t.
6578 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
6579 intptr_t when converting between pointer and integer, to avoid GCC
6580 warnings about wrong width.
6581
666b903b 65822012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
6583
6584 * w32proc.c (new_child): Force Windows to reserve only 64KB of
6585 stack for each reader_thread, instead of defaulting to 8MB
6586 determined by the linker. This avoids failures in creating
6587 subprocesses on Windows 7, see the discussion in this thread:
6588 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
6589
b120cc17
JC
65902012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
6591
6592 Fix up display of the *Minibuf-0* buffer in the mini window.
6593 * keyboard.c (read_char): Don't clear the echo area if there's no
6594 message to clear.
6595 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 6596 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 6597
9a4b36f8
MA
65982012-05-07 Michael Albinus <michael.albinus@gmx.de>
6599
6600 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
6601 batch mode.
6602
e5f9458f
CY
66032012-05-06 Chong Yidong <cyd@gnu.org>
6604
6605 * lisp.mk (lisp): Update.
6606
eceeb5fc 66072012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
6608
6609 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
6610
71873e2b
SM
66112012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
6612
6613 * data.c (PUT_ERROR): New macro.
6614 (syms_of_data): Use it. Add new error type `user-error'.
6615 * undo.c (user_error): New function.
6616 (Fprimitive_undo): Use it.
6617 * print.c (print_error_message): Adjust print style for `user-error'.
6618 * keyboard.c (user_error): New function.
6619 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
6620
ab0fa4e4
PE
66212012-05-03 Paul Eggert <eggert@cs.ucla.edu>
6622
6623 Do not limit current-time-string to years 1000..9999.
6624 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
6625 (Fcurrent_time_string): Support any year that is supported by the
6626 underlying localtime representation. Don't use asctime, as it
6627 has undefined behavior for years outside the range -999..9999.
6628
7ed806a7
PE
66292012-05-02 Paul Eggert <eggert@cs.ucla.edu>
6630
6631 Fix race conditions involving setenv, gmtime, localtime, asctime.
6632 Without this fix, interrupts could mess up code that uses these
6633 nonreentrant functions, since setting TZ invalidates existing
6634 tm_zone or tzname values, and since most of these functions return
6635 pointers to static storage.
6636 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
6637 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
6638 Grow the critical sections to include not just invoking
6639 localtime/gmtime, but also accessing these functions' results
6640 including their tm_zone values if any, and any related TZ setting.
6641 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
6642 so that the struct tm is saved in the critical section.
6643 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
6644 motivated by the fact that memory allocation needs to be outside
6645 the critical section.
6646
0c16dfed
DA
66472012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
6648
6649 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
6650 with RESET_INTERVAL.
6651
6652 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
6653 Remove duplicated buffer name initialization.
6654
3f83ace8
JM
66552012-05-02 Jim Meyering <jim@meyering.net>
6656
6657 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
6658
c7b8541e
JM
6659 * xfns.c (x_window): Use xstrdup (Bug#11375).
6660
90207a15 66612012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
6662
6663 * xdisp.c (pos_visible_p): If already at a newline from the
6664 display string before the 'while' loop, don't walk back the glyphs
6665 from it3.glyph_row. Solves assertion violation when the display
6666 string begins with a newline (egg.el). (Bug#11367)
6667
b593d6a9
AH
66682012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
6669
6670 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
6671 Move to simple.el.
6672
4737362e
GM
66732012-05-01 Glenn Morris <rgm@gnu.org>
6674
99cf43f9
GM
6675 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
6676 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
6677 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
6678 All were removed before 23.1.
6679
9311dcff
GM
6680 * dispnew.c: Remove HAVE_LIBNCURSES test;
6681 it is always true on relevant platforms.
6682
4d5c6349
GM
6683 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
6684 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
6685
4737362e
GM
6686 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
6687
74dd3a6b
AS
66882012-04-30 Andreas Schwab <schwab@linux-m68k.org>
6689
6690 * .gdbinit (xpr): Remove checks for no longer existing misc types.
6691 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
6692 Remove.
6693
13c379ee
PE
66942012-04-28 Paul Eggert <eggert@cs.ucla.edu>
6695
6696 Do not avoid creating empty evaporating overlays (Bug#9642).
6697 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
6698 That is, do not delete an evaporating overlay if it becomes
6699 empty after its bounds are adjusted to fit within its buffer.
6700 This fix caused other problems, and I'm reverting it until we get
6701 to the bottom of them.
6702
a8e7d6d7 67032012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
6704
6705 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
6706
a8e7d6d7 67072012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
6708
6709 * xdisp.c (pos_visible_p): If the window start position is beyond
6710 ZV, start the display from buffer beginning. Prevents assertion
6711 violation in init_iterator when the minibuffer window is scrolled
6712 via the scroll bar.
6713
6714 * window.c (window_scroll_pixel_based): Likewise.
6715
a8e7d6d7 67162012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
6717
6718 * keymap.c (where_is_internal): Doc fix (Bug#10872).
6719
a8e7d6d7 67202012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
6721
6722 * fileio.c (Fcopy_file, Fset_file_selinux_context):
6723 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
6724
a8e7d6d7 67252012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 6726
b593d6a9
AH
6727 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
6728 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 6729
1c6900d9
EZ
67302012-04-26 Eli Zaretskii <eliz@gnu.org>
6731
4c3fa1d9
EZ
6732 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
6733 display element, check also the underlying string or buffer
6734 character. (Bug#11341)
6735
1c6900d9
EZ
6736 * w32menu.c: Include w32heap.h.
6737 (add_menu_item): If the call to AppendMenuW (via
6738 unicode_append_menu) fails, disable Unicode menus only if we are
6739 running on Windows 9X/Me.
6740
42bf8205
AS
67412012-04-24 Andreas Schwab <schwab@linux-m68k.org>
6742
6743 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
6744 (xgetint): Add missing shift for LSB tags.
6745
b1bac16e
MR
67462012-04-24 Martin Rudalics <rudalics@gmx.at>
6747
6748 * keyboard.c (read_char): Don't wipe echo area for select window
6749 events: These might get delayed via `mouse-autoselect-window'
6750 (Bug#11304).
6751
d69621cc
JB
67522012-04-24 Juanma Barranquero <lekktu@gmail.com>
6753
6754 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
6755 manipulation of :loaded-from data.
6756
02fd101b
JB
67572012-04-23 Juanma Barranquero <lekktu@gmail.com>
6758
6759 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
6760 now a cons (bug#11311).
6761
888bec30
PE
67622012-04-23 Paul Eggert <eggert@cs.ucla.edu>
6763
89a438bd
PE
6764 Do not create empty overlays with the evaporate property (Bug#9642).
6765 * buffer.c (Fmove_overlay): Delete an evaporating overlay
6766 if it becomes empty after its bounds are adjusted to fit within
6767 its buffer. Without this fix, in a nonempty buffer (let ((o
6768 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
6769 yields an empty overlay that has the evaporate property, which is
6770 not supposed to happen.
6771
1068fe4d
PE
6772 Fix minor GTK3 problems found by static checking.
6773 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6774 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6775 (struct _EmacsFixedClass, emacs_fixed_get_type):
6776 Move decls here from emacsgtkfixed.h, since they needn't be public.
6777 (emacs_fixed_get_type): Now static.
6778 (emacs_fixed_class_init): Omit unused local.
6779 (emacs_fixed_child_type): Remove; unused.
6780 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6781 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6782 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
6783 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
6784 (EMACS_FIXED_GET_CLASS): Remove; unused.
6785 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
6786
888bec30
PE
6787 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
6788 Problem reported by Juanma Barranquero for Windows -Wunused-function.
6789
de85e130
PE
67902012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6791
d0baac98 6792 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 6793 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
6794 (__malloc_size_t, __malloc_ptrdiff_t):
6795 Remove. All uses removed, replaced by the definiens if needed,
6796 since we can assume C89 or better now.
6797 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
6798 (protect_malloc_state, align, get_contiguous_space)
6799 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
6800 (malloc_atfork_handler_child, malloc_enable_thread)
6801 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
6802 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
6803 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
6804 (special_realloc, _realloc_internal_nolock, _realloc_internal)
6805 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
6806 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
6807 Define using prototypes, not old style.
6808 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
6809 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
6810 (align): Don't assume that signed integer overflow wraps around.
6811 Omit unused local var.
6812 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
6813 (_free_internal_nolock, memalign, mallochook, reallochook):
6814 Omit no-longer-needed casts.
6815 (valloc): Use getpagesize, not __getpagesize.
6816 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
6817 (struct hdr): The 'magic' member is now size_t, not unsigned long.
6818
de85e130
PE
6819 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
6820
dcbf5805
MA
68212012-04-22 Michael Albinus <michael.albinus@gmx.de>
6822
6823 Move functions from C to Lisp. Make non-blocking method calls
6824 the default. Implement further D-Bus standard interfaces.
6825
6826 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
6827 (QCdbus_request_name_allow_replacement)
6828 (QCdbus_request_name_replace_existing)
6829 (QCdbus_request_name_do_not_queue)
6830 (QCdbus_request_name_reply_primary_owner)
6831 (QCdbus_request_name_reply_in_queue)
6832 (QCdbus_request_name_reply_exists)
6833 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
6834 (QCdbus_registered_serial, QCdbus_registered_method)
6835 (QCdbus_registered_signal): New Lisp objects.
6836 (XD_DEBUG_MESSAGE): Use sizeof.
6837 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
6838 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
6839 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
6840 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
6841 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
6842 (xd_signature, xd_append_arg): Allow float for integer types.
6843 (xd_get_connection_references): New function.
b593d6a9
AH
6844 (xd_get_connection_address): Rename from xd_initialize.
6845 Return cached address.
dcbf5805
MA
6846 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
6847 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
6848 level.
6849 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 6850 Return number of refcounts.
dcbf5805
MA
6851 (Fdbus_get_unique_name): Make stronger parameter check.
6852 (Fdbus_message_internal): New defun.
6853 (Fdbus_call_method, Fdbus_call_method_asynchronously)
6854 (Fdbus_method_return_internal, Fdbus_method_error_internal)
6855 (Fdbus_send_signal, Fdbus_register_service)
6856 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
6857 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
6858 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
6859 (Vdbus_compiled_version, Vdbus_runtime_version)
6860 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
6861 (Vdbus_message_type_method_return, Vdbus_message_type_error)
6862 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
6863 (Vdbus_registered_buses, Vdbus_registered_objects_table):
6864 Adapt docstring.
dcbf5805 6865
52828e02
PE
68662012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6867
da05bc4c
PE
6868 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
6869 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
6870 Do not assume ptrdiff_t is the same width as 'int'.
6871
52828e02
PE
6872 * alloc.c: Handle unusual debugging option combinations.
6873 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
6874 since the two debugging options are incompatible.
6875 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
6876 is defined.
6877 (mem_init, mem_insert, mem_insert_fixup):
6878 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
6879 (NEED_MEM_INSERT): Remove; no longer needed.
6880
f01769f9
LL
68812012-04-22 Leo Liu <sdl.web@gmail.com>
6882
6883 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
6884
5790543d
PE
68852012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6886
6887 * sysdep.c [__FreeBSD__]: Minor cleanups.
6888 (list_system_processes, system_process_attributes) [__FreeBSD__]:
6889 Use Emacs indenting style more consistently. Avoid some casts.
6890 Use 'double' consistently rather than mixing 'float' and 'double'.
6891
b91b7e4d
EW
68922012-04-21 Eduard Wiebe <usenet@pusto.de>
6893
b593d6a9
AH
6894 * sysdep.c (list_system_processes, system_process_attributes):
6895 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 6896
6114eb15
AS
68972012-04-21 Andreas Schwab <schwab@linux-m68k.org>
6898
6899 * lisp.mk (lisp): Update.
6900
2f38dff7
PE
69012012-04-20 Paul Eggert <eggert@cs.ucla.edu>
6902
6903 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
6904 It is never used otherwise.
6905
4ae29f89
SM
69062012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
6907
6908 * print.c (print_preprocess): Only check print_depth if print-circle
6909 is nil.
6910 (print_object): Check for cycles even when print-circle is nil and
6911 print-gensym is t, but only check print_depth if print-circle is nil.
6912
f30d612a
CY
69132012-04-20 Chong Yidong <cyd@gnu.org>
6914
6915 * process.c (wait_reading_process_output): If EIO occurs on a pty,
6916 set the status to "failed" and ensure that sentinel is run.
6917
c07a4c0b 69182012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
6919
6920 * process.c (Fset_process_inherit_coding_system_flag)
6921 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 6922 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 6923
c07a4c0b 69242012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
6925
6926 * xdisp.c (string_buffer_position_lim): Limit starting position to
6927 BEGV.
6928 (set_cursor_from_row): If called for a mode-line or header-line
6929 row, return zero immediately.
6930 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
6931 farther than the first row after the header line, if any.
6932 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
6933 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
6934
c07a4c0b 69352012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 6936
4ae29f89
SM
6937 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
6938 (bug#11238).
ad3a2b41 6939
c07a4c0b 69402012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 69412012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
6942
6943 configure: new option --enable-gcc-warnings (Bug#11207)
6944 * Makefile.in (C_WARNINGS_SWITCH): Remove.
6945 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
6946 (ALL_CFLAGS): Use new macros rather than old.
6947 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
6948 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
6949 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
6950 -Wunused-result, -Wunused-variable. This should go away once
6951 the Emacs and Gnulib regex code is merged.
6952 (xmalloc, xrealloc): Now static.
6953
aba027e8
PE
69542012-04-17 Paul Eggert <eggert@cs.ucla.edu>
6955
6956 * dired.c (Fsystem_groups): Remove unused local.
6957
e5a36063
GM
69582012-04-17 Glenn Morris <rgm@gnu.org>
6959
6960 * dired.c (Fsystem_users): Doc fix.
6961
316411f0
DA
69622012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
6963
6964 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
6965 (syms_of_dired): Add them.
6966
9426aba4
PE
69672012-04-16 Paul Eggert <eggert@cs.ucla.edu>
6968
b62a57be
PE
6969 Fix minor alloc.c problems found by static checking.
6970 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
6971 New extern decls, to avoid calling undeclared functions.
6972 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
6973 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
6974 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
6975 (NEED_MEM_INSERT): New macro.
6976 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 6977 Remove one incorrect comment and fix another.
b62a57be 6978
3539f31f
PE
6979 Fix minor ralloc.c problems found by static checking.
6980 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6981 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
6982 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
6983 (r_alloc_sbrk): Now static.
6984
a041960a
PE
6985 Improve ralloc.c interface checking.
6986 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6987 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
6988 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
6989 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
6990 [REL_ALLOC]: ... to here, to check interface.
6991 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
6992 Remove decls. This fixes an "It stinks!".
6993
9426aba4
PE
6994 * alloc.c (which_symbols): Fix alignment issue / type clash.
6995
d55c12ed
AS
69962012-04-15 Andreas Schwab <schwab@linux-m68k.org>
6997
6998 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
6999 (struct Lisp_Misc_Any): Likewise.
7000 (struct Lisp_Free): Likewise.
7001 * alloc.c (union aligned_Lisp_Symbol): Define.
7002 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
7003 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
7004 (union aligned_Lisp_Misc): Define.
7005 (MARKER_BLOCK_SIZE, struct marker_block): Use union
7006 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 7007 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 7008
b948ce8b
PE
70092012-04-14 Paul Eggert <eggert@cs.ucla.edu>
7010
7011 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
7012 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
7013 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
7014 * s/netbsd.h, s/sol2-6.h:
7015 Remove definition of GC_MARK_STACK, since the default now works.
7016 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
7017 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
7018 no longer the default.
7019 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
7020
35dc09a1 70212012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 7022
35dc09a1
GM
7023 * lread.c (lisp_file_lexically_bound_p):
7024 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 7025
35dc09a1
GM
70262012-04-14 Eli Zaretskii <eliz@gnu.org>
7027
7028 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
7029 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
7030
70312012-04-14 Jan Djärv <jan.h.d@swipnet.se>
7032
7033 * nsterm.m (constrainFrameRect): Always constrain when there is only
7034 one screen (Bug#10962).
7035
bcd86815
KB
70362012-04-13 Ken Brown <kbrown@cornell.edu>
7037
7038 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
7039
c25df26e
RT
70402012-04-13 Reuben Thomas <rrt@sc3d.org>
7041
7042 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
7043
0fc59f1e
DC
70442012-04-11 Daniel Colascione <dancol@dancol.org>
7045
7046 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
7047 against is gone. It's better to use vfork now so that when Cygwin
7048 gains a new, working vfork, we use it automatically (bug#10398).
7049
de8c03dc
SM
70502012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7051
7052 * window.c (save_window_save): Obey window-point-insertion-type.
7053
2f097256
GM
70542012-04-11 Glenn Morris <rgm@gnu.org>
7055
7056 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
7057
453b951e
SM
70582012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7059
7060 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
7061
75f1671a 70622012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
7063
7064 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
7065 (force_quit_count): New var.
7066 (handle_interrupt): Use it.
7067
2a8ce227
JB
70682012-04-10 Juanma Barranquero <lekktu@gmail.com>
7069
7070 * w32.c (w32_delayed_load): Record the full path of the library
7071 being loaded (bug#10424).
7072
935396c0
GM
70732012-04-09 Glenn Morris <rgm@gnu.org>
7074
05920a43
GM
7075 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
7076 not just in the obarray, before snarfing them. (Bug#11036)
7077
935396c0
GM
7078 * Makefile.in ($(leimdir)/leim-list.el):
7079 Pass EMACS rather than BUILT_EMACS.
7080
a18ecafa
TZ
70812012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
7082
7083 * process.c (make_process):
7084 * process.h: Add integer `gnutls_handshakes_tried' member to
7085 process struct.
7086
6bbef4e5
JC
7087 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
7088 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
7089
7090 * gnutls.c (gnutls_log_function2i): Convenience log function.
7091 (emacs_gnutls_read): Use new log functions,
7092 `gnutls_handshakes_tried' process member, and
7093 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
7094 attempts per process (connection).
7095
b4d3bc10
CY
70962012-04-09 Chong Yidong <cyd@gnu.org>
7097
7098 * eval.c (Fuser_variable_p, user_variable_p_eh)
7099 (lisp_indirect_variable): Functions deleted.
7100 (Fdefvar): Caller changed.
7101
7102 * callint.c (Finteractive, Fcall_interactively):
7103 * minibuf.c (Fread_variable): Callers changed.
7104
70f4d973
EZ
71052012-04-09 Eli Zaretskii <eliz@gnu.org>
7106
7107 * xdisp.c (set_cursor_from_row): If the display string appears in
7108 the buffer at position that is closer to point than the position
7109 after the display string, display the cursor on the first glyph of
7110 the display string. Fixes cursor display when a 'display' text
7111 property immediately follows invisible text. (Bug#11094)
7112
cb3c2e3e
PE
71132012-04-09 Paul Eggert <eggert@cs.ucla.edu>
7114
7115 composite.c: use 'double' consistently
7116 * composite.c (get_composition_id): Use 'double' consistently
7117 instead of converting 'float' to 'double' and vice versa; this is
7118 easier to understand and avoids a GCC warning.
7119
fd06db5d
GM
71202012-04-09 Glenn Morris <rgm@gnu.org>
7121
50fe702a
GM
7122 * Makefile.in: Generate leim-list with bootstrap-emacs, in
7123 preparation for dumping it with emacs. (Bug#4789)
7124 (leimdir): New variable.
7125 ($(leimdir)/leim-list.el): New rule.
7126 (emacs$(EXEEXT)): Depend on leim-list.el.
7127
fd06db5d
GM
7128 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
7129 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
7130 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
7131
55c131ee
AS
71322012-04-08 Andreas Schwab <schwab@linux-m68k.org>
7133
7134 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
7135 proper alignment.
7136
9209588f
JB
71372012-04-07 Juanma Barranquero <lekktu@gmail.com>
7138
7139 * xml.c (init_libxml2_functions) [WINDOWSNT]:
7140 Remove unused local variable.
7141
e3fb2efb
PE
71422012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7143
7144 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
7145 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
7146 (mark_memory): Mark Lisp_Objects only if pointers might hide in
7147 objects, as mark_maybe_pointer will catch them otherwise.
7148 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
7149 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
7150
b5385551
PE
71512012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7152
7153 Fix typo that broke non-Windows builds.
7154 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
7155
9078ead6
EZ
71562012-04-07 Eli Zaretskii <eliz@gnu.org>
7157
7158 Support building on MS-Windows with libxml2.
7159
7160 * makefile.w32-in (OBJ2): Add xml.$(O).
7161 (GLOBAL_SOURCES): Add xml.c.
7162 ($(BLD)/xml.$(O)): New dependency list.
7163
7164 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
7165 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
7166 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
7167 [!WINDOWSNT]: New macros.
7168 (init_libxml2_functions, libxml2_loaded_p): New functions.
7169 (parse_region): Call fn_xmlCheckVersion instead of using the macro
7170 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
7171 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
7172 Calls xmlCleanupParser only if libxml2 was loaded (or statically
7173 linked in).
6bbef4e5
JC
7174 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
7175 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
7176 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
7177
7178 * emacs.c: Don't include libxml/parser.h.
7179 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
7180 xmlCleanupParser directly.
7181
7182 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
7183
3811fdf3
EZ
71842012-04-07 Eli Zaretskii <eliz@gnu.org>
7185
7186 * indent.c (Fvertical_motion): If there is a display string at
7187 point, use it.vpos to compute how many lines to backtrack after
7188 move_it_to point. (Bug#11133)
7189
2f8e16b2
EZ
71902012-04-06 Eli Zaretskii <eliz@gnu.org>
7191
7192 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
7193 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
7194 about subtle differences between FETCH_CHAR* and STRING_CHAR*
7195 macros related to unification of CJK characters. For the details,
7196 see the discussion following the message here:
7197 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
7198
3d439cd1
CY
71992012-04-04 Chong Yidong <cyd@gnu.org>
7200
7201 * keyboard.c (Vdelayed_warnings_list): Doc fix.
7202
8bc53d00
EZ
72032012-04-01 Eli Zaretskii <eliz@gnu.org>
7204
7205 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
7206 instead of alloca. (Bug#11138)
7207
3b0512a3
AS
72082012-04-01 Andreas Schwab <schwab@linux-m68k.org>
7209
7210 * w32menu.c (is_simple_dialog): Properly check lisp types.
7211 (Bug#11141)
7212
8427ddd2
EZ
72132012-03-31 Eli Zaretskii <eliz@gnu.org>
7214
979022ef
EZ
7215 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
7216 position we get to after a call to move_it_to fails the
7217 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
7218 only if we wind up in a string from display property. (Bug#11063)
7219
a6b1c7cc
EZ
7220 * window.c (Fdelete_other_windows_internal): Invalidate the row
7221 and column information about mouse highlight, so that redisplay
7222 restores it after reallocating the glyph matrices. (Bug#7464)
7223
8427ddd2
EZ
7224 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
7225 string comes from a `display' text property, use the buffer
7226 position of that property as if we actually saw that position in
7227 the row's glyphs.
697ba24b
EZ
7228 (move_it_by_lines): Remove the assertion that
7229 "it->current_x == 0 && it->hpos == 0" which can be legitimately
7230 violated when there's a before-string at the beginning of a line.
7231 (Bug#11063)
8427ddd2 7232
65a0a738
EZ
72332012-03-30 Eli Zaretskii <eliz@gnu.org>
7234
7235 * xdisp.c (append_space_for_newline): If the default face was
7236 remapped, use the remapped face for the appended newline.
7237 (extend_face_to_end_of_line): Use the remapped default face for
7238 extending the face to the end of the line.
7239 (display_line): Call extend_face_to_end_of_line when the default
7240 face was remapped. (Bug#11068)
7241
581355cc
EZ
72422012-03-29 Eli Zaretskii <eliz@gnu.org>
7243
7244 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
7245
e8fc049f
SM
72462012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
7247
7248 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
7249
4fb9a543
GM
72502012-03-27 Glenn Morris <rgm@gnu.org>
7251
7252 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
7253 Doc fixes.
7254
679910f1
KH
72552012-03-26 Kenichi Handa <handa@m17n.org>
7256
7257 * dispextern.h (struct glyph): Fix previous change. Change the
7258 bit length of glyphless.ch to 25 (Bug#11082).
7259
90d49b7f
CY
72602012-03-26 Chong Yidong <cyd@gnu.org>
7261
7262 * keyboard.c (Vselection_inhibit_update_commands): New variable.
7263 (command_loop_1): Use it; inhibit selection update for
7264 handle-select-window too (Bug#8996).
7265
f514f6f0
FP
72662012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
7267
e8fc049f 7268 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 7269
bf43fa51
KH
72702012-03-25 Kenichi Handa <handa@m17n.org>
7271
7272 * dispextern.h (struct glyph): Change the bit length of
7273 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
7274
8a0c01dd
EZ
72752012-03-24 Eli Zaretskii <eliz@gnu.org>
7276
7277 * s/ms-w32.h (tzname): Include time.h before redirecting to
7278 _tzname. Fixes the MSVC build. (Bug#9960)
7279
7d1c3a76
AS
72802012-03-24 Andreas Schwab <schwab@linux-m68k.org>
7281
8ed79523
AS
7282 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
7283 characters.
7284
7d1c3a76
AS
7285 * xterm.c (XTread_socket): Only modify handling_signal if
7286 !SYNC_INPUT. (Bug#11080)
7287
e99a9b8b
EZ
72882012-03-23 Eli Zaretskii <eliz@gnu.org>
7289
7290 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
7291 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
7292 when fetching a multibyte character consumes more bytes than
7293 CHAR_BYTES returns, due to unification of CJK characters in
7294 string_char. (Bug#11073)
7295
5063c0e1
TN
72962012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
7297
7298 * process.c (wait_reading_process_output): Handle pty disconnect
7299 by refraining from sending oneself a SIGCHLD (bug#10933).
7300
9f851fbd
CY
73012012-03-22 Chong Yidong <cyd@gnu.org>
7302
7303 * dispextern.h (struct it): New member string_from_prefix_prop_p.
7304
5063c0e1 7305 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
7306 Mark string as coming from a prefix property.
7307 (handle_face_prop): Use default face for prefix strings (Bug#4281).
7308 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
7309
fb5b8aca
CY
73102012-03-21 Chong Yidong <cyd@gnu.org>
7311
7312 * xfaces.c (Vface_remapping_alist): Doc fix.
7313
62356a1b
EZ
73142012-03-20 Eli Zaretskii <eliz@gnu.org>
7315
7316 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
7317 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
7318 Doc fixes.
62356a1b 7319
025de85b
CY
73202012-03-20 Chong Yidong <cyd@gnu.org>
7321
7322 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
7323 to reflect default non-nil value of redisplay-dont-pause.
7324
4827f94e
KH
73252012-03-19 Kenichi Handa <handa@m17n.org>
7326
7327 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
7328 it fit in a valid range (Bug#11003).
7329
e50a24a2
EZ
73302012-03-18 Eli Zaretskii <eliz@gnu.org>
7331
7332 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
7333 that is not from display property, accept the row as a "cursor
7334 row" if one of the string's character has a non-nil `cursor'
7335 property. Fixes cursor positioning when there are newlines in
7336 overlay strings, e.g. in icomplete.el. (Bug#11035)
7337
9af5ed87
PE
73382012-03-12 Paul Eggert <eggert@cs.ucla.edu>
7339
7340 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
7341
d1f55f16
CY
73422012-03-12 Chong Yidong <cyd@gnu.org>
7343
7344 * eval.c (inhibit_lisp_code): Rename from
7345 inhibit_window_configuration_change_hook; move from window.c.
7346
7347 * xfns.c (unwind_create_frame_1, Fx_create_frame):
7348 * window.c (run_window_configuration_change_hook)
7349 (syms_of_window): Callers changed.
7350
66c5eebd
CY
73512012-03-11 Chong Yidong <cyd@gnu.org>
7352
413df973
CY
7353 * keymap.c (Fkey_description): Doc fix (Bug#9700).
7354
66c5eebd
CY
7355 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
7356
1de11f56
CY
73572012-03-10 Chong Yidong <cyd@gnu.org>
7358
7359 * frame.c (other_visible_frames): Don't assume the selected frame
7360 is visible (Bug#10955).
7361
cae07000
SM
73622012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
7363
7364 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
7365
89c94350
JD
73662012-03-08 Jan Djärv <jan.h.d@swipnet.se>
7367
7368 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
7369 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
7370 zero (Bug#10954).
7371
999dd333
GM
73722012-03-03 Glenn Morris <rgm@gnu.org>
7373
01a6dcc8 7374 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 7375
de0100f2
EZ
73762012-03-02 Eli Zaretskii <eliz@gnu.org>
7377
7378 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
7379 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
7380 (redisplay_window, next_element_from_string): Fix typos in
7381 comments.
3e441275
EZ
7382 (redisplay_window): Pass to move_it_vertically the margin in
7383 pixels, not in screen lines.
de0100f2 7384
96a72ee9
GM
73852012-03-02 Glenn Morris <rgm@gnu.org>
7386
7387 * buffer.c (buffer-list-update-hook): Doc fix.
7388
312508d7
EZ
73892012-02-29 Eli Zaretskii <eliz@gnu.org>
7390
7391 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
7392 push_it before setting up the iterator for the first overlay
7393 string, even if we have an empty string loaded.
7394 (next_overlay_string): If there's an empty string on the iterator
7395 stack, pop the stack. (Bug#10903)
7396
27f3c637
PE
73972012-02-25 Paul Eggert <eggert@cs.ucla.edu>
7398
7399 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
7400 Suggested by Stefan Monnier in
7401 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
7402 * alloc.c (widen_to_Lisp_Object): New static function.
7403 (mark_memory): Also mark Lisp_Objects by fetching pointer words
7404 and widening them to Lisp_Objects. This would work even if
7405 USE_LSB_TAG is defined and wide integers are used, which might
7406 happen in a future version of Emacs.
7407
3c9dfce6
CY
74082012-02-25 Chong Yidong <cyd@gnu.org>
7409
fa74b241
CY
7410 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
7411 Doc fix.
7412
3c9dfce6
CY
7413 * xselect.c (Fx_selection_exists_p): Doc fix.
7414 (x_clipboard_manager_save_all): Print an informative message
7415 before saving to clipboard manager.
7416
9486df08
CY
74172012-02-24 Chong Yidong <cyd@gnu.org>
7418
7419 * keyboard.c (process_special_events): Handle all X selection
7420 requests in kbd_buffer, not just the next one (Bug#8869).
7421
f01d3321
CY
74222012-02-23 Chong Yidong <cyd@gnu.org>
7423
7424 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
7425 call when setting menu-bar-lines and tool-bar-lines parameters.
7426 (unwind_create_frame_1): New helper function.
7427
7428 * window.c (inhibit_window_configuration_change_hook): New var.
7429 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 7430 (syms_of_window): Initialize it.
f01d3321 7431
86b847b6
CY
74322012-02-22 Chong Yidong <cyd@gnu.org>
7433
7434 * xterm.c (x_draw_image_relief): Add missing type check for
7435 Vtool_bar_button_margin (Bug#10743).
7436
a59225b1
CY
74372012-02-21 Chong Yidong <cyd@gnu.org>
7438
7439 * fileio.c (Vfile_name_handler_alist): Doc fix.
7440
7441 * buffer.c (Fget_file_buffer): Protect against invalid file
7442 handler return value.
7443
310f5bd4
PE
74442012-02-20 Paul Eggert <eggert@cs.ucla.edu>
7445
cb3a28cc
PE
7446 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
7447 when computing $valmask.
7448
310f5bd4
PE
7449 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
7450 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
7451 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
7452 It's useless in that case, and it can cause problems on hosts
7453 that allocate halves of EMACS_INT values separately.
7454 Reported by Dan Horák. Diagnosed by Andreas Schwab in
7455 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
7456 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
7457 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
7458 it avoids undefined behavior on hosts where shifting right by more
7459 than the word width has undefined behavior.
7460
2375c96a
CY
74612012-02-19 Chong Yidong <cyd@gnu.org>
7462
7463 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
7464 (Funhandled_file_name_directory, Ffile_name_as_directory)
7465 (Fdirectory_file_name, Fexpand_file_name)
7466 (Fsubstitute_in_file_name): Protect against invalid file handler
7467 return values (Bug#10845).
7468
3eb49e71
EZ
74692012-02-18 Eli Zaretskii <eliz@gnu.org>
7470
7471 * .gdbinit (pitx): Fix incorrect references to fields of the
7472 iterator stack.
7473
7b926f3f
CY
74742012-02-17 Chong Yidong <cyd@gnu.org>
7475
7476 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
7477
11273115
PE
74782012-02-15 Paul Eggert <eggert@cs.ucla.edu>
7479
7480 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
7481 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
7482
c3a70e2b
CY
74832012-02-15 Chong Yidong <cyd@gnu.org>
7484
7485 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
7486 marked as special. Also, starting docstrings with * is obsolete.
7487
0ca43699
AS
74882012-02-13 Andreas Schwab <schwab@linux-m68k.org>
7489
7490 * gnutls.c (emacs_gnutls_write): Fix last change.
7491
2e8f3c56
LI
74922012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
7493
7494 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
7495 send_process.
7496
af70074f
SM
74972012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
7498
7499 * keymap.c (Fsingle_key_description): Handle char ranges.
7500
95986d52
CY
75012012-02-12 Chong Yidong <cyd@gnu.org>
7502
afd83bd1
CY
7503 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
7504 as that creates a dangerous corner case.
7505
95986d52
CY
7506 * window.c (Fdelete_window_internal): Invalidate the mouse
7507 highlight (Bug#9904).
7508
bd7da63e
GM
75092012-02-12 Glenn Morris <rgm@gnu.org>
7510
7511 * xselect.c (Fx_own_selection_internal)
7512 (Fx_get_selection_internal, Fx_disown_selection_internal)
7513 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
7514 * nsselect.m (Fx_own_selection_internal)
7515 (Fx_disown_selection_internal, Fx_selection_exists_p)
7516 (Fx_selection_owner_p, Fx_get_selection_internal):
7517 Sync docs and argument specs with the xselect.c versions.
7518
77abcbc2
LI
75192012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
7520
7521 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
7522
90b671e2
EZ
75232012-02-11 Eli Zaretskii <eliz@gnu.org>
7524
1c0ca0b7
EZ
7525 * w32select.c (Fx_selection_exists_p): Sync doc string and
7526 argument list with xselect.c. (Bug#10783)
7527
7528 * w16select.c (Fx_selection_exists_p): Sync doc string and
7529 argument list with xselect.c. (Bug#10783)
90b671e2 7530
49241268
GM
75312012-02-10 Glenn Morris <rgm@gnu.org>
7532
7533 * fns.c (Fsecure_hash): Doc fix.
7534
f998bbe7 75352012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
7536
7537 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
7538
0992bd9c
CY
75392012-02-07 Chong Yidong <cyd@gnu.org>
7540
7541 * buffer.c (Fbuffer_local_variables)
7542 (buffer_lisp_local_variables): Handle unbound vars correctly;
7543 don't let Qunbound leak into Lisp.
7544
af008560
GM
75452012-02-07 Glenn Morris <rgm@gnu.org>
7546
dd605cc4
GM
7547 * image.c (Fimagemagick_types): Doc fix.
7548
af008560
GM
7549 * image.c (imagemagick-render-type): Change it from a lisp object
7550 to an integer. Move the doc here from the lisp manual.
7551 Treat all values not equal to 0 the same.
7552
1449fa1d
CY
75532012-02-06 Chong Yidong <cyd@gnu.org>
7554
7555 * doc.c (store_function_docstring): Avoid applying docstring of
7556 alias to base function (Bug#2603).
7557
3723ec07
AS
75582012-02-04 Andreas Schwab <schwab@linux-m68k.org>
7559
7560 * .gdbinit (pp1, pv1): Remove redundant defines.
7561 (pr): Use pp.
7562
79c1cc1e
CY
75632012-02-04 Chong Yidong <cyd@gnu.org>
7564
7565 * nsterm.m: Declare a global (Bug#10694).
7566
d7f29f8e
EZ
75672012-02-04 Eli Zaretskii <eliz@gnu.org>
7568
cae07000
SM
7569 * w32.c (get_emacs_configuration_options):
7570 Include --enable-checking, if specified, in the return value.
d7f29f8e 7571
3b95a6f9
MR
75722012-02-04 Martin Rudalics <rudalics@gmx.at>
7573
7574 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
7575 after rounding frame sizes. (Bug#9723)
7576
d6fa96a6
EZ
75772012-02-04 Eli Zaretskii <eliz@gnu.org>
7578
7579 * keyboard.c (adjust_point_for_property): Don't position point
7580 before BEGV. (Bug#10696)
7581
df0b2940
PE
75822012-02-03 Paul Eggert <eggert@cs.ucla.edu>
7583
7584 Handle overflow when computing char display width (Bug#9496).
7585 * character.c (char_width): Return EMACS_INT, not int.
7586 (char_width, c_string_width): Check for overflow when
7587 computing the width; this is possible now that individual
7588 characters can have unbounded width. Problem introduced
7589 by merge from Emacs 23 on 2012-01-19.
7590
6bee44d6
MA
75912012-02-02 Michael Albinus <michael.albinus@gmx.de>
7592
7593 * dbusbind.c (Fdbus_register_method): Mention the return value
7594 :ignore in the docstring.
7595
44f92739
GM
75962012-02-02 Glenn Morris <rgm@gnu.org>
7597
1b9f60cc
GM
7598 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
7599
44f92739
GM
7600 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7601 Unconditionally set to t. (Bug#10673)
7602 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7603 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
7604 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
7605
c5d3843c
KH
76062012-02-02 Kenichi Handa <handa@m17n.org>
7607
7608 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
7609 0, do not call append_composite_glyph.
7610
159462d4 76112012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
7612
7613 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
7614 NULL (Bug#6988).
7615 (x_produce_glyphs): If the component of a composition is a null
7616 string, set it->pixel_width to 1 to avoid zero-width glyph.
7617
78cef877
EZ
76182012-02-01 Eli Zaretskii <eliz@gnu.org>
7619
7620 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
7621 first 2 arguments are identical. This makes inserting large
7622 output from a subprocess an order of magnitude faster on
7623 MS-Windows, where all sbrk'ed memory is always contiguous.
7624
97897668
GM
76252012-01-31 Glenn Morris <rgm@gnu.org>
7626
7627 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 7628 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
7629 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
7630
31fd3586
GM
76312012-01-29 Glenn Morris <rgm@gnu.org>
7632
7633 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
7634
0e24a8b2
CY
76352012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
7636
7637 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
7638
cc0adcb0
CY
76392012-01-28 Chong Yidong <cyd@gnu.org>
7640
7641 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
7642
acc28cb9
CY
76432012-01-26 Chong Yidong <cyd@gnu.org>
7644
9c69cfb7
CY
7645 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
7646
acc28cb9
CY
7647 * search.c (Fsearch_forward, Fsearch_backward): Document negative
7648 repeat counts (Bug#10507).
7649
48da7392
GM
76502012-01-26 Glenn Morris <rgm@gnu.org>
7651
7652 * lread.c (syms_of_lread): Doc fix.
7653
14af5f7f
CY
76542012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
7655
7656 * coding.c (encode_designation_at_bol): Change return value to
7657 EMACS_INT.
7658
0b21c100
CY
76592012-01-25 Chong Yidong <cyd@gnu.org>
7660
7661 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
7662
3c2907f7
CY
76632012-01-21 Chong Yidong <cyd@gnu.org>
7664
7665 * floatfns.c (Fcopysign): Make the second argument non-optional,
7666 since nil is not allowed anyway.
7667
959ad23f
AS
76682012-01-21 Andreas Schwab <schwab@linux-m68k.org>
7669
7670 * process.c (read_process_output): Use p instead of XPROCESS (proc).
7671 (send_process): Likewise.
7672
34a02f46
MR
76732012-01-19 Martin Rudalics <rudalics@gmx.at>
7674
7675 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
7676 (Vwindow_persistent_parameters): Do not use Qstate.
7677 Rewrite doc-strings.
34a02f46 7678
1259009a 76792012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
7680
7681 * character.c (char_width): New function.
70d4fdf6
GM
7682 (Fchar_width, c_string_width, lisp_string_width):
7683 Use char_width (Bug#9496).
25ed9e61 7684
6a6ee00d
MR
76852012-01-16 Martin Rudalics <rudalics@gmx.at>
7686
7687 * window.c (Vwindow_persistent_parameters): New variable.
7688 (Fset_window_configuration, save_window_save): Handle persistent
7689 window parameters.
7690
c85efaf7
EZ
76912012-01-14 Eli Zaretskii <eliz@gnu.org>
7692
7693 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
7694 thrashing the stack of the thread. (Bug#9087)
7695
5944709e
PE
76962012-01-12 Paul Eggert <eggert@cs.ucla.edu>
7697
7698 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
7699
e71f5d99
EZ
77002012-01-11 Eli Zaretskii <eliz@gnu.org>
7701
7702 * xdisp.c (rows_from_pos_range): Handle the case where the
7703 highlight ends on a newline. (Bug#10464)
7704 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
7705 he end column for display of highlight that ends on a newline
7706 before a R2L line.
7707
ce316182
GM
77082012-01-11 Glenn Morris <rgm@gnu.org>
7709
7710 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
7711 from load-path also when installation-directory is nil. (Bug#10208)
7712
5b43da69
GM
77132012-01-10 Glenn Morris <rgm@gnu.org>
7714
74cc8ff9
GM
7715 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
7716
7d8d6e4e
GM
7717 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
7718 Update template values to be closer to their typical values these days.
5b43da69 7719
a0db8d43
EZ
77202012-01-09 Eli Zaretskii <eliz@gnu.org>
7721
7722 * xdisp.c (rows_from_pos_range): Accept additional argument
7723 DISP_STRING, and accept any glyph in a row whose object is that
7724 string as eligible for mouse highlight. Fixes mouse highlight of
7725 display strings from overlays. (Bug#10464)
7726
9a0115ab 77272012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 7728
b9110d6a 7729 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
7730 * fileio.c (auto_saving_dir_umask): New static var.
7731 (Fmake_directory_internal): Use it.
7732 (do_auto_save_make_dir): Set it, instead of invoking chmod after
7733 creating the directory. The old code temporarily assigns
7734 too-generous permissions to the directory.
7735 (do_auto_save_eh): Clear it.
b9110d6a 7736 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
7737 that the var is always cleared.
7738
6c1bd3f3
EZ
77392012-01-07 Eli Zaretskii <eliz@gnu.org>
7740
7741 * search.c (scan_buffer): Pass character positions to
7742 know_region_cache, not byte positions. (Bug#6540)
7743
069d2b50
L
77442012-01-07 LynX <_LynX@bk.ru> (tiny change)
7745
7746 * w32.c (sys_rename): Report EXDEV when rename of a directory
7747 fails because the target is on another logical disk. (Bug#10284)
7748
75bf0d33
DB
77492012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
7750
7751 * xterm.c (x_embed_request_focus): New function.
7752
7753 * xterm.h: Add prototype.
7754
7755 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
7756
1c6e5a32
GM
77572012-01-05 Glenn Morris <rgm@gnu.org>
7758
7759 * emacs.c (emacs_copyright): Update short copyright year to 2012.
7760
651e947e
EZ
77612012-01-01 Eli Zaretskii <eliz@gnu.org>
7762
7763 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
7764 Load gnutls_transport_set_lowat only if GnuTLS version is below
7765 2.11.1.
7766 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
7767 GnuTLS versions below 2.11.1.
7768
3778cdd8
AL
77692011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
7770
7771 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
7772 to the doc string advising against its use for altering the way
7773 windows are scrolled.
7774
0e5317f7
KH
77752011-12-28 Kenichi Handa <handa@m17n.org>
7776
7777 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
7778 coding-system ASCII compatible only when it does not produce BOM
7779 on encoding (Bug#10383).
7780
93d5ca1f
JD
77812011-12-26 Jan Djärv <jan.h.d@swipnet.se>
7782
7783 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
7784 can scroll.
7785 (create_and_show_popup_menu): Always use menu_position_func for
7786 Gtk3 (Bug#10361).
7787
ca22b785
AS
77882011-12-24 Andreas Schwab <schwab@linux-m68k.org>
7789
7790 * callint.c (Fcall_interactively): Don't truncate prompt string.
7791
d048e1e6
EZ
77922011-12-23 Eli Zaretskii <eliz@gnu.org>
7793
7794 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
7795 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 7796 resumed from there (after widening). (Bug#10360)
d048e1e6 7797
5ccaba1f
JD
77982011-12-22 Jan Djärv <jan.h.d@swipnet.se>
7799
7800 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
7801
204ee57f
JD
78022011-12-21 Jan Djärv <jan.h.d@swipnet.se>
7803
b81d40f0
JB
7804 * nsterm.m (x_free_frame_resources):
7805 Release f->output_data.ns->miniimage.
204ee57f
JD
7806 (ns_index_color): Fix indentation. Do not retain
7807 color_table->colors[i].
7808
7809 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
7810 before returning.
7811
7812 * nsfns.m (x_set_background_color): Assign return value from
7813 ns_index_color to face-background instead of NSColor*.
7814 (ns_implicitly_set_icon_type): Fix indentation.
7815 Change assignment in for loop to comparison.
7816
7817 * emacs.c (ns_pool): New variable.
7818 (main): Assign ns_pool.
7819 (Fkill_emacs): Call ns_release_autorelease_pool.
7820
7821 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
7822 autorelease fdesc, release fdAttrs and tdict.
7823 (ns_get_covering_families): Release charset.
7824 (ns_findfonts): Release NSFontDescriptor created with new.
7825 (ns_uni_to_glyphs): Fix indentation.
7826 (setString): Release attrStr before assigning new value.
7827
c803b2b7
JD
78282011-12-18 Jan Djärv <jan.h.d@swipnet.se>
7829
678f4426
JD
7830 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
7831 and NS_IMPL_COCOA.
7832 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
7833 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
7834
cd394be1 78352011-12-18 David Reitter <reitter@cmu.edu>
678f4426 7836
5fecd5fc
JD
7837 * nsterm.m (ns_term_init): Subscribe for notifications
7838 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
7839 to method trackingNotification in EmacsMenu.
7840
7841 * nsmenu.m (trackingMenu): New variable.
3771cb17 7842 (trackingNotification): New method (from Aquamacs).
5fecd5fc 7843 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 7844 from Aquamacs (Bug#7030).
678f4426
JD
7845
78462011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 7847
c803b2b7
JD
7848 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
7849 (symbol_to_nsstring): Fix indentation.
7850 (ns_symbol_to_pb): New function.
cae07000
SM
7851 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
7852 (Fns_rotate_cut_buffers_internal): Remove.
7853 (Fns_store_selection_internal): Rename from
c803b2b7
JD
7854 Fns_store_cut_buffer_internal.
7855 (ns_get_foreign_selection, Fx_own_selection_internal)
7856 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
7857 (Fns_get_selection_internal, Fns_store_selection_internal):
7858 Use ns_symbol_to_pb and check if return value is nil.
7859 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
7860 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
7861 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
7862 renamed to Sns_store_selection_internal.
7863 (ns_handle_selection_request): Move code to Fx_own_selection_internal
7864 and remove this function.
7865 (ns_handle_selection_clear): Remove, never used.
7866 (Fx_own_selection_internal): Move code from ns_handle_selection_request
7867 here.
7868
e1b01a3a
KB
78692011-12-17 Ken Brown <kbrown@cornell.edu>
7870
7871 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
7872 GID is unknown (Bug#10257).
7873
2adb6e85
PE
78742011-12-17 Paul Eggert <eggert@cs.ucla.edu>
7875
7876 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
7877 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
7878 which caused a build failure on GNU/Linux IA-64. This problem was
7879 introduced by my 2011-10-07 patch.
7880
d1d7b339
JL
78812011-12-15 Juri Linkov <juri@jurta.org>
7882
7883 * image.c (imagemagick_error): New function. (Bug#10112)
7884 (imagemagick_load_image): Comment out `MagickSetResolution' call.
7885 Use `imagemagick_error' where ImageMagick functions return
7886 `MagickFalse'.
7887 (Fimagemagick_types): Add `Fnreverse' to return the list in the
7888 proper order.
7889
100d5755
KH
78902011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7891
7892 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
7893 fill background (Bug#8992).
7894
454592a6
MR
78952011-12-13 Martin Rudalics <rudalics@gmx.at>
7896
7897 * window.c (Vwindow_combination_resize)
7898 (Vwindow_combination_limit): Use t instead of non-nil in
7899 doc-strings.
61d4b438
MR
7900 (Vrecenter_redisplay): Add first sentence of doc-string on
7901 separate line.
53524d93 7902 (Frecenter): Fix doc-string typo.
454592a6 7903
3633e3aa
KH
79042011-12-11 Kenichi Handa <handa@m17n.org>
7905
7906 * coding.c (Funencodable_char_position): Pay attention to the
7907 buffer text relocation (Bug#9389).
7908
7b9d523a 79092011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 7910
7b9d523a
JD
7911 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
7912 gtk_init (Bug#10100).
7913
b73189c6
EZ
79142011-12-10 Eli Zaretskii <eliz@gnu.org>
7915
7916 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
7917 IT->string is nil. (Bug#10263)
7918
f7dfe5d6
JD
79192011-12-10 Jan Djärv <jan.h.d@swipnet.se>
7920
83faebb4
JD
7921 * nsterm.h (x_free_frame_resources): Declare.
7922
f7dfe5d6
JD
7923 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
7924 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
7925
7926 * nsterm.h (ns_get_defaults_value): Declare.
7927
7928 * nsterm.m (ns_default): Call ns_get_defaults_value.
7929
7cd4e72c
EZ
79302011-12-09 Eli Zaretskii <eliz@gnu.org>
7931
7932 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
7933 (Bug#10170)
7934
b34d7317
YM
79352011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7936
7937 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
7938 that where the value of an _OBJC_* symbol points to is in the .bss
7939 section (Bug#10240).
7940
76470ad1
KH
79412011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
7942
7943 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 7944 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 7945
745fff94
KH
79462011-12-08 Kenichi Handa <handa@m17n.org>
7947
7948 * ftfont.c (get_adstyle_property): Fix previous change
7949 (Bug#10233).
7950
6e44397c
JB
79512011-12-07 Juanma Barranquero <lekktu@gmail.com>
7952
7953 * w32.c (init_environment): If no_site_lisp, remove site-lisp
7954 dirs from the default value of EMACSLOADPATH (bug#10208).
7955
7efa6272
GM
79562011-12-07 Glenn Morris <rgm@gnu.org>
7957
7958 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
7959 installation and source directories as well. (Bug#10208)
7960
f6fc4d87
CY
79612011-12-06 Chong Yidong <cyd@gnu.org>
7962
7963 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
7964
2bf26180
GM
79652011-12-06 Glenn Morris <rgm@gnu.org>
7966
7967 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
7968 as an error, not just -1. (Bug#10217)
7969
3a6ad4f0
CY
79702011-12-05 Chong Yidong <cyd@gnu.org>
7971
7972 * keyboard.c (process_special_events): New function.
7973 (swallow_events, Finput_pending_p): Use it (Bug#10195).
7974
75a3b399
PE
79752011-12-05 Paul Eggert <eggert@cs.ucla.edu>
7976
7977 * coding.c (encode_designation_at_bol): Don't use uninitialized
7978 local variable (Bug#9318).
7979
c3c9e25e
KH
79802011-12-05 Kenichi Handa <handa@m17n.org>
7981
7982 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
7983 return Qnil (Bug#8046, Bug#10193).
7984
5eb05ea3
KH
79852011-12-05 Kenichi Handa <handa@m17n.org>
7986
7987 * coding.c (encode_designation_at_bol): New args charbuf_end and
7988 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
7989 (coding_set_source): Return how many bytes coding->source was
7990 relocated.
7991 (coding_set_destination): Return how many bytes
7992 coding->destination was relocated.
7993 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 7994 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
7995
79962011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
7997
7998 * coding.c (CODING_CHAR_CHARSET_P): New macro.
7999 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
8000 macro (Bug#9318).
8001
80022011-12-05 Andreas Schwab <schwab@linux-m68k.org>
8003
8004 The following changes are to fix Bug#9318.
8005
a79703f5 8006 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
8007 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
8008 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 8009 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 8010
7dbda6df
JB
80112011-12-05 Juanma Barranquero <lekktu@gmail.com>
8012
8013 * lisp.h (process_quit_flag): Fix external declaration.
8014
6d5eb5b0
SM
80152011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
8016
8017 Don't macro-inline non-performance-critical code.
8018 * eval.c (process_quit_flag): New function.
8019 * lisp.h (QUIT): Use it.
8020
a0c3fad0
JD
80212011-12-04 Jan Djärv <jan.h.d@swipnet.se>
8022
8023 * nsfns.m (get_geometry_from_preferences): New function.
8024 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
8025
6c07aac2
AS
80262011-12-04 Andreas Schwab <schwab@linux-m68k.org>
8027
8028 * emacs.c (Qkill_emacs): Define.
8029 (syms_of_emacs): Initialize it.
8030 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
8031 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
8032 (quit_throw_to_read_char): Add parameter `from_signal'.
8033 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
8034 * lisp.h (QUIT): Call Fkill_emacs if requested.
8035
c052ead4
JD
80362011-12-03 Jan Djärv <jan.h.d@swipnet.se>
8037
8038 * widget.c (update_wm_hints): Return if wmshell is null.
8039 (widget_update_wm_size_hints): New function.
8040
8041 * widget.h (widget_update_wm_size_hints): Declare.
8042
8043 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
8044 widget_update_wm_size_hints (Bug#10104).
8045
9e49252b
EZ
80462011-12-03 Eli Zaretskii <eliz@gnu.org>
8047
8048 * xdisp.c (handle_invisible_prop): If the invisible text ends just
8049 before a newline, prepare the bidi iterator for consuming the
8050 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 8051 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 8052
02b16839
JL
80532011-12-02 Juri Linkov <juri@jurta.org>
8054
8055 * search.c (Fword_search_regexp): New Lisp function created from
8056 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
8057 (Fword_search_backward, Fword_search_forward)
8058 (Fword_search_backward_lax, Fword_search_forward_lax):
8059 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
8060 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
8061
0068070e
SM
80622011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
8063
8064 * fileio.c (Finsert_file_contents): Move after-change-function call
8065 to before the "handled:" label, since all "goto handled" appear in
8066 cases where the *-change-functions have already been properly called
8067 (bug#10117).
8068
3360a3fc
AS
80692011-12-01 Andreas Schwab <schwab@linux-m68k.org>
8070
8071 * keyboard.c (interrupt_signal): Don't call kill-emacs when
8072 waiting for input. (Bug#10169)
8073
73d6c093
EZ
80742011-11-30 Eli Zaretskii <eliz@gnu.org>
8075
8076 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
8077 verifies glyph row's hash code--we have just reallocated the
8078 glyphs, so their contents can be complete garbage. (Bug#10164)
8079
febe6bea
JB
80802011-11-30 Juanma Barranquero <lekktu@gmail.com>
8081
8082 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
8083
801a4313
EZ
80842011-11-30 Eli Zaretskii <eliz@gnu.org>
8085
8086 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
8087 attributes are tested _before_ calling verify_row_hash, to protect
8088 against GCC re-ordering of the tests. (Bug#10164)
8089
2b56b87e
JD
80902011-11-29 Jan Djärv <jan.h.d@swipnet.se>
8091
8092 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
8093
8094 * xterm.c (handle_one_xevent): Only set async_visible and friends
8095 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 8096 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
8097 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
8098
dbf31225
PE
80992011-11-28 Paul Eggert <eggert@cs.ucla.edu>
8100
8101 Remove GCPRO-related macros that exist only to avoid shadowing locals.
8102 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
8103 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
8104 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8105 All uses changed to use GCPRO1 etc.
8106 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
8107 Revert to old implementation (i.e., before 2011-03-11).
8108
1305621b
YM
81092011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8110
8111 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
8112 of scroll runs so as to avoid assigning disabled bogus rows and
8113 unnecessary graphics copy operations.
8114
8c9afb46
EZ
81152011-11-27 Eli Zaretskii <eliz@gnu.org>
8116
8117 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
8118 (snprintf) [_MSC_VER]: Redirect to _snprintf.
8119 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
8120 (malloc, free, realloc, calloc): Redirect to e_* only when
8121 compiling Emacs.
8122
8123 * lisp.h (GCTYPEBITS): Move before first use.
8124 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
8125 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
8126 this macro definition.
8127
8128 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
8129 _MSC_VER.
8130
54e9e3bf
JD
81312011-11-27 Jan Djärv <jan.h.d@swipnet.se>
8132
6d5eb5b0
SM
8133 * gtkutil.c (xg_create_frame_widgets):
8134 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
8135 present with Gtk+ 2.0.
8136
83aca1cb
PE
81372011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8138
8139 * fileio.c (Finsert_file_contents): Undo previous change; see
8140 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8141
5b76caa4
PE
81422011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8143
8144 Rename locals to avoid shadowing.
8145 * fileio.c (Finsert_file_contents):
8146 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
8147 * process.c (wait_reading_process_output):
8148 Rename inner 'proc' to 'p' to avoid shadowing.
8149 Indent for consistency with usual Emacs style.
8150
8c535114
EZ
81512011-11-25 Eli Zaretskii <eliz@gnu.org>
8152
8153 * xdisp.c (redisplay_window): If cursor row is not fully visible
8154 after recentering, and scroll-conservatively is set to a large
8155 number, scroll window by a few more lines to make the cursor fully
8156 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
8157 (start_display): Don't move to the next line if the display should
8158 start at a newline that is part of a display vector or an overlay
8159 string. (Bug#10119)
8c535114 8160
fa4fdb5c
JL
81612011-11-24 Juri Linkov <juri@jurta.org>
8162
8163 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
8164 after the `MagickPingImage' call. (Bug#10112)
8165
90ec88df
CY
81662011-11-23 Chong Yidong <cyd@gnu.org>
8167
8168 * window.c (Fcoordinates_in_window_p): Accept only live windows.
8169
56e2e794
MR
81702011-11-23 Martin Rudalics <rudalics@gmx.at>
8171
8172 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
8173 making another buffer current. (Bug#10114)
8174
b6e64c41
GM
81752011-11-23 Glenn Morris <rgm@gnu.org>
8176
8177 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
8178
6b21de18
CY
81792011-11-23 Chong Yidong <cyd@gnu.org>
8180
8181 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
8182 using it (Bug#5984).
8183
b12cd789
EZ
81842011-11-22 Eli Zaretskii <eliz@gnu.org>
8185
8186 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
8187 and header-lines, as they don't have one computed for them.
8188 (Bug#10098)
8189
8190 * .gdbinit (prow): Make displayed values more self-explaining.
8191 Add row's hash code.
8192
261b6fd4
LMI
81932011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
8194
8195 * process.c (wait_reading_process_output): Fix asynchrounous
8196 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 8197 (wait_reading_process_output): Add comment and URL.
261b6fd4 8198
e7cfd277
JD
81992011-11-21 Jan Djärv <jan.h.d@swipnet.se>
8200
8201 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
8202
a9b9b7f5
CY
82032011-11-21 Chong Yidong <cyd@gnu.org>
8204
8205 * window.c (Fnext_window, Fprevious_window): Doc fix.
8206
b0d15b4f
SM
82072011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8208
8209 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
8210
fe7a3057
JB
82112011-11-20 Juanma Barranquero <lekktu@gmail.com>
8212
8213 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
8214
d2999b1a
MR
82152011-11-20 Martin Rudalics <rudalics@gmx.at>
8216
8217 * window.c (Fset_window_combination_limit): Rename argument
8218 STATUS to LIMIT.
8219 (Vwindow_combination_limit): Remove "status" from doc-string.
8220
d5ff9cd0
AS
82212011-11-20 Andreas Schwab <schwab@linux-m68k.org>
8222
8223 * m/ibms390.h: Remove.
8224 * m/ibms390x.h: Don't include "ibms390.h".
8225
a5bb9bd3
SM
82262011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8227
8228 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
8229 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
8230
cd1181db
JB
82312011-11-20 Juanma Barranquero <lekktu@gmail.com>
8232
8233 * casetab.c (Fset_case_table):
8234 * charset.c (Fcharset_after): Fix typos.
8235
615a3b8d 82362011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 8237
17e845af
PE
8238 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
8239 Otherwise, valgrind does not work on some platforms.
8240 Problem reported by Andreas Schwab in
6a0bf43d
PE
8241 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
8242 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
8243 is set, removing the need for VIRT_ADDRESS_VARIES.
8244 (PURE_P): Use a more-efficient implementation that needs just one
8245 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
8246 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
8247 to 4 (xorl, subq, cmpq, setbe).
8248 * alloc.c (pure): Always extern now, since that's the
8249 VIRT_ADDR_VARIES behavior.
8250 (PURE_POINTER_P): Use a single comparison, not two, for
8251 consistency with the new puresize.h.
8252 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
8253 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
8254 Remove VIRT_ADDR_VARIES no longer needed.
8255
f8fe6f96
EZ
82562011-11-19 Eli Zaretskii <eliz@gnu.org>
8257
8258 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
8259 (erase_phys_cursor, update_window_cursor, show_mouse_face)
8260 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
8261 behave as if the cursor position were at the window margin.
8262
8263 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
8264 and the cursor position is out of bounds, behave as if the cursor
8265 position were at the window margin. (Bug#10075)
8266
df05a53c
CY
82672011-11-18 Chong Yidong <cyd@gnu.org>
8268
8269 * window.c (Fwindow_combination_limit): Make first argument
8270 non-optional, since it is meaningless for live windows like the
8271 selected window.
61ccba97 8272
2071918e
DA
82732011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
8274
8275 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
8276
b50a28de
SM
82772011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
8278
8279 * intervals.c: Fix grafting over the whole buffer (bug#10071).
8280 (graft_intervals_into_buffer): Simplify.
8281
015137db
EZ
82822011-11-18 Eli Zaretskii <eliz@gnu.org>
8283
8284 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
8285 hash values of the two rows.
8286 (copy_row_except_pointers): Preserve the used[] arrays and the
8287 hash values of the two rows. (Bug#10035)
68c95424 8288 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
8289
8290 * xdisp.c (row_hash): New function, body extracted from
8291 compute_line_metrics.
8292 (compute_line_metrics): Call row_hash, instead of computing the
8293 hash code inline.
8294
8295 * dispnew.c (verify_row_hash): Call row_hash for computing the
8296 hash code of a row, instead of duplicating code from xdisp.c.
8297
8298 * dispextern.h (row_hash): Add prototype.
8299
a2addb04
TH
83002011-11-18 Tassilo Horn <tassilo@member.fsf.org>
8301
8302 * frame.c (delete_frame): Don't delete the terminal when the last
8303 X frame is closed if emacs is built with GTK toolkit.
8304
df85d315
JB
83052011-11-17 Juanma Barranquero <lekktu@gmail.com>
8306
8307 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
8308
a0c2d0ae
MR
83092011-11-17 Martin Rudalics <rudalics@gmx.at>
8310
8311 * window.c (Vwindow_splits): Rename to
8312 Vwindow_combination_resize. Suggested by Juri Linkov.
8313 (Fsplit_window_internal): Use Vwindow_combination_resize instead
8314 of Vwindow_splits.
8315
58179cce
JB
83162011-11-16 Juanma Barranquero <lekktu@gmail.com>
8317
7877f373
JB
8318 * nsfns.m (Fns_font_name):
8319 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 8320
b6f67890
MR
83212011-11-16 Martin Rudalics <rudalics@gmx.at>
8322
8323 * window.h (window): Rename slot "nest" to "combination_limit".
8324 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
8325 (Fset_window_nest): Rename to Fset_window_combination_limit.
8326 (Vwindow_nest): Rename to Vwindow_combination_limit.
8327 (recombine_windows, make_parent_window, make_window)
8328 (Fsplit_window_internal, saved_window)
8329 (Fset_window_configuration, save_window_save): Rename all
8330 occurrences of window_nest to window_combination_limit.
8331
c7015153
JB
83322011-11-15 Juanma Barranquero <lekktu@gmail.com>
8333
8334 * image.c (imagemagick_load_image): Fix typo.
8335
322ad6ec
EZ
83362011-11-14 Eli Zaretskii <eliz@gnu.org>
8337
8338 * xdisp.c (display_line): Move the call to
8339 highlight_trailing_whitespace before the call to
8340 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
8341 faces of all the glyphs to compute ROW's hash value.
8342 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 8343
f067b8ec
JB
83442011-11-14 Juanma Barranquero <lekktu@gmail.com>
8345
8346 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
8347 just return (bug#10044).
8348
1e5b2111
EZ
83492011-11-12 Eli Zaretskii <eliz@gnu.org>
8350
7ef3cbd5
EZ
8351 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
8352 with user-defined heap size. Bump the default size of the temacs
8353 heap to 27MB, to avoid memory warning when running temacs.
8354 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
8355
1e5b2111
EZ
8356 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
8357 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
8358 (verify_row_hash) [XASSERTS]: New function.
8359 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
8360 that the hash value of glyph rows is correct.
1e5b2111 8361
89d61221
MR
83622011-11-12 Martin Rudalics <rudalics@gmx.at>
8363
8364 * window.h (window): Remove splits slot.
8365 * window.c (Fwindow_splits, Fset_window_splits): Remove.
8366 (Fdelete_other_windows_internal, make_parent_window)
8367 (make_window, Fsplit_window_internal, Fdelete_window_internal)
8368 (Fset_window_configuration, save_window_save): Don't deal with
8369 split status of windows.
8370 (saved_window): Remove splits slot.
8371 (Vwindow_splits): Rewrite doc-string.
8372
97f18cc8
JD
83732011-11-11 Jan Djärv <jan.h.d@swipnet.se>
8374
8375 * xfns.c (unwind_create_frame):
8376 * nsfns.m (unwind_create_frame):
8377 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
8378 Vframe_list (Bug#9999).
8379
22a648b4
DA
83802011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
8381
0b381c7e 8382 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 8383
659afede
KH
83842011-11-11 Kenichi Handa <handa@m17n.org>
8385
8386 * callproc.c (Fcall_process): Set the member dst_multibyte of
8387 process_coding.
8388
9ac0394b
KH
83892011-11-11 Johan Bockgård <bojohan@gnu.org>
8390
8391 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
8392 avoid a crash (bug#9496).
8393
2fbdc249
CY
83942011-11-09 Chong Yidong <cyd@gnu.org>
8395
8396 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8397 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
8398
ac6b1f81
PE
83992011-11-08 Paul Eggert <eggert@cs.ucla.edu>
8400
8401 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
8402
09db192c
PE
84032011-11-08 Paul Eggert <eggert@cs.ucla.edu>
8404
8405 Avoid some portability problems by eschewing 'extern inline' functions.
8406 The trivial performance wins aren't worth the portability hassles; see
8407 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
8408 et seq.
8409 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
8410 (window_box_width, window_box_left, window_box_left_offset)
8411 (window_box_right, window_box_right_offset): Undo previous change,
8412 by removing the "extern"s.
8413 * intervals.c (adjust_intervals_for_insertion)
8414 (adjust_intervals_for_deletion): Undo previous change,
8415 making these static again.
8416 (offset_intervals, temp_set_point_both, temp_set_point)
8417 (copy_intervals_to_string): No longer inline.
8418 * xdisp.c (window_text_bottom_y, window_box_width)
8419 (window_box_height, window_box_left_offset)
8420 (window_box_right_offset, window_box_left, window_box_right)
8421 (window_box): No longer inline.
8422
105216ed
CY
84232011-11-08 Chong Yidong <cyd@gnu.org>
8424
8425 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
8426 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
8427 Signal an error if not a live window.
105216ed
CY
8428 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
8429 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
8430
ae9e237f
JB
84312011-11-07 Juanma Barranquero <lekktu@gmail.com>
8432
8433 * lisp.h (syms_of_abbrev): Remove declaration.
8434 Reported by CHENG Gao <chenggao@royau.me>.
8435
c7aa8333
EZ
84362011-11-07 Eli Zaretskii <eliz@gnu.org>
8437
8438 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
8439 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
8440 of temacs in GUI mode.
8441
be7f5545
MR
84422011-11-07 Martin Rudalics <rudalics@gmx.at>
8443
8444 * window.h: Declare delete_all_child_windows instead of
8445 delete_all_subwindows.
8446 * window.c (Fwindow_nest, Fset_window_nest)
8447 (Fset_window_new_total, Fset_window_new_normal)
8448 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
8449 (delete_all_subwindows): Rename to delete_all_child_windows.
8450 (Fdelete_other_windows_internal, Fset_window_configuration):
8451 Call delete_all_child_windows instead of delete_all_subwindows.
8452 * frame.c (delete_frame): Call delete_all_child_windows instead
8453 of delete_all_subwindows.
8454
ca78dc43
PE
84552011-11-07 Paul Eggert <eggert@cs.ucla.edu>
8456
8457 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
8458 This is also needed for porting to any host where GC_MARK_STACK is
8459 not GC_MAKE_GCPROS_NOOPS.
8460 (which_symbols): Use it.
8461
a0241d01
KH
84622011-11-07 Kenichi Handa <handa@m17n.org>
8463
8464 * coding.c (coding_set_destination): Check coding->src_pos only
8465 when coding->src_object is a buffer (bug#9910).
8466
8467 * process.c (send_process): Set the member src_multibyte of coding
8468 to 0 (bug#9911) when sending a unibyte text.
8469
8470 * callproc.c (Fcall_process): Set the member src_multibyte of
8471 process_coding to 0 (bug#9912).
8472
a64bfdfa 84732011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
8474
8475 * xmenu.c (cleanup_widget_value_tree): New function.
8476 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
8477 calling free_menubar_widget_value_tree directly (Bug#9830).
8478
cb41b32a
PE
84792011-11-06 Paul Eggert <eggert@cs.ucla.edu>
8480
8481 Fix some portability problems with 'inline'.
8482 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
8483 (window_box_width, window_box_left, window_box_left_offset)
8484 (window_box_right, window_box_right_offset): Declare extern.
8485 Otherwise, these inline functions do not conform to C99 and
8486 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
8487 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
8488 * intervals.c (adjust_intervals_for_insertion)
8489 (adjust_intervals_for_deletion): Now extern, because otherwise the
8490 extern inline functions 'offset_intervals' couldn't refer to it.
8491 (static_offset_intervals): Remove.
8492 (offset_intervals): Rewrite using the old contents of
8493 static_offset_intervals. The old version didn't conform to C99
8494 because an extern inline function contained a reference to an
8495 identifier with static linkage.
8496
b7041366
AS
84972011-11-06 Andreas Schwab <schwab@linux-m68k.org>
8498
8499 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
8500 GC.
8501
88a37c4d
EZ
85022011-11-06 Eli Zaretskii <eliz@gnu.org>
8503
8504 * xdisp.c (init_iterator, reseat_to_string): Don't set the
8505 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
8506 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
8507 return Qleft_to_right.
8508
49745b39
CY
85092011-11-06 Chong Yidong <cyd@gnu.org>
8510
8511 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
8512 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
8513 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
8514 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
8515 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
8516 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
8517 (Fwindow_vscroll): Doc fix.
8518 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
8519 argument, since it makes no sense to pass a live window and for
8520 consistency with window-child.
8521
1f05cd82
CS
85222011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
8523
8524 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
8525 support MSVC.
8526
22610910
JR
85272011-11-05 Jason Rumney <jasonr@gnu.org>
8528
8529 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
8530 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
8531 fonts (Bug#6029).
8532 (add_font_entity_to_list): Fix logic errors in mixed boolean and
8533 bitwise arithmetic preventing use of unicode-sip and non-truetype
8534 opentype fonts.
8535
a06776b2
EZ
85362011-11-05 Eli Zaretskii <eliz@gnu.org>
8537
3ad924ba
EZ
8538 * s/ms-w32.h (fstat, stat, utime): Move redirections to
8539 "emacs"-only part.
8540
a06776b2
EZ
8541 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
8542 initialization code to keep similarity to xfns.c after changes
8543 from 2011-11-05.
8544
c9e7db78
JD
85452011-11-05 Jan Djärv <jan.h.d@swipnet.se>
8546
a97f8f3f
JD
8547 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
8548 (unwind_create_frame): New function (Bug#9943).
8549 (Fx_create_frame): Restructure code to be more similar to the one in
8550 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
8551 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
8552 Move terminal->reference_count++ just before making the frame official
8553 (Bug#9943).
8554
8555 * nsterm.m (x_free_frame_resources): New function.
8556 (x_destroy_window): Move code to x_free_frame_resources.
8557
c9e7db78 8558 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
8559 (Fx_create_frame, x_create_tip_frame):
8560 Move terminal->reference_count++ just before making the frame
75f1671a 8561 official. Move initialization of image_cache_refcount and
c9e7db78
JD
8562 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
8563
a6fc3b5c
EZ
85642011-11-05 Eli Zaretskii <eliz@gnu.org>
8565
8566 Support MSVC build with newer versions of Visual Studio.
8567 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
8568 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
8569 nt/gmake.defs.
8570
8571 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
8572 which are not supported by MSVC.
8573 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
8574 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
8575 bitfields.
8576 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
8577 types in bitfields.
8578 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
8579
8580 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
8581
58179cce 85822011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
8583
8584 Support MSVC build with newer versions of Visual Studio.
8585 * w32.c: Don't include w32api.h for MSVC.
8586 (init_environment) [_MSC_VER]: Call sys_access, not _access.
8587
8588 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
8589 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
8590 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
8591 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
8592 e_* cousins.
8593 (alloca) [_MSC_VER]: Define to _alloca.
8594
8595 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
8596
8597 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
8598
a58c13ed
EZ
85992011-11-04 Eli Zaretskii <eliz@gnu.org>
8600
8601 * xdisp.c (note_mouse_highlight): If either of
8602 previous/next-single-property-change returns nil, treat that as
8603 the beginning or the end of the buffer. (Bug#9955)
8604
fe0b6370
JD
86052011-11-04 Jan Djärv <jan.h.d@swipnet.se>
8606
a58c13ed 8607 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
8608 label is not null (Bug#9951).
8609 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
8610 may be NULL.
8611
89bd5ee1
EZ
86122011-11-04 Eli Zaretskii <eliz@gnu.org>
8613
8614 * window.c (Fwindow_body_size): Mention in the doc string that the
8615 return value is in frame's canonical units. (Bug#9949)
8616
84c3edb9
EZ
86172011-11-03 Eli Zaretskii <eliz@gnu.org>
8618
4e2fb5c7
EZ
8619 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
8620
84c3edb9 8621 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 8622 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 8623 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 8624
bc17a887
EZ
86252011-11-01 Eli Zaretskii <eliz@gnu.org>
8626
8627 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
8628 Don't stop backward scan on the continuation glyph, even though
8629 its CHARPOS is positive.
6d5eb5b0
SM
8630 (mouse_face_from_buffer_pos, note_mouse_highlight):
8631 Rename cover_string to disp_string.
bc17a887 8632
4ee88440
MR
86332011-11-01 Martin Rudalics <rudalics@gmx.at>
8634
8635 * window.c (temp_output_buffer_show): Don't use
8636 Vtemp_buffer_show_specifiers.
8637 (Vtemp_buffer_show_specifiers): Remove unused variable.
8638
c2ff3c02
EZ
86392011-10-30 Eli Zaretskii <eliz@gnu.org>
8640
8641 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
8642 past the beginning of the current glyph matrix.
8643
58179cce 86442011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
8645
8646 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
8647 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
8648 HAVE_GTK3 (Bug#9869).
b77a6a7f 8649
3b574623
JD
8650 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
8651 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
8652
b77a6a7f
JD
8653 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
8654
8655 * xterm.c: Declare x_handle_net_wm_state to return int.
8656 (handle_one_xevent): Check if we are iconified but don't have
8657 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
8658 (get_current_wm_state): Return non-zero if not hidden,
8659 check for _NET_WM_STATE_HIDDEN (Bug#9893).
8660 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
8661 (x_handle_net_wm_state): Return what get_current_wm_state returns.
8662 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
8663
196e41e4
PE
86642011-10-29 Paul Eggert <eggert@cs.ucla.edu>
8665
8666 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
8667 so that this new function doesn't get optimized away by a
8668 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
8669
021f2e1a
AS
86702011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8671
8672 * frame.h (MOUSE_HL_INFO): Remove excess parens.
8673
8b058d44
EZ
86742011-10-29 Eli Zaretskii <eliz@gnu.org>
8675
8676 Fix the `xbytecode' command.
8677 * .gdbinit (xprintbytestr): New command.
b50a28de 8678 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
8679 (xbytecode): Print the byte-code string as well.
8680
4452fb80
EZ
86812011-10-29 Kim Storm <storm@cua.dk>
8682
8b058d44
EZ
8683 * alloc.c (which_symbols): New function.
8684
21b72067
AS
86852011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8686
8687 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
8688 line. (Bug#9903)
8689
83ed7b5c
GM
86902011-10-29 Glenn Morris <rgm@gnu.org>
8691
8692 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
8693 Not clear what it was for, and it causes various bugs. (Bug#9839)
8694
5a7a728b
EZ
86952011-10-28 Eli Zaretskii <eliz@gnu.org>
8696
8697 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
8698 possible random value that matches one of those tested as
8699 condition to clear the mouse face.
8700
d3d0842f
CY
87012011-10-28 Chong Yidong <cyd@gnu.org>
8702
8703 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
8704
31b39d13
DN
87052011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
8706
8707 * window.c (make_window): Initialize phys_cursor_on_p.
8708
9aba6043
SM
87092011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
8710
8711 * lisp.h (struct Lisp_Symbol): Update comments.
8712
c20992f4
JB
87132011-10-28 Juanma Barranquero <lekktu@gmail.com>
8714
8715 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
8716
db4f02f2
EZ
87172011-10-28 Eli Zaretskii <eliz@gnu.org>
8718
8719 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
8720 <oslsachem@gmail.com> for helping to debug this.
8721
8722 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
8723 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
8724 (g_b_init_get_glyph_outline_w): New static variables.
8725 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
8726 (GetGlyphOutlineW_Proc): New typedefs.
8727 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
8728 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
8729 New functions.
8730 (w32font_open_internal, compute_metrics):
8731 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
8732 instead of calling the "wide" APIs directly.
8733
8734 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
8735
8736 * w32.h (syms_of_w32font): Add prototype.
8737
87e68db4
JB
87382011-10-27 Juanma Barranquero <lekktu@gmail.com>
8739
8740 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
8741 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
8742 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
8743 (Fmove_to_window_line): Doc fix.
8744
435c1d67
CY
87452011-10-27 Chong Yidong <cyd@gnu.org>
8746
8747 * process.c (make_process): Set gnutls_state to NULL.
8748
8749 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
8750 non-NULL, regardless of GNUTLS_INITSTAGE.
8751 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
8752 an error. Set process slots as soon as we allocate them.
8753
8754 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
8755
9c6c6f49
CY
87562011-10-27 Chong Yidong <cyd@gnu.org>
8757
9aba6043
SM
8758 * gnutls.c (emacs_gnutls_deinit): New function.
8759 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
8760 (Fgnutls_deinit, Fgnutls_boot): Use it.
8761
8762 * process.c (make_process): Initialize GnuTLS credentials to NULL.
8763 (deactivate_process): Call emacs_gnutls_deinit.
8764
657d08d3
JB
87652011-10-27 Juanma Barranquero <lekktu@gmail.com>
8766
8767 * image.c (x_create_x_image_and_pixmap):
8768 * w32.c (sys_rename, w32_delayed_load):
8769 * w32font.c (fill_in_logfont):
8770 * w32reg.c (x_get_string_resource): Silence compiler warnings.
8771
5430d399
JB
87722011-10-26 Juanma Barranquero <lekktu@gmail.com>
8773
8774 * w32fns.c (w32_default_color_map): New function,
8775 extracted from Fw32_default_color_map.
a7ef684b 8776 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 8777
fe0055fa
PE
87782011-10-25 Paul Eggert <eggert@cs.ucla.edu>
8779
8780 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
8781
e6346438
SM
87822011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
8783
8784 * keyboard.c (test_undefined): New function (bug#9751).
8785 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
8786
e112cc37
ET
87872011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
8788
8789 * sysdep.c (init_sys_modes): Fix the check for the controlling
8790 terminal (Bug#6649).
8791
7b5d6677
EZ
87922011-10-20 Eli Zaretskii <eliz@gnu.org>
8793
8794 * dispextern.h (struct bidi_it): New member next_en_type.
8795
8796 * bidi.c (bidi_line_init): Initialize the next_en_type member.
8797 (bidi_resolve_explicit_1): When next_en_pos is valid for the
8798 current character, check also for next_en_type being WEAK_EN.
8799 (bidi_resolve_weak): Don't enter the expensive loop if the current
8800 position is before next_en_pos. Record the bidi type of the first
8801 non-ET, non-BN character we find, in addition to its position.
8802 (bidi_level_of_next_char): Invalidate next_en_type when
8803 next_en_pos is over-stepped.
8804
7da0b018
PE
88052011-10-20 Paul Eggert <eggert@cs.ucla.edu>
8806
8807 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
8808 * editfns.c: Rewrite current-time-zone so that it invokes
8809 the equivalent of (format-time-string "%Z") to get the time zone name.
8810 This fixes a bug when the time zone name contains characters that
8811 need converting from the system time locale to Emacs internal format.
8812 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
8813 that patch fixed format-time-string to do the conversion, but
8814 I forgot to fix current-time-zone.
8815 (format_time_string): New function, containing most of
8816 what Fformat_time_string used to contain.
8817 (Fformat_time_string): Rewrite in terms of format_time_string.
8818 This doesn't change this function's behavior.
8819 (current-time-zone): Rewrite to use format_time_string.
8820 This fixes the bug reported by Michael Schierl in
8821 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
8822 Jason Rumney's 2007-06-07 change worked around this bug, but
8823 didn't fix it.
8824 * systime.h (tzname, timezone): Remove no-longer-used declarations.
8825
8547b010
EZ
88262011-10-19 Eli Zaretskii <eliz@gnu.org>
8827
8828 * xdisp.c (start_display): If the character at POS is displayed
8829 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
8830 (try_window_reusing_current_matrix): If a line ends in a display
8831 vector or the next line starts in a display vector, continue
8832 redrawing the window even though the character position of
8833 start_row was reached.
8547b010
EZ
8834 (Bug#9771, part 2)
8835
4e948d15
CY
88362011-10-18 Chong Yidong <cyd@gnu.org>
8837
8838 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
8839 with nobreak-char-display too.
8840
4787455f
EZ
88412011-10-18 Eli Zaretskii <eliz@gnu.org>
8842
8843 Fix part 3 of bug#9771.
8844 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
8845 (bidi_resolve_neutral): Don't enter the expensive loop looking for
8846 non-neutral characters if the current character is a paragraph
8847 separator (a.k.a. Newline). This avoids running the same
8848 expensive loop twice, once when we consume the preceding newline
8849 and the other time when the line actually needs to be displayed.
8850 Avoid the loop when we see neutrals on the base embedding level
8851 following a character whose directionality is the same as the
8852 paragraph's. This avoids running the expensive loop when a line
8853 ends in a long sequence of neutrals, like control characters.
8854 Add assertion against STRONG_AL type. Slightly rearrange code
8855 that determines the type of a neutral given the first non-neutral
8856 that follows it.
8857 (bidi_level_of_next_char): Set next_en_pos to zero when
8858 invalidating its info.
8859
2c91f553
EZ
88602011-10-17 Eli Zaretskii <eliz@gnu.org>
8861
8862 * xdisp.c (push_display_prop): Determine whether to record string
8863 or buffer position by IT->string, not by IT->method. Allow
8864 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
8865 (move_it_vertically_backward): Don't look for character position
8866 immediately after the newline when in a continuation line.
8867 (Bug#9771, part 1)
2c91f553 8868
c7b08b0d
MR
88692011-10-15 Martin Rudalics <rudalics@gmx.at>
8870
8871 * window.c (coordinates_in_window): Rewrite and delabelize
8872 vertical border check. (Bug#5357) (Bug#9618)
8873
6b02f655
SM
88742011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
8875
8876 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
8877 errors in XSetWindowBorder (bug#9310).
8878
81d40c92
DA
88792011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
8880
8881 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
8882 avoid crash when xmalloc overrun checking is enabled.
8883
d4172c3b
EZ
88842011-10-13 Eli Zaretskii <eliz@gnu.org>
8885
8886 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
8887 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
8888 cursor motion with <left> and <right> arrow keys.
8889
8890 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
8891 some callers set that themselves.
8892
b00eea75
EZ
88932011-10-12 Eli Zaretskii <eliz@gnu.org>
8894
8895 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
8896 display string and the previous row comes from the same string and
8897 is empty. (Bug#9739) (Bug#9738)
8898
8fe012c4
SM
88992011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
8900
8901 * doc.c (get_doc_string): Encode file name (bug#9735).
8902
0074aef2
EZ
89032011-10-12 Eli Zaretskii <eliz@gnu.org>
8904
79beb178
EZ
8905 * bidi.c (bidi_level_of_next_char):
8906 * xdisp.c (get_visually_first_element): Remove old incorrect
8907 comments regarding the Unicode Line Separator character.
8908
0074aef2
EZ
8909 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
8910
6e4b3fbe
DA
89112011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
8912
8913 * alloc.c (Fgc_status): Do not access beyond zombies array
8914 boundary if nzombies > MAX_ZOMBIES.
8915 * alloc.c (dump_zombies): Add missing format specifier.
8916
0324f3af
PE
89172011-10-12 Paul Eggert <eggert@cs.ucla.edu>
8918
b5525cac
PE
8919 * xdisp.c (set_cursor_from_row): Simplify conditionals,
8920 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
8921
0324f3af
PE
8922 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
8923 Some packages use them to denote characters with modifiers.
8924
e9b5f888
AS
89252011-10-11 Andreas Schwab <schwab@linux-m68k.org>
8926
8927 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
8928 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
8929 matching a pp-number. Rename parameter var to var1.
8930
127827c0
SM
89312011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
8932
8933 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
8934
c8fd3bd0
GM
89352011-10-08 Glenn Morris <rgm@gnu.org>
8936
8937 * callint.c (Fcall_interactively): Give a more explicit error for the
8938 'c' case with a non-character input. (Bug#8479)
8939
352ec8ff
EZ
89402011-10-08 Eli Zaretskii <eliz@gnu.org>
8941
03669ccb
EZ
8942 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
8943 lines.
7061c986
EZ
8944 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
8945 lines that are hscrolled on the left.
03669ccb 8946
352ec8ff
EZ
8947 * dispnew.c (buffer_posn_from_coords): Account for a possible
8948 presence of header-line. (Bug#4426)
8949
a66cfb1c
SM
89502011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
8951
6b02f655
SM
8952 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
8953 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 8954
7c5ee88e
PE
89552011-10-07 Paul Eggert <eggert@cs.ucla.edu>
8956
8957 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
8958 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
8959 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
8960 this makes Emacs dump core during garbage collection on rare
8961 occasions. sizeof is obviously inferior to offsetof here, so
8962 stick with offsetof.
8963 (GC_POINTER_ALIGNMENT): New macro.
8964 (mark_memory): Omit 3rd (offset) arg; caller changed.
8965 Don't assume EMACS_INT alignment is the same as pointer alignment.
8966
df1bbe5b
SM
89672011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
8968
8969 * keyboard.c (read_key_sequence_remapped): New var.
8970 (read_key_sequence): Compute remapping in the right buffer.
8971 (command_loop_1): Use read_key_sequence's remapping directly.
8972
51553db6
SM
89732011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
8974
32c1fffd
SM
8975 * dired.c (file_name_completion): Don't expand file name.
8976 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
8977 before checking file name handler.
8978
51553db6
SM
8979 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
8980 they've been requested explicitly (bug#9591).
8981
b6bd1599 89822011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
8983
8984 * keymap.c (Fsingle_key_description): Use make_specified_string
8985 instead of build_string to build string from push_key_description.
8986 (Bug#5193)
8987
f701dc2a
PE
89882011-09-30 Paul Eggert <eggert@cs.ucla.edu>
8989
4222c55d
PE
8990 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
8991 This fixes a Y2038 bug on 64-bit hosts.
8992 * buffer.c (reset_buffer):
8993 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
8994 (Fclear_buffer_auto_save_failure):
8995 Use 0, not -1, to represent an unset failure time, since time_t
8996 might not be signed.
8997
f701dc2a
PE
8998 Remove dependency on glibc malloc internals.
8999 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9000 Move back here from lisp.h, but with their new implementations.
9001 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9002 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
9003 * charset.c (charset_table_init): New static var.
9004 (syms_of_charset): Use it instead of xmalloc. This removes a
9005 dependency on glibc malloc internals. See Eli Zaretskii's comment in
9006 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
9007 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9008 Move back to alloc.c.
9009 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9010 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
9011
9ceebf39
JD
90122011-09-30 Jan Djärv <jan.h.d@swipnet.se>
9013
9014 * nsterm.m (windowDidResize): Call x_set_window_size only when
9015 ns_in_resize is true. Otherwise set pixelwidth/height and
9016 call change_frame_size (Bug#9628).
9017
cb993c58
PE
90182011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9019
3930c88b
PE
9020 Port --enable-checking=all to Fedora 14 x86-64.
9021 * charset.c (syms_of_charset): Also account for glibc malloc's
9022 internal overhead when calculating the initial malloc maximum.
9023
cb993c58
PE
9024 Port --enable-checking=all to Fedora 14 x86.
9025 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9026 Move to lisp.h.
9027 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
9028 (overrun_check_realloc, overrun_check_free):
9029 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
9030 That way, xmalloc returns a properly-aligned pointer even if
9031 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
9032 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
9033 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
9034 into account when calculating the initial malloc maximum.
9035 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9036 Move here from alloc.c, so that charset.c can use it too.
9037 Properly align; the old code wasn't right for common 32-bit hosts
9038 when configured with --enable-checking=all.
9039 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9040 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
9041
31bed486
EZ
90422011-09-29 Eli Zaretskii <eliz@gnu.org>
9043
04c70788 9044 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
9045 use EDOM.
9046
fbcaa2f3
EZ
90472011-09-28 Eli Zaretskii <eliz@gnu.org>
9048
9049 * xdisp.c (compute_display_string_end): If there's no display
9050 string at CHARPOS, return -1.
9051
9052 * bidi.c (bidi_fetch_char): When compute_display_string_end
9053 returns a negative value, treat the character as a normal
9054 character not covered by a display string. (Bug#9624)
9055
a239d4e9
JB
90562011-09-28 Juanma Barranquero <lekktu@gmail.com>
9057
9058 * lread.c (Fread_from_string): Fix typo in docstring.
9059
88652fd5
EZ
90602011-09-27 Eli Zaretskii <eliz@gnu.org>
9061
9062 * xdisp.c (handle_invisible_prop): If invisible text ends on a
9063 newline, reseat the iterator instead of bidi-iterating there one
9064 character at a time. (Bug#9610)
32c1fffd
SM
9065 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
9066 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 9067
ed497dd4
AS
90682011-09-27 Andreas Schwab <schwab@linux-m68k.org>
9069
9070 * lread.c (readevalloop): Use correct code for NBSP.
9071 (read1): Likewise. (Bug#9608)
9072
b2bf61aa
MA
90732011-09-25 Michael Albinus <michael.albinus@gmx.de>
9074
9075 * dbusbind.c (Fdbus_register_signal): When service is not
9076 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
9077
32bbb17c
GM
90782011-09-25 Glenn Morris <rgm@gnu.org>
9079
9080 * buffer.c (truncate-lines): Doc fix.
9081
94e0933e
CY
90822011-09-24 Chong Yidong <cyd@stupidchicken.com>
9083
9084 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
9085 (Fset_window_next_buffers): Doc fix.
9086
cddde921
GM
90872011-09-24 Glenn Morris <rgm@gnu.org>
9088
9089 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
9090
1260aef1
PE
90912011-09-24 Paul Eggert <eggert@cs.ucla.edu>
9092
25b4bfa0
PE
9093 Fix minor problems found by static checking.
9094 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
9095 * indent.c (Fvertical_motion): Fix == vs = typo.
9096
e3cbd34b
EZ
90972011-09-24 Eli Zaretskii <eliz@gnu.org>
9098
a66cfb1c
SM
9099 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
9100 Default value is now t. Doc fix.
6bf7006f 9101
e3cbd34b 9102 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 9103 logic when moving up, not only when moving down. Fix the
e3cbd34b 9104 confusing name and values of the it_overshoot_expected variable;
32c1fffd 9105 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
9106
9107 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
9108 CHARPOS is covered by a display string which includes newlines.
9109 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
9110 is covered by a display string with embedded newlines.
9111
a3de0cbd
MA
91122011-09-24 Michael Albinus <michael.albinus@gmx.de>
9113
9114 * dbusbind.c (Fdbus_register_signal): Add match rule to
9115 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
9116 (Fdbus_register_method, Vdbus_registered_objects_table):
9117 Fix docstring.
a3de0cbd 9118
b260039d
JM
91192011-09-24 Jim Meyering <meyering@redhat.com>
9120
32c1fffd 9121 do not ignore write error for any output size
b260039d
JM
9122 The previous change was incomplete.
9123 While it makes emacs --batch detect the vast majority of stdout
9124 write failures, errors were still ignored whenever the output size is
9125 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
9126 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
9127 && echo FAIL: ignored write error
9128 FAIL: ignored write error
9129 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
9130 && echo FAIL: ignored write error
9131 FAIL: ignored write error
9132 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
9133
8eca8a7c
AS
91342011-09-23 Andreas Schwab <schwab@linux-m68k.org>
9135
9136 * emacs.c (Fkill_emacs): In noninteractive mode exit
9137 non-successfully if a write error occurred on stdout. (Bug#9574)
9138
3341db62
EZ
91392011-09-21 Eli Zaretskii <eliz@gnu.org>
9140
9141 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
9142 the xassert test.
9143
9144 * dispextern.h (struct it): Update the comment documenting what
9145 can it->OBJECT be.
9146
8c203dbf
EZ
91472011-09-20 Eli Zaretskii <eliz@gnu.org>
9148
9149 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
9150 a display string, extend search for cursor position to end of row.
9151 (find_row_edges): If the row ends in a newline from a display
9152 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
9153 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
9154 (Fcurrent_bidi_paragraph_direction): Fix search for previous
9155 non-empty line. Fixes confusing cursor motion with arrow keys at
9156 the beginning of a line that starts with whitespace.
8c203dbf 9157
a4824228
LMI
91582011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
9159
9160 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
9161 (bug#9493).
9162
33ed493b
CY
91632011-09-18 Chong Yidong <cyd@stupidchicken.com>
9164
9165 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
9166 boolean (Bug#9154).
9167
56cd55c8
EZ
91682011-09-18 Eli Zaretskii <eliz@gnu.org>
9169
9170 * xdisp.c (display_line): Record maximum and minimum buffer
9171 positions even if no glyphs were produced (e.g., by a zero-width
9172 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
9173 buffer positions that will be removed from the glyph row because
9174 they don't fit.
c02dcedf
EZ
9175 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
9176 column is beyond frame width: don't subtract 1 "pixel" when
9177 computing width of the stretch.
3e62b7e0
EZ
9178 (reseat_at_next_visible_line_start): Undo the change made on
9179 2011-09-17 that saved paragraph information and restored it after
9180 the call to `reseat'. (Bug#9545)
56cd55c8 9181
5ed99d36 91822011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
9183
9184 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
9185 and turn window cursor on if cleared (Bug#9415).
9186
5ed99d36 91872011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
9188
9189 * search.c (boyer_moore): Take unibyte characters from pattern
9190 literally. (Bug#9458)
9191
9bade7b2
EZ
91922011-09-18 Eli Zaretskii <eliz@gnu.org>
9193
9194 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
9195
e5e9d610
PE
91962011-09-18 Paul Eggert <eggert@cs.ucla.edu>
9197
87e4427a
PE
9198 Fix minor problem found by static checking.
9199 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
9200 initialized, to pacify gcc -Wuninitialized.
9201
e5e9d610
PE
9202 * fileio.c: Report proper errno when syscall falls.
9203 (Finsert_file_contents): Save and restore errno,
9204 so that report_file_error outputs the correct diagnostic.
9205 (Fwrite_region) [CLASH_DETECTION]: Likewise.
9206
a1674f0b
EZ
92072011-09-18 Eli Zaretskii <eliz@gnu.org>
9208
9209 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
9210
fbfb6dd4
EZ
92112011-09-17 Eli Zaretskii <eliz@gnu.org>
9212
9213 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
9214 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
9215
bb187662
EZ
92162011-09-17 Eli Zaretskii <eliz@gnu.org>
9217
1137e8b8 9218 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 9219 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
9220
9221 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
9222 (bidi_find_paragraph_start): Search back for paragraph beginning
9223 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
9224 (bidi_move_to_visually_next): Only trigger paragraph-related
9225 computations when the last character is a newline or at EOB, not
9226 just any NEUTRAL_B. (Bug#9470)
9227
bb187662
EZ
9228 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
9229 truncated lines if point is covered by a display string. (Bug#9524)
9230
2e621251
PE
92312011-09-16 Paul Eggert <eggert@cs.ucla.edu>
9232
9233 * xselect.c: Relax test for outgoing X longs (Bug#9498).
9234 (cons_to_x_long): New function.
9235 (lisp_data_to_selection_data): Use it. Correct the test for
9236 short-versus-long data; it was negated. Break out of vector
9237 loop, for efficiency, when a long datum is discovered.
9238
91a15bc6
SM
92392011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
9240
9241 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
9242
b41c3a35
EZ
92432011-09-16 Eli Zaretskii <eliz@gnu.org>
9244
9245 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
9246 GCC PR/17406) by declaring this function with external scope.
9247
7812ba2d
PE
92482011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9249
9250 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
9251 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
9252
cf7edc2a
AS
92532011-09-15 Andreas Schwab <schwab@linux-m68k.org>
9254
9255 * editfns.c (Fformat): Correctly handle text properties on "%%".
9256
bd01620e
EZ
92572011-09-15 Eli Zaretskii <eliz@gnu.org>
9258
9259 * xterm.c (x_draw_composite_glyph_string_foreground):
9260 * w32term.c (x_draw_composite_glyph_string_foreground):
9261 * term.c (encode_terminal_code):
9262 * composite.c (composition_update_it, get_composition_id):
9263 * xdisp.c (get_next_display_element)
9264 (fill_composite_glyph_string): Add comments about special meaning
9265 of TAB characters in a composition.
9266
a02719a3
PE
92672011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9268
9269 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
9270 This occurs when processing a multibyte format.
9271 Problem reported by Wolfgang Jenker.
a02719a3 9272
72589a3c
JB
92732011-09-15 Johan Bockgård <bojohan@gnu.org>
9274
9275 * xdisp.c (try_cursor_movement): Only check for exact match if
9276 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
9277
1c14176c
PE
92782011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9279
9280 Remove unused external symbols.
9281 * dispextern.h (calc_pixel_width_or_height): Remove decl.
9282 * xdisp.c (calc_pixel_width_or_height): Now static.
9283 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
9284 * indent.c (check_display_width):
9285 * w32term.c: Fix comment to match code.
9286 * xterm.c, xterm.h (x_catching_errors): Remove.
9287
d2eea5b5
PE
92882011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9289
9290 * xselect.c: Use signed conversions more consistently (Bug#9498).
9291 (selection_data_to_lisp_data): Assume incoming selection data are
9292 signed integers, not unsigned. This is to be consistent with
9293 outgoing selection data, which was modified to use signed integers
9294 in as part of the fix to Bug#9196 in response to Jan D.'s comment
9295 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
9296 expects long, not unsigned long.
9297
46888499
EZ
92982011-09-14 Eli Zaretskii <eliz@gnu.org>
9299
9300 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
9301 computation of loop end. Reported by Johan Bockgård
9302 <bojohan@gnu.org>.
9303
ef8ef9fb
CY
93042011-09-13 Chong Yidong <cyd@stupidchicken.com>
9305
9306 * frame.c (Fother_visible_frames_p): Function deleted.
9307
fa819fed
EZ
93082011-09-12 Eli Zaretskii <eliz@gnu.org>
9309
9310 * indent.c (compute_motion): Process display vector front to back
9311 rather than the other way around. (Bug#2496)
9312
2ba8e008
SM
93132011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
9314
9315 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
9316
20f53c69
CY
93172011-09-11 Chong Yidong <cyd@stupidchicken.com>
9318
9319 * minibuf.c (Fread_from_minibuffer): Doc fix.
9320
d562d7a4
EZ
93212011-09-11 Eli Zaretskii <eliz@gnu.org>
9322
9323 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
9324 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
9325
1c4d7f3d
LMI
93262011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
9327
9328 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
9329 value for non-existent files.
9330
b885bf36
EZ
93312011-09-11 Eli Zaretskii <eliz@gnu.org>
9332
9333 * fileio.c (Finsert_file_contents): If the file cannot be opened,
9334 set its "size" to -1. This will set the modtime_size field of
9335 the corresponding buffer to -1, which is what
9336 verify-visited-file-modtime expects for files that do not exist.
9337 (Bug#9139)
9338
6612f0bf
PE
93392011-09-11 Paul Eggert <eggert@cs.ucla.edu>
9340
9341 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
9342 here ...
9343 * lisp.h: ... from here. push_key_description is no longer
9344 defined in keyboard.c, so its declaration should not be in
9345 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
9346 logically belongs with push_key_description.
9347
dfb3f755
PE
93482011-09-10 Paul Eggert <eggert@cs.ucla.edu>
9349
9350 * buffer.h: Include <sys/types.h> instead of <time.h>.
9351 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
9352 Problem reported by Herbert J. Skuhra.
9353
3134906c
LMI
93542011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
9355
9356 * xml.c (parse_region): Make the parsing work for
9357 non-comment-starting XML files again (bug#9144).
9358
8d903f4e
AS
93592011-09-10 Andreas Schwab <schwab@linux-m68k.org>
9360
9361 * image.c (gif_load): Fix calculation of bottom and right corner.
9362 (Bug#9468)
9363
80ad64f4
EZ
93642011-09-10 Eli Zaretskii <eliz@gnu.org>
9365
9366 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
9367 redisplay in small windows.
9368
208a048d
EZ
93692011-09-09 Eli Zaretskii <eliz@gnu.org>
9370
9371 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
9372
9b1c252e
MR
93732011-09-08 Martin Rudalics <rudalics@gmx.at>
9374
9375 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
9376 Operate on live windows only.
9377
2949f33b
JB
93782011-09-08 Juanma Barranquero <lekktu@gmail.com>
9379
9380 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
9381
e08dcafd
EZ
93822011-09-07 Eli Zaretskii <eliz@gnu.org>
9383
9384 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
9385 only under bidi iteration.
9386
115b96bd
JD
93872011-09-07 Jan Djärv <jan.h.d@swipnet.se>
9388
9389 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
9390
c8199d0f
PE
93912011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9392
9393 isnan: Fix porting problem to Solaris 10 with bundled gcc.
9394 Without this fix, the command to link temacs failed due to an
9395 undefined symbol __builtin_isnan. This is because
9396 /usr/include/iso/math_c99.h #defines isnan(x) to
9397 __builtin_isnan(x), but the bundled gcc, which identifies itself
9398 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
9399 a __builtin_isnan.
9400 * floatfns.c (isnan): #undef, and then #define to a clone of
9401 what's in data.c.
9402 (Fisnan): Always define, since it's always available now.
9403 (syms_of_floatfns): Always define isnan at the Lisp level.
9404
e39b275c 94052011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
9406
9407 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
9408
b2db44d9 94092011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 9410
f4af5137 9411 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
9412 The previous code assumed that file offsets (off_t values) fit in
9413 EMACS_INT variables, which is not true on typical 32-bit hosts.
9414 The code messed up by falsely reporting buffer overflow in cases
9415 such as (insert-file-contents "big" nil 1 2) into an empty buffer
9416 when "big" contains more than 2**29 bytes, even though this
9417 inserts just one byte and does not overflow the buffer.
9418 (Finsert_file_contents): Store file offsets as off_t
9419 values, not as EMACS_INT values. Check for overflow when
9420 converting between EMACS_INT and off_t. When checking for
9421 buffer overflow or for overlap, take the offsets into account.
9422 Don't use EMACS_INT for small values where int suffices.
9423 When checking for overlap, fix a typo: ZV was used where
9424 ZV_BYTE was intended.
9425 (Fwrite_region): Don't assume off_t fits into 'long'.
9426 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
9427
ecfc0a49
MA
94282011-09-05 Michael Albinus <michael.albinus@gmx.de>
9429
9430 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
9431
6511acf2 94322011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 9433
0999621a 9434 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
9435
9436 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 9437 (esprintf, exprintf, evxprintf): New functions.
62f19c19 9438 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 9439 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
9440 (modify_event_symbol): Do not assume that the length of
9441 name_alist_or_stem is safe to alloca and fits in int.
9442 (Fexecute_extended_command): Likewise for function name and binding.
9443 (Frecursion_depth): Wrap around reliably on integer overflow.
9444 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
9445 since some callers pass EMACS_INT values.
9446 (Fsingle_key_description): Don't crash if symbol name contains more
9447 than MAX_ALLOCA bytes.
9448 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
9449 (get_minibuffer): Arg is now EMACS_INT, not int.
9450 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 9451 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
9452 * window.h (command_loop_level, minibuf_level): Reflect API changes.
9453
2be7d702
PE
9454 * dbusbind.c (signature_cat): New function.
9455 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
9456 Do not overrun buffer; instead, report string overflow.
9457
9d1df220
PE
9458 * dispnew.c (add_window_display_history): Don't overrun buffer.
9459 Truncate instead; this is OK since it's just a log.
9460
33ef5c64
PE
9461 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
9462 even if the time zone offset is outlandishly large.
9463 Don't mishandle offset == INT_MIN.
9464
66c6fdd5
PE
9465 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
9466 when creating daemon; the previous buffer-overflow check was incorrect.
9467
d749b01b
PE
9468 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
9469 which has the guts of the old verror function.
9470
b5cd1905
PE
9471 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
9472 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
9473
6e1a67fb
PE
9474 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
9475 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 9476 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 9477 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
9478 length of string rather than counting it via multiple sprintfs;
9479 that's simpler and more reliable.
c21721cc
PE
9480 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
9481 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
9482 sprintf, in case result does not fit in int.
9483
c57b67fc
PE
9484 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
9485 (fontset_from_font): Print it.
9486
8a401434
PE
9487 * frame.c (tty_frame_count): Now printmax_t, not int.
9488 (make_terminal_frame, set_term_frame_name): Print it.
9489 (x_report_frame_params): In X, window IDs are unsigned long,
9490 not signed long, so print them as unsigned.
9491 (validate_x_resource_name): Check for implausibly long names,
9492 and don't assume name length fits in 'int'.
9493 (x_get_resource_string): Don't blindly alloca invocation name;
9494 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
9495 not fit in int.
9496
6e1a67fb
PE
9497 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
9498 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
9499 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
9500
0df02bf3
PE
9501 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
9502 Use esprintf, not sprintf, in case result does not fit in int.
9503
48e30793
PE
9504 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
9505 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
9506 it as a large positive number.
9507 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
9508 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
9509
a66ff6d8
PE
9510 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
9511 in case result does not fit in int.
9512
aca216ff
PE
9513 * print.c (float_to_string): Detect width overflow more reliably.
9514 (print_object): Make sprintf buffer a bit bigger, to avoid potential
9515 buffer overrun. Don't assume list length fits in 'int'. Treat
9516 print length of 0 as 0, not as infinity; to be consistent with other
9517 uses of print length in this function. Don't overflow print length
9518 index. Don't assume hash table size fits in 'long', or that
9519 vectorlike size fits in 'unsigned long'.
9520
31c286f7
PE
9521 * process.c (make_process): Use printmax_t, not int, to format
9522 process-name gensyms.
9523
55e5faa1
PE
9524 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
9525
80f2e268
PE
9526 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
9527 to avoid potential buffer overrun.
9528
670741ab
PE
9529 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
9530 if X resource line is longer than 512 bytes.
9531
b7163a50
PE
9532 * xfns.c (x_window): Make sprintf buffer a bit bigger
9533 to avoid potential buffer overrun.
9534
ae58ff1f
PE
9535 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
9536
c43c8a6a
PE
9537 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
9538
3f8236f4
PE
95392011-09-04 Paul Eggert <eggert@cs.ucla.edu>
9540
53e9fe90 9541 Integer overflow fixes for scrolling, etc.
6511acf2
PE
9542 Without these, Emacs silently mishandles large integers sometimes.
9543 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
9544 it were "C-u 1 M-x recenter" on a typical 64-bit host.
9545
6511acf2
PE
9546 * xdisp.c (try_window_id): Check Emacs fixnum range before
9547 converting to 'int'.
806add1d 9548
6511acf2 9549 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
9550 Check that an Emacs fixnum is in range before assigning it to 'int'.
9551 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
9552 values converted from Emacs fixnums.
9553 (Frecenter): Don't wrap around a line count if it is out of 'int'
9554 range; instead, treat it as an extreme value.
9555 (Fset_window_configuration, compare_window_configurations):
9556 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
9557
6511acf2
PE
9558 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
9559 that can exceed INT_MAX. Check that EMACS_INT value is in range
9560 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
9561 (match_limit): Don't assume that a fixnum can fit in 'int'.
9562
6511acf2 9563 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
9564 exceed INT_MAX.
9565
6511acf2 9566 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
9567 (Fvertical_motion): Don't wrap around LINES values that don't fit
9568 in 'int'. Instead, treat them as extreme values. This is good
9569 enough for windows, which can't have more than INT_MAX lines anyway.
9570
fcb901a7
LMI
95712011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
9572
0f2f6b6d
LMI
9573 * Require libxml/parser.h to avoid compilation warning.
9574
fcb901a7
LMI
9575 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
9576
9577 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
9578 since this reportedly can destroy thread storage.
9579
6e20a0d4
CY
95802011-08-30 Chong Yidong <cyd@stupidchicken.com>
9581
9582 * syntax.c (find_defun_start): Update all cache variables if
9583 exiting early (Bug#9401).
9584
148ae00e
EZ
95852011-08-30 Eli Zaretskii <eliz@gnu.org>
9586
f6cfbd8f
EZ
9587 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
9588
148ae00e
EZ
9589 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
9590 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
9591 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
9592
9593 * term.c (tty_append_glyph): New function.
9594 (produce_stretch_glyph): Static function and its prototype deleted.
9595
a66cfb1c
SM
9596 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
9597 Add prototypes.
148ae00e 9598
c4a07a4c
PE
95992011-08-29 Paul Eggert <eggert@cs.ucla.edu>
9600
9601 * image.c (parse_image_spec): Check for nonnegative, not for positive,
9602 when checking :margin (Bug#9390).
9603 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 9604 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
9605 so that the name doesn't mislead. All uses changed.
9606
6bc8cd65
JB
96072011-08-28 Johan Bockgård <bojohan@gnu.org>
9608
9609 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
9610 set_tty_hooks.
9611
dca4927e
EZ
96122011-08-27 Eli Zaretskii <eliz@gnu.org>
9613
9614 * xdisp.c (move_it_to): Don't bail out early when reaching
9615 position beyond to_charpos, if we are scanning backwards.
9616 (move_it_vertically_backward): When DY == 0, make sure we get to
9617 the first character in the line after the newline.
9618
f2cad773
PE
96192011-08-27 Paul Eggert <eggert@cs.ucla.edu>
9620
9621 * ccl.c: Improve and simplify overflow checking (Bug#9196).
9622 (ccl_driver): Do not generate an out-of-range pointer.
9623 (Fccl_execute_on_string): Remove unnecessary check for
9624 integer overflow, noted by Stefan Monnier in
9625 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
9626 Remove a FIXME that didn't need fixing.
9627 Simplify the newly-introduced buffer reallocation code.
9628
0cae2cdb
JB
96292011-08-27 Juanma Barranquero <lekktu@gmail.com>
9630
9631 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
9632
5fc295a4 96332011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 9634
70c60eb2 9635 Integer and memory overflow issues (Bug#9196).
726e0ab1 9636
d31850da
PE
9637 * doc.c (get_doc_string): Rework so that
9638 get_doc_string_buffer_size is the actual buffer size, rather than
9639 being 1 less than the actual buffer size; this makes xpalloc more
9640 convenient.
9641
a69fbedb
PE
9642 * image.c (x_allocate_bitmap_record, cache_image):
9643 * xselect.c (Fx_register_dnd_atom):
9644 Simplify previous changes by using xpalloc.
9645
fe5c5d37
PE
9646 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
9647 since either will do and ptrdiff_t is convenient with xpalloc.
9648
0065d054
PE
9649 * charset.c (charset_table_size)
9650 (struct charset_sort_data.priority): Now ptrdiff_t.
9651 (charset_compare): Don't overflow if priorities differ greatly.
9652 (Fsort_charsets): Don't assume list length fits in int.
9653 Check for size-calculation overflow when allocating sort data.
9654 (syms_of_charset): Allocate an initial charset table that is
9655 just under 64 KiB, to avoid problems with glibc malloc and mmap.
9656
9657 * cmds.c (internal_self_insert): Check for size-calculation overflow.
9658
9659 * composite.h (struct composition.glyph_len): Now int, not unsigned.
9660 The actual value is always <= INT_MAX, and leaving it unsigned made
9661 overflow checking harder.
9662
9663 * dispextern.h (struct glyph_matrix.rows_allocated)
9664 (struct face_cache.size): Now ptrdiff_t, for convenience in use
9665 with xpalloc. The values are still always <= INT_MAX.
9666
9667 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
9668
9669 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
9670 (SAFE_NALLOCA): New macro.
9671
9672 * region-cache.c (struct boundary.pos, find_cache_boundary)
9673 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
9674 (set_cache_region, invalidate_region_cache)
9675 (revalidate_region_cache, know_region_cache, region_cache_forward)
9676 (region_cache_backward, pp_cache):
9677 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
9678 so that ptrdiff_t * can be passed to xpalloc.
9679 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
9680 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
9681 (pp_cache): Don't assume cache_len fits in int.
9682 * region-cache.h: Adjust extern decls to match.
9683
9684 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
9685 EMACS_INT, since either will do, for xpalloc.
9686
9687 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
9688 (xnmalloc, xnrealloc, xpalloc): New functions.
9689
726e0ab1
PE
9690 * bidi.c (bidi_shelve_header_size): New constant.
9691 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
9692 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
9693
51f30bc5 9694 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
9695 * buffer.c (overlays_at, overlays_in, record_overlay_string)
9696 (overlay_strings):
9697 Don't update size of array until after memory allocation succeeds,
9698 because xmalloc/xrealloc may not return.
0065d054
PE
9699 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
9700 now that we have proper integer overflow checking.
9701 (record_overlay_string, overlay_strings): Catch overflows when
9702 calculating size of overlay_str_buf.
726e0ab1 9703
0065d054
PE
9704 * callproc.c (Fcall_process): Check for size overflow when
9705 calculating size of args2.
9706 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
9707 Normally we prefer signed values, but sticking with ptrdiff_t would
9708 require adding more-complicated checks.
726e0ab1
PE
9709
9710 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
9711 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
9712 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 9713 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
9714
9715 * character.c (Fstring): Check for size-calculation overflow.
9716
9717 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
9718 unnecessary integer overflow. Check for size overflow.
9719 (encode_coding_object): Don't update size until xmalloc succeeds.
9720
9721 * composite.c (get_composition_id): Check for overflow in glyph
9722 length calculations.
9723
9724 Integer and memory overflow fixes for display code.
9725 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
9726 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
9727 (scrolling_window): Check for overflow in size calculations.
9728 (line_draw_cost, realloc_glyph_pool, add_row_entry):
9729 Don't assume glyph table len fits in int.
9730 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
9731 (row_table_size): Now ptrdiff_t, not int.
9732 (scrolling_window): Avoid overflow in size calculations.
9733 Don't update size until allocation succeeds.
9734 * fns.c (concat): Check for overflow in size calculations.
9735 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
9736 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9737 (NEXT_ALMOST_PRIME_LIMIT): New constant.
9738
9739 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
9740 (get_doc_string): Check for size calculation overflow.
9741 Don't update size until allocation succeeds.
9742 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
9743 EMACS_INT, where ptrdiff_t will do.
9744 (Fsubstitute_command_keys): Check for string overflow.
9745
9746 * editfns.c (set_time_zone_rule): Don't assume environment length
9747 fits in int.
9748 (message_length): Now ptrdiff_t, not int.
9749 (Fmessage_box): Don't update size until allocation succeeds.
9750 Don't assume message length fits in int.
9751 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
9752
0065d054
PE
9753 * emacs.c (main): Do not reallocate argv, since there is a null at
9754 the end that can be overwritten, and this way there's no need to
9755 worry about size-calculation overflow.
9756 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
9757
9758 * eval.c (init_eval_once, grow_specpdl): Don't update size until
9759 alloc succeeds.
9760 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
9761
9762 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
9763 (x_set_scroll_bar_width, x_figure_window_size):
9764 Check for integer overflow.
9765 (x_set_alpha): Do not assume XINT fits in int.
9766
9767 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
9768 This is for the members text_lines, text_cols, total_lines, total_cols,
9769 where the system imposes an 'int' limit.
9770
9771 * fringe.c (Fdefine_fringe_bitmap):
9772 Don't update size until alloc works.
9773
9774 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
9775 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
9776
9777 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
9778 Check for size-calculation overflow.
9779 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
9780 do, as we prefer signed integers.
9781 (id_to_widget.max_size, id_to_widget.used)
9782 (xg_store_widget_in_map, xg_remove_widget_from_map)
9783 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
9784 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
9785 Use and return ptrdiff_t, not int.
9786 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
9787 * gtkutil.h: Change prototypes to match the above.
9788
9789 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
9790 are duplicate now that they've been promoted to lisp.h.
9791 (x_allocate_bitmap_record, x_alloc_image_color)
9792 (make_image_cache, cache_image, xpm_load):
9793 Don't update size until alloc is done.
9794 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
9795 (x_detect_edges):
3256efce 9796 Check for size calculation overflow.
726e0ab1
PE
9797 (ct_colors_allocated_max): New constant.
9798 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
9799 overflow.
3256efce 9800
726e0ab1
PE
9801 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
9802 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
9803 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
9804 Use ptrdiff_t, not int, to count maps.
9805 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
9806 calculations. Don't update size until allocation succeeds.
9807 Redo calculations to avoid overflow.
726e0ab1
PE
9808 * keyboard.h: Change prototypes to match the above.
9809
9810 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
9811 to count maps.
9812 (current_minor_maps): Check for size calculation overflow.
9813 * keymap.h: Change prototypes to match the above.
9814
9815 * lread.c (read1, init_obarray): Don't update size until alloc done.
9816
9817 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
9818 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
9819
726e0ab1
PE
9820 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
9821 Now ptrdiff_t, not int.
9822 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
9823 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
9824
9825 * process.c (Fnetwork_interface_list): Check for overflow
9826 in size calculation.
9827
9828 * region-cache.c (move_cache_gap): Check for size calculation overflow.
9829
9830 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
9831 overflow. Don't bother calling xmalloc when xrealloc will do.
9832
9833 * search.c (Freplace_match): Check for size calculation overflow.
9834 (Fset_match_data): Don't assume list lengths fit in 'int'.
9835
9836 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
9837 for command line length. Do not attempt to address one before the
9838 beginning of an array, as that's not portable.
9839
9840 * term.c (max_frame_lines): Remove; unused.
9841 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
9842 not int.
9843 (encode_terminal_code, calculate_costs): Check for size
9844 calculation overflow.
9845 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
9846 table lengths and related sizes. Don't update size until alloc
9847 done. Redo calculations to avoid overflow.
9848 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
9849
9850 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
9851 subtracting pointers.
9852 (gobble_line): Check for overflow more carefully. Don't update size
9853 until alloc done.
9854
9855 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
9856 Don't update size until alloc done.
9857 Redo size calculations to avoid overflow.
9858 Check for size calculation overflow.
0065d054 9859 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
9860
9861 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
9862 Use ptrdiff_t, not int, for sizes.
9863 (store_mode_line_noprop_char): Don't update size until alloc done.
9864
0065d054
PE
9865 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
9866 Use ptrdiff_t, not int, for sizes.
9867 (Finternal_make_lisp_face, cache_face):
9868 Check for size calculation overflow.
9869 (cache_face): Treat size calculation overflows as if they were
9870 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
9871
9872 * xfns.c (x_encode_text, x_set_name_internal)
9873 (Fx_change_window_property): Use ptrdiff_t, not int, to count
9874 sizes, since they can exceed INT_MAX in size. Check for size
9875 calculation overflow.
9876
0065d054
PE
9877 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
9878 (xg_select): Check for size calculation overflow.
726e0ab1
PE
9879 Don't update size until alloc done.
9880
0065d054 9881 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 9882 as sprintf is limited to int lengths.
1d526e2f 9883
252c5ee1
PE
9884 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
9885 (X_LONG_MIN): New macros.
864d7ce7
PE
9886 Use them to make the following changes clearer.
9887 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
9888 This change doesn't affect the value now, but it may help remind
9889 future maintainers not to raise the value too much later.
9890 (SELECTION_QUANTUM): Remove, replacing with ...
9891 (selection_quantum): ... new function, which avoids overflow.
9892 All uses changed.
9893 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
9894 assumption that selection length fits in 'int'.
9895 (x_reply_selection_request, x_handle_selection_request)
9896 (x_get_window_property, receive_incremental_selection)
9897 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
9898 (lisp_data_to_selection_data, clean_local_selection_data):
9899 Use ptrdiff_t, not int, to record length of selection.
9900 (x_reply_selection_request, x_get_window_property)
9901 (receive_incremental_selection, x_property_data_to_lisp):
9902 Redo calculations to avoid overflow.
9903 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 9904 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
9905 something.
9906 (x_get_window_property, receive_incremental_selection)
9907 (lisp_data_to_selection_data, x_property_data_to_lisp):
9908 Check for size-calculation overflow.
9909 (x_get_window_property, receive_incremental_selection)
9910 (lisp_data_to_selection_data, Fx_register_dnd_atom):
9911 Don't store size until memory allocation succeeds.
9912 (x_get_window_property): Plug memory leak on memory exhaustion.
9913 Don't double-block input; malloc is safe here. Don't assume 2**34
9914 - 4 fits in unsigned long. Add an xassert to check
9915 XGetWindowProperty overflow. Be more careful about overflow
9916 calculations, and distinguish size from memory overflow better.
9917 (receive_incremental_selection): When tracing, don't assume
9918 unsigned int is less than INT_MAX.
9919 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
9920 harmful) conversions of unsigned short to int.
9921 (lisp_data_to_selection_data): Don't assume that integers
9922 in the range -65535 through -1 fit in an X unsigned short.
9923 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
9924 result parameters unless successful. Rely on cons_to_unsigned
9925 to report problems with elements; the old code wasn't right anyway.
9926 (x_check_property_data): Check for int overflow; we cannot use
9927 a wider type due to X limits.
9928 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
9929
726e0ab1 9930 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 9931
0065d054
PE
9932 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
9933 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
9934 (x_color_cells): Don't store size until memory allocation succeeds.
9935 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 9936 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
9937 (x_term_init): Don't assume length fits in int (sprintf is limited
9938 to int size).
bc18e09d 9939
ebfa62c0
PE
9940 Use ptrdiff_t for composition IDs.
9941 * character.c (lisp_string_width):
9942 * composite.c (composition_table_size, n_compositions)
9943 (get_composition_id, composition_gstring_from_id):
9944 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
9945 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
9946 * window.c (Frecenter):
9947 Use ptrdiff_t, not int, for composition IDs.
9948 * composite.c (get_composition_id): Check for integer overflow.
9949 * composite.h: Adjust prototypes to match the above changes.
9950
d3411f89
PE
9951 Use ptrdiff_t for hash table indexes.
9952 * category.c (hash_get_category_set):
9953 * ccl.c (ccl_driver):
9954 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
9955 * coding.c (coding_system_charset_list, detect_coding_system):
9956 * coding.h (struct coding_system.id):
9957 * composite.c (get_composition_id, gstring_lookup_cache):
9958 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
9959 * image.c (xpm_get_color_table_h):
9960 * lisp.h (hash_lookup, hash_put):
9961 * minibuf.c (Ftest_completion):
9962 Use ptrdiff_t for hash table indexes, not int (which is too
9963 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
9964 32-bit --with-wide-int hosts).
9965
e097a6fa
PE
9966 * charset.c (Fdefine_charset_internal): Check for integer overflow.
9967 Add a FIXME comment about memory leaks.
9968 (syms_of_charset): Don't assume xmalloc returns.
9969
5637687f
PE
9970 Don't assume that stated character widths fit in int.
9971 * character.c (Fchar_width, c_string_width, lisp_string_width):
9972 * character.h (CHAR_WIDTH):
9973 * indent.c (MULTIBYTE_BYTES_WIDTH):
9974 Use sanitize_char_width to avoid undefined and/or bad behavior
9975 with outlandish widths.
a66cfb1c 9976 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
9977 now that we have two such functions. All uses changed.
9978 (sanitize_char_width): New inline function.
9979
a2271ba2
PE
9980 Don't assume that tab-width fits in int.
9981 * character.h (sanitize_width): New inline function.
9982 (SANE_TAB_WIDTH): New macro.
9983 (ASCII_CHAR_WIDTH): Use it.
9984 * indent.c (sane_tab_width): Remove. All uses replaced by
9985 SANE_TAB_WIDTH (current_buffer).
9986 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
9987
18c52557
PE
9988 * fileio.c: Integer overflow issues with file modes.
9989 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
9990
caeeedc1
PE
9991 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
9992 Remove unreachable code.
9993 (read_hex, load_charset_map_from_file): Check for integer overflow.
9994
6df6ae42 9995 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
9996 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
9997 (x_send_scroll_bar_event): Likewise. Check that the size does not
9998 exceed limits imposed by XClientMessageEvent, as well as the usual
9999 ptrdiff_t and size_t limits.
10000
b13995db
PE
10001 * keyboard.c: Overflow, signedness and related fixes.
10002 (make_lispy_movement): Use same integer type in forward decl
10003 that is used in the definition.
10004 (read_key_sequence, keyremap_step):
10005 Change bufsize argument back to int, undoing my 2011-03-30 change.
10006 We prefer signed types, and int is wide enough here.
10007 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
10008 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
10009 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
10010 length, not size_t. Use ptrdiff_t for index, not int.
10011 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
10012 possibility of integer overflow.
10013
13464394
PE
10014 Overflow, signedness and related fixes for images.
10015
10016 * dispextern.h (struct it.stack[0].u.image.image_id)
10017 (struct_it.image_id, struct image.id, struct image_cache.size)
10018 (struct image_cache.used, struct image_cache.ref_count):
10019 * gtkutil.c (update_frame_tool_bar):
10020 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
10021 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
10022 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
10023 * nsmenu.m (update_frame_tool_bar):
10024 * xdisp.c (calc_pixel_width_or_height):
10025 * xfns.c (image_cache_refcount):
10026 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
10027 on typical 64-bit hosts.
10028
10029 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10030 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
10031 Omit unnecessary casts to int.
10032 (parse_image_spec): Check that integers fall into 'int' range
10033 when the callers expect that.
10034 (image_ascent): Redo ascent calculation to avoid int overflow.
10035 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
10036 (lookup_image): Remove unnecessary tests.
10037 (xbm_image_p): Locals are now of int, not EMACS_INT,
10038 since parse_image_check makes sure they fit into int.
10039 (png_load, gif_load, svg_load_image):
10040 Prefer int to unsigned where either will do.
10041 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
10042 old tiff_error_handler and tiff_warning_handler.
10043 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
10044 stack buffer overflows. It uses only the features of vsnprintf
10045 that are common to both POSIX and native Microsoft.
10046 (tiff_error_handler, tiff_warning_handler): Use it.
10047 (tiff_load, gif_load, imagemagick_load_image):
10048 Don't assume :index value fits in 'int'.
10049 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
10050 (imagemagick_load_image): Check that crop parameters fit into
10051 the integer types that MagickCropImage accepts. Don't assume
10052 Vimagemagick_render_type has a nonnegative value. Don't assume
10053 size_t fits in 'long'.
10054 (gs_load): Use printmax_t to print the widest integers possible.
10055 Check for integer overflow when computing image height and width.
10056
c11821d4
EZ
100572011-08-26 Eli Zaretskii <eliz@gnu.org>
10058
10059 * xdisp.c (redisplay_window): Don't force window start if point
10060 will be invisible in the resulting window. (Bug#9324)
10061
0c95fcf7
EZ
100622011-08-25 Eli Zaretskii <eliz@gnu.org>
10063
10064 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
10065 the display spec is of the form `(space ...)'.
10066 (handle_display_spec): Return the value returned by
10067 handle_single_display_spec, not just 1 or zero.
10068 (handle_single_display_spec): If the display spec is of the form
10069 `(space ...)', and specifies display in the text area, return 2
10070 rather than 1.
fee65a97 10071 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
10072 accurately, and prefer exact match for point under bidi.
10073 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
10074
10075 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
10076 into disp_prop; all users changed.
10077
10078 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
10079 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
10080 for the text covered by the display property.
10081
e4ed06f1
CY
100822011-08-25 Chong Yidong <cyd@stupidchicken.com>
10083
10084 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
10085 Change return value to nil.
10086 (Frecord_buffer): Delete unused function.
10087
f67cdd7f
EZ
100882011-08-24 Eli Zaretskii <eliz@gnu.org>
10089
5980d4c6
EZ
10090 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
10091 buffers, return left-to-right.
8610fe8b
EZ
10092 (set_cursor_from_row): Consider candidate row a win if its glyph
10093 represents a newline and point is on that newline. Fixes cursor
10094 positioning on the newline at EOL of R2L text within L2R
10095 paragraph, and vice versa.
10096 (try_cursor_movement): Check continued rows, in addition to
10097 continuation rows. Fixes unwarranted scroll when point enters a
10098 continued line of R2L text within an L2R paragraph, or vice versa.
10099 (cursor_row_p): Consider the case of point being equal to
10100 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
10101 from the end of a short line to the beginning of a continued line
10102 of R2L text within L2R paragraph.
10103 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
10104 composed characters.
5980d4c6 10105
f67cdd7f
EZ
10106 * bidi.c (bidi_check_type): Use xassert.
10107 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
10108 members.
10109
bca633fb
EZ
101102011-08-23 Eli Zaretskii <eliz@gnu.org>
10111
10112 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
10113 a character.
10114
4a5885a7
CY
101152011-08-23 Chong Yidong <cyd@stupidchicken.com>
10116
10117 * nsfont.m (ns_otf_to_script): Fix typo.
10118
0902a04e
KH
101192011-08-22 Kenichi Handa <handa@m17n.org>
10120
10121 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
10122 extra slot even if the purpose is char-code-property-table.
10123
1a2e6670
EZ
101242011-08-23 Eli Zaretskii <eliz@gnu.org>
10125
8ddde651
EZ
10126 * xdisp.c (redisplay_window): When computing centering_position,
10127 account for the height of the header line. (Bug#8874)
10128
425cc014
EZ
10129 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
10130 instead of CHAR_TO_BYTE. Fixes a crash when a completion
10131 candidate is selected by the mouse, and that candidate has a
10132 composed character under the mouse.
10133
1a2e6670
EZ
10134 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
10135 coordinates reported by pos-visible-in-window-p for a composed
10136 character in column zero.
10137
8b76d6f8
SM
101382011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
10139
10140 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
10141
dac347dd
EZ
101422011-08-22 Eli Zaretskii <eliz@gnu.org>
10143
10144 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
10145 consider it a hit if to_charpos is anywhere in the range of the
10146 composed buffer positions.
10147
e013fb34
CY
101482011-08-22 Chong Yidong <cyd@stupidchicken.com>
10149
10150 * image.c (gif_load): Don't assume that each subimage has the same
10151 dimensions as the base image. Handle disposal method that is
10152 "undefined" by the gif spec (Bug#9335).
10153
bd1ba3e8
CY
101542011-08-20 Chong Yidong <cyd@stupidchicken.com>
10155
10156 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 10157 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 10158
54a1215b
EZ
101592011-08-19 Eli Zaretskii <eliz@gnu.org>
10160
823564e5
EZ
10161 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
10162 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
10163 from an Org mode buffer to a Speedbar frame.
10164
54a1215b
EZ
10165 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
10166 a composition, take its buffer position from IT->cmp_it.charpos.
10167 Fixes cursor positioning at the beginning of a line that begins
10168 with a composed character.
10169
9778ebcc
EZ
101702011-08-18 Eli Zaretskii <eliz@gnu.org>
10171
0be6ee06
EZ
10172 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
10173 character bidirectional type, use STRONG_L instead. Fixes crashes
10174 in a buffer produced by `describe-categories'.
10175
9778ebcc
EZ
10176 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
10177 members before the level stack, so they would be saved and
10178 restored when copying iterator state. Fixes incorrect reordering
10179 around TABs covered by display properties.
10180
156bffbe
AS
101812011-08-18 Andreas Schwab <schwab@linux-m68k.org>
10182
6b02f655 10183 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 10184
72ad093b
CY
101852011-08-17 Chong Yidong <cyd@stupidchicken.com>
10186
10187 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
10188 (internal_condition_case_2, internal_condition_case_n):
10189 Remove unnecessary aborts (Bug#9081).
72ad093b 10190
35774242
EZ
101912011-08-17 Eli Zaretskii <eliz@gnu.org>
10192
10193 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
10194 has no `load' handler, try opening the file locally. (Bug#9311)
10195
db76dd85
KB
101962011-08-16 Ken Brown <kbrown@cornell.edu>
10197
10198 * gmalloc.c: Expand comment.
10199
b215eee5
EZ
102002011-08-16 Eli Zaretskii <eliz@gnu.org>
10201
10202 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
10203 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
10204
a4579d33
KB
102052011-08-16 Ken Brown <kbrown@cornell.edu>
10206
10207 Fix memory allocation problems in Cygwin build (Bug#9273).
10208
10209 * unexcw.c ( __malloc_initialized): Declare external variable.
10210 (fixup_executable): Force the dumped emacs to reinitialize malloc.
10211
8b76d6f8
SM
10212 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
10213 New variables.
a4579d33
KB
10214 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
10215 dumped emacs.
10216 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
10217 in the static heap.
10218 [CYGWIN] (special_realloc): New function.
10219 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
10220 requests to realloc storage in the static heap.
10221
3ebec551
PE
102222011-08-15 Paul Eggert <eggert@cs.ucla.edu>
10223
10224 * bidi.c (bidi_initialize): Remove unused local.
10225
9fd8be00
EZ
102262011-08-15 Eli Zaretskii <eliz@gnu.org>
10227
6b02f655
SM
10228 * bidimirror.h:
10229 * biditype.h: Remove file.
10230 * makefile.w32-in ($(BLD)/bidi.$(O)):
10231 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
10232
10233 * dispextern.h: Fix a typo in the comment to bidi_type_t.
10234
10235 * chartab.c: Improve commentary for the uniprop_table API.
10236
32413314
EZ
10237 * bidi.c (bidi_paragraph_init): Support zero value of
10238 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
10239 (bidi_initialize): Use uniprop_table instead of including
10240 biditype.h and bidimirror.h.
32413314 10241
9fd8be00
EZ
10242 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
10243 coordinates of the iterator when restoring from ppos_it.
10244 (Bug#9296)
10245
5cf2b69b
KH
102462011-08-14 Kenichi Handa <handa@m17n.org>
10247
10248 * process.c (create_process): Call setup_process_coding_systems
72ad093b 10249 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 10250
daf17d00
EZ
102512011-08-14 Eli Zaretskii <eliz@gnu.org>
10252
10253 * xdisp.c (move_it_in_display_line_to): Don't invoke
10254 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
10255 ppos_it. Fixes vertical cursor motion when line beginning is
10256 covered by an image. (Bug#9296)
10257
08e3161a
JD
102582011-08-14 Jan Djärv <jan.h.d@swipnet.se>
10259
10260 * nsterm.h (ns_run_ascript): Declare.
10261 (NSAPP_DATA2_RUNASSCRIPT): Define.
10262
10263 * nsfns.m (as_script, as_result, as_status): New static variables.
10264 (ns_run_ascript): New function.
5e617bc2 10265 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
10266 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
10267 the event loop. Get status from as_status (Bug#7276).
10268
10269 * nsterm.m (sendEvent): If event is NSApplicationDefined and
10270 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
10271 the event loop (Bug#7276).
10272
a3720aa2
AS
102732011-08-14 Andreas Schwab <schwab@linux-m68k.org>
10274
10275 * gnutls.c (QCgnutls_bootprop_priority)
10276 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
10277 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
10278 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
10279 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
10280 (QCgnutls_bootprop_verify_hostname_error)
10281 (QCgnutls_bootprop_callbacks_verify): Rename from
10282 Qgnutls_bootprop_..., all uses changed.
10283
10284 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
10285 uses changed.
10286
0a0d27fb
PE
102872011-08-14 Paul Eggert <eggert@cs.ucla.edu>
10288
19d5c50c
PE
10289 * xfaces.c (Qframe_set_background_mode): Now static.
10290 * dispextern.h (Qframe_set_background_mode): Remove decl.
10291
0a0d27fb
PE
10292 * process.c (Fnetwork_interface_info): Declare local only if needed.
10293
377538cb
JD
102942011-08-13 Jan Djärv <jan.h.d@swipnet.se>
10295
10296 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
10297 (Fnetwork_interface_list): Allocate in increments of bytes instead
10298 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
10299 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
10300 sockaddr.
10301 (struct ifflag_def): notrailers is smart on OSX.
10302 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
10303 Get hardware address with getifaddrs if available.
10304
08fff70c
EZ
103052011-08-12 Eli Zaretskii <eliz@gnu.org>
10306
10307 * xdisp.c (iterate_out_of_display_property): xassert that
10308 IT->position is set to within IT->object's boundaries. Break from
10309 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
10310 when IT->position is set up wrongly due to some bug.
10311 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
10312 (push_display_prop): Allow GET_FROM_STRING as IT->method on
10313 entry. Force push_it to save on the stack the current
10314 buffer/string position, to be restored by pop_it. Fix flags in
10315 the iterator structure wrt the object coming from a display
10316 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
10317 properties. (Bug#9284)
10318
7be1c708 103192011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 10320
7be1c708
CY
10321 * fontset.c (fontset_get_font_group): Add proper type checks.
10322 (Bug#9172)
aac0c6e3 10323
7be1c708 103242011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 10325
7be1c708
CY
10326 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
10327 and LC_VERSION_MIN_MACOSX.
10328 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
10329 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 10330
97bb72a6
EZ
103312011-08-08 Eli Zaretskii <eliz@gnu.org>
10332
10333 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
10334 no-display-properties-and-no-overlays under bidi display.
10335 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 10336 properties and overlays.
97bb72a6 10337
d5617611
CY
103382011-08-08 Chong Yidong <cyd@stupidchicken.com>
10339
37e11a63
CY
10340 * editfns.c (Fset_time_zone_rule): Document relationship with the
10341 setenv function.
10342
d5617611
CY
10343 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
10344 the font entity extracted from the cache (Bug#8109).
10345
58872834
CY
103462011-08-07 Chong Yidong <cyd@stupidchicken.com>
10347
10348 * composite.c (autocmp_chars): Don't reset point. That is done by
10349 restore_point_unwind (Bug#5984).
10350
75bfc667
JL
103512011-08-07 Juri Linkov <juri@jurta.org>
10352
10353 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
10354 to show the arg `TIME' instead of `TIMEVAL'.
10355
d1410150
EZ
103562011-08-06 Eli Zaretskii <eliz@gnu.org>
10357
10358 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
10359 display property strides EOL and includes a newline, as in
10360 longlines-mode. (Bug#9254)
75b771e4
EZ
10361 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
10362 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
10363
10364 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
10365 is non-zero, even if the data buffer is NULL. Fixes a crash in
10366 vertical-motion with longlines-mode. (Bug#9254)
10367
35928349
EZ
103682011-08-05 Eli Zaretskii <eliz@gnu.org>
10369
ec7cc85b
EZ
10370 * bidi.c <bidi_cache_total_alloc>: Now static.
10371 (bidi_initialize): Initialize bidi_cache_total_alloc.
10372
8b76d6f8 10373 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
10374 cache. (Bug#9221)
10375
10376 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
10377 amount allocated this far in `bidi_cache_total_alloc'.
10378 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
10379 non-zero, only free the data buffer without restoring the cache
10380 contents. All callers changed.
10381
10382 * dispextern.h (bidi_unshelve_cache): Update prototype.
10383
10384 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
10385 (move_it_in_display_line, move_it_to)
10386 (move_it_vertically_backward, move_it_by_lines): Replace the call
10387 to xfree to an equivalent call to bidi_unshelve_cache.
10388 (move_it_in_display_line_to): Fix logic of returning
412b6358 10389 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 10390
e2e2423b
EZ
103912011-08-05 Eli Zaretskii <eliz@gnu.org>
10392
10393 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
10394 came from a string character with a `cursor' property. (Bug#9229)
10395
ae9e757a
JD
103962011-08-04 Jan Djärv <jan.h.d@swipnet.se>
10397
10398 * Makefile.in (LIB_PTHREAD): New variable.
10399 (LIBES): Add LIB_PTHREAD (Bug#9216).
10400
10401 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
10402 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
10403
213bd7f2
AS
104042011-08-04 Andreas Schwab <schwab@linux-m68k.org>
10405
6b02f655 10406 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 10407
99aaf75f
JD
104082011-08-04 Jan Djärv <jan.h.d@swipnet.se>
10409
10410 * xterm.c (x_find_topmost_parent): New function.
10411 (x_set_frame_alpha): Find topmost parent window with
10412 x_find_topmost_parent and set the property there also (bug#9181).
10413 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
10414
c74e9d86
PE
104152011-08-04 Paul Eggert <eggert@cs.ucla.edu>
10416
10417 * callproc.c (Fcall_process): Avoid vfork clobbering
10418 the local vars buffer, coding_systems, current_dir.
10419
640c8776
SM
104202011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
10421
10422 * keymap.c (Fmake_composed_keymap): Move to subr.el.
10423
f26d0e4c
PE
104242011-08-03 Paul Eggert <eggert@cs.ucla.edu>
10425
8a10d76c
PE
10426 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
10427 so that it is not optimized away.
10428
f26d0e4c
PE
10429 * xdisp.c (compute_display_string_pos): Remove unused local.
10430
55439c61
EZ
104312011-08-02 Eli Zaretskii <eliz@gnu.org>
10432
10433 Fix slow cursor motion and scrolling in large buffers with
10434 selective display, like Org Mode buffers. (Bug#9218)
10435
10436 * dispextern.h (struct bidi_it): New member disp_prop_p.
10437
10438 * xdisp.c: Remove one-slot cache of display string positions.
10439 (compute_display_string_pos): Accept an additional argument
5e617bc2 10440 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
10441 for a display string or property. If found, set DISP_PROP_P
10442 non-zero.
10443
10444 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
10445 DISP_PROP_P, and pass it to compute_display_string_pos.
10446 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
10447 non-zero. All callers of bidi_fetch_char changed.
10448
fb33fa43
SM
104492011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
10450
10451 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
10452
b099e063
DM
104532010-12-03 Don March <don@ohspite.net>
10454
10455 * keymap.c (Fdefine_key): Fix non-prefix key error message when
10456 last character M-[char] is translated to ESC [char] (bug#7541).
10457
5cc7f7af
KH
104582011-08-02 Kenichi Handa <handa@m17n.org>
10459
d0fffa3f 10460 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
10461
10462 * chartab.c (uniprop_table): Make it non-static.
10463
525d5e6e
EZ
104642011-08-01 Eli Zaretskii <eliz@gnu.org>
10465
10466 * xdisp.c (forward_to_next_line_start): Accept additional argument
10467 BIDI_IT_PREV, and store into it the state of the bidi iterator had
10468 on the newline.
10469 (reseat_at_next_visible_line_start): Use the bidi iterator state
10470 returned by forward_to_next_line_start to restore the state of
10471 it->bidi_it after backing up to previous newline. (Bug#9212)
10472
31011111
AS
104732011-07-30 Andreas Schwab <schwab@linux-m68k.org>
10474
10475 * regex.c (re_comp): Protoize.
10476 (re_exec): Fix return type.
10477 (regexec): Fix type of `ret'. (Bug#9203)
10478
476371c4
PE
104792011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10480
e5d76069
PE
10481 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
10482 This is needed if max-image-size is a floating-point number.
10483
9a79b20c
AS
104842011-07-28 Andreas Schwab <schwab@linux-m68k.org>
10485
10486 * print.c (print_object): Print empty symbol as ##.
10487
10488 * lread.c (read1): Read ## as empty symbol.
10489
d8c2fa78
AA
104902011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
10491
10492 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
10493 setting frame foreground color (Bug#9175).
10494 (x_set_background_color): Likewise.
10495
ffe57a7a
AA
10496 * nsmenu.m (-setText): Size tooltip dimensions precisely to
10497 contents (Bug#9176).
10498 (EmacsTooltip -init): Remove bezels and add shadows to
10499 tooltip windows.
10500
bf3492a5
AA
10501 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
10502 or scroll bar (Bug#8470).
10503
d55e9c53
AA
10504 * nsfont.m (nsfont_open): Remove assignment to voffset and
10505 unnecessary vars hshink, expand, hd, full_height, min_height.
10506 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
10507
10508 * nsterm.h (nsfont_info): Remove voffset field.
10509
d8c2fa78 105102011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
10511
10512 Implement strike-through and overline on NextStep (Bug#8863).
10513
10514 * nsfont.m (nsfont_open): Use underline position provided by font,
10515 instead of hard-coded value of 2.
10516 (nsfont_draw): Call ns_draw_text_decoration instead.
10517
10518 * nsterm.h: Add declaration for ns_draw_text_decoration.
10519
10520 * nsterm.m (ns_draw_text_decoration): New function for drawing
10521 underline, overline, and strike-through.
10522 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
10523 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 10524 accommodate underlining, etc.
4843aac3 10525
4cc60b9b
EZ
105262011-07-28 Eli Zaretskii <eliz@gnu.org>
10527
bc7ece87
EZ
10528 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
10529 default.
4cc60b9b 10530
476371c4
PE
105312011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10532
66606eea
PE
10533 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
10534 Without this fix, if a signal arrives just after memory fills up,
10535 'malloc' might be invoked reentrantly.
10536
476371c4
PE
10537 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
10538 In other words, assume that every image size is allowed, on non-X
10539 hosts. This assumption is probably wrong, but it lets Emacs compile.
10540
f3fcc40d
AS
105412011-07-28 Andreas Schwab <schwab@linux-m68k.org>
10542
10543 * regex.c (re_iswctype): Convert return values to boolean.
10544
350c992f
EZ
105452011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
10546
10547 * xdisp.c (compute_display_string_pos): Don't use cached display
10548 string position if the buffer had its restriction changed.
10549 (Bug#9184)
10550
5266b4bb
PE
105512011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10552
10553 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
10554
2573a837 105552011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 10556
41f55ccd 10557 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 10558
39e378da
PE
10559 * bidi.c: Integer size and overflow fixes.
10560 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
10561 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
10562 (bidi_cache_find_level_change, bidi_cache_ensure_space)
10563 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
10564 (bidi_find_other_level_edge):
10565 Use ptrdiff_t instead of EMACS_INT where either will do.
10566 This works better on 32-bit hosts configured --with-wide-int.
10567 (bidi_cache_ensure_space): Check for size-calculation overflow.
10568 Use % rather than repeated addition, for better worst-case speed.
10569 Don't set bidi_cache_size until after xrealloc returns, because it
10570 might not return.
10571 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
10572 (bidi_cache_ensure_space): Also check that the bidi cache size
10573 does not exceed that of the largest Lisp string or buffer. See Eli
10574 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 10575
5e927815
PE
10576 * alloc.c (__malloc_size_t): Remove.
10577 All uses replaced by size_t. See Andreas Schwab's note
10578 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
10579
ca4aa935
PE
10580 * image.c: Improve checking for integer overflow.
10581 (check_image_size): Assume that f is nonnull, since
10582 it is always nonnull in practice. This is one less thing to
10583 worry about when checking for integer overflow later.
10584 (x_check_image_size): New function, which checks for integer
10585 overflow issues inside X.
10586 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
10587 This removes the need for a memory_full check.
10588 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
10589 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
10590 (xbm_read_bitmap_data): Change locals back to 'int', since
10591 their values must fit in 'int'.
10592 (xpm_load_image, png_load, tiff_load):
10593 Invoke x_create_x_image_and_pixmap earlier,
10594 to avoid much needless work if the image is too large.
10595 (tiff_load): Treat overly large images as if
10596 x_create_x_image_and_pixmap failed, not as malloc failures.
10597 (gs_load): Use x_check_image_size.
10598
5f8f9cc2
PE
10599 * gtkutil.c: Omit integer casts.
10600 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
10601 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
10602
5adf60bc
PE
10603 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
10604
c8907a93
PE
10605 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
10606 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
10607 would wrongly return t on a 64-bit host.
10608
e3c25c68
PE
10609 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
10610 The plain *_OVERFLOW macros run afoul of GCC bug 49705
10611 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
10612 and therefore cause GCC to emit a bogus diagnostic in some cases.
10613
3f791afe
PE
10614 * image.c: Integer signedness and overflow and related fixes.
10615 This is not an exhaustive set of fixes, but it's time to
10616 record what I've got.
10617 (lookup_pixel_color, check_image_size): Remove redundant decls.
10618 (check_image_size): Don't assume that arbitrary EMACS_INT values
10619 fit in 'int', or that arbitrary 'double' values fit in 'int'.
10620 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
10621 (tiff_load, imagemagick_load_image):
10622 Check for overflow in size calculations.
10623 (x_create_x_image_and_pixmap): Remove unnecessary test for
10624 xmalloc returning NULL; that can't happen.
10625 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
10626 (xpm_color_bucket): Use better integer hashing function.
10627 (xpm_cache_color): Don't possibly over-allocate memory.
10628 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
10629 (gif_memory_source):
10630 Use ptrdiff_t, not int or size_t, to record sizes.
10631 (png_load): Don't assume values greater than 2**31 fit in 'int'.
10632 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
10633 either works, as we prefer signed integers.
10634 (tiff_read_from_memory, tiff_write_from_memory):
10635 Return tsize_t, not size_t, since that's what the TIFF API wants.
10636 (tiff_read_from_memory): Don't fail simply because the read would
10637 go past EOF; instead, return a short read.
10638 (tiff_load): Omit no-longer-needed casts.
10639 (Fimagemagick_types): Don't assume size fits into 'int'.
10640
3cc5a532
PE
10641 Improve hashing quality when configured --with-wide-int.
10642 * fns.c (hash_string): New function, taken from sxhash_string.
10643 Do not discard information about ASCII character case; this
10644 discarding is no longer needed.
10645 (sxhash-string): Use it. Change sig to match it. Caller changed.
10646 * lisp.h: Declare it.
10647 * lread.c (hash_string): Remove, since we now use fns.c's version.
10648 The fns.c version returns a wider integer if --with-wide-int is
10649 specified, so this should help the quality of the hashing a bit.
10650
b312a492
PE
10651 * emacs.c: Integer overflow minor fix.
10652 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
10653 Define only if GNU_LINUX.
10654 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
10655
dfd153ae
PE
10656 * dispnew.c: Integer signedness and overflow fixes.
10657 Remove unnecessary forward decls, that were a maintenance hassle.
10658 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
10659 All uses changed.
10660 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
10661 (scrolling_window): Use ptrdiff_t, not int, for byte count.
10662 (prepare_desired_row, line_draw_cost):
10663 Use int, not unsigned, where either works.
10664 (save_current_matrix, restore_current_matrix):
10665 Use ptrdiff_t, not size_t, where either works.
10666 (init_display): Check for overflow more accurately, and without
10667 relying on undefined behavior.
10668
a81d11a3
PE
10669 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
10670 Remove, replacing with the new symbols in lisp.h. All uses changed.
10671 * fileio.c (make_temp_name):
10672 * filelock.c (lock_file_1, lock_file):
10673 * xdisp.c (message_dolog):
10674 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
10675 Use pMd etc. instead.
10676 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
10677 replacing the pWIDE etc. symbols removed from editfns.c.
10678
3300e6fd
PE
10679 * keyboard.h (num_input_events): Now uintmax_t.
10680 This is (very slightly) less likely to mess up due to wraparound.
10681 All uses changed.
10682
fd05c7e9
PE
10683 * buffer.c: Integer signedness fixes.
10684 (alloc_buffer_text, enlarge_buffer_text):
10685 Use ptrdiff_t rather than size_t when either will do, as we prefer
10686 signed integers.
10687
903fe15d
PE
10688 * alloc.c: Integer signedness and overflow fixes.
10689 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
10690 (__malloc_size_t): Default to size_t, not to int.
10691 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
10692 (Fgarbage_collect, mark_object_loop_halt, mark_object):
10693 Prefer ptrdiff_t to size_t when either would do, as we prefer
10694 signed integers.
10695 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
10696 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
10697 Now const. Initialize with values that are in range even if char
10698 is signed.
10699 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
10700 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
10701 These functions do the right thing with sizes > 2**32.
10702 (check_depth): Now ptrdiff_t, not int.
10703 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
10704 Adjust to new way of storing sizes. Check for size overflow bugs
10705 in rest of code.
10706 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
10707 slightly wrong anyway, as it missed one instance of
10708 XMALLOC_OVERRUN_CHECK_OVERHEAD.
10709 (refill_memory_reserve): Omit needless cast to size_t.
10710 (mark_object_loop_halt): Mark as externally visible.
10711
ac82cc6a
PE
10712 * xselect.c: Integer signedness and overflow fixes.
10713 (Fx_register_dnd_atom, x_handle_dnd_message):
10714 Use ptrdiff_t, not size_t, since we prefer signed.
10715 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
10716 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
10717 x_dnd_atoms_size and x_dnd_atoms_length.
10718
c2d1e36d
PE
10719 * doprnt.c: Prefer signed to unsigned when either works.
10720 * eval.c (verror):
10721 * doprnt.c (doprnt):
10722 * lisp.h (doprnt):
10723 * xdisp.c (vmessage):
10724 Use ptrdiff_t, not size_t, when using or implementing doprnt,
10725 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
10726 prefer signed arithmetic to avoid comparison confusion.
10727 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
10728 but is a bit tricky.
10729
0e926e56
PE
10730 Assume freestanding C89 headers, string.h, stdlib.h.
10731 * data.c, doprnt.c, floatfns.c, print.c:
10732 Include float.h unconditionally.
10733 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
10734 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
10735 * regex.c: Likewise for stddef.h, string.h.
10736 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
10737 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
10738 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
10739 (STDC_HEADERS): Remove obsolete defines.
10740 * sysdep.c: Include limits.h unconditionally.
10741
9cfdb3ec
PE
10742 Assume support for memcmp, memcpy, memmove, memset.
10743 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
10744 * regex.c (memcmp, memcpy):
10745 Remove; we assume C89 now.
10746
10747 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
10748 (__malloc_safe_bcopy): Remove; no longer needed.
10749
cf950e6b 10750 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
10751 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
10752 well either way, and we prefer signed to unsigned.
10753
dbf38e02
LMI
107542011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
10755
10756 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
10757 closes the connection while we're reading (bug#9182).
10758
d6f0886c 107592011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 10760
d6f0886c
JD
10761 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
10762 are specified (Bug#9168).
24e0f6b1 10763
2eb1f9e6
PE
107642011-07-25 Paul Eggert <eggert@cs.ucla.edu>
10765
10766 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
10767 Found by GCC static checking and --with-wide-int on a 32-bit host.
10768
22381272 107692011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
10770
10771 * xdisp.c (compute_display_string_pos): Fix logic of caching
10772 previous display string position. Initialize cached_prev_pos to
10773 -1. Fixes slow-down at the beginning of a buffer.
10774
f25e39b4
EZ
107752011-07-24 Eli Zaretskii <eliz@gnu.org>
10776
10777 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
10778 for attrs[LFACE_FONTSET_INDEX].
10779
04c4b52e
PE
107802011-07-23 Paul Eggert <eggert@cs.ucla.edu>
10781
10782 * xml.c (parse_region): Remove unused local
10783 that was recently introduced.
10784
c1734fbd
EZ
107852011-07-23 Eli Zaretskii <eliz@gnu.org>
10786
be18c5a5
EZ
10787 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
10788 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
10789
c1734fbd
EZ
10790 * xdisp.c (move_it_in_display_line_to): Record the best matching
10791 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
10792 exit if none of the characters scanned was an exact match.
10793 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
10794 when exact match is impossible due to invisible text, and the
10795 lines are truncated.
10796
a258d627
JD
107972011-07-23 Jan Djärv <jan.h.d@swipnet.se>
10798
10799 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
10800 for OSX >= 10.7.
10801
b6d5a689
EZ
108022011-07-22 Eli Zaretskii <eliz@gnu.org>
10803
0f74f785
EZ
10804 Fix a significant slow-down of cursor motion with C-n, C-p,
10805 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
10806 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 10807 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
10808 (next_element_from_buffer): Call compute_stop_pos_backwards to
10809 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
10810 base_level_stop.
10811 (reseat): Don't look for prev_stop, as that could mean a very long
10812 run.
10813 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
10814 <cached_disp_overlay_modiff>: Cache for last found display string
10815 position.
551918c1 10816 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
10817 about the same buffer in the same area of character positions, and
10818 the buffer wasn't changed since the time the display string
10819 position was cached.
551918c1 10820
b2d0c91a
EZ
108212011-07-22 Eli Zaretskii <eliz@gnu.org>
10822
10823 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
10824 is an integer, which is important for empty lines. (Bug#9149)
10825
043604ee
CY
108262011-07-22 Chong Yidong <cyd@stupidchicken.com>
10827
10828 * frame.c (Fmodify_frame_parameters): In tty case, update the
10829 default face if necessary (Bug#4238).
10830
da4adb04
CY
108312011-07-21 Chong Yidong <cyd@stupidchicken.com>
10832
10833 * editfns.c (Fstring_to_char): No need to explain what a character
10834 is in the docstring (Bug#6576).
10835
9abd0532
LMI
108362011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10837
10838 * xml.c (parse_region): Make sure we always return a tree.
10839
36881d16
HK
108402011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
10841
10842 * xml.c (parse_region): If a document contains only comments,
10843 return that, too.
10844
1e98674d
LMI
108452011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10846
10847 * xml.c (make_dom): Return comments, too.
10848
590bd467
PE
108492011-07-19 Paul Eggert <eggert@cs.ucla.edu>
10850
10851 Port to OpenBSD.
10852 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
10853 and the surrounding thread.
10854 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
10855 rather than fgets, and retry after EINTR. Otherwise, 'emacs
10856 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
10857 timer goes off.
10858 * s/openbsd.h (BROKEN_SIGIO): Define.
10859 * unexelf.c (unexec) [__OpenBSD__]:
10860 Don't update the .mdebug section of the Alpha COFF symbol table.
10861
f41628b2
LMI
108622011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10863
10864 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
10865 (bug#8460).
10866
b59b67c5
PE
108672011-07-18 Paul Eggert <eggert@cs.ucla.edu>
10868
15e3a074
PE
10869 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
10870 This fixes some race conditions on the permissions of any newly
10871 created file.
10872
41bed37d
PE
10873 * alloc.c (valid_pointer_p): Use pipe, not open.
10874 This fixes some permissions issues when debugging.
10875
b59b67c5
PE
10876 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
10877 If fchown fails to set both uid and gid, try to set just gid,
10878 as that is sometimes allowed. Adjust the file's mode to eliminate
10879 setuid or setgid bits that are inappropriate if fchown fails.
10880
925a6be7
SM
108812011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10882
10883 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
10884 to compare Lisp_Objects.
10885 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
10886 global_gnutls_log_level, don't mistake it for a Lisp_Object.
10887 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
10888
52968808
AS
108892011-07-17 Andreas Schwab <schwab@linux-m68k.org>
10890
0a6a104b
AS
10891 * lread.c (read_integer): Unread even EOF character.
10892 (read1): Likewise. Properly record start position of symbol.
10893
52968808
AS
10894 * lread.c (read1): Read `#:' as empty uninterned symbol if no
10895 symbol character follows.
10896
9e381cdd
PE
108972011-07-17 Paul Eggert <eggert@cs.ucla.edu>
10898
10899 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
10900 This works around a problem with the previous change to Fcopy_file.
10901 Recent glibc declares fchown with __attribute__((warn_unused_result)),
10902 and without this change, GCC might complain about discarding
10903 fchown's return value.
10904
b5641435
JB
109052011-07-16 Juanma Barranquero <lekktu@gmail.com>
10906
10907 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
10908
a8031457
PE
109092011-07-16 Paul Eggert <eggert@cs.ucla.edu>
10910
10911 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
10912
dd889327
LMI
109132011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
10914
750c33f7
LMI
10915 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
10916 it's used from the C level.
10917
dd889327
LMI
10918 * process.c: Use the same condition for POLL_FOR_INPUT in both
10919 keyboard.c and process.c (bug#1858).
10920
87e86684
LM
109212011-07-09 Lawrence Mitchell <wence@gmx.li>
10922
10923 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
10924 (Fgnutls_boot): Use it.
10925
64348f40
AS
109262011-07-15 Andreas Schwab <schwab@linux-m68k.org>
10927
10928 * doc.c (Fsubstitute_command_keys): Revert last change.
10929
1d698799
LMI
109302011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
10931
f863868c
LMI
10932 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
10933 quotes the next character, and doesn't affect other longer
10934 sequences (bug#8935).
10935
1d698799
LMI
10936 * lread.c (syms_of_lread): Clarify that is isn't only
10937 `eval-buffer' and `eval-defun' that's affected by
10938 `lexical-binding' (bug#8460).
10939
aa4b6df6
EZ
109402011-07-15 Eli Zaretskii <eliz@gnu.org>
10941
10942 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 10943 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 10944
5d856da6
PE
109452011-07-14 Paul Eggert <eggert@cs.ucla.edu>
10946
ad6042bb
PE
10947 Fix minor problems found by static checking.
10948 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
10949 (elsz): Now a signed constant, not a size_t var. We prefer signed
10950 types to unsigned, to avoid integer comparison confusion. Without
10951 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
10952 "cannot optimize loop, the loop counter may overflow", a symptom
10953 of the confusion.
f00bbb22 10954 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
10955 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
10956
6468f31c
LMI
109572011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
10958
49080b10
LMI
10959 * search.c (Fre_search_backward): Mention `case-fold-search' in
10960 all the re_search_* functions (bug#8138).
10961
6468f31c
LMI
10962 * keyboard.c (Fopen_dribble_file): Document when the file is
10963 closed (bug#8056).
10964
c965adc5
EZ
109652011-07-14 Eli Zaretskii <eliz@gnu.org>
10966
df9733bf
EZ
10967 * bidi.c (bidi_dump_cached_states): Fix format of displaying
10968 bidi_cache_idx.
10969
0bb23927
EZ
10970 Support bidi reordering of display and overlay strings.
10971 * xdisp.c (compute_display_string_pos)
10972 (compute_display_string_end): Accept additional argument STRING.
10973 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
10974 (reseat_to_string): Initialize bidi_it->string.s and
10975 bidi_it->string.schars.
10976 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
10977 NULL (avoids a crash in bidi_paragraph_init).
10978 Initialize itb.string.lstring.
0bb23927
EZ
10979 (init_iterator): Call bidi_init_it only of a valid
10980 buffer position was specified. Initialize paragraph_embedding to
10981 L2R.
10982 (reseat_to_string): Initialize the bidi iterator.
10983 (display_string): If we need to ignore text properties of
10984 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
10985 original value of -1 will not work with bidi.)
10986 (compute_display_string_pos): First arg is now struct
10987 `text_pos *'; all callers changed. Support display properties on
10988 Lisp strings.
10989 (compute_display_string_end): Support display properties on Lisp
10990 strings.
10991 (init_iterator, reseat_1, reseat_to_string): Initialize the
10992 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
10993 when iterating on a string not from display properties).
640c8776
SM
10994 (compute_display_string_pos, compute_display_string_end):
10995 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
10996 arrow keys.
10997 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
10998 base_level_stop; instead, set base_level_stop to BEGV.
10999 Fixes crashes in vertical-motion.
0bb23927
EZ
11000 (next_element_from_buffer): Improve commentary for when
11001 the iterator is before prev_stop.
11002 (init_iterator): Initialize bidi_p from the default value of
11003 bidi-display-reordering, not from buffer-local value. Use the
11004 buffer-local value only if initializing for buffer iteration.
11005 (handle_invisible_prop): Support invisible properties on strings
11006 that are being bidi-reordered.
11007 (set_iterator_to_next): Support bidi reordering of C strings and
11008 Lisp strings.
11009 (next_element_from_string): Support bidi reordering of Lisp
11010 strings.
11011 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
11012 (display_string): Support display of R2L glyph rows.
11013 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
11014 (init_iterator): Don't initialize it->bidi_p for strings
11015 here.
11016 (reseat_to_string): Initialize it->bidi_p for strings here.
11017 (next_element_from_string, next_element_from_c_string)
11018 (next_element_from_buffer): Add xassert's for correspondence
11019 between IT's object being iterated and it->bidi_it.string
11020 structure.
11021 (face_before_or_after_it_pos): Support bidi iteration.
11022 (next_element_from_c_string): Handle the case of the first string
11023 character that is not the first one in the visual order.
11024 (get_visually_first_element): New function, refactored from common
11025 parts of next_element_from_buffer, next_element_from_string, and
11026 next_element_from_c_string.
11027 (tool_bar_lines_needed, redisplay_tool_bar)
11028 (display_menu_bar): Force left-to-right direction. Add a FIXME
11029 comment for making that be controlled by a user option.
11030 (push_it, pop_it): Save and restore the state of the
11031 bidi iterator. Save and restore the bidi_p flag.
11032 (pop_it): Iterate out of display property for string iteration as
11033 well.
11034 (iterate_out_of_display_property): Support iteration over strings.
11035 (handle_single_display_spec): Set up it->bidi_it for iteration
11036 over a display string, and call bidi_init_it.
11037 (handle_single_display_spec, next_overlay_string)
11038 (get_overlay_strings_1, push_display_prop): Set up the bidi
11039 iterator for displaying display or overlay strings.
11040 (forward_to_next_line_start): Don't use the shortcut if
11041 bidi-iterating.
11042 (back_to_previous_visible_line_start): If handle_display_prop
11043 pushed the iterator stack, restore the internal state of the bidi
11044 iterator by calling bidi_pop_it same number of times.
11045 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
11046 and we are bidi-iterating, don't decrement the iterator position;
11047 instead, set the first_elt flag in the bidi iterator, to produce
11048 the same effect.
11049 (reseat_1): Remove redundant setting of string_from_display_prop_p.
11050 (push_display_prop): xassert that we are iterating a buffer.
11051 (push_it, pop_it): Save and restore paragraph_embedding member.
11052 (handle_single_display_spec, next_overlay_string)
11053 (get_overlay_strings_1, reseat_1, reseat_to_string)
11054 (push_display_prop): Set up the `unibyte' member of bidi_it.string
11055 correctly. Don't assume unibyte strings are not bidi-reordered.
11056 (compute_display_string_pos)
11057 (compute_display_string_end): Fix handling the case of C string.
11058 (push_it, pop_it): Save and restore from_disp_prop_p.
11059 (handle_single_display_spec, push_display_prop): Set the
11060 from_disp_prop_p flag.
11061 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
11062 (pop_it): Call iterate_out_of_display_property only if we are
11063 popping after iteration over a string that came from a display
11064 property. Fix a typo in popping stretch info. Add an assertion
11065 for verifying that the iterator position is in sync with the bidi
11066 iterator.
11067 (handle_single_display_spec, get_overlay_strings_1)
11068 (push_display_prop): Fix initialization of paragraph direction for
11069 string when that of the parent object is not yet determined.
11070 (reseat_1): Call bidi_init_it to resync the bidi
11071 iterator with IT's position. (Bug#7616)
11072 (find_row_edges): If ROW->start.pos gives position
11073 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
11074 (handle_stop, back_to_previous_visible_line_start, reseat_1):
11075 Reset the from_disp_prop_p flag.
11076 (SAVE_IT, RESTORE_IT): New macros.
11077 (pos_visible_p, face_before_or_after_it_pos)
11078 (back_to_previous_visible_line_start)
11079 (move_it_in_display_line_to, move_it_in_display_line)
11080 (move_it_to, move_it_vertically_backward, move_it_by_lines)
11081 (try_scrolling, redisplay_window, display_line): Use them when
11082 saving a temporary copy of the iterator and restoring it back.
11083 (back_to_previous_visible_line_start, reseat_1)
11084 (init_iterator): Empty the bidi cache "stack".
11085 (move_it_in_display_line_to): If iterator ended up at
11086 EOL, but we never saw any buffer positions smaller than
11087 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
11088 motion in bidi-reordered lines.
11089 (move_it_in_display_line_to): Record prev_method and prev_pos
11090 immediately before the call to set_iterator_to_next. Fixes cursor
11091 motion in bidi-reordered lines with stretch glyphs and strings
11092 displayed in margins. (Bug#8133) (Bug#8867)
11093 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
11094 TO_CHARPOS.
640c8776
SM
11095 (pos_visible_p): Support positions in bidi-reordered lines.
11096 Save and restore bidi cache.
0bb23927
EZ
11097
11098 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
11099 (bidi_paragraph_info): Delete unused struct.
11100 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
11101 (bidi_cache_start): New variable.
11102 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
11103 to zero.
11104 (bidi_cache_fetch_state, bidi_cache_search)
11105 (bidi_cache_find_level_change, bidi_cache_iterator_state)
11106 (bidi_cache_find, bidi_peek_at_next_level)
11107 (bidi_level_of_next_char, bidi_find_other_level_edge)
11108 (bidi_move_to_visually_next): Compare cache index with
11109 bidi_cache_start rather than with zero.
11110 (bidi_fetch_char): Accept new argument STRING; all callers
11111 changed. Support iteration over a string. Support strings with
11112 display properties. Support unibyte strings. Fix the type of
11113 `len' according to what STRING_CHAR_AND_LENGTH expects.
11114 (bidi_paragraph_init, bidi_resolve_explicit_1)
11115 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
11116 (bidi_level_of_next_char, bidi_move_to_visually_next):
11117 Support iteration over a string.
0bb23927
EZ
11118 (bidi_set_sor_type, bidi_resolve_explicit_1)
11119 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
11120 can now be zero (for strings); special values 0 and -1 were
11121 changed to -1 and -2, respectively.
11122 (bidi_char_at_pos): New function.
11123 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
11124 Call it instead of FETCH_MULTIBYTE_CHAR.
11125 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
11126 initialized to valid values.
11127 (bidi_init_it): Don't initialize charpos and bytepos with invalid
11128 values.
11129 (bidi_level_of_next_char): Allow the sentinel "position" to pass
11130 the test for valid cached positions. Fix the logic for looking up
11131 the sentinel state in the cache. GCPRO the Lisp string we are
11132 iterating.
11133 (bidi_push_it, bidi_pop_it): New functions.
11134 (bidi_initialize): Initialize the bidi cache start stack pointer.
11135 (bidi_cache_ensure_space): New function, refactored from part of
11136 bidi_cache_iterator_state. Don't assume the required size is just
11137 one BIDI_CACHE_CHUNK away.
11138 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
11139 (bidi_count_bytes, bidi_char_at_pos): New functions.
11140 (bidi_cache_search): Don't assume bidi_cache_last_idx is
11141 always valid if bidi_cache_idx is valid.
11142 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
11143 is valid if it's going to be used.
11144 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
11145 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
11146 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11147 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
11148 (bidi_find_other_level_edge, bidi_cache_start_stack):
11149 All variables related to cache indices are now EMACS_INT.
c965adc5 11150
0bb23927
EZ
11151 * dispextern.h (struct bidi_string_data): New structure.
11152 (struct bidi_it): New member `string'. Make flag members be 1-bit
11153 fields, and put them last in the struct.
640c8776
SM
11154 (compute_display_string_pos, compute_display_string_end):
11155 Update prototypes.
0bb23927
EZ
11156 (bidi_push_it, bidi_pop_it): Add prototypes.
11157 (struct iterator_stack_entry): New members bidi_p,
11158 paragraph_embedding, and from_disp_prop_p.
11159 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
11160 (bidi_shelve_cache, bidi_unshelve_cache):
11161 Declare prototypes.
0bb23927
EZ
11162
11163 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
11164 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
11165 and vector-like objects.
11166
11167 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
11168 cache around display iteration.
11169
11170 * window.c (Fwindow_end, window_scroll_pixel_based)
11171 (displayed_window_lines, Frecenter): Save and restore the bidi
11172 cache around display iteration.
11173
3bbd2265
LMI
111742011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11175
11176 * editfns.c (Fdelete_region): Clarify the use of the named
11177 parameters (bug#6788).
11178
adc47434
MR
111792011-07-14 Martin Rudalics <rudalics@gmx.at>
11180
11181 * indent.c (Fvertical_motion): Set and restore w->pointm when
11182 saving and restoring the window's buffer (Bug#9006).
11183
837c31f8
LMI
111842011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
11185
11186 * editfns.c (Fstring_to_char): Clarify just what is returned
11187 (bug#6576). Text by Eli Zaretskii.
11188
ac389d0c
JB
111892011-07-13 Juanma Barranquero <lekktu@gmail.com>
11190
11191 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
11192
0be0ce47
EZ
111932011-07-13 Eli Zaretskii <eliz@gnu.org>
11194
11195 * buffer.c (mmap_find): Fix a typo.
11196
cd18e7e3
JB
111972011-07-13 Johan Bockgård <bojohan@gnu.org>
11198
11199 Fix execution of x selection hooks.
11200 * xselect.c (Qx_lost_selection_functions)
11201 (Qx_sent_selection_functions): New vars.
11202 (syms_of_xselect): DEFSYM them.
11203 (x_handle_selection_request): Pass Qx_sent_selection_functions
11204 rather than Vx_sent_selection_functions to Frun_hook_with_args.
11205 (x_handle_selection_clear,x_clear_frame_selections):
11206 Pass Qx_lost_selection_functions rather than
11207 Vx_lost_selection_functions to Frun_hook_with_args.
11208
47ea7f44
PE
112092011-07-13 Paul Eggert <eggert@cs.ucla.edu>
11210
ac389d0c 11211 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
11212 The old code sometimes used this field without initializing it.
11213
47ea7f44
PE
11214 * alloc.c (gc_sweep): Don't read past end of array.
11215 In theory, the old code could also have corrupted Emacs internals,
11216 though it'd be very unlikely.
11217
bc985c87
AS
112182011-07-12 Andreas Schwab <schwab@linux-m68k.org>
11219
11220 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 11221 argument. (Bug#4026)
bc985c87 11222
0cf34688
LMI
112232011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
11224
b3dadd76
LMI
11225 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
11226 key" (bug#4257).
11227
0cf34688
LMI
11228 * window.c (Fset_window_start): Doc fix (bug#4199).
11229 (Fset_window_hscroll): Ditto.
11230
270768cd
PE
112312011-07-12 Paul Eggert <eggert@cs.ucla.edu>
11232
077e3dda 11233 Fix minor new problems caught by GCC 4.6.1.
270768cd 11234 * term.c (init_tty): Remove unused local.
490011a6 11235 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 11236 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 11237 not used otherwise.
270768cd 11238
b1f58454
CY
112392011-07-12 Chong Yidong <cyd@stupidchicken.com>
11240
11241 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
11242
22b9578d
LMI
112432011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11244
6e70ab07
LMI
11245 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
11246 are the mini-buffer and the echo area (bug#3320).
11247
22b9578d
LMI
11248 * term.c (init_tty): Remove support for supdup, c10 and perq
11249 terminals, which are no longer supported (bug#1482).
11250
8974cc9f
JB
112512011-07-10 Johan Bockgård <bojohan@gnu.org>
11252
11253 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
11254
a560d974
JD
112552011-07-10 Jan Djärv <jan.h.d@swipnet.se>
11256
11257 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
11258 for non-popups (Bug#3642).
11259
1dae0f0a
AS
112602011-07-10 Andreas Schwab <schwab@linux-m68k.org>
11261
268c2c36 11262 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 11263 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
11264 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
11265 * cm.c (losecursor): Likewise.
1dae0f0a
AS
11266 * data.c (fmod): Likewise.
11267 * dispnew.c (swap_glyphs_in_rows): Likewise.
11268 * emacs.c (memory_warning_signal): Likewise.
11269 * floatfns.c (float_error): Likewise.
11270 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
11271 (otf_open, font_otf_capability, generate_otf_features)
11272 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
11273 Likewise.
11274 * image.c (pbm_read_file): Likewise.
11275 * indent.c (string_display_width): Likewise.
11276 * intervals.c (check_for_interval, search_for_interval)
11277 (inc_interval_count, count_intervals, root_interval)
11278 (adjust_intervals_for_insertion, make_new_interval): Likewise.
11279 * lread.c (defalias): Likewise.
268c2c36 11280 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
11281 * regex.c (set_image_of_range_1, set_image_of_range)
11282 (regex_grow_registers): Likewise.
11283 * sysdep.c (strerror): Likewise.
11284 * termcap.c (valid_filename_p, tprint, main): Likewise.
11285 * tparam.c (main): Likewise.
11286 * unexhp9k800.c (run_time_remap, save_data_space)
11287 (update_file_ptrs, read_header, write_header, calculate_checksum)
11288 (copy_file, copy_rest, display_header): Likewise.
11289 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
11290 Likewise.
11291 * xdisp.c (check_it): Likewise.
11292 * xfaces.c (register_color, unregister_color, unregister_colors):
11293 Likewise.
11294 * xfns.c (print_fontset_result): Likewise.
11295 * xrdb.c (member, fatal, main): Likewise.
11296
99033785
PE
112972011-07-10 Paul Eggert <eggert@cs.ucla.edu>
11298
11299 Fix minor problems found by static checking (Bug#9031).
11300 * chartab.c (char_table_set_range, map_sub_char_table):
11301 Remove unused locals.
11302 (uniprop_table): Now static.
11303 * composite.c (_work_char): Remove unused static var.
11304
9cb2ac56
JB
113052011-07-09 Juanma Barranquero <lekktu@gmail.com>
11306
11307 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
11308
f25661f0
JD
113092011-07-09 Jan Djärv <jan.h.d@swipnet.se>
11310
11311 * gtkutil.c (qttip_cb): Remove code without function.
11312
8278c4fe
EZ
113132011-07-09 Eli Zaretskii <eliz@gnu.org>
11314
11315 * w32.c (pthread_sigmask): New stub.
11316
1692ae2d 113172011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 11318
8a6ebd58 11319 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
11320 sigprocmask is portable only for single-threaded applications, and
11321 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
11322 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
11323 (LIBES): Use it.
11324 * callproc.c (Fcall_process):
11325 * process.c (create_process):
11326 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
11327 Use pthread_sigmask, not sigprocmask.
123403e4 11328
1b854618
JD
113292011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11330
11331 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
11332 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
11333 wrong (Bug#8591).
11334
3fe4b549
JD
113352011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11336
0ce7e563
JD
11337 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
11338 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
11339 (xg_hide_tooltip): Fix comment.
11340
3fe4b549
JD
11341 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
11342 in registerServicesMenuSendTypes.
11343 (validRequestorForSendType): Don't check ns_return_types.
11344
11345 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
11346 ns_return_type.
11347
5df75e47
JR
113482011-07-08 Jason Rumney <jasonr@gnu.org>
11349
22610910
JR
11350 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
11351 SH_SHOW for hidden windows (Bug#5482).
11352
5df75e47
JR
11353 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
11354 frame struct members of non-existent frames (Bug#6284).
11355
699c10bd
JD
113562011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11357
4393663b
JD
11358 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
11359 variable firstTime not needed on OSX >= 10.6.
11360 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
11361 >= 10.5. Use setKnobProportion, setDoubleValue.
11362
11363 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
11364 (MAC_OS_X_VERSION_10_5): Define if not defined.
11365 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
11366 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
11367 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
11368
11369 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 11370 cString and lossyCString on OSX >= 10.4.
4393663b 11371
58179cce 11372 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
11373 sizeToFit on OSX >= 10.2.
11374
11375 * nsimage.m (allocInitFromFile): Don't use deprecated method
11376 bestRepresentationForDevice on OSX >= 10.6.
11377
11378 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
11379 to avoid warning.
11380
11381 * emacs.c: Declare unexec_init_emacs_zone.
11382
a63e0781
JD
11383 * nsgui.h: Fix compiler warning about gnulib redefining verify.
11384
699c10bd
JD
11385 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
11386
11387 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
11388 on svcsMenu (Bug#8842).
11389
11390 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
11391 ns_return_types.
11392 (Fns_list_services): Just return Qnil on 10.6, code not working there.
11393
11394 * nsterm.m (QUTF8_STRING): Declare.
11395 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
11396 (validRequestorForSendType): Return type is (id).
11397 Change indexOfObjectIdenticalTo to indexOfObject.
11398 Check if we have local selection before returning self (Bug#8842).
11399 (writeSelectionToPasteboard): Put local selection into paste board
11400 if we have a local selection (Bug#8842).
11401 (syms_of_nsterm): DEFSYM QUTF8_STRING.
11402
11403 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
11404 (ns_get_local_selection): Declare.
11405
54e10184
LMI
114062011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
11407
9888ff71
LMI
11408 * keymap.c (describe_map_tree): Don't insert a double newline at
11409 the end of the buffer (bug#1169) and return whether we inserted
11410 something.
11411
54e10184
LMI
11412 * callint.c (Fcall_interactively): Change "reading args" to
11413 "providing args" to try to clarify what it does (bug#1010).
11414
15fa4783
KH
114152011-07-07 Kenichi Handa <handa@m17n.org>
11416
11417 * composite.c (composition_compute_stop_pos): Ignore a static
11418 composition starting before CHARPOS (Bug#8915).
11419
11420 * xdisp.c (handle_composition_prop): Likewise.
11421
a8815b00
EZ
114222011-07-07 Eli Zaretskii <eliz@gnu.org>
11423
11424 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
11425 (Bug#9015)
11426
ef7b981d 114272011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
11428
11429 * character.h (unicode_category_t): New enum type.
11430
11431 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
11432 (Qchar_code_property_table): New variable.
11433 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
11434 (UNIPROP_COMPRESSED_FORM_P): New macros.
11435 (char_table_ascii): Uncompress the compressed values.
11436 (sub_char_table_ref): New arg is_uniprop. Callers changed.
11437 Uncompress the compressed values.
ac389d0c 11438 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
11439 (char_table_ref_and_range): Uncompress the compressed values.
11440 (sub_char_table_set): New arg is_uniprop. Callers changed.
11441 Uncompress the compressed values.
11442 (sub_char_table_set_range): Args changed. Callers changed.
11443 (char_table_set_range): Adjuted for the above change.
11444 (map_sub_char_table): Delete args default_val and parent. Add arg
11445 top. Give decoded values to a Lisp function.
640c8776 11446 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
11447 values to a Lisp function. Gcpro more variables.
11448 (uniprop_table_uncompress)
11449 (uniprop_decode_value_run_length): New functions.
11450 (uniprop_decoder, uniprop_decoder_count): New variables.
11451 (uniprop_get_decoder, uniprop_encode_value_character)
11452 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
11453 New functions.
11454 (uniprop_encoder, uniprop_encoder_count): New variables.
11455 (uniprop_get_encoder, uniprop_table)
11456 (Funicode_property_table_internal, Fget_unicode_property_internal)
11457 (Fput_unicode_property_internal): New functions.
11458 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
11459 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 11460 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
11461 char-code-property-alist.
11462
640c8776 11463 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
11464 Vunicode_category_table.
11465
640c8776 11466 * font.c (font_range): Adjust for the change of
c805dec0
KH
11467 Vunicode_category_table.
11468
76b397fb
DN
114692011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
11470
11471 * m/iris4d.h: Remove file, move contents ...
11472 * s/irix6-5.h: ... here.
11473
22b4128e
PE
114742011-07-06 Paul Eggert <eggert@cs.ucla.edu>
11475
11476 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
11477 * alloc.c (mark_buffer):
11478 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
11479 (clone_per_buffer_values): Don't assume that
22b4128e
PE
11480 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
11481 This isn't true in general, and it's particularly not true
11482 if Emacs is configured with --with-wide-int.
11483 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
11484 New macros, used in the buffer.c change.
11485
869795d6
JD
114862011-07-05 Jan Djärv <jan.h.d@swipnet.se>
11487
11488 * xsettings.c: Use both GConf and GSettings if both are available.
11489 (store_config_changed_event): Add comment.
11490 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
11491 (store_tool_bar_style_changed): New functions.
5e617bc2 11492 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
11493 (struct xsettings): Move font inside HAVE_XFT.
11494 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 11495 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 11496 Move inside HAVE_XFT.
640c8776 11497 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
11498 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
11499 also.
11500 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 11501 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 11502 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
11503 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
11504 (parse_settings): Move check for font inside HAVE_XFT.
11505 (read_settings, apply_xft_settings): Add comment.
11506 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
11507 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
11508 call store_font_name_changed.
11509 (xft_settings_event): Add comment.
11510 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
11511 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
11512 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
11513 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
11514 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
11515 (xsettings_get_system_font, xsettings_get_system_normal_font):
11516 Add comment.
869795d6 11517
d8ed26bd
PE
115182011-07-05 Paul Eggert <eggert@cs.ucla.edu>
11519
11520 Random fixes. E.g., (random) never returned negative values.
11521 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
11522 subseconds part to the entropy, as that's a bit more random.
11523 Prefer signed to unsigned, since the signedness doesn't matter and
11524 in general we prefer signed. When given a limit, use a
11525 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
11526 latter isn't right if USE_2_TAGS_FOR_INTS.
11527 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
11528 not 0..VALMASK. Don't discard "excess" bits that random () returns.
11529
cabf1cac
SM
115302011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11531
11532 * textprop.c (text_property_stickiness):
11533 Obey Vtext_property_default_nonsticky.
11534 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
11535 * w32fns.c (syms_of_w32fns):
11536 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
11537
6e9b2be9
PE
115382011-07-04 Paul Eggert <eggert@cs.ucla.edu>
11539
11540 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
11541 This is more efficient than Ffile_directory_p and avoids a minor race.
11542
90186c68
LMI
115432011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
11544
7c301272
LMI
11545 * buffer.c (Foverlay_put): Say what the return value is
11546 (bug#7835).
11547
c4f2d8d4
LMI
11548 * fileio.c (barf_or_query_if_file_exists): Check first if the file
11549 is a directory before asking whether to use the file name
11550 (bug#7564).
ad637907
LMI
11551 (barf_or_query_if_file_exists): Make the "File is a directory"
11552 error be more correct.
c4f2d8d4 11553
90186c68
LMI
11554 * fns.c (Frequire): Remove the mention of the .gz files, since
11555 that's installation-specific, but keep the mention of
11556 `get-load-suffixes'.
11557
da64016e
PE
115582011-07-04 Paul Eggert <eggert@cs.ucla.edu>
11559
11560 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
11561 Report string overflow if the output is too long.
11562
7d47b580
JB
115632011-07-04 Juanma Barranquero <lekktu@gmail.com>
11564
a555cb87
JB
11565 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
11566 (syms_of_gnutls): Remove duplicate DEFSYM for
11567 Qgnutls_bootprop_verify_hostname_error, an error for
11568 Qgnutls_bootprop_verify_error (which is no longer used).
11569
7d47b580
JB
11570 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
11571 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
11572 Also (re)move comments that are misplaced or no longer relevant.
11573
1e49bfab
LMI
115742011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11575
11576 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
11577
1485f4c0
CY
115782011-07-03 Chong Yidong <cyd@stupidchicken.com>
11579
11580 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
11581 and background color parameters if they have been changed.
11582
a9ab721e
LMI
115832011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11584
11585 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
11586
cf7cff57
PE
115872011-07-03 Paul Eggert <eggert@cs.ucla.edu>
11588
2e13213d
PE
11589 * xsettings.c (SYSTEM_FONT): Define only when used.
11590 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
11591
cf7cff57
PE
11592 * keymap.c (access_keymap_1): Now static.
11593
7a8e04f7
CY
115942011-07-02 Chong Yidong <cyd@stupidchicken.com>
11595
11596 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
11597 leave any prefix arg for the up event (Bug#1586).
11598
61352f62
LMI
115992011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
11600
69bb1ef7
LMI
11601 * lread.c (syms_of_lread): Mention single symbols defined by
11602 `defvar' or `defconst' (bug#7154).
11603
61352f62 11604 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 11605 (Frequire): Mention get-load-suffixes.
61352f62 11606
28545e04
MR
116072011-07-02 Martin Rudalics <rudalics@gmx.at>
11608
11609 * window.h (window): Remove clone_number slot.
11610 * window.c (Fwindow_clone_number, Fset_window_clone_number):
11611 Remove.
11612 (make_parent_window, make_window, saved_window)
11613 (Fset_window_configuration, save_window_save): Don't deal with
11614 clone numbers.
11615 * buffer.c (Qclone_number): Remove declaration.
11616 (sort_overlays, overlay_strings): Don't deal with clone numbers.
11617
3349e122
SM
116182011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
11619
11620 Add multiple inheritance to keymaps.
11621 * keymap.c (Fmake_composed_keymap): New function.
11622 (Fset_keymap_parent): Simplify.
11623 (fix_submap_inheritance): Remove.
11624 (access_keymap_1): New function extracted from access_keymap to handle
11625 embedded parents and handle lists of maps.
11626 (access_keymap): Use it.
11627 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
11628 (Fcopy_keymap): Handle embedded parents.
11629 (Fcommand_remapping, define_as_prefix): Simplify.
11630 (Fkey_binding): Simplify.
11631 (syms_of_keymap): Move minibuffer-local-completion-map,
11632 minibuffer-local-filename-completion-map,
11633 minibuffer-local-must-match-map, and
11634 minibuffer-local-filename-must-match-map to Elisp.
11635 (syms_of_keymap): Defsubr make-composed-keymap.
11636 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
11637 (parse_menu_item): Trivial simplification.
11638
3279eb87
GM
116392011-07-01 Glenn Morris <rgm@gnu.org>
11640
11641 * Makefile.in (SETTINGS_LIBS): Fix typo.
11642
39cb9e56 116432011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
11644
11645 * coding.c (Fencode_coding_string): Record the last coding system
11646 used, as the function doc string says (bug#8738).
11647
0949d2b6
JD
116482011-07-01 Jan Djärv <jan.h.d@swipnet.se>
11649
11650 * xsettings.c (store_monospaced_changed): Take new font as arg and
11651 check for change against current_mono_font.
11652 (EMACS_TYPE_SETTINGS): Remove this and related defines.
11653 (emacs_settings_constructor, emacs_settings_get_property)
11654 (emacs_settings_set_property, emacs_settings_class_init)
11655 (emacs_settings_init, gsettings_obj): Remove.
11656 (something_changedCB): New function for HAVE_GSETTINGS.
11657 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
11658 with value as argument.
11659 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
11660 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 11661 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
11662 "changed".
11663
11664 * xgselect.c: Add defined (HAVE_GSETTINGS).
11665 (xgselect_initialize): Ditto.
11666
11667 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
11668 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
11669 xg_select.
11670
bbc6b304
PE
116712011-07-01 Paul Eggert <eggert@cs.ucla.edu>
11672
11673 * eval.c (struct backtrace): Simplify and port the data structure.
11674 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
11675 signed bit field, as this assumption is not portable and it makes
11676 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
11677 "char debug_on_exit : 1" as this is not portable either; instead,
11678 use the portable "unsigned int debug_on_exit : 1". Remove unused
11679 member evalargs. Remove obsolete comments about cc bombing out.
11680
9851bfc5
JD
116812011-06-30 Jan Djärv <jan.h.d@swipnet.se>
11682
51bb811f 11683 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
11684 Let HAVE_GSETTINGS override HAVE_GCONF.
11685 (store_monospaced_changed): New function.
11686 (EMACS_SETTINGS): A new type derived from GObject to handle
11687 GSettings notifications.
11688 (emacs_settings_constructor, emacs_settings_get_property)
11689 (emacs_settings_set_property, emacs_settings_class_init):
11690 New functions.
11691 (gsettings_client, gsettings_obj): New variables.
11692 (GSETTINGS_SCHEMA): New define.
11693 (something_changedCB): Call store_monospaced_changed.
11694 (init_gsettings): New function.
11695 (xsettings_initialize): Call init_gsettings.
11696 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
11697 to NULL.
11698
640c8776 11699 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
11700 GCONF_CFLAGS/LIBS.
11701
5386012d
MR
117022011-06-29 Martin Rudalics <rudalics@gmx.at>
11703
11704 * window.c (resize_root_window, grow_mini_window)
11705 (shrink_mini_window): Rename Qresize_root_window to
11706 Qwindow_resize_root_window and Qresize_root_window_vertically to
11707 Qwindow_resize_root_window_vertically.
11708
f13e0b08
PE
117092011-06-28 Paul Eggert <eggert@cs.ucla.edu>
11710
11711 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
11712
94515237
JB
117132011-06-27 Juanma Barranquero <lekktu@gmail.com>
11714
11715 * makefile.w32-in: Redesign dependencies so they reflect more
11716 clearly which files are directly included by each source file,
11717 and not through other includes.
11718
e43b6e43
MR
117192011-06-27 Martin Rudalics <rudalics@gmx.at>
11720
11721 * buffer.c (Qclone_number): Declare static and DEFSYM it.
11722 (sort_overlays, overlay_strings): When an overlay's clone number
11723 matches the window's clone number process the overlay even if
11724 the overlay's window property doesn't match the current window.
11725
d68443dc
MR
11726 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
11727 (Fwindow_hchild): Rename to Fwindow_left_child.
11728 (Fwindow_next): Rename to Fwindow_next_sibling.
11729 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
11730 (resize_window_check): Rename to window_resize_check.
11731 (resize_window_apply): Rename to window_resize_apply.
11732 (Fresize_window_apply): Rename to Fwindow_resize_apply.
11733 (Fdelete_other_windows_internal, resize_frame_windows)
11734 (Fsplit_window_internal, Fdelete_window_internal)
11735 (grow_mini_window, shrink_mini_window)
11736 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 11737
c7e73be5
JD
117382011-06-26 Jan Djärv <jan.h.d@swipnet.se>
11739
11740 * emacsgtkfixed.h: State that this is only used with Gtk+3.
11741 (emacs_fixed_set_min_size): Remove.
11742 (emacs_fixed_new): Take frame as argument.
11743
11744 * emacsgtkfixed.c: State that this is only used with Gtk+3.
11745 (_EmacsFixedPrivate): Remove minwidth/height.
11746 Add struct frame *f.
11747 (emacs_fixed_init): Initialize priv->f.
11748 (get_parent_class, emacs_fixed_set_min_size): Remove.
11749 (emacs_fixed_new): Set priv->f to argument.
11750 (emacs_fixed_get_preferred_width)
11751 (emacs_fixed_get_preferred_height): Use min_width/height from
11752 frames size_hint to set minimum and natural (Bug#8919).
11753 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
11754 and use min_width/height from frames size_hint to set
11755 min_width/height (Bug#8919).
11756
11757 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
11758 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
11759 Fix indentation.
c7e73be5 11760
cf99dcf8
EZ
117612011-06-26 Eli Zaretskii <eliz@gnu.org>
11762
11763 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
11764 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
11765 called at ZV.
11766
029529ac
CY
117672011-06-26 Chong Yidong <cyd@stupidchicken.com>
11768
11769 * process.c (wait_reading_process_output): Bypass select if
11770 waiting for a cell while ignoring keyboard input, and input is
11771 pending. Suggested by Jan Djärv (Bug#8869).
11772
7a7ef429
PE
117732011-06-25 Paul Eggert <eggert@cs.ucla.edu>
11774
11775 Use gnulib's dup2 module instead of rolling our own.
11776 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
11777
11fdef7d 117782011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
11779
11780 * dispnew.c (scrolling_window): Before scrolling, turn off a
11781 mouse-highlight in the window being scrolled.
11782
cd3520a4
JB
117832011-06-24 Juanma Barranquero <lekktu@gmail.com>
11784
11785 Move DEFSYM to lisp.h and use everywhere.
11786
11787 * character.h (DEFSYM): Move declaration...
11788 * lisp.h (DEFSYM): ...here.
11789
11790 * gnutls.c:
11791 * minibuf.c:
11792 * w32menu.c:
11793 * w32proc.c:
11794 * w32select.c: Don't include character.h.
11795
11796 * alloc.c (syms_of_alloc):
11797 * buffer.c (syms_of_buffer):
11798 * bytecode.c (syms_of_bytecode):
11799 * callint.c (syms_of_callint):
11800 * casefiddle.c (syms_of_casefiddle):
11801 * casetab.c (init_casetab_once):
11802 * category.c (init_category_once, syms_of_category):
11803 * ccl.c (syms_of_ccl):
11804 * cmds.c (syms_of_cmds):
11805 * composite.c (syms_of_composite):
11806 * dbusbind.c (syms_of_dbusbind):
11807 * dired.c (syms_of_dired):
11808 * dispnew.c (syms_of_display):
11809 * doc.c (syms_of_doc):
11810 * editfns.c (syms_of_editfns):
11811 * emacs.c (syms_of_emacs):
11812 * eval.c (syms_of_eval):
11813 * fileio.c (syms_of_fileio):
11814 * fns.c (syms_of_fns):
11815 * frame.c (syms_of_frame):
11816 * fringe.c (syms_of_fringe):
11817 * insdel.c (syms_of_insdel):
11818 * keymap.c (syms_of_keymap):
11819 * lread.c (init_obarray, syms_of_lread):
11820 * macros.c (syms_of_macros):
11821 * msdos.c (syms_of_msdos):
11822 * print.c (syms_of_print):
11823 * process.c (syms_of_process):
11824 * search.c (syms_of_search):
11825 * sound.c (syms_of_sound):
11826 * syntax.c (init_syntax_once, syms_of_syntax):
11827 * terminal.c (syms_of_terminal):
11828 * textprop.c (syms_of_textprop):
11829 * undo.c (syms_of_undo):
11830 * w32.c (globals_of_w32):
11831 * window.c (syms_of_window):
11832 * xdisp.c (syms_of_xdisp):
11833 * xfaces.c (syms_of_xfaces):
11834 * xfns.c (syms_of_xfns):
11835 * xmenu.c (syms_of_xmenu):
11836 * xsettings.c (syms_of_xsettings):
11837 * xterm.c (syms_of_xterm): Use DEFSYM.
11838
4228cf16
TZ
118392011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
11840
cd3520a4 11841 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 11842
7fcccf1e
PE
118432011-06-23 Paul Eggert <eggert@cs.ucla.edu>
11844
7efb4e0e
PE
11845 Integer and buffer overflow fixes (Bug#8873).
11846
ff5844ad
PE
11847 * print.c (printchar, strout): Check for string overflow.
11848 (PRINTPREPARE, printchar, strout):
11849 Don't set size unless allocation succeeds.
11850
90532f02
PE
11851 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
11852 for sizes. Check for string overflow more accurately.
11853 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
11854
6d84508d
PE
11855 * macros.c: Integer and buffer overflow fixes.
11856 * keyboard.h (struct keyboard.kbd_macro_bufsize):
11857 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
11858 Use ptrdiff_t, not int, for sizes.
11859 Don't increment bufsize until after realloc succeeds.
11860 Check for size-calculation overflow.
11861 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
11862
437b2cb4
PE
11863 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
11864
8b9ac8b4
PE
11865 * lread.c: Integer overflow fixes.
11866 (read_integer): Radix is now EMACS_INT, not int,
11867 to improve quality of diagnostics for out-of-range radices.
11868 Calculate buffer size correctly for out-of-range radices.
11869 (read1): Check for integer overflow in radices, and in
11870 read-circle numbers.
82cb60d3
PE
11871 (read_escape): Avoid int overflow.
11872 (Fload, openp, read_buffer_size, read1)
11873 (substitute_object_recurse, read_vector, read_list, map_obarray):
11874 Use ptrdiff_t, not int, for sizes.
11875 (read1): Use EMACS_INT, not int, for sizes.
20270765 11876 Check for size overflow.
8b9ac8b4 11877
7fcccf1e
PE
11878 * image.c (cache_image): Check for size arithmetic overflow.
11879
bfbbd7e7
PE
11880 * lread.c: Integer overflow issues.
11881 (saved_doc_string_size, saved_doc_string_length)
11882 (prev_saved_doc_string_size, prev_saved_doc_string_length):
11883 Now ptrdiff_t, not int.
11884 (read1): Don't assume doc string length fits in int. Check for
11885 out-of-range doc string lengths.
11886 (read_list): Don't assume file position fits in int.
39019e54 11887 (read_escape): Check for hex character overflow.
bfbbd7e7 11888
4e323265
LL
118892011-06-22 Leo Liu <sdl.web@gmail.com>
11890
11891 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
11892 Move to minibuffer.el.
11893
85fece3e
PE
118942011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11895
20b84ce9 11896 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
11897 The following patches are for when GLYPH_DEBUG && !XASSERT.
11898 * dispextern.h (trace_redisplay_p, dump_glyph_string):
11899 * dispnew.c (flush_stdout):
11900 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
11901 Mark as externally visible.
11902 * dispnew.c (check_window_matrix_pointers): Now static.
11903 * dispnew.c (window_to_frame_vpos):
11904 * xfns.c (unwind_create_frame):
11905 * xterm.c (x_check_font): Remove unused local.
11906 * scroll.c (CHECK_BOUNDS):
11907 * xfaces.c (cache_fache): Rename local to avoid shadowing.
11908 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
11909 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
11910 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
11911 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
11912 Now static.
11913 (debug_method_add): Use va_list and vsprintf rather than relying
11914 on undefined behavior with wrong number of arguments.
11915 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
11916 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
11917 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
11918 since we're not interested in debugging glyphs with old libraries.
11919 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
11920 GCC 4.6.0's static checking.
11921
0766b489
PE
119222011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11923
31fd4b32
PE
11924 Integer overflow and signedness fixes (Bug#8873).
11925 A few related buffer overrun fixes, too.
11926
b79e8648
PE
11927 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
11928
0766b489
PE
11929 * dispextern.h (struct face.stipple):
11930 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
11931 (x_bitmap_mask, x_allocate_bitmap_record)
11932 (x_create_bitmap_from_data, x_create_bitmap_from_file)
11933 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
11934 (x_create_bitmap_from_xpm_data):
11935 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
11936 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
11937 (.bitmaps_last):
11938 * xfaces.c (load_pixmap):
11939 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
11940 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
11941 (.bitmaps_last, struct x_output.icon_bitmap):
11942 Use ptrdiff_t, not int, for bitmap indexes.
11943 (x_allocate_bitmap_record): Check for size overflow.
11944 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
11945
b081724f
PE
11946 Use ptrdiff_t, not int, for overlay counts.
11947 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
11948 * editfns.c (overlays_around, get_pos_property):
11949 * textprop.c (get_char_property_and_overlay):
11950 * xdisp.c (next_overlay_change, note_mouse_highlight):
11951 * xfaces.c (face_at_buffer_position):
21514da7
PE
11952 * buffer.c (OVERLAY_COUNT_MAX): New macro.
11953 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
11954 (Fnext_overlay_change, Fprevious_overlay_change)
11955 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 11956 Use ptrdiff_t, not int, for sizes.
21514da7 11957 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 11958
3de73e5e
PE
11959 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
11960
2606c57b
PE
11961 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
11962 (x_session_initialize): Do not assume string length fits in int.
11963
aaafe47a
PE
11964 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
11965 This is unlikely, but can occur if DPI is outlandish.
11966
2674ddc8 11967 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
11968 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
11969
28154962
PE
11970 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
11971 * xrdb.c (magic_file_p, search_magic_path):
11972 Omit last arg SUFFIX; it was always 0. All callers changed.
11973 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
11974
7de51af5
PE
11975 * xfont.c (xfont_match): Avoid need for strlen.
11976
25ed6cc3
PE
11977 * xfns.c: Don't assume strlen fits in int.
11978 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
11979
4eab31dd
PE
11980 * xdisp.c (message_log_check_duplicate): Return intmax_t,
11981 not unsigned long, as we prefer signed integers. All callers changed.
11982 Detect integer overflow in repeat count.
11983 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 11984 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 11985
171e2a58
PE
11986 * termcap.c: Don't assume sizes fit in int and never overflow.
11987 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
11988 (gobble_line): Check for size-calculation overflow.
11989
ad39faca 11990 * minibuf.c (Fread_buffer):
6e5bb2dc 11991 * lread.c (intern, intern_c_string):
74ca2eb3
PE
11992 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
11993 Don't assume string length fits in int.
11994
52c61c22 11995 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
11996 * gtkutil.c (style_changed_cb): Avoid need for strlen.
11997
b5b8c9e5
PE
11998 * font.c: Don't assume string length fits in int.
11999 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
12000 Use ptrdiff_t, not int.
ccd6111c
PE
12001 (font_intern_prop): Don't assume string length fits in int.
12002 Don't assume integer property fits in fixnum.
12003 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 12004
882f0d81 12005 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 12006 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
12007 Reformulate so as not to need the command string.
12008 Invoke gzip -cd rather than gunzip, as it's more portable.
12009 (lock_info_type, lock_file_1, lock_file):
12010 Don't assume pid_t and time_t fit in unsigned long.
12011 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
12012 (current_lock_owner): Prefer signed type for sizes.
12013 Use memcpy, not strncpy, where memcpy is what is really wanted.
12014 Don't assume (via atoi) that time_t and pid_t fit in int.
12015 Check for time_t and/or pid_t out of range, e.g., via a network share.
12016 Don't alloca where an auto var works fine.
12017
93f4cf88
PE
12018 * fileio.c: Fix some integer overflow issues.
12019 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
12020 Don't assume string length fits in int.
12021 (directory_file_name): Don't assume string length fits in long.
12022 (make_temp_name): Don't assume pid fits in int, or that its print
12023 length is less than 20.
12024
f3e92b69
PE
12025 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
12026
1bfdaf10
PE
12027 * coding.c (make_subsidiaries): Don't assume string length fits in int.
12028
35016e9a
PE
12029 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
12030
3d1e65a1
PE
12031 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
12032 We prefer signed integers, even for size calculations.
12033
0b963a93
PE
12034 * emacs.c: Don't assume string length fits in 'int'.
12035 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
12036 (main): Don't invoke strlen when not needed.
12037
573f4b54
PE
12038 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
12039 (XD_DEBUG_MESSAGE): Don't waste a byte.
12040
989f33ba
PE
12041 * callproc.c (getenv_internal_1, getenv_internal)
12042 (Fgetenv_internal):
965d34eb
PE
12043 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
12044
e4d29b33
PE
12045 * lread.c (invalid_syntax): Omit length argument.
12046 All uses changed. This doesn't fix a bug, but it simplifies the
12047 code away from its former Hollerith-constant appearance, and it's
12048 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 12049 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 12050
eb49b136
PE
12051 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
12052 This didn't break anything, but it didn't help either.
12053 It's confusing to put a bogus integer in a place where the actual
12054 value does not matter.
9f62aeb1 12055 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 12056 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 12057
15375a22
PE
12058 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
12059 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
12060 implementation.
b61cc01c
PE
12061 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
12062 We prefer signed types, and the value cannot exceed the EMACS_INT
12063 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
12064 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
12065 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
12066 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 12067
53b2623d
PE
12068 * indent.c (sane_tab_width): New function.
12069 (current_column, scan_for_column, Findent_to, position_indentation)
12070 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 12071 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 12072
51cab52b 12073 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 12074
f2ed8a70
PE
12075 * lisp.h (lint_assume): New macro.
12076 * composite.c (composition_gstring_put_cache):
12077 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
12078
abe80cc6
PE
12079 * editfns.c, insdel.c:
12080 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 12081
b02c740e
PE
12082 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
12083
ebc96716
PE
12084 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
12085
b4e50fa0 12086 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 12087 Use much-faster test for byte-length change.
311d5d7c 12088 Don't assume string byte-length fits in 'int'.
a4cf38e4 12089 Check that character arg fits in 'int'.
85461888 12090 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 12091
c0c1ee9f
PE
12092 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
12093
a498d7f4
PE
12094 * fns.c (concat): Catch string overflow earlier.
12095 Do not rely on integer wraparound.
12096
51cab52b
PE
12097 * dispextern.h (struct it.overlay_strings_charpos)
12098 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
12099 * xdisp.c (forward_to_next_line_start)
12100 (back_to_previous_visible_line_start)
12101 (reseat_at_next_visible_line_start, next_element_from_buffer):
12102 Don't arbitrarily truncate the value of 'selective' to int.
12103
76031fad
PE
12104 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
12105
5eb55db9
PE
12106 * composite.c: Don't truncate sizes to 'int'.
12107 (composition_gstring_p, composition_reseat_it)
12108 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
12109 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
12110 not EMACS_UINT, for indexes.
5eb55db9 12111
0703a717
PE
12112 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
12113
d6202519
PE
12114 * buffer.c: Include <verify.h>.
12115 (struct sortvec.priority, struct sortstr.priority):
8961a454 12116 Now EMACS_INT, not int.
c20998a7 12117 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
12118 (struct sortstr.size, record_overlay_string)
12119 (struct sortstrlist.size, struct sortlist.used):
12120 Don't truncate size to int.
12121 (record_overlay_string): Check for size-calculation overflow.
d6202519 12122 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 12123
d5a19415
JM
121242011-06-22 Jim Meyering <meyering@redhat.com>
12125
029529ac 12126 Don't leak an XBM-image-sized buffer
d5a19415
JM
12127 * image.c (xbm_load): Free the image buffer after using it.
12128
a9041e6c
PE
121292011-06-21 Paul Eggert <eggert@cs.ucla.edu>
12130
12131 Port to Sun C.
12132 * composite.c (find_automatic_composition): Omit needless 'return 0;'
12133 that Sun C diagnosed.
12134 * fns.c (secure_hash): Fix pointer signedness issue.
12135 * intervals.c (static_offset_intervals): New function.
12136 (offset_intervals): Use it.
12137
7f3f739f
LL
121382011-06-21 Leo Liu <sdl.web@gmail.com>
12139
12140 * deps.mk (fns.o):
12141 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
12142 sha512.h.
12143
12144 * fns.c (secure_hash): Rename from crypto_hash_function and change
12145 the first arg to accept symbols.
5b66d427 12146 (Fsecure_hash): New primitive.
7f3f739f
LL
12147 (syms_of_fns): New symbols.
12148
76147d94
DD
121492011-06-20 Deniz Dogan <deniz@dogan.se>
12150
12151 * process.c (Fset_process_buffer): Clarify return value in
12152 docstring.
12153
7d7d0045
CY
121542011-06-18 Chong Yidong <cyd@stupidchicken.com>
12155
12156 * dispnew.c (add_window_display_history): Use BVAR.
12157
12158 * xdisp.c (debug_method_add): Use BVAR.
12159 (check_window_end, dump_glyph_matrix, dump_glyph)
12160 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
12161
12162 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
12163 Likewise.
12164
12165 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
12166 check till after the cache is created in init_frame_faces.
12167
ff2bc410
SM
121682011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
12169
12170 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
12171
28177add
PE
121722011-06-16 Paul Eggert <eggert@cs.ucla.edu>
12173
dd3482fe
PE
12174 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
12175 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
12176 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
12177
393d71f3 12178 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
12179 * fileio.c (Finsert_file_contents):
12180 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
12181 Remove the old (too-loose) buffer overflow checks.
12182 They weren't needed, since make_gap checks for buffer overflow.
12183 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
12184 The old code merely checked for Emacs fixnum overflow, and relied
12185 on undefined (wraparound) behavior. The new code avoids undefined
12186 behavior, and also checks for ptrdiff_t and/or size_t overflow.
12187
2e6813b0 12188 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
12189 Tune. Don't use wider integers than needed. Don't use alloca.
12190 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 12191
599a9e4f
PE
12192 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
12193
99561444
PE
12194 * insdel.c, lisp.h (buffer_overflow): New function.
12195 (insert_from_buffer_1, replace_range, replace_range_2):
12196 * insdel.c (make_gap_larger):
12197 * editfns.c (Finsert_char):
12198 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
12199
28177add
PE
12200 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
12201
e69dafad
PE
122022011-06-15 Paul Eggert <eggert@cs.ucla.edu>
12203
4baa020d 12204 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 12205
b1c46f02
PE
12206 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
12207 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
12208
e69dafad
PE
12209 * fileio.c: Don't assume EMACS_INT fits in off_t.
12210 (emacs_lseek): New static function.
12211 (Finsert_file_contents, Fwrite_region): Use it.
12212 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
12213
566684ea
PE
12214 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
12215
e6966cd6
PE
12216 * fns.c: Don't overflow int when computing a list length.
12217 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
12218 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
12219 truncation on 64-bit hosts. Check for QUIT every
12220 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
12221 faster and is responsive enough.
12222 (Flength): Report an error instead of overflowing an integer.
12223 (Fsafe_length): Return a float if the value is not representable
12224 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 12225 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 12226 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 12227
dd0b0efb
PE
12228 * alloc.c: Check that resized vectors' lengths fit in fixnums.
12229 (header_size, word_size): New constants.
12230 (allocate_vectorlike): Don't check size overflow here.
12231 (allocate_vector): Check it here instead, since this is the only
12232 caller of allocate_vectorlike that could cause overflow.
12233 Check that the new vector's length is representable as a fixnum.
12234
86fe5cfe
PE
12235 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
12236 The previous code was bogus. For example, next_almost_prime (32)
12237 returned 39, which is undesirable as it is a multiple of 3; and
12238 next_almost_prime (24) returned 25, which is a multiple of 5 so
12239 why was the code bothering to check for multiples of 7?
12240
80e88859
PE
12241 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
12242
4a2f0ad6
PE
12243 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
12244
f66c7cf8
PE
12245 Variadic C functions now count arguments with ptrdiff_t.
12246 This partly undoes my 2011-03-30 change, which replaced int with size_t.
12247 Back then I didn't know that the Emacs coding style prefers signed int.
12248 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
12249 were being counted with int, which may truncate counts on 64-bit
12250 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
12251 * lisp.h (struct Lisp_Subr.function.aMANY)
12252 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
12253 Arg counts are now ptrdiff_t, not size_t.
12254 All variadic functions and their callers changed accordingly.
12255 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
12256 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
12257 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
12258 * callint.c (Fcall_interactively): Check arg count for overflow,
12259 to avoid potential buffer overrun. Use signed char, not 'int',
12260 for 'varies' array, so that we needn't bother to check its size
12261 calculation for overflow.
12262 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
12263 * eval.c (apply_lambda):
12264 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
12265 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
12266 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
12267
a1759b76
PE
12268 * callint.c (Fcall_interactively): Don't use index var as event count.
12269
d96be9fc
PE
12270 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
12271 * mem-limits.h (SIZE): Remove; no longer used.
12272
a690a978 12273 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 12274
578c21e6
PE
12275 Remove unnecessary casts.
12276 * xterm.c (x_term_init):
12277 * xfns.c (x_set_border_pixel):
12278 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
12279 These aren't needed now that we assume ANSI C.
12280
96f53c6c
PE
12281 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
12282 It's more likely to cause problems (due to unsigned overflow)
12283 than to cure them.
12284
83c77d31
PE
12285 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
12286
ee2079f1
PE
12287 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
12288
6da65536
PE
12289 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
12290
7147c4a4
PE
12291 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
12292
193e32d9
PE
12293 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
12294
e5533da6
PE
12295 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
12296
9910e595
PE
12297 GLYPH_CODE_FACE returns EMACS_INT, not int.
12298 * dispextern.h (merge_faces):
12299 * xfaces.c (merge_faces):
01103c44
PE
12300 * xdisp.c (get_next_display_element, next_element_from_display_vector):
12301 Don't assume EMACS_INT fits in int.
9910e595 12302
2638320e
PE
12303 * character.h (CHAR_VALID_P): Remove unused parameter.
12304 * fontset.c, lisp.h, xdisp.c: All uses changed.
12305
045eb8d9
PE
12306 * editfns.c (Ftranslate_region_internal): Omit redundant test.
12307
c1f134b5
PE
12308 * fns.c (concat): Minor tuning based on overflow analysis.
12309 This doesn't fix any bugs. Use int to hold character, instead
12310 of constantly refetching from Emacs object. Use XFASTINT, not
12311 XINT, for value known to be a character. Don't bother comparing
12312 a single byte to 0400, as it's always less.
12313
395fcb93 12314 * floatfns.c (Fexpt):
327eeec8
PE
12315 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
12316
abbd3d23
PE
12317 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
12318 for characters.
12319
684a03ef
PE
12320 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
12321
0fed43f3
PE
12322 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
12323 Without this fix, on a 64-bit host (aset S 0 4294967386) would
12324 incorrectly succeed when S was a string, because 4294967386 was
12325 truncated before it was used.
12326
8fd02eb7
PE
12327 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
12328 Otherwise, an out-of-range integer could cause undefined behavior
12329 on a 64-bit host.
12330
f8c86b69
PE
12331 * composite.c: Use int, not EMACS_INT, for characters.
12332 (fill_gstring_body, composition_compute_stop_pos): Use int, not
12333 EMACS_INT, for values that are known to be in character range.
12334 This doesn't fix any bugs but is the usual style inside Emacs and
12335 may generate better code on 32-bit machines.
12336
34206dd2
PE
12337 Make sure a 64-bit char is never passed to ENCODE_CHAR.
12338 This is for reasons similar to the recent CHAR_STRING fix.
12339 * charset.c (Fencode_char): Check that character arg is actually
12340 a character. Pass an int to ENCODE_CHAR.
12341 * charset.h (ENCODE_CHAR): Verify that the character argument is no
12342 wider than 'int', as a compile-time check to prevent future regressions
12343 in this area.
12344
c5958d4c 12345 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
12346
12347 Make sure a 64-bit char is never passed to CHAR_STRING.
12348 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
12349 by silently ignoring the top 32 bits, allowing some values
12350 that were far too large to be valid characters.
12351 * character.h: Include <verify.h>.
12352 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
12353 arguments are no wider than unsigned, as a compile-time check
12354 to prevent future regressions in this area.
12355 * data.c (Faset):
01103c44 12356 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
12357 (Fsubst_char_in_region):
12358 * fns.c (concat):
12359 * xdisp.c (decode_mode_spec_coding):
12360 Adjust to CHAR_STRING's new requirement.
12361 * editfns.c (Finsert_char, Fsubst_char_in_region):
12362 * fns.c (concat): Check that character args are actually
12363 characters. Without this test, these functions did the wrong
12364 thing with wildly out-of-range values on 64-bit hosts.
12365
d37ca623
PE
12366 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
12367 These casts should not be needed on 32-bit hosts, either.
12368 * keyboard.c (read_char):
12369 * lread.c (Fload): Remove casts to unsigned.
12370
ea204efb
PE
12371 * lisp.h (UNSIGNED_CMP): New macro.
12372 This fixes comparison bugs on 64-bit hosts.
12373 (ASCII_CHAR_P): Use it.
12374 * casefiddle.c (casify_object):
01103c44 12375 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
12376 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
12377 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
12378 * dispextern.h (FACE_FROM_ID):
12379 * keyboard.c (read_char): Use UNSIGNED_CMP.
12380
41cb286c
PE
12381 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
12382 not to EMACS_INT, to avoid GCC warning.
12383
4a1b9832
PE
12384 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
12385
55daad71
PE
12386 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
12387 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
12388 isn't needed on 32-bit machines.
8f95c75c 12389
01103c44
PE
12390 * buffer.c (Fgenerate_new_buffer_name):
12391 Use EMACS_INT for count, not int.
0ceccced 12392 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
12393
12394 * data.c (Qcompiled_function): Now static.
12395
c6f072e7
PE
12396 * window.c (window_body_lines): Now static.
12397
20ce5912
PE
12398 * image.c (gif_load): Rename local to avoid shadowing.
12399
9c4c5f81
PE
12400 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
12401 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
12402 * alloc.c (make_save_value): Integer argument is now of type
12403 ptrdiff_t, not int.
12404 (mark_object): Use ptrdiff_t, not int.
12405 * lisp.h (pD): New macro.
12406 * print.c (print_object): Use it.
12407
c0c5c8ae
PE
12408 * alloc.c: Use EMACS_INT, not int, to count objects.
12409 (total_conses, total_markers, total_symbols, total_vector_size)
12410 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
12411 (total_free_floats, total_floats, total_free_intervals)
12412 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
12413 Now EMACS_INT, not int. All uses changed.
12414 (Fgarbage_collect): Compute overall total using a double, so that
12415 integer overflow is less likely to be a problem. Check for overflow
12416 when converting back to an integer.
5a25e253
PE
12417 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
12418 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
12419 These were 'int' variables that could overflow on 64-bit hosts;
12420 they were never used, so remove them instead of repairing them.
211a0b2a 12421 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
12422 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
12423 Previously, this ceilinged at INT_MAX, but that doesn't work on
12424 64-bit machines.
e46bb31a 12425 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 12426
c78baabf 12427 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 12428 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
12429 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
12430 when a (possibly-narrower) signed value would do just as well.
12431 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 12432
c9d624c6
PE
12433 * alloc.c: Catch some string size overflows that we were missing.
12434 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
12435 for convenience in STRING_BYTES_MAX.
12436 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
12437 The definition here is exact; the one in lisp.h was approximate.
12438 (allocate_string_data): Check for string overflow. This catches
12439 some instances we weren't catching before. Also, it catches
12440 size_t overflow on (unusual) hosts where SIZE_MAX <= min
12441 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
12442 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 12443
c9d624c6
PE
12444 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
12445 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 12446 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 12447
353032ce
PE
12448 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
12449
2bccce07
PE
12450 * alloc.c (Fmake_string): Check for out-of-range init.
12451
0ac30604
SM
124522011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
12453
12454 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
12455
c195f2de
JD
124562011-06-14 Jan Djärv <jan.h.d@swipnet.se>
12457
12458 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
12459 xg_get_default_scrollbar_width.
12460
12461 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
12462 (int_gtk_range_get_value): Move to the scroll bar part of the file.
12463 (style_changed_cb): Call update_theme_scrollbar_width and call
12464 x_set_scroll_bar_default_width and xg_frame_set_char_size for
12465 all frames (Bug#8505).
12466 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
12467 Call gtk_window_set_resizable if HAVE_GTK3.
12468 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
12469 and height if HAVE_GTK3 (Bug#8505).
12470 (scroll_bar_width_for_theme): New variable.
12471 (update_theme_scrollbar_width): New function.
12472 (xg_get_default_scrollbar_width): Move code to
12473 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
12474 (xg_initialize): Call update_theme_scrollbar_width.
12475
12476 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
12477
12478 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
12479
e10ac9f1
MR
124802011-06-12 Martin Rudalics <rudalics@gmx.at>
12481
12482 * frame.c (make_frame): Call other_buffer_safely instead of
12483 other_buffer.
12484
12485 * window.c (temp_output_buffer_show): Call display_buffer with
12486 second argument Vtemp_buffer_show_specifiers and reset latter
12487 immediately after the call.
12488 (Vtemp_buffer_show_specifiers): New variable.
12489 (auto_window_vscroll_p, next_screen_context_lines)
12490 (Vscroll_preserve_screen_position): Remove leading asterisks from
12491 doc-strings.
12492
2d3c217e 124932011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 12494
7b7f97e8 12495 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
12496 * buffer.c (Qclone_number): Remove for now, as it's unused.
12497 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
12498 (record_buffer): Remove unused local.
12499 * frame.c (other_visible_frames, frame_buffer_list): Now static.
12500 (set_frame_buffer_list): Remove; unused.
12501 * frame.h (other_visible_frames): Remove decl.
12502 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
12503 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
12504 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
12505 if HAVE_GPM.
12506 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
12507 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
12508 Define only if HAVE_GPM.
12509 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
12510 (update_hints_inhibit): Remove; never set. All uses removed.
12511 * widgetprv.h (emacsFrameClassRec): Remove decl.
12512 * window.c (delete_deletable_window): Now returns void, since it
12513 wasn't returning anything.
12514 (compare_window_configurations): Remove unused locals.
12515 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
12516 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
12517 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
12518 the same widths as pointers. This follows up on the 2011-05-06 patch.
12519 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
12520 * xterm.h: Likewise.
12521 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
12522
1384b89e
JB
125232011-06-12 Juanma Barranquero <lekktu@gmail.com>
12524
12525 * makefile.w32-in: Update dependencies.
12526 (LISP_H): Add lib/intprops.h.
12527
1100a63c
CY
125282011-06-11 Chong Yidong <cyd@stupidchicken.com>
12529
12530 * image.c (gif_load): Add animation frame delay to the metadata.
12531 (syms_of_image): Use DEFSYM. New symbol `delay'.
12532
6198ccd0
MR
125332011-06-11 Martin Rudalics <rudalics@gmx.at>
12534
12535 * window.c (delete_deletable_window): Re-add.
12536 (Fset_window_configuration): Rewrite to handle dead buffers and
12537 consequently deletable windows.
12538 (window_tree, Fwindow_tree): Remove. Supply functionality in
12539 window.el.
12540 (compare_window_configurations): Simplify code.
12541
b6e3633c
AS
125422011-06-11 Andreas Schwab <schwab@linux-m68k.org>
12543
1ab0dee5
AS
12544 * image.c (imagemagick_load_image): Fix type mismatch.
12545 (Fimagemagick_types): Likewise.
12546
b6e3633c
AS
12547 * window.h (replace_buffer_in_windows): Declare.
12548
9397e56f
MR
125492011-06-11 Martin Rudalics <rudalics@gmx.at>
12550
12551 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
12552 Qclone_number. Remove external declaration of Qdelete_window.
12553 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
12554 code.
640c8776
SM
12555 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
12556 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
12557 (Fother_buffer): Rewrite doc-string. Major rewrite for new
12558 buffer list implementation.
12559 (other_buffer_safely): New function.
12560 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
12561 calls to replace_buffer_in_windows and
12562 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
12563 if allowed.
12564 (record_buffer): Inhibit quitting and rewrite using quittable
12565 functions. Run Qbuffer_list_update_hook if allowed.
12566 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
12567 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
12568 Move switch-to-buffer to window.el.
9397e56f
MR
12569 (bury-buffer): Move to window.el.
12570 (Vbuffer_list_update_hook): New variable.
12571
12572 * lisp.h (other_buffer_safely): Add prototype in buffer.c
12573 section.
12574
12575 * window.h (resize_frame_windows): Move up in code.
12576 (Fwindow_frame): Remove EXFUN.
12577 (replace_buffer_in_all_windows): Remove prototype.
12578 (replace_buffer_in_windows_safely): Add prototype.
12579
12580 * window.c: Declare Qdelete_window static again. Move down
12581 declaration of select_count.
12582 (Fnext_window, Fprevious_window): Rewrite doc-strings.
12583 (Fother_window): Move to window.el.
12584 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
12585 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
12586 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
12587 window.el.
12588 (replace_buffer_in_windows): Implement by calling
12589 Qreplace_buffer_in_windows.
12590 (replace_buffer_in_all_windows): Remove with some functionality
12591 moved into replace_buffer_in_windows_safely.
12592 (replace_buffer_in_windows_safely): New function.
12593 (select_window_norecord, select_frame_norecord): Move in front
12594 of run_window_configuration_change_hook. Remove now obsolete
12595 declarations.
640c8776
SM
12596 (Fset_window_buffer): Rewrite doc-string.
12597 Call Qrecord_window_buffer.
9397e56f
MR
12598 (keys_of_window): Move binding for other-window to window.el.
12599
b50691aa
CY
126002011-06-11 Chong Yidong <cyd@stupidchicken.com>
12601
12602 * dispextern.h (struct image): Replace data member, whose int_val
12603 and ptr_val fields were not used by anything, with a single
12604 lisp_val object.
12605
12606 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
12607 (gif_clear_image, gif_load, imagemagick_load_image)
12608 (gs_clear_image, gs_load): Callers changed.
12609
3f754b86
PE
126102011-06-10 Paul Eggert <eggert@cs.ucla.edu>
12611
cca69397
PE
12612 * buffer.h: Include <time.h>, for time_t.
12613 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
12614
109e28d0
PE
12615 Fix minor problems found by static checking.
12616
60737f02
PE
12617 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
12618
4b66faf3
PE
12619 Make identifiers static if they are not used in other modules.
12620 * data.c (Qcompiled_function, Qframe, Qvector):
12621 * image.c (QimageMagick, Qsvg):
12622 * minibuf.c (Qmetadata):
12623 * window.c (resize_window_check, resize_root_window): Now static.
12624 * window.h (resize_window_check, resize_root_window): Remove decls.
12625
109e28d0
PE
12626 * window.c (window_deletion_count, delete_deletable_window):
12627 Remove; unused.
46a4ce9e
PE
12628 (window_body_lines): Now static.
12629 (Fdelete_other_windows_internal): Mark vars as initialized.
12630 Make sure 'resize_failed' is initialized.
12631 (run_window_configuration_change_hook): Rename local to avoid shadowing.
12632 (resize_window_apply): Remove unused local.
12633 * window.h (delete_deletable_window): Remove decl.
12634
109e28d0 12635 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
12636 (imagemagick_load_image): Fix pointer signedness problem by changing
12637 last arg from unsigned char * to char *. All uses changed.
12638 Also, fix a local for similar reasons.
12639 Remove unused locals. Remove locals to avoid shadowing.
12640 (fn_rsvg_handle_free): Remove; unused.
12641 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 12642 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 12643
3f754b86
PE
12644 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
12645
2547adb1
CY
126462011-06-10 Chong Yidong <cyd@stupidchicken.com>
12647
12648 * image.c (gif_load): Fix omitted cast error introduced by
12649 2011-06-06 change.
12650
2c8e37d4
MR
126512011-06-10 Martin Rudalics <rudalics@gmx.at>
12652
12653 * window.h (resize_proportionally, orig_total_lines)
12654 (orig_top_line): Remove from window structure.
12655 (set_window_height, set_window_width, change_window_heights)
12656 (Fdelete_window): Remove prototypes.
12657 (resize_frame_windows): Remove duplicate declaration.
12658
440a42e3
EZ
126592011-06-10 Eli Zaretskii <eliz@gnu.org>
12660
12661 * window.h (resize_frame_windows, resize_window_check)
12662 (delete_deletable_window, resize_root_window)
12663 (resize_frame_windows): Declare prototypes.
12664
12665 * window.c (resize_window_apply): Make definition be "static" to
12666 match the prototype.
12667
562dd5e9
MR
126682011-06-10 Martin Rudalics <rudalics@gmx.at>
12669
12670 * window.c: Remove declarations of Qwindow_size_fixed,
12671 window_min_size_1, window_min_size_2, window_min_size,
12672 size_window, window_fixed_size_p, enlarge_window, delete_window.
12673 Remove static from declaration of Qdelete_window, it's
12674 temporarily needed by Fbury_buffer.
12675 (replace_window): Don't assign orig_top_line and
12676 orig_total_lines.
12677 (Fdelete_window, delete_window): Remove. Window deletion is
12678 handled by window.el.
640c8776
SM
12679 (window_loop): Remove DELETE_OTHER_WINDOWS case.
12680 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
12681 (Fdelete_other_windows): Remove. Deleting other windows is
12682 handled by window.el.
12683 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
12684 handled in window.el.
12685 (window_min_size_2, window_min_size_1, window_min_size): Remove.
12686 Window minimum sizes are handled in window.el.
12687 (shrink_windows, size_window, set_window_height)
12688 (set_window_width, change_window_heights, window_height)
12689 (window_width, CURBEG, CURSIZE, enlarge_window)
12690 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
12691 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
12692 handled in window.el.
12693 (make_dummy_parent): Rename to make_parent_window and give it a
12694 second argument horflag.
12695 (make_window): Don't set resize_proportionally any more.
12696 (Fsplit_window): Remove. Windows are split in window.el.
12697 (save_restore_action, save_restore_orig_size)
12698 (shrink_window_lowest_first, save_restore_orig_size): Remove.
12699 Resize mini windows in window.el.
12700 (grow_mini_window, shrink_mini_window): Implement by calling
12701 Qresize_root_window_vertically, resize_window_check and
12702 resize_window_apply.
640c8776
SM
12703 (saved_window, Fset_window_configuration, save_window_save):
12704 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
12705 resize_proportionally.
12706 (window_min_height, window_min_width): Move to window.el.
12707 (keys_of_window): Move bindings for delete-other-windows,
12708 split-window, delete-window and enlarge-window to window.el.
12709
12710 * buffer.c: Temporarily extern Qdelete_window.
12711 (Fbury_buffer): Temporarily call Qdelete_window instead of
12712 Fdelete_window (Fbury_buffer will move to window.el soon).
12713
12714 * frame.c (set_menu_bar_lines_1): Remove code handling
12715 orig_top_line and orig_total_lines.
12716
12717 * dispnew.c (adjust_frame_glyphs_initially): Don't use
12718 set_window_height but set heights directly.
12719 (change_frame_size_1): Use resize_frame_windows.
12720
12721 * xdisp.c (init_xdisp): Don't use set_window_height but set
12722 heights directly.
12723
640c8776
SM
12724 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
12725 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
12726 run_window_configuration_change_hook.
12727
12728 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
12729 instead of change_window_heights and run
12730 run_window_configuration_change_hook.
12731
1a13852e
MR
127322011-06-09 Martin Rudalics <rudalics@gmx.at>
12733
12734 * window.c (replace_window): Rename second argument REPLACEMENT to
12735 NEW. New third argument SETFLAG. Rewrite.
12736 (delete_window, make_dummy_parent): Call replace_window with
12737 third argument 1.
12738 (window_list_1): Move down in code.
12739 (run_window_configuration_change_hook): Move set_buffer part
12740 before select_frame_norecord part in order to unwind correctly.
12741 Rename count1 to count.
12742 (recombine_windows, delete_deletable_window, resize_root_window)
12743 (Fdelete_other_windows_internal)
12744 (Frun_window_configuration_change_hook, make_parent_window)
12745 (resize_window_check, resize_window_apply, Fresize_window_apply)
12746 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
12747 (Fdelete_window_internal, Fresize_mini_window_internal):
12748 New functions.
1a13852e
MR
12749 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
12750
f3d1777e
MR
127512011-06-08 Martin Rudalics <rudalics@gmx.at>
12752
496e208e
MR
12753 * window.h (window): Add some new members to window structure -
12754 normal_lines, normal_cols, new_total, new_normal, clone_number,
12755 splits, nest, prev_buffers, next_buffers.
12756 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 12757 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 12758
f3d1777e
MR
12759 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
12760 Remove.
496e208e
MR
12761 (make_dummy_parent): Set new members of windows structure.
12762 (make_window): Move down in code. Handle new members of window
12763 structure.
12764 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
12765 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
12766 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
12767 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
12768 (Fset_window_next_buffers, Fset_window_clone_number):
12769 New functions.
496e208e
MR
12770 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
12771 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
12772 Doc-string fixes.
12773 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
12774 Argument WINDOW can be now internal window too.
12775 (Fwindow_use_time): Move up in code.
12776 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
12777 Rewrite doc-string.
12778 (Fset_window_configuration, saved_window)
12779 (Fcurrent_window_configuration, save_window_save): Handle new
12780 members of window structure.
b9e809c2
MR
12781 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
12782 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
12783 (syms_of_window): New Lisp objects Qrecord_window_buffer,
12784 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
12785 Qget_mru_window, Qresize_root_window,
12786 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
12787 Qauto_buffer_name; staticpro them.
f3d1777e 12788
abde8f8c
MR
127892011-06-07 Martin Rudalics <rudalics@gmx.at>
12790
12791 * window.c (Fwindow_total_size, Fwindow_left_column)
12792 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
12793 (Fwindow_list_1): New functions.
12794 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
12795 (Fwindow_width, Fscroll_left, Fscroll_right):
12796 Use window_body_cols instead of window_box_text_cols.
12797 (delete_window, Fset_window_configuration):
12798 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
12799 (delete_all_subwindows): Take a window as argument and not a
12800 structure. Rewrite.
190b47e6
MR
12801 (window_loop): Remove handling of GET_LRU_WINDOW and
12802 GET_LARGEST_WINDOW.
12803 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
12804
12805 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
12806 window_box_text_cols. delete_all_subwindows now takes a
12807 Lisp_Object as argument.
abde8f8c 12808
640c8776
SM
12809 * indent.c (compute_motion, Fcompute_motion):
12810 Use window_body_cols instead of window_box_text_cols.
abde8f8c 12811
fa8a67e6
MR
12812 * frame.c (delete_frame): Call delete_all_subwindows with root
12813 window as argument.
12814
a54e3482
DC
128152011-06-07 Daniel Colascione <dan.colascione@gmail.com>
12816
12817 * fns.c (Fputhash): Document return value.
12818
60002bf5
CY
128192011-06-06 Chong Yidong <cyd@stupidchicken.com>
12820
12821 * image.c (gif_load): Implement gif89a spec "no disposal" method.
12822
0c671da6 128232011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 12824
b862a52a 12825 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 12826
be44ca6c
PE
12827 Check for overflow when converting integer to cons and back.
12828 * charset.c (Fdefine_charset_internal, Fdecode_char):
12829 Use cons_to_unsigned to catch overflow.
12830 (Fencode_char): Use INTEGER_TO_CONS.
12831 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
12832 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
12833 * data.c (long_to_cons, cons_to_long): Remove.
12834 (cons_to_unsigned, cons_to_signed): New functions.
12835 These signal an error for invalid or out-of-range values.
12836 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
12837 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
12838 * font.c (Ffont_variation_glyphs):
12839 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
12840 * lisp.h: Include <intprops.h>.
12841 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
12842 (cons_to_signed, cons_to_unsigned): New decls.
12843 (long_to_cons, cons_to_long): Remove decls.
12844 * undo.c (record_first_change): Use INTEGER_TO_CONS.
12845 (Fprimitive_undo): Use CONS_TO_INTEGER.
12846 * xfns.c (Fx_window_property): Likewise.
12847 * xselect.c: Include <limits.h>.
12848 (x_own_selection, selection_data_to_lisp_data):
12849 Use INTEGER_TO_CONS.
12850 (x_handle_selection_request, x_handle_selection_clear)
12851 (x_get_foreign_selection, Fx_disown_selection_internal)
12852 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
12853 (lisp_data_to_selection_data): Use cons_to_unsigned.
12854 (x_fill_property_data): Use cons_to_signed.
12855 Report values out of range.
12856
d1f3d2af
PE
12857 Check for buffer and string overflow more precisely.
12858 * buffer.h (BUF_BYTES_MAX): New macro.
12859 * lisp.h (STRING_BYTES_MAX): New macro.
12860 * alloc.c (Fmake_string):
12861 * character.c (string_escape_byte8):
12862 * coding.c (coding_alloc_by_realloc):
12863 * doprnt.c (doprnt):
12864 * editfns.c (Fformat):
12865 * eval.c (verror):
12866 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
12867 since they may not be the same number.
12868 * editfns.c (Finsert_char):
12869 * fileio.c (Finsert_file_contents):
12870 Likewise for BUF_BYTES_MAX.
12871
dd52fcea
PE
12872 * image.c: Use ptrdiff_t, not int, for sizes.
12873 (slurp_file): Switch from int to ptrdiff_t.
12874 All uses changed.
12875 (slurp_file): Check that file size fits in both size_t (for
12876 malloc) and ptrdiff_t (for sanity and safety).
12877
7f9bbdbb
PE
12878 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
12879 if b->modtime has its maximal value.
12880
dfe18f82
PE
12881 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
12882
84acfcf0
PE
12883 Don't assume time_t can fit into int.
12884 * buffer.h (struct buffer.modtime): Now time_t, not int.
12885 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
12886 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
12887
ccd9a01a
PE
12888 Minor fixes for signed vs unsigned integers.
12889 * character.h (MAYBE_UNIFY_CHAR):
12890 * charset.c (maybe_unify_char):
12891 * keyboard.c (read_char, reorder_modifiers):
12892 XINT -> XFASTINT, since the integer must be nonnegative.
12893 * ftfont.c (ftfont_spec_pattern):
12894 * keymap.c (access_keymap, silly_event_symbol_error):
12895 XUINT -> XFASTINT, since the integer must be nonnegative.
12896 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
12897 since it makes no difference and we prefer signed.
12898 * keyboard.c (record_char): Use XUINT when all the neighbors do.
12899 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
12900 nonnegative.
12901
d6d100dd
SM
129022011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
12903
12904 * window.h (Fwindow_frame): Declare.
12905
2b6148e4
PE
129062011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12907
12908 * alloc.c: Simplify handling of large-request failures (Bug#8800).
12909 (SPARE_MEMORY): Always define.
12910 (LARGE_REQUEST): Remove.
12911 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
12912
f230ecc9
MR
129132011-06-06 Martin Rudalics <rudalics@gmx.at>
12914
727e958e
MR
12915 * lisp.h: Move EXFUNS for Fframe_root_window,
12916 Fframe_first_window and Fset_frame_selected_window to window.h.
12917
12918 * window.h: Move EXFUNS for Fframe_root_window,
12919 Fframe_first_window and Fset_frame_selected_window here from
12920 lisp.h.
12921
12922 * frame.c (Fwindow_frame, Fframe_first_window)
12923 (Fframe_root_window, Fframe_selected_window)
12924 (Fset_frame_selected_window): Move to window.c.
12925 (Factive_minibuffer_window): Move to minibuf.c.
12926 (Fother_visible_frames_p): New function.
12927
12928 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
12929
f230ecc9
MR
12930 * window.c (decode_window, decode_any_window): Move up in code.
12931 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
12932 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
12933 (Fwindow_buffer): Move up and rewrite doc-string.
12934 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
12935 (Fwindow_prev): New functions.
727e958e
MR
12936 (Fwindow_frame): Move here from frame.c. Accept any window as
12937 argument.
12938 (Fframe_root_window, Fframe_first_window)
12939 (Fframe_selected_window): Move here from frame.c. Accept frame
12940 or arbitrary window as argument. Update doc-strings.
12941 (Fminibuffer_window): Move up in code.
12942 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
12943 (Fset_frame_selected_window): Move here from frame.c.
12944 Marginal rewrite.
727e958e
MR
12945 (Fselected_window, select_window, Fselect_window): Move up in
12946 code. Minor doc-string fixes.
f230ecc9 12947
4d09bcf6
PE
129482011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12949
12950 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
12951 Do not assume that spare memory exists; that assumption is valid
12952 only if SYSTEM_MALLOC.
12953 (LARGE_REQUEST): New macro, so that the issue of large requests
12954 is separated from the issue of spare memory.
12955
810928a2
AS
129562011-06-05 Andreas Schwab <schwab@linux-m68k.org>
12957
172418ad
AS
12958 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
12959 format. (Bug#8806)
12960
43f862f7
AS
12961 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
12962
810928a2
AS
12963 * xfns.c (x_set_scroll_bar_default_width): Move declarations
12964 before statements.
12965
a059fe24
JD
129662011-06-05 Jan Djärv <jan.h.d@swipnet.se>
12967
12968 * gtkutil.c (xg_get_default_scrollbar_width): New function.
12969
12970 * gtkutil.h: Declare xg_get_default_scrollbar_width.
12971
12972 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
12973 min width by calling x_set_scroll_bar_default_width (Bug#8505).
12974
989bf368
JB
129752011-06-05 Juanma Barranquero <lekktu@gmail.com>
12976
12977 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
12978
4b80f674
CY
129792011-06-04 Chong Yidong <cyd@stupidchicken.com>
12980
12981 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
12982 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
12983 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
12984 New error handlers.
4b80f674
CY
12985 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
12986 Obey Vx_select_enable_clipboard_manager. Catch errors in
12987 x_clipboard_manager_save (Bug#8779).
12988 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 12989 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 12990
99a33b77 129912011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
12992
12993 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
12994
99a33b77 129952011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
12996
12997 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
12998 in the current matrix if keep_current_p is non-zero.
12999
8264569d
EZ
130002011-06-04 Eli Zaretskii <eliz@gnu.org>
13001
13002 * bidi.c (bidi_level_of_next_char): Fix last change.
13003
57f97249
EZ
130042011-06-03 Eli Zaretskii <eliz@gnu.org>
13005
fec2107c 13006 Support bidi reordering of text covered by display properties.
57f97249 13007
fec2107c
EZ
13008 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
13009 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
13010 (bidi_cache_search, bidi_cache_iterator_state)
13011 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
13012 (bidi_level_of_next_char, bidi_move_to_visually_next):
13013 Support character positions inside a run of characters covered by a
fec2107c
EZ
13014 display string.
13015 (bidi_paragraph_init, bidi_resolve_explicit_1)
13016 (bidi_level_of_next_char): Call bidi_fetch_char and
13017 bidi_fetch_char_advance instead of FETCH_CHAR and
13018 FETCH_CHAR_ADVANCE.
13019 (bidi_init_it): Initialize new members.
13020 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
13021 definitions.
13022 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
13023 instead of using explicit *_CHAR codes.
d6d100dd
SM
13024 (bidi_resolve_explicit, bidi_resolve_weak):
13025 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
13026 bidirectional text is supported only in multibyte buffers.
13027 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
13028 it to initialize the frame_window_p member of struct bidi_it.
13029 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
13030 (bidi_resolve_explicit, bidi_resolve_weak)
13031 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
13032 bidi_it->nchars is non-positive.
13033 (bidi_level_of_next_char): Don't try to lookup the cache for the
13034 next/previous character if nothing is cached there yet, or if we
13035 were just reseat()'ed to a new position.
c40e2fb2 13036
0e14fe90
EZ
13037 * xdisp.c (set_cursor_from_row): Set start and stop points
13038 according to the row's direction when priming the loop that looks
13039 for the glyph on which to display cursor.
13040 (single_display_spec_intangible_p): Function deleted.
13041 (display_prop_intangible_p): Reimplement to call
13042 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
13043 Accept 3 additional arguments needed by handle_display_spec.
13044 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
13045 values: lists, `(when COND...)' forms, etc.
13046 (single_display_spec_string_p): Support property values that are
13047 lists with the argument STRING its top-level element.
13048 (display_prop_string_p): Fix the condition for processing a
13049 property that is a list to be consistent with handle_display_spec.
fec2107c 13050 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
13051 last portion of handle_display_prop.
13052 (compute_display_string_pos): Accept additional argument
13053 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
13054 value of a `display' property is a "replacing spec".
13055 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
13056 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
13057 the display property, but just return a value indicating whether
13058 the display property will replace the characters it covers.
13059 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
13060 frame_window_p members of struct bidi_it.
d6d100dd
SM
13061 (compute_display_string_pos, compute_display_string_end):
13062 New functions.
fec2107c
EZ
13063 (push_it): Accept second argument POSITION, where pop_it should
13064 jump to continue iteration.
13065 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 13066
fec2107c
EZ
13067 * keyboard.c (adjust_point_for_property): Adjust the call to
13068 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
13069
13070 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
13071 (bidi_init_it): Update prototypes.
13072 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
13073 (compute_display_string_pos, compute_display_string_end):
13074 Declare prototypes.
fec2107c
EZ
13075 (struct bidi_it): New members nchars and disp_pos. ch_len is now
13076 EMACS_INT.
fc6f18ce 13077
40087514 130782011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 13079
57f53182
PE
13080 Malloc failure behavior now depends on size of allocation.
13081 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
13082 * lisp.h: Change signatures accordingly.
13083 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
13084 All callers changed. (Bug#8762)
13085
13086 * gnutls.c: Use Emacs's memory allocators.
13087 Without this change, the gnutls library would invoke malloc etc.
13088 directly, which causes problems on non-SYNC_INPUT hosts, and which
13089 runs afoul of improving memory_full behavior. (Bug#8761)
13090 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
13091 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
13092 xfree instead of the default malloc, realloc, free.
13093 (Fgnutls_boot): No need to check for memory allocation failure,
13094 since xmalloc does that for us.
13095
ac32cd99 13096 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
13097 * category.c (hash_get_category_set):
13098 * ccl.c (ccl_driver):
13099 * charset.c (Fdefine_charset_internal):
13100 * charset.h (struct charset.hash_index):
13101 * composite.c (get_composition_id, gstring_lookup_cache)
13102 (composition_gstring_put_cache):
13103 * composite.h (struct composition.hash_index):
13104 * dispextern.h (struct image.hash):
13105 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
13106 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
13107 (hashfn_equal, hashfn_user_defined, make_hash_table)
13108 (maybe_resize_hash_table, hash_lookup, hash_put)
13109 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
13110 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
13111 (Fsxhash, Fgethash, Fputhash, Fmaphash):
13112 * image.c (make_image, search_image_cache, lookup_image)
13113 (xpm_put_color_table_h):
13114 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 13115 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 13116 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 13117 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
13118 * alloc.c (allocate_vectorlike):
13119 Check for overflow in vector size calculations.
13120 * ccl.c (ccl_driver):
13121 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
13122 * fns.c, image.c: Remove unnecessary static decls that would otherwise
13123 need to be updated by these changes.
40087514
PE
13124 * fns.c (make_hash_table, maybe_resize_hash_table):
13125 Check for integer overflow with large hash tables.
0de4bb68
PE
13126 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
13127 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
13128 (SXHASH_REDUCE): New macro.
13129 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
13130 Use it instead of discarding useful hash info with large hash values.
13131 (sxhash_float): New function.
13132 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
13133 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
13134 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
13135 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
13136 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
13137 Adjust signatures to match updated version of code.
13138 (consing_since_gc): Now EMACS_INT, since a single hash table can
13139 use more than INT_MAX bytes.
13140
698d32e2
DN
131412011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
13142
13143 Make it possible to build with GCC-4.6+ -O2 -flto.
13144
13145 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
13146
fd6fa53f
SM
131472011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
13148
13149 * minibuf.c (get_minibuffer, read_minibuf_unwind):
13150 Call minibuffer-inactive-mode.
13151
864db017
JB
131522011-05-31 Juanma Barranquero <lekktu@gmail.com>
13153
13154 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
13155 Update dependencies.
13156
2ad0baf4
DN
131572011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13158
13159 * data.c (init_data): Remove code for UTS, this system is not
13160 supported anymore.
13161
4fcc2638
DN
131622011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13163
13164 Don't force ./temacs to start in terminal mode.
13165
13166 * frame.c (make_initial_frame): Initialize faces in all cases, not
13167 only when CANNOT_DUMP is defined.
13168 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
13169
c56e0fd5
DN
131702011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13171
13172 * dispnew.c (add_window_display_history): Use const for the string
13173 pointer. Remove declaration, not needed.
13174
333d54da 131752011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 13176
55d4c1b2 13177 Use 'inline', not 'INLINE'.
333d54da 13178 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
13179 * alloc.c, fontset.c (INLINE): Remove.
13180 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
13181 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
13182 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
13183 * gmalloc.c (register_heapinfo): Use inline unconditionally.
13184 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
13185
738db178
DN
131862011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13187
13188 Make it possible to run ./temacs.
13189
13190 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
13191 syms_of_callproc does the same thing. Remove test for
13192 "initialized", do it in the caller.
13193 * emacs.c (main): Avoid calling set_initial_environment when dumping.
13194
620c53a6
SM
131952011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
13196
13197 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
13198 (read_minibuf): Use get_minibuffer.
13199 (syms_of_minibuf): Use DEFSYM.
13200 (Qmetadata): New var.
13201 * data.c (Qbuffer): Don't make it static.
13202 (syms_of_data): Use DEFSYM.
13203
e003a292
PE
132042011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13205
13206 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
13207 (CCL_CODE_MIN): New macro.
13208
ed008a6d
PE
132092011-05-30 Paul Eggert <eggert@cs.ucla.edu>
13210
3687c2ef
PE
13211 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
13212
ed008a6d
PE
13213 * eval.c (Qdebug): Now static.
13214 * lisp.h (Qdebug): Remove decl. This reverts a part of the
13215 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
13216 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
13217
d66c4c7c
CY
132182011-05-29 Chong Yidong <cyd@stupidchicken.com>
13219
13220 * image.c: Various fixes to ImageMagick code comments.
13221 (Fimagemagick_types): Doc fix.
13222
5fbc2025
PE
132232011-05-29 Paul Eggert <eggert@cs.ucla.edu>
13224
0196f88a
PE
13225 Minor fixes prompted by GCC 4.6.0 warnings.
13226
13227 * xselect.c (converted_selections, conversion_fail_tag): Now static.
13228
5fbc2025
PE
13229 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
13230 (x_clipboard_manager_save_all): Move extern decl to ...
13231 * xterm.h: ... here, so that it can be checked for consistency.
13232
1dd3c2d9
CY
132332011-05-29 Chong Yidong <cyd@stupidchicken.com>
13234
13235 * xselect.c (x_clipboard_manager_save_frame)
13236 (x_clipboard_manager_save_all): New functions.
13237 (Fx_clipboard_manager_save): Lisp function deleted.
13238
13239 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
13240 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
13241
13242 * xterm.h: Update prototype.
13243
5ba6571d
WX
132442011-05-28 William Xu <william.xwl@gmail.com>
13245
13246 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
13247 exiting (Bug#8239).
13248
3eaff834
JM
132492011-05-28 Jim Meyering <meyering@redhat.com>
13250
e1900994 13251 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
13252 * fns.c (to_uchar): Define.
13253 (crypto_hash_function): Use it to convert some newly-signed
13254 variables to unsigned, to avoid sign-extension bugs. For example,
13255 without this change, (md5 "truc") would evaluate to
13256 45723a2aff78ff4fff7fff1114760e62 rather than the expected
13257 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 13258 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 13259
0f6990a7
PE
132602011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13261
13262 Integer overflow fixes.
c8a9ca5a 13263
08686060
PE
13264 * dbusbind.c: Serial number integer overflow fixes.
13265 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
13266 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
13267 to hold a serial number that is too large for a fixnum.
13268 (Fdbus_method_return_internal, Fdbus_method_error_internal):
13269 Check for serial numbers out of range. Decode any serial number
59568bf0 13270 that was so large that it became a float. (Bug#8722)
08686060 13271
2d1fc3c7
PE
13272 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
13273 (Fdbus_call_method, Fdbus_call_method_asynchronously):
13274 Use XFASTINT rather than XUINT when numbers are nonnegative.
13275 (xd_append_arg, Fdbus_method_return_internal):
13276 (Fdbus_method_error_internal): Likewise. Also, for unsigned
13277 arguments, check that Lisp number is nonnegative, rather than
59568bf0 13278 silently wrapping negative numbers around. (Bug#8722)
30217ff0 13279 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 13280 (Bug#8722)
2d1fc3c7 13281
c8a9ca5a
PE
13282 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
13283
519e1d69
PE
13284 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
13285
6df6ae42 13286 ccl: Add integer overflow checks.
30569699
PE
13287 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
13288 (IN_INT_RANGE): New macros.
13289 (ccl_driver): Use them to check for integer overflow when
13290 decoding a CCL program. Many of the new checks are whether XINT (x)
13291 fits in int; it doesn't always, on 64-bit hosts. The new version
13292 doesn't catch all possible integer overflows, but it's an
847044ea 13293 improvement. (Bug#8719)
30569699 13294
c11285dc
PE
13295 * alloc.c (make_event_array): Use XINT, not XUINT.
13296 There's no need for unsigned here.
13297
fdccd48e
PE
13298 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
13299 This follows up to the 2011-05-06 change that substituted uintptr_t
13300 for EMACS_INT. This case wasn't caught back then.
13301
37910ab2
PE
13302 Rework Fformat to avoid integer overflow issues.
13303 * editfns.c: Include <float.h> unconditionally, as it's everywhere
13304 now (part of C89). Include <verify.h>.
13305 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
13306 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
13307 (Fformat): Avoid the prepass trying to compute sizes; it was only
13308 approximate and thus did not catch overflow reliably. Instead, walk
13309 through the format just once, formatting and computing sizes as we go,
13310 checking for integer overflow at every step, and allocating a larger
13311 buffer as needed. Keep track separately whether the format is
13312 multibyte. Keep only the most-recently calculated precision, rather
13313 than them all. Record whether each argument has been converted to
13314 string. Use EMACS_INT, not int, for byte and char and arg counts.
13315 Support field widths and precisions larger than INT_MAX. Avoid
13316 sprintf's undefined behavior with conversion specifications such as %#d
13317 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
13318 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
13319 formatting out-of-range floating point numbers with int
9173deec 13320 formats. (Bug#8668)
37910ab2 13321
2e6578fb
PE
13322 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
13323
0ae6bdee
PE
13324 * data.c: Avoid integer truncation in expressions involving floats.
13325 * data.c: Include <intprops.h>.
13326 (arith_driver): When there's an integer overflow in an expression
13327 involving floating point, convert the integers to floating point
13328 so that the resulting value does not suffer from catastrophic
13329 integer truncation. For example, on a 64-bit host (* 4
13330 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
13331 Do not rely on undefined behavior after integer overflow.
13332
de883a70
PE
13333 merge count_size_as_multibyte, parse_str_to_multibyte
13334 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 13335 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
13336 Check for integer overflow.
13337 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
13338 since it's now a duplicate of the other. This is more of
13339 a character than a buffer op, so better that it's in character.c.
13340 * fns.c, print.c: Adjust to above changes.
13341
2ff916cb
PE
133422011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
13343
13344 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
13345
f1b54466
PE
133462011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13347
fb1ac845
PE
13348 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
13349 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
13350 (x_clipboard_manager_save): Now static.
13351 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
13352
f1b54466
PE
13353 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
13354 (crypto_hash_function): Now static.
13355 Fix pointer signedness problems. Avoid unnecessary initializations.
13356
a9f737ee
CY
133572011-05-27 Chong Yidong <cyd@stupidchicken.com>
13358
13359 * termhooks.h (Vselection_alist): Make it terminal-local.
13360
13361 * terminal.c (create_terminal): Initialize it.
13362
13363 * xselect.c: Support for clipboard managers.
13364 (Vselection_alist): Move to termhooks.h as terminal-local var.
13365 (LOCAL_SELECTION): New macro.
13366 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
13367 (symbol_to_x_atom): Remove gratuitous arg.
13368 (x_handle_selection_request, lisp_data_to_selection_data)
13369 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
13370 (x_own_selection, x_get_local_selection, x_convert_selection):
13371 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
13372 (some_frame_on_display): Delete unused function.
13373 (Fx_own_selection_internal, Fx_get_selection_internal)
13374 (Fx_disown_selection_internal, Fx_selection_owner_p)
13375 (Fx_selection_exists_p): New optional frame arg.
13376 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
13377 (x_handle_selection_clear): Don't treat other terminals with the
13378 same keyboard specially. Use the terminal-local Vselection_alist.
13379 (x_clear_frame_selections): Use Frun_hook_with_args.
13380
13381 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
13382
13383 * xterm.h: Add support for those atoms.
13384
e067f0c1
CY
133852011-05-26 Chong Yidong <cyd@stupidchicken.com>
13386
13387 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
13388 (converted_selections, conversion_fail_tag): New global variables.
13389 (x_selection_request_lisp_error): Free the above.
13390 (x_get_local_selection): Remove unnecessary code.
13391 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
13392 of converted selections stored in converted_selections.
13393 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
13394 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
13395 (x_convert_selection): New function.
13396 (x_handle_selection_event): Simplify.
13397 (x_get_foreign_selection): Don't ignore incoming requests while
13398 waiting for an answer; this will fail when we implement
13399 SAVE_TARGETS, and seems unnecessary anyway.
13400 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
13401 (Vx_sent_selection_functions): Doc fix.
13402
0f4aebc0
LL
134032011-05-26 Leo Liu <sdl.web@gmail.com>
13404
13405 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
13406
e61124cd
YM
134072011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13408
13409 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
13410
13411 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
13412 for fringe update if it has periodic bitmap.
ac389d0c 13413 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
13414 and fringe_bitmap_periodic_p.
13415
13416 * fringe.c (get_fringe_bitmap_data): New function.
13417 (draw_fringe_bitmap_1, update_window_fringes): Use it.
13418 (update_window_fringes): Record periodicity of fringe bitmap in glyph
13419 row. Mark glyph row for fringe update if periodicity changed.
13420
13421 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
13422 for fringe update unless it has periodic bitmap.
13423
f16d9837
KH
134242011-05-25 Kenichi Handa <handa@m17n.org>
13425
13426 * xdisp.c (get_next_display_element): Set correct it->face_id for
13427 a static composition.
13428
e1b90ef6
LL
134292011-05-24 Leo Liu <sdl.web@gmail.com>
13430
13431 * deps.mk (fns.o):
13432 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
13433
13434 * fns.c (crypto_hash_function, Fsha1): New function.
13435 (Fmd5): Use crypto_hash_function.
13436 (syms_of_fns): Add Ssha1.
13437
7400048f
PE
134382011-05-22 Paul Eggert <eggert@cs.ucla.edu>
13439
13440 * gnutls.c: Remove unused macros.
13441 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
13442 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
13443 Remove macros that are defined and never used.
13444 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
13445
abb71cf4
CY
134462011-05-22 Chong Yidong <cyd@stupidchicken.com>
13447
13448 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
13449 (Fx_get_selection_internal): Minor cleanup.
13450 (Fx_own_selection_internal): Rename arguments for consistency with
13451 select.el.
13452
6307db39
PE
134532011-05-22 Paul Eggert <eggert@cs.ucla.edu>
13454
13455 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
13456
f3d4e0a4
CY
134572011-05-22 Chong Yidong <cyd@stupidchicken.com>
13458
13459 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
13460
4d8ade89
YM
134612011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13462
13463 * dispnew.c (scrolling_window): Don't exclude the case that the
13464 last enabled row in the desired matrix touches the bottom boundary.
13465
32078c8d
GM
134662011-05-21 Glenn Morris <rgm@gnu.org>
13467
13468 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
13469 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
13470 and add some more files.
32078c8d 13471
7285dc67
EZ
134722011-05-20 Eli Zaretskii <eliz@gnu.org>
13473
13474 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
13475 report_file_error introduced by the change from 2011-05-07.
13476
89d1bd22
PE
134772011-05-20 Paul Eggert <eggert@cs.ucla.edu>
13478
13479 * systime.h (Time): Define only if emacs is defined.
13480 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
13481 where the include path doesn't have X11/X.h by default. See
13482 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
13483
cd394be1 134842011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
13485
13486 * composite.c (find_automatic_composition): Fix previous change.
13487
b9704ad9
GM
134882011-05-20 Glenn Morris <rgm@gnu.org>
13489
13490 * lisp.mk: New file, split from Makefile.in.
13491 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
13492 (shortlisp): Remove.
13493 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
13494
4a720484
GM
134952011-05-19 Glenn Morris <rgm@gnu.org>
13496
13497 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
13498 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
13499 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
13500 (lisp): Set the order to that of loadup.el.
13501 (shortlisp): Make it a copy of $lisp.
13502 (SOME_MACHINE_LISP): Remove.
13503 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
13504 Use just $shortlisp, not $SOME_MACHINE_LISP too.
13505
a28d4396
KH
135062011-05-18 Kenichi Handa <handa@m17n.org>
13507
13508 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
13509 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
13510 (find_automatic_composition): Mostly rewrite for efficiency.
13511
a2b1fa8e
JB
135122011-05-18 Juanma Barranquero <lekktu@gmail.com>
13513
13514 * makefile.w32-in: Update dependencies.
13515
8e1f5610
CS
135162011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
13517
13518 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 13519 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 13520
7025ee00 135212011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 13522
cdfa6eab
PE
13523 Fix some integer overflow issues, such as string length overflow.
13524
06d6db33
PE
13525 * insdel.c (count_size_as_multibyte): Check for string overflow.
13526
2b4560a8
PE
13527 * character.c (lisp_string_width): Check for string overflow.
13528 Use EMACS_INT, not int, for string indexes and lengths; in
13529 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
13530 the resulting string length overflows an EMACS_INT; instead,
13531 report a string overflow if no precision given. When checking for
13532 precision exhaustion, use a check that cannot possibly have
13533 integer overflow. (Bug#8675)
13534 * character.h (lisp_string_width): Adjust to new signature.
13535
cb93f9be
PE
13536 * alloc.c (string_overflow): New function.
13537 (Fmake_string): Use it. This doesn't change behavior, but saves
13538 a few bytes and will simplify future changes.
13539 * character.c (string_escape_byte8): Likewise.
13540 * lisp.h (string_overflow): New decl.
13541
1a1f3366
PE
13542 Fixups, following up to the user-interface timestamp change.
13543 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
13544 for UI timestamps, instead of unsigned long.
9fbd6841
PE
13545 * msdos.c (mouse_get_pos): Likewise.
13546 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
13547 * w32gui.h (Time): Define by including "systime.h" rather than by
13548 declaring it ourselves. (Bug#8664)
13549
d4e3e4d3
PE
13550 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
13551 * image.c (clear_image_cache): Likewise.
13552
f6a24d19
PE
13553 * term.c (term_mouse_position): Don't assume time_t wraparound.
13554
08dc5ae6
PE
13555 Be more systematic about user-interface timestamps.
13556 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
13557 and sometimes 'EMACS_UINT', to represent these timestamps.
13558 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
13559 This makes the code easier to follow, and makes it easier to catch
13560 integer overflow bugs such as Bug#8664.
13561 * frame.c (Fmouse_position, Fmouse_pixel_position):
13562 Use Time, not unsigned long, for user-interface timestamps.
13563 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
13564 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
13565 * keyboard.h (last_event_timestamp): Likewise.
13566 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
13567 * menu.h (xmenu_show): Likewise.
13568 * term.c (term_mouse_position): Likewise.
13569 * termhooks.h (struct input_event.timestamp): Likewise.
13570 (struct terminal.mouse_position_hook): Likewise.
13571 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
13572 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
13573 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
13574 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
13575 what it was before.
13576 * menu.h, termhooks.h: Include "systime.h", for Time.
13577
8e55734a
PE
13578 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
13579 Don't assume that the difference between two unsigned long values
13580 can fit into an integer. At this point, we know button_down_time
13581 <= event->timestamp, so the difference must be nonnegative, so
13582 there's no need to cast the result if double-click-time is
13583 nonnegative, as it should be; check that it's nonnegative, just in
13584 case. This bug is triggered when events are more than 2**31 ms
86db42d2 13585 apart (about 25 days). (Bug#8664)
8e55734a 13586
841f1b75 13587 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 13588 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 13589
3e26f69c
PE
13590 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
13591 that always fit in int. Use a sentinel instead of a counter, to
13592 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
13593 * frame.h (struct frame): Use int for menu_bar_items_used
13594 instead of EMACS_INT, since it always fits in int.
3e26f69c 13595
5cc152c0
PE
13596 * menu.c (grow_menu_items): Check for int overflow.
13597
d89eb65e
PE
13598 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
13599
5235bd3e
PE
13600 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
13601 Before, the code was not consistent. These values cannot exceed
13602 2**31 - 1 so there's no need to make them unsigned.
13603 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
13604 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
13605 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
13606 as modifiers.
13607 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
13608
bc827e23
PE
13609 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
13610 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
13611 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
13612 presumably because the widths might not match.
13613
78eb494e
PE
13614 * window.c (size_window): Avoid needless test at loop start.
13615
04f2d78b
CB
136162011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
13617
13618 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
13619
d2fc7e3d 136202011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
13621
13622 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
13623
d2fc7e3d 136242011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
13625
13626 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
13627 `width' to `bar_area_x' and `bar_area_width', respectively.
13628 (x_scroll_run): Take account of fringe background extension.
13629
04f2d78b
CB
13630 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
13631 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
13632 `bar_area_width', respectively.
13633 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
13634 background extension.
13635
79b70037
GM
136362011-05-10 Jim Meyering <meyering@redhat.com>
13637
13638 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
13639
2f142cc5
JB
136402011-05-10 Juanma Barranquero <lekktu@gmail.com>
13641
13642 * image.c (Finit_image_library): Return t for built-in image types,
13643 like pbm and xbm. (Bug#8640)
13644
57679c86
AS
136452011-05-09 Andreas Schwab <schwab@linux-m68k.org>
13646
13647 * w32menu.c (set_frame_menubar): Fix submenu allocation.
13648
888c9e86
EZ
136492011-05-07 Eli Zaretskii <eliz@gnu.org>
13650
b0512a1d
EZ
13651 * w32console.c (Fset_screen_color): Doc fix.
13652 (Fget_screen_color): New function.
13653 (syms_of_ntterm): Defsubr it.
13654
7285dc67
EZ
13655 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
13656 unlink the temporary file if Fcall_process didn't create it in the
13657 first place.
13658 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
13659 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
13660 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
13661 cue to call_process_cleanup not to close that handle.
13662
4d3fcc8e
BK
136632011-05-07 Ben Key <bkey76@gmail.com>
13664
13665 * makefile.w32-in: The bootstrap-temacs rule now makes use of
13666 one of two shell specific rules, either bootstrap-temacs-CMD or
13667 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
13668 to the previous implementation of the bootstrap-temacs rule.
13669 The bootstrap-temacs-CMD rule is similar to the previous
13670 implementation of the bootstrap-temacs rule except that it
13671 makes use of the ESC_CFLAGS variable instead of the CFLAGS
13672 variable.
13673
13674 These changes, along with some changes to nt/configure.bat,
13675 nt/gmake.defs, and nt/nmake.defs, are required to extend my
13676 earlier fix to add support for --cflags and --ldflags options
13677 that include quotes so that it works whether make uses cmd or
13678 sh as the shell.
13679
b4289b64
MA
136802011-05-06 Michael Albinus <michael.albinus@gmx.de>
13681
13682 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
13683 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
13684 is a constant.
13685 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
13686 a string. Handle both cases.
13687 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
13688 (Fdbus_register_method): Use Qinvalid_function.
13689
af4c0e28
JB
136902011-05-06 Juanma Barranquero <lekktu@gmail.com>
13691
13692 * makefile.w32-in: Update dependencies.
13693 (LISP_H): Add inttypes.h and stdin.h.
13694 (PROCESS_H): Add unistd.h.
13695
c51453d9
EZ
136962011-05-06 Eli Zaretskii <eliz@gnu.org>
13697
13698 * lread.c: Include limits.h (fixes the MS-Windows build broken by
13699 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
13700
8ff0ac3c 137012011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 13702
4c4b566b
PE
13703 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
13704
aab2b9b5
PE
13705 * term.c (vfatal): Remove stray call to va_end.
13706 It's not needed and the C Standard doesn't allow it here anyway.
13707
c378da0b
PE
13708 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
13709 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
13710
288b08c7
PE
13711 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
13712 bytes.
13713
e3601888
PE
13714 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
13715
db6c0e74
PE
13716 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13717
dd5963ea
PE
13718 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
13719
88c9450f
PE
13720 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
13721
2f9442b8
PE
13722 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
13723
c032b5f8
PE
13724 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
13725 * charset.c (Fdefine_charset_internal): Don't initialize
13726 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 13727 32-bit int (Bug#8600).
a108c10b
PE
13728
13729 * lread.c (read_integer): Be more consistent with string-to-number.
13730 Use string_to_number to do the actual conversion; this avoids
13731 rounding errors and fixes some other screwups. Without this fix,
13732 for example, #x1fffffffffffffff was misread as -2305843009213693952.
13733 (digit_to_number): Move earlier, for benefit of read_integer.
13734 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 13735 not a digit in any supported base. (Bug#8602)
a108c10b 13736
ad5f9eea
PE
13737 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
13738
aec1708a
PE
13739 * dispnew.c (scrolling_window): Return 1 if we scrolled,
13740 to match comment at start of function. This also removes a
13741 GCC warning about overflow in a 32+64-bit port.
13742
47be4ab5
PE
13743 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
13744
371cac43
PE
13745 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
13746 Reported by Stefan Monnier in
13747 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
13748 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13749 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 13750
d01a7826
PE
13751 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
13752 (EMACS_UINTPTR): Likewise, with uintptr_t.
13753
7fd47d5c
PE
13754 * lisp.h: Prefer 64-bit EMACS_INT if available.
13755 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
13756 on 32-bit hosts that have 64-bit int, so that they can access
13757 large files.
122b0c86
PE
13758 However, temporarily disable this change unless the temporary
13759 symbol WIDE_EMACS_INT is defined.
7fd47d5c 13760
8727937b
PE
13761 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
13762
8ac068ac
PE
13763 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
13764 This removes an assumption that EMACS_INT and long are the same
13765 width as pointers. The assumption is true for Emacs porting targets
13766 now, but we want to make other targets possible.
13767 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
13768 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
13769 In the rest of the code, change types of integers that hold casted
13770 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
13771 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
13772 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
13773 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
13774 No need to cast type when ORing.
13775 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
13776 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
13777 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
13778 assume EMACS_INT is the same width as char *.
13779 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
13780 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
13781 Remove no-longer-needed casts.
13782 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
13783 (xg_tool_bar_help_callback, xg_make_tool_item):
13784 Use EMACS_INTPTR to hold an integer
13785 that will be cast to void *; this can avoid a GCC warning
13786 if EMACS_INT is not the same width as void *.
13787 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
13788 * xdisp.c (display_echo_area_1, resize_mini_window_1):
13789 (current_message_1, set_message_1):
13790 Use a local to convert to proper width without a cast.
13791 * xmenu.c (dialog_selection_callback): Likewise.
13792
ede49d71
PE
13793 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
13794 Also, don't assume VALBITS / RAND_BITS is less than 5,
13795 and don't rely on undefined behavior when shifting a 1 left into
13796 the sign bit.
13797 * lisp.h (get_random): Change signature to match.
13798
2f30ecd0
PE
13799 * lread.c (hash_string): Use size_t, not int, for hash computation.
13800 Normally we prefer signed values; but hashing is special, because
13801 it's better to use unsigned division on hash table sizes so that
13802 the remainder is nonnegative. Also, size_t is the natural width
13803 for hashing into memory. The previous code used 'int', which doesn't
13804 retain enough info to hash well into very large tables.
13805 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
13806
2a866e7b
PE
13807 * dbusbind.c: Don't possibly lose pointer info when converting.
13808 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13809 Use XPNTR rather than XHASH, so that the high-order bits of
13810 the pointer aren't lost when converting through void *.
13811
51639eac
PE
13812 * eval.c (Fautoload): Don't double-shift a pointer.
13813
92394119
PE
13814 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
13815
dbdb9a7c
JB
138162011-05-06 Juanma Barranquero <lekktu@gmail.com>
13817
13818 * gnutls.c (DEF_GNUTLS_FN):
13819 * image.c (DEF_IMGLIB_FN): Make function pointers static.
13820
db7a0b4f
AS
138212011-05-05 Andreas Schwab <schwab@linux-m68k.org>
13822
13823 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
13824 marker. (Bug#8610)
13825
cd394be1 138262011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
13827
13828 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
13829 New version that can reserve upto 2GB of heap space.
13830
f7ff1b0f 138312011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
13832
13833 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
13834
639c109b
TZ
138352011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
13836
13837 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
13838 `gnutls_certificate_set_x509_key_file'.
13839
d2127135
JB
138402011-05-05 Juanma Barranquero <lekktu@gmail.com>
13841
13842 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
13843 Update dependencies.
13844
e968f4f3
JB
138452011-05-04 Juanma Barranquero <lekktu@gmail.com>
13846
13847 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
13848 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13849 Remove unused parameter `fildes'.
13850 * process.c (read_process_output, send_process): Don't pass it.
13851
84d358f0
JB
138522011-05-04 Juanma Barranquero <lekktu@gmail.com>
13853
13854 Fix previous change: the library cache is defined in w32.c.
13855 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
13856 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
13857
0898ca10
JB
138582011-05-04 Juanma Barranquero <lekktu@gmail.com>
13859
13860 Implement dynamic loading of GnuTLS on Windows.
13861
13862 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
13863 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
13864 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13865 Declare.
13866
13867 * gnutls.c (Qgnutls_dll): Define.
13868 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
13869 (gnutls_*): Declare function pointers.
13870 (init_gnutls_functions): New function to initialize function pointers.
13871 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
13872 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
13873 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13874 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
13875 (emacs_gnutls_write, emacs_gnutls_read)
13876 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
13877 (Fgnutls_available_p): New function.
13878 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
13879 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
13880 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
13881
13882 * image.c: Include w32.h.
13883 (Vimage_type_cache): Delete.
13884 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
13885 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
13886 (w32_delayed_load): Move to w32.c.
13887
13888 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
13889
13890 * w32.c (QCloaded_from, Vlibrary_cache): Define.
13891 (w32_delayed_load): Move from image.c. When loading a library, record
13892 its filename in the :loaded-from property of the library id.
13893 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
13894 Initialize and staticpro them.
13895 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
13896
13897 * process.c: Include lisp.h before w32.h, not after.
13898 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
13899 instead of gnutls_record_check_pending.
13900
13901 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
13902
ff4de4aa
TZ
139032011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
13904
13905 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
13906 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
13907 as passed in.
13908
abe95abb
JD
139092011-05-03 Jan Djärv <jan.h.d@swipnet.se>
13910
13911 * xterm.c (x_set_frame_alpha): Do not set property on anything
13912 else than FRAME_X_OUTER_WINDOW (Bug#8608).
13913
e16e55d4
JB
139142011-05-02 Juanma Barranquero <lekktu@gmail.com>
13915
13916 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
13917
bafcf6a5
JB
139182011-05-02 Juanma Barranquero <lekktu@gmail.com>
13919
13920 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
13921 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
13922 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
13923 (gnutls_global_initialized, Qgnutls_bootprop_priority)
13924 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
13925 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
13926 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
13927 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
13928 (Qgnutls_bootprop_callbacks_verify): Make static.
13929
e7a6747f
AS
139302011-05-01 Andreas Schwab <schwab@linux-m68k.org>
13931
19ed11ba
AS
13932 * callproc.c: Indentation fixup.
13933
e7a6747f 13934 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
13935 (wait_for_termination, interruptible_wait_for_termination):
13936 Move after wait_for_termination_1.
e7a6747f 13937
1ef14cb4
LMI
139382011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
13939
13940 * sysdep.c (interruptible_wait_for_termination): New function
13941 which is like wait_for_termination, but allows keyboard
13942 interruptions.
13943
13944 * callproc.c (Fcall_process): Add (:file "file") as an option for
13945 the STDOUT buffer.
13946 (Fcall_process_region): Ditto.
13947
330d880c
EZ
139482011-04-30 Eli Zaretskii <eliz@gnu.org>
13949
8db90b73
EZ
13950 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
13951 rather than `XVECTOR (FOO)->size'.
13952
330d880c
EZ
13953 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
13954 inttypes.h, as a gnulib replacement is used if it not available in
13955 system headers.
13956
15cbd324
EZ
139572011-04-21 Eli Zaretskii <eliz@gnu.org>
13958
13959 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
13960 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
13961 of MOST_POSITIVE_FIXNUM. (Bug#8528)
13962
13963 * coding.c (coding_alloc_by_realloc): Error out if destination
13964 will grow beyond MOST_POSITIVE_FIXNUM.
13965 (decode_coding_emacs_mule): Abort if there isn't enough place in
13966 charbuf for the composition carryover bytes. Reserve an extra
13967 space for up to 2 characters produced in a loop.
13968 (decode_coding_iso_2022): Abort if there isn't enough place in
13969 charbuf for the composition carryover bytes.
13970
139712011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 13972
ae940cca
EZ
13973 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
13974 aborting when %lld or %lll format is passed.
13975 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
13976 %llo or %llx format is passed. (Bug#8545)
13977
03ab8921
EZ
13978 * window.c (window_scroll_line_based): Use a marker instead of
13979 simple variables to record original value of point. (Bug#7952)
13980
afda1437
EZ
13981 * doprnt.c (doprnt): Fix the case where a multibyte sequence
13982 produced by %s or %c overflows available buffer space. (Bug#8545)
13983
f76dee0c
PE
139842011-04-28 Paul Eggert <eggert@cs.ucla.edu>
13985
13986 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 13987 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 13988
fdc5744d
JB
139892011-04-28 Juanma Barranquero <lekktu@gmail.com>
13990
13991 * w32.c (init_environment): Warn about defaulting HOME to C:\.
13992
638f053a
JB
139932011-04-28 Juanma Barranquero <lekktu@gmail.com>
13994
13995 * keyboard.c (Qdelayed_warnings_hook): Define.
13996 (command_loop_1): Run `delayed-warnings-hook'
13997 if Vdelayed_warnings_list is non-nil.
13998 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
13999 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
14000
d178f871
EZ
140012011-04-28 Eli Zaretskii <eliz@gnu.org>
14002
14003 * doprnt.c (doprnt): Don't return value smaller than the buffer
14004 size if the message was truncated. (Bug#8545).
14005
b124fd93
JB
140062011-04-28 Juanma Barranquero <lekktu@gmail.com>
14007
14008 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
14009 (Fx_window_property): #if-0 the whole functions, not just the bodies.
14010
e810457d
PE
140112011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14012
14013 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
14014
ea51cceb
JB
140152011-04-27 Juanma Barranquero <lekktu@gmail.com>
14016
14017 * makefile.w32-in: Update dependencies.
14018
94dcfacf
EZ
140192011-04-27 Eli Zaretskii <eliz@gnu.org>
14020
14021 Improve `doprnt' and its usage. (Bug#8545)
14022 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
14023 `format_end'. Remove support for %l as a conversion specifier.
14024 Don't use xrealloc. Improve diagnostics when the %l size modifier
14025 is used. Update the commentary.
14026
14027 * eval.c (verror): Simplify calculation of size_t.
14028
14029 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
14030 messages.
14031
f61f41d7
PE
140322011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
14033
14034 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
14035 change.
14036
96fb4434
PE
140372011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14038
14039 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
14040 This makes this file independent of the recent pseudovector change.
14041
671875da 140422011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 14043
69e9b5a3
PE
14044 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
14045
b5f869a7 14046 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 14047 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 14048 Remove unused local.
c8926152 14049 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 14050
841a1577 14051 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
14052 GCC 4.6.0 optimizes based on type-based alias analysis.
14053 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
14054 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
14055 != &v->size, and therefore "v->size = 1; b->size = 2; return
14056 v->size;" must therefore return 1. This assumption is incorrect
14057 for Emacs, since it type-puns struct Lisp_Vector * with many other
14058 types. To fix this problem, this patch adds a new type struct
f904488f 14059 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
14060 and pseudovectors, and helps optimizing compilers not get fooled
14061 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
14062 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
14063 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
14064 the size member.
eab3844f
PE
14065 (XSETPVECTYPE): Rewrite in terms of new macro.
14066 (XSETPVECTYPESIZE): New macro, specifying both type and size.
14067 This is a bit clearer, and further avoids the possibility of
14068 undesirable aliasing.
14069 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 14070 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
14071 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
14072 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
14073 (ASIZE): Now uses header.size rather than size.
14074 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
14075 to avoid the hassle of writing XVECTOR (foo)->header.size.
14076 (struct vectorlike_header): New type.
eab3844f
PE
14077 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
14078 object, to help avoid aliasing.
14079 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
14080 (SUBRP): Likewise, since Lisp_Subr is a special case.
14081 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
14082 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
14083 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 14084 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
14085 changed to be "header.size" and "header.next".
14086 * buffer.h (struct buffer): Likewise.
14087 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
14088 * frame.h (struct frame): Likewise.
14089 * process.h (struct Lisp_Process): Likewise.
14090 * termhooks.h (struct terminal): Likewise.
14091 * window.c (struct save_window_data, struct saved_window): Likewise.
14092 * window.h (struct window): Likewise.
14093 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
14094 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
14095 * buffer.c (init_buffer_once): Likewise.
14096 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
14097 special case.
14098 * process.c (Fformat_network_address): Use local var for size,
14099 for brevity.
14100
0df1eac5
PE
14101 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
14102
847ab9d1 14103 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
14104 * data.c (atof): Remove decl; no longer used or needed.
14105 (digit_to_number): Move to lread.c.
14106 (Fstring_to_number): Use new string_to_number function, to be
14107 consistent with how the Lisp reader treats infinities and NaNs.
14108 Do not assume that floating-point numbers represent EMACS_INT
14109 without losing information; this is not true on most 64-bit hosts.
14110 Avoid double-rounding errors, by insisting on integers when
14111 parsing non-base-10 numbers, as the documentation specifies.
14112 * lisp.h (string_to_number): New decl, replacing ...
14113 (isfloat_string): Remove.
bc0a5c13 14114 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 14115 (read1): Do not accept +. and -. as integers; this
452f4150
PE
14116 appears to have been a coding error. Similarly, do not accept
14117 strings like +-1e0 as floating point numbers. Do not report
14118 overflow for integer overflows unless the base is not 10 which
14119 means we have no simple and reliable way to continue.
14120 Break out the floating-point parsing into a new
14121 function string_to_number, so that Fstring_to_number parses
14122 floating point numbers consistently with the Lisp reader.
04f2d78b 14123 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
14124 (E_CHAR, EXP_INT): Remove, replacing with ...
14125 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
14126 (string_to_number): New function, replacing isfloat_string.
14127 This function checks for valid syntax and produces the resulting
14128 Lisp float number too. Rework it so that string-to-number
bc0a5c13 14129 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
14130 so that overflow for non-base-10 numbers is reported only when
14131 there's no portable and simple way to convert to floating point.
452f4150 14132
67769ffc
PE
14133 * textprop.c (set_text_properties_1): Rewrite for clarity,
14134 and to avoid GCC warning about integer overflow.
14135
c20db43f
PE
14136 * intervals.h (struct interval): Use EMACS_INT for members
14137 where EMACS_UINT might cause problems. See
14138 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
14139 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
14140 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
14141 All uses changed.
37aa2f85
PE
14142 (offset_intervals): Tell GCC not to worry about length overflow
14143 when negating a negative length.
c20db43f 14144
2538aa2f
PE
14145 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
14146 (overrun_check_free): Likewise.
14147
f2d3008d
PE
14148 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
14149 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
14150 word size.
14151
ec8df744
PE
14152 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14153 (gnutls_make_error): Rename local to avoid shadowing.
14154 (gnutls_emacs_global_deinit): ifdef out; not used.
14155 (Fgnutls_boot): Use const for pointer to readonly storage.
14156 Comment out unused local. Fix pointer signedness problems.
14157
640ee02d
PE
14158 * lread.c (openp): Don't stuff size_t into an 'int'.
14159 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
14160 about possible signed overflow.
14161
6048fb2a
PE
14162 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14163 (GDK_KEY_g): Don't define if already defined.
14164 (xg_prepare_tooltip): Avoid pointer signedness problem.
14165 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
14166
fa3c87e1
PE
14167 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
14168 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
14169
2172544b
PE
14170 * xfns.c (Fx_window_property): Simplify a bit,
14171 to make a bit faster and to avoid GCC 4.6.0 warning.
14172 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
14173
9b821a21
PE
14174 * fns.c (internal_equal): Don't assume size_t fits in int.
14175
3c616cfa
PE
14176 * alloc.c (compact_small_strings): Tighten assertion a little.
14177
c2982e87
PE
14178 Replace pEd with more-general pI, and fix some printf arg casts.
14179 * lisp.h (pI): New macro, generalizing old pEd macro to other
14180 conversion specifiers. For example, use "...%"pI"d..." rather
14181 than "...%"pEd"...".
14182 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 14183 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
14184 * alloc.c (check_pure_size): Don't overflow by converting size to int.
14185 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
14186 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
14187 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
14188 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
14189 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
14190 64-bit hosts.
14191 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
14192 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
14193 * print.c (safe_debug_print, print_object): Likewise.
14194 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
14195 to int.
6f04d126
PE
14196 Use pI instead of if-then-else-abort. Use %p to avoid casts,
14197 avoiding the 0 flag, which is not portable.
c2982e87
PE
14198 * process.c (Fmake_network_process): Use pI to avoid cast.
14199 * region-cache.c (pp_cache): Likewise.
14200 * xdisp.c (decode_mode_spec): Likewise.
14201 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
14202 behavior on 64-bit hosts with printf arg.
6f04d126 14203 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
14204 (x_stop_queuing_selection_requests): Likewise.
14205 (x_get_window_property): Don't truncate byte count to an 'int'
14206 when tracing.
0b432f21 14207
5e073ec7
PE
14208 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
14209 here, since it parses constructs like leading '-' and spaces,
14210 which are not wanted; and it overflows with large numbers.
14211 Instead, simply match F[0-9]+, which is what is wanted anyway.
14212
36372bf9
PE
14213 * alloc.c: Remove unportable assumptions about struct layout.
14214 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
14215 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
14216 (allocate_vectorlike, make_pure_vector): Use the new macros,
14217 plus offsetof, to remove unportable assumptions about struct layout.
14218 These assumptions hold on all porting targets that I know of, but
14219 they are not guaranteed, they're easy to remove, and removing them
14220 makes further changes easier.
14221
0b432f21
PE
14222 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
14223 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
14224 (string_overrun_cookie): Now const. Use initializers that
14225 don't formally overflow signed char, to avoid warnings.
000098c1
PE
14226 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
14227 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
14228 (allocate_buffer): Don't assume sizeof (struct buffer) is a
14229 multiple of sizeof (EMACS_INT); it need not be, if
14230 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 14231 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 14232
895009e1
JB
142332011-04-26 Juanma Barranquero <lekktu@gmail.com>
14234
14235 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
14236
6a7a1b0b
TZ
142372011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
14238
14239 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 14240 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
14241 Reported by Paul Eggert <eggert@cs.ucla.edu>.
14242
841a1577 142432011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
14244
14245 * lisp.h (Qdebug): List symbol.
895009e1 14246 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
14247 * keyboard.c (debug-on-event): New variable.
14248 (handle_user_signal): Break into debugger when debug-on-event
14249 matches the current signal symbol.
14250
f2d3ba6f
DN
142512011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
14252
14253 * alloc.c (check_sblock, check_string_bytes)
14254 (check_string_free_list): Convert to standard C.
14255
42ce4c63
TZ
142562011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
14257
14258 * w32.c (emacs_gnutls_push): Fix typo.
14259
825cd63c
EZ
142602011-04-25 Eli Zaretskii <eliz@gnu.org>
14261
fb11d64d
EZ
14262 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
14263 "cast to pointer from integer of different size".
14264
825cd63c
EZ
14265 Improve doprnt and its use in verror. (Bug#8545)
14266 * doprnt.c (doprnt): Document the set of format control sequences
14267 supported by the function. Use SAFE_ALLOCA instead of always
14268 using `alloca'.
14269
14270 * eval.c (verror): Don't limit the buffer size at size_max-1, that
14271 is one byte too soon. Don't use xrealloc; instead xfree and
14272 xmalloc anew.
14273
e061a11b
TZ
142742011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
14275
14276 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
14277 callbacks stage.
14278
14279 * gnutls.c: Renamed global_initialized to
14280 gnutls_global_initialized. Added internals for the
14281 :verify-hostname-error, :verify-error, and :verify-flags
14282 parameters of `gnutls-boot' and documented those parameters in the
14283 docstring. Start callback support.
9173deec
JB
14284 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
14285 unless a fatal error occurred. Call gnutls_alert_send_appropriate
14286 on error. Return error code.
e061a11b
TZ
14287 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
14288 (emacs_gnutls_read): Likewise.
14289 (Fgnutls_boot): Return handshake error code.
14290 (emacs_gnutls_handle_error): New function.
14291 (wsaerror_to_errno): Likewise.
14292
14293 * w32.h (emacs_gnutls_pull): Add prototype.
14294 (emacs_gnutls_push): Likewise.
14295
14296 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
14297 (emacs_gnutls_push): Likewise.
14298
142992011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
14300
14301 * process.c (wait_reading_process_output): Check if GnuTLS
14302 buffered some data internally if no FDs are set for TLS
14303 connections.
14304
14305 * makefile.w32-in (OBJ2): Add gnutls.$(O).
14306 (LIBS): Link to USER_LIBS.
14307 ($(BLD)/gnutls.$(0)): New target.
14308
fa6996bc
EZ
143092011-04-24 Eli Zaretskii <eliz@gnu.org>
14310
eb35682e
EZ
14311 * xdisp.c (handle_single_display_spec): Rename the
14312 display_replaced_before_p argument into display_replaced_p, to
14313 make it consistent with the commentary. Fix typos in the
14314 commentary.
14315
e2ad650c
EZ
14316 * textprop.c (syms_of_textprop): Remove dead code.
14317 (copy_text_properties): Delete obsolete commentary about an
14318 interface that was deleted long ago. Fix typos in the description
14319 of arguments.
14320
1b2de274
EZ
14321 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
14322 to changes in oldXMenu/XMenu.h from 2011-04-16.
14323 <menu_help_message, prev_menu_help_message>: Constify.
14324 (IT_menu_make_room): menu->help_text is now `const char **';
14325 adjust.
14326
14327 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
14328 to changes in oldXMenu/XMenu.h from 2011-04-16.
14329 (struct XMenu): Declare `help_text' `const char **'.
14330
14331 * xfaces.c <Qunspecified>: Make extern again.
14332
14333 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 14334 required by POSIX.
1b2de274 14335
762b15be
EZ
14336 * doc.c (get_doc_string): Improve the format passed to `error'.
14337
14338 * doprnt.c (doprnt): Improve commentary.
14339
14340 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
14341
14342 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
14343 them with etags.
14344
f1052e5d
EZ
14345 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
14346 changes in globals.h immediately force recompilation.
762b15be
EZ
14347 (TAGS): Depend on $(CURDIR)/m/intel386.h and
14348 $(CURDIR)/s/ms-w32.h.
14349 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 14350
fa6996bc
EZ
14351 * character.c (Fchar_direction): Function deleted.
14352 (syms_of_character): Don't defsubr it.
14353 <char-direction-table>: Deleted.
14354
e6c3da20
EZ
143552011-04-23 Eli Zaretskii <eliz@gnu.org>
14356
14357 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
14358 * doprnt.c: Include limits.h.
14359 (SIZE_MAX): New macro.
04f2d78b
CB
14360 (doprnt): Return a size_t value. 2nd arg is now size_t.
14361 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
14362 Improve overflow protection. Support `l' modifier for integer
14363 conversions. Support %l conversion. Don't assume an EMACS_INT
14364 argument for integer conversions and for %c.
14365
14366 * lisp.h (doprnt): Restore prototype.
14367
14368 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
14369 $(SRC)/character.h.
14370
14371 * Makefile.in (base_obj): Add back doprnt.o.
14372
14373 * deps.mk (doprnt.o): Add back prerequisites.
14374 (callint.o): Depend on character.h.
14375
14376 * eval.c (internal_lisp_condition_case): Include the handler
14377 representation in the error message.
14378 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
14379 when breaking from the loop.
14380
14381 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
14382
14383 * callint.c (Fcall_interactively): When displaying error message
14384 about invalid control letter, pass the character's codepoint, not
14385 a pointer to its multibyte form. Improve display of the character
14386 in octal and display also its hex code.
14387
14388 * character.c (char_string): Use %x to display the (unsigned)
14389 codepoint of an invalid character, to avoid displaying a bogus
14390 negative value.
14391
14392 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
14393 `error', not SYMBOL_NAME itself.
14394
14395 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
14396 character arguments to `error'.
14397
14398 * charset.c (check_iso_charset_parameter): Fix incorrect argument
14399 to `error' in error message about FINAL_CHAR argument. Make sure
14400 FINAL_CHAR is a character, and use %c when it is passed as
14401 argument to `error'.
14402
4ffd0d6b 144032011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
14404
14405 * s/ms-w32.h (localtime): Redirect to sys_localtime.
14406
14407 * w32.c: Include <time.h>.
14408 (sys_localtime): New function.
14409
4ffd0d6b 144102011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
14411
14412 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
14413
4ffd0d6b 14414 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 14415
4ffd0d6b 144162011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 14417
4ffd0d6b
GM
14418 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
14419 zombies (Bug#8467).
aac0c6e3 14420
04c56954
EZ
144212011-04-19 Eli Zaretskii <eliz@gnu.org>
14422
14423 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
14424 gl_state.e_property when gl_state.object is Qt.
14425
14426 * insdel.c (make_gap_larger): Remove limitation of buffer size
14427 to <= INT_MAX.
14428
16a43933
CY
144292011-04-18 Chong Yidong <cyd@stupidchicken.com>
14430
14431 * xdisp.c (lookup_glyphless_char_display)
14432 (produce_glyphless_glyph): Handle cons cell entry in
14433 glyphless-char-display.
14434 (Vglyphless_char_display): Document it.
14435
14436 * term.c (produce_glyphless_glyph): Handle cons cell entry in
14437 glyphless-char-display.
14438
4581706e
CY
144392011-04-17 Chong Yidong <cyd@stupidchicken.com>
14440
14441 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
14442
14443 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
14444
14445 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
14446 definition for no-X builds.
14447
4887c6e2 144482011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 14449
fd35b6f9
PE
14450 Static checks with GCC 4.6.0 and non-default toolkits.
14451
5c1ccb01
PE
14452 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
14453
006c5daa
PE
14454 * process.c (keyboard_bit_set): Define only if SIGIO.
14455 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
14456 (send_process): Repair possible setjmp clobbering.
14457
efc736d3
PE
14458 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
14459
4e2fe2e6
PE
14460 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
14461
f97334a2
PE
14462 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
14463
4e75f29d
PE
14464 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
14465 Define only if needed.
14466
90efadd1
PE
14467 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
14468 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 14469 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 14470
3c647824
PE
14471 * dispextern.h (struct redisplay_interface): Rename param
14472 to avoid shadowing.
e264f262 14473 * termhooks.h (struct terminal): Likewise.
761383f4 14474 * xterm.c (xembed_send_message): Likewise.
3c647824 14475
b58c5c4a
PE
14476 * insdel.c (make_gap_smaller): Define only if
14477 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
14478
cad59032
PE
14479 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
14480 it.
14481
c339dc2e
PE
14482 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
14483 so that we aren't warned about unused symbols.
14484
91a3e27b
PE
14485 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
14486
399c71d3 14487 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 14488
8ffc96f5
PE
14489 * xfns.c (x_real_positions): Mark locals as initialized.
14490
eef9bc79
PE
14491 * xmenu.c (xmenu_show): Don't use uninitialized vars.
14492
098db9dd
PE
14493 * xterm.c: Fix problems found by static analysis with other toolkits.
14494 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
14495 (x_dispatch_event): Declare static if USE_GTK, and
14496 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 14497 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 14498 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
14499 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
14500 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 14501
eb18f6cc
PE
14502 * xmenu.c (menu_help_callback): Pointer type fixes.
14503 Use const pointers when pointing at readonly data. Avoid pointer
14504 signedness clashes.
14505 (FALSE): Remove unused macro.
14506 (update_frame_menubar): Remove unused decl.
14507
1fe72bf8
PE
14508 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
14509
60d9e1db
PE
14510 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
14511 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
14512 (single_menu_item): Rename local to avoid shadowing.
14513
39261c26
PE
14514 * keyboard.c (make_lispy_event): Remove unused local var.
14515
018c5e19
PE
14516 * frame.c, frame.h (x_get_resource_string): Bring this back, but
14517 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
14518
63d2b86e
PE
14519 * bitmaps: Change bitmaps from unsigned char back to the X11
14520 compatible char. Avoid the old compiler warnings about
14521 out-of-range initializers by using, for example, '\xab' rather
14522 than 0xab.
14523
aefd87e1
PE
14524 * xgselect.c (xgselect_initialize): Check vs interface
14525 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
14526
bf501fb9
PE
14527 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
14528
e9829fdf
PE
14529 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
14530 to read-only memory.
14531
1086c095
PE
14532 * fns.c (vector): Remove; this old hack is no longer needed.
14533
2baccd04 14534 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 14535 Remove unused var.
dde42981 14536 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 14537
72391843 14538 * xrdb.c (x_load_resources): Omit unused local.
3565b346 14539
436c16df 14540 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 14541 (x_window): Rename locals to avoid shadowing.
dc5ddd85 14542 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 14543
92bb796d 14544 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 14545 (x_term_init): Remove local to avoid shadowing.
92bb796d 14546
764430a3 14547 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
14548
14549 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
14550 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
14551
d1dfb56c
EZ
145522011-04-16 Eli Zaretskii <eliz@gnu.org>
14553
c4354cb4
EZ
14554 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
14555
d1dfb56c
EZ
14556 Fix regex.c, syntax.c and friends for buffers > 2GB.
14557 * syntax.h (struct gl_state_s): Declare character position members
14558 EMACS_INT.
14559
14560 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
14561
04f2d78b
CB
14562 * textprop.c (verify_interval_modification, interval_of):
14563 Declare arguments EMACS_INT.
d1dfb56c
EZ
14564
14565 * intervals.c (adjust_intervals_for_insertion): Declare arguments
14566 EMACS_INT.
14567
14568 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
14569
14570 * indent.c (Fvertical_motion): Local variable it_start is now
14571 EMACS_INT.
14572
14573 * regex.c (re_match, re_match_2, re_match_2_internal)
14574 (bcmp_translate, regcomp, regexec, print_double_string)
14575 (group_in_compile_stack, re_search, re_search_2, regex_compile)
14576 (re_compile_pattern, re_exec): Declare arguments and local
14577 variables `size_t' and `ssize_t' and return values `regoff_t', as
14578 appropriate.
14579 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
14580 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
14581 <compile_stack_type>: `size' and `avail' are now `size_t'.
14582
14583 * regex.h <regoff_t>: Use ssize_t, not int.
14584 (re_search, re_search_2, re_match, re_match_2): Arguments that
14585 specify buffer/string position and length are now ssize_t and
14586 size_t. Return type is regoff_t.
14587
613052cd
BK
145882011-04-16 Ben Key <bkey76@gmail.com>
14589
14590 * nsfont.m: Fixed bugs in ns_get_family and
14591 ns_descriptor_to_entity that were caused by using free to
14592 deallocate memory blocks that were allocated by xmalloc (via
14593 xstrdup). This caused Emacs to crash when compiled with
14594 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
14595 --enable-checking=xmallocoverrun). xfree is now used to
14596 deallocate these memory blocks.
14597
4170f62f 145982011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 14599
71b41406
PE
14600 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
14601
9587a89d
PE
14602 emacs_write: Accept and return EMACS_INT for sizes.
14603 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
14604 et seq.
14605 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
14606 Accept and return EMACS_INT.
14607 (emacs_gnutls_write): Return the number of bytes written on
14608 partial writes.
14609 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
14610 (emacs_read, emacs_write): Remove check for negative size, as the
14611 Emacs source code has been audited now.
9587a89d
PE
14612 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
14613 (emacs_read, emacs_write): Use it.
273a5f82
PE
14614 * process.c (send_process): Adjust to the new signatures of
14615 emacs_write and emacs_gnutls_write. Do not attempt to store
14616 a byte offset into an 'int'; it might overflow.
9587a89d 14617 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 14618
3e047f51
PE
14619 * sound.c: Don't assume sizes fit in 'int'.
14620 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 14621 Return EMACS_INT, not int.
3e047f51 14622 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
14623 Accept EMACS_INT, not int.
14624 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
14625 record read return values.
14626
cc39a9db
BK
146272011-04-15 Ben Key <bkey76@gmail.com>
14628
c9d0ec6d
JB
14629 * keyboard.c (Qundefined): Don't declare static since it is used
14630 in nsfns.m.
14631 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
14632 static since they are used in nsfont.m.
cc39a9db 14633
6c60eb9f
SM
146342011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
14635
14636 * process.c (Qprocessp): Don't declare static.
14637 * lisp.h (Qprocessp): Declare again.
14638
7990b61a
JB
146392011-04-15 Juanma Barranquero <lekktu@gmail.com>
14640
14641 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
14642
5d4cb038
PE
146432011-04-14 Paul Eggert <eggert@cs.ucla.edu>
14644
8bd7b830 14645 Improve C-level modularity by making more things 'static'.
cd64ea1d 14646
e3b27b31
PE
14647 Don't publish debugger-only interfaces to other modules.
14648 * lisp.h (safe_debug_print, debug_output_compilation_hack):
14649 (verify_bytepos, count_markers): Move decls to the only modules
14650 that need them.
14651 * region-cache.h (pp_cache): Likewise.
14652 * window.h (check_all_windows): Likewise.
14653 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
14654
5d4cb038
PE
14655 * sysdep.c (croak): Now static, if
14656 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
14657 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
14658
14659 * alloc.c (refill_memory_reserve): Now static if
14660 !defined REL_ALLOC || defined SYSTEM_MALLOC.
14661 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 14662
e87b6180
PE
14663 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
14664 Define only if USE_LUCID.
14665
ac64929e
PE
14666 * xrdb.c (x_customization_string, x_rm_string): Now static.
14667
6f37259d
PE
14668 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
14669 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
14670
1683e3ab
PE
14671 * xdisp.c (draw_row_with_mouse_face): Now static.
14672 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
14673
de9c2632
PE
14674 * window.h (check_all_windows): Mark externally visible.
14675
2b96acb7
PE
14676 * window.c (window_deletion_count): Now static.
14677
14678 * undo.c: Make symbols static if they're not exported.
14679 (last_undo_buffer, last_boundary_position, pending_boundary):
14680 Now static.
14681
50436f33
PE
14682 * textprop.c (interval_insert_behind_hooks): Now static.
14683 (interval_insert_in_front_hooks): Likewise.
14684
64520e5c
PE
14685 * term.c: Make symbols static if they're not exported.
14686 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
14687 (max_frame_lines, tty_set_terminal_modes):
14688 (tty_reset_terminal_modes, tty_turn_off_highlight):
14689 (get_tty_terminal): Now static.
14690 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
14691 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 14692 HAVE_WINDOW_SYSTEM.
64520e5c
PE
14693 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
14694 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
14695
1fa53021
PE
14696 * sysdep.c: Make symbols static if they're not exported.
14697 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
14698 Now static.
14699 (sigprocmask_set, full_mask): Remove; unused.
14700 (wait_debugging): Mark as visible.
14701 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
14702 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
14703
d4b43b22
PE
14704 * syntax.c (syntax_temp): Define only if !__GNUC__.
14705
b7c513d0
PE
14706 * sound.c (current_sound_device, current_sound): Now static.
14707
989b29ad
PE
14708 * search.c (searchbufs, searchbuf_head): Now static.
14709
13a55a78
PE
14710 * scroll.c (scroll_cost): Remove; unused.
14711 * dispextern.h (scroll_cost): Remove decl.
14712
de68a1fc
PE
14713 * region-cache.h (pp_cache): Mark as externally visible.
14714
40ccffa6
PE
14715 * process.c: Make symbols static if they're not exported.
14716 (process_tick, update_tick, create_process, chan_process):
14717 (Vprocess_alist, proc_buffered_char, datagram_access):
14718 (fd_callback_data, send_process_frame, process_sent_to): Now static.
14719 (deactivate_process): Mark defn as static, as well as decl.
14720 * lisp.h (create_process): Remove decl.
14721 * process.h (chan_process, Vprocess_alist): Remove decls.
14722
ad64fc97
PE
14723 * print.c: Make symbols static if they're not exported.
14724 (print_depth, new_backquote_output, being_printed, print_buffer):
14725 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
14726 (print_interval, print_number_index, initial_stderr_stream):
14727 Now static.
14728 * lisp.h (Fprinc): Remove decl.
14729 (debug_output_compilation_hack): Mark as externally visible.
14730
adddb265
PE
14731 * sysdep.c (croak): Move decl from here to syssignal.h.
14732 * syssignal.h (croak): Put it here, so the API can be checked when
14733 'croak' is called from dissociate_if_controlling_tty.
14734
1717ede2
PE
14735 * minibuf.c: Make symbols static if they're not exported.
14736 (minibuf_save_list, choose_minibuf_frame): Now static.
14737 * lisp.h (choose_minibuf_frame): Remove decl.
14738
fa5fb2bc
PE
14739 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
14740
1e3890d1
PE
14741 * lread.c: Make symbols static if they're not exported.
14742 (read_objects, initial_obarray, oblookup_last_bucket_number):
14743 Now static.
14744 (make_symbol): Remove; unused.
14745 * lisp.h (initial_obarray, make_symbol): Remove decls.
14746
8a1414fa
PE
14747 * keyboard.c: Make symbols static if they're not exported.
14748 (single_kboard, recent_keys_index, total_keys, recent_keys):
14749 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
14750 (this_single_command_key_start, echoing, last_auto_save):
14751 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
14752 (command_loop, echo_now, keyboard_init_hook, help_char_p):
14753 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
14754 (Vlispy_mouse_stem, double_click_count):
14755 Now static.
14756 (force_auto_save_soon): Define only if SIGDANGER.
14757 (ignore_mouse_drag_p): Now static if
14758 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
14759 (print_help): Remove; unused.
14760 (stop_character, last_timer_event): Mark as externally visible.
14761 * keyboard.h (ignore_mouse_drag_p): Declare only if
14762 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
14763 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
14764 * lisp.h (echoing): Remove decl.
14765 (force_auto_save_soon): Declare only if SIGDANGER.
14766 * xdisp.c (redisplay_window): Simplify code, to make it more
14767 obvious that ignore_mouse_drag_p is not accessed if !defined
14768 USE_GTK && !defined HAVE_NS.
14769
93ea6e8f
PE
14770 * intervals.c: Make symbols static if they're not exported.
14771 (merge_properties_sticky, merge_interval_right, delete_interval):
14772 Now static.
14773 * intervals.h (merge_interval_right, delete_interval): Remove decls.
14774
77382fcc
PE
14775 * insdel.c: Make symbols static if they're not exported.
14776 However, leave prepare_to_modify_buffer alone. It's never
14777 called from outside this function, but that appears to be a bug.
14778 (combine_after_change_list, combine_after_change_buffer):
4889fc82 14779 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
14780 (adjust_after_replace_noundo): Remove; unused.
14781 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 14782 (signal_before_change): Remove decls.
77382fcc 14783
9306c32e
PE
14784 * indent.c (val_compute_motion, val_vmotion): Now static.
14785
cd44d2eb
PE
14786 * image.c: Make symbols static if they're not exported.
14787 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
14788 if USE_GTK.
14789 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
14790 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
14791
ad9a7a06
PE
14792 * fringe.c (standard_bitmaps): Now static.
14793 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
14794
81626931
PE
14795 * frame.c: Make symbols static if they're not exported.
14796 (x_report_frame_params, make_terminal_frame): Now static.
14797 (get_frame_param): Now static, unless HAVE_NS.
14798 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
14799 (x_get_resource_string): Remove; not used.
14800 * frame.h (make_terminal_frame, x_report_frame_params):
14801 (x_get_resource_string); Remove decls.
14802 (x_fullscreen_adjust): Declare only if WINDOWSNT.
14803 * lisp.h (get_frame_param): Declare only if HAVE_NS.
14804
239f9db9
PE
14805 * font.c, fontset.c: Make symbols static if they're not exported.
14806 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
14807 (FACE_SUITABLE_FOR_CHAR_P): Use it.
14808 * font.c (font_close_object): Now static.
14809 * font.h (font_close_object): Remove.
14810 * fontset.c (FONTSET_OBJLIST): Remove.
14811 (free_realized_fontset) #if-0 the body, which does nothing.
14812 (face_suitable_for_char_p): #if-0, as it's never called.
14813 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
14814 * xfaces.c (face_at_string_position):
14815 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
14816 since 0 is always ASCII.
14817
dfcf3579
PE
14818 * fns.c (weak_hash_tables): Now static.
14819
5045092b
PE
14820 * fileio.c: Make symbols static if they're not exported.
14821 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
14822 (Vwrite_region_annotation_buffers): Now static.
14823
57a96f5c
PE
14824 * eval.c: Make symbols static if they're not exported.
14825 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
14826 * lisp.h (backtrace_list): Remove decl.
14827
35f08c38
PE
14828 * emacs.c: Make symbols static if they're not exported.
14829 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
14830 (fatal_error_code, fatal_error_signal_hook, standard_args):
14831 Now static.
14832 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
14833 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
14834 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
14835 * lisp.h (fatal_error_signal_hook): Remove decl.
14836 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
14837
f44bd759
PE
14838 * editfns.c: Move a (normally-unused) function to its only use.
14839 * editfns.c, lisp.h (get_operating_system_release): Remove.
14840 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
14841 worth the hassle of breaking this out.
14842
b532497d
PE
14843 * xterm.c: Make symbols static if they're not exported.
14844 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
14845 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
14846 (x_destroy_window, x_delete_display):
14847 Now static.
14848 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
14849 (x_mouse_leave): Remove; unused.
14850 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
14851 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
14852 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
14853 Remove decls.
14854 (x_mouse_leave): Declare only if WINDOWSNT.
14855 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
14856 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
14857 USE_X_TOOLKIT.
14858
1675728f
PE
14859 * ftxfont.c: Make symbols static if they're not exported.
14860 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
14861 HAVE_FREETYPE.
14862 * font.h (ftxfont_driver): Likewise.
14863
e4cebfca
PE
14864 * xfns.c: Make symbols static if they're not exported.
14865 (x_last_font_name, x_display_info_for_name):
14866 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
14867 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
14868 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
14869 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
14870 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
14871 (last_show_tip_args): Now static.
14872 (xic_defaut_fontset, xic_create_fontsetname): Define only if
14873 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
14874 (x_screen_planes): Remove; unused.
14875 * dispextern.h (x_screen_planes): Remove decl.
14876
5bf46f05
PE
14877 * dispnew.c: Make symbols static if they're not exported.
14878 * dispextern.h (redraw_garbaged_frames, scrolling):
14879 (increment_row_positions): Remove.
14880 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
14881 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
14882 Now static.
14883 (redraw_garbaged_frames): Remove; unused.
14884
435f4c28
PE
14885 * xfaces.c: Make symbols static if they're not exported.
14886 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
14887 Remove decls.
14888 * xterm.h (defined_color): Remove decls.
14889 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
14890 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
14891 (menu_face_changed_default, defined_color, free_realized_face):
14892 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
14893 (ascii_face_of_lisp_face): Remove; unused.
14894
8524aef3
PE
14895 * xdisp.c: Make symbols static if they're not exported.
14896 * dispextern.h (scratch_glyph_row, window_box_edges):
14897 (glyph_to_pixel_coords, set_cursor_from_row):
14898 (get_next_display_element, set_iterator_to_next):
14899 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
14900 (show_mouse_face): Remove decls
14901 * frame.h (message_buf_print): Likewise.
14902 * lisp.h (pop_message, set_message, check_point_in_composition):
14903 Likewise.
14904 * xterm.h (set_vertical_scroll_bar): Likewise.
14905 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
14906 (message_buf_print, scratch_glyph_row, displayed_buffer):
14907 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
14908 (get_next_display_element, show_mouse_face, window_box_edges):
14909 (frame_to_window_pixel_xy, check_point_in_composition):
14910 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
14911 (glyph_to_pixel_coords): Remove; unused.
14912
16390cd2
PE
14913 * dired.c (file_name_completion): Now static.
14914
14915 * dbusbind.c (xd_in_read_queued_messages): Now static.
14916
a25f4dfa
PE
14917 * lisp.h (circular_list_error, FOREACH): Remove; unused.
14918 * data.c (circular_list_error): Remove.
14919
14a9c8df
PE
14920 * commands.h (last_point_position, last_point_position_buffer):
14921 (last_point_position_window): Remove decls.
14922 * keyboard.c: Make these variables static.
14923
04f2d78b
CB
14924 * coding.h (coding, code_convert_region, encode_coding_gap):
14925 Remove decls.
74ab6df5
PE
14926 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
14927 (iso_code_class, detect_coding, code_convert_region): Now static.
14928 (encode_coding_gap): Remove; unused.
14929
38dfbee1
PE
14930 * chartab.c (chartab_chars, chartab_bits): Now static.
14931
a2cb4e63
PE
14932 * charset.h (charset_iso_8859_1): Remove decl.
14933 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
14934 Now static.
14935
127198fd
PE
14936 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
14937 * ccl.c (Vccl_program_table): Now static.
14938 (check_ccl_update): Remove; unused.
14939
d85b608f
PE
14940 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
14941 * category.h: ... from here.
14942 * category.c (check_category_table, set_category_set): Now static.
14943
31cd66f3
PE
14944 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
14945 * lisp.h: Remove these decls.
14946
c358e587
PE
14947 * buffer.c (buffer_count): Remove unused var.
14948
e78aecca
PE
14949 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
14950 so that it's not optimized away.
14951 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
14952 * dispextern.h (bidi_dump_cached_states): Remove, since it's
14953 exported only to the debugger.
14954
e192d7d3 14955 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 14956 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 14957
92470028
PE
14958 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
14959 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
14960 was inaccessible from Lisp.
14961 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
14962 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
14963
244ed907
PE
14964 alloc.c: Import and export fewer symbols, and remove unused items.
14965 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
14966 is defined.
14967 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
14968 it's not optimized away by whole-program optimization.
14969 (message_enable_multibyte, free_misc): Remove.
14970 (catchlist, handlerlist, mark_backtrace):
14971 Declare only if BYTE_MARK_STACK.
14972 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
14973 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
14974 (message_enable_multibyte): Remove decl.
14975 (free_misc, interval_free_list, float_block, float_block_index):
14976 (n_float_blocks, float_free_list, cons_block, cons_block_index):
14977 (cons_free_list, last_marked_index):
14978 Now static.
14979 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
14980 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
14981 (mark_backtrace): Define only if BYTE_MARK_STACK.
14982 * xdisp.c (message_enable_multibyte): Now static.
14983
61c2b50e 14984 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
14985 This makes it easier for human readers (and static analyzers)
14986 to see whether these variables are used from other modules.
14987 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
14988 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
14989 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
14990 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
14991 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
14992 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
14993 * xmenu.c, xselect.c:
14994 Declare Q* vars static if they are not used in other modules.
14995 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
14996 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
14997 Remove decls of unexported vars.
14998 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
14999
95c82688
PE
15000 * lisp.h (DEFINE_FUNC): Make sname 'static'.
15001
16a97296
PE
15002 Make Emacs functions such as Fatom 'static' by default.
15003 This makes it easier for human readers (and static analyzers)
15004 to see whether these functions can be called from other modules.
15005 DEFUN now defines a static function. To make the function external
15006 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
15007 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
15008 (Finit_image_library):
16a97296
PE
15009 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
15010 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
15011 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
15012 Remove decls, since these functions are now static.
15013 (Funintern, Fget_internal_run_time): New decls, since these functions
15014 were already external.
95c82688 15015
16a97296
PE
15016 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
15017 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
15018 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
15019 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
15020 * keyboard.c, keymap.c, lread.c:
15021 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
15022 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
15023 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
15024 Mark functions with DEFUE instead of DEFUN,
15025 if they are used in other modules.
15026 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
15027 decls for now-static functions.
15028 * buffer.h (Fdelete_overlay): Remove decl.
15029 * callproc.c (Fgetenv_internal): Mark as internal.
15030 * composite.c (Fremove_list_of_text_properties): Remove decl.
15031 (Fcomposition_get_gstring): New forward static decl.
15032 * composite.h (Fcomposite_get_gstring): Remove decl.
15033 * dired.c (Ffile_attributes): New forward static decl.
15034 * doc.c (Fdocumntation_property): New forward static decl.
15035 * eval.c (Ffetch_bytecode): New forward static decl.
15036 (Funintern): Remove extern decl; now in .h file where it belongs.
15037 * fileio.c (Fmake_symbolic_link): New forward static decl.
15038 * image.c (Finit_image_library): New forward static decl.
15039 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
15040 * intervals.h (Fprevious_property_change):
15041 (Fremove_list_of_text_properties): Remove decls.
15042 * keyboard.c (Fthis_command_keys): Remove decl.
15043 (Fcommand_execute): New forward static decl.
15044 * keymap.c (Flookup_key): New forward static decl.
15045 (Fcopy_keymap): Now static.
15046 * keymap.h (Flookup_key): Remove decl.
15047 * process.c (Fget_process): New forward static decl.
15048 (Fprocess_datagram_address): Mark as internal.
15049 * syntax.c (Fsyntax_table_p): New forward static decl.
15050 (skip_chars): Remove duplicate decl.
15051 * textprop.c (Fprevious_property_change): New forward static decl.
15052 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
15053 Now internal.
15054 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
15055 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
15056
785bbd42
PE
15057 * editfns.c (Fformat): Remove unreachable code.
15058
8b913b57
AS
150592011-04-14 Andreas Schwab <schwab@linux-m68k.org>
15060
15061 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
15062 change. (Bug#8496)
15063
a6744a35
EZ
150642011-04-13 Eli Zaretskii <eliz@gnu.org>
15065
15066 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
15067 when at ZV. (Bug#8487)
15068
e7974947
AS
150692011-04-12 Andreas Schwab <schwab@linux-m68k.org>
15070
baad03f0
AS
15071 * charset.c (Fclear_charset_maps): Use xfree instead of free.
15072 (Bug#8437)
15073 * keyboard.c (parse_tool_bar_item): Likewise.
15074 * sound.c (sound_cleanup, alsa_close): Likewise.
15075 * termcap.c (tgetent): Likewise.
15076 * xfns.c (x_default_font_parameter): Likewise.
15077 * xsettings.c (read_and_apply_settings): Likewise.
15078
e7974947
AS
15079 * alloc.c (overrun_check_malloc, overrun_check_realloc)
15080 (overrun_check_free): Protoize.
15081
28272684
PE
150822011-04-12 Paul Eggert <eggert@cs.ucla.edu>
15083
15084 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
15085 since callers should never pass a negative size.
15086 Change the signature to match that of plain 'read' and 'write'; see
15087 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
15088 * lisp.h: Update prototypes of emacs_write and emacs_read.
15089
11997c76
EZ
150902011-04-11 Eli Zaretskii <eliz@gnu.org>
15091
15092 * xdisp.c (redisplay_window): Don't try to determine the character
15093 position of the scroll margin if the window start point w->startp
e896f03c 15094 is outside the buffer's accessible region. (Bug#8468)
11997c76 15095
8a2cbd72
EZ
150962011-04-10 Eli Zaretskii <eliz@gnu.org>
15097
15098 Fix write-region and its subroutines for buffers > 2GB.
15099 * fileio.c (a_write, e_write): Modify declaration of arguments and
15100 local variables to support buffers larger than 2GB.
15101 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
15102
15103 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
15104 argument, local variables, and return value.
15105
15106 * lisp.h: Update prototypes of emacs_write and emacs_read.
15107
15108 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
15109
4073e537 151102011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 15111
1ebfdcb6
PE
15112 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
15113
b2ded58d
PE
15114 Fix more problems found by GCC 4.6.0's static checks.
15115
7d66342c
PE
15116 * xdisp.c (vmessage): Use a better test for character truncation.
15117
bbf47d44
PE
15118 * charset.c (load_charset_map): <, not <=, for optimization,
15119 and to avoid potential problems with integer overflow.
9248994d 15120 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 15121 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 15122 * editfns.c (Fformat): Likewise.
1e69125e 15123 * syntax.c (skip_chars): Likewise.
3befa583 15124
e3019616
PE
15125 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
15126 This also lets GCC 4.6.0 generate slightly better loop code.
15127
becfa255
PE
15128 * callint.c (Fcall_interactively): <, not <=, for optimization.
15129 (Fcall_interactively): Count the number of arguments produced,
15130 not the number of arguments given. This is simpler and lets GCC
15131 4.6.0 generate slightly better code.
15132
dae0cd48
PE
15133 * ftfont.c: Distingish more carefully between FcChar8 and char.
15134 The previous code passed unsigned char * to a functions like
15135 strlen and xstrcasecmp that expect char *, which does not
15136 conform to the C standard.
15137 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
15138 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
15139 char * when the C standard requires it.
15140
76032d70
PE
15141 * keyboard.c (read_char): Remove unused var.
15142
eb3f1cc8
PE
15143 * eval.c: Port to Windows vsnprintf (Bug#8435).
15144 Include <limits.h>.
15145 (SIZE_MAX): Define if the headers do not.
15146 (verror): Do not give up if vsnprintf returns a negative count.
15147 Instead, grow the buffer. This ports to Windows vsnprintf, which
15148 does not conform to C99. Problem reported by Eli Zaretskii.
15149 Also, simplify the allocation scheme, by avoiding the need for
15150 calling realloc, and removing the ALLOCATED variable.
15151
70476b54
PE
15152 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
15153
12020a9e
PE
15154 Remove invocations of doprnt, as Emacs now uses vsnprintf.
15155 But keep the doprint source code for now, as we might revamp it
15156 and use it again (Bug#8435).
ea6c7ae6
PE
15157 * lisp.h (doprnt): Remove.
15158 * Makefile.in (base_obj): Remove doprnt.o.
15159 * deps.mk (doprnt.o): Remove.
15160
5fdb398c
PE
15161 error: Print 32- and 64-bit integers portably (Bug#8435).
15162 Without this change, on typical 64-bit hosts error ("...%d...", N)
15163 was used to print both 32- and 64-bit integers N, which relied on
15164 undefined behavior.
61bdb816 15165 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
15166 * lisp.h (error, verror): Mark as printf-like functions.
15167 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
15168 Report overflow in size calculations when allocating printf buffer.
15169 Do not truncate output string at its first null byte.
15170 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
15171 Truncate the output at a character boundary, since vsnprintf does not
15172 do that.
15173 * charset.c (check_iso_charset_parameter): Convert internal
15174 character to string before calling 'error', since %c now has the
15175 printf meaning.
15176 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
15177 overflow when computing char to be passed to 'error'. Do not
15178 pass Lisp_Object to 'error'; pass the integer instead.
15179 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
15180 formatted with plain %d.
15181
b189fa66
PE
15182 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
15183
bff87ef0
PE
15184 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
15185
7e2cac20
PE
15186 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
15187
ce4d90b5
PE
15188 * xterm.c (x_catch_errors): Remove duplicate declaration.
15189
266c9547
PE
15190 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
15191
79c49ad2
PE
15192 * xdisp.c, lisp.h (message_nolog): Remove; unused.
15193
368f4090
JM
151942011-04-10 Jim Meyering <meyering@redhat.com>
15195
15196 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
15197 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
15198 return ssize_t not "int", and use size_t as the buffer length.
15199 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
15200 * gnutls.h: Update declarations.
15201 * process.c (read_process_output): Use ssize_t, to match.
15202 (send_process): Likewise.
15203
a32d4040
CY
152042011-04-09 Chong Yidong <cyd@stupidchicken.com>
15205
15206 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
15207
8546720e 152082011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 15209
04f2d78b
CB
15210 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
15211 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 15212
8546720e
GM
15213 * xterm.c (handle_one_xevent):
15214 * xmenu.c (create_and_show_popup_menu):
15215 * xselect.c (x_decline_selection_request)
15216 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 15217
0a2f5c1a 152182011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
15219
15220 Fix some uses of `int' instead of EMACS_INT.
15221 * search.c (string_match_1, fast_string_match)
15222 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
15223 (scan_buffer, find_next_newline_no_quit)
15224 (find_before_next_newline, search_command, Freplace_match)
15225 (Fmatch_data): Make some `int' variables be EMACS_INT.
15226
15227 * xdisp.c (display_count_lines): 3rd argument and return value now
15228 EMACS_INT. All callers changed.
15229 (pint2hrstr): Last argument is now EMACS_INT.
15230
15231 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
15232 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
15233 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
15234 (decode_coding_utf_16, decode_coding_emacs_mule)
15235 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
15236 (decode_coding_ccl, decode_coding_charset)
15237 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
15238 (decode_coding_iso_2022, decode_coding_emacs_mule)
15239 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
15240 <char_offset, last_offset>: Declare EMACS_INT.
15241 (encode_coding_utf_8, encode_coding_utf_16)
15242 (encode_coding_emacs_mule, encode_invocation_designation)
15243 (encode_designation_at_bol, encode_coding_iso_2022)
15244 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
15245 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
15246 Declare EMACS_INT.
15247 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
15248 (encode_invocation_designation): Last argument P_NCHARS is now
15249 EMACS_INT.
15250 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
15251 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
15252
15253 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
15254 All users changed.
15255
15256 * ccl.c (Fccl_execute_on_string): Declare some variables
15257 EMACS_INT.
15258
8546720e 152592011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
15260
15261 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
15262
4e19a977
CS
152632011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
15264
15265 * process.c (Fformat_network_address): Doc fix.
15266
87302331
R
152672011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
15268
ee7683eb 15269 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 15270
cbb59342
CY
152712011-04-08 Chong Yidong <cyd@stupidchicken.com>
15272
15273 * keyboard.c (read_char): Call Lisp function help-form-show,
15274 instead of using internal_with_output_to_temp_buffer.
15275 (Qhelp_form_show): New var.
e0d38eeb 15276 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
15277
15278 * print.c (internal_with_output_to_temp_buffer): Function deleted.
15279
15280 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
15281
e67a13ab
CY
152822011-04-06 Chong Yidong <cyd@stupidchicken.com>
15283
04f2d78b
CB
15284 * process.c (Flist_processes): Remove to Lisp.
15285 (list_processes_1): Delete.
e67a13ab 15286
973f782d
EZ
152872011-04-06 Eli Zaretskii <eliz@gnu.org>
15288
7c106b1e
EZ
15289 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
15290
973f782d
EZ
15291 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
15292
41cf7d1a 152932011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 15294
ca23cc88
PE
15295 Fix more problems found by GCC 4.6.0's static checks.
15296
f390e2d5
PE
15297 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
15298
42eea0d0
PE
15299 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
15300
b69769da 15301 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 15302
f9541e84
PE
15303 * xdisp.c (vmessage): Mark as a printf-like function.
15304
13841b55
PE
15305 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
15306
c136c10f
PE
15307 * sound.c (sound_warning): Don't crash if arg contains a printf format.
15308
5e2d4a30
PE
15309 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
15310 printf-like functions.
15311 (tiff_load): Add casts to remove these marks before passing them
15312 to system-supplied API.
15313
583f48b9
PE
15314 * eval.c (Fsignal): Remove excess argument to 'fatal'.
15315
b25d760e
PE
15316 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
15317 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
15318 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
15319 directly, rather than having caller test rule sign. This avoids
15320 some unnecessary tests.
15321 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
15322 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
15323 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 15324
bc7b6697 15325 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 15326 (xfont_open): Avoid unnecessary tests.
bc7b6697 15327
27ccc379
PE
15328 * composite.c (composition_gstring_put_cache): Use unsigned integer.
15329
dcd5c89a
PE
15330 * composite.h, composite.c (composition_gstring_put_cache):
15331 Use EMACS_INT, not int, for length.
15332
b13a45c6
PE
15333 * composite.h (COMPOSITION_DECODE_REFS): New macro,
15334 breaking out part of COMPOSITION_DECODE_RULE.
15335 (COMPOSITION_DECODE_RULE): Use it.
15336 * composite.c (get_composition_id): Remove unused local vars,
15337 by using the new macro.
15338
1e792e4d
PE
15339 * textprop.c (set_text_properties_1): Change while to do-while,
15340 since the condition is always true at first.
15341
dc6c6455 15342 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
15343 (interval_deletion_adjustment): Return unsigned value.
15344 All uses changed.
dc6c6455 15345
aba7731a
PE
15346 * process.c (list_processes_1, create_pty, read_process_output):
15347 (exec_sentinel): Remove vars that were set but not used.
afd4052b 15348 (create_pty): Remove unnecessary "volatile"s.
bc57d757 15349 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 15350 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 15351 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 15352
fdfc4bf3
PE
15353 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
15354
fca8fe46 15355 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 15356 (update_syntax_table): Use unsigned instead of int.
fca8fe46 15357
06a0259a 15358 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 15359 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 15360 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 15361
e7b9e80f
PE
15362 * print.c (print_error_message): Avoid int overflow.
15363
56201685
PE
15364 * font.c (font_list_entities): Redo for clarity,
15365 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
15366
78834453 15367 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 15368 (font_score): Avoid potential overflow in diff calculation.
78834453 15369
0bc0b309 15370 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 15371 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 15372
e610eaca
PE
15373 * eval.c (funcall_lambda): Rename local to avoid shadowing.
15374
b895abce
PE
15375 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
15376 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
15377 can always succeed if overflow has undefined behavior.
15378
1f1d9321 15379 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 15380 (wordify): Omit three unnecessary tests.
1f1d9321 15381
c59478bc
PE
15382 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
15383 All callers changed. This avoids the need for an unused var.
15384
79b73827
PE
15385 * casefiddle.c (casify_region): Remove var that is set but not used.
15386
a4db5dfe
PE
15387 * dired.c (file_name_completion): Remove var that is set but not used.
15388
43aae36e
PE
15389 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
15390
2a47c44d 15391 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 15392 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 15393
a37c69bf
PE
15394 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
15395 Check for integer overflow on size calculations.
15396
328ab8e7
PE
15397 * buffer.c (Fprevious_overlay_change): Remove var that is set
15398 but not used.
15399
e5a2a5cb
PE
15400 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
15401 Remove vars that are set but not used.
8d84a6eb 15402 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 15403 (timer_check_2): Mark vars as initialized.
e5a2a5cb 15404
a60e5f68
PE
15405 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
15406
f661cb61 15407 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 15408 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 15409
f0397f5a
PE
15410 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
15411 that are set but not used.
15412
8664db06 15413 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 15414 if XCreateBitmapFromData fails (Bug#8410).
8664db06 15415
6abdaa4a
PE
15416 * xselect.c (x_get_local_selection, x_handle_property_notify):
15417 Remove vars that are set but not used.
15418
0ce7538d 15419 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 15420 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 15421
9ae848fc
PE
15422 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
15423 Remove var that is set but not used.
0b918413
PE
15424 (scroll_bar_windows_size): Now size_t, not int.
15425 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
15426 Check for overflow.
9ae848fc 15427
a5a62657
PE
15428 * xfaces.c (realize_named_face): Remove vars that are set but not used.
15429 (map_tty_color) [!defined MSDOS]: Likewise.
15430
5c5cdd39
PE
15431 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
15432
66ebf983
PE
15433 * coding.c: Remove vars that are set but not used.
15434 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
15435 All callers changed.
15436 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
15437 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
15438 (decode_coding_charset): Remove vars that are set but not used.
15439
1be4d761
PE
15440 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
15441 that is set but not used.
15442
47553fa8
PE
15443 * print.c (print_object): Remove var that is set but not used.
15444
1f7196bf 15445 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
15446 The gnulib version avoids calling malloc in the usual case,
15447 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
15448 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
15449 * filelock.c (current_lock_owner): Likewise.
15450 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
15451 * sysdep.c: Include allocator.h, careadlinkat.h.
15452 (emacs_no_realloc_allocator): New static constant.
15453 (emacs_readlink): New function.
fdb61804
PE
15454 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
15455 ../lib/careadlinkat.h.
d1fdcab7 15456
f84c17c7
SM
154572011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
15458
15459 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
15460 first non-nil return value).
15461
ef3862ad
JD
154622011-04-03 Jan Djärv <jan.h.d@swipnet.se>
15463
15464 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
15465 if not defined (Bug#8403).
15466
376a7006
JB
154672011-04-02 Juanma Barranquero <lekktu@gmail.com>
15468
15469 * xdisp.c (display_count_lines): Remove parameter `start',
15470 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
15471 (get_char_face_and_encoding): Remove parameter `multibyte_p',
15472 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
15473 (fill_stretch_glyph_string): Remove parameters `row' and `area',
15474 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
15475 and thereabouts. All callers changed.
15476 (get_per_char_metric): Remove parameter `f', unused since
15477 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
15478
6ca3801d
JM
154792011-04-02 Jim Meyering <meyering@redhat.com>
15480
15481 do not dereference NULL upon failed strdup
15482 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
15483 (ns_get_family): Likewise.
15484
d8e2b5ba
JB
154852011-04-02 Juanma Barranquero <lekktu@gmail.com>
15486
15487 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
15488
8c74fcbd
JD
154892011-04-02 Jan Djärv <jan.h.d@swipnet.se>
15490
15491 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
15492 later (Bug#8403).
15493
7200d79c
SM
154942011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
15495
03408648 15496 Add lexical binding.
7200d79c 15497
03408648
SM
15498 * window.c (Ftemp_output_buffer_show): New fun.
15499 (Fsave_window_excursion):
15500 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
15501
15502 * lread.c (lisp_file_lexically_bound_p): New function.
15503 (Fload): Bind Qlexical_binding.
15504 (readevalloop): Remove `evalfun' arg.
15505 Bind Qinternal_interpreter_environment.
15506 (Feval_buffer): Bind Qlexical_binding.
15507 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
15508 Mark as dynamic.
15509 (syms_of_lread): Declare `lexical-binding'.
15510
15511 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
15512
15513 * keyboard.c (eval_dyn): New fun.
15514 (menu_item_eval_property): Use it.
ca105506
SM
15515
15516 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 15517
03408648
SM
15518 * fns.c (concat, mapcar1): Accept byte-code-functions.
15519
15520 * eval.c (Fsetq): Handle lexical vars.
15521 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
15522 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
15523 (FletX, Flet): Obey lexical binding.
15524 (Fcommandp): Handle closures.
15525 (Feval): New `lexical' arg.
15526 (eval_sub): New function extracted from Feval. Use it almost
15527 everywhere where Feval was used. Look up vars in lexical env.
15528 Handle closures.
15529 (Ffunctionp): Move from subr.el.
15530 (Ffuncall): Handle closures.
15531 (apply_lambda): Remove `eval_flags'.
15532 (funcall_lambda): Handle closures and new byte-code-functions.
15533 (Fspecial_variable_p): New function.
15534 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
15535 but without exporting it to Lisp.
23aba0ea 15536
23aba0ea 15537 * doc.c (Fdocumentation, store_function_docstring):
03408648 15538 * data.c (Finteractive_form): Handle closures.
23aba0ea 15539
03408648
SM
15540 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
15541 interactive spec.
ba83908c 15542
04f2d78b
CB
15543 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
15544 New byte-codes.
03408648
SM
15545 (exec_byte_code): New function extracted from Fbyte_code to handle new
15546 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 15547
03408648 15548 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 15549
03408648 15550 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 15551
e2abce01
JB
155522011-03-31 Juanma Barranquero <lekktu@gmail.com>
15553
15554 * xdisp.c (redisplay_internal): Fix prototype.
15555
63696a73 155562011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 15557
63696a73 15558 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
15559 (try_scrolling): Use it when setting scroll_limit.
15560 Limit scrolling to 100 screen lines.
63696a73
EZ
15561 (redisplay_window): Even when falling back on "recentering",
15562 position point in the window according to scroll-conservatively,
15563 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
15564
15565 (try_scrolling): When point is above the window, allow searching
15566 as far as scroll_max, or one screenful, to compute vertical
15567 distance from PT to the scroll margin position. This prevents
15568 try_scrolling from unnecessarily failing when
15569 scroll-conservatively is set to a value slightly larger than the
15570 window height. Clean up the case of PT below the margin at bottom
15571 of window: scroll_max can no longer be INT_MAX. When aggressive
15572 scrolling is in use, don't let point enter the opposite scroll
15573 margin as result of the scroll.
15574 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
15575 threshold of 100 lines for never-recentering scrolling.
15576
e4cc2dfc
JB
155772011-03-31 Juanma Barranquero <lekktu@gmail.com>
15578
15579 * dispextern.h (move_it_by_lines):
15580 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
15581 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
15582 (message_log_check_duplicate): Remove parameters `prev_bol' and
15583 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
15584 (redisplay_internal): Remove parameter `preserve_echo_area',
15585 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
15586
15587 * indent.c (Fvertical_motion):
15588 * window.c (window_scroll_pixel_based, Frecenter):
15589 Don't pass `need_y_p' to `move_it_by_lines'.
15590
1c470562
SM
155912011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
15592
44f230aa
SM
15593 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
15594 steal a few bits to be more compact.
15595 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
15596 Remove unneeded casts.
15597
1c470562
SM
15598 * bytecode.c (Fbyte_code): CAR and CDR can GC.
15599
888adce9
ZK
156002011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
15601
15602 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
15603 binding" message (bug#7967).
15604
f838ed7b
PE
156052011-03-30 Paul Eggert <eggert@cs.ucla.edu>
15606
77861b95
PE
15607 Fix more problems found by GCC 4.6.0's static checks.
15608
de6dbc14
PE
15609 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
15610 Remove unused local var.
15611
f838ed7b
PE
15612 * editfns.c (Fmessage_box): Remove unused local var.
15613
792c7b2b
PE
15614 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
15615 (note_mode_line_or_margin_highlight, note_mouse_highlight):
15616 Omit unused local vars.
c499e557 15617 * window.c (shrink_windows): Omit unused local var.
b01a1c29 15618 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
15619 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
15620 Omit unused local var.
15621
ba0165e1
PE
15622 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
15623 Don't assume string length fits in int.
32ad8845 15624 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 15625 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 15626
3c59b4c9
PE
15627 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
15628 instead of alloca (Bug#8344).
15629
a3eed478 15630 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 15631 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 15632
eb4d412d
PE
15633 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
15634
1658b401
PE
15635 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
15636 concerns.
15637
15638 * term.c (produce_glyphless_glyph): Remove unnecessary test.
15639
15640 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 15641
9a2c6e05
PE
15642 * keyboard.c (syms_of_keyboard): Use the same style as later
15643 in this function when indexing through an array. This also
15644 works around GCC bug 48267.
15645
03d0a109
PE
15646 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
15647
44f730c8
PE
15648 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
15649
fe75f926
PE
15650 * chartab.c (sub_char_table_ref_and_range): Redo for slight
15651 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
15652
ffa8c828
PE
15653 * keyboard.c, keyboard.h (num_input_events): Now size_t.
15654 This avoids undefined behavior on integer overflow, and is a bit
15655 more convenient anyway since it is compared to a size_t variable.
15656
c5101a77
PE
15657 Variadic C functions now count arguments with size_t, not int.
15658 This avoids an unnecessary limitation on 64-bit machines, which
15659 caused (substring ...) to crash on large vectors (Bug#8344).
15660 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
15661 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 15662 All variadic functions and their callers changed accordingly.
c5101a77
PE
15663 (struct gcpro.nvars): Now size_t, not int. All uses changed.
15664 * data.c (arith_driver, float_arith_driver): Likewise.
15665 * editfns.c (general_insert_function): Likewise.
15666 * eval.c (struct backtrace.nargs, interactive_p)
15667 (internal_condition_case_n, run_hook_with_args, apply_lambda)
15668 (funcall_lambda, mark_backtrace): Likewise.
15669 * fns.c (concat): Likewise.
15670 * frame.c (x_set_frame_parameters): Likewise.
15671 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
15672 0 if not found, not -1. All callers changed.
15673
dd3f25f7
PE
15674 * alloc.c (garbage_collect): Don't assume stack size fits in int.
15675 (stack_copy_size): Now size_t, not int.
15676 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
15677
461c2ab9
JB
156782011-03-28 Juanma Barranquero <lekktu@gmail.com>
15679
15680 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
15681 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
15682 All callers changed.
15683
15684 * lisp.h (multibyte_char_to_unibyte):
15685 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
15686 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
15687 * character.h (CHAR_TO_BYTE8):
15688 * cmds.c (internal_self_insert):
15689 * editfns.c (general_insert_function):
15690 * keymap.c (push_key_description):
15691 * search.c (Freplace_match):
15692 * xdisp.c (message_dolog, set_message_1): All callers changed.
15693
f6d62986
SM
156942011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
15695
15696 * keyboard.c (safe_run_hook_funcall): New function.
15697 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
15698 don't set the hook to nil, but remove the offending function instead.
15699 (Qcommand_hook_internal): Remove, unused.
15700 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
15701 Vcommand_hook_internal.
15702
15703 * eval.c (enum run_hooks_condition): Remove.
15704 (funcall_nil, funcall_not): New functions.
15705 (run_hook_with_args): Call each function through a `funcall' argument.
15706 Remove `cond' argument, now redundant.
15707 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
15708 (Frun_hook_with_args_until_failure): Adjust accordingly.
15709 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
15710
1db5b1ad
JB
157112011-03-28 Juanma Barranquero <lekktu@gmail.com>
15712
15713 * dispextern.h (string_buffer_position): Remove declaration.
15714
15715 * print.c (strout): Remove parameter `multibyte', unused since
15716 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
15717
15718 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
15719 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
15720 All callers changed.
15721
15722 * w32.c (_wsa_errlist): Use braces for struct initializers.
15723
15724 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
15725 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
15726 All callers changed.
15727 (string_buffer_position): Likewise. Also, make static (it's never
15728 used outside xdisp.c).
15729 (cursor_row_p): Remove parameter `w', unused since
15730 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
15731 (decode_mode_spec): Remove parameter `precision', introduced during
15732 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
15733 All callers changed.
15734
5ffb62aa
JD
157352011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15736
15737 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
15738
461c2ab9 157392011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
15740
15741 * nsterm.m (ns_menu_bar_is_hidden): New variable.
15742 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
15743 (ns_update_auto_hide_menu_bar): New functions.
15744 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
15745 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
15746 ns_constrain_all_frames.
15747 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
15748 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
15749
5c380ffb
JD
157502011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15751
15752 * nsmenu.m (runDialogAt): Remove argument to timer_check.
15753
9af30bdf
GM
157542011-03-27 Glenn Morris <rgm@gnu.org>
15755
15756 * syssignal.h: Replace RETSIGTYPE with void.
15757 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
15758 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
15759 Replace SIGTYPE with void everywhere.
15760 * s/usg5-4-common.h (SIGTYPE): Remove definition.
15761 * s/template.h (SIGTYPE): Remove commented out definition.
15762
e2abce01
JB
157632011-03-26 Eli Zaretskii <eliz@gnu.org>
15764
15765 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
15766 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
15767
f868cd8a
JB
157682011-03-26 Juanma Barranquero <lekktu@gmail.com>
15769
59eb0929
JB
15770 * w32.c (read_unc_volume): Use parameter `henum', instead of
15771 global variable `wget_enum_handle'.
15772
15773 * keymap.c (describe_vector): Remove parameters `indices' and
15774 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
15775 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
15776
f868cd8a
JB
15777 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
15778
15779 * keyboard.c (timer_check): Remove parameter `do_it_now',
15780 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
15781 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
15782 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
15783
15784 * keyboard.c (read_char):
15785 * w32menu.c (w32_menu_display_help):
15786 * xmenu.c (show_help_event, menu_help_callback):
15787 Adjust calls to `show_help_echo'.
15788
15789 * gtkutil.c (xg_maybe_add_timer):
15790 * keyboard.c (readable_events):
15791 * process.c (wait_reading_process_output):
15792 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
15793
15794 * insdel.c (adjust_markers_gap_motion):
15795 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
15796 (gap_left, gap_right): Don't call it.
15797
2ecf6fdb
CY
157982011-03-25 Chong Yidong <cyd@stupidchicken.com>
15799
15800 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
15801 incurred during fontification.
15802
6b1f9ba4
JB
158032011-03-25 Juanma Barranquero <lekktu@gmail.com>
15804
15805 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
15806 (DEFVAR_PER_BUFFER): Don't pass it.
15807
15808 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
15809 (scrolling_window): Don't pass it.
15810
0f4a96b5
JB
158112011-03-25 Juanma Barranquero <lekktu@gmail.com>
15812
15813 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
15814
15815 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
15816 and `suffix'.
15817 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
15818 of variables specific to SELinux and computation of `encoded_absname'.
15819
15820 * image.c (XPutPixel): Remove unused variable `height'.
15821
15822 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
15823
15824 * unexw32.c (get_section_info): Remove unused variable `section'.
15825
15826 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
15827 (system_process_attributes): Remove unused variable `sess'.
15828 (sys_read): Remove unused variable `err'.
15829
15830 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
15831 (w32_wnd_proc): Remove unused variable `isdead'.
15832 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
15833 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
15834 (x_create_tip_frame): Remove unused variable `tem'.
15835
15836 * w32inevt.c (w32_console_read_socket):
15837 Remove unused variable `no_events'.
15838
15839 * w32term.c (x_draw_composite_glyph_string_foreground):
15840 Remove unused variable `width'.
15841
1149507c
JB
158422011-03-24 Juanma Barranquero <lekktu@gmail.com>
15843
15844 * w32term.c (x_set_glyph_string_clipping):
15845 Don't pass uninitialized region to CombineRgn.
15846
9c88f339
JB
158472011-03-23 Juanma Barranquero <lekktu@gmail.com>
15848
15849 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
15850 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
15851 (Fx_close_connection): Remove unused variable `i'.
15852
15853 * w32font.c (w32font_draw): Return number of glyphs.
15854 (w32font_open_internal): Remove unused variable `i'.
15855 (w32font_driver): Add missing initializer.
15856
15857 * w32menu.c (utf8to16): Remove unused variable `utf16'.
15858 (fill_in_menu): Remove unused variable `items_added'.
15859
15860 * w32term.c (last_mouse_press_frame): Remove static global variable.
15861 (w32_clip_to_row): Remove unused variable `f'.
15862 (x_delete_terminal): Remove unused variable `i'.
15863
15864 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
15865 (NOTHING): Remove unused static global variable.
15866 (uniscribe_check_otf): Remove unused variable `table'.
15867 (uniscribe_font_driver): Add missing initializers.
15868
dee091a3
JD
158692011-03-23 Julien Danjou <julien@danjou.info>
15870
15871 * term.c (Fsuspend_tty, Fresume_tty):
15872 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
15873 * window.c (temp_output_buffer_show):
15874 * insdel.c (signal_before_change):
15875 * frame.c (Fhandle_switch_frame):
15876 * fileio.c (Fdo_auto_save):
15877 * emacs.c (Fkill_emacs):
15878 * editfns.c (save_excursion_restore):
15879 * cmds.c (internal_self_insert):
15880 * callint.c (Fcall_interactively):
15881 * buffer.c (Fkill_all_local_variables):
15882 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
15883 Use Frun_hooks.
0f4a96b5 15884 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 15885 unconditionally since it does the check itself.
dee091a3 15886
2c520ab5 158872011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 15888
c9c49752
PE
15889 Fix more problems found by GCC 4.5.2's static checks.
15890
8abc3f12
PE
15891 * coding.c (encode_coding_raw_text): Avoid unnecessary test
15892 the first time through the loop, since we know p0 < p1 then.
15893 This also avoids a gcc -Wstrict-overflow warning.
15894
a2d26660
PE
15895 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
15896 leading to a memory leak, possible in functions like
15897 load_charset_map_from_file that can allocate an unbounded number
b12ef411 15898 of objects (Bug#8318).
a2d26660 15899
916c72e9
PE
15900 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
15901 that could (at least in theory) be that large.
15902
19ab8a18
PE
15903 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
15904 This is less likely to overflow, and avoids undefined behavior if
15905 overflow does occur. All callers changed. Use strtoul to scan
15906 for the unsigned long integer.
b7cbbd6f
PE
15907 (pint2hrstr): Simplify and tune code slightly.
15908 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 15909
f0641eff
PE
15910 * scroll.c (do_scrolling): Work around GCC bug 48228.
15911 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
15912
7f650bb9
PE
15913 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
15914 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
15915 (validate_x_resource_name): Simplify count usage.
15916 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 15917
37dd57d1
PE
15918 * fileio.c (Fcopy_file): Report error if fchown or fchmod
15919 fail (Bug#8306).
81e56e61 15920
699979fc 15921 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 15922
401bf9b4
PE
15923 * process.c (Fmake_network_process): Use socklen_t, not int,
15924 where POSIX says socklen_t is required in portable programs.
15925 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 15926 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
15927 (Fmake_network_process, server_accept_connection):
15928 (wait_reading_process_output, read_process_output):
15929 Likewise.
15930
b93aacde
PE
15931 * process.c: Rename or move locals to avoid shadowing.
15932 (list_processes_1, Fmake_network_process):
15933 (read_process_output_error_handler, exec_sentinel_error_handler):
15934 Rename or move locals.
4dc343ee 15935 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 15936 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 15937 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 15938 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 15939 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 15940
af8a867c 15941 Make tparam.h and terminfo.c consistent.
44f230aa
SM
15942 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
15943 Include tparam.h instead, since it declares them.
af8a867c
PE
15944 * cm.h (PC): Remove extern decl; tparam.h now does this.
15945 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
15946 * terminfo.c: Include tparam.h, to check interfaces.
15947 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
15948 (tparam): Adjust signature to match interface in tparam.h;
15949 this removes some undefined behavior. Check that outstring and len
15950 are zero, which they always are with Emacs.
15951 * tparam.h (PC, BC, UP): New extern decls.
15952
0248044d 15953 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 15954 (xftfont_open): Rename locals to avoid shadowing.
0248044d 15955
8ff096c1 15956 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
15957 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
15958 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 15959 (ftfont_list): Remove unused local.
49eaafba
PE
15960 (get_adstyle_property, ftfont_pattern_entity):
15961 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
15962 Rename locals to avoid shadowing.
8ff096c1 15963
e2be39f6
PE
15964 * xfont.c (xfont_list_family): Mark var as initialized.
15965
c9735e30
PE
15966 * xml.c (make_dom): Now static.
15967
8f5201ae
PE
15968 * composite.c (composition_compute_stop_pos): Rename local to
15969 avoid shadowing.
b246f932
PE
15970 (composition_reseat_it): Remove unused locals.
15971 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 15972 (composition_update_it): Mark var as initialized.
11b61122
PE
15973 (find_automatic_composition): Mark vars as initialized,
15974 with a FIXME (Bug#8290).
8f5201ae 15975
760fbc2c
PE
15976 character.h: Rename locals to avoid shadowing.
15977 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
15978 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
15979 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
15980 (BUF_DEC_POS): Be more systematic about renaming local temporaries
15981 to avoid shadowing.
15982
ff08eb85
PE
15983 * textprop.c (property_change_between_p): Remove; unused.
15984
fc7bf025
PE
15985 * intervals.c (interval_start_pos): Now static.
15986
235d7abc
PE
15987 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
15988
44f230aa
SM
15989 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
15990 Rename locals to avoid shadowing.
3e7d6594 15991
50060332
PE
15992 * sound.c (wav_play, au_play, Fplay_sound_internal):
15993 Fix pointer signedness.
d01f234b 15994 (alsa_choose_format): Remove unused local var.
c83b8872
PE
15995 (wav_play): Initialize a variable to 0, to prevent undefined
15996 behavior (Bug#8278).
50060332 15997
c4fc4e30
PE
15998 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
15999
918436ed
PE
16000 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
16001
c939f91b
PE
16002 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
16003 clobbering (Bug#8298).
b9c7f648
PE
16004 * sysdep.c (sys_subshell): Likewise.
16005 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 16006
6bd8c144
PE
16007 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
16008 This should get cleaned up, so that child_setup has the
16009 same signature on all platforms.
16010
7710357c 16011 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 16012 (relocate_fd): Rename locals to avoid shadowing.
7710357c 16013
c59da222
CY
160142011-03-22 Chong Yidong <cyd@stupidchicken.com>
16015
16016 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
16017 not to be necessary, and produces flickering.
16018
66b87493
GM
160192011-03-20 Glenn Morris <rgm@gnu.org>
16020
16021 * config.in: Remove file.
16022
45b6f6d5
JB
160232011-03-20 Juanma Barranquero <lekktu@gmail.com>
16024
16025 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
16026 are now in src/globals.h.
16027 (syms_of_minibuf): Remove spurious & from previous change.
16028
cd394be1 160292011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
16030
16031 * minibuf.c (completing-read-function): New variable.
16032 (completing-read-default): Rename from completing-read.
16033 (completing-read): Call completing-read-function.
16034
b14e3e21
CY
160352011-03-19 Juanma Barranquero <lekktu@gmail.com>
16036
16037 * xfaces.c (Fx_load_color_file):
16038 Read color file from absolute filename (bug#8250).
16039
f2b726e6
JB
160402011-03-19 Juanma Barranquero <lekktu@gmail.com>
16041
16042 * makefile.w32-in: Update dependencies.
16043
09f6ff02
EZ
160442011-03-17 Eli Zaretskii <eliz@gnu.org>
16045
16046 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
16047
29a6015a
PE
160482011-03-17 Paul Eggert <eggert@cs.ucla.edu>
16049
a3a6c54e
PE
16050 Fix more problems found by GCC 4.5.2's static checks.
16051
b766f867
PE
16052 * process.c (make_serial_process_unwind, send_process_trap):
16053 (sigchld_handler): Now static.
16054
be02381c
PE
16055 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
16056 That way, the code declares only the vars that it needs.
16057 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
16058 * s/cygwin.h (PTY_ITERATION): Likewise.
16059 * s/darwin.h (PTY_ITERATION): Likewise.
16060 * s/gnu-linux.h (PTY_ITERATION): Likewise.
16061
57048744
PE
16062 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
16063 * process.c (allocate_pty): Don't declare stb unless it's needed.
16064
7914961c 16065 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
16066 (CONSTANTLIM): Remove; unused.
16067 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
16068 Define only if needed.
7914961c 16069
b3967b18
PE
16070 * unexelf.c (unexec): Name an expression,
16071 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
16072 Use a different way to cause a compilation error if anyone uses
16073 n rather than nn, a way that does not involve shadowing.
73366a00 16074 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 16075
29a6015a
PE
16076 * deps.mk (unexalpha.o): Remove; unused.
16077
43cfc33e 16078 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 16079 * unexec.h: New file.
ce701a33
PE
16080 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
16081 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
16082 Depend on unexec.h.
16083 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
16084 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
16085 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 16086 Change as necessary to match prototype in unexec.h.
ce701a33 16087
01f44d5a
PE
16088 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
16089 shadowing.
4f63c6bb 16090 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 16091
a6670b0b
PE
16092 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
16093 Rename locals to avoid shadowing.
16094
cef2010d 16095 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 16096 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 16097
d4d7173a
PE
16098 * print.c (Fredirect_debugging_output): Fix pointer signedess.
16099
f08b802a
PE
16100 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
16101 warning when compiling print.c.
16102
3ddb0639
PE
16103 * font.c (font_unparse_fcname): Abort in an "impossible" situation
16104 instead of using an uninitialized var.
5ad03b97 16105 (font_sort_entities): Mark var as initialized.
3ddb0639 16106
170a2692
PE
16107 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
16108
e663c700
PE
16109 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
16110 pointers to constants.
89bc529a 16111 (font_parse_fcname): Remove unused vars.
7b81e2d0 16112 (font_delete_unmatched): Now static.
ea838e10 16113 (font_get_spec): Remove; unused.
13a547c6
PE
16114 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
16115 (font_update_drivers, Ffont_get_glyphs, font_add_log):
16116 Rename or move locals to avoid shadowing.
e663c700 16117
2a80c887 16118 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 16119 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 16120
1384fa33 16121 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 16122 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 16123
8b2c52e9
PE
16124 * alloc.c (mark_backtrace): Move decl from here ...
16125 * lisp.h: ... to here, so that it can be checked.
16126
475545b5 16127 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 16128 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
16129 (lisp_indirect_variable): Name an expression,
16130 to avoid gcc -Wbad-function-cast warning.
1faed8ae 16131 (Fdefvar): Rename locals to avoid shadowing.
475545b5 16132
b1349114 16133 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 16134 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 16135 Use const pointer when appropriate.
b1349114 16136
a2928364
PE
16137 * lisp.h (get_system_name, get_operating_system_release):
16138 Move decls here, to check interfaces.
16139 * process.c (get_operating_system_release): Move decl to lisp.h.
16140 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
16141 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
16142 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
16143 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
16144 (Fformat_time_string, Fencode_time, Finsert_char):
16145 (Ftranslate_region_internal, Fformat):
16146 Rename or remove local vars to avoid shadowing.
9710023e 16147 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 16148
a415e694
PE
16149 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
16150 avoid shadowing.
16151
8ef4622d
PE
16152 * lisp.h (eassert): Check that the argument compiles, even if
16153 ENABLE_CHECKING is not defined.
16154
946f9a5b
PE
16155 * data.c (Findirect_variable): Name an expression, to avoid
16156 gcc -Wbad-function-cast warning.
112396d6 16157 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 16158 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
16159 (Fmake_variable_buffer_local, Fmake_local_variable):
16160 Mark variables as initialized.
52746918 16161 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 16162
e5aab7e7 16163 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
16164 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
16165 Rename locals to avoid shadowing.
dff45157
PE
16166 (mark_stack): Move local variables into the #ifdef region where
16167 they're used.
7bc26fdb
PE
16168 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
16169 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
16170 needed otherwise.
16171 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
16172 (GC_STRING_CHARS): Remove; not used.
d40d4be1 16173 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 16174
e5aab7e7
PE
16175 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
16176 avoids undefined behavior in theory.
16177
4da60324
PE
16178 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
16179
88043301
PE
16180 Use functions, not macros, for up- and down-casing (Bug#8254).
16181 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16182 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
16183 to use the following functions instead of these macros.
16184 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
16185 EMACS_INT, since callers assume the returned value fits in int.
16186 (upcase1): Likewise, for UPCASE_TABLE.
16187 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 16188 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 16189 the race-condition problem in the old DOWNCASE.
88043301 16190
19ed5445
PE
16191 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
16192 Rename locals to avoid shadowing.
16193 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
16194 (regex_compile, re_search_2, re_match_2_internal):
16195 Remove unused local vars.
952db0d7
PE
16196 (FREE_VAR): Rewrite so as not to use empty "else",
16197 which gcc can warn about.
da053e48 16198 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
16199 (RETALLOC_IF): Define only if needed.
16200 (WORDCHAR_P): Likewise. This one is never needed, but is used
16201 only in a comment talking about a compiler bug, so put inside
16202 the #if 0 of that comment.
16203 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
16204 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
16205 Remove; unused.
19ed5445 16206
1f3561e4 16207 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
16208 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
16209 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 16210
ded6f8f7
PE
16211 * search.c (simple_search): Remove unused var.
16212
dbd37a95
PE
16213 * dired.c (compile_pattern): Move decl from here ...
16214 * lisp.h: ... to here, so that it can be checked.
16215 (struct re_registers): New forward decl.
16216
7e47afad
PE
16217 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
16218
85f24f61
PE
16219 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
16220 All uses changed.
16221 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
16222 Rename locals to avoid shadowing.
5671df8f 16223 (Fvertical_motion): Mark locals as initialized.
85f24f61 16224
181aa2be 16225 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 16226 (casify_region): Mark local as initialized.
181aa2be 16227
930d429c
PE
16228 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
16229
7082eac6
PE
16230 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
16231 New macros, so that the caller can use some names other than
16232 gcpro1, gcpro2, etc.
16233 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
16234 of the new macros.
16235 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
16236 argument, for consistency with GCPRO2_VAR, etc: it is now the
16237 prefix of the variable, not the variable itself. All uses
16238 changed.
38b2c076
PE
16239 * dired.c (directory_files_internal, file_name_completion):
16240 Rename locals to avoid shadowing.
16241
15206ed9
PE
16242 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
16243 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
16244 dired.c's scmp function, had undefined behavior.
16245 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16246 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
16247 * buffer.h: ... to here, because these macros use current_buffer,
16248 and the new implementation with inline functions needs to have
16249 current_buffer in scope now, rather than later when the macros
16250 are used.
16251 (downcase, upcase1): New static inline functions.
16252 (DOWNCASE, UPCASE1): Reimplement using these functions.
16253 This avoids undefined behavior in expressions like
16254 DOWNCASE (x) == DOWNCASE (y), which previously suffered
16255 from race conditions in accessing the global variables
16256 case_temp1 and case_temp2.
16257 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
16258 * lisp.h (case_temp1, case_temp2): Remove their decls.
16259 * character.h (ASCII_CHAR_P): Move from here ...
16260 * lisp.h: ... to here, so that the inline functions mentioned
16261 above can use them.
16262
4a6bea26
PE
16263 * dired.c (directory_files_internal_unwind): Now static.
16264
f14b7e14
PE
16265 * fileio.c (file_name_as_directory, directory_file_name):
16266 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
16267 Now static.
2893f146
PE
16268 (file_name_as_directory): Use const pointers when appropriate.
16269 (Fexpand_file_name): Likewise. In particular, newdir might
16270 point at constant storage, so make it a const pointer.
fd4ead52 16271 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
16272 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
16273 signedness issues.
f839df0c
PE
16274 (Fset_file_times, Finsert_file_contents, auto_save_error):
16275 Rename locals to avoid shadowing.
f14b7e14 16276
5716756e 16277 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
16278 (Ftry_completion, Fall_completions): Rename or remove locals
16279 to avoid shadowing.
5716756e 16280
b4c3046a
PE
16281 * marker.c (bytepos_to_charpos): Remove; unused.
16282
b45db522
PE
16283 * lisp.h (verify_bytepos, count_markers): New decls,
16284 so that gcc does not warn that these functions aren't declared.
16285
85876d07
PE
16286 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
16287 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 16288 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 16289 (copy_text): Remove unused local var.
85876d07 16290
03d78a21 16291 * filelock.c (within_one_second): Now static.
b3dd38ab 16292 (lock_file_1): Rename local to avoid shadowing.
03d78a21 16293
5df8f01b
PE
16294 * buffer.c (fix_overlays_before): Mark locals as initialized.
16295 (fix_start_end_in_overlays): Likewise. This function should be
16296 simplified by using pointers-to-pointers, but that's a different
16297 matter.
b1d876f1 16298 (switch_to_buffer_1): Now static.
8f54f30a
PE
16299 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
16300 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 16301
a70072c9 16302 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 16303 Fix pointer signedness issue.
edced198
PE
16304 (sys_subshell): Mark local as volatile if checking for lint,
16305 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 16306 (MAXPATHLEN): Define only if needed.
a70072c9 16307
a0977c44
PE
16308 * process.c (serial_open, serial_configure): Move decls from here ...
16309 * systty.h: ... to here, so that they can be checked.
16310
a884fdcc
PE
16311 * fns.c (get_random, seed_random): Move extern decls from here ...
16312 * lisp.h: ... to here, so that they can be checked.
16313
604efe86 16314 * sysdep.c (reset_io): Now static.
b8950c94 16315 (wait_for_termination_signal): Remove; unused.
604efe86 16316
38fc62d9
PE
16317 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
16318 (copy_keymap_item, append_key, push_text_char_description):
16319 Now static.
1004a21a 16320 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 16321 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
16322 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
16323 (describe_map_tree):
16324 Rename locals to avoid shadowing.
38fc62d9 16325
2f2650da
PE
16326 * keyboard.c: Declare functions static if they are not used elsewhere.
16327 (echo_char, echo_dash, cmd_error, top_level_2):
16328 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
16329 (read_char, kbd_buffer_get_event, make_lispy_position):
16330 (make_lispy_event, make_lispy_movement, apply_modifiers):
16331 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
16332 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
16333 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 16334 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 16335 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 16336
a053e86c 16337 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
16338 (mark_kboards): Move decl here ...
16339 * alloc.c (mark_kboards): ... from here.
a053e86c 16340
4752793e
PE
16341 * lisp.h (force_auto_save_soon): New decl.
16342
74f10ca7 16343 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
16344 (DEFINE_DUMMY_FUNCTION): New macro.
16345 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
16346 Use it.
c03cd23f
PE
16347 (main): Add casts to avoid warnings
16348 if GCC considers string literals to be constants.
74f10ca7 16349
022e70d4
PE
16350 * lisp.h (fatal_error_signal): Add decl, since it's exported.
16351
59d6fe83
PE
16352 * dbusbind.c: Pointer signedness fixes.
16353 (xd_signature, xd_append_arg, xd_initialize):
16354 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16355 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16356 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
16357 (Fdbus_register_signal): Use SSDATA when the context wants char *.
16358
78320123
PE
16359 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
16360 if GCC considers string literals to be constants.
49cebcca 16361 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 16362
35ac2a97
SM
163632011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
16364
fb103ca9
SM
16365 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
16366 (print_preprocess, print_object): New macro to fix last change.
16367
35ac2a97
SM
16368 * print.c (print_preprocess): Don't forget font objects.
16369
62973b41
JB
163702011-03-16 Juanma Barranquero <lekktu@gmail.com>
16371
16372 * emacs.c (USAGE3): Doc fixes.
16373
0e48bb22
AS
163742011-03-15 Andreas Schwab <schwab@linux-m68k.org>
16375
16376 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
16377 structure.
16378
7684e57b
JB
163792011-03-14 Juanma Barranquero <lekktu@gmail.com>
16380
16381 * lisp.h (VWindow_system, Qfile_name_history):
16382 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
16383 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
16384 (w32_system_caret_x, w32_system_caret_y): Declare extern.
16385
16386 * w32select.c: Don't #include "keyboard.h".
c96bbc66 16387 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
16388
16389 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
16390 * w32console.c (detect_input_pending, read_input_pending)
16391 (encode_terminal_code):
16392 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
16393 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
16394 (w32_system_caret_y, Qfile_name_history):
16395 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
16396 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
16397 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
16398 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
16399 * w32proc.c (Qlocal, report_file_error):
16400 * w32term.c (Vwindow_system, updating_frame):
16401 * w32uniscribe.c (initialized, uniscribe_font_driver):
16402 Remove unneeded extern declarations.
16403
2aa46d6c
CY
164042011-03-14 Chong Yidong <cyd@stupidchicken.com>
16405
c96bbc66 16406 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 16407
cffc6f3b
CY
164082011-03-13 Chong Yidong <cyd@stupidchicken.com>
16409
16410 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
16411 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
16412 These macros can no longer be used for assignment.
16413
44f230aa
SM
16414 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
16415 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
16416 (record_buffer_markers, fetch_buffer_markers): New functions for
16417 recording and fetching special buffer markers.
16418 (set_buffer_internal_1, set_buffer_temp): Use them.
16419
16420 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
16421
16422 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
16423
16424 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
16425 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
16426
16427 * xdisp.c (hscroll_window_tree):
16428 (reconsider_clip_changes): Use PT instead of BUF_PT.
16429
d251f04b
EZ
164302011-03-13 Eli Zaretskii <eliz@gnu.org>
16431
16432 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
16433 $(EMACS_ROOT)/lib/intprops.h.
16434
f0c77cd1
PE
164352011-03-13 Paul Eggert <eggert@cs.ucla.edu>
16436
3eca4629
PE
16437 Fix more problems found by GCC 4.5.2's static checks.
16438
7c86ee98
PE
16439 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
16440 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
16441 (xg_free_frame_widgets): Make it clear that a local variable is
16442 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
16443 (gdk_window_get_screen): Make it clear that this macro is needed
16444 only if USE_GTK_TOOLTIP.
1e5524e7
PE
16445 (int_gtk_range_get_value): New function, which avoids a diagnostic
16446 from gcc -Wbad-function-cast.
16447 (xg_set_toolkit_scroll_bar_thumb): Use it.
16448 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
16449 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
16450 (get_utf8_string, xg_get_file_with_chooser):
16451 Rename locals to avoid shadowing.
16452 (create_dialog): Move locals to avoid shadowing.
7c86ee98 16453
41729b81
PE
16454 * xgselect.c (xg_select): Remove unused var.
16455
f0c77cd1
PE
16456 * image.c (four_corners_best): Mark locals as initialized.
16457 (gif_load): Initialize transparent_p to zero (Bug#8238).
16458 Mark another local as initialized.
ec6cf4c6 16459 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 16460
ce0ad53d 16461 * image.c (clear_image_cache): Now static.
d5d5a617 16462 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 16463 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
16464 (x_edge_detection): Remove unnecessary cast that
16465 gcc -Wbad-function-cast diagnoses.
2037898d 16466 (gif_load): Fix pointer signedness.
6ae141d6
PE
16467 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
16468 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 16469
33383987 164702011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 16471
d32df629
PE
16472 Improve quality of tests for time stamp overflow.
16473 For example, without this patch (encode-time 0 0 0 1 1
16474 1152921504606846976) returns the obviously-bogus value (-948597
16475 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
16476 reports time overflow. See
16477 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
16478 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
16479 * editfns.c: Include limits.h and intprops.h.
16480 (TIME_T_MIN, TIME_T_MAX): New macros.
16481 (time_overflow): Move earlier, to before first use.
16482 (hi_time, lo_time): New functions, for an accurate test for
16483 out-of-range times.
16484 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
16485 (Fget_internal_run_time): Don't assume time_t fits in int.
16486 (make_time): Use list2 instead of Fcons twice.
16487 (Fdecode_time): More accurate test for out-of-range times.
16488 (check_tm_member): New function.
16489 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
16490 (lisp_time_argument): Don't rely on undefined left-shift and
16491 right-shift behavior when checking for time stamp overflow.
8be6f318 16492
fe31d94c
PE
16493 * editfns.c (time_overflow): New function, refactoring common code.
16494 (Fformat_time_string, Fdecode_time, Fencode_time):
16495 (Fcurrent_time_string): Use it.
16496
8be6f318
PE
16497 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
16498 * dired.c (make_time): Move to ...
16499 * editfns.c (make_time): ... here.
16500 * systime.h: Note the move.
16501
09d9db2c 165022011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 16503
126bc0dc
YM
16504 * fringe.c (update_window_fringes): Remove unused variables.
16505
c47cbdfd
YM
16506 * unexmacosx.c (copy_data_segment): Also copy __got section.
16507 (Bug#8223)
16508
7ac80be9
EZ
165092011-03-12 Eli Zaretskii <eliz@gnu.org>
16510
c96bbc66 16511 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
16512 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
16513 Constify `char *' arguments and their references according to
16514 prototypes in tparam.h.
16515
ecb0f94d 16516 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 16517
7ac80be9
EZ
16518 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
16519 Adapt all references accordingly.
16520
16521 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
16522
ef1fd07e
TT
165232011-03-11 Tom Tromey <tromey@redhat.com>
16524
16525 * buffer.c (syms_of_buffer): Remove obsolete comment.
16526
7ef4b50c
EZ
165272011-03-11 Eli Zaretskii <eliz@gnu.org>
16528
16529 * termhooks.h (encode_terminal_code): Declare prototype.
16530
16531 * msdos.c (encode_terminal_code): Don't declare prototype.
16532
16533 * term.c (encode_terminal_code): Now external again, used by
16534 w32console.c and msdos.c.
16535
44f230aa
SM
16536 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
16537 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 16538
4b1ec863 165392011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 16540
1714f52b 16541 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 16542
4b1ec863
PE
16543 * fringe.c (update_window_fringes): Mark locals as initialized
16544 (Bug#8227).
16545 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 16546
524c7aa6
PE
16547 * alloc.c (mark_fringe_data): Move decl from here ...
16548 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
16549 to check its interface.
16550 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
16551
a5c0af81 16552 * fontset.c (free_realized_fontset): Now static.
7519b8cd 16553 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 16554 (fontset_font): Mark local as initialized.
a9a06e0b 16555 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 16556
b4716021
PE
16557 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
16558
811e9bac 16559 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 16560 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
16561 (x_own_selection, Fx_disown_selection_internal): Rename locals
16562 to avoid shadowing.
16563 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 16564
7e3ab302
PE
16565 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
16566 so that the caller can use some name other than gcpro1.
16567 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
16568 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
16569 (Fx_backspace_delete_keys_p):
16570 Use them to avoid shadowing, and rename vars to avoid shadowing.
16571 (x_decode_color, x_set_name, x_window): Now static.
6b437900 16572 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 16573 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
16574 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
16575 Remove unused locals.
7e3ab302
PE
16576 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
16577 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
16578 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
16579 macros.
f78faa98 16580
e2b13473
PE
16581 * xterm.h (x_mouse_leave): New decl.
16582
77f23912
PE
16583 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
16584 Remove unused functions.
cdf4ba58
PE
16585 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
16586 (x_calc_absolute_position): Now static.
7411c686 16587 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 16588 Don't declare local "event" unless it's used.
ed7bf3a5
PE
16589 (x_iconify_frame, x_free_frame_resources): Don't declare locals
16590 unless they are used.
38d0b34a
PE
16591 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
16592 (x_fatal_error_signal): Remove; not used.
a6067996
PE
16593 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
16594 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
16595 (x_error_catcher, x_connection_closed, x_error_handler):
16596 (x_error_quitter, xembed_send_message, x_iconify_frame):
16597 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 16598 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 16599 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 16600
44f230aa
SM
16601 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
16602 Rename or move locals to avoid shadowing.
6b463e58 16603 (tty_defined_color, merge_face_heights): Now static.
5967d051 16604 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
16605 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
16606 does not deduce is never used uninitialized.
73719eba
PE
16607 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
16608 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 16609
426994c3 16610 * terminal.c (store_terminal_param): Now static.
5489860b 16611
032f1620 16612 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 16613 (set_frame_menubar): Remove unused local.
d4323972 16614 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
16615 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
16616 since they might point to immutable storage.
281585b0
PE
16617 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
16618 since it's unused otherwise.
032f1620 16619
367c19e5 16620 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 16621 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
16622 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
16623 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 16624 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
16625 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
16626 does not deduce are never used uninitialized.
70739cbe 16627
07b48fa9
PE
16628 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
16629
8868a238 16630 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
16631 * window.c (window_loop, size_window):
16632 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 16633
7e5cf297 16634 * window.c (display_buffer): Now static.
d6550a9f
PE
16635 (size_window): Mark variables that gcc -Wuninitialized
16636 does not deduce are never used uninitialized.
a586633d
PE
16637 * window.h (check_all_windows): New decl, to forestall
16638 gcc -Wmissing-prototypes diagnostic.
5b555da1 16639 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 16640
f6095868
PE
16641 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
16642 shadowing.
16643 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
16644 Include <limits.h>.
16645 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
16646 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
16647 (load_charset_map): Mark variables that gcc -Wuninitialized
16648 does not deduce are never used uninitialized.
53df7c11 16649 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 16650
f38b440c
PE
16651 * coding.c (coding_set_source, coding_set_destination):
16652 Use "else { /* comment */ }" rather than "else /* comment */;"
16653 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
16654 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
16655 a block, when the outer 'i' will do.
16656 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
16657 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
16658 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
16659 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
16660 (Fdecode_sjis_char, Fdefine_coding_system_internal):
16661 Rename locals to avoid shadowing.
16662 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
16663 * coding.c (emacs_mule_char, encode_invocation_designation):
16664 Now static, since they're not used elsewhere.
413bb2db 16665 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 16666 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
16667 (decode_coding_emacs_mule): Mark variables that gcc
16668 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
16669 (detect_coding_iso_2022): Initialize a local variable that might
16670 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 16671 this initialization is needed. (Bug#8211)
5f58e762
PE
16672 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
16673 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
16674 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
16675 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
16676 Remove unused macros.
f38b440c 16677
232b38b9 16678 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 16679 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 16680 * character.c (string_count_byte8): Likewise.
232b38b9 16681
fb90da1b
PE
16682 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
16683 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
16684
fb93dbc2
PE
16685 * chartab.c (copy_sub_char_table): Now static, since it's not used
16686 elsewhere.
5c156ace
PE
16687 (sub_char_table_ref_and_range, char_table_ref_and_range):
16688 Rename locals to avoid shadowing.
bbcd0949 16689 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 16690
7d3b3862 16691 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 16692 (BIDI_BOB): Remove unused macro.
7d3b3862 16693
6be7d3da
PE
16694 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
16695 deduce are never used uninitialized.
c2ed9c8b 16696 * term.c (encode_terminal_code): Likewise.
6be7d3da 16697
75f8807f 16698 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 16699
50938595
PE
16700 * tparam.h: New file.
16701 * term.c, tparam.h: Include it.
16702 * deps.mk (term.o, tparam.o): Depend on tparam.h.
16703 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
16704 Move these decls to tparam.h, and make them agree with what
16705 is actually in tparam.c. The previous trick of using incompatible
16706 decls in different modules does not conform to the C standard.
16707 All callers of tparam changed to use tparam's actual API.
16708 * tparam.c (tparam1, tparam, tgoto):
16709 Use const pointers where appropriate.
16710
fbceeba2
PE
16711 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
16712 * cm.h (struct cm): Likewise.
16713 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
16714 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
16715 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
16716 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
16717 (turn_on_face, init_tty): Likewise.
16718 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 16719
7f3f1250
PE
16720 * term.c (term_mouse_position): Rename local to avoid shadowing.
16721
e6ca6543
PE
16722 * alloc.c (mark_ttys): Move decl from here ...
16723 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
16724
c40f8d15
AS
167252011-03-11 Andreas Schwab <schwab@linux-m68k.org>
16726
16727 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
16728
cfe0661d
JB
167292011-03-09 Juanma Barranquero <lekktu@gmail.com>
16730
16731 * search.c (compile_pattern_1): Remove argument regp, unused since
16732 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
16733 (compile_pattern): Don't pass it.
16734
0afb4571
J
167352011-03-08 Jan Djärv <jan.h.d@swipnet.se>
16736
16737 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
16738 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
16739 for ! HAVE_GTK3.
16740 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
16741
16742 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
16743
16744 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
16745 gdk_window_get_screen, gdk_window_get_geometry,
16746 gdk_x11_window_lookup_for_display and GDK_KEY_g.
16747 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
16748 (xg_get_pixbuf_from_pixmap): New function.
16749 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
16750 to Pixmap, take frame as parameter, remove GdkColormap parameter.
16751 Call xg_get_pixbuf_from_pixmap instead of
16752 gdk_pixbuf_get_from_drawable.
16753 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
16754 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
16755 (xg_check_special_colors): Use GtkStyleContext and its functions
16756 for HAVE_GTK3.
16757 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
16758 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
16759 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
16760 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
16761 Call gtk_widget_get_preferred_size.
0afb4571
J
16762 (xg_frame_resized): gdk_window_get_geometry only takes 5
16763 parameters.
44f230aa
SM
16764 (xg_win_to_widget, xg_event_is_for_menubar):
16765 Call gdk_x11_window_lookup_for_display.
0afb4571
J
16766 (xg_set_widget_bg): New function.
16767 (delete_cb): New function.
895009e1 16768 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 16769 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
16770 (xg_set_background_color): Call xg_set_widget_bg.
16771 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
16772 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
16773 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
16774 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
16775 if ! HAVE_GTK3.
16776 (update_frame_tool_bar): Call gtk_widget_hide.
16777 (xg_initialize): Use GDK_KEY_g.
16778
16779 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
16780 if ! HAVE_GTK3
16781 (x_session_initialize): Call gdk_x11_set_sm_client_id.
16782
16783 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
16784 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
16785 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
16786
1c2cc4ef
JB
167872011-03-08 Juanma Barranquero <lekktu@gmail.com>
16788
16789 * w32xfns.c (select_palette): Check success of RealizePalette against
16790 GDI_ERROR, not zero.
16791
33383987 16792See ChangeLog.11 for earlier changes.
aac0c6e3
MR
16793
16794;; Local Variables:
16795;; coding: utf-8
aac0c6e3
MR
16796;; End:
16797
2f097256 16798 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
16799
16800 This file is part of GNU Emacs.
16801
16802 GNU Emacs is free software: you can redistribute it and/or modify
16803 it under the terms of the GNU General Public License as published by
16804 the Free Software Foundation, either version 3 of the License, or
16805 (at your option) any later version.
16806
16807 GNU Emacs is distributed in the hope that it will be useful,
16808 but WITHOUT ANY WARRANTY; without even the implied warranty of
16809 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16810 GNU General Public License for more details.
16811
16812 You should have received a copy of the GNU General Public License
16813 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.