1 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3 * .gdbinit: Use call instead of set when calling a function in the
6 * data.c (set_internal): Don't use set_blv_found.
7 (Fkill_local_variable): Likewise.
9 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
11 * nsfont.m (ns_ascii_average_width): Ensure the string
12 ascii_printable is initialized with a null-terminated character
13 array. Otherwise, it can contain undesired extra characters.
15 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
17 port new setting code to Sun C 5.8 2005/10/13
18 * chartab.c, lisp.h (char_table_set, char_table_set_range):
19 Return void, not Lisp_Object. Otherwise, the compiler
20 complains about (A?B:C) where B is void and C is Lisp_Object
21 when compiling CHAR_TABLE_SET, due to the recent change to
22 the API of sub_char_table_set_contents.
24 2012-08-18 Chong Yidong <cyd@gnu.org>
26 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
27 for the string case (Bug#3874).
29 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
31 * buffer.h (BSET): Remove (Bug#12215).
32 Replace all uses with calls to new setter functions.
33 (bset_bidi_paragraph_direction, bset_case_canon_table)
34 (bset_case_eqv_table, bset_directory, bset_display_count)
35 (bset_display_time, bset_downcase_table)
36 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
37 (bset_last_selected_window, bset_local_var_alist)
38 (bset_mark_active, bset_point_before_scroll, bset_read_only)
39 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
41 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
42 (bset_auto_fill_function, bset_auto_save_file_format)
43 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
44 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
45 (bset_cache_long_line_scans, bset_case_fold_search)
46 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
47 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
48 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
49 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
50 (bset_header_line_format, bset_indicate_buffer_boundaries)
51 (bset_indicate_empty_lines, bset_invisibility_spec)
52 (bset_left_fringe_width, bset_major_mode, bset_mark)
53 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
54 (bset_name, bset_overwrite_mode, bset_pt_marker)
55 (bset_right_fringe_width, bset_save_length)
56 (bset_scroll_bar_width, bset_scroll_down_aggressively)
57 (bset_scroll_up_aggressively, bset_selective_display)
58 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
59 (bset_word_wrap, bset_zv_marker):
60 * category.c (bset_category_table):
61 * syntax.c (bset_syntax_table):
64 * process.h (PSET): Remove (Bug#12215).
65 Replace all uses with calls to new setter functions.
66 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
67 (PROCESS_INLINE): New macro.
68 (pset_childp): New setter function.
69 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
70 * process.c (PROCESS_INLINE):
71 Define to EXTERN_INLINE, so that the corresponding functions
72 are compiled into code.
73 (pset_buffer, pset_command, pset_decode_coding_system)
74 (pset_decoding_buf, pset_encode_coding_system)
75 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
76 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
77 (pset_type, pset_write_queue): New setter functions.
79 * window.h (WSET): Remove (Bug#12215).
80 Replace all uses with calls to new setter functions.
81 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
82 (WINDOW_INLINE): New macro.
83 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
84 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
85 (wset_total_lines, wset_vertical_scroll_bar)
86 (wset_window_end_pos, wset_window_end_valid)
87 (wset_window_end_vpos): New setter functions.
88 * window.c (WINDOW_INLINE):
89 Define to EXTERN_INLINE, so that the corresponding functions
90 are compiled into code.
91 (wset_combination_limit, wset_dedicated, wset_display_table)
92 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
93 (wset_new_normal, wset_new_total, wset_next_buffers)
94 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
95 (wset_prev_buffers, wset_right_fringe_width)
96 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
97 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
98 (wset_window_parameters):
99 * xdisp.c (wset_base_line_number, wset_base_line_pos)
100 (wset_column_number_displayed, wset_region_showing):
101 New setter functions.
103 * termhooks.h (TSET): Remove (Bug#12215).
104 Replace all uses with calls to new setter functions.
105 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
106 (TERMHOOKS_INLINE): New macro.
107 (tset_charset_list, tset_selection_alist): New setter functions.
108 * terminal.c (TERMHOOKS_INLINE):
109 Define to EXTERN_INLINE, so that the corresponding functions
110 are compiled into code.
111 (tset_param_alist): New setter function.
113 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
115 * keyboard.h (KSET): Remove (Bug#12215).
116 Replace all uses with calls to new setter functions.
117 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
118 (KEYBOARD_INLINE): New macro.
119 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
120 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
121 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
122 New setter functions.
123 * keyboard.c (KEYBOARD_INLINE):
124 Define to EXTERN_INLINE, so that the corresponding functions
125 are compiled into code.
126 (kset_echo_string, kset_kbd_queue)
127 (kset_keyboard_translate_table, kset_last_prefix_arg)
128 (kset_last_repeatable_command, kset_local_function_key_map)
129 (kset_overriding_terminal_local_map, kset_real_last_command)
130 (kset_system_key_syms): New setter functions.
132 * frame.h (FSET): Remove (Bug#12215).
133 Replace all uses with calls to new setter functions.
134 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
135 (FRAME_INLINE): New macro.
136 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
137 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
138 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
139 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
140 (fset_param_alist, fset_root_window, fset_scroll_bars)
141 (fset_selected_window, fset_title, fset_tool_bar_items)
142 (fset_tool_bar_position, fset_tool_bar_window): New functions.
143 * frame.c (FRAME_INLINE):
144 Define to EXTERN_INLINE, so that the corresponding functions
145 are compiled into code.
146 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
148 A few more naming-convention fixes for getters and setters.
149 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
150 and rename from buffer_overlays_set_before.
151 (set_buffer_overlays_after): Move here from buffer.h, and rename
152 from buffer_overlays_set_after.
153 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
155 (set_buffer_intervals): Rename from buffer_set_intervals.
156 * intervals.c (set_interval_object): Move here from intervals.h,
157 and rename from interval_set_object.
158 (set_interval_left): Move here from intervals.h, and rename from
160 (set_interval_right): Move here from intervals.h, and rename from
162 (copy_interval_parent): Move here from intervals.h, and rename from
163 interval_copy_parent.
164 * intervals.h (set_interval_parent): Rename from interval_set_parent.
165 (set_interval_plist): Rename from interval_set_plist.
166 Return void, not Lisp_Object, since no caller uses the result.
167 * lisp.h (string_intervals): Rename from string_get_intervals.
168 (set_string_intervals): Rename from string_set_intervals.
170 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
171 (set_char_table_contents): Rename from char_table_set_contents.
172 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
173 All uses changed. See the end of
174 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
176 * lisp.h (CSET): Remove (Bug#12215).
177 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
178 (set_char_table_purpose): New functions,
179 replacing CSET. All uses changed. For example, replace
180 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
181 "set_char_table_parent (char_table, parent);".
182 The old version was confusing because it used the same name
183 'parent' for two different things.
185 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
187 Functions to get and set Lisp_Object fields of buffer-local variables.
188 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
189 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
190 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
191 * data.c, eval.c, frame.c: Adjust users.
193 2012-08-17 Chong Yidong <cyd@gnu.org>
195 * xfaces.c (merge_face_vectors): If the target font specfies a
196 font spec, make the font's attributes take precedence over
197 directly-specified attributes.
198 (merge_face_ref): Recognize :font.
200 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
202 Do not use memcpy for copying intervals.
203 * intervals.c (reproduce_interval): New function.
204 (reproduce_tree, reproduce_tree_obj): Use it.
205 (reproduce_tree_obj): Remove prototype.
207 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
209 * lisp.h (duration_to_sec_usec): Remove unused decl.
211 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
213 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
214 to an allocated instance of NSString, not to the class itself.
216 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
218 * makefile.w32-in (C_CTYPE_H): New macro.
219 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
220 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
221 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
223 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
225 Use ASCII tests for character types.
226 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
228 Don't include <ctype.h>; was not needed.
229 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
230 * sysdep.c, xfaces.c:
231 Include <c-ctype.h> instead of <ctype.h>.
232 * nsterm.m: Include <c-ctype.h>.
233 * charset.c (read_hex):
234 * doc.c (Fsnarf_documentation):
235 * fileio.c (IS_DRIVE) [WINDOWSNT]:
236 (DRIVE_LETTER) [DOS_NT]:
237 (Ffile_name_directory, Fexpand_file_name)
238 (Fsubstitute_in_file_name):
239 * font.c (font_parse_xlfd, font_parse_fcname):
240 * frame.c (x_set_font_backend):
241 * gtkutil.c (xg_get_font):
242 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
243 * nsimage.m (hexchar):
244 * nsterm.m (ns_xlfd_to_fontname):
245 * sysdep.c (system_process_attributes):
246 * xfaces.c (hash_string_case_insensitive):
247 Use C-locale tests instead of locale-specific tests for character
248 types, since we want the ASCII interpretation here, not the
249 interpretation suitable for whatever happens to be the current locale.
251 2012-08-16 Martin Rudalics <rudalics@gmx.at>
253 Consistently check windows for validity/liveness
254 (Bug#11984, Bug#12025, Bug#12026).
255 * lisp.h (CHECK_VALID_WINDOW): New macro.
256 * window.c (decode_window): Rename to decode_live_window.
257 (decode_valid_window, Fwindow_valid_p): New functions.
258 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
259 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
260 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
261 (Fwindow_prev_sibling, Fwindow_combination_limit)
262 (Fset_window_combination_limit, Fwindow_use_time)
263 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
264 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
265 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
266 (Fwindow_hscroll, Fset_window_hscroll)
267 (Fwindow_redisplay_end_trigger)
268 (Fset_window_redisplay_end_trigger, Fwindow_edges)
269 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
270 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
271 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
272 (Fwindow_end, Fset_window_point, Fset_window_start)
273 (Fpos_visible_in_window_p, Fwindow_line_height)
274 (Fwindow_dedicated_p, Fset_window_dedicated_p)
275 (Fwindow_prev_buffers, Fset_window_prev_buffers)
276 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
277 (Fset_window_parameter, Fwindow_display_table)
278 (Fset_window_display_table, Fdelete_other_windows_internal)
279 (Fset_window_buffer, Fset_window_new_total)
280 (Fset_window_new_normal, Fdelete_window_internal)
281 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
282 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
283 (Fwindow_scroll_bars): Check whether argument window is a valid or
284 live window. Update doc-strings.
285 (syms_of_window): New symbol Qwindow_valid_p.
286 * keyboard.c (Fposn_at_x_y): Check whether argument
287 frame_or_window denotes a valid window.
289 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
291 Fix previous char table change.
292 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
293 * chartab.c (optimize_sub_char_table): Likewise.
295 2012-08-16 Chong Yidong <cyd@gnu.org>
297 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
299 * xfont.c (xfont_open):
300 * xftfont.c (xftfont_open): Set the font's max_width field.
302 * nsfont.m (nsfont_open): Similar to the Xft backend, set
303 min_width to space_width and average_width to the average over
304 printable ASCII characters.
305 (ns_char_width): Code cleanup.
306 (ns_ascii_average_width): New utility function.
308 * font.h (struct font): Update comments.
310 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
312 Simple interface to set Lisp_Object fields of character tables.
313 * lisp.h (CSET): New macro.
314 (char_table_set_extras, char_table_set_contents)
315 (sub_char_table_set_contents): New function.
316 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
317 * syntax.c: Adjust users.
319 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
321 * eval.c (eval_sub): Bind lexical-binding.
322 * lread.c (Qlexical_binding): Make non-static.
324 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
326 * nsmenu.m (popupSession): Remove.
327 (pop_down_menu): Remove endModalSession.
328 (timeout_handler:): New method.
329 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
330 Call runModalForWindow. Check timer_fired when it returns.
331 If not set, cancel timer and break out of loop.
332 Otherwise loop again, with a new timeout.
334 * nsterm.m: Include fcntl.h if present.
335 (fd_entry, t_readfds, inNsSelect): Remove.
336 (select_writefds, select_valid, select_timeout, selfds)
337 (select_mutex, apploopnr): Add.
338 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
339 Otherwise call kbd_buffer_store_event.
340 (ns_send_appdefined): Remove release of fd_entry.
341 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
342 Increment and decrement apploopnr.
343 (ns_select): If no file descriptors, just do a NSTimer.
344 Otherwise copy read/write masks and start select thread (fd_handler).
345 Start main loop and wait for application defined event.
346 Inform select thread to stop selecting after main loop is exited.
347 (ns_term_init): Create selfds pipe and set non-blocking.
348 Initialize select_mutex. Start the select thread (fd_handler).
349 (fd_handler:): Loop forever, wait for info from the main thread
350 to either start or stop selecting. When select returns, send
351 and appdefined event.
352 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
353 If not call kbd_buffer_store_event.
355 * nsterm.h (EmacsApp): fd_handler takes id argument.
356 (EmacsDialogPanel): Add timer_fired and timeout_handler.
358 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
360 2012-08-15 Eli Zaretskii <eliz@gnu.org>
362 * region-cache.c (move_cache_gap): Update gap_len using the actual
363 growth of the boundaries array. Do not change cache_len.
366 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
368 Generalize and cleanup font subsystem checks.
369 * font.h (FONT_DEBUG, font_assert): Remove.
370 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
371 Change font_assert to eassert. Use eassert where appropriate.
373 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
375 * gtkutil.c (xg_get_font): Use pango_units_to_double.
377 2012-08-15 Chong Yidong <cyd@gnu.org>
379 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
380 When using the new font chooser, use gtk_font_chooser_get_font_desc to
381 extract the font descriptor instead of just the font name.
382 In that case, return a font spec instead of a string.
383 (x_last_font_name): Move to this file from xfns.c.
385 * xfns.c (Fx_select_font): The return value can also be a font
386 spec. Move x_last_font_name management to gtkutil.c.
388 * xfaces.c: Make font weight and style symbols non-static.
390 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
392 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
395 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
397 * alloc.c (Fgarbage_collect): Use plural form consistently.
399 2012-08-14 Eli Zaretskii <eliz@gnu.org>
401 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
402 iteration through the command loop. Fixes a problem whereby mouse
403 movements are ignored until the first mouse click.
405 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
407 Use bool, not int, for Lisp booleans.
408 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
409 makes Emacs a bit smaller and presumably a bit faster.
410 * lisp.h: Include <stdbool.h>.
411 (struct Lisp_Boolfwd, defvar_bool):
412 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
413 * regex.c [!emacs]: Include <stdbool.h>.
414 (false, true): Remove; <stdbool.h> does this for us now.
416 2012-08-14 Chong Yidong <cyd@gnu.org>
418 * character.c (Fcharacterp): Doc fix (Bug#12076).
420 * data.c (Findirect_variable): Doc fix (Bug#11040).
422 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
424 * editfns.c (Fformat): Doc fix (Bug#12059).
425 (Fsave_current_buffer): Doc fix (Bug#11542).
427 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
429 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
432 2012-08-14 Martin Rudalics <rudalics@gmx.at>
434 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
435 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
436 * minibuf.c (choose_minibuf_frame, read_minibuf):
437 * w32fns.c (x_create_tip_frame):
438 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
439 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
441 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
443 * intervals.c (offset_intervals): Remove obsolete comment.
445 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
447 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
449 2012-08-14 Gergely Risko <gergely@risko.hu>
451 * coding.c (decode_coding): Record buffer modification before
452 disabling undo_list (Bug#11773).
454 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
456 Revert and cleanup some recent overlay changes.
457 * buffer.h (enum overlay_type): Remove.
458 (buffer_get_overlays, buffer_set_overlays): Likewise.
459 (buffer_set_overlays_before, buffer_set_overlays_after):
460 New function. Adjust users.
461 (unchain_both): Add eassert.
463 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
465 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
467 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
469 * gtkutil.c (xg_mark_data): Don't assume C99.
471 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
473 * gtkutil.c (xg_frame_tb_info): New struct.
474 (TB_INFO_KEY): New define.
475 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
476 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
477 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
479 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
480 is up to date. Otherwise store new data.
481 (free_frame_tool_bar): Free xg_frame_tb_info if present.
483 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
485 Use KSET for write access to Lisp_Object members of struct kboard.
486 * keyboard.h (KSET): New macro.
487 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
488 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
489 * xterm.c: Adjust users.
491 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
493 Use BSET for write access to Lisp_Object members of struct buffer.
494 * buffer.h (BSET): New macro.
495 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
496 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
497 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
498 * window.c, xdisp.c, xfns.c: Adjust users.
500 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
502 * lread.c (syms_of_lread): Initialize Vlexical_binding.
504 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
506 * nsterm.m (not_in_argv): New function.
507 (application:openFile, application:openTempFile:):
508 (application:openFileWithoutUI:, application:openFiles:): Open file
509 if not_in_argv returns non-zero (bug#12171).
511 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
512 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
513 Define for Gtk+ versions less than 3.2.
514 (xg_get_font_name): Use those functions/macros here.
515 Reported by Frans Oilinki <moilinki@gmail.com>.
517 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
519 * unexmacosx.c (copy_data_segment): Copy initialized data in
520 statically linked libraries from input file rather than memory.
522 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
523 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
524 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
526 2012-08-10 Glenn Morris <rgm@gnu.org>
528 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
529 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
531 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
533 Fix last change to allow compilation with low optimization levels.
534 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
535 Reported by Jan Djärv <jan.h.d@swipnet.se>.
537 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
539 Use common inline syntax in intervals.h.
540 * intervals.h (INTERVALS_INLINE): New macro.
541 Change all users from LISP_INLINE.
543 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
545 Define Qnone once for all platforms.
546 * frame.c (Qnone): Define here.
547 (syms_of_frame): DEFSYM it.
548 * lisp.h (Qnone): New declaration.
549 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
550 * xfns.c: Remove duplication. Adjust users.
552 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
554 Remove unused macros from intervals.h.
555 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
556 * intervals.c: Adjust comment.
558 2012-08-10 Eli Zaretskii <eliz@gnu.org>
560 * w32fns.c <w32_unicode_gui>: New static variable.
561 (globals_of_w32fns): Initialize it according to os_subtype.
562 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
565 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
566 Eli Zaretskii <eliz@gnu.org>
568 Fix bug #10299 with Unicode characters sent by customized
569 keyboards created by MSKLC.
570 * w32fns.c (INIT_WINDOW_CLASS): New macro.
571 (w32_init_class): Use it to initialize the Emacs class with either
572 ANSI or Unicode API calls.
573 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
575 (w32_wnd_proc): If the character code sent by WM_CHAR or
576 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
577 original message. Call DefWindowProcW on NT and later.
579 2012-08-10 Glenn Morris <rgm@gnu.org>
581 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
583 * lisp.h (DIRECTORY_SEP): Let configure set it.
585 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
587 Use TSET for write access to Lisp_Object slots of struct terminal.
588 * termhooks.h (TSET): New macro.
589 * coding.c, terminal.c, xselect.c: Adjust users.
591 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
593 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
594 the failing expression, include them in the error message.
595 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
596 * lisp.h (internal_condition_case_n): Update declaration.
598 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
600 Inline functions to examine and change buffer overlays.
601 * buffer.c (unchain_both): New function.
602 * buffer.h (buffer_get_overlays, buffer_set_overlays):
603 (buffer_has_overlays): New function.
604 (enum overlay_type): New enum.
605 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
606 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
608 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
610 Inline functions to examine and change buffer intervals.
611 * alloc.c (mark_interval_tree): Remove.
612 (MARK_INTERVAL_TREE): Simplify.
613 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
614 * intervals.c (buffer_balance_intervals): New function.
615 (graft_intervals_into_buffer): Adjust indentation.
616 (set_intervals_multibyte): Simplify.
617 * buffer.h (BUF_INTERVALS): Remove.
618 (buffer_get_intervals, buffer_set_intervals): New function.
619 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
620 * intervals.c, textprop.c: Adjust users.
622 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
624 Inline functions to examine and change string intervals.
625 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
626 (string_get_intervals, string_set_intervals): New function.
627 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
628 * lread.c, print.c, textprop.c: Adjust users.
630 2012-08-08 Glenn Morris <rgm@gnu.org>
632 * lisp.mk (lisp): Remove language/persian.elc.
634 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
637 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
638 (NULL_INTERVAL_P): Likewise. Adjust users.
639 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
640 Adjust comment. Move under #if 0.
641 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
642 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
644 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
646 Check total length of intervals with eassert.
647 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
648 * intervals.c: Change all users to eassert.
650 2012-08-07 Eli Zaretskii <eliz@gnu.org>
652 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
653 Rename fields to match removal of FGET and WGET and disuse of
654 INTERNAL_FIELD in Lisp_Cons.
656 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
658 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
659 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
660 name since all xname users are fixed long time ago. Do not
662 (set_symbol_name, set_symbol_function, set_symbol_plist):
663 (set_symbol_next, set_overlay_plist): New function.
664 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
665 (struct Lisp_Overlay): Likewise.
666 (CVAR, MVAR, SVAR): Remove.
667 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
668 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
669 * xterm.c: Adjust users.
670 * .gdbinit: Change to use name field of struct Lisp_Symbol
673 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
675 Basic functions to set Lisp_Object and pointer slots of intervals.
676 * intervals.h (interval_set_parent, interval_set_object):
677 (interval_set_left, interval_set_right, interval_set_plist):
678 (interval_copy_parent): New function.
679 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
680 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
682 (INTERVAL_SIZE): Remove. Adjust users.
683 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
685 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
687 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
688 * process.h (PGET): Remove.
689 (struct Lisp_Process): Do not use INTERNAL_FIELD.
690 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
692 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
694 Drop WGET and revert read access to Lisp_Objects slots of struct window.
695 * window.h (WGET): Remove.
696 (struct window): Do not use INTERNAL_FIELD.
697 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
698 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
699 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
700 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
701 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
704 2012-08-07 Chong Yidong <cyd@gnu.org>
706 * window.c (Fwindow_edges, Fwindow_pixel_edges)
707 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
708 (Fdelete_window_internal): Signal an error if the window is not on
709 a live frame (Bug#12025).
711 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
713 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
714 * frame.h (FGET): Remove.
715 (struct frame): Do not use INTERNAL_FIELD.
716 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
717 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
718 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
719 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
721 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
723 * w32.c: Silence compiler warnings.
724 (map_w32_filename): Remove unused variable `is_fat'.
725 (chase_symlinks): Add parentheses around expression.
727 2012-08-06 Glenn Morris <rgm@gnu.org>
729 * sysdep.c: Respect BROKEN_GETWD.
731 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
732 Let configure handle it.
733 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
735 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
737 Use GCALIGNMENT where appropriate.
738 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
739 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
740 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
742 2012-08-06 Eli Zaretskii <eliz@gnu.org>
744 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
745 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
747 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
749 * buffer.h (struct buffer): Revert `indirections' to a simple int;
750 that should be sufficient for everyone.
752 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
754 * keyboard.c (timer_check_2): Add break so timer_check returns next
757 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
759 Fix Windows build errors introduced after converting to WGET and WSET.
760 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
761 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
763 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
765 * nsterm.m (ns_frame_rehighlight): Use FSET.
767 * nsmenu.m (ns_update_menubar): Use FSET.
769 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
771 Separate read and write access to Lisp_Object slots of Lisp_Process.
772 * process.h (PGET, PSET): New macros similar to AREF and ASET.
773 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
775 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
777 Separate read and write access to Lisp_Object slots of struct window.
778 * window.h (WGET, WSET): New macros similar to AREF and ASET.
779 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
780 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
781 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
782 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
783 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
786 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
788 Fix Windows build errors introduced after converting to FGET and FSET.
789 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
790 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
791 (w32_judge_scroll_bars): Change to use FSET.
792 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
794 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
796 Fix replacement typo.
797 * window.c (replace_window): Set root_window instead of
798 selected_window. This fixes a total window subsystem
799 malfunction reported by Bastien Guerry <bzg@gnu.org>.
801 2012-08-06 Glenn Morris <rgm@gnu.org>
803 * lisp.mk (lisp): Add language/persian.elc.
805 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
807 Separate read and write access to Lisp_Object slots of struct frame.
808 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
809 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
810 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
811 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
812 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
814 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
816 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
818 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
820 Generalize common compile-time constants.
821 * lisp.h (header_size, bool_header_size, word_size): Now here.
822 (struct Lisp_Vector): Add comment.
823 (struct Lisp_Bool_Vector): Move up to define handy constants.
824 (VECSIZE, PSEUDOVECSIZE): Simplify.
825 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
826 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
827 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
828 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
829 * xfont.c, xmenu.c: Use word_size where appropriate.
831 2012-08-05 Lawrence Mitchell <wence@gmx.li>
833 * search.c (Freplace_match): Treat \? in the replacement text
834 literally (Bug#8161).
836 2012-08-05 Chong Yidong <cyd@gnu.org>
838 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
839 * frame.c (Vdelete_frame_functions):
840 * emacs.c (Vkill_emacs_hook): Doc fix.
842 2012-08-04 Eli Zaretskii <eliz@gnu.org>
844 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
845 --with-x-toolkit=no builds.
846 Reported by Carsten Mattner <carstenmattner@gmail.com>.
848 2012-08-04 Chong Yidong <cyd@gnu.org>
850 * syntax.c (Fmodify_syntax_entry): Doc fix.
852 2012-08-04 Eli Zaretskii <eliz@gnu.org>
854 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
855 * w32.c (init_environment): Change the default values of many
856 environment variables in dflt_envvars[] to NULL, to avoid pushing
857 them into environment when they were not already defined.
858 Remove the code that deletes site-lisp subdirectories from the default
859 value of EMACSLOADPATH, as it is no longer needed.
860 (check_windows_init_file): Now external, not static.
861 Use Vload_path as is, without adding anything, as this function is now
862 called when Vload_path is already set up.
864 * w32.h (check_windows_init_file): Add prototype.
866 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
867 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
868 compatibility with Posix platforms.
869 (main): Move the call to check_windows_init_file to here from
871 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
872 any, in the DEFALT argument into the root of the Emacs build or
873 installation tree, as appropriate.
875 * callproc.c (init_callproc_1): Call decode_env_path instead of
876 doing its equivalent by hand.
877 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
878 the code that sets Vexec_path run on MS-Windows.
880 * lread.c (init_lread): Add comments to #ifdef's.
882 * msdos.c (dos_set_window_size, IT_update_begin)
883 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
884 instead of direct references.
886 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
888 Export DEFAULT_REHASH_* to GDB.
889 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
890 Now constants, not macros.
892 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
894 Remove unnecessary casts involving pointers.
895 These casts are no longer needed now that we assume C89 or later,
896 since they involve casting to or from void *.
897 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
898 (make_pure_float, make_pure_vector):
899 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
900 * macros.c (Fstart_kbd_macro):
901 * menu.c (find_and_return_menu_selection):
902 * minibuf.c (read_minibuf_noninteractive):
903 * sysdep.c (closedir):
904 * xdisp.c (x_produce_glyphs):
905 * xfaces.c (compare_fonts_by_sort_order):
906 * xfns.c (x_real_positions, select_visual):
907 * xselect.c (x_stop_queuing_selection_requests)
908 (x_get_window_property, x_get_window_property_as_lisp_data):
909 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
910 Remove unnecessary pointer casts.
911 * alloc.c (record_xmalloc): New function.
912 * lisp.h (record_xmalloc): New decl.
913 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
914 more like a function. This is because the pointer cast is not
915 needed. All uses changed.
916 * print.c (print_string, print_error_message): Avoid length recalc.
918 Improve fix for macroexp crash with debugging (Bug#12118).
919 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
920 ARRAY_MARK_FLAG when checking subscripts, because ASET is
921 not supposed to be invoked from the garbage collector.
922 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
923 (gc_aset): New function, which is like ASET but can be
924 used in the garbage collector.
925 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
926 (set_hash_index): Use it instead of ASET.
928 2012-08-03 Eli Zaretskii <eliz@gnu.org>
930 Support symlinks on latest versions of MS-Windows.
931 * w32.c: Include winioctl.h and aclapi.h.
932 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
933 (revert_to_self): Forward declarations of static functions.
934 <static BOOL g_b_init_get_security_info>:
935 <g_b_init_create_symbolic_link>: New static flags.
936 (globals_of_w32): Initialize them to zero.
937 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
938 (map_w32_filename): Improve commentary. Simplify switch.
939 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
940 headers (most versions of MinGW w32api don't).
941 (get_security_info, create_symbolic_link)
942 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
944 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
945 in the argument file name.
946 (sys_access): Call unc_volume_file_attributes only if
947 GetFileAttributes fails with network-related error codes.
948 (sys_rename): Diagnose renaming of a symlink when the user doesn't
949 have the required privileges.
950 (get_file_security_desc_by_name): Rename from
951 get_file_security_desc.
952 (stat_worker): New function, with most of the guts of 'stat', and
953 with addition of handling of symlinks and support for 'lstat'.
954 If possible, get file's attributes and security information by
955 handle, not by name. Produce S_IFLNK bit for symlinks, when
957 (stat, lstat): New functions, call 'stat_worker'.
958 (symlink, readlink, careadlinkat): Rewritten to create and resolve
959 symlinks when the underlying filesystem supports them.
961 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
963 Fix macroexp crash on Windows with debugging (Bug#12118).
964 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
965 checking subscripts; problem introduced with the recent
966 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
967 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
968 since it's used in non-static inline functions now.
970 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
971 Don't assume buffer size fits in 'int'. Remove unused local.
973 Use C99-style 'extern inline' if available.
974 * buffer.h (BUFFER_INLINE):
975 * category.h (CATEGORY_INLINE):
976 * character.h (CHARACTER_INLINE):
977 * charset.h (CHARSET_INLINE):
978 * composite.h (COMPOSITE_INLINE):
979 * dispextern.h (DISPEXTERN_INLINE):
980 * lisp.h (LISP_INLINE):
981 * systime.h (SYSTIME_INLINE):
982 New macro, replacing 'static inline' in this header.
983 * buffer.h, category.h, character.h, charset.h, composite.h:
984 * dispextern.h, lisp.h, systime.h:
985 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
986 * alloc.c (LISP_INLINE):
987 * buffer.c (BUFFER_INLINE):
988 * category.c (CATEGORY_INLINE):
989 * character.c (CHARACTER_INLINE):
990 * charset.c (CHARSET_INLINE):
991 * composite.c (COMPOSITE_INLINE):
992 * dispnew.c (DISPEXTERN_INLINE):
993 * sysdep.c (SYSTIME_INLINE):
994 Define to EXTERN_INLINE, so that the corresponding functions
995 are compiled into code.
996 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
997 (INLINE_HEADER_END): New macros.
998 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
999 since it's used in non-static inline functions now.
1000 (VALMASK) [!USE_LSB_TAG]: Likewise.
1002 2012-08-02 Glenn Morris <rgm@gnu.org>
1004 * s/: Remove empty directory.
1006 * s/ms-w32.h: Move to ../nt/inc.
1007 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
1008 Update for new ms-w32.h location.
1010 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
1013 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
1015 2012-08-02 Glenn Morris <rgm@gnu.org>
1017 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
1018 hard-coding the path separator.
1020 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
1022 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
1023 This how ASET and AREF are supposed to work, and makes
1024 it easier to think about future improvements. See
1025 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
1026 * charset.h (set_charset_attr): New function.
1027 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
1028 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
1029 (aref_addr): New function. All uses of &AREF(...) changed.
1030 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1031 (set_hash_index): New functions. All lvalue-style uses of
1032 HASH_KEY etc. changed.
1033 * keyboard.c (set_prop): New function. All lvalue-style uses
1036 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
1038 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
1039 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1040 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
1041 * nsfns.m (ns_set_name_as_filename): Likewise.
1042 * nsmenu.m (ns_update_menubar): Likewise.
1043 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
1045 2012-08-01 Eli Zaretskii <eliz@gnu.org>
1047 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
1048 Adapt to latest changes in field names of the corresponding Lisp
1051 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
1053 2012-08-01 Glenn Morris <rgm@gnu.org>
1055 * s/msdos.h: Remove file.
1056 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
1057 * Makefile.in (S_FILE): Remove.
1058 (config_h): Remove S_FILE.
1060 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
1062 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
1063 Remove; moved to nt/config.nt.
1065 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1067 Use INTERNAL_FIELD for conses and overlays.
1068 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
1069 Remove obsolete comment.
1071 (struct Lisp_Overlay): Use INTERNAL_FIELD.
1072 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
1074 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1076 Use INTERNAL_FIELD for symbols.
1077 * lisp.h (SVAR): New macro. Adjust users.
1078 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
1079 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
1081 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1083 Use INTERNAL_FIELD for processes.
1084 * process.h (PVAR): New macro. Adjust style.
1085 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
1086 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
1088 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1090 Use INTERNAL_FIELD for windows.
1091 * window.h (WVAR): New macro.
1092 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
1093 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1094 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1095 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
1096 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
1097 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
1099 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
1101 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
1103 2012-08-01 Glenn Morris <rgm@gnu.org>
1105 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
1106 Move to configure.ac.
1108 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
1110 * makefile.w32-in (CONFIG_H): Update dependencies.
1111 (CONF_POST_H): New macro.
1113 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
1115 2012-07-31 Glenn Morris <rgm@gnu.org>
1117 * Makefile.in (S_FILE): No longer set by configure.
1119 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
1121 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
1123 * process.h (NULL_DEVICE):
1124 * emacs.c (SEPCHAR):
1125 * editfns.c (USER_FULL_NAME): Let configure set them.
1127 * s/README, s/template.h: Remove files.
1129 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
1131 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
1132 Move to configure.ac.
1134 2012-07-31 Eli Zaretskii <eliz@gnu.org>
1136 * .gdbinit (xframe): Adapt to introduction of FVAR and the
1137 resulting renaming of 'struct frame' members.
1139 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
1141 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
1142 after introduction of FVAR.
1144 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
1146 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
1148 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
1149 instead of compositeToPoint.
1150 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
1152 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
1154 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
1156 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
1157 * lisp.h (INTERNAL_FIELD): New macro.
1158 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
1159 (BVAR): Change to use INTERNAL_FIELD.
1160 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
1161 (KVAR): Change to use INTERNAL_FIELD.
1162 * frame.h (FVAR): New macro.
1163 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
1164 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
1165 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
1166 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1167 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
1169 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
1171 Miscellaneous fixes for non-default X toolkits.
1172 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
1173 * xterm.c (x_frame_of_widget): Remove redundant prototype.
1174 Move under #ifdef USE_LUCID.
1175 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
1176 definition and usage to avoid warnings.
1178 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
1180 * nsterm.m (openFiles): Fix previous checkin.
1182 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
1184 * indent.c (compute_motion): Remove unused local.
1186 2012-07-31 Glenn Morris <rgm@gnu.org>
1188 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
1190 * conf_post.h [USG5_4]:
1191 Move remaining contents of s/usg5-4-common.h here.
1192 * s/usg5-4-common.h: Remove file.
1194 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
1195 * s/irix6-5.h: Remove file.
1197 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
1198 * s/darwin.h: Remove file.
1200 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
1201 * s/hpux10-20.h: Remove file, which is now empty.
1203 2012-07-30 Glenn Morris <rgm@gnu.org>
1205 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
1206 * Makefile.in (config_h): Add conf_post.h.
1207 * makefile.w32-in (CONFIG_H): Add conf_post.h.
1209 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
1211 * nsterm.m (ns_do_open_file): New variable.
1212 (ns_term_init): Set ns_do_open_file to YES after run returns.
1213 (openFile, openTempFile, openFileWithoutUI, openFiles):
1214 Open files only if ns_do_open_file.
1216 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1218 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
1219 This no-op macro hasn't been needed for many years.
1220 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
1222 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
1223 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
1224 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
1225 gdb_make_enums_visible.
1226 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
1227 (DIRECTORY_SEP): Now a constant, not a macro.
1229 2012-07-30 Eli Zaretskii <eliz@gnu.org>
1231 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
1232 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
1234 * w32term.c <w32_keyboard_codepage>: Renamed from
1235 keyboard_codepage and now external. All users changed.
1237 * w32term.h: Add declaration of w32_keyboard_codepage.
1239 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
1240 the codepage to translate keys to Unicode. If this argument is
1241 -1, use the value returned by GetConsoleCP. All callers changed.
1243 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1245 Update .PHONY listings in makefiles.
1246 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
1247 bootstrap-clean, distclean, maintainer-clean, versioclean,
1250 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
1251 This is a bit clearer. Fix some commentary typos.
1253 2012-07-30 Glenn Morris <rgm@gnu.org>
1255 * s/netbsd.h: Let configure include signal.h if needed.
1256 Remove file, which is now empty.
1258 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
1259 Let configure set them.
1260 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
1261 No more need to undefine.
1263 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
1265 * keymap.c (Fkey_description): Don't remove 0x80 bit from
1266 non-single-byte char when adding meta modifier. (Bug#12090)
1268 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
1270 Convert safe_call to use variable number of arguments.
1271 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
1272 (safe_call2): Fix comment.
1273 * lisp.h (safe_call): Adjust prototype.
1274 * coding.c (encode_coding_object): Change to use safe_call2.
1275 * xfaces.c (merge_face_heights): Change to use safe_call1.
1277 2012-07-30 Glenn Morris <rgm@gnu.org>
1279 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
1280 does that unconditionally. Remove file, which is now empty.
1282 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
1285 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1287 Export to GDB most of lisp.h's remaining object-like macros.
1288 * lisp.h (min, max): Move earlier, because they're used earlier now.
1289 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
1290 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
1291 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
1292 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
1293 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
1294 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
1295 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
1296 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
1297 Now constants, for GDB. They need not be macros.
1298 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
1299 Now constants, for GDB, as well as macros, for static initializers.
1300 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
1301 Move to after the definition of struct Lisp_Char_Table,
1302 since the former now needs that type defined.
1303 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
1304 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
1305 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
1306 New enums, for gdb_make_enums_visible.
1307 (GLYPH_MODE_LINE_FACE): Remove; unused.
1308 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
1309 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
1310 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
1311 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
1312 enum maxargs, enum MAX_ALLOCA.
1313 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
1314 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
1315 no longer needed, now that they are done in lisp.h.
1317 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
1319 Cleanup string bytes checking.
1320 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
1321 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
1322 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
1323 (check_sblock, compact_small_strings): Simplify.
1325 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1327 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
1328 These macros are confusing and no longer need to be defined, as
1329 the enum values now suffice. All uses replaced with definiens.
1330 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
1332 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
1334 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
1335 ($(BLD)/w32console.$(O)): Update dependencies.
1337 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1339 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
1340 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
1342 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
1344 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
1346 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
1347 setting sitelisp (Bug#12010).
1349 2012-07-29 Eli Zaretskii <eliz@gnu.org>
1351 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
1353 * w32heap.c (cache_system_info):
1354 * w32.c (sys_rename):
1355 * w32proc.c (find_child_console, sys_kill): All users changed.
1357 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1359 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
1361 2012-07-29 Eli Zaretskii <eliz@gnu.org>
1363 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
1365 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1367 Cleanup statistics calculation in Fgarbage_collect.
1368 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
1369 Fix zombies percentage calculation. Simplify elapsed time calculation.
1371 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1373 Generalize marker debugging code under MARKER_DEBUG and use eassert.
1374 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
1375 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
1376 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
1377 (replace_range, replace_range_2, del_range_2): Change to eassert.
1378 * marker.c (byte_char_debug_check): Adjust style.
1380 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1382 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
1383 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
1384 long-ago-commented-out code that talks about "WIN32".
1385 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
1388 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
1390 Use Gnulib stdalign module (Bug#9772, Bug#9960).
1391 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
1392 Simplify by using alignof.
1393 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
1394 * lisp.h: Include <stdalign.h>.
1395 (GCALIGNMENT): New macro and constant.
1396 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
1397 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
1398 (stdalign): New macro, if not already defined.
1400 2012-07-28 Eli Zaretskii <eliz@gnu.org>
1402 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
1403 * w32inevt.c: Include w32inevt.h.
1404 (w32_read_console_input): New inline function, calls either
1405 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
1406 w32_console_unicode_input.
1407 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
1408 (w32_kbd_patch_key, key_event): Use the codepage returned by
1409 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
1410 (key_event): use uChar.UnicodeChar only if
1411 w32_console_unicode_input is non-zero.
1413 * w32console.c: Include w32heap.h.
1414 <w32_console_unicode_input>: New global variable.
1415 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
1416 family of Windows, zero otherwise.
1418 * w32inevt.h: Declare w32_console_unicode_input.
1420 * xdisp.c (init_iterator): Don't reference tip_frame in a build
1421 --without-x. (Bug#11742)
1423 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
1425 Adjust GDB to reflect pvec_type changes (Bug#12036).
1426 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
1427 2012-07-04 changes to pseudovector representation.
1428 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
1430 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
1432 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
1434 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
1436 2012-07-27 Eli Zaretskii <eliz@gnu.org>
1438 * alloc.c (listn): Fix the order the arguments are consed onto the
1441 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
1442 enumeration constants, as PURE and HEAP are too general, and clash
1443 with other headers and sources, such as gmalloc.c and the
1444 MS-Windows system headers. All users changed.
1446 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1448 Revert last save_excursion_save and save_excursion_restore changes.
1449 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
1450 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
1452 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1454 Fix recently-introduced typos in Windows port.
1455 Reported by Martin Rudalics <rudalics@gmx.at>.
1456 * w32.c (init_environment): Replace comma with semicolon.
1457 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
1459 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
1461 Improve GDB symbol export (Bug#12036).
1462 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
1463 arms of an 'if', not using conditional expressions; otherwise GDB
1464 complains about the types in the unevaluated arm when the argument
1465 is an integer literal.
1466 (xgetint): Simplify expression.
1467 * alloc.c (gdb_make_enums_visible): New constant. This ports to
1468 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
1469 Zaretskii in <http://bugs.gnu.org/12036#13>.
1470 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
1471 needed now that we have gdb_make_enums_visible.
1472 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
1473 (enum enum_USE_LSB_TAG):
1474 New enum types, packaging up enums that need to be exported to GDB.
1476 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1478 Utility function to make a list from specified amount of objects.
1479 * lisp.h (enum constype): New datatype.
1480 (listn): New prototype.
1481 * alloc.c (listn): New function.
1482 (Fmemory_use_count, syms_of_alloc): Use it.
1483 * buffer.c (syms_of_buffer): Likewise.
1484 * callint.c (syms_of_callint): Likewise.
1485 * charset.c (define_charset_internal): Likewise.
1486 * coding.c (syms_of_coding): Likewise.
1487 * keymap.c (syms_of_keymap): Likewise.
1488 * search.c (syms_of_search): Likewise.
1489 * syntax.c (syms_of_syntax): Likewise.
1490 * w32.c (init_environment): Likewise.
1491 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
1492 * xdisp.c (syms_of_xdisp): Likewise.
1493 * xfns.c (syms_of_xfns): Likewise.
1495 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1497 Fast save_excursion_save and save_excursion_restore.
1498 * lisp.h (struct Lisp_Excursion): New data type.
1499 (PVEC_EXCURSION): New pseudovector type.
1500 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
1501 to deal with it. Adjust comments.
1502 (init_marker, attach_marker): New prototype.
1503 (unchain_marker): Adjust prototype.
1504 * marker.c (attach_marker): Change to global.
1505 (init_marker): New function.
1506 * alloc.c (Fmake_marker, build_marker): Use it.
1507 (build_marker): More easserts.
1508 (mark_object): Handle struct Lisp_Excursion.
1509 * editfns.c (save_excursion_save, save_excursion_restore):
1510 Reimplement to use struct Lisp_Excursion. Add comments.
1512 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
1514 Fix export of symbols to GDB (Bug#12036).
1515 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
1516 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
1517 emacs.c, as this is a more-suitable home. Had this been done earlier
1518 the fix for 12036 would have avoided some of the problems noted in
1519 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
1520 would have been more obvious.
1521 * emacs.c: Do not include <verify.h>; no longer needed.
1522 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
1523 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
1524 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
1525 Remove; now done in lisp.h.
1526 * lisp.h (PUBLISH_TO_GDB): New macro.
1527 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
1528 (DATA_SEG_BITS): Use it.
1529 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
1530 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
1531 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
1532 not be usable in #if. This simplifies things.
1534 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
1536 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
1538 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
1540 Simplify export of symbols to GDB (Bug#12036).
1541 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
1542 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
1543 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
1544 Adjust to changes in lisp.h and emacs.c, by using
1545 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
1546 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
1547 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
1548 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
1549 instead of gdb_valbits.
1550 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
1551 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
1552 instead of gdb_array_mark_flag.
1553 (xboolvector): Get size from $->size, not $->header.size.
1554 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
1555 (xreload, hook-run, hookpost-run): Remove.
1556 * emacs.c: Include <verify.h>.
1557 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
1558 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
1560 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
1561 (gdb_USE_LSB_TAG): New enum constants.
1562 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
1563 Also define these as enum constants, so they're visible to GDB.
1564 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
1565 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
1566 as constants, so they're visible to GDB.
1567 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
1568 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
1569 Now enum constants, not macros, so they're visible to GDB.
1570 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
1571 more convenient now. All uses changed.
1572 (VALMASK) [USE_LSB_TAG]: Also define in this case.
1573 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
1575 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
1577 Explicitly free restriction data that are not needed anymore.
1578 * editfns.c (save_restriction_restore): Free restriction data.
1580 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
1582 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
1583 add argument, tune behavior, and adjust all callers.
1585 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
1587 Use typedef for EMACS_INT, EMACS_UINT.
1588 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
1589 than macros. This simplifies debugging in the usual case, since
1590 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
1591 and it allows expressions involving EMACS_INT casts.
1592 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
1594 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
1596 * nsterm.m (ns_read_socket): Return early if there is a modal
1599 2012-07-25 Martin Rudalics <rudalics@gmx.at>
1601 * frame.c (Fredirect_frame_focus): In doc-string don't mention
1602 that FOCUS-FRAME can be omitted.
1604 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
1606 Adjust buffer text indirection counters at the end of Fkill_buffer.
1607 * buffer.c (Fkill_buffer): Adjust indirection counters when the
1608 buffer is definitely dead. This should really fix an issue reported
1609 by Christoph Scholtes again. (Bug#12007).
1610 (init_buffer_once): Initialize indirection counters of
1611 buffer_defaults and buffer_local_symbols (for sanity and safety).
1613 2012-07-24 Eli Zaretskii <eliz@gnu.org>
1615 * xdisp.c (init_iterator): Don't compute dimensions of truncation
1616 and continuation glyphs on tooltip frames, leave them at zero.
1617 Avoids continued lines in tooltips. (Bug#11832)
1619 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
1621 Simplify copy_overlay.
1622 * buffer.c (copy_overlay): Simplify. Use build_marker.
1623 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
1625 2012-07-23 Eli Zaretskii <eliz@gnu.org>
1627 * print.c (print_object): Don't crash when a frame's name is nil
1628 or invalid. (Bug#12025)
1630 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
1631 it signals an error when a tooltip frame is being created.
1633 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
1635 Cleanup miscellaneous objects allocation and initialization.
1636 * alloc.c (allocate_misc): Change to static. Add argument to
1637 specify the subtype. Adjust comment and users.
1638 (build_overlay): New function.
1639 * buffer.c (copy_overlays, Fmake_overlay): Use it.
1640 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
1641 (allocate_misc): Remove prototype.
1642 (build_overlay): Add prototype.
1644 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
1646 Swap buffer text indirection counters in Fbuffer_swap_text.
1647 * buffer.c (Fbuffer_swap_text): Swap indirections too.
1648 This avoids crash reported by Christoph Scholtes at
1649 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
1651 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
1653 * nsmenu.m (Popdown_data): New struct.
1654 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
1656 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
1657 (initWithContentRect): Make imgView and contentView non-static
1658 and autorelease them. Also autorelease img and matrix (Bug#12005).
1659 (dealloc): Remove (Bug#12005).
1661 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
1663 Adjust consing_since_gc when objects are explicitly freed.
1664 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
1665 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
1666 (free_cons, free_misc): Subtract object size from consing_since_gc.
1668 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
1670 Simplify and cleanup markers positioning code.
1671 * marker.c (attach_marker): More useful eassert.
1672 (live_buffer, set_marker_internal): New function.
1673 (Fset_marker, set_marker_restricted): Use set_marker_internal.
1674 (set_marker_both, set_marker_restricted_both): Use live_buffer.
1676 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
1678 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
1679 as it's limited by the amount of memory, not by INT_MAX.
1681 2012-07-21 Eli Zaretskii <eliz@gnu.org>
1683 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
1684 in special-event-map. See the discussion at
1685 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
1688 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
1689 info.dwItemData. Fixes crashes on 64-bit Windows.
1690 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
1692 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
1694 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
1695 (conversationIdentifier): Return value is NSInteger.
1696 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
1698 2012-07-21 Chong Yidong <cyd@gnu.org>
1700 * window.c (decode_any_window): Signal an error if the window is
1701 on a dead frame (Bug#11984).
1703 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
1705 Add indirection counting to speed up Fkill_buffer.
1706 * buffer.h (struct buffer): New member.
1707 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
1708 (Fmake_indirect_buffer): Set indirection counter to -1, increment
1709 base buffer indirection counter.
1710 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
1711 (Fkill_buffer): Adjust indirection counters as needed, don't walk
1712 through buffer list if indirection counter is 0.
1714 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
1716 Extend the value returned by Fgarbage_collect with heap statistics.
1717 * alloc.c (Qheap): New symbol.
1718 (syms_of_alloc): DEFSYM it.
1719 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
1720 (Fmemory_free): Remove.
1721 (syms_of_alloc): Don't defsubr it.
1722 * buffer.c (Fcompact_buffer): Remove.
1723 (syms_of_buffer): Don't defsubr it.
1725 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
1727 Make maybe_gc inline.
1728 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
1729 * lisp.h (consing_since_gc, gc_relative_threshold)
1730 (memory_full_cons_threshold): Revert declaration.
1731 (maybe_gc): Remove prototype, define as inline.
1732 * alloc.c: Remove old commented-out code.
1733 (consing_since_gc, gc_relative_threshold)
1734 (memory_full_cons_threshold): Revert to global.
1737 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
1739 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
1740 * lisp.h (build_unibyte_string): New function.
1741 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
1742 * sysdep.c, w32fns.c, xfns.c: Use it.
1743 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
1744 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
1745 Adjust users accordingly.
1746 * font.h (font_open_by_name): Adjust prototype.
1748 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
1750 Cleanup calls to Fgarbage_collect.
1751 * lisp.h (maybe_gc): New prototype.
1752 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
1753 Remove declarations.
1754 * alloc.c (maybe_gc): New function.
1755 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
1757 * bytecode.c (MAYBE_GC): Use maybe_gc.
1758 * eval.c (eval_sub, Ffuncall): Likewise.
1759 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
1760 to avoid dependency from auto-save feature.
1762 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
1764 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
1765 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
1766 'for_each_per_buffer_object_at'.
1767 All uses changed. It's better to use upper-case for macros that
1768 cannot be implemented as functions, to give the reader a clue
1769 that they're special.
1771 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
1773 * alloc.c (Fgarbage_collect): Tweak docstring.
1775 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
1777 Tweak the value returned from Fgarbage_collect again.
1778 * alloc.c (Fgarbage_collect): New return value, as confirmed in
1779 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
1780 Adjust documentation.
1781 (total_vector_bytes): Rename to total_vector_slots, adjust
1783 (total_free_vector_bytes): Rename to total_free_vector_slots,
1785 (Qstring_bytes, Qvector_slots): New symbols.
1786 (syms_of_alloc): DEFSYM them.
1788 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
1790 Buffer compaction primitive which may be used from Lisp.
1791 * buffer.c (compact_buffer, Fcompact_buffer): New function.
1792 (syms_of_buffer): Register Fcompact_buffer.
1793 * alloc.c (Fgarbage_collect): Use compact_buffer.
1794 * buffer.h (compact_buffer): New prototype.
1795 (struct buffer_text): New member.
1797 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
1799 New macro to iterate over all buffers, miscellaneous cleanups.
1800 * lisp.h (all_buffers): Remove declaration.
1801 * buffer.h (all_buffers): Add declaration, with comment.
1802 (for_each_buffer): New macro.
1803 * alloc.c (Fgarbage_collect, mark_object): Use it.
1804 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
1805 (init_buffer): Likewise.
1806 * data.c (Fset_default): Likewise.
1807 * coding.c (code_conversion_restore): Remove redundant check
1809 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
1811 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
1813 Fix bug that created negative-length intervals.
1814 * intervals.c (merge_interval_right, merge_interval_left):
1815 Do not zero out this interval if it is absorbed by its children,
1816 as this interval's total length doesn't change in that case. See
1817 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
1819 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
1821 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
1822 when invoking (make-bool-vector N t) and N is a positive
1823 multiple of 8 -- the last 8 bits were mistakenly cleared.
1825 Remove some struct layout assumptions in bool vectors.
1826 * alloc.c (bool_header_size): New constant.
1827 (header_size, word_size): Move earlier, as they're now used earlier.
1828 Use 'word_size' in a few more places, where it's appropriate.
1829 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
1830 padding before the data member of a bool vector.
1831 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
1832 than doing the check by hand with an abort ().
1834 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
1836 * eval.c (Fdefvar): Don't check constants since we only set the var if
1837 it's not yet defined anyway (bug#11904).
1839 * lisp.h (last_undo_boundary): Declare new var.
1840 * keyboard.c (command_loop_1): Set it.
1841 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
1842 were auto-added by the command loop (bug#11774).
1844 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
1846 * w32font.c (Qsymbol): Remove local definition.
1847 (syms_of_w32font): Don't DEFSYM it.
1849 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
1851 Fix sweep_vectors to handle large bool vectors correctly.
1852 * alloc.c (sweep_vectors): Account total_vector_bytes for
1853 bool vectors larger than VBLOCK_BYTES_MAX.
1855 2012-07-18 Chong Yidong <cyd@gnu.org>
1857 * frame.c (x_set_frame_parameters): Revert bogus change introduced
1858 in 2012-05-25 commit by Paul Eggert (Bug#11738).
1860 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
1862 Return more descriptive data from Fgarbage_collect.
1863 Suggested by Stefan Monnier in
1864 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
1865 * alloc.c (bounded_number): New function.
1866 (total_buffers, total_vectors): New variable.
1867 (total_string_size): Rename to total_string_bytes, adjust users.
1868 (total_vector_size): Rename to total_vector_bytes, adjust users.
1869 (sweep_vectors): Account total_vectors and total_vector_bytes.
1870 (Fgarbage_collect): New return value. Adjust documentation.
1871 (gc_sweep): Account total_buffers.
1872 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
1873 (VECTOR_SIZE): Remove.
1874 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
1875 (Qinterval, Qmisc): New symbols.
1876 (syms_of_data): Initialize them.
1877 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
1878 (Qcons, Qbuffer): New declarations.
1880 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
1882 * alloc.c (Fmemory_free): Account for memory-free's own storage.
1883 Round up, not down. Improve doc.
1885 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1887 Restore old code in allocate_string_data to avoid Faset breakage.
1888 Reported by Julien Danjou <julien@danjou.info> in
1889 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
1890 * alloc.c (allocate_string_data): Restore old code with minor
1891 adjustments, fix comment to explain this subtle issue.
1893 2012-07-17 Eli Zaretskii <eliz@gnu.org>
1895 Remove FILE_SYSTEM_CASE.
1896 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
1898 * fileio.c (FILE_SYSTEM_CASE): Don't define.
1899 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
1900 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
1901 call-process-region passes it through expand-file-name.
1903 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
1905 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
1907 Fix crash when creating indirect buffer (Bug#11917)
1908 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
1909 Don't handle unbound variables specially if non-zero.
1910 (Fbuffer_local_variables): Pass zero.
1911 (clone_per_buffer_values): Pass non-zero.
1913 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
1915 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
1916 to make the loop interruptible.
1918 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
1920 * gnutls.c (emacs_gnutls_handshake): Only retry if
1921 GNUTLS_E_INTERRUPTED.
1923 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1925 Cleanup and convert miscellaneous checks to eassert.
1926 * alloc.c (mark_interval): Fix comment, partially rephrase
1927 old comment from intervals.h (see below).
1928 * intervals.c (find_interval, adjust_intervals_for_insertion)
1929 (delete_interval, adjust_intervals_for_deletion)
1930 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
1932 (adjust_intervals_for_insertion, make_new_interval):
1933 Remove obsolete and unused code.
1934 * intervals.h (struct interval): Remove obsolete comment.
1935 * textprotp.c (erase_properties): Remove unused code.
1936 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
1937 (Fremove_list_of_text_properties): Convert to eassert.
1939 2012-07-17 Chong Yidong <cyd@gnu.org>
1941 * editfns.c (Finsert_char): Doc fix.
1943 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1945 Fix previous change to make Fmemory_free always accurate.
1946 * alloc.c (make_interval): Update total_free_intervals.
1947 (make_float): Likewise for total_free_floats.
1948 (free_cons, Fcons): Likewise for total_free_conses.
1949 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
1950 Likewise for total_free_vector_bytes.
1951 (Fmake_symbol): Likewise for total_free_symbols.
1952 (bytes_free): Remove.
1954 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1956 Simple free memory accounting feature.
1957 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
1958 (sweep_vectors): Accumulate size of free vectors.
1959 (Fgarbage_collect): Setup bytes_free.
1960 (Fmemory_free): New function.
1961 (syms_of_alloc): Register it.
1963 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1965 Cleanup overlays checking.
1966 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
1967 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
1968 eassert and OVERLAYP.
1969 (sort_overlays): Change to use OVERLAYP.
1971 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
1973 * editfns.c (Finsert_char): Make it interactive, and make the
1974 second arg optional. Copy interactive spec and docstring from
1977 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
1979 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
1980 Unlike the other wrapped functions, fabs has an unspecified
1983 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
1985 * nsterm.m (keyDown): Interpret flags without left/right bits
1986 as the left key (Bug#11670).
1988 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
1990 Remove empty and useless init functions.
1991 * lisp.h (init_character_once, init_fns, init_image)
1992 (init_filelock, init_sound): Remove prototype.
1993 * character.c (init_character_once): Remove.
1994 * filelock.c (init_filelock): Likewise.
1995 * fns.c (init_fns): Likewise.
1996 * image.c (init_image): Likewise.
1997 * sound.c (init_sound): Likewise.
1998 * emacs.c (main): Adjust accordingly.
2000 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
2002 * gtkutil.h: Tiny cleanups.
2003 (use_old_gtk_file_dialog): Remove useless declaration.
2004 (xg_uses_old_file_dialog): Add suggested const attribute.
2006 2012-07-15 Eli Zaretskii <eliz@gnu.org>
2008 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
2009 (bidi_paragraph_init): Use it to limit search forward for a strong
2010 directional character in abnormally large paragraphs full of
2011 neutral or weak characters. (Bug#11943)
2013 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
2015 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
2016 the toolbar (Bug#9451).
2017 (xg_make_tool_item): Give the widget event box a transparent
2020 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
2022 Cleanup basic allocation variables and functions.
2023 * alloc.c (ignore_warnings, init_intervals, init_float)
2024 (init_cons, init_symbol, init_marker): Remove.
2025 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
2026 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
2027 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
2028 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
2029 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
2030 (staticidx, init_alloc_once, init_strings, free_ablock):
2031 Remove redundant initialization.
2032 * fns.c (init_weak_hash_tables): Remove.
2033 * lisp.h (init_weak_hash_tables): Remove prototype.
2035 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
2037 Use zero_vector where appropriate.
2038 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
2040 * lisp.h (zero_vector): New declaration.
2041 * font.c (null_vector): Remove.
2042 (syms_of_font): Remove initialization and staticpro.
2043 (font_list_entities, font_find_for_lface): Change to use zero_vector.
2044 * keymap.c (Faccessible_keymaps): Likewise.
2046 2012-07-15 Leo Liu <sdl.web@gmail.com>
2048 * fringe.c: Fix typo in comments.
2050 2012-07-14 Leo Liu <sdl.web@gmail.com>
2052 * fringe.c: Add a new bitmap exclamation-mark.
2054 2012-07-14 Eli Zaretskii <eliz@gnu.org>
2056 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
2058 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
2059 (HAVE_MENUS): Don't define, defined by editing config.in with
2061 (GMALLOC_INHIBIT_VALLOC): Don't define.
2062 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
2064 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
2066 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
2068 2012-07-14 Glenn Morris <rgm@gnu.org>
2070 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
2071 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
2072 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
2074 2012-07-13 Glenn Morris <rgm@gnu.org>
2076 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
2078 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
2079 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
2081 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
2083 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
2084 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
2085 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
2086 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
2088 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
2089 as boolean expression.
2090 (x_set_window_size): Remove unused variable toolbar.
2091 (ns_get_color_default, ns_mod_to_lisp): Remove.
2092 (ns_mouse_position): Remove unused variables xchar and ychar.
2093 (ns_compute_glyph_string_overhangs): Remove unused variable face.
2094 (ns_set_vertical_scroll_bar): Remove unused variable count.
2095 (ns_delete_terminal): Remove unused variable i.
2096 (ns_term_init): Remove unused variables r, g and b.
2097 (mouseDown): Remove unused variable window.
2098 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
2099 (initFrameFromEmacs): Remove unused variable vbextra.
2100 (mouseEntered): Remove unused variables p and dpyinfo.
2101 (mouseExited): Remove unused variables p and r.
2102 (ns_define_frame_cursor, ns_clear_frame_area)
2103 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
2104 (menuDown): Assign [sender tag] to variable and cast the variable.
2106 * nsterm.h (menuDown): Add id as type to argument sender.
2107 (ns_display_info_for_name): Add Lisp_Object argument.
2108 (ns_term_init): Add Lisp_Object argument.
2109 (ns_map_event_to_object): Add void argument.
2110 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
2111 prototype with arguments and only declare if __OBJC__.
2112 (nxatoms_of_nsselect): Add void argument.
2113 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
2114 (ns_alloc_autorelease_pool): Add void argument.
2115 (ns_release_autorelease_pool): Add void* argument.
2116 (ns_get_defaults_value): Add const char* argument.
2118 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
2119 (initFromContents): Use SSDATA where appropriate.
2120 (ns_update_menubar): Add braces to ambigous if-else.
2121 (initWithTitle): Put () around assignment in if statement.
2122 (ns_menu_show): Remove unused variables window and keymap.
2123 (update_frame_tool_bar): Remove unused variable selected_p.
2124 (initWithContentRect): Remove unused variable this_cmd_name.
2126 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
2128 (setXBMColor): Remove unused variable len.
2129 (setPixmapData): Put () around assignment in loop statement.
2131 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
2132 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
2134 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
2135 around assignment in loop statement.
2136 (nsfont_open): Remove unused variable i.
2137 (nsfont_open): Remove unused variable len.
2138 (nsfont_draw): Remove unused variable cs.
2140 * nsfns.m (x_set_icon_name, ns_set_name_internal)
2141 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
2142 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
2143 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
2144 (Fns_font_name, Fns_perform_service)
2145 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
2146 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
2147 (ns_set_name): Remove unused variable view.
2148 (x_set_menu_bar_lines): Remove unused variable olines.
2149 (x_set_tool_bar_lines): Remove unused variable root_window.
2150 (Fns_list_colors): Put () around assignment in while statement.
2151 (Fns_perform_service): Remove unused variable len.
2152 (Fns_display_usable_bounds): Remove unused variable top.
2153 (syms_of_nsfns): Remove unused variable i.
2155 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
2158 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2160 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
2161 and free it with DestroyExceptionInfo (Bug#11558).
2163 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
2165 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
2166 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
2167 Set here, not in nt/config.nt.
2169 2012-07-13 Eli Zaretskii <eliz@gnu.org>
2171 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
2172 cursor overflow into the last glyph on display line when the right
2173 fringe is off. (Bug#11832)
2175 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
2177 * xdisp.c (produce_special_glyphs): Now static.
2178 * dispextern.h (produce_special_glyphs): Remove decl.
2180 2012-07-13 Glenn Morris <rgm@gnu.org>
2182 * s/bsd-common.h, s/cygwin.h: Remove empty files.
2183 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
2185 * s/usg5-4-common.h (USG, USG5):
2186 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
2187 * s/sol2-6.h (SOLARIS2):
2188 * s/irix6-5.h (IRIX6_5):
2189 * s/hpux10-20.h (USG, USG5, HPUX):
2190 * s/gnu-linux.h (USG, GNU_LINUX):
2191 * s/freebsd.h (BSD_SYSTEM):
2192 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
2193 * s/cygwin.h (CYGWIN):
2194 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
2195 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
2197 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
2199 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
2201 2012-07-13 Glenn Morris <rgm@gnu.org>
2203 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
2205 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
2207 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
2208 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
2210 2012-07-12 Glenn Morris <rgm@gnu.org>
2212 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
2214 * process.c (init_process_emacs): Rename from init_process.
2215 The old name is also the name of a Mach system call.
2216 * lisp.h, emacs.c: Update for this name change.
2217 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
2220 2012-07-12 Eli Zaretskii <eliz@gnu.org>
2222 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
2223 memmove call that removes glyphs covered by the left truncation
2224 glyph. Improve commentary.
2225 (display_line): Fix display of continuation glyphs on GUI frames
2226 when the right fringe is turned off and variable-size fonts are
2227 used in the window. Move the code that appends a stretch glyph to
2228 produce_special_glyphs, so that it could be used for truncation
2229 and continuation glyphs alike.
2230 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
2231 glyph of a suitably computed width, to align the special glyphs at
2232 the window margin. Code moved from display_line. (Bug#11832)
2234 2012-07-12 Glenn Morris <rgm@gnu.org>
2236 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
2238 * s/gnu-linux.h, s/hpux10-20.h:
2239 Do not unconditionally define HAVE_XRMSETDATABASE.
2241 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
2243 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
2245 Fix typos that broke OS X build.
2246 Reported by Randal L. Schwartz in
2247 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
2248 * nsterm.m (ns_timeout): Add missing local decl.
2249 (ns_get_color): snprintf -> sprintf, to fix typo.
2251 2012-07-12 Glenn Morris <rgm@gnu.org>
2253 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
2254 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
2255 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
2256 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
2258 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
2259 Move PTY_OPEN to configure.
2261 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2262 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
2263 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
2265 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
2267 Use empty_unibyte_string where applicable.
2268 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
2269 * lread.c (read1): Likewise.
2270 * xsettings.c (syms_of_xsettings): Likewise.
2272 2012-07-12 Glenn Morris <rgm@gnu.org>
2274 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
2275 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
2276 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
2277 * s/hpux10-20.h (RUN_TIME_REMAP):
2278 * s/bsd-common.h (TABDLY): Move to configure.
2280 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
2282 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
2284 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
2285 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
2287 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
2289 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
2290 * s/template.h: Move NARROWPROTO to configure.
2292 2012-07-11 Glenn Morris <rgm@gnu.org>
2294 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
2295 unused since 2011-01-17 change to systty.h.
2297 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
2298 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
2299 Move HAVE_PTYS and HAVE_SOCKETS to configure.
2301 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
2303 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
2305 2012-07-11 Glenn Morris <rgm@gnu.org>
2307 * s/darwin.h, s/gnu-linux.h, s/template.h:
2308 Move INTERRUPT_INPUT to configure.
2310 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2312 Minor adjustments to interning code.
2313 * lisp.h (intern, intern_c_string): Redefine as static inline
2314 wrappers for intern_1 and intern_c_string_1, respectively.
2315 (intern_1, intern_c_string_1): Rename prototypes.
2316 * lread.c (intern_1, intern_c_string_1, oblookup):
2317 Simplify Vobarray checking.
2318 * font.c (font_intern_prop): Likewise. Adjust comment.
2319 * w32font.c (intern_font_name): Likewise.
2321 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
2323 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
2325 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
2326 of Fcar/Fcdr if possible.
2327 * font.c (check_otf_features): Likewise.
2328 * fontset.c (Fnew_fontset): Likewise.
2329 * gnutls.c (Fgnutls_boot): Likewise.
2330 * minibuf.c (read_minibuf): Likewise.
2331 * msdos.c (IT_set_frame_parameters): Likewise.
2332 * xmenu.c (Fx_popup_dialog): Likewise.
2333 * w32menu.c (Fx_popup_dialog): Likewise.
2335 2012-07-11 Glenn Morris <rgm@gnu.org>
2337 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
2338 since nothing has defined it on these platforms.
2340 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
2341 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
2343 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2344 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
2345 Move CLASH_DETECTION to configure.
2347 * s/gnu.h: Remove file, which is now empty.
2349 * s/gnu.h, s/gnu-linux.h:
2350 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
2352 2012-07-11 John Wiegley <johnw@newartisans.com>
2354 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
2355 function attribute, so we only use it if it exists in the
2358 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2360 Avoid call to strlen in fast_c_string_match_ignore_case.
2361 * search.c (fast_c_string_match_ignore_case): Change to use
2362 length argument. Adjust users accordingly.
2363 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
2365 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
2367 Assume mkdir, rmdir.
2368 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
2369 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
2372 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
2375 * s/hpux10-20.h (HAVE_PERROR): Remove.
2376 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
2377 Remove dummy definition, as this problem was obsolete long ago.
2380 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
2382 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2384 Avoid calls to strlen in font processing functions.
2385 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
2386 (font_open_by_name): Change to use length argument.
2387 Adjust users accordingly.
2388 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
2390 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
2391 Change to return ptrdiff_t.
2392 (xfont_list_pattern, xfont_match): Use length returned by
2393 xfont_decode_coding_xlfd.
2394 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
2396 2012-07-11 Glenn Morris <rgm@gnu.org>
2398 * s/darwin.h, s/freebsd.h, s/netbsd.h:
2399 Move DONT_REOPEN_PTY to configure.
2401 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
2402 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
2404 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
2406 Remove "#define unix" that is no longer needed (Bug#11905).
2407 * s/aix4-2.h (unix): Remove; no longer needed.
2409 EMACS_TIME simplification (Bug#11875).
2410 This replaces macros (which typically do not work in GDB)
2411 with functions, typedefs and enums, making the code easier to debug.
2412 The functional style also makes code easier to read and maintain.
2413 * systime.h: Include <sys/time.h> on all hosts, not just if
2414 WINDOWSNT, since 'struct timeval' is needed in general.
2415 (EMACS_TIME): Now a typedef, not a macro.
2416 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
2418 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
2419 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
2420 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
2421 (EMACS_TIME_LE): Now functions, not macros.
2422 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
2423 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
2424 which are not functions. All uses rewritten to use:
2425 (make_emacs_time): New function.
2426 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
2427 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
2428 not functions. All uses rewritten to use the following, respectively:
2429 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
2430 (add_emacs_time, sub_emacs_time): New functions.
2431 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
2432 * fileio.c (Fcopy_file):
2433 * xterm.c (XTflash): Get the current time closer to when it's used.
2434 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
2436 * bytecode.c (targets): Suppress -Woverride-init warnings.
2438 Simplify by avoiding confusing use of strncpy etc.
2439 * doc.c (Fsnarf_documentation):
2440 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
2441 * frame.c (Fmake_terminal_frame):
2442 * gtkutil.c (get_utf8_string):
2444 * nsmenu.m (ns_update_menubar):
2445 * regex.c (regerror):
2446 Prefer memcpy to strncpy and strncat when either will do.
2447 * fileio.c (Fsubstitute_in_file_name):
2448 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
2449 (menu_separator_name_p):
2450 * nsmenu.m (ns_update_menubar):
2451 Prefer memcmp to strncmp when either will do.
2452 * nsterm.m: Include <ftoastr.h>.
2454 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
2455 Prefer snprintf to strncpy.
2456 * nsterm.m (ns_term_init):
2457 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
2458 * nsterm.m (ns_term_init):
2459 Avoid the need for strncpy, by using build_string or
2460 make_unibyte_string directly. Use dtoastr, not snprintf.
2461 * process.c (Fmake_network_process): Diagnose service names that
2462 are too long, rather than silently truncating them or creating
2463 non-null-terminated names.
2464 (Fnetwork_interface_info): Likewise, for interface names.
2465 * sysdep.c (system_process_attributes) [GNU_LINUX]:
2466 Prefer sprintf to strncat.
2467 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
2468 Prefer vsnprintf to vsprintf + strncpy.
2470 2012-07-10 Glenn Morris <rgm@gnu.org>
2472 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
2473 Clarify fallback case.
2475 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2477 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
2478 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
2479 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
2480 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
2481 where argument type is known to be a Lisp_Cons.
2483 2012-07-10 Tom Tromey <tromey@redhat.com>
2485 * bytecode.c (BYTE_CODE_THREADED): New macro.
2486 (BYTE_CODES): New macro. Replaces all old byte-code defines.
2487 (enum byte_code_op): New type.
2488 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
2489 (exec_byte_code): Use them. Use token threading when applicable.
2491 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2493 Optimize pure C strings initialization.
2494 * lisp.h (make_pure_string): Fix prototype.
2495 (build_pure_c_string): New function, defined as static inline. This
2496 provides a better opportunity to optimize away calls to strlen when
2497 the function is called with compile-time constant argument.
2498 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
2499 argument, adjust users accordingly. Use build_pure_c_string where
2501 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
2502 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
2503 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
2505 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2507 Avoid calls to strlen in miscellaneous functions.
2508 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
2509 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
2510 * lread.c (openp): Likewise.
2512 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2514 Avoid calls to strlen in path processing functions.
2515 * fileio.c (file_name_as_directory): Add comment. Change to add
2516 srclen argument and return the length of result. Adjust users
2518 (directory_file_name): Fix comment. Change to add srclen argument,
2519 swap 1st and 2nd arguments to obey the common convention.
2520 Adjust users accordingly.
2521 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
2523 2012-07-10 Glenn Morris <rgm@gnu.org>
2525 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
2526 Move PENDING_OUTPUT_COUNT definition to configure.
2528 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
2529 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
2530 * s/gnu.h (DATA_START): Move definitions to configure.
2532 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
2533 We include usg5-4-common.h, which defines them both.
2535 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
2536 O_RDONLY already includes it).
2538 Stop ns builds setting the EMACSLOADPATH environment variable.
2539 * nsterm.m (ns_load_path): Rename from ns_init_paths.
2540 Now it does not set EMACSLOADPATH, just returns the load-path string.
2541 * nsterm.h: Update accordingly.
2542 * lread.c [HAVE_NS]: Include nsterm.h.
2543 (init_lread) [HAVE_NS]: Use ns_load_path.
2544 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
2546 2012-07-09 Glenn Morris <rgm@gnu.org>
2548 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
2549 since the included bsd-common.h does so.
2551 Stop ns builds setting the EMACSPATH environment variable.
2552 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
2553 (ns_init_paths): Do not set EMACSPATH.
2554 * nsterm.h (ns_exec_path): Add it.
2555 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
2558 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
2560 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
2562 * process.c (wait_reading_process_output): 'waitchannels' was unset
2563 when read_kbd || !NILP (wait_for_cell); fix this.
2565 Add GCC-style 'const' attribute to functions that can use it.
2566 * character.h (char_resolve_modifier_mask):
2567 * keyboard.h (make_ctrl_char):
2568 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
2569 (init_character_once, next_almost_prime, init_fns, init_image)
2570 (flush_pending_output, init_sound):
2571 * mem-limits.h (start_of_data):
2572 * menu.h (finish_menu_items):
2573 Add ATTRIBUTE_CONST.
2574 * emacs.c (DEFINE_DUMMY_FUNCTION):
2575 Declare the dummy function with ATTRIBUTE_CONST.
2576 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
2577 Add decls with ATTRIBUTE_CONST.
2579 Minor improvements to make_formatted_string.
2580 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
2581 where int is good enough, as vsprintf returns an int.
2582 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
2584 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
2586 Use make_formatted_string to avoid double length calculation.
2587 * lisp.h (make_formatted_string): New prototype.
2588 * alloc.c (make_formatted_string): New function.
2589 * buffer.c (Fgenerate_new_buffer_name): Use it.
2590 * dbus.c (syms_of_dbusbind): Likewise.
2591 * editfns.c (Fcurrent_time_zone): Likewise.
2592 * filelock.c (get_boot_time): Likewise.
2593 * frame.c (make_terminal_frame, set_term_frame_name)
2594 (x_report_frame_params): Likewise.
2595 * image.c (gs_load): Likewise.
2596 * minibuf.c (get_minibuffer): Likewise.
2597 * msdos.c (dos_set_window_size): Likewise.
2598 * process.c (make_process): Likewise.
2599 * xdisp.c (ensure_echo_area_buffers): Likewise.
2600 * xsettings.c (apply_xft_settings): Likewise.
2602 2012-07-09 Glenn Morris <rgm@gnu.org>
2604 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
2605 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
2606 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
2607 * nsterm.h (ns_etc_directory): Add it.
2608 * callproc.c [HAVE_NS]: Include nsterm.h.
2609 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
2611 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
2613 Move marker debugging code under MARKER_DEBUG.
2614 * marker.c (MARKER_DEBUG): Move marker debugging code under
2615 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
2616 for bootstrap with --enable-checking (~3x slowdown reported
2617 by Juanma Barranquero <lekktu@gmail.com>).
2618 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
2620 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
2622 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
2623 See <http://bugs.gnu.org/11825#29>.
2625 2012-07-08 Eli Zaretskii <eliz@gnu.org>
2627 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
2628 has no font, use the frame's font. (Bug#11813)
2629 (display_line): Add commentary about displaying truncation glyphs
2631 (produce_special_glyphs): Move here from term.c.
2633 * term.c (produce_special_glyphs): Move to xdisp.c.
2635 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
2638 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
2640 * xdisp.c (display_line): Avoid warning about implicit declaration
2643 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
2645 * lisp.h: Remove empty conditional.
2647 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
2649 * lread.c (load_path_check): Now static.
2651 Fix some minor --with-ns problems found by static checking.
2652 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
2653 (x_set_font) [!HAVE_X_WINDOWS]:
2654 * image.c (xpm_load_image) [HAVE_NS]:
2655 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
2656 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
2657 Remove unused local.
2658 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
2659 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
2660 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
2661 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
2662 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
2663 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
2664 Fix pointer signedness problem.
2665 * xfaces.c (FRAME_X_FONT_TABLE):
2666 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
2668 2012-07-07 Glenn Morris <rgm@gnu.org>
2670 * lread.c (load_path_check): New function, split from init_lread.
2671 (init_lread): Reorganize. Motivation:
2672 If EMACSLOADPATH is set, check/warn about that rather than the
2673 defaults, which we are not going to use. Hence we can remove
2674 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
2675 Don't warn if site-lisp directories are missing.
2676 If not installed, start from a blank load-path, since
2677 PATH_LOADSEARCH refers to the eventual installation directories.
2679 2012-07-07 Eli Zaretskii <eliz@gnu.org>
2681 Support truncation and continuation glyphs on GUI frames, when
2682 fringes are disabled. (Bug#11832)
2683 * xdisp.c (init_iterator): Get dimensions of truncation and
2684 continuation glyphs even if on GUI frames.
2685 Adjust it->last_visible_x on GUI frames when the left or right fringes,
2686 or both, are absent.
2687 (start_display, move_it_in_display_line_to): Handle the case of a
2688 GUI frame without a fringe to display continuation or truncation
2690 (insert_left_trunc_glyphs): Support GUI frames: make sure
2691 truncation glyphs overwrite enough glyphs from the current line to
2692 have sufficient space in pixels.
2693 (display_line): Support truncation and continuation glyphs on GUI
2694 frames. If some spare pixels are left on the line after inserting
2695 the truncation glyphs, fill that space with a stretch glyph of a
2696 suitably computed width.
2698 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
2699 produce_glyphs, to support GUI sessions.
2701 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
2703 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
2705 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
2707 Do not require float-time's arg to fit in time_t (Bug#11825).
2708 This works better on hosts where time_t is unsigned, and where
2709 float-time is applied to the (negative) difference between two times.
2710 * editfns.c (decode_time_components): Last arg is now double *,
2711 not int *, and means to store all the result as a double, without
2712 worrying about whether the seconds part fits in time_t.
2713 All callers changed.
2714 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
2715 All callers changed.
2716 (Ffloat_time): Do not fail merely because the specified time falls
2717 outside of time_t range.
2719 2012-07-07 Glenn Morris <rgm@gnu.org>
2721 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
2722 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
2723 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
2725 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
2727 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
2728 Update dependencies.
2730 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
2732 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
2734 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
2735 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
2736 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
2737 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
2738 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
2739 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
2741 * xfont.c (compare_font_names): Redo to omit the need for casts.
2743 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
2745 * xfns.c (Fx_change_window_property): Doc fix.
2746 * w32fns.c (Fx_change_window_property): Doc fix.
2748 * w32fns.c (Fx_window_property): Accept the same arguments as the
2749 X Windows version. Doc fix.
2750 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
2752 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
2753 Eli Zaretskii <eliz@gnu.org>
2755 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
2756 Windows-specific code from nt/config.nt moved here.
2757 Obsolete settings removed.
2759 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
2761 * process.c: Avoid unnecessary calls to gettime.
2762 (wait_reading_process_output): Don't get the time of day
2763 when gobbling data immediately and not waiting, as there's no need
2764 for it in that case. This removes a FIXME.
2766 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
2768 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
2769 is defined (Bug#11768).
2771 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2773 Fix marker debugging code.
2774 * marker.c (byte_char_debug_check): Do not perform the check
2775 if buffer is not multibyte.
2776 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
2777 Call byte_char_debug_check with correct arguments.
2779 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2781 Compile marker debugging code only if ENABLE_CHECKING is defined.
2782 * marker.c (byte_char_debug_check, count_markers):
2783 Use only if ENABLE_CHECKING is defined.
2784 (byte_debug_flag): Remove.
2785 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
2786 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
2788 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2790 Avoid code repetition in marker-related functions.
2791 * marker.c (attach_marker): New function.
2792 (Fset_marker, set_marker_restricted, set_marker_both)
2793 (set_marker_restricted_both): Use it.
2794 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
2795 Consistently rename charno to charpos.
2796 (marker_position): Add eassert.
2797 (marker_byte_position): Convert to eassert.
2799 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2801 Simplify list operations in unchain_overlay and unchain_marker.
2802 * buffer.c (unchain_overlay): Simplify. Add comment.
2803 * marker.c (unchain_marker): Simplify. Fix comments.
2805 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2807 Introduce fast path for the widely used marker operation.
2808 * alloc.c (build_marker): New function.
2809 * lisp.h (build_marker): New prototype.
2810 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
2811 * composite.c (autocmp_chars): Likewise.
2812 * editfns.c (buildmark): Remove.
2813 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
2814 (save_restriction_save): Use build_marker.
2815 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
2816 * window.c (save_window_save): Likewise.
2818 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2820 Do not use Fdelete_overlay in delete_all_overlays
2821 to avoid redundant calls to unchain_overlay.
2822 * buffer.c (drop_overlay): New function.
2823 (delete_all_overlays, Fdelete_overlay): Use it.
2824 * minibuf.c (get_minibuffer): Fix comment.
2826 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
2828 Port to OpenBSD 5.1 amd64.
2829 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
2830 This is needed for OpenBSD, and should be harmless on all BSD systems.
2831 Also, include <sys/sysctl.h>, as it should be available on all
2832 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
2833 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
2834 use p_pid member, not kp_proc.pid.
2836 2012-07-06 Glenn Morris <rgm@gnu.org>
2838 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
2840 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
2842 More xmalloc and related cleanup.
2843 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
2844 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
2845 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
2846 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
2847 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
2848 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
2849 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
2850 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
2851 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
2853 Omit needless casts involving void * pointers and allocation.
2854 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
2855 as the former is more robust if P's type is changed.
2856 Prefer xzalloc to xmalloc + memset 0.
2857 Simplify malloc-or-realloc to realloc.
2858 Don't worry about xmalloc returning a null pointer.
2859 Prefer xstrdup to xmalloc + strcpy.
2860 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
2862 * keyboard.c (apply_modifiers_uncached): Prefer local array to
2863 alloca of a constant.
2865 2012-07-05 Eli Zaretskii <eliz@gnu.org>
2867 * xdisp.c (display_line): Fix horizontal pixel coordinates when
2868 hscroll is larger than the line width. Fixes long and futile
2869 looping inside extend_face_to_end_of_line (on a TTY) producing
2870 glyphs that are not needed and thrown away.
2872 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
2874 * marker.c (set_marker_restricted_both): Simplify by using
2877 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
2879 * editfns.c (region_limit): Simplify by using clip_to_bounds.
2881 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
2883 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
2884 not defined (Bug#11768).
2885 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
2886 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
2887 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
2888 followed by gtk_box_set_homogeneous (Bug#11768).
2889 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
2890 (update_theme_scrollbar_width, xg_create_scroll_bar):
2891 Use gtk_scrollbar_new (Bug#11768).
2892 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
2893 (is_box_type): New function (Bug#11768).
2894 (xg_tool_item_stale_p): Call is_box_type.
2895 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
2896 with default display (Bug#11768).
2898 2012-07-05 Eli Zaretskii <eliz@gnu.org>
2900 * xdisp.c (window_hscroll_limited): New function.
2901 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
2902 coordinates when window's hscroll is set to insanely large
2905 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
2907 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
2908 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
2910 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
2913 * lisp.h (xzalloc): New prototype. Omit needless casts.
2914 * alloc.c (xzalloc): New function. Omit needless casts.
2915 * charset.c: Omit needless casts. Convert all calls to
2916 xmalloc with following memset to xzalloc.
2917 * dispnew.c: Likewise.
2918 * fringe.c: Likewise.
2919 * image.c: Likewise.
2920 * sound.c: Likewise.
2922 * w32fns.c: Likewise.
2923 * w32font.c: Likewise.
2924 * w32term.c: Likewise.
2925 * xfaces.c: Likewise.
2927 * xterm.c: Likewise.
2928 * atimer.c: Omit needless casts.
2929 * buffer.c: Likewise.
2930 * callproc.c: Likewise.
2932 * coding.c: Likewise.
2933 * composite.c: Likewise.
2935 * doprnt.c: Likewise.
2936 * editfns.c: Likewise.
2937 * emacs.c: Likewise.
2939 * filelock.c: Likewise.
2941 * gtkutil.c: Likewise.
2942 * keyboard.c: Likewise.
2944 * lread.c: Likewise.
2945 * minibuf.c: Likewise.
2946 * msdos.c: Likewise.
2947 * print.c: Likewise.
2948 * process.c: Likewise.
2949 * region-cache.c: Likewise.
2950 * search.c: Likewise.
2951 * sysdep.c: Likewise.
2952 * termcap.c: Likewise.
2953 * terminal.c: Likewise.
2954 * tparam.c: Likewise.
2955 * w16select.c: Likewise.
2957 * w32reg.c: Likewise.
2958 * w32select.c: Likewise.
2959 * w32uniscribe.c: Likewise.
2960 * widget.c: Likewise.
2961 * xdisp.c: Likewise.
2962 * xmenu.c: Likewise.
2964 * xselect.c: Likewise.
2966 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
2968 * fileio.c (time_error_value): Check the right error number.
2969 Problem reported by Troels Nielsen in
2970 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
2972 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
2974 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
2975 This should be fixed in a better way; see Eli Zaretskii in
2976 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
2977 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
2979 * fileio.c (time_error_value): Rename from special_mtime.
2980 The old name's problems were noted by Eli Zaretskii in
2981 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
2983 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
2984 This variable's comment says Emacs needs at least one GDB-visible
2985 symbol of type enum pvec_type, to work around GDB problems.
2986 The symbol's value doesn't matter.
2988 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
2989 that causes compilation to fail on pre-C99 compilers.
2991 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
2993 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
2994 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
2996 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
2998 * buffer.c (init_buffer_once): Fix initialization of
2999 headers for buffer_defaults and buffer_local_symbols.
3000 Reported by Juanma Barranquero <lekktu@gmail.com>.
3002 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
3004 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
3005 * lisp.h (enum pvec_type): Use fewer bits.
3006 (PSEUDOVECTOR_SIZE_BITS): New constant.
3007 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
3008 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
3009 change in pvec_type.
3010 (PSEUDOVECTOR_TYPEP): New macro.
3011 (TYPED_PSEUDOVECTORP): Use it.
3012 * fns.c (internal_equal): Adapt code to extract pvectype.
3013 * emacs.c (gdb_pvec_type): Update type.
3014 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
3015 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
3016 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
3017 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
3018 (sweep_vectors): Use it. Use local var `total_bytes' instead of
3019 abusing vector->header.next.nbytes.
3020 (live_vector_p): Use PVEC_TYPE.
3021 (mark_object): Adapt code to extract pvectype. Use switch.
3023 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3025 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
3026 Tighten new eassert a bit.
3028 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3030 Fix compilation with --enable-gcc-warnings and -O1
3032 * doprnt.c (doprnt): Change type of tem to int, initialize
3033 to avoid compiler warning. Add eassert.
3034 * search.c (simple_search): Initialize match_byte to avoid
3035 compiler warning. Add eassert.
3037 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3039 Avoid weird behavior with large horizontal scrolls.
3040 Without this change, for example, large hscroll values would
3041 mess up Emacs's display on Fedora 15 x86, presumably due to
3042 overflows in int calculations in the display code.
3043 Also, if buffers had long lines, Emacs would freeze.
3044 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
3045 (set_window_hscroll): New function, containing the old guts of
3046 Fset_window_hscroll. Return the clipped value.
3047 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
3048 This avoids the need to check against PTRDIFF_MAX.
3050 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
3052 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3054 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
3056 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3058 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
3059 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
3060 since GCC 4.4.6 issues a bogus warning for them.
3062 Fix bugs in file timestamp newness comparisons.
3063 * fileio.c (Ffile_newer_than_file_p):
3064 * lread.c (Fload): Use full timestamp resolution of files,
3065 not just the 1-second resolution, so that files that are only
3066 slightly newer still count as newer.
3067 * fileio.c (Ffile_newer_than_file_p): Don't assume file
3068 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
3070 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
3072 * fileio.c: Improve handling of file time marker. (Bug#11852)
3073 (special_mtime): New function.
3074 (Finsert_file_contents, Fverify_visited_file_modtime):
3075 Use it to set special mtime values consistently.
3077 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
3079 * fileio.c (Finsert_file_contents): Properly handle st_mtime
3080 marker for non-existing file. (Bug#11852)
3082 2012-07-03 Glenn Morris <rgm@gnu.org>
3084 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
3085 and did not make it into globals.h).
3087 2012-07-03 Tom Tromey <tromey@redhat.com>
3089 * window.c (Fset_window_margins, Fset_window_fringes)
3090 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
3091 * textprop.c (Fprevious_property_change): No longer static.
3092 * syntax.c (Fsyntax_table_p): No longer static.
3093 * process.c (Fget_process, Fprocess_datagram_address): No longer
3095 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
3096 * keyboard.c (Fcommand_execute): No longer static.
3098 * insdel.c (Fcombine_after_change_execute): No longer static.
3099 * image.c (Finit_image_library): No longer static.
3100 * fileio.c (Fmake_symbolic_link): No longer static.
3101 * eval.c (Ffetch_bytecode): No longer static.
3102 * editfns.c (Fuser_full_name): No longer static.
3103 * doc.c (Fdocumentation_property, Fsnarf_documentation):
3105 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
3107 * dired.c (Ffile_attributes): No longer static.
3108 * composite.c (Fcomposition_get_gstring): No longer static.
3109 * callproc.c (Fgetenv_internal): No longer static.
3111 * ccl.h: Remove EXFUNs.
3112 * buffer.h: Remove EXFUNs.
3113 * dispextern.h: Remove EXFUNs.
3114 * intervals.h: Remove EXFUNs.
3115 * fontset.h: Remove EXFUN.
3116 * font.h: Remove EXFUNs.
3117 * dosfns.c (system_process_attributes): Remove EXFUN.
3118 * keymap.h: Remove EXFUNs.
3119 * lisp.h: Remove EXFUNs.
3120 * w32term.h: Remove EXFUNs.
3121 * window.h: Remove EXFUNs.
3122 * xsettings.h: Remove EXFUN.
3123 * xterm.h: Remove EXFUN.
3125 2012-07-03 Glenn Morris <rgm@gnu.org>
3127 * lisp.h (Frandom): Make it visible to C.
3128 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
3129 buffer for invisible buffers. (Bug#1229)
3131 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3133 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
3134 values which aren't power of 2.
3135 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
3136 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
3139 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
3141 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
3143 * alloc.c (mark_object): Revert part of last patch to use `switch'.
3145 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3147 * alloc.c (allocate_vector_block): Remove redundant
3148 calls to mallopt if DOUG_LEA_MALLOC is defined.
3149 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
3150 avoid calls to mallopt if zero_vector is returned.
3152 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3154 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
3155 is enabled, avoid dereferencing NULL current_sblock if
3158 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3160 Cleanup basic buffer management.
3161 * buffer.h (struct buffer): Change layout to use generic vector
3162 marking code. Fix some comments. Change type of 'clip_changed'
3163 to bitfield. Remove unused #ifndef old.
3164 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
3165 (GET_OVERLAYS_AT): Fix indentation.
3166 (for_each_per_buffer_object_at): New macro.
3167 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
3168 (Fbuffer_local_variables): Use it.
3169 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
3170 * alloc.c (allocate_buffer): Adjust to match new layout of
3171 struct buffer. Fix comment.
3172 (mark_overlay): New function.
3173 (mark_buffer): Use it. Use mark_vectorlike to mark normal
3174 Lisp area of struct buffer.
3175 (mark_object): Use it. Adjust marking of misc objects
3176 and related comments.
3178 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
3180 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
3181 wrapper that is not needed because the wrapped code is a no-op (zero
3182 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
3183 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
3185 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
3187 * alloc.c (mark_buffer): Simplify. Remove prototype.
3188 (mark_object): Add comment. Reorganize marking of vector-like
3189 objects. Use CHECK_LIVE for all vector-like objects except buffers
3190 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
3191 Avoid redundant calls to mark_vectorlike for bool vectors.
3193 2012-06-30 Glenn Morris <rgm@gnu.org>
3195 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
3197 * epaths.in (PATH_SITELOADSEARCH): New.
3198 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
3199 This is rather than relying on --enable-locallisppath elements
3200 having "site-lisp" in their names. (Bug#10208#25, 11658)
3202 2012-06-30 Eli Zaretskii <eliz@gnu.org>
3204 * w32proc.c (sys_select): Accept and ignore one more argument.
3206 * w32.c (emacs_gnutls_pull): Call select with one more argument.
3208 * sysselect.h [DOS_NT]: Don't include sys/select.h.
3209 (pselect) [!MS_DOS]: Redirect to sys_select.
3211 * sysdep.c: Don't include dos.h and dosfns.h.
3213 * process.c (sys_select):
3214 * msdos.c (sys_select): Accept one more argument and ignore it.
3216 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
3217 adapt data types and code to that.
3220 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
3221 which clashes with the gnulib function of the same name.
3223 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
3225 * font.c (font_style_to_value, font_style_symbolic)
3226 (font_prop_validate_style): Add type checks for values in
3229 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
3231 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
3234 2012-06-29 Eli Zaretskii <eliz@gnu.org>
3236 * xdisp.c (try_window_id): Undo last change.
3238 * w32.c (getwd): Adjust commentary about startup_dir.
3239 (init_environment): Always call sys_access, even in non-MSVC
3240 builds. Don't chdir to the directory of the Emacs executable.
3241 This undoes code from 1997 which was justified by the need to
3242 "avoid conflicts when removing and renaming directories". But its
3243 downside was that every relative file name was being interpreted
3244 relative to the directory of the Emacs executable, which can never
3245 be TRT. In particular, it broke sys_access when called with
3246 relative file names.
3247 (sys_access): Map GetLastError to errno.
3249 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3251 * window.h (struct window): Change type of 'fringes_outside_margins'
3252 to bitfield. Fix comment. Adjust users accordingly.
3253 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
3255 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
3258 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
3260 * gnutls.c (emacs_gnutls_handshake):
3261 Add QUIT to make the loop interruptible.
3263 2012-06-29 Glenn Morris <rgm@gnu.org>
3265 * charset.c (init_charset): Make lack of etc/charsets fatal.
3267 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3269 * editfns.c (region_limit): Fix type mismatch.
3271 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3273 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
3274 undefined. Convert from xassert to eassert.
3275 * nsmenu.m: Convert from xassert to eassert.
3276 * nsterm.m: Likewise.
3278 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
3280 * editfns.c (region_limit): Clip to narrowing (bug#11770).
3282 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
3284 Avoid integer overflow on scroll-left and scroll-right.
3285 * window.c (HSCROLL_MAX): New macro.
3286 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
3287 overflow when requested scroll falls outside ptrdiff_t range.
3289 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3291 * window.h (struct window): Change type of 'hscroll',
3292 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
3293 'last_modified' and 'last_overlay_modified' to EMACS_INT.
3294 Adjust users accordingly.
3295 * xdisp.c (try_cursor_movement): Replace type check with eassert.
3296 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
3297 from EMACS_INT to ptrdiff_t.
3298 (make_window): Omit redundant initialization.
3300 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
3302 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
3304 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3306 * window.h (struct window): Change type of 'use_time' and
3307 'sequence_number' from Lisp_Object to int.
3308 * frame.c (make_frame): Adjust users accordingly.
3309 * print.c (print_object): Likewise.
3310 * window.c (select_window, Fwindow_use_time, make_parent_window)
3311 (make_window): Likewise.
3313 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3315 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
3316 enabled with --enable-checking=[all,glyphs] configure option.
3317 Fix GLYPH_DEBUG usage assuming that it may be undefined,
3318 adjust comments accordingly.
3319 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
3320 undefined, adjust comments accordingly.
3321 * image.c: Likewise.
3322 * scroll.c: Likewise.
3323 * w32fns.c: Likewise.
3324 * w32term.c: Likewise.
3325 * xdisp.c: Likewise.
3326 * xfaces.c: Likewise.
3328 * xterm.c: Likewise.
3330 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3332 Generalize run-time debugging checks.
3333 * dispextern.h (XASSERTS): Remove.
3334 * fontset.c (xassert): Remove.
3335 Convert from xassert to eassert.
3336 * alloc.c: Convert from xassert to eassert.
3338 * dispnew.c: Likewise.
3340 * fringe.c: Likewise.
3341 * ftfont.c: Likewise.
3342 * gtkutil.c: Likewise.
3343 * image.c: Likewise.
3344 * keyboard.c: Likewise.
3346 * process.c: Likewise.
3347 * scroll.c: Likewise.
3348 * sound.c: Likewise.
3350 * w32console.c: Likewise.
3351 * w32fns.c: Likewise.
3352 * w32term.c: Likewise.
3353 * window.c: Likewise.
3354 * xdisp.c: Likewise.
3355 * xfaces.c: Likewise.
3357 * xselect.c: Likewise.
3358 * xterm.c: Likewise.
3360 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
3362 * fns.c (maybe_resize_hash_table): Output message when growing the
3365 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3367 * alloc.c (allocate_string_data): Remove dead code.
3368 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
3369 avoid GCC warning about unused macro.
3371 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3373 * alloc.c (allocate_string): Omit intervals initialization.
3374 * alloc.c (make_uninit_multibyte_string): Initialize intervals
3375 as in make_pure_string and make_pure_c_string.
3377 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3379 * alloc.c (allocate_string): Fix last change.
3381 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3383 * alloc.c (allocate_string): Remove two redundant calls
3384 to memset, add explicit initialization where appropriate.
3386 2012-06-27 Glenn Morris <rgm@gnu.org>
3388 * lisp.mk (lisp): Remove paths.elc.
3390 2012-06-27 Chong Yidong <cyd@gnu.org>
3392 * doc.c (Fsubstitute_command_keys): Fix punctuation.
3394 2012-06-26 John Wiegley <johnw@newartisans.com>
3396 * unexmacosx.c (copy_data_segment): Add two section names used
3397 on Mac OS X Lion: __mod_init_func and __mod_term_func.
3399 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
3400 when building with Clang.
3402 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
3404 * eval.c (Fapply): Allow calling it with a single argument.
3406 2012-06-26 Eli Zaretskii <eliz@gnu.org>
3408 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
3409 _stricmp and _strnicmp.
3410 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
3412 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3414 * alloc.c (allocate_window): Zero out non-Lisp part of newly
3416 (allocate_process): Likewise for new process.
3417 (allocate_terminal): Change to use offsetof.
3418 (allocate_frame): Likewise.
3419 * frame.c (make_frame): Omit redundant initialization.
3420 * window.c (make_parent_window): Use memset.
3421 (make_window): Omit redundant initialization.
3422 * process.c (make_process): Omit redundant initialization.
3423 * terminal.c (create_terminal): Likewise.
3425 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3427 * term.c (delete_tty): Remove redundant call to memset.
3429 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3431 * alloc.c: Remove build_string.
3432 * lisp.h: Define build_string as static inline. This provides
3433 a better opportunity to optimize away calls to strlen when the
3434 function is called with compile-time constant argument.
3435 * image.c (imagemagick_error): Convert to build_string.
3436 * w32proc.c (sys_spawnve): Likewise.
3437 * xterm.c (x_term_init): Likewise.
3439 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
3441 Use sprintf return value instead of invoking strlen on result.
3442 In the old days this wasn't portable, since some sprintf
3443 implementations returned char *. But they died out years ago and
3444 Emacs already assumes sprintf returns int.
3445 Similarly for float_to_string.
3446 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
3447 * ccl.c (ccl_driver):
3448 * character.c (string_escape_byte8):
3449 * data.c (Fnumber_to_string):
3450 * doprnt.c (doprnt):
3451 * print.c (print_object):
3452 * xdisp.c (message_dolog):
3453 * xfns.c (syms_of_xfns):
3454 Use sprintf or float_to_string result to avoid need to call strlen.
3455 * data.c (Fnumber_to_string):
3456 Use make_unibyte_string, since the string must be ASCII.
3457 * lisp.h, print.c (float_to_string): Now returns int length.
3458 * term.c (produce_glyphless_glyph):
3459 Use sprintf result rather than recomputing it.
3461 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
3462 * Makefile.in (ALL_CFLAGS):
3463 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
3464 * gmalloc.c, regex.c: Include <config.h> unconditionally.
3466 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
3468 * dispextern.h (xstrcasecmp): Define to library function
3469 strcasecmp if available.
3470 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
3472 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
3474 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
3475 Avoid comma operator.
3476 * menu.c (push_submenu_start, push_submenu_end)
3477 (push_left_right_boundary, push_menu_pane): Likewise.
3478 * msdos.c (dos_rawgetc): Likewise.
3480 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
3482 * xfns.c (xic_create_fontsetname): Remove redundant calls
3485 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
3487 * gtkutil.c (get_utf8_string): Remove redundant assignment.
3488 sprintf already null-terminates its output.
3490 * xfns.c (x_window): Remove redundant cast.
3492 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
3494 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
3495 `const char *' to `char *' to avoid compiler warning.
3497 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
3499 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
3500 instead of truncating it to 63 (admittedly a generous limit).
3502 * process.c: Fix spelling and caps in comments.
3504 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
3506 * emacs.c (setpgrp): Remove definition, unused.
3507 * sysdep.c (setpgrp): Remove definition, not used in this file.
3509 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
3511 * makefile.w32-in: Update dependencies.
3513 2012-06-24 Eli Zaretskii <eliz@gnu.org>
3515 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
3516 (SYSTIME_H): Add nt/inc/sys/time.h.
3518 * systime.h [WINDOWSNT]: Include sys/time.h.
3520 * s/ms-w32.h (struct timespec): Definition moved from
3521 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
3523 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
3525 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
3526 * buffer.h (buffer_slot_type_mismatch):
3527 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
3528 * eval.c (unwind_to_catch):
3529 * image.c (my_png_error, my_error_exit):
3530 * keyboard.c (quit_throw_to_read_char, user_error)
3531 (Fexit_recursive_edit, Fabort_recursive_edit):
3532 * lisp.h (die, args_out_of_range, args_out_of_range_3)
3533 (wrong_type_argument, buffer_overflow, __executable_start)
3534 (memory_full, buffer_memory_full, string_overflow, Fthrow)
3535 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
3536 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
3538 (child_setup) [!DOS_NT]:
3539 * lread.c (end_of_file_error, invalid_syntax):
3540 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
3541 * puresize.h (pure_write_error):
3542 * search.c (matcher_overflow):
3543 * sound.c (sound_perror, alsa_sound_perror):
3544 * sysdep.c, syssignal.h (croak):
3545 * term.c (maybe_fatal, vfatal):
3546 * textprop.c (text_read_only):
3547 * undo.c (user_error):
3548 * unexmacosx.c (unexec_error):
3549 * xterm.c (x_ins_del_lines, x_delete_glyphs):
3550 Use _Noreturn rather than NO_RETURN.
3551 No need for separate decl merely because of _Noreturn.
3552 * sound.c (sound_warning, parse_sound):
3553 Remove unnecessary forward decls.
3555 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
3557 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
3558 * lisp.h (WAIT_READING_MAX): New macro.
3559 * dispnew.c (Fsleep_for, sit_for):
3560 * keyboard.c (kbd_buffer_get_event):
3561 * process.c (Faccept_process_output):
3562 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
3563 This improves on the previous patch, which introduced a bug
3564 when time_t is unsigned and as wide as intmax_t.
3565 See <http://bugs.gnu.org/9000#51>.
3567 2012-06-23 Eli Zaretskii <eliz@gnu.org>
3569 * dispnew.c (sit_for, Fsleep_for):
3570 * keyboard.c (kbd_buffer_get_event):
3571 * process.c (Faccept_process_output): Avoid compiler warnings when
3572 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
3574 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
3576 * makefile.w32-in: Update dependencies.
3578 * w32.c (ltime): Add return type and declare static.
3579 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
3581 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
3583 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
3584 Privately reported by Herbert J. Skuhra.
3585 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
3587 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
3588 not make_lisp_timeval, when the argument is of type EMACS_TIME.
3590 2012-06-23 Eli Zaretskii <eliz@gnu.org>
3592 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
3593 last argument of make_unibyte_string.
3595 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
3596 language ID in the event parameters.
3598 * w32term.c (w32_read_socket): Put the new keyboard codepage into
3599 event.code, not the obscure "character set ID".
3601 2012-06-23 Chong Yidong <cyd@gnu.org>
3603 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
3605 2012-06-23 Eli Zaretskii <eliz@gnu.org>
3607 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
3608 * w32.c (fdutimens): New function.
3610 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
3612 * s/ms-w32.h (pselect): Redirect to sys_select.
3614 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
3616 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
3617 in the logic of incrementing and decrementing the value of
3618 use_relocatable_buffers.
3620 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
3622 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
3623 Privately reported by Herbert J. Skuhra.
3624 [__FreeBSD__]: Remove "*/" typo after "#include".
3625 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
3626 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
3627 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
3628 Don't assume EMACS_TIME and struct timeval are the same type.
3630 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
3632 Support higher-resolution time stamps (Bug#9000).
3633 The time stamps are only nanosecond-resolution at the C level,
3634 since that's the best that any real-world system supports now.
3635 But they are picosecond-resolution at the Lisp level, as that's
3636 easy, and leaves room for future OS improvements.
3638 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
3641 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
3642 Don't get current time unless it's needed.
3644 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
3645 now provides it if it's absent.
3646 (start_atimer): Port to higher-res time stamps.
3647 Check for time stamp overflow. Don't get current time more
3648 often than is needed.
3650 * buffer.h (struct buffer): Buffer modtime now has high resolution.
3651 Include systime.h, not time.h.
3652 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
3654 * dired.c: Include stat-time.h.
3655 (Ffile-attributes): File times now have higher resolution.
3657 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
3658 (struct image): Timestamp now has higher resolution.
3660 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
3661 has at least microseconds now. All uses removed.
3662 (update_frame, update_single_window, update_window, update_frame_1)
3663 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
3664 (duration_to_sec_usec): Remove; no longer needed.
3666 * editfns.c (time_overflow): Now extern.
3667 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
3668 (float-time, Fformat_time_string, Fcurrent_time_string)
3669 (Fcurrent_time_zone): Accept and generate higher-resolution
3671 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
3672 (decode_time_components, lisp_seconds_argument): New functions.
3673 (make_time): Now static.
3674 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
3675 Report an error if the time is invalid, rather than having the caller
3678 * fileio.c: Include <stat-time.h>
3679 (Fcopy_file): Copy higher-resolution time stamps.
3680 Prefer to set the time stamp via a file descriptor if that works.
3681 (Fset_file_times, Finsert_file_contents, Fwrite_region)
3682 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
3683 (Fvisited_file_modtime, Fset_visited_file_modtime):
3684 Support higher-resolution time stamps.
3686 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
3688 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
3690 * image.c (prepare_image_for_display, clear_image_cache)
3691 (lookup_image): Port to higer-resolution time stamps.
3693 * keyboard.c (start_polling, bind_polling_period):
3694 Check for time stamp overflow.
3695 (read_char, kbd_buffer_get_event, timer_start_idle)
3696 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
3697 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
3698 Port to higher-resolution time stamps. Do not assume time_t is signed.
3699 (decode_timer): New function. Timers are now vectors of length 9,
3700 not 8, to accommodate the picosecond component.
3701 (timer_check_2): Use it.
3703 * nsterm.m (select_timeout, timeval_subtract): Remove.
3704 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
3705 as they're a bit more accurate and handle overflow better.
3706 (ns_select): Change prototype to be compatible with pselect.
3707 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
3708 * nsterm.h (ns_select): Adjust prototype.
3710 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
3711 us-resolution time stamps.
3712 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
3714 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
3716 * lisp.h (time_overflow): New decl.
3717 (wait_reading_process_output): First arg is now intmax_t, not int,
3718 to accommodate larger waits.
3720 * process.h (struct Lisp_Process.read_output_delay):
3721 Now counts nanoseconds, not microseconds.
3722 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
3724 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
3725 (wait_reading_process_output):
3726 Port to ns-resolution time stamps.
3727 (Faccept_process_output, wait_reading_process_output):
3728 Check for time stamp overflow. Do not assume time_t is signed.
3729 (select_wrapper): Remove; we now use pselect.
3730 (Fprocess_attributes): Now generates ns-resolution time stamps.
3732 * sysdep.c: Include utimens.h. Don't include utime.h
3733 or worry about struct utimbuf; gnulib does that for us now.
3734 (gettimeofday): Remove; gnulib provides a substitute.
3735 (make_timeval): New function.
3736 (set_file_times): Now sets ns-resolution time stamps.
3737 New arg FD; all uses changed.
3738 (time_from_jiffies, ltime_from_jiffies, get_up_time)
3739 (system_process_attributes):
3740 Now returns ns-resolution time stamp. All uses changed.
3741 Check for time stamp overflow.
3743 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
3744 provides a substitute now.
3746 * systime.h: Include timespec.h rather than sys/time.h and time.h,
3747 since it guarantees struct timespec.
3748 (EMACS_TIME): Now struct timespec, so that we can support
3749 ns-resolution time stamps.
3750 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
3751 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
3752 (EMACS_USECS): Remove.
3753 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
3754 so multiply the arg by 1000 before storing it.
3755 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
3757 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
3758 Port to ns-resolution time stamps.
3759 (EMACS_TIME_NEG_P): Remove; replaced by....
3760 (EMACS_TIME_SIGN): New macro.
3761 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
3762 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
3763 (set_file_times, make_time, lisp_time_argument): Adjust signature.
3764 (make_timeval, make_lisp_time, decode_time_components): New decls.
3765 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
3766 that it mishandled time_t overflow. You can't compare by subtracting!
3767 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
3768 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
3770 * term.c: Include <sys/time.h>.
3771 (timeval_to_Time): New function, for proper overflow wraparound.
3772 (term_mouse_position, term_mouse_click): Use it.
3774 * undo.c (record_first_change): Support higher-resolution time stamps
3776 (Fprimitive_undo): Use them when restoring time stamps.
3778 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
3779 (w32_get_internal_run_time):
3780 Port to higher-resolution Emacs time stamps.
3781 (ltime): Now accepts single 64-bit integer, as that's more convenient
3784 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
3786 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
3787 for compatibility with pselect. Support ns-resolution time stamps.
3789 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
3791 * xselect.c (wait_for_property_change, x_get_foreign_selection):
3792 Check for time stamp overflow, and support ns-resolution time stamps.
3794 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
3795 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
3796 (timeval_subtract): Remove; no longer needed.
3797 (XTflash, XTring_bell, x_wait_for_event):
3798 Port to ns-resolution time stamps. Don't assume time_t is signed.
3800 2012-06-22 Chong Yidong <cyd@gnu.org>
3802 * xdisp.c (x_consider_frame_title): Revert last change.
3804 2012-06-22 Eli Zaretskii <eliz@gnu.org>
3806 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
3807 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
3808 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
3809 staticidx goes up to 1597 out of 1600 = 0x640.)
3811 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
3813 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
3814 Otherwise, the umask might be mistakenly 0 while handling input signals.
3816 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
3818 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
3820 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
3822 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
3823 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
3824 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
3825 access to `contents' member of Lisp_Vector objects with AREF and ASET
3828 2012-06-19 Chong Yidong <cyd@gnu.org>
3830 * frame.c (delete_frame): When selecting a frame on a different
3831 text terminal, do not alter the terminal's top-frame.
3833 * xdisp.c (format_mode_line_unwind_data): Record the target
3834 frame's selected window and its terminal's top-frame.
3835 (unwind_format_mode_line): Restore them.
3836 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
3838 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
3839 since tty frames can be explicitly named.
3840 (prepare_menu_bars): Likewise.
3842 * term.c (Ftty_top_frame): New function.
3844 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
3846 Port byte-code-meter to modern targets.
3847 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
3848 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
3849 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
3850 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
3851 (METER_1, METER_2): Simplify.
3853 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
3855 * data.c (Fdefalias): Return `symbol' (bug#11686).
3857 2012-06-18 Martin Rudalics <rudalics@gmx.at>
3859 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
3860 gets killed during executing of this function (Bug#11665).
3861 Try to always return Qt when the buffer has been actually killed.
3862 (Vkill_buffer_query_functions): In doc-string say that functions
3863 run by this hook should not change the current buffer.
3865 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
3867 Fix recently-introduced process.c problems found by static checking.
3868 * process.c (write_queue_push, write_queue_pop, send_process):
3869 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
3870 (write_queue_pop): Fix pointer signedness problem.
3871 (send_process): Remove unused local.
3873 2012-06-17 Chong Yidong <cyd@gnu.org>
3875 * xdisp.c (redisplay_internal): No need to redisplay terminal
3876 frames that are not on top.
3878 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
3880 * process.c (make_process): Initialize write_queue.
3881 (write_queue_push, write_queue_pop): New functions.
3882 (send_process): Use them to maintain correct ordering of process
3885 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
3887 * lisp.h (eassert): Assume C89 or later.
3888 This removes the need for CHECK.
3889 (CHECK): Remove. Its comments about always evaluating its
3890 argument were confusing, as 'eassert' typically does not evaluate
3893 * coding.c (produce_chars): Use ptrdiff_t, not int.
3895 * xterm.c (x_draw_underwave): Check for integer overflow.
3896 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
3898 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
3900 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
3901 referenced (Bug#11583).
3903 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
3905 Implement wave-style variant of underlining.
3906 * dispextern.h (face_underline_type): New enum.
3907 (face): Add field for underline type.
3908 * nsterm.m (ns_draw_underwave): New function.
3909 (ns_draw_text_decoration): Use it.
3910 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
3912 (x_draw_glyph_string): Use them.
3913 * xfaces.c (Qline, Qwave): New Lisp objects.
3914 (check_lface_attrs, merge_face_ref)
3915 (Finternal_set_lisp_face_attribute, realize_x_face):
3916 Handle wave-style underline face attributes.
3917 * xterm.c (x_draw_underwave): New function.
3918 (x_draw_glyph_string): Use it.
3920 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
3922 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
3923 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
3924 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
3925 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
3926 ($(BLD)/w32select.$(O)): Update dependencies.
3928 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
3930 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
3931 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
3932 * character.c (_fetch_multibyte_char_p): Remove.
3933 * alloc.c: Include "character.h" before "buffer.h".
3935 * buffer.c: Likewise.
3936 * bytecode.c: Likewise.
3937 * callint.c: Likewise.
3938 * callproc.c: Likewise.
3939 * casefiddle.c: Likewise.
3940 * casetab.c: Likewise.
3941 * category.c: Likewise.
3943 * coding.c: Likewise.
3944 * composite.c: Likewise.
3945 * dired.c: Likewise.
3946 * dispnew.c: Likewise.
3948 * dosfns.c: Likewise.
3949 * editfns.c: Likewise.
3950 * emacs.c: Likewise.
3951 * fileio.c: Likewise.
3952 * filelock.c: Likewise.
3954 * fontset.c: Likewise.
3955 * fringe.c: Likewise.
3956 * indent.c: Likewise.
3957 * insdel.c: Likewise.
3958 * intervals.c: Likewise.
3959 * keyboard.c: Likewise.
3960 * keymap.c: Likewise.
3961 * lread.c: Likewise.
3962 * macros.c: Likewise.
3963 * marker.c: Likewise.
3964 * minibuf.c: Likewise.
3965 * nsfns.m: Likewise.
3966 * nsmenu.m: Likewise.
3967 * print.c: Likewise.
3968 * process.c: Likewise.
3969 * regex.c: Likewise.
3970 * region-cache.c: Likewise.
3971 * search.c: Likewise.
3972 * syntax.c: Likewise.
3974 * textprop.c: Likewise.
3976 * unexsol.c: Likewise.
3977 * w16select.c: Likewise.
3978 * w32fns.c: Likewise.
3979 * w32menu.c: Likewise.
3980 * window.c: Likewise.
3981 * xdisp.c: Likewise.
3983 * xmenu.c: Likewise.
3985 * xselect.c: Likewise.
3987 2012-06-16 Eli Zaretskii <eliz@gnu.org>
3989 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
3990 If all the glyphs of the glyph row came from strings, and we have no
3991 cursor positioning clues, put the cursor on the first glyph of the
3993 (handle_face_prop): Use chunk-relative overlay string index when
3994 indexing into it->string_overlays array. (Bug#11653)
3995 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
3996 the rightmost. (Bug#11720)
3998 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
4000 * category.h (CHAR_HAS_CATEGORY): Define as inline.
4001 (CATEGORY_MEMBER): Enforce 1/0 value.
4002 * category.c (_temp_category_set): Remove.
4004 2012-06-16 Eli Zaretskii <eliz@gnu.org>
4006 * window.c (Fdelete_other_windows_internal)
4007 (Fdelete_window_internal): Don't access frame's mouse highlight
4008 info of the initial frame. (Bug#11677)
4010 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
4012 * .gdbinit (xgetint): Fix recently-introduced paren typo.
4013 Assume USE_2_TAGS_FOR_INTS.
4014 (xreload): Adjust $tagmask width to match recent lisp.h change.
4016 Simplify lisp.h in minor ways that should not affect code.
4017 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
4018 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
4019 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
4020 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
4021 (INTTYPEBITS): New macro, for clarity.
4022 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
4023 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
4024 Simplify now that USE_LSB_TAG is always defined.
4025 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
4026 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
4028 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
4030 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
4032 2012-06-13 Glenn Morris <rgm@gnu.org>
4034 * s/bsd-common.h (BSD4_3):
4035 * s/usg5-4-common.h (USG5_4): No longer define; unused.
4037 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
4039 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
4042 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
4044 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
4045 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
4046 * alloc.c (widen_to_Lisp_Object): Remove.
4047 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
4048 * frame.c (delete_frame): Remove outdated comment.
4049 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
4050 USE_LISP_UNION_TYPE.
4051 (Fw32_unregister_hot_key): Likewise.
4052 (Fw32_toggle_lock_key): Likewise.
4053 * w32menu.c (add_menu_item): Likewise.
4054 (w32_menu_display_help): Use XIL instead of checking
4055 USE_LISP_UNION_TYPE.
4056 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
4057 (init_heap): Likewise.
4058 * w32term.c (w32_read_socket): Update comment.
4060 2012-06-13 Glenn Morris <rgm@gnu.org>
4062 * s/usg5-4-common.h, src/s/unixware.h:
4063 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
4065 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
4067 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
4069 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
4070 * alloc.c (make_number) [!defined make_number]:
4071 Remove, as lisp.h always defines this now.
4072 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
4073 (roundup_size): Verify that it is a power of 2.
4074 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
4075 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
4076 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
4077 -DUSE_LSB_TAG=0, to override the automatically-selected default.
4078 USE_LSB_TAG now is always defined to be either 0 or 1.
4080 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
4081 code works fine either way, and efficiency is not a concern here,
4082 as the union type is for debugging, not for production.
4083 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
4084 Use an inline function on all platforms when using the union type,
4085 since this is simpler and 'static inline' can be used portably
4087 (LISP_INITIALLY_ZERO): New macro.
4088 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
4089 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
4091 2012-06-12 Glenn Morris <rgm@gnu.org>
4093 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
4095 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
4097 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
4098 Move BROKEN_SIGIO to configure.
4100 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
4101 Move NO_TERMIO to configure.
4103 2012-06-12 Chong Yidong <cyd@gnu.org>
4105 * image.c (imagemagick_load_image): Use MagickFlattenImage if
4106 MagickMergeImageLayers is undefined. Use pixel pusher loop if
4107 MagickExportImagePixels is undefined.
4109 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
4111 * image.c (imagemagick_load_image): Remove unused label.
4113 2012-06-11 Glenn Morris <rgm@gnu.org>
4115 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4116 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
4117 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
4118 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
4120 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
4122 * alloc.c (make_byte_code): New function.
4123 (Fmake_byte_code): Use it. Don't purify here.
4124 * lread.c (read1): Use it as well to avoid extra allocation.
4126 2012-06-11 Chong Yidong <cyd@gnu.org>
4128 * image.c (imagemagick_load_image): Implement transparency.
4130 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
4132 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
4133 account for preceding backslashes. (Bug#11663)
4135 2012-06-09 Chong Yidong <cyd@gnu.org>
4137 * term.c: Support italics in capable terminals (Bug#9652).
4138 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
4139 (turn_on_face): Output using TS_enter_italic_mode if available.
4140 Don't handle unused blinking and alt-charset cases.
4141 (turn_off_face): Handle italic case; discard unused tty_blinking_p
4142 and tty_alt_charset_p cases.
4143 (tty_capable_p, init_tty): Support italics.
4145 * termchar.h (struct tty_display_info): Add field for italics.
4146 Remove unused blink field.
4148 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
4151 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
4152 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
4153 tty_alt_charset_p. Add tty_italic_p.
4155 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
4157 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
4158 dbus_type_is_basic if available.
4159 (xd_extract_signed, xd_extract_unsigned): Rename from
4160 extract_signed and extract_unsigned, respectively. Adapt callers.
4162 2012-06-09 Chong Yidong <cyd@gnu.org>
4164 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
4166 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
4169 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
4171 * xdisp.c (vmessage): Treat frame message as multibyte.
4172 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
4173 would generate the diagnostic "Making \302\247 buffer-local while
4176 2012-06-08 Eli Zaretskii <eliz@gnu.org>
4178 * dispnew.c (showing_window_margins_p): Undo last change, which
4179 was done due to an inadvertent commit.
4180 (adjust_frame_glyphs_for_frame_redisplay): Do call
4181 showing_window_margins_p.
4183 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
4185 * eval.c (Fmake_var_non_special): New primitive.
4186 (syms_of_eval): Defsubr it.
4187 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
4189 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
4191 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
4192 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
4194 2012-06-08 Eli Zaretskii <eliz@gnu.org>
4196 * alloc.c (allocate_vectorlike): Fix last change.
4198 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
4200 Block-based vector allocation of small vectors.
4201 * lisp.h (struct vectorlike_header): New field `nbytes',
4202 adjust comment accordingly.
4203 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
4204 to denote vector blocks. Adjust users (live_vector_p,
4205 mark_maybe_pointer, valid_lisp_object_p) accordingly.
4206 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
4207 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
4208 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
4209 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
4210 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
4211 (roundup_size): New constant.
4212 (struct vector_block): New data type.
4213 (vector_blocks, vector_free_lists, zero_vector): New variables.
4214 (all_vectors): Rename to `large_vectors'.
4215 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
4216 (sweep_vectors): New functions.
4217 (allocate_vectorlike): Return `zero_vector' as the only vector of
4218 0 items. Allocate new vector from block if vector size is less than
4219 or equal to VBLOCK_BYTES_MAX.
4220 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
4221 (init_alloc_once): Add call to init_vectors.
4223 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
4225 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
4227 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
4229 * doprnt.c (doprnt): Truncate multibyte char correctly.
4230 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
4231 would mishandle a string argument "Xc" if X was a multibyte
4232 character of length 2: it would truncate after X's first byte
4233 rather than including all of X.
4235 2012-06-06 Chong Yidong <cyd@gnu.org>
4237 * buffer.c (word_wrap): Doc fix.
4239 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
4241 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
4243 2012-06-03 Glenn Morris <rgm@gnu.org>
4245 * xdisp.c (tool-bar-style): Doc fix.
4247 2012-06-03 Ulrich Müller <ulm@gentoo.org>
4249 * Makefile.in (PAXCTL): Define.
4250 (temacs$(EXEEXT)): Disable memory randomization for the temacs
4251 binary via PaX flags if the paxctl utility is available.
4252 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
4253 Restore PaX flags to their default. (Bug#11398)
4255 2012-06-03 Chong Yidong <cyd@gnu.org>
4257 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
4260 2012-06-03 Chong Yidong <cyd@gnu.org>
4262 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
4263 (note_mode_line_or_margin_highlight): If there is no help echo,
4264 use mode-line-default-help-echo. Handle the case where the mouse
4265 position is past the end of the mode line string.
4267 * buffer.c (buffer_local_value_1): New function, split from
4268 Fbuffer_local_value; can return Qunbound.
4269 (Fbuffer_local_value): Use it.
4270 (Vmode_line_format): Docstring tweaks.
4272 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
4274 * sysdep.c (system_process_attributes): Improve comment.
4276 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
4278 * keyboard.c: Export real-this-command to Elisp.
4279 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
4280 and DEFVAR it. Update all users.
4282 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
4284 * minibuf.c (Fassoc_string): Remove duplicate declaration.
4286 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
4287 Convert pctcpu and pctmem to Lisp float properly.
4288 Let the compiler fold better, as 100.0/0x8000 is exact.
4290 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
4292 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
4295 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
4297 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
4299 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
4301 For a 'struct window', replace some Lisp_Object fields to
4302 bitfields where appropriate, remove unused fields.
4303 * window.h (struct window): Remove unused 'last_mark_x' and
4304 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
4305 change it's type from Lisp_Object to bitfield.
4306 Change type of 'force_start', 'optional_new_start',
4307 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
4308 fields from Lisp_Object to bitfield. Adjust users accordingly.
4310 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
4312 Pacify gcc -Wdouble-precision when using Xaw.
4313 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
4314 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
4315 Use 'float' consistently, rather than 'float' in most places
4316 and 'double' in a couple of places.
4318 2012-05-31 Eli Zaretskii <eliz@gnu.org>
4320 * xdisp.c (handle_stop): Detect whether we have overlay strings
4321 loaded by testing it->current.overlay_string_index to be
4322 non-negative, instead of checking whether n_overlay_strings is
4323 positive. (Bug#11587)
4325 2012-05-31 Chong Yidong <cyd@gnu.org>
4327 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
4329 * doc.c (Fsubstitute_command_keys): Doc fix.
4331 2012-05-31 Eli Zaretskii <eliz@gnu.org>
4333 * search.c (search_buffer): Remove calls to
4334 r_alloc_inhibit_buffer_relocation, as it is now called by
4335 maybe_unify_char, which was the cause of relocation of buffer text
4338 2012-05-31 Eli Zaretskii <eliz@gnu.org>
4340 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
4341 for the duration of call to load_charset, to avoid problems with
4342 callers of maybe_unify_char that access buffer text through C
4345 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
4346 decrement the inhibition flag, instead of just setting or
4349 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
4351 Remove obsolete '#define static' cruft.
4352 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
4353 This #undef was "temporary" in 2000; it is no longer needed
4354 now that '#define static' has gone away.
4355 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
4356 (gray_bitmap_bits): Remove; no longer needed.
4357 All uses replaced with definiens.
4358 * xterm.c: Include "bitmaps/gray.xbm".
4360 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
4362 Clean up __executable_start, monstartup when --enable-profiling.
4363 The following changes affect the code only when profiling.
4364 * dispnew.c (__executable_start): Rename from safe_bcopy.
4365 Define only on platforms that need it.
4366 * emacs.c: Include <sys/gmon.h> when profiling.
4367 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
4368 (__executable_start): Remove decl, since lisp.h does it now.
4369 (safe_bcopy): Remove decl; no longer has that name.
4370 (main): Coalesce #if into single bit of code, for simplicity.
4371 Cast pointers to uintptr_t, since standard libraries want integers
4373 * lisp.h (__executable_start): New decl.
4375 2012-05-31 Glenn Morris <rgm@gnu.org>
4377 * image.c (Fimagemagick_types): Doc fix.
4379 2012-05-30 Jim Meyering <meyering@redhat.com>
4381 * callproc.c (Fcall_process_region): Include directory component
4382 in mkstemp error message (Bug#11586).
4384 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
4386 * alloc.c, lisp.h (make_pure_vector): Now static.
4388 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
4390 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
4391 Move to byte-run.el.
4392 (Fautoload): Do the hash-doc more carefully.
4393 * data.c (Fdefalias): Purify definition, except for keymaps.
4394 (Qdefun): Move from eval.c.
4395 * lisp.h (Qdefun): Remove.
4396 * lread.c (read1): Tiny simplification.
4398 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
4400 Do not create empty overlays with the evaporate property (Bug#9642).
4401 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
4402 Bug#9642, but explicitly check that the buffer the overlay would
4403 be moved to is live and rearrange lines to make sure that errors
4404 will not put the overlay in an inconsistent state.
4405 (Fdelete_overlay): Cosmetics.
4407 2012-05-28 Eli Zaretskii <eliz@gnu.org>
4409 * w32term.c (my_bring_window_to_top): New function.
4410 (x_raise_frame): Use handle returned by DeferWindowPos, which
4411 could be different from the original one.
4412 Call my_bring_window_to_top instead of my_set_foreground_window.
4415 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
4416 by calling BringWindowToTop.
4418 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
4419 (WM_EMACS_END): Increase by one.
4421 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
4423 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
4424 This avoids undefined behavior that might cause the eassert
4425 to not catch an out-of-range value.
4427 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
4429 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
4430 Update dependencies.
4432 2012-05-27 Eli Zaretskii <eliz@gnu.org>
4434 * bidi.c (bidi_mirror_char): Fix last change.
4436 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
4438 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
4439 when referring to sectname field in printf format.
4441 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
4443 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
4444 Only r_alloc_inhibit_buffer_relocation needed to be added;
4445 the others were already declared.
4447 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
4448 before checking whether it's out of range. Put the check inside
4450 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
4452 2012-05-27 Ken Brown <kbrown@cornell.edu>
4454 * callproc.c (Fcall_process): Restore a line that was accidentally
4455 commented out in the 2011-02-13 change (bug#11547).
4457 2012-05-27 Eli Zaretskii <eliz@gnu.org>
4459 * lisp.h [REL_ALLOC]: Add prototypes for external functions
4460 defined on ralloc.c.
4462 * buffer.c [REL_ALLOC]: Remove prototypes of
4463 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
4464 they are now on lisp.h.
4466 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
4468 * search.c (search_buffer): Use it to inhibit relocation of buffer
4469 text while re_search_2 is doing its job, because re_search_2 is
4470 passed C pointers to buffer text. (Bug#11519)
4472 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
4475 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
4476 state after an additional call to move_it_in_display_line_to, keep
4477 the values of it->max_ascent and it->max_descent found for the
4479 (pos_visible_p): Revert the comparison against bottom_y to what it
4480 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
4483 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
4485 Fix coding-related core dumps with gcc -ftrapv.
4486 The code was computing A - B, where A and B are pointers, and B is
4487 random garbage. This can lead to core dumps on platforms that
4488 have special pointer registers, and it also leads to core dumps on
4489 x86-64 when compiled with gcc -ftrapv. The fix is to compute
4490 A - B only when B is initialized properly.
4491 * coding.c (coding_set_source, coding_set_destination): Return void.
4492 (coding_change_source, coding_change_destinations): New functions,
4493 with the old behaviors of coding_set_source and coding_set_destination.
4494 All callers that need an offset changed to use these new functions.
4496 2012-05-26 Glenn Morris <rgm@gnu.org>
4498 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
4500 2012-05-26 Eli Zaretskii <eliz@gnu.org>
4502 Extend mouse support on W32 text-mode console.
4503 * xdisp.c (draw_row_with_mouse_face):
4504 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
4506 * w32console.c: Include window.h.
4507 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
4509 (initialize_w32_display): Initialize mouse-highlight data.
4511 * w32inevt.c: Include termchar.h and window.h.
4512 (do_mouse_event): Support mouse-autoselect-window. When the mouse
4513 moves, call note_mouse_highlight. If help_echo changed, call
4514 gen_help_event to produce help-echo message in the echo area.
4515 Call clear_mouse_face if mouse_face_hidden is set in the mouse
4518 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
4520 * lread.c (read1): Simplify slightly to avoid an overflow warning
4521 with GCC 4.7.0 on x86-64.
4523 2012-05-26 Eli Zaretskii <eliz@gnu.org>
4525 * bidi.c (bidi_mirror_char): Revert last change: an int is
4526 definitely wide enough here.
4528 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
4530 Fix integer width and related bugs (Bug#9874).
4531 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
4532 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
4533 (string_bytes, check_sblock, allocate_string_data):
4534 (compact_small_strings, Fmake_bool_vector, make_string)
4535 (make_unibyte_string, make_multibyte_string)
4536 (make_string_from_bytes, make_specified_string)
4537 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
4538 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
4540 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4541 (allocate_pseudovector):
4542 Use int, not EMACS_INT, where int is wide enough.
4543 (inhibit_garbage_collection, Fgarbage_collect):
4544 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4545 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
4546 int might not be wide enough.
4547 (bidi_cache_search, bidi_cache_find, bidi_init_it)
4548 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
4549 (bidi_at_paragraph_end, bidi_find_paragraph_start)
4550 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
4551 (bidi_level_of_next_char, bidi_move_to_visually_next):
4552 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4553 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
4554 (Fkill_buffer, Fset_buffer_major_mode)
4555 (advance_to_char_boundary, Fbuffer_swap_text)
4556 (Fset_buffer_multibyte, overlays_at, overlays_in)
4557 (overlay_touches_p, struct sortvec, record_overlay_string)
4558 (overlay_strings, recenter_overlay_lists)
4559 (adjust_overlays_for_insert, adjust_overlays_for_delete)
4560 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
4561 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
4562 (Foverlay_recenter, last_overlay_modification_hooks_used)
4563 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
4564 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4565 (validate_region): Omit unnecessary test for b <= e,
4566 since that's guaranteed by the previous test.
4567 (adjust_overlays_for_delete): Avoid pos + length overflow.
4568 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
4569 (report_overlay_modification):
4570 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4571 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
4572 Omit pointer cast, which isn't needed anyway, and doesn't work
4573 after the EMACS_INT -> ptrdiff_t change.
4574 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
4575 * buffer.h: Adjust decls to match defn changes elsewhere.
4576 (struct buffer_text, struct buffer):
4577 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4578 Use EMACS_INT, not int, where int might not be wide enough.
4579 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
4580 not int, to avoid needless 32-bit limit on 64-bit hosts.
4581 (exec_byte_code): Use tighter memory-full test, one that checks
4582 for alloca overflow. Don't compute the address of the object just
4583 before an array, as that's not portable. Use EMACS_INT, not
4584 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
4585 * callint.c (Fcall_interactively):
4586 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4587 * callproc.c (call_process_kill, Fcall_process):
4588 Don't assume pid_t fits into an Emacs fixnum.
4589 (call_process_cleanup, Fcall_process, child_setup):
4590 Don't assume pid_t fits into int.
4591 (call_process_cleanup, Fcall_process, delete_temp_file)
4592 (Fcall_process_region):
4593 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4594 (Fcall_process): Simplify handling of volatile integers.
4595 Use int, not EMACS_INT, where int will do.
4596 * casefiddle.c (casify_object, casify_region, operate_on_word)
4597 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
4598 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4599 (casify_object): Avoid integer overflow when overallocating buffer.
4600 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
4601 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
4602 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
4603 * category.h (CATEGORYP): Don't assume arg is nonnegative.
4604 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
4605 integers are now checked earlier. All uses replaced with XINT.
4607 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4608 For CCL_MapSingle, check that content and value are in int range.
4609 (ccl_driver, Fregister_code_conversion_map):
4610 Check that Vcode_version_map_vector is a vector.
4611 (resolve_symbol_ccl_program): Check that vector header is in range.
4612 Always copy the vector, so that we can check its contents reliably
4613 now rather than having to recheck each instruction as it's being
4614 executed. Check that vector words fit in 'int'.
4615 (ccl_get_compiled_code, Fregister_ccl_program)
4616 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
4617 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
4618 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
4619 contents are in range.
4620 (Fccl_execute_on_string): Check that status is in range.
4621 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
4622 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
4623 Accept and return EMACS_INT, not int, because callers can pass values
4625 (c_string_width, strwidth, lisp_string_width, chars_in_text)
4626 (multibyte_chars_in_text, parse_str_as_multibyte)
4627 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
4628 (str_as_unibyte, str_to_unibyte, string_count_byte8)
4629 (string_escape_byte8, Fget_byte):
4630 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4631 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
4632 avoid mishandling large integers.
4633 * character.h: Adjust decls to match defn changes elsewhere.
4634 * charset.c (load_charset_map_from_file, find_charsets_in_text)
4635 (Ffind_charset_region):
4636 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4637 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
4638 (load_charset_map_from_vector, Fdefine_charset_internal):
4639 Don't assume fixnum fits in int.
4640 (load_charset_map_from_vector, Fmap_charset_chars):
4641 Remove now-unnecessary CHECK_NATNUMs.
4642 (Fdefine_charset_internal): Check ranges here, more carefully.
4643 Don't rely on undefined behavior with signed left shift overflow.
4644 Don't assume unsigned int fits into fixnum, or that fixnum fits
4645 into unsigned int. Don't require max_code to be a valid fixnum;
4646 that's not true for gb10830 4-byte on a 32-bit host. Allow
4647 invalid_code to be a cons, for the same reason. Require code_offset
4648 to be a character. Avoid int overflow if max_char is close
4650 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
4651 this is intended anyway and avoids some undefined behavior.
4652 (load_charset_map): Pass unsigned, not int, as 2nd arg of
4653 INDEX_TO_CODE_POINT, as that's what it expects.
4654 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
4655 * charset.h (DECODE_CHAR): Return int, not unsigned;
4656 this is what was intended anyway, and it avoids undefined behavior.
4657 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
4658 integer-overflow issues.
4659 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
4660 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
4661 where the argument is EMACS_INT, and this behavior is not intended.
4662 * chartab.c (Fmake_char_table, Fset_char_table_range)
4663 (uniprop_get_decoder, uniprop_get_encoder):
4664 Don't assume fixnum fits in int.
4665 * cmds.c (move_point): New function, that does the gist of
4666 Fforward_char and Fbackward_char, but does so while checking
4667 for integer overflow more accurately.
4668 (Fforward_char, Fbackward_char): Use it.
4669 (Fforward_line, Fend_of_line, internal_self_insert)
4670 (internal_self_insert):
4671 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4672 Fix a FIXME, by checking for integer overflow when calculating
4673 target_clm and actual_clm.
4674 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
4675 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
4676 (ASSURE_DESTINATION, coding_alloc_by_realloc)
4677 (coding_alloc_by_making_gap, alloc_destination)
4678 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
4679 (encode_coding_utf_16, detect_coding_emacs_mule)
4680 (decode_coding_emacs_mule, encode_coding_emacs_mule)
4681 (detect_coding_iso_2022, decode_coding_iso_2022)
4682 (encode_invocation_designation, encode_designation_at_bol)
4683 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
4684 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
4685 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
4686 (encode_coding_ccl, encode_coding_raw_text)
4687 (detect_coding_charset, decode_coding_charset)
4688 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
4689 (produce_composition, produce_charset, produce_annotation)
4690 (decode_coding, handle_composition_annotation)
4691 (handle_charset_annotation, consume_chars, decode_coding_gap)
4692 (decode_coding_object, encode_coding_object, detect_coding_system)
4693 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
4694 (code_convert_region, code_convert_string)
4695 (Fdefine_coding_system_internal)
4696 (coding_set_source, coding_set_destination):
4697 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4698 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
4699 (Fdefine_coding_system_internal):
4700 Don't assume fixnums fit in int.
4701 (decode_coding_gap, decode_coding_object, encode_coding_object)
4702 (Fread_coding_system, Fdetect_coding_region)
4703 (Funencodable_char_position, Fcheck_coding_systems_region)
4704 (get_translation, handle_composition_annotation, consume_chars):
4705 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4706 (consume_chars): Rewrite to not calculate an address outside buffer.
4707 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
4708 Don't access memory outside of the args array.
4709 (Fdefine_coding_system_internal): Check for charset-id overflow.
4710 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
4711 result of ENCODE_CHAR.
4712 * coding.h: Adjust decls to match defn changes elsewhere.
4713 (struct coding_system):
4714 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4715 * composite.c (get_composition_id, find_composition)
4716 (run_composition_function, update_compositions)
4717 (compose_text, composition_gstring_put_cache)
4718 (composition_gstring_p, composition_gstring_width)
4719 (fill_gstring_header, fill_gstring_body, autocmp_chars)
4720 (composition_compute_stop_pos, composition_reseat_it)
4721 (composition_update_it, struct position_record)
4722 (find_automatic_composition, composition_adjust_point)
4723 (Fcomposition_get_gstring, Ffind_composition_internal):
4724 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4725 (update_compositions):
4726 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4727 * composite.h: Adjust decls to match defn changes elsewhere.
4728 (struct composition):
4729 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4730 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
4731 Do not attempt to compute the address of the object just before a
4732 buffer; this is not portable.
4734 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4735 (Faset): Use int, not EMACS_INT, where int is wide enough.
4736 (Fstring_to_number): Don't assume fixnums fit in int.
4737 (Frem): Don't assume arg is nonnegative.
4738 * dbusbind.c (xd_append_arg): Check for integers out of range.
4739 (Fdbus_call_method): Don't overflow the timeout int.
4740 (extract_signed, extract_unsigned): New functions.
4741 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
4742 (xd_get_connection_references): Return ptrdiff_t, not int.
4744 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
4745 (xd_read_message_1):
4746 Use int, not unsigned, where the dbus API uses int.
4747 (Fdbus_message_internal): Don't overflow mtype.
4748 (syms_of_dbusbind): Allocate right-sized buffer for integers.
4749 * dired.c (directory_files_internal, file_name_completion, scmp)
4750 (file_name_completion_stat):
4751 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4752 (file_name_completion): Don't overflow matchcount.
4753 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
4754 * dispextern.h: Adjust decls to match defn changes elsewhere.
4755 (struct text_pos, struct glyph, struct bidi_saved_info)
4756 (struct bidi_string_data, struct bidi_it, struct composition_it)
4758 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4759 (struct display_pos, struct composition_it, struct it):
4760 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4761 * dispnew.c (increment_matrix_positions)
4762 (increment_row_positions, mode_line_string)
4763 (marginal_area_string):
4764 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4765 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
4766 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4767 (duration_to_sec_usec): New function, to check for overflow better.
4768 (Fsleep_for, sit_for): Use it.
4769 * doc.c (get_doc_string, store_function_docstring):
4770 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4771 (get_doc_string, Fsnarf_documentation):
4772 Use int, not EMACS_INT, where int is wide enough.
4774 Use SAFE_ALLOCA, not alloca.
4775 Check for overflow when converting EMACS_INT to off_t.
4776 * doprnt.c (doprnt):
4777 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4778 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
4779 Don't assume uid_t fits into fixnum.
4780 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
4781 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
4782 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
4783 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
4784 (general_insert_function)
4785 (Finsert_char, make_buffer_string, make_buffer_string_both)
4786 (update_buffer_properties, Fbuffer_substring)
4787 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
4788 (Fsubst_char_in_region, check_translation)
4789 (Ftranslate_region_internal, save_restriction_restore, Fformat)
4790 (transpose_markers, Ftranspose_regions):
4791 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4792 (clip_to_bounds): Move to lisp.h as an inline function).
4793 (Fconstrain_to_field): Don't assume integers are nonnegative.
4794 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
4795 (Fsubst_char_in_region, Fsave_restriction):
4796 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4797 (Femacs_pid): Don't assume pid_t fits into fixnum.
4798 (lo_time): Use int, not EMACS_INT, when int suffices.
4799 (lisp_time_argument): Check for usec out of range.
4800 (Fencode_time): Don't assume fixnum fits in int.
4801 (Fuser_login_name, Fuser_full_name): Signal an error
4802 if a uid argument is out of range, rather than relying on
4804 (Fformat_time_string): Remove now-unnecessary check.
4805 lisp_time_argument checks for out-of-range usec now.
4806 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
4807 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
4808 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
4809 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
4810 (init_cmdargs, Fdump_emacs):
4811 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4812 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
4813 the bottom (typically) 32 bits of the fixnum.
4814 * eval.c (specpdl_size, call_debugger):
4815 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4816 (when_entered_debugger, Fbacktrace_debug):
4817 Don't assume fixnum can fit in int.
4818 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
4819 the object just before a buffer; this is not portable.
4820 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
4821 (grow_specpdl, unbind_to):
4822 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4823 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
4824 (grow_specpdl): Simplify allocation by using xpalloc.
4825 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
4826 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
4827 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
4828 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4829 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
4831 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4832 (Fcopy_file, non_regular_nbytes, read_non_regular)
4833 (Finsert_file_contents):
4834 Use int, not EMACS_INT, where int is wide enough.
4835 (READ_BUF_SIZE): Verify that it fits in int.
4836 (Finsert_file_contents): Check that counts are in proper range,
4837 rather than assuming fixnums fit into ptrdiff_t etc.
4838 Don't assume fixnums fit into int.
4839 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
4840 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
4841 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
4842 (string_char_to_byte, string_byte_to_char)
4843 (string_make_multibyte, string_to_multibyte)
4844 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
4845 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
4846 (substring_both, Fdelete, internal_equal, Ffillarray)
4847 (Fclear_string, mapcar1)
4848 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
4849 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
4850 (larger_vector, make_hash_table, maybe_resize_hash_table)
4851 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
4852 (Fmaphash, secure_hash):
4853 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4854 (concat): Check for string index and length overflow.
4855 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
4857 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4858 (larger_vector): New API (vec, incr_min, size_max) replaces old
4859 one (vec, new_size, init). This catches size overflow.
4860 INIT was removed because it was always Qnil.
4861 All callers changed.
4862 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
4863 the upper bound on a hash table index size.
4864 (make_hash_table, maybe_resize_hash_table): Use it.
4865 (secure_hash): Computer start_byte and end_byte only after
4866 they're known to be in ptrdiff_t range.
4867 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
4868 (Ffont_get_glyphs, Ffont_at):
4869 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4870 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
4871 (Flist_fonts, Fopen_font):
4872 Don't assume fixnum can fit in int.
4873 (check_gstring): Don't assume index can fit in int.
4874 (font_match_p): Check that fixnum is a character, not a nonnegative
4875 fixnum, since the later code needs to stuff it into an int.
4876 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
4877 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
4878 conversion overflow issues.
4879 (Fopen_font): Check for integer out of range.
4880 (Ffont_get_glyphs): Don't assume index can fit in int.
4881 * font.h: Adjust decls to match defn changes elsewhere.
4882 * fontset.c (reorder_font_vector): Redo score calculation to avoid
4884 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
4885 printmax_t, where ptrdiff_t is wide enough.
4886 (Finternal_char_font):
4887 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4888 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
4889 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
4890 (Fset_frame_position, x_set_frame_parameters)
4891 (x_set_line_spacing, x_set_border_width)
4892 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
4893 Check that fixnums are in proper range for system types.
4894 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
4895 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4896 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
4897 Use SAFE_ALLOCA_LISP, not alloca.
4898 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
4899 intptr_t is wide enough.
4900 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
4901 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
4902 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
4903 Check for fixnum out of range.
4904 * ftfont.c (ftfont_list): Don't assume index fits in int.
4905 Check that fixnums are in proper range for system types.
4906 (ftfont_shape_by_flt):
4907 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4908 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
4909 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4910 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
4911 Check that fixnums are in proper range for system types.
4912 * gnutls.h: Adjust decls to match defn changes elsewhere.
4913 * gtkutil.c (xg_dialog_run):
4914 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4915 (update_frame_tool_bar):
4916 Check that fixnums are in proper range for system types.
4917 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
4918 (lookup_image): Check that fixnums are in range for system types.
4919 * indent.c (last_known_column, last_known_column_point):
4920 (current_column_bol_cache):
4921 (skip_invisible, current_column, check_display_width):
4922 (check_display_width, scan_for_column, current_column_1)
4923 (Findent_to, Fcurrent_indentation, position_indentation)
4924 (indented_beyond_p, Fmove_to_column, compute_motion):
4925 (Fcompute_motion, Fvertical_motion):
4926 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4927 (last_known_column_modified): Use EMACS_INT, not int.
4928 (check_display_width):
4930 Check that fixnums and floats are in proper range for system types.
4931 (compute_motion): Don't assume index or fixnum fits in int.
4932 (compute_motion, Fcompute_motion):
4933 Use int, not EMACS_INT, when it is wide enough.
4934 (vmotion): Omit local var start_hpos that is always 0; that way
4935 we don't need to worry about overflow in expressions involving it.
4936 * indent.h: Adjust decls to match defn changes elsewhere.
4938 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4939 Use int, not EMACS_INT, where int is wide enough.
4940 Remove unused members ovstring_chars_done and tab_offset;
4942 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
4943 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
4944 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
4945 (make_gap, copy_text, insert, insert_and_inherit)
4946 (insert_before_markers, insert_before_markers_and_inherit)
4947 (insert_1, count_combining_before, count_combining_after)
4948 (insert_1_both, insert_from_string)
4949 (insert_from_string_before_markers, insert_from_string_1)
4950 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
4951 (adjust_after_replace, adjust_after_insert, replace_range)
4952 (replace_range_2, del_range, del_range_1, del_range_byte)
4953 (del_range_both, del_range_2, modify_region)
4954 (prepare_to_modify_buffer, signal_before_change)
4955 (signal_after_change, Fcombine_after_change_execute):
4956 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4957 * intervals.c (traverse_intervals, rotate_right, rotate_left)
4958 (balance_an_interval, split_interval_right, split_interval_left)
4959 (find_interval, next_interval, update_interval)
4960 (adjust_intervals_for_insertion, delete_node, delete_interval)
4961 (interval_deletion_adjustment, adjust_intervals_for_deletion)
4962 (static_offset_intervals, offset_intervals)
4963 (merge_interval_right, merge_interval_left, make_new_interval)
4964 (graft_intervals_into_buffer, temp_set_point_both)
4965 (temp_set_point, set_point, adjust_for_invis_intang)
4966 (set_point_both, move_if_not_intangible, get_property_and_range)
4967 (get_local_map, copy_intervals, copy_intervals_to_string)
4968 (compare_string_intervals, set_intervals_multibyte_1):
4969 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4970 * intervals.h: Adjust decls to match defn changes elsewhere.
4972 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4973 * keyboard.c (this_command_key_count, this_single_command_key_start)
4974 (before_command_key_count, before_command_echo_length, echo_now)
4975 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
4976 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
4977 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
4978 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
4979 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4980 (last_non_minibuf_size, last_point_position, echo_truncate)
4981 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
4982 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
4983 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
4984 (stuff_buffered_input):
4985 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4986 (last_auto_save, command_loop_1, read_char):
4987 Use EMACS_INT, not int, to avoid integer overflow.
4988 (record_char): Avoid overflow in total_keys computation.
4989 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
4990 * keyboard.h: Adjust decls to match defn changes elsewhere.
4991 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
4992 (Fkey_description, Fdescribe_vector, Flookup_key):
4993 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4994 (click_position): New function, to check that positions are in range.
4995 (Fcurrent_active_maps):
4997 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4998 (Faccessible_keymaps, Fkey_description):
4999 (preferred_sequence_p):
5000 Don't assume fixnum can fit into int.
5001 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
5002 Check for integer overflow in size calculations.
5003 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
5004 avoid mishandling large integers.
5005 * lisp.h: Adjust decls to match defn changes elsewhere.
5006 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
5007 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
5008 (struct Lisp_Marker):
5009 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5010 (clip_to_bounds): Now an inline function, moved here from editfns.c.
5011 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
5012 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
5013 All callers changed.
5014 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
5015 Assume the arg has valid form, since it always does.
5016 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
5017 unsigned integer system type.
5018 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
5019 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
5020 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5021 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
5022 (duration_to_sec_usec): New decl.
5023 * lread.c (read_from_string_index, read_from_string_index_byte)
5024 (read_from_string_limit, readchar, unreadchar, openp)
5025 (read_internal_start, read1, oblookup):
5026 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5027 (Fload, readevalloop, Feval_buffer, Feval_region):
5028 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5029 (openp): Check for out-of-range argument to 'access'.
5030 (read1): Use int, not EMACS_INT, where int is wide enough.
5031 Don't assume fixnum fits into int.
5032 Fix off-by-one error that can read outside a buffer.
5033 (read_filtered_event): Use duration_to_sec_usec
5034 to do proper overflow checking on durations.
5035 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
5036 in size calculation.
5037 (Fexecute_kbd_macro):
5038 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5039 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
5040 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
5041 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
5042 (set_marker_both, set_marker_restricted_both, marker_position)
5043 (marker_byte_position, Fbuffer_has_markers_at):
5044 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5045 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
5046 * menu.c (ensure_menu_items): Rename from grow_menu_items.
5047 It now merely ensures that the menu is large enough, without
5048 necessarily growing it, as this avoids some integer overflow issues.
5049 All callers changed.
5050 (keymap_panes, parse_single_submenu, Fx_popup_menu):
5051 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5052 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
5053 Use SAFE_ALLOCA_LISP, not alloca.
5054 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
5055 to EMACS_INT. Check that fixnums are in proper range for system types.
5056 * minibuf.c (minibuf_prompt_width, string_to_object)
5057 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
5058 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
5059 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5060 (get_minibuffer, read_minibuf_unwind):
5061 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5062 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
5063 this simplifies overflow checking. All callers changed.
5064 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
5066 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5067 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
5068 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
5069 Check that fixnums are in proper range for system types.
5070 (Fx_create_frame, Fx_show_tip):
5071 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5072 * nsfont.m (ns_findfonts, nsfont_list_family):
5073 Don't assume fixnum fits in long.
5074 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
5075 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5076 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
5078 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
5079 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5080 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
5081 (PRINTDECLARE, PRINTPREPARE):
5082 (strout, print_string):
5083 (print, print_preprocess, print_check_string_charset_prop)
5085 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5087 (temp_output_buffer_setup, Fprin1_to_string, print_object):
5088 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5089 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
5090 (printchar, strout): Use xpalloc to catch size calculation overflow.
5091 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
5092 (print_error_message): Use SAFE_ALLOCA, not alloca.
5093 (print_object): Use int, not EMACS_INT, where int is wide enough.
5094 (print_depth, new_backquote_output, print_number_index):
5095 Use ptrdiff_t, not int, where int might not be wide enough.
5096 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
5097 (Fset_process_window_size, Fformat_network_address)
5098 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
5100 Check that fixnums are in proper range for system types.
5101 (Fsignal_process): Simplify by avoiding a goto.
5102 Check for process-ids out of pid_t range rather than relying on
5104 (process_tick, update_tick): Use EMACS_INT, not int.
5105 (Fformat_network_address, read_process_output, send_process)
5106 (Fprocess_send_region, status_notify):
5107 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5108 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
5109 (wait_reading_process_output, read_process_output, exec_sentinel):
5110 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5111 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
5112 (Faccept_process_output): Use duration_to_sec_usec to do proper
5113 overflow checking on durations.
5114 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
5115 Don't assume pid_t fits in int.
5116 * process.h (struct Lisp_Process): Members tick and update_tick
5117 are now of type EMACS_INT, not int.
5118 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
5119 configured --with-wide-int.
5120 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
5121 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
5122 * search.c (looking_at_1, string_match_1):
5123 (fast_string_match, fast_c_string_match_ignore_case)
5124 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
5125 (scan_newline, find_before_next_newline, search_command)
5126 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
5127 (set_search_regs, wordify):
5130 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5131 (string_match_1, search_buffer, set_search_regs):
5133 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5134 (wordify): Check for overflow in size calculation.
5135 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
5136 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
5137 Check that fixnums are in proper range for system types.
5138 * sound.c (struct sound_device)
5139 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
5140 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5141 (Fplay_sound_internal):
5142 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5143 * syntax.c (struct lisp_parse_state, find_start_modiff)
5144 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
5145 (Fparse_partial_sexp):
5146 Don't assume fixnums can fit in int.
5147 (struct lisp_parse_state, find_start_pos, find_start_value)
5148 (find_start_value_byte, find_start_begv)
5149 (update_syntax_table, char_quoted, dec_bytepos)
5150 (find_defun_start, prev_char_comend_first, back_comment):
5151 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
5152 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
5153 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5154 (Finternal_describe_syntax_value): Check that match_lisp is a
5155 character, not an integer, since the code stuffs it into int.
5156 (scan_words, scan_sexps_forward):
5157 Check that fixnums are in proper range for system types.
5159 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5160 (scan_sexps_forward):
5161 Use CHARACTERP, not INTEGERP, since the value must fit into int.
5162 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
5163 * syntax.h: Adjust decls to match defn changes elsewhere.
5164 (struct gl_state_s):
5165 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5166 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
5167 MOST_POSITIVE_FIXNUM.
5168 * sysdep.c (wait_for_termination_1, wait_for_termination)
5169 (interruptible_wait_for_termination, mkdir):
5170 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
5171 (emacs_read, emacs_write):
5172 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5173 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
5174 and double all fit in int.
5175 * term.c (set_tty_color_mode):
5176 Check that fixnums are in proper range for system types.
5177 * termhooks.h (struct input_event):
5178 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5179 * textprop.c (validate_interval_range, interval_of)
5180 (Fadd_text_properties, set_text_properties_1)
5181 (Fremove_text_properties, Fremove_list_of_text_properties)
5182 (Ftext_property_any, Ftext_property_not_all)
5183 (copy_text_properties, text_property_list, extend_property_ranges)
5184 (verify_interval_modification):
5185 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5186 (Fnext_single_char_property_change)
5187 (Fprevious_single_char_property_change):
5188 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5189 (copy_text_properties):
5190 Check for integer overflow in index calculation.
5191 * undo.c (last_boundary_position, record_point, record_insert)
5192 (record_delete, record_marker_adjustment, record_change)
5193 (record_property_change):
5194 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5195 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
5196 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5197 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
5198 (Fx_hide_tip, Fx_file_dialog):
5199 * w32menu.c (set_frame_menubar):
5200 Use ptrdiff_t, not int, for consistency with rest of code.
5201 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
5202 (select_window, Fdelete_other_windows_internal)
5203 (window_scroll_pixel_based, window_scroll_line_based)
5204 (Frecenter, Fset_window_configuration):
5205 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5206 (Fset_window_hscroll, run_window_configuration_change_hook)
5207 (set_window_buffer, temp_output_buffer_show, scroll_command)
5208 (Fscroll_other_window, Frecenter):
5209 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5210 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
5211 Don't assume fixnum fits in int.
5212 (Fset_window_scroll_bars):
5213 Check that fixnums are in proper range for system types.
5214 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
5215 (string_pos, c_string_pos, number_of_chars, init_iterator)
5216 (in_ellipses_for_invisible_text_p, init_from_display_pos)
5217 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
5218 (compute_display_string_end, handle_face_prop)
5219 (face_before_or_after_it_pos, handle_invisible_prop)
5220 (handle_display_prop, handle_display_spec, handle_single_display_spec)
5221 (display_prop_intangible_p, string_buffer_position_lim)
5222 (string_buffer_position, handle_composition_prop, load_overlay_strings)
5223 (get_overlay_strings_1, get_overlay_strings)
5224 (iterate_out_of_display_property, forward_to_next_line_start)
5225 (back_to_previous_visible_line_start, reseat, reseat_to_string)
5226 (get_next_display_element, set_iterator_to_next)
5227 (get_visually_first_element, compute_stop_pos_backwards)
5228 (handle_stop_backwards, next_element_from_buffer)
5229 (move_it_in_display_line_to, move_it_in_display_line)
5230 (move_it_to, move_it_vertically_backward, move_it_by_lines)
5231 (add_to_log, message_dolog, message_log_check_duplicate)
5232 (message2, message2_nolog, message3, message3_nolog
5233 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
5234 (current_message_1, truncate_echo_area, truncate_message_1)
5235 (set_message, set_message_1, store_mode_line_noprop)
5236 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
5237 (text_outside_line_unchanged_p, check_point_in_composition)
5238 (reconsider_clip_changes)
5239 (redisplay_internal, set_cursor_from_row, try_scrolling)
5240 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
5241 (redisplay_window, find_last_unchanged_at_beg_row)
5242 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
5243 (trailing_whitespace_p, find_row_edges, display_line)
5244 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
5245 (display_mode_element, store_mode_line_string)
5246 (pint2str, pint2hrstr, decode_mode_spec)
5247 (display_count_lines, display_string, draw_glyphs)
5248 (x_produce_glyphs, x_insert_glyphs)
5249 (rows_from_pos_range, mouse_face_from_buffer_pos)
5250 (fast_find_string_pos, mouse_face_from_string_pos)
5251 (note_mode_line_or_margin_highlight, note_mouse_highlight):
5252 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5253 (safe_call, init_from_display_pos, handle_fontified_prop)
5254 (handle_single_display_spec, load_overlay_strings)
5255 (with_echo_area_buffer, setup_echo_area_for_printing)
5256 (display_echo_area, echo_area_display)
5257 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
5258 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5259 (redisplay_window, dump_glyph_row, display_mode_line)
5260 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
5261 (handle_display_spec, display_prop_string_p):
5262 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5263 (handle_single_display_spec, build_desired_tool_bar_string)
5264 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
5265 (get_specified_cursor_type):
5266 Check that fixnums are in proper range for system types.
5267 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
5268 (Flookup_image_map):
5269 Don't assume fixnums fit in int.
5270 (compare_overlay_entries):
5271 Avoid mishandling comparisons due to subtraction overflow.
5272 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
5273 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
5274 (handle_tool_bar_click):
5275 Use int, not unsigned, since we prefer signed and the signedness
5276 doesn't matter here.
5277 (get_next_display_element, next_element_from_display_vector):
5278 Use int, not EMACS_INT, when int is wide enough.
5279 (start_hourglass): Use duration_to_sec_usec to do proper
5280 overflow checking on durations.
5281 * xfaces.c (Fbitmap_spec_p):
5282 Check that fixnums are in proper range for system types.
5283 (compare_fonts_by_sort_order):
5284 Avoid mishandling comparisons due to subtraction overflow.
5285 (Fx_family_fonts, realize_basic_faces):
5286 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5288 Don't assume fixnum fits in int.
5289 Use SAFE_ALLOCA_LISP, not alloca.
5290 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
5291 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
5292 (face_at_buffer_position, face_for_overlay_string)
5293 (face_at_string_position):
5294 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5295 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
5296 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
5298 Check that fixnums are in proper range for system types.
5299 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
5300 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
5301 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5302 (Fx_change_window_property): Don't assume fixnums fit in int.
5303 * xfont.c (xfont_chars_supported):
5304 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5305 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
5306 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
5307 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5308 * xml.c (parse_region):
5309 * xrdb.c (magic_file_p):
5310 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5311 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
5312 (x_get_local_selection, x_reply_selection_request)
5313 (x_handle_selection_request, wait_for_property_change):
5314 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5315 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
5316 short is wide enough.
5317 (x_send_client_event): Don't assume fixnum fits in int.
5318 * xterm.c (x_x_to_emacs_modifiers):
5319 Don't assume EMACS_INT overflows nicely into int.
5320 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
5322 (handle_one_xevent): NATNUMP can eval its arg twice.
5323 (x_connection_closed):
5324 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5325 * xterm.h: Adjust decls to match defn changes elsewhere.
5326 (struct scroll_bar): Use struct vectorlike_header
5327 rather than rolling our own approximation.
5328 (SCROLL_BAR_VEC_SIZE): Remove; not used.
5330 2012-05-25 Glenn Morris <rgm@gnu.org>
5332 * lisp.mk (lisp): Update for more files being compiled now.
5334 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
5336 * lread.c: Remove `read_pure' which makes no difference.
5337 (read_pure): Remove var.
5338 (unreadpure): Remove function.
5339 (readevalloop): Don't call read_list with -1 flag.
5340 (read1, read_vector): Don't test read_pure any more.
5341 (read_list): Simplify.
5343 * fileio.c, character.h: Minor style tweaks.
5345 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
5347 * window.h (clip_changed): Remove useless declaration.
5349 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
5351 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
5352 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
5354 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
5357 This directory predates autoconf and is no longer needed nowadays.
5358 Move its few remaining bits of functionality to where they're needed.
5359 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
5360 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
5361 * m/template.h: Remove.
5362 * Makefile.in (M_FILE): Remove. All uses removed.
5363 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
5364 * lisp.h (USE_LSB_TAG):
5365 * mem-limits.h (EXCEEDS_LISP_PTR):
5366 Use VAL_MAX, not VALBITS, in #if.
5367 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
5368 (EMACS_UINT): Define unconditionally now.
5369 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
5370 (BITS_PER_EMACS_INT): New constants, replacing
5371 what used to be in config.h, but not useful in #if.
5372 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
5373 define them any more.
5374 (VAL_MAX): New macro.
5376 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
5377 BITS_PER_EMACS_INT, in #if.
5378 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
5379 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
5380 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
5381 * s/ms-w32.h (DATA_START):
5382 Move here from removed file m/intel386.h.
5383 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
5384 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
5386 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
5388 Assume C89 or later.
5389 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
5390 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
5392 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
5393 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
5394 * textprop.c, tparam.c (NULL): Remove.
5395 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
5396 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
5397 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
5398 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
5399 * xterm.c (input_signal_count): Assume volatile works.
5401 2012-05-21 Ken Brown <kbrown@cornell.edu>
5403 * xgselect.c (xg_select): Fix first argument in call to 'select'
5406 2012-05-20 Ken Brown <kbrown@cornell.edu>
5408 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
5409 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
5411 2012-05-19 Ken Brown <kbrown@cornell.edu>
5413 * xfns.c (x_in_use): Remove `static' qualifier.
5414 * xterm.h (x_in_use): Declare.
5415 * xgselect.c: Include xterm.h.
5416 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
5417 and `display_arg' (bug#9754).
5419 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
5421 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
5423 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
5424 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
5426 2012-05-18 Eli Zaretskii <eliz@gnu.org>
5428 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
5430 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
5431 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
5433 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
5434 reference to image_cache->refcount.
5435 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
5437 2012-05-17 Juri Linkov <juri@jurta.org>
5439 * search.c (Fword_search_regexp, Fword_search_backward)
5440 (Fword_search_forward, Fword_search_backward_lax)
5441 (Fword_search_forward_lax): Move functions to isearch.el
5442 (bug#10145, bug#11381).
5444 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
5446 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
5448 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
5450 * lread.c (init_obarray): Declare Qt and Qnil as special.
5452 2012-05-14 Glenn Morris <rgm@gnu.org>
5454 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
5455 Put "libexec" before "bin", for the sake of init_callproc_1.
5457 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
5459 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
5461 * unexaix.c: Port to more-recent AIX compilers.
5462 (report_error, report_error_1, make_hdr, copy_sym)
5463 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
5464 Make arguments const char *, not char *, to avoid violations of C
5465 standard and to fix some AIX warnings reported by Gilles Pion.
5467 2012-05-14 Eli Zaretskii <eliz@gnu.org>
5469 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
5470 already have overlays loaded.
5471 (handle_single_display_spec): Before returning without displaying
5472 fringe bitmap, synchronize the bidi iterator with the main display
5473 iterator, by calling iterate_out_of_display_property.
5474 (iterate_out_of_display_property): Detect buffer iteration by
5475 testing that it->string is a Lisp string.
5476 (get_next_display_element): When the current object is exhausted,
5477 and there's something on it->stack, call set_iterator_to_next to
5478 proceed with what's on the stack, instead of returning zero.
5479 (set_iterator_to_next): If called at the end of a Lisp string,
5480 proceed to consider_string_end without incrementing string
5481 position. Don't increment display vector index past the end of
5482 the display vector. (Bug#11417)
5483 (pos_visible_p): Don't report a position visible when move_it_to
5484 stopped at the last line of window, which happens to be scanned
5485 backwards by the bidi iteration. (Bug#11464)
5487 2012-05-14 Eli Zaretskii <eliz@gnu.org>
5489 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
5490 and right-margin display specs even if the spec is invalid or we
5491 are on a TTY, and thus unable to display on the fringes.
5492 That's because the text with the property will not be displayed anyway,
5493 so we need to signal to the caller that this is a "replacing"
5494 display spec. This fixes display when the spec is invalid or we
5497 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
5499 * unexaix.c (make_hdr): Fix typo in prototype.
5500 This bug broke the build on AIX. Problem reported by Gilles Pion.
5502 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
5504 * keyboard.c (kbd_buffer_get_event): Read special events also in
5505 batch mode. (Bug#11415)
5507 2012-05-12 Glenn Morris <rgm@gnu.org>
5509 * ns.mk: Update for ns_appbindir no longer having trailing "/".
5511 2012-05-12 Eli Zaretskii <eliz@gnu.org>
5513 * lisp.mk (lisp): Add newcomment.elc.
5515 2012-05-12 Glenn Morris <rgm@gnu.org>
5517 * Makefile.in (MKDIR_P): New, set by configure.
5518 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
5520 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
5522 Remove unused function hourglass_started.
5523 * dispextern.h (hourglass_started):
5524 * w32fns.c (hourglass_started):
5525 * xdisp.c (hourglass_started): Remove.
5527 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
5529 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
5530 Update dependencies.
5532 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
5534 * xgselect.c (xg_select): Put maxfds+1 into a var.
5535 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
5537 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
5539 2012-05-10 Dave Abrahams <dave@boostpro.com>
5541 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
5542 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
5544 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
5546 * dbusbind.c (xd_registered_buses): New internal Lisp object.
5547 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
5548 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
5549 Initialize xd_registered_buses.
5551 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
5553 Untag more efficiently if USE_LSB_TAG.
5554 This is based on a proposal by YAMAMOTO Mitsuharu in
5555 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
5556 For an admittedly artificial (nth 8000 longlist) benchmark on
5557 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
5558 Emacs's overall text size by 1%.
5559 * lisp.h (XUNTAG): New macro.
5560 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
5561 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
5562 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
5563 * eval.c (Fautoload):
5564 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
5565 * frame.h (XFRAME): Use XUNTAG.
5567 Port recent dbusbind.c changes to 32-bit --with-wide-int.
5568 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
5569 Remove unportable assumptions about print widths of types like
5571 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
5572 intptr_t when converting between pointer and integer, to avoid GCC
5573 warnings about wrong width.
5575 2012-05-09 Eli Zaretskii <eliz@gnu.org>
5577 * w32proc.c (new_child): Force Windows to reserve only 64KB of
5578 stack for each reader_thread, instead of defaulting to 8MB
5579 determined by the linker. This avoids failures in creating
5580 subprocesses on Windows 7, see the discussion in this thread:
5581 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
5583 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
5585 Fix up display of the *Minibuf-0* buffer in the mini window.
5586 * keyboard.c (read_char): Don't clear the echo area if there's no
5588 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
5589 contents of *Minibuf-0*) if there's no message displayed in its stead.
5591 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
5593 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
5596 2012-05-06 Chong Yidong <cyd@gnu.org>
5598 * lisp.mk (lisp): Update.
5600 2012-05-05 Jim Meyering <meyering@redhat.com>
5602 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
5604 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
5606 * data.c (PUT_ERROR): New macro.
5607 (syms_of_data): Use it. Add new error type `user-error'.
5608 * undo.c (user_error): New function.
5609 (Fprimitive_undo): Use it.
5610 * print.c (print_error_message): Adjust print style for `user-error'.
5611 * keyboard.c (user_error): New function.
5612 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
5614 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
5616 Do not limit current-time-string to years 1000..9999.
5617 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
5618 (Fcurrent_time_string): Support any year that is supported by the
5619 underlying localtime representation. Don't use asctime, as it
5620 has undefined behavior for years outside the range -999..9999.
5622 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
5624 Fix race conditions involving setenv, gmtime, localtime, asctime.
5625 Without this fix, interrupts could mess up code that uses these
5626 nonreentrant functions, since setting TZ invalidates existing
5627 tm_zone or tzname values, and since most of these functions return
5628 pointers to static storage.
5629 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
5630 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
5631 Grow the critical sections to include not just invoking
5632 localtime/gmtime, but also accessing these functions' results
5633 including their tm_zone values if any, and any related TZ setting.
5634 (format_time_string): Last arg is now struct tm *, not struct tm **,
5635 so that the struct tm is saved in the critical section.
5636 All callers changed. Simplify allocation of initial buffer, partly
5637 motivated by the fact that memory allocation needs to be outside
5638 the critical section.
5640 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
5642 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
5643 with RESET_INTERVAL.
5645 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
5646 Remove duplicated buffer name initialization.
5648 2012-05-02 Jim Meyering <jim@meyering.net>
5650 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
5652 * xfns.c (x_window): Use xstrdup (Bug#11375).
5654 2012-05-02 Eli Zaretskii <eliz@gnu.org>
5656 * xdisp.c (pos_visible_p): If already at a newline from the
5657 display string before the 'while' loop, don't walk back the glyphs
5658 from it3.glyph_row. Solves assertion violation when the display
5659 string begins with a newline (egg.el). (Bug#11367)
5661 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
5663 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
5666 2012-05-01 Glenn Morris <rgm@gnu.org>
5668 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
5669 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
5670 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
5671 All were removed before 23.1.
5673 * dispnew.c: Remove HAVE_LIBNCURSES test;
5674 it is always true on relevant platforms.
5676 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
5677 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
5679 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
5681 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
5683 * .gdbinit (xpr): Remove checks for no longer existing misc types.
5684 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
5687 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
5689 Do not avoid creating empty evaporating overlays (Bug#9642).
5690 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
5691 That is, do not delete an evaporating overlay if it becomes
5692 empty after its bounds are adjusted to fit within its buffer.
5693 This fix caused other problems, and I'm reverting it until we get
5694 to the bottom of them.
5696 2012-04-27 Chong Yidong <cyd@gnu.org>
5698 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
5700 2012-04-27 Eli Zaretskii <eliz@gnu.org>
5702 * xdisp.c (pos_visible_p): If the window start position is beyond
5703 ZV, start the display from buffer beginning. Prevents assertion
5704 violation in init_iterator when the minibuffer window is scrolled
5707 * window.c (window_scroll_pixel_based): Likewise.
5709 2012-04-27 Chong Yidong <cyd@gnu.org>
5711 * keymap.c (where_is_internal): Doc fix (Bug#10872).
5713 2012-04-27 Glenn Morris <rgm@gnu.org>
5715 * fileio.c (Fcopy_file, Fset_file_selinux_context):
5716 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
5718 2012-04-27 Eli Zaretskii <eliz@gnu.org>
5720 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
5721 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
5723 2012-04-26 Eli Zaretskii <eliz@gnu.org>
5725 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
5726 display element, check also the underlying string or buffer
5727 character. (Bug#11341)
5729 * w32menu.c: Include w32heap.h.
5730 (add_menu_item): If the call to AppendMenuW (via
5731 unicode_append_menu) fails, disable Unicode menus only if we are
5732 running on Windows 9X/Me.
5734 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
5736 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
5737 (xgetint): Add missing shift for LSB tags.
5739 2012-04-24 Martin Rudalics <rudalics@gmx.at>
5741 * keyboard.c (read_char): Don't wipe echo area for select window
5742 events: These might get delayed via `mouse-autoselect-window'
5745 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
5747 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
5748 manipulation of :loaded-from data.
5750 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
5752 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
5753 now a cons (bug#11311).
5755 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
5757 Do not create empty overlays with the evaporate property (Bug#9642).
5758 * buffer.c (Fmove_overlay): Delete an evaporating overlay
5759 if it becomes empty after its bounds are adjusted to fit within
5760 its buffer. Without this fix, in a nonempty buffer (let ((o
5761 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
5762 yields an empty overlay that has the evaporate property, which is
5763 not supposed to happen.
5765 Fix minor GTK3 problems found by static checking.
5766 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
5767 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
5768 (struct _EmacsFixedClass, emacs_fixed_get_type):
5769 Move decls here from emacsgtkfixed.h, since they needn't be public.
5770 (emacs_fixed_get_type): Now static.
5771 (emacs_fixed_class_init): Omit unused local.
5772 (emacs_fixed_child_type): Remove; unused.
5773 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
5774 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
5775 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
5776 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
5777 (EMACS_FIXED_GET_CLASS): Remove; unused.
5778 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
5780 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
5781 Problem reported by Juanma Barranquero for Windows -Wunused-function.
5783 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
5785 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
5786 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
5787 (__malloc_size_t, __malloc_ptrdiff_t):
5788 Remove. All uses removed, replaced by the definiens if needed,
5789 since we can assume C89 or better now.
5790 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
5791 (protect_malloc_state, align, get_contiguous_space)
5792 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
5793 (malloc_atfork_handler_child, malloc_enable_thread)
5794 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
5795 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
5796 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
5797 (special_realloc, _realloc_internal_nolock, _realloc_internal)
5798 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
5799 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
5800 Define using prototypes, not old style.
5801 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
5802 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
5803 (align): Don't assume that signed integer overflow wraps around.
5804 Omit unused local var.
5805 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
5806 (_free_internal_nolock, memalign, mallochook, reallochook):
5807 Omit no-longer-needed casts.
5808 (valloc): Use getpagesize, not __getpagesize.
5809 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
5810 (struct hdr): The 'magic' member is now size_t, not unsigned long.
5812 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
5814 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
5816 Move functions from C to Lisp. Make non-blocking method calls
5817 the default. Implement further D-Bus standard interfaces.
5819 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
5820 (QCdbus_request_name_allow_replacement)
5821 (QCdbus_request_name_replace_existing)
5822 (QCdbus_request_name_do_not_queue)
5823 (QCdbus_request_name_reply_primary_owner)
5824 (QCdbus_request_name_reply_in_queue)
5825 (QCdbus_request_name_reply_exists)
5826 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
5827 (QCdbus_registered_serial, QCdbus_registered_method)
5828 (QCdbus_registered_signal): New Lisp objects.
5829 (XD_DEBUG_MESSAGE): Use sizeof.
5830 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
5831 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
5832 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
5833 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
5834 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
5835 (xd_signature, xd_append_arg): Allow float for integer types.
5836 (xd_get_connection_references): New function.
5837 (xd_get_connection_address): Rename from xd_initialize.
5838 Return cached address.
5839 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
5840 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
5842 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
5843 Return number of refcounts.
5844 (Fdbus_get_unique_name): Make stronger parameter check.
5845 (Fdbus_message_internal): New defun.
5846 (Fdbus_call_method, Fdbus_call_method_asynchronously)
5847 (Fdbus_method_return_internal, Fdbus_method_error_internal)
5848 (Fdbus_send_signal, Fdbus_register_service)
5849 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
5850 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
5851 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
5852 (Vdbus_compiled_version, Vdbus_runtime_version)
5853 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
5854 (Vdbus_message_type_method_return, Vdbus_message_type_error)
5855 (Vdbus_message_type_signal): New defvars.
5856 (Vdbus_registered_buses, Vdbus_registered_objects_table):
5859 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
5861 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
5862 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
5863 Do not assume ptrdiff_t is the same width as 'int'.
5865 * alloc.c: Handle unusual debugging option combinations.
5866 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
5867 since the two debugging options are incompatible.
5868 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
5870 (mem_init, mem_insert, mem_insert_fixup):
5871 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
5872 (NEED_MEM_INSERT): Remove; no longer needed.
5874 2012-04-22 Leo Liu <sdl.web@gmail.com>
5876 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
5878 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
5880 * sysdep.c [__FreeBSD__]: Minor cleanups.
5881 (list_system_processes, system_process_attributes) [__FreeBSD__]:
5882 Use Emacs indenting style more consistently. Avoid some casts.
5883 Use 'double' consistently rather than mixing 'float' and 'double'.
5885 2012-04-21 Eduard Wiebe <usenet@pusto.de>
5887 * sysdep.c (list_system_processes, system_process_attributes):
5888 Add implementation for FreeBSD (Bug#5243).
5890 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
5892 * lisp.mk (lisp): Update.
5894 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
5896 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
5897 It is never used otherwise.
5899 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
5901 * print.c (print_preprocess): Only check print_depth if print-circle
5903 (print_object): Check for cycles even when print-circle is nil and
5904 print-gensym is t, but only check print_depth if print-circle is nil.
5906 2012-04-20 Chong Yidong <cyd@gnu.org>
5908 * process.c (wait_reading_process_output): If EIO occurs on a pty,
5909 set the status to "failed" and ensure that sentinel is run.
5911 2012-04-20 Glenn Morris <rgm@gnu.org>
5913 * process.c (Fset_process_inherit_coding_system_flag)
5914 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
5915 (Fmake_network_process, Fmake_serial_process): Doc fix.
5917 2012-04-20 Eli Zaretskii <eliz@gnu.org>
5919 * xdisp.c (string_buffer_position_lim): Limit starting position to
5921 (set_cursor_from_row): If called for a mode-line or header-line
5922 row, return zero immediately.
5923 (try_cursor_movement): If inside continuation line, don't back up
5924 farther than the first row after the header line, if any.
5925 Don't consider the header-line row as "partially visible", even if
5926 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
5928 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
5930 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
5933 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
5934 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
5936 configure: new option --enable-gcc-warnings (Bug#11207)
5937 * Makefile.in (C_WARNINGS_SWITCH): Remove.
5938 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
5939 (ALL_CFLAGS): Use new macros rather than old.
5940 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
5941 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
5942 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
5943 -Wunused-result, -Wunused-variable. This should go away once
5944 the Emacs and Gnulib regex code is merged.
5945 (xmalloc, xrealloc): Now static.
5947 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
5949 * dired.c (Fsystem_groups): Remove unused local.
5951 2012-04-17 Glenn Morris <rgm@gnu.org>
5953 * dired.c (Fsystem_users): Doc fix.
5955 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
5957 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
5958 (syms_of_dired): Add them.
5960 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
5962 Fix minor alloc.c problems found by static checking.
5963 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
5964 New extern decls, to avoid calling undeclared functions.
5965 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
5966 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
5967 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
5968 (NEED_MEM_INSERT): New macro.
5969 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
5970 Remove one incorrect comment and fix another.
5972 Fix minor ralloc.c problems found by static checking.
5973 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
5974 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
5975 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
5976 (r_alloc_sbrk): Now static.
5978 Improve ralloc.c interface checking.
5979 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
5980 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
5981 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
5982 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
5983 [REL_ALLOC]: ... to here, to check interface.
5984 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
5985 Remove decls. This fixes an "It stinks!".
5987 * alloc.c (which_symbols): Fix alignment issue / type clash.
5989 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
5991 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
5992 (struct Lisp_Misc_Any): Likewise.
5993 (struct Lisp_Free): Likewise.
5994 * alloc.c (union aligned_Lisp_Symbol): Define.
5995 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
5996 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
5997 (union aligned_Lisp_Misc): Define.
5998 (MARKER_BLOCK_SIZE, struct marker_block): Use union
5999 aligned_Lisp_Misc instead of union Lisp_Misc.
6000 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
6002 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
6004 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
6005 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
6006 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
6007 * s/netbsd.h, s/sol2-6.h:
6008 Remove definition of GC_MARK_STACK, since the default now works.
6009 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
6010 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
6011 no longer the default.
6012 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
6014 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
6016 * lread.c (lisp_file_lexically_bound_p):
6017 Fix hang at ";-*-\n" (bug#11238).
6019 2012-04-14 Eli Zaretskii <eliz@gnu.org>
6021 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
6022 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
6024 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
6026 * nsterm.m (constrainFrameRect): Always constrain when there is only
6027 one screen (Bug#10962).
6029 2012-04-13 Ken Brown <kbrown@cornell.edu>
6031 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
6033 2012-04-13 Reuben Thomas <rrt@sc3d.org>
6035 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
6037 2012-04-11 Daniel Colascione <dancol@dancol.org>
6039 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
6040 against is gone. It's better to use vfork now so that when Cygwin
6041 gains a new, working vfork, we use it automatically (bug#10398).
6043 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
6045 * window.c (save_window_save): Obey window-point-insertion-type.
6047 2012-04-11 Glenn Morris <rgm@gnu.org>
6049 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
6051 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
6053 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
6055 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6057 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
6058 (force_quit_count): New var.
6059 (handle_interrupt): Use it.
6061 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
6063 * w32.c (w32_delayed_load): Record the full path of the library
6064 being loaded (bug#10424).
6066 2012-04-09 Glenn Morris <rgm@gnu.org>
6068 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
6069 not just in the obarray, before snarfing them. (Bug#11036)
6071 * Makefile.in ($(leimdir)/leim-list.el):
6072 Pass EMACS rather than BUILT_EMACS.
6074 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
6076 * process.c (make_process):
6077 * process.h: Add integer `gnutls_handshakes_tried' member to
6080 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
6081 Add convenience `GNUTLS_LOG2i' macro.
6083 * gnutls.c (gnutls_log_function2i): Convenience log function.
6084 (emacs_gnutls_read): Use new log functions,
6085 `gnutls_handshakes_tried' process member, and
6086 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
6087 attempts per process (connection).
6089 2012-04-09 Chong Yidong <cyd@gnu.org>
6091 * eval.c (Fuser_variable_p, user_variable_p_eh)
6092 (lisp_indirect_variable): Functions deleted.
6093 (Fdefvar): Caller changed.
6095 * callint.c (Finteractive, Fcall_interactively):
6096 * minibuf.c (Fread_variable): Callers changed.
6098 2012-04-09 Eli Zaretskii <eliz@gnu.org>
6100 * xdisp.c (set_cursor_from_row): If the display string appears in
6101 the buffer at position that is closer to point than the position
6102 after the display string, display the cursor on the first glyph of
6103 the display string. Fixes cursor display when a 'display' text
6104 property immediately follows invisible text. (Bug#11094)
6106 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
6108 composite.c: use 'double' consistently
6109 * composite.c (get_composition_id): Use 'double' consistently
6110 instead of converting 'float' to 'double' and vice versa; this is
6111 easier to understand and avoids a GCC warning.
6113 2012-04-09 Glenn Morris <rgm@gnu.org>
6115 * Makefile.in: Generate leim-list with bootstrap-emacs, in
6116 preparation for dumping it with emacs. (Bug#4789)
6117 (leimdir): New variable.
6118 ($(leimdir)/leim-list.el): New rule.
6119 (emacs$(EXEEXT)): Depend on leim-list.el.
6121 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
6122 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
6123 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
6125 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
6127 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
6130 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
6132 * xml.c (init_libxml2_functions) [WINDOWSNT]:
6133 Remove unused local variable.
6135 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
6137 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
6138 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
6139 (mark_memory): Mark Lisp_Objects only if pointers might hide in
6140 objects, as mark_maybe_pointer will catch them otherwise.
6141 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
6142 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
6144 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
6146 Fix typo that broke non-Windows builds.
6147 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
6149 2012-04-07 Eli Zaretskii <eliz@gnu.org>
6151 Support building on MS-Windows with libxml2.
6153 * makefile.w32-in (OBJ2): Add xml.$(O).
6154 (GLOBAL_SOURCES): Add xml.c.
6155 ($(BLD)/xml.$(O)): New dependency list.
6157 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
6158 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
6159 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
6160 [!WINDOWSNT]: New macros.
6161 (init_libxml2_functions, libxml2_loaded_p): New functions.
6162 (parse_region): Call fn_xmlCheckVersion instead of using the macro
6163 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
6164 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
6165 Calls xmlCleanupParser only if libxml2 was loaded (or statically
6167 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
6168 Call init_libxml2_functions before calling libxml2 functions.
6169 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
6171 * emacs.c: Don't include libxml/parser.h.
6172 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
6173 xmlCleanupParser directly.
6175 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
6177 2012-04-07 Eli Zaretskii <eliz@gnu.org>
6179 * indent.c (Fvertical_motion): If there is a display string at
6180 point, use it.vpos to compute how many lines to backtrack after
6181 move_it_to point. (Bug#11133)
6183 2012-04-06 Eli Zaretskii <eliz@gnu.org>
6185 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
6186 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
6187 about subtle differences between FETCH_CHAR* and STRING_CHAR*
6188 macros related to unification of CJK characters. For the details,
6189 see the discussion following the message here:
6190 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
6192 2012-04-04 Chong Yidong <cyd@gnu.org>
6194 * keyboard.c (Vdelayed_warnings_list): Doc fix.
6196 2012-04-01 Eli Zaretskii <eliz@gnu.org>
6198 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
6199 instead of alloca. (Bug#11138)
6201 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
6203 * w32menu.c (is_simple_dialog): Properly check lisp types.
6206 2012-03-31 Eli Zaretskii <eliz@gnu.org>
6208 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
6209 position we get to after a call to move_it_to fails the
6210 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
6211 only if we wind up in a string from display property. (Bug#11063)
6213 * window.c (Fdelete_other_windows_internal): Invalidate the row
6214 and column information about mouse highlight, so that redisplay
6215 restores it after reallocating the glyph matrices. (Bug#7464)
6217 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
6218 string comes from a `display' text property, use the buffer
6219 position of that property as if we actually saw that position in
6221 (move_it_by_lines): Remove the assertion that
6222 "it->current_x == 0 && it->hpos == 0" which can be legitimately
6223 violated when there's a before-string at the beginning of a line.
6226 2012-03-30 Eli Zaretskii <eliz@gnu.org>
6228 * xdisp.c (append_space_for_newline): If the default face was
6229 remapped, use the remapped face for the appended newline.
6230 (extend_face_to_end_of_line): Use the remapped default face for
6231 extending the face to the end of the line.
6232 (display_line): Call extend_face_to_end_of_line when the default
6233 face was remapped. (Bug#11068)
6235 2012-03-29 Eli Zaretskii <eliz@gnu.org>
6237 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
6239 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
6241 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
6243 2012-03-27 Glenn Morris <rgm@gnu.org>
6245 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
6248 2012-03-26 Kenichi Handa <handa@m17n.org>
6250 * dispextern.h (struct glyph): Fix previous change. Change the
6251 bit length of glyphless.ch to 25 (Bug#11082).
6253 2012-03-26 Chong Yidong <cyd@gnu.org>
6255 * keyboard.c (Vselection_inhibit_update_commands): New variable.
6256 (command_loop_1): Use it; inhibit selection update for
6257 handle-select-window too (Bug#8996).
6259 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
6261 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
6263 2012-03-25 Kenichi Handa <handa@m17n.org>
6265 * dispextern.h (struct glyph): Change the bit length of
6266 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
6268 2012-03-24 Eli Zaretskii <eliz@gnu.org>
6270 * s/ms-w32.h (tzname): Include time.h before redirecting to
6271 _tzname. Fixes the MSVC build. (Bug#9960)
6273 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
6275 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
6278 * xterm.c (XTread_socket): Only modify handling_signal if
6279 !SYNC_INPUT. (Bug#11080)
6281 2012-03-23 Eli Zaretskii <eliz@gnu.org>
6283 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
6284 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
6285 when fetching a multibyte character consumes more bytes than
6286 CHAR_BYTES returns, due to unification of CJK characters in
6287 string_char. (Bug#11073)
6289 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
6291 * process.c (wait_reading_process_output): Handle pty disconnect
6292 by refraining from sending oneself a SIGCHLD (bug#10933).
6294 2012-03-22 Chong Yidong <cyd@gnu.org>
6296 * dispextern.h (struct it): New member string_from_prefix_prop_p.
6298 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
6299 Mark string as coming from a prefix property.
6300 (handle_face_prop): Use default face for prefix strings (Bug#4281).
6301 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
6303 2012-03-21 Chong Yidong <cyd@gnu.org>
6305 * xfaces.c (Vface_remapping_alist): Doc fix.
6307 2012-03-20 Eli Zaretskii <eliz@gnu.org>
6309 * w32proc.c (Fw32_set_console_codepage)
6310 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
6313 2012-03-20 Chong Yidong <cyd@gnu.org>
6315 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
6316 to reflect default non-nil value of redisplay-dont-pause.
6318 2012-03-19 Kenichi Handa <handa@m17n.org>
6320 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
6321 it fit in a valid range (Bug#11003).
6323 2012-03-18 Eli Zaretskii <eliz@gnu.org>
6325 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
6326 that is not from display property, accept the row as a "cursor
6327 row" if one of the string's character has a non-nil `cursor'
6328 property. Fixes cursor positioning when there are newlines in
6329 overlay strings, e.g. in icomplete.el. (Bug#11035)
6331 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
6333 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
6335 2012-03-12 Chong Yidong <cyd@gnu.org>
6337 * eval.c (inhibit_lisp_code): Rename from
6338 inhibit_window_configuration_change_hook; move from window.c.
6340 * xfns.c (unwind_create_frame_1, Fx_create_frame):
6341 * window.c (run_window_configuration_change_hook)
6342 (syms_of_window): Callers changed.
6344 2012-03-11 Chong Yidong <cyd@gnu.org>
6346 * keymap.c (Fkey_description): Doc fix (Bug#9700).
6348 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
6350 2012-03-10 Chong Yidong <cyd@gnu.org>
6352 * frame.c (other_visible_frames): Don't assume the selected frame
6353 is visible (Bug#10955).
6355 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
6357 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
6359 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
6361 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
6362 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
6365 2012-03-03 Glenn Morris <rgm@gnu.org>
6367 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
6369 2012-03-02 Eli Zaretskii <eliz@gnu.org>
6371 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
6372 position past the first glyph_row that ends at ZV. (Bug#10902)
6373 (redisplay_window, next_element_from_string): Fix typos in
6375 (redisplay_window): Pass to move_it_vertically the margin in
6376 pixels, not in screen lines.
6378 2012-03-02 Glenn Morris <rgm@gnu.org>
6380 * buffer.c (buffer-list-update-hook): Doc fix.
6382 2012-02-29 Eli Zaretskii <eliz@gnu.org>
6384 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
6385 push_it before setting up the iterator for the first overlay
6386 string, even if we have an empty string loaded.
6387 (next_overlay_string): If there's an empty string on the iterator
6388 stack, pop the stack. (Bug#10903)
6390 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
6392 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
6393 Suggested by Stefan Monnier in
6394 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
6395 * alloc.c (widen_to_Lisp_Object): New static function.
6396 (mark_memory): Also mark Lisp_Objects by fetching pointer words
6397 and widening them to Lisp_Objects. This would work even if
6398 USE_LSB_TAG is defined and wide integers are used, which might
6399 happen in a future version of Emacs.
6401 2012-02-25 Chong Yidong <cyd@gnu.org>
6403 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
6406 * xselect.c (Fx_selection_exists_p): Doc fix.
6407 (x_clipboard_manager_save_all): Print an informative message
6408 before saving to clipboard manager.
6410 2012-02-24 Chong Yidong <cyd@gnu.org>
6412 * keyboard.c (process_special_events): Handle all X selection
6413 requests in kbd_buffer, not just the next one (Bug#8869).
6415 2012-02-23 Chong Yidong <cyd@gnu.org>
6417 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
6418 call when setting menu-bar-lines and tool-bar-lines parameters.
6419 (unwind_create_frame_1): New helper function.
6421 * window.c (inhibit_window_configuration_change_hook): New var.
6422 (run_window_configuration_change_hook): Obey it.
6423 (syms_of_window): Initialize it.
6425 2012-02-22 Chong Yidong <cyd@gnu.org>
6427 * xterm.c (x_draw_image_relief): Add missing type check for
6428 Vtool_bar_button_margin (Bug#10743).
6430 2012-02-21 Chong Yidong <cyd@gnu.org>
6432 * fileio.c (Vfile_name_handler_alist): Doc fix.
6434 * buffer.c (Fget_file_buffer): Protect against invalid file
6435 handler return value.
6437 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
6439 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
6440 when computing $valmask.
6442 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
6443 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
6444 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
6445 It's useless in that case, and it can cause problems on hosts
6446 that allocate halves of EMACS_INT values separately.
6447 Reported by Dan Horák. Diagnosed by Andreas Schwab in
6448 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
6449 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
6450 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
6451 it avoids undefined behavior on hosts where shifting right by more
6452 than the word width has undefined behavior.
6454 2012-02-19 Chong Yidong <cyd@gnu.org>
6456 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
6457 (Funhandled_file_name_directory, Ffile_name_as_directory)
6458 (Fdirectory_file_name, Fexpand_file_name)
6459 (Fsubstitute_in_file_name): Protect against invalid file handler
6460 return values (Bug#10845).
6462 2012-02-18 Eli Zaretskii <eliz@gnu.org>
6464 * .gdbinit (pitx): Fix incorrect references to fields of the
6467 2012-02-17 Chong Yidong <cyd@gnu.org>
6469 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
6471 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
6473 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
6474 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
6476 2012-02-15 Chong Yidong <cyd@gnu.org>
6478 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
6479 marked as special. Also, starting docstrings with * is obsolete.
6481 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
6483 * gnutls.c (emacs_gnutls_write): Fix last change.
6485 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
6487 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
6490 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
6492 * keymap.c (Fsingle_key_description): Handle char ranges.
6494 2012-02-12 Chong Yidong <cyd@gnu.org>
6496 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
6497 as that creates a dangerous corner case.
6499 * window.c (Fdelete_window_internal): Invalidate the mouse
6500 highlight (Bug#9904).
6502 2012-02-12 Glenn Morris <rgm@gnu.org>
6504 * xselect.c (Fx_own_selection_internal)
6505 (Fx_get_selection_internal, Fx_disown_selection_internal)
6506 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
6507 * nsselect.m (Fx_own_selection_internal)
6508 (Fx_disown_selection_internal, Fx_selection_exists_p)
6509 (Fx_selection_owner_p, Fx_get_selection_internal):
6510 Sync docs and argument specs with the xselect.c versions.
6512 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
6514 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
6516 2012-02-11 Eli Zaretskii <eliz@gnu.org>
6518 * w32select.c (Fx_selection_exists_p): Sync doc string and
6519 argument list with xselect.c. (Bug#10783)
6521 * w16select.c (Fx_selection_exists_p): Sync doc string and
6522 argument list with xselect.c. (Bug#10783)
6524 2012-02-10 Glenn Morris <rgm@gnu.org>
6526 * fns.c (Fsecure_hash): Doc fix.
6528 2012-02-09 Kenichi Handa <handa@m17n.org>
6530 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
6532 2012-02-07 Chong Yidong <cyd@gnu.org>
6534 * buffer.c (Fbuffer_local_variables)
6535 (buffer_lisp_local_variables): Handle unbound vars correctly;
6536 don't let Qunbound leak into Lisp.
6538 2012-02-07 Glenn Morris <rgm@gnu.org>
6540 * image.c (Fimagemagick_types): Doc fix.
6542 * image.c (imagemagick-render-type): Change it from a lisp object
6543 to an integer. Move the doc here from the lisp manual.
6544 Treat all values not equal to 0 the same.
6546 2012-02-06 Chong Yidong <cyd@gnu.org>
6548 * doc.c (store_function_docstring): Avoid applying docstring of
6549 alias to base function (Bug#2603).
6551 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
6553 * .gdbinit (pp1, pv1): Remove redundant defines.
6556 2012-02-04 Chong Yidong <cyd@gnu.org>
6558 * nsterm.m: Declare a global (Bug#10694).
6560 2012-02-04 Eli Zaretskii <eliz@gnu.org>
6562 * w32.c (get_emacs_configuration_options):
6563 Include --enable-checking, if specified, in the return value.
6565 2012-02-04 Martin Rudalics <rudalics@gmx.at>
6567 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
6568 after rounding frame sizes. (Bug#9723)
6570 2012-02-04 Eli Zaretskii <eliz@gnu.org>
6572 * keyboard.c (adjust_point_for_property): Don't position point
6573 before BEGV. (Bug#10696)
6575 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
6577 Handle overflow when computing char display width (Bug#9496).
6578 * character.c (char_width): Return EMACS_INT, not int.
6579 (char_width, c_string_width): Check for overflow when
6580 computing the width; this is possible now that individual
6581 characters can have unbounded width. Problem introduced
6582 by merge from Emacs 23 on 2012-01-19.
6584 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
6586 * dbusbind.c (Fdbus_register_method): Mention the return value
6587 :ignore in the docstring.
6589 2012-02-02 Glenn Morris <rgm@gnu.org>
6591 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
6593 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
6594 Unconditionally set to t. (Bug#10673)
6595 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
6596 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
6597 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
6599 2012-02-02 Kenichi Handa <handa@m17n.org>
6601 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
6602 0, do not call append_composite_glyph.
6604 2012-02-02 Kenichi Handa <handa@m17n.org>
6606 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
6608 (x_produce_glyphs): If the component of a composition is a null
6609 string, set it->pixel_width to 1 to avoid zero-width glyph.
6611 2012-02-01 Eli Zaretskii <eliz@gnu.org>
6613 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
6614 first 2 arguments are identical. This makes inserting large
6615 output from a subprocess an order of magnitude faster on
6616 MS-Windows, where all sbrk'ed memory is always contiguous.
6618 2012-01-31 Glenn Morris <rgm@gnu.org>
6620 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
6621 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
6622 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
6624 2012-01-29 Glenn Morris <rgm@gnu.org>
6626 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
6628 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
6630 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
6632 2012-01-28 Chong Yidong <cyd@gnu.org>
6634 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
6636 2012-01-26 Chong Yidong <cyd@gnu.org>
6638 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
6640 * search.c (Fsearch_forward, Fsearch_backward): Document negative
6641 repeat counts (Bug#10507).
6643 2012-01-26 Glenn Morris <rgm@gnu.org>
6645 * lread.c (syms_of_lread): Doc fix.
6647 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
6649 * coding.c (encode_designation_at_bol): Change return value to
6652 2012-01-25 Chong Yidong <cyd@gnu.org>
6654 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
6656 2012-01-21 Chong Yidong <cyd@gnu.org>
6658 * floatfns.c (Fcopysign): Make the second argument non-optional,
6659 since nil is not allowed anyway.
6661 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
6663 * process.c (read_process_output): Use p instead of XPROCESS (proc).
6664 (send_process): Likewise.
6666 2012-01-19 Martin Rudalics <rudalics@gmx.at>
6668 * window.c (save_window_save, Fcurrent_window_configuration)
6669 (Vwindow_persistent_parameters): Do not use Qstate.
6670 Rewrite doc-strings.
6672 2012-01-19 Kenichi Handa <handa@m17n.org>
6674 * character.c (char_width): New function.
6675 (Fchar_width, c_string_width, lisp_string_width):
6676 Use char_width (Bug#9496).
6678 2012-01-16 Martin Rudalics <rudalics@gmx.at>
6680 * window.c (Vwindow_persistent_parameters): New variable.
6681 (Fset_window_configuration, save_window_save): Handle persistent
6684 2012-01-14 Eli Zaretskii <eliz@gnu.org>
6686 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
6687 thrashing the stack of the thread. (Bug#9087)
6689 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
6691 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
6693 2012-01-11 Eli Zaretskii <eliz@gnu.org>
6695 * xdisp.c (rows_from_pos_range): Handle the case where the
6696 highlight ends on a newline. (Bug#10464)
6697 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
6698 he end column for display of highlight that ends on a newline
6701 2012-01-11 Glenn Morris <rgm@gnu.org>
6703 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
6704 from load-path also when installation-directory is nil. (Bug#10208)
6706 2012-01-10 Glenn Morris <rgm@gnu.org>
6708 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
6710 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
6711 Update template values to be closer to their typical values these days.
6713 2012-01-09 Eli Zaretskii <eliz@gnu.org>
6715 * xdisp.c (rows_from_pos_range): Accept additional argument
6716 DISP_STRING, and accept any glyph in a row whose object is that
6717 string as eligible for mouse highlight. Fixes mouse highlight of
6718 display strings from overlays. (Bug#10464)
6720 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
6722 emacs: fix an auto-save permissions race condition (Bug#10400)
6723 * fileio.c (auto_saving_dir_umask): New static var.
6724 (Fmake_directory_internal): Use it.
6725 (do_auto_save_make_dir): Set it, instead of invoking chmod after
6726 creating the directory. The old code temporarily assigns
6727 too-generous permissions to the directory.
6728 (do_auto_save_eh): Clear it.
6729 (Fdo_auto_save): Catch all errors, not just file errors, so
6730 that the var is always cleared.
6732 2012-01-07 Eli Zaretskii <eliz@gnu.org>
6734 * search.c (scan_buffer): Pass character positions to
6735 know_region_cache, not byte positions. (Bug#6540)
6737 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
6739 * w32.c (sys_rename): Report EXDEV when rename of a directory
6740 fails because the target is on another logical disk. (Bug#10284)
6742 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
6744 * xterm.c (x_embed_request_focus): New function.
6746 * xterm.h: Add prototype.
6748 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
6750 2012-01-05 Glenn Morris <rgm@gnu.org>
6752 * emacs.c (emacs_copyright): Update short copyright year to 2012.
6754 2012-01-01 Eli Zaretskii <eliz@gnu.org>
6756 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
6757 Load gnutls_transport_set_lowat only if GnuTLS version is below
6759 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
6760 GnuTLS versions below 2.11.1.
6762 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
6764 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
6765 to the doc string advising against its use for altering the way
6766 windows are scrolled.
6768 2011-12-28 Kenichi Handa <handa@m17n.org>
6770 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
6771 coding-system ASCII compatible only when it does not produce BOM
6772 on encoding (Bug#10383).
6774 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
6776 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
6778 (create_and_show_popup_menu): Always use menu_position_func for
6781 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
6783 * callint.c (Fcall_interactively): Don't truncate prompt string.
6785 2011-12-23 Eli Zaretskii <eliz@gnu.org>
6787 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
6788 property that ends at ZV, so that the bidi iteration could be
6789 resumed from there (after widening). (Bug#10360)
6791 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
6793 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
6795 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
6797 * nsterm.m (x_free_frame_resources):
6798 Release f->output_data.ns->miniimage.
6799 (ns_index_color): Fix indentation. Do not retain
6800 color_table->colors[i].
6802 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
6805 * nsfns.m (x_set_background_color): Assign return value from
6806 ns_index_color to face-background instead of NSColor*.
6807 (ns_implicitly_set_icon_type): Fix indentation.
6808 Change assignment in for loop to comparison.
6810 * emacs.c (ns_pool): New variable.
6811 (main): Assign ns_pool.
6812 (Fkill_emacs): Call ns_release_autorelease_pool.
6814 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
6815 autorelease fdesc, release fdAttrs and tdict.
6816 (ns_get_covering_families): Release charset.
6817 (ns_findfonts): Release NSFontDescriptor created with new.
6818 (ns_uni_to_glyphs): Fix indentation.
6819 (setString): Release attrStr before assigning new value.
6821 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
6823 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
6825 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
6826 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
6828 2011-12-18 David Reitter <reitter@cmu.edu>
6830 * nsterm.m (ns_term_init): Subscribe for notifications
6831 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
6832 to method trackingNotification in EmacsMenu.
6834 * nsmenu.m (trackingMenu): New variable.
6835 (trackingNotification): New method (from Aquamacs).
6836 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
6837 from Aquamacs (Bug#7030).
6839 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
6841 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
6842 (symbol_to_nsstring): Fix indentation.
6843 (ns_symbol_to_pb): New function.
6844 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
6845 (Fns_rotate_cut_buffers_internal): Remove.
6846 (Fns_store_selection_internal): Rename from
6847 Fns_store_cut_buffer_internal.
6848 (ns_get_foreign_selection, Fx_own_selection_internal)
6849 (Fx_disown_selection_internal, Fx_selection_exists_p)
6850 (Fns_get_selection_internal, Fns_store_selection_internal):
6851 Use ns_symbol_to_pb and check if return value is nil.
6852 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
6853 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
6854 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
6855 renamed to Sns_store_selection_internal.
6856 (ns_handle_selection_request): Move code to Fx_own_selection_internal
6857 and remove this function.
6858 (ns_handle_selection_clear): Remove, never used.
6859 (Fx_own_selection_internal): Move code from ns_handle_selection_request
6862 2011-12-17 Ken Brown <kbrown@cornell.edu>
6864 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
6865 GID is unknown (Bug#10257).
6867 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
6869 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
6870 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
6871 which caused a build failure on GNU/Linux IA-64. This problem was
6872 introduced by my 2011-10-07 patch.
6874 2011-12-15 Juri Linkov <juri@jurta.org>
6876 * image.c (imagemagick_error): New function. (Bug#10112)
6877 (imagemagick_load_image): Comment out `MagickSetResolution' call.
6878 Use `imagemagick_error' where ImageMagick functions return
6880 (Fimagemagick_types): Add `Fnreverse' to return the list in the
6883 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6885 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
6886 fill background (Bug#8992).
6888 2011-12-13 Martin Rudalics <rudalics@gmx.at>
6890 * window.c (Vwindow_combination_resize)
6891 (Vwindow_combination_limit): Use t instead of non-nil in
6893 (Vrecenter_redisplay): Add first sentence of doc-string on
6895 (Frecenter): Fix doc-string typo.
6897 2011-12-11 Kenichi Handa <handa@m17n.org>
6899 * coding.c (Funencodable_char_position): Pay attention to the
6900 buffer text relocation (Bug#9389).
6902 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
6904 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
6905 gtk_init (Bug#10100).
6907 2011-12-10 Eli Zaretskii <eliz@gnu.org>
6909 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
6910 IT->string is nil. (Bug#10263)
6912 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
6914 * nsterm.h (x_free_frame_resources): Declare.
6916 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
6917 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
6919 * nsterm.h (ns_get_defaults_value): Declare.
6921 * nsterm.m (ns_default): Call ns_get_defaults_value.
6923 2011-12-09 Eli Zaretskii <eliz@gnu.org>
6925 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
6928 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6930 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
6931 that where the value of an _OBJC_* symbol points to is in the .bss
6932 section (Bug#10240).
6934 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
6936 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
6937 after the loop to call ccl_driver at least once (Bug#8619).
6939 2011-12-08 Kenichi Handa <handa@m17n.org>
6941 * ftfont.c (get_adstyle_property): Fix previous change
6944 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
6946 * w32.c (init_environment): If no_site_lisp, remove site-lisp
6947 dirs from the default value of EMACSLOADPATH (bug#10208).
6949 2011-12-07 Glenn Morris <rgm@gnu.org>
6951 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
6952 installation and source directories as well. (Bug#10208)
6954 2011-12-06 Chong Yidong <cyd@gnu.org>
6956 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
6958 2011-12-06 Glenn Morris <rgm@gnu.org>
6960 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
6961 as an error, not just -1. (Bug#10217)
6963 2011-12-05 Chong Yidong <cyd@gnu.org>
6965 * keyboard.c (process_special_events): New function.
6966 (swallow_events, Finput_pending_p): Use it (Bug#10195).
6968 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
6970 * coding.c (encode_designation_at_bol): Don't use uninitialized
6971 local variable (Bug#9318).
6973 2011-12-05 Kenichi Handa <handa@m17n.org>
6975 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
6976 return Qnil (Bug#8046, Bug#10193).
6978 2011-12-05 Kenichi Handa <handa@m17n.org>
6980 * coding.c (encode_designation_at_bol): New args charbuf_end and
6981 dst. Return the number of produced bytes. Callers changed.
6982 (coding_set_source): Return how many bytes coding->source was
6984 (coding_set_destination): Return how many bytes
6985 coding->destination was relocated.
6986 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
6987 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
6989 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
6991 * coding.c (CODING_CHAR_CHARSET_P): New macro.
6992 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
6995 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
6997 The following changes are to fix Bug#9318.
6999 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
7000 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
7001 (encode_coding_iso_2022, encode_coding_sjis)
7002 (encode_coding_big5, encode_coding_charset): Use the above macros.
7004 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
7006 * lisp.h (process_quit_flag): Fix external declaration.
7008 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
7010 Don't macro-inline non-performance-critical code.
7011 * eval.c (process_quit_flag): New function.
7012 * lisp.h (QUIT): Use it.
7014 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
7016 * nsfns.m (get_geometry_from_preferences): New function.
7017 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
7019 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
7021 * emacs.c (Qkill_emacs): Define.
7022 (syms_of_emacs): Initialize it.
7023 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
7024 Qquit_flag to `kill-emacs' instead.
7025 (quit_throw_to_read_char): Add parameter `from_signal'.
7026 All callers changed. Call Fkill_emacs if requested and safe.
7027 * lisp.h (QUIT): Call Fkill_emacs if requested.
7029 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
7031 * widget.c (update_wm_hints): Return if wmshell is null.
7032 (widget_update_wm_size_hints): New function.
7034 * widget.h (widget_update_wm_size_hints): Declare.
7036 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
7037 widget_update_wm_size_hints (Bug#10104).
7039 2011-12-03 Eli Zaretskii <eliz@gnu.org>
7041 * xdisp.c (handle_invisible_prop): If the invisible text ends just
7042 before a newline, prepare the bidi iterator for consuming the
7043 newline, and keep the current paragraph direction. (Bug#10183)
7044 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
7046 2011-12-02 Juri Linkov <juri@jurta.org>
7048 * search.c (Fword_search_regexp): New Lisp function created from
7049 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
7050 (Fword_search_backward, Fword_search_forward)
7051 (Fword_search_backward_lax, Fword_search_forward_lax):
7052 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
7053 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
7055 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
7057 * fileio.c (Finsert_file_contents): Move after-change-function call
7058 to before the "handled:" label, since all "goto handled" appear in
7059 cases where the *-change-functions have already been properly called
7062 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
7064 * keyboard.c (interrupt_signal): Don't call kill-emacs when
7065 waiting for input. (Bug#10169)
7067 2011-11-30 Eli Zaretskii <eliz@gnu.org>
7069 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
7070 verifies glyph row's hash code--we have just reallocated the
7071 glyphs, so their contents can be complete garbage. (Bug#10164)
7073 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
7075 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
7077 2011-11-30 Eli Zaretskii <eliz@gnu.org>
7079 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
7080 attributes are tested _before_ calling verify_row_hash, to protect
7081 against GCC re-ordering of the tests. (Bug#10164)
7083 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
7085 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
7087 * xterm.c (handle_one_xevent): Only set async_visible and friends
7088 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7089 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
7090 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
7092 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
7094 Remove GCPRO-related macros that exist only to avoid shadowing locals.
7095 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
7096 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
7097 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
7098 All uses changed to use GCPRO1 etc.
7099 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
7100 Revert to old implementation (i.e., before 2011-03-11).
7102 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7104 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
7105 of scroll runs so as to avoid assigning disabled bogus rows and
7106 unnecessary graphics copy operations.
7108 2011-11-27 Eli Zaretskii <eliz@gnu.org>
7110 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
7111 (snprintf) [_MSC_VER]: Redirect to _snprintf.
7112 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
7113 (malloc, free, realloc, calloc): Redirect to e_* only when
7116 * lisp.h (GCTYPEBITS): Move before first use.
7117 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
7118 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
7119 this macro definition.
7121 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
7124 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
7126 * gtkutil.c (xg_create_frame_widgets):
7127 Call gtk_window_set_has_resize_grip (FALSE) if that function is
7128 present with Gtk+ 2.0.
7130 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
7132 * fileio.c (Finsert_file_contents): Undo previous change; see
7133 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
7135 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
7137 Rename locals to avoid shadowing.
7138 * fileio.c (Finsert_file_contents):
7139 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
7140 * process.c (wait_reading_process_output):
7141 Rename inner 'proc' to 'p' to avoid shadowing.
7142 Indent for consistency with usual Emacs style.
7144 2011-11-25 Eli Zaretskii <eliz@gnu.org>
7146 * xdisp.c (redisplay_window): If cursor row is not fully visible
7147 after recentering, and scroll-conservatively is set to a large
7148 number, scroll window by a few more lines to make the cursor fully
7149 visible and out of scroll-margin. (Bug#10105)
7150 (start_display): Don't move to the next line if the display should
7151 start at a newline that is part of a display vector or an overlay
7154 2011-11-24 Juri Linkov <juri@jurta.org>
7156 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
7157 after the `MagickPingImage' call. (Bug#10112)
7159 2011-11-23 Chong Yidong <cyd@gnu.org>
7161 * window.c (Fcoordinates_in_window_p): Accept only live windows.
7163 2011-11-23 Martin Rudalics <rudalics@gmx.at>
7165 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
7166 making another buffer current. (Bug#10114)
7168 2011-11-23 Glenn Morris <rgm@gnu.org>
7170 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
7172 2011-11-23 Chong Yidong <cyd@gnu.org>
7174 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
7175 using it (Bug#5984).
7177 2011-11-22 Eli Zaretskii <eliz@gnu.org>
7179 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
7180 and header-lines, as they don't have one computed for them.
7183 * .gdbinit (prow): Make displayed values more self-explaining.
7184 Add row's hash code.
7186 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
7188 * process.c (wait_reading_process_output): Fix asynchrounous
7189 GnuTLS socket handling on some versions of the GnuTLS library.
7190 (wait_reading_process_output): Add comment and URL.
7192 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
7194 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
7196 2011-11-21 Chong Yidong <cyd@gnu.org>
7198 * window.c (Fnext_window, Fprevious_window): Doc fix.
7200 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
7202 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
7204 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
7206 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
7208 2011-11-20 Martin Rudalics <rudalics@gmx.at>
7210 * window.c (Fset_window_combination_limit): Rename argument
7212 (Vwindow_combination_limit): Remove "status" from doc-string.
7214 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
7216 * m/ibms390.h: Remove.
7217 * m/ibms390x.h: Don't include "ibms390.h".
7219 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
7221 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
7222 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
7224 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
7226 * casetab.c (Fset_case_table):
7227 * charset.c (Fcharset_after): Fix typos.
7229 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
7231 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
7232 Otherwise, valgrind does not work on some platforms.
7233 Problem reported by Andreas Schwab in
7234 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
7235 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
7236 is set, removing the need for VIRT_ADDRESS_VARIES.
7237 (PURE_P): Use a more-efficient implementation that needs just one
7238 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
7239 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
7240 to 4 (xorl, subq, cmpq, setbe).
7241 * alloc.c (pure): Always extern now, since that's the
7242 VIRT_ADDR_VARIES behavior.
7243 (PURE_POINTER_P): Use a single comparison, not two, for
7244 consistency with the new puresize.h.
7245 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
7246 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
7247 Remove VIRT_ADDR_VARIES no longer needed.
7249 2011-11-19 Eli Zaretskii <eliz@gnu.org>
7251 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
7252 (erase_phys_cursor, update_window_cursor, show_mouse_face)
7253 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
7254 behave as if the cursor position were at the window margin.
7256 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
7257 and the cursor position is out of bounds, behave as if the cursor
7258 position were at the window margin. (Bug#10075)
7260 2011-11-18 Chong Yidong <cyd@gnu.org>
7262 * window.c (Fwindow_combination_limit): Make first argument
7263 non-optional, since it is meaningless for live windows like the
7266 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
7268 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
7270 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
7272 * intervals.c: Fix grafting over the whole buffer (bug#10071).
7273 (graft_intervals_into_buffer): Simplify.
7275 2011-11-18 Eli Zaretskii <eliz@gnu.org>
7277 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
7278 hash values of the two rows.
7279 (copy_row_except_pointers): Preserve the used[] arrays and the
7280 hash values of the two rows. (Bug#10035)
7281 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
7283 * xdisp.c (row_hash): New function, body extracted from
7284 compute_line_metrics.
7285 (compute_line_metrics): Call row_hash, instead of computing the
7288 * dispnew.c (verify_row_hash): Call row_hash for computing the
7289 hash code of a row, instead of duplicating code from xdisp.c.
7291 * dispextern.h (row_hash): Add prototype.
7293 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
7295 * frame.c (delete_frame): Don't delete the terminal when the last
7296 X frame is closed if emacs is built with GTK toolkit.
7298 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
7300 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
7302 2011-11-17 Martin Rudalics <rudalics@gmx.at>
7304 * window.c (Vwindow_splits): Rename to
7305 Vwindow_combination_resize. Suggested by Juri Linkov.
7306 (Fsplit_window_internal): Use Vwindow_combination_resize instead
7309 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
7311 * nsfns.m (Fns_font_name):
7312 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
7314 2011-11-16 Martin Rudalics <rudalics@gmx.at>
7316 * window.h (window): Rename slot "nest" to "combination_limit".
7317 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
7318 (Fset_window_nest): Rename to Fset_window_combination_limit.
7319 (Vwindow_nest): Rename to Vwindow_combination_limit.
7320 (recombine_windows, make_parent_window, make_window)
7321 (Fsplit_window_internal, saved_window)
7322 (Fset_window_configuration, save_window_save): Rename all
7323 occurrences of window_nest to window_combination_limit.
7325 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
7327 * image.c (imagemagick_load_image): Fix typo.
7329 2011-11-14 Eli Zaretskii <eliz@gnu.org>
7331 * xdisp.c (display_line): Move the call to
7332 highlight_trailing_whitespace before the call to
7333 compute_line_metrics, since the latter needs to see the final
7334 faces of all the glyphs to compute ROW's hash value.
7335 Fixes assertion violations in row_equal_p. (Bug#10035)
7337 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
7339 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
7340 just return (bug#10044).
7342 2011-11-12 Eli Zaretskii <eliz@gnu.org>
7344 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
7345 with user-defined heap size. Bump the default size of the temacs
7346 heap to 27MB, to avoid memory warning when running temacs.
7347 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
7349 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
7350 current_matrix and desired_matrix. (Bug#9990)
7351 (verify_row_hash) [XASSERTS]: New function.
7352 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
7353 that the hash value of glyph rows is correct.
7355 2011-11-12 Martin Rudalics <rudalics@gmx.at>
7357 * window.h (window): Remove splits slot.
7358 * window.c (Fwindow_splits, Fset_window_splits): Remove.
7359 (Fdelete_other_windows_internal, make_parent_window)
7360 (make_window, Fsplit_window_internal, Fdelete_window_internal)
7361 (Fset_window_configuration, save_window_save): Don't deal with
7362 split status of windows.
7363 (saved_window): Remove splits slot.
7364 (Vwindow_splits): Rewrite doc-string.
7366 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
7368 * xfns.c (unwind_create_frame):
7369 * nsfns.m (unwind_create_frame):
7370 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
7371 Vframe_list (Bug#9999).
7373 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
7375 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
7377 2011-11-11 Kenichi Handa <handa@m17n.org>
7379 * callproc.c (Fcall_process): Set the member dst_multibyte of
7382 2011-11-11 Johan Bockgård <bojohan@gnu.org>
7384 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
7385 avoid a crash (bug#9496).
7387 2011-11-09 Chong Yidong <cyd@gnu.org>
7389 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
7390 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
7392 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
7394 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
7396 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
7398 Avoid some portability problems by eschewing 'extern inline' functions.
7399 The trivial performance wins aren't worth the portability hassles; see
7400 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
7402 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
7403 (window_box_width, window_box_left, window_box_left_offset)
7404 (window_box_right, window_box_right_offset): Undo previous change,
7405 by removing the "extern"s.
7406 * intervals.c (adjust_intervals_for_insertion)
7407 (adjust_intervals_for_deletion): Undo previous change,
7408 making these static again.
7409 (offset_intervals, temp_set_point_both, temp_set_point)
7410 (copy_intervals_to_string): No longer inline.
7411 * xdisp.c (window_text_bottom_y, window_box_width)
7412 (window_box_height, window_box_left_offset)
7413 (window_box_right_offset, window_box_left, window_box_right)
7414 (window_box): No longer inline.
7416 2011-11-08 Chong Yidong <cyd@gnu.org>
7418 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
7419 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
7420 Signal an error if not a live window.
7421 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
7422 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
7424 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
7426 * lisp.h (syms_of_abbrev): Remove declaration.
7427 Reported by CHENG Gao <chenggao@royau.me>.
7429 2011-11-07 Eli Zaretskii <eliz@gnu.org>
7431 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
7432 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
7433 of temacs in GUI mode.
7435 2011-11-07 Martin Rudalics <rudalics@gmx.at>
7437 * window.h: Declare delete_all_child_windows instead of
7438 delete_all_subwindows.
7439 * window.c (Fwindow_nest, Fset_window_nest)
7440 (Fset_window_new_total, Fset_window_new_normal)
7441 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
7442 (delete_all_subwindows): Rename to delete_all_child_windows.
7443 (Fdelete_other_windows_internal, Fset_window_configuration):
7444 Call delete_all_child_windows instead of delete_all_subwindows.
7445 * frame.c (delete_frame): Call delete_all_child_windows instead
7446 of delete_all_subwindows.
7448 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
7450 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
7451 This is also needed for porting to any host where GC_MARK_STACK is
7452 not GC_MAKE_GCPROS_NOOPS.
7453 (which_symbols): Use it.
7455 2011-11-07 Kenichi Handa <handa@m17n.org>
7457 * coding.c (coding_set_destination): Check coding->src_pos only
7458 when coding->src_object is a buffer (bug#9910).
7460 * process.c (send_process): Set the member src_multibyte of coding
7461 to 0 (bug#9911) when sending a unibyte text.
7463 * callproc.c (Fcall_process): Set the member src_multibyte of
7464 process_coding to 0 (bug#9912).
7466 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7468 * xmenu.c (cleanup_widget_value_tree): New function.
7469 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
7470 calling free_menubar_widget_value_tree directly (Bug#9830).
7472 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
7474 Fix some portability problems with 'inline'.
7475 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
7476 (window_box_width, window_box_left, window_box_left_offset)
7477 (window_box_right, window_box_right_offset): Declare extern.
7478 Otherwise, these inline functions do not conform to C99 and
7479 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
7480 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
7481 * intervals.c (adjust_intervals_for_insertion)
7482 (adjust_intervals_for_deletion): Now extern, because otherwise the
7483 extern inline functions 'offset_intervals' couldn't refer to it.
7484 (static_offset_intervals): Remove.
7485 (offset_intervals): Rewrite using the old contents of
7486 static_offset_intervals. The old version didn't conform to C99
7487 because an extern inline function contained a reference to an
7488 identifier with static linkage.
7490 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
7492 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
7495 2011-11-06 Eli Zaretskii <eliz@gnu.org>
7497 * xdisp.c (init_iterator, reseat_to_string): Don't set the
7498 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
7499 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
7500 return Qleft_to_right.
7502 2011-11-06 Chong Yidong <cyd@gnu.org>
7504 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
7505 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
7506 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
7507 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
7508 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
7509 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
7510 (Fwindow_vscroll): Doc fix.
7511 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
7512 argument, since it makes no sense to pass a live window and for
7513 consistency with window-child.
7515 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
7517 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
7520 2011-11-05 Jason Rumney <jasonr@gnu.org>
7522 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
7523 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
7525 (add_font_entity_to_list): Fix logic errors in mixed boolean and
7526 bitwise arithmetic preventing use of unicode-sip and non-truetype
7529 2011-11-05 Eli Zaretskii <eliz@gnu.org>
7531 * s/ms-w32.h (fstat, stat, utime): Move redirections to
7534 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
7535 initialization code to keep similarity to xfns.c after changes
7538 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
7540 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
7541 (unwind_create_frame): New function (Bug#9943).
7542 (Fx_create_frame): Restructure code to be more similar to the one in
7543 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
7544 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
7545 Move terminal->reference_count++ just before making the frame official
7548 * nsterm.m (x_free_frame_resources): New function.
7549 (x_destroy_window): Move code to x_free_frame_resources.
7551 * xfns.c (unwind_create_frame): Fix comment.
7552 (Fx_create_frame, x_create_tip_frame):
7553 Move terminal->reference_count++ just before making the frame
7554 official. Move initialization of image_cache_refcount and
7555 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
7557 2011-11-05 Eli Zaretskii <eliz@gnu.org>
7559 Support MSVC build with newer versions of Visual Studio.
7560 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
7561 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
7564 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
7565 which are not supported by MSVC.
7566 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
7567 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
7569 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
7571 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
7573 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
7575 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
7577 Support MSVC build with newer versions of Visual Studio.
7578 * w32.c: Don't include w32api.h for MSVC.
7579 (init_environment) [_MSC_VER]: Call sys_access, not _access.
7581 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
7582 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
7583 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
7584 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
7586 (alloca) [_MSC_VER]: Define to _alloca.
7588 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
7590 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
7592 2011-11-04 Eli Zaretskii <eliz@gnu.org>
7594 * xdisp.c (note_mouse_highlight): If either of
7595 previous/next-single-property-change returns nil, treat that as
7596 the beginning or the end of the buffer. (Bug#9955)
7598 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
7600 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
7601 label is not null (Bug#9951).
7602 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
7605 2011-11-04 Eli Zaretskii <eliz@gnu.org>
7607 * window.c (Fwindow_body_size): Mention in the doc string that the
7608 return value is in frame's canonical units. (Bug#9949)
7610 2011-11-03 Eli Zaretskii <eliz@gnu.org>
7612 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
7614 * w32fns.c (unwind_create_frame): If needed, free the glyph
7615 matrices of the partially constructed frame. (Bug#9943)
7616 * xfns.c (unwind_create_frame): Likewise.
7618 2011-11-01 Eli Zaretskii <eliz@gnu.org>
7620 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
7621 Don't stop backward scan on the continuation glyph, even though
7622 its CHARPOS is positive.
7623 (mouse_face_from_buffer_pos, note_mouse_highlight):
7624 Rename cover_string to disp_string.
7626 2011-11-01 Martin Rudalics <rudalics@gmx.at>
7628 * window.c (temp_output_buffer_show): Don't use
7629 Vtemp_buffer_show_specifiers.
7630 (Vtemp_buffer_show_specifiers): Remove unused variable.
7632 2011-10-30 Eli Zaretskii <eliz@gnu.org>
7634 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
7635 past the beginning of the current glyph matrix.
7637 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
7639 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
7640 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
7641 HAVE_GTK3 (Bug#9869).
7643 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
7644 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
7646 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
7648 * xterm.c: Declare x_handle_net_wm_state to return int.
7649 (handle_one_xevent): Check if we are iconified but don't have
7650 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
7651 (get_current_wm_state): Return non-zero if not hidden,
7652 check for _NET_WM_STATE_HIDDEN (Bug#9893).
7653 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
7654 (x_handle_net_wm_state): Return what get_current_wm_state returns.
7655 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
7657 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
7659 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
7660 so that this new function doesn't get optimized away by a
7661 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
7663 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
7665 * frame.h (MOUSE_HL_INFO): Remove excess parens.
7667 2011-10-29 Eli Zaretskii <eliz@gnu.org>
7669 Fix the `xbytecode' command.
7670 * .gdbinit (xprintbytestr): New command.
7671 (xwhichsymbols): Rename from `which'; all callers changed.
7672 (xbytecode): Print the byte-code string as well.
7674 2011-10-29 Kim Storm <storm@cua.dk>
7676 * alloc.c (which_symbols): New function.
7678 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
7680 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
7683 2011-10-29 Glenn Morris <rgm@gnu.org>
7685 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
7686 Not clear what it was for, and it causes various bugs. (Bug#9839)
7688 2011-10-28 Eli Zaretskii <eliz@gnu.org>
7690 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
7691 possible random value that matches one of those tested as
7692 condition to clear the mouse face.
7694 2011-10-28 Chong Yidong <cyd@gnu.org>
7696 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
7698 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
7700 * window.c (make_window): Initialize phys_cursor_on_p.
7702 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
7704 * lisp.h (struct Lisp_Symbol): Update comments.
7706 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
7708 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
7710 2011-10-28 Eli Zaretskii <eliz@gnu.org>
7712 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
7713 <oslsachem@gmail.com> for helping to debug this.
7715 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
7716 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
7717 (g_b_init_get_glyph_outline_w): New static variables.
7718 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
7719 (GetGlyphOutlineW_Proc): New typedefs.
7720 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
7721 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
7723 (w32font_open_internal, compute_metrics):
7724 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
7725 instead of calling the "wide" APIs directly.
7727 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
7729 * w32.h (syms_of_w32font): Add prototype.
7731 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
7733 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
7734 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
7735 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
7736 (Fmove_to_window_line): Doc fix.
7738 2011-10-27 Chong Yidong <cyd@gnu.org>
7740 * process.c (make_process): Set gnutls_state to NULL.
7742 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
7743 non-NULL, regardless of GNUTLS_INITSTAGE.
7744 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
7745 an error. Set process slots as soon as we allocate them.
7747 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
7749 2011-10-27 Chong Yidong <cyd@gnu.org>
7751 * gnutls.c (emacs_gnutls_deinit): New function.
7752 Deallocate credentials structures as well as calling gnutls_deinit.
7753 (Fgnutls_deinit, Fgnutls_boot): Use it.
7755 * process.c (make_process): Initialize GnuTLS credentials to NULL.
7756 (deactivate_process): Call emacs_gnutls_deinit.
7758 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
7760 * image.c (x_create_x_image_and_pixmap):
7761 * w32.c (sys_rename, w32_delayed_load):
7762 * w32font.c (fill_in_logfont):
7763 * w32reg.c (x_get_string_resource): Silence compiler warnings.
7765 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
7767 * w32fns.c (w32_default_color_map): New function,
7768 extracted from Fw32_default_color_map.
7769 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
7771 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
7773 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
7775 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
7777 * keyboard.c (test_undefined): New function (bug#9751).
7778 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
7780 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
7782 * sysdep.c (init_sys_modes): Fix the check for the controlling
7783 terminal (Bug#6649).
7785 2011-10-20 Eli Zaretskii <eliz@gnu.org>
7787 * dispextern.h (struct bidi_it): New member next_en_type.
7789 * bidi.c (bidi_line_init): Initialize the next_en_type member.
7790 (bidi_resolve_explicit_1): When next_en_pos is valid for the
7791 current character, check also for next_en_type being WEAK_EN.
7792 (bidi_resolve_weak): Don't enter the expensive loop if the current
7793 position is before next_en_pos. Record the bidi type of the first
7794 non-ET, non-BN character we find, in addition to its position.
7795 (bidi_level_of_next_char): Invalidate next_en_type when
7796 next_en_pos is over-stepped.
7798 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
7800 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
7801 * editfns.c: Rewrite current-time-zone so that it invokes
7802 the equivalent of (format-time-string "%Z") to get the time zone name.
7803 This fixes a bug when the time zone name contains characters that
7804 need converting from the system time locale to Emacs internal format.
7805 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
7806 that patch fixed format-time-string to do the conversion, but
7807 I forgot to fix current-time-zone.
7808 (format_time_string): New function, containing most of
7809 what Fformat_time_string used to contain.
7810 (Fformat_time_string): Rewrite in terms of format_time_string.
7811 This doesn't change this function's behavior.
7812 (current-time-zone): Rewrite to use format_time_string.
7813 This fixes the bug reported by Michael Schierl in
7814 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
7815 Jason Rumney's 2007-06-07 change worked around this bug, but
7817 * systime.h (tzname, timezone): Remove no-longer-used declarations.
7819 2011-10-19 Eli Zaretskii <eliz@gnu.org>
7821 * xdisp.c (start_display): If the character at POS is displayed
7822 via a display vector, reset IT->current.dpvec_index to zero.
7823 (try_window_reusing_current_matrix): If a line ends in a display
7824 vector or the next line starts in a display vector, continue
7825 redrawing the window even though the character position of
7826 start_row was reached.
7829 2011-10-18 Chong Yidong <cyd@gnu.org>
7831 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
7832 with nobreak-char-display too.
7834 2011-10-18 Eli Zaretskii <eliz@gnu.org>
7836 Fix part 3 of bug#9771.
7837 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
7838 (bidi_resolve_neutral): Don't enter the expensive loop looking for
7839 non-neutral characters if the current character is a paragraph
7840 separator (a.k.a. Newline). This avoids running the same
7841 expensive loop twice, once when we consume the preceding newline
7842 and the other time when the line actually needs to be displayed.
7843 Avoid the loop when we see neutrals on the base embedding level
7844 following a character whose directionality is the same as the
7845 paragraph's. This avoids running the expensive loop when a line
7846 ends in a long sequence of neutrals, like control characters.
7847 Add assertion against STRONG_AL type. Slightly rearrange code
7848 that determines the type of a neutral given the first non-neutral
7850 (bidi_level_of_next_char): Set next_en_pos to zero when
7851 invalidating its info.
7853 2011-10-17 Eli Zaretskii <eliz@gnu.org>
7855 * xdisp.c (push_display_prop): Determine whether to record string
7856 or buffer position by IT->string, not by IT->method. Allow
7857 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
7858 (move_it_vertically_backward): Don't look for character position
7859 immediately after the newline when in a continuation line.
7862 2011-10-15 Martin Rudalics <rudalics@gmx.at>
7864 * window.c (coordinates_in_window): Rewrite and delabelize
7865 vertical border check. (Bug#5357) (Bug#9618)
7867 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
7869 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
7870 errors in XSetWindowBorder (bug#9310).
7872 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
7874 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
7875 avoid crash when xmalloc overrun checking is enabled.
7877 2011-10-13 Eli Zaretskii <eliz@gnu.org>
7879 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
7880 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
7881 cursor motion with <left> and <right> arrow keys.
7883 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
7884 some callers set that themselves.
7886 2011-10-12 Eli Zaretskii <eliz@gnu.org>
7888 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
7889 display string and the previous row comes from the same string and
7890 is empty. (Bug#9739) (Bug#9738)
7892 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
7894 * doc.c (get_doc_string): Encode file name (bug#9735).
7896 2011-10-12 Eli Zaretskii <eliz@gnu.org>
7898 * bidi.c (bidi_level_of_next_char):
7899 * xdisp.c (get_visually_first_element): Remove old incorrect
7900 comments regarding the Unicode Line Separator character.
7902 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
7904 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
7906 * alloc.c (Fgc_status): Do not access beyond zombies array
7907 boundary if nzombies > MAX_ZOMBIES.
7908 * alloc.c (dump_zombies): Add missing format specifier.
7910 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
7912 * xdisp.c (set_cursor_from_row): Simplify conditionals,
7913 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
7915 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
7916 Some packages use them to denote characters with modifiers.
7918 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
7920 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
7921 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
7922 matching a pp-number. Rename parameter var to var1.
7924 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
7926 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
7928 2011-10-08 Glenn Morris <rgm@gnu.org>
7930 * callint.c (Fcall_interactively): Give a more explicit error for the
7931 'c' case with a non-character input. (Bug#8479)
7933 2011-10-08 Eli Zaretskii <eliz@gnu.org>
7935 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
7937 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
7938 lines that are hscrolled on the left.
7940 * dispnew.c (buffer_posn_from_coords): Account for a possible
7941 presence of header-line. (Bug#4426)
7943 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
7945 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
7946 Don't advertise functionality which we discourage or doesn't work.
7948 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
7950 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
7951 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
7952 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
7953 this makes Emacs dump core during garbage collection on rare
7954 occasions. sizeof is obviously inferior to offsetof here, so
7955 stick with offsetof.
7956 (GC_POINTER_ALIGNMENT): New macro.
7957 (mark_memory): Omit 3rd (offset) arg; caller changed.
7958 Don't assume EMACS_INT alignment is the same as pointer alignment.
7960 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
7962 * keyboard.c (read_key_sequence_remapped): New var.
7963 (read_key_sequence): Compute remapping in the right buffer.
7964 (command_loop_1): Use read_key_sequence's remapping directly.
7966 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
7968 * dired.c (file_name_completion): Don't expand file name.
7969 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
7970 before checking file name handler.
7972 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
7973 they've been requested explicitly (bug#9591).
7975 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
7977 * keymap.c (Fsingle_key_description): Use make_specified_string
7978 instead of build_string to build string from push_key_description.
7981 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
7983 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
7984 This fixes a Y2038 bug on 64-bit hosts.
7985 * buffer.c (reset_buffer):
7986 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
7987 (Fclear_buffer_auto_save_failure):
7988 Use 0, not -1, to represent an unset failure time, since time_t
7989 might not be signed.
7991 Remove dependency on glibc malloc internals.
7992 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
7993 Move back here from lisp.h, but with their new implementations.
7994 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
7995 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
7996 * charset.c (charset_table_init): New static var.
7997 (syms_of_charset): Use it instead of xmalloc. This removes a
7998 dependency on glibc malloc internals. See Eli Zaretskii's comment in
7999 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
8000 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8001 Move back to alloc.c.
8002 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8003 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
8005 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
8007 * nsterm.m (windowDidResize): Call x_set_window_size only when
8008 ns_in_resize is true. Otherwise set pixelwidth/height and
8009 call change_frame_size (Bug#9628).
8011 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
8013 Port --enable-checking=all to Fedora 14 x86-64.
8014 * charset.c (syms_of_charset): Also account for glibc malloc's
8015 internal overhead when calculating the initial malloc maximum.
8017 Port --enable-checking=all to Fedora 14 x86.
8018 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8020 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
8021 (overrun_check_realloc, overrun_check_free):
8022 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
8023 That way, xmalloc returns a properly-aligned pointer even if
8024 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
8025 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
8026 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
8027 into account when calculating the initial malloc maximum.
8028 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8029 Move here from alloc.c, so that charset.c can use it too.
8030 Properly align; the old code wasn't right for common 32-bit hosts
8031 when configured with --enable-checking=all.
8032 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8033 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
8035 2011-09-29 Eli Zaretskii <eliz@gnu.org>
8037 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
8040 2011-09-28 Eli Zaretskii <eliz@gnu.org>
8042 * xdisp.c (compute_display_string_end): If there's no display
8043 string at CHARPOS, return -1.
8045 * bidi.c (bidi_fetch_char): When compute_display_string_end
8046 returns a negative value, treat the character as a normal
8047 character not covered by a display string. (Bug#9624)
8049 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
8051 * lread.c (Fread_from_string): Fix typo in docstring.
8053 2011-09-27 Eli Zaretskii <eliz@gnu.org>
8055 * xdisp.c (handle_invisible_prop): If invisible text ends on a
8056 newline, reseat the iterator instead of bidi-iterating there one
8057 character at a time. (Bug#9610)
8058 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
8059 TO_CHARPOS if the bidi iterator is at base embedding level.
8061 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
8063 * lread.c (readevalloop): Use correct code for NBSP.
8064 (read1): Likewise. (Bug#9608)
8066 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
8068 * dbusbind.c (Fdbus_register_signal): When service is not
8069 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
8071 2011-09-25 Glenn Morris <rgm@gnu.org>
8073 * buffer.c (truncate-lines): Doc fix.
8075 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
8077 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
8078 (Fset_window_next_buffers): Doc fix.
8080 2011-09-24 Glenn Morris <rgm@gnu.org>
8082 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
8084 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
8086 Fix minor problems found by static checking.
8087 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
8088 * indent.c (Fvertical_motion): Fix == vs = typo.
8090 2011-09-24 Eli Zaretskii <eliz@gnu.org>
8092 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
8093 Default value is now t. Doc fix.
8095 * indent.c (Fvertical_motion): Compute and apply the overshoot
8096 logic when moving up, not only when moving down. Fix the
8097 confusing name and values of the it_overshoot_expected variable;
8098 logic changes accordingly. (Bug#9254) (Bug#9549)
8100 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
8101 CHARPOS is covered by a display string which includes newlines.
8102 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
8103 is covered by a display string with embedded newlines.
8105 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
8107 * dbusbind.c (Fdbus_register_signal): Add match rule to
8108 Vdbus_registered_objects_table. (Bug#9581)
8109 (Fdbus_register_method, Vdbus_registered_objects_table):
8112 2011-09-24 Jim Meyering <meyering@redhat.com>
8114 do not ignore write error for any output size
8115 The previous change was incomplete.
8116 While it makes emacs --batch detect the vast majority of stdout
8117 write failures, errors were still ignored whenever the output size is
8118 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
8119 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
8120 && echo FAIL: ignored write error
8121 FAIL: ignored write error
8122 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
8123 && echo FAIL: ignored write error
8124 FAIL: ignored write error
8125 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
8127 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
8129 * emacs.c (Fkill_emacs): In noninteractive mode exit
8130 non-successfully if a write error occurred on stdout. (Bug#9574)
8132 2011-09-21 Eli Zaretskii <eliz@gnu.org>
8134 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
8137 * dispextern.h (struct it): Update the comment documenting what
8140 2011-09-20 Eli Zaretskii <eliz@gnu.org>
8142 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
8143 a display string, extend search for cursor position to end of row.
8144 (find_row_edges): If the row ends in a newline from a display
8145 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
8146 Handle the case of a display string with multiple newlines.
8147 (Fcurrent_bidi_paragraph_direction): Fix search for previous
8148 non-empty line. Fixes confusing cursor motion with arrow keys at
8149 the beginning of a line that starts with whitespace.
8151 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
8153 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
8156 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
8158 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
8161 2011-09-18 Eli Zaretskii <eliz@gnu.org>
8163 * xdisp.c (display_line): Record maximum and minimum buffer
8164 positions even if no glyphs were produced (e.g., by a zero-width
8165 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
8166 buffer positions that will be removed from the glyph row because
8168 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
8169 column is beyond frame width: don't subtract 1 "pixel" when
8170 computing width of the stretch.
8171 (reseat_at_next_visible_line_start): Undo the change made on
8172 2011-09-17 that saved paragraph information and restored it after
8173 the call to `reseat'. (Bug#9545)
8175 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8177 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
8178 and turn window cursor on if cleared (Bug#9415).
8180 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
8182 * search.c (boyer_moore): Take unibyte characters from pattern
8183 literally. (Bug#9458)
8185 2011-09-18 Eli Zaretskii <eliz@gnu.org>
8187 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
8189 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
8191 Fix minor problem found by static checking.
8192 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
8193 initialized, to pacify gcc -Wuninitialized.
8195 * fileio.c: Report proper errno when syscall falls.
8196 (Finsert_file_contents): Save and restore errno,
8197 so that report_file_error outputs the correct diagnostic.
8198 (Fwrite_region) [CLASH_DETECTION]: Likewise.
8200 2011-09-18 Eli Zaretskii <eliz@gnu.org>
8202 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
8204 2011-09-17 Eli Zaretskii <eliz@gnu.org>
8206 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
8207 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
8209 2011-09-17 Eli Zaretskii <eliz@gnu.org>
8211 * xdisp.c (reseat_at_next_visible_line_start): Keep information
8212 about the current paragraph and restore it after the call to reseat.
8214 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
8215 (bidi_find_paragraph_start): Search back for paragraph beginning
8216 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
8217 (bidi_move_to_visually_next): Only trigger paragraph-related
8218 computations when the last character is a newline or at EOB, not
8219 just any NEUTRAL_B. (Bug#9470)
8221 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
8222 truncated lines if point is covered by a display string. (Bug#9524)
8224 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
8226 * xselect.c: Relax test for outgoing X longs (Bug#9498).
8227 (cons_to_x_long): New function.
8228 (lisp_data_to_selection_data): Use it. Correct the test for
8229 short-versus-long data; it was negated. Break out of vector
8230 loop, for efficiency, when a long datum is discovered.
8232 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
8234 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
8236 2011-09-16 Eli Zaretskii <eliz@gnu.org>
8238 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
8239 GCC PR/17406) by declaring this function with external scope.
8241 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
8243 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
8244 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
8246 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
8248 * editfns.c (Fformat): Correctly handle text properties on "%%".
8250 2011-09-15 Eli Zaretskii <eliz@gnu.org>
8252 * xterm.c (x_draw_composite_glyph_string_foreground):
8253 * w32term.c (x_draw_composite_glyph_string_foreground):
8254 * term.c (encode_terminal_code):
8255 * composite.c (composition_update_it, get_composition_id):
8256 * xdisp.c (get_next_display_element)
8257 (fill_composite_glyph_string): Add comments about special meaning
8258 of TAB characters in a composition.
8260 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
8262 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
8263 This occurs when processing a multibyte format.
8264 Problem reported by Wolfgang Jenker.
8266 2011-09-15 Johan Bockgård <bojohan@gnu.org>
8268 * xdisp.c (try_cursor_movement): Only check for exact match if
8269 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
8271 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
8273 Remove unused external symbols.
8274 * dispextern.h (calc_pixel_width_or_height): Remove decl.
8275 * xdisp.c (calc_pixel_width_or_height): Now static.
8276 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
8277 * indent.c (check_display_width):
8278 * w32term.c: Fix comment to match code.
8279 * xterm.c, xterm.h (x_catching_errors): Remove.
8281 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
8283 * xselect.c: Use signed conversions more consistently (Bug#9498).
8284 (selection_data_to_lisp_data): Assume incoming selection data are
8285 signed integers, not unsigned. This is to be consistent with
8286 outgoing selection data, which was modified to use signed integers
8287 in as part of the fix to Bug#9196 in response to Jan D.'s comment
8288 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
8289 expects long, not unsigned long.
8291 2011-09-14 Eli Zaretskii <eliz@gnu.org>
8293 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
8294 computation of loop end. Reported by Johan Bockgård
8297 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
8299 * frame.c (Fother_visible_frames_p): Function deleted.
8301 2011-09-12 Eli Zaretskii <eliz@gnu.org>
8303 * indent.c (compute_motion): Process display vector front to back
8304 rather than the other way around. (Bug#2496)
8306 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
8308 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
8310 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
8312 * minibuf.c (Fread_from_minibuffer): Doc fix.
8314 2011-09-11 Eli Zaretskii <eliz@gnu.org>
8316 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
8317 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
8319 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
8321 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
8322 value for non-existent files.
8324 2011-09-11 Eli Zaretskii <eliz@gnu.org>
8326 * fileio.c (Finsert_file_contents): If the file cannot be opened,
8327 set its "size" to -1. This will set the modtime_size field of
8328 the corresponding buffer to -1, which is what
8329 verify-visited-file-modtime expects for files that do not exist.
8332 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
8334 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
8336 * lisp.h: ... from here. push_key_description is no longer
8337 defined in keyboard.c, so its declaration should not be in
8338 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
8339 logically belongs with push_key_description.
8341 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
8343 * buffer.h: Include <sys/types.h> instead of <time.h>.
8344 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
8345 Problem reported by Herbert J. Skuhra.
8347 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
8349 * xml.c (parse_region): Make the parsing work for
8350 non-comment-starting XML files again (bug#9144).
8352 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
8354 * image.c (gif_load): Fix calculation of bottom and right corner.
8357 2011-09-10 Eli Zaretskii <eliz@gnu.org>
8359 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
8360 redisplay in small windows.
8362 2011-09-09 Eli Zaretskii <eliz@gnu.org>
8364 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
8366 2011-09-08 Martin Rudalics <rudalics@gmx.at>
8368 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
8369 Operate on live windows only.
8371 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
8373 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
8375 2011-09-07 Eli Zaretskii <eliz@gnu.org>
8377 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
8378 only under bidi iteration.
8380 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
8382 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
8384 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
8386 isnan: Fix porting problem to Solaris 10 with bundled gcc.
8387 Without this fix, the command to link temacs failed due to an
8388 undefined symbol __builtin_isnan. This is because
8389 /usr/include/iso/math_c99.h #defines isnan(x) to
8390 __builtin_isnan(x), but the bundled gcc, which identifies itself
8391 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
8393 * floatfns.c (isnan): #undef, and then #define to a clone of
8395 (Fisnan): Always define, since it's always available now.
8396 (syms_of_floatfns): Always define isnan at the Lisp level.
8398 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
8400 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
8402 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
8404 * fileio.c: Fix bugs with large file offsets (Bug#9428).
8405 The previous code assumed that file offsets (off_t values) fit in
8406 EMACS_INT variables, which is not true on typical 32-bit hosts.
8407 The code messed up by falsely reporting buffer overflow in cases
8408 such as (insert-file-contents "big" nil 1 2) into an empty buffer
8409 when "big" contains more than 2**29 bytes, even though this
8410 inserts just one byte and does not overflow the buffer.
8411 (Finsert_file_contents): Store file offsets as off_t
8412 values, not as EMACS_INT values. Check for overflow when
8413 converting between EMACS_INT and off_t. When checking for
8414 buffer overflow or for overlap, take the offsets into account.
8415 Don't use EMACS_INT for small values where int suffices.
8416 When checking for overlap, fix a typo: ZV was used where
8417 ZV_BYTE was intended.
8418 (Fwrite_region): Don't assume off_t fits into 'long'.
8419 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
8421 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
8423 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
8425 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
8427 sprintf-related integer and memory overflow issues (Bug#9412).
8429 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8430 (esprintf, exprintf, evxprintf): New functions.
8431 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
8432 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
8433 (modify_event_symbol): Do not assume that the length of
8434 name_alist_or_stem is safe to alloca and fits in int.
8435 (Fexecute_extended_command): Likewise for function name and binding.
8436 (Frecursion_depth): Wrap around reliably on integer overflow.
8437 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
8438 since some callers pass EMACS_INT values.
8439 (Fsingle_key_description): Don't crash if symbol name contains more
8440 than MAX_ALLOCA bytes.
8441 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
8442 (get_minibuffer): Arg is now EMACS_INT, not int.
8443 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8444 (esprintf, exprintf, evxprintf): New decls.
8445 * window.h (command_loop_level, minibuf_level): Reflect API changes.
8447 * dbusbind.c (signature_cat): New function.
8448 (xd_signature, Fdbus_register_signal):
8449 Do not overrun buffer; instead, report string overflow.
8451 * dispnew.c (add_window_display_history): Don't overrun buffer.
8452 Truncate instead; this is OK since it's just a log.
8454 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
8455 even if the time zone offset is outlandishly large.
8456 Don't mishandle offset == INT_MIN.
8458 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
8459 when creating daemon; the previous buffer-overflow check was incorrect.
8461 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
8462 which has the guts of the old verror function.
8464 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
8465 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
8467 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
8468 (font_unparse_xlfd): Don't blindly alloca long strings.
8469 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8470 fits in int, when using sprintf. Use single snprintf to count
8471 length of string rather than counting it via multiple sprintfs;
8472 that's simpler and more reliable.
8473 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
8474 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
8475 sprintf, in case result does not fit in int.
8477 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
8478 (fontset_from_font): Print it.
8480 * frame.c (tty_frame_count): Now printmax_t, not int.
8481 (make_terminal_frame, set_term_frame_name): Print it.
8482 (x_report_frame_params): In X, window IDs are unsigned long,
8483 not signed long, so print them as unsigned.
8484 (validate_x_resource_name): Check for implausibly long names,
8485 and don't assume name length fits in 'int'.
8486 (x_get_resource_string): Don't blindly alloca invocation name;
8487 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
8490 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
8491 (xg_check_special_colors, xg_set_geometry):
8492 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
8494 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
8495 Use esprintf, not sprintf, in case result does not fit in int.
8497 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
8498 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
8499 it as a large positive number.
8500 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
8501 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
8503 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
8504 in case result does not fit in int.
8506 * print.c (float_to_string): Detect width overflow more reliably.
8507 (print_object): Make sprintf buffer a bit bigger, to avoid potential
8508 buffer overrun. Don't assume list length fits in 'int'. Treat
8509 print length of 0 as 0, not as infinity; to be consistent with other
8510 uses of print length in this function. Don't overflow print length
8511 index. Don't assume hash table size fits in 'long', or that
8512 vectorlike size fits in 'unsigned long'.
8514 * process.c (make_process): Use printmax_t, not int, to format
8515 process-name gensyms.
8517 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
8519 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
8520 to avoid potential buffer overrun.
8522 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
8523 if X resource line is longer than 512 bytes.
8525 * xfns.c (x_window): Make sprintf buffer a bit bigger
8526 to avoid potential buffer overrun.
8528 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
8530 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
8532 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
8534 Integer overflow fixes for scrolling, etc.
8535 Without these, Emacs silently mishandles large integers sometimes.
8536 For example, "C-u 4294967297 M-x recenter" was treated as if
8537 it were "C-u 1 M-x recenter" on a typical 64-bit host.
8539 * xdisp.c (try_window_id): Check Emacs fixnum range before
8540 converting to 'int'.
8542 * window.c (window_scroll_line_based, Frecenter):
8543 Check that an Emacs fixnum is in range before assigning it to 'int'.
8544 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
8545 values converted from Emacs fixnums.
8546 (Frecenter): Don't wrap around a line count if it is out of 'int'
8547 range; instead, treat it as an extreme value.
8548 (Fset_window_configuration, compare_window_configurations):
8549 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
8551 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
8552 that can exceed INT_MAX. Check that EMACS_INT value is in range
8553 before assigning it to the (possibly-narrower) index.
8554 (match_limit): Don't assume that a fixnum can fit in 'int'.
8556 * print.c (print_object): Use ptrdiff_t, not int, for index that can
8559 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
8560 (Fvertical_motion): Don't wrap around LINES values that don't fit
8561 in 'int'. Instead, treat them as extreme values. This is good
8562 enough for windows, which can't have more than INT_MAX lines anyway.
8564 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
8566 * Require libxml/parser.h to avoid compilation warning.
8568 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
8570 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
8571 since this reportedly can destroy thread storage.
8573 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
8575 * syntax.c (find_defun_start): Update all cache variables if
8576 exiting early (Bug#9401).
8578 2011-08-30 Eli Zaretskii <eliz@gnu.org>
8580 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
8582 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
8583 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
8584 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
8586 * term.c (tty_append_glyph): New function.
8587 (produce_stretch_glyph): Static function and its prototype deleted.
8589 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
8592 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
8594 * image.c (parse_image_spec): Check for nonnegative, not for positive,
8595 when checking :margin (Bug#9390).
8596 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
8597 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
8598 so that the name doesn't mislead. All uses changed.
8600 2011-08-28 Johan Bockgård <bojohan@gnu.org>
8602 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
8605 2011-08-27 Eli Zaretskii <eliz@gnu.org>
8607 * xdisp.c (move_it_to): Don't bail out early when reaching
8608 position beyond to_charpos, if we are scanning backwards.
8609 (move_it_vertically_backward): When DY == 0, make sure we get to
8610 the first character in the line after the newline.
8612 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
8614 * ccl.c: Improve and simplify overflow checking (Bug#9196).
8615 (ccl_driver): Do not generate an out-of-range pointer.
8616 (Fccl_execute_on_string): Remove unnecessary check for
8617 integer overflow, noted by Stefan Monnier in
8618 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
8619 Remove a FIXME that didn't need fixing.
8620 Simplify the newly-introduced buffer reallocation code.
8622 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
8624 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
8626 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
8628 Integer and memory overflow issues (Bug#9196).
8630 * doc.c (get_doc_string): Rework so that
8631 get_doc_string_buffer_size is the actual buffer size, rather than
8632 being 1 less than the actual buffer size; this makes xpalloc more
8635 * image.c (x_allocate_bitmap_record, cache_image):
8636 * xselect.c (Fx_register_dnd_atom):
8637 Simplify previous changes by using xpalloc.
8639 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
8640 since either will do and ptrdiff_t is convenient with xpalloc.
8642 * charset.c (charset_table_size)
8643 (struct charset_sort_data.priority): Now ptrdiff_t.
8644 (charset_compare): Don't overflow if priorities differ greatly.
8645 (Fsort_charsets): Don't assume list length fits in int.
8646 Check for size-calculation overflow when allocating sort data.
8647 (syms_of_charset): Allocate an initial charset table that is
8648 just under 64 KiB, to avoid problems with glibc malloc and mmap.
8650 * cmds.c (internal_self_insert): Check for size-calculation overflow.
8652 * composite.h (struct composition.glyph_len): Now int, not unsigned.
8653 The actual value is always <= INT_MAX, and leaving it unsigned made
8654 overflow checking harder.
8656 * dispextern.h (struct glyph_matrix.rows_allocated)
8657 (struct face_cache.size): Now ptrdiff_t, for convenience in use
8658 with xpalloc. The values are still always <= INT_MAX.
8660 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
8662 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
8663 (SAFE_NALLOCA): New macro.
8665 * region-cache.c (struct boundary.pos, find_cache_boundary)
8666 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
8667 (set_cache_region, invalidate_region_cache)
8668 (revalidate_region_cache, know_region_cache, region_cache_forward)
8669 (region_cache_backward, pp_cache):
8670 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
8671 so that ptrdiff_t * can be passed to xpalloc.
8672 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
8673 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
8674 (pp_cache): Don't assume cache_len fits in int.
8675 * region-cache.h: Adjust extern decls to match.
8677 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
8678 EMACS_INT, since either will do, for xpalloc.
8680 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
8681 (xnmalloc, xnrealloc, xpalloc): New functions.
8683 * bidi.c (bidi_shelve_header_size): New constant.
8684 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
8685 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
8687 * bidi.c (bidi_cache_shrink):
8688 * buffer.c (overlays_at, overlays_in, record_overlay_string)
8690 Don't update size of array until after memory allocation succeeds,
8691 because xmalloc/xrealloc may not return.
8692 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
8693 now that we have proper integer overflow checking.
8694 (record_overlay_string, overlay_strings): Catch overflows when
8695 calculating size of overlay_str_buf.
8697 * callproc.c (Fcall_process): Check for size overflow when
8698 calculating size of args2.
8699 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
8700 Normally we prefer signed values, but sticking with ptrdiff_t would
8701 require adding more-complicated checks.
8703 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
8704 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
8705 Redo buffer-overflow calculations to avoid integer overflow.
8706 Add a FIXME comment where memory seems to be over-allocated.
8708 * character.c (Fstring): Check for size-calculation overflow.
8710 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
8711 unnecessary integer overflow. Check for size overflow.
8712 (encode_coding_object): Don't update size until xmalloc succeeds.
8714 * composite.c (get_composition_id): Check for overflow in glyph
8715 length calculations.
8717 Integer and memory overflow fixes for display code.
8718 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
8719 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
8720 (scrolling_window): Check for overflow in size calculations.
8721 (line_draw_cost, realloc_glyph_pool, add_row_entry):
8722 Don't assume glyph table len fits in int.
8723 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
8724 (row_table_size): Now ptrdiff_t, not int.
8725 (scrolling_window): Avoid overflow in size calculations.
8726 Don't update size until allocation succeeds.
8727 * fns.c (concat): Check for overflow in size calculations.
8728 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
8729 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
8730 (NEXT_ALMOST_PRIME_LIMIT): New constant.
8732 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
8733 (get_doc_string): Check for size calculation overflow.
8734 Don't update size until allocation succeeds.
8735 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
8736 EMACS_INT, where ptrdiff_t will do.
8737 (Fsubstitute_command_keys): Check for string overflow.
8739 * editfns.c (set_time_zone_rule): Don't assume environment length
8741 (message_length): Now ptrdiff_t, not int.
8742 (Fmessage_box): Don't update size until allocation succeeds.
8743 Don't assume message length fits in int.
8744 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
8746 * emacs.c (main): Do not reallocate argv, since there is a null at
8747 the end that can be overwritten, and this way there's no need to
8748 worry about size-calculation overflow.
8749 (sort_args): Check for size-calculation overflow.
8751 * eval.c (init_eval_once, grow_specpdl): Don't update size until
8753 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
8755 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
8756 (x_set_scroll_bar_width, x_figure_window_size):
8757 Check for integer overflow.
8758 (x_set_alpha): Do not assume XINT fits in int.
8760 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
8761 This is for the members text_lines, text_cols, total_lines, total_cols,
8762 where the system imposes an 'int' limit.
8764 * fringe.c (Fdefine_fringe_bitmap):
8765 Don't update size until alloc works.
8767 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
8768 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
8770 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
8771 Check for size-calculation overflow.
8772 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
8773 do, as we prefer signed integers.
8774 (id_to_widget.max_size, id_to_widget.used)
8775 (xg_store_widget_in_map, xg_remove_widget_from_map)
8776 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
8777 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
8778 Use and return ptrdiff_t, not int.
8779 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
8780 * gtkutil.h: Change prototypes to match the above.
8782 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
8783 are duplicate now that they've been promoted to lisp.h.
8784 (x_allocate_bitmap_record, x_alloc_image_color)
8785 (make_image_cache, cache_image, xpm_load):
8786 Don't update size until alloc is done.
8787 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
8789 Check for size calculation overflow.
8790 (ct_colors_allocated_max): New constant.
8791 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
8794 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
8795 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
8796 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
8797 Use ptrdiff_t, not int, to count maps.
8798 (read_char_minibuf_menu_prompt): Check for overflow in size
8799 calculations. Don't update size until allocation succeeds.
8800 Redo calculations to avoid overflow.
8801 * keyboard.h: Change prototypes to match the above.
8803 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
8805 (current_minor_maps): Check for size calculation overflow.
8806 * keymap.h: Change prototypes to match the above.
8808 * lread.c (read1, init_obarray): Don't update size until alloc done.
8810 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
8811 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
8813 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
8814 Now ptrdiff_t, not int.
8815 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
8816 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
8818 * process.c (Fnetwork_interface_list): Check for overflow
8819 in size calculation.
8821 * region-cache.c (move_cache_gap): Check for size calculation overflow.
8823 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
8824 overflow. Don't bother calling xmalloc when xrealloc will do.
8826 * search.c (Freplace_match): Check for size calculation overflow.
8827 (Fset_match_data): Don't assume list lengths fit in 'int'.
8829 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
8830 for command line length. Do not attempt to address one before the
8831 beginning of an array, as that's not portable.
8833 * term.c (max_frame_lines): Remove; unused.
8834 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
8836 (encode_terminal_code, calculate_costs): Check for size
8837 calculation overflow.
8838 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
8839 table lengths and related sizes. Don't update size until alloc
8840 done. Redo calculations to avoid overflow.
8841 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
8843 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
8844 subtracting pointers.
8845 (gobble_line): Check for overflow more carefully. Don't update size
8848 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
8849 Don't update size until alloc done.
8850 Redo size calculations to avoid overflow.
8851 Check for size calculation overflow.
8852 (main) [DEBUG]: Fix typo in invoking tparam1.
8854 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
8855 Use ptrdiff_t, not int, for sizes.
8856 (store_mode_line_noprop_char): Don't update size until alloc done.
8858 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
8859 Use ptrdiff_t, not int, for sizes.
8860 (Finternal_make_lisp_face, cache_face):
8861 Check for size calculation overflow.
8862 (cache_face): Treat size calculation overflows as if they were
8863 memory exhaustion (the usual treatment), rather than aborting.
8865 * xfns.c (x_encode_text, x_set_name_internal)
8866 (Fx_change_window_property): Use ptrdiff_t, not int, to count
8867 sizes, since they can exceed INT_MAX in size. Check for size
8868 calculation overflow.
8870 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
8871 (xg_select): Check for size calculation overflow.
8872 Don't update size until alloc done.
8874 * xrdb.c (get_environ_db): Don't assume path length fits in int,
8875 as sprintf is limited to int lengths.
8877 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
8878 (X_LONG_MIN): New macros.
8879 Use them to make the following changes clearer.
8880 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
8881 This change doesn't affect the value now, but it may help remind
8882 future maintainers not to raise the value too much later.
8883 (SELECTION_QUANTUM): Remove, replacing with ...
8884 (selection_quantum): ... new function, which avoids overflow.
8886 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
8887 assumption that selection length fits in 'int'.
8888 (x_reply_selection_request, x_handle_selection_request)
8889 (x_get_window_property, receive_incremental_selection)
8890 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
8891 (lisp_data_to_selection_data, clean_local_selection_data):
8892 Use ptrdiff_t, not int, to record length of selection.
8893 (x_reply_selection_request, x_get_window_property)
8894 (receive_incremental_selection, x_property_data_to_lisp):
8895 Redo calculations to avoid overflow.
8896 (x_reply_selection_request): When sending hint, ceiling it at
8897 X_LONG_MAX rather than relying on wraparound overflow to send
8899 (x_get_window_property, receive_incremental_selection)
8900 (lisp_data_to_selection_data, x_property_data_to_lisp):
8901 Check for size-calculation overflow.
8902 (x_get_window_property, receive_incremental_selection)
8903 (lisp_data_to_selection_data, Fx_register_dnd_atom):
8904 Don't store size until memory allocation succeeds.
8905 (x_get_window_property): Plug memory leak on memory exhaustion.
8906 Don't double-block input; malloc is safe here. Don't assume 2**34
8907 - 4 fits in unsigned long. Add an xassert to check
8908 XGetWindowProperty overflow. Be more careful about overflow
8909 calculations, and distinguish size from memory overflow better.
8910 (receive_incremental_selection): When tracing, don't assume
8911 unsigned int is less than INT_MAX.
8912 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
8913 harmful) conversions of unsigned short to int.
8914 (lisp_data_to_selection_data): Don't assume that integers
8915 in the range -65535 through -1 fit in an X unsigned short.
8916 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
8917 result parameters unless successful. Rely on cons_to_unsigned
8918 to report problems with elements; the old code wasn't right anyway.
8919 (x_check_property_data): Check for int overflow; we cannot use
8920 a wider type due to X limits.
8921 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
8923 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
8925 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
8926 (x_term_init): Check for size calculation overflow.
8927 (x_color_cells): Don't store size until memory allocation succeeds.
8928 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
8929 Don't assume alloca size is less than MAX_ALLOCA.
8930 (x_term_init): Don't assume length fits in int (sprintf is limited
8933 Use ptrdiff_t for composition IDs.
8934 * character.c (lisp_string_width):
8935 * composite.c (composition_table_size, n_compositions)
8936 (get_composition_id, composition_gstring_from_id):
8937 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
8938 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
8939 * window.c (Frecenter):
8940 Use ptrdiff_t, not int, for composition IDs.
8941 * composite.c (get_composition_id): Check for integer overflow.
8942 * composite.h: Adjust prototypes to match the above changes.
8944 Use ptrdiff_t for hash table indexes.
8945 * category.c (hash_get_category_set):
8946 * ccl.c (ccl_driver):
8947 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
8948 * coding.c (coding_system_charset_list, detect_coding_system):
8949 * coding.h (struct coding_system.id):
8950 * composite.c (get_composition_id, gstring_lookup_cache):
8951 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
8952 * image.c (xpm_get_color_table_h):
8953 * lisp.h (hash_lookup, hash_put):
8954 * minibuf.c (Ftest_completion):
8955 Use ptrdiff_t for hash table indexes, not int (which is too
8956 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
8957 32-bit --with-wide-int hosts).
8959 * charset.c (Fdefine_charset_internal): Check for integer overflow.
8960 Add a FIXME comment about memory leaks.
8961 (syms_of_charset): Don't assume xmalloc returns.
8963 Don't assume that stated character widths fit in int.
8964 * character.c (Fchar_width, c_string_width, lisp_string_width):
8965 * character.h (CHAR_WIDTH):
8966 * indent.c (MULTIBYTE_BYTES_WIDTH):
8967 Use sanitize_char_width to avoid undefined and/or bad behavior
8968 with outlandish widths.
8969 * character.h (sanitize_tab_width): Rename from sanitize_width,
8970 now that we have two such functions. All uses changed.
8971 (sanitize_char_width): New inline function.
8973 Don't assume that tab-width fits in int.
8974 * character.h (sanitize_width): New inline function.
8975 (SANE_TAB_WIDTH): New macro.
8976 (ASCII_CHAR_WIDTH): Use it.
8977 * indent.c (sane_tab_width): Remove. All uses replaced by
8978 SANE_TAB_WIDTH (current_buffer).
8979 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
8981 * fileio.c: Integer overflow issues with file modes.
8982 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
8984 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
8985 Remove unreachable code.
8986 (read_hex, load_charset_map_from_file): Check for integer overflow.
8988 * xterm.c: Don't go over XClientMessageEvent limit.
8989 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
8990 (x_send_scroll_bar_event): Likewise. Check that the size does not
8991 exceed limits imposed by XClientMessageEvent, as well as the usual
8992 ptrdiff_t and size_t limits.
8994 * keyboard.c: Overflow, signedness and related fixes.
8995 (make_lispy_movement): Use same integer type in forward decl
8996 that is used in the definition.
8997 (read_key_sequence, keyremap_step):
8998 Change bufsize argument back to int, undoing my 2011-03-30 change.
8999 We prefer signed types, and int is wide enough here.
9000 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
9001 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
9002 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
9003 length, not size_t. Use ptrdiff_t for index, not int.
9004 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
9005 possibility of integer overflow.
9007 Overflow, signedness and related fixes for images.
9009 * dispextern.h (struct it.stack[0].u.image.image_id)
9010 (struct_it.image_id, struct image.id, struct image_cache.size)
9011 (struct image_cache.used, struct image_cache.ref_count):
9012 * gtkutil.c (update_frame_tool_bar):
9013 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
9014 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
9015 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
9016 * nsmenu.m (update_frame_tool_bar):
9017 * xdisp.c (calc_pixel_width_or_height):
9018 * xfns.c (image_cache_refcount):
9019 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
9020 on typical 64-bit hosts.
9022 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9023 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
9024 Omit unnecessary casts to int.
9025 (parse_image_spec): Check that integers fall into 'int' range
9026 when the callers expect that.
9027 (image_ascent): Redo ascent calculation to avoid int overflow.
9028 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
9029 (lookup_image): Remove unnecessary tests.
9030 (xbm_image_p): Locals are now of int, not EMACS_INT,
9031 since parse_image_check makes sure they fit into int.
9032 (png_load, gif_load, svg_load_image):
9033 Prefer int to unsigned where either will do.
9034 (tiff_handler): New function, combining the cores of the
9035 old tiff_error_handler and tiff_warning_handler.
9036 This function is rewritten to use vsnprintf and thereby avoid
9037 stack buffer overflows. It uses only the features of vsnprintf
9038 that are common to both POSIX and native Microsoft.
9039 (tiff_error_handler, tiff_warning_handler): Use it.
9040 (tiff_load, gif_load, imagemagick_load_image):
9041 Don't assume :index value fits in 'int'.
9042 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
9043 (imagemagick_load_image): Check that crop parameters fit into
9044 the integer types that MagickCropImage accepts. Don't assume
9045 Vimagemagick_render_type has a nonnegative value. Don't assume
9046 size_t fits in 'long'.
9047 (gs_load): Use printmax_t to print the widest integers possible.
9048 Check for integer overflow when computing image height and width.
9050 2011-08-26 Eli Zaretskii <eliz@gnu.org>
9052 * xdisp.c (redisplay_window): Don't force window start if point
9053 will be invisible in the resulting window. (Bug#9324)
9055 2011-08-25 Eli Zaretskii <eliz@gnu.org>
9057 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
9058 the display spec is of the form `(space ...)'.
9059 (handle_display_spec): Return the value returned by
9060 handle_single_display_spec, not just 1 or zero.
9061 (handle_single_display_spec): If the display spec is of the form
9062 `(space ...)', and specifies display in the text area, return 2
9064 (try_cursor_movement): Check for the need to scroll more
9065 accurately, and prefer exact match for point under bidi.
9066 Don't advance `row' beyond the last row of the window.
9068 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
9069 into disp_prop; all users changed.
9071 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
9072 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
9073 for the text covered by the display property.
9075 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
9077 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
9078 Change return value to nil.
9079 (Frecord_buffer): Delete unused function.
9081 2011-08-24 Eli Zaretskii <eliz@gnu.org>
9083 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
9084 buffers, return left-to-right.
9085 (set_cursor_from_row): Consider candidate row a win if its glyph
9086 represents a newline and point is on that newline. Fixes cursor
9087 positioning on the newline at EOL of R2L text within L2R
9088 paragraph, and vice versa.
9089 (try_cursor_movement): Check continued rows, in addition to
9090 continuation rows. Fixes unwarranted scroll when point enters a
9091 continued line of R2L text within an L2R paragraph, or vice versa.
9092 (cursor_row_p): Consider the case of point being equal to
9093 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
9094 from the end of a short line to the beginning of a continued line
9095 of R2L text within L2R paragraph.
9096 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
9097 composed characters.
9099 * bidi.c (bidi_check_type): Use xassert.
9100 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
9103 2011-08-23 Eli Zaretskii <eliz@gnu.org>
9105 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
9108 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
9110 * nsfont.m (ns_otf_to_script): Fix typo.
9112 2011-08-22 Kenichi Handa <handa@m17n.org>
9114 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
9115 extra slot even if the purpose is char-code-property-table.
9117 2011-08-23 Eli Zaretskii <eliz@gnu.org>
9119 * xdisp.c (redisplay_window): When computing centering_position,
9120 account for the height of the header line. (Bug#8874)
9122 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
9123 instead of CHAR_TO_BYTE. Fixes a crash when a completion
9124 candidate is selected by the mouse, and that candidate has a
9125 composed character under the mouse.
9127 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
9128 coordinates reported by pos-visible-in-window-p for a composed
9129 character in column zero.
9131 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
9133 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
9135 2011-08-22 Eli Zaretskii <eliz@gnu.org>
9137 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
9138 consider it a hit if to_charpos is anywhere in the range of the
9139 composed buffer positions.
9141 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
9143 * image.c (gif_load): Don't assume that each subimage has the same
9144 dimensions as the base image. Handle disposal method that is
9145 "undefined" by the gif spec (Bug#9335).
9147 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
9149 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
9150 (Fcondition_case): Document `debug' symbol in error handler.
9152 2011-08-19 Eli Zaretskii <eliz@gnu.org>
9154 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
9155 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
9156 from an Org mode buffer to a Speedbar frame.
9158 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
9159 a composition, take its buffer position from IT->cmp_it.charpos.
9160 Fixes cursor positioning at the beginning of a line that begins
9161 with a composed character.
9163 2011-08-18 Eli Zaretskii <eliz@gnu.org>
9165 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
9166 character bidirectional type, use STRONG_L instead. Fixes crashes
9167 in a buffer produced by `describe-categories'.
9169 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
9170 members before the level stack, so they would be saved and
9171 restored when copying iterator state. Fixes incorrect reordering
9172 around TABs covered by display properties.
9174 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
9176 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
9178 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
9180 * eval.c (internal_condition_case, internal_condition_case_1)
9181 (internal_condition_case_2, internal_condition_case_n):
9182 Remove unnecessary aborts (Bug#9081).
9184 2011-08-17 Eli Zaretskii <eliz@gnu.org>
9186 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
9187 has no `load' handler, try opening the file locally. (Bug#9311)
9189 2011-08-16 Ken Brown <kbrown@cornell.edu>
9191 * gmalloc.c: Expand comment.
9193 2011-08-16 Eli Zaretskii <eliz@gnu.org>
9195 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
9196 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
9198 2011-08-16 Ken Brown <kbrown@cornell.edu>
9200 Fix memory allocation problems in Cygwin build (Bug#9273).
9202 * unexcw.c ( __malloc_initialized): Declare external variable.
9203 (fixup_executable): Force the dumped emacs to reinitialize malloc.
9205 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
9207 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
9209 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
9211 [CYGWIN] (special_realloc): New function.
9212 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
9213 requests to realloc storage in the static heap.
9215 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
9217 * bidi.c (bidi_initialize): Remove unused local.
9219 2011-08-15 Eli Zaretskii <eliz@gnu.org>
9222 * biditype.h: Remove file.
9223 * makefile.w32-in ($(BLD)/bidi.$(O)):
9224 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
9226 * dispextern.h: Fix a typo in the comment to bidi_type_t.
9228 * chartab.c: Improve commentary for the uniprop_table API.
9230 * bidi.c (bidi_paragraph_init): Support zero value of
9231 bidi_ignore_explicit_marks_for_paragraph_level.
9232 (bidi_initialize): Use uniprop_table instead of including
9233 biditype.h and bidimirror.h.
9235 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
9236 coordinates of the iterator when restoring from ppos_it.
9239 2011-08-14 Kenichi Handa <handa@m17n.org>
9241 * process.c (create_process): Call setup_process_coding_systems
9242 after the pid of the process is set to -1 (Bug#8162).
9244 2011-08-14 Eli Zaretskii <eliz@gnu.org>
9246 * xdisp.c (move_it_in_display_line_to): Don't invoke
9247 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
9248 ppos_it. Fixes vertical cursor motion when line beginning is
9249 covered by an image. (Bug#9296)
9251 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
9253 * nsterm.h (ns_run_ascript): Declare.
9254 (NSAPP_DATA2_RUNASSCRIPT): Define.
9256 * nsfns.m (as_script, as_result, as_status): New static variables.
9257 (ns_run_ascript): New function.
9258 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
9259 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
9260 the event loop. Get status from as_status (Bug#7276).
9262 * nsterm.m (sendEvent): If event is NSApplicationDefined and
9263 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
9264 the event loop (Bug#7276).
9266 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
9268 * gnutls.c (QCgnutls_bootprop_priority)
9269 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
9270 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
9271 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
9272 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
9273 (QCgnutls_bootprop_verify_hostname_error)
9274 (QCgnutls_bootprop_callbacks_verify): Rename from
9275 Qgnutls_bootprop_..., all uses changed.
9277 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
9280 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
9282 * xfaces.c (Qframe_set_background_mode): Now static.
9283 * dispextern.h (Qframe_set_background_mode): Remove decl.
9285 * process.c (Fnetwork_interface_info): Declare local only if needed.
9287 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
9289 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
9290 (Fnetwork_interface_list): Allocate in increments of bytes instead
9291 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
9292 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
9294 (struct ifflag_def): notrailers is smart on OSX.
9295 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
9296 Get hardware address with getifaddrs if available.
9298 2011-08-12 Eli Zaretskii <eliz@gnu.org>
9300 * xdisp.c (iterate_out_of_display_property): xassert that
9301 IT->position is set to within IT->object's boundaries. Break from
9302 the loop as soon as EOB is reached; avoids infloops in redisplay
9303 when IT->position is set up wrongly due to some bug.
9304 Set IT->current to match the bidi iterator unconditionally.
9305 (push_display_prop): Allow GET_FROM_STRING as IT->method on
9306 entry. Force push_it to save on the stack the current
9307 buffer/string position, to be restored by pop_it. Fix flags in
9308 the iterator structure wrt the object coming from a display
9309 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
9310 properties. (Bug#9284)
9312 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
9314 * fontset.c (fontset_get_font_group): Add proper type checks.
9317 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9319 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
9320 and LC_VERSION_MIN_MACOSX.
9321 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
9322 (dump_it) [LC_FUNCTION_STARTS]: Use it.
9324 2011-08-08 Eli Zaretskii <eliz@gnu.org>
9326 * xdisp.c (forward_to_next_line_start): Allow to use the
9327 no-display-properties-and-no-overlays under bidi display.
9328 Set disp_pos in the bidi iterator to avoid searches for display
9329 properties and overlays.
9331 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
9333 * editfns.c (Fset_time_zone_rule): Document relationship with the
9336 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
9337 the font entity extracted from the cache (Bug#8109).
9339 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
9341 * composite.c (autocmp_chars): Don't reset point. That is done by
9342 restore_point_unwind (Bug#5984).
9344 2011-08-07 Juri Linkov <juri@jurta.org>
9346 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
9347 to show the arg `TIME' instead of `TIMEVAL'.
9349 2011-08-06 Eli Zaretskii <eliz@gnu.org>
9351 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
9352 display property strides EOL and includes a newline, as in
9353 longlines-mode. (Bug#9254)
9354 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
9355 word-wrap under bidirectional display. (Bug#9224)
9357 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
9358 is non-zero, even if the data buffer is NULL. Fixes a crash in
9359 vertical-motion with longlines-mode. (Bug#9254)
9361 2011-08-05 Eli Zaretskii <eliz@gnu.org>
9363 * bidi.c <bidi_cache_total_alloc>: Now static.
9364 (bidi_initialize): Initialize bidi_cache_total_alloc.
9366 * xdisp.c (display_line): Release buffer allocated for shelved bidi
9369 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
9370 amount allocated this far in `bidi_cache_total_alloc'.
9371 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
9372 non-zero, only free the data buffer without restoring the cache
9373 contents. All callers changed.
9375 * dispextern.h (bidi_unshelve_cache): Update prototype.
9377 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
9378 (move_it_in_display_line, move_it_to)
9379 (move_it_vertically_backward, move_it_by_lines): Replace the call
9380 to xfree to an equivalent call to bidi_unshelve_cache.
9381 (move_it_in_display_line_to): Fix logic of returning
9382 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
9384 2011-08-05 Eli Zaretskii <eliz@gnu.org>
9386 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
9387 came from a string character with a `cursor' property. (Bug#9229)
9389 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
9391 * Makefile.in (LIB_PTHREAD): New variable.
9392 (LIBES): Add LIB_PTHREAD (Bug#9216).
9394 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
9395 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
9397 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
9399 * regex.c (re_iswctype): Remove some redundant boolean conversions.
9401 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
9403 * xterm.c (x_find_topmost_parent): New function.
9404 (x_set_frame_alpha): Find topmost parent window with
9405 x_find_topmost_parent and set the property there also (bug#9181).
9406 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
9408 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
9410 * callproc.c (Fcall_process): Avoid vfork clobbering
9411 the local vars buffer, coding_systems, current_dir.
9413 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
9415 * keymap.c (Fmake_composed_keymap): Move to subr.el.
9417 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
9419 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
9420 so that it is not optimized away.
9422 * xdisp.c (compute_display_string_pos): Remove unused local.
9424 2011-08-02 Eli Zaretskii <eliz@gnu.org>
9426 Fix slow cursor motion and scrolling in large buffers with
9427 selective display, like Org Mode buffers. (Bug#9218)
9429 * dispextern.h (struct bidi_it): New member disp_prop_p.
9431 * xdisp.c: Remove one-slot cache of display string positions.
9432 (compute_display_string_pos): Accept an additional argument
9433 DISP_PROP_P; callers changed. Scan at most 5K characters forward
9434 for a display string or property. If found, set DISP_PROP_P
9437 * bidi.c (bidi_fetch_char): Accept an additional argument
9438 DISP_PROP_P, and pass it to compute_display_string_pos.
9439 Only handle text covered by a display string if DISP_PROP_P is returned
9440 non-zero. All callers of bidi_fetch_char changed.
9442 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
9444 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
9446 2010-12-03 Don March <don@ohspite.net>
9448 * keymap.c (Fdefine_key): Fix non-prefix key error message when
9449 last character M-[char] is translated to ESC [char] (bug#7541).
9451 2011-08-02 Kenichi Handa <handa@m17n.org>
9453 * lisp.h (uniprop_table): Extern it.
9455 * chartab.c (uniprop_table): Make it non-static.
9457 2011-08-01 Eli Zaretskii <eliz@gnu.org>
9459 * xdisp.c (forward_to_next_line_start): Accept additional argument
9460 BIDI_IT_PREV, and store into it the state of the bidi iterator had
9462 (reseat_at_next_visible_line_start): Use the bidi iterator state
9463 returned by forward_to_next_line_start to restore the state of
9464 it->bidi_it after backing up to previous newline. (Bug#9212)
9466 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
9468 * regex.c (re_comp): Protoize.
9469 (re_exec): Fix return type.
9470 (regexec): Fix type of `ret'. (Bug#9203)
9472 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
9474 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
9475 This is needed if max-image-size is a floating-point number.
9477 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
9479 * print.c (print_object): Print empty symbol as ##.
9481 * lread.c (read1): Read ## as empty symbol.
9483 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
9485 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
9486 setting frame foreground color (Bug#9175).
9487 (x_set_background_color): Likewise.
9489 * nsmenu.m (-setText): Size tooltip dimensions precisely to
9490 contents (Bug#9176).
9491 (EmacsTooltip -init): Remove bezels and add shadows to
9494 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
9495 or scroll bar (Bug#8470).
9497 * nsfont.m (nsfont_open): Remove assignment to voffset and
9498 unnecessary vars hshink, expand, hd, full_height, min_height.
9499 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
9501 * nsterm.h (nsfont_info): Remove voffset field.
9503 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
9505 Implement strike-through and overline on NextStep (Bug#8863).
9507 * nsfont.m (nsfont_open): Use underline position provided by font,
9508 instead of hard-coded value of 2.
9509 (nsfont_draw): Call ns_draw_text_decoration instead.
9511 * nsterm.h: Add declaration for ns_draw_text_decoration.
9513 * nsterm.m (ns_draw_text_decoration): New function for drawing
9514 underline, overline, and strike-through.
9515 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
9516 ns_draw_text_decoration. Change treatment of cursor drawing to
9517 accommodate underlining, etc.
9519 2011-07-28 Eli Zaretskii <eliz@gnu.org>
9521 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
9524 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
9526 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
9527 Without this fix, if a signal arrives just after memory fills up,
9528 'malloc' might be invoked reentrantly.
9530 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
9531 In other words, assume that every image size is allowed, on non-X
9532 hosts. This assumption is probably wrong, but it lets Emacs compile.
9534 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
9536 * regex.c (re_iswctype): Convert return values to boolean.
9538 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
9540 * xdisp.c (compute_display_string_pos): Don't use cached display
9541 string position if the buffer had its restriction changed.
9544 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
9546 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
9548 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
9550 Integer signedness and overflow and related fixes. (Bug#9079)
9552 * bidi.c: Integer size and overflow fixes.
9553 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
9554 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
9555 (bidi_cache_find_level_change, bidi_cache_ensure_space)
9556 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
9557 (bidi_find_other_level_edge):
9558 Use ptrdiff_t instead of EMACS_INT where either will do.
9559 This works better on 32-bit hosts configured --with-wide-int.
9560 (bidi_cache_ensure_space): Check for size-calculation overflow.
9561 Use % rather than repeated addition, for better worst-case speed.
9562 Don't set bidi_cache_size until after xrealloc returns, because it
9564 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
9565 (bidi_cache_ensure_space): Also check that the bidi cache size
9566 does not exceed that of the largest Lisp string or buffer. See Eli
9567 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
9569 * alloc.c (__malloc_size_t): Remove.
9570 All uses replaced by size_t. See Andreas Schwab's note
9571 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
9573 * image.c: Improve checking for integer overflow.
9574 (check_image_size): Assume that f is nonnull, since
9575 it is always nonnull in practice. This is one less thing to
9576 worry about when checking for integer overflow later.
9577 (x_check_image_size): New function, which checks for integer
9578 overflow issues inside X.
9579 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
9580 This removes the need for a memory_full check.
9581 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
9582 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
9583 (xbm_read_bitmap_data): Change locals back to 'int', since
9584 their values must fit in 'int'.
9585 (xpm_load_image, png_load, tiff_load):
9586 Invoke x_create_x_image_and_pixmap earlier,
9587 to avoid much needless work if the image is too large.
9588 (tiff_load): Treat overly large images as if
9589 x_create_x_image_and_pixmap failed, not as malloc failures.
9590 (gs_load): Use x_check_image_size.
9592 * gtkutil.c: Omit integer casts.
9593 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
9594 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
9596 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
9598 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
9599 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
9600 would wrongly return t on a 64-bit host.
9602 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
9603 The plain *_OVERFLOW macros run afoul of GCC bug 49705
9604 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
9605 and therefore cause GCC to emit a bogus diagnostic in some cases.
9607 * image.c: Integer signedness and overflow and related fixes.
9608 This is not an exhaustive set of fixes, but it's time to
9609 record what I've got.
9610 (lookup_pixel_color, check_image_size): Remove redundant decls.
9611 (check_image_size): Don't assume that arbitrary EMACS_INT values
9612 fit in 'int', or that arbitrary 'double' values fit in 'int'.
9613 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
9614 (tiff_load, imagemagick_load_image):
9615 Check for overflow in size calculations.
9616 (x_create_x_image_and_pixmap): Remove unnecessary test for
9617 xmalloc returning NULL; that can't happen.
9618 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
9619 (xpm_color_bucket): Use better integer hashing function.
9620 (xpm_cache_color): Don't possibly over-allocate memory.
9621 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
9622 (gif_memory_source):
9623 Use ptrdiff_t, not int or size_t, to record sizes.
9624 (png_load): Don't assume values greater than 2**31 fit in 'int'.
9625 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
9626 either works, as we prefer signed integers.
9627 (tiff_read_from_memory, tiff_write_from_memory):
9628 Return tsize_t, not size_t, since that's what the TIFF API wants.
9629 (tiff_read_from_memory): Don't fail simply because the read would
9630 go past EOF; instead, return a short read.
9631 (tiff_load): Omit no-longer-needed casts.
9632 (Fimagemagick_types): Don't assume size fits into 'int'.
9634 Improve hashing quality when configured --with-wide-int.
9635 * fns.c (hash_string): New function, taken from sxhash_string.
9636 Do not discard information about ASCII character case; this
9637 discarding is no longer needed.
9638 (sxhash-string): Use it. Change sig to match it. Caller changed.
9639 * lisp.h: Declare it.
9640 * lread.c (hash_string): Remove, since we now use fns.c's version.
9641 The fns.c version returns a wider integer if --with-wide-int is
9642 specified, so this should help the quality of the hashing a bit.
9644 * emacs.c: Integer overflow minor fix.
9645 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
9646 Define only if GNU_LINUX.
9647 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
9649 * dispnew.c: Integer signedness and overflow fixes.
9650 Remove unnecessary forward decls, that were a maintenance hassle.
9651 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
9653 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
9654 (scrolling_window): Use ptrdiff_t, not int, for byte count.
9655 (prepare_desired_row, line_draw_cost):
9656 Use int, not unsigned, where either works.
9657 (save_current_matrix, restore_current_matrix):
9658 Use ptrdiff_t, not size_t, where either works.
9659 (init_display): Check for overflow more accurately, and without
9660 relying on undefined behavior.
9662 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
9663 Remove, replacing with the new symbols in lisp.h. All uses changed.
9664 * fileio.c (make_temp_name):
9665 * filelock.c (lock_file_1, lock_file):
9666 * xdisp.c (message_dolog):
9667 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
9668 Use pMd etc. instead.
9669 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
9670 replacing the pWIDE etc. symbols removed from editfns.c.
9672 * keyboard.h (num_input_events): Now uintmax_t.
9673 This is (very slightly) less likely to mess up due to wraparound.
9676 * buffer.c: Integer signedness fixes.
9677 (alloc_buffer_text, enlarge_buffer_text):
9678 Use ptrdiff_t rather than size_t when either will do, as we prefer
9681 * alloc.c: Integer signedness and overflow fixes.
9682 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
9683 (__malloc_size_t): Default to size_t, not to int.
9684 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
9685 (Fgarbage_collect, mark_object_loop_halt, mark_object):
9686 Prefer ptrdiff_t to size_t when either would do, as we prefer
9688 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
9689 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
9690 Now const. Initialize with values that are in range even if char
9692 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
9693 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
9694 These functions do the right thing with sizes > 2**32.
9695 (check_depth): Now ptrdiff_t, not int.
9696 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
9697 Adjust to new way of storing sizes. Check for size overflow bugs
9699 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
9700 slightly wrong anyway, as it missed one instance of
9701 XMALLOC_OVERRUN_CHECK_OVERHEAD.
9702 (refill_memory_reserve): Omit needless cast to size_t.
9703 (mark_object_loop_halt): Mark as externally visible.
9705 * xselect.c: Integer signedness and overflow fixes.
9706 (Fx_register_dnd_atom, x_handle_dnd_message):
9707 Use ptrdiff_t, not size_t, since we prefer signed.
9708 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
9709 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
9710 x_dnd_atoms_size and x_dnd_atoms_length.
9712 * doprnt.c: Prefer signed to unsigned when either works.
9714 * doprnt.c (doprnt):
9716 * xdisp.c (vmessage):
9717 Use ptrdiff_t, not size_t, when using or implementing doprnt,
9718 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
9719 prefer signed arithmetic to avoid comparison confusion.
9720 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
9721 but is a bit tricky.
9723 Assume freestanding C89 headers, string.h, stdlib.h.
9724 * data.c, doprnt.c, floatfns.c, print.c:
9725 Include float.h unconditionally.
9726 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
9727 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
9728 * regex.c: Likewise for stddef.h, string.h.
9729 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
9730 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
9731 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
9732 (STDC_HEADERS): Remove obsolete defines.
9733 * sysdep.c: Include limits.h unconditionally.
9735 Assume support for memcmp, memcpy, memmove, memset.
9736 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
9737 * regex.c (memcmp, memcpy):
9738 Remove; we assume C89 now.
9740 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
9741 (__malloc_safe_bcopy): Remove; no longer needed.
9743 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
9744 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
9745 well either way, and we prefer signed to unsigned.
9747 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
9749 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
9750 closes the connection while we're reading (bug#9182).
9752 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
9754 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
9755 are specified (Bug#9168).
9757 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
9759 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
9760 Found by GCC static checking and --with-wide-int on a 32-bit host.
9762 2011-07-25 Eli Zaretskii <eliz@gnu.org>
9764 * xdisp.c (compute_display_string_pos): Fix logic of caching
9765 previous display string position. Initialize cached_prev_pos to
9766 -1. Fixes slow-down at the beginning of a buffer.
9768 2011-07-24 Eli Zaretskii <eliz@gnu.org>
9770 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
9771 for attrs[LFACE_FONTSET_INDEX].
9773 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
9775 * xml.c (parse_region): Remove unused local
9776 that was recently introduced.
9778 2011-07-23 Eli Zaretskii <eliz@gnu.org>
9780 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
9781 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
9783 * xdisp.c (move_it_in_display_line_to): Record the best matching
9784 position for TO_CHARPOS while scanning the line, and restore it on
9785 exit if none of the characters scanned was an exact match.
9786 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
9787 when exact match is impossible due to invisible text, and the
9788 lines are truncated.
9790 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
9792 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
9795 2011-07-22 Eli Zaretskii <eliz@gnu.org>
9797 Fix a significant slow-down of cursor motion with C-n, C-p,
9798 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
9799 auto-repeat under bidi redisplay in fontified buffers.
9800 * xdisp.c (compute_stop_pos_backwards): New function.
9801 (next_element_from_buffer): Call compute_stop_pos_backwards to
9802 find a suitable prev_stop when we find ourselves before
9804 (reseat): Don't look for prev_stop, as that could mean a very long
9806 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
9807 <cached_disp_overlay_modiff>: Cache for last found display string
9809 (compute_display_string_pos): Return the cached position if asked
9810 about the same buffer in the same area of character positions, and
9811 the buffer wasn't changed since the time the display string
9812 position was cached.
9814 2011-07-22 Eli Zaretskii <eliz@gnu.org>
9816 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
9817 is an integer, which is important for empty lines. (Bug#9149)
9819 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
9821 * frame.c (Fmodify_frame_parameters): In tty case, update the
9822 default face if necessary (Bug#4238).
9824 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
9826 * editfns.c (Fstring_to_char): No need to explain what a character
9827 is in the docstring (Bug#6576).
9829 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
9831 * xml.c (parse_region): Make sure we always return a tree.
9833 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
9835 * xml.c (parse_region): If a document contains only comments,
9838 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
9840 * xml.c (make_dom): Return comments, too.
9842 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
9845 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
9846 and the surrounding thread.
9847 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
9848 rather than fgets, and retry after EINTR. Otherwise, 'emacs
9849 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
9851 * s/openbsd.h (BROKEN_SIGIO): Define.
9852 * unexelf.c (unexec) [__OpenBSD__]:
9853 Don't update the .mdebug section of the Alpha COFF symbol table.
9855 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
9857 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
9860 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
9862 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
9863 This fixes some race conditions on the permissions of any newly
9866 * alloc.c (valid_pointer_p): Use pipe, not open.
9867 This fixes some permissions issues when debugging.
9869 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
9870 If fchown fails to set both uid and gid, try to set just gid,
9871 as that is sometimes allowed. Adjust the file's mode to eliminate
9872 setuid or setgid bits that are inappropriate if fchown fails.
9874 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
9876 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
9877 to compare Lisp_Objects.
9878 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
9879 global_gnutls_log_level, don't mistake it for a Lisp_Object.
9880 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
9882 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
9884 * lread.c (read_integer): Unread even EOF character.
9885 (read1): Likewise. Properly record start position of symbol.
9887 * lread.c (read1): Read `#:' as empty uninterned symbol if no
9888 symbol character follows.
9890 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
9892 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
9893 This works around a problem with the previous change to Fcopy_file.
9894 Recent glibc declares fchown with __attribute__((warn_unused_result)),
9895 and without this change, GCC might complain about discarding
9896 fchown's return value.
9898 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
9900 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
9902 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
9904 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
9906 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
9908 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
9909 it's used from the C level.
9911 * process.c: Use the same condition for POLL_FOR_INPUT in both
9912 keyboard.c and process.c (bug#1858).
9914 2011-07-09 Lawrence Mitchell <wence@gmx.li>
9916 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
9917 (Fgnutls_boot): Use it.
9919 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
9921 * doc.c (Fsubstitute_command_keys): Revert last change.
9923 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
9925 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
9926 quotes the next character, and doesn't affect other longer
9927 sequences (bug#8935).
9929 * lread.c (syms_of_lread): Clarify that is isn't only
9930 `eval-buffer' and `eval-defun' that's affected by
9931 `lexical-binding' (bug#8460).
9933 2011-07-15 Eli Zaretskii <eliz@gnu.org>
9935 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
9936 bidi redisplay when a line includes both an image and is truncated.
9938 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
9940 Fix minor problems found by static checking.
9941 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
9942 (elsz): Now a signed constant, not a size_t var. We prefer signed
9943 types to unsigned, to avoid integer comparison confusion. Without
9944 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
9945 "cannot optimize loop, the loop counter may overflow", a symptom
9947 * indent.c (Fvertical_motion): Mark locals as initialized.
9948 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
9950 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
9952 * search.c (Fre_search_backward): Mention `case-fold-search' in
9953 all the re_search_* functions (bug#8138).
9955 * keyboard.c (Fopen_dribble_file): Document when the file is
9958 2011-07-14 Eli Zaretskii <eliz@gnu.org>
9960 * bidi.c (bidi_dump_cached_states): Fix format of displaying
9963 Support bidi reordering of display and overlay strings.
9964 * xdisp.c (compute_display_string_pos)
9965 (compute_display_string_end): Accept additional argument STRING.
9966 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
9967 (reseat_to_string): Initialize bidi_it->string.s and
9968 bidi_it->string.schars.
9969 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
9970 NULL (avoids a crash in bidi_paragraph_init).
9971 Initialize itb.string.lstring.
9972 (init_iterator): Call bidi_init_it only of a valid
9973 buffer position was specified. Initialize paragraph_embedding to
9975 (reseat_to_string): Initialize the bidi iterator.
9976 (display_string): If we need to ignore text properties of
9977 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
9978 original value of -1 will not work with bidi.)
9979 (compute_display_string_pos): First arg is now struct
9980 `text_pos *'; all callers changed. Support display properties on
9982 (compute_display_string_end): Support display properties on Lisp
9984 (init_iterator, reseat_1, reseat_to_string): Initialize the
9985 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
9986 when iterating on a string not from display properties).
9987 (compute_display_string_pos, compute_display_string_end):
9988 Fix calculation of the object to scan. Fixes an error when using
9990 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
9991 base_level_stop; instead, set base_level_stop to BEGV.
9992 Fixes crashes in vertical-motion.
9993 (next_element_from_buffer): Improve commentary for when
9994 the iterator is before prev_stop.
9995 (init_iterator): Initialize bidi_p from the default value of
9996 bidi-display-reordering, not from buffer-local value. Use the
9997 buffer-local value only if initializing for buffer iteration.
9998 (handle_invisible_prop): Support invisible properties on strings
9999 that are being bidi-reordered.
10000 (set_iterator_to_next): Support bidi reordering of C strings and
10002 (next_element_from_string): Support bidi reordering of Lisp
10004 (handle_stop_backwards): Support Lisp strings as well.
10005 (display_string): Support display of R2L glyph rows.
10006 Use IT_STRING_CHARPOS when displaying from a Lisp string.
10007 (init_iterator): Don't initialize it->bidi_p for strings
10009 (reseat_to_string): Initialize it->bidi_p for strings here.
10010 (next_element_from_string, next_element_from_c_string)
10011 (next_element_from_buffer): Add xassert's for correspondence
10012 between IT's object being iterated and it->bidi_it.string
10014 (face_before_or_after_it_pos): Support bidi iteration.
10015 (next_element_from_c_string): Handle the case of the first string
10016 character that is not the first one in the visual order.
10017 (get_visually_first_element): New function, refactored from common
10018 parts of next_element_from_buffer, next_element_from_string, and
10019 next_element_from_c_string.
10020 (tool_bar_lines_needed, redisplay_tool_bar)
10021 (display_menu_bar): Force left-to-right direction. Add a FIXME
10022 comment for making that be controlled by a user option.
10023 (push_it, pop_it): Save and restore the state of the
10024 bidi iterator. Save and restore the bidi_p flag.
10025 (pop_it): Iterate out of display property for string iteration as
10027 (iterate_out_of_display_property): Support iteration over strings.
10028 (handle_single_display_spec): Set up it->bidi_it for iteration
10029 over a display string, and call bidi_init_it.
10030 (handle_single_display_spec, next_overlay_string)
10031 (get_overlay_strings_1, push_display_prop): Set up the bidi
10032 iterator for displaying display or overlay strings.
10033 (forward_to_next_line_start): Don't use the shortcut if
10035 (back_to_previous_visible_line_start): If handle_display_prop
10036 pushed the iterator stack, restore the internal state of the bidi
10037 iterator by calling bidi_pop_it same number of times.
10038 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
10039 and we are bidi-iterating, don't decrement the iterator position;
10040 instead, set the first_elt flag in the bidi iterator, to produce
10042 (reseat_1): Remove redundant setting of string_from_display_prop_p.
10043 (push_display_prop): xassert that we are iterating a buffer.
10044 (push_it, pop_it): Save and restore paragraph_embedding member.
10045 (handle_single_display_spec, next_overlay_string)
10046 (get_overlay_strings_1, reseat_1, reseat_to_string)
10047 (push_display_prop): Set up the `unibyte' member of bidi_it.string
10048 correctly. Don't assume unibyte strings are not bidi-reordered.
10049 (compute_display_string_pos)
10050 (compute_display_string_end): Fix handling the case of C string.
10051 (push_it, pop_it): Save and restore from_disp_prop_p.
10052 (handle_single_display_spec, push_display_prop): Set the
10053 from_disp_prop_p flag.
10054 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
10055 (pop_it): Call iterate_out_of_display_property only if we are
10056 popping after iteration over a string that came from a display
10057 property. Fix a typo in popping stretch info. Add an assertion
10058 for verifying that the iterator position is in sync with the bidi
10060 (handle_single_display_spec, get_overlay_strings_1)
10061 (push_display_prop): Fix initialization of paragraph direction for
10062 string when that of the parent object is not yet determined.
10063 (reseat_1): Call bidi_init_it to resync the bidi
10064 iterator with IT's position. (Bug#7616)
10065 (find_row_edges): If ROW->start.pos gives position
10066 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
10067 (handle_stop, back_to_previous_visible_line_start, reseat_1):
10068 Reset the from_disp_prop_p flag.
10069 (SAVE_IT, RESTORE_IT): New macros.
10070 (pos_visible_p, face_before_or_after_it_pos)
10071 (back_to_previous_visible_line_start)
10072 (move_it_in_display_line_to, move_it_in_display_line)
10073 (move_it_to, move_it_vertically_backward, move_it_by_lines)
10074 (try_scrolling, redisplay_window, display_line): Use them when
10075 saving a temporary copy of the iterator and restoring it back.
10076 (back_to_previous_visible_line_start, reseat_1)
10077 (init_iterator): Empty the bidi cache "stack".
10078 (move_it_in_display_line_to): If iterator ended up at
10079 EOL, but we never saw any buffer positions smaller than
10080 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
10081 motion in bidi-reordered lines.
10082 (move_it_in_display_line_to): Record prev_method and prev_pos
10083 immediately before the call to set_iterator_to_next. Fixes cursor
10084 motion in bidi-reordered lines with stretch glyphs and strings
10085 displayed in margins. (Bug#8133) (Bug#8867)
10086 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
10088 (pos_visible_p): Support positions in bidi-reordered lines.
10089 Save and restore bidi cache.
10091 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
10092 (bidi_paragraph_info): Delete unused struct.
10093 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
10094 (bidi_cache_start): New variable.
10095 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
10097 (bidi_cache_fetch_state, bidi_cache_search)
10098 (bidi_cache_find_level_change, bidi_cache_iterator_state)
10099 (bidi_cache_find, bidi_peek_at_next_level)
10100 (bidi_level_of_next_char, bidi_find_other_level_edge)
10101 (bidi_move_to_visually_next): Compare cache index with
10102 bidi_cache_start rather than with zero.
10103 (bidi_fetch_char): Accept new argument STRING; all callers
10104 changed. Support iteration over a string. Support strings with
10105 display properties. Support unibyte strings. Fix the type of
10106 `len' according to what STRING_CHAR_AND_LENGTH expects.
10107 (bidi_paragraph_init, bidi_resolve_explicit_1)
10108 (bidi_resolve_explicit, bidi_resolve_weak)
10109 (bidi_level_of_next_char, bidi_move_to_visually_next):
10110 Support iteration over a string.
10111 (bidi_set_sor_type, bidi_resolve_explicit_1)
10112 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
10113 can now be zero (for strings); special values 0 and -1 were
10114 changed to -1 and -2, respectively.
10115 (bidi_char_at_pos): New function.
10116 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
10117 Call it instead of FETCH_MULTIBYTE_CHAR.
10118 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
10119 initialized to valid values.
10120 (bidi_init_it): Don't initialize charpos and bytepos with invalid
10122 (bidi_level_of_next_char): Allow the sentinel "position" to pass
10123 the test for valid cached positions. Fix the logic for looking up
10124 the sentinel state in the cache. GCPRO the Lisp string we are
10126 (bidi_push_it, bidi_pop_it): New functions.
10127 (bidi_initialize): Initialize the bidi cache start stack pointer.
10128 (bidi_cache_ensure_space): New function, refactored from part of
10129 bidi_cache_iterator_state. Don't assume the required size is just
10130 one BIDI_CACHE_CHUNK away.
10131 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
10132 (bidi_count_bytes, bidi_char_at_pos): New functions.
10133 (bidi_cache_search): Don't assume bidi_cache_last_idx is
10134 always valid if bidi_cache_idx is valid.
10135 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
10136 is valid if it's going to be used.
10137 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
10138 (bidi_cache_fetch_state, bidi_cache_search)
10139 (bidi_cache_find_level_change, bidi_cache_ensure_space)
10140 (bidi_cache_iterator_state, bidi_cache_find)
10141 (bidi_find_other_level_edge, bidi_cache_start_stack):
10142 All variables related to cache indices are now EMACS_INT.
10144 * dispextern.h (struct bidi_string_data): New structure.
10145 (struct bidi_it): New member `string'. Make flag members be 1-bit
10146 fields, and put them last in the struct.
10147 (compute_display_string_pos, compute_display_string_end):
10149 (bidi_push_it, bidi_pop_it): Add prototypes.
10150 (struct iterator_stack_entry): New members bidi_p,
10151 paragraph_embedding, and from_disp_prop_p.
10152 (struct it): Member bidi_p is now a bit field 1 bit wide.
10153 (bidi_shelve_cache, bidi_unshelve_cache):
10154 Declare prototypes.
10156 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
10157 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
10158 and vector-like objects.
10160 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
10161 cache around display iteration.
10163 * window.c (Fwindow_end, window_scroll_pixel_based)
10164 (displayed_window_lines, Frecenter): Save and restore the bidi
10165 cache around display iteration.
10167 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
10169 * editfns.c (Fdelete_region): Clarify the use of the named
10170 parameters (bug#6788).
10172 2011-07-14 Martin Rudalics <rudalics@gmx.at>
10174 * indent.c (Fvertical_motion): Set and restore w->pointm when
10175 saving and restoring the window's buffer (Bug#9006).
10177 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
10179 * editfns.c (Fstring_to_char): Clarify just what is returned
10180 (bug#6576). Text by Eli Zaretskii.
10182 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
10184 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
10186 2011-07-13 Eli Zaretskii <eliz@gnu.org>
10188 * buffer.c (mmap_find): Fix a typo.
10190 2011-07-13 Johan Bockgård <bojohan@gnu.org>
10192 Fix execution of x selection hooks.
10193 * xselect.c (Qx_lost_selection_functions)
10194 (Qx_sent_selection_functions): New vars.
10195 (syms_of_xselect): DEFSYM them.
10196 (x_handle_selection_request): Pass Qx_sent_selection_functions
10197 rather than Vx_sent_selection_functions to Frun_hook_with_args.
10198 (x_handle_selection_clear,x_clear_frame_selections):
10199 Pass Qx_lost_selection_functions rather than
10200 Vx_lost_selection_functions to Frun_hook_with_args.
10202 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
10204 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
10205 The old code sometimes used this field without initializing it.
10207 * alloc.c (gc_sweep): Don't read past end of array.
10208 In theory, the old code could also have corrupted Emacs internals,
10209 though it'd be very unlikely.
10211 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
10213 * character.c (Fcharacterp): Don't advertise optional ignored
10214 argument. (Bug#4026)
10216 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
10218 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
10221 * window.c (Fset_window_start): Doc fix (bug#4199).
10222 (Fset_window_hscroll): Ditto.
10224 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
10226 Fix minor new problems caught by GCC 4.6.1.
10227 * term.c (init_tty): Remove unused local.
10228 * xsettings.c (store_monospaced_changed): Define this function only
10229 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
10230 not used otherwise.
10232 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
10234 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
10236 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10238 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
10239 are the mini-buffer and the echo area (bug#3320).
10241 * term.c (init_tty): Remove support for supdup, c10 and perq
10242 terminals, which are no longer supported (bug#1482).
10244 2011-07-10 Johan Bockgård <bojohan@gnu.org>
10246 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
10248 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
10250 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
10251 for non-popups (Bug#3642).
10253 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
10255 * alloc.c (reset_malloc_hooks): Protoize.
10256 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
10257 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
10258 * cm.c (losecursor): Likewise.
10259 * data.c (fmod): Likewise.
10260 * dispnew.c (swap_glyphs_in_rows): Likewise.
10261 * emacs.c (memory_warning_signal): Likewise.
10262 * floatfns.c (float_error): Likewise.
10263 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
10264 (otf_open, font_otf_capability, generate_otf_features)
10265 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
10267 * image.c (pbm_read_file): Likewise.
10268 * indent.c (string_display_width): Likewise.
10269 * intervals.c (check_for_interval, search_for_interval)
10270 (inc_interval_count, count_intervals, root_interval)
10271 (adjust_intervals_for_insertion, make_new_interval): Likewise.
10272 * lread.c (defalias): Likewise.
10273 * ralloc.c (r_alloc_check): Likewise.
10274 * regex.c (set_image_of_range_1, set_image_of_range)
10275 (regex_grow_registers): Likewise.
10276 * sysdep.c (strerror): Likewise.
10277 * termcap.c (valid_filename_p, tprint, main): Likewise.
10278 * tparam.c (main): Likewise.
10279 * unexhp9k800.c (run_time_remap, save_data_space)
10280 (update_file_ptrs, read_header, write_header, calculate_checksum)
10281 (copy_file, copy_rest, display_header): Likewise.
10282 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
10284 * xdisp.c (check_it): Likewise.
10285 * xfaces.c (register_color, unregister_color, unregister_colors):
10287 * xfns.c (print_fontset_result): Likewise.
10288 * xrdb.c (member, fatal, main): Likewise.
10290 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
10292 Fix minor problems found by static checking (Bug#9031).
10293 * chartab.c (char_table_set_range, map_sub_char_table):
10294 Remove unused locals.
10295 (uniprop_table): Now static.
10296 * composite.c (_work_char): Remove unused static var.
10298 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
10300 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
10302 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
10304 * gtkutil.c (qttip_cb): Remove code without function.
10306 2011-07-09 Eli Zaretskii <eliz@gnu.org>
10308 * w32.c (pthread_sigmask): New stub.
10310 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
10312 Use pthread_sigmask, not sigprocmask (Bug#9010).
10313 sigprocmask is portable only for single-threaded applications, and
10314 Emacs can be multi-threaded when it uses GTK.
10315 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
10317 * callproc.c (Fcall_process):
10318 * process.c (create_process):
10319 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
10320 Use pthread_sigmask, not sigprocmask.
10322 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10324 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
10325 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
10328 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10330 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
10331 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
10332 (xg_hide_tooltip): Fix comment.
10334 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
10335 in registerServicesMenuSendTypes.
10336 (validRequestorForSendType): Don't check ns_return_types.
10338 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
10341 2011-07-08 Jason Rumney <jasonr@gnu.org>
10343 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
10344 SH_SHOW for hidden windows (Bug#5482).
10346 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
10347 frame struct members of non-existent frames (Bug#6284).
10349 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10351 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
10352 variable firstTime not needed on OSX >= 10.6.
10353 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
10354 >= 10.5. Use setKnobProportion, setDoubleValue.
10356 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
10357 (MAC_OS_X_VERSION_10_5): Define if not defined.
10358 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
10359 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
10360 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
10362 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
10363 cString and lossyCString on OSX >= 10.4.
10365 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
10366 sizeToFit on OSX >= 10.2.
10368 * nsimage.m (allocInitFromFile): Don't use deprecated method
10369 bestRepresentationForDevice on OSX >= 10.6.
10371 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
10374 * emacs.c: Declare unexec_init_emacs_zone.
10376 * nsgui.h: Fix compiler warning about gnulib redefining verify.
10378 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
10380 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
10381 on svcsMenu (Bug#8842).
10383 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
10385 (Fns_list_services): Just return Qnil on 10.6, code not working there.
10387 * nsterm.m (QUTF8_STRING): Declare.
10388 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
10389 (validRequestorForSendType): Return type is (id).
10390 Change indexOfObjectIdenticalTo to indexOfObject.
10391 Check if we have local selection before returning self (Bug#8842).
10392 (writeSelectionToPasteboard): Put local selection into paste board
10393 if we have a local selection (Bug#8842).
10394 (syms_of_nsterm): DEFSYM QUTF8_STRING.
10396 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
10397 (ns_get_local_selection): Declare.
10399 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
10401 * keymap.c (describe_map_tree): Don't insert a double newline at
10402 the end of the buffer (bug#1169) and return whether we inserted
10405 * callint.c (Fcall_interactively): Change "reading args" to
10406 "providing args" to try to clarify what it does (bug#1010).
10408 2011-07-07 Kenichi Handa <handa@m17n.org>
10410 * composite.c (composition_compute_stop_pos): Ignore a static
10411 composition starting before CHARPOS (Bug#8915).
10413 * xdisp.c (handle_composition_prop): Likewise.
10415 2011-07-07 Eli Zaretskii <eliz@gnu.org>
10417 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
10420 2011-07-07 Kenichi Handa <handa@m17n.org>
10422 * character.h (unicode_category_t): New enum type.
10424 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
10425 (Qchar_code_property_table): New variable.
10426 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
10427 (UNIPROP_COMPRESSED_FORM_P): New macros.
10428 (char_table_ascii): Uncompress the compressed values.
10429 (sub_char_table_ref): New arg is_uniprop. Callers changed.
10430 Uncompress the compressed values.
10431 (sub_char_table_ref_and_range): Likewise.
10432 (char_table_ref_and_range): Uncompress the compressed values.
10433 (sub_char_table_set): New arg is_uniprop. Callers changed.
10434 Uncompress the compressed values.
10435 (sub_char_table_set_range): Args changed. Callers changed.
10436 (char_table_set_range): Adjuted for the above change.
10437 (map_sub_char_table): Delete args default_val and parent. Add arg
10438 top. Give decoded values to a Lisp function.
10439 (map_char_table): Adjust for the above change. Give decoded
10440 values to a Lisp function. Gcpro more variables.
10441 (uniprop_table_uncompress)
10442 (uniprop_decode_value_run_length): New functions.
10443 (uniprop_decoder, uniprop_decoder_count): New variables.
10444 (uniprop_get_decoder, uniprop_encode_value_character)
10445 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
10447 (uniprop_encoder, uniprop_encoder_count): New variables.
10448 (uniprop_get_encoder, uniprop_table)
10449 (Funicode_property_table_internal, Fget_unicode_property_internal)
10450 (Fput_unicode_property_internal): New functions.
10451 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
10452 Sunicode_property_table_internal, Sget_unicode_property_internal,
10453 and Sput_unicode_property_internal. Defvar_lisp
10454 char-code-property-alist.
10456 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
10457 Vunicode_category_table.
10459 * font.c (font_range): Adjust for the change of
10460 Vunicode_category_table.
10462 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
10464 * m/iris4d.h: Remove file, move contents ...
10465 * s/irix6-5.h: ... here.
10467 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
10469 Remove unportable assumption about struct layout (Bug#8884).
10470 * alloc.c (mark_buffer):
10471 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
10472 (clone_per_buffer_values): Don't assume that
10473 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
10474 This isn't true in general, and it's particularly not true
10475 if Emacs is configured with --with-wide-int.
10476 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
10477 New macros, used in the buffer.c change.
10479 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
10481 * xsettings.c: Use both GConf and GSettings if both are available.
10482 (store_config_changed_event): Add comment.
10483 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
10484 (store_tool_bar_style_changed): New functions.
10485 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
10486 (struct xsettings): Move font inside HAVE_XFT.
10487 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
10488 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
10489 Move inside HAVE_XFT.
10490 (something_changed_gsettingsCB): Rename from something_changedCB.
10491 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
10493 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
10494 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
10495 (something_changed_gconfCB): Rename from something_changedCB.
10496 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
10497 (parse_settings): Move check for font inside HAVE_XFT.
10498 (read_settings, apply_xft_settings): Add comment.
10499 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
10500 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
10501 call store_font_name_changed.
10502 (xft_settings_event): Add comment.
10503 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
10504 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
10505 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
10506 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
10507 (xsettings_initialize): Call init_gsettings last.
10508 (xsettings_get_system_font, xsettings_get_system_normal_font):
10511 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
10513 Random fixes. E.g., (random) never returned negative values.
10514 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
10515 subseconds part to the entropy, as that's a bit more random.
10516 Prefer signed to unsigned, since the signedness doesn't matter and
10517 in general we prefer signed. When given a limit, use a
10518 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
10519 latter isn't right if USE_2_TAGS_FOR_INTS.
10520 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
10521 not 0..VALMASK. Don't discard "excess" bits that random () returns.
10523 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
10525 * textprop.c (text_property_stickiness):
10526 Obey Vtext_property_default_nonsticky.
10527 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
10528 * w32fns.c (syms_of_w32fns):
10529 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
10531 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
10533 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
10534 This is more efficient than Ffile_directory_p and avoids a minor race.
10536 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
10538 * buffer.c (Foverlay_put): Say what the return value is
10541 * fileio.c (barf_or_query_if_file_exists): Check first if the file
10542 is a directory before asking whether to use the file name
10544 (barf_or_query_if_file_exists): Make the "File is a directory"
10545 error be more correct.
10547 * fns.c (Frequire): Remove the mention of the .gz files, since
10548 that's installation-specific, but keep the mention of
10549 `get-load-suffixes'.
10551 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
10553 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
10554 Report string overflow if the output is too long.
10556 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
10558 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
10559 (syms_of_gnutls): Remove duplicate DEFSYM for
10560 Qgnutls_bootprop_verify_hostname_error, an error for
10561 Qgnutls_bootprop_verify_error (which is no longer used).
10563 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
10564 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
10565 Also (re)move comments that are misplaced or no longer relevant.
10567 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10569 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
10571 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
10573 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
10574 and background color parameters if they have been changed.
10576 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10578 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
10580 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
10582 * xsettings.c (SYSTEM_FONT): Define only when used.
10583 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
10585 * keymap.c (access_keymap_1): Now static.
10587 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
10589 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
10590 leave any prefix arg for the up event (Bug#1586).
10592 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
10594 * lread.c (syms_of_lread): Mention single symbols defined by
10595 `defvar' or `defconst' (bug#7154).
10597 * fns.c (Frequire): Mention .el.gz files (bug#7314).
10598 (Frequire): Mention get-load-suffixes.
10600 2011-07-02 Martin Rudalics <rudalics@gmx.at>
10602 * window.h (window): Remove clone_number slot.
10603 * window.c (Fwindow_clone_number, Fset_window_clone_number):
10605 (make_parent_window, make_window, saved_window)
10606 (Fset_window_configuration, save_window_save): Don't deal with
10608 * buffer.c (Qclone_number): Remove declaration.
10609 (sort_overlays, overlay_strings): Don't deal with clone numbers.
10611 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
10613 Add multiple inheritance to keymaps.
10614 * keymap.c (Fmake_composed_keymap): New function.
10615 (Fset_keymap_parent): Simplify.
10616 (fix_submap_inheritance): Remove.
10617 (access_keymap_1): New function extracted from access_keymap to handle
10618 embedded parents and handle lists of maps.
10619 (access_keymap): Use it.
10620 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
10621 (Fcopy_keymap): Handle embedded parents.
10622 (Fcommand_remapping, define_as_prefix): Simplify.
10623 (Fkey_binding): Simplify.
10624 (syms_of_keymap): Move minibuffer-local-completion-map,
10625 minibuffer-local-filename-completion-map,
10626 minibuffer-local-must-match-map, and
10627 minibuffer-local-filename-must-match-map to Elisp.
10628 (syms_of_keymap): Defsubr make-composed-keymap.
10629 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
10630 (parse_menu_item): Trivial simplification.
10632 2011-07-01 Glenn Morris <rgm@gnu.org>
10634 * Makefile.in (SETTINGS_LIBS): Fix typo.
10636 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10638 * coding.c (Fencode_coding_string): Record the last coding system
10639 used, as the function doc string says (bug#8738).
10641 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
10643 * xsettings.c (store_monospaced_changed): Take new font as arg and
10644 check for change against current_mono_font.
10645 (EMACS_TYPE_SETTINGS): Remove this and related defines.
10646 (emacs_settings_constructor, emacs_settings_get_property)
10647 (emacs_settings_set_property, emacs_settings_class_init)
10648 (emacs_settings_init, gsettings_obj): Remove.
10649 (something_changedCB): New function for HAVE_GSETTINGS.
10650 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
10651 with value as argument.
10652 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
10653 g_settings_new (Bug#8967). Do not create gsettings_obj.
10654 Remove calls to g_settings_bind. Connect something_changedCB to
10657 * xgselect.c: Add defined (HAVE_GSETTINGS).
10658 (xgselect_initialize): Ditto.
10660 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
10661 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
10664 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
10666 * eval.c (struct backtrace): Simplify and port the data structure.
10667 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
10668 signed bit field, as this assumption is not portable and it makes
10669 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
10670 "char debug_on_exit : 1" as this is not portable either; instead,
10671 use the portable "unsigned int debug_on_exit : 1". Remove unused
10672 member evalargs. Remove obsolete comments about cc bombing out.
10674 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
10676 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
10677 Let HAVE_GSETTINGS override HAVE_GCONF.
10678 (store_monospaced_changed): New function.
10679 (EMACS_SETTINGS): A new type derived from GObject to handle
10680 GSettings notifications.
10681 (emacs_settings_constructor, emacs_settings_get_property)
10682 (emacs_settings_set_property, emacs_settings_class_init):
10684 (gsettings_client, gsettings_obj): New variables.
10685 (GSETTINGS_SCHEMA): New define.
10686 (something_changedCB): Call store_monospaced_changed.
10687 (init_gsettings): New function.
10688 (xsettings_initialize): Call init_gsettings.
10689 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
10692 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
10695 2011-06-29 Martin Rudalics <rudalics@gmx.at>
10697 * window.c (resize_root_window, grow_mini_window)
10698 (shrink_mini_window): Rename Qresize_root_window to
10699 Qwindow_resize_root_window and Qresize_root_window_vertically to
10700 Qwindow_resize_root_window_vertically.
10702 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
10704 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
10706 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
10708 * makefile.w32-in: Redesign dependencies so they reflect more
10709 clearly which files are directly included by each source file,
10710 and not through other includes.
10712 2011-06-27 Martin Rudalics <rudalics@gmx.at>
10714 * buffer.c (Qclone_number): Declare static and DEFSYM it.
10715 (sort_overlays, overlay_strings): When an overlay's clone number
10716 matches the window's clone number process the overlay even if
10717 the overlay's window property doesn't match the current window.
10719 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
10720 (Fwindow_hchild): Rename to Fwindow_left_child.
10721 (Fwindow_next): Rename to Fwindow_next_sibling.
10722 (Fwindow_prev): Rename to Fwindow_prev_sibling.
10723 (resize_window_check): Rename to window_resize_check.
10724 (resize_window_apply): Rename to window_resize_apply.
10725 (Fresize_window_apply): Rename to Fwindow_resize_apply.
10726 (Fdelete_other_windows_internal, resize_frame_windows)
10727 (Fsplit_window_internal, Fdelete_window_internal)
10728 (grow_mini_window, shrink_mini_window)
10729 (Fresize_mini_window_internal): Fix callers accordingly.
10731 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
10733 * emacsgtkfixed.h: State that this is only used with Gtk+3.
10734 (emacs_fixed_set_min_size): Remove.
10735 (emacs_fixed_new): Take frame as argument.
10737 * emacsgtkfixed.c: State that this is only used with Gtk+3.
10738 (_EmacsFixedPrivate): Remove minwidth/height.
10739 Add struct frame *f.
10740 (emacs_fixed_init): Initialize priv->f.
10741 (get_parent_class, emacs_fixed_set_min_size): Remove.
10742 (emacs_fixed_new): Set priv->f to argument.
10743 (emacs_fixed_get_preferred_width)
10744 (emacs_fixed_get_preferred_height): Use min_width/height from
10745 frames size_hint to set minimum and natural (Bug#8919).
10746 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
10747 and use min_width/height from frames size_hint to set
10748 min_width/height (Bug#8919).
10750 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
10751 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
10754 2011-06-26 Eli Zaretskii <eliz@gnu.org>
10756 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
10757 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
10760 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
10762 * process.c (wait_reading_process_output): Bypass select if
10763 waiting for a cell while ignoring keyboard input, and input is
10764 pending. Suggested by Jan Djärv (Bug#8869).
10766 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
10768 Use gnulib's dup2 module instead of rolling our own.
10769 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
10771 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10773 * dispnew.c (scrolling_window): Before scrolling, turn off a
10774 mouse-highlight in the window being scrolled.
10776 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
10778 Move DEFSYM to lisp.h and use everywhere.
10780 * character.h (DEFSYM): Move declaration...
10781 * lisp.h (DEFSYM): ...here.
10787 * w32select.c: Don't include character.h.
10789 * alloc.c (syms_of_alloc):
10790 * buffer.c (syms_of_buffer):
10791 * bytecode.c (syms_of_bytecode):
10792 * callint.c (syms_of_callint):
10793 * casefiddle.c (syms_of_casefiddle):
10794 * casetab.c (init_casetab_once):
10795 * category.c (init_category_once, syms_of_category):
10796 * ccl.c (syms_of_ccl):
10797 * cmds.c (syms_of_cmds):
10798 * composite.c (syms_of_composite):
10799 * dbusbind.c (syms_of_dbusbind):
10800 * dired.c (syms_of_dired):
10801 * dispnew.c (syms_of_display):
10802 * doc.c (syms_of_doc):
10803 * editfns.c (syms_of_editfns):
10804 * emacs.c (syms_of_emacs):
10805 * eval.c (syms_of_eval):
10806 * fileio.c (syms_of_fileio):
10807 * fns.c (syms_of_fns):
10808 * frame.c (syms_of_frame):
10809 * fringe.c (syms_of_fringe):
10810 * insdel.c (syms_of_insdel):
10811 * keymap.c (syms_of_keymap):
10812 * lread.c (init_obarray, syms_of_lread):
10813 * macros.c (syms_of_macros):
10814 * msdos.c (syms_of_msdos):
10815 * print.c (syms_of_print):
10816 * process.c (syms_of_process):
10817 * search.c (syms_of_search):
10818 * sound.c (syms_of_sound):
10819 * syntax.c (init_syntax_once, syms_of_syntax):
10820 * terminal.c (syms_of_terminal):
10821 * textprop.c (syms_of_textprop):
10822 * undo.c (syms_of_undo):
10823 * w32.c (globals_of_w32):
10824 * window.c (syms_of_window):
10825 * xdisp.c (syms_of_xdisp):
10826 * xfaces.c (syms_of_xfaces):
10827 * xfns.c (syms_of_xfns):
10828 * xmenu.c (syms_of_xmenu):
10829 * xsettings.c (syms_of_xsettings):
10830 * xterm.c (syms_of_xterm): Use DEFSYM.
10832 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
10834 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
10836 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
10838 Integer and buffer overflow fixes (Bug#8873).
10840 * print.c (printchar, strout): Check for string overflow.
10841 (PRINTPREPARE, printchar, strout):
10842 Don't set size unless allocation succeeds.
10844 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
10845 for sizes. Check for string overflow more accurately.
10846 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
10848 * macros.c: Integer and buffer overflow fixes.
10849 * keyboard.h (struct keyboard.kbd_macro_bufsize):
10850 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
10851 Use ptrdiff_t, not int, for sizes.
10852 Don't increment bufsize until after realloc succeeds.
10853 Check for size-calculation overflow.
10854 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
10856 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
10858 * lread.c: Integer overflow fixes.
10859 (read_integer): Radix is now EMACS_INT, not int,
10860 to improve quality of diagnostics for out-of-range radices.
10861 Calculate buffer size correctly for out-of-range radices.
10862 (read1): Check for integer overflow in radices, and in
10863 read-circle numbers.
10864 (read_escape): Avoid int overflow.
10865 (Fload, openp, read_buffer_size, read1)
10866 (substitute_object_recurse, read_vector, read_list, map_obarray):
10867 Use ptrdiff_t, not int, for sizes.
10868 (read1): Use EMACS_INT, not int, for sizes.
10869 Check for size overflow.
10871 * image.c (cache_image): Check for size arithmetic overflow.
10873 * lread.c: Integer overflow issues.
10874 (saved_doc_string_size, saved_doc_string_length)
10875 (prev_saved_doc_string_size, prev_saved_doc_string_length):
10876 Now ptrdiff_t, not int.
10877 (read1): Don't assume doc string length fits in int. Check for
10878 out-of-range doc string lengths.
10879 (read_list): Don't assume file position fits in int.
10880 (read_escape): Check for hex character overflow.
10882 2011-06-22 Leo Liu <sdl.web@gmail.com>
10884 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
10885 Move to minibuffer.el.
10887 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
10889 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
10890 The following patches are for when GLYPH_DEBUG && !XASSERT.
10891 * dispextern.h (trace_redisplay_p, dump_glyph_string):
10892 * dispnew.c (flush_stdout):
10893 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
10894 Mark as externally visible.
10895 * dispnew.c (check_window_matrix_pointers): Now static.
10896 * dispnew.c (window_to_frame_vpos):
10897 * xfns.c (unwind_create_frame):
10898 * xterm.c (x_check_font): Remove unused local.
10899 * scroll.c (CHECK_BOUNDS):
10900 * xfaces.c (cache_fache): Rename local to avoid shadowing.
10901 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
10902 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
10903 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
10904 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
10906 (debug_method_add): Use va_list and vsprintf rather than relying
10907 on undefined behavior with wrong number of arguments.
10908 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
10909 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
10910 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
10911 since we're not interested in debugging glyphs with old libraries.
10912 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
10913 GCC 4.6.0's static checking.
10915 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
10917 Integer overflow and signedness fixes (Bug#8873).
10918 A few related buffer overrun fixes, too.
10920 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
10922 * dispextern.h (struct face.stipple):
10923 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
10924 (x_bitmap_mask, x_allocate_bitmap_record)
10925 (x_create_bitmap_from_data, x_create_bitmap_from_file)
10926 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
10927 (x_create_bitmap_from_xpm_data):
10928 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
10929 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
10931 * xfaces.c (load_pixmap):
10932 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
10933 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
10934 (.bitmaps_last, struct x_output.icon_bitmap):
10935 Use ptrdiff_t, not int, for bitmap indexes.
10936 (x_allocate_bitmap_record): Check for size overflow.
10937 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
10939 Use ptrdiff_t, not int, for overlay counts.
10940 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
10941 * editfns.c (overlays_around, get_pos_property):
10942 * textprop.c (get_char_property_and_overlay):
10943 * xdisp.c (next_overlay_change, note_mouse_highlight):
10944 * xfaces.c (face_at_buffer_position):
10945 * buffer.c (OVERLAY_COUNT_MAX): New macro.
10946 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
10947 (Fnext_overlay_change, Fprevious_overlay_change)
10948 (mouse_face_overlay_overlaps, Foverlays_in):
10949 Use ptrdiff_t, not int, for sizes.
10950 (overlays_at, overlays_in): Check for size-calculation overflow.
10952 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
10954 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
10955 (x_session_initialize): Do not assume string length fits in int.
10957 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
10958 This is unlikely, but can occur if DPI is outlandish.
10960 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
10961 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
10963 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
10964 * xrdb.c (magic_file_p, search_magic_path):
10965 Omit last arg SUFFIX; it was always 0. All callers changed.
10966 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
10968 * xfont.c (xfont_match): Avoid need for strlen.
10970 * xfns.c: Don't assume strlen fits in int.
10971 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
10973 * xdisp.c (message_log_check_duplicate): Return intmax_t,
10974 not unsigned long, as we prefer signed integers. All callers changed.
10975 Detect integer overflow in repeat count.
10976 (message_dolog): Don't assume print length fits in 39 bytes.
10977 (display_mode_element): Don't assume strlen fits in int.
10979 * termcap.c: Don't assume sizes fit in int and never overflow.
10980 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
10981 (gobble_line): Check for size-calculation overflow.
10983 * minibuf.c (Fread_buffer):
10984 * lread.c (intern, intern_c_string):
10985 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
10986 Don't assume string length fits in int.
10988 * keyboard.c (parse_tool_bar_item):
10989 * gtkutil.c (style_changed_cb): Avoid need for strlen.
10991 * font.c: Don't assume string length fits in int.
10992 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
10993 Use ptrdiff_t, not int.
10994 (font_intern_prop): Don't assume string length fits in int.
10995 Don't assume integer property fits in fixnum.
10996 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
10998 * filelock.c: Fix some buffer overrun and integer overflow issues.
10999 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
11000 Reformulate so as not to need the command string.
11001 Invoke gzip -cd rather than gunzip, as it's more portable.
11002 (lock_info_type, lock_file_1, lock_file):
11003 Don't assume pid_t and time_t fit in unsigned long.
11004 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
11005 (current_lock_owner): Prefer signed type for sizes.
11006 Use memcpy, not strncpy, where memcpy is what is really wanted.
11007 Don't assume (via atoi) that time_t and pid_t fit in int.
11008 Check for time_t and/or pid_t out of range, e.g., via a network share.
11009 Don't alloca where an auto var works fine.
11011 * fileio.c: Fix some integer overflow issues.
11012 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
11013 Don't assume string length fits in int.
11014 (directory_file_name): Don't assume string length fits in long.
11015 (make_temp_name): Don't assume pid fits in int, or that its print
11016 length is less than 20.
11018 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
11020 * coding.c (make_subsidiaries): Don't assume string length fits in int.
11022 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
11024 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
11025 We prefer signed integers, even for size calculations.
11027 * emacs.c: Don't assume string length fits in 'int'.
11028 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
11029 (main): Don't invoke strlen when not needed.
11031 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
11032 (XD_DEBUG_MESSAGE): Don't waste a byte.
11034 * callproc.c (getenv_internal_1, getenv_internal)
11035 (Fgetenv_internal):
11036 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
11038 * lread.c (invalid_syntax): Omit length argument.
11039 All uses changed. This doesn't fix a bug, but it simplifies the
11040 code away from its former Hollerith-constant appearance, and it's
11041 one less 'int' to worry about when looking at integer-overflow issues.
11042 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
11044 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
11045 This didn't break anything, but it didn't help either.
11046 It's confusing to put a bogus integer in a place where the actual
11047 value does not matter.
11048 (LIST_END_P): Remove unused macro and its bogus comment.
11049 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
11051 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
11052 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
11054 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
11055 We prefer signed types, and the value cannot exceed the EMACS_INT
11056 range anyway (because otherwise the length would not be representable).
11057 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
11058 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
11059 This avoids a GCC warning when WIDE_EMACS_INT.
11061 * indent.c (sane_tab_width): New function.
11062 (current_column, scan_for_column, Findent_to, position_indentation)
11063 (compute_motion): Use it. This is just for clarity.
11064 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
11066 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
11068 * lisp.h (lint_assume): New macro.
11069 * composite.c (composition_gstring_put_cache):
11070 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
11072 * editfns.c, insdel.c:
11073 Omit unnecessary forward decls, to simplify future changes.
11075 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
11077 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
11079 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
11080 Use much-faster test for byte-length change.
11081 Don't assume string byte-length fits in 'int'.
11082 Check that character arg fits in 'int'.
11083 (mapcar1): Declare byte as byte, for clarity.
11085 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
11087 * fns.c (concat): Catch string overflow earlier.
11088 Do not rely on integer wraparound.
11090 * dispextern.h (struct it.overlay_strings_charpos)
11091 (struct it.selective): Now EMACS_INT, not int.
11092 * xdisp.c (forward_to_next_line_start)
11093 (back_to_previous_visible_line_start)
11094 (reseat_at_next_visible_line_start, next_element_from_buffer):
11095 Don't arbitrarily truncate the value of 'selective' to int.
11097 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
11099 * composite.c: Don't truncate sizes to 'int'.
11100 (composition_gstring_p, composition_reseat_it)
11101 (composition_adjust_point): Use EMACS_INT, not int.
11102 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
11103 not EMACS_UINT, for indexes.
11105 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
11107 * buffer.c: Include <verify.h>.
11108 (struct sortvec.priority, struct sortstr.priority):
11109 Now EMACS_INT, not int.
11110 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
11111 (struct sortstr.size, record_overlay_string)
11112 (struct sortstrlist.size, struct sortlist.used):
11113 Don't truncate size to int.
11114 (record_overlay_string): Check for size-calculation overflow.
11115 (init_buffer_once): Check at compile-time, not run-time.
11117 2011-06-22 Jim Meyering <meyering@redhat.com>
11119 Don't leak an XBM-image-sized buffer
11120 * image.c (xbm_load): Free the image buffer after using it.
11122 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
11125 * composite.c (find_automatic_composition): Omit needless 'return 0;'
11126 that Sun C diagnosed.
11127 * fns.c (secure_hash): Fix pointer signedness issue.
11128 * intervals.c (static_offset_intervals): New function.
11129 (offset_intervals): Use it.
11131 2011-06-21 Leo Liu <sdl.web@gmail.com>
11134 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
11137 * fns.c (secure_hash): Rename from crypto_hash_function and change
11138 the first arg to accept symbols.
11139 (Fsecure_hash): New primitive.
11140 (syms_of_fns): New symbols.
11142 2011-06-20 Deniz Dogan <deniz@dogan.se>
11144 * process.c (Fset_process_buffer): Clarify return value in
11147 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
11149 * dispnew.c (add_window_display_history): Use BVAR.
11151 * xdisp.c (debug_method_add): Use BVAR.
11152 (check_window_end, dump_glyph_matrix, dump_glyph)
11153 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
11155 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
11158 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
11159 check till after the cache is created in init_frame_faces.
11161 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
11163 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
11165 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
11167 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
11168 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
11169 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
11171 Improve buffer-overflow checking (Bug#8873).
11172 * fileio.c (Finsert_file_contents):
11173 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
11174 Remove the old (too-loose) buffer overflow checks.
11175 They weren't needed, since make_gap checks for buffer overflow.
11176 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
11177 The old code merely checked for Emacs fixnum overflow, and relied
11178 on undefined (wraparound) behavior. The new code avoids undefined
11179 behavior, and also checks for ptrdiff_t and/or size_t overflow.
11181 * editfns.c (Finsert_char): Don't dump core with very negative counts.
11182 Tune. Don't use wider integers than needed. Don't use alloca.
11183 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
11185 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
11187 * insdel.c, lisp.h (buffer_overflow): New function.
11188 (insert_from_buffer_1, replace_range, replace_range_2):
11189 * insdel.c (make_gap_larger):
11190 * editfns.c (Finsert_char):
11191 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
11193 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
11195 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
11197 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
11199 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
11200 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
11202 * fileio.c: Don't assume EMACS_INT fits in off_t.
11203 (emacs_lseek): New static function.
11204 (Finsert_file_contents, Fwrite_region): Use it.
11205 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
11207 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
11209 * fns.c: Don't overflow int when computing a list length.
11210 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
11211 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
11212 truncation on 64-bit hosts. Check for QUIT every
11213 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
11214 faster and is responsive enough.
11215 (Flength): Report an error instead of overflowing an integer.
11216 (Fsafe_length): Return a float if the value is not representable
11217 as a fixnum. This shouldn't happen except in contrived situations.
11218 (Fnthcdr, Fsort): Don't assume list length fits in int.
11219 (Fcopy_sequence): Don't assume vector length fits in int.
11221 * alloc.c: Check that resized vectors' lengths fit in fixnums.
11222 (header_size, word_size): New constants.
11223 (allocate_vectorlike): Don't check size overflow here.
11224 (allocate_vector): Check it here instead, since this is the only
11225 caller of allocate_vectorlike that could cause overflow.
11226 Check that the new vector's length is representable as a fixnum.
11228 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
11229 The previous code was bogus. For example, next_almost_prime (32)
11230 returned 39, which is undesirable as it is a multiple of 3; and
11231 next_almost_prime (24) returned 25, which is a multiple of 5 so
11232 why was the code bothering to check for multiples of 7?
11234 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
11236 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
11238 Variadic C functions now count arguments with ptrdiff_t.
11239 This partly undoes my 2011-03-30 change, which replaced int with size_t.
11240 Back then I didn't know that the Emacs coding style prefers signed int.
11241 Also, in the meantime I found a few more instances where arguments
11242 were being counted with int, which may truncate counts on 64-bit
11243 machines, or EMACS_INT, which may be unnecessarily wide.
11244 * lisp.h (struct Lisp_Subr.function.aMANY)
11245 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
11246 Arg counts are now ptrdiff_t, not size_t.
11247 All variadic functions and their callers changed accordingly.
11248 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
11249 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
11250 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
11251 * callint.c (Fcall_interactively): Check arg count for overflow,
11252 to avoid potential buffer overrun. Use signed char, not 'int',
11253 for 'varies' array, so that we needn't bother to check its size
11254 calculation for overflow.
11255 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
11256 * eval.c (apply_lambda):
11257 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
11258 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
11259 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
11261 * callint.c (Fcall_interactively): Don't use index var as event count.
11263 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
11264 * mem-limits.h (SIZE): Remove; no longer used.
11266 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
11268 Remove unnecessary casts.
11269 * xterm.c (x_term_init):
11270 * xfns.c (x_set_border_pixel):
11271 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
11272 These aren't needed now that we assume ANSI C.
11274 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
11275 It's more likely to cause problems (due to unsigned overflow)
11278 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
11280 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
11282 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
11284 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
11286 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
11288 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
11290 GLYPH_CODE_FACE returns EMACS_INT, not int.
11291 * dispextern.h (merge_faces):
11292 * xfaces.c (merge_faces):
11293 * xdisp.c (get_next_display_element, next_element_from_display_vector):
11294 Don't assume EMACS_INT fits in int.
11296 * character.h (CHAR_VALID_P): Remove unused parameter.
11297 * fontset.c, lisp.h, xdisp.c: All uses changed.
11299 * editfns.c (Ftranslate_region_internal): Omit redundant test.
11301 * fns.c (concat): Minor tuning based on overflow analysis.
11302 This doesn't fix any bugs. Use int to hold character, instead
11303 of constantly refetching from Emacs object. Use XFASTINT, not
11304 XINT, for value known to be a character. Don't bother comparing
11305 a single byte to 0400, as it's always less.
11307 * floatfns.c (Fexpt):
11308 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
11310 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
11313 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
11315 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
11316 Without this fix, on a 64-bit host (aset S 0 4294967386) would
11317 incorrectly succeed when S was a string, because 4294967386 was
11318 truncated before it was used.
11320 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
11321 Otherwise, an out-of-range integer could cause undefined behavior
11324 * composite.c: Use int, not EMACS_INT, for characters.
11325 (fill_gstring_body, composition_compute_stop_pos): Use int, not
11326 EMACS_INT, for values that are known to be in character range.
11327 This doesn't fix any bugs but is the usual style inside Emacs and
11328 may generate better code on 32-bit machines.
11330 Make sure a 64-bit char is never passed to ENCODE_CHAR.
11331 This is for reasons similar to the recent CHAR_STRING fix.
11332 * charset.c (Fencode_char): Check that character arg is actually
11333 a character. Pass an int to ENCODE_CHAR.
11334 * charset.h (ENCODE_CHAR): Verify that the character argument is no
11335 wider than 'int', as a compile-time check to prevent future regressions
11338 * character.c (char_string): Remove unnecessary casts.
11340 Make sure a 64-bit char is never passed to CHAR_STRING.
11341 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
11342 by silently ignoring the top 32 bits, allowing some values
11343 that were far too large to be valid characters.
11344 * character.h: Include <verify.h>.
11345 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
11346 arguments are no wider than unsigned, as a compile-time check
11347 to prevent future regressions in this area.
11349 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
11350 (Fsubst_char_in_region):
11352 * xdisp.c (decode_mode_spec_coding):
11353 Adjust to CHAR_STRING's new requirement.
11354 * editfns.c (Finsert_char, Fsubst_char_in_region):
11355 * fns.c (concat): Check that character args are actually
11356 characters. Without this test, these functions did the wrong
11357 thing with wildly out-of-range values on 64-bit hosts.
11359 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
11360 These casts should not be needed on 32-bit hosts, either.
11361 * keyboard.c (read_char):
11362 * lread.c (Fload): Remove casts to unsigned.
11364 * lisp.h (UNSIGNED_CMP): New macro.
11365 This fixes comparison bugs on 64-bit hosts.
11366 (ASCII_CHAR_P): Use it.
11367 * casefiddle.c (casify_object):
11368 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
11369 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
11370 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
11371 * dispextern.h (FACE_FROM_ID):
11372 * keyboard.c (read_char): Use UNSIGNED_CMP.
11374 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
11375 not to EMACS_INT, to avoid GCC warning.
11377 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
11379 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
11380 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
11381 isn't needed on 32-bit machines.
11383 * buffer.c (Fgenerate_new_buffer_name):
11384 Use EMACS_INT for count, not int.
11385 (advance_to_char_boundary): Return EMACS_INT, not int.
11387 * data.c (Qcompiled_function): Now static.
11389 * window.c (window_body_lines): Now static.
11391 * image.c (gif_load): Rename local to avoid shadowing.
11393 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
11394 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
11395 * alloc.c (make_save_value): Integer argument is now of type
11396 ptrdiff_t, not int.
11397 (mark_object): Use ptrdiff_t, not int.
11398 * lisp.h (pD): New macro.
11399 * print.c (print_object): Use it.
11401 * alloc.c: Use EMACS_INT, not int, to count objects.
11402 (total_conses, total_markers, total_symbols, total_vector_size)
11403 (total_free_conses, total_free_markers, total_free_symbols)
11404 (total_free_floats, total_floats, total_free_intervals)
11405 (total_intervals, total_strings, total_free_strings):
11406 Now EMACS_INT, not int. All uses changed.
11407 (Fgarbage_collect): Compute overall total using a double, so that
11408 integer overflow is less likely to be a problem. Check for overflow
11409 when converting back to an integer.
11410 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
11411 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
11412 These were 'int' variables that could overflow on 64-bit hosts;
11413 they were never used, so remove them instead of repairing them.
11414 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
11415 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
11416 Previously, this ceilinged at INT_MAX, but that doesn't work on
11418 (allocate_pseudovector): Don't use EMACS_INT when int would do.
11420 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
11421 (allocate_vectorlike): Check for ptrdiff_t overflow.
11422 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
11423 when a (possibly-narrower) signed value would do just as well.
11424 We prefer using signed arithmetic, to avoid comparison confusion.
11426 * alloc.c: Catch some string size overflows that we were missing.
11427 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
11428 for convenience in STRING_BYTES_MAX.
11429 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
11430 The definition here is exact; the one in lisp.h was approximate.
11431 (allocate_string_data): Check for string overflow. This catches
11432 some instances we weren't catching before. Also, it catches
11433 size_t overflow on (unusual) hosts where SIZE_MAX <= min
11434 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
11435 and ptrdiff_t and EMACS_INT are both 64 bits.
11437 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
11438 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
11439 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
11441 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
11443 * alloc.c (Fmake_string): Check for out-of-range init.
11445 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
11447 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
11449 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
11451 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
11452 xg_get_default_scrollbar_width.
11454 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
11455 (int_gtk_range_get_value): Move to the scroll bar part of the file.
11456 (style_changed_cb): Call update_theme_scrollbar_width and call
11457 x_set_scroll_bar_default_width and xg_frame_set_char_size for
11458 all frames (Bug#8505).
11459 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
11460 Call gtk_window_set_resizable if HAVE_GTK3.
11461 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
11462 and height if HAVE_GTK3 (Bug#8505).
11463 (scroll_bar_width_for_theme): New variable.
11464 (update_theme_scrollbar_width): New function.
11465 (xg_get_default_scrollbar_width): Move code to
11466 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
11467 (xg_initialize): Call update_theme_scrollbar_width.
11469 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
11471 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
11473 2011-06-12 Martin Rudalics <rudalics@gmx.at>
11475 * frame.c (make_frame): Call other_buffer_safely instead of
11478 * window.c (temp_output_buffer_show): Call display_buffer with
11479 second argument Vtemp_buffer_show_specifiers and reset latter
11480 immediately after the call.
11481 (Vtemp_buffer_show_specifiers): New variable.
11482 (auto_window_vscroll_p, next_screen_context_lines)
11483 (Vscroll_preserve_screen_position): Remove leading asterisks from
11486 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
11488 Fix minor problems found by GCC 4.6.0 static checking.
11489 * buffer.c (Qclone_number): Remove for now, as it's unused.
11490 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
11491 (record_buffer): Remove unused local.
11492 * frame.c (other_visible_frames, frame_buffer_list): Now static.
11493 (set_frame_buffer_list): Remove; unused.
11494 * frame.h (other_visible_frames): Remove decl.
11495 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
11496 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
11497 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
11499 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
11500 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
11501 Define only if HAVE_GPM.
11502 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
11503 (update_hints_inhibit): Remove; never set. All uses removed.
11504 * widgetprv.h (emacsFrameClassRec): Remove decl.
11505 * window.c (delete_deletable_window): Now returns void, since it
11506 wasn't returning anything.
11507 (compare_window_configurations): Remove unused locals.
11508 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
11509 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
11510 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
11511 the same widths as pointers. This follows up on the 2011-05-06 patch.
11512 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
11513 * xterm.h: Likewise.
11514 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
11516 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
11518 * makefile.w32-in: Update dependencies.
11519 (LISP_H): Add lib/intprops.h.
11521 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
11523 * image.c (gif_load): Add animation frame delay to the metadata.
11524 (syms_of_image): Use DEFSYM. New symbol `delay'.
11526 2011-06-11 Martin Rudalics <rudalics@gmx.at>
11528 * window.c (delete_deletable_window): Re-add.
11529 (Fset_window_configuration): Rewrite to handle dead buffers and
11530 consequently deletable windows.
11531 (window_tree, Fwindow_tree): Remove. Supply functionality in
11533 (compare_window_configurations): Simplify code.
11535 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
11537 * image.c (imagemagick_load_image): Fix type mismatch.
11538 (Fimagemagick_types): Likewise.
11540 * window.h (replace_buffer_in_windows): Declare.
11542 2011-06-11 Martin Rudalics <rudalics@gmx.at>
11544 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
11545 Qclone_number. Remove external declaration of Qdelete_window.
11546 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
11548 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
11549 Run Qbuffer_list_update_hook if allowed.
11550 (Fother_buffer): Rewrite doc-string. Major rewrite for new
11551 buffer list implementation.
11552 (other_buffer_safely): New function.
11553 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
11554 calls to replace_buffer_in_windows and
11555 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
11557 (record_buffer): Inhibit quitting and rewrite using quittable
11558 functions. Run Qbuffer_list_update_hook if allowed.
11559 (Frecord_buffer, Funrecord_buffer): New functions.
11560 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
11561 Move switch-to-buffer to window.el.
11562 (bury-buffer): Move to window.el.
11563 (Vbuffer_list_update_hook): New variable.
11565 * lisp.h (other_buffer_safely): Add prototype in buffer.c
11568 * window.h (resize_frame_windows): Move up in code.
11569 (Fwindow_frame): Remove EXFUN.
11570 (replace_buffer_in_all_windows): Remove prototype.
11571 (replace_buffer_in_windows_safely): Add prototype.
11573 * window.c: Declare Qdelete_window static again. Move down
11574 declaration of select_count.
11575 (Fnext_window, Fprevious_window): Rewrite doc-strings.
11576 (Fother_window): Move to window.el.
11577 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
11578 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
11579 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
11581 (replace_buffer_in_windows): Implement by calling
11582 Qreplace_buffer_in_windows.
11583 (replace_buffer_in_all_windows): Remove with some functionality
11584 moved into replace_buffer_in_windows_safely.
11585 (replace_buffer_in_windows_safely): New function.
11586 (select_window_norecord, select_frame_norecord): Move in front
11587 of run_window_configuration_change_hook. Remove now obsolete
11589 (Fset_window_buffer): Rewrite doc-string.
11590 Call Qrecord_window_buffer.
11591 (keys_of_window): Move binding for other-window to window.el.
11593 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
11595 * dispextern.h (struct image): Replace data member, whose int_val
11596 and ptr_val fields were not used by anything, with a single
11599 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
11600 (gif_clear_image, gif_load, imagemagick_load_image)
11601 (gs_clear_image, gs_load): Callers changed.
11603 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
11605 * buffer.h: Include <time.h>, for time_t.
11606 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
11608 Fix minor problems found by static checking.
11610 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
11612 Make identifiers static if they are not used in other modules.
11613 * data.c (Qcompiled_function, Qframe, Qvector):
11614 * image.c (QimageMagick, Qsvg):
11615 * minibuf.c (Qmetadata):
11616 * window.c (resize_window_check, resize_root_window): Now static.
11617 * window.h (resize_window_check, resize_root_window): Remove decls.
11619 * window.c (window_deletion_count, delete_deletable_window):
11621 (window_body_lines): Now static.
11622 (Fdelete_other_windows_internal): Mark vars as initialized.
11623 Make sure 'resize_failed' is initialized.
11624 (run_window_configuration_change_hook): Rename local to avoid shadowing.
11625 (resize_window_apply): Remove unused local.
11626 * window.h (delete_deletable_window): Remove decl.
11628 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
11629 (imagemagick_load_image): Fix pointer signedness problem by changing
11630 last arg from unsigned char * to char *. All uses changed.
11631 Also, fix a local for similar reasons.
11632 Remove unused locals. Remove locals to avoid shadowing.
11633 (fn_rsvg_handle_free): Remove; unused.
11634 (svg_load, svg_load_image): Fix pointer signedness problem.
11635 (imagemagick_load_image): Don't use garbage pointer image_wand.
11637 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
11639 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
11641 * image.c (gif_load): Fix omitted cast error introduced by
11644 2011-06-10 Martin Rudalics <rudalics@gmx.at>
11646 * window.h (resize_proportionally, orig_total_lines)
11647 (orig_top_line): Remove from window structure.
11648 (set_window_height, set_window_width, change_window_heights)
11649 (Fdelete_window): Remove prototypes.
11650 (resize_frame_windows): Remove duplicate declaration.
11652 2011-06-10 Eli Zaretskii <eliz@gnu.org>
11654 * window.h (resize_frame_windows, resize_window_check)
11655 (delete_deletable_window, resize_root_window)
11656 (resize_frame_windows): Declare prototypes.
11658 * window.c (resize_window_apply): Make definition be "static" to
11659 match the prototype.
11661 2011-06-10 Martin Rudalics <rudalics@gmx.at>
11663 * window.c: Remove declarations of Qwindow_size_fixed,
11664 window_min_size_1, window_min_size_2, window_min_size,
11665 size_window, window_fixed_size_p, enlarge_window, delete_window.
11666 Remove static from declaration of Qdelete_window, it's
11667 temporarily needed by Fbury_buffer.
11668 (replace_window): Don't assign orig_top_line and
11670 (Fdelete_window, delete_window): Remove. Window deletion is
11671 handled by window.el.
11672 (window_loop): Remove DELETE_OTHER_WINDOWS case.
11673 Replace Fdelete_window calls with calls to Qdelete_window.
11674 (Fdelete_other_windows): Remove. Deleting other windows is
11675 handled by window.el.
11676 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
11677 handled in window.el.
11678 (window_min_size_2, window_min_size_1, window_min_size): Remove.
11679 Window minimum sizes are handled in window.el.
11680 (shrink_windows, size_window, set_window_height)
11681 (set_window_width, change_window_heights, window_height)
11682 (window_width, CURBEG, CURSIZE, enlarge_window)
11683 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
11684 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
11685 handled in window.el.
11686 (make_dummy_parent): Rename to make_parent_window and give it a
11687 second argument horflag.
11688 (make_window): Don't set resize_proportionally any more.
11689 (Fsplit_window): Remove. Windows are split in window.el.
11690 (save_restore_action, save_restore_orig_size)
11691 (shrink_window_lowest_first, save_restore_orig_size): Remove.
11692 Resize mini windows in window.el.
11693 (grow_mini_window, shrink_mini_window): Implement by calling
11694 Qresize_root_window_vertically, resize_window_check and
11695 resize_window_apply.
11696 (saved_window, Fset_window_configuration, save_window_save):
11697 Do not handle orig_top_line, orig_total_lines, and
11698 resize_proportionally.
11699 (window_min_height, window_min_width): Move to window.el.
11700 (keys_of_window): Move bindings for delete-other-windows,
11701 split-window, delete-window and enlarge-window to window.el.
11703 * buffer.c: Temporarily extern Qdelete_window.
11704 (Fbury_buffer): Temporarily call Qdelete_window instead of
11705 Fdelete_window (Fbury_buffer will move to window.el soon).
11707 * frame.c (set_menu_bar_lines_1): Remove code handling
11708 orig_top_line and orig_total_lines.
11710 * dispnew.c (adjust_frame_glyphs_initially): Don't use
11711 set_window_height but set heights directly.
11712 (change_frame_size_1): Use resize_frame_windows.
11714 * xdisp.c (init_xdisp): Don't use set_window_height but set
11717 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
11718 Use resize_frame_windows instead of change_window_heights and run
11719 run_window_configuration_change_hook.
11721 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
11722 instead of change_window_heights and run
11723 run_window_configuration_change_hook.
11725 2011-06-09 Martin Rudalics <rudalics@gmx.at>
11727 * window.c (replace_window): Rename second argument REPLACEMENT to
11728 NEW. New third argument SETFLAG. Rewrite.
11729 (delete_window, make_dummy_parent): Call replace_window with
11731 (window_list_1): Move down in code.
11732 (run_window_configuration_change_hook): Move set_buffer part
11733 before select_frame_norecord part in order to unwind correctly.
11734 Rename count1 to count.
11735 (recombine_windows, delete_deletable_window, resize_root_window)
11736 (Fdelete_other_windows_internal)
11737 (Frun_window_configuration_change_hook, make_parent_window)
11738 (resize_window_check, resize_window_apply, Fresize_window_apply)
11739 (resize_frame_windows, Fsplit_window_internal)
11740 (Fdelete_window_internal, Fresize_mini_window_internal):
11742 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
11744 2011-06-08 Martin Rudalics <rudalics@gmx.at>
11746 * window.h (window): Add some new members to window structure -
11747 normal_lines, normal_cols, new_total, new_normal, clone_number,
11748 splits, nest, prev_buffers, next_buffers.
11749 (WINDOW_TOTAL_SIZE): Move here from window.c.
11750 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
11752 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
11754 (make_dummy_parent): Set new members of windows structure.
11755 (make_window): Move down in code. Handle new members of window
11757 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
11758 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
11759 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
11760 (Fset_window_prev_buffers, Fwindow_next_buffers)
11761 (Fset_window_next_buffers, Fset_window_clone_number):
11763 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
11764 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
11766 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
11767 Argument WINDOW can be now internal window too.
11768 (Fwindow_use_time): Move up in code.
11769 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
11770 Rewrite doc-string.
11771 (Fset_window_configuration, saved_window)
11772 (Fcurrent_window_configuration, save_window_save): Handle new
11773 members of window structure.
11774 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
11775 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
11776 (syms_of_window): New Lisp objects Qrecord_window_buffer,
11777 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
11778 Qget_mru_window, Qresize_root_window,
11779 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
11780 Qauto_buffer_name; staticpro them.
11782 2011-06-07 Martin Rudalics <rudalics@gmx.at>
11784 * window.c (Fwindow_total_size, Fwindow_left_column)
11785 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
11786 (Fwindow_list_1): New functions.
11787 (window_box_text_cols): Replace with window_body_cols.
11788 (Fwindow_width, Fscroll_left, Fscroll_right):
11789 Use window_body_cols instead of window_box_text_cols.
11790 (delete_window, Fset_window_configuration):
11791 Call delete_all_subwindows with window as argument.
11792 (delete_all_subwindows): Take a window as argument and not a
11793 structure. Rewrite.
11794 (window_loop): Remove handling of GET_LRU_WINDOW and
11795 GET_LARGEST_WINDOW.
11796 (Fget_lru_window, Fget_largest_window): Move to window.el.
11798 * window.h: Extern window_body_cols instead of
11799 window_box_text_cols. delete_all_subwindows now takes a
11800 Lisp_Object as argument.
11802 * indent.c (compute_motion, Fcompute_motion):
11803 Use window_body_cols instead of window_box_text_cols.
11805 * frame.c (delete_frame): Call delete_all_subwindows with root
11806 window as argument.
11808 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
11810 * fns.c (Fputhash): Document return value.
11812 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
11814 * image.c (gif_load): Implement gif89a spec "no disposal" method.
11816 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
11818 Cons<->int and similar integer overflow fixes (Bug#8794).
11820 Check for overflow when converting integer to cons and back.
11821 * charset.c (Fdefine_charset_internal, Fdecode_char):
11822 Use cons_to_unsigned to catch overflow.
11823 (Fencode_char): Use INTEGER_TO_CONS.
11824 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
11825 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
11826 * data.c (long_to_cons, cons_to_long): Remove.
11827 (cons_to_unsigned, cons_to_signed): New functions.
11828 These signal an error for invalid or out-of-range values.
11829 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
11830 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
11831 * font.c (Ffont_variation_glyphs):
11832 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
11833 * lisp.h: Include <intprops.h>.
11834 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
11835 (cons_to_signed, cons_to_unsigned): New decls.
11836 (long_to_cons, cons_to_long): Remove decls.
11837 * undo.c (record_first_change): Use INTEGER_TO_CONS.
11838 (Fprimitive_undo): Use CONS_TO_INTEGER.
11839 * xfns.c (Fx_window_property): Likewise.
11840 * xselect.c: Include <limits.h>.
11841 (x_own_selection, selection_data_to_lisp_data):
11842 Use INTEGER_TO_CONS.
11843 (x_handle_selection_request, x_handle_selection_clear)
11844 (x_get_foreign_selection, Fx_disown_selection_internal)
11845 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
11846 (lisp_data_to_selection_data): Use cons_to_unsigned.
11847 (x_fill_property_data): Use cons_to_signed.
11848 Report values out of range.
11850 Check for buffer and string overflow more precisely.
11851 * buffer.h (BUF_BYTES_MAX): New macro.
11852 * lisp.h (STRING_BYTES_MAX): New macro.
11853 * alloc.c (Fmake_string):
11854 * character.c (string_escape_byte8):
11855 * coding.c (coding_alloc_by_realloc):
11856 * doprnt.c (doprnt):
11857 * editfns.c (Fformat):
11859 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
11860 since they may not be the same number.
11861 * editfns.c (Finsert_char):
11862 * fileio.c (Finsert_file_contents):
11863 Likewise for BUF_BYTES_MAX.
11865 * image.c: Use ptrdiff_t, not int, for sizes.
11866 (slurp_file): Switch from int to ptrdiff_t.
11868 (slurp_file): Check that file size fits in both size_t (for
11869 malloc) and ptrdiff_t (for sanity and safety).
11871 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
11872 if b->modtime has its maximal value.
11874 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
11876 Don't assume time_t can fit into int.
11877 * buffer.h (struct buffer.modtime): Now time_t, not int.
11878 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
11879 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
11881 Minor fixes for signed vs unsigned integers.
11882 * character.h (MAYBE_UNIFY_CHAR):
11883 * charset.c (maybe_unify_char):
11884 * keyboard.c (read_char, reorder_modifiers):
11885 XINT -> XFASTINT, since the integer must be nonnegative.
11886 * ftfont.c (ftfont_spec_pattern):
11887 * keymap.c (access_keymap, silly_event_symbol_error):
11888 XUINT -> XFASTINT, since the integer must be nonnegative.
11889 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
11890 since it makes no difference and we prefer signed.
11891 * keyboard.c (record_char): Use XUINT when all the neighbors do.
11892 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
11895 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
11897 * window.h (Fwindow_frame): Declare.
11899 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
11901 * alloc.c: Simplify handling of large-request failures (Bug#8800).
11902 (SPARE_MEMORY): Always define.
11903 (LARGE_REQUEST): Remove.
11904 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
11906 2011-06-06 Martin Rudalics <rudalics@gmx.at>
11908 * lisp.h: Move EXFUNS for Fframe_root_window,
11909 Fframe_first_window and Fset_frame_selected_window to window.h.
11911 * window.h: Move EXFUNS for Fframe_root_window,
11912 Fframe_first_window and Fset_frame_selected_window here from
11915 * frame.c (Fwindow_frame, Fframe_first_window)
11916 (Fframe_root_window, Fframe_selected_window)
11917 (Fset_frame_selected_window): Move to window.c.
11918 (Factive_minibuffer_window): Move to minibuf.c.
11919 (Fother_visible_frames_p): New function.
11921 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
11923 * window.c (decode_window, decode_any_window): Move up in code.
11924 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
11925 (inhibit_frame_unsplittable): Remove unused variable.
11926 (Fwindow_buffer): Move up and rewrite doc-string.
11927 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
11928 (Fwindow_prev): New functions.
11929 (Fwindow_frame): Move here from frame.c. Accept any window as
11931 (Fframe_root_window, Fframe_first_window)
11932 (Fframe_selected_window): Move here from frame.c. Accept frame
11933 or arbitrary window as argument. Update doc-strings.
11934 (Fminibuffer_window): Move up in code.
11935 (Fwindow_minibuffer_p): Move up in code and simplify.
11936 (Fset_frame_selected_window): Move here from frame.c.
11938 (Fselected_window, select_window, Fselect_window): Move up in
11939 code. Minor doc-string fixes.
11941 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
11943 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
11944 Do not assume that spare memory exists; that assumption is valid
11945 only if SYSTEM_MALLOC.
11946 (LARGE_REQUEST): New macro, so that the issue of large requests
11947 is separated from the issue of spare memory.
11949 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
11951 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
11954 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
11956 * xfns.c (x_set_scroll_bar_default_width): Move declarations
11959 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
11961 * gtkutil.c (xg_get_default_scrollbar_width): New function.
11963 * gtkutil.h: Declare xg_get_default_scrollbar_width.
11965 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
11966 min width by calling x_set_scroll_bar_default_width (Bug#8505).
11968 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
11970 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
11972 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
11974 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
11975 (x_clipboard_manager_save): Add return value.
11976 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
11977 New error handlers.
11978 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
11979 Obey Vx_select_enable_clipboard_manager. Catch errors in
11980 x_clipboard_manager_save (Bug#8779).
11981 (Vx_select_enable_clipboard_manager): New variable.
11982 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
11984 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
11986 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
11988 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11990 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
11991 in the current matrix if keep_current_p is non-zero.
11993 2011-06-04 Eli Zaretskii <eliz@gnu.org>
11995 * bidi.c (bidi_level_of_next_char): Fix last change.
11997 2011-06-03 Eli Zaretskii <eliz@gnu.org>
11999 Support bidi reordering of text covered by display properties.
12001 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
12002 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
12003 (bidi_cache_search, bidi_cache_iterator_state)
12004 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
12005 (bidi_level_of_next_char, bidi_move_to_visually_next):
12006 Support character positions inside a run of characters covered by a
12008 (bidi_paragraph_init, bidi_resolve_explicit_1)
12009 (bidi_level_of_next_char): Call bidi_fetch_char and
12010 bidi_fetch_char_advance instead of FETCH_CHAR and
12011 FETCH_CHAR_ADVANCE.
12012 (bidi_init_it): Initialize new members.
12013 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
12015 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
12016 instead of using explicit *_CHAR codes.
12017 (bidi_resolve_explicit, bidi_resolve_weak):
12018 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
12019 bidirectional text is supported only in multibyte buffers.
12020 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
12021 it to initialize the frame_window_p member of struct bidi_it.
12022 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
12023 (bidi_resolve_explicit, bidi_resolve_weak)
12024 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
12025 bidi_it->nchars is non-positive.
12026 (bidi_level_of_next_char): Don't try to lookup the cache for the
12027 next/previous character if nothing is cached there yet, or if we
12028 were just reseat()'ed to a new position.
12030 * xdisp.c (set_cursor_from_row): Set start and stop points
12031 according to the row's direction when priming the loop that looks
12032 for the glyph on which to display cursor.
12033 (single_display_spec_intangible_p): Function deleted.
12034 (display_prop_intangible_p): Reimplement to call
12035 handle_display_spec instead of single_display_spec_intangible_p.
12036 Accept 3 additional arguments needed by handle_display_spec.
12037 This fixes incorrect cursor motion across display property with complex
12038 values: lists, `(when COND...)' forms, etc.
12039 (single_display_spec_string_p): Support property values that are
12040 lists with the argument STRING its top-level element.
12041 (display_prop_string_p): Fix the condition for processing a
12042 property that is a list to be consistent with handle_display_spec.
12043 (handle_display_spec): New function, refactored from the
12044 last portion of handle_display_prop.
12045 (compute_display_string_pos): Accept additional argument
12046 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
12047 value of a `display' property is a "replacing spec".
12048 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
12049 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
12050 the display property, but just return a value indicating whether
12051 the display property will replace the characters it covers.
12052 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
12053 frame_window_p members of struct bidi_it.
12054 (compute_display_string_pos, compute_display_string_end):
12056 (push_it): Accept second argument POSITION, where pop_it should
12057 jump to continue iteration.
12058 (reseat_1): Initialize bidi_it.disp_pos.
12060 * keyboard.c (adjust_point_for_property): Adjust the call to
12061 display_prop_intangible_p to its new signature.
12063 * dispextern.h (struct bidi_it): New member frame_window_p.
12064 (bidi_init_it): Update prototypes.
12065 (display_prop_intangible_p): Update prototype.
12066 (compute_display_string_pos, compute_display_string_end):
12067 Declare prototypes.
12068 (struct bidi_it): New members nchars and disp_pos. ch_len is now
12071 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
12073 Malloc failure behavior now depends on size of allocation.
12074 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
12075 * lisp.h: Change signatures accordingly.
12076 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
12077 All callers changed. (Bug#8762)
12079 * gnutls.c: Use Emacs's memory allocators.
12080 Without this change, the gnutls library would invoke malloc etc.
12081 directly, which causes problems on non-SYNC_INPUT hosts, and which
12082 runs afoul of improving memory_full behavior. (Bug#8761)
12083 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
12084 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
12085 xfree instead of the default malloc, realloc, free.
12086 (Fgnutls_boot): No need to check for memory allocation failure,
12087 since xmalloc does that for us.
12089 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
12090 * category.c (hash_get_category_set):
12091 * ccl.c (ccl_driver):
12092 * charset.c (Fdefine_charset_internal):
12093 * charset.h (struct charset.hash_index):
12094 * composite.c (get_composition_id, gstring_lookup_cache)
12095 (composition_gstring_put_cache):
12096 * composite.h (struct composition.hash_index):
12097 * dispextern.h (struct image.hash):
12098 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
12099 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
12100 (hashfn_equal, hashfn_user_defined, make_hash_table)
12101 (maybe_resize_hash_table, hash_lookup, hash_put)
12102 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
12103 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
12104 (Fsxhash, Fgethash, Fputhash, Fmaphash):
12105 * image.c (make_image, search_image_cache, lookup_image)
12106 (xpm_put_color_table_h):
12107 * lisp.h (struct Lisp_Hash_Table):
12108 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
12109 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
12110 for hashes and hash indexes, instead of 'unsigned' and 'int'.
12111 * alloc.c (allocate_vectorlike):
12112 Check for overflow in vector size calculations.
12113 * ccl.c (ccl_driver):
12114 Check for overflow when converting EMACS_INT to int.
12115 * fns.c, image.c: Remove unnecessary static decls that would otherwise
12116 need to be updated by these changes.
12117 * fns.c (make_hash_table, maybe_resize_hash_table):
12118 Check for integer overflow with large hash tables.
12119 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
12120 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
12121 (SXHASH_REDUCE): New macro.
12122 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
12123 Use it instead of discarding useful hash info with large hash values.
12124 (sxhash_float): New function.
12125 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
12126 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
12127 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
12128 Rewrite to use FIXNUM_BITS, as this simplifies things.
12129 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
12130 Adjust signatures to match updated version of code.
12131 (consing_since_gc): Now EMACS_INT, since a single hash table can
12132 use more than INT_MAX bytes.
12134 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
12136 Make it possible to build with GCC-4.6+ -O2 -flto.
12138 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
12140 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
12142 * minibuf.c (get_minibuffer, read_minibuf_unwind):
12143 Call minibuffer-inactive-mode.
12145 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
12147 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
12148 Update dependencies.
12150 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12152 * data.c (init_data): Remove code for UTS, this system is not
12155 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12157 Don't force ./temacs to start in terminal mode.
12159 * frame.c (make_initial_frame): Initialize faces in all cases, not
12160 only when CANNOT_DUMP is defined.
12161 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
12163 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12165 * dispnew.c (add_window_display_history): Use const for the string
12166 pointer. Remove declaration, not needed.
12168 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
12170 Use 'inline', not 'INLINE'.
12171 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
12172 * alloc.c, fontset.c (INLINE): Remove.
12173 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
12174 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
12175 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
12176 * gmalloc.c (register_heapinfo): Use inline unconditionally.
12177 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
12179 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12181 Make it possible to run ./temacs.
12183 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
12184 syms_of_callproc does the same thing. Remove test for
12185 "initialized", do it in the caller.
12186 * emacs.c (main): Avoid calling set_initial_environment when dumping.
12188 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
12190 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
12191 (read_minibuf): Use get_minibuffer.
12192 (syms_of_minibuf): Use DEFSYM.
12193 (Qmetadata): New var.
12194 * data.c (Qbuffer): Don't make it static.
12195 (syms_of_data): Use DEFSYM.
12197 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
12199 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
12200 (CCL_CODE_MIN): New macro.
12202 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
12204 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
12206 * eval.c (Qdebug): Now static.
12207 * lisp.h (Qdebug): Remove decl. This reverts a part of the
12208 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
12209 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
12211 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
12213 * image.c: Various fixes to ImageMagick code comments.
12214 (Fimagemagick_types): Doc fix.
12216 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
12218 Minor fixes prompted by GCC 4.6.0 warnings.
12220 * xselect.c (converted_selections, conversion_fail_tag): Now static.
12222 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
12223 (x_clipboard_manager_save_all): Move extern decl to ...
12224 * xterm.h: ... here, so that it can be checked for consistency.
12226 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
12228 * xselect.c (x_clipboard_manager_save_frame)
12229 (x_clipboard_manager_save_all): New functions.
12230 (Fx_clipboard_manager_save): Lisp function deleted.
12232 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
12233 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
12235 * xterm.h: Update prototype.
12237 2011-05-28 William Xu <william.xwl@gmail.com>
12239 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
12240 exiting (Bug#8239).
12242 2011-05-28 Jim Meyering <meyering@redhat.com>
12244 Avoid a sign-extension bug in crypto_hash_function.
12245 * fns.c (to_uchar): Define.
12246 (crypto_hash_function): Use it to convert some newly-signed
12247 variables to unsigned, to avoid sign-extension bugs. For example,
12248 without this change, (md5 "truc") would evaluate to
12249 45723a2aff78ff4fff7fff1114760e62 rather than the expected
12250 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
12251 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
12253 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
12255 Integer overflow fixes.
12257 * dbusbind.c: Serial number integer overflow fixes.
12258 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
12259 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
12260 to hold a serial number that is too large for a fixnum.
12261 (Fdbus_method_return_internal, Fdbus_method_error_internal):
12262 Check for serial numbers out of range. Decode any serial number
12263 that was so large that it became a float. (Bug#8722)
12265 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
12266 (Fdbus_call_method, Fdbus_call_method_asynchronously):
12267 Use XFASTINT rather than XUINT when numbers are nonnegative.
12268 (xd_append_arg, Fdbus_method_return_internal):
12269 (Fdbus_method_error_internal): Likewise. Also, for unsigned
12270 arguments, check that Lisp number is nonnegative, rather than
12271 silently wrapping negative numbers around. (Bug#8722)
12272 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
12275 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
12277 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
12279 ccl: Add integer overflow checks.
12280 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
12281 (IN_INT_RANGE): New macros.
12282 (ccl_driver): Use them to check for integer overflow when
12283 decoding a CCL program. Many of the new checks are whether XINT (x)
12284 fits in int; it doesn't always, on 64-bit hosts. The new version
12285 doesn't catch all possible integer overflows, but it's an
12286 improvement. (Bug#8719)
12288 * alloc.c (make_event_array): Use XINT, not XUINT.
12289 There's no need for unsigned here.
12291 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
12292 This follows up to the 2011-05-06 change that substituted uintptr_t
12293 for EMACS_INT. This case wasn't caught back then.
12295 Rework Fformat to avoid integer overflow issues.
12296 * editfns.c: Include <float.h> unconditionally, as it's everywhere
12297 now (part of C89). Include <verify.h>.
12298 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
12299 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
12300 (Fformat): Avoid the prepass trying to compute sizes; it was only
12301 approximate and thus did not catch overflow reliably. Instead, walk
12302 through the format just once, formatting and computing sizes as we go,
12303 checking for integer overflow at every step, and allocating a larger
12304 buffer as needed. Keep track separately whether the format is
12305 multibyte. Keep only the most-recently calculated precision, rather
12306 than them all. Record whether each argument has been converted to
12307 string. Use EMACS_INT, not int, for byte and char and arg counts.
12308 Support field widths and precisions larger than INT_MAX. Avoid
12309 sprintf's undefined behavior with conversion specifications such as %#d
12310 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
12311 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
12312 formatting out-of-range floating point numbers with int
12313 formats. (Bug#8668)
12315 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
12317 * data.c: Avoid integer truncation in expressions involving floats.
12318 * data.c: Include <intprops.h>.
12319 (arith_driver): When there's an integer overflow in an expression
12320 involving floating point, convert the integers to floating point
12321 so that the resulting value does not suffer from catastrophic
12322 integer truncation. For example, on a 64-bit host (* 4
12323 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
12324 Do not rely on undefined behavior after integer overflow.
12326 merge count_size_as_multibyte, parse_str_to_multibyte
12327 * character.c, character.h (count_size_as_multibyte):
12328 Rename from parse_str_to_multibyte; all uses changed.
12329 Check for integer overflow.
12330 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
12331 since it's now a duplicate of the other. This is more of
12332 a character than a buffer op, so better that it's in character.c.
12333 * fns.c, print.c: Adjust to above changes.
12335 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
12337 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
12339 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
12341 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
12342 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
12343 (x_clipboard_manager_save): Now static.
12344 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
12346 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
12347 (crypto_hash_function): Now static.
12348 Fix pointer signedness problems. Avoid unnecessary initializations.
12350 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
12352 * termhooks.h (Vselection_alist): Make it terminal-local.
12354 * terminal.c (create_terminal): Initialize it.
12356 * xselect.c: Support for clipboard managers.
12357 (Vselection_alist): Move to termhooks.h as terminal-local var.
12358 (LOCAL_SELECTION): New macro.
12359 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
12360 (symbol_to_x_atom): Remove gratuitous arg.
12361 (x_handle_selection_request, lisp_data_to_selection_data)
12362 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
12363 (x_own_selection, x_get_local_selection, x_convert_selection):
12364 New arg, specifying work frame. Use terminal-local Vselection_alist.
12365 (some_frame_on_display): Delete unused function.
12366 (Fx_own_selection_internal, Fx_get_selection_internal)
12367 (Fx_disown_selection_internal, Fx_selection_owner_p)
12368 (Fx_selection_exists_p): New optional frame arg.
12369 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
12370 (x_handle_selection_clear): Don't treat other terminals with the
12371 same keyboard specially. Use the terminal-local Vselection_alist.
12372 (x_clear_frame_selections): Use Frun_hook_with_args.
12374 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
12376 * xterm.h: Add support for those atoms.
12378 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
12380 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
12381 (converted_selections, conversion_fail_tag): New global variables.
12382 (x_selection_request_lisp_error): Free the above.
12383 (x_get_local_selection): Remove unnecessary code.
12384 (x_reply_selection_request): Args changed; handle arbitrary array
12385 of converted selections stored in converted_selections.
12386 Separate the XChangeProperty and SelectionNotify steps.
12387 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
12388 (x_convert_selection): New function.
12389 (x_handle_selection_event): Simplify.
12390 (x_get_foreign_selection): Don't ignore incoming requests while
12391 waiting for an answer; this will fail when we implement
12392 SAVE_TARGETS, and seems unnecessary anyway.
12393 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
12394 (Vx_sent_selection_functions): Doc fix.
12396 2011-05-26 Leo Liu <sdl.web@gmail.com>
12398 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
12400 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12402 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
12404 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
12405 for fringe update if it has periodic bitmap.
12406 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
12407 and fringe_bitmap_periodic_p.
12409 * fringe.c (get_fringe_bitmap_data): New function.
12410 (draw_fringe_bitmap_1, update_window_fringes): Use it.
12411 (update_window_fringes): Record periodicity of fringe bitmap in glyph
12412 row. Mark glyph row for fringe update if periodicity changed.
12414 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
12415 for fringe update unless it has periodic bitmap.
12417 2011-05-25 Kenichi Handa <handa@m17n.org>
12419 * xdisp.c (get_next_display_element): Set correct it->face_id for
12420 a static composition.
12422 2011-05-24 Leo Liu <sdl.web@gmail.com>
12425 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
12427 * fns.c (crypto_hash_function, Fsha1): New function.
12428 (Fmd5): Use crypto_hash_function.
12429 (syms_of_fns): Add Ssha1.
12431 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
12433 * gnutls.c: Remove unused macros.
12434 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
12435 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
12436 Remove macros that are defined and never used.
12437 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
12439 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
12441 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
12442 (Fx_get_selection_internal): Minor cleanup.
12443 (Fx_own_selection_internal): Rename arguments for consistency with
12446 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
12448 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
12450 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
12452 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
12454 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12456 * dispnew.c (scrolling_window): Don't exclude the case that the
12457 last enabled row in the desired matrix touches the bottom boundary.
12459 2011-05-21 Glenn Morris <rgm@gnu.org>
12461 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
12462 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
12463 and add some more files.
12465 2011-05-20 Eli Zaretskii <eliz@gnu.org>
12467 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
12468 report_file_error introduced by the change from 2011-05-07.
12470 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
12472 * systime.h (Time): Define only if emacs is defined.
12473 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
12474 where the include path doesn't have X11/X.h by default. See
12475 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
12477 2011-05-20 Kenichi Handa <handa@m17n.org>
12479 * composite.c (find_automatic_composition): Fix previous change.
12481 2011-05-20 Glenn Morris <rgm@gnu.org>
12483 * lisp.mk: New file, split from Makefile.in.
12484 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
12485 (shortlisp): Remove.
12486 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
12488 2011-05-19 Glenn Morris <rgm@gnu.org>
12490 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
12491 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
12492 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
12493 (lisp): Set the order to that of loadup.el.
12494 (shortlisp): Make it a copy of $lisp.
12495 (SOME_MACHINE_LISP): Remove.
12496 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
12497 Use just $shortlisp, not $SOME_MACHINE_LISP too.
12499 2011-05-18 Kenichi Handa <handa@m17n.org>
12501 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
12502 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
12503 (find_automatic_composition): Mostly rewrite for efficiency.
12505 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
12507 * makefile.w32-in: Update dependencies.
12509 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
12511 * menu.c: Include limits.h (fixes the MS-Windows build broken by
12512 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
12514 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
12516 Fix some integer overflow issues, such as string length overflow.
12518 * insdel.c (count_size_as_multibyte): Check for string overflow.
12520 * character.c (lisp_string_width): Check for string overflow.
12521 Use EMACS_INT, not int, for string indexes and lengths; in
12522 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
12523 the resulting string length overflows an EMACS_INT; instead,
12524 report a string overflow if no precision given. When checking for
12525 precision exhaustion, use a check that cannot possibly have
12526 integer overflow. (Bug#8675)
12527 * character.h (lisp_string_width): Adjust to new signature.
12529 * alloc.c (string_overflow): New function.
12530 (Fmake_string): Use it. This doesn't change behavior, but saves
12531 a few bytes and will simplify future changes.
12532 * character.c (string_escape_byte8): Likewise.
12533 * lisp.h (string_overflow): New decl.
12535 Fixups, following up to the user-interface timestamp change.
12536 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
12537 for UI timestamps, instead of unsigned long.
12538 * msdos.c (mouse_get_pos): Likewise.
12539 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
12540 * w32gui.h (Time): Define by including "systime.h" rather than by
12541 declaring it ourselves. (Bug#8664)
12543 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
12544 * image.c (clear_image_cache): Likewise.
12546 * term.c (term_mouse_position): Don't assume time_t wraparound.
12548 Be more systematic about user-interface timestamps.
12549 Before, the code sometimes used 'Time', sometimes 'unsigned long',
12550 and sometimes 'EMACS_UINT', to represent these timestamps.
12551 This change causes it to use 'Time' uniformly, as that's what X uses.
12552 This makes the code easier to follow, and makes it easier to catch
12553 integer overflow bugs such as Bug#8664.
12554 * frame.c (Fmouse_position, Fmouse_pixel_position):
12555 Use Time, not unsigned long, for user-interface timestamps.
12556 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
12557 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
12558 * keyboard.h (last_event_timestamp): Likewise.
12559 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
12560 * menu.h (xmenu_show): Likewise.
12561 * term.c (term_mouse_position): Likewise.
12562 * termhooks.h (struct input_event.timestamp): Likewise.
12563 (struct terminal.mouse_position_hook): Likewise.
12564 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
12565 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
12566 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
12567 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
12568 what it was before.
12569 * menu.h, termhooks.h: Include "systime.h", for Time.
12571 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
12572 Don't assume that the difference between two unsigned long values
12573 can fit into an integer. At this point, we know button_down_time
12574 <= event->timestamp, so the difference must be nonnegative, so
12575 there's no need to cast the result if double-click-time is
12576 nonnegative, as it should be; check that it's nonnegative, just in
12577 case. This bug is triggered when events are more than 2**31 ms
12578 apart (about 25 days). (Bug#8664)
12580 * xselect.c (last_event_timestamp): Remove duplicate decl.
12581 (x_own_selection): Remove needless cast to unsigned long.
12583 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
12584 that always fit in int. Use a sentinel instead of a counter, to
12585 avoid a temp and to allay GCC's concerns about possible int overflow.
12586 * frame.h (struct frame): Use int for menu_bar_items_used
12587 instead of EMACS_INT, since it always fits in int.
12589 * menu.c (grow_menu_items): Check for int overflow.
12591 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
12593 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
12594 Before, the code was not consistent. These values cannot exceed
12595 2**31 - 1 so there's no need to make them unsigned.
12596 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
12597 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
12598 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
12600 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
12602 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
12603 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
12604 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
12605 presumably because the widths might not match.
12607 * window.c (size_window): Avoid needless test at loop start.
12609 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
12611 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
12613 2011-05-12 Drew Adams <drew.adams@oracle.com>
12615 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
12617 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12619 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
12620 `width' to `bar_area_x' and `bar_area_width', respectively.
12621 (x_scroll_run): Take account of fringe background extension.
12623 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
12624 Rename local vars `left' and `width' to `bar_area_x' and
12625 `bar_area_width', respectively.
12626 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
12627 background extension.
12629 2011-05-10 Jim Meyering <meyering@redhat.com>
12631 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
12633 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
12635 * image.c (Finit_image_library): Return t for built-in image types,
12636 like pbm and xbm. (Bug#8640)
12638 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
12640 * w32menu.c (set_frame_menubar): Fix submenu allocation.
12642 2011-05-07 Eli Zaretskii <eliz@gnu.org>
12644 * w32console.c (Fset_screen_color): Doc fix.
12645 (Fget_screen_color): New function.
12646 (syms_of_ntterm): Defsubr it.
12648 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
12649 unlink the temporary file if Fcall_process didn't create it in the
12651 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
12652 child process will be redirected to a file specified with `:file'.
12653 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
12654 cue to call_process_cleanup not to close that handle.
12656 2011-05-07 Ben Key <bkey76@gmail.com>
12658 * makefile.w32-in: The bootstrap-temacs rule now makes use of
12659 one of two shell specific rules, either bootstrap-temacs-CMD or
12660 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
12661 to the previous implementation of the bootstrap-temacs rule.
12662 The bootstrap-temacs-CMD rule is similar to the previous
12663 implementation of the bootstrap-temacs rule except that it
12664 makes use of the ESC_CFLAGS variable instead of the CFLAGS
12667 These changes, along with some changes to nt/configure.bat,
12668 nt/gmake.defs, and nt/nmake.defs, are required to extend my
12669 earlier fix to add support for --cflags and --ldflags options
12670 that include quotes so that it works whether make uses cmd or
12673 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
12675 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
12676 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
12678 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
12679 a string. Handle both cases.
12680 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
12681 (Fdbus_register_method): Use Qinvalid_function.
12683 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
12685 * makefile.w32-in: Update dependencies.
12686 (LISP_H): Add inttypes.h and stdin.h.
12687 (PROCESS_H): Add unistd.h.
12689 2011-05-06 Eli Zaretskii <eliz@gnu.org>
12691 * lread.c: Include limits.h (fixes the MS-Windows build broken by
12692 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
12694 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
12696 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
12698 * term.c (vfatal): Remove stray call to va_end.
12699 It's not needed and the C Standard doesn't allow it here anyway.
12701 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
12702 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
12704 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
12707 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
12709 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12711 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
12713 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
12715 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
12717 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
12718 * charset.c (Fdefine_charset_internal): Don't initialize
12719 charset.code_space[15]. The value was garbage, on hosts with
12720 32-bit int (Bug#8600).
12722 * lread.c (read_integer): Be more consistent with string-to-number.
12723 Use string_to_number to do the actual conversion; this avoids
12724 rounding errors and fixes some other screwups. Without this fix,
12725 for example, #x1fffffffffffffff was misread as -2305843009213693952.
12726 (digit_to_number): Move earlier, for benefit of read_integer.
12727 Return -1 if the digit is out of range for the base, -2 if it is
12728 not a digit in any supported base. (Bug#8602)
12730 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
12732 * dispnew.c (scrolling_window): Return 1 if we scrolled,
12733 to match comment at start of function. This also removes a
12734 GCC warning about overflow in a 32+64-bit port.
12736 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
12738 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
12739 Reported by Stefan Monnier in
12740 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
12741 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
12742 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
12744 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
12745 (EMACS_UINTPTR): Likewise, with uintptr_t.
12747 * lisp.h: Prefer 64-bit EMACS_INT if available.
12748 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
12749 on 32-bit hosts that have 64-bit int, so that they can access
12751 However, temporarily disable this change unless the temporary
12752 symbol WIDE_EMACS_INT is defined.
12754 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
12756 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
12757 This removes an assumption that EMACS_INT and long are the same
12758 width as pointers. The assumption is true for Emacs porting targets
12759 now, but we want to make other targets possible.
12760 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
12761 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
12762 In the rest of the code, change types of integers that hold casted
12763 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
12764 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
12765 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
12766 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
12767 No need to cast type when ORing.
12768 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
12769 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
12770 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
12771 assume EMACS_INT is the same width as char *.
12772 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
12773 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
12774 Remove no-longer-needed casts.
12775 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
12776 (xg_tool_bar_help_callback, xg_make_tool_item):
12777 Use EMACS_INTPTR to hold an integer
12778 that will be cast to void *; this can avoid a GCC warning
12779 if EMACS_INT is not the same width as void *.
12780 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
12781 * xdisp.c (display_echo_area_1, resize_mini_window_1):
12782 (current_message_1, set_message_1):
12783 Use a local to convert to proper width without a cast.
12784 * xmenu.c (dialog_selection_callback): Likewise.
12786 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
12787 Also, don't assume VALBITS / RAND_BITS is less than 5,
12788 and don't rely on undefined behavior when shifting a 1 left into
12790 * lisp.h (get_random): Change signature to match.
12792 * lread.c (hash_string): Use size_t, not int, for hash computation.
12793 Normally we prefer signed values; but hashing is special, because
12794 it's better to use unsigned division on hash table sizes so that
12795 the remainder is nonnegative. Also, size_t is the natural width
12796 for hashing into memory. The previous code used 'int', which doesn't
12797 retain enough info to hash well into very large tables.
12798 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
12800 * dbusbind.c: Don't possibly lose pointer info when converting.
12801 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
12802 Use XPNTR rather than XHASH, so that the high-order bits of
12803 the pointer aren't lost when converting through void *.
12805 * eval.c (Fautoload): Don't double-shift a pointer.
12807 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
12809 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
12811 * gnutls.c (DEF_GNUTLS_FN):
12812 * image.c (DEF_IMGLIB_FN): Make function pointers static.
12814 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
12816 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
12819 2011-05-05 Eli Zaretskii <eliz@gnu.org>
12821 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
12822 New version that can reserve upto 2GB of heap space.
12824 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
12826 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
12828 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
12830 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
12831 `gnutls_certificate_set_x509_key_file'.
12833 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
12835 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
12836 Update dependencies.
12838 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
12840 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
12841 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
12842 Remove unused parameter `fildes'.
12843 * process.c (read_process_output, send_process): Don't pass it.
12845 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
12847 Fix previous change: the library cache is defined in w32.c.
12848 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
12849 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
12851 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
12853 Implement dynamic loading of GnuTLS on Windows.
12855 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
12856 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
12857 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
12860 * gnutls.c (Qgnutls_dll): Define.
12861 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
12862 (gnutls_*): Declare function pointers.
12863 (init_gnutls_functions): New function to initialize function pointers.
12864 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
12865 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
12866 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
12867 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
12868 (emacs_gnutls_write, emacs_gnutls_read)
12869 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
12870 (Fgnutls_available_p): New function.
12871 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
12872 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
12873 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
12875 * image.c: Include w32.h.
12876 (Vimage_type_cache): Delete.
12877 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
12878 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
12879 (w32_delayed_load): Move to w32.c.
12881 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
12883 * w32.c (QCloaded_from, Vlibrary_cache): Define.
12884 (w32_delayed_load): Move from image.c. When loading a library, record
12885 its filename in the :loaded-from property of the library id.
12886 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
12887 Initialize and staticpro them.
12888 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
12890 * process.c: Include lisp.h before w32.h, not after.
12891 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
12892 instead of gnutls_record_check_pending.
12894 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
12896 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
12898 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
12899 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
12902 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
12904 * xterm.c (x_set_frame_alpha): Do not set property on anything
12905 else than FRAME_X_OUTER_WINDOW (Bug#8608).
12907 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
12909 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
12911 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
12913 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
12914 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
12915 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
12916 (gnutls_global_initialized, Qgnutls_bootprop_priority)
12917 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
12918 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
12919 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
12920 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
12921 (Qgnutls_bootprop_callbacks_verify): Make static.
12923 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
12925 * callproc.c: Indentation fixup.
12927 * sysdep.c (wait_for_termination_1): Make static.
12928 (wait_for_termination, interruptible_wait_for_termination):
12929 Move after wait_for_termination_1.
12931 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
12933 * sysdep.c (interruptible_wait_for_termination): New function
12934 which is like wait_for_termination, but allows keyboard
12937 * callproc.c (Fcall_process): Add (:file "file") as an option for
12939 (Fcall_process_region): Ditto.
12941 2011-04-30 Eli Zaretskii <eliz@gnu.org>
12943 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
12944 rather than `XVECTOR (FOO)->size'.
12946 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
12947 inttypes.h, as a gnulib replacement is used if it not available in
12950 2011-04-21 Eli Zaretskii <eliz@gnu.org>
12952 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
12953 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
12954 of MOST_POSITIVE_FIXNUM. (Bug#8528)
12956 * coding.c (coding_alloc_by_realloc): Error out if destination
12957 will grow beyond MOST_POSITIVE_FIXNUM.
12958 (decode_coding_emacs_mule): Abort if there isn't enough place in
12959 charbuf for the composition carryover bytes. Reserve an extra
12960 space for up to 2 characters produced in a loop.
12961 (decode_coding_iso_2022): Abort if there isn't enough place in
12962 charbuf for the composition carryover bytes.
12964 2011-04-21 Eli Zaretskii <eliz@gnu.org>
12966 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
12967 aborting when %lld or %lll format is passed.
12968 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
12969 %llo or %llx format is passed. (Bug#8545)
12971 * window.c (window_scroll_line_based): Use a marker instead of
12972 simple variables to record original value of point. (Bug#7952)
12974 * doprnt.c (doprnt): Fix the case where a multibyte sequence
12975 produced by %s or %c overflows available buffer space. (Bug#8545)
12977 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
12979 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
12980 (SIZE_MAX): Move defn after all includes, as they might #define it.
12982 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
12984 * w32.c (init_environment): Warn about defaulting HOME to C:\.
12986 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
12988 * keyboard.c (Qdelayed_warnings_hook): Define.
12989 (command_loop_1): Run `delayed-warnings-hook'
12990 if Vdelayed_warnings_list is non-nil.
12991 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
12992 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
12994 2011-04-28 Eli Zaretskii <eliz@gnu.org>
12996 * doprnt.c (doprnt): Don't return value smaller than the buffer
12997 size if the message was truncated. (Bug#8545).
12999 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
13001 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
13002 (Fx_window_property): #if-0 the whole functions, not just the bodies.
13004 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
13006 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
13008 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
13010 * makefile.w32-in: Update dependencies.
13012 2011-04-27 Eli Zaretskii <eliz@gnu.org>
13014 Improve `doprnt' and its usage. (Bug#8545)
13015 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
13016 `format_end'. Remove support for %l as a conversion specifier.
13017 Don't use xrealloc. Improve diagnostics when the %l size modifier
13018 is used. Update the commentary.
13020 * eval.c (verror): Simplify calculation of size_t.
13022 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
13025 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
13027 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
13030 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
13032 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
13033 This makes this file independent of the recent pseudovector change.
13035 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
13037 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
13039 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
13040 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
13041 Remove unused local.
13042 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
13044 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
13045 GCC 4.6.0 optimizes based on type-based alias analysis.
13046 For example, if b is of type struct buffer * and v of type struct
13047 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
13048 != &v->size, and therefore "v->size = 1; b->size = 2; return
13049 v->size;" must therefore return 1. This assumption is incorrect
13050 for Emacs, since it type-puns struct Lisp_Vector * with many other
13051 types. To fix this problem, this patch adds a new type struct
13052 vectorlike_header that documents the constraints on layout of vectors
13053 and pseudovectors, and helps optimizing compilers not get fooled
13054 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
13055 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
13056 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
13058 (XSETPVECTYPE): Rewrite in terms of new macro.
13059 (XSETPVECTYPESIZE): New macro, specifying both type and size.
13060 This is a bit clearer, and further avoids the possibility of
13061 undesirable aliasing.
13062 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
13063 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
13064 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
13065 since Lisp_Subr is a special case (no "next" field).
13066 (ASIZE): Now uses header.size rather than size.
13067 All previous uses of XVECTOR (foo)->size replaced to use this macro,
13068 to avoid the hassle of writing XVECTOR (foo)->header.size.
13069 (struct vectorlike_header): New type.
13070 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
13071 object, to help avoid aliasing.
13072 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
13073 (SUBRP): Likewise, since Lisp_Subr is a special case.
13074 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
13075 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
13076 (struct Lisp_Hash_Table): Combine first two members into a single
13077 struct vectorlike_header member. All uses of "size" and "next" members
13078 changed to be "header.size" and "header.next".
13079 * buffer.h (struct buffer): Likewise.
13080 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
13081 * frame.h (struct frame): Likewise.
13082 * process.h (struct Lisp_Process): Likewise.
13083 * termhooks.h (struct terminal): Likewise.
13084 * window.c (struct save_window_data, struct saved_window): Likewise.
13085 * window.h (struct window): Likewise.
13086 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
13087 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
13088 * buffer.c (init_buffer_once): Likewise.
13089 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
13091 * process.c (Fformat_network_address): Use local var for size,
13094 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
13096 Make the Lisp reader and string-to-float more consistent (Bug#8525)
13097 * data.c (atof): Remove decl; no longer used or needed.
13098 (digit_to_number): Move to lread.c.
13099 (Fstring_to_number): Use new string_to_number function, to be
13100 consistent with how the Lisp reader treats infinities and NaNs.
13101 Do not assume that floating-point numbers represent EMACS_INT
13102 without losing information; this is not true on most 64-bit hosts.
13103 Avoid double-rounding errors, by insisting on integers when
13104 parsing non-base-10 numbers, as the documentation specifies.
13105 * lisp.h (string_to_number): New decl, replacing ...
13106 (isfloat_string): Remove.
13107 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
13108 (read1): Do not accept +. and -. as integers; this
13109 appears to have been a coding error. Similarly, do not accept
13110 strings like +-1e0 as floating point numbers. Do not report
13111 overflow for integer overflows unless the base is not 10 which
13112 means we have no simple and reliable way to continue.
13113 Break out the floating-point parsing into a new
13114 function string_to_number, so that Fstring_to_number parses
13115 floating point numbers consistently with the Lisp reader.
13116 (digit_to_number): Move here from data.c. Make it static inline.
13117 (E_CHAR, EXP_INT): Remove, replacing with ...
13118 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
13119 (string_to_number): New function, replacing isfloat_string.
13120 This function checks for valid syntax and produces the resulting
13121 Lisp float number too. Rework it so that string-to-number
13122 no longer mishandles examples like "1.0e+". Use strtoumax,
13123 so that overflow for non-base-10 numbers is reported only when
13124 there's no portable and simple way to convert to floating point.
13126 * textprop.c (set_text_properties_1): Rewrite for clarity,
13127 and to avoid GCC warning about integer overflow.
13129 * intervals.h (struct interval): Use EMACS_INT for members
13130 where EMACS_UINT might cause problems. See
13131 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
13132 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
13133 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
13135 (offset_intervals): Tell GCC not to worry about length overflow
13136 when negating a negative length.
13138 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
13139 (overrun_check_free): Likewise.
13141 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
13142 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
13145 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
13146 (gnutls_make_error): Rename local to avoid shadowing.
13147 (gnutls_emacs_global_deinit): ifdef out; not used.
13148 (Fgnutls_boot): Use const for pointer to readonly storage.
13149 Comment out unused local. Fix pointer signedness problems.
13151 * lread.c (openp): Don't stuff size_t into an 'int'.
13152 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
13153 about possible signed overflow.
13155 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
13156 (GDK_KEY_g): Don't define if already defined.
13157 (xg_prepare_tooltip): Avoid pointer signedness problem.
13158 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
13160 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
13161 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
13163 * xfns.c (Fx_window_property): Simplify a bit,
13164 to make a bit faster and to avoid GCC 4.6.0 warning.
13165 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
13167 * fns.c (internal_equal): Don't assume size_t fits in int.
13169 * alloc.c (compact_small_strings): Tighten assertion a little.
13171 Replace pEd with more-general pI, and fix some printf arg casts.
13172 * lisp.h (pI): New macro, generalizing old pEd macro to other
13173 conversion specifiers. For example, use "...%"pI"d..." rather
13174 than "...%"pEd"...".
13175 (pEd): Remove. All uses replaced with similar uses of pI.
13176 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
13177 * alloc.c (check_pure_size): Don't overflow by converting size to int.
13178 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
13179 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
13180 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
13181 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
13182 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
13184 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
13185 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
13186 * print.c (safe_debug_print, print_object): Likewise.
13187 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
13189 Use pI instead of if-then-else-abort. Use %p to avoid casts,
13190 avoiding the 0 flag, which is not portable.
13191 * process.c (Fmake_network_process): Use pI to avoid cast.
13192 * region-cache.c (pp_cache): Likewise.
13193 * xdisp.c (decode_mode_spec): Likewise.
13194 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
13195 behavior on 64-bit hosts with printf arg.
13196 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
13197 (x_stop_queuing_selection_requests): Likewise.
13198 (x_get_window_property): Don't truncate byte count to an 'int'
13201 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
13202 here, since it parses constructs like leading '-' and spaces,
13203 which are not wanted; and it overflows with large numbers.
13204 Instead, simply match F[0-9]+, which is what is wanted anyway.
13206 * alloc.c: Remove unportable assumptions about struct layout.
13207 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
13208 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
13209 (allocate_vectorlike, make_pure_vector): Use the new macros,
13210 plus offsetof, to remove unportable assumptions about struct layout.
13211 These assumptions hold on all porting targets that I know of, but
13212 they are not guaranteed, they're easy to remove, and removing them
13213 makes further changes easier.
13215 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
13216 This doesn't fix a bug but makes the code clearer.
13217 (string_overrun_cookie): Now const. Use initializers that
13218 don't formally overflow signed char, to avoid warnings.
13219 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
13220 can cause Emacs to crash when string overrun checking is enabled.
13221 (allocate_buffer): Don't assume sizeof (struct buffer) is a
13222 multiple of sizeof (EMACS_INT); it need not be, if
13223 alignof(EMACS_INT) < sizeof (EMACS_INT).
13224 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
13226 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
13228 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
13230 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
13232 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
13233 supposed to be handshaking. (Bug#8556)
13234 Reported by Paul Eggert <eggert@cs.ucla.edu>.
13236 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
13238 * lisp.h (Qdebug): List symbol.
13239 * eval.c (Qdebug): Restore global linkage.
13240 * keyboard.c (debug-on-event): New variable.
13241 (handle_user_signal): Break into debugger when debug-on-event
13242 matches the current signal symbol.
13244 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
13246 * alloc.c (check_sblock, check_string_bytes)
13247 (check_string_free_list): Convert to standard C.
13249 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
13251 * w32.c (emacs_gnutls_push): Fix typo.
13253 2011-04-25 Eli Zaretskii <eliz@gnu.org>
13255 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
13256 "cast to pointer from integer of different size".
13258 Improve doprnt and its use in verror. (Bug#8545)
13259 * doprnt.c (doprnt): Document the set of format control sequences
13260 supported by the function. Use SAFE_ALLOCA instead of always
13263 * eval.c (verror): Don't limit the buffer size at size_max-1, that
13264 is one byte too soon. Don't use xrealloc; instead xfree and
13267 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
13269 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
13272 * gnutls.c: Renamed global_initialized to
13273 gnutls_global_initialized. Added internals for the
13274 :verify-hostname-error, :verify-error, and :verify-flags
13275 parameters of `gnutls-boot' and documented those parameters in the
13276 docstring. Start callback support.
13277 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
13278 unless a fatal error occurred. Call gnutls_alert_send_appropriate
13279 on error. Return error code.
13280 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
13281 (emacs_gnutls_read): Likewise.
13282 (Fgnutls_boot): Return handshake error code.
13283 (emacs_gnutls_handle_error): New function.
13284 (wsaerror_to_errno): Likewise.
13286 * w32.h (emacs_gnutls_pull): Add prototype.
13287 (emacs_gnutls_push): Likewise.
13289 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
13290 (emacs_gnutls_push): Likewise.
13292 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
13294 * process.c (wait_reading_process_output): Check if GnuTLS
13295 buffered some data internally if no FDs are set for TLS
13298 * makefile.w32-in (OBJ2): Add gnutls.$(O).
13299 (LIBS): Link to USER_LIBS.
13300 ($(BLD)/gnutls.$(0)): New target.
13302 2011-04-24 Eli Zaretskii <eliz@gnu.org>
13304 * xdisp.c (handle_single_display_spec): Rename the
13305 display_replaced_before_p argument into display_replaced_p, to
13306 make it consistent with the commentary. Fix typos in the
13309 * textprop.c (syms_of_textprop): Remove dead code.
13310 (copy_text_properties): Delete obsolete commentary about an
13311 interface that was deleted long ago. Fix typos in the description
13314 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
13315 to changes in oldXMenu/XMenu.h from 2011-04-16.
13316 <menu_help_message, prev_menu_help_message>: Constify.
13317 (IT_menu_make_room): menu->help_text is now `const char **';
13320 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
13321 to changes in oldXMenu/XMenu.h from 2011-04-16.
13322 (struct XMenu): Declare `help_text' `const char **'.
13324 * xfaces.c <Qunspecified>: Make extern again.
13326 * syntax.c: Include sys/types.h before including regex.h, as
13329 * doc.c (get_doc_string): Improve the format passed to `error'.
13331 * doprnt.c (doprnt): Improve commentary.
13333 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
13335 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
13338 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
13339 changes in globals.h immediately force recompilation.
13340 (TAGS): Depend on $(CURDIR)/m/intel386.h and
13341 $(CURDIR)/s/ms-w32.h.
13342 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
13344 * character.c (Fchar_direction): Function deleted.
13345 (syms_of_character): Don't defsubr it.
13346 <char-direction-table>: Deleted.
13348 2011-04-23 Eli Zaretskii <eliz@gnu.org>
13350 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
13351 * doprnt.c: Include limits.h.
13352 (SIZE_MAX): New macro.
13353 (doprnt): Return a size_t value. 2nd arg is now size_t.
13354 Many local variables are now size_t instead of int or unsigned.
13355 Improve overflow protection. Support `l' modifier for integer
13356 conversions. Support %l conversion. Don't assume an EMACS_INT
13357 argument for integer conversions and for %c.
13359 * lisp.h (doprnt): Restore prototype.
13361 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
13362 $(SRC)/character.h.
13364 * Makefile.in (base_obj): Add back doprnt.o.
13366 * deps.mk (doprnt.o): Add back prerequisites.
13367 (callint.o): Depend on character.h.
13369 * eval.c (internal_lisp_condition_case): Include the handler
13370 representation in the error message.
13371 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
13372 when breaking from the loop.
13374 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
13376 * callint.c (Fcall_interactively): When displaying error message
13377 about invalid control letter, pass the character's codepoint, not
13378 a pointer to its multibyte form. Improve display of the character
13379 in octal and display also its hex code.
13381 * character.c (char_string): Use %x to display the (unsigned)
13382 codepoint of an invalid character, to avoid displaying a bogus
13385 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
13386 `error', not SYMBOL_NAME itself.
13388 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
13389 character arguments to `error'.
13391 * charset.c (check_iso_charset_parameter): Fix incorrect argument
13392 to `error' in error message about FINAL_CHAR argument. Make sure
13393 FINAL_CHAR is a character, and use %c when it is passed as
13394 argument to `error'.
13396 2011-04-23 Eli Zaretskii <eliz@gnu.org>
13398 * s/ms-w32.h (localtime): Redirect to sys_localtime.
13400 * w32.c: Include <time.h>.
13401 (sys_localtime): New function.
13403 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
13405 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
13407 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
13409 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
13411 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
13412 zombies (Bug#8467).
13414 2011-04-19 Eli Zaretskii <eliz@gnu.org>
13416 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
13417 gl_state.e_property when gl_state.object is Qt.
13419 * insdel.c (make_gap_larger): Remove limitation of buffer size
13422 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
13424 * xdisp.c (lookup_glyphless_char_display)
13425 (produce_glyphless_glyph): Handle cons cell entry in
13426 glyphless-char-display.
13427 (Vglyphless_char_display): Document it.
13429 * term.c (produce_glyphless_glyph): Handle cons cell entry in
13430 glyphless-char-display.
13432 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
13434 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
13436 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
13438 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
13439 definition for no-X builds.
13441 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
13443 Static checks with GCC 4.6.0 and non-default toolkits.
13445 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
13447 * process.c (keyboard_bit_set): Define only if SIGIO.
13448 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
13449 (send_process): Repair possible setjmp clobbering.
13451 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
13453 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
13455 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
13457 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
13458 Define only if needed.
13460 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
13461 by pacifying GCC about it. Maybe it's time to retire it?
13462 * xfaces.c (USG, __TIMEVAL__): Likewise.
13464 * dispextern.h (struct redisplay_interface): Rename param
13465 to avoid shadowing.
13466 * termhooks.h (struct terminal): Likewise.
13467 * xterm.c (xembed_send_message): Likewise.
13469 * insdel.c (make_gap_smaller): Define only if
13470 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
13472 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
13475 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
13476 so that we aren't warned about unused symbols.
13478 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
13480 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
13482 * xfns.c (x_real_positions): Mark locals as initialized.
13484 * xmenu.c (xmenu_show): Don't use uninitialized vars.
13486 * xterm.c: Fix problems found by static analysis with other toolkits.
13487 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
13488 (x_dispatch_event): Declare static if USE_GTK, and
13489 define if USE_GTK || USE_X_TOOLKIT.
13490 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
13491 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
13492 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
13493 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
13495 * xmenu.c (menu_help_callback): Pointer type fixes.
13496 Use const pointers when pointing at readonly data. Avoid pointer
13497 signedness clashes.
13498 (FALSE): Remove unused macro.
13499 (update_frame_menubar): Remove unused decl.
13501 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
13503 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
13504 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
13505 (single_menu_item): Rename local to avoid shadowing.
13507 * keyboard.c (make_lispy_event): Remove unused local var.
13509 * frame.c, frame.h (x_get_resource_string): Bring this back, but
13510 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
13512 * bitmaps: Change bitmaps from unsigned char back to the X11
13513 compatible char. Avoid the old compiler warnings about
13514 out-of-range initializers by using, for example, '\xab' rather
13517 * xgselect.c (xgselect_initialize): Check vs interface
13518 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
13520 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
13522 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
13523 to read-only memory.
13525 * fns.c (vector): Remove; this old hack is no longer needed.
13527 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
13529 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
13531 * xrdb.c (x_load_resources): Omit unused local.
13533 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
13534 (x_window): Rename locals to avoid shadowing.
13535 (USG): Use the kludged USG macro, to pacify gcc.
13537 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
13538 (x_term_init): Remove local to avoid shadowing.
13540 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
13542 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
13543 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
13545 2011-04-16 Eli Zaretskii <eliz@gnu.org>
13547 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
13549 Fix regex.c, syntax.c and friends for buffers > 2GB.
13550 * syntax.h (struct gl_state_s): Declare character position members
13553 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
13555 * textprop.c (verify_interval_modification, interval_of):
13556 Declare arguments EMACS_INT.
13558 * intervals.c (adjust_intervals_for_insertion): Declare arguments
13561 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
13563 * indent.c (Fvertical_motion): Local variable it_start is now
13566 * regex.c (re_match, re_match_2, re_match_2_internal)
13567 (bcmp_translate, regcomp, regexec, print_double_string)
13568 (group_in_compile_stack, re_search, re_search_2, regex_compile)
13569 (re_compile_pattern, re_exec): Declare arguments and local
13570 variables `size_t' and `ssize_t' and return values `regoff_t', as
13572 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
13573 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
13574 <compile_stack_type>: `size' and `avail' are now `size_t'.
13576 * regex.h <regoff_t>: Use ssize_t, not int.
13577 (re_search, re_search_2, re_match, re_match_2): Arguments that
13578 specify buffer/string position and length are now ssize_t and
13579 size_t. Return type is regoff_t.
13581 2011-04-16 Ben Key <bkey76@gmail.com>
13583 * nsfont.m: Fixed bugs in ns_get_family and
13584 ns_descriptor_to_entity that were caused by using free to
13585 deallocate memory blocks that were allocated by xmalloc (via
13586 xstrdup). This caused Emacs to crash when compiled with
13587 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
13588 --enable-checking=xmallocoverrun). xfree is now used to
13589 deallocate these memory blocks.
13591 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
13593 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
13595 emacs_write: Accept and return EMACS_INT for sizes.
13596 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
13598 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
13599 Accept and return EMACS_INT.
13600 (emacs_gnutls_write): Return the number of bytes written on
13602 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
13603 (emacs_read, emacs_write): Remove check for negative size, as the
13604 Emacs source code has been audited now.
13605 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
13606 (emacs_read, emacs_write): Use it.
13607 * process.c (send_process): Adjust to the new signatures of
13608 emacs_write and emacs_gnutls_write. Do not attempt to store
13609 a byte offset into an 'int'; it might overflow.
13610 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
13612 * sound.c: Don't assume sizes fit in 'int'.
13613 (struct sound_device.period_size, alsa_period_size):
13614 Return EMACS_INT, not int.
13615 (struct sound_device.write, vox_write, alsa_write):
13616 Accept EMACS_INT, not int.
13617 (wav_play, au_play): Use EMACS_INT to store sizes and to
13618 record read return values.
13620 2011-04-15 Ben Key <bkey76@gmail.com>
13622 * keyboard.c (Qundefined): Don't declare static since it is used
13624 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
13625 static since they are used in nsfont.m.
13627 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
13629 * process.c (Qprocessp): Don't declare static.
13630 * lisp.h (Qprocessp): Declare again.
13632 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
13634 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
13636 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
13638 Improve C-level modularity by making more things 'static'.
13640 Don't publish debugger-only interfaces to other modules.
13641 * lisp.h (safe_debug_print, debug_output_compilation_hack):
13642 (verify_bytepos, count_markers): Move decls to the only modules
13644 * region-cache.h (pp_cache): Likewise.
13645 * window.h (check_all_windows): Likewise.
13646 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
13648 * sysdep.c (croak): Now static, if
13649 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
13650 * syssignal.h (croak): Declare only if not static.
13652 * alloc.c (refill_memory_reserve): Now static if
13653 !defined REL_ALLOC || defined SYSTEM_MALLOC.
13654 * lisp.h (refill_memory_reserve): Declare only if not static.
13656 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
13657 Define only if USE_LUCID.
13659 * xrdb.c (x_customization_string, x_rm_string): Now static.
13661 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
13662 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
13664 * xdisp.c (draw_row_with_mouse_face): Now static.
13665 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
13667 * window.h (check_all_windows): Mark externally visible.
13669 * window.c (window_deletion_count): Now static.
13671 * undo.c: Make symbols static if they're not exported.
13672 (last_undo_buffer, last_boundary_position, pending_boundary):
13675 * textprop.c (interval_insert_behind_hooks): Now static.
13676 (interval_insert_in_front_hooks): Likewise.
13678 * term.c: Make symbols static if they're not exported.
13679 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
13680 (max_frame_lines, tty_set_terminal_modes):
13681 (tty_reset_terminal_modes, tty_turn_off_highlight):
13682 (get_tty_terminal): Now static.
13683 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
13684 * termhooks.h (term_mouse_moveto): Do not declare if
13685 HAVE_WINDOW_SYSTEM.
13686 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
13687 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
13689 * sysdep.c: Make symbols static if they're not exported.
13690 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
13692 (sigprocmask_set, full_mask): Remove; unused.
13693 (wait_debugging): Mark as visible.
13694 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
13695 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
13697 * syntax.c (syntax_temp): Define only if !__GNUC__.
13699 * sound.c (current_sound_device, current_sound): Now static.
13701 * search.c (searchbufs, searchbuf_head): Now static.
13703 * scroll.c (scroll_cost): Remove; unused.
13704 * dispextern.h (scroll_cost): Remove decl.
13706 * region-cache.h (pp_cache): Mark as externally visible.
13708 * process.c: Make symbols static if they're not exported.
13709 (process_tick, update_tick, create_process, chan_process):
13710 (Vprocess_alist, proc_buffered_char, datagram_access):
13711 (fd_callback_data, send_process_frame, process_sent_to): Now static.
13712 (deactivate_process): Mark defn as static, as well as decl.
13713 * lisp.h (create_process): Remove decl.
13714 * process.h (chan_process, Vprocess_alist): Remove decls.
13716 * print.c: Make symbols static if they're not exported.
13717 (print_depth, new_backquote_output, being_printed, print_buffer):
13718 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
13719 (print_interval, print_number_index, initial_stderr_stream):
13721 * lisp.h (Fprinc): Remove decl.
13722 (debug_output_compilation_hack): Mark as externally visible.
13724 * sysdep.c (croak): Move decl from here to syssignal.h.
13725 * syssignal.h (croak): Put it here, so the API can be checked when
13726 'croak' is called from dissociate_if_controlling_tty.
13728 * minibuf.c: Make symbols static if they're not exported.
13729 (minibuf_save_list, choose_minibuf_frame): Now static.
13730 * lisp.h (choose_minibuf_frame): Remove decl.
13732 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
13734 * lread.c: Make symbols static if they're not exported.
13735 (read_objects, initial_obarray, oblookup_last_bucket_number):
13737 (make_symbol): Remove; unused.
13738 * lisp.h (initial_obarray, make_symbol): Remove decls.
13740 * keyboard.c: Make symbols static if they're not exported.
13741 (single_kboard, recent_keys_index, total_keys, recent_keys):
13742 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
13743 (this_single_command_key_start, echoing, last_auto_save):
13744 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
13745 (command_loop, echo_now, keyboard_init_hook, help_char_p):
13746 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
13747 (Vlispy_mouse_stem, double_click_count):
13749 (force_auto_save_soon): Define only if SIGDANGER.
13750 (ignore_mouse_drag_p): Now static if
13751 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
13752 (print_help): Remove; unused.
13753 (stop_character, last_timer_event): Mark as externally visible.
13754 * keyboard.h (ignore_mouse_drag_p): Declare only if
13755 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
13756 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
13757 * lisp.h (echoing): Remove decl.
13758 (force_auto_save_soon): Declare only if SIGDANGER.
13759 * xdisp.c (redisplay_window): Simplify code, to make it more
13760 obvious that ignore_mouse_drag_p is not accessed if !defined
13761 USE_GTK && !defined HAVE_NS.
13763 * intervals.c: Make symbols static if they're not exported.
13764 (merge_properties_sticky, merge_interval_right, delete_interval):
13766 * intervals.h (merge_interval_right, delete_interval): Remove decls.
13768 * insdel.c: Make symbols static if they're not exported.
13769 However, leave prepare_to_modify_buffer alone. It's never
13770 called from outside this function, but that appears to be a bug.
13771 (combine_after_change_list, combine_after_change_buffer):
13772 (adjust_after_replace, signal_before_change): Now static.
13773 (adjust_after_replace_noundo): Remove; unused.
13774 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
13775 (signal_before_change): Remove decls.
13777 * indent.c (val_compute_motion, val_vmotion): Now static.
13779 * image.c: Make symbols static if they're not exported.
13780 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
13782 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
13783 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
13785 * fringe.c (standard_bitmaps): Now static.
13786 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
13788 * frame.c: Make symbols static if they're not exported.
13789 (x_report_frame_params, make_terminal_frame): Now static.
13790 (get_frame_param): Now static, unless HAVE_NS.
13791 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
13792 (x_get_resource_string): Remove; not used.
13793 * frame.h (make_terminal_frame, x_report_frame_params):
13794 (x_get_resource_string); Remove decls.
13795 (x_fullscreen_adjust): Declare only if WINDOWSNT.
13796 * lisp.h (get_frame_param): Declare only if HAVE_NS.
13798 * font.c, fontset.c: Make symbols static if they're not exported.
13799 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
13800 (FACE_SUITABLE_FOR_CHAR_P): Use it.
13801 * font.c (font_close_object): Now static.
13802 * font.h (font_close_object): Remove.
13803 * fontset.c (FONTSET_OBJLIST): Remove.
13804 (free_realized_fontset) #if-0 the body, which does nothing.
13805 (face_suitable_for_char_p): #if-0, as it's never called.
13806 * fontset.h (face_suitable_for_char_p): Remove decl.
13807 * xfaces.c (face_at_string_position):
13808 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
13809 since 0 is always ASCII.
13811 * fns.c (weak_hash_tables): Now static.
13813 * fileio.c: Make symbols static if they're not exported.
13814 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
13815 (Vwrite_region_annotation_buffers): Now static.
13817 * eval.c: Make symbols static if they're not exported.
13818 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
13819 * lisp.h (backtrace_list): Remove decl.
13821 * emacs.c: Make symbols static if they're not exported.
13822 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
13823 (fatal_error_code, fatal_error_signal_hook, standard_args):
13825 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
13826 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
13827 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
13828 * lisp.h (fatal_error_signal_hook): Remove decl.
13829 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
13831 * editfns.c: Move a (normally-unused) function to its only use.
13832 * editfns.c, lisp.h (get_operating_system_release): Remove.
13833 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
13834 worth the hassle of breaking this out.
13836 * xterm.c: Make symbols static if they're not exported.
13837 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
13838 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
13839 (x_destroy_window, x_delete_display):
13841 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
13842 (x_mouse_leave): Remove; unused.
13843 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
13844 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
13845 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
13847 (x_mouse_leave): Declare only if WINDOWSNT.
13848 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
13849 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
13852 * ftxfont.c: Make symbols static if they're not exported.
13853 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
13855 * font.h (ftxfont_driver): Likewise.
13857 * xfns.c: Make symbols static if they're not exported.
13858 (x_last_font_name, x_display_info_for_name):
13859 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
13860 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
13861 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
13862 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
13863 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
13864 (last_show_tip_args): Now static.
13865 (xic_defaut_fontset, xic_create_fontsetname): Define only if
13866 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
13867 (x_screen_planes): Remove; unused.
13868 * dispextern.h (x_screen_planes): Remove decl.
13870 * dispnew.c: Make symbols static if they're not exported.
13871 * dispextern.h (redraw_garbaged_frames, scrolling):
13872 (increment_row_positions): Remove.
13873 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
13874 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
13876 (redraw_garbaged_frames): Remove; unused.
13878 * xfaces.c: Make symbols static if they're not exported.
13879 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
13881 * xterm.h (defined_color): Remove decls.
13882 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
13883 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
13884 (menu_face_changed_default, defined_color, free_realized_face):
13885 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
13886 (ascii_face_of_lisp_face): Remove; unused.
13888 * xdisp.c: Make symbols static if they're not exported.
13889 * dispextern.h (scratch_glyph_row, window_box_edges):
13890 (glyph_to_pixel_coords, set_cursor_from_row):
13891 (get_next_display_element, set_iterator_to_next):
13892 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
13893 (show_mouse_face): Remove decls
13894 * frame.h (message_buf_print): Likewise.
13895 * lisp.h (pop_message, set_message, check_point_in_composition):
13897 * xterm.h (set_vertical_scroll_bar): Likewise.
13898 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
13899 (message_buf_print, scratch_glyph_row, displayed_buffer):
13900 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
13901 (get_next_display_element, show_mouse_face, window_box_edges):
13902 (frame_to_window_pixel_xy, check_point_in_composition):
13903 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
13904 (glyph_to_pixel_coords): Remove; unused.
13906 * dired.c (file_name_completion): Now static.
13908 * dbusbind.c (xd_in_read_queued_messages): Now static.
13910 * lisp.h (circular_list_error, FOREACH): Remove; unused.
13911 * data.c (circular_list_error): Remove.
13913 * commands.h (last_point_position, last_point_position_buffer):
13914 (last_point_position_window): Remove decls.
13915 * keyboard.c: Make these variables static.
13917 * coding.h (coding, code_convert_region, encode_coding_gap):
13919 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
13920 (iso_code_class, detect_coding, code_convert_region): Now static.
13921 (encode_coding_gap): Remove; unused.
13923 * chartab.c (chartab_chars, chartab_bits): Now static.
13925 * charset.h (charset_iso_8859_1): Remove decl.
13926 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
13929 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
13930 * ccl.c (Vccl_program_table): Now static.
13931 (check_ccl_update): Remove; unused.
13933 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
13934 * category.h: ... from here.
13935 * category.c (check_category_table, set_category_set): Now static.
13937 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
13938 * lisp.h: Remove these decls.
13940 * buffer.c (buffer_count): Remove unused var.
13942 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
13943 so that it's not optimized away.
13944 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
13945 * dispextern.h (bidi_dump_cached_states): Remove, since it's
13946 exported only to the debugger.
13948 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
13949 * atimer.h (run_all_atimers): Remove; not exported.
13951 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
13952 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
13953 was inaccessible from Lisp.
13954 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
13955 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
13957 alloc.c: Import and export fewer symbols, and remove unused items.
13958 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
13960 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
13961 it's not optimized away by whole-program optimization.
13962 (message_enable_multibyte, free_misc): Remove.
13963 (catchlist, handlerlist, mark_backtrace):
13964 Declare only if BYTE_MARK_STACK.
13965 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
13966 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
13967 (message_enable_multibyte): Remove decl.
13968 (free_misc, interval_free_list, float_block, float_block_index):
13969 (n_float_blocks, float_free_list, cons_block, cons_block_index):
13970 (cons_free_list, last_marked_index):
13972 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
13973 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
13974 (mark_backtrace): Define only if BYTE_MARK_STACK.
13975 * xdisp.c (message_enable_multibyte): Now static.
13977 Declare Lisp_Object Q* variables to be 'static' if not exported.
13978 This makes it easier for human readers (and static analyzers)
13979 to see whether these variables are used from other modules.
13980 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
13981 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
13982 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
13983 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
13984 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
13985 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
13986 * xmenu.c, xselect.c:
13987 Declare Q* vars static if they are not used in other modules.
13988 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
13989 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
13990 Remove decls of unexported vars.
13991 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
13993 * lisp.h (DEFINE_FUNC): Make sname 'static'.
13995 Make Emacs functions such as Fatom 'static' by default.
13996 This makes it easier for human readers (and static analyzers)
13997 to see whether these functions can be called from other modules.
13998 DEFUN now defines a static function. To make the function external
13999 so that it can be used in other C modules, use the new macro DEFUE.
14000 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
14001 (Finit_image_library):
14002 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
14003 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
14004 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
14005 Remove decls, since these functions are now static.
14006 (Funintern, Fget_internal_run_time): New decls, since these functions
14007 were already external.
14009 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
14010 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
14011 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
14012 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
14013 * keyboard.c, keymap.c, lread.c:
14014 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
14015 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
14016 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
14017 Mark functions with DEFUE instead of DEFUN,
14018 if they are used in other modules.
14019 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
14020 decls for now-static functions.
14021 * buffer.h (Fdelete_overlay): Remove decl.
14022 * callproc.c (Fgetenv_internal): Mark as internal.
14023 * composite.c (Fremove_list_of_text_properties): Remove decl.
14024 (Fcomposition_get_gstring): New forward static decl.
14025 * composite.h (Fcomposite_get_gstring): Remove decl.
14026 * dired.c (Ffile_attributes): New forward static decl.
14027 * doc.c (Fdocumntation_property): New forward static decl.
14028 * eval.c (Ffetch_bytecode): New forward static decl.
14029 (Funintern): Remove extern decl; now in .h file where it belongs.
14030 * fileio.c (Fmake_symbolic_link): New forward static decl.
14031 * image.c (Finit_image_library): New forward static decl.
14032 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
14033 * intervals.h (Fprevious_property_change):
14034 (Fremove_list_of_text_properties): Remove decls.
14035 * keyboard.c (Fthis_command_keys): Remove decl.
14036 (Fcommand_execute): New forward static decl.
14037 * keymap.c (Flookup_key): New forward static decl.
14038 (Fcopy_keymap): Now static.
14039 * keymap.h (Flookup_key): Remove decl.
14040 * process.c (Fget_process): New forward static decl.
14041 (Fprocess_datagram_address): Mark as internal.
14042 * syntax.c (Fsyntax_table_p): New forward static decl.
14043 (skip_chars): Remove duplicate decl.
14044 * textprop.c (Fprevious_property_change): New forward static decl.
14045 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
14047 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
14048 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
14050 * editfns.c (Fformat): Remove unreachable code.
14052 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
14054 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
14057 2011-04-13 Eli Zaretskii <eliz@gnu.org>
14059 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
14060 when at ZV. (Bug#8487)
14062 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
14064 * charset.c (Fclear_charset_maps): Use xfree instead of free.
14066 * keyboard.c (parse_tool_bar_item): Likewise.
14067 * sound.c (sound_cleanup, alsa_close): Likewise.
14068 * termcap.c (tgetent): Likewise.
14069 * xfns.c (x_default_font_parameter): Likewise.
14070 * xsettings.c (read_and_apply_settings): Likewise.
14072 * alloc.c (overrun_check_malloc, overrun_check_realloc)
14073 (overrun_check_free): Protoize.
14075 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
14077 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
14078 since callers should never pass a negative size.
14079 Change the signature to match that of plain 'read' and 'write'; see
14080 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
14081 * lisp.h: Update prototypes of emacs_write and emacs_read.
14083 2011-04-11 Eli Zaretskii <eliz@gnu.org>
14085 * xdisp.c (redisplay_window): Don't try to determine the character
14086 position of the scroll margin if the window start point w->startp
14087 is outside the buffer's accessible region. (Bug#8468)
14089 2011-04-10 Eli Zaretskii <eliz@gnu.org>
14091 Fix write-region and its subroutines for buffers > 2GB.
14092 * fileio.c (a_write, e_write): Modify declaration of arguments and
14093 local variables to support buffers larger than 2GB.
14094 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
14096 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
14097 argument, local variables, and return value.
14099 * lisp.h: Update prototypes of emacs_write and emacs_read.
14101 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
14103 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
14105 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
14107 Fix more problems found by GCC 4.6.0's static checks.
14109 * xdisp.c (vmessage): Use a better test for character truncation.
14111 * charset.c (load_charset_map): <, not <=, for optimization,
14112 and to avoid potential problems with integer overflow.
14113 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
14114 * casetab.c (set_identity, shuffle): Likewise.
14115 * editfns.c (Fformat): Likewise.
14116 * syntax.c (skip_chars): Likewise.
14118 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
14119 This also lets GCC 4.6.0 generate slightly better loop code.
14121 * callint.c (Fcall_interactively): <, not <=, for optimization.
14122 (Fcall_interactively): Count the number of arguments produced,
14123 not the number of arguments given. This is simpler and lets GCC
14124 4.6.0 generate slightly better code.
14126 * ftfont.c: Distingish more carefully between FcChar8 and char.
14127 The previous code passed unsigned char * to a functions like
14128 strlen and xstrcasecmp that expect char *, which does not
14129 conform to the C standard.
14130 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
14131 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
14132 char * when the C standard requires it.
14134 * keyboard.c (read_char): Remove unused var.
14136 * eval.c: Port to Windows vsnprintf (Bug#8435).
14137 Include <limits.h>.
14138 (SIZE_MAX): Define if the headers do not.
14139 (verror): Do not give up if vsnprintf returns a negative count.
14140 Instead, grow the buffer. This ports to Windows vsnprintf, which
14141 does not conform to C99. Problem reported by Eli Zaretskii.
14142 Also, simplify the allocation scheme, by avoiding the need for
14143 calling realloc, and removing the ALLOCATED variable.
14145 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
14147 Remove invocations of doprnt, as Emacs now uses vsnprintf.
14148 But keep the doprint source code for now, as we might revamp it
14149 and use it again (Bug#8435).
14150 * lisp.h (doprnt): Remove.
14151 * Makefile.in (base_obj): Remove doprnt.o.
14152 * deps.mk (doprnt.o): Remove.
14154 error: Print 32- and 64-bit integers portably (Bug#8435).
14155 Without this change, on typical 64-bit hosts error ("...%d...", N)
14156 was used to print both 32- and 64-bit integers N, which relied on
14157 undefined behavior.
14158 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
14159 * lisp.h (error, verror): Mark as printf-like functions.
14160 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
14161 Report overflow in size calculations when allocating printf buffer.
14162 Do not truncate output string at its first null byte.
14163 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
14164 Truncate the output at a character boundary, since vsnprintf does not
14166 * charset.c (check_iso_charset_parameter): Convert internal
14167 character to string before calling 'error', since %c now has the
14169 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
14170 overflow when computing char to be passed to 'error'. Do not
14171 pass Lisp_Object to 'error'; pass the integer instead.
14172 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
14173 formatted with plain %d.
14175 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
14177 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
14179 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
14181 * xterm.c (x_catch_errors): Remove duplicate declaration.
14183 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
14185 * xdisp.c, lisp.h (message_nolog): Remove; unused.
14187 2011-04-10 Jim Meyering <meyering@redhat.com>
14189 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
14190 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
14191 return ssize_t not "int", and use size_t as the buffer length.
14192 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
14193 * gnutls.h: Update declarations.
14194 * process.c (read_process_output): Use ssize_t, to match.
14195 (send_process): Likewise.
14197 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
14199 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
14201 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
14203 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
14204 Use unsigned char, to match FcChar8 type definition.
14206 * xterm.c (handle_one_xevent):
14207 * xmenu.c (create_and_show_popup_menu):
14208 * xselect.c (x_decline_selection_request)
14209 (x_reply_selection_request): Avoid type-punned deref of X events.
14211 2011-04-09 Eli Zaretskii <eliz@gnu.org>
14213 Fix some uses of `int' instead of EMACS_INT.
14214 * search.c (string_match_1, fast_string_match)
14215 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
14216 (scan_buffer, find_next_newline_no_quit)
14217 (find_before_next_newline, search_command, Freplace_match)
14218 (Fmatch_data): Make some `int' variables be EMACS_INT.
14220 * xdisp.c (display_count_lines): 3rd argument and return value now
14221 EMACS_INT. All callers changed.
14222 (pint2hrstr): Last argument is now EMACS_INT.
14224 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
14225 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
14226 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
14227 (decode_coding_utf_16, decode_coding_emacs_mule)
14228 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
14229 (decode_coding_ccl, decode_coding_charset)
14230 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
14231 (decode_coding_iso_2022, decode_coding_emacs_mule)
14232 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
14233 <char_offset, last_offset>: Declare EMACS_INT.
14234 (encode_coding_utf_8, encode_coding_utf_16)
14235 (encode_coding_emacs_mule, encode_invocation_designation)
14236 (encode_designation_at_bol, encode_coding_iso_2022)
14237 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
14238 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
14240 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
14241 (encode_invocation_designation): Last argument P_NCHARS is now
14243 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
14244 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
14246 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
14249 * ccl.c (Fccl_execute_on_string): Declare some variables
14252 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
14254 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
14256 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
14258 * process.c (Fformat_network_address): Doc fix.
14260 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
14262 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
14264 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
14266 * keyboard.c (read_char): Call Lisp function help-form-show,
14267 instead of using internal_with_output_to_temp_buffer.
14268 (Qhelp_form_show): New var.
14269 (syms_of_keyboard): Use DEFSYM macro.
14271 * print.c (internal_with_output_to_temp_buffer): Function deleted.
14273 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
14275 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
14277 * process.c (Flist_processes): Remove to Lisp.
14278 (list_processes_1): Delete.
14280 2011-04-06 Eli Zaretskii <eliz@gnu.org>
14282 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
14284 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
14286 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
14288 Fix more problems found by GCC 4.6.0's static checks.
14290 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
14292 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
14294 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
14296 * xdisp.c (vmessage): Mark as a printf-like function.
14298 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
14300 * sound.c (sound_warning): Don't crash if arg contains a printf format.
14302 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
14303 printf-like functions.
14304 (tiff_load): Add casts to remove these marks before passing them
14305 to system-supplied API.
14307 * eval.c (Fsignal): Remove excess argument to 'fatal'.
14309 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
14310 This avoids several warnings with gcc -Wstrict-overflow.
14311 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
14312 directly, rather than having caller test rule sign. This avoids
14313 some unnecessary tests.
14314 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
14315 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
14316 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
14318 * xfont.c (xfont_text_extents): Remove var that was set but not used.
14319 (xfont_open): Avoid unnecessary tests.
14321 * composite.c (composition_gstring_put_cache): Use unsigned integer.
14323 * composite.h, composite.c (composition_gstring_put_cache):
14324 Use EMACS_INT, not int, for length.
14326 * composite.h (COMPOSITION_DECODE_REFS): New macro,
14327 breaking out part of COMPOSITION_DECODE_RULE.
14328 (COMPOSITION_DECODE_RULE): Use it.
14329 * composite.c (get_composition_id): Remove unused local vars,
14330 by using the new macro.
14332 * textprop.c (set_text_properties_1): Change while to do-while,
14333 since the condition is always true at first.
14335 * intervals.c (graft_intervals_into_buffer): Mark var as used.
14336 (interval_deletion_adjustment): Return unsigned value.
14339 * process.c (list_processes_1, create_pty, read_process_output):
14340 (exec_sentinel): Remove vars that were set but not used.
14341 (create_pty): Remove unnecessary "volatile"s.
14342 (Fnetwork_interface_info): Avoid possibility of int overflow.
14343 (read_process_output): Do adaptive read buffering even if carryover.
14344 (read_process_output): Simplify nbytes computation if buffered.
14346 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
14348 * syntax.c (scan_words): Remove var that was set but not used.
14349 (update_syntax_table): Use unsigned instead of int.
14351 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
14352 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
14353 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
14355 * print.c (print_error_message): Avoid int overflow.
14357 * font.c (font_list_entities): Redo for clarity,
14358 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
14360 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
14361 (font_score): Avoid potential overflow in diff calculation.
14363 * fns.c (substring_both): Remove var that is set but not used.
14364 (sxhash): Redo loop for clarity and to avoid wraparound warning.
14366 * eval.c (funcall_lambda): Rename local to avoid shadowing.
14368 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
14369 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
14370 can always succeed if overflow has undefined behavior.
14372 * search.c (boyer_moore, wordify): Remove vars set but not used.
14373 (wordify): Omit three unnecessary tests.
14375 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
14376 All callers changed. This avoids the need for an unused var.
14378 * casefiddle.c (casify_region): Remove var that is set but not used.
14380 * dired.c (file_name_completion): Remove var that is set but not used.
14382 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
14384 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
14385 (Finsert_file_contents): Remove unnecessary code checking fd.
14387 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
14388 Check for integer overflow on size calculations.
14390 * buffer.c (Fprevious_overlay_change): Remove var that is set
14393 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
14394 Remove vars that are set but not used.
14395 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
14396 (timer_check_2): Mark vars as initialized.
14398 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
14400 * image.c (lookup_image): Remove var that is set but not used.
14401 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
14403 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
14404 that are set but not used.
14406 * xfns.c (make_invisible_cursor): Don't return garbage
14407 if XCreateBitmapFromData fails (Bug#8410).
14409 * xselect.c (x_get_local_selection, x_handle_property_notify):
14410 Remove vars that are set but not used.
14412 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
14413 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
14415 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
14416 Remove var that is set but not used.
14417 (scroll_bar_windows_size): Now size_t, not int.
14418 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
14419 Check for overflow.
14421 * xfaces.c (realize_named_face): Remove vars that are set but not used.
14422 (map_tty_color) [!defined MSDOS]: Likewise.
14424 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
14426 * coding.c: Remove vars that are set but not used.
14427 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
14428 All callers changed.
14429 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
14430 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
14431 (decode_coding_charset): Remove vars that are set but not used.
14433 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
14434 that is set but not used.
14436 * print.c (print_object): Remove var that is set but not used.
14438 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
14439 The gnulib version avoids calling malloc in the usual case,
14440 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
14441 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
14442 * filelock.c (current_lock_owner): Likewise.
14443 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
14444 * sysdep.c: Include allocator.h, careadlinkat.h.
14445 (emacs_no_realloc_allocator): New static constant.
14446 (emacs_readlink): New function.
14447 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
14448 ../lib/careadlinkat.h.
14450 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
14452 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
14453 first non-nil return value).
14455 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
14457 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
14458 if not defined (Bug#8403).
14460 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
14462 * xdisp.c (display_count_lines): Remove parameter `start',
14463 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
14464 (get_char_face_and_encoding): Remove parameter `multibyte_p',
14465 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
14466 (fill_stretch_glyph_string): Remove parameters `row' and `area',
14467 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
14468 and thereabouts. All callers changed.
14469 (get_per_char_metric): Remove parameter `f', unused since
14470 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
14472 2011-04-02 Jim Meyering <meyering@redhat.com>
14474 do not dereference NULL upon failed strdup
14475 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
14476 (ns_get_family): Likewise.
14478 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
14480 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
14482 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
14484 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
14487 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
14489 Add lexical binding.
14491 * window.c (Ftemp_output_buffer_show): New fun.
14492 (Fsave_window_excursion):
14493 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
14495 * lread.c (lisp_file_lexically_bound_p): New function.
14496 (Fload): Bind Qlexical_binding.
14497 (readevalloop): Remove `evalfun' arg.
14498 Bind Qinternal_interpreter_environment.
14499 (Feval_buffer): Bind Qlexical_binding.
14500 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
14502 (syms_of_lread): Declare `lexical-binding'.
14504 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
14506 * keyboard.c (eval_dyn): New fun.
14507 (menu_item_eval_property): Use it.
14509 * image.c (parse_image_spec): Use Ffunctionp.
14511 * fns.c (concat, mapcar1): Accept byte-code-functions.
14513 * eval.c (Fsetq): Handle lexical vars.
14514 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
14515 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
14516 (FletX, Flet): Obey lexical binding.
14517 (Fcommandp): Handle closures.
14518 (Feval): New `lexical' arg.
14519 (eval_sub): New function extracted from Feval. Use it almost
14520 everywhere where Feval was used. Look up vars in lexical env.
14522 (Ffunctionp): Move from subr.el.
14523 (Ffuncall): Handle closures.
14524 (apply_lambda): Remove `eval_flags'.
14525 (funcall_lambda): Handle closures and new byte-code-functions.
14526 (Fspecial_variable_p): New function.
14527 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
14528 but without exporting it to Lisp.
14530 * doc.c (Fdocumentation, store_function_docstring):
14531 * data.c (Finteractive_form): Handle closures.
14533 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
14536 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
14538 (exec_byte_code): New function extracted from Fbyte_code to handle new
14539 calling convention for byte-code-functions. Add new byte-codes.
14541 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
14543 * alloc.c (Fmake_symbol): Init new `declared_special' field.
14545 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
14547 * xdisp.c (redisplay_internal): Fix prototype.
14549 2011-03-31 Eli Zaretskii <eliz@gnu.org>
14551 * xdisp.c (SCROLL_LIMIT): New macro.
14552 (try_scrolling): Use it when setting scroll_limit.
14553 Limit scrolling to 100 screen lines.
14554 (redisplay_window): Even when falling back on "recentering",
14555 position point in the window according to scroll-conservatively,
14556 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
14558 (try_scrolling): When point is above the window, allow searching
14559 as far as scroll_max, or one screenful, to compute vertical
14560 distance from PT to the scroll margin position. This prevents
14561 try_scrolling from unnecessarily failing when
14562 scroll-conservatively is set to a value slightly larger than the
14563 window height. Clean up the case of PT below the margin at bottom
14564 of window: scroll_max can no longer be INT_MAX. When aggressive
14565 scrolling is in use, don't let point enter the opposite scroll
14566 margin as result of the scroll.
14567 (syms_of_xdisp) <scroll-conservatively>: Document the
14568 threshold of 100 lines for never-recentering scrolling.
14570 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
14572 * dispextern.h (move_it_by_lines):
14573 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
14574 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
14575 (message_log_check_duplicate): Remove parameters `prev_bol' and
14576 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
14577 (redisplay_internal): Remove parameter `preserve_echo_area',
14578 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
14580 * indent.c (Fvertical_motion):
14581 * window.c (window_scroll_pixel_based, Frecenter):
14582 Don't pass `need_y_p' to `move_it_by_lines'.
14584 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
14586 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
14587 steal a few bits to be more compact.
14588 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
14589 Remove unneeded casts.
14591 * bytecode.c (Fbyte_code): CAR and CDR can GC.
14593 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
14595 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
14596 binding" message (bug#7967).
14598 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
14600 Fix more problems found by GCC 4.6.0's static checks.
14602 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
14603 Remove unused local var.
14605 * editfns.c (Fmessage_box): Remove unused local var.
14607 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
14608 (note_mode_line_or_margin_highlight, note_mouse_highlight):
14609 Omit unused local vars.
14610 * window.c (shrink_windows): Omit unused local var.
14611 * menu.c (digest_single_submenu): Omit unused local var.
14612 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
14613 Omit unused local var.
14615 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
14616 Don't assume string length fits in int.
14617 (keyremap_step, read_key_sequence): Use size_t for sizes.
14618 (read_key_sequence): Don't check last_real_key_start redundantly.
14620 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
14621 instead of alloca (Bug#8344).
14623 * eval.c (Fbacktrace): Don't assume nargs fits in int.
14624 (Fbacktrace_frame): Don't assume nframes fits in int.
14626 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
14628 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
14631 * term.c (produce_glyphless_glyph): Remove unnecessary test.
14633 * cm.c (calccost): Turn while-do into do-while, for clarity.
14635 * keyboard.c (syms_of_keyboard): Use the same style as later
14636 in this function when indexing through an array. This also
14637 works around GCC bug 48267.
14639 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
14641 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
14643 * chartab.c (sub_char_table_ref_and_range): Redo for slight
14644 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
14646 * keyboard.c, keyboard.h (num_input_events): Now size_t.
14647 This avoids undefined behavior on integer overflow, and is a bit
14648 more convenient anyway since it is compared to a size_t variable.
14650 Variadic C functions now count arguments with size_t, not int.
14651 This avoids an unnecessary limitation on 64-bit machines, which
14652 caused (substring ...) to crash on large vectors (Bug#8344).
14653 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
14654 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
14655 All variadic functions and their callers changed accordingly.
14656 (struct gcpro.nvars): Now size_t, not int. All uses changed.
14657 * data.c (arith_driver, float_arith_driver): Likewise.
14658 * editfns.c (general_insert_function): Likewise.
14659 * eval.c (struct backtrace.nargs, interactive_p)
14660 (internal_condition_case_n, run_hook_with_args, apply_lambda)
14661 (funcall_lambda, mark_backtrace): Likewise.
14662 * fns.c (concat): Likewise.
14663 * frame.c (x_set_frame_parameters): Likewise.
14664 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
14665 0 if not found, not -1. All callers changed.
14667 * alloc.c (garbage_collect): Don't assume stack size fits in int.
14668 (stack_copy_size): Now size_t, not int.
14669 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
14671 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
14673 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
14674 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
14675 All callers changed.
14677 * lisp.h (multibyte_char_to_unibyte):
14678 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
14679 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
14680 * character.h (CHAR_TO_BYTE8):
14681 * cmds.c (internal_self_insert):
14682 * editfns.c (general_insert_function):
14683 * keymap.c (push_key_description):
14684 * search.c (Freplace_match):
14685 * xdisp.c (message_dolog, set_message_1): All callers changed.
14687 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
14689 * keyboard.c (safe_run_hook_funcall): New function.
14690 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
14691 don't set the hook to nil, but remove the offending function instead.
14692 (Qcommand_hook_internal): Remove, unused.
14693 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
14694 Vcommand_hook_internal.
14696 * eval.c (enum run_hooks_condition): Remove.
14697 (funcall_nil, funcall_not): New functions.
14698 (run_hook_with_args): Call each function through a `funcall' argument.
14699 Remove `cond' argument, now redundant.
14700 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
14701 (Frun_hook_with_args_until_failure): Adjust accordingly.
14702 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
14704 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
14706 * dispextern.h (string_buffer_position): Remove declaration.
14708 * print.c (strout): Remove parameter `multibyte', unused since
14709 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
14711 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
14712 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
14713 All callers changed.
14715 * w32.c (_wsa_errlist): Use braces for struct initializers.
14717 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
14718 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
14719 All callers changed.
14720 (string_buffer_position): Likewise. Also, make static (it's never
14721 used outside xdisp.c).
14722 (cursor_row_p): Remove parameter `w', unused since
14723 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
14724 (decode_mode_spec): Remove parameter `precision', introduced during
14725 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
14726 All callers changed.
14728 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
14730 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
14732 2011-03-27 Anders Lindgren <andlind@gmail.com>
14734 * nsterm.m (ns_menu_bar_is_hidden): New variable.
14735 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
14736 (ns_update_auto_hide_menu_bar): New functions.
14737 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
14738 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
14739 ns_constrain_all_frames.
14740 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
14741 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
14743 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
14745 * nsmenu.m (runDialogAt): Remove argument to timer_check.
14747 2011-03-27 Glenn Morris <rgm@gnu.org>
14749 * syssignal.h: Replace RETSIGTYPE with void.
14750 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
14751 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
14752 Replace SIGTYPE with void everywhere.
14753 * s/usg5-4-common.h (SIGTYPE): Remove definition.
14754 * s/template.h (SIGTYPE): Remove commented out definition.
14756 2011-03-26 Eli Zaretskii <eliz@gnu.org>
14758 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
14759 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
14761 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
14763 * w32.c (read_unc_volume): Use parameter `henum', instead of
14764 global variable `wget_enum_handle'.
14766 * keymap.c (describe_vector): Remove parameters `indices' and
14767 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
14768 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
14770 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
14772 * keyboard.c (timer_check): Remove parameter `do_it_now',
14773 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
14774 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
14775 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
14777 * keyboard.c (read_char):
14778 * w32menu.c (w32_menu_display_help):
14779 * xmenu.c (show_help_event, menu_help_callback):
14780 Adjust calls to `show_help_echo'.
14782 * gtkutil.c (xg_maybe_add_timer):
14783 * keyboard.c (readable_events):
14784 * process.c (wait_reading_process_output):
14785 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
14787 * insdel.c (adjust_markers_gap_motion):
14788 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
14789 (gap_left, gap_right): Don't call it.
14791 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
14793 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
14794 incurred during fontification.
14796 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
14798 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
14799 (DEFVAR_PER_BUFFER): Don't pass it.
14801 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
14802 (scrolling_window): Don't pass it.
14804 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
14806 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
14808 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
14810 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
14811 of variables specific to SELinux and computation of `encoded_absname'.
14813 * image.c (XPutPixel): Remove unused variable `height'.
14815 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
14817 * unexw32.c (get_section_info): Remove unused variable `section'.
14819 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
14820 (system_process_attributes): Remove unused variable `sess'.
14821 (sys_read): Remove unused variable `err'.
14823 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
14824 (w32_wnd_proc): Remove unused variable `isdead'.
14825 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
14826 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
14827 (x_create_tip_frame): Remove unused variable `tem'.
14829 * w32inevt.c (w32_console_read_socket):
14830 Remove unused variable `no_events'.
14832 * w32term.c (x_draw_composite_glyph_string_foreground):
14833 Remove unused variable `width'.
14835 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
14837 * w32term.c (x_set_glyph_string_clipping):
14838 Don't pass uninitialized region to CombineRgn.
14840 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
14842 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
14843 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
14844 (Fx_close_connection): Remove unused variable `i'.
14846 * w32font.c (w32font_draw): Return number of glyphs.
14847 (w32font_open_internal): Remove unused variable `i'.
14848 (w32font_driver): Add missing initializer.
14850 * w32menu.c (utf8to16): Remove unused variable `utf16'.
14851 (fill_in_menu): Remove unused variable `items_added'.
14853 * w32term.c (last_mouse_press_frame): Remove static global variable.
14854 (w32_clip_to_row): Remove unused variable `f'.
14855 (x_delete_terminal): Remove unused variable `i'.
14857 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
14858 (NOTHING): Remove unused static global variable.
14859 (uniscribe_check_otf): Remove unused variable `table'.
14860 (uniscribe_font_driver): Add missing initializers.
14862 2011-03-23 Julien Danjou <julien@danjou.info>
14864 * term.c (Fsuspend_tty, Fresume_tty):
14865 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
14866 * window.c (temp_output_buffer_show):
14867 * insdel.c (signal_before_change):
14868 * frame.c (Fhandle_switch_frame):
14869 * fileio.c (Fdo_auto_save):
14870 * emacs.c (Fkill_emacs):
14871 * editfns.c (save_excursion_restore):
14872 * cmds.c (internal_self_insert):
14873 * callint.c (Fcall_interactively):
14874 * buffer.c (Fkill_all_local_variables):
14875 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
14877 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
14878 unconditionally since it does the check itself.
14880 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
14882 Fix more problems found by GCC 4.5.2's static checks.
14884 * coding.c (encode_coding_raw_text): Avoid unnecessary test
14885 the first time through the loop, since we know p0 < p1 then.
14886 This also avoids a gcc -Wstrict-overflow warning.
14888 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
14889 leading to a memory leak, possible in functions like
14890 load_charset_map_from_file that can allocate an unbounded number
14891 of objects (Bug#8318).
14893 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
14894 that could (at least in theory) be that large.
14896 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
14897 This is less likely to overflow, and avoids undefined behavior if
14898 overflow does occur. All callers changed. Use strtoul to scan
14899 for the unsigned long integer.
14900 (pint2hrstr): Simplify and tune code slightly.
14901 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
14903 * scroll.c (do_scrolling): Work around GCC bug 48228.
14904 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
14906 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
14907 This also avoids a warning with gcc -Wstrict-overflow.
14908 (validate_x_resource_name): Simplify count usage.
14909 This also avoids a warning with gcc -Wstrict-overflow.
14911 * fileio.c (Fcopy_file): Report error if fchown or fchmod
14914 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
14916 * process.c (Fmake_network_process): Use socklen_t, not int,
14917 where POSIX says socklen_t is required in portable programs.
14918 This fixes a porting bug on hosts like 64-bit HP-UX, where
14919 socklen_t is wider than int (Bug#8277).
14920 (Fmake_network_process, server_accept_connection):
14921 (wait_reading_process_output, read_process_output):
14924 * process.c: Rename or move locals to avoid shadowing.
14925 (list_processes_1, Fmake_network_process):
14926 (read_process_output_error_handler, exec_sentinel_error_handler):
14927 Rename or move locals.
14928 (Fmake_network_process): Define label "retry_connect" only if needed.
14929 (Fnetwork_interface_info): Fix pointer signedness.
14930 (process_send_signal): Add cast to avoid pointer signedness problem.
14931 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
14932 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
14934 Make tparam.h and terminfo.c consistent.
14935 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
14936 Include tparam.h instead, since it declares them.
14937 * cm.h (PC): Remove extern decl; tparam.h now does this.
14938 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
14939 * terminfo.c: Include tparam.h, to check interfaces.
14940 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
14941 (tparam): Adjust signature to match interface in tparam.h;
14942 this removes some undefined behavior. Check that outstring and len
14943 are zero, which they always are with Emacs.
14944 * tparam.h (PC, BC, UP): New extern decls.
14946 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
14947 (xftfont_open): Rename locals to avoid shadowing.
14949 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
14950 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
14951 (OTF_TAG_SYM): Omit macro if not needed.
14952 (ftfont_list): Remove unused local.
14953 (get_adstyle_property, ftfont_pattern_entity):
14954 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
14955 Rename locals to avoid shadowing.
14957 * xfont.c (xfont_list_family): Mark var as initialized.
14959 * xml.c (make_dom): Now static.
14961 * composite.c (composition_compute_stop_pos): Rename local to
14963 (composition_reseat_it): Remove unused locals.
14964 (find_automatic_composition, composition_adjust_point): Likewise.
14965 (composition_update_it): Mark var as initialized.
14966 (find_automatic_composition): Mark vars as initialized,
14967 with a FIXME (Bug#8290).
14969 character.h: Rename locals to avoid shadowing.
14970 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
14971 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
14972 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
14973 (BUF_DEC_POS): Be more systematic about renaming local temporaries
14974 to avoid shadowing.
14976 * textprop.c (property_change_between_p): Remove; unused.
14978 * intervals.c (interval_start_pos): Now static.
14980 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
14982 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
14983 Rename locals to avoid shadowing.
14985 * sound.c (wav_play, au_play, Fplay_sound_internal):
14986 Fix pointer signedness.
14987 (alsa_choose_format): Remove unused local var.
14988 (wav_play): Initialize a variable to 0, to prevent undefined
14989 behavior (Bug#8278).
14991 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
14993 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
14995 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
14996 clobbering (Bug#8298).
14997 * sysdep.c (sys_subshell): Likewise.
14998 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
15000 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
15001 This should get cleaned up, so that child_setup has the
15002 same signature on all platforms.
15004 * callproc.c (call_process_cleanup): Now static.
15005 (relocate_fd): Rename locals to avoid shadowing.
15007 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
15009 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
15010 not to be necessary, and produces flickering.
15012 2011-03-20 Glenn Morris <rgm@gnu.org>
15014 * config.in: Remove file.
15016 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
15018 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
15019 are now in src/globals.h.
15020 (syms_of_minibuf): Remove spurious & from previous change.
15022 2011-03-20 Leo Liu <sdl.web@gmail.com>
15024 * minibuf.c (completing-read-function): New variable.
15025 (completing-read-default): Rename from completing-read.
15026 (completing-read): Call completing-read-function.
15028 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
15030 * xfaces.c (Fx_load_color_file):
15031 Read color file from absolute filename (bug#8250).
15033 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
15035 * makefile.w32-in: Update dependencies.
15037 2011-03-17 Eli Zaretskii <eliz@gnu.org>
15039 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
15041 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
15043 Fix more problems found by GCC 4.5.2's static checks.
15045 * process.c (make_serial_process_unwind, send_process_trap):
15046 (sigchld_handler): Now static.
15048 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
15049 That way, the code declares only the vars that it needs.
15050 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
15051 * s/cygwin.h (PTY_ITERATION): Likewise.
15052 * s/darwin.h (PTY_ITERATION): Likewise.
15053 * s/gnu-linux.h (PTY_ITERATION): Likewise.
15055 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
15056 * process.c (allocate_pty): Don't declare stb unless it's needed.
15058 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
15059 (CONSTANTLIM): Remove; unused.
15060 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
15061 Define only if needed.
15063 * unexelf.c (unexec): Name an expression,
15064 to avoid gcc -Wbad-function-cast warning.
15065 Use a different way to cause a compilation error if anyone uses
15066 n rather than nn, a way that does not involve shadowing.
15067 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
15069 * deps.mk (unexalpha.o): Remove; unused.
15071 New file unexec.h, the (simple) interface for unexec (Bug#8267).
15072 * unexec.h: New file.
15073 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
15074 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
15075 Depend on unexec.h.
15076 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
15077 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
15078 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
15079 Change as necessary to match prototype in unexec.h.
15081 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
15083 (back_comment, skip_chars): Mark vars as initialized.
15085 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
15086 Rename locals to avoid shadowing.
15088 * lread.c (read1): Rewrite so as not to use empty "else".
15089 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
15091 * print.c (Fredirect_debugging_output): Fix pointer signedess.
15093 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
15094 warning when compiling print.c.
15096 * font.c (font_unparse_fcname): Abort in an "impossible" situation
15097 instead of using an uninitialized var.
15098 (font_sort_entities): Mark var as initialized.
15100 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
15102 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
15103 pointers to constants.
15104 (font_parse_fcname): Remove unused vars.
15105 (font_delete_unmatched): Now static.
15106 (font_get_spec): Remove; unused.
15107 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
15108 (font_update_drivers, Ffont_get_glyphs, font_add_log):
15109 Rename or move locals to avoid shadowing.
15111 * fns.c (require_nesting_list, require_unwind): Now static.
15112 (Ffillarray): Rename locals to avoid shadowing.
15114 * floatfns.c (domain_error2): Define only if needed.
15115 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
15117 * alloc.c (mark_backtrace): Move decl from here ...
15118 * lisp.h: ... to here, so that it can be checked.
15120 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
15121 (Fdefvar): Rewrite so as not to use empty "else".
15122 (lisp_indirect_variable): Name an expression,
15123 to avoid gcc -Wbad-function-cast warning.
15124 (Fdefvar): Rename locals to avoid shadowing.
15126 * callint.c (quotify_arg, quotify_args): Now static.
15127 (Fcall_interactively): Rename locals to avoid shadowing.
15128 Use const pointer when appropriate.
15130 * lisp.h (get_system_name, get_operating_system_release):
15131 Move decls here, to check interfaces.
15132 * process.c (get_operating_system_release): Move decl to lisp.h.
15133 * xrdb.c (get_system_name): Likewise.
15134 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
15135 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
15136 some of which prompt warnings from gcc -Wbad-function-cast.
15137 (Fformat_time_string, Fencode_time, Finsert_char):
15138 (Ftranslate_region_internal, Fformat):
15139 Rename or remove local vars to avoid shadowing.
15140 (Ftranslate_region_internal): Mark var as initialized.
15142 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
15145 * lisp.h (eassert): Check that the argument compiles, even if
15146 ENABLE_CHECKING is not defined.
15148 * data.c (Findirect_variable): Name an expression, to avoid
15149 gcc -Wbad-function-cast warning.
15150 (default_value, arithcompare, arith_driver, arith_error): Now static.
15151 (store_symval_forwarding): Rename local to avoid shadowing.
15152 (Fmake_variable_buffer_local, Fmake_local_variable):
15153 Mark variables as initialized.
15154 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
15156 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
15157 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
15158 Rename locals to avoid shadowing.
15159 (mark_stack): Move local variables into the #ifdef region where
15161 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
15162 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
15164 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
15165 (GC_STRING_CHARS): Remove; not used.
15166 (Fmemory_limit): Cast sbrk's returned value to char *.
15168 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
15169 avoids undefined behavior in theory.
15171 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
15173 Use functions, not macros, for up- and down-casing (Bug#8254).
15174 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
15175 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
15176 to use the following functions instead of these macros.
15177 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
15178 EMACS_INT, since callers assume the returned value fits in int.
15179 (upcase1): Likewise, for UPCASE_TABLE.
15180 (uppercasep, lowercasep, upcase): New static inline functions.
15181 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
15182 the race-condition problem in the old DOWNCASE.
15184 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
15185 Rename locals to avoid shadowing.
15186 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
15187 (regex_compile, re_search_2, re_match_2_internal):
15188 Remove unused local vars.
15189 (FREE_VAR): Rewrite so as not to use empty "else",
15190 which gcc can warn about.
15191 (regex_compile, re_match_2_internal): Mark locals as initialized.
15192 (RETALLOC_IF): Define only if needed.
15193 (WORDCHAR_P): Likewise. This one is never needed, but is used
15194 only in a comment talking about a compiler bug, so put inside
15195 the #if 0 of that comment.
15196 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
15197 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
15200 * search.c (boyer_moore): Rename locals to avoid shadowing.
15201 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
15202 (PREV_CHAR_BOUNDARY): Likewise.
15204 * search.c (simple_search): Remove unused var.
15206 * dired.c (compile_pattern): Move decl from here ...
15207 * lisp.h: ... to here, so that it can be checked.
15208 (struct re_registers): New forward decl.
15210 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
15212 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
15214 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
15215 Rename locals to avoid shadowing.
15216 (Fvertical_motion): Mark locals as initialized.
15218 * casefiddle.c (casify_object, casify_region): Now static.
15219 (casify_region): Mark local as initialized.
15221 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
15223 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
15224 New macros, so that the caller can use some names other than
15225 gcpro1, gcpro2, etc.
15226 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
15228 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
15229 argument, for consistency with GCPRO2_VAR, etc: it is now the
15230 prefix of the variable, not the variable itself. All uses
15232 * dired.c (directory_files_internal, file_name_completion):
15233 Rename locals to avoid shadowing.
15235 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
15236 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
15237 dired.c's scmp function, had undefined behavior.
15238 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
15239 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
15240 * buffer.h: ... to here, because these macros use current_buffer,
15241 and the new implementation with inline functions needs to have
15242 current_buffer in scope now, rather than later when the macros
15244 (downcase, upcase1): New static inline functions.
15245 (DOWNCASE, UPCASE1): Reimplement using these functions.
15246 This avoids undefined behavior in expressions like
15247 DOWNCASE (x) == DOWNCASE (y), which previously suffered
15248 from race conditions in accessing the global variables
15249 case_temp1 and case_temp2.
15250 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
15251 * lisp.h (case_temp1, case_temp2): Remove their decls.
15252 * character.h (ASCII_CHAR_P): Move from here ...
15253 * lisp.h: ... to here, so that the inline functions mentioned
15254 above can use them.
15256 * dired.c (directory_files_internal_unwind): Now static.
15258 * fileio.c (file_name_as_directory, directory_file_name):
15259 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
15261 (file_name_as_directory): Use const pointers when appropriate.
15262 (Fexpand_file_name): Likewise. In particular, newdir might
15263 point at constant storage, so make it a const pointer.
15264 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
15265 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
15267 (Fset_file_times, Finsert_file_contents, auto_save_error):
15268 Rename locals to avoid shadowing.
15270 * minibuf.c (choose_minibuf_frame_1): Now static.
15271 (Ftry_completion, Fall_completions): Rename or remove locals
15272 to avoid shadowing.
15274 * marker.c (bytepos_to_charpos): Remove; unused.
15276 * lisp.h (verify_bytepos, count_markers): New decls,
15277 so that gcc does not warn that these functions aren't declared.
15279 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
15280 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
15281 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
15282 (copy_text): Remove unused local var.
15284 * filelock.c (within_one_second): Now static.
15285 (lock_file_1): Rename local to avoid shadowing.
15287 * buffer.c (fix_overlays_before): Mark locals as initialized.
15288 (fix_start_end_in_overlays): Likewise. This function should be
15289 simplified by using pointers-to-pointers, but that's a different
15291 (switch_to_buffer_1): Now static.
15292 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
15293 (report_overlay_modification): Rename locals to avoid shadowing.
15295 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
15296 Fix pointer signedness issue.
15297 (sys_subshell): Mark local as volatile if checking for lint,
15298 to suppress a gcc -Wclobbered warning that does not seem to be right.
15299 (MAXPATHLEN): Define only if needed.
15301 * process.c (serial_open, serial_configure): Move decls from here ...
15302 * systty.h: ... to here, so that they can be checked.
15304 * fns.c (get_random, seed_random): Move extern decls from here ...
15305 * lisp.h: ... to here, so that they can be checked.
15307 * sysdep.c (reset_io): Now static.
15308 (wait_for_termination_signal): Remove; unused.
15310 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
15311 (copy_keymap_item, append_key, push_text_char_description):
15313 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
15314 (DENSE_TABLE_SIZE): Remove; unused.
15315 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
15316 (describe_map_tree):
15317 Rename locals to avoid shadowing.
15319 * keyboard.c: Declare functions static if they are not used elsewhere.
15320 (echo_char, echo_dash, cmd_error, top_level_2):
15321 (poll_for_input, handle_async_input): Now static.
15322 (read_char, kbd_buffer_get_event, make_lispy_position):
15323 (make_lispy_event, make_lispy_movement, apply_modifiers):
15324 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
15325 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
15326 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
15327 (read_key_sequence, read_char): Mark locals as initialized.
15328 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
15330 * keyboard.h (make_ctrl_char): New decl.
15331 (mark_kboards): Move decl here ...
15332 * alloc.c (mark_kboards): ... from here.
15334 * lisp.h (force_auto_save_soon): New decl.
15336 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
15337 (DEFINE_DUMMY_FUNCTION): New macro.
15338 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
15340 (main): Add casts to avoid warnings
15341 if GCC considers string literals to be constants.
15343 * lisp.h (fatal_error_signal): Add decl, since it's exported.
15345 * dbusbind.c: Pointer signedness fixes.
15346 (xd_signature, xd_append_arg, xd_initialize):
15347 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15348 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15349 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
15350 (Fdbus_register_signal): Use SSDATA when the context wants char *.
15352 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
15353 if GCC considers string literals to be constants.
15354 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
15356 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
15358 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
15359 (print_preprocess, print_object): New macro to fix last change.
15361 * print.c (print_preprocess): Don't forget font objects.
15363 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
15365 * emacs.c (USAGE3): Doc fixes.
15367 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
15369 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
15372 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
15374 * lisp.h (VWindow_system, Qfile_name_history):
15375 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
15376 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
15377 (w32_system_caret_x, w32_system_caret_y): Declare extern.
15379 * w32select.c: Don't #include "keyboard.h".
15380 (run_protected): Add extern declaration for waiting_for_input.
15382 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
15383 * w32console.c (detect_input_pending, read_input_pending)
15384 (encode_terminal_code):
15385 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
15386 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
15387 (w32_system_caret_y, Qfile_name_history):
15388 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
15389 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
15390 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
15391 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
15392 * w32proc.c (Qlocal, report_file_error):
15393 * w32term.c (Vwindow_system, updating_frame):
15394 * w32uniscribe.c (initialized, uniscribe_font_driver):
15395 Remove unneeded extern declarations.
15397 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
15399 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
15401 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
15403 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
15404 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
15405 These macros can no longer be used for assignment.
15407 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
15408 Assign struct members directly, instead of using BUF_BEGV etc.
15409 (record_buffer_markers, fetch_buffer_markers): New functions for
15410 recording and fetching special buffer markers.
15411 (set_buffer_internal_1, set_buffer_temp): Use them.
15413 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
15415 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
15417 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
15418 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
15420 * xdisp.c (hscroll_window_tree):
15421 (reconsider_clip_changes): Use PT instead of BUF_PT.
15423 2011-03-13 Eli Zaretskii <eliz@gnu.org>
15425 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
15426 $(EMACS_ROOT)/lib/intprops.h.
15428 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
15430 Fix more problems found by GCC 4.5.2's static checks.
15432 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
15433 to unsigned char * to avoid compiler diagnostic.
15434 (xg_free_frame_widgets): Make it clear that a local variable is
15435 needed only if USE_GTK_TOOLTIP.
15436 (gdk_window_get_screen): Make it clear that this macro is needed
15437 only if USE_GTK_TOOLTIP.
15438 (int_gtk_range_get_value): New function, which avoids a diagnostic
15439 from gcc -Wbad-function-cast.
15440 (xg_set_toolkit_scroll_bar_thumb): Use it.
15441 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
15442 diagnostic from gcc -Wbad-function-cast.
15443 (get_utf8_string, xg_get_file_with_chooser):
15444 Rename locals to avoid shadowing.
15445 (create_dialog): Move locals to avoid shadowing.
15447 * xgselect.c (xg_select): Remove unused var.
15449 * image.c (four_corners_best): Mark locals as initialized.
15450 (gif_load): Initialize transparent_p to zero (Bug#8238).
15451 Mark another local as initialized.
15452 (my_png_error, my_error_exit): Mark with NO_RETURN.
15454 * image.c (clear_image_cache): Now static.
15455 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
15456 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
15457 (x_edge_detection): Remove unnecessary cast that
15458 gcc -Wbad-function-cast diagnoses.
15459 (gif_load): Fix pointer signedness.
15460 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
15461 (jpeg_load, gif_load): Rename locals to avoid shadowing.
15463 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
15465 Improve quality of tests for time stamp overflow.
15466 For example, without this patch (encode-time 0 0 0 1 1
15467 1152921504606846976) returns the obviously-bogus value (-948597
15468 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
15469 reports time overflow. See
15470 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
15471 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
15472 * editfns.c: Include limits.h and intprops.h.
15473 (TIME_T_MIN, TIME_T_MAX): New macros.
15474 (time_overflow): Move earlier, to before first use.
15475 (hi_time, lo_time): New functions, for an accurate test for
15476 out-of-range times.
15477 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
15478 (Fget_internal_run_time): Don't assume time_t fits in int.
15479 (make_time): Use list2 instead of Fcons twice.
15480 (Fdecode_time): More accurate test for out-of-range times.
15481 (check_tm_member): New function.
15482 (Fencode_time): Use it, to test for out-of-range times.
15483 (lisp_time_argument): Don't rely on undefined left-shift and
15484 right-shift behavior when checking for time stamp overflow.
15486 * editfns.c (time_overflow): New function, refactoring common code.
15487 (Fformat_time_string, Fdecode_time, Fencode_time):
15488 (Fcurrent_time_string): Use it.
15490 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
15491 * dired.c (make_time): Move to ...
15492 * editfns.c (make_time): ... here.
15493 * systime.h: Note the move.
15495 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15497 * fringe.c (update_window_fringes): Remove unused variables.
15499 * unexmacosx.c (copy_data_segment): Also copy __got section.
15502 2011-03-12 Eli Zaretskii <eliz@gnu.org>
15504 * termcap.c [MSDOS]: Include "msdos.h".
15505 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
15506 Constify `char *' arguments and their references according to
15507 prototypes in tparam.h.
15509 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
15511 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
15512 Adapt all references accordingly.
15514 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
15516 2011-03-11 Tom Tromey <tromey@redhat.com>
15518 * buffer.c (syms_of_buffer): Remove obsolete comment.
15520 2011-03-11 Eli Zaretskii <eliz@gnu.org>
15522 * termhooks.h (encode_terminal_code): Declare prototype.
15524 * msdos.c (encode_terminal_code): Don't declare prototype.
15526 * term.c (encode_terminal_code): Now external again, used by
15527 w32console.c and msdos.c.
15529 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
15530 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
15532 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
15534 Fix some minor problems found by GCC 4.5.2's static checks.
15536 * fringe.c (update_window_fringes): Mark locals as initialized
15538 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
15540 * alloc.c (mark_fringe_data): Move decl from here ...
15541 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
15542 to check its interface.
15543 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
15545 * fontset.c (free_realized_fontset): Now static.
15546 (Fset_fontset_font): Rename local to avoid shadowing.
15547 (fontset_font): Mark local as initialized.
15548 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
15550 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
15552 * xselect.c (x_disown_buffer_selections): Remove; not used.
15553 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
15554 (x_own_selection, Fx_disown_selection_internal): Rename locals
15555 to avoid shadowing.
15556 (x_handle_dnd_message): Remove local to avoid shadowing.
15558 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
15559 so that the caller can use some name other than gcpro1.
15560 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
15561 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
15562 (Fx_backspace_delete_keys_p):
15563 Use them to avoid shadowing, and rename vars to avoid shadowing.
15564 (x_decode_color, x_set_name, x_window): Now static.
15565 (Fx_create_frame): Add braces to silence GCC warning.
15566 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
15567 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
15568 Remove unused locals.
15569 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
15570 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
15571 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
15574 * xterm.h (x_mouse_leave): New decl.
15576 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
15577 Remove unused functions.
15578 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
15579 (x_calc_absolute_position): Now static.
15580 (XTread_socket): Don't define label "out" unless it's used.
15581 Don't declare local "event" unless it's used.
15582 (x_iconify_frame, x_free_frame_resources): Don't declare locals
15583 unless they are used.
15584 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
15585 (x_fatal_error_signal): Remove; not used.
15586 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
15587 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
15588 (x_error_catcher, x_connection_closed, x_error_handler):
15589 (x_error_quitter, xembed_send_message, x_iconify_frame):
15590 (my_log_handler): Rename locals to avoid shadowing.
15591 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
15592 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
15594 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
15595 Rename or move locals to avoid shadowing.
15596 (tty_defined_color, merge_face_heights): Now static.
15597 (free_realized_faces_for_fontset): Remove; not used.
15598 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
15599 does not deduce is never used uninitialized.
15600 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
15601 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
15603 * terminal.c (store_terminal_param): Now static.
15605 * xmenu.c (menu_highlight_callback): Now static.
15606 (set_frame_menubar): Remove unused local.
15607 (xmenu_show): Rename parameter to avoid shadowing.
15608 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
15609 since they might point to immutable storage.
15610 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
15611 since it's unused otherwise.
15613 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
15614 Add a FIXME, since the code still doesn't look right. (Bug#8215)
15615 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
15616 avoids a gcc -Wuninitialized diagnostic.
15617 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
15618 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
15619 does not deduce are never used uninitialized.
15621 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
15623 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
15624 * window.c (window_loop, size_window):
15625 (run_window_configuration_change_hook, enlarge_window): Likewise.
15627 * window.c (display_buffer): Now static.
15628 (size_window): Mark variables that gcc -Wuninitialized
15629 does not deduce are never used uninitialized.
15630 * window.h (check_all_windows): New decl, to forestall
15631 gcc -Wmissing-prototypes diagnostic.
15632 * dispextern.h (bidi_dump_cached_states): Likewise.
15634 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
15636 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
15637 Include <limits.h>.
15638 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
15639 and to avoid gcc -Wuninitialized warning.
15640 (load_charset_map): Mark variables that gcc -Wuninitialized
15641 does not deduce are never used uninitialized.
15642 (load_charset): Abort instead of using uninitialized var (Bug#8229).
15644 * coding.c (coding_set_source, coding_set_destination):
15645 Use "else { /* comment */ }" rather than "else /* comment */;"
15646 for clarity, and to avoid gcc -Wempty-body warning.
15647 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
15648 a block, when the outer 'i' will do.
15649 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
15650 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
15651 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
15652 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
15653 (Fdecode_sjis_char, Fdefine_coding_system_internal):
15654 Rename locals to avoid shadowing.
15655 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
15656 * coding.c (emacs_mule_char, encode_invocation_designation):
15657 Now static, since they're not used elsewhere.
15658 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
15659 (decode_coding_object, encode_coding_object, detect_coding_system):
15660 (decode_coding_emacs_mule): Mark variables that gcc
15661 -Wuninitialized does not deduce are never used uninitialized.
15662 (detect_coding_iso_2022): Initialize a local variable that might
15663 be used uninitialized. Leave a FIXME because it's not clear that
15664 this initialization is needed. (Bug#8211)
15665 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
15666 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
15667 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
15668 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
15669 Remove unused macros.
15671 * category.c (hash_get_category_set): Remove unused local var.
15672 (copy_category_table): Now static, since it's not used elsewhere.
15673 * character.c (string_count_byte8): Likewise.
15675 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
15676 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
15678 * chartab.c (copy_sub_char_table): Now static, since it's not used
15680 (sub_char_table_ref_and_range, char_table_ref_and_range):
15681 Rename locals to avoid shadowing.
15682 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
15684 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
15685 (BIDI_BOB): Remove unused macro.
15687 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
15688 deduce are never used uninitialized.
15689 * term.c (encode_terminal_code): Likewise.
15691 * term.c (encode_terminal_code): Now static. Remove unused local.
15693 * tparam.h: New file.
15694 * term.c, tparam.h: Include it.
15695 * deps.mk (term.o, tparam.o): Depend on tparam.h.
15696 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
15697 Move these decls to tparam.h, and make them agree with what
15698 is actually in tparam.c. The previous trick of using incompatible
15699 decls in different modules does not conform to the C standard.
15700 All callers of tparam changed to use tparam's actual API.
15701 * tparam.c (tparam1, tparam, tgoto):
15702 Use const pointers where appropriate.
15704 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
15705 * cm.h (struct cm): Likewise.
15706 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
15707 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
15708 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
15709 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
15710 (turn_on_face, init_tty): Likewise.
15711 * termchar.h (struct tty_display_info): Likewise.
15713 * term.c (term_mouse_position): Rename local to avoid shadowing.
15715 * alloc.c (mark_ttys): Move decl from here ...
15716 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
15718 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
15720 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
15722 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
15724 * search.c (compile_pattern_1): Remove argument regp, unused since
15725 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
15726 (compile_pattern): Don't pass it.
15728 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
15730 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
15731 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
15733 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
15735 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
15737 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
15738 gdk_window_get_screen, gdk_window_get_geometry,
15739 gdk_x11_window_lookup_for_display and GDK_KEY_g.
15740 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
15741 (xg_get_pixbuf_from_pixmap): New function.
15742 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
15743 to Pixmap, take frame as parameter, remove GdkColormap parameter.
15744 Call xg_get_pixbuf_from_pixmap instead of
15745 gdk_pixbuf_get_from_drawable.
15746 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
15747 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
15748 (xg_check_special_colors): Use GtkStyleContext and its functions
15750 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
15751 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
15752 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
15753 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
15754 Call gtk_widget_get_preferred_size.
15755 (xg_frame_resized): gdk_window_get_geometry only takes 5
15757 (xg_win_to_widget, xg_event_is_for_menubar):
15758 Call gdk_x11_window_lookup_for_display.
15759 (xg_set_widget_bg): New function.
15760 (delete_cb): New function.
15761 (xg_create_frame_widgets): Connect delete-event to delete_cb.
15762 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
15763 (xg_set_background_color): Call xg_set_widget_bg.
15764 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
15765 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
15766 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
15767 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
15769 (update_frame_tool_bar): Call gtk_widget_hide.
15770 (xg_initialize): Use GDK_KEY_g.
15772 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
15774 (x_session_initialize): Call gdk_x11_set_sm_client_id.
15776 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
15777 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
15778 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
15780 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
15782 * w32xfns.c (select_palette): Check success of RealizePalette against
15783 GDI_ERROR, not zero.
15785 See ChangeLog.11 for earlier changes.
15787 ;; Local Variables:
15791 Copyright (C) 2011-2012 Free Software Foundation, Inc.
15793 This file is part of GNU Emacs.
15795 GNU Emacs is free software: you can redistribute it and/or modify
15796 it under the terms of the GNU General Public License as published by
15797 the Free Software Foundation, either version 3 of the License, or
15798 (at your option) any later version.
15800 GNU Emacs is distributed in the hope that it will be useful,
15801 but WITHOUT ANY WARRANTY; without even the implied warranty of
15802 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15803 GNU General Public License for more details.
15805 You should have received a copy of the GNU General Public License
15806 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.