1 2012-09-26 Stefan Monnier <monnier@iro.umontreal.ca>
3 * profiler.c (Fprofiler_cpu_stop, Fprofiler_memory_stop):
4 Return whether the profiler was running, instead of signaling an error
7 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
9 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
10 ($(BLD)/profiler.$(O)): New target.
12 2012-09-25 Stefan Monnier <monnier@iro.umontreal.ca>
14 * profiler.c: Rename sample_profiler_* to profiler_cpu_* and
15 memory_profiler_* to profiler_memory_*. Move sigprof_handler before
16 its first use, inside the PROFILER_CPU_SUPPORT conditional.
18 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
20 * profiler.c (evict_lower_half): Fix typo.
21 (PROFILER_CPU_SUPPORT): Check and define if cpu-profiler is supported.
22 Don't compile the cpu-profiler code, if not supported.
23 (malloc_probe): Presume memory_log is non-nil.
24 (syms_of_profiler): Don't defsubr functions when they aren't defined.
26 * lisp.h (sample_profiler_running, gc_probe): Don't declare.
28 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
30 * xdisp.c (Qautomatic_redisplay): New constant.
31 (redisplay_internal): Record itself in backtrace_list.
32 (syms_of_xdisp): Define Qautomatic_redisplay.
34 * profiler.c: Remove filtering functionality.
35 (is_in_trace, Qgc): Remove vars.
36 (make_log, record_backtrace, Fsample_profiler_log):
37 Rewrite, using Elisp hash-tables.
38 (approximate_median, evict_lower_half): New functions.
39 (cpu_log): Rename from sample_log.
40 (cpu_gc_count): New var.
41 (Fsample_profiler_reset, Fmemory_profiler_reset): Remove.
42 (sigprof_handler): Add count to cpu_gc_count during GC, detected via
44 (block_sigprof, unblock_sigprof): Remove.
45 (gc_probe, mark_profiler): Remove functions.
46 (syms_of_profiler): Staticpro cpu_log and memory_log.
48 * lisp.h (SXHASH_COMBINE): Move back to...
49 * fns.c (SXHASH_COMBINE): ...here.
51 * alloc.c (Fgarbage_collect): Record itself in backtrace_list.
52 Don't set is_in_trace any more. Don't call mark_profiler.
53 Only call gc_probe for the memory profiler.
54 (syms_of_alloc): Define Qautomatic_gc.
56 2012-09-15 Tomohiro Matsuyama <tomo@cx4a.org>
58 * alloc.c (emacs_blocked_malloc): Remove redundant MALLOC_PROBE.
60 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
62 * alloc.c: Use bool for booleans.
63 (gc_in_progress, abort_on_gc)
64 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
65 (dont_register_blocks) [GC_MALLOC_CHECK]:
66 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
67 (check_string_bytes, make_specified_string, memory_full)
68 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
69 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
70 (mark_stack, valid_pointer_p, make_pure_string)
71 (Fgarbage_collect, survives_gc_p, gc_sweep):
72 Use bool for booleans, instead of int.
73 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
75 * alloc.c (PURE_POINTER_P):
76 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
77 * editfns.c (Fformat):
78 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
80 * fns.c (sweep_weak_table):
81 * lisp.h (suppress_checking, push_message, survives_gc_p)
82 (make_pure_string, gc_in_progress, abort_on_gc):
83 * lread.c (readchar, read1):
84 * print.c (Fprin1_to_string):
85 * xdisp.c (push_message):
86 Use bool for booleans affected directly or indirectly by
89 Make recently-introduced setters macros.
90 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
91 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
92 (set_fontset_default, set_fontset_fallback): Rename from their
93 upper-case counterparts, and make them functions rather than macros.
94 This is more consistent with the other recently-introduced setters.
95 These don't need to be inline, since they're local.
97 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
99 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
100 the loop (Bug#12247).
102 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
104 * lisp.h (vcopy): Use memcpy rather than our own loop.
105 This fixes a performance regression introduced by the recent
106 addition of vcopy. This means 'vcopy' will need to be modified
107 for a copying collector, but that's OK. Also, tighten the
108 checking in the assertion.
110 2012-08-21 Eli Zaretskii <eliz@gnu.org>
112 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
113 components for RTL text (Bug#11860). Adjust X-OFFSET of each
114 non-base glyph for the width of the base character, according to
115 what x_draw_composite_glyph_string_foreground expects.
116 Generate WADJUST value according to composition_gstring_width's
117 expectations, to produce correct width of the composed character.
118 Reverse the sign of the DU offset produced by ScriptPlace.
120 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
122 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
124 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
126 Avoid direct writes to contents member of struct Lisp_Vector.
127 * lisp.h (vcopy): New function to copy data into vector.
128 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
129 * fns.c (Ffillarray): Use ASET.
130 * keyboard.c (timer_check_2): Use AREF and ASET.
131 (append_tool_bar_item, Frecent_keys): Use vcopy.
132 * lread.c (read_vector): Use ASET.
133 * msdos.c (Frecent_doskeys): Use vcopy.
134 * xface.c (Finternal_copy_lisp_face): Use vcopy.
135 (Finternal_merge_in_global_face): Use ASET and vcopy.
136 * xfont.c (xfont_list_pattern): Likewise.
138 2012-08-21 Martin Rudalics <rudalics@gmx.at>
140 * window.c (Fwindow_point): For the selected window always return
141 the position of its buffer's point.
142 (Fset_window_point): For the selected window always go in its
143 buffer to the specified position.
145 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
147 Setter macros for fontsets.
148 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
149 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
150 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
153 2012-08-20 Glenn Morris <rgm@gnu.org>
155 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
156 Don't assume that `ln -f' works.
158 2012-08-20 Eli Zaretskii <eliz@gnu.org>
160 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
161 and later about non-assignments with no effect. See discussion at
162 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
165 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
167 Inline setter functions for Lisp_Objects slots of struct specbinding.
168 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
171 2012-08-20 Martin Rudalics <rudalics@gmx.at>
173 * window.c (select_window): Always make selected window's buffer
176 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
178 Use AREF and ASET for docstrings of category tables.
179 * category.h (CATEGORY_DOCSTRING): Use AREF.
180 (SET_CATEGORY_DOCSTRING): Use ASET.
181 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
183 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
185 Inline setter functions for hash table members.
186 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
187 (set_hash_hash, set_hash_index): Rename with _slot suffix.
188 (set_hash_key_and_value, set_hash_index, set_hash_next)
189 (set_hash_hash): New functions.
190 * charset.c, fns.c: Adjust users.
192 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
194 Inline getter and setter functions for per-buffer values.
195 * buffer.h (per_buffer_default, set_per_buffer_default)
196 (per_buffer_value, set_per_buffer_value): New functions.
197 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
198 * buffer.c, data.c: Adjust users.
200 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
202 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
204 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
206 Rely on <config.h> + <unistd.h> to declare 'environ',
207 as gnulib does this if the system doesn't.
208 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
209 Remove declaration. MS-Windows declares it on stdlib.h which is
210 included by conf_post.h.
211 * emacs.c (environ) [DOUG_LEA_MALLOC]:
212 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
213 * vm-limit.c: Include <unistd.h>, for 'environ'.
215 * unexaix.c, unexcoff.c: Include "mem-limits.h".
216 (start_of_data): Remove decl; mem-limits.h provides it.
218 * xdisp.c (handle_invisible_prop): Make it a bit faster
219 and avoid a gcc -Wmaybe-uninitialized diagnostic.
221 2012-08-19 Chong Yidong <cyd@gnu.org>
223 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
226 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
228 * .gdbinit: Use call instead of set when calling a function in the
231 * data.c (set_internal): Don't use set_blv_found.
232 (Fkill_local_variable): Likewise.
234 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
236 * nsfont.m (ns_ascii_average_width): Ensure the string
237 ascii_printable is initialized with a null-terminated character
238 array. Otherwise, it can contain undesired extra characters.
240 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
242 port new setting code to Sun C 5.8 2005/10/13
243 * chartab.c, lisp.h (char_table_set, char_table_set_range):
244 Return void, not Lisp_Object. Otherwise, the compiler
245 complains about (A?B:C) where B is void and C is Lisp_Object
246 when compiling CHAR_TABLE_SET, due to the recent change to
247 the API of sub_char_table_set_contents.
249 2012-08-18 Chong Yidong <cyd@gnu.org>
251 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
252 for the string case (Bug#3874).
254 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
256 * buffer.h (BSET): Remove (Bug#12215).
257 Replace all uses with calls to new setter functions.
258 (bset_bidi_paragraph_direction, bset_case_canon_table)
259 (bset_case_eqv_table, bset_directory, bset_display_count)
260 (bset_display_time, bset_downcase_table)
261 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
262 (bset_last_selected_window, bset_local_var_alist)
263 (bset_mark_active, bset_point_before_scroll, bset_read_only)
264 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
266 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
267 (bset_auto_fill_function, bset_auto_save_file_format)
268 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
269 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
270 (bset_cache_long_line_scans, bset_case_fold_search)
271 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
272 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
273 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
274 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
275 (bset_header_line_format, bset_indicate_buffer_boundaries)
276 (bset_indicate_empty_lines, bset_invisibility_spec)
277 (bset_left_fringe_width, bset_major_mode, bset_mark)
278 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
279 (bset_name, bset_overwrite_mode, bset_pt_marker)
280 (bset_right_fringe_width, bset_save_length)
281 (bset_scroll_bar_width, bset_scroll_down_aggressively)
282 (bset_scroll_up_aggressively, bset_selective_display)
283 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
284 (bset_word_wrap, bset_zv_marker):
285 * category.c (bset_category_table):
286 * syntax.c (bset_syntax_table):
287 New setter functions.
289 * process.h (PSET): Remove (Bug#12215).
290 Replace all uses with calls to new setter functions.
291 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
292 (PROCESS_INLINE): New macro.
293 (pset_childp): New setter function.
294 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
295 * process.c (PROCESS_INLINE):
296 Define to EXTERN_INLINE, so that the corresponding functions
297 are compiled into code.
298 (pset_buffer, pset_command, pset_decode_coding_system)
299 (pset_decoding_buf, pset_encode_coding_system)
300 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
301 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
302 (pset_type, pset_write_queue): New setter functions.
304 * window.h (WSET): Remove (Bug#12215).
305 Replace all uses with calls to new setter functions.
306 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
307 (WINDOW_INLINE): New macro.
308 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
309 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
310 (wset_total_lines, wset_vertical_scroll_bar)
311 (wset_window_end_pos, wset_window_end_valid)
312 (wset_window_end_vpos): New setter functions.
313 * window.c (WINDOW_INLINE):
314 Define to EXTERN_INLINE, so that the corresponding functions
315 are compiled into code.
316 (wset_combination_limit, wset_dedicated, wset_display_table)
317 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
318 (wset_new_normal, wset_new_total, wset_next_buffers)
319 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
320 (wset_prev_buffers, wset_right_fringe_width)
321 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
322 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
323 (wset_window_parameters):
324 * xdisp.c (wset_base_line_number, wset_base_line_pos)
325 (wset_column_number_displayed, wset_region_showing):
326 New setter functions.
328 * termhooks.h (TSET): Remove (Bug#12215).
329 Replace all uses with calls to new setter functions.
330 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
331 (TERMHOOKS_INLINE): New macro.
332 (tset_charset_list, tset_selection_alist): New setter functions.
333 * terminal.c (TERMHOOKS_INLINE):
334 Define to EXTERN_INLINE, so that the corresponding functions
335 are compiled into code.
336 (tset_param_alist): New setter function.
338 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
340 * keyboard.h (KSET): Remove (Bug#12215).
341 Replace all uses with calls to new setter functions.
342 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
343 (KEYBOARD_INLINE): New macro.
344 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
345 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
346 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
347 New setter functions.
348 * keyboard.c (KEYBOARD_INLINE):
349 Define to EXTERN_INLINE, so that the corresponding functions
350 are compiled into code.
351 (kset_echo_string, kset_kbd_queue)
352 (kset_keyboard_translate_table, kset_last_prefix_arg)
353 (kset_last_repeatable_command, kset_local_function_key_map)
354 (kset_overriding_terminal_local_map, kset_real_last_command)
355 (kset_system_key_syms): New setter functions.
357 * frame.h (FSET): Remove (Bug#12215).
358 Replace all uses with calls to new setter functions.
359 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
360 (FRAME_INLINE): New macro.
361 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
362 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
363 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
364 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
365 (fset_param_alist, fset_root_window, fset_scroll_bars)
366 (fset_selected_window, fset_title, fset_tool_bar_items)
367 (fset_tool_bar_position, fset_tool_bar_window): New functions.
368 * frame.c (FRAME_INLINE):
369 Define to EXTERN_INLINE, so that the corresponding functions
370 are compiled into code.
371 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
373 A few more naming-convention fixes for getters and setters.
374 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
375 and rename from buffer_overlays_set_before.
376 (set_buffer_overlays_after): Move here from buffer.h, and rename
377 from buffer_overlays_set_after.
378 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
380 (set_buffer_intervals): Rename from buffer_set_intervals.
381 * intervals.c (set_interval_object): Move here from intervals.h,
382 and rename from interval_set_object.
383 (set_interval_left): Move here from intervals.h, and rename from
385 (set_interval_right): Move here from intervals.h, and rename from
387 (copy_interval_parent): Move here from intervals.h, and rename from
388 interval_copy_parent.
389 * intervals.h (set_interval_parent): Rename from interval_set_parent.
390 (set_interval_plist): Rename from interval_set_plist.
391 Return void, not Lisp_Object, since no caller uses the result.
392 * lisp.h (string_intervals): Rename from string_get_intervals.
393 (set_string_intervals): Rename from string_set_intervals.
395 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
396 (set_char_table_contents): Rename from char_table_set_contents.
397 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
398 All uses changed. See the end of
399 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
401 * lisp.h (CSET): Remove (Bug#12215).
402 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
403 (set_char_table_purpose): New functions,
404 replacing CSET. All uses changed. For example, replace
405 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
406 "set_char_table_parent (char_table, parent);".
407 The old version was confusing because it used the same name
408 'parent' for two different things.
410 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
412 Functions to get and set Lisp_Object fields of buffer-local variables.
413 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
414 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
415 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
416 * data.c, eval.c, frame.c: Adjust users.
418 2012-08-17 Chong Yidong <cyd@gnu.org>
420 * xfaces.c (merge_face_vectors): If the target font specfies a
421 font spec, make the font's attributes take precedence over
422 directly-specified attributes.
423 (merge_face_ref): Recognize :font.
425 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
427 Do not use memcpy for copying intervals.
428 * intervals.c (reproduce_interval): New function.
429 (reproduce_tree, reproduce_tree_obj): Use it.
430 (reproduce_tree_obj): Remove prototype.
432 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
434 * lisp.h (duration_to_sec_usec): Remove unused decl.
436 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
438 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
439 to an allocated instance of NSString, not to the class itself.
441 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
443 * makefile.w32-in (C_CTYPE_H): New macro.
444 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
445 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
446 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
448 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
450 Use ASCII tests for character types.
451 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
453 Don't include <ctype.h>; was not needed.
454 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
455 * sysdep.c, xfaces.c:
456 Include <c-ctype.h> instead of <ctype.h>.
457 * nsterm.m: Include <c-ctype.h>.
458 * charset.c (read_hex):
459 * doc.c (Fsnarf_documentation):
460 * fileio.c (IS_DRIVE) [WINDOWSNT]:
461 (DRIVE_LETTER) [DOS_NT]:
462 (Ffile_name_directory, Fexpand_file_name)
463 (Fsubstitute_in_file_name):
464 * font.c (font_parse_xlfd, font_parse_fcname):
465 * frame.c (x_set_font_backend):
466 * gtkutil.c (xg_get_font):
467 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
468 * nsimage.m (hexchar):
469 * nsterm.m (ns_xlfd_to_fontname):
470 * sysdep.c (system_process_attributes):
471 * xfaces.c (hash_string_case_insensitive):
472 Use C-locale tests instead of locale-specific tests for character
473 types, since we want the ASCII interpretation here, not the
474 interpretation suitable for whatever happens to be the current locale.
476 2012-08-16 Martin Rudalics <rudalics@gmx.at>
478 Consistently check windows for validity/liveness
479 (Bug#11984, Bug#12025, Bug#12026).
480 * lisp.h (CHECK_VALID_WINDOW): New macro.
481 * window.c (decode_window): Rename to decode_live_window.
482 (decode_valid_window, Fwindow_valid_p): New functions.
483 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
484 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
485 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
486 (Fwindow_prev_sibling, Fwindow_combination_limit)
487 (Fset_window_combination_limit, Fwindow_use_time)
488 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
489 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
490 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
491 (Fwindow_hscroll, Fset_window_hscroll)
492 (Fwindow_redisplay_end_trigger)
493 (Fset_window_redisplay_end_trigger, Fwindow_edges)
494 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
495 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
496 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
497 (Fwindow_end, Fset_window_point, Fset_window_start)
498 (Fpos_visible_in_window_p, Fwindow_line_height)
499 (Fwindow_dedicated_p, Fset_window_dedicated_p)
500 (Fwindow_prev_buffers, Fset_window_prev_buffers)
501 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
502 (Fset_window_parameter, Fwindow_display_table)
503 (Fset_window_display_table, Fdelete_other_windows_internal)
504 (Fset_window_buffer, Fset_window_new_total)
505 (Fset_window_new_normal, Fdelete_window_internal)
506 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
507 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
508 (Fwindow_scroll_bars): Check whether argument window is a valid or
509 live window. Update doc-strings.
510 (syms_of_window): New symbol Qwindow_valid_p.
511 * keyboard.c (Fposn_at_x_y): Check whether argument
512 frame_or_window denotes a valid window.
514 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
516 Fix previous char table change.
517 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
518 * chartab.c (optimize_sub_char_table): Likewise.
520 2012-08-16 Chong Yidong <cyd@gnu.org>
522 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
524 * xfont.c (xfont_open):
525 * xftfont.c (xftfont_open): Set the font's max_width field.
527 * nsfont.m (nsfont_open): Similar to the Xft backend, set
528 min_width to space_width and average_width to the average over
529 printable ASCII characters.
530 (ns_char_width): Code cleanup.
531 (ns_ascii_average_width): New utility function.
533 * font.h (struct font): Update comments.
535 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
537 Simple interface to set Lisp_Object fields of character tables.
538 * lisp.h (CSET): New macro.
539 (char_table_set_extras, char_table_set_contents)
540 (sub_char_table_set_contents): New function.
541 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
542 * syntax.c: Adjust users.
544 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
546 * eval.c (eval_sub): Bind lexical-binding.
547 * lread.c (Qlexical_binding): Make non-static.
549 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
551 * nsmenu.m (popupSession): Remove.
552 (pop_down_menu): Remove endModalSession.
553 (timeout_handler:): New method.
554 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
555 Call runModalForWindow. Check timer_fired when it returns.
556 If not set, cancel timer and break out of loop.
557 Otherwise loop again, with a new timeout.
559 * nsterm.m: Include fcntl.h if present.
560 (fd_entry, t_readfds, inNsSelect): Remove.
561 (select_writefds, select_valid, select_timeout, selfds)
562 (select_mutex, apploopnr): Add.
563 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
564 Otherwise call kbd_buffer_store_event.
565 (ns_send_appdefined): Remove release of fd_entry.
566 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
567 Increment and decrement apploopnr.
568 (ns_select): If no file descriptors, just do a NSTimer.
569 Otherwise copy read/write masks and start select thread (fd_handler).
570 Start main loop and wait for application defined event.
571 Inform select thread to stop selecting after main loop is exited.
572 (ns_term_init): Create selfds pipe and set non-blocking.
573 Initialize select_mutex. Start the select thread (fd_handler).
574 (fd_handler:): Loop forever, wait for info from the main thread
575 to either start or stop selecting. When select returns, send
576 and appdefined event.
577 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
578 If not call kbd_buffer_store_event.
580 * nsterm.h (EmacsApp): fd_handler takes id argument.
581 (EmacsDialogPanel): Add timer_fired and timeout_handler.
583 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
585 2012-08-15 Eli Zaretskii <eliz@gnu.org>
587 * region-cache.c (move_cache_gap): Update gap_len using the actual
588 growth of the boundaries array. Do not change cache_len.
591 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
593 Generalize and cleanup font subsystem checks.
594 * font.h (FONT_DEBUG, font_assert): Remove.
595 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
596 Change font_assert to eassert. Use eassert where appropriate.
598 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
600 * gtkutil.c (xg_get_font): Use pango_units_to_double.
602 2012-08-15 Chong Yidong <cyd@gnu.org>
604 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
605 When using the new font chooser, use gtk_font_chooser_get_font_desc to
606 extract the font descriptor instead of just the font name.
607 In that case, return a font spec instead of a string.
608 (x_last_font_name): Move to this file from xfns.c.
610 * xfns.c (Fx_select_font): The return value can also be a font
611 spec. Move x_last_font_name management to gtkutil.c.
613 * xfaces.c: Make font weight and style symbols non-static.
615 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
617 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
620 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
622 * alloc.c (Fgarbage_collect): Use plural form consistently.
624 2012-08-14 Eli Zaretskii <eliz@gnu.org>
626 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
627 iteration through the command loop. Fixes a problem whereby mouse
628 movements are ignored until the first mouse click.
630 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
632 Use bool, not int, for Lisp booleans.
633 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
634 makes Emacs a bit smaller and presumably a bit faster.
635 * lisp.h: Include <stdbool.h>.
636 (struct Lisp_Boolfwd, defvar_bool):
637 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
638 * regex.c [!emacs]: Include <stdbool.h>.
639 (false, true): Remove; <stdbool.h> does this for us now.
641 2012-08-14 Chong Yidong <cyd@gnu.org>
643 * character.c (Fcharacterp): Doc fix (Bug#12076).
645 * data.c (Findirect_variable): Doc fix (Bug#11040).
647 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
649 * editfns.c (Fformat): Doc fix (Bug#12059).
650 (Fsave_current_buffer): Doc fix (Bug#11542).
652 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
654 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
657 2012-08-14 Martin Rudalics <rudalics@gmx.at>
659 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
660 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
661 * minibuf.c (choose_minibuf_frame, read_minibuf):
662 * w32fns.c (x_create_tip_frame):
663 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
664 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
666 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
668 * intervals.c (offset_intervals): Remove obsolete comment.
670 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
672 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
674 2012-08-14 Gergely Risko <gergely@risko.hu>
676 * coding.c (decode_coding): Record buffer modification before
677 disabling undo_list (Bug#11773).
679 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
681 Revert and cleanup some recent overlay changes.
682 * buffer.h (enum overlay_type): Remove.
683 (buffer_get_overlays, buffer_set_overlays): Likewise.
684 (buffer_set_overlays_before, buffer_set_overlays_after):
685 New function. Adjust users.
686 (unchain_both): Add eassert.
688 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
690 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
692 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
694 * gtkutil.c (xg_mark_data): Don't assume C99.
696 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
698 * gtkutil.c (xg_frame_tb_info): New struct.
699 (TB_INFO_KEY): New define.
700 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
701 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
702 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
704 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
705 is up to date. Otherwise store new data.
706 (free_frame_tool_bar): Free xg_frame_tb_info if present.
708 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
710 Use KSET for write access to Lisp_Object members of struct kboard.
711 * keyboard.h (KSET): New macro.
712 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
713 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
714 * xterm.c: Adjust users.
716 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
718 Use BSET for write access to Lisp_Object members of struct buffer.
719 * buffer.h (BSET): New macro.
720 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
721 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
722 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
723 * window.c, xdisp.c, xfns.c: Adjust users.
725 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
727 * lread.c (syms_of_lread): Initialize Vlexical_binding.
729 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
731 * nsterm.m (not_in_argv): New function.
732 (application:openFile, application:openTempFile:):
733 (application:openFileWithoutUI:, application:openFiles:): Open file
734 if not_in_argv returns non-zero (bug#12171).
736 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
737 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
738 Define for Gtk+ versions less than 3.2.
739 (xg_get_font_name): Use those functions/macros here.
740 Reported by Frans Oilinki <moilinki@gmail.com>.
742 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
744 * unexmacosx.c (copy_data_segment): Copy initialized data in
745 statically linked libraries from input file rather than memory.
747 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
748 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
749 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
751 2012-08-10 Glenn Morris <rgm@gnu.org>
753 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
754 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
756 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
758 Fix last change to allow compilation with low optimization levels.
759 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
760 Reported by Jan Djärv <jan.h.d@swipnet.se>.
762 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
764 Use common inline syntax in intervals.h.
765 * intervals.h (INTERVALS_INLINE): New macro.
766 Change all users from LISP_INLINE.
768 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
770 Define Qnone once for all platforms.
771 * frame.c (Qnone): Define here.
772 (syms_of_frame): DEFSYM it.
773 * lisp.h (Qnone): New declaration.
774 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
775 * xfns.c: Remove duplication. Adjust users.
777 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
779 Remove unused macros from intervals.h.
780 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
781 * intervals.c: Adjust comment.
783 2012-08-10 Eli Zaretskii <eliz@gnu.org>
785 * w32fns.c <w32_unicode_gui>: New static variable.
786 (globals_of_w32fns): Initialize it according to os_subtype.
787 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
790 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
791 Eli Zaretskii <eliz@gnu.org>
793 Fix bug #10299 with Unicode characters sent by customized
794 keyboards created by MSKLC.
795 * w32fns.c (INIT_WINDOW_CLASS): New macro.
796 (w32_init_class): Use it to initialize the Emacs class with either
797 ANSI or Unicode API calls.
798 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
800 (w32_wnd_proc): If the character code sent by WM_CHAR or
801 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
802 original message. Call DefWindowProcW on NT and later.
804 2012-08-10 Glenn Morris <rgm@gnu.org>
806 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
808 * lisp.h (DIRECTORY_SEP): Let configure set it.
810 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
812 Use TSET for write access to Lisp_Object slots of struct terminal.
813 * termhooks.h (TSET): New macro.
814 * coding.c, terminal.c, xselect.c: Adjust users.
816 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
818 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
819 the failing expression, include them in the error message.
820 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
821 * lisp.h (internal_condition_case_n): Update declaration.
823 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
825 Inline functions to examine and change buffer overlays.
826 * buffer.c (unchain_both): New function.
827 * buffer.h (buffer_get_overlays, buffer_set_overlays):
828 (buffer_has_overlays): New function.
829 (enum overlay_type): New enum.
830 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
831 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
833 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
835 Inline functions to examine and change buffer intervals.
836 * alloc.c (mark_interval_tree): Remove.
837 (MARK_INTERVAL_TREE): Simplify.
838 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
839 * intervals.c (buffer_balance_intervals): New function.
840 (graft_intervals_into_buffer): Adjust indentation.
841 (set_intervals_multibyte): Simplify.
842 * buffer.h (BUF_INTERVALS): Remove.
843 (buffer_get_intervals, buffer_set_intervals): New function.
844 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
845 * intervals.c, textprop.c: Adjust users.
847 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
849 Inline functions to examine and change string intervals.
850 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
851 (string_get_intervals, string_set_intervals): New function.
852 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
853 * lread.c, print.c, textprop.c: Adjust users.
855 2012-08-08 Glenn Morris <rgm@gnu.org>
857 * lisp.mk (lisp): Remove language/persian.elc.
859 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
862 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
863 (NULL_INTERVAL_P): Likewise. Adjust users.
864 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
865 Adjust comment. Move under #if 0.
866 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
867 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
869 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
871 Check total length of intervals with eassert.
872 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
873 * intervals.c: Change all users to eassert.
875 2012-08-07 Eli Zaretskii <eliz@gnu.org>
877 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
878 Rename fields to match removal of FGET and WGET and disuse of
879 INTERNAL_FIELD in Lisp_Cons.
881 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
883 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
884 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
885 name since all xname users are fixed long time ago. Do not
887 (set_symbol_name, set_symbol_function, set_symbol_plist):
888 (set_symbol_next, set_overlay_plist): New function.
889 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
890 (struct Lisp_Overlay): Likewise.
891 (CVAR, MVAR, SVAR): Remove.
892 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
893 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
894 * xterm.c: Adjust users.
895 * .gdbinit: Change to use name field of struct Lisp_Symbol
898 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
900 Basic functions to set Lisp_Object and pointer slots of intervals.
901 * intervals.h (interval_set_parent, interval_set_object):
902 (interval_set_left, interval_set_right, interval_set_plist):
903 (interval_copy_parent): New function.
904 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
905 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
907 (INTERVAL_SIZE): Remove. Adjust users.
908 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
910 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
912 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
913 * process.h (PGET): Remove.
914 (struct Lisp_Process): Do not use INTERNAL_FIELD.
915 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
917 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
919 Drop WGET and revert read access to Lisp_Objects slots of struct window.
920 * window.h (WGET): Remove.
921 (struct window): Do not use INTERNAL_FIELD.
922 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
923 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
924 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
925 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
926 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
929 2012-08-07 Chong Yidong <cyd@gnu.org>
931 * window.c (Fwindow_edges, Fwindow_pixel_edges)
932 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
933 (Fdelete_window_internal): Signal an error if the window is not on
934 a live frame (Bug#12025).
936 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
938 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
939 * frame.h (FGET): Remove.
940 (struct frame): Do not use INTERNAL_FIELD.
941 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
942 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
943 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
944 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
946 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
948 * w32.c: Silence compiler warnings.
949 (map_w32_filename): Remove unused variable `is_fat'.
950 (chase_symlinks): Add parentheses around expression.
952 2012-08-06 Glenn Morris <rgm@gnu.org>
954 * sysdep.c: Respect BROKEN_GETWD.
956 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
957 Let configure handle it.
958 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
960 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
962 Use GCALIGNMENT where appropriate.
963 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
964 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
965 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
967 2012-08-06 Eli Zaretskii <eliz@gnu.org>
969 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
970 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
972 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
974 * buffer.h (struct buffer): Revert `indirections' to a simple int;
975 that should be sufficient for everyone.
977 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
979 * keyboard.c (timer_check_2): Add break so timer_check returns next
982 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
984 Fix Windows build errors introduced after converting to WGET and WSET.
985 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
986 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
988 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
990 * nsterm.m (ns_frame_rehighlight): Use FSET.
992 * nsmenu.m (ns_update_menubar): Use FSET.
994 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
996 Separate read and write access to Lisp_Object slots of Lisp_Process.
997 * process.h (PGET, PSET): New macros similar to AREF and ASET.
998 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1000 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1002 Separate read and write access to Lisp_Object slots of struct window.
1003 * window.h (WGET, WSET): New macros similar to AREF and ASET.
1004 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1005 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1006 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1007 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1008 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1011 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1013 Fix Windows build errors introduced after converting to FGET and FSET.
1014 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
1015 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
1016 (w32_judge_scroll_bars): Change to use FSET.
1017 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1019 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1021 Fix replacement typo.
1022 * window.c (replace_window): Set root_window instead of
1023 selected_window. This fixes a total window subsystem
1024 malfunction reported by Bastien Guerry <bzg@gnu.org>.
1026 2012-08-06 Glenn Morris <rgm@gnu.org>
1028 * lisp.mk (lisp): Add language/persian.elc.
1030 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1032 Separate read and write access to Lisp_Object slots of struct frame.
1033 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
1034 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1035 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1036 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1037 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1039 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
1041 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
1043 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
1045 Generalize common compile-time constants.
1046 * lisp.h (header_size, bool_header_size, word_size): Now here.
1047 (struct Lisp_Vector): Add comment.
1048 (struct Lisp_Bool_Vector): Move up to define handy constants.
1049 (VECSIZE, PSEUDOVECSIZE): Simplify.
1050 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
1051 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
1052 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
1053 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
1054 * xfont.c, xmenu.c: Use word_size where appropriate.
1056 2012-08-05 Lawrence Mitchell <wence@gmx.li>
1058 * search.c (Freplace_match): Treat \? in the replacement text
1059 literally (Bug#8161).
1061 2012-08-05 Chong Yidong <cyd@gnu.org>
1063 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
1064 * frame.c (Vdelete_frame_functions):
1065 * emacs.c (Vkill_emacs_hook): Doc fix.
1067 2012-08-04 Eli Zaretskii <eliz@gnu.org>
1069 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
1070 --with-x-toolkit=no builds.
1071 Reported by Carsten Mattner <carstenmattner@gmail.com>.
1073 2012-08-04 Chong Yidong <cyd@gnu.org>
1075 * syntax.c (Fmodify_syntax_entry): Doc fix.
1077 2012-08-04 Eli Zaretskii <eliz@gnu.org>
1079 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
1080 * w32.c (init_environment): Change the default values of many
1081 environment variables in dflt_envvars[] to NULL, to avoid pushing
1082 them into environment when they were not already defined.
1083 Remove the code that deletes site-lisp subdirectories from the default
1084 value of EMACSLOADPATH, as it is no longer needed.
1085 (check_windows_init_file): Now external, not static.
1086 Use Vload_path as is, without adding anything, as this function is now
1087 called when Vload_path is already set up.
1089 * w32.h (check_windows_init_file): Add prototype.
1091 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
1092 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
1093 compatibility with Posix platforms.
1094 (main): Move the call to check_windows_init_file to here from
1096 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
1097 any, in the DEFALT argument into the root of the Emacs build or
1098 installation tree, as appropriate.
1100 * callproc.c (init_callproc_1): Call decode_env_path instead of
1101 doing its equivalent by hand.
1102 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
1103 the code that sets Vexec_path run on MS-Windows.
1105 * lread.c (init_lread): Add comments to #ifdef's.
1107 * msdos.c (dos_set_window_size, IT_update_begin)
1108 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
1109 instead of direct references.
1111 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
1113 Export DEFAULT_REHASH_* to GDB.
1114 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
1115 Now constants, not macros.
1117 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
1119 Remove unnecessary casts involving pointers.
1120 These casts are no longer needed now that we assume C89 or later,
1121 since they involve casting to or from void *.
1122 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
1123 (make_pure_float, make_pure_vector):
1124 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
1125 * macros.c (Fstart_kbd_macro):
1126 * menu.c (find_and_return_menu_selection):
1127 * minibuf.c (read_minibuf_noninteractive):
1128 * sysdep.c (closedir):
1129 * xdisp.c (x_produce_glyphs):
1130 * xfaces.c (compare_fonts_by_sort_order):
1131 * xfns.c (x_real_positions, select_visual):
1132 * xselect.c (x_stop_queuing_selection_requests)
1133 (x_get_window_property, x_get_window_property_as_lisp_data):
1134 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
1135 Remove unnecessary pointer casts.
1136 * alloc.c (record_xmalloc): New function.
1137 * lisp.h (record_xmalloc): New decl.
1138 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
1139 more like a function. This is because the pointer cast is not
1140 needed. All uses changed.
1141 * print.c (print_string, print_error_message): Avoid length recalc.
1143 Improve fix for macroexp crash with debugging (Bug#12118).
1144 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
1145 ARRAY_MARK_FLAG when checking subscripts, because ASET is
1146 not supposed to be invoked from the garbage collector.
1147 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
1148 (gc_aset): New function, which is like ASET but can be
1149 used in the garbage collector.
1150 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1151 (set_hash_index): Use it instead of ASET.
1153 2012-08-03 Eli Zaretskii <eliz@gnu.org>
1155 Support symlinks on latest versions of MS-Windows.
1156 * w32.c: Include winioctl.h and aclapi.h.
1157 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
1158 (revert_to_self): Forward declarations of static functions.
1159 <static BOOL g_b_init_get_security_info>:
1160 <g_b_init_create_symbolic_link>: New static flags.
1161 (globals_of_w32): Initialize them to zero.
1162 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
1163 (map_w32_filename): Improve commentary. Simplify switch.
1164 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
1165 headers (most versions of MinGW w32api don't).
1166 (get_security_info, create_symbolic_link)
1167 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
1169 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
1170 in the argument file name.
1171 (sys_access): Call unc_volume_file_attributes only if
1172 GetFileAttributes fails with network-related error codes.
1173 (sys_rename): Diagnose renaming of a symlink when the user doesn't
1174 have the required privileges.
1175 (get_file_security_desc_by_name): Rename from
1176 get_file_security_desc.
1177 (stat_worker): New function, with most of the guts of 'stat', and
1178 with addition of handling of symlinks and support for 'lstat'.
1179 If possible, get file's attributes and security information by
1180 handle, not by name. Produce S_IFLNK bit for symlinks, when
1181 called from 'lstat'.
1182 (stat, lstat): New functions, call 'stat_worker'.
1183 (symlink, readlink, careadlinkat): Rewritten to create and resolve
1184 symlinks when the underlying filesystem supports them.
1186 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
1188 Fix macroexp crash on Windows with debugging (Bug#12118).
1189 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
1190 checking subscripts; problem introduced with the recent
1191 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
1192 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
1193 since it's used in non-static inline functions now.
1195 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
1196 Don't assume buffer size fits in 'int'. Remove unused local.
1198 Use C99-style 'extern inline' if available.
1199 * buffer.h (BUFFER_INLINE):
1200 * category.h (CATEGORY_INLINE):
1201 * character.h (CHARACTER_INLINE):
1202 * charset.h (CHARSET_INLINE):
1203 * composite.h (COMPOSITE_INLINE):
1204 * dispextern.h (DISPEXTERN_INLINE):
1205 * lisp.h (LISP_INLINE):
1206 * systime.h (SYSTIME_INLINE):
1207 New macro, replacing 'static inline' in this header.
1208 * buffer.h, category.h, character.h, charset.h, composite.h:
1209 * dispextern.h, lisp.h, systime.h:
1210 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1211 * alloc.c (LISP_INLINE):
1212 * buffer.c (BUFFER_INLINE):
1213 * category.c (CATEGORY_INLINE):
1214 * character.c (CHARACTER_INLINE):
1215 * charset.c (CHARSET_INLINE):
1216 * composite.c (COMPOSITE_INLINE):
1217 * dispnew.c (DISPEXTERN_INLINE):
1218 * sysdep.c (SYSTIME_INLINE):
1219 Define to EXTERN_INLINE, so that the corresponding functions
1220 are compiled into code.
1221 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
1222 (INLINE_HEADER_END): New macros.
1223 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
1224 since it's used in non-static inline functions now.
1225 (VALMASK) [!USE_LSB_TAG]: Likewise.
1227 2012-08-02 Glenn Morris <rgm@gnu.org>
1229 * s/: Remove empty directory.
1231 * s/ms-w32.h: Move to ../nt/inc.
1232 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
1233 Update for new ms-w32.h location.
1235 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
1238 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
1240 2012-08-02 Glenn Morris <rgm@gnu.org>
1242 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
1243 hard-coding the path separator.
1245 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
1247 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
1248 This how ASET and AREF are supposed to work, and makes
1249 it easier to think about future improvements. See
1250 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
1251 * charset.h (set_charset_attr): New function.
1252 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
1253 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
1254 (aref_addr): New function. All uses of &AREF(...) changed.
1255 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1256 (set_hash_index): New functions. All lvalue-style uses of
1257 HASH_KEY etc. changed.
1258 * keyboard.c (set_prop): New function. All lvalue-style uses
1261 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
1263 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
1264 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1265 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
1266 * nsfns.m (ns_set_name_as_filename): Likewise.
1267 * nsmenu.m (ns_update_menubar): Likewise.
1268 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
1270 2012-08-01 Eli Zaretskii <eliz@gnu.org>
1272 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
1273 Adapt to latest changes in field names of the corresponding Lisp
1276 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
1278 2012-08-01 Glenn Morris <rgm@gnu.org>
1280 * s/msdos.h: Remove file.
1281 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
1282 * Makefile.in (S_FILE): Remove.
1283 (config_h): Remove S_FILE.
1285 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
1287 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
1288 Remove; moved to nt/config.nt.
1290 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1292 Use INTERNAL_FIELD for conses and overlays.
1293 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
1294 Remove obsolete comment.
1296 (struct Lisp_Overlay): Use INTERNAL_FIELD.
1297 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
1299 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1301 Use INTERNAL_FIELD for symbols.
1302 * lisp.h (SVAR): New macro. Adjust users.
1303 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
1304 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
1306 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1308 Use INTERNAL_FIELD for processes.
1309 * process.h (PVAR): New macro. Adjust style.
1310 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
1311 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
1313 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1315 Use INTERNAL_FIELD for windows.
1316 * window.h (WVAR): New macro.
1317 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
1318 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1319 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1320 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
1321 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
1322 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
1324 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
1326 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
1328 2012-08-01 Glenn Morris <rgm@gnu.org>
1330 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
1331 Move to configure.ac.
1333 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
1335 * makefile.w32-in (CONFIG_H): Update dependencies.
1336 (CONF_POST_H): New macro.
1338 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
1340 2012-07-31 Glenn Morris <rgm@gnu.org>
1342 * Makefile.in (S_FILE): No longer set by configure.
1344 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
1346 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
1348 * process.h (NULL_DEVICE):
1349 * emacs.c (SEPCHAR):
1350 * editfns.c (USER_FULL_NAME): Let configure set them.
1352 * s/README, s/template.h: Remove files.
1354 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
1356 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
1357 Move to configure.ac.
1359 2012-07-31 Eli Zaretskii <eliz@gnu.org>
1361 * .gdbinit (xframe): Adapt to introduction of FVAR and the
1362 resulting renaming of 'struct frame' members.
1364 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
1366 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
1367 after introduction of FVAR.
1369 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
1371 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
1373 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
1374 instead of compositeToPoint.
1375 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
1377 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
1379 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
1381 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
1382 * lisp.h (INTERNAL_FIELD): New macro.
1383 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
1384 (BVAR): Change to use INTERNAL_FIELD.
1385 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
1386 (KVAR): Change to use INTERNAL_FIELD.
1387 * frame.h (FVAR): New macro.
1388 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
1389 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
1390 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
1391 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1392 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
1394 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
1396 Miscellaneous fixes for non-default X toolkits.
1397 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
1398 * xterm.c (x_frame_of_widget): Remove redundant prototype.
1399 Move under #ifdef USE_LUCID.
1400 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
1401 definition and usage to avoid warnings.
1403 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
1405 * nsterm.m (openFiles): Fix previous checkin.
1407 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
1409 * indent.c (compute_motion): Remove unused local.
1411 2012-07-31 Glenn Morris <rgm@gnu.org>
1413 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
1415 * conf_post.h [USG5_4]:
1416 Move remaining contents of s/usg5-4-common.h here.
1417 * s/usg5-4-common.h: Remove file.
1419 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
1420 * s/irix6-5.h: Remove file.
1422 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
1423 * s/darwin.h: Remove file.
1425 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
1426 * s/hpux10-20.h: Remove file, which is now empty.
1428 2012-07-30 Glenn Morris <rgm@gnu.org>
1430 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
1431 * Makefile.in (config_h): Add conf_post.h.
1432 * makefile.w32-in (CONFIG_H): Add conf_post.h.
1434 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
1436 * nsterm.m (ns_do_open_file): New variable.
1437 (ns_term_init): Set ns_do_open_file to YES after run returns.
1438 (openFile, openTempFile, openFileWithoutUI, openFiles):
1439 Open files only if ns_do_open_file.
1441 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1443 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
1444 This no-op macro hasn't been needed for many years.
1445 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
1447 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
1448 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
1449 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
1450 gdb_make_enums_visible.
1451 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
1452 (DIRECTORY_SEP): Now a constant, not a macro.
1454 2012-07-30 Eli Zaretskii <eliz@gnu.org>
1456 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
1457 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
1459 * w32term.c <w32_keyboard_codepage>: Renamed from
1460 keyboard_codepage and now external. All users changed.
1462 * w32term.h: Add declaration of w32_keyboard_codepage.
1464 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
1465 the codepage to translate keys to Unicode. If this argument is
1466 -1, use the value returned by GetConsoleCP. All callers changed.
1468 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1470 Update .PHONY listings in makefiles.
1471 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
1472 bootstrap-clean, distclean, maintainer-clean, versioclean,
1475 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
1476 This is a bit clearer. Fix some commentary typos.
1478 2012-07-30 Glenn Morris <rgm@gnu.org>
1480 * s/netbsd.h: Let configure include signal.h if needed.
1481 Remove file, which is now empty.
1483 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
1484 Let configure set them.
1485 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
1486 No more need to undefine.
1488 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
1490 * keymap.c (Fkey_description): Don't remove 0x80 bit from
1491 non-single-byte char when adding meta modifier. (Bug#12090)
1493 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
1495 Convert safe_call to use variable number of arguments.
1496 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
1497 (safe_call2): Fix comment.
1498 * lisp.h (safe_call): Adjust prototype.
1499 * coding.c (encode_coding_object): Change to use safe_call2.
1500 * xfaces.c (merge_face_heights): Change to use safe_call1.
1502 2012-07-30 Glenn Morris <rgm@gnu.org>
1504 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
1505 does that unconditionally. Remove file, which is now empty.
1507 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
1510 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1512 Export to GDB most of lisp.h's remaining object-like macros.
1513 * lisp.h (min, max): Move earlier, because they're used earlier now.
1514 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
1515 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
1516 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
1517 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
1518 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
1519 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
1520 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
1521 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
1522 Now constants, for GDB. They need not be macros.
1523 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
1524 Now constants, for GDB, as well as macros, for static initializers.
1525 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
1526 Move to after the definition of struct Lisp_Char_Table,
1527 since the former now needs that type defined.
1528 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
1529 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
1530 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
1531 New enums, for gdb_make_enums_visible.
1532 (GLYPH_MODE_LINE_FACE): Remove; unused.
1533 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
1534 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
1535 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
1536 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
1537 enum maxargs, enum MAX_ALLOCA.
1538 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
1539 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
1540 no longer needed, now that they are done in lisp.h.
1542 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
1544 Cleanup string bytes checking.
1545 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
1546 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
1547 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
1548 (check_sblock, compact_small_strings): Simplify.
1550 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1552 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
1553 These macros are confusing and no longer need to be defined, as
1554 the enum values now suffice. All uses replaced with definiens.
1555 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
1557 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
1559 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
1560 ($(BLD)/w32console.$(O)): Update dependencies.
1562 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1564 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
1565 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
1567 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
1569 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
1571 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
1572 setting sitelisp (Bug#12010).
1574 2012-07-29 Eli Zaretskii <eliz@gnu.org>
1576 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
1578 * w32heap.c (cache_system_info):
1579 * w32.c (sys_rename):
1580 * w32proc.c (find_child_console, sys_kill): All users changed.
1582 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1584 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
1586 2012-07-29 Eli Zaretskii <eliz@gnu.org>
1588 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
1590 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1592 Cleanup statistics calculation in Fgarbage_collect.
1593 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
1594 Fix zombies percentage calculation. Simplify elapsed time calculation.
1596 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1598 Generalize marker debugging code under MARKER_DEBUG and use eassert.
1599 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
1600 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
1601 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
1602 (replace_range, replace_range_2, del_range_2): Change to eassert.
1603 * marker.c (byte_char_debug_check): Adjust style.
1605 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1607 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
1608 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
1609 long-ago-commented-out code that talks about "WIN32".
1610 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
1613 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
1615 Use Gnulib stdalign module (Bug#9772, Bug#9960).
1616 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
1617 Simplify by using alignof.
1618 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
1619 * lisp.h: Include <stdalign.h>.
1620 (GCALIGNMENT): New macro and constant.
1621 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
1622 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
1623 (stdalign): New macro, if not already defined.
1625 2012-07-28 Eli Zaretskii <eliz@gnu.org>
1627 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
1628 * w32inevt.c: Include w32inevt.h.
1629 (w32_read_console_input): New inline function, calls either
1630 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
1631 w32_console_unicode_input.
1632 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
1633 (w32_kbd_patch_key, key_event): Use the codepage returned by
1634 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
1635 (key_event): use uChar.UnicodeChar only if
1636 w32_console_unicode_input is non-zero.
1638 * w32console.c: Include w32heap.h.
1639 <w32_console_unicode_input>: New global variable.
1640 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
1641 family of Windows, zero otherwise.
1643 * w32inevt.h: Declare w32_console_unicode_input.
1645 * xdisp.c (init_iterator): Don't reference tip_frame in a build
1646 --without-x. (Bug#11742)
1648 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
1650 Adjust GDB to reflect pvec_type changes (Bug#12036).
1651 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
1652 2012-07-04 changes to pseudovector representation.
1653 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
1655 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
1657 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
1659 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
1661 2012-07-27 Eli Zaretskii <eliz@gnu.org>
1663 * alloc.c (listn): Fix the order the arguments are consed onto the
1666 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
1667 enumeration constants, as PURE and HEAP are too general, and clash
1668 with other headers and sources, such as gmalloc.c and the
1669 MS-Windows system headers. All users changed.
1671 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1673 Revert last save_excursion_save and save_excursion_restore changes.
1674 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
1675 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
1677 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1679 Fix recently-introduced typos in Windows port.
1680 Reported by Martin Rudalics <rudalics@gmx.at>.
1681 * w32.c (init_environment): Replace comma with semicolon.
1682 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
1684 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
1686 Improve GDB symbol export (Bug#12036).
1687 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
1688 arms of an 'if', not using conditional expressions; otherwise GDB
1689 complains about the types in the unevaluated arm when the argument
1690 is an integer literal.
1691 (xgetint): Simplify expression.
1692 * alloc.c (gdb_make_enums_visible): New constant. This ports to
1693 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
1694 Zaretskii in <http://bugs.gnu.org/12036#13>.
1695 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
1696 needed now that we have gdb_make_enums_visible.
1697 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
1698 (enum enum_USE_LSB_TAG):
1699 New enum types, packaging up enums that need to be exported to GDB.
1701 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1703 Utility function to make a list from specified amount of objects.
1704 * lisp.h (enum constype): New datatype.
1705 (listn): New prototype.
1706 * alloc.c (listn): New function.
1707 (Fmemory_use_count, syms_of_alloc): Use it.
1708 * buffer.c (syms_of_buffer): Likewise.
1709 * callint.c (syms_of_callint): Likewise.
1710 * charset.c (define_charset_internal): Likewise.
1711 * coding.c (syms_of_coding): Likewise.
1712 * keymap.c (syms_of_keymap): Likewise.
1713 * search.c (syms_of_search): Likewise.
1714 * syntax.c (syms_of_syntax): Likewise.
1715 * w32.c (init_environment): Likewise.
1716 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
1717 * xdisp.c (syms_of_xdisp): Likewise.
1718 * xfns.c (syms_of_xfns): Likewise.
1720 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1722 Fast save_excursion_save and save_excursion_restore.
1723 * lisp.h (struct Lisp_Excursion): New data type.
1724 (PVEC_EXCURSION): New pseudovector type.
1725 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
1726 to deal with it. Adjust comments.
1727 (init_marker, attach_marker): New prototype.
1728 (unchain_marker): Adjust prototype.
1729 * marker.c (attach_marker): Change to global.
1730 (init_marker): New function.
1731 * alloc.c (Fmake_marker, build_marker): Use it.
1732 (build_marker): More easserts.
1733 (mark_object): Handle struct Lisp_Excursion.
1734 * editfns.c (save_excursion_save, save_excursion_restore):
1735 Reimplement to use struct Lisp_Excursion. Add comments.
1737 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
1739 Fix export of symbols to GDB (Bug#12036).
1740 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
1741 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
1742 emacs.c, as this is a more-suitable home. Had this been done earlier
1743 the fix for 12036 would have avoided some of the problems noted in
1744 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
1745 would have been more obvious.
1746 * emacs.c: Do not include <verify.h>; no longer needed.
1747 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
1748 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
1749 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
1750 Remove; now done in lisp.h.
1751 * lisp.h (PUBLISH_TO_GDB): New macro.
1752 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
1753 (DATA_SEG_BITS): Use it.
1754 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
1755 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
1756 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
1757 not be usable in #if. This simplifies things.
1759 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
1761 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
1763 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
1765 Simplify export of symbols to GDB (Bug#12036).
1766 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
1767 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
1768 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
1769 Adjust to changes in lisp.h and emacs.c, by using
1770 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
1771 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
1772 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
1773 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
1774 instead of gdb_valbits.
1775 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
1776 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
1777 instead of gdb_array_mark_flag.
1778 (xboolvector): Get size from $->size, not $->header.size.
1779 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
1780 (xreload, hook-run, hookpost-run): Remove.
1781 * emacs.c: Include <verify.h>.
1782 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
1783 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
1785 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
1786 (gdb_USE_LSB_TAG): New enum constants.
1787 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
1788 Also define these as enum constants, so they're visible to GDB.
1789 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
1790 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
1791 as constants, so they're visible to GDB.
1792 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
1793 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
1794 Now enum constants, not macros, so they're visible to GDB.
1795 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
1796 more convenient now. All uses changed.
1797 (VALMASK) [USE_LSB_TAG]: Also define in this case.
1798 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
1800 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
1802 Explicitly free restriction data that are not needed anymore.
1803 * editfns.c (save_restriction_restore): Free restriction data.
1805 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
1807 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
1808 add argument, tune behavior, and adjust all callers.
1810 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
1812 Use typedef for EMACS_INT, EMACS_UINT.
1813 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
1814 than macros. This simplifies debugging in the usual case, since
1815 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
1816 and it allows expressions involving EMACS_INT casts.
1817 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
1819 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
1821 * nsterm.m (ns_read_socket): Return early if there is a modal
1824 2012-07-25 Martin Rudalics <rudalics@gmx.at>
1826 * frame.c (Fredirect_frame_focus): In doc-string don't mention
1827 that FOCUS-FRAME can be omitted.
1829 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
1831 Adjust buffer text indirection counters at the end of Fkill_buffer.
1832 * buffer.c (Fkill_buffer): Adjust indirection counters when the
1833 buffer is definitely dead. This should really fix an issue reported
1834 by Christoph Scholtes again. (Bug#12007).
1835 (init_buffer_once): Initialize indirection counters of
1836 buffer_defaults and buffer_local_symbols (for sanity and safety).
1838 2012-07-24 Eli Zaretskii <eliz@gnu.org>
1840 * xdisp.c (init_iterator): Don't compute dimensions of truncation
1841 and continuation glyphs on tooltip frames, leave them at zero.
1842 Avoids continued lines in tooltips. (Bug#11832)
1844 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
1846 Simplify copy_overlay.
1847 * buffer.c (copy_overlay): Simplify. Use build_marker.
1848 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
1850 2012-07-23 Eli Zaretskii <eliz@gnu.org>
1852 * print.c (print_object): Don't crash when a frame's name is nil
1853 or invalid. (Bug#12025)
1855 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
1856 it signals an error when a tooltip frame is being created.
1858 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
1860 Cleanup miscellaneous objects allocation and initialization.
1861 * alloc.c (allocate_misc): Change to static. Add argument to
1862 specify the subtype. Adjust comment and users.
1863 (build_overlay): New function.
1864 * buffer.c (copy_overlays, Fmake_overlay): Use it.
1865 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
1866 (allocate_misc): Remove prototype.
1867 (build_overlay): Add prototype.
1869 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
1871 Swap buffer text indirection counters in Fbuffer_swap_text.
1872 * buffer.c (Fbuffer_swap_text): Swap indirections too.
1873 This avoids crash reported by Christoph Scholtes at
1874 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
1876 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
1878 * nsmenu.m (Popdown_data): New struct.
1879 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
1881 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
1882 (initWithContentRect): Make imgView and contentView non-static
1883 and autorelease them. Also autorelease img and matrix (Bug#12005).
1884 (dealloc): Remove (Bug#12005).
1886 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
1888 Adjust consing_since_gc when objects are explicitly freed.
1889 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
1890 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
1891 (free_cons, free_misc): Subtract object size from consing_since_gc.
1893 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
1895 Simplify and cleanup markers positioning code.
1896 * marker.c (attach_marker): More useful eassert.
1897 (live_buffer, set_marker_internal): New function.
1898 (Fset_marker, set_marker_restricted): Use set_marker_internal.
1899 (set_marker_both, set_marker_restricted_both): Use live_buffer.
1901 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
1903 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
1904 as it's limited by the amount of memory, not by INT_MAX.
1906 2012-07-21 Eli Zaretskii <eliz@gnu.org>
1908 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
1909 in special-event-map. See the discussion at
1910 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
1913 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
1914 info.dwItemData. Fixes crashes on 64-bit Windows.
1915 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
1917 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
1919 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
1920 (conversationIdentifier): Return value is NSInteger.
1921 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
1923 2012-07-21 Chong Yidong <cyd@gnu.org>
1925 * window.c (decode_any_window): Signal an error if the window is
1926 on a dead frame (Bug#11984).
1928 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
1930 Add indirection counting to speed up Fkill_buffer.
1931 * buffer.h (struct buffer): New member.
1932 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
1933 (Fmake_indirect_buffer): Set indirection counter to -1, increment
1934 base buffer indirection counter.
1935 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
1936 (Fkill_buffer): Adjust indirection counters as needed, don't walk
1937 through buffer list if indirection counter is 0.
1939 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
1941 Extend the value returned by Fgarbage_collect with heap statistics.
1942 * alloc.c (Qheap): New symbol.
1943 (syms_of_alloc): DEFSYM it.
1944 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
1945 (Fmemory_free): Remove.
1946 (syms_of_alloc): Don't defsubr it.
1947 * buffer.c (Fcompact_buffer): Remove.
1948 (syms_of_buffer): Don't defsubr it.
1950 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
1952 Make maybe_gc inline.
1953 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
1954 * lisp.h (consing_since_gc, gc_relative_threshold)
1955 (memory_full_cons_threshold): Revert declaration.
1956 (maybe_gc): Remove prototype, define as inline.
1957 * alloc.c: Remove old commented-out code.
1958 (consing_since_gc, gc_relative_threshold)
1959 (memory_full_cons_threshold): Revert to global.
1962 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
1964 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
1965 * lisp.h (build_unibyte_string): New function.
1966 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
1967 * sysdep.c, w32fns.c, xfns.c: Use it.
1968 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
1969 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
1970 Adjust users accordingly.
1971 * font.h (font_open_by_name): Adjust prototype.
1973 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
1975 Cleanup calls to Fgarbage_collect.
1976 * lisp.h (maybe_gc): New prototype.
1977 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
1978 Remove declarations.
1979 * alloc.c (maybe_gc): New function.
1980 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
1982 * bytecode.c (MAYBE_GC): Use maybe_gc.
1983 * eval.c (eval_sub, Ffuncall): Likewise.
1984 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
1985 to avoid dependency from auto-save feature.
1987 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
1989 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
1990 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
1991 'for_each_per_buffer_object_at'.
1992 All uses changed. It's better to use upper-case for macros that
1993 cannot be implemented as functions, to give the reader a clue
1994 that they're special.
1996 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
1998 * alloc.c (Fgarbage_collect): Tweak docstring.
2000 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2002 Tweak the value returned from Fgarbage_collect again.
2003 * alloc.c (Fgarbage_collect): New return value, as confirmed in
2004 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
2005 Adjust documentation.
2006 (total_vector_bytes): Rename to total_vector_slots, adjust
2008 (total_free_vector_bytes): Rename to total_free_vector_slots,
2010 (Qstring_bytes, Qvector_slots): New symbols.
2011 (syms_of_alloc): DEFSYM them.
2013 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2015 Buffer compaction primitive which may be used from Lisp.
2016 * buffer.c (compact_buffer, Fcompact_buffer): New function.
2017 (syms_of_buffer): Register Fcompact_buffer.
2018 * alloc.c (Fgarbage_collect): Use compact_buffer.
2019 * buffer.h (compact_buffer): New prototype.
2020 (struct buffer_text): New member.
2022 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2024 New macro to iterate over all buffers, miscellaneous cleanups.
2025 * lisp.h (all_buffers): Remove declaration.
2026 * buffer.h (all_buffers): Add declaration, with comment.
2027 (for_each_buffer): New macro.
2028 * alloc.c (Fgarbage_collect, mark_object): Use it.
2029 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
2030 (init_buffer): Likewise.
2031 * data.c (Fset_default): Likewise.
2032 * coding.c (code_conversion_restore): Remove redundant check
2034 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
2036 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2038 Fix bug that created negative-length intervals.
2039 * intervals.c (merge_interval_right, merge_interval_left):
2040 Do not zero out this interval if it is absorbed by its children,
2041 as this interval's total length doesn't change in that case. See
2042 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
2044 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
2046 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
2047 when invoking (make-bool-vector N t) and N is a positive
2048 multiple of 8 -- the last 8 bits were mistakenly cleared.
2050 Remove some struct layout assumptions in bool vectors.
2051 * alloc.c (bool_header_size): New constant.
2052 (header_size, word_size): Move earlier, as they're now used earlier.
2053 Use 'word_size' in a few more places, where it's appropriate.
2054 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
2055 padding before the data member of a bool vector.
2056 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
2057 than doing the check by hand with an abort ().
2059 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
2061 * eval.c (Fdefvar): Don't check constants since we only set the var if
2062 it's not yet defined anyway (bug#11904).
2064 * lisp.h (last_undo_boundary): Declare new var.
2065 * keyboard.c (command_loop_1): Set it.
2066 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
2067 were auto-added by the command loop (bug#11774).
2069 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2071 * w32font.c (Qsymbol): Remove local definition.
2072 (syms_of_w32font): Don't DEFSYM it.
2074 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2076 Fix sweep_vectors to handle large bool vectors correctly.
2077 * alloc.c (sweep_vectors): Account total_vector_bytes for
2078 bool vectors larger than VBLOCK_BYTES_MAX.
2080 2012-07-18 Chong Yidong <cyd@gnu.org>
2082 * frame.c (x_set_frame_parameters): Revert bogus change introduced
2083 in 2012-05-25 commit by Paul Eggert (Bug#11738).
2085 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2087 Return more descriptive data from Fgarbage_collect.
2088 Suggested by Stefan Monnier in
2089 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
2090 * alloc.c (bounded_number): New function.
2091 (total_buffers, total_vectors): New variable.
2092 (total_string_size): Rename to total_string_bytes, adjust users.
2093 (total_vector_size): Rename to total_vector_bytes, adjust users.
2094 (sweep_vectors): Account total_vectors and total_vector_bytes.
2095 (Fgarbage_collect): New return value. Adjust documentation.
2096 (gc_sweep): Account total_buffers.
2097 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
2098 (VECTOR_SIZE): Remove.
2099 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
2100 (Qinterval, Qmisc): New symbols.
2101 (syms_of_data): Initialize them.
2102 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
2103 (Qcons, Qbuffer): New declarations.
2105 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2107 * alloc.c (Fmemory_free): Account for memory-free's own storage.
2108 Round up, not down. Improve doc.
2110 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2112 Restore old code in allocate_string_data to avoid Faset breakage.
2113 Reported by Julien Danjou <julien@danjou.info> in
2114 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
2115 * alloc.c (allocate_string_data): Restore old code with minor
2116 adjustments, fix comment to explain this subtle issue.
2118 2012-07-17 Eli Zaretskii <eliz@gnu.org>
2120 Remove FILE_SYSTEM_CASE.
2121 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
2123 * fileio.c (FILE_SYSTEM_CASE): Don't define.
2124 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
2125 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
2126 call-process-region passes it through expand-file-name.
2128 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
2130 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2132 Fix crash when creating indirect buffer (Bug#11917)
2133 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
2134 Don't handle unbound variables specially if non-zero.
2135 (Fbuffer_local_variables): Pass zero.
2136 (clone_per_buffer_values): Pass non-zero.
2138 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2140 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
2141 to make the loop interruptible.
2143 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2145 * gnutls.c (emacs_gnutls_handshake): Only retry if
2146 GNUTLS_E_INTERRUPTED.
2148 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2150 Cleanup and convert miscellaneous checks to eassert.
2151 * alloc.c (mark_interval): Fix comment, partially rephrase
2152 old comment from intervals.h (see below).
2153 * intervals.c (find_interval, adjust_intervals_for_insertion)
2154 (delete_interval, adjust_intervals_for_deletion)
2155 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
2157 (adjust_intervals_for_insertion, make_new_interval):
2158 Remove obsolete and unused code.
2159 * intervals.h (struct interval): Remove obsolete comment.
2160 * textprotp.c (erase_properties): Remove unused code.
2161 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
2162 (Fremove_list_of_text_properties): Convert to eassert.
2164 2012-07-17 Chong Yidong <cyd@gnu.org>
2166 * editfns.c (Finsert_char): Doc fix.
2168 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2170 Fix previous change to make Fmemory_free always accurate.
2171 * alloc.c (make_interval): Update total_free_intervals.
2172 (make_float): Likewise for total_free_floats.
2173 (free_cons, Fcons): Likewise for total_free_conses.
2174 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
2175 Likewise for total_free_vector_bytes.
2176 (Fmake_symbol): Likewise for total_free_symbols.
2177 (bytes_free): Remove.
2179 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2181 Simple free memory accounting feature.
2182 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
2183 (sweep_vectors): Accumulate size of free vectors.
2184 (Fgarbage_collect): Setup bytes_free.
2185 (Fmemory_free): New function.
2186 (syms_of_alloc): Register it.
2188 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2190 Cleanup overlays checking.
2191 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
2192 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
2193 eassert and OVERLAYP.
2194 (sort_overlays): Change to use OVERLAYP.
2196 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
2198 * editfns.c (Finsert_char): Make it interactive, and make the
2199 second arg optional. Copy interactive spec and docstring from
2202 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2204 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
2205 Unlike the other wrapped functions, fabs has an unspecified
2208 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
2210 * nsterm.m (keyDown): Interpret flags without left/right bits
2211 as the left key (Bug#11670).
2213 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
2215 Remove empty and useless init functions.
2216 * lisp.h (init_character_once, init_fns, init_image)
2217 (init_filelock, init_sound): Remove prototype.
2218 * character.c (init_character_once): Remove.
2219 * filelock.c (init_filelock): Likewise.
2220 * fns.c (init_fns): Likewise.
2221 * image.c (init_image): Likewise.
2222 * sound.c (init_sound): Likewise.
2223 * emacs.c (main): Adjust accordingly.
2225 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
2227 * gtkutil.h: Tiny cleanups.
2228 (use_old_gtk_file_dialog): Remove useless declaration.
2229 (xg_uses_old_file_dialog): Add suggested const attribute.
2231 2012-07-15 Eli Zaretskii <eliz@gnu.org>
2233 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
2234 (bidi_paragraph_init): Use it to limit search forward for a strong
2235 directional character in abnormally large paragraphs full of
2236 neutral or weak characters. (Bug#11943)
2238 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
2240 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
2241 the toolbar (Bug#9451).
2242 (xg_make_tool_item): Give the widget event box a transparent
2245 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
2247 Cleanup basic allocation variables and functions.
2248 * alloc.c (ignore_warnings, init_intervals, init_float)
2249 (init_cons, init_symbol, init_marker): Remove.
2250 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
2251 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
2252 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
2253 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
2254 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
2255 (staticidx, init_alloc_once, init_strings, free_ablock):
2256 Remove redundant initialization.
2257 * fns.c (init_weak_hash_tables): Remove.
2258 * lisp.h (init_weak_hash_tables): Remove prototype.
2260 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
2262 Use zero_vector where appropriate.
2263 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
2265 * lisp.h (zero_vector): New declaration.
2266 * font.c (null_vector): Remove.
2267 (syms_of_font): Remove initialization and staticpro.
2268 (font_list_entities, font_find_for_lface): Change to use zero_vector.
2269 * keymap.c (Faccessible_keymaps): Likewise.
2271 2012-07-15 Leo Liu <sdl.web@gmail.com>
2273 * fringe.c: Fix typo in comments.
2275 2012-07-14 Leo Liu <sdl.web@gmail.com>
2277 * fringe.c: Add a new bitmap exclamation-mark.
2279 2012-07-14 Eli Zaretskii <eliz@gnu.org>
2281 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
2283 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
2284 (HAVE_MENUS): Don't define, defined by editing config.in with
2286 (GMALLOC_INHIBIT_VALLOC): Don't define.
2287 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
2289 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
2291 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
2293 2012-07-14 Glenn Morris <rgm@gnu.org>
2295 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
2296 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
2297 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
2299 2012-07-13 Glenn Morris <rgm@gnu.org>
2301 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
2303 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
2304 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
2306 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
2308 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
2309 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
2310 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
2311 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
2313 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
2314 as boolean expression.
2315 (x_set_window_size): Remove unused variable toolbar.
2316 (ns_get_color_default, ns_mod_to_lisp): Remove.
2317 (ns_mouse_position): Remove unused variables xchar and ychar.
2318 (ns_compute_glyph_string_overhangs): Remove unused variable face.
2319 (ns_set_vertical_scroll_bar): Remove unused variable count.
2320 (ns_delete_terminal): Remove unused variable i.
2321 (ns_term_init): Remove unused variables r, g and b.
2322 (mouseDown): Remove unused variable window.
2323 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
2324 (initFrameFromEmacs): Remove unused variable vbextra.
2325 (mouseEntered): Remove unused variables p and dpyinfo.
2326 (mouseExited): Remove unused variables p and r.
2327 (ns_define_frame_cursor, ns_clear_frame_area)
2328 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
2329 (menuDown): Assign [sender tag] to variable and cast the variable.
2331 * nsterm.h (menuDown): Add id as type to argument sender.
2332 (ns_display_info_for_name): Add Lisp_Object argument.
2333 (ns_term_init): Add Lisp_Object argument.
2334 (ns_map_event_to_object): Add void argument.
2335 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
2336 prototype with arguments and only declare if __OBJC__.
2337 (nxatoms_of_nsselect): Add void argument.
2338 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
2339 (ns_alloc_autorelease_pool): Add void argument.
2340 (ns_release_autorelease_pool): Add void* argument.
2341 (ns_get_defaults_value): Add const char* argument.
2343 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
2344 (initFromContents): Use SSDATA where appropriate.
2345 (ns_update_menubar): Add braces to ambigous if-else.
2346 (initWithTitle): Put () around assignment in if statement.
2347 (ns_menu_show): Remove unused variables window and keymap.
2348 (update_frame_tool_bar): Remove unused variable selected_p.
2349 (initWithContentRect): Remove unused variable this_cmd_name.
2351 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
2353 (setXBMColor): Remove unused variable len.
2354 (setPixmapData): Put () around assignment in loop statement.
2356 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
2357 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
2359 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
2360 around assignment in loop statement.
2361 (nsfont_open): Remove unused variable i.
2362 (nsfont_open): Remove unused variable len.
2363 (nsfont_draw): Remove unused variable cs.
2365 * nsfns.m (x_set_icon_name, ns_set_name_internal)
2366 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
2367 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
2368 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
2369 (Fns_font_name, Fns_perform_service)
2370 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
2371 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
2372 (ns_set_name): Remove unused variable view.
2373 (x_set_menu_bar_lines): Remove unused variable olines.
2374 (x_set_tool_bar_lines): Remove unused variable root_window.
2375 (Fns_list_colors): Put () around assignment in while statement.
2376 (Fns_perform_service): Remove unused variable len.
2377 (Fns_display_usable_bounds): Remove unused variable top.
2378 (syms_of_nsfns): Remove unused variable i.
2380 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
2383 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2385 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
2386 and free it with DestroyExceptionInfo (Bug#11558).
2388 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
2390 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
2391 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
2392 Set here, not in nt/config.nt.
2394 2012-07-13 Eli Zaretskii <eliz@gnu.org>
2396 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
2397 cursor overflow into the last glyph on display line when the right
2398 fringe is off. (Bug#11832)
2400 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
2402 * xdisp.c (produce_special_glyphs): Now static.
2403 * dispextern.h (produce_special_glyphs): Remove decl.
2405 2012-07-13 Glenn Morris <rgm@gnu.org>
2407 * s/bsd-common.h, s/cygwin.h: Remove empty files.
2408 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
2410 * s/usg5-4-common.h (USG, USG5):
2411 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
2412 * s/sol2-6.h (SOLARIS2):
2413 * s/irix6-5.h (IRIX6_5):
2414 * s/hpux10-20.h (USG, USG5, HPUX):
2415 * s/gnu-linux.h (USG, GNU_LINUX):
2416 * s/freebsd.h (BSD_SYSTEM):
2417 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
2418 * s/cygwin.h (CYGWIN):
2419 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
2420 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
2422 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
2424 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
2426 2012-07-13 Glenn Morris <rgm@gnu.org>
2428 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
2430 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
2432 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
2433 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
2435 2012-07-12 Glenn Morris <rgm@gnu.org>
2437 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
2439 * process.c (init_process_emacs): Rename from init_process.
2440 The old name is also the name of a Mach system call.
2441 * lisp.h, emacs.c: Update for this name change.
2442 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
2445 2012-07-12 Eli Zaretskii <eliz@gnu.org>
2447 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
2448 memmove call that removes glyphs covered by the left truncation
2449 glyph. Improve commentary.
2450 (display_line): Fix display of continuation glyphs on GUI frames
2451 when the right fringe is turned off and variable-size fonts are
2452 used in the window. Move the code that appends a stretch glyph to
2453 produce_special_glyphs, so that it could be used for truncation
2454 and continuation glyphs alike.
2455 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
2456 glyph of a suitably computed width, to align the special glyphs at
2457 the window margin. Code moved from display_line. (Bug#11832)
2459 2012-07-12 Glenn Morris <rgm@gnu.org>
2461 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
2463 * s/gnu-linux.h, s/hpux10-20.h:
2464 Do not unconditionally define HAVE_XRMSETDATABASE.
2466 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
2468 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
2470 Fix typos that broke OS X build.
2471 Reported by Randal L. Schwartz in
2472 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
2473 * nsterm.m (ns_timeout): Add missing local decl.
2474 (ns_get_color): snprintf -> sprintf, to fix typo.
2476 2012-07-12 Glenn Morris <rgm@gnu.org>
2478 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
2479 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
2480 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
2481 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
2483 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
2484 Move PTY_OPEN to configure.
2486 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2487 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
2488 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
2490 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
2492 Use empty_unibyte_string where applicable.
2493 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
2494 * lread.c (read1): Likewise.
2495 * xsettings.c (syms_of_xsettings): Likewise.
2497 2012-07-12 Glenn Morris <rgm@gnu.org>
2499 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
2500 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
2501 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
2502 * s/hpux10-20.h (RUN_TIME_REMAP):
2503 * s/bsd-common.h (TABDLY): Move to configure.
2505 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
2507 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
2509 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
2510 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
2512 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
2514 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
2515 * s/template.h: Move NARROWPROTO to configure.
2517 2012-07-11 Glenn Morris <rgm@gnu.org>
2519 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
2520 unused since 2011-01-17 change to systty.h.
2522 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
2523 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
2524 Move HAVE_PTYS and HAVE_SOCKETS to configure.
2526 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
2528 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
2530 2012-07-11 Glenn Morris <rgm@gnu.org>
2532 * s/darwin.h, s/gnu-linux.h, s/template.h:
2533 Move INTERRUPT_INPUT to configure.
2535 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2537 Minor adjustments to interning code.
2538 * lisp.h (intern, intern_c_string): Redefine as static inline
2539 wrappers for intern_1 and intern_c_string_1, respectively.
2540 (intern_1, intern_c_string_1): Rename prototypes.
2541 * lread.c (intern_1, intern_c_string_1, oblookup):
2542 Simplify Vobarray checking.
2543 * font.c (font_intern_prop): Likewise. Adjust comment.
2544 * w32font.c (intern_font_name): Likewise.
2546 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
2548 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
2550 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
2551 of Fcar/Fcdr if possible.
2552 * font.c (check_otf_features): Likewise.
2553 * fontset.c (Fnew_fontset): Likewise.
2554 * gnutls.c (Fgnutls_boot): Likewise.
2555 * minibuf.c (read_minibuf): Likewise.
2556 * msdos.c (IT_set_frame_parameters): Likewise.
2557 * xmenu.c (Fx_popup_dialog): Likewise.
2558 * w32menu.c (Fx_popup_dialog): Likewise.
2560 2012-07-11 Glenn Morris <rgm@gnu.org>
2562 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
2563 since nothing has defined it on these platforms.
2565 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
2566 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
2568 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2569 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
2570 Move CLASH_DETECTION to configure.
2572 * s/gnu.h: Remove file, which is now empty.
2574 * s/gnu.h, s/gnu-linux.h:
2575 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
2577 2012-07-11 John Wiegley <johnw@newartisans.com>
2579 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
2580 function attribute, so we only use it if it exists in the
2583 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2585 Avoid call to strlen in fast_c_string_match_ignore_case.
2586 * search.c (fast_c_string_match_ignore_case): Change to use
2587 length argument. Adjust users accordingly.
2588 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
2590 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
2592 Assume mkdir, rmdir.
2593 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
2594 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
2597 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
2600 * s/hpux10-20.h (HAVE_PERROR): Remove.
2601 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
2602 Remove dummy definition, as this problem was obsolete long ago.
2605 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
2607 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2609 Avoid calls to strlen in font processing functions.
2610 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
2611 (font_open_by_name): Change to use length argument.
2612 Adjust users accordingly.
2613 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
2615 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
2616 Change to return ptrdiff_t.
2617 (xfont_list_pattern, xfont_match): Use length returned by
2618 xfont_decode_coding_xlfd.
2619 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
2621 2012-07-11 Glenn Morris <rgm@gnu.org>
2623 * s/darwin.h, s/freebsd.h, s/netbsd.h:
2624 Move DONT_REOPEN_PTY to configure.
2626 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
2627 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
2629 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
2631 Remove "#define unix" that is no longer needed (Bug#11905).
2632 * s/aix4-2.h (unix): Remove; no longer needed.
2634 EMACS_TIME simplification (Bug#11875).
2635 This replaces macros (which typically do not work in GDB)
2636 with functions, typedefs and enums, making the code easier to debug.
2637 The functional style also makes code easier to read and maintain.
2638 * systime.h: Include <sys/time.h> on all hosts, not just if
2639 WINDOWSNT, since 'struct timeval' is needed in general.
2640 (EMACS_TIME): Now a typedef, not a macro.
2641 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
2643 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
2644 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
2645 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
2646 (EMACS_TIME_LE): Now functions, not macros.
2647 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
2648 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
2649 which are not functions. All uses rewritten to use:
2650 (make_emacs_time): New function.
2651 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
2652 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
2653 not functions. All uses rewritten to use the following, respectively:
2654 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
2655 (add_emacs_time, sub_emacs_time): New functions.
2656 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
2657 * fileio.c (Fcopy_file):
2658 * xterm.c (XTflash): Get the current time closer to when it's used.
2659 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
2661 * bytecode.c (targets): Suppress -Woverride-init warnings.
2663 Simplify by avoiding confusing use of strncpy etc.
2664 * doc.c (Fsnarf_documentation):
2665 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
2666 * frame.c (Fmake_terminal_frame):
2667 * gtkutil.c (get_utf8_string):
2669 * nsmenu.m (ns_update_menubar):
2670 * regex.c (regerror):
2671 Prefer memcpy to strncpy and strncat when either will do.
2672 * fileio.c (Fsubstitute_in_file_name):
2673 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
2674 (menu_separator_name_p):
2675 * nsmenu.m (ns_update_menubar):
2676 Prefer memcmp to strncmp when either will do.
2677 * nsterm.m: Include <ftoastr.h>.
2679 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
2680 Prefer snprintf to strncpy.
2681 * nsterm.m (ns_term_init):
2682 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
2683 * nsterm.m (ns_term_init):
2684 Avoid the need for strncpy, by using build_string or
2685 make_unibyte_string directly. Use dtoastr, not snprintf.
2686 * process.c (Fmake_network_process): Diagnose service names that
2687 are too long, rather than silently truncating them or creating
2688 non-null-terminated names.
2689 (Fnetwork_interface_info): Likewise, for interface names.
2690 * sysdep.c (system_process_attributes) [GNU_LINUX]:
2691 Prefer sprintf to strncat.
2692 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
2693 Prefer vsnprintf to vsprintf + strncpy.
2695 2012-07-10 Glenn Morris <rgm@gnu.org>
2697 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
2698 Clarify fallback case.
2700 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2702 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
2703 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
2704 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
2705 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
2706 where argument type is known to be a Lisp_Cons.
2708 2012-07-10 Tom Tromey <tromey@redhat.com>
2710 * bytecode.c (BYTE_CODE_THREADED): New macro.
2711 (BYTE_CODES): New macro. Replaces all old byte-code defines.
2712 (enum byte_code_op): New type.
2713 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
2714 (exec_byte_code): Use them. Use token threading when applicable.
2716 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2718 Optimize pure C strings initialization.
2719 * lisp.h (make_pure_string): Fix prototype.
2720 (build_pure_c_string): New function, defined as static inline. This
2721 provides a better opportunity to optimize away calls to strlen when
2722 the function is called with compile-time constant argument.
2723 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
2724 argument, adjust users accordingly. Use build_pure_c_string where
2726 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
2727 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
2728 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
2730 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2732 Avoid calls to strlen in miscellaneous functions.
2733 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
2734 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
2735 * lread.c (openp): Likewise.
2737 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2739 Avoid calls to strlen in path processing functions.
2740 * fileio.c (file_name_as_directory): Add comment. Change to add
2741 srclen argument and return the length of result. Adjust users
2743 (directory_file_name): Fix comment. Change to add srclen argument,
2744 swap 1st and 2nd arguments to obey the common convention.
2745 Adjust users accordingly.
2746 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
2748 2012-07-10 Glenn Morris <rgm@gnu.org>
2750 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
2751 Move PENDING_OUTPUT_COUNT definition to configure.
2753 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
2754 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
2755 * s/gnu.h (DATA_START): Move definitions to configure.
2757 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
2758 We include usg5-4-common.h, which defines them both.
2760 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
2761 O_RDONLY already includes it).
2763 Stop ns builds setting the EMACSLOADPATH environment variable.
2764 * nsterm.m (ns_load_path): Rename from ns_init_paths.
2765 Now it does not set EMACSLOADPATH, just returns the load-path string.
2766 * nsterm.h: Update accordingly.
2767 * lread.c [HAVE_NS]: Include nsterm.h.
2768 (init_lread) [HAVE_NS]: Use ns_load_path.
2769 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
2771 2012-07-09 Glenn Morris <rgm@gnu.org>
2773 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
2774 since the included bsd-common.h does so.
2776 Stop ns builds setting the EMACSPATH environment variable.
2777 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
2778 (ns_init_paths): Do not set EMACSPATH.
2779 * nsterm.h (ns_exec_path): Add it.
2780 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
2783 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
2785 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
2787 * process.c (wait_reading_process_output): 'waitchannels' was unset
2788 when read_kbd || !NILP (wait_for_cell); fix this.
2790 Add GCC-style 'const' attribute to functions that can use it.
2791 * character.h (char_resolve_modifier_mask):
2792 * keyboard.h (make_ctrl_char):
2793 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
2794 (init_character_once, next_almost_prime, init_fns, init_image)
2795 (flush_pending_output, init_sound):
2796 * mem-limits.h (start_of_data):
2797 * menu.h (finish_menu_items):
2798 Add ATTRIBUTE_CONST.
2799 * emacs.c (DEFINE_DUMMY_FUNCTION):
2800 Declare the dummy function with ATTRIBUTE_CONST.
2801 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
2802 Add decls with ATTRIBUTE_CONST.
2804 Minor improvements to make_formatted_string.
2805 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
2806 where int is good enough, as vsprintf returns an int.
2807 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
2809 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
2811 Use make_formatted_string to avoid double length calculation.
2812 * lisp.h (make_formatted_string): New prototype.
2813 * alloc.c (make_formatted_string): New function.
2814 * buffer.c (Fgenerate_new_buffer_name): Use it.
2815 * dbus.c (syms_of_dbusbind): Likewise.
2816 * editfns.c (Fcurrent_time_zone): Likewise.
2817 * filelock.c (get_boot_time): Likewise.
2818 * frame.c (make_terminal_frame, set_term_frame_name)
2819 (x_report_frame_params): Likewise.
2820 * image.c (gs_load): Likewise.
2821 * minibuf.c (get_minibuffer): Likewise.
2822 * msdos.c (dos_set_window_size): Likewise.
2823 * process.c (make_process): Likewise.
2824 * xdisp.c (ensure_echo_area_buffers): Likewise.
2825 * xsettings.c (apply_xft_settings): Likewise.
2827 2012-07-09 Glenn Morris <rgm@gnu.org>
2829 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
2830 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
2831 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
2832 * nsterm.h (ns_etc_directory): Add it.
2833 * callproc.c [HAVE_NS]: Include nsterm.h.
2834 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
2836 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
2838 Move marker debugging code under MARKER_DEBUG.
2839 * marker.c (MARKER_DEBUG): Move marker debugging code under
2840 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
2841 for bootstrap with --enable-checking (~3x slowdown reported
2842 by Juanma Barranquero <lekktu@gmail.com>).
2843 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
2845 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
2847 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
2848 See <http://bugs.gnu.org/11825#29>.
2850 2012-07-08 Eli Zaretskii <eliz@gnu.org>
2852 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
2853 has no font, use the frame's font. (Bug#11813)
2854 (display_line): Add commentary about displaying truncation glyphs
2856 (produce_special_glyphs): Move here from term.c.
2858 * term.c (produce_special_glyphs): Move to xdisp.c.
2860 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
2863 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
2865 * xdisp.c (display_line): Avoid warning about implicit declaration
2868 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
2870 * lisp.h: Remove empty conditional.
2872 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
2874 * lread.c (load_path_check): Now static.
2876 Fix some minor --with-ns problems found by static checking.
2877 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
2878 (x_set_font) [!HAVE_X_WINDOWS]:
2879 * image.c (xpm_load_image) [HAVE_NS]:
2880 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
2881 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
2882 Remove unused local.
2883 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
2884 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
2885 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
2886 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
2887 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
2888 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
2889 Fix pointer signedness problem.
2890 * xfaces.c (FRAME_X_FONT_TABLE):
2891 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
2893 2012-07-07 Glenn Morris <rgm@gnu.org>
2895 * lread.c (load_path_check): New function, split from init_lread.
2896 (init_lread): Reorganize. Motivation:
2897 If EMACSLOADPATH is set, check/warn about that rather than the
2898 defaults, which we are not going to use. Hence we can remove
2899 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
2900 Don't warn if site-lisp directories are missing.
2901 If not installed, start from a blank load-path, since
2902 PATH_LOADSEARCH refers to the eventual installation directories.
2904 2012-07-07 Eli Zaretskii <eliz@gnu.org>
2906 Support truncation and continuation glyphs on GUI frames, when
2907 fringes are disabled. (Bug#11832)
2908 * xdisp.c (init_iterator): Get dimensions of truncation and
2909 continuation glyphs even if on GUI frames.
2910 Adjust it->last_visible_x on GUI frames when the left or right fringes,
2911 or both, are absent.
2912 (start_display, move_it_in_display_line_to): Handle the case of a
2913 GUI frame without a fringe to display continuation or truncation
2915 (insert_left_trunc_glyphs): Support GUI frames: make sure
2916 truncation glyphs overwrite enough glyphs from the current line to
2917 have sufficient space in pixels.
2918 (display_line): Support truncation and continuation glyphs on GUI
2919 frames. If some spare pixels are left on the line after inserting
2920 the truncation glyphs, fill that space with a stretch glyph of a
2921 suitably computed width.
2923 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
2924 produce_glyphs, to support GUI sessions.
2926 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
2928 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
2930 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
2932 Do not require float-time's arg to fit in time_t (Bug#11825).
2933 This works better on hosts where time_t is unsigned, and where
2934 float-time is applied to the (negative) difference between two times.
2935 * editfns.c (decode_time_components): Last arg is now double *,
2936 not int *, and means to store all the result as a double, without
2937 worrying about whether the seconds part fits in time_t.
2938 All callers changed.
2939 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
2940 All callers changed.
2941 (Ffloat_time): Do not fail merely because the specified time falls
2942 outside of time_t range.
2944 2012-07-07 Glenn Morris <rgm@gnu.org>
2946 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
2947 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
2948 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
2950 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
2952 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
2953 Update dependencies.
2955 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
2957 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
2959 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
2960 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
2961 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
2962 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
2963 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
2964 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
2966 * xfont.c (compare_font_names): Redo to omit the need for casts.
2968 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
2970 * xfns.c (Fx_change_window_property): Doc fix.
2971 * w32fns.c (Fx_change_window_property): Doc fix.
2973 * w32fns.c (Fx_window_property): Accept the same arguments as the
2974 X Windows version. Doc fix.
2975 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
2977 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
2978 Eli Zaretskii <eliz@gnu.org>
2980 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
2981 Windows-specific code from nt/config.nt moved here.
2982 Obsolete settings removed.
2984 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
2986 * process.c: Avoid unnecessary calls to gettime.
2987 (wait_reading_process_output): Don't get the time of day
2988 when gobbling data immediately and not waiting, as there's no need
2989 for it in that case. This removes a FIXME.
2991 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
2993 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
2994 is defined (Bug#11768).
2996 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2998 Fix marker debugging code.
2999 * marker.c (byte_char_debug_check): Do not perform the check
3000 if buffer is not multibyte.
3001 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3002 Call byte_char_debug_check with correct arguments.
3004 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3006 Compile marker debugging code only if ENABLE_CHECKING is defined.
3007 * marker.c (byte_char_debug_check, count_markers):
3008 Use only if ENABLE_CHECKING is defined.
3009 (byte_debug_flag): Remove.
3010 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3011 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
3013 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3015 Avoid code repetition in marker-related functions.
3016 * marker.c (attach_marker): New function.
3017 (Fset_marker, set_marker_restricted, set_marker_both)
3018 (set_marker_restricted_both): Use it.
3019 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
3020 Consistently rename charno to charpos.
3021 (marker_position): Add eassert.
3022 (marker_byte_position): Convert to eassert.
3024 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3026 Simplify list operations in unchain_overlay and unchain_marker.
3027 * buffer.c (unchain_overlay): Simplify. Add comment.
3028 * marker.c (unchain_marker): Simplify. Fix comments.
3030 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3032 Introduce fast path for the widely used marker operation.
3033 * alloc.c (build_marker): New function.
3034 * lisp.h (build_marker): New prototype.
3035 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
3036 * composite.c (autocmp_chars): Likewise.
3037 * editfns.c (buildmark): Remove.
3038 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
3039 (save_restriction_save): Use build_marker.
3040 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
3041 * window.c (save_window_save): Likewise.
3043 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3045 Do not use Fdelete_overlay in delete_all_overlays
3046 to avoid redundant calls to unchain_overlay.
3047 * buffer.c (drop_overlay): New function.
3048 (delete_all_overlays, Fdelete_overlay): Use it.
3049 * minibuf.c (get_minibuffer): Fix comment.
3051 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3053 Port to OpenBSD 5.1 amd64.
3054 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
3055 This is needed for OpenBSD, and should be harmless on all BSD systems.
3056 Also, include <sys/sysctl.h>, as it should be available on all
3057 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
3058 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
3059 use p_pid member, not kp_proc.pid.
3061 2012-07-06 Glenn Morris <rgm@gnu.org>
3063 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
3065 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3067 More xmalloc and related cleanup.
3068 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
3069 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
3070 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
3071 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
3072 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
3073 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
3074 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
3075 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
3076 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
3078 Omit needless casts involving void * pointers and allocation.
3079 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
3080 as the former is more robust if P's type is changed.
3081 Prefer xzalloc to xmalloc + memset 0.
3082 Simplify malloc-or-realloc to realloc.
3083 Don't worry about xmalloc returning a null pointer.
3084 Prefer xstrdup to xmalloc + strcpy.
3085 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
3087 * keyboard.c (apply_modifiers_uncached): Prefer local array to
3088 alloca of a constant.
3090 2012-07-05 Eli Zaretskii <eliz@gnu.org>
3092 * xdisp.c (display_line): Fix horizontal pixel coordinates when
3093 hscroll is larger than the line width. Fixes long and futile
3094 looping inside extend_face_to_end_of_line (on a TTY) producing
3095 glyphs that are not needed and thrown away.
3097 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3099 * marker.c (set_marker_restricted_both): Simplify by using
3102 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3104 * editfns.c (region_limit): Simplify by using clip_to_bounds.
3106 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
3108 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
3109 not defined (Bug#11768).
3110 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
3111 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
3112 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
3113 followed by gtk_box_set_homogeneous (Bug#11768).
3114 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
3115 (update_theme_scrollbar_width, xg_create_scroll_bar):
3116 Use gtk_scrollbar_new (Bug#11768).
3117 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
3118 (is_box_type): New function (Bug#11768).
3119 (xg_tool_item_stale_p): Call is_box_type.
3120 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
3121 with default display (Bug#11768).
3123 2012-07-05 Eli Zaretskii <eliz@gnu.org>
3125 * xdisp.c (window_hscroll_limited): New function.
3126 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
3127 coordinates when window's hscroll is set to insanely large
3130 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
3132 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
3133 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
3135 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3138 * lisp.h (xzalloc): New prototype. Omit needless casts.
3139 * alloc.c (xzalloc): New function. Omit needless casts.
3140 * charset.c: Omit needless casts. Convert all calls to
3141 xmalloc with following memset to xzalloc.
3142 * dispnew.c: Likewise.
3143 * fringe.c: Likewise.
3144 * image.c: Likewise.
3145 * sound.c: Likewise.
3147 * w32fns.c: Likewise.
3148 * w32font.c: Likewise.
3149 * w32term.c: Likewise.
3150 * xfaces.c: Likewise.
3152 * xterm.c: Likewise.
3153 * atimer.c: Omit needless casts.
3154 * buffer.c: Likewise.
3155 * callproc.c: Likewise.
3157 * coding.c: Likewise.
3158 * composite.c: Likewise.
3160 * doprnt.c: Likewise.
3161 * editfns.c: Likewise.
3162 * emacs.c: Likewise.
3164 * filelock.c: Likewise.
3166 * gtkutil.c: Likewise.
3167 * keyboard.c: Likewise.
3169 * lread.c: Likewise.
3170 * minibuf.c: Likewise.
3171 * msdos.c: Likewise.
3172 * print.c: Likewise.
3173 * process.c: Likewise.
3174 * region-cache.c: Likewise.
3175 * search.c: Likewise.
3176 * sysdep.c: Likewise.
3177 * termcap.c: Likewise.
3178 * terminal.c: Likewise.
3179 * tparam.c: Likewise.
3180 * w16select.c: Likewise.
3182 * w32reg.c: Likewise.
3183 * w32select.c: Likewise.
3184 * w32uniscribe.c: Likewise.
3185 * widget.c: Likewise.
3186 * xdisp.c: Likewise.
3187 * xmenu.c: Likewise.
3189 * xselect.c: Likewise.
3191 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3193 * fileio.c (time_error_value): Check the right error number.
3194 Problem reported by Troels Nielsen in
3195 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
3197 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3199 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
3200 This should be fixed in a better way; see Eli Zaretskii in
3201 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
3202 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
3204 * fileio.c (time_error_value): Rename from special_mtime.
3205 The old name's problems were noted by Eli Zaretskii in
3206 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
3208 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
3209 This variable's comment says Emacs needs at least one GDB-visible
3210 symbol of type enum pvec_type, to work around GDB problems.
3211 The symbol's value doesn't matter.
3213 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
3214 that causes compilation to fail on pre-C99 compilers.
3216 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
3218 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
3219 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
3221 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3223 * buffer.c (init_buffer_once): Fix initialization of
3224 headers for buffer_defaults and buffer_local_symbols.
3225 Reported by Juanma Barranquero <lekktu@gmail.com>.
3227 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
3229 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
3230 * lisp.h (enum pvec_type): Use fewer bits.
3231 (PSEUDOVECTOR_SIZE_BITS): New constant.
3232 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
3233 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
3234 change in pvec_type.
3235 (PSEUDOVECTOR_TYPEP): New macro.
3236 (TYPED_PSEUDOVECTORP): Use it.
3237 * fns.c (internal_equal): Adapt code to extract pvectype.
3238 * emacs.c (gdb_pvec_type): Update type.
3239 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
3240 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
3241 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
3242 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
3243 (sweep_vectors): Use it. Use local var `total_bytes' instead of
3244 abusing vector->header.next.nbytes.
3245 (live_vector_p): Use PVEC_TYPE.
3246 (mark_object): Adapt code to extract pvectype. Use switch.
3248 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3250 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
3251 Tighten new eassert a bit.
3253 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3255 Fix compilation with --enable-gcc-warnings and -O1
3257 * doprnt.c (doprnt): Change type of tem to int, initialize
3258 to avoid compiler warning. Add eassert.
3259 * search.c (simple_search): Initialize match_byte to avoid
3260 compiler warning. Add eassert.
3262 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3264 Avoid weird behavior with large horizontal scrolls.
3265 Without this change, for example, large hscroll values would
3266 mess up Emacs's display on Fedora 15 x86, presumably due to
3267 overflows in int calculations in the display code.
3268 Also, if buffers had long lines, Emacs would freeze.
3269 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
3270 (set_window_hscroll): New function, containing the old guts of
3271 Fset_window_hscroll. Return the clipped value.
3272 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
3273 This avoids the need to check against PTRDIFF_MAX.
3275 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
3277 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3279 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
3281 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3283 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
3284 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
3285 since GCC 4.4.6 issues a bogus warning for them.
3287 Fix bugs in file timestamp newness comparisons.
3288 * fileio.c (Ffile_newer_than_file_p):
3289 * lread.c (Fload): Use full timestamp resolution of files,
3290 not just the 1-second resolution, so that files that are only
3291 slightly newer still count as newer.
3292 * fileio.c (Ffile_newer_than_file_p): Don't assume file
3293 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
3295 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
3297 * fileio.c: Improve handling of file time marker. (Bug#11852)
3298 (special_mtime): New function.
3299 (Finsert_file_contents, Fverify_visited_file_modtime):
3300 Use it to set special mtime values consistently.
3302 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
3304 * fileio.c (Finsert_file_contents): Properly handle st_mtime
3305 marker for non-existing file. (Bug#11852)
3307 2012-07-03 Glenn Morris <rgm@gnu.org>
3309 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
3310 and did not make it into globals.h).
3312 2012-07-03 Tom Tromey <tromey@redhat.com>
3314 * window.c (Fset_window_margins, Fset_window_fringes)
3315 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
3316 * textprop.c (Fprevious_property_change): No longer static.
3317 * syntax.c (Fsyntax_table_p): No longer static.
3318 * process.c (Fget_process, Fprocess_datagram_address): No longer
3320 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
3321 * keyboard.c (Fcommand_execute): No longer static.
3323 * insdel.c (Fcombine_after_change_execute): No longer static.
3324 * image.c (Finit_image_library): No longer static.
3325 * fileio.c (Fmake_symbolic_link): No longer static.
3326 * eval.c (Ffetch_bytecode): No longer static.
3327 * editfns.c (Fuser_full_name): No longer static.
3328 * doc.c (Fdocumentation_property, Fsnarf_documentation):
3330 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
3332 * dired.c (Ffile_attributes): No longer static.
3333 * composite.c (Fcomposition_get_gstring): No longer static.
3334 * callproc.c (Fgetenv_internal): No longer static.
3336 * ccl.h: Remove EXFUNs.
3337 * buffer.h: Remove EXFUNs.
3338 * dispextern.h: Remove EXFUNs.
3339 * intervals.h: Remove EXFUNs.
3340 * fontset.h: Remove EXFUN.
3341 * font.h: Remove EXFUNs.
3342 * dosfns.c (system_process_attributes): Remove EXFUN.
3343 * keymap.h: Remove EXFUNs.
3344 * lisp.h: Remove EXFUNs.
3345 * w32term.h: Remove EXFUNs.
3346 * window.h: Remove EXFUNs.
3347 * xsettings.h: Remove EXFUN.
3348 * xterm.h: Remove EXFUN.
3350 2012-07-03 Glenn Morris <rgm@gnu.org>
3352 * lisp.h (Frandom): Make it visible to C.
3353 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
3354 buffer for invisible buffers. (Bug#1229)
3356 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3358 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
3359 values which aren't power of 2.
3360 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
3361 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
3364 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
3366 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
3368 * alloc.c (mark_object): Revert part of last patch to use `switch'.
3370 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3372 * alloc.c (allocate_vector_block): Remove redundant
3373 calls to mallopt if DOUG_LEA_MALLOC is defined.
3374 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
3375 avoid calls to mallopt if zero_vector is returned.
3377 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3379 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
3380 is enabled, avoid dereferencing NULL current_sblock if
3383 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3385 Cleanup basic buffer management.
3386 * buffer.h (struct buffer): Change layout to use generic vector
3387 marking code. Fix some comments. Change type of 'clip_changed'
3388 to bitfield. Remove unused #ifndef old.
3389 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
3390 (GET_OVERLAYS_AT): Fix indentation.
3391 (for_each_per_buffer_object_at): New macro.
3392 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
3393 (Fbuffer_local_variables): Use it.
3394 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
3395 * alloc.c (allocate_buffer): Adjust to match new layout of
3396 struct buffer. Fix comment.
3397 (mark_overlay): New function.
3398 (mark_buffer): Use it. Use mark_vectorlike to mark normal
3399 Lisp area of struct buffer.
3400 (mark_object): Use it. Adjust marking of misc objects
3401 and related comments.
3403 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
3405 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
3406 wrapper that is not needed because the wrapped code is a no-op (zero
3407 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
3408 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
3410 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
3412 * alloc.c (mark_buffer): Simplify. Remove prototype.
3413 (mark_object): Add comment. Reorganize marking of vector-like
3414 objects. Use CHECK_LIVE for all vector-like objects except buffers
3415 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
3416 Avoid redundant calls to mark_vectorlike for bool vectors.
3418 2012-06-30 Glenn Morris <rgm@gnu.org>
3420 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
3422 * epaths.in (PATH_SITELOADSEARCH): New.
3423 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
3424 This is rather than relying on --enable-locallisppath elements
3425 having "site-lisp" in their names. (Bug#10208#25, 11658)
3427 2012-06-30 Eli Zaretskii <eliz@gnu.org>
3429 * w32proc.c (sys_select): Accept and ignore one more argument.
3431 * w32.c (emacs_gnutls_pull): Call select with one more argument.
3433 * sysselect.h [DOS_NT]: Don't include sys/select.h.
3434 (pselect) [!MS_DOS]: Redirect to sys_select.
3436 * sysdep.c: Don't include dos.h and dosfns.h.
3438 * process.c (sys_select):
3439 * msdos.c (sys_select): Accept one more argument and ignore it.
3441 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
3442 adapt data types and code to that.
3445 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
3446 which clashes with the gnulib function of the same name.
3448 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
3450 * font.c (font_style_to_value, font_style_symbolic)
3451 (font_prop_validate_style): Add type checks for values in
3454 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
3456 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
3459 2012-06-29 Eli Zaretskii <eliz@gnu.org>
3461 * xdisp.c (try_window_id): Undo last change.
3463 * w32.c (getwd): Adjust commentary about startup_dir.
3464 (init_environment): Always call sys_access, even in non-MSVC
3465 builds. Don't chdir to the directory of the Emacs executable.
3466 This undoes code from 1997 which was justified by the need to
3467 "avoid conflicts when removing and renaming directories". But its
3468 downside was that every relative file name was being interpreted
3469 relative to the directory of the Emacs executable, which can never
3470 be TRT. In particular, it broke sys_access when called with
3471 relative file names.
3472 (sys_access): Map GetLastError to errno.
3474 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3476 * window.h (struct window): Change type of 'fringes_outside_margins'
3477 to bitfield. Fix comment. Adjust users accordingly.
3478 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
3480 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
3483 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
3485 * gnutls.c (emacs_gnutls_handshake):
3486 Add QUIT to make the loop interruptible.
3488 2012-06-29 Glenn Morris <rgm@gnu.org>
3490 * charset.c (init_charset): Make lack of etc/charsets fatal.
3492 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3494 * editfns.c (region_limit): Fix type mismatch.
3496 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3498 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
3499 undefined. Convert from xassert to eassert.
3500 * nsmenu.m: Convert from xassert to eassert.
3501 * nsterm.m: Likewise.
3503 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
3505 * editfns.c (region_limit): Clip to narrowing (bug#11770).
3507 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
3509 Avoid integer overflow on scroll-left and scroll-right.
3510 * window.c (HSCROLL_MAX): New macro.
3511 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
3512 overflow when requested scroll falls outside ptrdiff_t range.
3514 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3516 * window.h (struct window): Change type of 'hscroll',
3517 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
3518 'last_modified' and 'last_overlay_modified' to EMACS_INT.
3519 Adjust users accordingly.
3520 * xdisp.c (try_cursor_movement): Replace type check with eassert.
3521 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
3522 from EMACS_INT to ptrdiff_t.
3523 (make_window): Omit redundant initialization.
3525 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
3527 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
3529 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3531 * window.h (struct window): Change type of 'use_time' and
3532 'sequence_number' from Lisp_Object to int.
3533 * frame.c (make_frame): Adjust users accordingly.
3534 * print.c (print_object): Likewise.
3535 * window.c (select_window, Fwindow_use_time, make_parent_window)
3536 (make_window): Likewise.
3538 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3540 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
3541 enabled with --enable-checking=[all,glyphs] configure option.
3542 Fix GLYPH_DEBUG usage assuming that it may be undefined,
3543 adjust comments accordingly.
3544 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
3545 undefined, adjust comments accordingly.
3546 * image.c: Likewise.
3547 * scroll.c: Likewise.
3548 * w32fns.c: Likewise.
3549 * w32term.c: Likewise.
3550 * xdisp.c: Likewise.
3551 * xfaces.c: Likewise.
3553 * xterm.c: Likewise.
3555 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3557 Generalize run-time debugging checks.
3558 * dispextern.h (XASSERTS): Remove.
3559 * fontset.c (xassert): Remove.
3560 Convert from xassert to eassert.
3561 * alloc.c: Convert from xassert to eassert.
3563 * dispnew.c: Likewise.
3565 * fringe.c: Likewise.
3566 * ftfont.c: Likewise.
3567 * gtkutil.c: Likewise.
3568 * image.c: Likewise.
3569 * keyboard.c: Likewise.
3571 * process.c: Likewise.
3572 * scroll.c: Likewise.
3573 * sound.c: Likewise.
3575 * w32console.c: Likewise.
3576 * w32fns.c: Likewise.
3577 * w32term.c: Likewise.
3578 * window.c: Likewise.
3579 * xdisp.c: Likewise.
3580 * xfaces.c: Likewise.
3582 * xselect.c: Likewise.
3583 * xterm.c: Likewise.
3585 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
3587 * fns.c (maybe_resize_hash_table): Output message when growing the
3590 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3592 * alloc.c (allocate_string_data): Remove dead code.
3593 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
3594 avoid GCC warning about unused macro.
3596 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3598 * alloc.c (allocate_string): Omit intervals initialization.
3599 * alloc.c (make_uninit_multibyte_string): Initialize intervals
3600 as in make_pure_string and make_pure_c_string.
3602 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3604 * alloc.c (allocate_string): Fix last change.
3606 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3608 * alloc.c (allocate_string): Remove two redundant calls
3609 to memset, add explicit initialization where appropriate.
3611 2012-06-27 Glenn Morris <rgm@gnu.org>
3613 * lisp.mk (lisp): Remove paths.elc.
3615 2012-06-27 Chong Yidong <cyd@gnu.org>
3617 * doc.c (Fsubstitute_command_keys): Fix punctuation.
3619 2012-06-26 John Wiegley <johnw@newartisans.com>
3621 * unexmacosx.c (copy_data_segment): Add two section names used
3622 on Mac OS X Lion: __mod_init_func and __mod_term_func.
3624 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
3625 when building with Clang.
3627 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
3629 * eval.c (Fapply): Allow calling it with a single argument.
3631 2012-06-26 Eli Zaretskii <eliz@gnu.org>
3633 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
3634 _stricmp and _strnicmp.
3635 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
3637 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3639 * alloc.c (allocate_window): Zero out non-Lisp part of newly
3641 (allocate_process): Likewise for new process.
3642 (allocate_terminal): Change to use offsetof.
3643 (allocate_frame): Likewise.
3644 * frame.c (make_frame): Omit redundant initialization.
3645 * window.c (make_parent_window): Use memset.
3646 (make_window): Omit redundant initialization.
3647 * process.c (make_process): Omit redundant initialization.
3648 * terminal.c (create_terminal): Likewise.
3650 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3652 * term.c (delete_tty): Remove redundant call to memset.
3654 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3656 * alloc.c: Remove build_string.
3657 * lisp.h: Define build_string as static inline. This provides
3658 a better opportunity to optimize away calls to strlen when the
3659 function is called with compile-time constant argument.
3660 * image.c (imagemagick_error): Convert to build_string.
3661 * w32proc.c (sys_spawnve): Likewise.
3662 * xterm.c (x_term_init): Likewise.
3664 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
3666 Use sprintf return value instead of invoking strlen on result.
3667 In the old days this wasn't portable, since some sprintf
3668 implementations returned char *. But they died out years ago and
3669 Emacs already assumes sprintf returns int.
3670 Similarly for float_to_string.
3671 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
3672 * ccl.c (ccl_driver):
3673 * character.c (string_escape_byte8):
3674 * data.c (Fnumber_to_string):
3675 * doprnt.c (doprnt):
3676 * print.c (print_object):
3677 * xdisp.c (message_dolog):
3678 * xfns.c (syms_of_xfns):
3679 Use sprintf or float_to_string result to avoid need to call strlen.
3680 * data.c (Fnumber_to_string):
3681 Use make_unibyte_string, since the string must be ASCII.
3682 * lisp.h, print.c (float_to_string): Now returns int length.
3683 * term.c (produce_glyphless_glyph):
3684 Use sprintf result rather than recomputing it.
3686 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
3687 * Makefile.in (ALL_CFLAGS):
3688 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
3689 * gmalloc.c, regex.c: Include <config.h> unconditionally.
3691 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
3693 * dispextern.h (xstrcasecmp): Define to library function
3694 strcasecmp if available.
3695 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
3697 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
3699 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
3700 Avoid comma operator.
3701 * menu.c (push_submenu_start, push_submenu_end)
3702 (push_left_right_boundary, push_menu_pane): Likewise.
3703 * msdos.c (dos_rawgetc): Likewise.
3705 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
3707 * xfns.c (xic_create_fontsetname): Remove redundant calls
3710 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
3712 * gtkutil.c (get_utf8_string): Remove redundant assignment.
3713 sprintf already null-terminates its output.
3715 * xfns.c (x_window): Remove redundant cast.
3717 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
3719 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
3720 `const char *' to `char *' to avoid compiler warning.
3722 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
3724 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
3725 instead of truncating it to 63 (admittedly a generous limit).
3727 * process.c: Fix spelling and caps in comments.
3729 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
3731 * emacs.c (setpgrp): Remove definition, unused.
3732 * sysdep.c (setpgrp): Remove definition, not used in this file.
3734 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
3736 * makefile.w32-in: Update dependencies.
3738 2012-06-24 Eli Zaretskii <eliz@gnu.org>
3740 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
3741 (SYSTIME_H): Add nt/inc/sys/time.h.
3743 * systime.h [WINDOWSNT]: Include sys/time.h.
3745 * s/ms-w32.h (struct timespec): Definition moved from
3746 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
3748 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
3750 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
3751 * buffer.h (buffer_slot_type_mismatch):
3752 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
3753 * eval.c (unwind_to_catch):
3754 * image.c (my_png_error, my_error_exit):
3755 * keyboard.c (quit_throw_to_read_char, user_error)
3756 (Fexit_recursive_edit, Fabort_recursive_edit):
3757 * lisp.h (die, args_out_of_range, args_out_of_range_3)
3758 (wrong_type_argument, buffer_overflow, __executable_start)
3759 (memory_full, buffer_memory_full, string_overflow, Fthrow)
3760 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
3761 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
3763 (child_setup) [!DOS_NT]:
3764 * lread.c (end_of_file_error, invalid_syntax):
3765 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
3766 * puresize.h (pure_write_error):
3767 * search.c (matcher_overflow):
3768 * sound.c (sound_perror, alsa_sound_perror):
3769 * sysdep.c, syssignal.h (croak):
3770 * term.c (maybe_fatal, vfatal):
3771 * textprop.c (text_read_only):
3772 * undo.c (user_error):
3773 * unexmacosx.c (unexec_error):
3774 * xterm.c (x_ins_del_lines, x_delete_glyphs):
3775 Use _Noreturn rather than NO_RETURN.
3776 No need for separate decl merely because of _Noreturn.
3777 * sound.c (sound_warning, parse_sound):
3778 Remove unnecessary forward decls.
3780 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
3782 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
3783 * lisp.h (WAIT_READING_MAX): New macro.
3784 * dispnew.c (Fsleep_for, sit_for):
3785 * keyboard.c (kbd_buffer_get_event):
3786 * process.c (Faccept_process_output):
3787 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
3788 This improves on the previous patch, which introduced a bug
3789 when time_t is unsigned and as wide as intmax_t.
3790 See <http://bugs.gnu.org/9000#51>.
3792 2012-06-23 Eli Zaretskii <eliz@gnu.org>
3794 * dispnew.c (sit_for, Fsleep_for):
3795 * keyboard.c (kbd_buffer_get_event):
3796 * process.c (Faccept_process_output): Avoid compiler warnings when
3797 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
3799 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
3801 * makefile.w32-in: Update dependencies.
3803 * w32.c (ltime): Add return type and declare static.
3804 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
3806 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
3808 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
3809 Privately reported by Herbert J. Skuhra.
3810 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
3812 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
3813 not make_lisp_timeval, when the argument is of type EMACS_TIME.
3815 2012-06-23 Eli Zaretskii <eliz@gnu.org>
3817 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
3818 last argument of make_unibyte_string.
3820 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
3821 language ID in the event parameters.
3823 * w32term.c (w32_read_socket): Put the new keyboard codepage into
3824 event.code, not the obscure "character set ID".
3826 2012-06-23 Chong Yidong <cyd@gnu.org>
3828 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
3830 2012-06-23 Eli Zaretskii <eliz@gnu.org>
3832 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
3833 * w32.c (fdutimens): New function.
3835 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
3837 * s/ms-w32.h (pselect): Redirect to sys_select.
3839 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
3841 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
3842 in the logic of incrementing and decrementing the value of
3843 use_relocatable_buffers.
3845 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
3847 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
3848 Privately reported by Herbert J. Skuhra.
3849 [__FreeBSD__]: Remove "*/" typo after "#include".
3850 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
3851 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
3852 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
3853 Don't assume EMACS_TIME and struct timeval are the same type.
3855 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
3857 Support higher-resolution time stamps (Bug#9000).
3858 The time stamps are only nanosecond-resolution at the C level,
3859 since that's the best that any real-world system supports now.
3860 But they are picosecond-resolution at the Lisp level, as that's
3861 easy, and leaves room for future OS improvements.
3863 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
3866 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
3867 Don't get current time unless it's needed.
3869 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
3870 now provides it if it's absent.
3871 (start_atimer): Port to higher-res time stamps.
3872 Check for time stamp overflow. Don't get current time more
3873 often than is needed.
3875 * buffer.h (struct buffer): Buffer modtime now has high resolution.
3876 Include systime.h, not time.h.
3877 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
3879 * dired.c: Include stat-time.h.
3880 (Ffile-attributes): File times now have higher resolution.
3882 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
3883 (struct image): Timestamp now has higher resolution.
3885 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
3886 has at least microseconds now. All uses removed.
3887 (update_frame, update_single_window, update_window, update_frame_1)
3888 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
3889 (duration_to_sec_usec): Remove; no longer needed.
3891 * editfns.c (time_overflow): Now extern.
3892 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
3893 (float-time, Fformat_time_string, Fcurrent_time_string)
3894 (Fcurrent_time_zone): Accept and generate higher-resolution
3896 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
3897 (decode_time_components, lisp_seconds_argument): New functions.
3898 (make_time): Now static.
3899 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
3900 Report an error if the time is invalid, rather than having the caller
3903 * fileio.c: Include <stat-time.h>
3904 (Fcopy_file): Copy higher-resolution time stamps.
3905 Prefer to set the time stamp via a file descriptor if that works.
3906 (Fset_file_times, Finsert_file_contents, Fwrite_region)
3907 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
3908 (Fvisited_file_modtime, Fset_visited_file_modtime):
3909 Support higher-resolution time stamps.
3911 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
3913 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
3915 * image.c (prepare_image_for_display, clear_image_cache)
3916 (lookup_image): Port to higer-resolution time stamps.
3918 * keyboard.c (start_polling, bind_polling_period):
3919 Check for time stamp overflow.
3920 (read_char, kbd_buffer_get_event, timer_start_idle)
3921 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
3922 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
3923 Port to higher-resolution time stamps. Do not assume time_t is signed.
3924 (decode_timer): New function. Timers are now vectors of length 9,
3925 not 8, to accommodate the picosecond component.
3926 (timer_check_2): Use it.
3928 * nsterm.m (select_timeout, timeval_subtract): Remove.
3929 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
3930 as they're a bit more accurate and handle overflow better.
3931 (ns_select): Change prototype to be compatible with pselect.
3932 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
3933 * nsterm.h (ns_select): Adjust prototype.
3935 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
3936 us-resolution time stamps.
3937 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
3939 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
3941 * lisp.h (time_overflow): New decl.
3942 (wait_reading_process_output): First arg is now intmax_t, not int,
3943 to accommodate larger waits.
3945 * process.h (struct Lisp_Process.read_output_delay):
3946 Now counts nanoseconds, not microseconds.
3947 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
3949 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
3950 (wait_reading_process_output):
3951 Port to ns-resolution time stamps.
3952 (Faccept_process_output, wait_reading_process_output):
3953 Check for time stamp overflow. Do not assume time_t is signed.
3954 (select_wrapper): Remove; we now use pselect.
3955 (Fprocess_attributes): Now generates ns-resolution time stamps.
3957 * sysdep.c: Include utimens.h. Don't include utime.h
3958 or worry about struct utimbuf; gnulib does that for us now.
3959 (gettimeofday): Remove; gnulib provides a substitute.
3960 (make_timeval): New function.
3961 (set_file_times): Now sets ns-resolution time stamps.
3962 New arg FD; all uses changed.
3963 (time_from_jiffies, ltime_from_jiffies, get_up_time)
3964 (system_process_attributes):
3965 Now returns ns-resolution time stamp. All uses changed.
3966 Check for time stamp overflow.
3968 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
3969 provides a substitute now.
3971 * systime.h: Include timespec.h rather than sys/time.h and time.h,
3972 since it guarantees struct timespec.
3973 (EMACS_TIME): Now struct timespec, so that we can support
3974 ns-resolution time stamps.
3975 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
3976 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
3977 (EMACS_USECS): Remove.
3978 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
3979 so multiply the arg by 1000 before storing it.
3980 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
3982 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
3983 Port to ns-resolution time stamps.
3984 (EMACS_TIME_NEG_P): Remove; replaced by....
3985 (EMACS_TIME_SIGN): New macro.
3986 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
3987 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
3988 (set_file_times, make_time, lisp_time_argument): Adjust signature.
3989 (make_timeval, make_lisp_time, decode_time_components): New decls.
3990 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
3991 that it mishandled time_t overflow. You can't compare by subtracting!
3992 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
3993 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
3995 * term.c: Include <sys/time.h>.
3996 (timeval_to_Time): New function, for proper overflow wraparound.
3997 (term_mouse_position, term_mouse_click): Use it.
3999 * undo.c (record_first_change): Support higher-resolution time stamps
4001 (Fprimitive_undo): Use them when restoring time stamps.
4003 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
4004 (w32_get_internal_run_time):
4005 Port to higher-resolution Emacs time stamps.
4006 (ltime): Now accepts single 64-bit integer, as that's more convenient
4009 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
4011 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
4012 for compatibility with pselect. Support ns-resolution time stamps.
4014 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
4016 * xselect.c (wait_for_property_change, x_get_foreign_selection):
4017 Check for time stamp overflow, and support ns-resolution time stamps.
4019 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
4020 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
4021 (timeval_subtract): Remove; no longer needed.
4022 (XTflash, XTring_bell, x_wait_for_event):
4023 Port to ns-resolution time stamps. Don't assume time_t is signed.
4025 2012-06-22 Chong Yidong <cyd@gnu.org>
4027 * xdisp.c (x_consider_frame_title): Revert last change.
4029 2012-06-22 Eli Zaretskii <eliz@gnu.org>
4031 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
4032 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
4033 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
4034 staticidx goes up to 1597 out of 1600 = 0x640.)
4036 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
4038 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
4039 Otherwise, the umask might be mistakenly 0 while handling input signals.
4041 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
4043 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
4045 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
4047 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
4048 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
4049 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
4050 access to `contents' member of Lisp_Vector objects with AREF and ASET
4053 2012-06-19 Chong Yidong <cyd@gnu.org>
4055 * frame.c (delete_frame): When selecting a frame on a different
4056 text terminal, do not alter the terminal's top-frame.
4058 * xdisp.c (format_mode_line_unwind_data): Record the target
4059 frame's selected window and its terminal's top-frame.
4060 (unwind_format_mode_line): Restore them.
4061 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
4063 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
4064 since tty frames can be explicitly named.
4065 (prepare_menu_bars): Likewise.
4067 * term.c (Ftty_top_frame): New function.
4069 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4071 Port byte-code-meter to modern targets.
4072 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
4073 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
4074 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
4075 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
4076 (METER_1, METER_2): Simplify.
4078 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
4080 * data.c (Fdefalias): Return `symbol' (bug#11686).
4082 2012-06-18 Martin Rudalics <rudalics@gmx.at>
4084 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
4085 gets killed during executing of this function (Bug#11665).
4086 Try to always return Qt when the buffer has been actually killed.
4087 (Vkill_buffer_query_functions): In doc-string say that functions
4088 run by this hook should not change the current buffer.
4090 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4092 Fix recently-introduced process.c problems found by static checking.
4093 * process.c (write_queue_push, write_queue_pop, send_process):
4094 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
4095 (write_queue_pop): Fix pointer signedness problem.
4096 (send_process): Remove unused local.
4098 2012-06-17 Chong Yidong <cyd@gnu.org>
4100 * xdisp.c (redisplay_internal): No need to redisplay terminal
4101 frames that are not on top.
4103 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
4105 * process.c (make_process): Initialize write_queue.
4106 (write_queue_push, write_queue_pop): New functions.
4107 (send_process): Use them to maintain correct ordering of process
4110 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
4112 * lisp.h (eassert): Assume C89 or later.
4113 This removes the need for CHECK.
4114 (CHECK): Remove. Its comments about always evaluating its
4115 argument were confusing, as 'eassert' typically does not evaluate
4118 * coding.c (produce_chars): Use ptrdiff_t, not int.
4120 * xterm.c (x_draw_underwave): Check for integer overflow.
4121 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
4123 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
4125 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
4126 referenced (Bug#11583).
4128 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
4130 Implement wave-style variant of underlining.
4131 * dispextern.h (face_underline_type): New enum.
4132 (face): Add field for underline type.
4133 * nsterm.m (ns_draw_underwave): New function.
4134 (ns_draw_text_decoration): Use it.
4135 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
4137 (x_draw_glyph_string): Use them.
4138 * xfaces.c (Qline, Qwave): New Lisp objects.
4139 (check_lface_attrs, merge_face_ref)
4140 (Finternal_set_lisp_face_attribute, realize_x_face):
4141 Handle wave-style underline face attributes.
4142 * xterm.c (x_draw_underwave): New function.
4143 (x_draw_glyph_string): Use it.
4145 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
4147 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
4148 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
4149 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
4150 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
4151 ($(BLD)/w32select.$(O)): Update dependencies.
4153 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
4155 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
4156 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
4157 * character.c (_fetch_multibyte_char_p): Remove.
4158 * alloc.c: Include "character.h" before "buffer.h".
4160 * buffer.c: Likewise.
4161 * bytecode.c: Likewise.
4162 * callint.c: Likewise.
4163 * callproc.c: Likewise.
4164 * casefiddle.c: Likewise.
4165 * casetab.c: Likewise.
4166 * category.c: Likewise.
4168 * coding.c: Likewise.
4169 * composite.c: Likewise.
4170 * dired.c: Likewise.
4171 * dispnew.c: Likewise.
4173 * dosfns.c: Likewise.
4174 * editfns.c: Likewise.
4175 * emacs.c: Likewise.
4176 * fileio.c: Likewise.
4177 * filelock.c: Likewise.
4179 * fontset.c: Likewise.
4180 * fringe.c: Likewise.
4181 * indent.c: Likewise.
4182 * insdel.c: Likewise.
4183 * intervals.c: Likewise.
4184 * keyboard.c: Likewise.
4185 * keymap.c: Likewise.
4186 * lread.c: Likewise.
4187 * macros.c: Likewise.
4188 * marker.c: Likewise.
4189 * minibuf.c: Likewise.
4190 * nsfns.m: Likewise.
4191 * nsmenu.m: Likewise.
4192 * print.c: Likewise.
4193 * process.c: Likewise.
4194 * regex.c: Likewise.
4195 * region-cache.c: Likewise.
4196 * search.c: Likewise.
4197 * syntax.c: Likewise.
4199 * textprop.c: Likewise.
4201 * unexsol.c: Likewise.
4202 * w16select.c: Likewise.
4203 * w32fns.c: Likewise.
4204 * w32menu.c: Likewise.
4205 * window.c: Likewise.
4206 * xdisp.c: Likewise.
4208 * xmenu.c: Likewise.
4210 * xselect.c: Likewise.
4212 2012-06-16 Eli Zaretskii <eliz@gnu.org>
4214 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
4215 If all the glyphs of the glyph row came from strings, and we have no
4216 cursor positioning clues, put the cursor on the first glyph of the
4218 (handle_face_prop): Use chunk-relative overlay string index when
4219 indexing into it->string_overlays array. (Bug#11653)
4220 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
4221 the rightmost. (Bug#11720)
4223 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
4225 * category.h (CHAR_HAS_CATEGORY): Define as inline.
4226 (CATEGORY_MEMBER): Enforce 1/0 value.
4227 * category.c (_temp_category_set): Remove.
4229 2012-06-16 Eli Zaretskii <eliz@gnu.org>
4231 * window.c (Fdelete_other_windows_internal)
4232 (Fdelete_window_internal): Don't access frame's mouse highlight
4233 info of the initial frame. (Bug#11677)
4235 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
4237 * .gdbinit (xgetint): Fix recently-introduced paren typo.
4238 Assume USE_2_TAGS_FOR_INTS.
4239 (xreload): Adjust $tagmask width to match recent lisp.h change.
4241 Simplify lisp.h in minor ways that should not affect code.
4242 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
4243 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
4244 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
4245 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
4246 (INTTYPEBITS): New macro, for clarity.
4247 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
4248 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
4249 Simplify now that USE_LSB_TAG is always defined.
4250 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
4251 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
4253 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
4255 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
4257 2012-06-13 Glenn Morris <rgm@gnu.org>
4259 * s/bsd-common.h (BSD4_3):
4260 * s/usg5-4-common.h (USG5_4): No longer define; unused.
4262 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
4264 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
4267 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
4269 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
4270 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
4271 * alloc.c (widen_to_Lisp_Object): Remove.
4272 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
4273 * frame.c (delete_frame): Remove outdated comment.
4274 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
4275 USE_LISP_UNION_TYPE.
4276 (Fw32_unregister_hot_key): Likewise.
4277 (Fw32_toggle_lock_key): Likewise.
4278 * w32menu.c (add_menu_item): Likewise.
4279 (w32_menu_display_help): Use XIL instead of checking
4280 USE_LISP_UNION_TYPE.
4281 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
4282 (init_heap): Likewise.
4283 * w32term.c (w32_read_socket): Update comment.
4285 2012-06-13 Glenn Morris <rgm@gnu.org>
4287 * s/usg5-4-common.h, src/s/unixware.h:
4288 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
4290 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
4292 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
4294 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
4295 * alloc.c (make_number) [!defined make_number]:
4296 Remove, as lisp.h always defines this now.
4297 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
4298 (roundup_size): Verify that it is a power of 2.
4299 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
4300 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
4301 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
4302 -DUSE_LSB_TAG=0, to override the automatically-selected default.
4303 USE_LSB_TAG now is always defined to be either 0 or 1.
4305 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
4306 code works fine either way, and efficiency is not a concern here,
4307 as the union type is for debugging, not for production.
4308 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
4309 Use an inline function on all platforms when using the union type,
4310 since this is simpler and 'static inline' can be used portably
4312 (LISP_INITIALLY_ZERO): New macro.
4313 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
4314 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
4316 2012-06-12 Glenn Morris <rgm@gnu.org>
4318 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
4320 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
4322 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
4323 Move BROKEN_SIGIO to configure.
4325 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
4326 Move NO_TERMIO to configure.
4328 2012-06-12 Chong Yidong <cyd@gnu.org>
4330 * image.c (imagemagick_load_image): Use MagickFlattenImage if
4331 MagickMergeImageLayers is undefined. Use pixel pusher loop if
4332 MagickExportImagePixels is undefined.
4334 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
4336 * image.c (imagemagick_load_image): Remove unused label.
4338 2012-06-11 Glenn Morris <rgm@gnu.org>
4340 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4341 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
4342 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
4343 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
4345 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
4347 * alloc.c (make_byte_code): New function.
4348 (Fmake_byte_code): Use it. Don't purify here.
4349 * lread.c (read1): Use it as well to avoid extra allocation.
4351 2012-06-11 Chong Yidong <cyd@gnu.org>
4353 * image.c (imagemagick_load_image): Implement transparency.
4355 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
4357 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
4358 account for preceding backslashes. (Bug#11663)
4360 2012-06-09 Chong Yidong <cyd@gnu.org>
4362 * term.c: Support italics in capable terminals (Bug#9652).
4363 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
4364 (turn_on_face): Output using TS_enter_italic_mode if available.
4365 Don't handle unused blinking and alt-charset cases.
4366 (turn_off_face): Handle italic case; discard unused tty_blinking_p
4367 and tty_alt_charset_p cases.
4368 (tty_capable_p, init_tty): Support italics.
4370 * termchar.h (struct tty_display_info): Add field for italics.
4371 Remove unused blink field.
4373 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
4376 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
4377 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
4378 tty_alt_charset_p. Add tty_italic_p.
4380 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
4382 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
4383 dbus_type_is_basic if available.
4384 (xd_extract_signed, xd_extract_unsigned): Rename from
4385 extract_signed and extract_unsigned, respectively. Adapt callers.
4387 2012-06-09 Chong Yidong <cyd@gnu.org>
4389 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
4391 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
4394 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
4396 * xdisp.c (vmessage): Treat frame message as multibyte.
4397 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
4398 would generate the diagnostic "Making \302\247 buffer-local while
4401 2012-06-08 Eli Zaretskii <eliz@gnu.org>
4403 * dispnew.c (showing_window_margins_p): Undo last change, which
4404 was done due to an inadvertent commit.
4405 (adjust_frame_glyphs_for_frame_redisplay): Do call
4406 showing_window_margins_p.
4408 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
4410 * eval.c (Fmake_var_non_special): New primitive.
4411 (syms_of_eval): Defsubr it.
4412 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
4414 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
4416 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
4417 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
4419 2012-06-08 Eli Zaretskii <eliz@gnu.org>
4421 * alloc.c (allocate_vectorlike): Fix last change.
4423 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
4425 Block-based vector allocation of small vectors.
4426 * lisp.h (struct vectorlike_header): New field `nbytes',
4427 adjust comment accordingly.
4428 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
4429 to denote vector blocks. Adjust users (live_vector_p,
4430 mark_maybe_pointer, valid_lisp_object_p) accordingly.
4431 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
4432 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
4433 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
4434 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
4435 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
4436 (roundup_size): New constant.
4437 (struct vector_block): New data type.
4438 (vector_blocks, vector_free_lists, zero_vector): New variables.
4439 (all_vectors): Rename to `large_vectors'.
4440 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
4441 (sweep_vectors): New functions.
4442 (allocate_vectorlike): Return `zero_vector' as the only vector of
4443 0 items. Allocate new vector from block if vector size is less than
4444 or equal to VBLOCK_BYTES_MAX.
4445 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
4446 (init_alloc_once): Add call to init_vectors.
4448 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
4450 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
4452 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
4454 * doprnt.c (doprnt): Truncate multibyte char correctly.
4455 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
4456 would mishandle a string argument "Xc" if X was a multibyte
4457 character of length 2: it would truncate after X's first byte
4458 rather than including all of X.
4460 2012-06-06 Chong Yidong <cyd@gnu.org>
4462 * buffer.c (word_wrap): Doc fix.
4464 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
4466 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
4468 2012-06-03 Glenn Morris <rgm@gnu.org>
4470 * xdisp.c (tool-bar-style): Doc fix.
4472 2012-06-03 Ulrich Müller <ulm@gentoo.org>
4474 * Makefile.in (PAXCTL): Define.
4475 (temacs$(EXEEXT)): Disable memory randomization for the temacs
4476 binary via PaX flags if the paxctl utility is available.
4477 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
4478 Restore PaX flags to their default. (Bug#11398)
4480 2012-06-03 Chong Yidong <cyd@gnu.org>
4482 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
4485 2012-06-03 Chong Yidong <cyd@gnu.org>
4487 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
4488 (note_mode_line_or_margin_highlight): If there is no help echo,
4489 use mode-line-default-help-echo. Handle the case where the mouse
4490 position is past the end of the mode line string.
4492 * buffer.c (buffer_local_value_1): New function, split from
4493 Fbuffer_local_value; can return Qunbound.
4494 (Fbuffer_local_value): Use it.
4495 (Vmode_line_format): Docstring tweaks.
4497 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
4499 * sysdep.c (system_process_attributes): Improve comment.
4501 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
4503 * keyboard.c: Export real-this-command to Elisp.
4504 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
4505 and DEFVAR it. Update all users.
4507 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
4509 * minibuf.c (Fassoc_string): Remove duplicate declaration.
4511 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
4512 Convert pctcpu and pctmem to Lisp float properly.
4513 Let the compiler fold better, as 100.0/0x8000 is exact.
4515 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
4517 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
4520 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
4522 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
4524 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
4526 For a 'struct window', replace some Lisp_Object fields to
4527 bitfields where appropriate, remove unused fields.
4528 * window.h (struct window): Remove unused 'last_mark_x' and
4529 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
4530 change it's type from Lisp_Object to bitfield.
4531 Change type of 'force_start', 'optional_new_start',
4532 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
4533 fields from Lisp_Object to bitfield. Adjust users accordingly.
4535 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
4537 Pacify gcc -Wdouble-precision when using Xaw.
4538 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
4539 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
4540 Use 'float' consistently, rather than 'float' in most places
4541 and 'double' in a couple of places.
4543 2012-05-31 Eli Zaretskii <eliz@gnu.org>
4545 * xdisp.c (handle_stop): Detect whether we have overlay strings
4546 loaded by testing it->current.overlay_string_index to be
4547 non-negative, instead of checking whether n_overlay_strings is
4548 positive. (Bug#11587)
4550 2012-05-31 Chong Yidong <cyd@gnu.org>
4552 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
4554 * doc.c (Fsubstitute_command_keys): Doc fix.
4556 2012-05-31 Eli Zaretskii <eliz@gnu.org>
4558 * search.c (search_buffer): Remove calls to
4559 r_alloc_inhibit_buffer_relocation, as it is now called by
4560 maybe_unify_char, which was the cause of relocation of buffer text
4563 2012-05-31 Eli Zaretskii <eliz@gnu.org>
4565 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
4566 for the duration of call to load_charset, to avoid problems with
4567 callers of maybe_unify_char that access buffer text through C
4570 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
4571 decrement the inhibition flag, instead of just setting or
4574 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
4576 Remove obsolete '#define static' cruft.
4577 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
4578 This #undef was "temporary" in 2000; it is no longer needed
4579 now that '#define static' has gone away.
4580 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
4581 (gray_bitmap_bits): Remove; no longer needed.
4582 All uses replaced with definiens.
4583 * xterm.c: Include "bitmaps/gray.xbm".
4585 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
4587 Clean up __executable_start, monstartup when --enable-profiling.
4588 The following changes affect the code only when profiling.
4589 * dispnew.c (__executable_start): Rename from safe_bcopy.
4590 Define only on platforms that need it.
4591 * emacs.c: Include <sys/gmon.h> when profiling.
4592 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
4593 (__executable_start): Remove decl, since lisp.h does it now.
4594 (safe_bcopy): Remove decl; no longer has that name.
4595 (main): Coalesce #if into single bit of code, for simplicity.
4596 Cast pointers to uintptr_t, since standard libraries want integers
4598 * lisp.h (__executable_start): New decl.
4600 2012-05-31 Glenn Morris <rgm@gnu.org>
4602 * image.c (Fimagemagick_types): Doc fix.
4604 2012-05-30 Jim Meyering <meyering@redhat.com>
4606 * callproc.c (Fcall_process_region): Include directory component
4607 in mkstemp error message (Bug#11586).
4609 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
4611 * alloc.c, lisp.h (make_pure_vector): Now static.
4613 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
4615 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
4616 Move to byte-run.el.
4617 (Fautoload): Do the hash-doc more carefully.
4618 * data.c (Fdefalias): Purify definition, except for keymaps.
4619 (Qdefun): Move from eval.c.
4620 * lisp.h (Qdefun): Remove.
4621 * lread.c (read1): Tiny simplification.
4623 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
4625 Do not create empty overlays with the evaporate property (Bug#9642).
4626 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
4627 Bug#9642, but explicitly check that the buffer the overlay would
4628 be moved to is live and rearrange lines to make sure that errors
4629 will not put the overlay in an inconsistent state.
4630 (Fdelete_overlay): Cosmetics.
4632 2012-05-28 Eli Zaretskii <eliz@gnu.org>
4634 * w32term.c (my_bring_window_to_top): New function.
4635 (x_raise_frame): Use handle returned by DeferWindowPos, which
4636 could be different from the original one.
4637 Call my_bring_window_to_top instead of my_set_foreground_window.
4640 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
4641 by calling BringWindowToTop.
4643 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
4644 (WM_EMACS_END): Increase by one.
4646 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
4648 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
4649 This avoids undefined behavior that might cause the eassert
4650 to not catch an out-of-range value.
4652 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
4654 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
4655 Update dependencies.
4657 2012-05-27 Eli Zaretskii <eliz@gnu.org>
4659 * bidi.c (bidi_mirror_char): Fix last change.
4661 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
4663 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
4664 when referring to sectname field in printf format.
4666 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
4668 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
4669 Only r_alloc_inhibit_buffer_relocation needed to be added;
4670 the others were already declared.
4672 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
4673 before checking whether it's out of range. Put the check inside
4675 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
4677 2012-05-27 Ken Brown <kbrown@cornell.edu>
4679 * callproc.c (Fcall_process): Restore a line that was accidentally
4680 commented out in the 2011-02-13 change (bug#11547).
4682 2012-05-27 Eli Zaretskii <eliz@gnu.org>
4684 * lisp.h [REL_ALLOC]: Add prototypes for external functions
4685 defined on ralloc.c.
4687 * buffer.c [REL_ALLOC]: Remove prototypes of
4688 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
4689 they are now on lisp.h.
4691 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
4693 * search.c (search_buffer): Use it to inhibit relocation of buffer
4694 text while re_search_2 is doing its job, because re_search_2 is
4695 passed C pointers to buffer text. (Bug#11519)
4697 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
4700 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
4701 state after an additional call to move_it_in_display_line_to, keep
4702 the values of it->max_ascent and it->max_descent found for the
4704 (pos_visible_p): Revert the comparison against bottom_y to what it
4705 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
4708 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
4710 Fix coding-related core dumps with gcc -ftrapv.
4711 The code was computing A - B, where A and B are pointers, and B is
4712 random garbage. This can lead to core dumps on platforms that
4713 have special pointer registers, and it also leads to core dumps on
4714 x86-64 when compiled with gcc -ftrapv. The fix is to compute
4715 A - B only when B is initialized properly.
4716 * coding.c (coding_set_source, coding_set_destination): Return void.
4717 (coding_change_source, coding_change_destinations): New functions,
4718 with the old behaviors of coding_set_source and coding_set_destination.
4719 All callers that need an offset changed to use these new functions.
4721 2012-05-26 Glenn Morris <rgm@gnu.org>
4723 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
4725 2012-05-26 Eli Zaretskii <eliz@gnu.org>
4727 Extend mouse support on W32 text-mode console.
4728 * xdisp.c (draw_row_with_mouse_face):
4729 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
4731 * w32console.c: Include window.h.
4732 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
4734 (initialize_w32_display): Initialize mouse-highlight data.
4736 * w32inevt.c: Include termchar.h and window.h.
4737 (do_mouse_event): Support mouse-autoselect-window. When the mouse
4738 moves, call note_mouse_highlight. If help_echo changed, call
4739 gen_help_event to produce help-echo message in the echo area.
4740 Call clear_mouse_face if mouse_face_hidden is set in the mouse
4743 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
4745 * lread.c (read1): Simplify slightly to avoid an overflow warning
4746 with GCC 4.7.0 on x86-64.
4748 2012-05-26 Eli Zaretskii <eliz@gnu.org>
4750 * bidi.c (bidi_mirror_char): Revert last change: an int is
4751 definitely wide enough here.
4753 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
4755 Fix integer width and related bugs (Bug#9874).
4756 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
4757 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
4758 (string_bytes, check_sblock, allocate_string_data):
4759 (compact_small_strings, Fmake_bool_vector, make_string)
4760 (make_unibyte_string, make_multibyte_string)
4761 (make_string_from_bytes, make_specified_string)
4762 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
4763 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
4765 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4766 (allocate_pseudovector):
4767 Use int, not EMACS_INT, where int is wide enough.
4768 (inhibit_garbage_collection, Fgarbage_collect):
4769 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4770 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
4771 int might not be wide enough.
4772 (bidi_cache_search, bidi_cache_find, bidi_init_it)
4773 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
4774 (bidi_at_paragraph_end, bidi_find_paragraph_start)
4775 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
4776 (bidi_level_of_next_char, bidi_move_to_visually_next):
4777 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4778 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
4779 (Fkill_buffer, Fset_buffer_major_mode)
4780 (advance_to_char_boundary, Fbuffer_swap_text)
4781 (Fset_buffer_multibyte, overlays_at, overlays_in)
4782 (overlay_touches_p, struct sortvec, record_overlay_string)
4783 (overlay_strings, recenter_overlay_lists)
4784 (adjust_overlays_for_insert, adjust_overlays_for_delete)
4785 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
4786 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
4787 (Foverlay_recenter, last_overlay_modification_hooks_used)
4788 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
4789 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4790 (validate_region): Omit unnecessary test for b <= e,
4791 since that's guaranteed by the previous test.
4792 (adjust_overlays_for_delete): Avoid pos + length overflow.
4793 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
4794 (report_overlay_modification):
4795 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4796 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
4797 Omit pointer cast, which isn't needed anyway, and doesn't work
4798 after the EMACS_INT -> ptrdiff_t change.
4799 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
4800 * buffer.h: Adjust decls to match defn changes elsewhere.
4801 (struct buffer_text, struct buffer):
4802 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4803 Use EMACS_INT, not int, where int might not be wide enough.
4804 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
4805 not int, to avoid needless 32-bit limit on 64-bit hosts.
4806 (exec_byte_code): Use tighter memory-full test, one that checks
4807 for alloca overflow. Don't compute the address of the object just
4808 before an array, as that's not portable. Use EMACS_INT, not
4809 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
4810 * callint.c (Fcall_interactively):
4811 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4812 * callproc.c (call_process_kill, Fcall_process):
4813 Don't assume pid_t fits into an Emacs fixnum.
4814 (call_process_cleanup, Fcall_process, child_setup):
4815 Don't assume pid_t fits into int.
4816 (call_process_cleanup, Fcall_process, delete_temp_file)
4817 (Fcall_process_region):
4818 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4819 (Fcall_process): Simplify handling of volatile integers.
4820 Use int, not EMACS_INT, where int will do.
4821 * casefiddle.c (casify_object, casify_region, operate_on_word)
4822 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
4823 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4824 (casify_object): Avoid integer overflow when overallocating buffer.
4825 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
4826 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
4827 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
4828 * category.h (CATEGORYP): Don't assume arg is nonnegative.
4829 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
4830 integers are now checked earlier. All uses replaced with XINT.
4832 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4833 For CCL_MapSingle, check that content and value are in int range.
4834 (ccl_driver, Fregister_code_conversion_map):
4835 Check that Vcode_version_map_vector is a vector.
4836 (resolve_symbol_ccl_program): Check that vector header is in range.
4837 Always copy the vector, so that we can check its contents reliably
4838 now rather than having to recheck each instruction as it's being
4839 executed. Check that vector words fit in 'int'.
4840 (ccl_get_compiled_code, Fregister_ccl_program)
4841 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
4842 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
4843 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
4844 contents are in range.
4845 (Fccl_execute_on_string): Check that status is in range.
4846 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
4847 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
4848 Accept and return EMACS_INT, not int, because callers can pass values
4850 (c_string_width, strwidth, lisp_string_width, chars_in_text)
4851 (multibyte_chars_in_text, parse_str_as_multibyte)
4852 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
4853 (str_as_unibyte, str_to_unibyte, string_count_byte8)
4854 (string_escape_byte8, Fget_byte):
4855 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4856 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
4857 avoid mishandling large integers.
4858 * character.h: Adjust decls to match defn changes elsewhere.
4859 * charset.c (load_charset_map_from_file, find_charsets_in_text)
4860 (Ffind_charset_region):
4861 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4862 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
4863 (load_charset_map_from_vector, Fdefine_charset_internal):
4864 Don't assume fixnum fits in int.
4865 (load_charset_map_from_vector, Fmap_charset_chars):
4866 Remove now-unnecessary CHECK_NATNUMs.
4867 (Fdefine_charset_internal): Check ranges here, more carefully.
4868 Don't rely on undefined behavior with signed left shift overflow.
4869 Don't assume unsigned int fits into fixnum, or that fixnum fits
4870 into unsigned int. Don't require max_code to be a valid fixnum;
4871 that's not true for gb10830 4-byte on a 32-bit host. Allow
4872 invalid_code to be a cons, for the same reason. Require code_offset
4873 to be a character. Avoid int overflow if max_char is close
4875 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
4876 this is intended anyway and avoids some undefined behavior.
4877 (load_charset_map): Pass unsigned, not int, as 2nd arg of
4878 INDEX_TO_CODE_POINT, as that's what it expects.
4879 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
4880 * charset.h (DECODE_CHAR): Return int, not unsigned;
4881 this is what was intended anyway, and it avoids undefined behavior.
4882 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
4883 integer-overflow issues.
4884 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
4885 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
4886 where the argument is EMACS_INT, and this behavior is not intended.
4887 * chartab.c (Fmake_char_table, Fset_char_table_range)
4888 (uniprop_get_decoder, uniprop_get_encoder):
4889 Don't assume fixnum fits in int.
4890 * cmds.c (move_point): New function, that does the gist of
4891 Fforward_char and Fbackward_char, but does so while checking
4892 for integer overflow more accurately.
4893 (Fforward_char, Fbackward_char): Use it.
4894 (Fforward_line, Fend_of_line, internal_self_insert)
4895 (internal_self_insert):
4896 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4897 Fix a FIXME, by checking for integer overflow when calculating
4898 target_clm and actual_clm.
4899 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
4900 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
4901 (ASSURE_DESTINATION, coding_alloc_by_realloc)
4902 (coding_alloc_by_making_gap, alloc_destination)
4903 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
4904 (encode_coding_utf_16, detect_coding_emacs_mule)
4905 (decode_coding_emacs_mule, encode_coding_emacs_mule)
4906 (detect_coding_iso_2022, decode_coding_iso_2022)
4907 (encode_invocation_designation, encode_designation_at_bol)
4908 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
4909 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
4910 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
4911 (encode_coding_ccl, encode_coding_raw_text)
4912 (detect_coding_charset, decode_coding_charset)
4913 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
4914 (produce_composition, produce_charset, produce_annotation)
4915 (decode_coding, handle_composition_annotation)
4916 (handle_charset_annotation, consume_chars, decode_coding_gap)
4917 (decode_coding_object, encode_coding_object, detect_coding_system)
4918 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
4919 (code_convert_region, code_convert_string)
4920 (Fdefine_coding_system_internal)
4921 (coding_set_source, coding_set_destination):
4922 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4923 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
4924 (Fdefine_coding_system_internal):
4925 Don't assume fixnums fit in int.
4926 (decode_coding_gap, decode_coding_object, encode_coding_object)
4927 (Fread_coding_system, Fdetect_coding_region)
4928 (Funencodable_char_position, Fcheck_coding_systems_region)
4929 (get_translation, handle_composition_annotation, consume_chars):
4930 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4931 (consume_chars): Rewrite to not calculate an address outside buffer.
4932 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
4933 Don't access memory outside of the args array.
4934 (Fdefine_coding_system_internal): Check for charset-id overflow.
4935 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
4936 result of ENCODE_CHAR.
4937 * coding.h: Adjust decls to match defn changes elsewhere.
4938 (struct coding_system):
4939 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4940 * composite.c (get_composition_id, find_composition)
4941 (run_composition_function, update_compositions)
4942 (compose_text, composition_gstring_put_cache)
4943 (composition_gstring_p, composition_gstring_width)
4944 (fill_gstring_header, fill_gstring_body, autocmp_chars)
4945 (composition_compute_stop_pos, composition_reseat_it)
4946 (composition_update_it, struct position_record)
4947 (find_automatic_composition, composition_adjust_point)
4948 (Fcomposition_get_gstring, Ffind_composition_internal):
4949 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4950 (update_compositions):
4951 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4952 * composite.h: Adjust decls to match defn changes elsewhere.
4953 (struct composition):
4954 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4955 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
4956 Do not attempt to compute the address of the object just before a
4957 buffer; this is not portable.
4959 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4960 (Faset): Use int, not EMACS_INT, where int is wide enough.
4961 (Fstring_to_number): Don't assume fixnums fit in int.
4962 (Frem): Don't assume arg is nonnegative.
4963 * dbusbind.c (xd_append_arg): Check for integers out of range.
4964 (Fdbus_call_method): Don't overflow the timeout int.
4965 (extract_signed, extract_unsigned): New functions.
4966 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
4967 (xd_get_connection_references): Return ptrdiff_t, not int.
4969 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
4970 (xd_read_message_1):
4971 Use int, not unsigned, where the dbus API uses int.
4972 (Fdbus_message_internal): Don't overflow mtype.
4973 (syms_of_dbusbind): Allocate right-sized buffer for integers.
4974 * dired.c (directory_files_internal, file_name_completion, scmp)
4975 (file_name_completion_stat):
4976 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4977 (file_name_completion): Don't overflow matchcount.
4978 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
4979 * dispextern.h: Adjust decls to match defn changes elsewhere.
4980 (struct text_pos, struct glyph, struct bidi_saved_info)
4981 (struct bidi_string_data, struct bidi_it, struct composition_it)
4983 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4984 (struct display_pos, struct composition_it, struct it):
4985 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4986 * dispnew.c (increment_matrix_positions)
4987 (increment_row_positions, mode_line_string)
4988 (marginal_area_string):
4989 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4990 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
4991 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4992 (duration_to_sec_usec): New function, to check for overflow better.
4993 (Fsleep_for, sit_for): Use it.
4994 * doc.c (get_doc_string, store_function_docstring):
4995 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4996 (get_doc_string, Fsnarf_documentation):
4997 Use int, not EMACS_INT, where int is wide enough.
4999 Use SAFE_ALLOCA, not alloca.
5000 Check for overflow when converting EMACS_INT to off_t.
5001 * doprnt.c (doprnt):
5002 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5003 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
5004 Don't assume uid_t fits into fixnum.
5005 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
5006 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
5007 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
5008 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
5009 (general_insert_function)
5010 (Finsert_char, make_buffer_string, make_buffer_string_both)
5011 (update_buffer_properties, Fbuffer_substring)
5012 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
5013 (Fsubst_char_in_region, check_translation)
5014 (Ftranslate_region_internal, save_restriction_restore, Fformat)
5015 (transpose_markers, Ftranspose_regions):
5016 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5017 (clip_to_bounds): Move to lisp.h as an inline function).
5018 (Fconstrain_to_field): Don't assume integers are nonnegative.
5019 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
5020 (Fsubst_char_in_region, Fsave_restriction):
5021 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5022 (Femacs_pid): Don't assume pid_t fits into fixnum.
5023 (lo_time): Use int, not EMACS_INT, when int suffices.
5024 (lisp_time_argument): Check for usec out of range.
5025 (Fencode_time): Don't assume fixnum fits in int.
5026 (Fuser_login_name, Fuser_full_name): Signal an error
5027 if a uid argument is out of range, rather than relying on
5029 (Fformat_time_string): Remove now-unnecessary check.
5030 lisp_time_argument checks for out-of-range usec now.
5031 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
5032 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
5033 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
5034 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
5035 (init_cmdargs, Fdump_emacs):
5036 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5037 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
5038 the bottom (typically) 32 bits of the fixnum.
5039 * eval.c (specpdl_size, call_debugger):
5040 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5041 (when_entered_debugger, Fbacktrace_debug):
5042 Don't assume fixnum can fit in int.
5043 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
5044 the object just before a buffer; this is not portable.
5045 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
5046 (grow_specpdl, unbind_to):
5047 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5048 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
5049 (grow_specpdl): Simplify allocation by using xpalloc.
5050 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
5051 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
5052 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
5053 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5054 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
5056 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5057 (Fcopy_file, non_regular_nbytes, read_non_regular)
5058 (Finsert_file_contents):
5059 Use int, not EMACS_INT, where int is wide enough.
5060 (READ_BUF_SIZE): Verify that it fits in int.
5061 (Finsert_file_contents): Check that counts are in proper range,
5062 rather than assuming fixnums fit into ptrdiff_t etc.
5063 Don't assume fixnums fit into int.
5064 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5065 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
5066 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
5067 (string_char_to_byte, string_byte_to_char)
5068 (string_make_multibyte, string_to_multibyte)
5069 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
5070 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
5071 (substring_both, Fdelete, internal_equal, Ffillarray)
5072 (Fclear_string, mapcar1)
5073 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
5074 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
5075 (larger_vector, make_hash_table, maybe_resize_hash_table)
5076 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
5077 (Fmaphash, secure_hash):
5078 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5079 (concat): Check for string index and length overflow.
5080 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
5082 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5083 (larger_vector): New API (vec, incr_min, size_max) replaces old
5084 one (vec, new_size, init). This catches size overflow.
5085 INIT was removed because it was always Qnil.
5086 All callers changed.
5087 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
5088 the upper bound on a hash table index size.
5089 (make_hash_table, maybe_resize_hash_table): Use it.
5090 (secure_hash): Computer start_byte and end_byte only after
5091 they're known to be in ptrdiff_t range.
5092 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
5093 (Ffont_get_glyphs, Ffont_at):
5094 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5095 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
5096 (Flist_fonts, Fopen_font):
5097 Don't assume fixnum can fit in int.
5098 (check_gstring): Don't assume index can fit in int.
5099 (font_match_p): Check that fixnum is a character, not a nonnegative
5100 fixnum, since the later code needs to stuff it into an int.
5101 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
5102 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
5103 conversion overflow issues.
5104 (Fopen_font): Check for integer out of range.
5105 (Ffont_get_glyphs): Don't assume index can fit in int.
5106 * font.h: Adjust decls to match defn changes elsewhere.
5107 * fontset.c (reorder_font_vector): Redo score calculation to avoid
5109 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
5110 printmax_t, where ptrdiff_t is wide enough.
5111 (Finternal_char_font):
5112 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5113 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
5114 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
5115 (Fset_frame_position, x_set_frame_parameters)
5116 (x_set_line_spacing, x_set_border_width)
5117 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
5118 Check that fixnums are in proper range for system types.
5119 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
5120 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5121 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
5122 Use SAFE_ALLOCA_LISP, not alloca.
5123 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
5124 intptr_t is wide enough.
5125 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
5126 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
5127 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
5128 Check for fixnum out of range.
5129 * ftfont.c (ftfont_list): Don't assume index fits in int.
5130 Check that fixnums are in proper range for system types.
5131 (ftfont_shape_by_flt):
5132 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5133 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
5134 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5135 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
5136 Check that fixnums are in proper range for system types.
5137 * gnutls.h: Adjust decls to match defn changes elsewhere.
5138 * gtkutil.c (xg_dialog_run):
5139 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5140 (update_frame_tool_bar):
5141 Check that fixnums are in proper range for system types.
5142 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5143 (lookup_image): Check that fixnums are in range for system types.
5144 * indent.c (last_known_column, last_known_column_point):
5145 (current_column_bol_cache):
5146 (skip_invisible, current_column, check_display_width):
5147 (check_display_width, scan_for_column, current_column_1)
5148 (Findent_to, Fcurrent_indentation, position_indentation)
5149 (indented_beyond_p, Fmove_to_column, compute_motion):
5150 (Fcompute_motion, Fvertical_motion):
5151 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5152 (last_known_column_modified): Use EMACS_INT, not int.
5153 (check_display_width):
5155 Check that fixnums and floats are in proper range for system types.
5156 (compute_motion): Don't assume index or fixnum fits in int.
5157 (compute_motion, Fcompute_motion):
5158 Use int, not EMACS_INT, when it is wide enough.
5159 (vmotion): Omit local var start_hpos that is always 0; that way
5160 we don't need to worry about overflow in expressions involving it.
5161 * indent.h: Adjust decls to match defn changes elsewhere.
5163 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5164 Use int, not EMACS_INT, where int is wide enough.
5165 Remove unused members ovstring_chars_done and tab_offset;
5167 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
5168 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
5169 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
5170 (make_gap, copy_text, insert, insert_and_inherit)
5171 (insert_before_markers, insert_before_markers_and_inherit)
5172 (insert_1, count_combining_before, count_combining_after)
5173 (insert_1_both, insert_from_string)
5174 (insert_from_string_before_markers, insert_from_string_1)
5175 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
5176 (adjust_after_replace, adjust_after_insert, replace_range)
5177 (replace_range_2, del_range, del_range_1, del_range_byte)
5178 (del_range_both, del_range_2, modify_region)
5179 (prepare_to_modify_buffer, signal_before_change)
5180 (signal_after_change, Fcombine_after_change_execute):
5181 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5182 * intervals.c (traverse_intervals, rotate_right, rotate_left)
5183 (balance_an_interval, split_interval_right, split_interval_left)
5184 (find_interval, next_interval, update_interval)
5185 (adjust_intervals_for_insertion, delete_node, delete_interval)
5186 (interval_deletion_adjustment, adjust_intervals_for_deletion)
5187 (static_offset_intervals, offset_intervals)
5188 (merge_interval_right, merge_interval_left, make_new_interval)
5189 (graft_intervals_into_buffer, temp_set_point_both)
5190 (temp_set_point, set_point, adjust_for_invis_intang)
5191 (set_point_both, move_if_not_intangible, get_property_and_range)
5192 (get_local_map, copy_intervals, copy_intervals_to_string)
5193 (compare_string_intervals, set_intervals_multibyte_1):
5194 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5195 * intervals.h: Adjust decls to match defn changes elsewhere.
5197 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5198 * keyboard.c (this_command_key_count, this_single_command_key_start)
5199 (before_command_key_count, before_command_echo_length, echo_now)
5200 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
5201 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
5202 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
5203 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
5204 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5205 (last_non_minibuf_size, last_point_position, echo_truncate)
5206 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
5207 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
5208 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
5209 (stuff_buffered_input):
5210 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5211 (last_auto_save, command_loop_1, read_char):
5212 Use EMACS_INT, not int, to avoid integer overflow.
5213 (record_char): Avoid overflow in total_keys computation.
5214 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
5215 * keyboard.h: Adjust decls to match defn changes elsewhere.
5216 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
5217 (Fkey_description, Fdescribe_vector, Flookup_key):
5218 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5219 (click_position): New function, to check that positions are in range.
5220 (Fcurrent_active_maps):
5222 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5223 (Faccessible_keymaps, Fkey_description):
5224 (preferred_sequence_p):
5225 Don't assume fixnum can fit into int.
5226 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
5227 Check for integer overflow in size calculations.
5228 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
5229 avoid mishandling large integers.
5230 * lisp.h: Adjust decls to match defn changes elsewhere.
5231 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
5232 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
5233 (struct Lisp_Marker):
5234 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5235 (clip_to_bounds): Now an inline function, moved here from editfns.c.
5236 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
5237 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
5238 All callers changed.
5239 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
5240 Assume the arg has valid form, since it always does.
5241 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
5242 unsigned integer system type.
5243 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
5244 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
5245 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5246 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
5247 (duration_to_sec_usec): New decl.
5248 * lread.c (read_from_string_index, read_from_string_index_byte)
5249 (read_from_string_limit, readchar, unreadchar, openp)
5250 (read_internal_start, read1, oblookup):
5251 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5252 (Fload, readevalloop, Feval_buffer, Feval_region):
5253 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5254 (openp): Check for out-of-range argument to 'access'.
5255 (read1): Use int, not EMACS_INT, where int is wide enough.
5256 Don't assume fixnum fits into int.
5257 Fix off-by-one error that can read outside a buffer.
5258 (read_filtered_event): Use duration_to_sec_usec
5259 to do proper overflow checking on durations.
5260 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
5261 in size calculation.
5262 (Fexecute_kbd_macro):
5263 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5264 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
5265 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
5266 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
5267 (set_marker_both, set_marker_restricted_both, marker_position)
5268 (marker_byte_position, Fbuffer_has_markers_at):
5269 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5270 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
5271 * menu.c (ensure_menu_items): Rename from grow_menu_items.
5272 It now merely ensures that the menu is large enough, without
5273 necessarily growing it, as this avoids some integer overflow issues.
5274 All callers changed.
5275 (keymap_panes, parse_single_submenu, Fx_popup_menu):
5276 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5277 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
5278 Use SAFE_ALLOCA_LISP, not alloca.
5279 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
5280 to EMACS_INT. Check that fixnums are in proper range for system types.
5281 * minibuf.c (minibuf_prompt_width, string_to_object)
5282 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
5283 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
5284 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5285 (get_minibuffer, read_minibuf_unwind):
5286 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5287 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
5288 this simplifies overflow checking. All callers changed.
5289 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
5291 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5292 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
5293 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
5294 Check that fixnums are in proper range for system types.
5295 (Fx_create_frame, Fx_show_tip):
5296 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5297 * nsfont.m (ns_findfonts, nsfont_list_family):
5298 Don't assume fixnum fits in long.
5299 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
5300 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5301 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
5303 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
5304 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5305 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
5306 (PRINTDECLARE, PRINTPREPARE):
5307 (strout, print_string):
5308 (print, print_preprocess, print_check_string_charset_prop)
5310 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5312 (temp_output_buffer_setup, Fprin1_to_string, print_object):
5313 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5314 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
5315 (printchar, strout): Use xpalloc to catch size calculation overflow.
5316 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
5317 (print_error_message): Use SAFE_ALLOCA, not alloca.
5318 (print_object): Use int, not EMACS_INT, where int is wide enough.
5319 (print_depth, new_backquote_output, print_number_index):
5320 Use ptrdiff_t, not int, where int might not be wide enough.
5321 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
5322 (Fset_process_window_size, Fformat_network_address)
5323 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
5325 Check that fixnums are in proper range for system types.
5326 (Fsignal_process): Simplify by avoiding a goto.
5327 Check for process-ids out of pid_t range rather than relying on
5329 (process_tick, update_tick): Use EMACS_INT, not int.
5330 (Fformat_network_address, read_process_output, send_process)
5331 (Fprocess_send_region, status_notify):
5332 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5333 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
5334 (wait_reading_process_output, read_process_output, exec_sentinel):
5335 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5336 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
5337 (Faccept_process_output): Use duration_to_sec_usec to do proper
5338 overflow checking on durations.
5339 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
5340 Don't assume pid_t fits in int.
5341 * process.h (struct Lisp_Process): Members tick and update_tick
5342 are now of type EMACS_INT, not int.
5343 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
5344 configured --with-wide-int.
5345 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
5346 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
5347 * search.c (looking_at_1, string_match_1):
5348 (fast_string_match, fast_c_string_match_ignore_case)
5349 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
5350 (scan_newline, find_before_next_newline, search_command)
5351 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
5352 (set_search_regs, wordify):
5355 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5356 (string_match_1, search_buffer, set_search_regs):
5358 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5359 (wordify): Check for overflow in size calculation.
5360 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
5361 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
5362 Check that fixnums are in proper range for system types.
5363 * sound.c (struct sound_device)
5364 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
5365 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5366 (Fplay_sound_internal):
5367 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5368 * syntax.c (struct lisp_parse_state, find_start_modiff)
5369 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
5370 (Fparse_partial_sexp):
5371 Don't assume fixnums can fit in int.
5372 (struct lisp_parse_state, find_start_pos, find_start_value)
5373 (find_start_value_byte, find_start_begv)
5374 (update_syntax_table, char_quoted, dec_bytepos)
5375 (find_defun_start, prev_char_comend_first, back_comment):
5376 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
5377 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
5378 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5379 (Finternal_describe_syntax_value): Check that match_lisp is a
5380 character, not an integer, since the code stuffs it into int.
5381 (scan_words, scan_sexps_forward):
5382 Check that fixnums are in proper range for system types.
5384 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5385 (scan_sexps_forward):
5386 Use CHARACTERP, not INTEGERP, since the value must fit into int.
5387 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
5388 * syntax.h: Adjust decls to match defn changes elsewhere.
5389 (struct gl_state_s):
5390 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5391 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
5392 MOST_POSITIVE_FIXNUM.
5393 * sysdep.c (wait_for_termination_1, wait_for_termination)
5394 (interruptible_wait_for_termination, mkdir):
5395 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
5396 (emacs_read, emacs_write):
5397 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5398 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
5399 and double all fit in int.
5400 * term.c (set_tty_color_mode):
5401 Check that fixnums are in proper range for system types.
5402 * termhooks.h (struct input_event):
5403 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5404 * textprop.c (validate_interval_range, interval_of)
5405 (Fadd_text_properties, set_text_properties_1)
5406 (Fremove_text_properties, Fremove_list_of_text_properties)
5407 (Ftext_property_any, Ftext_property_not_all)
5408 (copy_text_properties, text_property_list, extend_property_ranges)
5409 (verify_interval_modification):
5410 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5411 (Fnext_single_char_property_change)
5412 (Fprevious_single_char_property_change):
5413 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5414 (copy_text_properties):
5415 Check for integer overflow in index calculation.
5416 * undo.c (last_boundary_position, record_point, record_insert)
5417 (record_delete, record_marker_adjustment, record_change)
5418 (record_property_change):
5419 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5420 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
5421 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5422 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
5423 (Fx_hide_tip, Fx_file_dialog):
5424 * w32menu.c (set_frame_menubar):
5425 Use ptrdiff_t, not int, for consistency with rest of code.
5426 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
5427 (select_window, Fdelete_other_windows_internal)
5428 (window_scroll_pixel_based, window_scroll_line_based)
5429 (Frecenter, Fset_window_configuration):
5430 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5431 (Fset_window_hscroll, run_window_configuration_change_hook)
5432 (set_window_buffer, temp_output_buffer_show, scroll_command)
5433 (Fscroll_other_window, Frecenter):
5434 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5435 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
5436 Don't assume fixnum fits in int.
5437 (Fset_window_scroll_bars):
5438 Check that fixnums are in proper range for system types.
5439 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
5440 (string_pos, c_string_pos, number_of_chars, init_iterator)
5441 (in_ellipses_for_invisible_text_p, init_from_display_pos)
5442 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
5443 (compute_display_string_end, handle_face_prop)
5444 (face_before_or_after_it_pos, handle_invisible_prop)
5445 (handle_display_prop, handle_display_spec, handle_single_display_spec)
5446 (display_prop_intangible_p, string_buffer_position_lim)
5447 (string_buffer_position, handle_composition_prop, load_overlay_strings)
5448 (get_overlay_strings_1, get_overlay_strings)
5449 (iterate_out_of_display_property, forward_to_next_line_start)
5450 (back_to_previous_visible_line_start, reseat, reseat_to_string)
5451 (get_next_display_element, set_iterator_to_next)
5452 (get_visually_first_element, compute_stop_pos_backwards)
5453 (handle_stop_backwards, next_element_from_buffer)
5454 (move_it_in_display_line_to, move_it_in_display_line)
5455 (move_it_to, move_it_vertically_backward, move_it_by_lines)
5456 (add_to_log, message_dolog, message_log_check_duplicate)
5457 (message2, message2_nolog, message3, message3_nolog
5458 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
5459 (current_message_1, truncate_echo_area, truncate_message_1)
5460 (set_message, set_message_1, store_mode_line_noprop)
5461 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
5462 (text_outside_line_unchanged_p, check_point_in_composition)
5463 (reconsider_clip_changes)
5464 (redisplay_internal, set_cursor_from_row, try_scrolling)
5465 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
5466 (redisplay_window, find_last_unchanged_at_beg_row)
5467 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
5468 (trailing_whitespace_p, find_row_edges, display_line)
5469 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
5470 (display_mode_element, store_mode_line_string)
5471 (pint2str, pint2hrstr, decode_mode_spec)
5472 (display_count_lines, display_string, draw_glyphs)
5473 (x_produce_glyphs, x_insert_glyphs)
5474 (rows_from_pos_range, mouse_face_from_buffer_pos)
5475 (fast_find_string_pos, mouse_face_from_string_pos)
5476 (note_mode_line_or_margin_highlight, note_mouse_highlight):
5477 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5478 (safe_call, init_from_display_pos, handle_fontified_prop)
5479 (handle_single_display_spec, load_overlay_strings)
5480 (with_echo_area_buffer, setup_echo_area_for_printing)
5481 (display_echo_area, echo_area_display)
5482 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
5483 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5484 (redisplay_window, dump_glyph_row, display_mode_line)
5485 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
5486 (handle_display_spec, display_prop_string_p):
5487 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5488 (handle_single_display_spec, build_desired_tool_bar_string)
5489 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
5490 (get_specified_cursor_type):
5491 Check that fixnums are in proper range for system types.
5492 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
5493 (Flookup_image_map):
5494 Don't assume fixnums fit in int.
5495 (compare_overlay_entries):
5496 Avoid mishandling comparisons due to subtraction overflow.
5497 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
5498 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
5499 (handle_tool_bar_click):
5500 Use int, not unsigned, since we prefer signed and the signedness
5501 doesn't matter here.
5502 (get_next_display_element, next_element_from_display_vector):
5503 Use int, not EMACS_INT, when int is wide enough.
5504 (start_hourglass): Use duration_to_sec_usec to do proper
5505 overflow checking on durations.
5506 * xfaces.c (Fbitmap_spec_p):
5507 Check that fixnums are in proper range for system types.
5508 (compare_fonts_by_sort_order):
5509 Avoid mishandling comparisons due to subtraction overflow.
5510 (Fx_family_fonts, realize_basic_faces):
5511 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5513 Don't assume fixnum fits in int.
5514 Use SAFE_ALLOCA_LISP, not alloca.
5515 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
5516 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
5517 (face_at_buffer_position, face_for_overlay_string)
5518 (face_at_string_position):
5519 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5520 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
5521 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
5523 Check that fixnums are in proper range for system types.
5524 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
5525 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
5526 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5527 (Fx_change_window_property): Don't assume fixnums fit in int.
5528 * xfont.c (xfont_chars_supported):
5529 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5530 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
5531 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
5532 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5533 * xml.c (parse_region):
5534 * xrdb.c (magic_file_p):
5535 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5536 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
5537 (x_get_local_selection, x_reply_selection_request)
5538 (x_handle_selection_request, wait_for_property_change):
5539 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5540 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
5541 short is wide enough.
5542 (x_send_client_event): Don't assume fixnum fits in int.
5543 * xterm.c (x_x_to_emacs_modifiers):
5544 Don't assume EMACS_INT overflows nicely into int.
5545 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
5547 (handle_one_xevent): NATNUMP can eval its arg twice.
5548 (x_connection_closed):
5549 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5550 * xterm.h: Adjust decls to match defn changes elsewhere.
5551 (struct scroll_bar): Use struct vectorlike_header
5552 rather than rolling our own approximation.
5553 (SCROLL_BAR_VEC_SIZE): Remove; not used.
5555 2012-05-25 Glenn Morris <rgm@gnu.org>
5557 * lisp.mk (lisp): Update for more files being compiled now.
5559 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
5561 * lread.c: Remove `read_pure' which makes no difference.
5562 (read_pure): Remove var.
5563 (unreadpure): Remove function.
5564 (readevalloop): Don't call read_list with -1 flag.
5565 (read1, read_vector): Don't test read_pure any more.
5566 (read_list): Simplify.
5568 * fileio.c, character.h: Minor style tweaks.
5570 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
5572 * window.h (clip_changed): Remove useless declaration.
5574 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
5576 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
5577 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
5579 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
5582 This directory predates autoconf and is no longer needed nowadays.
5583 Move its few remaining bits of functionality to where they're needed.
5584 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
5585 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
5586 * m/template.h: Remove.
5587 * Makefile.in (M_FILE): Remove. All uses removed.
5588 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
5589 * lisp.h (USE_LSB_TAG):
5590 * mem-limits.h (EXCEEDS_LISP_PTR):
5591 Use VAL_MAX, not VALBITS, in #if.
5592 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
5593 (EMACS_UINT): Define unconditionally now.
5594 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
5595 (BITS_PER_EMACS_INT): New constants, replacing
5596 what used to be in config.h, but not useful in #if.
5597 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
5598 define them any more.
5599 (VAL_MAX): New macro.
5601 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
5602 BITS_PER_EMACS_INT, in #if.
5603 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
5604 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
5605 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
5606 * s/ms-w32.h (DATA_START):
5607 Move here from removed file m/intel386.h.
5608 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
5609 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
5611 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
5613 Assume C89 or later.
5614 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
5615 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
5617 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
5618 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
5619 * textprop.c, tparam.c (NULL): Remove.
5620 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
5621 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
5622 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
5623 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
5624 * xterm.c (input_signal_count): Assume volatile works.
5626 2012-05-21 Ken Brown <kbrown@cornell.edu>
5628 * xgselect.c (xg_select): Fix first argument in call to 'select'
5631 2012-05-20 Ken Brown <kbrown@cornell.edu>
5633 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
5634 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
5636 2012-05-19 Ken Brown <kbrown@cornell.edu>
5638 * xfns.c (x_in_use): Remove `static' qualifier.
5639 * xterm.h (x_in_use): Declare.
5640 * xgselect.c: Include xterm.h.
5641 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
5642 and `display_arg' (bug#9754).
5644 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
5646 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
5648 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
5649 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
5651 2012-05-18 Eli Zaretskii <eliz@gnu.org>
5653 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
5655 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
5656 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
5658 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
5659 reference to image_cache->refcount.
5660 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
5662 2012-05-17 Juri Linkov <juri@jurta.org>
5664 * search.c (Fword_search_regexp, Fword_search_backward)
5665 (Fword_search_forward, Fword_search_backward_lax)
5666 (Fword_search_forward_lax): Move functions to isearch.el
5667 (bug#10145, bug#11381).
5669 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
5671 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
5673 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
5675 * lread.c (init_obarray): Declare Qt and Qnil as special.
5677 2012-05-14 Glenn Morris <rgm@gnu.org>
5679 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
5680 Put "libexec" before "bin", for the sake of init_callproc_1.
5682 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
5684 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
5686 * unexaix.c: Port to more-recent AIX compilers.
5687 (report_error, report_error_1, make_hdr, copy_sym)
5688 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
5689 Make arguments const char *, not char *, to avoid violations of C
5690 standard and to fix some AIX warnings reported by Gilles Pion.
5692 2012-05-14 Eli Zaretskii <eliz@gnu.org>
5694 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
5695 already have overlays loaded.
5696 (handle_single_display_spec): Before returning without displaying
5697 fringe bitmap, synchronize the bidi iterator with the main display
5698 iterator, by calling iterate_out_of_display_property.
5699 (iterate_out_of_display_property): Detect buffer iteration by
5700 testing that it->string is a Lisp string.
5701 (get_next_display_element): When the current object is exhausted,
5702 and there's something on it->stack, call set_iterator_to_next to
5703 proceed with what's on the stack, instead of returning zero.
5704 (set_iterator_to_next): If called at the end of a Lisp string,
5705 proceed to consider_string_end without incrementing string
5706 position. Don't increment display vector index past the end of
5707 the display vector. (Bug#11417)
5708 (pos_visible_p): Don't report a position visible when move_it_to
5709 stopped at the last line of window, which happens to be scanned
5710 backwards by the bidi iteration. (Bug#11464)
5712 2012-05-14 Eli Zaretskii <eliz@gnu.org>
5714 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
5715 and right-margin display specs even if the spec is invalid or we
5716 are on a TTY, and thus unable to display on the fringes.
5717 That's because the text with the property will not be displayed anyway,
5718 so we need to signal to the caller that this is a "replacing"
5719 display spec. This fixes display when the spec is invalid or we
5722 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
5724 * unexaix.c (make_hdr): Fix typo in prototype.
5725 This bug broke the build on AIX. Problem reported by Gilles Pion.
5727 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
5729 * keyboard.c (kbd_buffer_get_event): Read special events also in
5730 batch mode. (Bug#11415)
5732 2012-05-12 Glenn Morris <rgm@gnu.org>
5734 * ns.mk: Update for ns_appbindir no longer having trailing "/".
5736 2012-05-12 Eli Zaretskii <eliz@gnu.org>
5738 * lisp.mk (lisp): Add newcomment.elc.
5740 2012-05-12 Glenn Morris <rgm@gnu.org>
5742 * Makefile.in (MKDIR_P): New, set by configure.
5743 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
5745 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
5747 Remove unused function hourglass_started.
5748 * dispextern.h (hourglass_started):
5749 * w32fns.c (hourglass_started):
5750 * xdisp.c (hourglass_started): Remove.
5752 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
5754 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
5755 Update dependencies.
5757 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
5759 * xgselect.c (xg_select): Put maxfds+1 into a var.
5760 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
5762 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
5764 2012-05-10 Dave Abrahams <dave@boostpro.com>
5766 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
5767 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
5769 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
5771 * dbusbind.c (xd_registered_buses): New internal Lisp object.
5772 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
5773 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
5774 Initialize xd_registered_buses.
5776 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
5778 Untag more efficiently if USE_LSB_TAG.
5779 This is based on a proposal by YAMAMOTO Mitsuharu in
5780 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
5781 For an admittedly artificial (nth 8000 longlist) benchmark on
5782 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
5783 Emacs's overall text size by 1%.
5784 * lisp.h (XUNTAG): New macro.
5785 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
5786 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
5787 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
5788 * eval.c (Fautoload):
5789 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
5790 * frame.h (XFRAME): Use XUNTAG.
5792 Port recent dbusbind.c changes to 32-bit --with-wide-int.
5793 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
5794 Remove unportable assumptions about print widths of types like
5796 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
5797 intptr_t when converting between pointer and integer, to avoid GCC
5798 warnings about wrong width.
5800 2012-05-09 Eli Zaretskii <eliz@gnu.org>
5802 * w32proc.c (new_child): Force Windows to reserve only 64KB of
5803 stack for each reader_thread, instead of defaulting to 8MB
5804 determined by the linker. This avoids failures in creating
5805 subprocesses on Windows 7, see the discussion in this thread:
5806 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
5808 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
5810 Fix up display of the *Minibuf-0* buffer in the mini window.
5811 * keyboard.c (read_char): Don't clear the echo area if there's no
5813 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
5814 contents of *Minibuf-0*) if there's no message displayed in its stead.
5816 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
5818 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
5821 2012-05-06 Chong Yidong <cyd@gnu.org>
5823 * lisp.mk (lisp): Update.
5825 2012-05-05 Jim Meyering <meyering@redhat.com>
5827 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
5829 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
5831 * data.c (PUT_ERROR): New macro.
5832 (syms_of_data): Use it. Add new error type `user-error'.
5833 * undo.c (user_error): New function.
5834 (Fprimitive_undo): Use it.
5835 * print.c (print_error_message): Adjust print style for `user-error'.
5836 * keyboard.c (user_error): New function.
5837 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
5839 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
5841 Do not limit current-time-string to years 1000..9999.
5842 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
5843 (Fcurrent_time_string): Support any year that is supported by the
5844 underlying localtime representation. Don't use asctime, as it
5845 has undefined behavior for years outside the range -999..9999.
5847 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
5849 Fix race conditions involving setenv, gmtime, localtime, asctime.
5850 Without this fix, interrupts could mess up code that uses these
5851 nonreentrant functions, since setting TZ invalidates existing
5852 tm_zone or tzname values, and since most of these functions return
5853 pointers to static storage.
5854 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
5855 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
5856 Grow the critical sections to include not just invoking
5857 localtime/gmtime, but also accessing these functions' results
5858 including their tm_zone values if any, and any related TZ setting.
5859 (format_time_string): Last arg is now struct tm *, not struct tm **,
5860 so that the struct tm is saved in the critical section.
5861 All callers changed. Simplify allocation of initial buffer, partly
5862 motivated by the fact that memory allocation needs to be outside
5863 the critical section.
5865 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
5867 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
5868 with RESET_INTERVAL.
5870 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
5871 Remove duplicated buffer name initialization.
5873 2012-05-02 Jim Meyering <jim@meyering.net>
5875 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
5877 * xfns.c (x_window): Use xstrdup (Bug#11375).
5879 2012-05-02 Eli Zaretskii <eliz@gnu.org>
5881 * xdisp.c (pos_visible_p): If already at a newline from the
5882 display string before the 'while' loop, don't walk back the glyphs
5883 from it3.glyph_row. Solves assertion violation when the display
5884 string begins with a newline (egg.el). (Bug#11367)
5886 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
5888 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
5891 2012-05-01 Glenn Morris <rgm@gnu.org>
5893 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
5894 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
5895 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
5896 All were removed before 23.1.
5898 * dispnew.c: Remove HAVE_LIBNCURSES test;
5899 it is always true on relevant platforms.
5901 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
5902 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
5904 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
5906 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
5908 * .gdbinit (xpr): Remove checks for no longer existing misc types.
5909 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
5912 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
5914 Do not avoid creating empty evaporating overlays (Bug#9642).
5915 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
5916 That is, do not delete an evaporating overlay if it becomes
5917 empty after its bounds are adjusted to fit within its buffer.
5918 This fix caused other problems, and I'm reverting it until we get
5919 to the bottom of them.
5921 2012-04-27 Chong Yidong <cyd@gnu.org>
5923 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
5925 2012-04-27 Eli Zaretskii <eliz@gnu.org>
5927 * xdisp.c (pos_visible_p): If the window start position is beyond
5928 ZV, start the display from buffer beginning. Prevents assertion
5929 violation in init_iterator when the minibuffer window is scrolled
5932 * window.c (window_scroll_pixel_based): Likewise.
5934 2012-04-27 Chong Yidong <cyd@gnu.org>
5936 * keymap.c (where_is_internal): Doc fix (Bug#10872).
5938 2012-04-27 Glenn Morris <rgm@gnu.org>
5940 * fileio.c (Fcopy_file, Fset_file_selinux_context):
5941 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
5943 2012-04-27 Eli Zaretskii <eliz@gnu.org>
5945 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
5946 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
5948 2012-04-26 Eli Zaretskii <eliz@gnu.org>
5950 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
5951 display element, check also the underlying string or buffer
5952 character. (Bug#11341)
5954 * w32menu.c: Include w32heap.h.
5955 (add_menu_item): If the call to AppendMenuW (via
5956 unicode_append_menu) fails, disable Unicode menus only if we are
5957 running on Windows 9X/Me.
5959 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
5961 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
5962 (xgetint): Add missing shift for LSB tags.
5964 2012-04-24 Martin Rudalics <rudalics@gmx.at>
5966 * keyboard.c (read_char): Don't wipe echo area for select window
5967 events: These might get delayed via `mouse-autoselect-window'
5970 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
5972 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
5973 manipulation of :loaded-from data.
5975 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
5977 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
5978 now a cons (bug#11311).
5980 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
5982 Do not create empty overlays with the evaporate property (Bug#9642).
5983 * buffer.c (Fmove_overlay): Delete an evaporating overlay
5984 if it becomes empty after its bounds are adjusted to fit within
5985 its buffer. Without this fix, in a nonempty buffer (let ((o
5986 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
5987 yields an empty overlay that has the evaporate property, which is
5988 not supposed to happen.
5990 Fix minor GTK3 problems found by static checking.
5991 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
5992 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
5993 (struct _EmacsFixedClass, emacs_fixed_get_type):
5994 Move decls here from emacsgtkfixed.h, since they needn't be public.
5995 (emacs_fixed_get_type): Now static.
5996 (emacs_fixed_class_init): Omit unused local.
5997 (emacs_fixed_child_type): Remove; unused.
5998 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
5999 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6000 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
6001 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
6002 (EMACS_FIXED_GET_CLASS): Remove; unused.
6003 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
6005 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
6006 Problem reported by Juanma Barranquero for Windows -Wunused-function.
6008 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6010 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
6011 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
6012 (__malloc_size_t, __malloc_ptrdiff_t):
6013 Remove. All uses removed, replaced by the definiens if needed,
6014 since we can assume C89 or better now.
6015 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
6016 (protect_malloc_state, align, get_contiguous_space)
6017 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
6018 (malloc_atfork_handler_child, malloc_enable_thread)
6019 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
6020 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
6021 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
6022 (special_realloc, _realloc_internal_nolock, _realloc_internal)
6023 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
6024 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
6025 Define using prototypes, not old style.
6026 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
6027 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
6028 (align): Don't assume that signed integer overflow wraps around.
6029 Omit unused local var.
6030 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
6031 (_free_internal_nolock, memalign, mallochook, reallochook):
6032 Omit no-longer-needed casts.
6033 (valloc): Use getpagesize, not __getpagesize.
6034 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
6035 (struct hdr): The 'magic' member is now size_t, not unsigned long.
6037 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
6039 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
6041 Move functions from C to Lisp. Make non-blocking method calls
6042 the default. Implement further D-Bus standard interfaces.
6044 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
6045 (QCdbus_request_name_allow_replacement)
6046 (QCdbus_request_name_replace_existing)
6047 (QCdbus_request_name_do_not_queue)
6048 (QCdbus_request_name_reply_primary_owner)
6049 (QCdbus_request_name_reply_in_queue)
6050 (QCdbus_request_name_reply_exists)
6051 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
6052 (QCdbus_registered_serial, QCdbus_registered_method)
6053 (QCdbus_registered_signal): New Lisp objects.
6054 (XD_DEBUG_MESSAGE): Use sizeof.
6055 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
6056 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
6057 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
6058 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
6059 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
6060 (xd_signature, xd_append_arg): Allow float for integer types.
6061 (xd_get_connection_references): New function.
6062 (xd_get_connection_address): Rename from xd_initialize.
6063 Return cached address.
6064 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
6065 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
6067 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
6068 Return number of refcounts.
6069 (Fdbus_get_unique_name): Make stronger parameter check.
6070 (Fdbus_message_internal): New defun.
6071 (Fdbus_call_method, Fdbus_call_method_asynchronously)
6072 (Fdbus_method_return_internal, Fdbus_method_error_internal)
6073 (Fdbus_send_signal, Fdbus_register_service)
6074 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
6075 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
6076 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
6077 (Vdbus_compiled_version, Vdbus_runtime_version)
6078 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
6079 (Vdbus_message_type_method_return, Vdbus_message_type_error)
6080 (Vdbus_message_type_signal): New defvars.
6081 (Vdbus_registered_buses, Vdbus_registered_objects_table):
6084 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6086 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
6087 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
6088 Do not assume ptrdiff_t is the same width as 'int'.
6090 * alloc.c: Handle unusual debugging option combinations.
6091 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
6092 since the two debugging options are incompatible.
6093 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
6095 (mem_init, mem_insert, mem_insert_fixup):
6096 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
6097 (NEED_MEM_INSERT): Remove; no longer needed.
6099 2012-04-22 Leo Liu <sdl.web@gmail.com>
6101 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
6103 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6105 * sysdep.c [__FreeBSD__]: Minor cleanups.
6106 (list_system_processes, system_process_attributes) [__FreeBSD__]:
6107 Use Emacs indenting style more consistently. Avoid some casts.
6108 Use 'double' consistently rather than mixing 'float' and 'double'.
6110 2012-04-21 Eduard Wiebe <usenet@pusto.de>
6112 * sysdep.c (list_system_processes, system_process_attributes):
6113 Add implementation for FreeBSD (Bug#5243).
6115 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
6117 * lisp.mk (lisp): Update.
6119 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
6121 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
6122 It is never used otherwise.
6124 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
6126 * print.c (print_preprocess): Only check print_depth if print-circle
6128 (print_object): Check for cycles even when print-circle is nil and
6129 print-gensym is t, but only check print_depth if print-circle is nil.
6131 2012-04-20 Chong Yidong <cyd@gnu.org>
6133 * process.c (wait_reading_process_output): If EIO occurs on a pty,
6134 set the status to "failed" and ensure that sentinel is run.
6136 2012-04-20 Glenn Morris <rgm@gnu.org>
6138 * process.c (Fset_process_inherit_coding_system_flag)
6139 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
6140 (Fmake_network_process, Fmake_serial_process): Doc fix.
6142 2012-04-20 Eli Zaretskii <eliz@gnu.org>
6144 * xdisp.c (string_buffer_position_lim): Limit starting position to
6146 (set_cursor_from_row): If called for a mode-line or header-line
6147 row, return zero immediately.
6148 (try_cursor_movement): If inside continuation line, don't back up
6149 farther than the first row after the header line, if any.
6150 Don't consider the header-line row as "partially visible", even if
6151 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
6153 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
6155 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
6158 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6159 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
6161 configure: new option --enable-gcc-warnings (Bug#11207)
6162 * Makefile.in (C_WARNINGS_SWITCH): Remove.
6163 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
6164 (ALL_CFLAGS): Use new macros rather than old.
6165 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
6166 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
6167 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
6168 -Wunused-result, -Wunused-variable. This should go away once
6169 the Emacs and Gnulib regex code is merged.
6170 (xmalloc, xrealloc): Now static.
6172 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
6174 * dired.c (Fsystem_groups): Remove unused local.
6176 2012-04-17 Glenn Morris <rgm@gnu.org>
6178 * dired.c (Fsystem_users): Doc fix.
6180 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
6182 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
6183 (syms_of_dired): Add them.
6185 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
6187 Fix minor alloc.c problems found by static checking.
6188 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
6189 New extern decls, to avoid calling undeclared functions.
6190 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
6191 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
6192 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
6193 (NEED_MEM_INSERT): New macro.
6194 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
6195 Remove one incorrect comment and fix another.
6197 Fix minor ralloc.c problems found by static checking.
6198 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6199 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
6200 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
6201 (r_alloc_sbrk): Now static.
6203 Improve ralloc.c interface checking.
6204 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6205 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
6206 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
6207 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
6208 [REL_ALLOC]: ... to here, to check interface.
6209 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
6210 Remove decls. This fixes an "It stinks!".
6212 * alloc.c (which_symbols): Fix alignment issue / type clash.
6214 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
6216 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
6217 (struct Lisp_Misc_Any): Likewise.
6218 (struct Lisp_Free): Likewise.
6219 * alloc.c (union aligned_Lisp_Symbol): Define.
6220 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
6221 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
6222 (union aligned_Lisp_Misc): Define.
6223 (MARKER_BLOCK_SIZE, struct marker_block): Use union
6224 aligned_Lisp_Misc instead of union Lisp_Misc.
6225 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
6227 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
6229 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
6230 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
6231 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
6232 * s/netbsd.h, s/sol2-6.h:
6233 Remove definition of GC_MARK_STACK, since the default now works.
6234 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
6235 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
6236 no longer the default.
6237 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
6239 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
6241 * lread.c (lisp_file_lexically_bound_p):
6242 Fix hang at ";-*-\n" (bug#11238).
6244 2012-04-14 Eli Zaretskii <eliz@gnu.org>
6246 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
6247 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
6249 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
6251 * nsterm.m (constrainFrameRect): Always constrain when there is only
6252 one screen (Bug#10962).
6254 2012-04-13 Ken Brown <kbrown@cornell.edu>
6256 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
6258 2012-04-13 Reuben Thomas <rrt@sc3d.org>
6260 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
6262 2012-04-11 Daniel Colascione <dancol@dancol.org>
6264 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
6265 against is gone. It's better to use vfork now so that when Cygwin
6266 gains a new, working vfork, we use it automatically (bug#10398).
6268 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
6270 * window.c (save_window_save): Obey window-point-insertion-type.
6272 2012-04-11 Glenn Morris <rgm@gnu.org>
6274 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
6276 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
6278 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
6280 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6282 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
6283 (force_quit_count): New var.
6284 (handle_interrupt): Use it.
6286 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
6288 * w32.c (w32_delayed_load): Record the full path of the library
6289 being loaded (bug#10424).
6291 2012-04-09 Glenn Morris <rgm@gnu.org>
6293 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
6294 not just in the obarray, before snarfing them. (Bug#11036)
6296 * Makefile.in ($(leimdir)/leim-list.el):
6297 Pass EMACS rather than BUILT_EMACS.
6299 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
6301 * process.c (make_process):
6302 * process.h: Add integer `gnutls_handshakes_tried' member to
6305 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
6306 Add convenience `GNUTLS_LOG2i' macro.
6308 * gnutls.c (gnutls_log_function2i): Convenience log function.
6309 (emacs_gnutls_read): Use new log functions,
6310 `gnutls_handshakes_tried' process member, and
6311 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
6312 attempts per process (connection).
6314 2012-04-09 Chong Yidong <cyd@gnu.org>
6316 * eval.c (Fuser_variable_p, user_variable_p_eh)
6317 (lisp_indirect_variable): Functions deleted.
6318 (Fdefvar): Caller changed.
6320 * callint.c (Finteractive, Fcall_interactively):
6321 * minibuf.c (Fread_variable): Callers changed.
6323 2012-04-09 Eli Zaretskii <eliz@gnu.org>
6325 * xdisp.c (set_cursor_from_row): If the display string appears in
6326 the buffer at position that is closer to point than the position
6327 after the display string, display the cursor on the first glyph of
6328 the display string. Fixes cursor display when a 'display' text
6329 property immediately follows invisible text. (Bug#11094)
6331 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
6333 composite.c: use 'double' consistently
6334 * composite.c (get_composition_id): Use 'double' consistently
6335 instead of converting 'float' to 'double' and vice versa; this is
6336 easier to understand and avoids a GCC warning.
6338 2012-04-09 Glenn Morris <rgm@gnu.org>
6340 * Makefile.in: Generate leim-list with bootstrap-emacs, in
6341 preparation for dumping it with emacs. (Bug#4789)
6342 (leimdir): New variable.
6343 ($(leimdir)/leim-list.el): New rule.
6344 (emacs$(EXEEXT)): Depend on leim-list.el.
6346 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
6347 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
6348 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
6350 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
6352 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
6355 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
6357 * xml.c (init_libxml2_functions) [WINDOWSNT]:
6358 Remove unused local variable.
6360 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
6362 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
6363 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
6364 (mark_memory): Mark Lisp_Objects only if pointers might hide in
6365 objects, as mark_maybe_pointer will catch them otherwise.
6366 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
6367 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
6369 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
6371 Fix typo that broke non-Windows builds.
6372 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
6374 2012-04-07 Eli Zaretskii <eliz@gnu.org>
6376 Support building on MS-Windows with libxml2.
6378 * makefile.w32-in (OBJ2): Add xml.$(O).
6379 (GLOBAL_SOURCES): Add xml.c.
6380 ($(BLD)/xml.$(O)): New dependency list.
6382 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
6383 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
6384 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
6385 [!WINDOWSNT]: New macros.
6386 (init_libxml2_functions, libxml2_loaded_p): New functions.
6387 (parse_region): Call fn_xmlCheckVersion instead of using the macro
6388 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
6389 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
6390 Calls xmlCleanupParser only if libxml2 was loaded (or statically
6392 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
6393 Call init_libxml2_functions before calling libxml2 functions.
6394 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
6396 * emacs.c: Don't include libxml/parser.h.
6397 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
6398 xmlCleanupParser directly.
6400 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
6402 2012-04-07 Eli Zaretskii <eliz@gnu.org>
6404 * indent.c (Fvertical_motion): If there is a display string at
6405 point, use it.vpos to compute how many lines to backtrack after
6406 move_it_to point. (Bug#11133)
6408 2012-04-06 Eli Zaretskii <eliz@gnu.org>
6410 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
6411 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
6412 about subtle differences between FETCH_CHAR* and STRING_CHAR*
6413 macros related to unification of CJK characters. For the details,
6414 see the discussion following the message here:
6415 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
6417 2012-04-04 Chong Yidong <cyd@gnu.org>
6419 * keyboard.c (Vdelayed_warnings_list): Doc fix.
6421 2012-04-01 Eli Zaretskii <eliz@gnu.org>
6423 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
6424 instead of alloca. (Bug#11138)
6426 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
6428 * w32menu.c (is_simple_dialog): Properly check lisp types.
6431 2012-03-31 Eli Zaretskii <eliz@gnu.org>
6433 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
6434 position we get to after a call to move_it_to fails the
6435 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
6436 only if we wind up in a string from display property. (Bug#11063)
6438 * window.c (Fdelete_other_windows_internal): Invalidate the row
6439 and column information about mouse highlight, so that redisplay
6440 restores it after reallocating the glyph matrices. (Bug#7464)
6442 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
6443 string comes from a `display' text property, use the buffer
6444 position of that property as if we actually saw that position in
6446 (move_it_by_lines): Remove the assertion that
6447 "it->current_x == 0 && it->hpos == 0" which can be legitimately
6448 violated when there's a before-string at the beginning of a line.
6451 2012-03-30 Eli Zaretskii <eliz@gnu.org>
6453 * xdisp.c (append_space_for_newline): If the default face was
6454 remapped, use the remapped face for the appended newline.
6455 (extend_face_to_end_of_line): Use the remapped default face for
6456 extending the face to the end of the line.
6457 (display_line): Call extend_face_to_end_of_line when the default
6458 face was remapped. (Bug#11068)
6460 2012-03-29 Eli Zaretskii <eliz@gnu.org>
6462 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
6464 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
6466 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
6468 2012-03-27 Glenn Morris <rgm@gnu.org>
6470 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
6473 2012-03-26 Kenichi Handa <handa@m17n.org>
6475 * dispextern.h (struct glyph): Fix previous change. Change the
6476 bit length of glyphless.ch to 25 (Bug#11082).
6478 2012-03-26 Chong Yidong <cyd@gnu.org>
6480 * keyboard.c (Vselection_inhibit_update_commands): New variable.
6481 (command_loop_1): Use it; inhibit selection update for
6482 handle-select-window too (Bug#8996).
6484 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
6486 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
6488 2012-03-25 Kenichi Handa <handa@m17n.org>
6490 * dispextern.h (struct glyph): Change the bit length of
6491 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
6493 2012-03-24 Eli Zaretskii <eliz@gnu.org>
6495 * s/ms-w32.h (tzname): Include time.h before redirecting to
6496 _tzname. Fixes the MSVC build. (Bug#9960)
6498 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
6500 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
6503 * xterm.c (XTread_socket): Only modify handling_signal if
6504 !SYNC_INPUT. (Bug#11080)
6506 2012-03-23 Eli Zaretskii <eliz@gnu.org>
6508 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
6509 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
6510 when fetching a multibyte character consumes more bytes than
6511 CHAR_BYTES returns, due to unification of CJK characters in
6512 string_char. (Bug#11073)
6514 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
6516 * process.c (wait_reading_process_output): Handle pty disconnect
6517 by refraining from sending oneself a SIGCHLD (bug#10933).
6519 2012-03-22 Chong Yidong <cyd@gnu.org>
6521 * dispextern.h (struct it): New member string_from_prefix_prop_p.
6523 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
6524 Mark string as coming from a prefix property.
6525 (handle_face_prop): Use default face for prefix strings (Bug#4281).
6526 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
6528 2012-03-21 Chong Yidong <cyd@gnu.org>
6530 * xfaces.c (Vface_remapping_alist): Doc fix.
6532 2012-03-20 Eli Zaretskii <eliz@gnu.org>
6534 * w32proc.c (Fw32_set_console_codepage)
6535 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
6538 2012-03-20 Chong Yidong <cyd@gnu.org>
6540 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
6541 to reflect default non-nil value of redisplay-dont-pause.
6543 2012-03-19 Kenichi Handa <handa@m17n.org>
6545 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
6546 it fit in a valid range (Bug#11003).
6548 2012-03-18 Eli Zaretskii <eliz@gnu.org>
6550 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
6551 that is not from display property, accept the row as a "cursor
6552 row" if one of the string's character has a non-nil `cursor'
6553 property. Fixes cursor positioning when there are newlines in
6554 overlay strings, e.g. in icomplete.el. (Bug#11035)
6556 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
6558 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
6560 2012-03-12 Chong Yidong <cyd@gnu.org>
6562 * eval.c (inhibit_lisp_code): Rename from
6563 inhibit_window_configuration_change_hook; move from window.c.
6565 * xfns.c (unwind_create_frame_1, Fx_create_frame):
6566 * window.c (run_window_configuration_change_hook)
6567 (syms_of_window): Callers changed.
6569 2012-03-11 Chong Yidong <cyd@gnu.org>
6571 * keymap.c (Fkey_description): Doc fix (Bug#9700).
6573 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
6575 2012-03-10 Chong Yidong <cyd@gnu.org>
6577 * frame.c (other_visible_frames): Don't assume the selected frame
6578 is visible (Bug#10955).
6580 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
6582 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
6584 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
6586 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
6587 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
6590 2012-03-03 Glenn Morris <rgm@gnu.org>
6592 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
6594 2012-03-02 Eli Zaretskii <eliz@gnu.org>
6596 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
6597 position past the first glyph_row that ends at ZV. (Bug#10902)
6598 (redisplay_window, next_element_from_string): Fix typos in
6600 (redisplay_window): Pass to move_it_vertically the margin in
6601 pixels, not in screen lines.
6603 2012-03-02 Glenn Morris <rgm@gnu.org>
6605 * buffer.c (buffer-list-update-hook): Doc fix.
6607 2012-02-29 Eli Zaretskii <eliz@gnu.org>
6609 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
6610 push_it before setting up the iterator for the first overlay
6611 string, even if we have an empty string loaded.
6612 (next_overlay_string): If there's an empty string on the iterator
6613 stack, pop the stack. (Bug#10903)
6615 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
6617 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
6618 Suggested by Stefan Monnier in
6619 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
6620 * alloc.c (widen_to_Lisp_Object): New static function.
6621 (mark_memory): Also mark Lisp_Objects by fetching pointer words
6622 and widening them to Lisp_Objects. This would work even if
6623 USE_LSB_TAG is defined and wide integers are used, which might
6624 happen in a future version of Emacs.
6626 2012-02-25 Chong Yidong <cyd@gnu.org>
6628 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
6631 * xselect.c (Fx_selection_exists_p): Doc fix.
6632 (x_clipboard_manager_save_all): Print an informative message
6633 before saving to clipboard manager.
6635 2012-02-24 Chong Yidong <cyd@gnu.org>
6637 * keyboard.c (process_special_events): Handle all X selection
6638 requests in kbd_buffer, not just the next one (Bug#8869).
6640 2012-02-23 Chong Yidong <cyd@gnu.org>
6642 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
6643 call when setting menu-bar-lines and tool-bar-lines parameters.
6644 (unwind_create_frame_1): New helper function.
6646 * window.c (inhibit_window_configuration_change_hook): New var.
6647 (run_window_configuration_change_hook): Obey it.
6648 (syms_of_window): Initialize it.
6650 2012-02-22 Chong Yidong <cyd@gnu.org>
6652 * xterm.c (x_draw_image_relief): Add missing type check for
6653 Vtool_bar_button_margin (Bug#10743).
6655 2012-02-21 Chong Yidong <cyd@gnu.org>
6657 * fileio.c (Vfile_name_handler_alist): Doc fix.
6659 * buffer.c (Fget_file_buffer): Protect against invalid file
6660 handler return value.
6662 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
6664 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
6665 when computing $valmask.
6667 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
6668 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
6669 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
6670 It's useless in that case, and it can cause problems on hosts
6671 that allocate halves of EMACS_INT values separately.
6672 Reported by Dan Horák. Diagnosed by Andreas Schwab in
6673 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
6674 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
6675 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
6676 it avoids undefined behavior on hosts where shifting right by more
6677 than the word width has undefined behavior.
6679 2012-02-19 Chong Yidong <cyd@gnu.org>
6681 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
6682 (Funhandled_file_name_directory, Ffile_name_as_directory)
6683 (Fdirectory_file_name, Fexpand_file_name)
6684 (Fsubstitute_in_file_name): Protect against invalid file handler
6685 return values (Bug#10845).
6687 2012-02-18 Eli Zaretskii <eliz@gnu.org>
6689 * .gdbinit (pitx): Fix incorrect references to fields of the
6692 2012-02-17 Chong Yidong <cyd@gnu.org>
6694 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
6696 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
6698 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
6699 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
6701 2012-02-15 Chong Yidong <cyd@gnu.org>
6703 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
6704 marked as special. Also, starting docstrings with * is obsolete.
6706 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
6708 * gnutls.c (emacs_gnutls_write): Fix last change.
6710 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
6712 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
6715 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
6717 * keymap.c (Fsingle_key_description): Handle char ranges.
6719 2012-02-12 Chong Yidong <cyd@gnu.org>
6721 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
6722 as that creates a dangerous corner case.
6724 * window.c (Fdelete_window_internal): Invalidate the mouse
6725 highlight (Bug#9904).
6727 2012-02-12 Glenn Morris <rgm@gnu.org>
6729 * xselect.c (Fx_own_selection_internal)
6730 (Fx_get_selection_internal, Fx_disown_selection_internal)
6731 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
6732 * nsselect.m (Fx_own_selection_internal)
6733 (Fx_disown_selection_internal, Fx_selection_exists_p)
6734 (Fx_selection_owner_p, Fx_get_selection_internal):
6735 Sync docs and argument specs with the xselect.c versions.
6737 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
6739 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
6741 2012-02-11 Eli Zaretskii <eliz@gnu.org>
6743 * w32select.c (Fx_selection_exists_p): Sync doc string and
6744 argument list with xselect.c. (Bug#10783)
6746 * w16select.c (Fx_selection_exists_p): Sync doc string and
6747 argument list with xselect.c. (Bug#10783)
6749 2012-02-10 Glenn Morris <rgm@gnu.org>
6751 * fns.c (Fsecure_hash): Doc fix.
6753 2012-02-09 Kenichi Handa <handa@m17n.org>
6755 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
6757 2012-02-07 Chong Yidong <cyd@gnu.org>
6759 * buffer.c (Fbuffer_local_variables)
6760 (buffer_lisp_local_variables): Handle unbound vars correctly;
6761 don't let Qunbound leak into Lisp.
6763 2012-02-07 Glenn Morris <rgm@gnu.org>
6765 * image.c (Fimagemagick_types): Doc fix.
6767 * image.c (imagemagick-render-type): Change it from a lisp object
6768 to an integer. Move the doc here from the lisp manual.
6769 Treat all values not equal to 0 the same.
6771 2012-02-06 Chong Yidong <cyd@gnu.org>
6773 * doc.c (store_function_docstring): Avoid applying docstring of
6774 alias to base function (Bug#2603).
6776 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
6778 * .gdbinit (pp1, pv1): Remove redundant defines.
6781 2012-02-04 Chong Yidong <cyd@gnu.org>
6783 * nsterm.m: Declare a global (Bug#10694).
6785 2012-02-04 Eli Zaretskii <eliz@gnu.org>
6787 * w32.c (get_emacs_configuration_options):
6788 Include --enable-checking, if specified, in the return value.
6790 2012-02-04 Martin Rudalics <rudalics@gmx.at>
6792 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
6793 after rounding frame sizes. (Bug#9723)
6795 2012-02-04 Eli Zaretskii <eliz@gnu.org>
6797 * keyboard.c (adjust_point_for_property): Don't position point
6798 before BEGV. (Bug#10696)
6800 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
6802 Handle overflow when computing char display width (Bug#9496).
6803 * character.c (char_width): Return EMACS_INT, not int.
6804 (char_width, c_string_width): Check for overflow when
6805 computing the width; this is possible now that individual
6806 characters can have unbounded width. Problem introduced
6807 by merge from Emacs 23 on 2012-01-19.
6809 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
6811 * dbusbind.c (Fdbus_register_method): Mention the return value
6812 :ignore in the docstring.
6814 2012-02-02 Glenn Morris <rgm@gnu.org>
6816 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
6818 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
6819 Unconditionally set to t. (Bug#10673)
6820 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
6821 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
6822 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
6824 2012-02-02 Kenichi Handa <handa@m17n.org>
6826 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
6827 0, do not call append_composite_glyph.
6829 2012-02-02 Kenichi Handa <handa@m17n.org>
6831 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
6833 (x_produce_glyphs): If the component of a composition is a null
6834 string, set it->pixel_width to 1 to avoid zero-width glyph.
6836 2012-02-01 Eli Zaretskii <eliz@gnu.org>
6838 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
6839 first 2 arguments are identical. This makes inserting large
6840 output from a subprocess an order of magnitude faster on
6841 MS-Windows, where all sbrk'ed memory is always contiguous.
6843 2012-01-31 Glenn Morris <rgm@gnu.org>
6845 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
6846 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
6847 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
6849 2012-01-29 Glenn Morris <rgm@gnu.org>
6851 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
6853 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
6855 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
6857 2012-01-28 Chong Yidong <cyd@gnu.org>
6859 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
6861 2012-01-26 Chong Yidong <cyd@gnu.org>
6863 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
6865 * search.c (Fsearch_forward, Fsearch_backward): Document negative
6866 repeat counts (Bug#10507).
6868 2012-01-26 Glenn Morris <rgm@gnu.org>
6870 * lread.c (syms_of_lread): Doc fix.
6872 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
6874 * coding.c (encode_designation_at_bol): Change return value to
6877 2012-01-25 Chong Yidong <cyd@gnu.org>
6879 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
6881 2012-01-21 Chong Yidong <cyd@gnu.org>
6883 * floatfns.c (Fcopysign): Make the second argument non-optional,
6884 since nil is not allowed anyway.
6886 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
6888 * process.c (read_process_output): Use p instead of XPROCESS (proc).
6889 (send_process): Likewise.
6891 2012-01-19 Martin Rudalics <rudalics@gmx.at>
6893 * window.c (save_window_save, Fcurrent_window_configuration)
6894 (Vwindow_persistent_parameters): Do not use Qstate.
6895 Rewrite doc-strings.
6897 2012-01-19 Kenichi Handa <handa@m17n.org>
6899 * character.c (char_width): New function.
6900 (Fchar_width, c_string_width, lisp_string_width):
6901 Use char_width (Bug#9496).
6903 2012-01-16 Martin Rudalics <rudalics@gmx.at>
6905 * window.c (Vwindow_persistent_parameters): New variable.
6906 (Fset_window_configuration, save_window_save): Handle persistent
6909 2012-01-14 Eli Zaretskii <eliz@gnu.org>
6911 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
6912 thrashing the stack of the thread. (Bug#9087)
6914 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
6916 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
6918 2012-01-11 Eli Zaretskii <eliz@gnu.org>
6920 * xdisp.c (rows_from_pos_range): Handle the case where the
6921 highlight ends on a newline. (Bug#10464)
6922 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
6923 he end column for display of highlight that ends on a newline
6926 2012-01-11 Glenn Morris <rgm@gnu.org>
6928 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
6929 from load-path also when installation-directory is nil. (Bug#10208)
6931 2012-01-10 Glenn Morris <rgm@gnu.org>
6933 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
6935 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
6936 Update template values to be closer to their typical values these days.
6938 2012-01-09 Eli Zaretskii <eliz@gnu.org>
6940 * xdisp.c (rows_from_pos_range): Accept additional argument
6941 DISP_STRING, and accept any glyph in a row whose object is that
6942 string as eligible for mouse highlight. Fixes mouse highlight of
6943 display strings from overlays. (Bug#10464)
6945 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
6947 emacs: fix an auto-save permissions race condition (Bug#10400)
6948 * fileio.c (auto_saving_dir_umask): New static var.
6949 (Fmake_directory_internal): Use it.
6950 (do_auto_save_make_dir): Set it, instead of invoking chmod after
6951 creating the directory. The old code temporarily assigns
6952 too-generous permissions to the directory.
6953 (do_auto_save_eh): Clear it.
6954 (Fdo_auto_save): Catch all errors, not just file errors, so
6955 that the var is always cleared.
6957 2012-01-07 Eli Zaretskii <eliz@gnu.org>
6959 * search.c (scan_buffer): Pass character positions to
6960 know_region_cache, not byte positions. (Bug#6540)
6962 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
6964 * w32.c (sys_rename): Report EXDEV when rename of a directory
6965 fails because the target is on another logical disk. (Bug#10284)
6967 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
6969 * xterm.c (x_embed_request_focus): New function.
6971 * xterm.h: Add prototype.
6973 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
6975 2012-01-05 Glenn Morris <rgm@gnu.org>
6977 * emacs.c (emacs_copyright): Update short copyright year to 2012.
6979 2012-01-01 Eli Zaretskii <eliz@gnu.org>
6981 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
6982 Load gnutls_transport_set_lowat only if GnuTLS version is below
6984 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
6985 GnuTLS versions below 2.11.1.
6987 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
6989 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
6990 to the doc string advising against its use for altering the way
6991 windows are scrolled.
6993 2011-12-28 Kenichi Handa <handa@m17n.org>
6995 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
6996 coding-system ASCII compatible only when it does not produce BOM
6997 on encoding (Bug#10383).
6999 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
7001 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
7003 (create_and_show_popup_menu): Always use menu_position_func for
7006 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
7008 * callint.c (Fcall_interactively): Don't truncate prompt string.
7010 2011-12-23 Eli Zaretskii <eliz@gnu.org>
7012 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
7013 property that ends at ZV, so that the bidi iteration could be
7014 resumed from there (after widening). (Bug#10360)
7016 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
7018 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
7020 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
7022 * nsterm.m (x_free_frame_resources):
7023 Release f->output_data.ns->miniimage.
7024 (ns_index_color): Fix indentation. Do not retain
7025 color_table->colors[i].
7027 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
7030 * nsfns.m (x_set_background_color): Assign return value from
7031 ns_index_color to face-background instead of NSColor*.
7032 (ns_implicitly_set_icon_type): Fix indentation.
7033 Change assignment in for loop to comparison.
7035 * emacs.c (ns_pool): New variable.
7036 (main): Assign ns_pool.
7037 (Fkill_emacs): Call ns_release_autorelease_pool.
7039 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
7040 autorelease fdesc, release fdAttrs and tdict.
7041 (ns_get_covering_families): Release charset.
7042 (ns_findfonts): Release NSFontDescriptor created with new.
7043 (ns_uni_to_glyphs): Fix indentation.
7044 (setString): Release attrStr before assigning new value.
7046 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
7048 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
7050 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
7051 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
7053 2011-12-18 David Reitter <reitter@cmu.edu>
7055 * nsterm.m (ns_term_init): Subscribe for notifications
7056 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
7057 to method trackingNotification in EmacsMenu.
7059 * nsmenu.m (trackingMenu): New variable.
7060 (trackingNotification): New method (from Aquamacs).
7061 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
7062 from Aquamacs (Bug#7030).
7064 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
7066 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
7067 (symbol_to_nsstring): Fix indentation.
7068 (ns_symbol_to_pb): New function.
7069 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
7070 (Fns_rotate_cut_buffers_internal): Remove.
7071 (Fns_store_selection_internal): Rename from
7072 Fns_store_cut_buffer_internal.
7073 (ns_get_foreign_selection, Fx_own_selection_internal)
7074 (Fx_disown_selection_internal, Fx_selection_exists_p)
7075 (Fns_get_selection_internal, Fns_store_selection_internal):
7076 Use ns_symbol_to_pb and check if return value is nil.
7077 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
7078 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
7079 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
7080 renamed to Sns_store_selection_internal.
7081 (ns_handle_selection_request): Move code to Fx_own_selection_internal
7082 and remove this function.
7083 (ns_handle_selection_clear): Remove, never used.
7084 (Fx_own_selection_internal): Move code from ns_handle_selection_request
7087 2011-12-17 Ken Brown <kbrown@cornell.edu>
7089 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
7090 GID is unknown (Bug#10257).
7092 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
7094 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
7095 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
7096 which caused a build failure on GNU/Linux IA-64. This problem was
7097 introduced by my 2011-10-07 patch.
7099 2011-12-15 Juri Linkov <juri@jurta.org>
7101 * image.c (imagemagick_error): New function. (Bug#10112)
7102 (imagemagick_load_image): Comment out `MagickSetResolution' call.
7103 Use `imagemagick_error' where ImageMagick functions return
7105 (Fimagemagick_types): Add `Fnreverse' to return the list in the
7108 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7110 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
7111 fill background (Bug#8992).
7113 2011-12-13 Martin Rudalics <rudalics@gmx.at>
7115 * window.c (Vwindow_combination_resize)
7116 (Vwindow_combination_limit): Use t instead of non-nil in
7118 (Vrecenter_redisplay): Add first sentence of doc-string on
7120 (Frecenter): Fix doc-string typo.
7122 2011-12-11 Kenichi Handa <handa@m17n.org>
7124 * coding.c (Funencodable_char_position): Pay attention to the
7125 buffer text relocation (Bug#9389).
7127 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
7129 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
7130 gtk_init (Bug#10100).
7132 2011-12-10 Eli Zaretskii <eliz@gnu.org>
7134 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
7135 IT->string is nil. (Bug#10263)
7137 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
7139 * nsterm.h (x_free_frame_resources): Declare.
7141 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
7142 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
7144 * nsterm.h (ns_get_defaults_value): Declare.
7146 * nsterm.m (ns_default): Call ns_get_defaults_value.
7148 2011-12-09 Eli Zaretskii <eliz@gnu.org>
7150 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
7153 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7155 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
7156 that where the value of an _OBJC_* symbol points to is in the .bss
7157 section (Bug#10240).
7159 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
7161 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
7162 after the loop to call ccl_driver at least once (Bug#8619).
7164 2011-12-08 Kenichi Handa <handa@m17n.org>
7166 * ftfont.c (get_adstyle_property): Fix previous change
7169 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
7171 * w32.c (init_environment): If no_site_lisp, remove site-lisp
7172 dirs from the default value of EMACSLOADPATH (bug#10208).
7174 2011-12-07 Glenn Morris <rgm@gnu.org>
7176 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
7177 installation and source directories as well. (Bug#10208)
7179 2011-12-06 Chong Yidong <cyd@gnu.org>
7181 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
7183 2011-12-06 Glenn Morris <rgm@gnu.org>
7185 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
7186 as an error, not just -1. (Bug#10217)
7188 2011-12-05 Chong Yidong <cyd@gnu.org>
7190 * keyboard.c (process_special_events): New function.
7191 (swallow_events, Finput_pending_p): Use it (Bug#10195).
7193 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
7195 * coding.c (encode_designation_at_bol): Don't use uninitialized
7196 local variable (Bug#9318).
7198 2011-12-05 Kenichi Handa <handa@m17n.org>
7200 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
7201 return Qnil (Bug#8046, Bug#10193).
7203 2011-12-05 Kenichi Handa <handa@m17n.org>
7205 * coding.c (encode_designation_at_bol): New args charbuf_end and
7206 dst. Return the number of produced bytes. Callers changed.
7207 (coding_set_source): Return how many bytes coding->source was
7209 (coding_set_destination): Return how many bytes
7210 coding->destination was relocated.
7211 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
7212 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
7214 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
7216 * coding.c (CODING_CHAR_CHARSET_P): New macro.
7217 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
7220 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
7222 The following changes are to fix Bug#9318.
7224 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
7225 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
7226 (encode_coding_iso_2022, encode_coding_sjis)
7227 (encode_coding_big5, encode_coding_charset): Use the above macros.
7229 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
7231 * lisp.h (process_quit_flag): Fix external declaration.
7233 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
7235 Don't macro-inline non-performance-critical code.
7236 * eval.c (process_quit_flag): New function.
7237 * lisp.h (QUIT): Use it.
7239 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
7241 * nsfns.m (get_geometry_from_preferences): New function.
7242 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
7244 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
7246 * emacs.c (Qkill_emacs): Define.
7247 (syms_of_emacs): Initialize it.
7248 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
7249 Qquit_flag to `kill-emacs' instead.
7250 (quit_throw_to_read_char): Add parameter `from_signal'.
7251 All callers changed. Call Fkill_emacs if requested and safe.
7252 * lisp.h (QUIT): Call Fkill_emacs if requested.
7254 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
7256 * widget.c (update_wm_hints): Return if wmshell is null.
7257 (widget_update_wm_size_hints): New function.
7259 * widget.h (widget_update_wm_size_hints): Declare.
7261 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
7262 widget_update_wm_size_hints (Bug#10104).
7264 2011-12-03 Eli Zaretskii <eliz@gnu.org>
7266 * xdisp.c (handle_invisible_prop): If the invisible text ends just
7267 before a newline, prepare the bidi iterator for consuming the
7268 newline, and keep the current paragraph direction. (Bug#10183)
7269 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
7271 2011-12-02 Juri Linkov <juri@jurta.org>
7273 * search.c (Fword_search_regexp): New Lisp function created from
7274 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
7275 (Fword_search_backward, Fword_search_forward)
7276 (Fword_search_backward_lax, Fword_search_forward_lax):
7277 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
7278 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
7280 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
7282 * fileio.c (Finsert_file_contents): Move after-change-function call
7283 to before the "handled:" label, since all "goto handled" appear in
7284 cases where the *-change-functions have already been properly called
7287 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
7289 * keyboard.c (interrupt_signal): Don't call kill-emacs when
7290 waiting for input. (Bug#10169)
7292 2011-11-30 Eli Zaretskii <eliz@gnu.org>
7294 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
7295 verifies glyph row's hash code--we have just reallocated the
7296 glyphs, so their contents can be complete garbage. (Bug#10164)
7298 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
7300 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
7302 2011-11-30 Eli Zaretskii <eliz@gnu.org>
7304 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
7305 attributes are tested _before_ calling verify_row_hash, to protect
7306 against GCC re-ordering of the tests. (Bug#10164)
7308 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
7310 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
7312 * xterm.c (handle_one_xevent): Only set async_visible and friends
7313 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7314 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
7315 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
7317 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
7319 Remove GCPRO-related macros that exist only to avoid shadowing locals.
7320 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
7321 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
7322 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
7323 All uses changed to use GCPRO1 etc.
7324 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
7325 Revert to old implementation (i.e., before 2011-03-11).
7327 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7329 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
7330 of scroll runs so as to avoid assigning disabled bogus rows and
7331 unnecessary graphics copy operations.
7333 2011-11-27 Eli Zaretskii <eliz@gnu.org>
7335 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
7336 (snprintf) [_MSC_VER]: Redirect to _snprintf.
7337 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
7338 (malloc, free, realloc, calloc): Redirect to e_* only when
7341 * lisp.h (GCTYPEBITS): Move before first use.
7342 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
7343 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
7344 this macro definition.
7346 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
7349 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
7351 * gtkutil.c (xg_create_frame_widgets):
7352 Call gtk_window_set_has_resize_grip (FALSE) if that function is
7353 present with Gtk+ 2.0.
7355 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
7357 * fileio.c (Finsert_file_contents): Undo previous change; see
7358 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
7360 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
7362 Rename locals to avoid shadowing.
7363 * fileio.c (Finsert_file_contents):
7364 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
7365 * process.c (wait_reading_process_output):
7366 Rename inner 'proc' to 'p' to avoid shadowing.
7367 Indent for consistency with usual Emacs style.
7369 2011-11-25 Eli Zaretskii <eliz@gnu.org>
7371 * xdisp.c (redisplay_window): If cursor row is not fully visible
7372 after recentering, and scroll-conservatively is set to a large
7373 number, scroll window by a few more lines to make the cursor fully
7374 visible and out of scroll-margin. (Bug#10105)
7375 (start_display): Don't move to the next line if the display should
7376 start at a newline that is part of a display vector or an overlay
7379 2011-11-24 Juri Linkov <juri@jurta.org>
7381 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
7382 after the `MagickPingImage' call. (Bug#10112)
7384 2011-11-23 Chong Yidong <cyd@gnu.org>
7386 * window.c (Fcoordinates_in_window_p): Accept only live windows.
7388 2011-11-23 Martin Rudalics <rudalics@gmx.at>
7390 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
7391 making another buffer current. (Bug#10114)
7393 2011-11-23 Glenn Morris <rgm@gnu.org>
7395 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
7397 2011-11-23 Chong Yidong <cyd@gnu.org>
7399 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
7400 using it (Bug#5984).
7402 2011-11-22 Eli Zaretskii <eliz@gnu.org>
7404 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
7405 and header-lines, as they don't have one computed for them.
7408 * .gdbinit (prow): Make displayed values more self-explaining.
7409 Add row's hash code.
7411 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
7413 * process.c (wait_reading_process_output): Fix asynchrounous
7414 GnuTLS socket handling on some versions of the GnuTLS library.
7415 (wait_reading_process_output): Add comment and URL.
7417 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
7419 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
7421 2011-11-21 Chong Yidong <cyd@gnu.org>
7423 * window.c (Fnext_window, Fprevious_window): Doc fix.
7425 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
7427 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
7429 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
7431 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
7433 2011-11-20 Martin Rudalics <rudalics@gmx.at>
7435 * window.c (Fset_window_combination_limit): Rename argument
7437 (Vwindow_combination_limit): Remove "status" from doc-string.
7439 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
7441 * m/ibms390.h: Remove.
7442 * m/ibms390x.h: Don't include "ibms390.h".
7444 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
7446 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
7447 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
7449 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
7451 * casetab.c (Fset_case_table):
7452 * charset.c (Fcharset_after): Fix typos.
7454 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
7456 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
7457 Otherwise, valgrind does not work on some platforms.
7458 Problem reported by Andreas Schwab in
7459 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
7460 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
7461 is set, removing the need for VIRT_ADDRESS_VARIES.
7462 (PURE_P): Use a more-efficient implementation that needs just one
7463 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
7464 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
7465 to 4 (xorl, subq, cmpq, setbe).
7466 * alloc.c (pure): Always extern now, since that's the
7467 VIRT_ADDR_VARIES behavior.
7468 (PURE_POINTER_P): Use a single comparison, not two, for
7469 consistency with the new puresize.h.
7470 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
7471 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
7472 Remove VIRT_ADDR_VARIES no longer needed.
7474 2011-11-19 Eli Zaretskii <eliz@gnu.org>
7476 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
7477 (erase_phys_cursor, update_window_cursor, show_mouse_face)
7478 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
7479 behave as if the cursor position were at the window margin.
7481 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
7482 and the cursor position is out of bounds, behave as if the cursor
7483 position were at the window margin. (Bug#10075)
7485 2011-11-18 Chong Yidong <cyd@gnu.org>
7487 * window.c (Fwindow_combination_limit): Make first argument
7488 non-optional, since it is meaningless for live windows like the
7491 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
7493 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
7495 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
7497 * intervals.c: Fix grafting over the whole buffer (bug#10071).
7498 (graft_intervals_into_buffer): Simplify.
7500 2011-11-18 Eli Zaretskii <eliz@gnu.org>
7502 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
7503 hash values of the two rows.
7504 (copy_row_except_pointers): Preserve the used[] arrays and the
7505 hash values of the two rows. (Bug#10035)
7506 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
7508 * xdisp.c (row_hash): New function, body extracted from
7509 compute_line_metrics.
7510 (compute_line_metrics): Call row_hash, instead of computing the
7513 * dispnew.c (verify_row_hash): Call row_hash for computing the
7514 hash code of a row, instead of duplicating code from xdisp.c.
7516 * dispextern.h (row_hash): Add prototype.
7518 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
7520 * frame.c (delete_frame): Don't delete the terminal when the last
7521 X frame is closed if emacs is built with GTK toolkit.
7523 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
7525 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
7527 2011-11-17 Martin Rudalics <rudalics@gmx.at>
7529 * window.c (Vwindow_splits): Rename to
7530 Vwindow_combination_resize. Suggested by Juri Linkov.
7531 (Fsplit_window_internal): Use Vwindow_combination_resize instead
7534 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
7536 * nsfns.m (Fns_font_name):
7537 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
7539 2011-11-16 Martin Rudalics <rudalics@gmx.at>
7541 * window.h (window): Rename slot "nest" to "combination_limit".
7542 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
7543 (Fset_window_nest): Rename to Fset_window_combination_limit.
7544 (Vwindow_nest): Rename to Vwindow_combination_limit.
7545 (recombine_windows, make_parent_window, make_window)
7546 (Fsplit_window_internal, saved_window)
7547 (Fset_window_configuration, save_window_save): Rename all
7548 occurrences of window_nest to window_combination_limit.
7550 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
7552 * image.c (imagemagick_load_image): Fix typo.
7554 2011-11-14 Eli Zaretskii <eliz@gnu.org>
7556 * xdisp.c (display_line): Move the call to
7557 highlight_trailing_whitespace before the call to
7558 compute_line_metrics, since the latter needs to see the final
7559 faces of all the glyphs to compute ROW's hash value.
7560 Fixes assertion violations in row_equal_p. (Bug#10035)
7562 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
7564 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
7565 just return (bug#10044).
7567 2011-11-12 Eli Zaretskii <eliz@gnu.org>
7569 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
7570 with user-defined heap size. Bump the default size of the temacs
7571 heap to 27MB, to avoid memory warning when running temacs.
7572 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
7574 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
7575 current_matrix and desired_matrix. (Bug#9990)
7576 (verify_row_hash) [XASSERTS]: New function.
7577 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
7578 that the hash value of glyph rows is correct.
7580 2011-11-12 Martin Rudalics <rudalics@gmx.at>
7582 * window.h (window): Remove splits slot.
7583 * window.c (Fwindow_splits, Fset_window_splits): Remove.
7584 (Fdelete_other_windows_internal, make_parent_window)
7585 (make_window, Fsplit_window_internal, Fdelete_window_internal)
7586 (Fset_window_configuration, save_window_save): Don't deal with
7587 split status of windows.
7588 (saved_window): Remove splits slot.
7589 (Vwindow_splits): Rewrite doc-string.
7591 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
7593 * xfns.c (unwind_create_frame):
7594 * nsfns.m (unwind_create_frame):
7595 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
7596 Vframe_list (Bug#9999).
7598 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
7600 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
7602 2011-11-11 Kenichi Handa <handa@m17n.org>
7604 * callproc.c (Fcall_process): Set the member dst_multibyte of
7607 2011-11-11 Johan Bockgård <bojohan@gnu.org>
7609 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
7610 avoid a crash (bug#9496).
7612 2011-11-09 Chong Yidong <cyd@gnu.org>
7614 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
7615 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
7617 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
7619 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
7621 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
7623 Avoid some portability problems by eschewing 'extern inline' functions.
7624 The trivial performance wins aren't worth the portability hassles; see
7625 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
7627 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
7628 (window_box_width, window_box_left, window_box_left_offset)
7629 (window_box_right, window_box_right_offset): Undo previous change,
7630 by removing the "extern"s.
7631 * intervals.c (adjust_intervals_for_insertion)
7632 (adjust_intervals_for_deletion): Undo previous change,
7633 making these static again.
7634 (offset_intervals, temp_set_point_both, temp_set_point)
7635 (copy_intervals_to_string): No longer inline.
7636 * xdisp.c (window_text_bottom_y, window_box_width)
7637 (window_box_height, window_box_left_offset)
7638 (window_box_right_offset, window_box_left, window_box_right)
7639 (window_box): No longer inline.
7641 2011-11-08 Chong Yidong <cyd@gnu.org>
7643 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
7644 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
7645 Signal an error if not a live window.
7646 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
7647 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
7649 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
7651 * lisp.h (syms_of_abbrev): Remove declaration.
7652 Reported by CHENG Gao <chenggao@royau.me>.
7654 2011-11-07 Eli Zaretskii <eliz@gnu.org>
7656 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
7657 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
7658 of temacs in GUI mode.
7660 2011-11-07 Martin Rudalics <rudalics@gmx.at>
7662 * window.h: Declare delete_all_child_windows instead of
7663 delete_all_subwindows.
7664 * window.c (Fwindow_nest, Fset_window_nest)
7665 (Fset_window_new_total, Fset_window_new_normal)
7666 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
7667 (delete_all_subwindows): Rename to delete_all_child_windows.
7668 (Fdelete_other_windows_internal, Fset_window_configuration):
7669 Call delete_all_child_windows instead of delete_all_subwindows.
7670 * frame.c (delete_frame): Call delete_all_child_windows instead
7671 of delete_all_subwindows.
7673 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
7675 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
7676 This is also needed for porting to any host where GC_MARK_STACK is
7677 not GC_MAKE_GCPROS_NOOPS.
7678 (which_symbols): Use it.
7680 2011-11-07 Kenichi Handa <handa@m17n.org>
7682 * coding.c (coding_set_destination): Check coding->src_pos only
7683 when coding->src_object is a buffer (bug#9910).
7685 * process.c (send_process): Set the member src_multibyte of coding
7686 to 0 (bug#9911) when sending a unibyte text.
7688 * callproc.c (Fcall_process): Set the member src_multibyte of
7689 process_coding to 0 (bug#9912).
7691 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7693 * xmenu.c (cleanup_widget_value_tree): New function.
7694 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
7695 calling free_menubar_widget_value_tree directly (Bug#9830).
7697 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
7699 Fix some portability problems with 'inline'.
7700 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
7701 (window_box_width, window_box_left, window_box_left_offset)
7702 (window_box_right, window_box_right_offset): Declare extern.
7703 Otherwise, these inline functions do not conform to C99 and
7704 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
7705 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
7706 * intervals.c (adjust_intervals_for_insertion)
7707 (adjust_intervals_for_deletion): Now extern, because otherwise the
7708 extern inline functions 'offset_intervals' couldn't refer to it.
7709 (static_offset_intervals): Remove.
7710 (offset_intervals): Rewrite using the old contents of
7711 static_offset_intervals. The old version didn't conform to C99
7712 because an extern inline function contained a reference to an
7713 identifier with static linkage.
7715 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
7717 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
7720 2011-11-06 Eli Zaretskii <eliz@gnu.org>
7722 * xdisp.c (init_iterator, reseat_to_string): Don't set the
7723 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
7724 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
7725 return Qleft_to_right.
7727 2011-11-06 Chong Yidong <cyd@gnu.org>
7729 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
7730 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
7731 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
7732 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
7733 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
7734 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
7735 (Fwindow_vscroll): Doc fix.
7736 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
7737 argument, since it makes no sense to pass a live window and for
7738 consistency with window-child.
7740 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
7742 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
7745 2011-11-05 Jason Rumney <jasonr@gnu.org>
7747 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
7748 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
7750 (add_font_entity_to_list): Fix logic errors in mixed boolean and
7751 bitwise arithmetic preventing use of unicode-sip and non-truetype
7754 2011-11-05 Eli Zaretskii <eliz@gnu.org>
7756 * s/ms-w32.h (fstat, stat, utime): Move redirections to
7759 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
7760 initialization code to keep similarity to xfns.c after changes
7763 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
7765 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
7766 (unwind_create_frame): New function (Bug#9943).
7767 (Fx_create_frame): Restructure code to be more similar to the one in
7768 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
7769 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
7770 Move terminal->reference_count++ just before making the frame official
7773 * nsterm.m (x_free_frame_resources): New function.
7774 (x_destroy_window): Move code to x_free_frame_resources.
7776 * xfns.c (unwind_create_frame): Fix comment.
7777 (Fx_create_frame, x_create_tip_frame):
7778 Move terminal->reference_count++ just before making the frame
7779 official. Move initialization of image_cache_refcount and
7780 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
7782 2011-11-05 Eli Zaretskii <eliz@gnu.org>
7784 Support MSVC build with newer versions of Visual Studio.
7785 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
7786 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
7789 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
7790 which are not supported by MSVC.
7791 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
7792 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
7794 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
7796 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
7798 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
7800 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
7802 Support MSVC build with newer versions of Visual Studio.
7803 * w32.c: Don't include w32api.h for MSVC.
7804 (init_environment) [_MSC_VER]: Call sys_access, not _access.
7806 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
7807 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
7808 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
7809 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
7811 (alloca) [_MSC_VER]: Define to _alloca.
7813 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
7815 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
7817 2011-11-04 Eli Zaretskii <eliz@gnu.org>
7819 * xdisp.c (note_mouse_highlight): If either of
7820 previous/next-single-property-change returns nil, treat that as
7821 the beginning or the end of the buffer. (Bug#9955)
7823 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
7825 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
7826 label is not null (Bug#9951).
7827 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
7830 2011-11-04 Eli Zaretskii <eliz@gnu.org>
7832 * window.c (Fwindow_body_size): Mention in the doc string that the
7833 return value is in frame's canonical units. (Bug#9949)
7835 2011-11-03 Eli Zaretskii <eliz@gnu.org>
7837 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
7839 * w32fns.c (unwind_create_frame): If needed, free the glyph
7840 matrices of the partially constructed frame. (Bug#9943)
7841 * xfns.c (unwind_create_frame): Likewise.
7843 2011-11-01 Eli Zaretskii <eliz@gnu.org>
7845 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
7846 Don't stop backward scan on the continuation glyph, even though
7847 its CHARPOS is positive.
7848 (mouse_face_from_buffer_pos, note_mouse_highlight):
7849 Rename cover_string to disp_string.
7851 2011-11-01 Martin Rudalics <rudalics@gmx.at>
7853 * window.c (temp_output_buffer_show): Don't use
7854 Vtemp_buffer_show_specifiers.
7855 (Vtemp_buffer_show_specifiers): Remove unused variable.
7857 2011-10-30 Eli Zaretskii <eliz@gnu.org>
7859 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
7860 past the beginning of the current glyph matrix.
7862 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
7864 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
7865 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
7866 HAVE_GTK3 (Bug#9869).
7868 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
7869 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
7871 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
7873 * xterm.c: Declare x_handle_net_wm_state to return int.
7874 (handle_one_xevent): Check if we are iconified but don't have
7875 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
7876 (get_current_wm_state): Return non-zero if not hidden,
7877 check for _NET_WM_STATE_HIDDEN (Bug#9893).
7878 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
7879 (x_handle_net_wm_state): Return what get_current_wm_state returns.
7880 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
7882 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
7884 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
7885 so that this new function doesn't get optimized away by a
7886 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
7888 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
7890 * frame.h (MOUSE_HL_INFO): Remove excess parens.
7892 2011-10-29 Eli Zaretskii <eliz@gnu.org>
7894 Fix the `xbytecode' command.
7895 * .gdbinit (xprintbytestr): New command.
7896 (xwhichsymbols): Rename from `which'; all callers changed.
7897 (xbytecode): Print the byte-code string as well.
7899 2011-10-29 Kim Storm <storm@cua.dk>
7901 * alloc.c (which_symbols): New function.
7903 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
7905 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
7908 2011-10-29 Glenn Morris <rgm@gnu.org>
7910 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
7911 Not clear what it was for, and it causes various bugs. (Bug#9839)
7913 2011-10-28 Eli Zaretskii <eliz@gnu.org>
7915 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
7916 possible random value that matches one of those tested as
7917 condition to clear the mouse face.
7919 2011-10-28 Chong Yidong <cyd@gnu.org>
7921 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
7923 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
7925 * window.c (make_window): Initialize phys_cursor_on_p.
7927 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
7929 * lisp.h (struct Lisp_Symbol): Update comments.
7931 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
7933 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
7935 2011-10-28 Eli Zaretskii <eliz@gnu.org>
7937 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
7938 <oslsachem@gmail.com> for helping to debug this.
7940 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
7941 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
7942 (g_b_init_get_glyph_outline_w): New static variables.
7943 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
7944 (GetGlyphOutlineW_Proc): New typedefs.
7945 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
7946 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
7948 (w32font_open_internal, compute_metrics):
7949 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
7950 instead of calling the "wide" APIs directly.
7952 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
7954 * w32.h (syms_of_w32font): Add prototype.
7956 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
7958 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
7959 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
7960 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
7961 (Fmove_to_window_line): Doc fix.
7963 2011-10-27 Chong Yidong <cyd@gnu.org>
7965 * process.c (make_process): Set gnutls_state to NULL.
7967 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
7968 non-NULL, regardless of GNUTLS_INITSTAGE.
7969 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
7970 an error. Set process slots as soon as we allocate them.
7972 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
7974 2011-10-27 Chong Yidong <cyd@gnu.org>
7976 * gnutls.c (emacs_gnutls_deinit): New function.
7977 Deallocate credentials structures as well as calling gnutls_deinit.
7978 (Fgnutls_deinit, Fgnutls_boot): Use it.
7980 * process.c (make_process): Initialize GnuTLS credentials to NULL.
7981 (deactivate_process): Call emacs_gnutls_deinit.
7983 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
7985 * image.c (x_create_x_image_and_pixmap):
7986 * w32.c (sys_rename, w32_delayed_load):
7987 * w32font.c (fill_in_logfont):
7988 * w32reg.c (x_get_string_resource): Silence compiler warnings.
7990 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
7992 * w32fns.c (w32_default_color_map): New function,
7993 extracted from Fw32_default_color_map.
7994 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
7996 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
7998 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
8000 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
8002 * keyboard.c (test_undefined): New function (bug#9751).
8003 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
8005 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
8007 * sysdep.c (init_sys_modes): Fix the check for the controlling
8008 terminal (Bug#6649).
8010 2011-10-20 Eli Zaretskii <eliz@gnu.org>
8012 * dispextern.h (struct bidi_it): New member next_en_type.
8014 * bidi.c (bidi_line_init): Initialize the next_en_type member.
8015 (bidi_resolve_explicit_1): When next_en_pos is valid for the
8016 current character, check also for next_en_type being WEAK_EN.
8017 (bidi_resolve_weak): Don't enter the expensive loop if the current
8018 position is before next_en_pos. Record the bidi type of the first
8019 non-ET, non-BN character we find, in addition to its position.
8020 (bidi_level_of_next_char): Invalidate next_en_type when
8021 next_en_pos is over-stepped.
8023 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
8025 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
8026 * editfns.c: Rewrite current-time-zone so that it invokes
8027 the equivalent of (format-time-string "%Z") to get the time zone name.
8028 This fixes a bug when the time zone name contains characters that
8029 need converting from the system time locale to Emacs internal format.
8030 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
8031 that patch fixed format-time-string to do the conversion, but
8032 I forgot to fix current-time-zone.
8033 (format_time_string): New function, containing most of
8034 what Fformat_time_string used to contain.
8035 (Fformat_time_string): Rewrite in terms of format_time_string.
8036 This doesn't change this function's behavior.
8037 (current-time-zone): Rewrite to use format_time_string.
8038 This fixes the bug reported by Michael Schierl in
8039 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
8040 Jason Rumney's 2007-06-07 change worked around this bug, but
8042 * systime.h (tzname, timezone): Remove no-longer-used declarations.
8044 2011-10-19 Eli Zaretskii <eliz@gnu.org>
8046 * xdisp.c (start_display): If the character at POS is displayed
8047 via a display vector, reset IT->current.dpvec_index to zero.
8048 (try_window_reusing_current_matrix): If a line ends in a display
8049 vector or the next line starts in a display vector, continue
8050 redrawing the window even though the character position of
8051 start_row was reached.
8054 2011-10-18 Chong Yidong <cyd@gnu.org>
8056 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
8057 with nobreak-char-display too.
8059 2011-10-18 Eli Zaretskii <eliz@gnu.org>
8061 Fix part 3 of bug#9771.
8062 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
8063 (bidi_resolve_neutral): Don't enter the expensive loop looking for
8064 non-neutral characters if the current character is a paragraph
8065 separator (a.k.a. Newline). This avoids running the same
8066 expensive loop twice, once when we consume the preceding newline
8067 and the other time when the line actually needs to be displayed.
8068 Avoid the loop when we see neutrals on the base embedding level
8069 following a character whose directionality is the same as the
8070 paragraph's. This avoids running the expensive loop when a line
8071 ends in a long sequence of neutrals, like control characters.
8072 Add assertion against STRONG_AL type. Slightly rearrange code
8073 that determines the type of a neutral given the first non-neutral
8075 (bidi_level_of_next_char): Set next_en_pos to zero when
8076 invalidating its info.
8078 2011-10-17 Eli Zaretskii <eliz@gnu.org>
8080 * xdisp.c (push_display_prop): Determine whether to record string
8081 or buffer position by IT->string, not by IT->method. Allow
8082 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
8083 (move_it_vertically_backward): Don't look for character position
8084 immediately after the newline when in a continuation line.
8087 2011-10-15 Martin Rudalics <rudalics@gmx.at>
8089 * window.c (coordinates_in_window): Rewrite and delabelize
8090 vertical border check. (Bug#5357) (Bug#9618)
8092 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
8094 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
8095 errors in XSetWindowBorder (bug#9310).
8097 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
8099 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
8100 avoid crash when xmalloc overrun checking is enabled.
8102 2011-10-13 Eli Zaretskii <eliz@gnu.org>
8104 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
8105 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
8106 cursor motion with <left> and <right> arrow keys.
8108 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
8109 some callers set that themselves.
8111 2011-10-12 Eli Zaretskii <eliz@gnu.org>
8113 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
8114 display string and the previous row comes from the same string and
8115 is empty. (Bug#9739) (Bug#9738)
8117 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
8119 * doc.c (get_doc_string): Encode file name (bug#9735).
8121 2011-10-12 Eli Zaretskii <eliz@gnu.org>
8123 * bidi.c (bidi_level_of_next_char):
8124 * xdisp.c (get_visually_first_element): Remove old incorrect
8125 comments regarding the Unicode Line Separator character.
8127 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
8129 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
8131 * alloc.c (Fgc_status): Do not access beyond zombies array
8132 boundary if nzombies > MAX_ZOMBIES.
8133 * alloc.c (dump_zombies): Add missing format specifier.
8135 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
8137 * xdisp.c (set_cursor_from_row): Simplify conditionals,
8138 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
8140 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
8141 Some packages use them to denote characters with modifiers.
8143 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
8145 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
8146 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
8147 matching a pp-number. Rename parameter var to var1.
8149 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
8151 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
8153 2011-10-08 Glenn Morris <rgm@gnu.org>
8155 * callint.c (Fcall_interactively): Give a more explicit error for the
8156 'c' case with a non-character input. (Bug#8479)
8158 2011-10-08 Eli Zaretskii <eliz@gnu.org>
8160 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
8162 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
8163 lines that are hscrolled on the left.
8165 * dispnew.c (buffer_posn_from_coords): Account for a possible
8166 presence of header-line. (Bug#4426)
8168 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
8170 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
8171 Don't advertise functionality which we discourage or doesn't work.
8173 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
8175 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
8176 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
8177 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
8178 this makes Emacs dump core during garbage collection on rare
8179 occasions. sizeof is obviously inferior to offsetof here, so
8180 stick with offsetof.
8181 (GC_POINTER_ALIGNMENT): New macro.
8182 (mark_memory): Omit 3rd (offset) arg; caller changed.
8183 Don't assume EMACS_INT alignment is the same as pointer alignment.
8185 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
8187 * keyboard.c (read_key_sequence_remapped): New var.
8188 (read_key_sequence): Compute remapping in the right buffer.
8189 (command_loop_1): Use read_key_sequence's remapping directly.
8191 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
8193 * dired.c (file_name_completion): Don't expand file name.
8194 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
8195 before checking file name handler.
8197 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
8198 they've been requested explicitly (bug#9591).
8200 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
8202 * keymap.c (Fsingle_key_description): Use make_specified_string
8203 instead of build_string to build string from push_key_description.
8206 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
8208 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
8209 This fixes a Y2038 bug on 64-bit hosts.
8210 * buffer.c (reset_buffer):
8211 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
8212 (Fclear_buffer_auto_save_failure):
8213 Use 0, not -1, to represent an unset failure time, since time_t
8214 might not be signed.
8216 Remove dependency on glibc malloc internals.
8217 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8218 Move back here from lisp.h, but with their new implementations.
8219 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8220 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
8221 * charset.c (charset_table_init): New static var.
8222 (syms_of_charset): Use it instead of xmalloc. This removes a
8223 dependency on glibc malloc internals. See Eli Zaretskii's comment in
8224 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
8225 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8226 Move back to alloc.c.
8227 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8228 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
8230 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
8232 * nsterm.m (windowDidResize): Call x_set_window_size only when
8233 ns_in_resize is true. Otherwise set pixelwidth/height and
8234 call change_frame_size (Bug#9628).
8236 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
8238 Port --enable-checking=all to Fedora 14 x86-64.
8239 * charset.c (syms_of_charset): Also account for glibc malloc's
8240 internal overhead when calculating the initial malloc maximum.
8242 Port --enable-checking=all to Fedora 14 x86.
8243 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8245 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
8246 (overrun_check_realloc, overrun_check_free):
8247 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
8248 That way, xmalloc returns a properly-aligned pointer even if
8249 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
8250 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
8251 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
8252 into account when calculating the initial malloc maximum.
8253 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8254 Move here from alloc.c, so that charset.c can use it too.
8255 Properly align; the old code wasn't right for common 32-bit hosts
8256 when configured with --enable-checking=all.
8257 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8258 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
8260 2011-09-29 Eli Zaretskii <eliz@gnu.org>
8262 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
8265 2011-09-28 Eli Zaretskii <eliz@gnu.org>
8267 * xdisp.c (compute_display_string_end): If there's no display
8268 string at CHARPOS, return -1.
8270 * bidi.c (bidi_fetch_char): When compute_display_string_end
8271 returns a negative value, treat the character as a normal
8272 character not covered by a display string. (Bug#9624)
8274 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
8276 * lread.c (Fread_from_string): Fix typo in docstring.
8278 2011-09-27 Eli Zaretskii <eliz@gnu.org>
8280 * xdisp.c (handle_invisible_prop): If invisible text ends on a
8281 newline, reseat the iterator instead of bidi-iterating there one
8282 character at a time. (Bug#9610)
8283 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
8284 TO_CHARPOS if the bidi iterator is at base embedding level.
8286 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
8288 * lread.c (readevalloop): Use correct code for NBSP.
8289 (read1): Likewise. (Bug#9608)
8291 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
8293 * dbusbind.c (Fdbus_register_signal): When service is not
8294 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
8296 2011-09-25 Glenn Morris <rgm@gnu.org>
8298 * buffer.c (truncate-lines): Doc fix.
8300 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
8302 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
8303 (Fset_window_next_buffers): Doc fix.
8305 2011-09-24 Glenn Morris <rgm@gnu.org>
8307 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
8309 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
8311 Fix minor problems found by static checking.
8312 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
8313 * indent.c (Fvertical_motion): Fix == vs = typo.
8315 2011-09-24 Eli Zaretskii <eliz@gnu.org>
8317 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
8318 Default value is now t. Doc fix.
8320 * indent.c (Fvertical_motion): Compute and apply the overshoot
8321 logic when moving up, not only when moving down. Fix the
8322 confusing name and values of the it_overshoot_expected variable;
8323 logic changes accordingly. (Bug#9254) (Bug#9549)
8325 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
8326 CHARPOS is covered by a display string which includes newlines.
8327 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
8328 is covered by a display string with embedded newlines.
8330 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
8332 * dbusbind.c (Fdbus_register_signal): Add match rule to
8333 Vdbus_registered_objects_table. (Bug#9581)
8334 (Fdbus_register_method, Vdbus_registered_objects_table):
8337 2011-09-24 Jim Meyering <meyering@redhat.com>
8339 do not ignore write error for any output size
8340 The previous change was incomplete.
8341 While it makes emacs --batch detect the vast majority of stdout
8342 write failures, errors were still ignored whenever the output size is
8343 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
8344 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
8345 && echo FAIL: ignored write error
8346 FAIL: ignored write error
8347 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
8348 && echo FAIL: ignored write error
8349 FAIL: ignored write error
8350 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
8352 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
8354 * emacs.c (Fkill_emacs): In noninteractive mode exit
8355 non-successfully if a write error occurred on stdout. (Bug#9574)
8357 2011-09-21 Eli Zaretskii <eliz@gnu.org>
8359 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
8362 * dispextern.h (struct it): Update the comment documenting what
8365 2011-09-20 Eli Zaretskii <eliz@gnu.org>
8367 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
8368 a display string, extend search for cursor position to end of row.
8369 (find_row_edges): If the row ends in a newline from a display
8370 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
8371 Handle the case of a display string with multiple newlines.
8372 (Fcurrent_bidi_paragraph_direction): Fix search for previous
8373 non-empty line. Fixes confusing cursor motion with arrow keys at
8374 the beginning of a line that starts with whitespace.
8376 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
8378 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
8381 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
8383 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
8386 2011-09-18 Eli Zaretskii <eliz@gnu.org>
8388 * xdisp.c (display_line): Record maximum and minimum buffer
8389 positions even if no glyphs were produced (e.g., by a zero-width
8390 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
8391 buffer positions that will be removed from the glyph row because
8393 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
8394 column is beyond frame width: don't subtract 1 "pixel" when
8395 computing width of the stretch.
8396 (reseat_at_next_visible_line_start): Undo the change made on
8397 2011-09-17 that saved paragraph information and restored it after
8398 the call to `reseat'. (Bug#9545)
8400 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8402 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
8403 and turn window cursor on if cleared (Bug#9415).
8405 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
8407 * search.c (boyer_moore): Take unibyte characters from pattern
8408 literally. (Bug#9458)
8410 2011-09-18 Eli Zaretskii <eliz@gnu.org>
8412 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
8414 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
8416 Fix minor problem found by static checking.
8417 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
8418 initialized, to pacify gcc -Wuninitialized.
8420 * fileio.c: Report proper errno when syscall falls.
8421 (Finsert_file_contents): Save and restore errno,
8422 so that report_file_error outputs the correct diagnostic.
8423 (Fwrite_region) [CLASH_DETECTION]: Likewise.
8425 2011-09-18 Eli Zaretskii <eliz@gnu.org>
8427 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
8429 2011-09-17 Eli Zaretskii <eliz@gnu.org>
8431 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
8432 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
8434 2011-09-17 Eli Zaretskii <eliz@gnu.org>
8436 * xdisp.c (reseat_at_next_visible_line_start): Keep information
8437 about the current paragraph and restore it after the call to reseat.
8439 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
8440 (bidi_find_paragraph_start): Search back for paragraph beginning
8441 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
8442 (bidi_move_to_visually_next): Only trigger paragraph-related
8443 computations when the last character is a newline or at EOB, not
8444 just any NEUTRAL_B. (Bug#9470)
8446 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
8447 truncated lines if point is covered by a display string. (Bug#9524)
8449 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
8451 * xselect.c: Relax test for outgoing X longs (Bug#9498).
8452 (cons_to_x_long): New function.
8453 (lisp_data_to_selection_data): Use it. Correct the test for
8454 short-versus-long data; it was negated. Break out of vector
8455 loop, for efficiency, when a long datum is discovered.
8457 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
8459 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
8461 2011-09-16 Eli Zaretskii <eliz@gnu.org>
8463 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
8464 GCC PR/17406) by declaring this function with external scope.
8466 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
8468 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
8469 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
8471 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
8473 * editfns.c (Fformat): Correctly handle text properties on "%%".
8475 2011-09-15 Eli Zaretskii <eliz@gnu.org>
8477 * xterm.c (x_draw_composite_glyph_string_foreground):
8478 * w32term.c (x_draw_composite_glyph_string_foreground):
8479 * term.c (encode_terminal_code):
8480 * composite.c (composition_update_it, get_composition_id):
8481 * xdisp.c (get_next_display_element)
8482 (fill_composite_glyph_string): Add comments about special meaning
8483 of TAB characters in a composition.
8485 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
8487 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
8488 This occurs when processing a multibyte format.
8489 Problem reported by Wolfgang Jenker.
8491 2011-09-15 Johan Bockgård <bojohan@gnu.org>
8493 * xdisp.c (try_cursor_movement): Only check for exact match if
8494 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
8496 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
8498 Remove unused external symbols.
8499 * dispextern.h (calc_pixel_width_or_height): Remove decl.
8500 * xdisp.c (calc_pixel_width_or_height): Now static.
8501 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
8502 * indent.c (check_display_width):
8503 * w32term.c: Fix comment to match code.
8504 * xterm.c, xterm.h (x_catching_errors): Remove.
8506 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
8508 * xselect.c: Use signed conversions more consistently (Bug#9498).
8509 (selection_data_to_lisp_data): Assume incoming selection data are
8510 signed integers, not unsigned. This is to be consistent with
8511 outgoing selection data, which was modified to use signed integers
8512 in as part of the fix to Bug#9196 in response to Jan D.'s comment
8513 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
8514 expects long, not unsigned long.
8516 2011-09-14 Eli Zaretskii <eliz@gnu.org>
8518 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
8519 computation of loop end. Reported by Johan Bockgård
8522 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
8524 * frame.c (Fother_visible_frames_p): Function deleted.
8526 2011-09-12 Eli Zaretskii <eliz@gnu.org>
8528 * indent.c (compute_motion): Process display vector front to back
8529 rather than the other way around. (Bug#2496)
8531 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
8533 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
8535 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
8537 * minibuf.c (Fread_from_minibuffer): Doc fix.
8539 2011-09-11 Eli Zaretskii <eliz@gnu.org>
8541 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
8542 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
8544 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
8546 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
8547 value for non-existent files.
8549 2011-09-11 Eli Zaretskii <eliz@gnu.org>
8551 * fileio.c (Finsert_file_contents): If the file cannot be opened,
8552 set its "size" to -1. This will set the modtime_size field of
8553 the corresponding buffer to -1, which is what
8554 verify-visited-file-modtime expects for files that do not exist.
8557 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
8559 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
8561 * lisp.h: ... from here. push_key_description is no longer
8562 defined in keyboard.c, so its declaration should not be in
8563 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
8564 logically belongs with push_key_description.
8566 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
8568 * buffer.h: Include <sys/types.h> instead of <time.h>.
8569 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
8570 Problem reported by Herbert J. Skuhra.
8572 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
8574 * xml.c (parse_region): Make the parsing work for
8575 non-comment-starting XML files again (bug#9144).
8577 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
8579 * image.c (gif_load): Fix calculation of bottom and right corner.
8582 2011-09-10 Eli Zaretskii <eliz@gnu.org>
8584 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
8585 redisplay in small windows.
8587 2011-09-09 Eli Zaretskii <eliz@gnu.org>
8589 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
8591 2011-09-08 Martin Rudalics <rudalics@gmx.at>
8593 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
8594 Operate on live windows only.
8596 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
8598 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
8600 2011-09-07 Eli Zaretskii <eliz@gnu.org>
8602 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
8603 only under bidi iteration.
8605 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
8607 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
8609 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
8611 isnan: Fix porting problem to Solaris 10 with bundled gcc.
8612 Without this fix, the command to link temacs failed due to an
8613 undefined symbol __builtin_isnan. This is because
8614 /usr/include/iso/math_c99.h #defines isnan(x) to
8615 __builtin_isnan(x), but the bundled gcc, which identifies itself
8616 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
8618 * floatfns.c (isnan): #undef, and then #define to a clone of
8620 (Fisnan): Always define, since it's always available now.
8621 (syms_of_floatfns): Always define isnan at the Lisp level.
8623 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
8625 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
8627 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
8629 * fileio.c: Fix bugs with large file offsets (Bug#9428).
8630 The previous code assumed that file offsets (off_t values) fit in
8631 EMACS_INT variables, which is not true on typical 32-bit hosts.
8632 The code messed up by falsely reporting buffer overflow in cases
8633 such as (insert-file-contents "big" nil 1 2) into an empty buffer
8634 when "big" contains more than 2**29 bytes, even though this
8635 inserts just one byte and does not overflow the buffer.
8636 (Finsert_file_contents): Store file offsets as off_t
8637 values, not as EMACS_INT values. Check for overflow when
8638 converting between EMACS_INT and off_t. When checking for
8639 buffer overflow or for overlap, take the offsets into account.
8640 Don't use EMACS_INT for small values where int suffices.
8641 When checking for overlap, fix a typo: ZV was used where
8642 ZV_BYTE was intended.
8643 (Fwrite_region): Don't assume off_t fits into 'long'.
8644 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
8646 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
8648 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
8650 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
8652 sprintf-related integer and memory overflow issues (Bug#9412).
8654 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8655 (esprintf, exprintf, evxprintf): New functions.
8656 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
8657 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
8658 (modify_event_symbol): Do not assume that the length of
8659 name_alist_or_stem is safe to alloca and fits in int.
8660 (Fexecute_extended_command): Likewise for function name and binding.
8661 (Frecursion_depth): Wrap around reliably on integer overflow.
8662 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
8663 since some callers pass EMACS_INT values.
8664 (Fsingle_key_description): Don't crash if symbol name contains more
8665 than MAX_ALLOCA bytes.
8666 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
8667 (get_minibuffer): Arg is now EMACS_INT, not int.
8668 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8669 (esprintf, exprintf, evxprintf): New decls.
8670 * window.h (command_loop_level, minibuf_level): Reflect API changes.
8672 * dbusbind.c (signature_cat): New function.
8673 (xd_signature, Fdbus_register_signal):
8674 Do not overrun buffer; instead, report string overflow.
8676 * dispnew.c (add_window_display_history): Don't overrun buffer.
8677 Truncate instead; this is OK since it's just a log.
8679 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
8680 even if the time zone offset is outlandishly large.
8681 Don't mishandle offset == INT_MIN.
8683 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
8684 when creating daemon; the previous buffer-overflow check was incorrect.
8686 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
8687 which has the guts of the old verror function.
8689 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
8690 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
8692 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
8693 (font_unparse_xlfd): Don't blindly alloca long strings.
8694 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8695 fits in int, when using sprintf. Use single snprintf to count
8696 length of string rather than counting it via multiple sprintfs;
8697 that's simpler and more reliable.
8698 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
8699 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
8700 sprintf, in case result does not fit in int.
8702 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
8703 (fontset_from_font): Print it.
8705 * frame.c (tty_frame_count): Now printmax_t, not int.
8706 (make_terminal_frame, set_term_frame_name): Print it.
8707 (x_report_frame_params): In X, window IDs are unsigned long,
8708 not signed long, so print them as unsigned.
8709 (validate_x_resource_name): Check for implausibly long names,
8710 and don't assume name length fits in 'int'.
8711 (x_get_resource_string): Don't blindly alloca invocation name;
8712 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
8715 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
8716 (xg_check_special_colors, xg_set_geometry):
8717 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
8719 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
8720 Use esprintf, not sprintf, in case result does not fit in int.
8722 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
8723 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
8724 it as a large positive number.
8725 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
8726 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
8728 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
8729 in case result does not fit in int.
8731 * print.c (float_to_string): Detect width overflow more reliably.
8732 (print_object): Make sprintf buffer a bit bigger, to avoid potential
8733 buffer overrun. Don't assume list length fits in 'int'. Treat
8734 print length of 0 as 0, not as infinity; to be consistent with other
8735 uses of print length in this function. Don't overflow print length
8736 index. Don't assume hash table size fits in 'long', or that
8737 vectorlike size fits in 'unsigned long'.
8739 * process.c (make_process): Use printmax_t, not int, to format
8740 process-name gensyms.
8742 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
8744 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
8745 to avoid potential buffer overrun.
8747 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
8748 if X resource line is longer than 512 bytes.
8750 * xfns.c (x_window): Make sprintf buffer a bit bigger
8751 to avoid potential buffer overrun.
8753 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
8755 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
8757 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
8759 Integer overflow fixes for scrolling, etc.
8760 Without these, Emacs silently mishandles large integers sometimes.
8761 For example, "C-u 4294967297 M-x recenter" was treated as if
8762 it were "C-u 1 M-x recenter" on a typical 64-bit host.
8764 * xdisp.c (try_window_id): Check Emacs fixnum range before
8765 converting to 'int'.
8767 * window.c (window_scroll_line_based, Frecenter):
8768 Check that an Emacs fixnum is in range before assigning it to 'int'.
8769 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
8770 values converted from Emacs fixnums.
8771 (Frecenter): Don't wrap around a line count if it is out of 'int'
8772 range; instead, treat it as an extreme value.
8773 (Fset_window_configuration, compare_window_configurations):
8774 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
8776 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
8777 that can exceed INT_MAX. Check that EMACS_INT value is in range
8778 before assigning it to the (possibly-narrower) index.
8779 (match_limit): Don't assume that a fixnum can fit in 'int'.
8781 * print.c (print_object): Use ptrdiff_t, not int, for index that can
8784 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
8785 (Fvertical_motion): Don't wrap around LINES values that don't fit
8786 in 'int'. Instead, treat them as extreme values. This is good
8787 enough for windows, which can't have more than INT_MAX lines anyway.
8789 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
8791 * Require libxml/parser.h to avoid compilation warning.
8793 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
8795 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
8796 since this reportedly can destroy thread storage.
8798 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
8800 * syntax.c (find_defun_start): Update all cache variables if
8801 exiting early (Bug#9401).
8803 2011-08-30 Eli Zaretskii <eliz@gnu.org>
8805 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
8807 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
8808 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
8809 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
8811 * term.c (tty_append_glyph): New function.
8812 (produce_stretch_glyph): Static function and its prototype deleted.
8814 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
8817 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
8819 * image.c (parse_image_spec): Check for nonnegative, not for positive,
8820 when checking :margin (Bug#9390).
8821 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
8822 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
8823 so that the name doesn't mislead. All uses changed.
8825 2011-08-28 Johan Bockgård <bojohan@gnu.org>
8827 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
8830 2011-08-27 Eli Zaretskii <eliz@gnu.org>
8832 * xdisp.c (move_it_to): Don't bail out early when reaching
8833 position beyond to_charpos, if we are scanning backwards.
8834 (move_it_vertically_backward): When DY == 0, make sure we get to
8835 the first character in the line after the newline.
8837 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
8839 * ccl.c: Improve and simplify overflow checking (Bug#9196).
8840 (ccl_driver): Do not generate an out-of-range pointer.
8841 (Fccl_execute_on_string): Remove unnecessary check for
8842 integer overflow, noted by Stefan Monnier in
8843 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
8844 Remove a FIXME that didn't need fixing.
8845 Simplify the newly-introduced buffer reallocation code.
8847 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
8849 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
8851 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
8853 Integer and memory overflow issues (Bug#9196).
8855 * doc.c (get_doc_string): Rework so that
8856 get_doc_string_buffer_size is the actual buffer size, rather than
8857 being 1 less than the actual buffer size; this makes xpalloc more
8860 * image.c (x_allocate_bitmap_record, cache_image):
8861 * xselect.c (Fx_register_dnd_atom):
8862 Simplify previous changes by using xpalloc.
8864 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
8865 since either will do and ptrdiff_t is convenient with xpalloc.
8867 * charset.c (charset_table_size)
8868 (struct charset_sort_data.priority): Now ptrdiff_t.
8869 (charset_compare): Don't overflow if priorities differ greatly.
8870 (Fsort_charsets): Don't assume list length fits in int.
8871 Check for size-calculation overflow when allocating sort data.
8872 (syms_of_charset): Allocate an initial charset table that is
8873 just under 64 KiB, to avoid problems with glibc malloc and mmap.
8875 * cmds.c (internal_self_insert): Check for size-calculation overflow.
8877 * composite.h (struct composition.glyph_len): Now int, not unsigned.
8878 The actual value is always <= INT_MAX, and leaving it unsigned made
8879 overflow checking harder.
8881 * dispextern.h (struct glyph_matrix.rows_allocated)
8882 (struct face_cache.size): Now ptrdiff_t, for convenience in use
8883 with xpalloc. The values are still always <= INT_MAX.
8885 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
8887 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
8888 (SAFE_NALLOCA): New macro.
8890 * region-cache.c (struct boundary.pos, find_cache_boundary)
8891 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
8892 (set_cache_region, invalidate_region_cache)
8893 (revalidate_region_cache, know_region_cache, region_cache_forward)
8894 (region_cache_backward, pp_cache):
8895 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
8896 so that ptrdiff_t * can be passed to xpalloc.
8897 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
8898 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
8899 (pp_cache): Don't assume cache_len fits in int.
8900 * region-cache.h: Adjust extern decls to match.
8902 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
8903 EMACS_INT, since either will do, for xpalloc.
8905 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
8906 (xnmalloc, xnrealloc, xpalloc): New functions.
8908 * bidi.c (bidi_shelve_header_size): New constant.
8909 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
8910 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
8912 * bidi.c (bidi_cache_shrink):
8913 * buffer.c (overlays_at, overlays_in, record_overlay_string)
8915 Don't update size of array until after memory allocation succeeds,
8916 because xmalloc/xrealloc may not return.
8917 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
8918 now that we have proper integer overflow checking.
8919 (record_overlay_string, overlay_strings): Catch overflows when
8920 calculating size of overlay_str_buf.
8922 * callproc.c (Fcall_process): Check for size overflow when
8923 calculating size of args2.
8924 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
8925 Normally we prefer signed values, but sticking with ptrdiff_t would
8926 require adding more-complicated checks.
8928 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
8929 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
8930 Redo buffer-overflow calculations to avoid integer overflow.
8931 Add a FIXME comment where memory seems to be over-allocated.
8933 * character.c (Fstring): Check for size-calculation overflow.
8935 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
8936 unnecessary integer overflow. Check for size overflow.
8937 (encode_coding_object): Don't update size until xmalloc succeeds.
8939 * composite.c (get_composition_id): Check for overflow in glyph
8940 length calculations.
8942 Integer and memory overflow fixes for display code.
8943 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
8944 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
8945 (scrolling_window): Check for overflow in size calculations.
8946 (line_draw_cost, realloc_glyph_pool, add_row_entry):
8947 Don't assume glyph table len fits in int.
8948 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
8949 (row_table_size): Now ptrdiff_t, not int.
8950 (scrolling_window): Avoid overflow in size calculations.
8951 Don't update size until allocation succeeds.
8952 * fns.c (concat): Check for overflow in size calculations.
8953 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
8954 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
8955 (NEXT_ALMOST_PRIME_LIMIT): New constant.
8957 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
8958 (get_doc_string): Check for size calculation overflow.
8959 Don't update size until allocation succeeds.
8960 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
8961 EMACS_INT, where ptrdiff_t will do.
8962 (Fsubstitute_command_keys): Check for string overflow.
8964 * editfns.c (set_time_zone_rule): Don't assume environment length
8966 (message_length): Now ptrdiff_t, not int.
8967 (Fmessage_box): Don't update size until allocation succeeds.
8968 Don't assume message length fits in int.
8969 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
8971 * emacs.c (main): Do not reallocate argv, since there is a null at
8972 the end that can be overwritten, and this way there's no need to
8973 worry about size-calculation overflow.
8974 (sort_args): Check for size-calculation overflow.
8976 * eval.c (init_eval_once, grow_specpdl): Don't update size until
8978 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
8980 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
8981 (x_set_scroll_bar_width, x_figure_window_size):
8982 Check for integer overflow.
8983 (x_set_alpha): Do not assume XINT fits in int.
8985 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
8986 This is for the members text_lines, text_cols, total_lines, total_cols,
8987 where the system imposes an 'int' limit.
8989 * fringe.c (Fdefine_fringe_bitmap):
8990 Don't update size until alloc works.
8992 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
8993 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
8995 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
8996 Check for size-calculation overflow.
8997 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
8998 do, as we prefer signed integers.
8999 (id_to_widget.max_size, id_to_widget.used)
9000 (xg_store_widget_in_map, xg_remove_widget_from_map)
9001 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
9002 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
9003 Use and return ptrdiff_t, not int.
9004 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
9005 * gtkutil.h: Change prototypes to match the above.
9007 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
9008 are duplicate now that they've been promoted to lisp.h.
9009 (x_allocate_bitmap_record, x_alloc_image_color)
9010 (make_image_cache, cache_image, xpm_load):
9011 Don't update size until alloc is done.
9012 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
9014 Check for size calculation overflow.
9015 (ct_colors_allocated_max): New constant.
9016 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
9019 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
9020 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
9021 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
9022 Use ptrdiff_t, not int, to count maps.
9023 (read_char_minibuf_menu_prompt): Check for overflow in size
9024 calculations. Don't update size until allocation succeeds.
9025 Redo calculations to avoid overflow.
9026 * keyboard.h: Change prototypes to match the above.
9028 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
9030 (current_minor_maps): Check for size calculation overflow.
9031 * keymap.h: Change prototypes to match the above.
9033 * lread.c (read1, init_obarray): Don't update size until alloc done.
9035 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
9036 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
9038 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
9039 Now ptrdiff_t, not int.
9040 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
9041 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
9043 * process.c (Fnetwork_interface_list): Check for overflow
9044 in size calculation.
9046 * region-cache.c (move_cache_gap): Check for size calculation overflow.
9048 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
9049 overflow. Don't bother calling xmalloc when xrealloc will do.
9051 * search.c (Freplace_match): Check for size calculation overflow.
9052 (Fset_match_data): Don't assume list lengths fit in 'int'.
9054 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
9055 for command line length. Do not attempt to address one before the
9056 beginning of an array, as that's not portable.
9058 * term.c (max_frame_lines): Remove; unused.
9059 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
9061 (encode_terminal_code, calculate_costs): Check for size
9062 calculation overflow.
9063 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
9064 table lengths and related sizes. Don't update size until alloc
9065 done. Redo calculations to avoid overflow.
9066 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
9068 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
9069 subtracting pointers.
9070 (gobble_line): Check for overflow more carefully. Don't update size
9073 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
9074 Don't update size until alloc done.
9075 Redo size calculations to avoid overflow.
9076 Check for size calculation overflow.
9077 (main) [DEBUG]: Fix typo in invoking tparam1.
9079 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
9080 Use ptrdiff_t, not int, for sizes.
9081 (store_mode_line_noprop_char): Don't update size until alloc done.
9083 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
9084 Use ptrdiff_t, not int, for sizes.
9085 (Finternal_make_lisp_face, cache_face):
9086 Check for size calculation overflow.
9087 (cache_face): Treat size calculation overflows as if they were
9088 memory exhaustion (the usual treatment), rather than aborting.
9090 * xfns.c (x_encode_text, x_set_name_internal)
9091 (Fx_change_window_property): Use ptrdiff_t, not int, to count
9092 sizes, since they can exceed INT_MAX in size. Check for size
9093 calculation overflow.
9095 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
9096 (xg_select): Check for size calculation overflow.
9097 Don't update size until alloc done.
9099 * xrdb.c (get_environ_db): Don't assume path length fits in int,
9100 as sprintf is limited to int lengths.
9102 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
9103 (X_LONG_MIN): New macros.
9104 Use them to make the following changes clearer.
9105 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
9106 This change doesn't affect the value now, but it may help remind
9107 future maintainers not to raise the value too much later.
9108 (SELECTION_QUANTUM): Remove, replacing with ...
9109 (selection_quantum): ... new function, which avoids overflow.
9111 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
9112 assumption that selection length fits in 'int'.
9113 (x_reply_selection_request, x_handle_selection_request)
9114 (x_get_window_property, receive_incremental_selection)
9115 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
9116 (lisp_data_to_selection_data, clean_local_selection_data):
9117 Use ptrdiff_t, not int, to record length of selection.
9118 (x_reply_selection_request, x_get_window_property)
9119 (receive_incremental_selection, x_property_data_to_lisp):
9120 Redo calculations to avoid overflow.
9121 (x_reply_selection_request): When sending hint, ceiling it at
9122 X_LONG_MAX rather than relying on wraparound overflow to send
9124 (x_get_window_property, receive_incremental_selection)
9125 (lisp_data_to_selection_data, x_property_data_to_lisp):
9126 Check for size-calculation overflow.
9127 (x_get_window_property, receive_incremental_selection)
9128 (lisp_data_to_selection_data, Fx_register_dnd_atom):
9129 Don't store size until memory allocation succeeds.
9130 (x_get_window_property): Plug memory leak on memory exhaustion.
9131 Don't double-block input; malloc is safe here. Don't assume 2**34
9132 - 4 fits in unsigned long. Add an xassert to check
9133 XGetWindowProperty overflow. Be more careful about overflow
9134 calculations, and distinguish size from memory overflow better.
9135 (receive_incremental_selection): When tracing, don't assume
9136 unsigned int is less than INT_MAX.
9137 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
9138 harmful) conversions of unsigned short to int.
9139 (lisp_data_to_selection_data): Don't assume that integers
9140 in the range -65535 through -1 fit in an X unsigned short.
9141 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
9142 result parameters unless successful. Rely on cons_to_unsigned
9143 to report problems with elements; the old code wasn't right anyway.
9144 (x_check_property_data): Check for int overflow; we cannot use
9145 a wider type due to X limits.
9146 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
9148 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
9150 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
9151 (x_term_init): Check for size calculation overflow.
9152 (x_color_cells): Don't store size until memory allocation succeeds.
9153 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
9154 Don't assume alloca size is less than MAX_ALLOCA.
9155 (x_term_init): Don't assume length fits in int (sprintf is limited
9158 Use ptrdiff_t for composition IDs.
9159 * character.c (lisp_string_width):
9160 * composite.c (composition_table_size, n_compositions)
9161 (get_composition_id, composition_gstring_from_id):
9162 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
9163 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
9164 * window.c (Frecenter):
9165 Use ptrdiff_t, not int, for composition IDs.
9166 * composite.c (get_composition_id): Check for integer overflow.
9167 * composite.h: Adjust prototypes to match the above changes.
9169 Use ptrdiff_t for hash table indexes.
9170 * category.c (hash_get_category_set):
9171 * ccl.c (ccl_driver):
9172 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
9173 * coding.c (coding_system_charset_list, detect_coding_system):
9174 * coding.h (struct coding_system.id):
9175 * composite.c (get_composition_id, gstring_lookup_cache):
9176 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
9177 * image.c (xpm_get_color_table_h):
9178 * lisp.h (hash_lookup, hash_put):
9179 * minibuf.c (Ftest_completion):
9180 Use ptrdiff_t for hash table indexes, not int (which is too
9181 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
9182 32-bit --with-wide-int hosts).
9184 * charset.c (Fdefine_charset_internal): Check for integer overflow.
9185 Add a FIXME comment about memory leaks.
9186 (syms_of_charset): Don't assume xmalloc returns.
9188 Don't assume that stated character widths fit in int.
9189 * character.c (Fchar_width, c_string_width, lisp_string_width):
9190 * character.h (CHAR_WIDTH):
9191 * indent.c (MULTIBYTE_BYTES_WIDTH):
9192 Use sanitize_char_width to avoid undefined and/or bad behavior
9193 with outlandish widths.
9194 * character.h (sanitize_tab_width): Rename from sanitize_width,
9195 now that we have two such functions. All uses changed.
9196 (sanitize_char_width): New inline function.
9198 Don't assume that tab-width fits in int.
9199 * character.h (sanitize_width): New inline function.
9200 (SANE_TAB_WIDTH): New macro.
9201 (ASCII_CHAR_WIDTH): Use it.
9202 * indent.c (sane_tab_width): Remove. All uses replaced by
9203 SANE_TAB_WIDTH (current_buffer).
9204 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
9206 * fileio.c: Integer overflow issues with file modes.
9207 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
9209 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
9210 Remove unreachable code.
9211 (read_hex, load_charset_map_from_file): Check for integer overflow.
9213 * xterm.c: Don't go over XClientMessageEvent limit.
9214 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
9215 (x_send_scroll_bar_event): Likewise. Check that the size does not
9216 exceed limits imposed by XClientMessageEvent, as well as the usual
9217 ptrdiff_t and size_t limits.
9219 * keyboard.c: Overflow, signedness and related fixes.
9220 (make_lispy_movement): Use same integer type in forward decl
9221 that is used in the definition.
9222 (read_key_sequence, keyremap_step):
9223 Change bufsize argument back to int, undoing my 2011-03-30 change.
9224 We prefer signed types, and int is wide enough here.
9225 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
9226 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
9227 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
9228 length, not size_t. Use ptrdiff_t for index, not int.
9229 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
9230 possibility of integer overflow.
9232 Overflow, signedness and related fixes for images.
9234 * dispextern.h (struct it.stack[0].u.image.image_id)
9235 (struct_it.image_id, struct image.id, struct image_cache.size)
9236 (struct image_cache.used, struct image_cache.ref_count):
9237 * gtkutil.c (update_frame_tool_bar):
9238 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
9239 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
9240 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
9241 * nsmenu.m (update_frame_tool_bar):
9242 * xdisp.c (calc_pixel_width_or_height):
9243 * xfns.c (image_cache_refcount):
9244 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
9245 on typical 64-bit hosts.
9247 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9248 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
9249 Omit unnecessary casts to int.
9250 (parse_image_spec): Check that integers fall into 'int' range
9251 when the callers expect that.
9252 (image_ascent): Redo ascent calculation to avoid int overflow.
9253 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
9254 (lookup_image): Remove unnecessary tests.
9255 (xbm_image_p): Locals are now of int, not EMACS_INT,
9256 since parse_image_check makes sure they fit into int.
9257 (png_load, gif_load, svg_load_image):
9258 Prefer int to unsigned where either will do.
9259 (tiff_handler): New function, combining the cores of the
9260 old tiff_error_handler and tiff_warning_handler.
9261 This function is rewritten to use vsnprintf and thereby avoid
9262 stack buffer overflows. It uses only the features of vsnprintf
9263 that are common to both POSIX and native Microsoft.
9264 (tiff_error_handler, tiff_warning_handler): Use it.
9265 (tiff_load, gif_load, imagemagick_load_image):
9266 Don't assume :index value fits in 'int'.
9267 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
9268 (imagemagick_load_image): Check that crop parameters fit into
9269 the integer types that MagickCropImage accepts. Don't assume
9270 Vimagemagick_render_type has a nonnegative value. Don't assume
9271 size_t fits in 'long'.
9272 (gs_load): Use printmax_t to print the widest integers possible.
9273 Check for integer overflow when computing image height and width.
9275 2011-08-26 Eli Zaretskii <eliz@gnu.org>
9277 * xdisp.c (redisplay_window): Don't force window start if point
9278 will be invisible in the resulting window. (Bug#9324)
9280 2011-08-25 Eli Zaretskii <eliz@gnu.org>
9282 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
9283 the display spec is of the form `(space ...)'.
9284 (handle_display_spec): Return the value returned by
9285 handle_single_display_spec, not just 1 or zero.
9286 (handle_single_display_spec): If the display spec is of the form
9287 `(space ...)', and specifies display in the text area, return 2
9289 (try_cursor_movement): Check for the need to scroll more
9290 accurately, and prefer exact match for point under bidi.
9291 Don't advance `row' beyond the last row of the window.
9293 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
9294 into disp_prop; all users changed.
9296 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
9297 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
9298 for the text covered by the display property.
9300 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
9302 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
9303 Change return value to nil.
9304 (Frecord_buffer): Delete unused function.
9306 2011-08-24 Eli Zaretskii <eliz@gnu.org>
9308 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
9309 buffers, return left-to-right.
9310 (set_cursor_from_row): Consider candidate row a win if its glyph
9311 represents a newline and point is on that newline. Fixes cursor
9312 positioning on the newline at EOL of R2L text within L2R
9313 paragraph, and vice versa.
9314 (try_cursor_movement): Check continued rows, in addition to
9315 continuation rows. Fixes unwarranted scroll when point enters a
9316 continued line of R2L text within an L2R paragraph, or vice versa.
9317 (cursor_row_p): Consider the case of point being equal to
9318 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
9319 from the end of a short line to the beginning of a continued line
9320 of R2L text within L2R paragraph.
9321 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
9322 composed characters.
9324 * bidi.c (bidi_check_type): Use xassert.
9325 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
9328 2011-08-23 Eli Zaretskii <eliz@gnu.org>
9330 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
9333 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
9335 * nsfont.m (ns_otf_to_script): Fix typo.
9337 2011-08-22 Kenichi Handa <handa@m17n.org>
9339 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
9340 extra slot even if the purpose is char-code-property-table.
9342 2011-08-23 Eli Zaretskii <eliz@gnu.org>
9344 * xdisp.c (redisplay_window): When computing centering_position,
9345 account for the height of the header line. (Bug#8874)
9347 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
9348 instead of CHAR_TO_BYTE. Fixes a crash when a completion
9349 candidate is selected by the mouse, and that candidate has a
9350 composed character under the mouse.
9352 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
9353 coordinates reported by pos-visible-in-window-p for a composed
9354 character in column zero.
9356 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
9358 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
9360 2011-08-22 Eli Zaretskii <eliz@gnu.org>
9362 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
9363 consider it a hit if to_charpos is anywhere in the range of the
9364 composed buffer positions.
9366 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
9368 * image.c (gif_load): Don't assume that each subimage has the same
9369 dimensions as the base image. Handle disposal method that is
9370 "undefined" by the gif spec (Bug#9335).
9372 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
9374 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
9375 (Fcondition_case): Document `debug' symbol in error handler.
9377 2011-08-19 Eli Zaretskii <eliz@gnu.org>
9379 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
9380 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
9381 from an Org mode buffer to a Speedbar frame.
9383 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
9384 a composition, take its buffer position from IT->cmp_it.charpos.
9385 Fixes cursor positioning at the beginning of a line that begins
9386 with a composed character.
9388 2011-08-18 Eli Zaretskii <eliz@gnu.org>
9390 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
9391 character bidirectional type, use STRONG_L instead. Fixes crashes
9392 in a buffer produced by `describe-categories'.
9394 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
9395 members before the level stack, so they would be saved and
9396 restored when copying iterator state. Fixes incorrect reordering
9397 around TABs covered by display properties.
9399 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
9401 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
9403 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
9405 * eval.c (internal_condition_case, internal_condition_case_1)
9406 (internal_condition_case_2, internal_condition_case_n):
9407 Remove unnecessary aborts (Bug#9081).
9409 2011-08-17 Eli Zaretskii <eliz@gnu.org>
9411 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
9412 has no `load' handler, try opening the file locally. (Bug#9311)
9414 2011-08-16 Ken Brown <kbrown@cornell.edu>
9416 * gmalloc.c: Expand comment.
9418 2011-08-16 Eli Zaretskii <eliz@gnu.org>
9420 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
9421 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
9423 2011-08-16 Ken Brown <kbrown@cornell.edu>
9425 Fix memory allocation problems in Cygwin build (Bug#9273).
9427 * unexcw.c ( __malloc_initialized): Declare external variable.
9428 (fixup_executable): Force the dumped emacs to reinitialize malloc.
9430 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
9432 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
9434 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
9436 [CYGWIN] (special_realloc): New function.
9437 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
9438 requests to realloc storage in the static heap.
9440 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
9442 * bidi.c (bidi_initialize): Remove unused local.
9444 2011-08-15 Eli Zaretskii <eliz@gnu.org>
9447 * biditype.h: Remove file.
9448 * makefile.w32-in ($(BLD)/bidi.$(O)):
9449 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
9451 * dispextern.h: Fix a typo in the comment to bidi_type_t.
9453 * chartab.c: Improve commentary for the uniprop_table API.
9455 * bidi.c (bidi_paragraph_init): Support zero value of
9456 bidi_ignore_explicit_marks_for_paragraph_level.
9457 (bidi_initialize): Use uniprop_table instead of including
9458 biditype.h and bidimirror.h.
9460 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
9461 coordinates of the iterator when restoring from ppos_it.
9464 2011-08-14 Kenichi Handa <handa@m17n.org>
9466 * process.c (create_process): Call setup_process_coding_systems
9467 after the pid of the process is set to -1 (Bug#8162).
9469 2011-08-14 Eli Zaretskii <eliz@gnu.org>
9471 * xdisp.c (move_it_in_display_line_to): Don't invoke
9472 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
9473 ppos_it. Fixes vertical cursor motion when line beginning is
9474 covered by an image. (Bug#9296)
9476 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
9478 * nsterm.h (ns_run_ascript): Declare.
9479 (NSAPP_DATA2_RUNASSCRIPT): Define.
9481 * nsfns.m (as_script, as_result, as_status): New static variables.
9482 (ns_run_ascript): New function.
9483 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
9484 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
9485 the event loop. Get status from as_status (Bug#7276).
9487 * nsterm.m (sendEvent): If event is NSApplicationDefined and
9488 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
9489 the event loop (Bug#7276).
9491 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
9493 * gnutls.c (QCgnutls_bootprop_priority)
9494 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
9495 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
9496 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
9497 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
9498 (QCgnutls_bootprop_verify_hostname_error)
9499 (QCgnutls_bootprop_callbacks_verify): Rename from
9500 Qgnutls_bootprop_..., all uses changed.
9502 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
9505 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
9507 * xfaces.c (Qframe_set_background_mode): Now static.
9508 * dispextern.h (Qframe_set_background_mode): Remove decl.
9510 * process.c (Fnetwork_interface_info): Declare local only if needed.
9512 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
9514 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
9515 (Fnetwork_interface_list): Allocate in increments of bytes instead
9516 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
9517 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
9519 (struct ifflag_def): notrailers is smart on OSX.
9520 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
9521 Get hardware address with getifaddrs if available.
9523 2011-08-12 Eli Zaretskii <eliz@gnu.org>
9525 * xdisp.c (iterate_out_of_display_property): xassert that
9526 IT->position is set to within IT->object's boundaries. Break from
9527 the loop as soon as EOB is reached; avoids infloops in redisplay
9528 when IT->position is set up wrongly due to some bug.
9529 Set IT->current to match the bidi iterator unconditionally.
9530 (push_display_prop): Allow GET_FROM_STRING as IT->method on
9531 entry. Force push_it to save on the stack the current
9532 buffer/string position, to be restored by pop_it. Fix flags in
9533 the iterator structure wrt the object coming from a display
9534 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
9535 properties. (Bug#9284)
9537 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
9539 * fontset.c (fontset_get_font_group): Add proper type checks.
9542 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9544 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
9545 and LC_VERSION_MIN_MACOSX.
9546 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
9547 (dump_it) [LC_FUNCTION_STARTS]: Use it.
9549 2011-08-08 Eli Zaretskii <eliz@gnu.org>
9551 * xdisp.c (forward_to_next_line_start): Allow to use the
9552 no-display-properties-and-no-overlays under bidi display.
9553 Set disp_pos in the bidi iterator to avoid searches for display
9554 properties and overlays.
9556 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
9558 * editfns.c (Fset_time_zone_rule): Document relationship with the
9561 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
9562 the font entity extracted from the cache (Bug#8109).
9564 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
9566 * composite.c (autocmp_chars): Don't reset point. That is done by
9567 restore_point_unwind (Bug#5984).
9569 2011-08-07 Juri Linkov <juri@jurta.org>
9571 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
9572 to show the arg `TIME' instead of `TIMEVAL'.
9574 2011-08-06 Eli Zaretskii <eliz@gnu.org>
9576 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
9577 display property strides EOL and includes a newline, as in
9578 longlines-mode. (Bug#9254)
9579 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
9580 word-wrap under bidirectional display. (Bug#9224)
9582 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
9583 is non-zero, even if the data buffer is NULL. Fixes a crash in
9584 vertical-motion with longlines-mode. (Bug#9254)
9586 2011-08-05 Eli Zaretskii <eliz@gnu.org>
9588 * bidi.c <bidi_cache_total_alloc>: Now static.
9589 (bidi_initialize): Initialize bidi_cache_total_alloc.
9591 * xdisp.c (display_line): Release buffer allocated for shelved bidi
9594 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
9595 amount allocated this far in `bidi_cache_total_alloc'.
9596 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
9597 non-zero, only free the data buffer without restoring the cache
9598 contents. All callers changed.
9600 * dispextern.h (bidi_unshelve_cache): Update prototype.
9602 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
9603 (move_it_in_display_line, move_it_to)
9604 (move_it_vertically_backward, move_it_by_lines): Replace the call
9605 to xfree to an equivalent call to bidi_unshelve_cache.
9606 (move_it_in_display_line_to): Fix logic of returning
9607 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
9609 2011-08-05 Eli Zaretskii <eliz@gnu.org>
9611 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
9612 came from a string character with a `cursor' property. (Bug#9229)
9614 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
9616 * Makefile.in (LIB_PTHREAD): New variable.
9617 (LIBES): Add LIB_PTHREAD (Bug#9216).
9619 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
9620 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
9622 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
9624 * regex.c (re_iswctype): Remove some redundant boolean conversions.
9626 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
9628 * xterm.c (x_find_topmost_parent): New function.
9629 (x_set_frame_alpha): Find topmost parent window with
9630 x_find_topmost_parent and set the property there also (bug#9181).
9631 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
9633 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
9635 * callproc.c (Fcall_process): Avoid vfork clobbering
9636 the local vars buffer, coding_systems, current_dir.
9638 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
9640 * keymap.c (Fmake_composed_keymap): Move to subr.el.
9642 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
9644 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
9645 so that it is not optimized away.
9647 * xdisp.c (compute_display_string_pos): Remove unused local.
9649 2011-08-02 Eli Zaretskii <eliz@gnu.org>
9651 Fix slow cursor motion and scrolling in large buffers with
9652 selective display, like Org Mode buffers. (Bug#9218)
9654 * dispextern.h (struct bidi_it): New member disp_prop_p.
9656 * xdisp.c: Remove one-slot cache of display string positions.
9657 (compute_display_string_pos): Accept an additional argument
9658 DISP_PROP_P; callers changed. Scan at most 5K characters forward
9659 for a display string or property. If found, set DISP_PROP_P
9662 * bidi.c (bidi_fetch_char): Accept an additional argument
9663 DISP_PROP_P, and pass it to compute_display_string_pos.
9664 Only handle text covered by a display string if DISP_PROP_P is returned
9665 non-zero. All callers of bidi_fetch_char changed.
9667 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
9669 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
9671 2010-12-03 Don March <don@ohspite.net>
9673 * keymap.c (Fdefine_key): Fix non-prefix key error message when
9674 last character M-[char] is translated to ESC [char] (bug#7541).
9676 2011-08-02 Kenichi Handa <handa@m17n.org>
9678 * lisp.h (uniprop_table): Extern it.
9680 * chartab.c (uniprop_table): Make it non-static.
9682 2011-08-01 Eli Zaretskii <eliz@gnu.org>
9684 * xdisp.c (forward_to_next_line_start): Accept additional argument
9685 BIDI_IT_PREV, and store into it the state of the bidi iterator had
9687 (reseat_at_next_visible_line_start): Use the bidi iterator state
9688 returned by forward_to_next_line_start to restore the state of
9689 it->bidi_it after backing up to previous newline. (Bug#9212)
9691 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
9693 * regex.c (re_comp): Protoize.
9694 (re_exec): Fix return type.
9695 (regexec): Fix type of `ret'. (Bug#9203)
9697 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
9699 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
9700 This is needed if max-image-size is a floating-point number.
9702 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
9704 * print.c (print_object): Print empty symbol as ##.
9706 * lread.c (read1): Read ## as empty symbol.
9708 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
9710 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
9711 setting frame foreground color (Bug#9175).
9712 (x_set_background_color): Likewise.
9714 * nsmenu.m (-setText): Size tooltip dimensions precisely to
9715 contents (Bug#9176).
9716 (EmacsTooltip -init): Remove bezels and add shadows to
9719 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
9720 or scroll bar (Bug#8470).
9722 * nsfont.m (nsfont_open): Remove assignment to voffset and
9723 unnecessary vars hshink, expand, hd, full_height, min_height.
9724 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
9726 * nsterm.h (nsfont_info): Remove voffset field.
9728 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
9730 Implement strike-through and overline on NextStep (Bug#8863).
9732 * nsfont.m (nsfont_open): Use underline position provided by font,
9733 instead of hard-coded value of 2.
9734 (nsfont_draw): Call ns_draw_text_decoration instead.
9736 * nsterm.h: Add declaration for ns_draw_text_decoration.
9738 * nsterm.m (ns_draw_text_decoration): New function for drawing
9739 underline, overline, and strike-through.
9740 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
9741 ns_draw_text_decoration. Change treatment of cursor drawing to
9742 accommodate underlining, etc.
9744 2011-07-28 Eli Zaretskii <eliz@gnu.org>
9746 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
9749 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
9751 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
9752 Without this fix, if a signal arrives just after memory fills up,
9753 'malloc' might be invoked reentrantly.
9755 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
9756 In other words, assume that every image size is allowed, on non-X
9757 hosts. This assumption is probably wrong, but it lets Emacs compile.
9759 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
9761 * regex.c (re_iswctype): Convert return values to boolean.
9763 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
9765 * xdisp.c (compute_display_string_pos): Don't use cached display
9766 string position if the buffer had its restriction changed.
9769 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
9771 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
9773 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
9775 Integer signedness and overflow and related fixes. (Bug#9079)
9777 * bidi.c: Integer size and overflow fixes.
9778 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
9779 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
9780 (bidi_cache_find_level_change, bidi_cache_ensure_space)
9781 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
9782 (bidi_find_other_level_edge):
9783 Use ptrdiff_t instead of EMACS_INT where either will do.
9784 This works better on 32-bit hosts configured --with-wide-int.
9785 (bidi_cache_ensure_space): Check for size-calculation overflow.
9786 Use % rather than repeated addition, for better worst-case speed.
9787 Don't set bidi_cache_size until after xrealloc returns, because it
9789 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
9790 (bidi_cache_ensure_space): Also check that the bidi cache size
9791 does not exceed that of the largest Lisp string or buffer. See Eli
9792 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
9794 * alloc.c (__malloc_size_t): Remove.
9795 All uses replaced by size_t. See Andreas Schwab's note
9796 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
9798 * image.c: Improve checking for integer overflow.
9799 (check_image_size): Assume that f is nonnull, since
9800 it is always nonnull in practice. This is one less thing to
9801 worry about when checking for integer overflow later.
9802 (x_check_image_size): New function, which checks for integer
9803 overflow issues inside X.
9804 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
9805 This removes the need for a memory_full check.
9806 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
9807 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
9808 (xbm_read_bitmap_data): Change locals back to 'int', since
9809 their values must fit in 'int'.
9810 (xpm_load_image, png_load, tiff_load):
9811 Invoke x_create_x_image_and_pixmap earlier,
9812 to avoid much needless work if the image is too large.
9813 (tiff_load): Treat overly large images as if
9814 x_create_x_image_and_pixmap failed, not as malloc failures.
9815 (gs_load): Use x_check_image_size.
9817 * gtkutil.c: Omit integer casts.
9818 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
9819 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
9821 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
9823 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
9824 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
9825 would wrongly return t on a 64-bit host.
9827 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
9828 The plain *_OVERFLOW macros run afoul of GCC bug 49705
9829 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
9830 and therefore cause GCC to emit a bogus diagnostic in some cases.
9832 * image.c: Integer signedness and overflow and related fixes.
9833 This is not an exhaustive set of fixes, but it's time to
9834 record what I've got.
9835 (lookup_pixel_color, check_image_size): Remove redundant decls.
9836 (check_image_size): Don't assume that arbitrary EMACS_INT values
9837 fit in 'int', or that arbitrary 'double' values fit in 'int'.
9838 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
9839 (tiff_load, imagemagick_load_image):
9840 Check for overflow in size calculations.
9841 (x_create_x_image_and_pixmap): Remove unnecessary test for
9842 xmalloc returning NULL; that can't happen.
9843 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
9844 (xpm_color_bucket): Use better integer hashing function.
9845 (xpm_cache_color): Don't possibly over-allocate memory.
9846 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
9847 (gif_memory_source):
9848 Use ptrdiff_t, not int or size_t, to record sizes.
9849 (png_load): Don't assume values greater than 2**31 fit in 'int'.
9850 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
9851 either works, as we prefer signed integers.
9852 (tiff_read_from_memory, tiff_write_from_memory):
9853 Return tsize_t, not size_t, since that's what the TIFF API wants.
9854 (tiff_read_from_memory): Don't fail simply because the read would
9855 go past EOF; instead, return a short read.
9856 (tiff_load): Omit no-longer-needed casts.
9857 (Fimagemagick_types): Don't assume size fits into 'int'.
9859 Improve hashing quality when configured --with-wide-int.
9860 * fns.c (hash_string): New function, taken from sxhash_string.
9861 Do not discard information about ASCII character case; this
9862 discarding is no longer needed.
9863 (sxhash-string): Use it. Change sig to match it. Caller changed.
9864 * lisp.h: Declare it.
9865 * lread.c (hash_string): Remove, since we now use fns.c's version.
9866 The fns.c version returns a wider integer if --with-wide-int is
9867 specified, so this should help the quality of the hashing a bit.
9869 * emacs.c: Integer overflow minor fix.
9870 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
9871 Define only if GNU_LINUX.
9872 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
9874 * dispnew.c: Integer signedness and overflow fixes.
9875 Remove unnecessary forward decls, that were a maintenance hassle.
9876 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
9878 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
9879 (scrolling_window): Use ptrdiff_t, not int, for byte count.
9880 (prepare_desired_row, line_draw_cost):
9881 Use int, not unsigned, where either works.
9882 (save_current_matrix, restore_current_matrix):
9883 Use ptrdiff_t, not size_t, where either works.
9884 (init_display): Check for overflow more accurately, and without
9885 relying on undefined behavior.
9887 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
9888 Remove, replacing with the new symbols in lisp.h. All uses changed.
9889 * fileio.c (make_temp_name):
9890 * filelock.c (lock_file_1, lock_file):
9891 * xdisp.c (message_dolog):
9892 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
9893 Use pMd etc. instead.
9894 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
9895 replacing the pWIDE etc. symbols removed from editfns.c.
9897 * keyboard.h (num_input_events): Now uintmax_t.
9898 This is (very slightly) less likely to mess up due to wraparound.
9901 * buffer.c: Integer signedness fixes.
9902 (alloc_buffer_text, enlarge_buffer_text):
9903 Use ptrdiff_t rather than size_t when either will do, as we prefer
9906 * alloc.c: Integer signedness and overflow fixes.
9907 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
9908 (__malloc_size_t): Default to size_t, not to int.
9909 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
9910 (Fgarbage_collect, mark_object_loop_halt, mark_object):
9911 Prefer ptrdiff_t to size_t when either would do, as we prefer
9913 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
9914 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
9915 Now const. Initialize with values that are in range even if char
9917 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
9918 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
9919 These functions do the right thing with sizes > 2**32.
9920 (check_depth): Now ptrdiff_t, not int.
9921 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
9922 Adjust to new way of storing sizes. Check for size overflow bugs
9924 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
9925 slightly wrong anyway, as it missed one instance of
9926 XMALLOC_OVERRUN_CHECK_OVERHEAD.
9927 (refill_memory_reserve): Omit needless cast to size_t.
9928 (mark_object_loop_halt): Mark as externally visible.
9930 * xselect.c: Integer signedness and overflow fixes.
9931 (Fx_register_dnd_atom, x_handle_dnd_message):
9932 Use ptrdiff_t, not size_t, since we prefer signed.
9933 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
9934 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
9935 x_dnd_atoms_size and x_dnd_atoms_length.
9937 * doprnt.c: Prefer signed to unsigned when either works.
9939 * doprnt.c (doprnt):
9941 * xdisp.c (vmessage):
9942 Use ptrdiff_t, not size_t, when using or implementing doprnt,
9943 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
9944 prefer signed arithmetic to avoid comparison confusion.
9945 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
9946 but is a bit tricky.
9948 Assume freestanding C89 headers, string.h, stdlib.h.
9949 * data.c, doprnt.c, floatfns.c, print.c:
9950 Include float.h unconditionally.
9951 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
9952 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
9953 * regex.c: Likewise for stddef.h, string.h.
9954 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
9955 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
9956 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
9957 (STDC_HEADERS): Remove obsolete defines.
9958 * sysdep.c: Include limits.h unconditionally.
9960 Assume support for memcmp, memcpy, memmove, memset.
9961 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
9962 * regex.c (memcmp, memcpy):
9963 Remove; we assume C89 now.
9965 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
9966 (__malloc_safe_bcopy): Remove; no longer needed.
9968 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
9969 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
9970 well either way, and we prefer signed to unsigned.
9972 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
9974 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
9975 closes the connection while we're reading (bug#9182).
9977 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
9979 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
9980 are specified (Bug#9168).
9982 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
9984 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
9985 Found by GCC static checking and --with-wide-int on a 32-bit host.
9987 2011-07-25 Eli Zaretskii <eliz@gnu.org>
9989 * xdisp.c (compute_display_string_pos): Fix logic of caching
9990 previous display string position. Initialize cached_prev_pos to
9991 -1. Fixes slow-down at the beginning of a buffer.
9993 2011-07-24 Eli Zaretskii <eliz@gnu.org>
9995 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
9996 for attrs[LFACE_FONTSET_INDEX].
9998 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
10000 * xml.c (parse_region): Remove unused local
10001 that was recently introduced.
10003 2011-07-23 Eli Zaretskii <eliz@gnu.org>
10005 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
10006 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
10008 * xdisp.c (move_it_in_display_line_to): Record the best matching
10009 position for TO_CHARPOS while scanning the line, and restore it on
10010 exit if none of the characters scanned was an exact match.
10011 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
10012 when exact match is impossible due to invisible text, and the
10013 lines are truncated.
10015 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
10017 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
10020 2011-07-22 Eli Zaretskii <eliz@gnu.org>
10022 Fix a significant slow-down of cursor motion with C-n, C-p,
10023 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
10024 auto-repeat under bidi redisplay in fontified buffers.
10025 * xdisp.c (compute_stop_pos_backwards): New function.
10026 (next_element_from_buffer): Call compute_stop_pos_backwards to
10027 find a suitable prev_stop when we find ourselves before
10029 (reseat): Don't look for prev_stop, as that could mean a very long
10031 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
10032 <cached_disp_overlay_modiff>: Cache for last found display string
10034 (compute_display_string_pos): Return the cached position if asked
10035 about the same buffer in the same area of character positions, and
10036 the buffer wasn't changed since the time the display string
10037 position was cached.
10039 2011-07-22 Eli Zaretskii <eliz@gnu.org>
10041 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
10042 is an integer, which is important for empty lines. (Bug#9149)
10044 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
10046 * frame.c (Fmodify_frame_parameters): In tty case, update the
10047 default face if necessary (Bug#4238).
10049 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
10051 * editfns.c (Fstring_to_char): No need to explain what a character
10052 is in the docstring (Bug#6576).
10054 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10056 * xml.c (parse_region): Make sure we always return a tree.
10058 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
10060 * xml.c (parse_region): If a document contains only comments,
10063 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10065 * xml.c (make_dom): Return comments, too.
10067 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
10070 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
10071 and the surrounding thread.
10072 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
10073 rather than fgets, and retry after EINTR. Otherwise, 'emacs
10074 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
10076 * s/openbsd.h (BROKEN_SIGIO): Define.
10077 * unexelf.c (unexec) [__OpenBSD__]:
10078 Don't update the .mdebug section of the Alpha COFF symbol table.
10080 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10082 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
10085 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
10087 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
10088 This fixes some race conditions on the permissions of any newly
10091 * alloc.c (valid_pointer_p): Use pipe, not open.
10092 This fixes some permissions issues when debugging.
10094 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
10095 If fchown fails to set both uid and gid, try to set just gid,
10096 as that is sometimes allowed. Adjust the file's mode to eliminate
10097 setuid or setgid bits that are inappropriate if fchown fails.
10099 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10101 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
10102 to compare Lisp_Objects.
10103 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
10104 global_gnutls_log_level, don't mistake it for a Lisp_Object.
10105 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
10107 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
10109 * lread.c (read_integer): Unread even EOF character.
10110 (read1): Likewise. Properly record start position of symbol.
10112 * lread.c (read1): Read `#:' as empty uninterned symbol if no
10113 symbol character follows.
10115 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
10117 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
10118 This works around a problem with the previous change to Fcopy_file.
10119 Recent glibc declares fchown with __attribute__((warn_unused_result)),
10120 and without this change, GCC might complain about discarding
10121 fchown's return value.
10123 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
10125 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
10127 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
10129 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
10131 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
10133 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
10134 it's used from the C level.
10136 * process.c: Use the same condition for POLL_FOR_INPUT in both
10137 keyboard.c and process.c (bug#1858).
10139 2011-07-09 Lawrence Mitchell <wence@gmx.li>
10141 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
10142 (Fgnutls_boot): Use it.
10144 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
10146 * doc.c (Fsubstitute_command_keys): Revert last change.
10148 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
10150 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
10151 quotes the next character, and doesn't affect other longer
10152 sequences (bug#8935).
10154 * lread.c (syms_of_lread): Clarify that is isn't only
10155 `eval-buffer' and `eval-defun' that's affected by
10156 `lexical-binding' (bug#8460).
10158 2011-07-15 Eli Zaretskii <eliz@gnu.org>
10160 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
10161 bidi redisplay when a line includes both an image and is truncated.
10163 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
10165 Fix minor problems found by static checking.
10166 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
10167 (elsz): Now a signed constant, not a size_t var. We prefer signed
10168 types to unsigned, to avoid integer comparison confusion. Without
10169 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
10170 "cannot optimize loop, the loop counter may overflow", a symptom
10172 * indent.c (Fvertical_motion): Mark locals as initialized.
10173 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
10175 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
10177 * search.c (Fre_search_backward): Mention `case-fold-search' in
10178 all the re_search_* functions (bug#8138).
10180 * keyboard.c (Fopen_dribble_file): Document when the file is
10183 2011-07-14 Eli Zaretskii <eliz@gnu.org>
10185 * bidi.c (bidi_dump_cached_states): Fix format of displaying
10188 Support bidi reordering of display and overlay strings.
10189 * xdisp.c (compute_display_string_pos)
10190 (compute_display_string_end): Accept additional argument STRING.
10191 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
10192 (reseat_to_string): Initialize bidi_it->string.s and
10193 bidi_it->string.schars.
10194 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
10195 NULL (avoids a crash in bidi_paragraph_init).
10196 Initialize itb.string.lstring.
10197 (init_iterator): Call bidi_init_it only of a valid
10198 buffer position was specified. Initialize paragraph_embedding to
10200 (reseat_to_string): Initialize the bidi iterator.
10201 (display_string): If we need to ignore text properties of
10202 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
10203 original value of -1 will not work with bidi.)
10204 (compute_display_string_pos): First arg is now struct
10205 `text_pos *'; all callers changed. Support display properties on
10207 (compute_display_string_end): Support display properties on Lisp
10209 (init_iterator, reseat_1, reseat_to_string): Initialize the
10210 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
10211 when iterating on a string not from display properties).
10212 (compute_display_string_pos, compute_display_string_end):
10213 Fix calculation of the object to scan. Fixes an error when using
10215 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
10216 base_level_stop; instead, set base_level_stop to BEGV.
10217 Fixes crashes in vertical-motion.
10218 (next_element_from_buffer): Improve commentary for when
10219 the iterator is before prev_stop.
10220 (init_iterator): Initialize bidi_p from the default value of
10221 bidi-display-reordering, not from buffer-local value. Use the
10222 buffer-local value only if initializing for buffer iteration.
10223 (handle_invisible_prop): Support invisible properties on strings
10224 that are being bidi-reordered.
10225 (set_iterator_to_next): Support bidi reordering of C strings and
10227 (next_element_from_string): Support bidi reordering of Lisp
10229 (handle_stop_backwards): Support Lisp strings as well.
10230 (display_string): Support display of R2L glyph rows.
10231 Use IT_STRING_CHARPOS when displaying from a Lisp string.
10232 (init_iterator): Don't initialize it->bidi_p for strings
10234 (reseat_to_string): Initialize it->bidi_p for strings here.
10235 (next_element_from_string, next_element_from_c_string)
10236 (next_element_from_buffer): Add xassert's for correspondence
10237 between IT's object being iterated and it->bidi_it.string
10239 (face_before_or_after_it_pos): Support bidi iteration.
10240 (next_element_from_c_string): Handle the case of the first string
10241 character that is not the first one in the visual order.
10242 (get_visually_first_element): New function, refactored from common
10243 parts of next_element_from_buffer, next_element_from_string, and
10244 next_element_from_c_string.
10245 (tool_bar_lines_needed, redisplay_tool_bar)
10246 (display_menu_bar): Force left-to-right direction. Add a FIXME
10247 comment for making that be controlled by a user option.
10248 (push_it, pop_it): Save and restore the state of the
10249 bidi iterator. Save and restore the bidi_p flag.
10250 (pop_it): Iterate out of display property for string iteration as
10252 (iterate_out_of_display_property): Support iteration over strings.
10253 (handle_single_display_spec): Set up it->bidi_it for iteration
10254 over a display string, and call bidi_init_it.
10255 (handle_single_display_spec, next_overlay_string)
10256 (get_overlay_strings_1, push_display_prop): Set up the bidi
10257 iterator for displaying display or overlay strings.
10258 (forward_to_next_line_start): Don't use the shortcut if
10260 (back_to_previous_visible_line_start): If handle_display_prop
10261 pushed the iterator stack, restore the internal state of the bidi
10262 iterator by calling bidi_pop_it same number of times.
10263 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
10264 and we are bidi-iterating, don't decrement the iterator position;
10265 instead, set the first_elt flag in the bidi iterator, to produce
10267 (reseat_1): Remove redundant setting of string_from_display_prop_p.
10268 (push_display_prop): xassert that we are iterating a buffer.
10269 (push_it, pop_it): Save and restore paragraph_embedding member.
10270 (handle_single_display_spec, next_overlay_string)
10271 (get_overlay_strings_1, reseat_1, reseat_to_string)
10272 (push_display_prop): Set up the `unibyte' member of bidi_it.string
10273 correctly. Don't assume unibyte strings are not bidi-reordered.
10274 (compute_display_string_pos)
10275 (compute_display_string_end): Fix handling the case of C string.
10276 (push_it, pop_it): Save and restore from_disp_prop_p.
10277 (handle_single_display_spec, push_display_prop): Set the
10278 from_disp_prop_p flag.
10279 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
10280 (pop_it): Call iterate_out_of_display_property only if we are
10281 popping after iteration over a string that came from a display
10282 property. Fix a typo in popping stretch info. Add an assertion
10283 for verifying that the iterator position is in sync with the bidi
10285 (handle_single_display_spec, get_overlay_strings_1)
10286 (push_display_prop): Fix initialization of paragraph direction for
10287 string when that of the parent object is not yet determined.
10288 (reseat_1): Call bidi_init_it to resync the bidi
10289 iterator with IT's position. (Bug#7616)
10290 (find_row_edges): If ROW->start.pos gives position
10291 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
10292 (handle_stop, back_to_previous_visible_line_start, reseat_1):
10293 Reset the from_disp_prop_p flag.
10294 (SAVE_IT, RESTORE_IT): New macros.
10295 (pos_visible_p, face_before_or_after_it_pos)
10296 (back_to_previous_visible_line_start)
10297 (move_it_in_display_line_to, move_it_in_display_line)
10298 (move_it_to, move_it_vertically_backward, move_it_by_lines)
10299 (try_scrolling, redisplay_window, display_line): Use them when
10300 saving a temporary copy of the iterator and restoring it back.
10301 (back_to_previous_visible_line_start, reseat_1)
10302 (init_iterator): Empty the bidi cache "stack".
10303 (move_it_in_display_line_to): If iterator ended up at
10304 EOL, but we never saw any buffer positions smaller than
10305 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
10306 motion in bidi-reordered lines.
10307 (move_it_in_display_line_to): Record prev_method and prev_pos
10308 immediately before the call to set_iterator_to_next. Fixes cursor
10309 motion in bidi-reordered lines with stretch glyphs and strings
10310 displayed in margins. (Bug#8133) (Bug#8867)
10311 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
10313 (pos_visible_p): Support positions in bidi-reordered lines.
10314 Save and restore bidi cache.
10316 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
10317 (bidi_paragraph_info): Delete unused struct.
10318 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
10319 (bidi_cache_start): New variable.
10320 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
10322 (bidi_cache_fetch_state, bidi_cache_search)
10323 (bidi_cache_find_level_change, bidi_cache_iterator_state)
10324 (bidi_cache_find, bidi_peek_at_next_level)
10325 (bidi_level_of_next_char, bidi_find_other_level_edge)
10326 (bidi_move_to_visually_next): Compare cache index with
10327 bidi_cache_start rather than with zero.
10328 (bidi_fetch_char): Accept new argument STRING; all callers
10329 changed. Support iteration over a string. Support strings with
10330 display properties. Support unibyte strings. Fix the type of
10331 `len' according to what STRING_CHAR_AND_LENGTH expects.
10332 (bidi_paragraph_init, bidi_resolve_explicit_1)
10333 (bidi_resolve_explicit, bidi_resolve_weak)
10334 (bidi_level_of_next_char, bidi_move_to_visually_next):
10335 Support iteration over a string.
10336 (bidi_set_sor_type, bidi_resolve_explicit_1)
10337 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
10338 can now be zero (for strings); special values 0 and -1 were
10339 changed to -1 and -2, respectively.
10340 (bidi_char_at_pos): New function.
10341 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
10342 Call it instead of FETCH_MULTIBYTE_CHAR.
10343 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
10344 initialized to valid values.
10345 (bidi_init_it): Don't initialize charpos and bytepos with invalid
10347 (bidi_level_of_next_char): Allow the sentinel "position" to pass
10348 the test for valid cached positions. Fix the logic for looking up
10349 the sentinel state in the cache. GCPRO the Lisp string we are
10351 (bidi_push_it, bidi_pop_it): New functions.
10352 (bidi_initialize): Initialize the bidi cache start stack pointer.
10353 (bidi_cache_ensure_space): New function, refactored from part of
10354 bidi_cache_iterator_state. Don't assume the required size is just
10355 one BIDI_CACHE_CHUNK away.
10356 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
10357 (bidi_count_bytes, bidi_char_at_pos): New functions.
10358 (bidi_cache_search): Don't assume bidi_cache_last_idx is
10359 always valid if bidi_cache_idx is valid.
10360 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
10361 is valid if it's going to be used.
10362 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
10363 (bidi_cache_fetch_state, bidi_cache_search)
10364 (bidi_cache_find_level_change, bidi_cache_ensure_space)
10365 (bidi_cache_iterator_state, bidi_cache_find)
10366 (bidi_find_other_level_edge, bidi_cache_start_stack):
10367 All variables related to cache indices are now EMACS_INT.
10369 * dispextern.h (struct bidi_string_data): New structure.
10370 (struct bidi_it): New member `string'. Make flag members be 1-bit
10371 fields, and put them last in the struct.
10372 (compute_display_string_pos, compute_display_string_end):
10374 (bidi_push_it, bidi_pop_it): Add prototypes.
10375 (struct iterator_stack_entry): New members bidi_p,
10376 paragraph_embedding, and from_disp_prop_p.
10377 (struct it): Member bidi_p is now a bit field 1 bit wide.
10378 (bidi_shelve_cache, bidi_unshelve_cache):
10379 Declare prototypes.
10381 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
10382 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
10383 and vector-like objects.
10385 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
10386 cache around display iteration.
10388 * window.c (Fwindow_end, window_scroll_pixel_based)
10389 (displayed_window_lines, Frecenter): Save and restore the bidi
10390 cache around display iteration.
10392 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
10394 * editfns.c (Fdelete_region): Clarify the use of the named
10395 parameters (bug#6788).
10397 2011-07-14 Martin Rudalics <rudalics@gmx.at>
10399 * indent.c (Fvertical_motion): Set and restore w->pointm when
10400 saving and restoring the window's buffer (Bug#9006).
10402 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
10404 * editfns.c (Fstring_to_char): Clarify just what is returned
10405 (bug#6576). Text by Eli Zaretskii.
10407 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
10409 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
10411 2011-07-13 Eli Zaretskii <eliz@gnu.org>
10413 * buffer.c (mmap_find): Fix a typo.
10415 2011-07-13 Johan Bockgård <bojohan@gnu.org>
10417 Fix execution of x selection hooks.
10418 * xselect.c (Qx_lost_selection_functions)
10419 (Qx_sent_selection_functions): New vars.
10420 (syms_of_xselect): DEFSYM them.
10421 (x_handle_selection_request): Pass Qx_sent_selection_functions
10422 rather than Vx_sent_selection_functions to Frun_hook_with_args.
10423 (x_handle_selection_clear,x_clear_frame_selections):
10424 Pass Qx_lost_selection_functions rather than
10425 Vx_lost_selection_functions to Frun_hook_with_args.
10427 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
10429 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
10430 The old code sometimes used this field without initializing it.
10432 * alloc.c (gc_sweep): Don't read past end of array.
10433 In theory, the old code could also have corrupted Emacs internals,
10434 though it'd be very unlikely.
10436 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
10438 * character.c (Fcharacterp): Don't advertise optional ignored
10439 argument. (Bug#4026)
10441 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
10443 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
10446 * window.c (Fset_window_start): Doc fix (bug#4199).
10447 (Fset_window_hscroll): Ditto.
10449 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
10451 Fix minor new problems caught by GCC 4.6.1.
10452 * term.c (init_tty): Remove unused local.
10453 * xsettings.c (store_monospaced_changed): Define this function only
10454 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
10455 not used otherwise.
10457 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
10459 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
10461 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10463 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
10464 are the mini-buffer and the echo area (bug#3320).
10466 * term.c (init_tty): Remove support for supdup, c10 and perq
10467 terminals, which are no longer supported (bug#1482).
10469 2011-07-10 Johan Bockgård <bojohan@gnu.org>
10471 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
10473 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
10475 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
10476 for non-popups (Bug#3642).
10478 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
10480 * alloc.c (reset_malloc_hooks): Protoize.
10481 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
10482 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
10483 * cm.c (losecursor): Likewise.
10484 * data.c (fmod): Likewise.
10485 * dispnew.c (swap_glyphs_in_rows): Likewise.
10486 * emacs.c (memory_warning_signal): Likewise.
10487 * floatfns.c (float_error): Likewise.
10488 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
10489 (otf_open, font_otf_capability, generate_otf_features)
10490 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
10492 * image.c (pbm_read_file): Likewise.
10493 * indent.c (string_display_width): Likewise.
10494 * intervals.c (check_for_interval, search_for_interval)
10495 (inc_interval_count, count_intervals, root_interval)
10496 (adjust_intervals_for_insertion, make_new_interval): Likewise.
10497 * lread.c (defalias): Likewise.
10498 * ralloc.c (r_alloc_check): Likewise.
10499 * regex.c (set_image_of_range_1, set_image_of_range)
10500 (regex_grow_registers): Likewise.
10501 * sysdep.c (strerror): Likewise.
10502 * termcap.c (valid_filename_p, tprint, main): Likewise.
10503 * tparam.c (main): Likewise.
10504 * unexhp9k800.c (run_time_remap, save_data_space)
10505 (update_file_ptrs, read_header, write_header, calculate_checksum)
10506 (copy_file, copy_rest, display_header): Likewise.
10507 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
10509 * xdisp.c (check_it): Likewise.
10510 * xfaces.c (register_color, unregister_color, unregister_colors):
10512 * xfns.c (print_fontset_result): Likewise.
10513 * xrdb.c (member, fatal, main): Likewise.
10515 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
10517 Fix minor problems found by static checking (Bug#9031).
10518 * chartab.c (char_table_set_range, map_sub_char_table):
10519 Remove unused locals.
10520 (uniprop_table): Now static.
10521 * composite.c (_work_char): Remove unused static var.
10523 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
10525 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
10527 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
10529 * gtkutil.c (qttip_cb): Remove code without function.
10531 2011-07-09 Eli Zaretskii <eliz@gnu.org>
10533 * w32.c (pthread_sigmask): New stub.
10535 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
10537 Use pthread_sigmask, not sigprocmask (Bug#9010).
10538 sigprocmask is portable only for single-threaded applications, and
10539 Emacs can be multi-threaded when it uses GTK.
10540 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
10542 * callproc.c (Fcall_process):
10543 * process.c (create_process):
10544 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
10545 Use pthread_sigmask, not sigprocmask.
10547 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10549 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
10550 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
10553 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10555 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
10556 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
10557 (xg_hide_tooltip): Fix comment.
10559 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
10560 in registerServicesMenuSendTypes.
10561 (validRequestorForSendType): Don't check ns_return_types.
10563 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
10566 2011-07-08 Jason Rumney <jasonr@gnu.org>
10568 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
10569 SH_SHOW for hidden windows (Bug#5482).
10571 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
10572 frame struct members of non-existent frames (Bug#6284).
10574 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10576 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
10577 variable firstTime not needed on OSX >= 10.6.
10578 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
10579 >= 10.5. Use setKnobProportion, setDoubleValue.
10581 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
10582 (MAC_OS_X_VERSION_10_5): Define if not defined.
10583 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
10584 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
10585 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
10587 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
10588 cString and lossyCString on OSX >= 10.4.
10590 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
10591 sizeToFit on OSX >= 10.2.
10593 * nsimage.m (allocInitFromFile): Don't use deprecated method
10594 bestRepresentationForDevice on OSX >= 10.6.
10596 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
10599 * emacs.c: Declare unexec_init_emacs_zone.
10601 * nsgui.h: Fix compiler warning about gnulib redefining verify.
10603 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
10605 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
10606 on svcsMenu (Bug#8842).
10608 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
10610 (Fns_list_services): Just return Qnil on 10.6, code not working there.
10612 * nsterm.m (QUTF8_STRING): Declare.
10613 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
10614 (validRequestorForSendType): Return type is (id).
10615 Change indexOfObjectIdenticalTo to indexOfObject.
10616 Check if we have local selection before returning self (Bug#8842).
10617 (writeSelectionToPasteboard): Put local selection into paste board
10618 if we have a local selection (Bug#8842).
10619 (syms_of_nsterm): DEFSYM QUTF8_STRING.
10621 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
10622 (ns_get_local_selection): Declare.
10624 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
10626 * keymap.c (describe_map_tree): Don't insert a double newline at
10627 the end of the buffer (bug#1169) and return whether we inserted
10630 * callint.c (Fcall_interactively): Change "reading args" to
10631 "providing args" to try to clarify what it does (bug#1010).
10633 2011-07-07 Kenichi Handa <handa@m17n.org>
10635 * composite.c (composition_compute_stop_pos): Ignore a static
10636 composition starting before CHARPOS (Bug#8915).
10638 * xdisp.c (handle_composition_prop): Likewise.
10640 2011-07-07 Eli Zaretskii <eliz@gnu.org>
10642 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
10645 2011-07-07 Kenichi Handa <handa@m17n.org>
10647 * character.h (unicode_category_t): New enum type.
10649 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
10650 (Qchar_code_property_table): New variable.
10651 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
10652 (UNIPROP_COMPRESSED_FORM_P): New macros.
10653 (char_table_ascii): Uncompress the compressed values.
10654 (sub_char_table_ref): New arg is_uniprop. Callers changed.
10655 Uncompress the compressed values.
10656 (sub_char_table_ref_and_range): Likewise.
10657 (char_table_ref_and_range): Uncompress the compressed values.
10658 (sub_char_table_set): New arg is_uniprop. Callers changed.
10659 Uncompress the compressed values.
10660 (sub_char_table_set_range): Args changed. Callers changed.
10661 (char_table_set_range): Adjuted for the above change.
10662 (map_sub_char_table): Delete args default_val and parent. Add arg
10663 top. Give decoded values to a Lisp function.
10664 (map_char_table): Adjust for the above change. Give decoded
10665 values to a Lisp function. Gcpro more variables.
10666 (uniprop_table_uncompress)
10667 (uniprop_decode_value_run_length): New functions.
10668 (uniprop_decoder, uniprop_decoder_count): New variables.
10669 (uniprop_get_decoder, uniprop_encode_value_character)
10670 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
10672 (uniprop_encoder, uniprop_encoder_count): New variables.
10673 (uniprop_get_encoder, uniprop_table)
10674 (Funicode_property_table_internal, Fget_unicode_property_internal)
10675 (Fput_unicode_property_internal): New functions.
10676 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
10677 Sunicode_property_table_internal, Sget_unicode_property_internal,
10678 and Sput_unicode_property_internal. Defvar_lisp
10679 char-code-property-alist.
10681 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
10682 Vunicode_category_table.
10684 * font.c (font_range): Adjust for the change of
10685 Vunicode_category_table.
10687 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
10689 * m/iris4d.h: Remove file, move contents ...
10690 * s/irix6-5.h: ... here.
10692 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
10694 Remove unportable assumption about struct layout (Bug#8884).
10695 * alloc.c (mark_buffer):
10696 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
10697 (clone_per_buffer_values): Don't assume that
10698 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
10699 This isn't true in general, and it's particularly not true
10700 if Emacs is configured with --with-wide-int.
10701 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
10702 New macros, used in the buffer.c change.
10704 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
10706 * xsettings.c: Use both GConf and GSettings if both are available.
10707 (store_config_changed_event): Add comment.
10708 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
10709 (store_tool_bar_style_changed): New functions.
10710 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
10711 (struct xsettings): Move font inside HAVE_XFT.
10712 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
10713 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
10714 Move inside HAVE_XFT.
10715 (something_changed_gsettingsCB): Rename from something_changedCB.
10716 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
10718 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
10719 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
10720 (something_changed_gconfCB): Rename from something_changedCB.
10721 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
10722 (parse_settings): Move check for font inside HAVE_XFT.
10723 (read_settings, apply_xft_settings): Add comment.
10724 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
10725 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
10726 call store_font_name_changed.
10727 (xft_settings_event): Add comment.
10728 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
10729 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
10730 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
10731 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
10732 (xsettings_initialize): Call init_gsettings last.
10733 (xsettings_get_system_font, xsettings_get_system_normal_font):
10736 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
10738 Random fixes. E.g., (random) never returned negative values.
10739 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
10740 subseconds part to the entropy, as that's a bit more random.
10741 Prefer signed to unsigned, since the signedness doesn't matter and
10742 in general we prefer signed. When given a limit, use a
10743 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
10744 latter isn't right if USE_2_TAGS_FOR_INTS.
10745 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
10746 not 0..VALMASK. Don't discard "excess" bits that random () returns.
10748 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
10750 * textprop.c (text_property_stickiness):
10751 Obey Vtext_property_default_nonsticky.
10752 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
10753 * w32fns.c (syms_of_w32fns):
10754 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
10756 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
10758 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
10759 This is more efficient than Ffile_directory_p and avoids a minor race.
10761 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
10763 * buffer.c (Foverlay_put): Say what the return value is
10766 * fileio.c (barf_or_query_if_file_exists): Check first if the file
10767 is a directory before asking whether to use the file name
10769 (barf_or_query_if_file_exists): Make the "File is a directory"
10770 error be more correct.
10772 * fns.c (Frequire): Remove the mention of the .gz files, since
10773 that's installation-specific, but keep the mention of
10774 `get-load-suffixes'.
10776 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
10778 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
10779 Report string overflow if the output is too long.
10781 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
10783 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
10784 (syms_of_gnutls): Remove duplicate DEFSYM for
10785 Qgnutls_bootprop_verify_hostname_error, an error for
10786 Qgnutls_bootprop_verify_error (which is no longer used).
10788 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
10789 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
10790 Also (re)move comments that are misplaced or no longer relevant.
10792 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10794 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
10796 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
10798 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
10799 and background color parameters if they have been changed.
10801 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10803 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
10805 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
10807 * xsettings.c (SYSTEM_FONT): Define only when used.
10808 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
10810 * keymap.c (access_keymap_1): Now static.
10812 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
10814 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
10815 leave any prefix arg for the up event (Bug#1586).
10817 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
10819 * lread.c (syms_of_lread): Mention single symbols defined by
10820 `defvar' or `defconst' (bug#7154).
10822 * fns.c (Frequire): Mention .el.gz files (bug#7314).
10823 (Frequire): Mention get-load-suffixes.
10825 2011-07-02 Martin Rudalics <rudalics@gmx.at>
10827 * window.h (window): Remove clone_number slot.
10828 * window.c (Fwindow_clone_number, Fset_window_clone_number):
10830 (make_parent_window, make_window, saved_window)
10831 (Fset_window_configuration, save_window_save): Don't deal with
10833 * buffer.c (Qclone_number): Remove declaration.
10834 (sort_overlays, overlay_strings): Don't deal with clone numbers.
10836 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
10838 Add multiple inheritance to keymaps.
10839 * keymap.c (Fmake_composed_keymap): New function.
10840 (Fset_keymap_parent): Simplify.
10841 (fix_submap_inheritance): Remove.
10842 (access_keymap_1): New function extracted from access_keymap to handle
10843 embedded parents and handle lists of maps.
10844 (access_keymap): Use it.
10845 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
10846 (Fcopy_keymap): Handle embedded parents.
10847 (Fcommand_remapping, define_as_prefix): Simplify.
10848 (Fkey_binding): Simplify.
10849 (syms_of_keymap): Move minibuffer-local-completion-map,
10850 minibuffer-local-filename-completion-map,
10851 minibuffer-local-must-match-map, and
10852 minibuffer-local-filename-must-match-map to Elisp.
10853 (syms_of_keymap): Defsubr make-composed-keymap.
10854 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
10855 (parse_menu_item): Trivial simplification.
10857 2011-07-01 Glenn Morris <rgm@gnu.org>
10859 * Makefile.in (SETTINGS_LIBS): Fix typo.
10861 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10863 * coding.c (Fencode_coding_string): Record the last coding system
10864 used, as the function doc string says (bug#8738).
10866 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
10868 * xsettings.c (store_monospaced_changed): Take new font as arg and
10869 check for change against current_mono_font.
10870 (EMACS_TYPE_SETTINGS): Remove this and related defines.
10871 (emacs_settings_constructor, emacs_settings_get_property)
10872 (emacs_settings_set_property, emacs_settings_class_init)
10873 (emacs_settings_init, gsettings_obj): Remove.
10874 (something_changedCB): New function for HAVE_GSETTINGS.
10875 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
10876 with value as argument.
10877 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
10878 g_settings_new (Bug#8967). Do not create gsettings_obj.
10879 Remove calls to g_settings_bind. Connect something_changedCB to
10882 * xgselect.c: Add defined (HAVE_GSETTINGS).
10883 (xgselect_initialize): Ditto.
10885 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
10886 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
10889 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
10891 * eval.c (struct backtrace): Simplify and port the data structure.
10892 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
10893 signed bit field, as this assumption is not portable and it makes
10894 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
10895 "char debug_on_exit : 1" as this is not portable either; instead,
10896 use the portable "unsigned int debug_on_exit : 1". Remove unused
10897 member evalargs. Remove obsolete comments about cc bombing out.
10899 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
10901 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
10902 Let HAVE_GSETTINGS override HAVE_GCONF.
10903 (store_monospaced_changed): New function.
10904 (EMACS_SETTINGS): A new type derived from GObject to handle
10905 GSettings notifications.
10906 (emacs_settings_constructor, emacs_settings_get_property)
10907 (emacs_settings_set_property, emacs_settings_class_init):
10909 (gsettings_client, gsettings_obj): New variables.
10910 (GSETTINGS_SCHEMA): New define.
10911 (something_changedCB): Call store_monospaced_changed.
10912 (init_gsettings): New function.
10913 (xsettings_initialize): Call init_gsettings.
10914 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
10917 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
10920 2011-06-29 Martin Rudalics <rudalics@gmx.at>
10922 * window.c (resize_root_window, grow_mini_window)
10923 (shrink_mini_window): Rename Qresize_root_window to
10924 Qwindow_resize_root_window and Qresize_root_window_vertically to
10925 Qwindow_resize_root_window_vertically.
10927 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
10929 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
10931 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
10933 * makefile.w32-in: Redesign dependencies so they reflect more
10934 clearly which files are directly included by each source file,
10935 and not through other includes.
10937 2011-06-27 Martin Rudalics <rudalics@gmx.at>
10939 * buffer.c (Qclone_number): Declare static and DEFSYM it.
10940 (sort_overlays, overlay_strings): When an overlay's clone number
10941 matches the window's clone number process the overlay even if
10942 the overlay's window property doesn't match the current window.
10944 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
10945 (Fwindow_hchild): Rename to Fwindow_left_child.
10946 (Fwindow_next): Rename to Fwindow_next_sibling.
10947 (Fwindow_prev): Rename to Fwindow_prev_sibling.
10948 (resize_window_check): Rename to window_resize_check.
10949 (resize_window_apply): Rename to window_resize_apply.
10950 (Fresize_window_apply): Rename to Fwindow_resize_apply.
10951 (Fdelete_other_windows_internal, resize_frame_windows)
10952 (Fsplit_window_internal, Fdelete_window_internal)
10953 (grow_mini_window, shrink_mini_window)
10954 (Fresize_mini_window_internal): Fix callers accordingly.
10956 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
10958 * emacsgtkfixed.h: State that this is only used with Gtk+3.
10959 (emacs_fixed_set_min_size): Remove.
10960 (emacs_fixed_new): Take frame as argument.
10962 * emacsgtkfixed.c: State that this is only used with Gtk+3.
10963 (_EmacsFixedPrivate): Remove minwidth/height.
10964 Add struct frame *f.
10965 (emacs_fixed_init): Initialize priv->f.
10966 (get_parent_class, emacs_fixed_set_min_size): Remove.
10967 (emacs_fixed_new): Set priv->f to argument.
10968 (emacs_fixed_get_preferred_width)
10969 (emacs_fixed_get_preferred_height): Use min_width/height from
10970 frames size_hint to set minimum and natural (Bug#8919).
10971 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
10972 and use min_width/height from frames size_hint to set
10973 min_width/height (Bug#8919).
10975 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
10976 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
10979 2011-06-26 Eli Zaretskii <eliz@gnu.org>
10981 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
10982 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
10985 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
10987 * process.c (wait_reading_process_output): Bypass select if
10988 waiting for a cell while ignoring keyboard input, and input is
10989 pending. Suggested by Jan Djärv (Bug#8869).
10991 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
10993 Use gnulib's dup2 module instead of rolling our own.
10994 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
10996 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10998 * dispnew.c (scrolling_window): Before scrolling, turn off a
10999 mouse-highlight in the window being scrolled.
11001 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
11003 Move DEFSYM to lisp.h and use everywhere.
11005 * character.h (DEFSYM): Move declaration...
11006 * lisp.h (DEFSYM): ...here.
11012 * w32select.c: Don't include character.h.
11014 * alloc.c (syms_of_alloc):
11015 * buffer.c (syms_of_buffer):
11016 * bytecode.c (syms_of_bytecode):
11017 * callint.c (syms_of_callint):
11018 * casefiddle.c (syms_of_casefiddle):
11019 * casetab.c (init_casetab_once):
11020 * category.c (init_category_once, syms_of_category):
11021 * ccl.c (syms_of_ccl):
11022 * cmds.c (syms_of_cmds):
11023 * composite.c (syms_of_composite):
11024 * dbusbind.c (syms_of_dbusbind):
11025 * dired.c (syms_of_dired):
11026 * dispnew.c (syms_of_display):
11027 * doc.c (syms_of_doc):
11028 * editfns.c (syms_of_editfns):
11029 * emacs.c (syms_of_emacs):
11030 * eval.c (syms_of_eval):
11031 * fileio.c (syms_of_fileio):
11032 * fns.c (syms_of_fns):
11033 * frame.c (syms_of_frame):
11034 * fringe.c (syms_of_fringe):
11035 * insdel.c (syms_of_insdel):
11036 * keymap.c (syms_of_keymap):
11037 * lread.c (init_obarray, syms_of_lread):
11038 * macros.c (syms_of_macros):
11039 * msdos.c (syms_of_msdos):
11040 * print.c (syms_of_print):
11041 * process.c (syms_of_process):
11042 * search.c (syms_of_search):
11043 * sound.c (syms_of_sound):
11044 * syntax.c (init_syntax_once, syms_of_syntax):
11045 * terminal.c (syms_of_terminal):
11046 * textprop.c (syms_of_textprop):
11047 * undo.c (syms_of_undo):
11048 * w32.c (globals_of_w32):
11049 * window.c (syms_of_window):
11050 * xdisp.c (syms_of_xdisp):
11051 * xfaces.c (syms_of_xfaces):
11052 * xfns.c (syms_of_xfns):
11053 * xmenu.c (syms_of_xmenu):
11054 * xsettings.c (syms_of_xsettings):
11055 * xterm.c (syms_of_xterm): Use DEFSYM.
11057 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
11059 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
11061 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
11063 Integer and buffer overflow fixes (Bug#8873).
11065 * print.c (printchar, strout): Check for string overflow.
11066 (PRINTPREPARE, printchar, strout):
11067 Don't set size unless allocation succeeds.
11069 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
11070 for sizes. Check for string overflow more accurately.
11071 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
11073 * macros.c: Integer and buffer overflow fixes.
11074 * keyboard.h (struct keyboard.kbd_macro_bufsize):
11075 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
11076 Use ptrdiff_t, not int, for sizes.
11077 Don't increment bufsize until after realloc succeeds.
11078 Check for size-calculation overflow.
11079 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
11081 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
11083 * lread.c: Integer overflow fixes.
11084 (read_integer): Radix is now EMACS_INT, not int,
11085 to improve quality of diagnostics for out-of-range radices.
11086 Calculate buffer size correctly for out-of-range radices.
11087 (read1): Check for integer overflow in radices, and in
11088 read-circle numbers.
11089 (read_escape): Avoid int overflow.
11090 (Fload, openp, read_buffer_size, read1)
11091 (substitute_object_recurse, read_vector, read_list, map_obarray):
11092 Use ptrdiff_t, not int, for sizes.
11093 (read1): Use EMACS_INT, not int, for sizes.
11094 Check for size overflow.
11096 * image.c (cache_image): Check for size arithmetic overflow.
11098 * lread.c: Integer overflow issues.
11099 (saved_doc_string_size, saved_doc_string_length)
11100 (prev_saved_doc_string_size, prev_saved_doc_string_length):
11101 Now ptrdiff_t, not int.
11102 (read1): Don't assume doc string length fits in int. Check for
11103 out-of-range doc string lengths.
11104 (read_list): Don't assume file position fits in int.
11105 (read_escape): Check for hex character overflow.
11107 2011-06-22 Leo Liu <sdl.web@gmail.com>
11109 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
11110 Move to minibuffer.el.
11112 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11114 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
11115 The following patches are for when GLYPH_DEBUG && !XASSERT.
11116 * dispextern.h (trace_redisplay_p, dump_glyph_string):
11117 * dispnew.c (flush_stdout):
11118 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
11119 Mark as externally visible.
11120 * dispnew.c (check_window_matrix_pointers): Now static.
11121 * dispnew.c (window_to_frame_vpos):
11122 * xfns.c (unwind_create_frame):
11123 * xterm.c (x_check_font): Remove unused local.
11124 * scroll.c (CHECK_BOUNDS):
11125 * xfaces.c (cache_fache): Rename local to avoid shadowing.
11126 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
11127 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
11128 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
11129 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
11131 (debug_method_add): Use va_list and vsprintf rather than relying
11132 on undefined behavior with wrong number of arguments.
11133 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
11134 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
11135 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
11136 since we're not interested in debugging glyphs with old libraries.
11137 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
11138 GCC 4.6.0's static checking.
11140 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11142 Integer overflow and signedness fixes (Bug#8873).
11143 A few related buffer overrun fixes, too.
11145 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
11147 * dispextern.h (struct face.stipple):
11148 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
11149 (x_bitmap_mask, x_allocate_bitmap_record)
11150 (x_create_bitmap_from_data, x_create_bitmap_from_file)
11151 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
11152 (x_create_bitmap_from_xpm_data):
11153 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
11154 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
11156 * xfaces.c (load_pixmap):
11157 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
11158 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
11159 (.bitmaps_last, struct x_output.icon_bitmap):
11160 Use ptrdiff_t, not int, for bitmap indexes.
11161 (x_allocate_bitmap_record): Check for size overflow.
11162 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
11164 Use ptrdiff_t, not int, for overlay counts.
11165 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
11166 * editfns.c (overlays_around, get_pos_property):
11167 * textprop.c (get_char_property_and_overlay):
11168 * xdisp.c (next_overlay_change, note_mouse_highlight):
11169 * xfaces.c (face_at_buffer_position):
11170 * buffer.c (OVERLAY_COUNT_MAX): New macro.
11171 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
11172 (Fnext_overlay_change, Fprevious_overlay_change)
11173 (mouse_face_overlay_overlaps, Foverlays_in):
11174 Use ptrdiff_t, not int, for sizes.
11175 (overlays_at, overlays_in): Check for size-calculation overflow.
11177 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
11179 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
11180 (x_session_initialize): Do not assume string length fits in int.
11182 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
11183 This is unlikely, but can occur if DPI is outlandish.
11185 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
11186 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
11188 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
11189 * xrdb.c (magic_file_p, search_magic_path):
11190 Omit last arg SUFFIX; it was always 0. All callers changed.
11191 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
11193 * xfont.c (xfont_match): Avoid need for strlen.
11195 * xfns.c: Don't assume strlen fits in int.
11196 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
11198 * xdisp.c (message_log_check_duplicate): Return intmax_t,
11199 not unsigned long, as we prefer signed integers. All callers changed.
11200 Detect integer overflow in repeat count.
11201 (message_dolog): Don't assume print length fits in 39 bytes.
11202 (display_mode_element): Don't assume strlen fits in int.
11204 * termcap.c: Don't assume sizes fit in int and never overflow.
11205 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
11206 (gobble_line): Check for size-calculation overflow.
11208 * minibuf.c (Fread_buffer):
11209 * lread.c (intern, intern_c_string):
11210 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
11211 Don't assume string length fits in int.
11213 * keyboard.c (parse_tool_bar_item):
11214 * gtkutil.c (style_changed_cb): Avoid need for strlen.
11216 * font.c: Don't assume string length fits in int.
11217 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
11218 Use ptrdiff_t, not int.
11219 (font_intern_prop): Don't assume string length fits in int.
11220 Don't assume integer property fits in fixnum.
11221 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
11223 * filelock.c: Fix some buffer overrun and integer overflow issues.
11224 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
11225 Reformulate so as not to need the command string.
11226 Invoke gzip -cd rather than gunzip, as it's more portable.
11227 (lock_info_type, lock_file_1, lock_file):
11228 Don't assume pid_t and time_t fit in unsigned long.
11229 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
11230 (current_lock_owner): Prefer signed type for sizes.
11231 Use memcpy, not strncpy, where memcpy is what is really wanted.
11232 Don't assume (via atoi) that time_t and pid_t fit in int.
11233 Check for time_t and/or pid_t out of range, e.g., via a network share.
11234 Don't alloca where an auto var works fine.
11236 * fileio.c: Fix some integer overflow issues.
11237 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
11238 Don't assume string length fits in int.
11239 (directory_file_name): Don't assume string length fits in long.
11240 (make_temp_name): Don't assume pid fits in int, or that its print
11241 length is less than 20.
11243 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
11245 * coding.c (make_subsidiaries): Don't assume string length fits in int.
11247 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
11249 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
11250 We prefer signed integers, even for size calculations.
11252 * emacs.c: Don't assume string length fits in 'int'.
11253 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
11254 (main): Don't invoke strlen when not needed.
11256 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
11257 (XD_DEBUG_MESSAGE): Don't waste a byte.
11259 * callproc.c (getenv_internal_1, getenv_internal)
11260 (Fgetenv_internal):
11261 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
11263 * lread.c (invalid_syntax): Omit length argument.
11264 All uses changed. This doesn't fix a bug, but it simplifies the
11265 code away from its former Hollerith-constant appearance, and it's
11266 one less 'int' to worry about when looking at integer-overflow issues.
11267 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
11269 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
11270 This didn't break anything, but it didn't help either.
11271 It's confusing to put a bogus integer in a place where the actual
11272 value does not matter.
11273 (LIST_END_P): Remove unused macro and its bogus comment.
11274 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
11276 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
11277 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
11279 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
11280 We prefer signed types, and the value cannot exceed the EMACS_INT
11281 range anyway (because otherwise the length would not be representable).
11282 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
11283 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
11284 This avoids a GCC warning when WIDE_EMACS_INT.
11286 * indent.c (sane_tab_width): New function.
11287 (current_column, scan_for_column, Findent_to, position_indentation)
11288 (compute_motion): Use it. This is just for clarity.
11289 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
11291 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
11293 * lisp.h (lint_assume): New macro.
11294 * composite.c (composition_gstring_put_cache):
11295 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
11297 * editfns.c, insdel.c:
11298 Omit unnecessary forward decls, to simplify future changes.
11300 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
11302 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
11304 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
11305 Use much-faster test for byte-length change.
11306 Don't assume string byte-length fits in 'int'.
11307 Check that character arg fits in 'int'.
11308 (mapcar1): Declare byte as byte, for clarity.
11310 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
11312 * fns.c (concat): Catch string overflow earlier.
11313 Do not rely on integer wraparound.
11315 * dispextern.h (struct it.overlay_strings_charpos)
11316 (struct it.selective): Now EMACS_INT, not int.
11317 * xdisp.c (forward_to_next_line_start)
11318 (back_to_previous_visible_line_start)
11319 (reseat_at_next_visible_line_start, next_element_from_buffer):
11320 Don't arbitrarily truncate the value of 'selective' to int.
11322 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
11324 * composite.c: Don't truncate sizes to 'int'.
11325 (composition_gstring_p, composition_reseat_it)
11326 (composition_adjust_point): Use EMACS_INT, not int.
11327 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
11328 not EMACS_UINT, for indexes.
11330 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
11332 * buffer.c: Include <verify.h>.
11333 (struct sortvec.priority, struct sortstr.priority):
11334 Now EMACS_INT, not int.
11335 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
11336 (struct sortstr.size, record_overlay_string)
11337 (struct sortstrlist.size, struct sortlist.used):
11338 Don't truncate size to int.
11339 (record_overlay_string): Check for size-calculation overflow.
11340 (init_buffer_once): Check at compile-time, not run-time.
11342 2011-06-22 Jim Meyering <meyering@redhat.com>
11344 Don't leak an XBM-image-sized buffer
11345 * image.c (xbm_load): Free the image buffer after using it.
11347 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
11350 * composite.c (find_automatic_composition): Omit needless 'return 0;'
11351 that Sun C diagnosed.
11352 * fns.c (secure_hash): Fix pointer signedness issue.
11353 * intervals.c (static_offset_intervals): New function.
11354 (offset_intervals): Use it.
11356 2011-06-21 Leo Liu <sdl.web@gmail.com>
11359 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
11362 * fns.c (secure_hash): Rename from crypto_hash_function and change
11363 the first arg to accept symbols.
11364 (Fsecure_hash): New primitive.
11365 (syms_of_fns): New symbols.
11367 2011-06-20 Deniz Dogan <deniz@dogan.se>
11369 * process.c (Fset_process_buffer): Clarify return value in
11372 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
11374 * dispnew.c (add_window_display_history): Use BVAR.
11376 * xdisp.c (debug_method_add): Use BVAR.
11377 (check_window_end, dump_glyph_matrix, dump_glyph)
11378 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
11380 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
11383 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
11384 check till after the cache is created in init_frame_faces.
11386 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
11388 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
11390 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
11392 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
11393 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
11394 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
11396 Improve buffer-overflow checking (Bug#8873).
11397 * fileio.c (Finsert_file_contents):
11398 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
11399 Remove the old (too-loose) buffer overflow checks.
11400 They weren't needed, since make_gap checks for buffer overflow.
11401 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
11402 The old code merely checked for Emacs fixnum overflow, and relied
11403 on undefined (wraparound) behavior. The new code avoids undefined
11404 behavior, and also checks for ptrdiff_t and/or size_t overflow.
11406 * editfns.c (Finsert_char): Don't dump core with very negative counts.
11407 Tune. Don't use wider integers than needed. Don't use alloca.
11408 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
11410 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
11412 * insdel.c, lisp.h (buffer_overflow): New function.
11413 (insert_from_buffer_1, replace_range, replace_range_2):
11414 * insdel.c (make_gap_larger):
11415 * editfns.c (Finsert_char):
11416 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
11418 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
11420 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
11422 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
11424 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
11425 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
11427 * fileio.c: Don't assume EMACS_INT fits in off_t.
11428 (emacs_lseek): New static function.
11429 (Finsert_file_contents, Fwrite_region): Use it.
11430 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
11432 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
11434 * fns.c: Don't overflow int when computing a list length.
11435 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
11436 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
11437 truncation on 64-bit hosts. Check for QUIT every
11438 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
11439 faster and is responsive enough.
11440 (Flength): Report an error instead of overflowing an integer.
11441 (Fsafe_length): Return a float if the value is not representable
11442 as a fixnum. This shouldn't happen except in contrived situations.
11443 (Fnthcdr, Fsort): Don't assume list length fits in int.
11444 (Fcopy_sequence): Don't assume vector length fits in int.
11446 * alloc.c: Check that resized vectors' lengths fit in fixnums.
11447 (header_size, word_size): New constants.
11448 (allocate_vectorlike): Don't check size overflow here.
11449 (allocate_vector): Check it here instead, since this is the only
11450 caller of allocate_vectorlike that could cause overflow.
11451 Check that the new vector's length is representable as a fixnum.
11453 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
11454 The previous code was bogus. For example, next_almost_prime (32)
11455 returned 39, which is undesirable as it is a multiple of 3; and
11456 next_almost_prime (24) returned 25, which is a multiple of 5 so
11457 why was the code bothering to check for multiples of 7?
11459 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
11461 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
11463 Variadic C functions now count arguments with ptrdiff_t.
11464 This partly undoes my 2011-03-30 change, which replaced int with size_t.
11465 Back then I didn't know that the Emacs coding style prefers signed int.
11466 Also, in the meantime I found a few more instances where arguments
11467 were being counted with int, which may truncate counts on 64-bit
11468 machines, or EMACS_INT, which may be unnecessarily wide.
11469 * lisp.h (struct Lisp_Subr.function.aMANY)
11470 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
11471 Arg counts are now ptrdiff_t, not size_t.
11472 All variadic functions and their callers changed accordingly.
11473 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
11474 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
11475 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
11476 * callint.c (Fcall_interactively): Check arg count for overflow,
11477 to avoid potential buffer overrun. Use signed char, not 'int',
11478 for 'varies' array, so that we needn't bother to check its size
11479 calculation for overflow.
11480 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
11481 * eval.c (apply_lambda):
11482 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
11483 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
11484 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
11486 * callint.c (Fcall_interactively): Don't use index var as event count.
11488 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
11489 * mem-limits.h (SIZE): Remove; no longer used.
11491 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
11493 Remove unnecessary casts.
11494 * xterm.c (x_term_init):
11495 * xfns.c (x_set_border_pixel):
11496 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
11497 These aren't needed now that we assume ANSI C.
11499 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
11500 It's more likely to cause problems (due to unsigned overflow)
11503 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
11505 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
11507 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
11509 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
11511 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
11513 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
11515 GLYPH_CODE_FACE returns EMACS_INT, not int.
11516 * dispextern.h (merge_faces):
11517 * xfaces.c (merge_faces):
11518 * xdisp.c (get_next_display_element, next_element_from_display_vector):
11519 Don't assume EMACS_INT fits in int.
11521 * character.h (CHAR_VALID_P): Remove unused parameter.
11522 * fontset.c, lisp.h, xdisp.c: All uses changed.
11524 * editfns.c (Ftranslate_region_internal): Omit redundant test.
11526 * fns.c (concat): Minor tuning based on overflow analysis.
11527 This doesn't fix any bugs. Use int to hold character, instead
11528 of constantly refetching from Emacs object. Use XFASTINT, not
11529 XINT, for value known to be a character. Don't bother comparing
11530 a single byte to 0400, as it's always less.
11532 * floatfns.c (Fexpt):
11533 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
11535 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
11538 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
11540 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
11541 Without this fix, on a 64-bit host (aset S 0 4294967386) would
11542 incorrectly succeed when S was a string, because 4294967386 was
11543 truncated before it was used.
11545 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
11546 Otherwise, an out-of-range integer could cause undefined behavior
11549 * composite.c: Use int, not EMACS_INT, for characters.
11550 (fill_gstring_body, composition_compute_stop_pos): Use int, not
11551 EMACS_INT, for values that are known to be in character range.
11552 This doesn't fix any bugs but is the usual style inside Emacs and
11553 may generate better code on 32-bit machines.
11555 Make sure a 64-bit char is never passed to ENCODE_CHAR.
11556 This is for reasons similar to the recent CHAR_STRING fix.
11557 * charset.c (Fencode_char): Check that character arg is actually
11558 a character. Pass an int to ENCODE_CHAR.
11559 * charset.h (ENCODE_CHAR): Verify that the character argument is no
11560 wider than 'int', as a compile-time check to prevent future regressions
11563 * character.c (char_string): Remove unnecessary casts.
11565 Make sure a 64-bit char is never passed to CHAR_STRING.
11566 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
11567 by silently ignoring the top 32 bits, allowing some values
11568 that were far too large to be valid characters.
11569 * character.h: Include <verify.h>.
11570 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
11571 arguments are no wider than unsigned, as a compile-time check
11572 to prevent future regressions in this area.
11574 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
11575 (Fsubst_char_in_region):
11577 * xdisp.c (decode_mode_spec_coding):
11578 Adjust to CHAR_STRING's new requirement.
11579 * editfns.c (Finsert_char, Fsubst_char_in_region):
11580 * fns.c (concat): Check that character args are actually
11581 characters. Without this test, these functions did the wrong
11582 thing with wildly out-of-range values on 64-bit hosts.
11584 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
11585 These casts should not be needed on 32-bit hosts, either.
11586 * keyboard.c (read_char):
11587 * lread.c (Fload): Remove casts to unsigned.
11589 * lisp.h (UNSIGNED_CMP): New macro.
11590 This fixes comparison bugs on 64-bit hosts.
11591 (ASCII_CHAR_P): Use it.
11592 * casefiddle.c (casify_object):
11593 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
11594 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
11595 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
11596 * dispextern.h (FACE_FROM_ID):
11597 * keyboard.c (read_char): Use UNSIGNED_CMP.
11599 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
11600 not to EMACS_INT, to avoid GCC warning.
11602 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
11604 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
11605 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
11606 isn't needed on 32-bit machines.
11608 * buffer.c (Fgenerate_new_buffer_name):
11609 Use EMACS_INT for count, not int.
11610 (advance_to_char_boundary): Return EMACS_INT, not int.
11612 * data.c (Qcompiled_function): Now static.
11614 * window.c (window_body_lines): Now static.
11616 * image.c (gif_load): Rename local to avoid shadowing.
11618 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
11619 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
11620 * alloc.c (make_save_value): Integer argument is now of type
11621 ptrdiff_t, not int.
11622 (mark_object): Use ptrdiff_t, not int.
11623 * lisp.h (pD): New macro.
11624 * print.c (print_object): Use it.
11626 * alloc.c: Use EMACS_INT, not int, to count objects.
11627 (total_conses, total_markers, total_symbols, total_vector_size)
11628 (total_free_conses, total_free_markers, total_free_symbols)
11629 (total_free_floats, total_floats, total_free_intervals)
11630 (total_intervals, total_strings, total_free_strings):
11631 Now EMACS_INT, not int. All uses changed.
11632 (Fgarbage_collect): Compute overall total using a double, so that
11633 integer overflow is less likely to be a problem. Check for overflow
11634 when converting back to an integer.
11635 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
11636 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
11637 These were 'int' variables that could overflow on 64-bit hosts;
11638 they were never used, so remove them instead of repairing them.
11639 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
11640 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
11641 Previously, this ceilinged at INT_MAX, but that doesn't work on
11643 (allocate_pseudovector): Don't use EMACS_INT when int would do.
11645 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
11646 (allocate_vectorlike): Check for ptrdiff_t overflow.
11647 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
11648 when a (possibly-narrower) signed value would do just as well.
11649 We prefer using signed arithmetic, to avoid comparison confusion.
11651 * alloc.c: Catch some string size overflows that we were missing.
11652 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
11653 for convenience in STRING_BYTES_MAX.
11654 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
11655 The definition here is exact; the one in lisp.h was approximate.
11656 (allocate_string_data): Check for string overflow. This catches
11657 some instances we weren't catching before. Also, it catches
11658 size_t overflow on (unusual) hosts where SIZE_MAX <= min
11659 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
11660 and ptrdiff_t and EMACS_INT are both 64 bits.
11662 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
11663 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
11664 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
11666 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
11668 * alloc.c (Fmake_string): Check for out-of-range init.
11670 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
11672 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
11674 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
11676 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
11677 xg_get_default_scrollbar_width.
11679 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
11680 (int_gtk_range_get_value): Move to the scroll bar part of the file.
11681 (style_changed_cb): Call update_theme_scrollbar_width and call
11682 x_set_scroll_bar_default_width and xg_frame_set_char_size for
11683 all frames (Bug#8505).
11684 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
11685 Call gtk_window_set_resizable if HAVE_GTK3.
11686 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
11687 and height if HAVE_GTK3 (Bug#8505).
11688 (scroll_bar_width_for_theme): New variable.
11689 (update_theme_scrollbar_width): New function.
11690 (xg_get_default_scrollbar_width): Move code to
11691 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
11692 (xg_initialize): Call update_theme_scrollbar_width.
11694 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
11696 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
11698 2011-06-12 Martin Rudalics <rudalics@gmx.at>
11700 * frame.c (make_frame): Call other_buffer_safely instead of
11703 * window.c (temp_output_buffer_show): Call display_buffer with
11704 second argument Vtemp_buffer_show_specifiers and reset latter
11705 immediately after the call.
11706 (Vtemp_buffer_show_specifiers): New variable.
11707 (auto_window_vscroll_p, next_screen_context_lines)
11708 (Vscroll_preserve_screen_position): Remove leading asterisks from
11711 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
11713 Fix minor problems found by GCC 4.6.0 static checking.
11714 * buffer.c (Qclone_number): Remove for now, as it's unused.
11715 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
11716 (record_buffer): Remove unused local.
11717 * frame.c (other_visible_frames, frame_buffer_list): Now static.
11718 (set_frame_buffer_list): Remove; unused.
11719 * frame.h (other_visible_frames): Remove decl.
11720 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
11721 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
11722 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
11724 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
11725 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
11726 Define only if HAVE_GPM.
11727 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
11728 (update_hints_inhibit): Remove; never set. All uses removed.
11729 * widgetprv.h (emacsFrameClassRec): Remove decl.
11730 * window.c (delete_deletable_window): Now returns void, since it
11731 wasn't returning anything.
11732 (compare_window_configurations): Remove unused locals.
11733 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
11734 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
11735 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
11736 the same widths as pointers. This follows up on the 2011-05-06 patch.
11737 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
11738 * xterm.h: Likewise.
11739 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
11741 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
11743 * makefile.w32-in: Update dependencies.
11744 (LISP_H): Add lib/intprops.h.
11746 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
11748 * image.c (gif_load): Add animation frame delay to the metadata.
11749 (syms_of_image): Use DEFSYM. New symbol `delay'.
11751 2011-06-11 Martin Rudalics <rudalics@gmx.at>
11753 * window.c (delete_deletable_window): Re-add.
11754 (Fset_window_configuration): Rewrite to handle dead buffers and
11755 consequently deletable windows.
11756 (window_tree, Fwindow_tree): Remove. Supply functionality in
11758 (compare_window_configurations): Simplify code.
11760 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
11762 * image.c (imagemagick_load_image): Fix type mismatch.
11763 (Fimagemagick_types): Likewise.
11765 * window.h (replace_buffer_in_windows): Declare.
11767 2011-06-11 Martin Rudalics <rudalics@gmx.at>
11769 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
11770 Qclone_number. Remove external declaration of Qdelete_window.
11771 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
11773 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
11774 Run Qbuffer_list_update_hook if allowed.
11775 (Fother_buffer): Rewrite doc-string. Major rewrite for new
11776 buffer list implementation.
11777 (other_buffer_safely): New function.
11778 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
11779 calls to replace_buffer_in_windows and
11780 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
11782 (record_buffer): Inhibit quitting and rewrite using quittable
11783 functions. Run Qbuffer_list_update_hook if allowed.
11784 (Frecord_buffer, Funrecord_buffer): New functions.
11785 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
11786 Move switch-to-buffer to window.el.
11787 (bury-buffer): Move to window.el.
11788 (Vbuffer_list_update_hook): New variable.
11790 * lisp.h (other_buffer_safely): Add prototype in buffer.c
11793 * window.h (resize_frame_windows): Move up in code.
11794 (Fwindow_frame): Remove EXFUN.
11795 (replace_buffer_in_all_windows): Remove prototype.
11796 (replace_buffer_in_windows_safely): Add prototype.
11798 * window.c: Declare Qdelete_window static again. Move down
11799 declaration of select_count.
11800 (Fnext_window, Fprevious_window): Rewrite doc-strings.
11801 (Fother_window): Move to window.el.
11802 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
11803 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
11804 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
11806 (replace_buffer_in_windows): Implement by calling
11807 Qreplace_buffer_in_windows.
11808 (replace_buffer_in_all_windows): Remove with some functionality
11809 moved into replace_buffer_in_windows_safely.
11810 (replace_buffer_in_windows_safely): New function.
11811 (select_window_norecord, select_frame_norecord): Move in front
11812 of run_window_configuration_change_hook. Remove now obsolete
11814 (Fset_window_buffer): Rewrite doc-string.
11815 Call Qrecord_window_buffer.
11816 (keys_of_window): Move binding for other-window to window.el.
11818 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
11820 * dispextern.h (struct image): Replace data member, whose int_val
11821 and ptr_val fields were not used by anything, with a single
11824 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
11825 (gif_clear_image, gif_load, imagemagick_load_image)
11826 (gs_clear_image, gs_load): Callers changed.
11828 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
11830 * buffer.h: Include <time.h>, for time_t.
11831 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
11833 Fix minor problems found by static checking.
11835 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
11837 Make identifiers static if they are not used in other modules.
11838 * data.c (Qcompiled_function, Qframe, Qvector):
11839 * image.c (QimageMagick, Qsvg):
11840 * minibuf.c (Qmetadata):
11841 * window.c (resize_window_check, resize_root_window): Now static.
11842 * window.h (resize_window_check, resize_root_window): Remove decls.
11844 * window.c (window_deletion_count, delete_deletable_window):
11846 (window_body_lines): Now static.
11847 (Fdelete_other_windows_internal): Mark vars as initialized.
11848 Make sure 'resize_failed' is initialized.
11849 (run_window_configuration_change_hook): Rename local to avoid shadowing.
11850 (resize_window_apply): Remove unused local.
11851 * window.h (delete_deletable_window): Remove decl.
11853 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
11854 (imagemagick_load_image): Fix pointer signedness problem by changing
11855 last arg from unsigned char * to char *. All uses changed.
11856 Also, fix a local for similar reasons.
11857 Remove unused locals. Remove locals to avoid shadowing.
11858 (fn_rsvg_handle_free): Remove; unused.
11859 (svg_load, svg_load_image): Fix pointer signedness problem.
11860 (imagemagick_load_image): Don't use garbage pointer image_wand.
11862 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
11864 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
11866 * image.c (gif_load): Fix omitted cast error introduced by
11869 2011-06-10 Martin Rudalics <rudalics@gmx.at>
11871 * window.h (resize_proportionally, orig_total_lines)
11872 (orig_top_line): Remove from window structure.
11873 (set_window_height, set_window_width, change_window_heights)
11874 (Fdelete_window): Remove prototypes.
11875 (resize_frame_windows): Remove duplicate declaration.
11877 2011-06-10 Eli Zaretskii <eliz@gnu.org>
11879 * window.h (resize_frame_windows, resize_window_check)
11880 (delete_deletable_window, resize_root_window)
11881 (resize_frame_windows): Declare prototypes.
11883 * window.c (resize_window_apply): Make definition be "static" to
11884 match the prototype.
11886 2011-06-10 Martin Rudalics <rudalics@gmx.at>
11888 * window.c: Remove declarations of Qwindow_size_fixed,
11889 window_min_size_1, window_min_size_2, window_min_size,
11890 size_window, window_fixed_size_p, enlarge_window, delete_window.
11891 Remove static from declaration of Qdelete_window, it's
11892 temporarily needed by Fbury_buffer.
11893 (replace_window): Don't assign orig_top_line and
11895 (Fdelete_window, delete_window): Remove. Window deletion is
11896 handled by window.el.
11897 (window_loop): Remove DELETE_OTHER_WINDOWS case.
11898 Replace Fdelete_window calls with calls to Qdelete_window.
11899 (Fdelete_other_windows): Remove. Deleting other windows is
11900 handled by window.el.
11901 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
11902 handled in window.el.
11903 (window_min_size_2, window_min_size_1, window_min_size): Remove.
11904 Window minimum sizes are handled in window.el.
11905 (shrink_windows, size_window, set_window_height)
11906 (set_window_width, change_window_heights, window_height)
11907 (window_width, CURBEG, CURSIZE, enlarge_window)
11908 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
11909 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
11910 handled in window.el.
11911 (make_dummy_parent): Rename to make_parent_window and give it a
11912 second argument horflag.
11913 (make_window): Don't set resize_proportionally any more.
11914 (Fsplit_window): Remove. Windows are split in window.el.
11915 (save_restore_action, save_restore_orig_size)
11916 (shrink_window_lowest_first, save_restore_orig_size): Remove.
11917 Resize mini windows in window.el.
11918 (grow_mini_window, shrink_mini_window): Implement by calling
11919 Qresize_root_window_vertically, resize_window_check and
11920 resize_window_apply.
11921 (saved_window, Fset_window_configuration, save_window_save):
11922 Do not handle orig_top_line, orig_total_lines, and
11923 resize_proportionally.
11924 (window_min_height, window_min_width): Move to window.el.
11925 (keys_of_window): Move bindings for delete-other-windows,
11926 split-window, delete-window and enlarge-window to window.el.
11928 * buffer.c: Temporarily extern Qdelete_window.
11929 (Fbury_buffer): Temporarily call Qdelete_window instead of
11930 Fdelete_window (Fbury_buffer will move to window.el soon).
11932 * frame.c (set_menu_bar_lines_1): Remove code handling
11933 orig_top_line and orig_total_lines.
11935 * dispnew.c (adjust_frame_glyphs_initially): Don't use
11936 set_window_height but set heights directly.
11937 (change_frame_size_1): Use resize_frame_windows.
11939 * xdisp.c (init_xdisp): Don't use set_window_height but set
11942 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
11943 Use resize_frame_windows instead of change_window_heights and run
11944 run_window_configuration_change_hook.
11946 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
11947 instead of change_window_heights and run
11948 run_window_configuration_change_hook.
11950 2011-06-09 Martin Rudalics <rudalics@gmx.at>
11952 * window.c (replace_window): Rename second argument REPLACEMENT to
11953 NEW. New third argument SETFLAG. Rewrite.
11954 (delete_window, make_dummy_parent): Call replace_window with
11956 (window_list_1): Move down in code.
11957 (run_window_configuration_change_hook): Move set_buffer part
11958 before select_frame_norecord part in order to unwind correctly.
11959 Rename count1 to count.
11960 (recombine_windows, delete_deletable_window, resize_root_window)
11961 (Fdelete_other_windows_internal)
11962 (Frun_window_configuration_change_hook, make_parent_window)
11963 (resize_window_check, resize_window_apply, Fresize_window_apply)
11964 (resize_frame_windows, Fsplit_window_internal)
11965 (Fdelete_window_internal, Fresize_mini_window_internal):
11967 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
11969 2011-06-08 Martin Rudalics <rudalics@gmx.at>
11971 * window.h (window): Add some new members to window structure -
11972 normal_lines, normal_cols, new_total, new_normal, clone_number,
11973 splits, nest, prev_buffers, next_buffers.
11974 (WINDOW_TOTAL_SIZE): Move here from window.c.
11975 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
11977 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
11979 (make_dummy_parent): Set new members of windows structure.
11980 (make_window): Move down in code. Handle new members of window
11982 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
11983 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
11984 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
11985 (Fset_window_prev_buffers, Fwindow_next_buffers)
11986 (Fset_window_next_buffers, Fset_window_clone_number):
11988 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
11989 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
11991 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
11992 Argument WINDOW can be now internal window too.
11993 (Fwindow_use_time): Move up in code.
11994 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
11995 Rewrite doc-string.
11996 (Fset_window_configuration, saved_window)
11997 (Fcurrent_window_configuration, save_window_save): Handle new
11998 members of window structure.
11999 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
12000 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
12001 (syms_of_window): New Lisp objects Qrecord_window_buffer,
12002 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
12003 Qget_mru_window, Qresize_root_window,
12004 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
12005 Qauto_buffer_name; staticpro them.
12007 2011-06-07 Martin Rudalics <rudalics@gmx.at>
12009 * window.c (Fwindow_total_size, Fwindow_left_column)
12010 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
12011 (Fwindow_list_1): New functions.
12012 (window_box_text_cols): Replace with window_body_cols.
12013 (Fwindow_width, Fscroll_left, Fscroll_right):
12014 Use window_body_cols instead of window_box_text_cols.
12015 (delete_window, Fset_window_configuration):
12016 Call delete_all_subwindows with window as argument.
12017 (delete_all_subwindows): Take a window as argument and not a
12018 structure. Rewrite.
12019 (window_loop): Remove handling of GET_LRU_WINDOW and
12020 GET_LARGEST_WINDOW.
12021 (Fget_lru_window, Fget_largest_window): Move to window.el.
12023 * window.h: Extern window_body_cols instead of
12024 window_box_text_cols. delete_all_subwindows now takes a
12025 Lisp_Object as argument.
12027 * indent.c (compute_motion, Fcompute_motion):
12028 Use window_body_cols instead of window_box_text_cols.
12030 * frame.c (delete_frame): Call delete_all_subwindows with root
12031 window as argument.
12033 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
12035 * fns.c (Fputhash): Document return value.
12037 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
12039 * image.c (gif_load): Implement gif89a spec "no disposal" method.
12041 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12043 Cons<->int and similar integer overflow fixes (Bug#8794).
12045 Check for overflow when converting integer to cons and back.
12046 * charset.c (Fdefine_charset_internal, Fdecode_char):
12047 Use cons_to_unsigned to catch overflow.
12048 (Fencode_char): Use INTEGER_TO_CONS.
12049 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
12050 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
12051 * data.c (long_to_cons, cons_to_long): Remove.
12052 (cons_to_unsigned, cons_to_signed): New functions.
12053 These signal an error for invalid or out-of-range values.
12054 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
12055 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
12056 * font.c (Ffont_variation_glyphs):
12057 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
12058 * lisp.h: Include <intprops.h>.
12059 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
12060 (cons_to_signed, cons_to_unsigned): New decls.
12061 (long_to_cons, cons_to_long): Remove decls.
12062 * undo.c (record_first_change): Use INTEGER_TO_CONS.
12063 (Fprimitive_undo): Use CONS_TO_INTEGER.
12064 * xfns.c (Fx_window_property): Likewise.
12065 * xselect.c: Include <limits.h>.
12066 (x_own_selection, selection_data_to_lisp_data):
12067 Use INTEGER_TO_CONS.
12068 (x_handle_selection_request, x_handle_selection_clear)
12069 (x_get_foreign_selection, Fx_disown_selection_internal)
12070 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
12071 (lisp_data_to_selection_data): Use cons_to_unsigned.
12072 (x_fill_property_data): Use cons_to_signed.
12073 Report values out of range.
12075 Check for buffer and string overflow more precisely.
12076 * buffer.h (BUF_BYTES_MAX): New macro.
12077 * lisp.h (STRING_BYTES_MAX): New macro.
12078 * alloc.c (Fmake_string):
12079 * character.c (string_escape_byte8):
12080 * coding.c (coding_alloc_by_realloc):
12081 * doprnt.c (doprnt):
12082 * editfns.c (Fformat):
12084 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
12085 since they may not be the same number.
12086 * editfns.c (Finsert_char):
12087 * fileio.c (Finsert_file_contents):
12088 Likewise for BUF_BYTES_MAX.
12090 * image.c: Use ptrdiff_t, not int, for sizes.
12091 (slurp_file): Switch from int to ptrdiff_t.
12093 (slurp_file): Check that file size fits in both size_t (for
12094 malloc) and ptrdiff_t (for sanity and safety).
12096 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
12097 if b->modtime has its maximal value.
12099 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
12101 Don't assume time_t can fit into int.
12102 * buffer.h (struct buffer.modtime): Now time_t, not int.
12103 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
12104 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
12106 Minor fixes for signed vs unsigned integers.
12107 * character.h (MAYBE_UNIFY_CHAR):
12108 * charset.c (maybe_unify_char):
12109 * keyboard.c (read_char, reorder_modifiers):
12110 XINT -> XFASTINT, since the integer must be nonnegative.
12111 * ftfont.c (ftfont_spec_pattern):
12112 * keymap.c (access_keymap, silly_event_symbol_error):
12113 XUINT -> XFASTINT, since the integer must be nonnegative.
12114 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
12115 since it makes no difference and we prefer signed.
12116 * keyboard.c (record_char): Use XUINT when all the neighbors do.
12117 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
12120 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
12122 * window.h (Fwindow_frame): Declare.
12124 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12126 * alloc.c: Simplify handling of large-request failures (Bug#8800).
12127 (SPARE_MEMORY): Always define.
12128 (LARGE_REQUEST): Remove.
12129 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
12131 2011-06-06 Martin Rudalics <rudalics@gmx.at>
12133 * lisp.h: Move EXFUNS for Fframe_root_window,
12134 Fframe_first_window and Fset_frame_selected_window to window.h.
12136 * window.h: Move EXFUNS for Fframe_root_window,
12137 Fframe_first_window and Fset_frame_selected_window here from
12140 * frame.c (Fwindow_frame, Fframe_first_window)
12141 (Fframe_root_window, Fframe_selected_window)
12142 (Fset_frame_selected_window): Move to window.c.
12143 (Factive_minibuffer_window): Move to minibuf.c.
12144 (Fother_visible_frames_p): New function.
12146 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
12148 * window.c (decode_window, decode_any_window): Move up in code.
12149 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
12150 (inhibit_frame_unsplittable): Remove unused variable.
12151 (Fwindow_buffer): Move up and rewrite doc-string.
12152 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
12153 (Fwindow_prev): New functions.
12154 (Fwindow_frame): Move here from frame.c. Accept any window as
12156 (Fframe_root_window, Fframe_first_window)
12157 (Fframe_selected_window): Move here from frame.c. Accept frame
12158 or arbitrary window as argument. Update doc-strings.
12159 (Fminibuffer_window): Move up in code.
12160 (Fwindow_minibuffer_p): Move up in code and simplify.
12161 (Fset_frame_selected_window): Move here from frame.c.
12163 (Fselected_window, select_window, Fselect_window): Move up in
12164 code. Minor doc-string fixes.
12166 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12168 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
12169 Do not assume that spare memory exists; that assumption is valid
12170 only if SYSTEM_MALLOC.
12171 (LARGE_REQUEST): New macro, so that the issue of large requests
12172 is separated from the issue of spare memory.
12174 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
12176 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
12179 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
12181 * xfns.c (x_set_scroll_bar_default_width): Move declarations
12184 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
12186 * gtkutil.c (xg_get_default_scrollbar_width): New function.
12188 * gtkutil.h: Declare xg_get_default_scrollbar_width.
12190 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
12191 min width by calling x_set_scroll_bar_default_width (Bug#8505).
12193 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
12195 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
12197 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
12199 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
12200 (x_clipboard_manager_save): Add return value.
12201 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
12202 New error handlers.
12203 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
12204 Obey Vx_select_enable_clipboard_manager. Catch errors in
12205 x_clipboard_manager_save (Bug#8779).
12206 (Vx_select_enable_clipboard_manager): New variable.
12207 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
12209 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
12211 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
12213 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12215 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
12216 in the current matrix if keep_current_p is non-zero.
12218 2011-06-04 Eli Zaretskii <eliz@gnu.org>
12220 * bidi.c (bidi_level_of_next_char): Fix last change.
12222 2011-06-03 Eli Zaretskii <eliz@gnu.org>
12224 Support bidi reordering of text covered by display properties.
12226 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
12227 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
12228 (bidi_cache_search, bidi_cache_iterator_state)
12229 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
12230 (bidi_level_of_next_char, bidi_move_to_visually_next):
12231 Support character positions inside a run of characters covered by a
12233 (bidi_paragraph_init, bidi_resolve_explicit_1)
12234 (bidi_level_of_next_char): Call bidi_fetch_char and
12235 bidi_fetch_char_advance instead of FETCH_CHAR and
12236 FETCH_CHAR_ADVANCE.
12237 (bidi_init_it): Initialize new members.
12238 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
12240 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
12241 instead of using explicit *_CHAR codes.
12242 (bidi_resolve_explicit, bidi_resolve_weak):
12243 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
12244 bidirectional text is supported only in multibyte buffers.
12245 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
12246 it to initialize the frame_window_p member of struct bidi_it.
12247 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
12248 (bidi_resolve_explicit, bidi_resolve_weak)
12249 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
12250 bidi_it->nchars is non-positive.
12251 (bidi_level_of_next_char): Don't try to lookup the cache for the
12252 next/previous character if nothing is cached there yet, or if we
12253 were just reseat()'ed to a new position.
12255 * xdisp.c (set_cursor_from_row): Set start and stop points
12256 according to the row's direction when priming the loop that looks
12257 for the glyph on which to display cursor.
12258 (single_display_spec_intangible_p): Function deleted.
12259 (display_prop_intangible_p): Reimplement to call
12260 handle_display_spec instead of single_display_spec_intangible_p.
12261 Accept 3 additional arguments needed by handle_display_spec.
12262 This fixes incorrect cursor motion across display property with complex
12263 values: lists, `(when COND...)' forms, etc.
12264 (single_display_spec_string_p): Support property values that are
12265 lists with the argument STRING its top-level element.
12266 (display_prop_string_p): Fix the condition for processing a
12267 property that is a list to be consistent with handle_display_spec.
12268 (handle_display_spec): New function, refactored from the
12269 last portion of handle_display_prop.
12270 (compute_display_string_pos): Accept additional argument
12271 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
12272 value of a `display' property is a "replacing spec".
12273 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
12274 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
12275 the display property, but just return a value indicating whether
12276 the display property will replace the characters it covers.
12277 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
12278 frame_window_p members of struct bidi_it.
12279 (compute_display_string_pos, compute_display_string_end):
12281 (push_it): Accept second argument POSITION, where pop_it should
12282 jump to continue iteration.
12283 (reseat_1): Initialize bidi_it.disp_pos.
12285 * keyboard.c (adjust_point_for_property): Adjust the call to
12286 display_prop_intangible_p to its new signature.
12288 * dispextern.h (struct bidi_it): New member frame_window_p.
12289 (bidi_init_it): Update prototypes.
12290 (display_prop_intangible_p): Update prototype.
12291 (compute_display_string_pos, compute_display_string_end):
12292 Declare prototypes.
12293 (struct bidi_it): New members nchars and disp_pos. ch_len is now
12296 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
12298 Malloc failure behavior now depends on size of allocation.
12299 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
12300 * lisp.h: Change signatures accordingly.
12301 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
12302 All callers changed. (Bug#8762)
12304 * gnutls.c: Use Emacs's memory allocators.
12305 Without this change, the gnutls library would invoke malloc etc.
12306 directly, which causes problems on non-SYNC_INPUT hosts, and which
12307 runs afoul of improving memory_full behavior. (Bug#8761)
12308 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
12309 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
12310 xfree instead of the default malloc, realloc, free.
12311 (Fgnutls_boot): No need to check for memory allocation failure,
12312 since xmalloc does that for us.
12314 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
12315 * category.c (hash_get_category_set):
12316 * ccl.c (ccl_driver):
12317 * charset.c (Fdefine_charset_internal):
12318 * charset.h (struct charset.hash_index):
12319 * composite.c (get_composition_id, gstring_lookup_cache)
12320 (composition_gstring_put_cache):
12321 * composite.h (struct composition.hash_index):
12322 * dispextern.h (struct image.hash):
12323 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
12324 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
12325 (hashfn_equal, hashfn_user_defined, make_hash_table)
12326 (maybe_resize_hash_table, hash_lookup, hash_put)
12327 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
12328 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
12329 (Fsxhash, Fgethash, Fputhash, Fmaphash):
12330 * image.c (make_image, search_image_cache, lookup_image)
12331 (xpm_put_color_table_h):
12332 * lisp.h (struct Lisp_Hash_Table):
12333 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
12334 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
12335 for hashes and hash indexes, instead of 'unsigned' and 'int'.
12336 * alloc.c (allocate_vectorlike):
12337 Check for overflow in vector size calculations.
12338 * ccl.c (ccl_driver):
12339 Check for overflow when converting EMACS_INT to int.
12340 * fns.c, image.c: Remove unnecessary static decls that would otherwise
12341 need to be updated by these changes.
12342 * fns.c (make_hash_table, maybe_resize_hash_table):
12343 Check for integer overflow with large hash tables.
12344 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
12345 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
12346 (SXHASH_REDUCE): New macro.
12347 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
12348 Use it instead of discarding useful hash info with large hash values.
12349 (sxhash_float): New function.
12350 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
12351 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
12352 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
12353 Rewrite to use FIXNUM_BITS, as this simplifies things.
12354 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
12355 Adjust signatures to match updated version of code.
12356 (consing_since_gc): Now EMACS_INT, since a single hash table can
12357 use more than INT_MAX bytes.
12359 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
12361 Make it possible to build with GCC-4.6+ -O2 -flto.
12363 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
12365 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
12367 * minibuf.c (get_minibuffer, read_minibuf_unwind):
12368 Call minibuffer-inactive-mode.
12370 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
12372 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
12373 Update dependencies.
12375 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12377 * data.c (init_data): Remove code for UTS, this system is not
12380 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12382 Don't force ./temacs to start in terminal mode.
12384 * frame.c (make_initial_frame): Initialize faces in all cases, not
12385 only when CANNOT_DUMP is defined.
12386 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
12388 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12390 * dispnew.c (add_window_display_history): Use const for the string
12391 pointer. Remove declaration, not needed.
12393 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
12395 Use 'inline', not 'INLINE'.
12396 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
12397 * alloc.c, fontset.c (INLINE): Remove.
12398 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
12399 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
12400 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
12401 * gmalloc.c (register_heapinfo): Use inline unconditionally.
12402 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
12404 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12406 Make it possible to run ./temacs.
12408 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
12409 syms_of_callproc does the same thing. Remove test for
12410 "initialized", do it in the caller.
12411 * emacs.c (main): Avoid calling set_initial_environment when dumping.
12413 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
12415 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
12416 (read_minibuf): Use get_minibuffer.
12417 (syms_of_minibuf): Use DEFSYM.
12418 (Qmetadata): New var.
12419 * data.c (Qbuffer): Don't make it static.
12420 (syms_of_data): Use DEFSYM.
12422 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
12424 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
12425 (CCL_CODE_MIN): New macro.
12427 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
12429 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
12431 * eval.c (Qdebug): Now static.
12432 * lisp.h (Qdebug): Remove decl. This reverts a part of the
12433 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
12434 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
12436 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
12438 * image.c: Various fixes to ImageMagick code comments.
12439 (Fimagemagick_types): Doc fix.
12441 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
12443 Minor fixes prompted by GCC 4.6.0 warnings.
12445 * xselect.c (converted_selections, conversion_fail_tag): Now static.
12447 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
12448 (x_clipboard_manager_save_all): Move extern decl to ...
12449 * xterm.h: ... here, so that it can be checked for consistency.
12451 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
12453 * xselect.c (x_clipboard_manager_save_frame)
12454 (x_clipboard_manager_save_all): New functions.
12455 (Fx_clipboard_manager_save): Lisp function deleted.
12457 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
12458 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
12460 * xterm.h: Update prototype.
12462 2011-05-28 William Xu <william.xwl@gmail.com>
12464 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
12465 exiting (Bug#8239).
12467 2011-05-28 Jim Meyering <meyering@redhat.com>
12469 Avoid a sign-extension bug in crypto_hash_function.
12470 * fns.c (to_uchar): Define.
12471 (crypto_hash_function): Use it to convert some newly-signed
12472 variables to unsigned, to avoid sign-extension bugs. For example,
12473 without this change, (md5 "truc") would evaluate to
12474 45723a2aff78ff4fff7fff1114760e62 rather than the expected
12475 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
12476 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
12478 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
12480 Integer overflow fixes.
12482 * dbusbind.c: Serial number integer overflow fixes.
12483 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
12484 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
12485 to hold a serial number that is too large for a fixnum.
12486 (Fdbus_method_return_internal, Fdbus_method_error_internal):
12487 Check for serial numbers out of range. Decode any serial number
12488 that was so large that it became a float. (Bug#8722)
12490 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
12491 (Fdbus_call_method, Fdbus_call_method_asynchronously):
12492 Use XFASTINT rather than XUINT when numbers are nonnegative.
12493 (xd_append_arg, Fdbus_method_return_internal):
12494 (Fdbus_method_error_internal): Likewise. Also, for unsigned
12495 arguments, check that Lisp number is nonnegative, rather than
12496 silently wrapping negative numbers around. (Bug#8722)
12497 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
12500 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
12502 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
12504 ccl: Add integer overflow checks.
12505 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
12506 (IN_INT_RANGE): New macros.
12507 (ccl_driver): Use them to check for integer overflow when
12508 decoding a CCL program. Many of the new checks are whether XINT (x)
12509 fits in int; it doesn't always, on 64-bit hosts. The new version
12510 doesn't catch all possible integer overflows, but it's an
12511 improvement. (Bug#8719)
12513 * alloc.c (make_event_array): Use XINT, not XUINT.
12514 There's no need for unsigned here.
12516 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
12517 This follows up to the 2011-05-06 change that substituted uintptr_t
12518 for EMACS_INT. This case wasn't caught back then.
12520 Rework Fformat to avoid integer overflow issues.
12521 * editfns.c: Include <float.h> unconditionally, as it's everywhere
12522 now (part of C89). Include <verify.h>.
12523 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
12524 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
12525 (Fformat): Avoid the prepass trying to compute sizes; it was only
12526 approximate and thus did not catch overflow reliably. Instead, walk
12527 through the format just once, formatting and computing sizes as we go,
12528 checking for integer overflow at every step, and allocating a larger
12529 buffer as needed. Keep track separately whether the format is
12530 multibyte. Keep only the most-recently calculated precision, rather
12531 than them all. Record whether each argument has been converted to
12532 string. Use EMACS_INT, not int, for byte and char and arg counts.
12533 Support field widths and precisions larger than INT_MAX. Avoid
12534 sprintf's undefined behavior with conversion specifications such as %#d
12535 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
12536 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
12537 formatting out-of-range floating point numbers with int
12538 formats. (Bug#8668)
12540 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
12542 * data.c: Avoid integer truncation in expressions involving floats.
12543 * data.c: Include <intprops.h>.
12544 (arith_driver): When there's an integer overflow in an expression
12545 involving floating point, convert the integers to floating point
12546 so that the resulting value does not suffer from catastrophic
12547 integer truncation. For example, on a 64-bit host (* 4
12548 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
12549 Do not rely on undefined behavior after integer overflow.
12551 merge count_size_as_multibyte, parse_str_to_multibyte
12552 * character.c, character.h (count_size_as_multibyte):
12553 Rename from parse_str_to_multibyte; all uses changed.
12554 Check for integer overflow.
12555 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
12556 since it's now a duplicate of the other. This is more of
12557 a character than a buffer op, so better that it's in character.c.
12558 * fns.c, print.c: Adjust to above changes.
12560 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
12562 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
12564 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
12566 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
12567 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
12568 (x_clipboard_manager_save): Now static.
12569 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
12571 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
12572 (crypto_hash_function): Now static.
12573 Fix pointer signedness problems. Avoid unnecessary initializations.
12575 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
12577 * termhooks.h (Vselection_alist): Make it terminal-local.
12579 * terminal.c (create_terminal): Initialize it.
12581 * xselect.c: Support for clipboard managers.
12582 (Vselection_alist): Move to termhooks.h as terminal-local var.
12583 (LOCAL_SELECTION): New macro.
12584 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
12585 (symbol_to_x_atom): Remove gratuitous arg.
12586 (x_handle_selection_request, lisp_data_to_selection_data)
12587 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
12588 (x_own_selection, x_get_local_selection, x_convert_selection):
12589 New arg, specifying work frame. Use terminal-local Vselection_alist.
12590 (some_frame_on_display): Delete unused function.
12591 (Fx_own_selection_internal, Fx_get_selection_internal)
12592 (Fx_disown_selection_internal, Fx_selection_owner_p)
12593 (Fx_selection_exists_p): New optional frame arg.
12594 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
12595 (x_handle_selection_clear): Don't treat other terminals with the
12596 same keyboard specially. Use the terminal-local Vselection_alist.
12597 (x_clear_frame_selections): Use Frun_hook_with_args.
12599 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
12601 * xterm.h: Add support for those atoms.
12603 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
12605 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
12606 (converted_selections, conversion_fail_tag): New global variables.
12607 (x_selection_request_lisp_error): Free the above.
12608 (x_get_local_selection): Remove unnecessary code.
12609 (x_reply_selection_request): Args changed; handle arbitrary array
12610 of converted selections stored in converted_selections.
12611 Separate the XChangeProperty and SelectionNotify steps.
12612 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
12613 (x_convert_selection): New function.
12614 (x_handle_selection_event): Simplify.
12615 (x_get_foreign_selection): Don't ignore incoming requests while
12616 waiting for an answer; this will fail when we implement
12617 SAVE_TARGETS, and seems unnecessary anyway.
12618 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
12619 (Vx_sent_selection_functions): Doc fix.
12621 2011-05-26 Leo Liu <sdl.web@gmail.com>
12623 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
12625 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12627 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
12629 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
12630 for fringe update if it has periodic bitmap.
12631 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
12632 and fringe_bitmap_periodic_p.
12634 * fringe.c (get_fringe_bitmap_data): New function.
12635 (draw_fringe_bitmap_1, update_window_fringes): Use it.
12636 (update_window_fringes): Record periodicity of fringe bitmap in glyph
12637 row. Mark glyph row for fringe update if periodicity changed.
12639 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
12640 for fringe update unless it has periodic bitmap.
12642 2011-05-25 Kenichi Handa <handa@m17n.org>
12644 * xdisp.c (get_next_display_element): Set correct it->face_id for
12645 a static composition.
12647 2011-05-24 Leo Liu <sdl.web@gmail.com>
12650 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
12652 * fns.c (crypto_hash_function, Fsha1): New function.
12653 (Fmd5): Use crypto_hash_function.
12654 (syms_of_fns): Add Ssha1.
12656 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
12658 * gnutls.c: Remove unused macros.
12659 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
12660 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
12661 Remove macros that are defined and never used.
12662 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
12664 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
12666 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
12667 (Fx_get_selection_internal): Minor cleanup.
12668 (Fx_own_selection_internal): Rename arguments for consistency with
12671 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
12673 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
12675 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
12677 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
12679 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12681 * dispnew.c (scrolling_window): Don't exclude the case that the
12682 last enabled row in the desired matrix touches the bottom boundary.
12684 2011-05-21 Glenn Morris <rgm@gnu.org>
12686 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
12687 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
12688 and add some more files.
12690 2011-05-20 Eli Zaretskii <eliz@gnu.org>
12692 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
12693 report_file_error introduced by the change from 2011-05-07.
12695 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
12697 * systime.h (Time): Define only if emacs is defined.
12698 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
12699 where the include path doesn't have X11/X.h by default. See
12700 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
12702 2011-05-20 Kenichi Handa <handa@m17n.org>
12704 * composite.c (find_automatic_composition): Fix previous change.
12706 2011-05-20 Glenn Morris <rgm@gnu.org>
12708 * lisp.mk: New file, split from Makefile.in.
12709 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
12710 (shortlisp): Remove.
12711 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
12713 2011-05-19 Glenn Morris <rgm@gnu.org>
12715 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
12716 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
12717 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
12718 (lisp): Set the order to that of loadup.el.
12719 (shortlisp): Make it a copy of $lisp.
12720 (SOME_MACHINE_LISP): Remove.
12721 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
12722 Use just $shortlisp, not $SOME_MACHINE_LISP too.
12724 2011-05-18 Kenichi Handa <handa@m17n.org>
12726 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
12727 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
12728 (find_automatic_composition): Mostly rewrite for efficiency.
12730 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
12732 * makefile.w32-in: Update dependencies.
12734 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
12736 * menu.c: Include limits.h (fixes the MS-Windows build broken by
12737 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
12739 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
12741 Fix some integer overflow issues, such as string length overflow.
12743 * insdel.c (count_size_as_multibyte): Check for string overflow.
12745 * character.c (lisp_string_width): Check for string overflow.
12746 Use EMACS_INT, not int, for string indexes and lengths; in
12747 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
12748 the resulting string length overflows an EMACS_INT; instead,
12749 report a string overflow if no precision given. When checking for
12750 precision exhaustion, use a check that cannot possibly have
12751 integer overflow. (Bug#8675)
12752 * character.h (lisp_string_width): Adjust to new signature.
12754 * alloc.c (string_overflow): New function.
12755 (Fmake_string): Use it. This doesn't change behavior, but saves
12756 a few bytes and will simplify future changes.
12757 * character.c (string_escape_byte8): Likewise.
12758 * lisp.h (string_overflow): New decl.
12760 Fixups, following up to the user-interface timestamp change.
12761 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
12762 for UI timestamps, instead of unsigned long.
12763 * msdos.c (mouse_get_pos): Likewise.
12764 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
12765 * w32gui.h (Time): Define by including "systime.h" rather than by
12766 declaring it ourselves. (Bug#8664)
12768 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
12769 * image.c (clear_image_cache): Likewise.
12771 * term.c (term_mouse_position): Don't assume time_t wraparound.
12773 Be more systematic about user-interface timestamps.
12774 Before, the code sometimes used 'Time', sometimes 'unsigned long',
12775 and sometimes 'EMACS_UINT', to represent these timestamps.
12776 This change causes it to use 'Time' uniformly, as that's what X uses.
12777 This makes the code easier to follow, and makes it easier to catch
12778 integer overflow bugs such as Bug#8664.
12779 * frame.c (Fmouse_position, Fmouse_pixel_position):
12780 Use Time, not unsigned long, for user-interface timestamps.
12781 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
12782 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
12783 * keyboard.h (last_event_timestamp): Likewise.
12784 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
12785 * menu.h (xmenu_show): Likewise.
12786 * term.c (term_mouse_position): Likewise.
12787 * termhooks.h (struct input_event.timestamp): Likewise.
12788 (struct terminal.mouse_position_hook): Likewise.
12789 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
12790 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
12791 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
12792 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
12793 what it was before.
12794 * menu.h, termhooks.h: Include "systime.h", for Time.
12796 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
12797 Don't assume that the difference between two unsigned long values
12798 can fit into an integer. At this point, we know button_down_time
12799 <= event->timestamp, so the difference must be nonnegative, so
12800 there's no need to cast the result if double-click-time is
12801 nonnegative, as it should be; check that it's nonnegative, just in
12802 case. This bug is triggered when events are more than 2**31 ms
12803 apart (about 25 days). (Bug#8664)
12805 * xselect.c (last_event_timestamp): Remove duplicate decl.
12806 (x_own_selection): Remove needless cast to unsigned long.
12808 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
12809 that always fit in int. Use a sentinel instead of a counter, to
12810 avoid a temp and to allay GCC's concerns about possible int overflow.
12811 * frame.h (struct frame): Use int for menu_bar_items_used
12812 instead of EMACS_INT, since it always fits in int.
12814 * menu.c (grow_menu_items): Check for int overflow.
12816 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
12818 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
12819 Before, the code was not consistent. These values cannot exceed
12820 2**31 - 1 so there's no need to make them unsigned.
12821 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
12822 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
12823 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
12825 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
12827 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
12828 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
12829 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
12830 presumably because the widths might not match.
12832 * window.c (size_window): Avoid needless test at loop start.
12834 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
12836 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
12838 2011-05-12 Drew Adams <drew.adams@oracle.com>
12840 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
12842 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12844 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
12845 `width' to `bar_area_x' and `bar_area_width', respectively.
12846 (x_scroll_run): Take account of fringe background extension.
12848 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
12849 Rename local vars `left' and `width' to `bar_area_x' and
12850 `bar_area_width', respectively.
12851 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
12852 background extension.
12854 2011-05-10 Jim Meyering <meyering@redhat.com>
12856 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
12858 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
12860 * image.c (Finit_image_library): Return t for built-in image types,
12861 like pbm and xbm. (Bug#8640)
12863 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
12865 * w32menu.c (set_frame_menubar): Fix submenu allocation.
12867 2011-05-07 Eli Zaretskii <eliz@gnu.org>
12869 * w32console.c (Fset_screen_color): Doc fix.
12870 (Fget_screen_color): New function.
12871 (syms_of_ntterm): Defsubr it.
12873 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
12874 unlink the temporary file if Fcall_process didn't create it in the
12876 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
12877 child process will be redirected to a file specified with `:file'.
12878 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
12879 cue to call_process_cleanup not to close that handle.
12881 2011-05-07 Ben Key <bkey76@gmail.com>
12883 * makefile.w32-in: The bootstrap-temacs rule now makes use of
12884 one of two shell specific rules, either bootstrap-temacs-CMD or
12885 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
12886 to the previous implementation of the bootstrap-temacs rule.
12887 The bootstrap-temacs-CMD rule is similar to the previous
12888 implementation of the bootstrap-temacs rule except that it
12889 makes use of the ESC_CFLAGS variable instead of the CFLAGS
12892 These changes, along with some changes to nt/configure.bat,
12893 nt/gmake.defs, and nt/nmake.defs, are required to extend my
12894 earlier fix to add support for --cflags and --ldflags options
12895 that include quotes so that it works whether make uses cmd or
12898 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
12900 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
12901 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
12903 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
12904 a string. Handle both cases.
12905 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
12906 (Fdbus_register_method): Use Qinvalid_function.
12908 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
12910 * makefile.w32-in: Update dependencies.
12911 (LISP_H): Add inttypes.h and stdin.h.
12912 (PROCESS_H): Add unistd.h.
12914 2011-05-06 Eli Zaretskii <eliz@gnu.org>
12916 * lread.c: Include limits.h (fixes the MS-Windows build broken by
12917 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
12919 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
12921 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
12923 * term.c (vfatal): Remove stray call to va_end.
12924 It's not needed and the C Standard doesn't allow it here anyway.
12926 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
12927 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
12929 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
12932 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
12934 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12936 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
12938 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
12940 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
12942 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
12943 * charset.c (Fdefine_charset_internal): Don't initialize
12944 charset.code_space[15]. The value was garbage, on hosts with
12945 32-bit int (Bug#8600).
12947 * lread.c (read_integer): Be more consistent with string-to-number.
12948 Use string_to_number to do the actual conversion; this avoids
12949 rounding errors and fixes some other screwups. Without this fix,
12950 for example, #x1fffffffffffffff was misread as -2305843009213693952.
12951 (digit_to_number): Move earlier, for benefit of read_integer.
12952 Return -1 if the digit is out of range for the base, -2 if it is
12953 not a digit in any supported base. (Bug#8602)
12955 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
12957 * dispnew.c (scrolling_window): Return 1 if we scrolled,
12958 to match comment at start of function. This also removes a
12959 GCC warning about overflow in a 32+64-bit port.
12961 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
12963 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
12964 Reported by Stefan Monnier in
12965 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
12966 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
12967 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
12969 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
12970 (EMACS_UINTPTR): Likewise, with uintptr_t.
12972 * lisp.h: Prefer 64-bit EMACS_INT if available.
12973 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
12974 on 32-bit hosts that have 64-bit int, so that they can access
12976 However, temporarily disable this change unless the temporary
12977 symbol WIDE_EMACS_INT is defined.
12979 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
12981 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
12982 This removes an assumption that EMACS_INT and long are the same
12983 width as pointers. The assumption is true for Emacs porting targets
12984 now, but we want to make other targets possible.
12985 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
12986 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
12987 In the rest of the code, change types of integers that hold casted
12988 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
12989 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
12990 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
12991 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
12992 No need to cast type when ORing.
12993 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
12994 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
12995 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
12996 assume EMACS_INT is the same width as char *.
12997 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
12998 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
12999 Remove no-longer-needed casts.
13000 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
13001 (xg_tool_bar_help_callback, xg_make_tool_item):
13002 Use EMACS_INTPTR to hold an integer
13003 that will be cast to void *; this can avoid a GCC warning
13004 if EMACS_INT is not the same width as void *.
13005 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
13006 * xdisp.c (display_echo_area_1, resize_mini_window_1):
13007 (current_message_1, set_message_1):
13008 Use a local to convert to proper width without a cast.
13009 * xmenu.c (dialog_selection_callback): Likewise.
13011 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
13012 Also, don't assume VALBITS / RAND_BITS is less than 5,
13013 and don't rely on undefined behavior when shifting a 1 left into
13015 * lisp.h (get_random): Change signature to match.
13017 * lread.c (hash_string): Use size_t, not int, for hash computation.
13018 Normally we prefer signed values; but hashing is special, because
13019 it's better to use unsigned division on hash table sizes so that
13020 the remainder is nonnegative. Also, size_t is the natural width
13021 for hashing into memory. The previous code used 'int', which doesn't
13022 retain enough info to hash well into very large tables.
13023 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
13025 * dbusbind.c: Don't possibly lose pointer info when converting.
13026 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13027 Use XPNTR rather than XHASH, so that the high-order bits of
13028 the pointer aren't lost when converting through void *.
13030 * eval.c (Fautoload): Don't double-shift a pointer.
13032 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
13034 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
13036 * gnutls.c (DEF_GNUTLS_FN):
13037 * image.c (DEF_IMGLIB_FN): Make function pointers static.
13039 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
13041 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
13044 2011-05-05 Eli Zaretskii <eliz@gnu.org>
13046 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
13047 New version that can reserve upto 2GB of heap space.
13049 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
13051 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
13053 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
13055 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
13056 `gnutls_certificate_set_x509_key_file'.
13058 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
13060 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
13061 Update dependencies.
13063 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13065 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
13066 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13067 Remove unused parameter `fildes'.
13068 * process.c (read_process_output, send_process): Don't pass it.
13070 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13072 Fix previous change: the library cache is defined in w32.c.
13073 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
13074 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
13076 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13078 Implement dynamic loading of GnuTLS on Windows.
13080 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
13081 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
13082 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13085 * gnutls.c (Qgnutls_dll): Define.
13086 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
13087 (gnutls_*): Declare function pointers.
13088 (init_gnutls_functions): New function to initialize function pointers.
13089 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
13090 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
13091 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13092 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
13093 (emacs_gnutls_write, emacs_gnutls_read)
13094 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
13095 (Fgnutls_available_p): New function.
13096 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
13097 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
13098 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
13100 * image.c: Include w32.h.
13101 (Vimage_type_cache): Delete.
13102 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
13103 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
13104 (w32_delayed_load): Move to w32.c.
13106 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
13108 * w32.c (QCloaded_from, Vlibrary_cache): Define.
13109 (w32_delayed_load): Move from image.c. When loading a library, record
13110 its filename in the :loaded-from property of the library id.
13111 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
13112 Initialize and staticpro them.
13113 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
13115 * process.c: Include lisp.h before w32.h, not after.
13116 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
13117 instead of gnutls_record_check_pending.
13119 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
13121 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
13123 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
13124 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
13127 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
13129 * xterm.c (x_set_frame_alpha): Do not set property on anything
13130 else than FRAME_X_OUTER_WINDOW (Bug#8608).
13132 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
13134 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
13136 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
13138 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
13139 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
13140 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
13141 (gnutls_global_initialized, Qgnutls_bootprop_priority)
13142 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
13143 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
13144 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
13145 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
13146 (Qgnutls_bootprop_callbacks_verify): Make static.
13148 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
13150 * callproc.c: Indentation fixup.
13152 * sysdep.c (wait_for_termination_1): Make static.
13153 (wait_for_termination, interruptible_wait_for_termination):
13154 Move after wait_for_termination_1.
13156 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
13158 * sysdep.c (interruptible_wait_for_termination): New function
13159 which is like wait_for_termination, but allows keyboard
13162 * callproc.c (Fcall_process): Add (:file "file") as an option for
13164 (Fcall_process_region): Ditto.
13166 2011-04-30 Eli Zaretskii <eliz@gnu.org>
13168 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
13169 rather than `XVECTOR (FOO)->size'.
13171 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
13172 inttypes.h, as a gnulib replacement is used if it not available in
13175 2011-04-21 Eli Zaretskii <eliz@gnu.org>
13177 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
13178 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
13179 of MOST_POSITIVE_FIXNUM. (Bug#8528)
13181 * coding.c (coding_alloc_by_realloc): Error out if destination
13182 will grow beyond MOST_POSITIVE_FIXNUM.
13183 (decode_coding_emacs_mule): Abort if there isn't enough place in
13184 charbuf for the composition carryover bytes. Reserve an extra
13185 space for up to 2 characters produced in a loop.
13186 (decode_coding_iso_2022): Abort if there isn't enough place in
13187 charbuf for the composition carryover bytes.
13189 2011-04-21 Eli Zaretskii <eliz@gnu.org>
13191 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
13192 aborting when %lld or %lll format is passed.
13193 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
13194 %llo or %llx format is passed. (Bug#8545)
13196 * window.c (window_scroll_line_based): Use a marker instead of
13197 simple variables to record original value of point. (Bug#7952)
13199 * doprnt.c (doprnt): Fix the case where a multibyte sequence
13200 produced by %s or %c overflows available buffer space. (Bug#8545)
13202 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
13204 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
13205 (SIZE_MAX): Move defn after all includes, as they might #define it.
13207 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
13209 * w32.c (init_environment): Warn about defaulting HOME to C:\.
13211 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
13213 * keyboard.c (Qdelayed_warnings_hook): Define.
13214 (command_loop_1): Run `delayed-warnings-hook'
13215 if Vdelayed_warnings_list is non-nil.
13216 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
13217 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
13219 2011-04-28 Eli Zaretskii <eliz@gnu.org>
13221 * doprnt.c (doprnt): Don't return value smaller than the buffer
13222 size if the message was truncated. (Bug#8545).
13224 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
13226 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
13227 (Fx_window_property): #if-0 the whole functions, not just the bodies.
13229 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
13231 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
13233 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
13235 * makefile.w32-in: Update dependencies.
13237 2011-04-27 Eli Zaretskii <eliz@gnu.org>
13239 Improve `doprnt' and its usage. (Bug#8545)
13240 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
13241 `format_end'. Remove support for %l as a conversion specifier.
13242 Don't use xrealloc. Improve diagnostics when the %l size modifier
13243 is used. Update the commentary.
13245 * eval.c (verror): Simplify calculation of size_t.
13247 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
13250 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
13252 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
13255 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
13257 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
13258 This makes this file independent of the recent pseudovector change.
13260 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
13262 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
13264 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
13265 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
13266 Remove unused local.
13267 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
13269 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
13270 GCC 4.6.0 optimizes based on type-based alias analysis.
13271 For example, if b is of type struct buffer * and v of type struct
13272 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
13273 != &v->size, and therefore "v->size = 1; b->size = 2; return
13274 v->size;" must therefore return 1. This assumption is incorrect
13275 for Emacs, since it type-puns struct Lisp_Vector * with many other
13276 types. To fix this problem, this patch adds a new type struct
13277 vectorlike_header that documents the constraints on layout of vectors
13278 and pseudovectors, and helps optimizing compilers not get fooled
13279 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
13280 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
13281 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
13283 (XSETPVECTYPE): Rewrite in terms of new macro.
13284 (XSETPVECTYPESIZE): New macro, specifying both type and size.
13285 This is a bit clearer, and further avoids the possibility of
13286 undesirable aliasing.
13287 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
13288 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
13289 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
13290 since Lisp_Subr is a special case (no "next" field).
13291 (ASIZE): Now uses header.size rather than size.
13292 All previous uses of XVECTOR (foo)->size replaced to use this macro,
13293 to avoid the hassle of writing XVECTOR (foo)->header.size.
13294 (struct vectorlike_header): New type.
13295 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
13296 object, to help avoid aliasing.
13297 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
13298 (SUBRP): Likewise, since Lisp_Subr is a special case.
13299 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
13300 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
13301 (struct Lisp_Hash_Table): Combine first two members into a single
13302 struct vectorlike_header member. All uses of "size" and "next" members
13303 changed to be "header.size" and "header.next".
13304 * buffer.h (struct buffer): Likewise.
13305 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
13306 * frame.h (struct frame): Likewise.
13307 * process.h (struct Lisp_Process): Likewise.
13308 * termhooks.h (struct terminal): Likewise.
13309 * window.c (struct save_window_data, struct saved_window): Likewise.
13310 * window.h (struct window): Likewise.
13311 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
13312 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
13313 * buffer.c (init_buffer_once): Likewise.
13314 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
13316 * process.c (Fformat_network_address): Use local var for size,
13319 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
13321 Make the Lisp reader and string-to-float more consistent (Bug#8525)
13322 * data.c (atof): Remove decl; no longer used or needed.
13323 (digit_to_number): Move to lread.c.
13324 (Fstring_to_number): Use new string_to_number function, to be
13325 consistent with how the Lisp reader treats infinities and NaNs.
13326 Do not assume that floating-point numbers represent EMACS_INT
13327 without losing information; this is not true on most 64-bit hosts.
13328 Avoid double-rounding errors, by insisting on integers when
13329 parsing non-base-10 numbers, as the documentation specifies.
13330 * lisp.h (string_to_number): New decl, replacing ...
13331 (isfloat_string): Remove.
13332 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
13333 (read1): Do not accept +. and -. as integers; this
13334 appears to have been a coding error. Similarly, do not accept
13335 strings like +-1e0 as floating point numbers. Do not report
13336 overflow for integer overflows unless the base is not 10 which
13337 means we have no simple and reliable way to continue.
13338 Break out the floating-point parsing into a new
13339 function string_to_number, so that Fstring_to_number parses
13340 floating point numbers consistently with the Lisp reader.
13341 (digit_to_number): Move here from data.c. Make it static inline.
13342 (E_CHAR, EXP_INT): Remove, replacing with ...
13343 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
13344 (string_to_number): New function, replacing isfloat_string.
13345 This function checks for valid syntax and produces the resulting
13346 Lisp float number too. Rework it so that string-to-number
13347 no longer mishandles examples like "1.0e+". Use strtoumax,
13348 so that overflow for non-base-10 numbers is reported only when
13349 there's no portable and simple way to convert to floating point.
13351 * textprop.c (set_text_properties_1): Rewrite for clarity,
13352 and to avoid GCC warning about integer overflow.
13354 * intervals.h (struct interval): Use EMACS_INT for members
13355 where EMACS_UINT might cause problems. See
13356 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
13357 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
13358 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
13360 (offset_intervals): Tell GCC not to worry about length overflow
13361 when negating a negative length.
13363 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
13364 (overrun_check_free): Likewise.
13366 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
13367 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
13370 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
13371 (gnutls_make_error): Rename local to avoid shadowing.
13372 (gnutls_emacs_global_deinit): ifdef out; not used.
13373 (Fgnutls_boot): Use const for pointer to readonly storage.
13374 Comment out unused local. Fix pointer signedness problems.
13376 * lread.c (openp): Don't stuff size_t into an 'int'.
13377 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
13378 about possible signed overflow.
13380 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
13381 (GDK_KEY_g): Don't define if already defined.
13382 (xg_prepare_tooltip): Avoid pointer signedness problem.
13383 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
13385 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
13386 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
13388 * xfns.c (Fx_window_property): Simplify a bit,
13389 to make a bit faster and to avoid GCC 4.6.0 warning.
13390 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
13392 * fns.c (internal_equal): Don't assume size_t fits in int.
13394 * alloc.c (compact_small_strings): Tighten assertion a little.
13396 Replace pEd with more-general pI, and fix some printf arg casts.
13397 * lisp.h (pI): New macro, generalizing old pEd macro to other
13398 conversion specifiers. For example, use "...%"pI"d..." rather
13399 than "...%"pEd"...".
13400 (pEd): Remove. All uses replaced with similar uses of pI.
13401 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
13402 * alloc.c (check_pure_size): Don't overflow by converting size to int.
13403 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
13404 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
13405 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
13406 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
13407 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
13409 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
13410 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
13411 * print.c (safe_debug_print, print_object): Likewise.
13412 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
13414 Use pI instead of if-then-else-abort. Use %p to avoid casts,
13415 avoiding the 0 flag, which is not portable.
13416 * process.c (Fmake_network_process): Use pI to avoid cast.
13417 * region-cache.c (pp_cache): Likewise.
13418 * xdisp.c (decode_mode_spec): Likewise.
13419 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
13420 behavior on 64-bit hosts with printf arg.
13421 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
13422 (x_stop_queuing_selection_requests): Likewise.
13423 (x_get_window_property): Don't truncate byte count to an 'int'
13426 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
13427 here, since it parses constructs like leading '-' and spaces,
13428 which are not wanted; and it overflows with large numbers.
13429 Instead, simply match F[0-9]+, which is what is wanted anyway.
13431 * alloc.c: Remove unportable assumptions about struct layout.
13432 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
13433 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
13434 (allocate_vectorlike, make_pure_vector): Use the new macros,
13435 plus offsetof, to remove unportable assumptions about struct layout.
13436 These assumptions hold on all porting targets that I know of, but
13437 they are not guaranteed, they're easy to remove, and removing them
13438 makes further changes easier.
13440 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
13441 This doesn't fix a bug but makes the code clearer.
13442 (string_overrun_cookie): Now const. Use initializers that
13443 don't formally overflow signed char, to avoid warnings.
13444 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
13445 can cause Emacs to crash when string overrun checking is enabled.
13446 (allocate_buffer): Don't assume sizeof (struct buffer) is a
13447 multiple of sizeof (EMACS_INT); it need not be, if
13448 alignof(EMACS_INT) < sizeof (EMACS_INT).
13449 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
13451 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
13453 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
13455 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
13457 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
13458 supposed to be handshaking. (Bug#8556)
13459 Reported by Paul Eggert <eggert@cs.ucla.edu>.
13461 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
13463 * lisp.h (Qdebug): List symbol.
13464 * eval.c (Qdebug): Restore global linkage.
13465 * keyboard.c (debug-on-event): New variable.
13466 (handle_user_signal): Break into debugger when debug-on-event
13467 matches the current signal symbol.
13469 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
13471 * alloc.c (check_sblock, check_string_bytes)
13472 (check_string_free_list): Convert to standard C.
13474 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
13476 * w32.c (emacs_gnutls_push): Fix typo.
13478 2011-04-25 Eli Zaretskii <eliz@gnu.org>
13480 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
13481 "cast to pointer from integer of different size".
13483 Improve doprnt and its use in verror. (Bug#8545)
13484 * doprnt.c (doprnt): Document the set of format control sequences
13485 supported by the function. Use SAFE_ALLOCA instead of always
13488 * eval.c (verror): Don't limit the buffer size at size_max-1, that
13489 is one byte too soon. Don't use xrealloc; instead xfree and
13492 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
13494 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
13497 * gnutls.c: Renamed global_initialized to
13498 gnutls_global_initialized. Added internals for the
13499 :verify-hostname-error, :verify-error, and :verify-flags
13500 parameters of `gnutls-boot' and documented those parameters in the
13501 docstring. Start callback support.
13502 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
13503 unless a fatal error occurred. Call gnutls_alert_send_appropriate
13504 on error. Return error code.
13505 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
13506 (emacs_gnutls_read): Likewise.
13507 (Fgnutls_boot): Return handshake error code.
13508 (emacs_gnutls_handle_error): New function.
13509 (wsaerror_to_errno): Likewise.
13511 * w32.h (emacs_gnutls_pull): Add prototype.
13512 (emacs_gnutls_push): Likewise.
13514 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
13515 (emacs_gnutls_push): Likewise.
13517 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
13519 * process.c (wait_reading_process_output): Check if GnuTLS
13520 buffered some data internally if no FDs are set for TLS
13523 * makefile.w32-in (OBJ2): Add gnutls.$(O).
13524 (LIBS): Link to USER_LIBS.
13525 ($(BLD)/gnutls.$(0)): New target.
13527 2011-04-24 Eli Zaretskii <eliz@gnu.org>
13529 * xdisp.c (handle_single_display_spec): Rename the
13530 display_replaced_before_p argument into display_replaced_p, to
13531 make it consistent with the commentary. Fix typos in the
13534 * textprop.c (syms_of_textprop): Remove dead code.
13535 (copy_text_properties): Delete obsolete commentary about an
13536 interface that was deleted long ago. Fix typos in the description
13539 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
13540 to changes in oldXMenu/XMenu.h from 2011-04-16.
13541 <menu_help_message, prev_menu_help_message>: Constify.
13542 (IT_menu_make_room): menu->help_text is now `const char **';
13545 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
13546 to changes in oldXMenu/XMenu.h from 2011-04-16.
13547 (struct XMenu): Declare `help_text' `const char **'.
13549 * xfaces.c <Qunspecified>: Make extern again.
13551 * syntax.c: Include sys/types.h before including regex.h, as
13554 * doc.c (get_doc_string): Improve the format passed to `error'.
13556 * doprnt.c (doprnt): Improve commentary.
13558 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
13560 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
13563 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
13564 changes in globals.h immediately force recompilation.
13565 (TAGS): Depend on $(CURDIR)/m/intel386.h and
13566 $(CURDIR)/s/ms-w32.h.
13567 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
13569 * character.c (Fchar_direction): Function deleted.
13570 (syms_of_character): Don't defsubr it.
13571 <char-direction-table>: Deleted.
13573 2011-04-23 Eli Zaretskii <eliz@gnu.org>
13575 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
13576 * doprnt.c: Include limits.h.
13577 (SIZE_MAX): New macro.
13578 (doprnt): Return a size_t value. 2nd arg is now size_t.
13579 Many local variables are now size_t instead of int or unsigned.
13580 Improve overflow protection. Support `l' modifier for integer
13581 conversions. Support %l conversion. Don't assume an EMACS_INT
13582 argument for integer conversions and for %c.
13584 * lisp.h (doprnt): Restore prototype.
13586 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
13587 $(SRC)/character.h.
13589 * Makefile.in (base_obj): Add back doprnt.o.
13591 * deps.mk (doprnt.o): Add back prerequisites.
13592 (callint.o): Depend on character.h.
13594 * eval.c (internal_lisp_condition_case): Include the handler
13595 representation in the error message.
13596 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
13597 when breaking from the loop.
13599 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
13601 * callint.c (Fcall_interactively): When displaying error message
13602 about invalid control letter, pass the character's codepoint, not
13603 a pointer to its multibyte form. Improve display of the character
13604 in octal and display also its hex code.
13606 * character.c (char_string): Use %x to display the (unsigned)
13607 codepoint of an invalid character, to avoid displaying a bogus
13610 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
13611 `error', not SYMBOL_NAME itself.
13613 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
13614 character arguments to `error'.
13616 * charset.c (check_iso_charset_parameter): Fix incorrect argument
13617 to `error' in error message about FINAL_CHAR argument. Make sure
13618 FINAL_CHAR is a character, and use %c when it is passed as
13619 argument to `error'.
13621 2011-04-23 Eli Zaretskii <eliz@gnu.org>
13623 * s/ms-w32.h (localtime): Redirect to sys_localtime.
13625 * w32.c: Include <time.h>.
13626 (sys_localtime): New function.
13628 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
13630 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
13632 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
13634 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
13636 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
13637 zombies (Bug#8467).
13639 2011-04-19 Eli Zaretskii <eliz@gnu.org>
13641 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
13642 gl_state.e_property when gl_state.object is Qt.
13644 * insdel.c (make_gap_larger): Remove limitation of buffer size
13647 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
13649 * xdisp.c (lookup_glyphless_char_display)
13650 (produce_glyphless_glyph): Handle cons cell entry in
13651 glyphless-char-display.
13652 (Vglyphless_char_display): Document it.
13654 * term.c (produce_glyphless_glyph): Handle cons cell entry in
13655 glyphless-char-display.
13657 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
13659 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
13661 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
13663 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
13664 definition for no-X builds.
13666 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
13668 Static checks with GCC 4.6.0 and non-default toolkits.
13670 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
13672 * process.c (keyboard_bit_set): Define only if SIGIO.
13673 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
13674 (send_process): Repair possible setjmp clobbering.
13676 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
13678 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
13680 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
13682 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
13683 Define only if needed.
13685 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
13686 by pacifying GCC about it. Maybe it's time to retire it?
13687 * xfaces.c (USG, __TIMEVAL__): Likewise.
13689 * dispextern.h (struct redisplay_interface): Rename param
13690 to avoid shadowing.
13691 * termhooks.h (struct terminal): Likewise.
13692 * xterm.c (xembed_send_message): Likewise.
13694 * insdel.c (make_gap_smaller): Define only if
13695 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
13697 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
13700 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
13701 so that we aren't warned about unused symbols.
13703 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
13705 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
13707 * xfns.c (x_real_positions): Mark locals as initialized.
13709 * xmenu.c (xmenu_show): Don't use uninitialized vars.
13711 * xterm.c: Fix problems found by static analysis with other toolkits.
13712 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
13713 (x_dispatch_event): Declare static if USE_GTK, and
13714 define if USE_GTK || USE_X_TOOLKIT.
13715 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
13716 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
13717 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
13718 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
13720 * xmenu.c (menu_help_callback): Pointer type fixes.
13721 Use const pointers when pointing at readonly data. Avoid pointer
13722 signedness clashes.
13723 (FALSE): Remove unused macro.
13724 (update_frame_menubar): Remove unused decl.
13726 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
13728 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
13729 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
13730 (single_menu_item): Rename local to avoid shadowing.
13732 * keyboard.c (make_lispy_event): Remove unused local var.
13734 * frame.c, frame.h (x_get_resource_string): Bring this back, but
13735 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
13737 * bitmaps: Change bitmaps from unsigned char back to the X11
13738 compatible char. Avoid the old compiler warnings about
13739 out-of-range initializers by using, for example, '\xab' rather
13742 * xgselect.c (xgselect_initialize): Check vs interface
13743 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
13745 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
13747 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
13748 to read-only memory.
13750 * fns.c (vector): Remove; this old hack is no longer needed.
13752 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
13754 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
13756 * xrdb.c (x_load_resources): Omit unused local.
13758 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
13759 (x_window): Rename locals to avoid shadowing.
13760 (USG): Use the kludged USG macro, to pacify gcc.
13762 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
13763 (x_term_init): Remove local to avoid shadowing.
13765 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
13767 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
13768 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
13770 2011-04-16 Eli Zaretskii <eliz@gnu.org>
13772 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
13774 Fix regex.c, syntax.c and friends for buffers > 2GB.
13775 * syntax.h (struct gl_state_s): Declare character position members
13778 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
13780 * textprop.c (verify_interval_modification, interval_of):
13781 Declare arguments EMACS_INT.
13783 * intervals.c (adjust_intervals_for_insertion): Declare arguments
13786 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
13788 * indent.c (Fvertical_motion): Local variable it_start is now
13791 * regex.c (re_match, re_match_2, re_match_2_internal)
13792 (bcmp_translate, regcomp, regexec, print_double_string)
13793 (group_in_compile_stack, re_search, re_search_2, regex_compile)
13794 (re_compile_pattern, re_exec): Declare arguments and local
13795 variables `size_t' and `ssize_t' and return values `regoff_t', as
13797 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
13798 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
13799 <compile_stack_type>: `size' and `avail' are now `size_t'.
13801 * regex.h <regoff_t>: Use ssize_t, not int.
13802 (re_search, re_search_2, re_match, re_match_2): Arguments that
13803 specify buffer/string position and length are now ssize_t and
13804 size_t. Return type is regoff_t.
13806 2011-04-16 Ben Key <bkey76@gmail.com>
13808 * nsfont.m: Fixed bugs in ns_get_family and
13809 ns_descriptor_to_entity that were caused by using free to
13810 deallocate memory blocks that were allocated by xmalloc (via
13811 xstrdup). This caused Emacs to crash when compiled with
13812 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
13813 --enable-checking=xmallocoverrun). xfree is now used to
13814 deallocate these memory blocks.
13816 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
13818 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
13820 emacs_write: Accept and return EMACS_INT for sizes.
13821 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
13823 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
13824 Accept and return EMACS_INT.
13825 (emacs_gnutls_write): Return the number of bytes written on
13827 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
13828 (emacs_read, emacs_write): Remove check for negative size, as the
13829 Emacs source code has been audited now.
13830 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
13831 (emacs_read, emacs_write): Use it.
13832 * process.c (send_process): Adjust to the new signatures of
13833 emacs_write and emacs_gnutls_write. Do not attempt to store
13834 a byte offset into an 'int'; it might overflow.
13835 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
13837 * sound.c: Don't assume sizes fit in 'int'.
13838 (struct sound_device.period_size, alsa_period_size):
13839 Return EMACS_INT, not int.
13840 (struct sound_device.write, vox_write, alsa_write):
13841 Accept EMACS_INT, not int.
13842 (wav_play, au_play): Use EMACS_INT to store sizes and to
13843 record read return values.
13845 2011-04-15 Ben Key <bkey76@gmail.com>
13847 * keyboard.c (Qundefined): Don't declare static since it is used
13849 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
13850 static since they are used in nsfont.m.
13852 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
13854 * process.c (Qprocessp): Don't declare static.
13855 * lisp.h (Qprocessp): Declare again.
13857 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
13859 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
13861 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
13863 Improve C-level modularity by making more things 'static'.
13865 Don't publish debugger-only interfaces to other modules.
13866 * lisp.h (safe_debug_print, debug_output_compilation_hack):
13867 (verify_bytepos, count_markers): Move decls to the only modules
13869 * region-cache.h (pp_cache): Likewise.
13870 * window.h (check_all_windows): Likewise.
13871 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
13873 * sysdep.c (croak): Now static, if
13874 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
13875 * syssignal.h (croak): Declare only if not static.
13877 * alloc.c (refill_memory_reserve): Now static if
13878 !defined REL_ALLOC || defined SYSTEM_MALLOC.
13879 * lisp.h (refill_memory_reserve): Declare only if not static.
13881 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
13882 Define only if USE_LUCID.
13884 * xrdb.c (x_customization_string, x_rm_string): Now static.
13886 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
13887 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
13889 * xdisp.c (draw_row_with_mouse_face): Now static.
13890 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
13892 * window.h (check_all_windows): Mark externally visible.
13894 * window.c (window_deletion_count): Now static.
13896 * undo.c: Make symbols static if they're not exported.
13897 (last_undo_buffer, last_boundary_position, pending_boundary):
13900 * textprop.c (interval_insert_behind_hooks): Now static.
13901 (interval_insert_in_front_hooks): Likewise.
13903 * term.c: Make symbols static if they're not exported.
13904 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
13905 (max_frame_lines, tty_set_terminal_modes):
13906 (tty_reset_terminal_modes, tty_turn_off_highlight):
13907 (get_tty_terminal): Now static.
13908 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
13909 * termhooks.h (term_mouse_moveto): Do not declare if
13910 HAVE_WINDOW_SYSTEM.
13911 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
13912 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
13914 * sysdep.c: Make symbols static if they're not exported.
13915 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
13917 (sigprocmask_set, full_mask): Remove; unused.
13918 (wait_debugging): Mark as visible.
13919 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
13920 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
13922 * syntax.c (syntax_temp): Define only if !__GNUC__.
13924 * sound.c (current_sound_device, current_sound): Now static.
13926 * search.c (searchbufs, searchbuf_head): Now static.
13928 * scroll.c (scroll_cost): Remove; unused.
13929 * dispextern.h (scroll_cost): Remove decl.
13931 * region-cache.h (pp_cache): Mark as externally visible.
13933 * process.c: Make symbols static if they're not exported.
13934 (process_tick, update_tick, create_process, chan_process):
13935 (Vprocess_alist, proc_buffered_char, datagram_access):
13936 (fd_callback_data, send_process_frame, process_sent_to): Now static.
13937 (deactivate_process): Mark defn as static, as well as decl.
13938 * lisp.h (create_process): Remove decl.
13939 * process.h (chan_process, Vprocess_alist): Remove decls.
13941 * print.c: Make symbols static if they're not exported.
13942 (print_depth, new_backquote_output, being_printed, print_buffer):
13943 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
13944 (print_interval, print_number_index, initial_stderr_stream):
13946 * lisp.h (Fprinc): Remove decl.
13947 (debug_output_compilation_hack): Mark as externally visible.
13949 * sysdep.c (croak): Move decl from here to syssignal.h.
13950 * syssignal.h (croak): Put it here, so the API can be checked when
13951 'croak' is called from dissociate_if_controlling_tty.
13953 * minibuf.c: Make symbols static if they're not exported.
13954 (minibuf_save_list, choose_minibuf_frame): Now static.
13955 * lisp.h (choose_minibuf_frame): Remove decl.
13957 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
13959 * lread.c: Make symbols static if they're not exported.
13960 (read_objects, initial_obarray, oblookup_last_bucket_number):
13962 (make_symbol): Remove; unused.
13963 * lisp.h (initial_obarray, make_symbol): Remove decls.
13965 * keyboard.c: Make symbols static if they're not exported.
13966 (single_kboard, recent_keys_index, total_keys, recent_keys):
13967 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
13968 (this_single_command_key_start, echoing, last_auto_save):
13969 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
13970 (command_loop, echo_now, keyboard_init_hook, help_char_p):
13971 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
13972 (Vlispy_mouse_stem, double_click_count):
13974 (force_auto_save_soon): Define only if SIGDANGER.
13975 (ignore_mouse_drag_p): Now static if
13976 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
13977 (print_help): Remove; unused.
13978 (stop_character, last_timer_event): Mark as externally visible.
13979 * keyboard.h (ignore_mouse_drag_p): Declare only if
13980 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
13981 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
13982 * lisp.h (echoing): Remove decl.
13983 (force_auto_save_soon): Declare only if SIGDANGER.
13984 * xdisp.c (redisplay_window): Simplify code, to make it more
13985 obvious that ignore_mouse_drag_p is not accessed if !defined
13986 USE_GTK && !defined HAVE_NS.
13988 * intervals.c: Make symbols static if they're not exported.
13989 (merge_properties_sticky, merge_interval_right, delete_interval):
13991 * intervals.h (merge_interval_right, delete_interval): Remove decls.
13993 * insdel.c: Make symbols static if they're not exported.
13994 However, leave prepare_to_modify_buffer alone. It's never
13995 called from outside this function, but that appears to be a bug.
13996 (combine_after_change_list, combine_after_change_buffer):
13997 (adjust_after_replace, signal_before_change): Now static.
13998 (adjust_after_replace_noundo): Remove; unused.
13999 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
14000 (signal_before_change): Remove decls.
14002 * indent.c (val_compute_motion, val_vmotion): Now static.
14004 * image.c: Make symbols static if they're not exported.
14005 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
14007 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
14008 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
14010 * fringe.c (standard_bitmaps): Now static.
14011 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
14013 * frame.c: Make symbols static if they're not exported.
14014 (x_report_frame_params, make_terminal_frame): Now static.
14015 (get_frame_param): Now static, unless HAVE_NS.
14016 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
14017 (x_get_resource_string): Remove; not used.
14018 * frame.h (make_terminal_frame, x_report_frame_params):
14019 (x_get_resource_string); Remove decls.
14020 (x_fullscreen_adjust): Declare only if WINDOWSNT.
14021 * lisp.h (get_frame_param): Declare only if HAVE_NS.
14023 * font.c, fontset.c: Make symbols static if they're not exported.
14024 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
14025 (FACE_SUITABLE_FOR_CHAR_P): Use it.
14026 * font.c (font_close_object): Now static.
14027 * font.h (font_close_object): Remove.
14028 * fontset.c (FONTSET_OBJLIST): Remove.
14029 (free_realized_fontset) #if-0 the body, which does nothing.
14030 (face_suitable_for_char_p): #if-0, as it's never called.
14031 * fontset.h (face_suitable_for_char_p): Remove decl.
14032 * xfaces.c (face_at_string_position):
14033 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
14034 since 0 is always ASCII.
14036 * fns.c (weak_hash_tables): Now static.
14038 * fileio.c: Make symbols static if they're not exported.
14039 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
14040 (Vwrite_region_annotation_buffers): Now static.
14042 * eval.c: Make symbols static if they're not exported.
14043 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
14044 * lisp.h (backtrace_list): Remove decl.
14046 * emacs.c: Make symbols static if they're not exported.
14047 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
14048 (fatal_error_code, fatal_error_signal_hook, standard_args):
14050 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
14051 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
14052 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
14053 * lisp.h (fatal_error_signal_hook): Remove decl.
14054 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
14056 * editfns.c: Move a (normally-unused) function to its only use.
14057 * editfns.c, lisp.h (get_operating_system_release): Remove.
14058 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
14059 worth the hassle of breaking this out.
14061 * xterm.c: Make symbols static if they're not exported.
14062 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
14063 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
14064 (x_destroy_window, x_delete_display):
14066 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
14067 (x_mouse_leave): Remove; unused.
14068 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
14069 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
14070 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
14072 (x_mouse_leave): Declare only if WINDOWSNT.
14073 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
14074 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
14077 * ftxfont.c: Make symbols static if they're not exported.
14078 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
14080 * font.h (ftxfont_driver): Likewise.
14082 * xfns.c: Make symbols static if they're not exported.
14083 (x_last_font_name, x_display_info_for_name):
14084 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
14085 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
14086 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
14087 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
14088 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
14089 (last_show_tip_args): Now static.
14090 (xic_defaut_fontset, xic_create_fontsetname): Define only if
14091 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
14092 (x_screen_planes): Remove; unused.
14093 * dispextern.h (x_screen_planes): Remove decl.
14095 * dispnew.c: Make symbols static if they're not exported.
14096 * dispextern.h (redraw_garbaged_frames, scrolling):
14097 (increment_row_positions): Remove.
14098 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
14099 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
14101 (redraw_garbaged_frames): Remove; unused.
14103 * xfaces.c: Make symbols static if they're not exported.
14104 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
14106 * xterm.h (defined_color): Remove decls.
14107 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
14108 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
14109 (menu_face_changed_default, defined_color, free_realized_face):
14110 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
14111 (ascii_face_of_lisp_face): Remove; unused.
14113 * xdisp.c: Make symbols static if they're not exported.
14114 * dispextern.h (scratch_glyph_row, window_box_edges):
14115 (glyph_to_pixel_coords, set_cursor_from_row):
14116 (get_next_display_element, set_iterator_to_next):
14117 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
14118 (show_mouse_face): Remove decls
14119 * frame.h (message_buf_print): Likewise.
14120 * lisp.h (pop_message, set_message, check_point_in_composition):
14122 * xterm.h (set_vertical_scroll_bar): Likewise.
14123 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
14124 (message_buf_print, scratch_glyph_row, displayed_buffer):
14125 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
14126 (get_next_display_element, show_mouse_face, window_box_edges):
14127 (frame_to_window_pixel_xy, check_point_in_composition):
14128 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
14129 (glyph_to_pixel_coords): Remove; unused.
14131 * dired.c (file_name_completion): Now static.
14133 * dbusbind.c (xd_in_read_queued_messages): Now static.
14135 * lisp.h (circular_list_error, FOREACH): Remove; unused.
14136 * data.c (circular_list_error): Remove.
14138 * commands.h (last_point_position, last_point_position_buffer):
14139 (last_point_position_window): Remove decls.
14140 * keyboard.c: Make these variables static.
14142 * coding.h (coding, code_convert_region, encode_coding_gap):
14144 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
14145 (iso_code_class, detect_coding, code_convert_region): Now static.
14146 (encode_coding_gap): Remove; unused.
14148 * chartab.c (chartab_chars, chartab_bits): Now static.
14150 * charset.h (charset_iso_8859_1): Remove decl.
14151 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
14154 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
14155 * ccl.c (Vccl_program_table): Now static.
14156 (check_ccl_update): Remove; unused.
14158 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
14159 * category.h: ... from here.
14160 * category.c (check_category_table, set_category_set): Now static.
14162 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
14163 * lisp.h: Remove these decls.
14165 * buffer.c (buffer_count): Remove unused var.
14167 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
14168 so that it's not optimized away.
14169 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
14170 * dispextern.h (bidi_dump_cached_states): Remove, since it's
14171 exported only to the debugger.
14173 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
14174 * atimer.h (run_all_atimers): Remove; not exported.
14176 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
14177 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
14178 was inaccessible from Lisp.
14179 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
14180 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
14182 alloc.c: Import and export fewer symbols, and remove unused items.
14183 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
14185 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
14186 it's not optimized away by whole-program optimization.
14187 (message_enable_multibyte, free_misc): Remove.
14188 (catchlist, handlerlist, mark_backtrace):
14189 Declare only if BYTE_MARK_STACK.
14190 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
14191 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
14192 (message_enable_multibyte): Remove decl.
14193 (free_misc, interval_free_list, float_block, float_block_index):
14194 (n_float_blocks, float_free_list, cons_block, cons_block_index):
14195 (cons_free_list, last_marked_index):
14197 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
14198 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
14199 (mark_backtrace): Define only if BYTE_MARK_STACK.
14200 * xdisp.c (message_enable_multibyte): Now static.
14202 Declare Lisp_Object Q* variables to be 'static' if not exported.
14203 This makes it easier for human readers (and static analyzers)
14204 to see whether these variables are used from other modules.
14205 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
14206 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
14207 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
14208 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
14209 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
14210 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
14211 * xmenu.c, xselect.c:
14212 Declare Q* vars static if they are not used in other modules.
14213 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
14214 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
14215 Remove decls of unexported vars.
14216 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
14218 * lisp.h (DEFINE_FUNC): Make sname 'static'.
14220 Make Emacs functions such as Fatom 'static' by default.
14221 This makes it easier for human readers (and static analyzers)
14222 to see whether these functions can be called from other modules.
14223 DEFUN now defines a static function. To make the function external
14224 so that it can be used in other C modules, use the new macro DEFUE.
14225 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
14226 (Finit_image_library):
14227 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
14228 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
14229 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
14230 Remove decls, since these functions are now static.
14231 (Funintern, Fget_internal_run_time): New decls, since these functions
14232 were already external.
14234 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
14235 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
14236 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
14237 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
14238 * keyboard.c, keymap.c, lread.c:
14239 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
14240 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
14241 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
14242 Mark functions with DEFUE instead of DEFUN,
14243 if they are used in other modules.
14244 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
14245 decls for now-static functions.
14246 * buffer.h (Fdelete_overlay): Remove decl.
14247 * callproc.c (Fgetenv_internal): Mark as internal.
14248 * composite.c (Fremove_list_of_text_properties): Remove decl.
14249 (Fcomposition_get_gstring): New forward static decl.
14250 * composite.h (Fcomposite_get_gstring): Remove decl.
14251 * dired.c (Ffile_attributes): New forward static decl.
14252 * doc.c (Fdocumntation_property): New forward static decl.
14253 * eval.c (Ffetch_bytecode): New forward static decl.
14254 (Funintern): Remove extern decl; now in .h file where it belongs.
14255 * fileio.c (Fmake_symbolic_link): New forward static decl.
14256 * image.c (Finit_image_library): New forward static decl.
14257 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
14258 * intervals.h (Fprevious_property_change):
14259 (Fremove_list_of_text_properties): Remove decls.
14260 * keyboard.c (Fthis_command_keys): Remove decl.
14261 (Fcommand_execute): New forward static decl.
14262 * keymap.c (Flookup_key): New forward static decl.
14263 (Fcopy_keymap): Now static.
14264 * keymap.h (Flookup_key): Remove decl.
14265 * process.c (Fget_process): New forward static decl.
14266 (Fprocess_datagram_address): Mark as internal.
14267 * syntax.c (Fsyntax_table_p): New forward static decl.
14268 (skip_chars): Remove duplicate decl.
14269 * textprop.c (Fprevious_property_change): New forward static decl.
14270 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
14272 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
14273 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
14275 * editfns.c (Fformat): Remove unreachable code.
14277 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
14279 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
14282 2011-04-13 Eli Zaretskii <eliz@gnu.org>
14284 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
14285 when at ZV. (Bug#8487)
14287 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
14289 * charset.c (Fclear_charset_maps): Use xfree instead of free.
14291 * keyboard.c (parse_tool_bar_item): Likewise.
14292 * sound.c (sound_cleanup, alsa_close): Likewise.
14293 * termcap.c (tgetent): Likewise.
14294 * xfns.c (x_default_font_parameter): Likewise.
14295 * xsettings.c (read_and_apply_settings): Likewise.
14297 * alloc.c (overrun_check_malloc, overrun_check_realloc)
14298 (overrun_check_free): Protoize.
14300 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
14302 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
14303 since callers should never pass a negative size.
14304 Change the signature to match that of plain 'read' and 'write'; see
14305 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
14306 * lisp.h: Update prototypes of emacs_write and emacs_read.
14308 2011-04-11 Eli Zaretskii <eliz@gnu.org>
14310 * xdisp.c (redisplay_window): Don't try to determine the character
14311 position of the scroll margin if the window start point w->startp
14312 is outside the buffer's accessible region. (Bug#8468)
14314 2011-04-10 Eli Zaretskii <eliz@gnu.org>
14316 Fix write-region and its subroutines for buffers > 2GB.
14317 * fileio.c (a_write, e_write): Modify declaration of arguments and
14318 local variables to support buffers larger than 2GB.
14319 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
14321 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
14322 argument, local variables, and return value.
14324 * lisp.h: Update prototypes of emacs_write and emacs_read.
14326 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
14328 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
14330 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
14332 Fix more problems found by GCC 4.6.0's static checks.
14334 * xdisp.c (vmessage): Use a better test for character truncation.
14336 * charset.c (load_charset_map): <, not <=, for optimization,
14337 and to avoid potential problems with integer overflow.
14338 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
14339 * casetab.c (set_identity, shuffle): Likewise.
14340 * editfns.c (Fformat): Likewise.
14341 * syntax.c (skip_chars): Likewise.
14343 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
14344 This also lets GCC 4.6.0 generate slightly better loop code.
14346 * callint.c (Fcall_interactively): <, not <=, for optimization.
14347 (Fcall_interactively): Count the number of arguments produced,
14348 not the number of arguments given. This is simpler and lets GCC
14349 4.6.0 generate slightly better code.
14351 * ftfont.c: Distingish more carefully between FcChar8 and char.
14352 The previous code passed unsigned char * to a functions like
14353 strlen and xstrcasecmp that expect char *, which does not
14354 conform to the C standard.
14355 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
14356 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
14357 char * when the C standard requires it.
14359 * keyboard.c (read_char): Remove unused var.
14361 * eval.c: Port to Windows vsnprintf (Bug#8435).
14362 Include <limits.h>.
14363 (SIZE_MAX): Define if the headers do not.
14364 (verror): Do not give up if vsnprintf returns a negative count.
14365 Instead, grow the buffer. This ports to Windows vsnprintf, which
14366 does not conform to C99. Problem reported by Eli Zaretskii.
14367 Also, simplify the allocation scheme, by avoiding the need for
14368 calling realloc, and removing the ALLOCATED variable.
14370 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
14372 Remove invocations of doprnt, as Emacs now uses vsnprintf.
14373 But keep the doprint source code for now, as we might revamp it
14374 and use it again (Bug#8435).
14375 * lisp.h (doprnt): Remove.
14376 * Makefile.in (base_obj): Remove doprnt.o.
14377 * deps.mk (doprnt.o): Remove.
14379 error: Print 32- and 64-bit integers portably (Bug#8435).
14380 Without this change, on typical 64-bit hosts error ("...%d...", N)
14381 was used to print both 32- and 64-bit integers N, which relied on
14382 undefined behavior.
14383 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
14384 * lisp.h (error, verror): Mark as printf-like functions.
14385 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
14386 Report overflow in size calculations when allocating printf buffer.
14387 Do not truncate output string at its first null byte.
14388 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
14389 Truncate the output at a character boundary, since vsnprintf does not
14391 * charset.c (check_iso_charset_parameter): Convert internal
14392 character to string before calling 'error', since %c now has the
14394 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
14395 overflow when computing char to be passed to 'error'. Do not
14396 pass Lisp_Object to 'error'; pass the integer instead.
14397 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
14398 formatted with plain %d.
14400 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
14402 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
14404 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
14406 * xterm.c (x_catch_errors): Remove duplicate declaration.
14408 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
14410 * xdisp.c, lisp.h (message_nolog): Remove; unused.
14412 2011-04-10 Jim Meyering <meyering@redhat.com>
14414 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
14415 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
14416 return ssize_t not "int", and use size_t as the buffer length.
14417 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
14418 * gnutls.h: Update declarations.
14419 * process.c (read_process_output): Use ssize_t, to match.
14420 (send_process): Likewise.
14422 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
14424 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
14426 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
14428 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
14429 Use unsigned char, to match FcChar8 type definition.
14431 * xterm.c (handle_one_xevent):
14432 * xmenu.c (create_and_show_popup_menu):
14433 * xselect.c (x_decline_selection_request)
14434 (x_reply_selection_request): Avoid type-punned deref of X events.
14436 2011-04-09 Eli Zaretskii <eliz@gnu.org>
14438 Fix some uses of `int' instead of EMACS_INT.
14439 * search.c (string_match_1, fast_string_match)
14440 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
14441 (scan_buffer, find_next_newline_no_quit)
14442 (find_before_next_newline, search_command, Freplace_match)
14443 (Fmatch_data): Make some `int' variables be EMACS_INT.
14445 * xdisp.c (display_count_lines): 3rd argument and return value now
14446 EMACS_INT. All callers changed.
14447 (pint2hrstr): Last argument is now EMACS_INT.
14449 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
14450 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
14451 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
14452 (decode_coding_utf_16, decode_coding_emacs_mule)
14453 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
14454 (decode_coding_ccl, decode_coding_charset)
14455 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
14456 (decode_coding_iso_2022, decode_coding_emacs_mule)
14457 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
14458 <char_offset, last_offset>: Declare EMACS_INT.
14459 (encode_coding_utf_8, encode_coding_utf_16)
14460 (encode_coding_emacs_mule, encode_invocation_designation)
14461 (encode_designation_at_bol, encode_coding_iso_2022)
14462 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
14463 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
14465 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
14466 (encode_invocation_designation): Last argument P_NCHARS is now
14468 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
14469 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
14471 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
14474 * ccl.c (Fccl_execute_on_string): Declare some variables
14477 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
14479 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
14481 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
14483 * process.c (Fformat_network_address): Doc fix.
14485 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
14487 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
14489 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
14491 * keyboard.c (read_char): Call Lisp function help-form-show,
14492 instead of using internal_with_output_to_temp_buffer.
14493 (Qhelp_form_show): New var.
14494 (syms_of_keyboard): Use DEFSYM macro.
14496 * print.c (internal_with_output_to_temp_buffer): Function deleted.
14498 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
14500 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
14502 * process.c (Flist_processes): Remove to Lisp.
14503 (list_processes_1): Delete.
14505 2011-04-06 Eli Zaretskii <eliz@gnu.org>
14507 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
14509 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
14511 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
14513 Fix more problems found by GCC 4.6.0's static checks.
14515 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
14517 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
14519 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
14521 * xdisp.c (vmessage): Mark as a printf-like function.
14523 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
14525 * sound.c (sound_warning): Don't crash if arg contains a printf format.
14527 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
14528 printf-like functions.
14529 (tiff_load): Add casts to remove these marks before passing them
14530 to system-supplied API.
14532 * eval.c (Fsignal): Remove excess argument to 'fatal'.
14534 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
14535 This avoids several warnings with gcc -Wstrict-overflow.
14536 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
14537 directly, rather than having caller test rule sign. This avoids
14538 some unnecessary tests.
14539 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
14540 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
14541 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
14543 * xfont.c (xfont_text_extents): Remove var that was set but not used.
14544 (xfont_open): Avoid unnecessary tests.
14546 * composite.c (composition_gstring_put_cache): Use unsigned integer.
14548 * composite.h, composite.c (composition_gstring_put_cache):
14549 Use EMACS_INT, not int, for length.
14551 * composite.h (COMPOSITION_DECODE_REFS): New macro,
14552 breaking out part of COMPOSITION_DECODE_RULE.
14553 (COMPOSITION_DECODE_RULE): Use it.
14554 * composite.c (get_composition_id): Remove unused local vars,
14555 by using the new macro.
14557 * textprop.c (set_text_properties_1): Change while to do-while,
14558 since the condition is always true at first.
14560 * intervals.c (graft_intervals_into_buffer): Mark var as used.
14561 (interval_deletion_adjustment): Return unsigned value.
14564 * process.c (list_processes_1, create_pty, read_process_output):
14565 (exec_sentinel): Remove vars that were set but not used.
14566 (create_pty): Remove unnecessary "volatile"s.
14567 (Fnetwork_interface_info): Avoid possibility of int overflow.
14568 (read_process_output): Do adaptive read buffering even if carryover.
14569 (read_process_output): Simplify nbytes computation if buffered.
14571 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
14573 * syntax.c (scan_words): Remove var that was set but not used.
14574 (update_syntax_table): Use unsigned instead of int.
14576 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
14577 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
14578 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
14580 * print.c (print_error_message): Avoid int overflow.
14582 * font.c (font_list_entities): Redo for clarity,
14583 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
14585 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
14586 (font_score): Avoid potential overflow in diff calculation.
14588 * fns.c (substring_both): Remove var that is set but not used.
14589 (sxhash): Redo loop for clarity and to avoid wraparound warning.
14591 * eval.c (funcall_lambda): Rename local to avoid shadowing.
14593 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
14594 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
14595 can always succeed if overflow has undefined behavior.
14597 * search.c (boyer_moore, wordify): Remove vars set but not used.
14598 (wordify): Omit three unnecessary tests.
14600 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
14601 All callers changed. This avoids the need for an unused var.
14603 * casefiddle.c (casify_region): Remove var that is set but not used.
14605 * dired.c (file_name_completion): Remove var that is set but not used.
14607 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
14609 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
14610 (Finsert_file_contents): Remove unnecessary code checking fd.
14612 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
14613 Check for integer overflow on size calculations.
14615 * buffer.c (Fprevious_overlay_change): Remove var that is set
14618 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
14619 Remove vars that are set but not used.
14620 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
14621 (timer_check_2): Mark vars as initialized.
14623 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
14625 * image.c (lookup_image): Remove var that is set but not used.
14626 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
14628 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
14629 that are set but not used.
14631 * xfns.c (make_invisible_cursor): Don't return garbage
14632 if XCreateBitmapFromData fails (Bug#8410).
14634 * xselect.c (x_get_local_selection, x_handle_property_notify):
14635 Remove vars that are set but not used.
14637 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
14638 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
14640 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
14641 Remove var that is set but not used.
14642 (scroll_bar_windows_size): Now size_t, not int.
14643 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
14644 Check for overflow.
14646 * xfaces.c (realize_named_face): Remove vars that are set but not used.
14647 (map_tty_color) [!defined MSDOS]: Likewise.
14649 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
14651 * coding.c: Remove vars that are set but not used.
14652 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
14653 All callers changed.
14654 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
14655 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
14656 (decode_coding_charset): Remove vars that are set but not used.
14658 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
14659 that is set but not used.
14661 * print.c (print_object): Remove var that is set but not used.
14663 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
14664 The gnulib version avoids calling malloc in the usual case,
14665 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
14666 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
14667 * filelock.c (current_lock_owner): Likewise.
14668 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
14669 * sysdep.c: Include allocator.h, careadlinkat.h.
14670 (emacs_no_realloc_allocator): New static constant.
14671 (emacs_readlink): New function.
14672 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
14673 ../lib/careadlinkat.h.
14675 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
14677 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
14678 first non-nil return value).
14680 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
14682 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
14683 if not defined (Bug#8403).
14685 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
14687 * xdisp.c (display_count_lines): Remove parameter `start',
14688 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
14689 (get_char_face_and_encoding): Remove parameter `multibyte_p',
14690 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
14691 (fill_stretch_glyph_string): Remove parameters `row' and `area',
14692 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
14693 and thereabouts. All callers changed.
14694 (get_per_char_metric): Remove parameter `f', unused since
14695 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
14697 2011-04-02 Jim Meyering <meyering@redhat.com>
14699 do not dereference NULL upon failed strdup
14700 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
14701 (ns_get_family): Likewise.
14703 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
14705 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
14707 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
14709 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
14712 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
14714 Add lexical binding.
14716 * window.c (Ftemp_output_buffer_show): New fun.
14717 (Fsave_window_excursion):
14718 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
14720 * lread.c (lisp_file_lexically_bound_p): New function.
14721 (Fload): Bind Qlexical_binding.
14722 (readevalloop): Remove `evalfun' arg.
14723 Bind Qinternal_interpreter_environment.
14724 (Feval_buffer): Bind Qlexical_binding.
14725 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
14727 (syms_of_lread): Declare `lexical-binding'.
14729 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
14731 * keyboard.c (eval_dyn): New fun.
14732 (menu_item_eval_property): Use it.
14734 * image.c (parse_image_spec): Use Ffunctionp.
14736 * fns.c (concat, mapcar1): Accept byte-code-functions.
14738 * eval.c (Fsetq): Handle lexical vars.
14739 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
14740 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
14741 (FletX, Flet): Obey lexical binding.
14742 (Fcommandp): Handle closures.
14743 (Feval): New `lexical' arg.
14744 (eval_sub): New function extracted from Feval. Use it almost
14745 everywhere where Feval was used. Look up vars in lexical env.
14747 (Ffunctionp): Move from subr.el.
14748 (Ffuncall): Handle closures.
14749 (apply_lambda): Remove `eval_flags'.
14750 (funcall_lambda): Handle closures and new byte-code-functions.
14751 (Fspecial_variable_p): New function.
14752 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
14753 but without exporting it to Lisp.
14755 * doc.c (Fdocumentation, store_function_docstring):
14756 * data.c (Finteractive_form): Handle closures.
14758 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
14761 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
14763 (exec_byte_code): New function extracted from Fbyte_code to handle new
14764 calling convention for byte-code-functions. Add new byte-codes.
14766 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
14768 * alloc.c (Fmake_symbol): Init new `declared_special' field.
14770 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
14772 * xdisp.c (redisplay_internal): Fix prototype.
14774 2011-03-31 Eli Zaretskii <eliz@gnu.org>
14776 * xdisp.c (SCROLL_LIMIT): New macro.
14777 (try_scrolling): Use it when setting scroll_limit.
14778 Limit scrolling to 100 screen lines.
14779 (redisplay_window): Even when falling back on "recentering",
14780 position point in the window according to scroll-conservatively,
14781 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
14783 (try_scrolling): When point is above the window, allow searching
14784 as far as scroll_max, or one screenful, to compute vertical
14785 distance from PT to the scroll margin position. This prevents
14786 try_scrolling from unnecessarily failing when
14787 scroll-conservatively is set to a value slightly larger than the
14788 window height. Clean up the case of PT below the margin at bottom
14789 of window: scroll_max can no longer be INT_MAX. When aggressive
14790 scrolling is in use, don't let point enter the opposite scroll
14791 margin as result of the scroll.
14792 (syms_of_xdisp) <scroll-conservatively>: Document the
14793 threshold of 100 lines for never-recentering scrolling.
14795 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
14797 * dispextern.h (move_it_by_lines):
14798 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
14799 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
14800 (message_log_check_duplicate): Remove parameters `prev_bol' and
14801 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
14802 (redisplay_internal): Remove parameter `preserve_echo_area',
14803 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
14805 * indent.c (Fvertical_motion):
14806 * window.c (window_scroll_pixel_based, Frecenter):
14807 Don't pass `need_y_p' to `move_it_by_lines'.
14809 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
14811 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
14812 steal a few bits to be more compact.
14813 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
14814 Remove unneeded casts.
14816 * bytecode.c (Fbyte_code): CAR and CDR can GC.
14818 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
14820 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
14821 binding" message (bug#7967).
14823 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
14825 Fix more problems found by GCC 4.6.0's static checks.
14827 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
14828 Remove unused local var.
14830 * editfns.c (Fmessage_box): Remove unused local var.
14832 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
14833 (note_mode_line_or_margin_highlight, note_mouse_highlight):
14834 Omit unused local vars.
14835 * window.c (shrink_windows): Omit unused local var.
14836 * menu.c (digest_single_submenu): Omit unused local var.
14837 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
14838 Omit unused local var.
14840 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
14841 Don't assume string length fits in int.
14842 (keyremap_step, read_key_sequence): Use size_t for sizes.
14843 (read_key_sequence): Don't check last_real_key_start redundantly.
14845 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
14846 instead of alloca (Bug#8344).
14848 * eval.c (Fbacktrace): Don't assume nargs fits in int.
14849 (Fbacktrace_frame): Don't assume nframes fits in int.
14851 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
14853 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
14856 * term.c (produce_glyphless_glyph): Remove unnecessary test.
14858 * cm.c (calccost): Turn while-do into do-while, for clarity.
14860 * keyboard.c (syms_of_keyboard): Use the same style as later
14861 in this function when indexing through an array. This also
14862 works around GCC bug 48267.
14864 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
14866 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
14868 * chartab.c (sub_char_table_ref_and_range): Redo for slight
14869 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
14871 * keyboard.c, keyboard.h (num_input_events): Now size_t.
14872 This avoids undefined behavior on integer overflow, and is a bit
14873 more convenient anyway since it is compared to a size_t variable.
14875 Variadic C functions now count arguments with size_t, not int.
14876 This avoids an unnecessary limitation on 64-bit machines, which
14877 caused (substring ...) to crash on large vectors (Bug#8344).
14878 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
14879 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
14880 All variadic functions and their callers changed accordingly.
14881 (struct gcpro.nvars): Now size_t, not int. All uses changed.
14882 * data.c (arith_driver, float_arith_driver): Likewise.
14883 * editfns.c (general_insert_function): Likewise.
14884 * eval.c (struct backtrace.nargs, interactive_p)
14885 (internal_condition_case_n, run_hook_with_args, apply_lambda)
14886 (funcall_lambda, mark_backtrace): Likewise.
14887 * fns.c (concat): Likewise.
14888 * frame.c (x_set_frame_parameters): Likewise.
14889 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
14890 0 if not found, not -1. All callers changed.
14892 * alloc.c (garbage_collect): Don't assume stack size fits in int.
14893 (stack_copy_size): Now size_t, not int.
14894 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
14896 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
14898 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
14899 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
14900 All callers changed.
14902 * lisp.h (multibyte_char_to_unibyte):
14903 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
14904 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
14905 * character.h (CHAR_TO_BYTE8):
14906 * cmds.c (internal_self_insert):
14907 * editfns.c (general_insert_function):
14908 * keymap.c (push_key_description):
14909 * search.c (Freplace_match):
14910 * xdisp.c (message_dolog, set_message_1): All callers changed.
14912 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
14914 * keyboard.c (safe_run_hook_funcall): New function.
14915 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
14916 don't set the hook to nil, but remove the offending function instead.
14917 (Qcommand_hook_internal): Remove, unused.
14918 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
14919 Vcommand_hook_internal.
14921 * eval.c (enum run_hooks_condition): Remove.
14922 (funcall_nil, funcall_not): New functions.
14923 (run_hook_with_args): Call each function through a `funcall' argument.
14924 Remove `cond' argument, now redundant.
14925 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
14926 (Frun_hook_with_args_until_failure): Adjust accordingly.
14927 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
14929 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
14931 * dispextern.h (string_buffer_position): Remove declaration.
14933 * print.c (strout): Remove parameter `multibyte', unused since
14934 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
14936 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
14937 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
14938 All callers changed.
14940 * w32.c (_wsa_errlist): Use braces for struct initializers.
14942 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
14943 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
14944 All callers changed.
14945 (string_buffer_position): Likewise. Also, make static (it's never
14946 used outside xdisp.c).
14947 (cursor_row_p): Remove parameter `w', unused since
14948 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
14949 (decode_mode_spec): Remove parameter `precision', introduced during
14950 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
14951 All callers changed.
14953 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
14955 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
14957 2011-03-27 Anders Lindgren <andlind@gmail.com>
14959 * nsterm.m (ns_menu_bar_is_hidden): New variable.
14960 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
14961 (ns_update_auto_hide_menu_bar): New functions.
14962 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
14963 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
14964 ns_constrain_all_frames.
14965 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
14966 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
14968 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
14970 * nsmenu.m (runDialogAt): Remove argument to timer_check.
14972 2011-03-27 Glenn Morris <rgm@gnu.org>
14974 * syssignal.h: Replace RETSIGTYPE with void.
14975 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
14976 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
14977 Replace SIGTYPE with void everywhere.
14978 * s/usg5-4-common.h (SIGTYPE): Remove definition.
14979 * s/template.h (SIGTYPE): Remove commented out definition.
14981 2011-03-26 Eli Zaretskii <eliz@gnu.org>
14983 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
14984 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
14986 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
14988 * w32.c (read_unc_volume): Use parameter `henum', instead of
14989 global variable `wget_enum_handle'.
14991 * keymap.c (describe_vector): Remove parameters `indices' and
14992 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
14993 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
14995 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
14997 * keyboard.c (timer_check): Remove parameter `do_it_now',
14998 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
14999 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
15000 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
15002 * keyboard.c (read_char):
15003 * w32menu.c (w32_menu_display_help):
15004 * xmenu.c (show_help_event, menu_help_callback):
15005 Adjust calls to `show_help_echo'.
15007 * gtkutil.c (xg_maybe_add_timer):
15008 * keyboard.c (readable_events):
15009 * process.c (wait_reading_process_output):
15010 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
15012 * insdel.c (adjust_markers_gap_motion):
15013 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
15014 (gap_left, gap_right): Don't call it.
15016 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
15018 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
15019 incurred during fontification.
15021 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
15023 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
15024 (DEFVAR_PER_BUFFER): Don't pass it.
15026 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
15027 (scrolling_window): Don't pass it.
15029 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
15031 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
15033 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
15035 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
15036 of variables specific to SELinux and computation of `encoded_absname'.
15038 * image.c (XPutPixel): Remove unused variable `height'.
15040 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
15042 * unexw32.c (get_section_info): Remove unused variable `section'.
15044 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
15045 (system_process_attributes): Remove unused variable `sess'.
15046 (sys_read): Remove unused variable `err'.
15048 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
15049 (w32_wnd_proc): Remove unused variable `isdead'.
15050 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
15051 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
15052 (x_create_tip_frame): Remove unused variable `tem'.
15054 * w32inevt.c (w32_console_read_socket):
15055 Remove unused variable `no_events'.
15057 * w32term.c (x_draw_composite_glyph_string_foreground):
15058 Remove unused variable `width'.
15060 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
15062 * w32term.c (x_set_glyph_string_clipping):
15063 Don't pass uninitialized region to CombineRgn.
15065 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
15067 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
15068 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
15069 (Fx_close_connection): Remove unused variable `i'.
15071 * w32font.c (w32font_draw): Return number of glyphs.
15072 (w32font_open_internal): Remove unused variable `i'.
15073 (w32font_driver): Add missing initializer.
15075 * w32menu.c (utf8to16): Remove unused variable `utf16'.
15076 (fill_in_menu): Remove unused variable `items_added'.
15078 * w32term.c (last_mouse_press_frame): Remove static global variable.
15079 (w32_clip_to_row): Remove unused variable `f'.
15080 (x_delete_terminal): Remove unused variable `i'.
15082 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
15083 (NOTHING): Remove unused static global variable.
15084 (uniscribe_check_otf): Remove unused variable `table'.
15085 (uniscribe_font_driver): Add missing initializers.
15087 2011-03-23 Julien Danjou <julien@danjou.info>
15089 * term.c (Fsuspend_tty, Fresume_tty):
15090 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
15091 * window.c (temp_output_buffer_show):
15092 * insdel.c (signal_before_change):
15093 * frame.c (Fhandle_switch_frame):
15094 * fileio.c (Fdo_auto_save):
15095 * emacs.c (Fkill_emacs):
15096 * editfns.c (save_excursion_restore):
15097 * cmds.c (internal_self_insert):
15098 * callint.c (Fcall_interactively):
15099 * buffer.c (Fkill_all_local_variables):
15100 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
15102 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
15103 unconditionally since it does the check itself.
15105 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
15107 Fix more problems found by GCC 4.5.2's static checks.
15109 * coding.c (encode_coding_raw_text): Avoid unnecessary test
15110 the first time through the loop, since we know p0 < p1 then.
15111 This also avoids a gcc -Wstrict-overflow warning.
15113 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
15114 leading to a memory leak, possible in functions like
15115 load_charset_map_from_file that can allocate an unbounded number
15116 of objects (Bug#8318).
15118 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
15119 that could (at least in theory) be that large.
15121 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
15122 This is less likely to overflow, and avoids undefined behavior if
15123 overflow does occur. All callers changed. Use strtoul to scan
15124 for the unsigned long integer.
15125 (pint2hrstr): Simplify and tune code slightly.
15126 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
15128 * scroll.c (do_scrolling): Work around GCC bug 48228.
15129 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
15131 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
15132 This also avoids a warning with gcc -Wstrict-overflow.
15133 (validate_x_resource_name): Simplify count usage.
15134 This also avoids a warning with gcc -Wstrict-overflow.
15136 * fileio.c (Fcopy_file): Report error if fchown or fchmod
15139 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
15141 * process.c (Fmake_network_process): Use socklen_t, not int,
15142 where POSIX says socklen_t is required in portable programs.
15143 This fixes a porting bug on hosts like 64-bit HP-UX, where
15144 socklen_t is wider than int (Bug#8277).
15145 (Fmake_network_process, server_accept_connection):
15146 (wait_reading_process_output, read_process_output):
15149 * process.c: Rename or move locals to avoid shadowing.
15150 (list_processes_1, Fmake_network_process):
15151 (read_process_output_error_handler, exec_sentinel_error_handler):
15152 Rename or move locals.
15153 (Fmake_network_process): Define label "retry_connect" only if needed.
15154 (Fnetwork_interface_info): Fix pointer signedness.
15155 (process_send_signal): Add cast to avoid pointer signedness problem.
15156 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
15157 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
15159 Make tparam.h and terminfo.c consistent.
15160 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
15161 Include tparam.h instead, since it declares them.
15162 * cm.h (PC): Remove extern decl; tparam.h now does this.
15163 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
15164 * terminfo.c: Include tparam.h, to check interfaces.
15165 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
15166 (tparam): Adjust signature to match interface in tparam.h;
15167 this removes some undefined behavior. Check that outstring and len
15168 are zero, which they always are with Emacs.
15169 * tparam.h (PC, BC, UP): New extern decls.
15171 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
15172 (xftfont_open): Rename locals to avoid shadowing.
15174 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
15175 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
15176 (OTF_TAG_SYM): Omit macro if not needed.
15177 (ftfont_list): Remove unused local.
15178 (get_adstyle_property, ftfont_pattern_entity):
15179 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
15180 Rename locals to avoid shadowing.
15182 * xfont.c (xfont_list_family): Mark var as initialized.
15184 * xml.c (make_dom): Now static.
15186 * composite.c (composition_compute_stop_pos): Rename local to
15188 (composition_reseat_it): Remove unused locals.
15189 (find_automatic_composition, composition_adjust_point): Likewise.
15190 (composition_update_it): Mark var as initialized.
15191 (find_automatic_composition): Mark vars as initialized,
15192 with a FIXME (Bug#8290).
15194 character.h: Rename locals to avoid shadowing.
15195 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
15196 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
15197 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
15198 (BUF_DEC_POS): Be more systematic about renaming local temporaries
15199 to avoid shadowing.
15201 * textprop.c (property_change_between_p): Remove; unused.
15203 * intervals.c (interval_start_pos): Now static.
15205 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
15207 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
15208 Rename locals to avoid shadowing.
15210 * sound.c (wav_play, au_play, Fplay_sound_internal):
15211 Fix pointer signedness.
15212 (alsa_choose_format): Remove unused local var.
15213 (wav_play): Initialize a variable to 0, to prevent undefined
15214 behavior (Bug#8278).
15216 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
15218 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
15220 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
15221 clobbering (Bug#8298).
15222 * sysdep.c (sys_subshell): Likewise.
15223 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
15225 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
15226 This should get cleaned up, so that child_setup has the
15227 same signature on all platforms.
15229 * callproc.c (call_process_cleanup): Now static.
15230 (relocate_fd): Rename locals to avoid shadowing.
15232 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
15234 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
15235 not to be necessary, and produces flickering.
15237 2011-03-20 Glenn Morris <rgm@gnu.org>
15239 * config.in: Remove file.
15241 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
15243 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
15244 are now in src/globals.h.
15245 (syms_of_minibuf): Remove spurious & from previous change.
15247 2011-03-20 Leo Liu <sdl.web@gmail.com>
15249 * minibuf.c (completing-read-function): New variable.
15250 (completing-read-default): Rename from completing-read.
15251 (completing-read): Call completing-read-function.
15253 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
15255 * xfaces.c (Fx_load_color_file):
15256 Read color file from absolute filename (bug#8250).
15258 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
15260 * makefile.w32-in: Update dependencies.
15262 2011-03-17 Eli Zaretskii <eliz@gnu.org>
15264 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
15266 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
15268 Fix more problems found by GCC 4.5.2's static checks.
15270 * process.c (make_serial_process_unwind, send_process_trap):
15271 (sigchld_handler): Now static.
15273 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
15274 That way, the code declares only the vars that it needs.
15275 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
15276 * s/cygwin.h (PTY_ITERATION): Likewise.
15277 * s/darwin.h (PTY_ITERATION): Likewise.
15278 * s/gnu-linux.h (PTY_ITERATION): Likewise.
15280 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
15281 * process.c (allocate_pty): Don't declare stb unless it's needed.
15283 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
15284 (CONSTANTLIM): Remove; unused.
15285 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
15286 Define only if needed.
15288 * unexelf.c (unexec): Name an expression,
15289 to avoid gcc -Wbad-function-cast warning.
15290 Use a different way to cause a compilation error if anyone uses
15291 n rather than nn, a way that does not involve shadowing.
15292 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
15294 * deps.mk (unexalpha.o): Remove; unused.
15296 New file unexec.h, the (simple) interface for unexec (Bug#8267).
15297 * unexec.h: New file.
15298 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
15299 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
15300 Depend on unexec.h.
15301 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
15302 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
15303 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
15304 Change as necessary to match prototype in unexec.h.
15306 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
15308 (back_comment, skip_chars): Mark vars as initialized.
15310 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
15311 Rename locals to avoid shadowing.
15313 * lread.c (read1): Rewrite so as not to use empty "else".
15314 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
15316 * print.c (Fredirect_debugging_output): Fix pointer signedess.
15318 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
15319 warning when compiling print.c.
15321 * font.c (font_unparse_fcname): Abort in an "impossible" situation
15322 instead of using an uninitialized var.
15323 (font_sort_entities): Mark var as initialized.
15325 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
15327 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
15328 pointers to constants.
15329 (font_parse_fcname): Remove unused vars.
15330 (font_delete_unmatched): Now static.
15331 (font_get_spec): Remove; unused.
15332 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
15333 (font_update_drivers, Ffont_get_glyphs, font_add_log):
15334 Rename or move locals to avoid shadowing.
15336 * fns.c (require_nesting_list, require_unwind): Now static.
15337 (Ffillarray): Rename locals to avoid shadowing.
15339 * floatfns.c (domain_error2): Define only if needed.
15340 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
15342 * alloc.c (mark_backtrace): Move decl from here ...
15343 * lisp.h: ... to here, so that it can be checked.
15345 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
15346 (Fdefvar): Rewrite so as not to use empty "else".
15347 (lisp_indirect_variable): Name an expression,
15348 to avoid gcc -Wbad-function-cast warning.
15349 (Fdefvar): Rename locals to avoid shadowing.
15351 * callint.c (quotify_arg, quotify_args): Now static.
15352 (Fcall_interactively): Rename locals to avoid shadowing.
15353 Use const pointer when appropriate.
15355 * lisp.h (get_system_name, get_operating_system_release):
15356 Move decls here, to check interfaces.
15357 * process.c (get_operating_system_release): Move decl to lisp.h.
15358 * xrdb.c (get_system_name): Likewise.
15359 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
15360 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
15361 some of which prompt warnings from gcc -Wbad-function-cast.
15362 (Fformat_time_string, Fencode_time, Finsert_char):
15363 (Ftranslate_region_internal, Fformat):
15364 Rename or remove local vars to avoid shadowing.
15365 (Ftranslate_region_internal): Mark var as initialized.
15367 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
15370 * lisp.h (eassert): Check that the argument compiles, even if
15371 ENABLE_CHECKING is not defined.
15373 * data.c (Findirect_variable): Name an expression, to avoid
15374 gcc -Wbad-function-cast warning.
15375 (default_value, arithcompare, arith_driver, arith_error): Now static.
15376 (store_symval_forwarding): Rename local to avoid shadowing.
15377 (Fmake_variable_buffer_local, Fmake_local_variable):
15378 Mark variables as initialized.
15379 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
15381 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
15382 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
15383 Rename locals to avoid shadowing.
15384 (mark_stack): Move local variables into the #ifdef region where
15386 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
15387 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
15389 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
15390 (GC_STRING_CHARS): Remove; not used.
15391 (Fmemory_limit): Cast sbrk's returned value to char *.
15393 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
15394 avoids undefined behavior in theory.
15396 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
15398 Use functions, not macros, for up- and down-casing (Bug#8254).
15399 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
15400 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
15401 to use the following functions instead of these macros.
15402 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
15403 EMACS_INT, since callers assume the returned value fits in int.
15404 (upcase1): Likewise, for UPCASE_TABLE.
15405 (uppercasep, lowercasep, upcase): New static inline functions.
15406 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
15407 the race-condition problem in the old DOWNCASE.
15409 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
15410 Rename locals to avoid shadowing.
15411 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
15412 (regex_compile, re_search_2, re_match_2_internal):
15413 Remove unused local vars.
15414 (FREE_VAR): Rewrite so as not to use empty "else",
15415 which gcc can warn about.
15416 (regex_compile, re_match_2_internal): Mark locals as initialized.
15417 (RETALLOC_IF): Define only if needed.
15418 (WORDCHAR_P): Likewise. This one is never needed, but is used
15419 only in a comment talking about a compiler bug, so put inside
15420 the #if 0 of that comment.
15421 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
15422 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
15425 * search.c (boyer_moore): Rename locals to avoid shadowing.
15426 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
15427 (PREV_CHAR_BOUNDARY): Likewise.
15429 * search.c (simple_search): Remove unused var.
15431 * dired.c (compile_pattern): Move decl from here ...
15432 * lisp.h: ... to here, so that it can be checked.
15433 (struct re_registers): New forward decl.
15435 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
15437 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
15439 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
15440 Rename locals to avoid shadowing.
15441 (Fvertical_motion): Mark locals as initialized.
15443 * casefiddle.c (casify_object, casify_region): Now static.
15444 (casify_region): Mark local as initialized.
15446 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
15448 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
15449 New macros, so that the caller can use some names other than
15450 gcpro1, gcpro2, etc.
15451 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
15453 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
15454 argument, for consistency with GCPRO2_VAR, etc: it is now the
15455 prefix of the variable, not the variable itself. All uses
15457 * dired.c (directory_files_internal, file_name_completion):
15458 Rename locals to avoid shadowing.
15460 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
15461 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
15462 dired.c's scmp function, had undefined behavior.
15463 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
15464 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
15465 * buffer.h: ... to here, because these macros use current_buffer,
15466 and the new implementation with inline functions needs to have
15467 current_buffer in scope now, rather than later when the macros
15469 (downcase, upcase1): New static inline functions.
15470 (DOWNCASE, UPCASE1): Reimplement using these functions.
15471 This avoids undefined behavior in expressions like
15472 DOWNCASE (x) == DOWNCASE (y), which previously suffered
15473 from race conditions in accessing the global variables
15474 case_temp1 and case_temp2.
15475 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
15476 * lisp.h (case_temp1, case_temp2): Remove their decls.
15477 * character.h (ASCII_CHAR_P): Move from here ...
15478 * lisp.h: ... to here, so that the inline functions mentioned
15479 above can use them.
15481 * dired.c (directory_files_internal_unwind): Now static.
15483 * fileio.c (file_name_as_directory, directory_file_name):
15484 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
15486 (file_name_as_directory): Use const pointers when appropriate.
15487 (Fexpand_file_name): Likewise. In particular, newdir might
15488 point at constant storage, so make it a const pointer.
15489 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
15490 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
15492 (Fset_file_times, Finsert_file_contents, auto_save_error):
15493 Rename locals to avoid shadowing.
15495 * minibuf.c (choose_minibuf_frame_1): Now static.
15496 (Ftry_completion, Fall_completions): Rename or remove locals
15497 to avoid shadowing.
15499 * marker.c (bytepos_to_charpos): Remove; unused.
15501 * lisp.h (verify_bytepos, count_markers): New decls,
15502 so that gcc does not warn that these functions aren't declared.
15504 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
15505 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
15506 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
15507 (copy_text): Remove unused local var.
15509 * filelock.c (within_one_second): Now static.
15510 (lock_file_1): Rename local to avoid shadowing.
15512 * buffer.c (fix_overlays_before): Mark locals as initialized.
15513 (fix_start_end_in_overlays): Likewise. This function should be
15514 simplified by using pointers-to-pointers, but that's a different
15516 (switch_to_buffer_1): Now static.
15517 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
15518 (report_overlay_modification): Rename locals to avoid shadowing.
15520 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
15521 Fix pointer signedness issue.
15522 (sys_subshell): Mark local as volatile if checking for lint,
15523 to suppress a gcc -Wclobbered warning that does not seem to be right.
15524 (MAXPATHLEN): Define only if needed.
15526 * process.c (serial_open, serial_configure): Move decls from here ...
15527 * systty.h: ... to here, so that they can be checked.
15529 * fns.c (get_random, seed_random): Move extern decls from here ...
15530 * lisp.h: ... to here, so that they can be checked.
15532 * sysdep.c (reset_io): Now static.
15533 (wait_for_termination_signal): Remove; unused.
15535 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
15536 (copy_keymap_item, append_key, push_text_char_description):
15538 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
15539 (DENSE_TABLE_SIZE): Remove; unused.
15540 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
15541 (describe_map_tree):
15542 Rename locals to avoid shadowing.
15544 * keyboard.c: Declare functions static if they are not used elsewhere.
15545 (echo_char, echo_dash, cmd_error, top_level_2):
15546 (poll_for_input, handle_async_input): Now static.
15547 (read_char, kbd_buffer_get_event, make_lispy_position):
15548 (make_lispy_event, make_lispy_movement, apply_modifiers):
15549 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
15550 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
15551 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
15552 (read_key_sequence, read_char): Mark locals as initialized.
15553 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
15555 * keyboard.h (make_ctrl_char): New decl.
15556 (mark_kboards): Move decl here ...
15557 * alloc.c (mark_kboards): ... from here.
15559 * lisp.h (force_auto_save_soon): New decl.
15561 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
15562 (DEFINE_DUMMY_FUNCTION): New macro.
15563 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
15565 (main): Add casts to avoid warnings
15566 if GCC considers string literals to be constants.
15568 * lisp.h (fatal_error_signal): Add decl, since it's exported.
15570 * dbusbind.c: Pointer signedness fixes.
15571 (xd_signature, xd_append_arg, xd_initialize):
15572 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15573 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15574 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
15575 (Fdbus_register_signal): Use SSDATA when the context wants char *.
15577 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
15578 if GCC considers string literals to be constants.
15579 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
15581 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
15583 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
15584 (print_preprocess, print_object): New macro to fix last change.
15586 * print.c (print_preprocess): Don't forget font objects.
15588 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
15590 * emacs.c (USAGE3): Doc fixes.
15592 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
15594 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
15597 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
15599 * lisp.h (VWindow_system, Qfile_name_history):
15600 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
15601 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
15602 (w32_system_caret_x, w32_system_caret_y): Declare extern.
15604 * w32select.c: Don't #include "keyboard.h".
15605 (run_protected): Add extern declaration for waiting_for_input.
15607 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
15608 * w32console.c (detect_input_pending, read_input_pending)
15609 (encode_terminal_code):
15610 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
15611 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
15612 (w32_system_caret_y, Qfile_name_history):
15613 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
15614 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
15615 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
15616 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
15617 * w32proc.c (Qlocal, report_file_error):
15618 * w32term.c (Vwindow_system, updating_frame):
15619 * w32uniscribe.c (initialized, uniscribe_font_driver):
15620 Remove unneeded extern declarations.
15622 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
15624 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
15626 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
15628 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
15629 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
15630 These macros can no longer be used for assignment.
15632 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
15633 Assign struct members directly, instead of using BUF_BEGV etc.
15634 (record_buffer_markers, fetch_buffer_markers): New functions for
15635 recording and fetching special buffer markers.
15636 (set_buffer_internal_1, set_buffer_temp): Use them.
15638 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
15640 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
15642 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
15643 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
15645 * xdisp.c (hscroll_window_tree):
15646 (reconsider_clip_changes): Use PT instead of BUF_PT.
15648 2011-03-13 Eli Zaretskii <eliz@gnu.org>
15650 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
15651 $(EMACS_ROOT)/lib/intprops.h.
15653 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
15655 Fix more problems found by GCC 4.5.2's static checks.
15657 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
15658 to unsigned char * to avoid compiler diagnostic.
15659 (xg_free_frame_widgets): Make it clear that a local variable is
15660 needed only if USE_GTK_TOOLTIP.
15661 (gdk_window_get_screen): Make it clear that this macro is needed
15662 only if USE_GTK_TOOLTIP.
15663 (int_gtk_range_get_value): New function, which avoids a diagnostic
15664 from gcc -Wbad-function-cast.
15665 (xg_set_toolkit_scroll_bar_thumb): Use it.
15666 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
15667 diagnostic from gcc -Wbad-function-cast.
15668 (get_utf8_string, xg_get_file_with_chooser):
15669 Rename locals to avoid shadowing.
15670 (create_dialog): Move locals to avoid shadowing.
15672 * xgselect.c (xg_select): Remove unused var.
15674 * image.c (four_corners_best): Mark locals as initialized.
15675 (gif_load): Initialize transparent_p to zero (Bug#8238).
15676 Mark another local as initialized.
15677 (my_png_error, my_error_exit): Mark with NO_RETURN.
15679 * image.c (clear_image_cache): Now static.
15680 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
15681 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
15682 (x_edge_detection): Remove unnecessary cast that
15683 gcc -Wbad-function-cast diagnoses.
15684 (gif_load): Fix pointer signedness.
15685 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
15686 (jpeg_load, gif_load): Rename locals to avoid shadowing.
15688 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
15690 Improve quality of tests for time stamp overflow.
15691 For example, without this patch (encode-time 0 0 0 1 1
15692 1152921504606846976) returns the obviously-bogus value (-948597
15693 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
15694 reports time overflow. See
15695 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
15696 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
15697 * editfns.c: Include limits.h and intprops.h.
15698 (TIME_T_MIN, TIME_T_MAX): New macros.
15699 (time_overflow): Move earlier, to before first use.
15700 (hi_time, lo_time): New functions, for an accurate test for
15701 out-of-range times.
15702 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
15703 (Fget_internal_run_time): Don't assume time_t fits in int.
15704 (make_time): Use list2 instead of Fcons twice.
15705 (Fdecode_time): More accurate test for out-of-range times.
15706 (check_tm_member): New function.
15707 (Fencode_time): Use it, to test for out-of-range times.
15708 (lisp_time_argument): Don't rely on undefined left-shift and
15709 right-shift behavior when checking for time stamp overflow.
15711 * editfns.c (time_overflow): New function, refactoring common code.
15712 (Fformat_time_string, Fdecode_time, Fencode_time):
15713 (Fcurrent_time_string): Use it.
15715 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
15716 * dired.c (make_time): Move to ...
15717 * editfns.c (make_time): ... here.
15718 * systime.h: Note the move.
15720 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15722 * fringe.c (update_window_fringes): Remove unused variables.
15724 * unexmacosx.c (copy_data_segment): Also copy __got section.
15727 2011-03-12 Eli Zaretskii <eliz@gnu.org>
15729 * termcap.c [MSDOS]: Include "msdos.h".
15730 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
15731 Constify `char *' arguments and their references according to
15732 prototypes in tparam.h.
15734 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
15736 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
15737 Adapt all references accordingly.
15739 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
15741 2011-03-11 Tom Tromey <tromey@redhat.com>
15743 * buffer.c (syms_of_buffer): Remove obsolete comment.
15745 2011-03-11 Eli Zaretskii <eliz@gnu.org>
15747 * termhooks.h (encode_terminal_code): Declare prototype.
15749 * msdos.c (encode_terminal_code): Don't declare prototype.
15751 * term.c (encode_terminal_code): Now external again, used by
15752 w32console.c and msdos.c.
15754 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
15755 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
15757 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
15759 Fix some minor problems found by GCC 4.5.2's static checks.
15761 * fringe.c (update_window_fringes): Mark locals as initialized
15763 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
15765 * alloc.c (mark_fringe_data): Move decl from here ...
15766 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
15767 to check its interface.
15768 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
15770 * fontset.c (free_realized_fontset): Now static.
15771 (Fset_fontset_font): Rename local to avoid shadowing.
15772 (fontset_font): Mark local as initialized.
15773 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
15775 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
15777 * xselect.c (x_disown_buffer_selections): Remove; not used.
15778 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
15779 (x_own_selection, Fx_disown_selection_internal): Rename locals
15780 to avoid shadowing.
15781 (x_handle_dnd_message): Remove local to avoid shadowing.
15783 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
15784 so that the caller can use some name other than gcpro1.
15785 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
15786 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
15787 (Fx_backspace_delete_keys_p):
15788 Use them to avoid shadowing, and rename vars to avoid shadowing.
15789 (x_decode_color, x_set_name, x_window): Now static.
15790 (Fx_create_frame): Add braces to silence GCC warning.
15791 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
15792 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
15793 Remove unused locals.
15794 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
15795 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
15796 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
15799 * xterm.h (x_mouse_leave): New decl.
15801 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
15802 Remove unused functions.
15803 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
15804 (x_calc_absolute_position): Now static.
15805 (XTread_socket): Don't define label "out" unless it's used.
15806 Don't declare local "event" unless it's used.
15807 (x_iconify_frame, x_free_frame_resources): Don't declare locals
15808 unless they are used.
15809 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
15810 (x_fatal_error_signal): Remove; not used.
15811 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
15812 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
15813 (x_error_catcher, x_connection_closed, x_error_handler):
15814 (x_error_quitter, xembed_send_message, x_iconify_frame):
15815 (my_log_handler): Rename locals to avoid shadowing.
15816 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
15817 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
15819 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
15820 Rename or move locals to avoid shadowing.
15821 (tty_defined_color, merge_face_heights): Now static.
15822 (free_realized_faces_for_fontset): Remove; not used.
15823 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
15824 does not deduce is never used uninitialized.
15825 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
15826 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
15828 * terminal.c (store_terminal_param): Now static.
15830 * xmenu.c (menu_highlight_callback): Now static.
15831 (set_frame_menubar): Remove unused local.
15832 (xmenu_show): Rename parameter to avoid shadowing.
15833 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
15834 since they might point to immutable storage.
15835 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
15836 since it's unused otherwise.
15838 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
15839 Add a FIXME, since the code still doesn't look right. (Bug#8215)
15840 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
15841 avoids a gcc -Wuninitialized diagnostic.
15842 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
15843 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
15844 does not deduce are never used uninitialized.
15846 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
15848 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
15849 * window.c (window_loop, size_window):
15850 (run_window_configuration_change_hook, enlarge_window): Likewise.
15852 * window.c (display_buffer): Now static.
15853 (size_window): Mark variables that gcc -Wuninitialized
15854 does not deduce are never used uninitialized.
15855 * window.h (check_all_windows): New decl, to forestall
15856 gcc -Wmissing-prototypes diagnostic.
15857 * dispextern.h (bidi_dump_cached_states): Likewise.
15859 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
15861 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
15862 Include <limits.h>.
15863 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
15864 and to avoid gcc -Wuninitialized warning.
15865 (load_charset_map): Mark variables that gcc -Wuninitialized
15866 does not deduce are never used uninitialized.
15867 (load_charset): Abort instead of using uninitialized var (Bug#8229).
15869 * coding.c (coding_set_source, coding_set_destination):
15870 Use "else { /* comment */ }" rather than "else /* comment */;"
15871 for clarity, and to avoid gcc -Wempty-body warning.
15872 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
15873 a block, when the outer 'i' will do.
15874 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
15875 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
15876 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
15877 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
15878 (Fdecode_sjis_char, Fdefine_coding_system_internal):
15879 Rename locals to avoid shadowing.
15880 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
15881 * coding.c (emacs_mule_char, encode_invocation_designation):
15882 Now static, since they're not used elsewhere.
15883 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
15884 (decode_coding_object, encode_coding_object, detect_coding_system):
15885 (decode_coding_emacs_mule): Mark variables that gcc
15886 -Wuninitialized does not deduce are never used uninitialized.
15887 (detect_coding_iso_2022): Initialize a local variable that might
15888 be used uninitialized. Leave a FIXME because it's not clear that
15889 this initialization is needed. (Bug#8211)
15890 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
15891 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
15892 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
15893 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
15894 Remove unused macros.
15896 * category.c (hash_get_category_set): Remove unused local var.
15897 (copy_category_table): Now static, since it's not used elsewhere.
15898 * character.c (string_count_byte8): Likewise.
15900 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
15901 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
15903 * chartab.c (copy_sub_char_table): Now static, since it's not used
15905 (sub_char_table_ref_and_range, char_table_ref_and_range):
15906 Rename locals to avoid shadowing.
15907 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
15909 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
15910 (BIDI_BOB): Remove unused macro.
15912 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
15913 deduce are never used uninitialized.
15914 * term.c (encode_terminal_code): Likewise.
15916 * term.c (encode_terminal_code): Now static. Remove unused local.
15918 * tparam.h: New file.
15919 * term.c, tparam.h: Include it.
15920 * deps.mk (term.o, tparam.o): Depend on tparam.h.
15921 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
15922 Move these decls to tparam.h, and make them agree with what
15923 is actually in tparam.c. The previous trick of using incompatible
15924 decls in different modules does not conform to the C standard.
15925 All callers of tparam changed to use tparam's actual API.
15926 * tparam.c (tparam1, tparam, tgoto):
15927 Use const pointers where appropriate.
15929 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
15930 * cm.h (struct cm): Likewise.
15931 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
15932 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
15933 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
15934 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
15935 (turn_on_face, init_tty): Likewise.
15936 * termchar.h (struct tty_display_info): Likewise.
15938 * term.c (term_mouse_position): Rename local to avoid shadowing.
15940 * alloc.c (mark_ttys): Move decl from here ...
15941 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
15943 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
15945 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
15947 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
15949 * search.c (compile_pattern_1): Remove argument regp, unused since
15950 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
15951 (compile_pattern): Don't pass it.
15953 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
15955 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
15956 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
15958 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
15960 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
15962 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
15963 gdk_window_get_screen, gdk_window_get_geometry,
15964 gdk_x11_window_lookup_for_display and GDK_KEY_g.
15965 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
15966 (xg_get_pixbuf_from_pixmap): New function.
15967 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
15968 to Pixmap, take frame as parameter, remove GdkColormap parameter.
15969 Call xg_get_pixbuf_from_pixmap instead of
15970 gdk_pixbuf_get_from_drawable.
15971 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
15972 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
15973 (xg_check_special_colors): Use GtkStyleContext and its functions
15975 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
15976 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
15977 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
15978 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
15979 Call gtk_widget_get_preferred_size.
15980 (xg_frame_resized): gdk_window_get_geometry only takes 5
15982 (xg_win_to_widget, xg_event_is_for_menubar):
15983 Call gdk_x11_window_lookup_for_display.
15984 (xg_set_widget_bg): New function.
15985 (delete_cb): New function.
15986 (xg_create_frame_widgets): Connect delete-event to delete_cb.
15987 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
15988 (xg_set_background_color): Call xg_set_widget_bg.
15989 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
15990 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
15991 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
15992 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
15994 (update_frame_tool_bar): Call gtk_widget_hide.
15995 (xg_initialize): Use GDK_KEY_g.
15997 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
15999 (x_session_initialize): Call gdk_x11_set_sm_client_id.
16001 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
16002 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
16003 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
16005 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
16007 * w32xfns.c (select_palette): Check success of RealizePalette against
16008 GDI_ERROR, not zero.
16010 See ChangeLog.11 for earlier changes.
16012 ;; Local Variables:
16016 Copyright (C) 2011-2012 Free Software Foundation, Inc.
16018 This file is part of GNU Emacs.
16020 GNU Emacs is free software: you can redistribute it and/or modify
16021 it under the terms of the GNU General Public License as published by
16022 the Free Software Foundation, either version 3 of the License, or
16023 (at your option) any later version.
16025 GNU Emacs is distributed in the hope that it will be useful,
16026 but WITHOUT ANY WARRANTY; without even the implied warranty of
16027 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16028 GNU General Public License for more details.
16030 You should have received a copy of the GNU General Public License
16031 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.