merge trunk
[emacs.git] / src / ChangeLog
blobf69ab42bd90eb7e0ca8142abec6621a04960c68c
1 2012-09-30  Kenichi Handa  <handa@gnu.org>
3         * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
4         to the buffer relocation which may be caused by ccl_driver.
6 2012-09-30  Jan Djärv  <jan.h.d@swipnet.se>
8         * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
10         * nsterm.m (NEW_STYLE_FS): New define.
11         (ns_fullscreen_hook, windowWillEnterFullScreen)
12         (windowDidEnterFullScreen, windowWillExitFullScreen)
13         (windowDidExitFullScreen, toggleFullScreen, handleFS)
14         (setFSValue): New functions.
15         (EmacsFSWindow): New implementation.
16         (canBecomeKeyWindow): New function for EmacsFSWindow.
17         (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
18         (dealloc): Release nonfs_window if in fullscreen.
19         (updateFrameSize:): Call windowDidMove to update top/left.
20         (windowWillResize:toSize:): Check if frame is still maximized.
21         (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
22         next_maximized, maximized_width, maximized_height and nonfs_window.
23         Call setCollectionBehavior if NEW_STYLE_FS.  Initialize bwidth and
24         tbar_height.
25         (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
26         fullscreen. Set maximized_width/height.  Act on next_maximized.
28         * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
29         (EmacsView): Add variables for fullscreen.
30         (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
31         (EmacsFSWindow): New interface for fullscreen.
33 2012-09-30  Juanma Barranquero  <lekktu@gmail.com>
35         * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
37 2012-09-30  Chong Yidong  <cyd@gnu.org>
39         * fns.c (Frandom): Doc fix.
41 2012-09-30  Martin Rudalics  <rudalics@gmx.at>
43         * window.c (Vwindow_combination_limit): New default value.
44         (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
46 2012-09-30  Paul Eggert  <eggert@cs.ucla.edu>
48         * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
49         Suggested by Eli Zaretskii in
50         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
52 2012-09-30  Eli Zaretskii  <eliz@gnu.org>
54         * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
55         HAVE_TIMER_SETTIME is defined.
57 2012-09-30  Paul Eggert  <eggert@cs.ucla.edu>
59         Profiler improvements: more-accurate timers, overflow checks.
60         * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
61         signal.h, setjmp.h.  Include systime.h instead.
62         (saturated_add): New function.
63         (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
64         (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
65         (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
66         New static vars.
67         (enum profiler_cpu_running): New enum.
68         (profiler_cpu_running): Now of that enum type, not bool.
69         All uses changed to store the new value.
70         (handle_profiler_signal): Rename from sigprof_handler_1,
71         for consistency with other handlers.  Do not check whether
72         cpu_log is a hash-table if garbage collecting, since it
73         doesn't matter in that case.
74         (deliver_profiler_signal): Rename from sigprof_handler,
75         for consistency with other handlers.
76         (setup_cpu_timer): New function, with much of what used to be in
77         Fprofiler_cpu_start.  Check for out-of-range argument.
78         Prefer timer_settime if available, and prefer
79         thread cputime clocks, then process cputime clocks, then
80         monotonic clocks, to the old realtime clock.  Use make_timeval
81         to round more-correctly when falling back to setitimer.
82         (Fprofiler_cpu_start): Use it.
83         (Fprofiler_cpu_stop): Prefer timer_settime if available.
84         Don't assume that passing NULL as the 2nd argument of setitimer
85         is the same as passing a pointer to all-zero storage.
86         Ignore SIGPROF afterwards.
87         (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
88         * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
89         non-fatal signal handlers.  Ignore SIGPROF on startup.
90         * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
91         in profiler.c, since sysdep.c now uses it.
93         * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
94         Suggested by Eli Zaretskii in
95         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
97 2012-09-29  Juanma Barranquero  <lekktu@gmail.com>
99         * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
101 2012-09-29  Stefan Monnier  <monnier@iro.umontreal.ca>
103         * lisp.h (struct backtrace): Remove indirection for `function' field.
104         * xdisp.c (redisplay_internal):
105         * profiler.c (record_backtrace, sigprof_handler_1):
106         * alloc.c (Fgarbage_collect):
107         * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
108         (Fbacktrace_frame): Adjust accordingly.
110 2012-09-28  Glenn Morris  <rgm@gnu.org>
112         * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
113         (Frun_hook_with_args_until_failure): Doc fixes.
115 2012-09-28  Eli Zaretskii  <eliz@gnu.org>
117         * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
118         Qautomatic_redisplay and change the symbol name.  All users changed.
120 2012-09-28  Tomohiro Matsuyama  <tomo@cx4a.org>
122         * profiler.c (sigprof_handler): Fix race condition.
124 2012-09-28  Glenn Morris  <rgm@gnu.org>
126         * lread.c (lisp_file_lexically_bound_p): Handle #! lines.  (Bug#12528)
128 2012-09-27  Paul Eggert  <eggert@cs.ucla.edu>
130         Check more robustly for timer_settime.
131         * Makefile.in (LIB_TIMER_TIME): New macro.
132         (LIBES): Add it.
133         * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
134         Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
135         call timer_settime.
137 2012-09-26  Tomohiro Matsuyama  <tomo@cx4a.org>
139         * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
141 2012-09-26  Juanma Barranquero  <lekktu@gmail.com>
143         * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
145 2012-09-26  Paul Eggert  <eggert@cs.ucla.edu>
147         * character.h (MAYBE_UNIFY_CHAR): Remove.
148         * charset.c, charset.h (maybe_unify_char): Now static.
149         * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
150         Since this stuff is now private to charset.c, there's no need for
151         a public macro and no need to inline by hand.
153 2012-09-26  Tomohiro Matsuyama  <tomo@cx4a.org>
154             Stefan Monnier  <monnier@iro.umontreal.ca>
155             Juanma Barranquero  <lekktu@gmail.com>
157         * profiler.c: New file.
158         * Makefile.in (base_obj): Add profiler.o.
159         * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
160         ($(BLD)/profiler.$(O)): New target.
161         * emacs.c (main): Call syms_of_profiler.
162         * alloc.c (Qautomatic_gc): New constant.
163         (MALLOC_PROBE): New macro.
164         (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
165         (total_bytes_of_live_objects): New function.
166         (Fgarbage_collect): Use it.  Record itself in backtrace_list.
167         Call malloc_probe for the memory profiler.
168         (syms_of_alloc): Define Qautomatic_gc.
169         * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
170         race condition.
171         (struct backtrace): Move definition...
172         * lisp.h (struct backtrace): ..here.
173         (Qautomatic_gc, profiler_memory_running): Declare vars.
174         (malloc_probe, syms_of_profiler): Declare functions.
175         * xdisp.c (Qautomatic_redisplay): New constant.
176         (redisplay_internal): Record itself in backtrace_list.
177         (syms_of_xdisp): Define Qautomatic_redisplay.
179 2012-09-25  Eli Zaretskii  <eliz@gnu.org>
180 2012-09-25  Juanma Barranquero  <lekktu@gmail.com>
182         * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
184 2012-09-25  Paul Eggert  <eggert@cs.ucla.edu>
186         Prefer POSIX timers if available.
187         They avoid a race if the timer is too close to the current time.
188         * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
189         (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
190         (init_atimer) [SIGEV_SIGNAL]: Initialize them.
192 2012-09-25  Eli Zaretskii  <eliz@gnu.org>
194         * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
195         CHAR_STRING_ADVANCE.
196         (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
197         STRING_CHAR_ADVANCE.
199 2012-09-25  Juanma Barranquero  <lekktu@gmail.com>
201         Move Vlibrary_cache to emacs.c and reset before dumping.
203         * lisp.h (reset_image_types): Declare.
204         [WINDOWSNT] (Vlibrary_cache): Declare.
206         * image.c (reset_image_types): New function.
208         * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
209         (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
210         (Fdump_emacs): Reset Vlibrary_cache and image_types.
212         * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
213         (globals_of_w32) <Vlibrary_cache>: Do not initialize.
215         * w32.h (Vlibrary_cache): Do not declare.
217 2012-09-25  Eli Zaretskii  <eliz@gnu.org>
219         * w32proc.c (sys_signal): Handle all signals defined by the
220         MS-Windows runtime, not just SIGCHLD.  Actually install the signal
221         handlers for signals supported by Windows.  Don't override
222         term_ntproc as the handler for SIGABRT.
223         (sigaction): Rewrite to call sys_signal instead of duplicating its
224         code.
225         (sys_kill): Improve commentary.
227         * w32.c (term_ntproc): Accept (and ignore) one argument, for
228         consistency with a signature of a signal handler.  All callers
229         changed.
230         (init_ntproc): Accept an argument DUMPING.  If dumping, don't
231         install term_ntproc as a signal handler for SIGABRT, as that
232         should be done by the dumped Emacs.
234         * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
236         * w32select.c (term_w32select): Protect against repeated
237         invocation by setting clipboard_owner to NULL after calling
238         DestroyWindow.
240         * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
241         and term_ntproc to their modified signatures.
243         * character.c (char_string, string_char): Remove calls to
244         MAYBE_UNIFY_CHAR.  See the discussion starting at
245         http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
246         for the details.
248 2012-09-25  Chong Yidong  <cyd@gnu.org>
250         * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
252 2012-09-24  Stefan Monnier  <monnier@iro.umontreal.ca>
254         * bytecode.c (exec_byte_code): Signal an error instead of aborting,
255         when encountering an unknown bytecode.
257 2012-09-24  Paul Eggert  <eggert@cs.ucla.edu>
259         image.c, indent.c: Use bool for booleans.
260         * dispextern.h (struct image_type): Members valid_p, load, init
261         now return bool, not int.  All uses changed.
262         * image.c: Omit unnecessary static decls.
263         (x_create_bitmap_mask, x_build_heuristic_mask):
264         Return void, not int, since callers don't care about the return value.
265         (x_create_bitmap_mask, define_image_type, valid_image_p)
266         (struct image_keyword, parse_image_spec, image_spec_value)
267         (check_image_size, image_background)
268         (image_background_transparent, x_clear_image_1)
269         (postprocess_image, lookup_image, x_check_image_size)
270         (x_create_x_image_and_pixmap, xbm_image_p)
271         (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
272         (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
273         (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
274         (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
275         (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
276         (png_image_p, init_png_functions, png_load_body, png_load)
277         (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
278         (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
279         (init_gif_functions, gif_load, imagemagick_image_p)
280         (imagemagick_load_image, imagemagick_load, svg_image_p)
281         (init_svg_functions, svg_load, svg_load_image, gs_image_p)
282         (gs_load):
283         * nsimage.m (ns_load_image):
284         * nsterm.m (ns_defined_color):
285         * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
286         * xfns.c (x_defined_color):
287         * xterm.c (x_alloc_lighter_color_for_widget)
288         (x_alloc_nearest_color_1, x_alloc_nearest_color)
289         (x_alloc_lighter_color):
290         * indent.c (disptab_matches_widthtab, current_column)
291         (scan_for_column, string_display_width, indented_beyond_p)
292         (compute_motion, vmotion, Fvertical_motion):
293         Use bool for booleans.
295 2012-09-24  Chong Yidong  <cyd@gnu.org>
297         * chartab.c (Fset_char_table_default): Obsolete function removed.
299 2012-09-23  Paul Eggert  <eggert@cs.ucla.edu>
301         Move pid_t related decls out of lisp.h.
302         * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
303         (interruptible_wait_for_termination):
304         Move these decls from lisp.h to syswait.h, since they use pid_t.
305         Needed on FreeBSD; see Herbert J. Skuhra in
306         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
307         * callproc.c: Include syswait.h.
309         gnutls.c, gtkutil.c: Use bool for boolean.
310         * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
311         (emacs_gnutls_handle_error):
312         * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
313         (xg_hide_tooltip, xg_create_frame_widgets)
314         (create_dialog, xg_uses_old_file_dialog)
315         (xg_get_file_with_chooser, xg_get_file_with_selection)
316         (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
317         (xg_item_label_same_p, xg_update_menubar)
318         (xg_modify_menubar_widgets, xg_event_is_for_menubar)
319         (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
320         (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
321         (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
322         (update_frame_tool_bar, free_frame_tool_bar):
323         * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
324         * nsmenu.m (ns_update_menubar):
325         * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
326         * xfns.c (Fx_show_tip) [USE_GTK]:
327         Use bool for boolean.
328         * gtkutil.c (xg_update_frame_menubar):
329         * xmenu.c (update_frame_menubar):
330         Return void, not int, since caller ignores return value.
331         * gtkutil.c (xg_change_toolbar_position):
332         Return void, not 1.
334 2012-09-23  Juanma Barranquero  <lekktu@gmail.com>
336         * makefile.w32-in (BLOCKINPUT_H): Remove.
337         (SYSSIGNAL_H): New macro.
338         ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
339         ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
340         ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
341         ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
342         ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
343         ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
344         ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
345         ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
346         ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
347         ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
348         ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
349         ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
350         ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
351         ($(BLD)/w32xfns.$(O)): Update dependencies.
353 2012-09-23  Eli Zaretskii  <eliz@gnu.org>
355         * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
356         fatal_error_backtrace.
358         * w32proc.c (sys_kill): Undo last change: don't do anything when
359         invoked to deliver SIGABRT to our own process.  This is now
360         handled by emacs_raise.
362 2012-09-23  Juanma Barranquero  <lekktu@gmail.com>
364         * w32term.c (w32_read_socket): Remove leftover reference to
365         interrupt_input_pending.
367 2012-09-23  Paul Eggert  <eggert@cs.ucla.edu>
369         Do not use SA_NODEFER.
370         Problem reported by Dani Moncayo in
371         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
372         * alloc.c (die):
373         * sysdep.c (emacs_abort): Do not reset signal handler.
374         * emacs.c (terminate_due_to_signal): Reset signal handler here.
375         * sysdep.c (init_signals): Do not use SA_NODEFER.  It wasn't
376         wanted even on POSIXish hosts, and it doesn't work on Windows.
378 2012-09-23  Jan Djärv  <jan.h.d@swipnet.se>
380         * xterm.c (x_term_init): Call fixup_locale before and after calling
381         gtk_init (Bug#12392).
383 2012-09-23  Chong Yidong  <cyd@gnu.org>
385         * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
386         Vdynamic_library_alist.
388         * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
389         (Fgnutls_available_p): Caller changed.
391         * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
392         (Flibxml_parse_xml_region): Likewise.
394         * dispextern.h (struct image_type): Remove arg from init function.
396         * image.c (Finit_image_library, lookup_image_type)
397         (define_image_type): Remove now-unneeded second arg.
398         (init_xpm_functions, init_png_functions, init_jpeg_functions)
399         (init_tiff_functions, init_gif_functions, init_svg_functions):
400         Arglist and w32_delayed_load calling convention changed.
401         (gs_type): Remove init_gs_functions; there is no such function.
402         (valid_image_p, make_image): Fix caller to lookup_image_type.
404 2012-09-23  Paul Eggert  <eggert@cs.ucla.edu>
406         Simplify and avoid signal-handling races (Bug#12471).
407         * alloc.c (die):
408         * sysdep.c (emacs_abort) [HAVE_NTGUI]:
409         Avoid recursive loop if there's a fatal error in the function itself.
410         * atimer.c (pending_atimers):
411         * blockinput.h: Don't include "atimer.h"; no longer needed.
412         (interrupt_input_pending): Remove.  All uses removed.
413         pending_signals now counts both atimers and ordinary interrupts.
414         This is less racy than having three separate pending-signal flags.
415         (block_input, unblock_input, totally_unblock_input, unblock_input_to)
416         (input_blocked_p):
417         Rename from their upper-case counterparts BLOCK_INPUT,
418         UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
419         INPUT_BLOCKED_P, and turn into functions.  All uses changed.
420         This makes it easier to access volatile variables more accurately.
421         (BLOCK_INPUT_RESIGNAL): Remove.  All uses replaced by unblock_input ().
422         (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
423         that's more reliable if the code is buggy and sets
424         interrupt_input_blocked to a negative value.  All uses changed.
425         * atimer.c (deliver_alarm_signal):
426         Remove.  No need to deliver this to the parent; any thread can
427         handle this signal now.  All uses replaced by underlying handler.
428         * atimer.c (turn_on_atimers):
429         * dispnew.c (handle_window_change_signal):
430         * emacs.c (handle_danger_signal):
431         * keyboard.c (kbd_buffer_get_event):
432         Don't reestablish signal handler; not needed with sigaction.
433         * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
434         (UNBLOCK_INPUT_TO):
435         Rework to avoid unnecessary accesses to volatile variables.
436         (UNBLOCK_INPUT_TO): Now a function.
437         (totally_unblock_input, unblock_input): New decls.
438         * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
439         (init_data): Remove.  Necessary stuff now done in init_signal.
440         * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
441         * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
442         (fatal_error_code): Remove; no longer needed.
443         (terminate_due_to_signal): Rename from fatal_error_backtrace, since
444         it doesn't always backtrace.  All uses changed.  No need to reset
445         signal to default, since sigaction and/or die does that for us now.
446         Use emacs_raise (FOO), not kill (getpid (), FOO).
447         (main): Check more-accurately whether we're dumping.
448         Move fatal-error setup to sysdep.c
449         * floatfns.c: Do not include "syssignal.h"; no longer needed.
450         * gtkutil.c (xg_get_file_name, xg_get_font):
451         Remove no-longer-needed signal-mask manipulation.
452         * keyboard.c, process.c (POLL_FOR_INPUT):
453         Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
454         * keyboard.c (read_avail_input): Remove.
455         All uses replaced by gobble_input.
456         (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
457         (kbd_buffer_store_event_hold, gobble_input):
458         (record_asynch_buffer_change) [USABLE_SIGIO]:
459         (store_user_signal_events):
460         No need to mess with signal mask.
461         (gobble_input): If blocking input and there are terminals, simply
462         set pending_signals to 1 and return.  All hooks changed to not
463         worry about whether input is blocked.
464         (process_pending_signals): Clear pending_signals before processing
465         them, in case a signal comes in while we're processing.
466         By convention callers now test pending_signals before calling us.
467         (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
468         New functions, to support changes to blockinput.h.
469         (handle_input_available_signal): Now extern.
470         (reinvoke_input_signal): Remove.  All uses replaced by
471         handle_async_input.
472         (quit_count): Now volatile, since a signal handler uses it.
473         (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
474         All callers changed.  Block SIGINT only if not already blocked.
475         Clear sigmask reliably, even if Fsignal returns, which it can.
476         Omit unnecessary accesses to volatile var.
477         (quit_throw_to_read_char): No need to restore sigmask.
478         * keyboard.c (gobble_input, handle_user_signal):
479         * process.c (wait_reading_process_output):
480         Call signal-handling code rather than killing ourselves.
481         * lisp.h: Include <float.h>, for...
482         (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
483         (pending_signals): Now volatile.
484         (syms_of_data): Now const if IEEE floating point.
485         (handle_input_available_signal) [USABLE_SIGIO]:
486         (terminate_due_to_signal, record_child_status_change): New decls.
487         * process.c (create_process): Avoid disaster if memory is exhausted
488         while we're processing a vfork, by tightening the critical section
489         around the vfork.
490         (send_process_frame, process_sent_to, handle_pipe_signal)
491         (deliver_pipe_signal): Remove.  No longer needed, as Emacs now
492         ignores SIGPIPE.
493         (send_process): No need for setjmp/longjmp any more, since the
494         SIGPIPE stuff is now gone.  Instead, report an error if errno
495         is EPIPE.
496         (record_child_status_change): Now extern.  PID and W are now args.
497         Return void, not bool.  All callers changed.
498         * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
499         Remove.  All uses removed.  This bug should be fixed now in a
500         different way.
501         (wait_for_termination_1): Use waitpid rather than sigsuspend,
502         and record the child status change directly.  This avoids the
503         need to futz with the signal mask.
504         (process_fatal_action): Move here from emacs.c.
505         (emacs_sigaction_flags): New function, containing
506         much of what used to be in emacs_sigaction_init.
507         (emacs_sigaction_init): Use it.  Block nonfatal system signals that are
508         caught by emacs, to make races less likely.
509         (deliver_process_signal): Rename from handle_on_main_thread.
510         All uses changed.
511         (BACKTRACE_LIMIT_MAX): Now at top level.
512         (thread_backtrace_buffer, threadback_backtrace_pointers):
513         New static vars.
514         (deliver_thread_signal, deliver_fatal_thread_signal):
515         New functions, for more-accurate delivery of thread-specific signals.
516         (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
517         (deliver_arith_signal): Handle in this thread, not
518         in the main thread, since it's triggered by this thread.
519         (maybe_fatal_sig): New function.
520         (init_signals): New arg DUMPING so that we can be more accurate
521         about whether we're dumping.  Caller changed.
522         Treat thread-specific signals differently from process-general signals.
523         Block all signals while handling fatal error; that's safer.
524         xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
525         on IEEE hosts.
526         When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
527         Ignore SIGPIPE unless batch.
528         (emacs_backtrace): Output backtrace for the appropriate thread,
529         which is not necessarily the main thread.
530         * syssignal.h: Include <stdbool.h>.
531         (emacs_raise): New macro.
532         * xterm.c (x_connection_signal): Remove; no longer needed
533         now that we use sigaction.
534         (x_connection_closed): No need to mess with sigmask now.
535         (x_initialize): No need to reset SIGPIPE handler here, since
536         init_signals does this for us now.
538 2012-09-23  Jan Djärv  <jan.h.d@swipnet.se>
540         * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
541         background rect may be larger (Bug#12245).
543 2012-09-23  Chong Yidong  <cyd@gnu.org>
545         * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
547 2012-09-22  Paul Eggert  <eggert@cs.ucla.edu>
549         * .gdbinit: Just stop at fatal_error_backtrace.
550         See Stefan Monnier's request in
551         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
552         Remove no-longer-used query of system type.
554 2012-09-22  Chong Yidong  <cyd@gnu.org>
556         * search.c (Freplace_match): Doc fix (Bug#12325).
558         * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
560         * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
561         (Fline_end_position): Doc fix.
563         * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
565 2012-09-22  Chong Yidong  <cyd@gnu.org>
567         * dispextern.h (struct image_type): Add new slot, storing a type
568         initialization function.
570         * image.c (define_image_type): Call the image initializer function
571         if it is defined.  Arguments and return value changed.
572         (valid_image_p, make_image): Callers changed.
573         (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
574         (gif_type, imagemagick_type, svg_type, gs_type):
575         Add initialization functions.
576         (Finit_image_library): Call lookup_image_type.
577         (CHECK_LIB_AVAILABLE): Macro deleted.
578         (lookup_image_type): Call define_image_type here, rather than via
579         Finit_image_library, and without using CHECK_LIB_AVAILABLE.
580         (syms_of_image): Move define_image_type calls for xbm_type and
581         pbm_type to lookup_image_type.
583 2012-09-22  Eli Zaretskii  <eliz@gnu.org>
585         * keyboard.c (timer_check_2): Move calculation of 'timers' and
586         'idle_timers' from here ...
587         (timer_check): ... to here.  Use Fcopy_sequence to copy the timer
588         lists, to avoid infloops when the timer does something stupid,
589         like reinvoke itself with the same or smaller time-out.
590         (Bug#12447)
592 2012-09-22  Martin Rudalics  <rudalics@gmx.at>
594         * window.c (Fsplit_window_internal): Handle only Qt value of
595         Vwindow_combination_limit separately.
596         (Qtemp_buffer_resize): New symbol.
597         (Vwindow_combination_limit): New default value.
598         Rewrite doc-string.
600 2012-09-22  Eli Zaretskii  <eliz@gnu.org>
602         * xdisp.c (next_overlay_string): Initialize it->end_charpos for
603         the new overlay string.  (Bug#10159)
605 2012-09-22  Paul Eggert  <eggert@cs.ucla.edu>
607         * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
608         or that fprintf is async-signal-safe.  POSIX doesn't require
609         either assumption.
611 2012-09-22  Chong Yidong  <cyd@gnu.org>
613         * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
614         (Bug#8207).
616 2012-09-22  Kenichi Handa  <handa@gnu.org>
618         * composite.c (composition_reseat_it): Handle the case that a
619         grapheme cluster is not covered by a single font (Bug#12352).
621 2012-09-21  Chong Yidong  <cyd@gnu.org>
623         * image.c (define_image_type): Avoid adding duplicate types to
624         image_types (Bug#12463).  Suggested by Jörg Walter.
626 2012-09-21  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
628         * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
629         (print_load_command_name): Add case LC_DATA_IN_CODE.
630         (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
632 2012-09-21  Glenn Morris  <rgm@gnu.org>
634         * eval.c (Frun_hook_with_args_until_success)
635         (Frun_hook_with_args_until_failure): Doc fixes.  (Bug#12393)
637 2012-09-21  Andreas Schwab  <schwab@linux-m68k.org>
639         * fileio.c (Ffile_selinux_context): Only call freecon when
640         lgetfilecon succeeded.
641         (Fset_file_selinux_context): Likewise.  (Bug#12444)
643 2012-09-21  Eli Zaretskii  <eliz@gnu.org>
645         * xdisp.c (try_window_reusing_current_matrix): Under bidi
646         reordering, locate the cursor by calling set_cursor_from_row; if
647         that fails, clear the desired glyph matrix before returning a
648         failure indication to the caller.  Fixes leaving garbled display
649         when fast scrolling with a down-key.  (Bug#12403)
650         (compute_stop_pos_backwards): Fix a typo that caused crashes while
651         scrolling through multibyte text.
653 2012-09-20  Stefan Monnier  <monnier@iro.umontreal.ca>
655         * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
656         calling mark_vectorlike since that's the one that marks the window.
657         (mark_discard_killed_buffers): Mark the final cdr.
658         * window.h (struct window): Move prev/next_buffers to the
659         non-standard fields.
660         * window.c (make_window): Initialize prev/next_buffers manually.
662 2012-09-20  Paul Eggert  <eggert@cs.ucla.edu>
664         Omit unused arg EXPECTED from socket hooks.
665         * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
666         * nsterm.m (ns_term_init):
667         * termhooks.h (struct terminal.read_socket_hook):
668         * w32inevt.c (w32_console_read_socket):
669         * w32term.c (w32_read_socket):
670         * xterm.c (XTread_socket):
671         Omit unused arg EXPECTED.  All callers changed.
672         (store_user_signal_events): Return void, not int, since callers no
673         longer care about the return value.  All uses changed.
675 2012-09-20  Juanma Barranquero  <lekktu@gmail.com>
677         * w32gui.h (XParseGeometry): Do not declare.
679 2012-09-19  Paul Eggert  <eggert@cs.ucla.edu>
681         * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
682         Ignore 'expected'. See Eli Zaretskii in
683         <http://bugs.gnu.org/12471#8> (last line).
685         * frame.c (read_integer): Remove.  All uses replaced by strtol/strtoul.
686         (XParseGeometry): Now static.  Substitute extremal values for
687         values that are out of range.
689 2012-09-19  Jan Djärv  <jan.h.d@swipnet.se>
691         * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
693         * nsfns.m (XParseGeometry): Remove.
694         (Fx_create_frame): Call x_set_offset to correctly interpret
695         top_pos in geometry.
697         * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
698         (Fx_parse_geometry): If there is a space in string, call
699         Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
701 2012-09-17  Eli Zaretskii  <eliz@gnu.org>
703         * search.c (scan_buffer): Use character positions in calls to
704         region_cache_forward and region_cache_backward, not byte
705         positions.  (Bug#12196)
707         * w32term.c (w32_read_socket): Set pending_signals to 1, like
708         xterm.c does.  Reported by Daniel Colascione <dancol@dancol.org>.
710         * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
711         __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
712         emacs_blocked_malloc, now deleted.
714 2012-09-17  Paul Eggert  <eggert@cs.ucla.edu>
716         Remove no-longer-needed Solaris 2.4 vfork bug workaround.
717         The workaround was for improving performance on Solaris 2.4, but
718         is getting in the way now.  Emacs will still work if someone is
719         still running Solaris 2.4 in a museum somewhere; Sun dropped
720         support for Solaris 2.4 in 2003.
721         * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
722         * process.c (create_process) [HAVE_WORKING_VFORK]:
723         Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
724         since Emacs no longer uses vfork on that platform.
726 2012-09-17  Glenn Morris  <rgm@gnu.org>
728         * emacs.c: Use COPYRIGHT.
730 2012-09-16  Paul Eggert  <eggert@cs.ucla.edu>
732         Remove configure's --without-sync-input option (Bug#12450).
733         When auditing signal-handling in preparation for cleaning it up,
734         I found that SYNC_INPUT has race conditions and would be a real
735         pain to fix.  Since it's an undocumented and deprecated
736         configure-time option, now seems like a good time to remove it.
737         Also see <http://bugs.gnu.org/11080#16>.
738         * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
739         (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
740         (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
741         (malloc_hysteresis):
742         (check_depth) [XMALLOC_OVERRUN_CHECK]:
743         (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
744         (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
745         (dont_register_blocks, bytes_used_when_reconsidered)
746         (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
747         (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
748         [!SYSTEM_MALLOC && !SYNC_INPUT]:
749         Remove. All uses removed.
750         (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
751         implementation, one that depends on whether the new macro
752         XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
753         is defined.
754         * atimer.c (run_timers, handle_alarm_signal):
755         * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
756         (handle_async_input, process_pending_signals)
757         (handle_input_available_signal, init_keyboard):
758         * nsterm.m (ns_read_socket):
759         * process.c (wait_reading_process_output):
760         * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
761         * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
762         (emacs_write):
763         * xterm.c (XTread_socket):
764         Assume SYNC_INPUT.
765         * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
766         * eval.c (handling_signal): Remove.  All uses removed.
767         * lisp.h (ELSE_PENDING_SIGNALS): Remove.
768         All uses replaced with the SYNC_INPUT version.
769         (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
770         Remove decls.
771         * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
772         Now static.
774         * font.c (Ffont_shape_gstring): Remove unused local.
776 2012-09-16  Glenn Morris  <rgm@gnu.org>
778         * Makefile.in (clean): No longer run nextstep's clean.
780         * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
781         (ns_frag): Remove.
782         (ns-app): Move here from ns.mk, and simplify.
783         (clean): Simplify nextstep entry.
784         * ns.mk: Remove file.
786 2012-09-17  Kenichi Handa  <handa@gnu.org>
788         * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
789         not covert the last few charactes.
791 2012-09-16  Kenichi Handa  <handa@gnu.org>
793         * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
794         here, but just check the validity of glyphs in the glyph-string.
796 2012-09-16  Martin Rudalics  <rudalics@gmx.at>
798         * window.c (Fwindow_parameter, Fset_window_parameter):
799         Accept any window as argument (Bug#12452).
801 2012-09-16  Jan Djärv  <jan.h.d@swipnet.se>
803         * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
804         to ns_term_init to avoid memory leak.
806         * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
807         explicit retain/release.
808         (ns_term_init): Only allow one display.  Initialize outerpool and
809         ns_*_types.
811 2012-09-15  Paul Eggert  <eggert@cs.ucla.edu>
813         Port _setjmp fix to POSIXish hosts as well as Microsoft.
814         * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
815         it's needed on POSIXish hosts that lack _setjmp.  Attempt to solve
816         the Microsoft problem in a different way, by altering ../nt/config.nt.
818 2012-09-15  Eli Zaretskii  <eliz@gnu.org>
820         * w32xfns.c:
821         * w32uniscribe.c:
822         * w32term.c:
823         * w32select.c:
824         * w32reg.c:
825         * w32proc.c:
826         * w32menu.c:
827         * w32inevt.c:
828         * w32heap.c:
829         * w32font.c:
830         * w32fns.c:
831         * w32console.c:
832         * w32.c:
833         * w16select.c: Remove inclusion of setjmp.h, as it is now included
834         by lisp.h.  This completes removal of setjmp.h inclusion
835         erroneously announced in the previous commit.  (Bug#12446)
837         * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
838         more accurate.
840         * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
841         not defined as a macro.  The latter happens on MS-Windows.
842         (Bug#12446)
844 2012-09-15  Paul Eggert  <eggert@cs.ucla.edu>
846         Port better to POSIX hosts lacking _setjmp (Bug#12446).
847         * lisp.h: Include <setjmp.h> here, since we use its symbols here.
848         Some instances of '#include <setjmp.h>' removed, if the
849         only reason for the instance was because "lisp.h" was included.
850         (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
851         Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
852         and _longjmp with the new symbols.  Emacs already uses _setjmp if
853         available, so this change affects only POSIXish hosts that have
854         sigsetjmp but not _setjmp, such as some versions of Solaris and
855         Unixware.  (Also, POSIX-2008 marks _setjmp as obsolescent.)
856         * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
857         (png_load_body) [HAVE_PNG]:
858         (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
859         (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
860         Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
861         since PNG requires jmp_buf.  This is the only exception to the
862         general rule that we now use sys_setjmp and sys_longjmp.
863         This exception is OK since this code does not change the signal
864         mask or longjmp out of a signal handler.
866 2012-09-14  Paul Eggert  <eggert@cs.ucla.edu>
868         * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
869         Include "syssignal.h", for 'main_thread'.
871 2012-09-14  Dmitry Antipov  <dmantipov@yandex.ru>
873         Avoid out-of-range marker position (Bug#12426).
874         * insdel.c (replace_range, replace_range_2):
875         Adjust markers before overlays, as suggested by comments.
876         (insert_1_both, insert_from_buffer_1, adjust_after_replace):
877         Remove redundant check before calling offset_intervals.
879 2012-09-14  Martin Rudalics  <rudalics@gmx.at>
881         * xdisp.c (Fformat_mode_line): Unconditionally save/restore
882         current buffer (Bug#12387).
884 2012-09-14  Juanma Barranquero  <lekktu@gmail.com>
886         * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
888 2012-09-13  Paul Eggert  <eggert@cs.ucla.edu>
890         Use a more backwards-compatible timer format (Bug#12430).
891         * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
892         vector element, not from the 4th, since PSECS is now at the end.
893         (Fcurrent_idle_time): Doc fix.
895 2012-09-13  Dmitry Antipov  <dmantipov@yandex.ru>
897         Function to mark objects and remove killed buffers at once.
898         * alloc.c (discard_killed_buffers): Rename to ...
899         (mark_discard_killed buffers) ... new name.  Add marking
900         of remaining objects.  Fix comment.  Adjust users.
901         (mark_object): Do not touch frame buffer lists here.
902         * frame.c (delete_frame): Reset frame buffer lists here.
904 2012-09-13  Paul Eggert  <eggert@cs.ucla.edu>
906         Better workaround for GNOME bug when --enable-gcc-warnings.
907         * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
908         Instead, disable -Wunused-local-typedefs.  See Dmitry Antipov in
909         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
911         Simplify SIGIO usage (Bug#12408).
912         The code that dealt with SIGIO was crufty and confusing, e.g., it
913         played tricks like "#undef SIGIO" but these tricks were not used
914         consistently.  Simplify mostly by not #undeffing standard symbols,
915         e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
916         or not as we please) rather than "defined SIGIO" (standard symbol
917         that we probably shouldn't #undef).
918         * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
919         Modules that need it can include it.
920         [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
921         * dispextern.h (ignore_sigio): New decl.
922         * emacs.c (shut_down_emacs): Invoke unrequest_sigio
923         unconditionally, since it's now a no-op if !USABLE_SIGIO.
924         * emacs.c (shut_down_emacs):
925         * keyboard.c (kbd_buffer_store_event_hold):
926         Use ignore_sigio rather than invoking 'signal' directly.
927         * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
928         for FIONREAD.
929         (FIONREAD, SIGIO): Do not #undef.
930         (tty_read_avail_input): Use #error rather than a syntax error.
931         * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
932         for I_PIPE, used by SETUP_SLAVE_PTY.
933         (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
934         * sysdep.c (croak): Remove; no longer needed.  This bit of
935         temporary code, with Fred N. Fish's comment that it's temporary,
936         has been in Emacs since at least 1992!
937         (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
938         Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
939         * syssignal.h (croak): Remove decl.
940         (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
941         * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
942         now that we're termios-only.
943         (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
944         * term.c (dissociate_if_controlling_tty): Use #error rather than
945         a run-time error.
947         Work around GCC and GNOME bugs when --enable-gcc-warnings.
948         * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
949         to work around GNOME bug 683906.
950         * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
951         (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
952         This works around GCC bug 54561.
954 2012-09-12  Paul Eggert  <eggert@cs.ucla.edu>
956         More fixes for 'volatile' and setjmp/longjmp.
957         * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
958         * image.c (struct png_load_context) [HAVE_PNG]: New type.
959         (png_load_body) [HAVE_PNG]:
960         (jpeg_load_body) [HAVE_JPEG]:
961         New function, with most of the old parent function's body.
962         (png_load) [HAVE_PNG]:
963         (jpeg_load) [HAVE_JPEG]:
964         Invoke the new function, to avoid longjmp munging our locals.
965         (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
966         (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
967         longjmp is passed 2, as the C standard doesn't guarantee this.
968         Instead, store the failure code into mgr->failure_code.
970 2012-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
972         * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
973         (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
974         (syms_of_keyboard): Remove support for unread-command-char.
976 2012-09-12  Eli Zaretskii  <eliz@gnu.org>
978         * w32proc.c (sys_kill): If PID is our process ID and the signal is
979         SIGABRT, call emacs_abort.  Avoids silently exiting upon assertion
980         violation.  (Bug#12426)
982 2012-09-12  Paul Eggert  <eggert@cs.ucla.edu>
984         * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
986 2012-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
988         * eval.c: Add `inhibit-debugger'.
989         (Qinhibit_debugger): New symbol.
990         (call_debugger): Bind it instead of Qdebug_on_error.
991         (maybe_call_debugger): Test Vinhibit_debugger.
992         (syms_of_eval): Define inhibit-debugger.
993         * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
994         (syms_of_xdisp): Remove inhibit-debug-on-message.
996 2012-09-11  Paul Eggert  <eggert@cs.ucla.edu>
998         Avoid _setjmp/_longjmp problems with local nonvolatile variables.
999         If a nonvolatile local variable is written before a _longjmp to
1000         the frame containing the variable, and is read after the _longjmp,
1001         the value read is indeterminate.  Some local variables of type
1002         'struct handler' and 'struct catchtag' are used in this way, so
1003         mark each of their slots as volatile if the slot can be set before
1004         _longjmp and read afterwards.
1005         * lisp.h (struct handler): var and chosen_clause are now volatile.
1006         (struct catchtag): val, next, and pdlcount are now volatile.
1008         * bidi.c (bidi_push_it, bidi_pop_it):
1009         * fns.c (copy_hash_table):
1010         * image.c (define_image_type):
1011         * keyboard.c (kbd_buffer_store_event_hold):
1012         * process.c (Fprocess_send_eof):
1013         * xfaces.c (x_create_gc) [HAVE_NS]:
1014         * xgselect.c (xg_select):
1015         Prefer assignment to memcpy when either will do.
1017         * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1018         Use pointer-to-a-pointer to simplify and avoid a NILP check each
1019         time an item is removed.  No need to mark this function 'inline';
1020         the compiler knows better than we do.
1022 2012-09-11  Jan Djärv  <jan.h.d@swipnet.se>
1024         * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1025         (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1026         to change_frame_size (Bug#12388).
1027         (windowDidResize:): Pass YES to updateFrameSize.
1029         * nsterm.h: Add delay parameter to updateFrameSize.
1031 2012-09-11  Dmitry Antipov  <dmantipov@yandex.ru>
1033         Discard killed buffers from deleted window and frame objects.
1034         This reduces an amount of references to killed buffers and
1035         helps GC to reclaim them faster.
1036         * alloc.c (discard_killed_buffers): New function.
1037         (mark_object): Use it for deleted windows and frames.
1038         (mark_object): If symbol's value is set up for a killed buffer
1039         or deleted frame, restore it's global binding.
1040         * data.c (swap_in_global_binding): Add GC notice.
1041         (swap_in_symval_forwarding): Use convenient set_blv_where.
1042         * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1043         * window.h: ... to here.
1045 2012-09-11  Dmitry Antipov  <dmantipov@yandex.ru>
1047         Convenient macro to check whether the buffer is live.
1048         * buffer.h (BUFFER_LIVE_P): New macro.
1049         * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1050         * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1052 2012-09-11  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
1054         * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1055         composition cases (Bug#12364).
1057         * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1058         overhang of succeeding glyphs overlapping box cursor.
1060         * w32term.c (x_draw_glyph_string): Likewise.
1062 2012-09-11  Paul Eggert  <eggert@cs.ucla.edu>
1064         Simplify, document, and port floating-point (Bug#12381).
1065         The porting part of this patch fixes bugs on non-IEEE platforms
1066         with frexp, ldexp, logb.
1067         * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1068         Now static.
1069         * floatfns.c: Simplify discussion of functions that Emacs doesn't
1070         support, by removing commented-out code and briefly listing the
1071         C89 functions excluded.  The commented-out stuff was confusing
1072         maintenance, e.g., we thought we needed cbrt but it was commented out.
1073         (logb): Remove decl; no longer needed.
1074         (isfinite): New macro, if not already supplied.
1075         (isnan): Don't replace any existing macro.
1076         (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1077         are present on all C89 platforms.
1078         (Ffrexp): Do not special-case zero, as frexp does the right thing
1079         for that case.
1080         (Flogb): Do not use logb, as it doesn't have the desired meaning
1081         on hosts that use non-base-2 floating point.  Instead, stick with
1082         frexp, which is C89 anyway.  Do not pass an infinity or a NaN to
1083         frexp, to avoid getting an unspecified result.
1085         * xdisp.c (Qinhibit_debug_on_message): Now static.
1087 2012-09-10  Jan Djärv  <jan.h.d@swipnet.se>
1089         * nsterm.m (ns_update_begin): Set clip path to whole view by using
1090         NSBezierPath (Bug#12131).
1092 2012-09-10  Chong Yidong  <cyd@gnu.org>
1094         * fns.c (Fdelq, Fdelete): Doc fix.
1096 2012-09-10  Paul Eggert  <eggert@cs.ucla.edu>
1098         * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1099         (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1101 2012-09-09  Stefan Monnier  <monnier@iro.umontreal.ca>
1103         * lisp.h (make_lisp_ptr): New macro to replace XSET.
1104         (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1105         Use it.
1107 2012-09-09  Eli Zaretskii  <eliz@gnu.org>
1109         * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1110         left fringe if the window has a left margin.  This avoids leaving
1111         traces of the cursor because its leftmost pixel is not drawn over.
1113         * dispnew.c (update_window_line): When the left margin area of a
1114         screen line is updated, set the redraw_fringe_bitmaps_p flag of
1115         that screen line.  (Bug#12277)
1117 2012-09-09  Paul Eggert  <eggert@cs.ucla.edu>
1119         Assume C89 or later for math functions (Bug#12381).
1120         This simplifies the code, and makes it a bit smaller and faster,
1121         and (most important) makes it easier to clean up signal handling
1122         since we can stop worring about floating-point exceptions in
1123         library code.  That was a problem before C89, but the problem
1124         went away many years ago on all practical Emacs targets.
1125         * data.c, image.c, lread.c, print.c:
1126         Don't include <math.h>; no longer needed.
1127         * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1128         might be autoconfigured, as that never happens.
1129         * data.c (fmod):
1130         * doprnt.c (DBL_MAX_10_EXP):
1131         * print.c (DBL_DIG):
1132         Remove.  C89 or later always defines these.
1133         * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1134         (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1135         (arith_error, domain_error, domain_error2):
1136         Remove all this pre-C89 cruft.  Do not include <errno.h> as that's
1137         no longer needed -- we simply return what C returns.  All uses removed.
1138         (IN_FLOAT, IN_FLOAT2): Remove.  All uses replaced with
1139         the wrapped code.
1140         (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1141         Remove.  All uses expanded, as these macros are no longer used
1142         more than once and are now more trouble than they're worth.
1143         (Ftan): Use tan, not sin / cos.
1144         (Flogb): Assume C89 frexp.
1145         (fmod_float): Assume C89 fmod.
1146         (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1147         (init_floatfns): Remove.  All uses removed.
1149 2012-09-08  Jan Djärv  <jan.h.d@swipnet.se>
1151         * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1152         compositeToPoint for OSX < 10.6 (Bug#12390).
1154 2012-09-08  Paul Eggert  <eggert@cs.ucla.edu>
1156         * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1157         This produces more-accurate results.
1159 2012-09-08  Jan Djärv  <jan.h.d@swipnet.se>
1161         * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1162         changes (Bug#12088).
1164 2012-09-08  Chong Yidong  <cyd@gnu.org>
1166         * syntax.c (Fstring_to_syntax): Doc fix.
1168 2012-09-08  Jan Djärv  <jan.h.d@swipnet.se>
1170         * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1171         in the internal border.
1172         (x_set_window_size): Remove static variables and their usage.
1173         (ns_redraw_scroll_bars): Fix NSTRACE arg.
1174         (ns_after_update_window_line, ns_draw_fringe_bitmap):
1175         Remove fringe/internal border adjustment (Bug#11052).
1176         (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1177         (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1178         (ns_fix_rect_ibw): Remove.
1179         (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1180         (ns_dumpglyphs_box_or_relief): Ditto.
1181         (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1182         adjustment.
1183         (ns_dumpglyphs_image): Ditto.
1184         (ns_dumpglyphs_stretch): Fix coding style.  Remove fringe/internal
1185         border adjustment.
1186         (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1187         their usage.  Add fringe_extended_p and its use as in other terms.
1188         (ns_judge_scroll_bars): Code style fix.  Call updateFrameSize if
1189         scroll bar was removed.
1190         (updateFrameSize): New function.
1191         (windowDidResize): Move code to updateFrameSize and call it.
1193         * nsterm.h (EmacsView): Add updateFrameSize.
1195 2012-09-07  Chong Yidong  <cyd@gnu.org>
1197         * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1199         * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1201 2012-09-07  Paul Eggert  <eggert@cs.ucla.edu>
1203         More signal-handler cleanup (Bug#12327).
1204         * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1205         Problem introduced when merging patches.  Noted by Eli Zaretskii in
1206         <http://bugs.gnu.org/12327#67>.
1207         * floatfns.c: Comment fix.
1208         * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1209         SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1210         and anyway the declaration is harmless even if SIGDANGER is not defined.
1211         * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1212         defined BROKEN_FIONREAD).  systty.h formerly did this, but other
1213         source files not surprisingly expected syssignal.h to define, or
1214         not define, SIGIO, and it's cleaner to do it that way, for consistency.
1215         Include <sys/ioctl.h>, for FIONREAD.
1216         * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1217         This eliminates a problem whereby other files mysteriously had
1218         to include "syssignal.h" before including "systty.h" if they
1219         wanted to use "#ifdef SIGIO".
1221 2012-09-07  Eli Zaretskii  <eliz@gnu.org>
1223         * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1225         * w32.c (sigemptyset): Empty the set.
1226         (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1228         * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1230 2012-09-07  Dmitry Antipov  <dmantipov@yandex.ru>
1232         * alloc.c (mark_buffer): Revert unsafe marking optimization.
1233         (mark_object): Likewise for frame objects.
1235 2012-09-07  Paul Eggert  <eggert@cs.ucla.edu>
1237         * syssignal.h (handle_on_main_thread): Always declare,
1238         even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1239         This ports to platforms without HAVE_PTHREAD.
1241 2012-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1243         Signal-handler cleanup (Bug#12327).
1244         Emacs's signal handlers were written in the old 4.2BSD style with
1245         sigblock and sigmask and so forth, and this led to some
1246         inefficiencies and confusion.  Rewrite these to use
1247         pthread_sigmask etc. without copying signal sets around.  Also,
1248         get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1249         'signal', and instead use functions that do not attempt to take
1250         over the system name space.  This patch causes Emacs's text
1251         segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1252         * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1253         Do not include <signal.h> or "syssignal.h", as these
1254         modules do not use signals.
1255         * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1256         * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1257         Do not include <signal.h>, as "syssignal.h" does that for us now.
1258         * atimer.c (sigmask_atimers): New function.
1259         (block_atimers, unblock_atimers): New functions,
1260         replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1261         All uses replaced.
1262         * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1263         no longer needed here.
1264         * emacs.c (main): Inspect existing signal handler with sigaction,
1265         so that there's no need to block and unblock SIGHUP.
1266         * sysdep.c (struct save_signal): New member 'action', replacing
1267         old member 'handler'.
1268         (save_signal_handlers, restore_signal_handlers):
1269         Use sigaction instead of 'signal' to save and restore.
1270         (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1271         New function.  All users of 'signal' modified to use set_sighandler
1272         if they're writeonly, and to use sys_signal if they're read+write.
1273         (emacs_sigaction_init, forwarded_signal): New functions.
1274         (sys_signal): Remove.  All uses replaced by calls to sigaction
1275         and emacs_sigaction_init, or by direct calls to 'signal'.
1276         (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1277         (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1278         all uses replaced by pthread_sigmask etc. calls.
1279         * syssignal.h: Include <signal.h>.
1280         (emacs_sigaction_init, forwarded_signal): New decls.
1281         (SIGMASKTYPE): Remove.  All uses replaced by its definiens, sigset_t.
1282         (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1283         (sigmask, sys_sigmask): Remove; no longer needed.
1284         (sigpause): Remove.  All uses replaced by its definiens, sigsuspend.
1285         (sigblock, sigunblock, sigfree):
1286         (sigsetmask) [!defined sigsetmask]:
1287         Remove.  All uses replaced by pthread_sigmask.
1288         (signal): Remove.  Its remaining uses (with SIG_DFL and SIG_IGN)
1289         no longer need to be replaced, and its typical old uses
1290         are now done via emacs_sigaction_init and sigaction.
1291         (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1292         (sys_sigdel): Remove; unused.
1293         (NSIG): Remove a FIXME; the code's fine.  Remove an unnecessary ifdef.
1295 2012-09-06  Eli Zaretskii  <eliz@gnu.org>
1297         * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1298         SIGCHLD handling on systems that don't have WNOHANG.  (Bug#12327)
1300 2012-09-06  Dmitry Antipov  <dmantipov@yandex.ru>
1302         Explicitly mark buffer_defaults and buffer_local_symbols.
1303         * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1304         mark_local_symbols here.
1305         (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1306         since special buffers aren't marked here any more.
1307         (allocate_buffer): Chain new buffer with all_buffers here...
1308         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1309         not here.
1310         (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1311         (syms_of_buffer): Remove staticpro of the above.
1312         (init_buffer_once): Set names for buffer_defaults and
1313         buffer_local_symbols.
1315 2012-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1317         Use bool for booleans in font-related modules.
1318         * font.c (font_intern_prop, font_style_to_value)
1319         (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1320         (generate_otf_features, font_check_otf_features, font_check_otf)
1321         (font_match_p, font_list_entities, font_at):
1322         * fontset.c (fontset_id_valid_p, reorder_font_vector
1323         (fontset_find_font, Fset_fontset_font)
1324         (face_suitable_for_char_p) [0]:
1325         * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1326         (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1327         (m17n_flt_initialized, ftfont_shape_by_flt):
1328         * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1329         * nsfont.m (nsfont_draw):
1330         * w32font.c (w32font_draw):
1331         * w32term.c (x_draw_glyphless_glyph_string_foreground):
1332         Use bool for booleans.
1333         * font.h: Adjust to above API changes.
1334         (struct font, struct font_driver, struct font_driver_list):
1335         Use bool for booleans.
1336         (struct font): Remove useless member encoding_type.
1337         All users removed.
1338         * fontset.c, xftfont.c: Omit unnecessary static decls.
1340 2012-09-06  Dmitry Antipov  <dmantipov@yandex.ru>
1342         * alloc.c (mark_object): Revert window marking code
1343         since it's unsafe for the Fset_window_configuration.
1345 2012-09-05  Paul Eggert  <eggert@cs.ucla.edu>
1347         Fix race conditions with signal handlers and errno (Bug#12327).
1348         Be more systematic about preserving errno whenever a signal
1349         handler returns, even if it's not in the main thread.  Do this by
1350         renaming signal handlers to distinguish between signal delivery
1351         and signal handling.  All uses changed.
1352         * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1353         * data.c (deliver_arith_signal): Rename from arith_error.
1354         * dispnew.c (deliver_window_change_signal): Rename from
1355         window_change_signal.
1356         * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1357         (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1358         * keyboard.c (deliver_input_available_signal): Rename from
1359         input_available_signal.
1360         (deliver_user_signal): Rename from handle_user_signal.
1361         (deliver_interrupt_signal): Rename from interrupt_signal.
1362         * process.c (deliver_pipe_signal): Rename from send_process_trap.
1363         (deliver_child_signal): Rename from sigchld_handler.
1364         * atimer.c (handle_alarm_signal):
1365         * data.c (handle_arith_signal):
1366         * dispnew.c (handle_window_change_signal):
1367         * emacs.c (handle_fatal_signal, handle_danger_signal):
1368         * keyboard.c (handle_input_available_signal):
1369         * keyboard.c (handle_user_signal, handle_interrupt_signal):
1370         * process.c (handle_pipe_signal, handle_child_signal):
1371         New functions, with the actual signal-handling code taken from the
1372         original respective signal handlers, sans the sporadic attempts to
1373         preserve errno, since that's now done by handle_on_main_thread.
1374         * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1375         * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1376         * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1377         Move to sysdep.c.
1378         (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1379         Move initialization of main_thread to sysdep.c's init_signals.
1380         * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1381         our usage, and simplifies the mainline code.
1382         (record_child_status_change): New static function, as a helper
1383         for handle_child_signal, and with most of the old child handler's
1384         contents.
1385         (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1386         (handle_child_signal): Use the above.
1387         * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1388         Moved here from emacs.c.
1389         (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1390         code moved here from emacs.c's main function.
1391         * sysdep.c, syssignal.h (handle_on_main_thread): New function,
1392         replacing the old SIGNAL_THREAD_CHECK.  All uses changed.
1393         This lets callers save and restore errno properly.
1395 2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
1397         Remove redundant or unused things here and there.
1398         * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1399         * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1400         * editfns.c (Fcompare_buffer_substrings): Likewise.
1401         * frame.h (struct terminal, struct font_driver_list):
1402         Remove redundant declarations.
1403         * window.h (Qleft, Qright): Likewise.
1405 2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
1407         Do not mark objects from deleted buffers, windows and frames.
1408         * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1409         (mark_object): Likewise for windows and frames.
1411 2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
1413         * alloc.c (valid_lisp_object_p): Treat killed buffers,
1414         buffer_defaults and buffer_local_symbols as valid objects.
1415         Return special value to denote them.
1417 2012-09-05  Paul Eggert  <eggert@cs.ucla.edu>
1419         * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1420         * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1421         (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1422         (file_name_absolute_p, Fsubstitute_in_file_name):
1423         (check_executable, check_writable, Ffile_accessible_directory_p)
1424         (Fset_file_selinux_context, Fdefault_file_modes)
1425         (Finsert_file_contents, choose_write_coding_system)
1426         (Fwrite_region, build_annotations, a_write, e_write)
1427         (Fdo_auto_save):
1428         * filelock.c (boot_time_initialized, get_boot_time)
1429         (get_boot_time_1, lock_file_1, within_one_second):
1430         * floatfns.c (in_float):
1431         * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1432         (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1433         (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1434         * lisp.h (struct Lisp_Hash_Table.cmpfn):
1435         * window.c (compare_window_configurations):
1436         Use bool for booleans.
1437         * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1438         (Fdefault_file_modes): Now mode_t, not int, for modes.
1439         (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1440         (internal_delete_file): Now returns void, not a (boolean) int,
1441         since nobody was looking at the return value.
1442         * lisp.h, window.h: Adjust to above API changes.
1444         * xdisp.c (set_message): Simplify and reindent last change.
1446 2012-09-05  Juanma Barranquero  <lekktu@gmail.com>
1448         * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1450 2012-09-04  Lars Ingebrigtsen  <larsi@gnus.org>
1452         * eval.c (call_debugger): Make the function non-static so that we
1453         can call it from set_message.
1455         * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1456         (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1458 2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
1460         Give more-useful info on a fatal error (Bug#12328).
1461         * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1462         (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1463         of doing the work ourselves.
1464         * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1465         do most of the work.
1466         (fatal_error_backtrace): New function, taken from the guts
1467         of the old fatal_error_signal, but with a new option to output
1468         a backtrace.
1469         (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1470         info about the signal than just its number.
1471         * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1472         * sysdep.c: Include <execinfo.h>
1473         (emacs_backtrace): New function, taken partly from the previous
1474         code of the 'die' function.
1475         (emacs_abort): Call fatal_error_backtrace rather than abort.
1477 2012-09-04  Stefan Monnier  <monnier@iro.umontreal.ca>
1479         * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1480         eager (load-time) macro-expansion.
1481         * lisp.mk (lisp): Add macroexp.
1483 2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
1485         Simplify redefinition of 'abort' (Bug#12316).
1486         Do not try to redefine the 'abort' function.  Instead, redo
1487         the code so that it calls 'emacs_abort' rather than 'abort'.
1488         This removes the need for the NO_ABORT configure-time macro
1489         and makes it easier to change the abort code to do a backtrace.
1490         * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1491         * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1492         Remove; sysdep.c's emacs_abort now takes its place.
1493         * lisp.h (emacs_abort): New decl.  All calls from Emacs code to
1494         'abort' changed to use 'emacs_abort'.
1495         * msdos.c (dos_abort) [defined abort]: Remove; not used.
1496         (abort) [!defined abort]: Rename to ...
1497         (emacs_abort): ... new name.
1498         * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1499         the place of the old 'abort' in emacs.c.
1500         * w32.c, w32fns.c (abort): Do not #undef.
1501         * w32.c (emacs_abort): Rename from w32_abort.
1503 2012-09-04  Eli Zaretskii  <eliz@gnu.org>
1505         * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1506         offsets[j].dv, since the y axis of the screen coordinates points
1507         down, while the y axis of the font definition coordinates points
1508         up.  This fixes display of Arabic diacritics such as KASRA and
1509         KASRATAN.  (Bug#11860)
1511 2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
1513         Be more systematic about _setjmp vs setjmp.
1514         * alloc.c (test_setjmp, mark_stack):
1515         * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1516         (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1517         (png_load, my_error_exit, jpeg_load):
1518         * process.c (send_process_trap, send_process):
1519         Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1520         The underscored versions are up to 30x faster on some hosts.
1521         Formerly, the code used setjmp+longjmp sometimes and
1522         _setjmp+_longjmp at other times, with no particular reason to
1523         prefer setjmp+longjmp.
1525 2012-09-03  Paul Eggert  <eggert@cs.ucla.edu>
1527         Fix minor problem found by static checking.
1528         * buffer.c (Fdelete_all_overlays): Return nil.
1530 2012-09-03  Martin Rudalics  <rudalics@gmx.at>
1532         * buffer.c (Fdelete_all_overlays): New function.
1534 2012-09-03  Chong Yidong  <cyd@gnu.org>
1536         * gtkutil.c: Add extern decl for Qxft.
1538 2012-09-02  Paul Eggert  <eggert@cs.ucla.edu>
1540         * emacs.c, eval.c: Use bool for boolean.
1541         * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1542         (malloc_using_checking) [DOUG_LEA_MALLOC]:
1543         (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1544         (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1545         (main, decode_env_path, Fdaemon_initialized):
1546         * eval.c (call_debugger, Finteractive_p, interactive_p):
1547         (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1548         (maybe_call_debugger, Fbacktrace):
1549         * process.c (read_process_output, exec_sentinel):
1550         Use bool for booleans.
1551         * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1552         All callers changed.
1553         * eval.c (interactive_p): Omit always-true boolean argument
1554         EXCLUDE_SUBRS_P.  All callers changed.
1555         * dispextern.h, lisp.h: Reflect above API changes.
1556         * firstfile.c (dummy): Use the address of 'main', whose signature
1557         won't change, instead of the address of 'initialize', whose
1558         signature just changed from int to bool.
1559         * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1560         * msdos.c (fatal_error_in_progress): ... from here.
1561         * xdisp.c (redisplaying_p): Now a boolean.  Set it to 1 instead
1562         of incrementing it.
1563         (redisplay_internal, unwind_redisplay): Simply clear
1564         REDISPLAYING_P when unwinding, instead of saving its previous,
1565         always-false value and then restoring it.
1567         Clean up some extern decls.
1568         Mostly, this hoists extern decls out of .c files and into .h files.
1569         That way, we're more likely to catch errors if the interfaces change.
1570         * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1571         declare xg_mark_data.
1572         * dispextern.h (x_frame_parm_handlers):
1573         * font.h (Qxft):
1574         * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1575         (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1576         (Qultra_bold, Qoblique, Qitalic):
1577         Move extern decl here from .c file.
1578         * alloc.c (xg_mark_data) [USE_GTK]:
1579         * doc.c (Qclosure):
1580         * eval.c (Qlexical_binding):
1581         * fns.c (time) [!HAVE_UNISTD_H]:
1582         * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1583         (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1584         * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1585         * lread.c (Qinternal_interpreter_environment):
1586         * minibuf.c (Qbuffer):
1587         * process.c (QCfamily, QCfilter):
1588         * widget.c (free_frame_faces):
1589         * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1590         * xfont.c (x_clear_errors):
1591         * xterm.c (x_frame_parm_handlers):
1592         Remove now-redundant extern decls.
1593         * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1594         * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1595         Now static.
1596         * xfaces.c: Remove unnecessary static decls.
1597         * xterm.c (updating_frame): Remove decl of nonexistent object.
1599         * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1600         when building globals.h, as the objects that are not built on
1601         this host are not needed to compile C files on this host.
1603 2012-09-02  Jan Djärv  <jan.h.d@swipnet.se>
1605         * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1607         * frame.h: Add missing prototype for x_wm_set_size_hint.
1609 2012-09-02  Paul Eggert  <eggert@cs.ucla.edu>
1611         * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1612         * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1613         (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1614         (Fsubstitute_command_keys):
1615         * editfns.c (region_limit, find_field, Fconstrain_to_field)
1616         (save_excursion_save, save_excursion_restore)
1617         (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1618         (format_time_string, general_insert_function)
1619         (make_buffer_string, make_buffer_string_both)
1620         (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1621         * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1622         (copy_text, insert_1, insert_1_both, insert_from_string)
1623         (insert_from_string_before_markers, insert_from_string_1)
1624         (insert_from_buffer, insert_from_buffer_1, replace_range)
1625         (replace_range_2, del_range_1, del_range_byte, del_range_both)
1626         (del_range_2, modify_region):
1627         * intervals.c (intervals_equal, balance_possible_root_interval)
1628         (adjust_intervals_for_insertion, merge_properties_sticky)
1629         (graft_intervals_into_buffer, lookup_char_property)
1630         (adjust_for_invis_intang, set_point_both)
1631         (get_property_and_range, compare_string_intervals)
1632         (set_intervals_multibyte_1, set_intervals_multibyte):
1633         * keyboard.c (decode_timer):
1634         Use bool for boolean.
1635         * intervals.h, lisp.h, systime.h: Reflect above API changes.
1636         * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1638 2012-09-02  Chong Yidong  <cyd@gnu.org>
1640         * keymap.c (push_key_description): Print M-TAB as C-M-i
1641         (Bug#11758).
1643 2012-09-02  Juanma Barranquero  <lekktu@gmail.com>
1645         * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1646         (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1647         ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1648         ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1649         ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1650         ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1651         ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1653 2012-09-01  Eli Zaretskii  <eliz@gnu.org>
1655         * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1656         more than one grapheme cluster passed to the shaper: compute the
1657         offset adjustment values separately for each cluster.  (Bug#11860)
1659         * image.c: Restore mistakenly removed inclusion of w32.h.  Without
1660         it, GCC doesn't see prototypes of w32_delayed_load, and complains
1661         about implicit conversions from integer to pointer.
1663 2012-09-01  Daniel Colascione  <dancol@dancol.org>
1665         * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1666         system used too early.
1668 2012-09-01  Paul Eggert  <eggert@cs.ucla.edu>
1670         Better seed support for (random).
1671         * emacs.c (main): Call init_random.
1672         * fns.c (Frandom): Set the seed from a string argument, if given.
1673         Remove long-obsolete Gentzel cruft.
1674         * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1675         (init_random): New function.
1677 2012-09-01  Daniel Colascione  <dancol@dancol.org>
1679         * xterm.h: Add header guards.  Declare x_menubar_window_to_frame.
1680         Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1681         x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1682         x_wm_set_size_hint, x_query_colors, x_real_positions,
1683         x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1684         x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1685         all of which have been moved to common code.
1687         * xfaces.c: Include TERM_HEADER instead of listing all possible
1688         window-system headers.
1690         * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1691         to match header.
1693         * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1694         directly accessing frame internals.
1696         * w32font.h: Include font.h.  Define syms_of_w32font and
1697         globals_of_w32font.
1699         * process.c: Include TERM_HEADER instead of listing all possible
1700         window-system headers.
1702         * nsterm.h: Remove declarations now in frame.h.
1703         Define FRAME_X_SCREEN, FRAME_X_VISUAL.
1705         * menu.c: Include TERM_HEADER instead of listing all possible
1706         window-system headers.
1708         * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1709         window system.
1711         * keyboard.c: Include TERM_HEADER instead of listing all possible
1712         window-system headers.
1714         * image.c: Include TERM_HEADER instead of listing all possible
1715         window-system headers.  Declare Vlibrary_cache when compiling for
1716         Windows.
1718         * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1719         window system declarations.
1721         * frame.h: Move common functions here: set_frame_menubar,
1722         x_set_window_size, x_sync, x_get_focus_frame,
1723         x_set_mouse_position, x_set_mouse_pixel_position,
1724         x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1725         x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1726         x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1727         x_activate_menubar, x_real_positions, x_bitmap_icon,
1728         x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1729         and x_query_colors.
1731         * frame.c: Include TERM_HEADER instead of listing all possible
1732         window-system headers.
1734         * font.c: Include TERM_HEADER instead of listing all possible
1735         window-system headers.
1737         * emacs.c: Include TERM_HEADER.
1739         * dispnew.c: Include TERM_HEADER instead of listing all possible
1740         window-system headers.
1742         * ccl.h: Include character.h.
1744         * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1745         the current window system; include in list of objects to link into
1746         Emacs.
1748 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
1750         Remove mark_ttys function and fix tty_display_info initialization.
1751         * lisp.h (mark_ttys): Remove prototype.
1752         * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1753         to mark_ttys because all possible values of 'top_frame' slot are
1754         the frames which are reachable from Vframe_list.
1755         * term.c (mark_ttys): Remove.
1756         (init_tty): Safely initialize 'top_frame' slot with Qnil.
1758 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
1760         Change struct frame bitfields from unsigned char to unsigned.
1761         * frame.h (struct frame): Change type of 'display_preempted',
1762         'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1763         'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
1764         'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
1765         bitfields from unsigned char to unsigned.
1767 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
1769         Remove unused member of struct x_output and struct w32_output.
1770         * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
1771         * w32term.h (struct w32_output): Likewise.
1773 2012-08-30  Jan Djärv  <jan.h.d@swipnet.se>
1775         * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
1776         does not become zero (Bug#12234).
1778 2012-08-30  Paul Eggert  <eggert@cs.ucla.edu>
1780         * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
1781         for GCC 4.7.1 x86-64.
1783 2012-08-30  Glenn Morris  <rgm@gnu.org>
1785         * lread.c (init_lread): For out-of-tree builds, only add the
1786         source directory's site-lisp dir to the load-path if it exists,
1787         consistent with in-tree builds.  (Bug#12302)
1789 2012-08-28  Jan Djärv  <jan.h.d@swipnet.se>
1791         * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1792         button_values to NULL.  Call setStykeMask so dialogs get a close button.
1793         (windowShouldClose:): Set window_closed.
1794         (dealloc): New member, free button_values.
1795         (process_dialog:): Make member function.  Remove window argument,
1796         replace window with self.  Count buttons and allocate and store values
1797         in button_values.
1798         (addButton:value:row:): value is int with the name tag.  Call setTag
1799         with tag.  Remove return self, declare return value as void.
1800         (addString:row:): Remove return self, declare return value as void.
1801         (addSplit): Remove return self, declare return value as void.
1802         (clicked:): Remove return self, declare return value as void.
1803         Set dialog_return to button_values[seltag].  Code formatting change.
1804         (initFromContents:isQuestion:): Adjust call to process_dialog.
1805         Code formatting change.
1806         (timeout_handler:): Set timer_fired to YES.
1807         (runDialogAt:): Set timer_fired to NO.
1808         Handle click on close button as quit.
1810         * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1811         Add window_closed and button_values.  Add void as return value for
1812         add(Button|String|Split).  addButton takes int instead of Lisp_Object.
1813         Add process_dialog as new member.
1815 2012-08-28  Eli Zaretskii  <eliz@gnu.org>
1817         * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1818         is not one of the heaps we manage.  (Bug#12242)
1820 2012-08-28  Glenn Morris  <rgm@gnu.org>
1822         * eval.c (Fcalled_interactively_p): Doc fix.  (Bug#11747)
1824 2012-08-28  Martin Rudalics  <rudalics@gmx.at>
1826         * window.c (Fset_window_configuration): Remove handling of
1827         auto-buffer-name window parameter.  Install revision of reverted
1828         fix.
1830 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
1832         Do not allow to set major mode for a dead buffer.
1833         * buffer.c (Fset_buffer_major_mode): Signal an error
1834         if the buffer is dead.
1835         (Fother_buffer, other_buffer_safely): Remove redundant
1836         nested declaration.
1838 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
1840         Always use set_buffer_if_live to restore original buffer at unwind.
1841         * buffer.h (record_unwind_current_buffer): New function.
1842         * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1843         * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1844         * undo.c, window.c: Adjust users.
1845         * buffer.c (set_buffer_if_live): Fix comment.
1847 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
1849         Fix usage of set_buffer_internal.
1850         * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1851         * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1852         * coding.c (decode_coding): Omit redundant test.
1853         * fileio.c (decide_coding_unwind): Likewise.
1854         * fns.c (secure_hash): Likewise.
1855         * insdel.c (modify_region): Likewise.
1856         * keyboard.c (command_loop_1): Likewise.
1857         * print.c (PRINTFINISH): Likewise.
1858         * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1860 2012-08-27  Paul Eggert  <eggert@cs.ucla.edu>
1862         * dispnew.c: Use bool for boolean.
1863         (frame_garbaged, display_completed, delayed_size_change)
1864         (fonts_changed_p, add_window_display_history)
1865         (add_frame_display_history, verify_row_hash)
1866         (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1867         (row_equal_p, realloc_glyph_pool)
1868         (allocate_matrices_for_frame_redisplay)
1869         (showing_window_margins_p)
1870         (adjust_frame_glyphs_for_frame_redisplay)
1871         (build_frame_matrix_from_leaf_window, make_current)
1872         (mirrored_line_dance, mirror_line_dance, update_frame)
1873         (update_window_tree, update_single_window)
1874         (check_current_matrix_flags, update_window, update_text_area)
1875         (update_window_line, set_window_update_flags, scrolling_window)
1876         (update_frame_1, scrolling, buffer_posn_from_coords)
1877         (do_pending_window_change, change_frame_size)
1878         (change_frame_size_1, sit_for):
1879         Use bool for boolean.
1880         (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
1881         and remove last int (actually boolean) argument, which was always 0.
1882         All callers changed.
1883         * dispextern.h, frame.h, lisp.h: Reflect above API changes.
1884         * dispextern.h (struct composition_it): Use bool for boolean.
1885         (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
1886         (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
1887         * dired.c (file_name_completion):
1888         Use bool for boolean.  (This was missed in an earlier change.)
1890 2012-08-27  Martin Rudalics  <rudalics@gmx.at>
1892         * window.c (Fset_window_configuration): Revert first part of
1893         last change.
1895 2012-08-27  Jan Djärv  <jan.h.d@swipnet.se>
1897         * nsterm.h (NSPanel): New class variable dialog_return.
1899         * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
1900         Initialize dialog_return.
1901         (windowShouldClose:): Use stop instead of stopModalWithCode.
1902         (clicked:): Ditto, and also set dialog_return (Bug#12258).
1903         (timeout_handler:): Use stop instead of abortModal.  Send a dummy
1904         event.
1905         (runDialogAt:): Make ret Lisp_Object.  Set it from dialog_return when
1906         modal loop returns.
1908 2012-08-27  Paul Eggert  <eggert@cs.ucla.edu>
1910         * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
1911         * composite.c (find_composition, composition_gstring_p)
1912         (composition_reseat_it, find_automatic_composition):
1913         * data.c (let_shadows_buffer_binding_p)
1914         (let_shadows_global_binding_p, set_internal, make_blv)
1915         (Fmake_variable_buffer_local, Fmake_local_variable)
1916         (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
1917         (cons_to_signed, arith_driver):
1918         * dbusbind.c (xd_in_read_queued_messages):
1919         * dired.c (directory_files_internal, file_name_completion):
1920         Use bool for booleans.
1921         * dired.c (file_name_completion):
1922         * process.h (fd_callback):
1923         Omit int (actually boolean) argument.  It wasn't being used.
1924         All uses changed.
1925         * composite.h, lisp.h: Reflect above API changes.
1927         * cmds.c, coding.c: Use bool for booleans.
1928         * cmds.c (move_point, Fself_insert_command):
1929         * coding.h (struct composition status, struct coding_system):
1930         * coding.c (detect_coding_utf_8, encode_coding_utf_8)
1931         (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
1932         (emacs_mule_char, decode_coding_emacs_mule)
1933         (encode_coding_emacs_mule, detect_coding_iso_2022)
1934         (decode_coding_iso_2022, encode_invocation_designation)
1935         (encode_designation_at_bol, encode_coding_iso_2022)
1936         (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
1937         (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
1938         (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
1939         (encode_coding_raw_text, detect_coding_charset)
1940         (decode_coding_charset, encode_coding_charset, detect_eol)
1941         (detect_coding, get_translation_table, produce_chars)
1942         (consume_chars, reused_workbuf_in_use)
1943         (make_conversion_work_buffer, code_conversion_save)
1944         (decode_coding_object, encode_coding_object)
1945         (detect_coding_system, char_encodable_p)
1946         (Funencodable_char_position, code_convert_region)
1947         (code_convert_string, code_convert_string_norecord)
1948         (Fset_coding_system_priority):
1949         * fileio.c (Finsert_file_contents):
1950         Use bool for booleans.
1951         * coding.h, lisp.h: Reflect above API changes.
1952         * coding.c: Remove unnecessary static function decls.
1953         (detect_coding): Use unsigned, not signed, to copy an unsigned field.
1954         (decode_coding, encode_coding, decode_coding_gap): Return 'void',
1955         not a boolean 'int', since callers never look at the return value.
1956         (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
1957         * coding.h (decoding_buffer_size, encoding_buffer_size)
1958         (emacs_mule_string_char): Remove unused extern decls.
1959         (struct iso_2022_spec, struct coding_system):
1960         Use 'unsigned int : 1' for boolean fields, since there's more than one.
1961         (struct emacs_mule_spec): Remove unused field 'full_support'.
1962         All initializations removed.
1963         * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
1965 2012-08-27  Dmitry Antipov  <dmantipov@yandex.ru>
1967         Fix spare memory change (Bug#12286).
1968         * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
1969         (valid_lisp_object_p): Likewise.
1971 2012-08-27  Martin Rudalics  <rudalics@gmx.at>
1973         * window.c (Fset_window_configuration): Record any window's old
1974         buffer if it's replaced (see Bug#8789).  If the new current
1975         buffer doesn't appear in the selected window, go to its old
1976         point (Bug#12208).
1978 2012-08-27  Dmitry Antipov  <dmantipov@yandex.ru>
1980         Special MEM_TYPE_SPARE to denote reserved memory.
1981         * alloc.c (enum mem_type): New memory type.
1982         (refill_memory_reserve): Use new type for spare memory.
1983         This prevents live_cons_p and live_string_p from incorrect
1984         detection of uninitialized objects from spare memory as live.
1986 2012-08-26  Paul Eggert  <eggert@cs.ucla.edu>
1988         Spelling fixes.
1989         * Makefile.in (.PHONY): versioclean -> versionclean.
1991         Remove unused external symbols.
1992         * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
1993         * window.c (Qwindow_valid_p, decode_valid_window):
1994         Now static, not extern.
1995         * data.c (Qinterval): Remove; unused.
1996         (syms_of_data): Do not define 'interval'.
1997         * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
1998         * window.h (decode_valid_window):
1999         Remove decls.
2001         * character.c, charset.c, chartab.c: Use bool for booleans.
2002         * character.c (lisp_string_width, string_count_byte8)
2003         (string_escape_byte8):
2004         * charset.c (charset_map_loaded, load_charset_map, read_hex):
2005         (load_charset_map_from_file, map_charset_chars)
2006         (Fdefine_charset_internal, define_charset_internal)
2007         (Fdeclare_equiv_charset, find_charsets_in_text)
2008         (Ffind_charset_region, char_charset, Fiso_charset):
2009         * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2010         (sub_char_table_set, sub_char_table_set_range)
2011         (char_table_set_range, optimize_sub_char_table)
2012         (map_sub_char_table):
2013         Use bool for boolean.
2014         * character.c (str_to_unibyte): Omit last boolean argument; it was
2015         always 0.  All callers changed.
2016         * character.h, charset.h: Adjust to match previous changes.
2017         * character.h (char_printable_p): Remove decl of nonexistent function.
2018         * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2019         ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2020         are all boolean, so make them single-bit bitfields.
2022         * lisp.h (ASET): Remove attempt to detect side effects.
2023         It was meant to be temporary and it often doesn't work,
2024         because when IDX has side effects the behavior of IDX==IDX
2025         is undefined.  See Stefan Monnier in
2026         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2028 2012-08-26  Barry OReilly  <gundaetiapo@gmail.com>  (tiny change)
2030         * lisp.h (functionp): New function (extracted from Ffunctionp).
2031         (FUNCTIONP): Use it.
2032         * eval.c (Ffunctionp): Use it.
2034 2012-08-25  Paul Eggert  <eggert@cs.ucla.edu>
2036         * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2037         as that's faster and simpler than static storage.  Don't bother
2038         with the g_main_context_query overhead if g_main_context_pending
2039         says no events are pending.
2040         (gfds, gfds_size): Remove these static vars.
2041         (xgselect_initialize): Remove; no longer needed.
2042         All uses and decls removed.
2044         * emacs.c (fatal_error_signal_hook): Remove.
2045         All uses removed.  This leftover from old code was always 0.
2047         * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2048         * casefiddle.c (casify_object, casify_region):
2049         * casetab.c (set_case_table):
2050         * category.c, category.h (word_boundary_p):
2051         * category.h (CHAR_HAS_CATEGORY):
2052         Use bool for booleans, instead of int.
2054 2012-08-25  Eli Zaretskii  <eliz@gnu.org>
2056         * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2058 2012-08-25  Paul Eggert  <eggert@cs.ucla.edu>
2060         On assertion failure, print backtrace if available.
2061         * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2062         (die) [ENABLE_CHECKING]: Print a backtrace if available.
2063         * Makefile.in (LIB_EXECINFO): New macro.
2064         (LIBES): Use it.
2066         * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2067         * bytecode.c (exec_byte_code):
2068         * callint.c (check_mark, Fcall_interactively):
2069         * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2070         (getenv_internal, sync_process_alive, call_process_exited):
2071         * lisp.h (USE_SAFE_ALLOCA):
2072         Use bool for booleans, instead of int.
2073         * lisp.h, process.h: Adjust prototypes to match above changes.
2074         * callint.c (Fcall_interactively): Don't assume the mark's
2075         offset fits in 'int'.
2077 2012-08-24  Paul Eggert  <eggert@cs.ucla.edu>
2079         * buffer.c, buffer.h: Use bool for boolean.
2080         * buffer.c (reset_buffer_local_variables)
2081         (buffer_lisp_local_variables, Fset_buffer_modified_p)
2082         (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2083         (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2084         (overlay_touches_p, overlay_strings, Foverlay_put)
2085         (report_overlay_modification, call_overlay_mod_hooks):
2086         (mmap_enlarge, mmap_set_vars):
2087         * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2088         Use bool for booleans, instead of int.
2089         * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2090         since the 1-or-0 return value is always ignored anyway.
2091         (mmap_initialized_p):
2092         * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2093         * buffer.h, lisp.h: Adjust prototypes to match above changes.
2095 2012-08-23  Paul Eggert  <eggert@cs.ucla.edu>
2097         * bidi.c: Use bool for boolean.
2098         This is a bit more readable, and makes the text segment of bidi.o
2099         0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2100         Presumably it's faster too.
2101         (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2102         Now bool.
2103         (bidi_cache_find_level_change, bidi_cache_iterator_state)
2104         (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2105         (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2106         (bidi_explicit_dir_char, bidi_level_of_next_char)
2107         (bidi_find_other_level_edge, bidi_move_to_visually_next):
2108         Use bool for booleans, instead of int.
2109         * dispextern.h (bidi_init_it, bidi_paragraph_init)
2110         (bidi_unshelve_cache): Adjust decls to match code.
2112 2012-08-23  Martin Rudalics  <rudalics@gmx.at>
2114         * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2115         argument.
2117 2012-08-23  Paul Eggert  <eggert@cs.ucla.edu>
2119         * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2120         * atimer.h: Include <stdbool.h>.
2122 2012-08-22  Dan Nicolaescu  <dann@gnu.org>
2124         * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2125         compile time tests instead of run time tests on systems that do
2126         not use them.
2127         (FRAME_MAC_P): Remove leftover from deleted code.
2128         * frame.c (syms_of_frame): Remove leftover from deleted code.
2130 2012-08-22  Jan Djärv  <jan.h.d@swipnet.se>
2132         * nsterm.m (insertText:): Don't clear modifiers if code is space.
2134 2012-08-22  Paul Eggert  <eggert@cs.ucla.edu>
2136         * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2137         Otherwise, the compiler complains about (A?B:C) where B is void
2138         and C is Lisp_Object.  This fixes an incompatibility with Sun C 5.12.
2139         (fontset_add): Return void, for FONTSET_ADD.
2141 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
2143         * alloc.c: Use bool for booleans.
2144         (gc_in_progress, abort_on_gc)
2145         (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2146         (dont_register_blocks) [GC_MALLOC_CHECK]:
2147         (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2148         (check_string_bytes, make_specified_string, memory_full)
2149         (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2150         (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2151         (mark_stack, valid_pointer_p, make_pure_string)
2152         (Fgarbage_collect, survives_gc_p, gc_sweep):
2153         Use bool for booleans, instead of int.
2154         (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2155         Remove unused local.
2156         * alloc.c (PURE_POINTER_P):
2157         * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2158         * editfns.c (Fformat):
2159         * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2160         (Fdo_auto_save):
2161         * fns.c (sweep_weak_table):
2162         * lisp.h (suppress_checking, push_message, survives_gc_p)
2163         (make_pure_string, gc_in_progress, abort_on_gc):
2164         * lread.c (readchar, read1):
2165         * print.c (Fprin1_to_string):
2166         * xdisp.c (push_message):
2167         Use bool for booleans affected directly or indirectly by
2168         alloc.c's changes.
2170         Make recently-introduced setters macros.
2171         * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2172         (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2173         (set_fontset_default, set_fontset_fallback): Rename from their
2174         upper-case counterparts, and make them functions rather than macros.
2175         This is more consistent with the other recently-introduced setters.
2176         These don't need to be inline, since they're local.
2178 2012-08-21  Jan Djärv  <jan.h.d@swipnet.se>
2180         * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2181         the loop (Bug#12247).
2183 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
2185         * lisp.h (vcopy): Use memcpy rather than our own loop.
2186         This fixes a performance regression introduced by the recent
2187         addition of vcopy.  This means 'vcopy' will need to be modified
2188         for a copying collector, but that's OK.  Also, tighten the
2189         checking in the assertion.
2191 2012-08-21  Eli Zaretskii  <eliz@gnu.org>
2193         * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2194         components for RTL text (Bug#11860).  Adjust X-OFFSET of each
2195         non-base glyph for the width of the base character, according to
2196         what x_draw_composite_glyph_string_foreground expects.
2197         Generate WADJUST value according to composition_gstring_width's
2198         expectations, to produce correct width of the composed character.
2199         Reverse the sign of the DU offset produced by ScriptPlace.
2201 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
2203         * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2205 2012-08-21  Dmitry Antipov  <dmantipov@yandex.ru>
2207         Avoid direct writes to contents member of struct Lisp_Vector.
2208         * lisp.h (vcopy): New function to copy data into vector.
2209         * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2210         * fns.c (Ffillarray): Use ASET.
2211         * keyboard.c (timer_check_2): Use AREF and ASET.
2212         (append_tool_bar_item, Frecent_keys): Use vcopy.
2213         * lread.c (read_vector): Use ASET.
2214         * msdos.c (Frecent_doskeys): Use vcopy.
2215         * xface.c (Finternal_copy_lisp_face): Use vcopy.
2216         (Finternal_merge_in_global_face): Use ASET and vcopy.
2217         * xfont.c (xfont_list_pattern): Likewise.
2219 2012-08-21  Martin Rudalics  <rudalics@gmx.at>
2221         * window.c (Fwindow_point): For the selected window always return
2222         the position of its buffer's point.
2223         (Fset_window_point): For the selected window always go in its
2224         buffer to the specified position.
2226 2012-08-21  Dmitry Antipov  <dmantipov@yandex.ru>
2228         Setter macros for fontsets.
2229         * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2230         (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2231         (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2232         Adjust users.
2234 2012-08-20  Glenn Morris  <rgm@gnu.org>
2236         * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2237         Don't assume that `ln -f' works.
2239 2012-08-20  Eli Zaretskii  <eliz@gnu.org>
2241         * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2242         and later about non-assignments with no effect.  See discussion at
2243         http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2244         details.
2246 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
2248         Inline setter functions for Lisp_Objects slots of struct specbinding.
2249         * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2250         Adjust users.
2252 2012-08-20  Martin Rudalics  <rudalics@gmx.at>
2254         * window.c (select_window): Always make selected window's buffer
2255         current.
2257 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
2259         Use AREF and ASET for docstrings of category tables.
2260         * category.h (CATEGORY_DOCSTRING): Use AREF.
2261         (SET_CATEGORY_DOCSTRING): Use ASET.
2262         * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2264 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
2266         Inline setter functions for hash table members.
2267         * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2268         (set_hash_hash, set_hash_index): Rename with _slot suffix.
2269         (set_hash_key_and_value, set_hash_index, set_hash_next)
2270         (set_hash_hash): New functions.
2271         * charset.c, fns.c: Adjust users.
2273 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
2275         Inline getter and setter functions for per-buffer values.
2276         * buffer.h (per_buffer_default, set_per_buffer_default)
2277         (per_buffer_value, set_per_buffer_value): New functions.
2278         (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2279         * buffer.c, data.c: Adjust users.
2281 2012-08-20  Juanma Barranquero  <lekktu@gmail.com>
2283         * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2285 2012-08-19  Paul Eggert  <eggert@cs.ucla.edu>
2287         Rely on <config.h> + <unistd.h> to declare 'environ',
2288         as gnulib does this if the system doesn't.
2289         * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
2290         Remove declaration.  MS-Windows declares it on stdlib.h which is
2291         included by conf_post.h.
2292         * emacs.c (environ) [DOUG_LEA_MALLOC]:
2293         * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2294         * vm-limit.c: Include <unistd.h>, for 'environ'.
2296         * unexaix.c, unexcoff.c: Include "mem-limits.h".
2297         (start_of_data): Remove decl; mem-limits.h provides it.
2299         * xdisp.c (handle_invisible_prop): Make it a bit faster
2300         and avoid a gcc -Wmaybe-uninitialized diagnostic.
2302 2012-08-19  Chong Yidong  <cyd@gnu.org>
2304         * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2305         ends (Bug#3874).
2307 2012-08-19  Andreas Schwab  <schwab@linux-m68k.org>
2309         * .gdbinit: Use call instead of set when calling a function in the
2310         inferior.
2312         * data.c (set_internal): Don't use set_blv_found.
2313         (Fkill_local_variable): Likewise.
2315 2012-08-18  Alp Aker  <alp.tekin.aker@gmail.com>
2317         * nsfont.m (ns_ascii_average_width): Ensure the string
2318         ascii_printable is initialized with a null-terminated character
2319         array.  Otherwise, it can contain undesired extra characters.
2321 2012-08-18  Paul Eggert  <eggert@cs.ucla.edu>
2323         port new setting code to Sun C 5.8 2005/10/13
2324         * chartab.c, lisp.h (char_table_set, char_table_set_range):
2325         Return void, not Lisp_Object.  Otherwise, the compiler
2326         complains about (A?B:C) where B is void and C is Lisp_Object
2327         when compiling CHAR_TABLE_SET, due to the recent change to
2328         the API of sub_char_table_set_contents.
2330 2012-08-18  Chong Yidong  <cyd@gnu.org>
2332         * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2333         for the string case (Bug#3874).
2335 2012-08-18  Paul Eggert  <eggert@cs.ucla.edu>
2337         * buffer.h (BSET): Remove (Bug#12215).
2338         Replace all uses with calls to new setter functions.
2339         (bset_bidi_paragraph_direction, bset_case_canon_table)
2340         (bset_case_eqv_table, bset_directory, bset_display_count)
2341         (bset_display_time, bset_downcase_table)
2342         (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2343         (bset_last_selected_window, bset_local_var_alist)
2344         (bset_mark_active, bset_point_before_scroll, bset_read_only)
2345         (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2346         (bset_width_table):
2347         * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2348         (bset_auto_fill_function, bset_auto_save_file_format)
2349         (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2350         (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2351         (bset_cache_long_line_scans, bset_case_fold_search)
2352         (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2353         (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2354         (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2355         (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2356         (bset_header_line_format, bset_indicate_buffer_boundaries)
2357         (bset_indicate_empty_lines, bset_invisibility_spec)
2358         (bset_left_fringe_width, bset_major_mode, bset_mark)
2359         (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2360         (bset_name, bset_overwrite_mode, bset_pt_marker)
2361         (bset_right_fringe_width, bset_save_length)
2362         (bset_scroll_bar_width, bset_scroll_down_aggressively)
2363         (bset_scroll_up_aggressively, bset_selective_display)
2364         (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2365         (bset_word_wrap, bset_zv_marker):
2366         * category.c (bset_category_table):
2367         * syntax.c (bset_syntax_table):
2368         New setter functions.
2370         * process.h (PSET): Remove (Bug#12215).
2371         Replace all uses with calls to new setter functions.
2372         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2373         (PROCESS_INLINE): New macro.
2374         (pset_childp): New setter function.
2375         (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2376         * process.c (PROCESS_INLINE):
2377         Define to EXTERN_INLINE, so that the corresponding functions
2378         are compiled into code.
2379         (pset_buffer, pset_command, pset_decode_coding_system)
2380         (pset_decoding_buf, pset_encode_coding_system)
2381         (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2382         (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2383         (pset_type, pset_write_queue): New setter functions.
2385         * window.h (WSET): Remove (Bug#12215).
2386         Replace all uses with calls to new setter functions.
2387         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2388         (WINDOW_INLINE): New macro.
2389         (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2390         (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2391         (wset_total_lines, wset_vertical_scroll_bar)
2392         (wset_window_end_pos, wset_window_end_valid)
2393         (wset_window_end_vpos): New setter functions.
2394         * window.c (WINDOW_INLINE):
2395         Define to EXTERN_INLINE, so that the corresponding functions
2396         are compiled into code.
2397         (wset_combination_limit, wset_dedicated, wset_display_table)
2398         (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2399         (wset_new_normal, wset_new_total, wset_next_buffers)
2400         (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2401         (wset_prev_buffers, wset_right_fringe_width)
2402         (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2403         (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2404         (wset_window_parameters):
2405         * xdisp.c (wset_base_line_number, wset_base_line_pos)
2406         (wset_column_number_displayed, wset_region_showing):
2407         New setter functions.
2409         * termhooks.h (TSET): Remove (Bug#12215).
2410         Replace all uses with calls to new setter functions.
2411         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2412         (TERMHOOKS_INLINE): New macro.
2413         (tset_charset_list, tset_selection_alist): New setter functions.
2414         * terminal.c (TERMHOOKS_INLINE):
2415         Define to EXTERN_INLINE, so that the corresponding functions
2416         are compiled into code.
2417         (tset_param_alist): New setter function.
2419 2012-08-17  Paul Eggert  <eggert@cs.ucla.edu>
2421         * keyboard.h (KSET): Remove (Bug#12215).
2422         Replace all uses with calls to new setter functions.
2423         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2424         (KEYBOARD_INLINE): New macro.
2425         (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2426         (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2427         (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2428         New setter functions.
2429         * keyboard.c (KEYBOARD_INLINE):
2430         Define to EXTERN_INLINE, so that the corresponding functions
2431         are compiled into code.
2432         (kset_echo_string, kset_kbd_queue)
2433         (kset_keyboard_translate_table, kset_last_prefix_arg)
2434         (kset_last_repeatable_command, kset_local_function_key_map)
2435         (kset_overriding_terminal_local_map, kset_real_last_command)
2436         (kset_system_key_syms): New setter functions.
2438         * frame.h (FSET): Remove (Bug#12215).
2439         Replace all uses with calls to new setter functions.
2440         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2441         (FRAME_INLINE): New macro.
2442         (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2443         (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2444         (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2445         (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2446         (fset_param_alist, fset_root_window, fset_scroll_bars)
2447         (fset_selected_window, fset_title, fset_tool_bar_items)
2448         (fset_tool_bar_position, fset_tool_bar_window): New functions.
2449         * frame.c (FRAME_INLINE):
2450         Define to EXTERN_INLINE, so that the corresponding functions
2451         are compiled into code.
2452         (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2454         A few more naming-convention fixes for getters and setters.
2455         * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2456         and rename from buffer_overlays_set_before.
2457         (set_buffer_overlays_after): Move here from buffer.h, and rename
2458         from buffer_overlays_set_after.
2459         * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2460         All uses changed.
2461         (set_buffer_intervals): Rename from buffer_set_intervals.
2462         * intervals.c (set_interval_object): Move here from intervals.h,
2463         and rename from interval_set_object.
2464         (set_interval_left): Move here from intervals.h, and rename from
2465         interval_set_left.
2466         (set_interval_right): Move here from intervals.h, and rename from
2467         interval_set_right.
2468         (copy_interval_parent): Move here from intervals.h, and rename from
2469         interval_copy_parent.
2470         * intervals.h (set_interval_parent): Rename from interval_set_parent.
2471         (set_interval_plist): Rename from interval_set_plist.
2472         Return void, not Lisp_Object, since no caller uses the result.
2473         * lisp.h (string_intervals): Rename from string_get_intervals.
2474         (set_string_intervals): Rename from string_set_intervals.
2476         * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2477         (set_char_table_contents): Rename from char_table_set_contents.
2478         (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
2479         All uses changed.  See the end of
2480         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2482         * lisp.h (CSET): Remove (Bug#12215).
2483         (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2484         (set_char_table_purpose): New functions,
2485         replacing CSET.  All uses changed.  For example, replace
2486         "CSET (XCHAR_TABLE (char_table), parent, parent);" with
2487         "set_char_table_parent (char_table, parent);".
2488         The old version was confusing because it used the same name
2489         'parent' for two different things.
2491 2012-08-17  Dmitry Antipov  <dmantipov@yandex.ru>
2493         Functions to get and set Lisp_Object fields of buffer-local variables.
2494         * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2495         (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2496         (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2497         * data.c, eval.c, frame.c: Adjust users.
2499 2012-08-17  Chong Yidong  <cyd@gnu.org>
2501         * xfaces.c (merge_face_vectors): If the target font specfies a
2502         font spec, make the font's attributes take precedence over
2503         directly-specified attributes.
2504         (merge_face_ref): Recognize :font.
2506 2012-08-17  Dmitry Antipov  <dmantipov@yandex.ru>
2508         Do not use memcpy for copying intervals.
2509         * intervals.c (reproduce_interval): New function.
2510         (reproduce_tree, reproduce_tree_obj): Use it.
2511         (reproduce_tree_obj): Remove prototype.
2513 2012-08-17  Paul Eggert  <eggert@cs.ucla.edu>
2515         * lisp.h (duration_to_sec_usec): Remove unused decl.
2517 2012-08-17  Alp Aker  <alp.tekin.aker@gmail.com>
2519         * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2520         to an allocated instance of NSString, not to the class itself.
2522 2012-08-17  Juanma Barranquero  <lekktu@gmail.com>
2524         * makefile.w32-in (C_CTYPE_H): New macro.
2525         (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2526         ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2527         ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2529 2012-08-16  Paul Eggert  <eggert@cs.ucla.edu>
2531         Use ASCII tests for character types.
2532         * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2533         * xfns.c, xterm.c:
2534         Don't include <ctype.h>; was not needed.
2535         * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2536         * sysdep.c, xfaces.c:
2537         Include <c-ctype.h> instead of <ctype.h>.
2538         * nsterm.m: Include <c-ctype.h>.
2539         * charset.c (read_hex):
2540         * doc.c (Fsnarf_documentation):
2541         * fileio.c (IS_DRIVE) [WINDOWSNT]:
2542         (DRIVE_LETTER) [DOS_NT]:
2543         (Ffile_name_directory, Fexpand_file_name)
2544         (Fsubstitute_in_file_name):
2545         * font.c (font_parse_xlfd, font_parse_fcname):
2546         * frame.c (x_set_font_backend):
2547         * gtkutil.c (xg_get_font):
2548         * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2549         * nsimage.m (hexchar):
2550         * nsterm.m (ns_xlfd_to_fontname):
2551         * sysdep.c (system_process_attributes):
2552         * xfaces.c (hash_string_case_insensitive):
2553         Use C-locale tests instead of locale-specific tests for character
2554         types, since we want the ASCII interpretation here, not the
2555         interpretation suitable for whatever happens to be the current locale.
2557 2012-08-16  Martin Rudalics  <rudalics@gmx.at>
2559         Consistently check windows for validity/liveness
2560         (Bug#11984, Bug#12025, Bug#12026).
2561         * lisp.h (CHECK_VALID_WINDOW): New macro.
2562         * window.c (decode_window): Rename to decode_live_window.
2563         (decode_valid_window, Fwindow_valid_p): New functions.
2564         (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2565         (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2566         (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2567         (Fwindow_prev_sibling, Fwindow_combination_limit)
2568         (Fset_window_combination_limit, Fwindow_use_time)
2569         (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2570         (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2571         (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2572         (Fwindow_hscroll, Fset_window_hscroll)
2573         (Fwindow_redisplay_end_trigger)
2574         (Fset_window_redisplay_end_trigger, Fwindow_edges)
2575         (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2576         (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2577         (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2578         (Fwindow_end, Fset_window_point, Fset_window_start)
2579         (Fpos_visible_in_window_p, Fwindow_line_height)
2580         (Fwindow_dedicated_p, Fset_window_dedicated_p)
2581         (Fwindow_prev_buffers, Fset_window_prev_buffers)
2582         (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2583         (Fset_window_parameter, Fwindow_display_table)
2584         (Fset_window_display_table, Fdelete_other_windows_internal)
2585         (Fset_window_buffer, Fset_window_new_total)
2586         (Fset_window_new_normal, Fdelete_window_internal)
2587         (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2588         (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2589         (Fwindow_scroll_bars): Check whether argument window is a valid or
2590         live window.  Update doc-strings.
2591         (syms_of_window): New symbol Qwindow_valid_p.
2592         * keyboard.c (Fposn_at_x_y): Check whether argument
2593         frame_or_window denotes a valid window.
2595 2012-08-16  Dmitry Antipov  <dmantipov@yandex.ru>
2597         Fix previous char table change.
2598         * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2599         * chartab.c (optimize_sub_char_table): Likewise.
2601 2012-08-16  Chong Yidong  <cyd@gnu.org>
2603         * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2605         * xfont.c (xfont_open):
2606         * xftfont.c (xftfont_open): Set the font's max_width field.
2608         * nsfont.m (nsfont_open): Similar to the Xft backend, set
2609         min_width to space_width and average_width to the average over
2610         printable ASCII characters.
2611         (ns_char_width): Code cleanup.
2612         (ns_ascii_average_width): New utility function.
2614         * font.h (struct font): Update comments.
2616 2012-08-16  Dmitry Antipov  <dmantipov@yandex.ru>
2618         Simple interface to set Lisp_Object fields of character tables.
2619         * lisp.h (CSET): New macro.
2620         (char_table_set_extras, char_table_set_contents)
2621         (sub_char_table_set_contents): New function.
2622         * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2623         * syntax.c: Adjust users.
2625 2012-08-16  Stefan Monnier  <monnier@iro.umontreal.ca>
2627         * eval.c (eval_sub): Bind lexical-binding.
2628         * lread.c (Qlexical_binding): Make non-static.
2630 2012-08-15  Jan Djärv  <jan.h.d@swipnet.se>
2632         * nsmenu.m (popupSession): Remove.
2633         (pop_down_menu): Remove endModalSession.
2634         (timeout_handler:): New method.
2635         (runDialogAt:): Get next timeout.  Start a NSTimer with that timeout.
2636         Call runModalForWindow.  Check timer_fired when it returns.
2637         If not set, cancel timer and break out of loop.
2638         Otherwise loop again, with a new timeout.
2640         * nsterm.m: Include fcntl.h if present.
2641         (fd_entry, t_readfds, inNsSelect): Remove.
2642         (select_writefds, select_valid, select_timeout, selfds)
2643         (select_mutex, apploopnr): Add.
2644         (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2645         Otherwise call kbd_buffer_store_event.
2646         (ns_send_appdefined): Remove release of fd_entry.
2647         (ns_read_socket): Always send appdefined.  Remove inNsSelect check.
2648         Increment and decrement apploopnr.
2649         (ns_select): If no file descriptors, just do a NSTimer.
2650         Otherwise copy read/write masks and start select thread (fd_handler).
2651         Start main loop and wait for application defined event.
2652         Inform select thread to stop selecting after main loop is exited.
2653         (ns_term_init): Create selfds pipe and set non-blocking.
2654         Initialize select_mutex.  Start the select thread (fd_handler).
2655         (fd_handler:): Loop forever, wait for info from the main thread
2656         to either start or stop selecting.  When select returns, send
2657         and appdefined event.
2658         (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2659         If not call kbd_buffer_store_event.
2661         * nsterm.h (EmacsApp): fd_handler takes id argument.
2662         (EmacsDialogPanel): Add timer_fired and timeout_handler.
2664         * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2666 2012-08-15  Eli Zaretskii  <eliz@gnu.org>
2668         * region-cache.c (move_cache_gap): Update gap_len using the actual
2669         growth of the boundaries array.  Do not change cache_len.
2670         (Bug#12196)
2672 2012-08-15  Dmitry Antipov  <dmantipov@yandex.ru>
2674         Generalize and cleanup font subsystem checks.
2675         * font.h (FONT_DEBUG, font_assert): Remove.
2676         * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2677         Change font_assert to eassert.  Use eassert where appropriate.
2679 2012-08-15  Dmitry Antipov  <dmantipov@yandex.ru>
2681         * gtkutil.c (xg_get_font): Use pango_units_to_double.
2683 2012-08-15  Chong Yidong  <cyd@gnu.org>
2685         * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2686         When using the new font chooser, use gtk_font_chooser_get_font_desc to
2687         extract the font descriptor instead of just the font name.
2688         In that case, return a font spec instead of a string.
2689         (x_last_font_name): Move to this file from xfns.c.
2691         * xfns.c (Fx_select_font): The return value can also be a font
2692         spec.  Move x_last_font_name management to gtkutil.c.
2694         * xfaces.c: Make font weight and style symbols non-static.
2696 2012-08-15  Stefan Monnier  <monnier@iro.umontreal.ca>
2698         * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2699         (bug#12117).
2701 2012-08-14  Stefan Monnier  <monnier@iro.umontreal.ca>
2703         * alloc.c (Fgarbage_collect): Use plural form consistently.
2705 2012-08-14  Eli Zaretskii  <eliz@gnu.org>
2707         * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2708         iteration through the command loop.  Fixes a problem whereby mouse
2709         movements are ignored until the first mouse click.
2711 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
2713         Use bool, not int, for Lisp booleans.
2714         This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2715         makes Emacs a bit smaller and presumably a bit faster.
2716         * lisp.h: Include <stdbool.h>.
2717         (struct Lisp_Boolfwd, defvar_bool):
2718         * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2719         * regex.c [!emacs]: Include <stdbool.h>.
2720         (false, true): Remove; <stdbool.h> does this for us now.
2722 2012-08-14  Chong Yidong  <cyd@gnu.org>
2724         * character.c (Fcharacterp): Doc fix (Bug#12076).
2726         * data.c (Findirect_variable): Doc fix (Bug#11040).
2728         * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2730         * editfns.c (Fformat): Doc fix (Bug#12059).
2731         (Fsave_current_buffer): Doc fix (Bug#11542).
2733 2012-08-14  Barry OReilly  <gundaetiapo@gmail.com>  (tiny change)
2735         * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2736         (bug#12022).
2738 2012-08-14  Martin Rudalics  <rudalics@gmx.at>
2740         * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2741         (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2742         * minibuf.c (choose_minibuf_frame, read_minibuf):
2743         * w32fns.c (x_create_tip_frame):
2744         * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2745         Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2747 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
2749         * intervals.c (offset_intervals): Remove obsolete comment.
2751 2012-08-14  Andreas Schwab  <schwab@linux-m68k.org>
2753         * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2755 2012-08-14  Gergely Risko  <gergely@risko.hu>
2757         * coding.c (decode_coding): Record buffer modification before
2758         disabling undo_list (Bug#11773).
2760 2012-08-14  Dmitry Antipov  <dmantipov@yandex.ru>
2762         Revert and cleanup some recent overlay changes.
2763         * buffer.h (enum overlay_type): Remove.
2764         (buffer_get_overlays, buffer_set_overlays): Likewise.
2765         (buffer_set_overlays_before, buffer_set_overlays_after):
2766         New function.  Adjust users.
2767         (unchain_both): Add eassert.
2769 2012-08-14  Dmitry Antipov  <dmantipov@yandex.ru>
2771         * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
2773 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
2775         * gtkutil.c (xg_mark_data): Don't assume C99.
2777 2012-08-13  Jan Djärv  <jan.h.d@swipnet.se>
2779         * gtkutil.c (xg_frame_tb_info): New struct.
2780         (TB_INFO_KEY): New define.
2781         (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
2782         (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
2783         (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
2784         if not present.
2785         (update_frame_tool_bar): Return early if data in xg_frame_tb_info
2786         is up to date.  Otherwise store new data.
2787         (free_frame_tool_bar): Free xg_frame_tb_info if present.
2789 2012-08-13  Dmitry Antipov  <dmantipov@yandex.ru>
2791         Use KSET for write access to Lisp_Object members of struct kboard.
2792         * keyboard.h (KSET): New macro.
2793         * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
2794         * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2795         * xterm.c: Adjust users.
2797 2012-08-13  Dmitry Antipov  <dmantipov@yandex.ru>
2799         Use BSET for write access to Lisp_Object members of struct buffer.
2800         * buffer.h (BSET): New macro.
2801         * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2802         * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2803         * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2804         * window.c, xdisp.c, xfns.c: Adjust users.
2806 2012-08-11  BT Templeton  <bpt@hcoop.net>  (tiny change)
2808         * lread.c (syms_of_lread): Initialize Vlexical_binding.
2810 2012-08-11  Jan Djärv  <jan.h.d@swipnet.se>
2812         * nsterm.m (not_in_argv): New function.
2813         (application:openFile, application:openTempFile:):
2814         (application:openFileWithoutUI:, application:openFiles:): Open file
2815         if not_in_argv returns non-zero (bug#12171).
2817         * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
2818         (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2819         Define for Gtk+ versions less than 3.2.
2820         (xg_get_font_name): Use those functions/macros here.
2821         Reported by Frans Oilinki <moilinki@gmail.com>.
2823 2012-08-11  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
2825         * unexmacosx.c (copy_data_segment): Copy initialized data in
2826         statically linked libraries from input file rather than memory.
2828         * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2829         LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2830         (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2832 2012-08-10  Glenn Morris  <rgm@gnu.org>
2834         * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2835         * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2837 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
2839         Fix last change to allow compilation with low optimization levels.
2840         * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2841         Reported by Jan Djärv <jan.h.d@swipnet.se>.
2843 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
2845         Use common inline syntax in intervals.h.
2846         * intervals.h (INTERVALS_INLINE): New macro.
2847         Change all users from LISP_INLINE.
2849 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
2851         Define Qnone once for all platforms.
2852         * frame.c (Qnone): Define here.
2853         (syms_of_frame): DEFSYM it.
2854         * lisp.h (Qnone): New declaration.
2855         * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2856         * xfns.c: Remove duplication.  Adjust users.
2858 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
2860         Remove unused macros from intervals.h.
2861         * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2862         * intervals.c: Adjust comment.
2864 2012-08-10  Eli Zaretskii  <eliz@gnu.org>
2866         * w32fns.c <w32_unicode_gui>: New static variable.
2867         (globals_of_w32fns): Initialize it according to os_subtype.
2868         (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2869         testing os_subtype.
2871 2012-08-10  Joakim Hårsman  <joakim.harsman@gmail.com>  (tiny change)
2872             Eli Zaretskii  <eliz@gnu.org>
2874         Fix bug #10299 with Unicode characters sent by customized
2875         keyboards created by MSKLC.
2876         * w32fns.c (INIT_WINDOW_CLASS): New macro.
2877         (w32_init_class): Use it to initialize the Emacs class with either
2878         ANSI or Unicode API calls.
2879         (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
2880         later.
2881         (w32_wnd_proc): If the character code sent by WM_CHAR or
2882         WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
2883         original message.  Call DefWindowProcW on NT and later.
2885 2012-08-10  Glenn Morris  <rgm@gnu.org>
2887         * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
2889         * lisp.h (DIRECTORY_SEP): Let configure set it.
2891 2012-08-09  Dmitry Antipov  <dmantipov@yandex.ru>
2893         Use TSET for write access to Lisp_Object slots of struct terminal.
2894         * termhooks.h (TSET): New macro.
2895         * coding.c, terminal.c, xselect.c: Adjust users.
2897 2012-08-08  Stefan Monnier  <monnier@iro.umontreal.ca>
2899         * xdisp.c (safe_eval_handler): Remove prototype.  Receive args describing
2900         the failing expression, include them in the error message.
2901         * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
2902         * lisp.h (internal_condition_case_n): Update declaration.
2904 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
2906         Inline functions to examine and change buffer overlays.
2907         * buffer.c (unchain_both): New function.
2908         * buffer.h (buffer_get_overlays, buffer_set_overlays):
2909         (buffer_has_overlays): New function.
2910         (enum overlay_type): New enum.
2911         * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
2912         * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
2914 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
2916         Inline functions to examine and change buffer intervals.
2917         * alloc.c (mark_interval_tree): Remove.
2918         (MARK_INTERVAL_TREE): Simplify.
2919         (UNMARK_BALANCE_INTERVALS): Remove.  Adjust users.
2920         * intervals.c (buffer_balance_intervals): New function.
2921         (graft_intervals_into_buffer): Adjust indentation.
2922         (set_intervals_multibyte): Simplify.
2923         * buffer.h (BUF_INTERVALS): Remove.
2924         (buffer_get_intervals, buffer_set_intervals): New function.
2925         * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
2926         * intervals.c, textprop.c: Adjust users.
2928 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
2930         Inline functions to examine and change string intervals.
2931         * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
2932         (string_get_intervals, string_set_intervals): New function.
2933         * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2934         * lread.c, print.c, textprop.c: Adjust users.
2936 2012-08-08  Glenn Morris  <rgm@gnu.org>
2938         * lisp.mk (lisp): Remove language/persian.elc.
2940 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
2942         Cleanup intervals.
2943         * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
2944         (NULL_INTERVAL_P): Likewise.  Adjust users.
2945         (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
2946         Adjust comment.  Move under #if 0.
2947         * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2948         * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2950 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
2952         Check total length of intervals with eassert.
2953         * intervals.h (CHECK_TOTAL_LENGTH): Remove.
2954         * intervals.c: Change all users to eassert.
2956 2012-08-07  Eli Zaretskii  <eliz@gnu.org>
2958         * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
2959         Rename fields to match removal of FGET and WGET and disuse of
2960         INTERNAL_FIELD in Lisp_Cons.
2962 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
2964         Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
2965         * lisp.h (struct Lisp_Symbol): Change xname to meaningful
2966         name since all xname users are fixed long time ago.  Do not
2967         use INTERNAL_FIELD.
2968         (set_symbol_name, set_symbol_function, set_symbol_plist):
2969         (set_symbol_next, set_overlay_plist): New function.
2970         (struct Lisp_Cons): Do not use INTERNAL_FIELD.
2971         (struct Lisp_Overlay): Likewise.
2972         (CVAR, MVAR, SVAR): Remove.
2973         * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
2974         * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
2975         * xterm.c: Adjust users.
2976         * .gdbinit: Change to use name field of struct Lisp_Symbol
2977         where appropriate.
2979 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
2981         Basic functions to set Lisp_Object and pointer slots of intervals.
2982         * intervals.h (interval_set_parent, interval_set_object):
2983         (interval_set_left, interval_set_right, interval_set_plist):
2984         (interval_copy_parent): New function.
2985         (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
2986         (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
2987         Adjust indentation.
2988         (INTERVAL_SIZE): Remove.  Adjust users.
2989         * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
2991 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
2993         Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
2994         * process.h (PGET): Remove.
2995         (struct Lisp_Process): Do not use INTERNAL_FIELD.
2996         * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2998 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
3000         Drop WGET and revert read access to Lisp_Objects slots of struct window.
3001         * window.h (WGET): Remove.
3002         (struct window): Do not use INTERNAL_FIELD.
3003         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3004         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3005         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3006         * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3007         * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3008         Adjust users.
3010 2012-08-07  Chong Yidong  <cyd@gnu.org>
3012         * window.c (Fwindow_edges, Fwindow_pixel_edges)
3013         (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3014         (Fdelete_window_internal): Signal an error if the window is not on
3015         a live frame (Bug#12025).
3017 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
3019         Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3020         * frame.h (FGET): Remove.
3021         (struct frame): Do not use INTERNAL_FIELD.
3022         * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3023         * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3024         * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3025         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3027 2012-08-06  Juanma Barranquero  <lekktu@gmail.com>
3029         * w32.c: Silence compiler warnings.
3030         (map_w32_filename): Remove unused variable `is_fat'.
3031         (chase_symlinks): Add parentheses around expression.
3033 2012-08-06  Glenn Morris  <rgm@gnu.org>
3035         * sysdep.c: Respect BROKEN_GETWD.
3037         * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3038         Let configure handle it.
3039         (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3041 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
3043         Use GCALIGNMENT where appropriate.
3044         * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3045         (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3046         (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3048 2012-08-06  Eli Zaretskii  <eliz@gnu.org>
3050         * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3051         Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
3053 2012-08-06  Stefan Monnier  <monnier@iro.umontreal.ca>
3055         * buffer.h (struct buffer): Revert `indirections' to a simple int;
3056         that should be sufficient for everyone.
3058 2012-08-06  Jan Djärv  <jan.h.d@swipnet.se>
3060         * keyboard.c (timer_check_2): Add break so timer_check returns next
3061         timeout.
3063 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
3065         Fix Windows build errors introduced after converting to WGET and WSET.
3066         * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3067         Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3069 2012-08-06  Jan Djärv  <jan.h.d@swipnet.se>
3071         * nsterm.m (ns_frame_rehighlight): Use FSET.
3073         * nsmenu.m (ns_update_menubar): Use FSET.
3075 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
3077         Separate read and write access to Lisp_Object slots of Lisp_Process.
3078         * process.h (PGET, PSET): New macros similar to AREF and ASET.
3079         * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3081 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
3083         Separate read and write access to Lisp_Object slots of struct window.
3084         * window.h (WGET, WSET): New macros similar to AREF and ASET.
3085         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3086         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3087         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3088         * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3089         * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3090         Adjust users.
3092 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
3094         Fix Windows build errors introduced after converting to FGET and FSET.
3095         * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3096         (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3097         (w32_judge_scroll_bars): Change to use FSET.
3098         Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3100 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
3102         Fix replacement typo.
3103         * window.c (replace_window): Set root_window instead of
3104         selected_window.  This fixes a total window subsystem
3105         malfunction reported by Bastien Guerry <bzg@gnu.org>.
3107 2012-08-06  Glenn Morris  <rgm@gnu.org>
3109         * lisp.mk (lisp): Add language/persian.elc.
3111 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
3113         Separate read and write access to Lisp_Object slots of struct frame.
3114         * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3115         * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3116         * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3117         * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3118         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3120 2012-08-05  Andreas Schwab  <schwab@linux-m68k.org>
3122         * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3124 2012-08-05  Dmitry Antipov  <dmantipov@yandex.ru>
3126         Generalize common compile-time constants.
3127         * lisp.h (header_size, bool_header_size, word_size): Now here.
3128         (struct Lisp_Vector): Add comment.
3129         (struct Lisp_Bool_Vector): Move up to define handy constants.
3130         (VECSIZE, PSEUDOVECSIZE): Simplify.
3131         (SAFE_ALLOCA_LISP): Use new constant.  Adjust indentation.
3132         * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3133         * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3134         * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3135         * xfont.c, xmenu.c: Use word_size where appropriate.
3137 2012-08-05  Lawrence Mitchell  <wence@gmx.li>
3139         * search.c (Freplace_match): Treat \? in the replacement text
3140         literally (Bug#8161).
3142 2012-08-05  Chong Yidong  <cyd@gnu.org>
3144         * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3145         * frame.c (Vdelete_frame_functions):
3146         * emacs.c (Vkill_emacs_hook): Doc fix.
3148 2012-08-04  Eli Zaretskii  <eliz@gnu.org>
3150         * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3151         --with-x-toolkit=no builds.
3152         Reported by Carsten Mattner <carstenmattner@gmail.com>.
3154 2012-08-04  Chong Yidong  <cyd@gnu.org>
3156         * syntax.c (Fmodify_syntax_entry): Doc fix.
3158 2012-08-04  Eli Zaretskii  <eliz@gnu.org>
3160         Fix startup warnings about ../site-lisp on MS-Windows.  (Bug#11959)
3161         * w32.c (init_environment): Change the default values of many
3162         environment variables in dflt_envvars[] to NULL, to avoid pushing
3163         them into environment when they were not already defined.
3164         Remove the code that deletes site-lisp subdirectories from the default
3165         value of EMACSLOADPATH, as it is no longer needed.
3166         (check_windows_init_file): Now external, not static.
3167         Use Vload_path as is, without adding anything, as this function is now
3168         called when Vload_path is already set up.
3170         * w32.h (check_windows_init_file): Add prototype.
3172         * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3173         directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3174         compatibility with Posix platforms.
3175         (main): Move the call to check_windows_init_file to here from
3176         w32.c.
3177         (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3178         any, in the DEFALT argument into the root of the Emacs build or
3179         installation tree, as appropriate.
3181         * callproc.c (init_callproc_1): Call decode_env_path instead of
3182         doing its equivalent by hand.
3183         (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3184         the code that sets Vexec_path run on MS-Windows.
3186         * lread.c (init_lread): Add comments to #ifdef's.
3188         * msdos.c (dos_set_window_size, IT_update_begin)
3189         (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3190         instead of direct references.
3192 2012-08-04  Paul Eggert  <eggert@cs.ucla.edu>
3194         Export DEFAULT_REHASH_* to GDB.
3195         * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3196         Now constants, not macros.
3198 2012-08-03  Paul Eggert  <eggert@cs.ucla.edu>
3200         Remove unnecessary casts involving pointers.
3201         These casts are no longer needed now that we assume C89 or later,
3202         since they involve casting to or from void *.
3203         * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3204         (make_pure_float, make_pure_vector):
3205         * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3206         * macros.c (Fstart_kbd_macro):
3207         * menu.c (find_and_return_menu_selection):
3208         * minibuf.c (read_minibuf_noninteractive):
3209         * sysdep.c (closedir):
3210         * xdisp.c (x_produce_glyphs):
3211         * xfaces.c (compare_fonts_by_sort_order):
3212         * xfns.c (x_real_positions, select_visual):
3213         * xselect.c (x_stop_queuing_selection_requests)
3214         (x_get_window_property, x_get_window_property_as_lisp_data):
3215         * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3216         Remove unnecessary pointer casts.
3217         * alloc.c (record_xmalloc): New function.
3218         * lisp.h (record_xmalloc): New decl.
3219         (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3220         more like a function.  This is because the pointer cast is not
3221         needed.  All uses changed.
3222         * print.c (print_string, print_error_message): Avoid length recalc.
3224         Improve fix for macroexp crash with debugging (Bug#12118).
3225         * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3226         ARRAY_MARK_FLAG when checking subscripts, because ASET is
3227         not supposed to be invoked from the garbage collector.
3228         See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3229         (gc_aset): New function, which is like ASET but can be
3230         used in the garbage collector.
3231         (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3232         (set_hash_index): Use it instead of ASET.
3234 2012-08-03  Eli Zaretskii  <eliz@gnu.org>
3236         Support symlinks on latest versions of MS-Windows.
3237         * w32.c: Include winioctl.h and aclapi.h.
3238         (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3239         (revert_to_self): Forward declarations of static functions.
3240         <static BOOL g_b_init_get_security_info>:
3241         <g_b_init_create_symbolic_link>: New static flags.
3242         (globals_of_w32): Initialize them to zero.
3243         (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3244         (map_w32_filename): Improve commentary.  Simplify switch.
3245         (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3246         headers (most versions of MinGW w32api don't).
3247         (get_security_info, create_symbolic_link)
3248         (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3249         New functions.
3250         (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3251         in the argument file name.
3252         (sys_access): Call unc_volume_file_attributes only if
3253         GetFileAttributes fails with network-related error codes.
3254         (sys_rename): Diagnose renaming of a symlink when the user doesn't
3255         have the required privileges.
3256         (get_file_security_desc_by_name): Rename from
3257         get_file_security_desc.
3258         (stat_worker): New function, with most of the guts of 'stat', and
3259         with addition of handling of symlinks and support for 'lstat'.
3260         If possible, get file's attributes and security information by
3261         handle, not by name.  Produce S_IFLNK bit for symlinks, when
3262         called from 'lstat'.
3263         (stat, lstat): New functions, call 'stat_worker'.
3264         (symlink, readlink, careadlinkat): Rewritten to create and resolve
3265         symlinks when the underlying filesystem supports them.
3267 2012-08-02  Paul Eggert  <eggert@cs.ucla.edu>
3269         Fix macroexp crash on Windows with debugging (Bug#12118).
3270         * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3271         checking subscripts; problem introduced with the recent
3272         "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3273         (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3274         since it's used in non-static inline functions now.
3276         * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3277         Don't assume buffer size fits in 'int'.  Remove unused local.
3279         Use C99-style 'extern inline' if available.
3280         * buffer.h (BUFFER_INLINE):
3281         * category.h (CATEGORY_INLINE):
3282         * character.h (CHARACTER_INLINE):
3283         * charset.h (CHARSET_INLINE):
3284         * composite.h (COMPOSITE_INLINE):
3285         * dispextern.h (DISPEXTERN_INLINE):
3286         * lisp.h (LISP_INLINE):
3287         * systime.h (SYSTIME_INLINE):
3288         New macro, replacing 'static inline' in this header.
3289         * buffer.h, category.h, character.h, charset.h, composite.h:
3290         * dispextern.h, lisp.h, systime.h:
3291         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3292         * alloc.c (LISP_INLINE):
3293         * buffer.c (BUFFER_INLINE):
3294         * category.c (CATEGORY_INLINE):
3295         * character.c (CHARACTER_INLINE):
3296         * charset.c (CHARSET_INLINE):
3297         * composite.c (COMPOSITE_INLINE):
3298         * dispnew.c (DISPEXTERN_INLINE):
3299         * sysdep.c (SYSTIME_INLINE):
3300         Define to EXTERN_INLINE, so that the corresponding functions
3301         are compiled into code.
3302         * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3303         (INLINE_HEADER_END): New macros.
3304         * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3305         since it's used in non-static inline functions now.
3306         (VALMASK) [!USE_LSB_TAG]: Likewise.
3308 2012-08-02  Glenn Morris  <rgm@gnu.org>
3310         * s/: Remove empty directory.
3312         * s/ms-w32.h: Move to ../nt/inc.
3313         * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3314         Update for new ms-w32.h location.
3316 2012-08-02  Paul Eggert  <eggert@cs.ucla.edu>
3318         Port to Solaris 8.
3319         * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3321 2012-08-02  Glenn Morris  <rgm@gnu.org>
3323         * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3324         hard-coding the path separator.
3326 2012-08-01  Paul Eggert  <eggert@cs.ucla.edu>
3328         Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3329         This how ASET and AREF are supposed to work, and makes
3330         it easier to think about future improvements.  See
3331         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3332         * charset.h (set_charset_attr): New function.
3333         All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3334         * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3335         (aref_addr): New function.  All uses of &AREF(...) changed.
3336         (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3337         (set_hash_index): New functions.  All lvalue-style uses of
3338         HASH_KEY etc. changed.
3339         * keyboard.c (set_prop): New function.  All lvalue-style uses
3340         of PROP changed.
3342 2012-08-01  Alp Aker  <alp.tekin.aker@gmail.com>
3344         * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3345         (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3346         (EmacsScroller-dealloc):  Adjust to use WVAR.  (Bug#12114)
3347         * nsfns.m (ns_set_name_as_filename): Likewise.
3348         * nsmenu.m (ns_update_menubar): Likewise.
3349         * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3351 2012-08-01  Eli Zaretskii  <eliz@gnu.org>
3353         * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3354         Adapt to latest changes in field names of the corresponding Lisp
3355         objects.
3357         * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3359 2012-08-01  Glenn Morris  <rgm@gnu.org>
3361         * s/msdos.h: Remove file.
3362         * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3363         * Makefile.in (S_FILE): Remove.
3364         (config_h): Remove S_FILE.
3366 2012-08-01  Juanma Barranquero  <lekktu@gmail.com>
3368         * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3369         Remove; moved to nt/config.nt.
3371 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
3373         Use INTERNAL_FIELD for conses and overlays.
3374         * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3375         Remove obsolete comment.
3376         (MVAR): New macro.
3377         (struct Lisp_Overlay): Use INTERNAL_FIELD.
3378         * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3380 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
3382         Use INTERNAL_FIELD for symbols.
3383         * lisp.h (SVAR): New macro.  Adjust users.
3384         * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3385         * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3387 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
3389         Use INTERNAL_FIELD for processes.
3390         * process.h (PVAR): New macro.  Adjust style.
3391         (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3392         * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3394 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
3396         Use INTERNAL_FIELD for windows.
3397         * window.h (WVAR): New macro.
3398         (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3399         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3400         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3401         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3402         * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3403         * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3405 2012-08-01  Paul Eggert  <eggert@cs.ucla.edu>
3407         * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3409 2012-08-01  Glenn Morris  <rgm@gnu.org>
3411         * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3412         Move to configure.ac.
3414 2012-08-01  Juanma Barranquero  <lekktu@gmail.com>
3416         * makefile.w32-in (CONFIG_H): Update dependencies.
3417         (CONF_POST_H): New macro.
3419         * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3421 2012-07-31  Glenn Morris  <rgm@gnu.org>
3423         * Makefile.in (S_FILE): No longer set by configure.
3425         * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3426         is available.
3427         (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3429         * process.h (NULL_DEVICE):
3430         * emacs.c (SEPCHAR):
3431         * editfns.c (USER_FULL_NAME): Let configure set them.
3433         * s/README, s/template.h: Remove files.
3435         * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3437         * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3438         Move to configure.ac.
3440 2012-07-31  Eli Zaretskii  <eliz@gnu.org>
3442         * .gdbinit (xframe): Adapt to introduction of FVAR and the
3443         resulting renaming of 'struct frame' members.
3445         * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3447         * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3448         after introduction of FVAR.
3450 2012-07-31  Jan Djärv  <jan.h.d@swipnet.se>
3452         * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3454         * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3455         instead of compositeToPoint.
3456         (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3458         * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
3460 2012-07-31  Dmitry Antipov  <dmantipov@yandex.ru>
3462         Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3463         * lisp.h (INTERNAL_FIELD): New macro.
3464         * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
3465         (BVAR): Change to use INTERNAL_FIELD.
3466         * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3467         (KVAR): Change to use INTERNAL_FIELD.
3468         * frame.h (FVAR): New macro.
3469         (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3470         * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3471         * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3472         * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3473         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3475 2012-07-31  Dmitry Antipov  <dmantipov@yandex.ru>
3477         Miscellaneous fixes for non-default X toolkits.
3478         * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3479         * xterm.c (x_frame_of_widget): Remove redundant prototype.
3480         Move under #ifdef USE_LUCID.
3481         (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3482         definition and usage to avoid warnings.
3484 2012-07-31  Jan Djärv  <jan.h.d@swipnet.se>
3486         * nsterm.m (openFiles): Fix previous checkin.
3488 2012-07-31  Paul Eggert  <eggert@cs.ucla.edu>
3490         * indent.c (compute_motion): Remove unused local.
3492 2012-07-31  Glenn Morris  <rgm@gnu.org>
3494         * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3496         * conf_post.h [USG5_4]:
3497         Move remaining contents of s/usg5-4-common.h here.
3498         * s/usg5-4-common.h: Remove file.
3500         * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3501         * s/irix6-5.h: Remove file.
3503         * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3504         * s/darwin.h: Remove file.
3506         * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3507         * s/hpux10-20.h: Remove file, which is now empty.
3509 2012-07-30  Glenn Morris  <rgm@gnu.org>
3511         * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3512         * Makefile.in (config_h): Add conf_post.h.
3513         * makefile.w32-in (CONFIG_H): Add conf_post.h.
3515 2012-07-30  Jan Djärv  <jan.h.d@swipnet.se>
3517         * nsterm.m (ns_do_open_file): New variable.
3518         (ns_term_init): Set ns_do_open_file to YES after run returns.
3519         (openFile, openTempFile, openFileWithoutUI, openFiles):
3520         Open files only if ns_do_open_file.
3522 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
3524         * lisp.h (SWITCH_ENUM_CAST): Remove.  All uses removed.
3525         This no-op macro hasn't been needed for many years.
3526         * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3528         Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3529         * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3530         * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3531         gdb_make_enums_visible.
3532         (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3533         (DIRECTORY_SEP): Now a constant, not a macro.
3535 2012-07-30  Eli Zaretskii  <eliz@gnu.org>
3537         * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3538         w32_kbd_patch_key as the 2nd arg.  (Bug#12082)
3540         * w32term.c <w32_keyboard_codepage>: Renamed from
3541         keyboard_codepage and now external.  All users changed.
3543         * w32term.h: Add declaration of w32_keyboard_codepage.
3545         * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3546         the codepage to translate keys to Unicode.  If this argument is
3547         -1, use the value returned by GetConsoleCP.  All callers changed.
3549 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
3551         Update .PHONY listings in makefiles.
3552         * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3553         bootstrap-clean, distclean, maintainer-clean, versioclean,
3554         extraclean, frc.
3556         * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3557         This is a bit clearer.  Fix some commentary typos.
3559 2012-07-30  Glenn Morris  <rgm@gnu.org>
3561         * s/netbsd.h: Let configure include signal.h if needed.
3562         Remove file, which is now empty.
3564         * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3565         Let configure set them.
3566         * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3567         No more need to undefine.
3569 2012-07-30  Andreas Schwab  <schwab@linux-m68k.org>
3571         * keymap.c (Fkey_description): Don't remove 0x80 bit from
3572         non-single-byte char when adding meta modifier.  (Bug#12090)
3574 2012-07-30  Dmitry Antipov  <dmantipov@yandex.ru>
3576         Convert safe_call to use variable number of arguments.
3577         * xdisp.c (safe_call): Convert to use varargs.  Adjust users.
3578         (safe_call2): Fix comment.
3579         * lisp.h (safe_call): Adjust prototype.
3580         * coding.c (encode_coding_object): Change to use safe_call2.
3581         * xfaces.c (merge_face_heights): Change to use safe_call1.
3583 2012-07-30  Glenn Morris  <rgm@gnu.org>
3585         * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
3586         does that unconditionally.  Remove file, which is now empty.
3588         * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3589         Remove empty files.
3591 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
3593         Export to GDB most of lisp.h's remaining object-like macros.
3594         * lisp.h (min, max): Move earlier, because they're used earlier now.
3595         (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3596         (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3597         (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3598         (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3599         (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3600         (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3601         (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3602         (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3603         Now constants, for GDB.  They need not be macros.
3604         (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3605         Now constants, for GDB, as well as macros, for static initializers.
3606         (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3607         Move to after the definition of struct Lisp_Char_Table,
3608         since the former now needs that type defined.
3609         (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3610         (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3611         (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3612         New enums, for gdb_make_enums_visible.
3613         (GLYPH_MODE_LINE_FACE): Remove; unused.
3614         * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
3615         (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3616         CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3617         enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3618         enum maxargs, enum MAX_ALLOCA.
3619         (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3620         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3621         no longer needed, now that they are done in lisp.h.
3623 2012-07-30  Dmitry Antipov  <dmantipov@yandex.ru>
3625         Cleanup string bytes checking.
3626         * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove.  Convert
3627         all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3628         (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3629         (check_sblock, compact_small_strings): Simplify.
3631 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
3633         * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3634         These macros are confusing and no longer need to be defined, as
3635         the enum values now suffice.  All uses replaced with definiens.
3636         (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3638 2012-07-29  Juanma Barranquero  <lekktu@gmail.com>
3640         * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3641         ($(BLD)/w32console.$(O)): Update dependencies.
3643 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
3645         Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3646         * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3647         time.  Adjust users.
3648         (CHECK_CONS_LIST): Remove.  Convert all users to check_cons_list.
3650 2012-07-29  Jan Djärv  <jan.h.d@swipnet.se>
3652         * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3653         setting sitelisp (Bug#12010).
3655 2012-07-29  Eli Zaretskii  <eliz@gnu.org>
3657         * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
3659         * w32heap.c (cache_system_info):
3660         * w32.c (sys_rename):
3661         * w32proc.c (find_child_console, sys_kill): All users changed.
3663 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
3665         * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3667 2012-07-29  Eli Zaretskii  <eliz@gnu.org>
3669         * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3671 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
3673         Cleanup statistics calculation in Fgarbage_collect.
3674         * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3675         Fix zombies percentage calculation.  Simplify elapsed time calculation.
3677 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
3679         Generalize marker debugging code under MARKER_DEBUG and use eassert.
3680         * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3681         (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3682         (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3683         (replace_range, replace_range_2, del_range_2): Change to eassert.
3684         * marker.c (byte_char_debug_check): Adjust style.
3686 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
3688         Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3689         * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3690         long-ago-commented-out code that talks about "WIN32".
3691         * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3692         All uses changed.
3694 2012-07-28  Paul Eggert  <eggert@cs.ucla.edu>
3696         Use Gnulib stdalign module (Bug#9772, Bug#9960).
3697         * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3698         Simplify by using alignof.
3699         (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3700         * lisp.h: Include <stdalign.h>.
3701         (GCALIGNMENT): New macro and constant.
3702         (DECL_ALIGN): Remove.  All uses replaced by alignas (GCALIGNMENT).
3703         (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3704         (stdalign): New macro, if not already defined.
3706 2012-07-28  Eli Zaretskii  <eliz@gnu.org>
3708         Fix non-ASCII input in non-GUI frames on MS-Windows.  (Bug#12055)
3709         * w32inevt.c: Include w32inevt.h.
3710         (w32_read_console_input): New inline function, calls either
3711         ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3712         w32_console_unicode_input.
3713         (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3714         (w32_kbd_patch_key, key_event): Use the codepage returned by
3715         GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3716         (key_event): use uChar.UnicodeChar only if
3717         w32_console_unicode_input is non-zero.
3719         * w32console.c: Include w32heap.h.
3720         <w32_console_unicode_input>: New global variable.
3721         (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3722         family of Windows, zero otherwise.
3724         * w32inevt.h: Declare w32_console_unicode_input.
3726         * xdisp.c (init_iterator): Don't reference tip_frame in a build
3727         --without-x.  (Bug#11742)
3729 2012-07-27  Paul Eggert  <eggert@cs.ucla.edu>
3731         Adjust GDB to reflect pvec_type changes (Bug#12036).
3732         * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
3733         2012-07-04 changes to pseudovector representation.
3734         Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
3736 2012-07-27  Michael Albinus  <michael.albinus@gmx.de>
3738         * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3739         bus address.
3740         (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3742 2012-07-27  Eli Zaretskii  <eliz@gnu.org>
3744         * alloc.c (listn): Fix the order the arguments are consed onto the
3745         list.
3747         * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3748         enumeration constants, as PURE and HEAP are too general, and clash
3749         with other headers and sources, such as gmalloc.c and the
3750         MS-Windows system headers.  All users changed.
3752 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
3754         Revert last save_excursion_save and save_excursion_restore changes.
3755         * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3756         Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3758 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
3760         Fix recently-introduced typos in Windows port.
3761         Reported by Martin Rudalics <rudalics@gmx.at>.
3762         * w32.c (init_environment): Replace comma with semicolon.
3763         * w32fns.c (syms_of_w32fns): Add missing parenthesis.
3765 2012-07-27  Paul Eggert  <eggert@cs.ucla.edu>
3767         Improve GDB symbol export (Bug#12036).
3768         * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
3769         arms of an 'if', not using conditional expressions; otherwise GDB
3770         complains about the types in the unevaluated arm when the argument
3771         is an integer literal.
3772         (xgetint): Simplify expression.
3773         * alloc.c (gdb_make_enums_visible): New constant.  This ports to
3774         GCC 3.4.2 the export of symbols to GDB.  Problem reported by Eli
3775         Zaretskii in <http://bugs.gnu.org/12036#13>.
3776         * lisp.h (PUBLISH_TO_GDB): Remove.  All uses removed.  No longer
3777         needed now that we have gdb_make_enums_visible.
3778         (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
3779         (enum enum_USE_LSB_TAG):
3780         New enum types, packaging up enums that need to be exported to GDB.
3782 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
3784         Utility function to make a list from specified amount of objects.
3785         * lisp.h (enum constype): New datatype.
3786         (listn): New prototype.
3787         * alloc.c (listn): New function.
3788         (Fmemory_use_count, syms_of_alloc): Use it.
3789         * buffer.c (syms_of_buffer): Likewise.
3790         * callint.c (syms_of_callint): Likewise.
3791         * charset.c (define_charset_internal): Likewise.
3792         * coding.c (syms_of_coding): Likewise.
3793         * keymap.c (syms_of_keymap): Likewise.
3794         * search.c (syms_of_search): Likewise.
3795         * syntax.c (syms_of_syntax): Likewise.
3796         * w32.c (init_environment): Likewise.
3797         * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3798         * xdisp.c (syms_of_xdisp): Likewise.
3799         * xfns.c (syms_of_xfns): Likewise.
3801 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
3803         Fast save_excursion_save and save_excursion_restore.
3804         * lisp.h (struct Lisp_Excursion): New data type.
3805         (PVEC_EXCURSION): New pseudovector type.
3806         (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3807         to deal with it.  Adjust comments.
3808         (init_marker, attach_marker): New prototype.
3809         (unchain_marker): Adjust prototype.
3810         * marker.c (attach_marker): Change to global.
3811         (init_marker): New function.
3812         * alloc.c (Fmake_marker, build_marker): Use it.
3813         (build_marker): More easserts.
3814         (mark_object): Handle struct Lisp_Excursion.
3815         * editfns.c (save_excursion_save, save_excursion_restore):
3816         Reimplement to use struct Lisp_Excursion.  Add comments.
3818 2012-07-26  Paul Eggert  <eggert@cs.ucla.edu>
3820         Fix export of symbols to GDB (Bug#12036).
3821         * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3822         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3823         emacs.c, as this is a more-suitable home.  Had this been done earlier
3824         the fix for 12036 would have avoided some of the problems noted in
3825         <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3826         would have been more obvious.
3827         * emacs.c: Do not include <verify.h>; no longer needed.
3828         (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
3829         (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3830         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3831         Remove; now done in lisp.h.
3832         * lisp.h (PUBLISH_TO_GDB): New macro.
3833         (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3834         (DATA_SEG_BITS): Use it.
3835         (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3836         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3837         * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3838         not be usable in #if.  This simplifies things.
3840 2012-07-26  Juanma Barranquero  <lekktu@gmail.com>
3842         * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3844 2012-07-26  Paul Eggert  <eggert@cs.ucla.edu>
3846         Simplify export of symbols to GDB (Bug#12036).
3847         * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3848         $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3849         (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3850         Adjust to changes in lisp.h and emacs.c, by using
3851         CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3852         of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3853         INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3854         gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3855         instead of gdb_valbits.
3856         (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3857         PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3858         instead of gdb_array_mark_flag.
3859         (xboolvector): Get size from $->size, not $->header.size.
3860         Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3861         (xreload, hook-run, hookpost-run): Remove.
3862         * emacs.c: Include <verify.h>.
3863         (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3864         (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3865         Remove.
3866         (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3867         (gdb_USE_LSB_TAG): New enum constants.
3868         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3869         Also define these as enum constants, so they're visible to GDB.
3870         (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
3871         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
3872         as constants, so they're visible to GDB.
3873         * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
3874         (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
3875         Now enum constants, not macros, so they're visible to GDB.
3876         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
3877         more convenient now.  All uses changed.
3878         (VALMASK) [USE_LSB_TAG]: Also define in this case.
3879         * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
3881 2012-07-26  Dmitry Antipov  <dmantipov@yandex.ru>
3883         Explicitly free restriction data that are not needed anymore.
3884         * editfns.c (save_restriction_restore): Free restriction data.
3886 2012-07-26  Stefan Monnier  <monnier@iro.umontreal.ca>
3888         * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
3889         add argument, tune behavior, and adjust all callers.
3891 2012-07-25  Paul Eggert  <eggert@cs.ucla.edu>
3893         Use typedef for EMACS_INT, EMACS_UINT.
3894         * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
3895         than macros.  This simplifies debugging in the usual case, since
3896         it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
3897         and it allows expressions involving EMACS_INT casts.
3898         * .gdbinit (xreload): Simplify by using EMACS_INT cast.
3900 2012-07-25  Jan Djärv  <jan.h.d@swipnet.se>
3902         * nsterm.m (ns_read_socket): Return early if there is a modal
3903         window (Bug#12043).
3905 2012-07-25  Martin Rudalics  <rudalics@gmx.at>
3907         * frame.c (Fredirect_frame_focus): In doc-string don't mention
3908         that FOCUS-FRAME can be omitted.
3910 2012-07-25  Dmitry Antipov  <dmantipov@yandex.ru>
3912         Adjust buffer text indirection counters at the end of Fkill_buffer.
3913         * buffer.c (Fkill_buffer): Adjust indirection counters when the
3914         buffer is definitely dead.  This should really fix an issue reported
3915         by Christoph Scholtes again.  (Bug#12007).
3916         (init_buffer_once): Initialize indirection counters of
3917         buffer_defaults and buffer_local_symbols (for sanity and safety).
3919 2012-07-24  Eli Zaretskii  <eliz@gnu.org>
3921         * xdisp.c (init_iterator): Don't compute dimensions of truncation
3922         and continuation glyphs on tooltip frames, leave them at zero.
3923         Avoids continued lines in tooltips.  (Bug#11832)
3925 2012-07-24  Dmitry Antipov  <dmantipov@yandex.ru>
3927         Simplify copy_overlay.
3928         * buffer.c (copy_overlay): Simplify.  Use build_marker.
3929         * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
3931 2012-07-23  Eli Zaretskii  <eliz@gnu.org>
3933         * print.c (print_object): Don't crash when a frame's name is nil
3934         or invalid.  (Bug#12025)
3936         * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
3937         it signals an error when a tooltip frame is being created.
3939 2012-07-23  Dmitry Antipov  <dmantipov@yandex.ru>
3941         Cleanup miscellaneous objects allocation and initialization.
3942         * alloc.c (allocate_misc): Change to static.  Add argument to
3943         specify the subtype.  Adjust comment and users.
3944         (build_overlay): New function.
3945         * buffer.c (copy_overlays, Fmake_overlay): Use it.
3946         * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
3947         (allocate_misc): Remove prototype.
3948         (build_overlay): Add prototype.
3950 2012-07-23  Dmitry Antipov  <dmantipov@yandex.ru>
3952         Swap buffer text indirection counters in Fbuffer_swap_text.
3953         * buffer.c (Fbuffer_swap_text): Swap indirections too.
3954         This avoids crash reported by Christoph Scholtes at
3955         http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
3957 2012-07-22  Jan Djärv  <jan.h.d@swipnet.se>
3959         * nsmenu.m (Popdown_data): New struct.
3960         (pop_down_menu): p->pointer is Popdown_data.  Release the pool and
3961         free Popdown_data.
3962         (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
3963         (initWithContentRect): Make imgView and contentView non-static
3964         and autorelease them.  Also autorelease img and matrix (Bug#12005).
3965         (dealloc): Remove (Bug#12005).
3967 2012-07-22  Dmitry Antipov  <dmantipov@yandex.ru>
3969         Adjust consing_since_gc when objects are explicitly freed.
3970         * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
3971         (Fgarbage_collect): Use it.  Change minimum to 1/10 of default.
3972         (free_cons, free_misc): Subtract object size from consing_since_gc.
3974 2012-07-22  Dmitry Antipov  <dmantipov@yandex.ru>
3976         Simplify and cleanup markers positioning code.
3977         * marker.c (attach_marker): More useful eassert.
3978         (live_buffer, set_marker_internal): New function.
3979         (Fset_marker, set_marker_restricted): Use set_marker_internal.
3980         (set_marker_both, set_marker_restricted_both): Use live_buffer.
3982 2012-07-22  Paul Eggert  <eggert@cs.ucla.edu>
3984         * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
3985         as it's limited by the amount of memory, not by INT_MAX.
3987 2012-07-21  Eli Zaretskii  <eliz@gnu.org>
3989         * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
3990         in special-event-map.  See the discussion at
3991         http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
3992         for the reasons.
3994         * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
3995         info.dwItemData.  Fixes crashes on 64-bit Windows.
3996         Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3998 2012-07-21  Jan Djärv  <jan.h.d@swipnet.se>
4000         * nsterm.m (accessibilityAttributeValue): New function.  (Bug#11134).
4001         (conversationIdentifier): Return value is NSInteger.
4002         * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
4004 2012-07-21  Chong Yidong  <cyd@gnu.org>
4006         * window.c (decode_any_window): Signal an error if the window is
4007         on a dead frame (Bug#11984).
4009 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
4011         Add indirection counting to speed up Fkill_buffer.
4012         * buffer.h (struct buffer): New member.
4013         * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4014         (Fmake_indirect_buffer): Set indirection counter to -1, increment
4015         base buffer indirection counter.
4016         (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4017         (Fkill_buffer): Adjust indirection counters as needed, don't walk
4018         through buffer list if indirection counter is 0.
4020 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
4022         Extend the value returned by Fgarbage_collect with heap statistics.
4023         * alloc.c (Qheap): New symbol.
4024         (syms_of_alloc): DEFSYM it.
4025         (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4026         (Fmemory_free): Remove.
4027         (syms_of_alloc): Don't defsubr it.
4028         * buffer.c (Fcompact_buffer): Remove.
4029         (syms_of_buffer): Don't defsubr it.
4031 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
4033         Make maybe_gc inline.
4034         Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4035         * lisp.h (consing_since_gc, gc_relative_threshold)
4036         (memory_full_cons_threshold): Revert declaration.
4037         (maybe_gc): Remove prototype, define as inline.
4038         * alloc.c: Remove old commented-out code.
4039         (consing_since_gc, gc_relative_threshold)
4040         (memory_full_cons_threshold): Revert to global.
4041         (maybe_gc): Remove.
4043 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
4045         Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4046         * lisp.h (build_unibyte_string): New function.
4047         * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4048         * sysdep.c, w32fns.c, xfns.c: Use it.
4049         * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4050         of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4051         Adjust users accordingly.
4052         * font.h (font_open_by_name): Adjust prototype.
4054 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
4056         Cleanup calls to Fgarbage_collect.
4057         * lisp.h (maybe_gc): New prototype.
4058         (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4059         Remove declarations.
4060         * alloc.c (maybe_gc): New function.
4061         (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4062         Make them static.
4063         * bytecode.c (MAYBE_GC): Use maybe_gc.
4064         * eval.c (eval_sub, Ffuncall): Likewise.
4065         * keyboard.c (read_char): Likewise.  Adjust call to maybe_gc
4066         to avoid dependency from auto-save feature.
4068 2012-07-19  Paul Eggert  <eggert@cs.ucla.edu>
4070         * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4071         (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4072         'for_each_per_buffer_object_at'.
4073         All uses changed.  It's better to use upper-case for macros that
4074         cannot be implemented as functions, to give the reader a clue
4075         that they're special.
4077 2012-07-19  Stefan Monnier  <monnier@iro.umontreal.ca>
4079         * alloc.c (Fgarbage_collect): Tweak docstring.
4081 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
4083         Tweak the value returned from Fgarbage_collect again.
4084         * alloc.c (Fgarbage_collect): New return value, as confirmed in
4085         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4086         Adjust documentation.
4087         (total_vector_bytes): Rename to total_vector_slots, adjust
4088         accounting.
4089         (total_free_vector_bytes): Rename to total_free_vector_slots,
4090         adjust accounting.
4091         (Qstring_bytes, Qvector_slots): New symbols.
4092         (syms_of_alloc): DEFSYM them.
4094 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
4096         Buffer compaction primitive which may be used from Lisp.
4097         * buffer.c (compact_buffer, Fcompact_buffer): New function.
4098         (syms_of_buffer): Register Fcompact_buffer.
4099         * alloc.c (Fgarbage_collect): Use compact_buffer.
4100         * buffer.h (compact_buffer): New prototype.
4101         (struct buffer_text): New member.
4103 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
4105         New macro to iterate over all buffers, miscellaneous cleanups.
4106         * lisp.h (all_buffers): Remove declaration.
4107         * buffer.h (all_buffers): Add declaration, with comment.
4108         (for_each_buffer): New macro.
4109         * alloc.c (Fgarbage_collect, mark_object): Use it.
4110         * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4111         (init_buffer): Likewise.
4112         * data.c (Fset_default): Likewise.
4113         * coding.c (code_conversion_restore): Remove redundant check
4114         for dead buffer.
4115         * buffer.c (Fkill_buffer): Likewise.  Remove obsolete comment.
4117 2012-07-18  Andreas Schwab  <schwab@linux-m68k.org>
4119         Fix bug that created negative-length intervals.
4120         * intervals.c (merge_interval_right, merge_interval_left):
4121         Do not zero out this interval if it is absorbed by its children,
4122         as this interval's total length doesn't change in that case.  See
4123         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4125 2012-07-18  Paul Eggert  <eggert@cs.ucla.edu>
4127         * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4128         when invoking (make-bool-vector N t) and N is a positive
4129         multiple of 8 -- the last 8 bits were mistakenly cleared.
4131         Remove some struct layout assumptions in bool vectors.
4132         * alloc.c (bool_header_size): New constant.
4133         (header_size, word_size): Move earlier, as they're now used earlier.
4134         Use 'word_size' in a few more places, where it's appropriate.
4135         (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4136         padding before the data member of a bool vector.
4137         (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4138         than doing the check by hand with an abort ().
4140 2012-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
4142         * eval.c (Fdefvar): Don't check constants since we only set the var if
4143         it's not yet defined anyway (bug#11904).
4145         * lisp.h (last_undo_boundary): Declare new var.
4146         * keyboard.c (command_loop_1): Set it.
4147         * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4148         were auto-added by the command loop (bug#11774).
4150 2012-07-18  Andreas Schwab  <schwab@linux-m68k.org>
4152         * w32font.c (Qsymbol): Remove local definition.
4153         (syms_of_w32font): Don't DEFSYM it.
4155 2012-07-18  Dmitry Antipov  <dmantipov@yandex.ru>
4157         Fix sweep_vectors to handle large bool vectors correctly.
4158         * alloc.c (sweep_vectors): Account total_vector_bytes for
4159         bool vectors larger than VBLOCK_BYTES_MAX.
4161 2012-07-18  Chong Yidong  <cyd@gnu.org>
4163         * frame.c (x_set_frame_parameters): Revert bogus change introduced
4164         in 2012-05-25 commit by Paul Eggert (Bug#11738).
4166 2012-07-18  Dmitry Antipov  <dmantipov@yandex.ru>
4168         Return more descriptive data from Fgarbage_collect.
4169         Suggested by Stefan Monnier in
4170         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4171         * alloc.c (bounded_number): New function.
4172         (total_buffers, total_vectors): New variable.
4173         (total_string_size): Rename to total_string_bytes, adjust users.
4174         (total_vector_size): Rename to total_vector_bytes, adjust users.
4175         (sweep_vectors): Account total_vectors and total_vector_bytes.
4176         (Fgarbage_collect): New return value.  Adjust documentation.
4177         (gc_sweep): Account total_buffers.
4178         (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4179         (VECTOR_SIZE): Remove.
4180         * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4181         (Qinterval, Qmisc): New symbols.
4182         (syms_of_data): Initialize them.
4183         * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4184         (Qcons, Qbuffer): New declarations.
4186 2012-07-17  Paul Eggert  <eggert@cs.ucla.edu>
4188         * alloc.c (Fmemory_free): Account for memory-free's own storage.
4189         Round up, not down.  Improve doc.
4191 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
4193         Restore old code in allocate_string_data to avoid Faset breakage.
4194         Reported by Julien Danjou <julien@danjou.info> in
4195         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4196         * alloc.c (allocate_string_data): Restore old code with minor
4197         adjustments, fix comment to explain this subtle issue.
4199 2012-07-17  Eli Zaretskii  <eliz@gnu.org>
4201         Remove FILE_SYSTEM_CASE.
4202         * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4204         * fileio.c (FILE_SYSTEM_CASE): Don't define.
4205         (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4206         Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4207         call-process-region passes it through expand-file-name.
4209         * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4211 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
4213         Fix crash when creating indirect buffer (Bug#11917)
4214         * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4215         Don't handle unbound variables specially if non-zero.
4216         (Fbuffer_local_variables): Pass zero.
4217         (clone_per_buffer_values): Pass non-zero.
4219 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
4221         * gnutls.c (emacs_gnutls_handshake): Revert last change.  Add QUIT
4222         to make the loop interruptible.
4224 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
4226         * gnutls.c (emacs_gnutls_handshake): Only retry if
4227         GNUTLS_E_INTERRUPTED.
4229 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
4231         Cleanup and convert miscellaneous checks to eassert.
4232         * alloc.c (mark_interval): Fix comment, partially rephrase
4233         old comment from intervals.h (see below).
4234         * intervals.c (find_interval, adjust_intervals_for_insertion)
4235         (delete_interval, adjust_intervals_for_deletion)
4236         (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4237         Convert to eassert.
4238         (adjust_intervals_for_insertion, make_new_interval):
4239         Remove obsolete and unused code.
4240         * intervals.h (struct interval): Remove obsolete comment.
4241         * textprotp.c (erase_properties): Remove unused code.
4242         (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4243         (Fremove_list_of_text_properties): Convert to eassert.
4245 2012-07-17  Chong Yidong  <cyd@gnu.org>
4247         * editfns.c (Finsert_char): Doc fix.
4249 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
4251         Fix previous change to make Fmemory_free always accurate.
4252         * alloc.c (make_interval): Update total_free_intervals.
4253         (make_float): Likewise for total_free_floats.
4254         (free_cons, Fcons): Likewise for total_free_conses.
4255         (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4256         Likewise for total_free_vector_bytes.
4257         (Fmake_symbol): Likewise for total_free_symbols.
4258         (bytes_free): Remove.
4260 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
4262         Simple free memory accounting feature.
4263         * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4264         (sweep_vectors): Accumulate size of free vectors.
4265         (Fgarbage_collect): Setup bytes_free.
4266         (Fmemory_free): New function.
4267         (syms_of_alloc): Register it.
4269 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
4271         Cleanup overlays checking.
4272         * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4273         * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4274         eassert and OVERLAYP.
4275         (sort_overlays): Change to use OVERLAYP.
4277 2012-07-16  René Kyllingstad  <Rene@Kyllingstad.com>  (tiny change)
4279         * editfns.c (Finsert_char): Make it interactive, and make the
4280         second arg optional.  Copy interactive spec and docstring from
4281         ucs-insert.
4283 2012-07-17  Paul Eggert  <eggert@cs.ucla.edu>
4285         * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4286         Unlike the other wrapped functions, fabs has an unspecified
4287         effect on errno.
4289 2012-07-16  Jan Djärv  <jan.h.d@swipnet.se>
4291         * nsterm.m (keyDown): Interpret flags without left/right bits
4292         as the left key (Bug#11670).
4294 2012-07-16  Dmitry Antipov  <dmantipov@yandex.ru>
4296         Remove empty and useless init functions.
4297         * lisp.h (init_character_once, init_fns, init_image)
4298         (init_filelock, init_sound): Remove prototype.
4299         * character.c (init_character_once): Remove.
4300         * filelock.c (init_filelock): Likewise.
4301         * fns.c (init_fns): Likewise.
4302         * image.c (init_image): Likewise.
4303         * sound.c (init_sound): Likewise.
4304         * emacs.c (main): Adjust accordingly.
4306 2012-07-16  Dmitry Antipov  <dmantipov@yandex.ru>
4308         * gtkutil.h: Tiny cleanups.
4309         (use_old_gtk_file_dialog): Remove useless declaration.
4310         (xg_uses_old_file_dialog): Add suggested const attribute.
4312 2012-07-15  Eli Zaretskii  <eliz@gnu.org>
4314         * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4315         (bidi_paragraph_init): Use it to limit search forward for a strong
4316         directional character in abnormally large paragraphs full of
4317         neutral or weak characters.  (Bug#11943)
4319 2012-07-15  Stefano Facchini  <stefano.facchini@gmail.com>  (tiny change)
4321         * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4322         the toolbar (Bug#9451).
4323         (xg_make_tool_item): Give the widget event box a transparent
4324         background.
4326 2012-07-15  Dmitry Antipov  <dmantipov@yandex.ru>
4328         Cleanup basic allocation variables and functions.
4329         * alloc.c (ignore_warnings, init_intervals, init_float)
4330         (init_cons, init_symbol, init_marker): Remove.
4331         (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4332         (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4333         (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4334         (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4335         (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4336         (staticidx, init_alloc_once, init_strings, free_ablock):
4337         Remove redundant initialization.
4338         * fns.c (init_weak_hash_tables): Remove.
4339         * lisp.h (init_weak_hash_tables): Remove prototype.
4341 2012-07-15  Dmitry Antipov  <dmantipov@yandex.ru>
4343         Use zero_vector where appropriate.
4344         * alloc.c (zero_vector): Define as Lisp_Object.  Adjust users
4345         accordingly.
4346         * lisp.h (zero_vector): New declaration.
4347         * font.c (null_vector): Remove.
4348         (syms_of_font): Remove initialization and staticpro.
4349         (font_list_entities, font_find_for_lface): Change to use zero_vector.
4350         * keymap.c (Faccessible_keymaps): Likewise.
4352 2012-07-15  Leo Liu  <sdl.web@gmail.com>
4354         * fringe.c: Fix typo in comments.
4356 2012-07-14  Leo Liu  <sdl.web@gmail.com>
4358         * fringe.c: Add a new bitmap exclamation-mark.
4360 2012-07-14  Eli Zaretskii  <eliz@gnu.org>
4362         * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4364         * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4365         (HAVE_MENUS): Don't define, defined by editing config.in with
4366         msdos/sed2v2.inp.
4367         (GMALLOC_INHIBIT_VALLOC): Don't define.
4368         (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4370 2012-07-14  Juanma Barranquero  <lekktu@gmail.com>
4372         * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4374 2012-07-14  Glenn Morris  <rgm@gnu.org>
4376         * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4377         * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4378         Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4380 2012-07-13  Glenn Morris  <rgm@gnu.org>
4382         * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4384         * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4385         * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4387 2012-07-13  Jan Djärv  <jan.h.d@swipnet.se>
4389         * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4390         (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4391         (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4392         (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4393         where appropriate.
4394         (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4395         as boolean expression.
4396         (x_set_window_size): Remove unused variable toolbar.
4397         (ns_get_color_default, ns_mod_to_lisp): Remove.
4398         (ns_mouse_position): Remove unused variables xchar and ychar.
4399         (ns_compute_glyph_string_overhangs): Remove unused variable face.
4400         (ns_set_vertical_scroll_bar): Remove unused variable count.
4401         (ns_delete_terminal): Remove unused variable i.
4402         (ns_term_init): Remove unused variables r, g and b.
4403         (mouseDown): Remove unused variable window.
4404         (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4405         (initFrameFromEmacs): Remove unused variable vbextra.
4406         (mouseEntered): Remove unused variables p and dpyinfo.
4407         (mouseExited): Remove unused variables p and r.
4408         (ns_define_frame_cursor, ns_clear_frame_area)
4409         (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4410         (menuDown): Assign [sender tag] to variable and cast the variable.
4412         * nsterm.h (menuDown): Add id as type to argument sender.
4413         (ns_display_info_for_name): Add Lisp_Object argument.
4414         (ns_term_init): Add Lisp_Object argument.
4415         (ns_map_event_to_object): Add void argument.
4416         (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4417         prototype with arguments and only declare if __OBJC__.
4418         (nxatoms_of_nsselect): Add void argument.
4419         (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4420         (ns_alloc_autorelease_pool): Add void argument.
4421         (ns_release_autorelease_pool): Add void* argument.
4422         (ns_get_defaults_value): Add const char* argument.
4424         * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4425         (initFromContents): Use SSDATA where appropriate.
4426         (ns_update_menubar): Add braces to ambigous if-else.
4427         (initWithTitle): Put () around assignment in if statement.
4428         (ns_menu_show): Remove unused variables window and keymap.
4429         (update_frame_tool_bar): Remove unused variable selected_p.
4430         (initWithContentRect): Remove unused variable this_cmd_name.
4432         * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4433         appropriate.
4434         (setXBMColor): Remove unused variable len.
4435         (setPixmapData): Put () around assignment in loop statement.
4437         * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4438         (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4439         where appropriate.
4440         (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4441         around assignment in loop statement.
4442         (nsfont_open): Remove unused variable i.
4443         (nsfont_open): Remove unused variable len.
4444         (nsfont_draw): Remove unused variable cs.
4446         * nsfns.m (x_set_icon_name, ns_set_name_internal)
4447         (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4448         (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4449         (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4450         (Fns_font_name, Fns_perform_service)
4451         (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4452         (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4453         (ns_set_name): Remove unused variable view.
4454         (x_set_menu_bar_lines): Remove unused variable olines.
4455         (x_set_tool_bar_lines): Remove unused variable root_window.
4456         (Fns_list_colors): Put () around assignment in while statement.
4457         (Fns_perform_service): Remove unused variable len.
4458         (Fns_display_usable_bounds): Remove unused variable top.
4459         (syms_of_nsfns): Remove unused variable i.
4461         * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4462         memcpy (Bug#11907).
4464 2012-07-13  Kalle Kankare  <kalle.kankare@iki.fi>  (tiny change)
4466         * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4467         and free it with DestroyExceptionInfo (Bug#11558).
4469 2012-07-13  Juanma Barranquero  <lekktu@gmail.com>
4471         * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4472         (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4473         Set here, not in nt/config.nt.
4475 2012-07-13  Eli Zaretskii  <eliz@gnu.org>
4477         * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4478         cursor overflow into the last glyph on display line when the right
4479         fringe is off.  (Bug#11832)
4481 2012-07-13  Paul Eggert  <eggert@cs.ucla.edu>
4483         * xdisp.c (produce_special_glyphs): Now static.
4484         * dispextern.h (produce_special_glyphs): Remove decl.
4486 2012-07-13  Glenn Morris  <rgm@gnu.org>
4488         * s/bsd-common.h, s/cygwin.h: Remove empty files.
4489         * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4491         * s/usg5-4-common.h (USG, USG5):
4492         * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4493         * s/sol2-6.h (SOLARIS2):
4494         * s/irix6-5.h (IRIX6_5):
4495         * s/hpux10-20.h (USG, USG5, HPUX):
4496         * s/gnu-linux.h (USG, GNU_LINUX):
4497         * s/freebsd.h (BSD_SYSTEM):
4498         * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4499         * s/cygwin.h (CYGWIN):
4500         * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4501         * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4503 2012-07-13  BT Templeton  <bpt@hcoop.net>  (tiny change)
4505         * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
4507 2012-07-13  Glenn Morris  <rgm@gnu.org>
4509         * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4511         * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4513         * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4514         * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4516 2012-07-12  Glenn Morris  <rgm@gnu.org>
4518         * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
4520         * process.c (init_process_emacs): Rename from init_process.
4521         The old name is also the name of a Mach system call.
4522         * lisp.h, emacs.c: Update for this name change.
4523         * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4524         longer needed.
4526 2012-07-12  Eli Zaretskii  <eliz@gnu.org>
4528         * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4529         memmove call that removes glyphs covered by the left truncation
4530         glyph.  Improve commentary.
4531         (display_line): Fix display of continuation glyphs on GUI frames
4532         when the right fringe is turned off and variable-size fonts are
4533         used in the window.  Move the code that appends a stretch glyph to
4534         produce_special_glyphs, so that it could be used for truncation
4535         and continuation glyphs alike.
4536         (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4537         glyph of a suitably computed width, to align the special glyphs at
4538         the window margin.  Code moved from display_line.  (Bug#11832)
4540 2012-07-12  Glenn Morris  <rgm@gnu.org>
4542         * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4544         * s/gnu-linux.h, s/hpux10-20.h:
4545         Do not unconditionally define HAVE_XRMSETDATABASE.
4547         * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4549 2012-07-12  Paul Eggert  <eggert@cs.ucla.edu>
4551         Fix typos that broke OS X build.
4552         Reported by Randal L. Schwartz in
4553         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4554         * nsterm.m (ns_timeout): Add missing local decl.
4555         (ns_get_color): snprintf -> sprintf, to fix typo.
4557 2012-07-12  Glenn Morris  <rgm@gnu.org>
4559         * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4560         * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4561         * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4562         Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4564         * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4565         Move PTY_OPEN to configure.
4567         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4568         * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4569         * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4571 2012-07-12  Dmitry Antipov  <dmantipov@yandex.ru>
4573         Use empty_unibyte_string where applicable.
4574         * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4575         * lread.c (read1): Likewise.
4576         * xsettings.c (syms_of_xsettings): Likewise.
4578 2012-07-12  Glenn Morris  <rgm@gnu.org>
4580         * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4581         * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
4582         * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4583         * s/hpux10-20.h (RUN_TIME_REMAP):
4584         * s/bsd-common.h (TABDLY): Move to configure.
4586         * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4588         * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4590         * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4591         (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
4593         * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
4595         * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4596         * s/template.h: Move NARROWPROTO to configure.
4598 2012-07-11  Glenn Morris  <rgm@gnu.org>
4600         * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4601         unused since 2011-01-17 change to systty.h.
4603         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4604         * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4605         Move HAVE_PTYS and HAVE_SOCKETS to configure.
4607 2012-07-11  Paul Eggert  <eggert@cs.ucla.edu>
4609         * s/sol2-6.h (HAVE_LIBKSTAT): Remove.  (Bug#11914)
4611 2012-07-11  Glenn Morris  <rgm@gnu.org>
4613         * s/darwin.h, s/gnu-linux.h, s/template.h:
4614         Move INTERRUPT_INPUT to configure.
4616 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
4618         Minor adjustments to interning code.
4619         * lisp.h (intern, intern_c_string): Redefine as static inline
4620         wrappers for intern_1 and intern_c_string_1, respectively.
4621         (intern_1, intern_c_string_1): Rename prototypes.
4622         * lread.c (intern_1, intern_c_string_1, oblookup):
4623         Simplify Vobarray checking.
4624         * font.c (font_intern_prop): Likewise.  Adjust comment.
4625         * w32font.c (intern_font_name): Likewise.
4627 2012-07-11  Andreas Schwab  <schwab@linux-m68k.org>
4629         * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4631         * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4632         of Fcar/Fcdr if possible.
4633         * font.c (check_otf_features): Likewise.
4634         * fontset.c (Fnew_fontset): Likewise.
4635         * gnutls.c (Fgnutls_boot): Likewise.
4636         * minibuf.c (read_minibuf): Likewise.
4637         * msdos.c (IT_set_frame_parameters): Likewise.
4638         * xmenu.c (Fx_popup_dialog): Likewise.
4639         * w32menu.c (Fx_popup_dialog): Likewise.
4641 2012-07-11  Glenn Morris  <rgm@gnu.org>
4643         * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4644         since nothing has defined it on these platforms.
4646         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4647         * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4649         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4650         * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4651         Move CLASH_DETECTION to configure.
4653         * s/gnu.h: Remove file, which is now empty.
4655         * s/gnu.h, s/gnu-linux.h:
4656         Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4658 2012-07-11  John Wiegley  <johnw@newartisans.com>
4660         * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4661         function attribute, so we only use it if it exists in the
4662         compiler.
4664 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
4666         Avoid call to strlen in fast_c_string_match_ignore_case.
4667         * search.c (fast_c_string_match_ignore_case): Change to use
4668         length argument.  Adjust users accordingly.
4669         * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4671 2012-07-11  Paul Eggert  <eggert@cs.ucla.edu>
4673         Assume mkdir, rmdir.
4674         * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4675         * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4677         Assume rename.
4678         * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4680         Assume perror.
4681         * s/hpux10-20.h (HAVE_PERROR): Remove.
4682         * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4683         Remove dummy definition, as this problem was obsolete long ago.
4685         Assume strerror.
4686         * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4688 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
4690         Avoid calls to strlen in font processing functions.
4691         * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
4692         (font_open_by_name): Change to use length argument.
4693         Adjust users accordingly.
4694         * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4695         Adjust prototypes.
4696         * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4697         Change to return ptrdiff_t.
4698         (xfont_list_pattern, xfont_match): Use length returned by
4699         xfont_decode_coding_xlfd.
4700         * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4702 2012-07-11  Glenn Morris  <rgm@gnu.org>
4704         * s/darwin.h, s/freebsd.h, s/netbsd.h:
4705         Move DONT_REOPEN_PTY to configure.
4707         * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4708         * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4710 2012-07-10  Paul Eggert  <eggert@cs.ucla.edu>
4712         Remove "#define unix" that is no longer needed (Bug#11905).
4713         * s/aix4-2.h (unix): Remove; no longer needed.
4715         EMACS_TIME simplification (Bug#11875).
4716         This replaces macros (which typically do not work in GDB)
4717         with functions, typedefs and enums, making the code easier to debug.
4718         The functional style also makes code easier to read and maintain.
4719         * systime.h: Include <sys/time.h> on all hosts, not just if
4720         WINDOWSNT, since 'struct timeval' is needed in general.
4721         (EMACS_TIME): Now a typedef, not a macro.
4722         (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4723         not macros.
4724         (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4725         (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4726         (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4727         (EMACS_TIME_LE): Now functions, not macros.
4728         (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4729         (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4730         which are not functions.  All uses rewritten to use:
4731         (make_emacs_time): New function.
4732         (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4733         (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4734         not functions.  All uses rewritten to use the following, respectively:
4735         (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4736         (add_emacs_time, sub_emacs_time): New functions.
4737         * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
4738         * fileio.c (Fcopy_file):
4739         * xterm.c (XTflash): Get the current time closer to when it's used.
4740         * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4742         * bytecode.c (targets): Suppress -Woverride-init warnings.
4744         Simplify by avoiding confusing use of strncpy etc.
4745         * doc.c (Fsnarf_documentation):
4746         * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4747         * frame.c (Fmake_terminal_frame):
4748         * gtkutil.c (get_utf8_string):
4749         * lread.c (openp):
4750         * nsmenu.m (ns_update_menubar):
4751         * regex.c (regerror):
4752         Prefer memcpy to strncpy and strncat when either will do.
4753         * fileio.c (Fsubstitute_in_file_name):
4754         * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4755         (menu_separator_name_p):
4756         * nsmenu.m (ns_update_menubar):
4757         Prefer memcmp to strncmp when either will do.
4758         * nsterm.m: Include <ftoastr.h>.
4759         (ns_get_color):
4760         * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4761         Prefer snprintf to strncpy.
4762         * nsterm.m (ns_term_init):
4763         * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
4764         * nsterm.m (ns_term_init):
4765         Avoid the need for strncpy, by using build_string or
4766         make_unibyte_string directly.  Use dtoastr, not snprintf.
4767         * process.c (Fmake_network_process): Diagnose service names that
4768         are too long, rather than silently truncating them or creating
4769         non-null-terminated names.
4770         (Fnetwork_interface_info): Likewise, for interface names.
4771         * sysdep.c (system_process_attributes) [GNU_LINUX]:
4772         Prefer sprintf to strncat.
4773         * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
4774         Prefer vsnprintf to vsprintf + strncpy.
4776 2012-07-10  Glenn Morris  <rgm@gnu.org>
4778         * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
4779         Clarify fallback case.
4781 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
4783         Use XCAR and XCDR instead of Fcar and Fcdr where possible.
4784         * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
4785         * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
4786         * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
4787         where argument type is known to be a Lisp_Cons.
4789 2012-07-10  Tom Tromey  <tromey@redhat.com>
4791         * bytecode.c (BYTE_CODE_THREADED): New macro.
4792         (BYTE_CODES): New macro.  Replaces all old byte-code defines.
4793         (enum byte_code_op): New type.
4794         (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4795         (exec_byte_code): Use them.  Use token threading when applicable.
4797 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
4799         Optimize pure C strings initialization.
4800         * lisp.h (make_pure_string): Fix prototype.
4801         (build_pure_c_string): New function, defined as static inline.  This
4802         provides a better opportunity to optimize away calls to strlen when
4803         the function is called with compile-time constant argument.
4804         * alloc.c (make_pure_c_string): Fix comment.  Change to add nchars
4805         argument, adjust users accordingly.  Use build_pure_c_string where
4806         appropriate.
4807         * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4808         * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4809         * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4811 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
4813         Avoid calls to strlen in miscellaneous functions.
4814         * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4815         * font.c (Ffont_xlfd_name): Likewise.  Change to call make_string.
4816         * lread.c (openp): Likewise.
4818 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
4820         Avoid calls to strlen in path processing functions.
4821         * fileio.c (file_name_as_directory): Add comment.  Change to add
4822         srclen argument and return the length of result.  Adjust users
4823         accordingly.
4824         (directory_file_name): Fix comment.  Change to add srclen argument,
4825         swap 1st and 2nd arguments to obey the common convention.
4826         Adjust users accordingly.
4827         * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4829 2012-07-10  Glenn Morris  <rgm@gnu.org>
4831         * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4832         Move PENDING_OUTPUT_COUNT definition to configure.
4834         * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4835         * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4836         * s/gnu.h (DATA_START): Move definitions to configure.
4838         * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4839         We include usg5-4-common.h, which defines them both.
4841         * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4842         O_RDONLY already includes it).
4844         Stop ns builds setting the EMACSLOADPATH environment variable.
4845         * nsterm.m (ns_load_path): Rename from ns_init_paths.
4846         Now it does not set EMACSLOADPATH, just returns the load-path string.
4847         * nsterm.h: Update accordingly.
4848         * lread.c [HAVE_NS]: Include nsterm.h.
4849         (init_lread) [HAVE_NS]: Use ns_load_path.
4850         * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4852 2012-07-09  Glenn Morris  <rgm@gnu.org>
4854         * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4855         since the included bsd-common.h does so.
4857         Stop ns builds setting the EMACSPATH environment variable.
4858         * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4859         (ns_init_paths): Do not set EMACSPATH.
4860         * nsterm.h (ns_exec_path): Add it.
4861         * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4862         Use ns_exec_path.
4864         * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4866 2012-07-09  Paul Eggert  <eggert@cs.ucla.edu>
4868         * process.c (wait_reading_process_output): 'waitchannels' was unset
4869         when read_kbd || !NILP (wait_for_cell); fix this.
4871         Add GCC-style 'const' attribute to functions that can use it.
4872         * character.h (char_resolve_modifier_mask):
4873         * keyboard.h (make_ctrl_char):
4874         * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
4875         (init_character_once, next_almost_prime, init_fns, init_image)
4876         (flush_pending_output, init_sound):
4877         * mem-limits.h (start_of_data):
4878         * menu.h (finish_menu_items):
4879         Add ATTRIBUTE_CONST.
4880         * emacs.c (DEFINE_DUMMY_FUNCTION):
4881         Declare the dummy function with ATTRIBUTE_CONST.
4882         * lisp.h (Fbyteorder, Fmax_char, Fidentity):
4883         Add decls with ATTRIBUTE_CONST.
4885         Minor improvements to make_formatted_string.
4886         * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
4887         where int is good enough, as vsprintf returns an int.
4888         * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
4890 2012-07-09  Dmitry Antipov  <dmantipov@yandex.ru>
4892         Use make_formatted_string to avoid double length calculation.
4893         * lisp.h (make_formatted_string): New prototype.
4894         * alloc.c (make_formatted_string): New function.
4895         * buffer.c (Fgenerate_new_buffer_name): Use it.
4896         * dbus.c (syms_of_dbusbind): Likewise.
4897         * editfns.c (Fcurrent_time_zone): Likewise.
4898         * filelock.c (get_boot_time): Likewise.
4899         * frame.c (make_terminal_frame, set_term_frame_name)
4900         (x_report_frame_params): Likewise.
4901         * image.c (gs_load): Likewise.
4902         * minibuf.c (get_minibuffer): Likewise.
4903         * msdos.c (dos_set_window_size): Likewise.
4904         * process.c (make_process): Likewise.
4905         * xdisp.c (ensure_echo_area_buffers): Likewise.
4906         * xsettings.c (apply_xft_settings): Likewise.
4908 2012-07-09  Glenn Morris  <rgm@gnu.org>
4910         Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
4911         * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
4912         (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
4913         * nsterm.h (ns_etc_directory): Add it.
4914         * callproc.c [HAVE_NS]: Include nsterm.h.
4915         (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
4917 2012-07-09  Dmitry Antipov  <dmantipov@yandex.ru>
4919         Move marker debugging code under MARKER_DEBUG.
4920         * marker.c (MARKER_DEBUG): Move marker debugging code under
4921         #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
4922         for bootstrap with --enable-checking (~3x slowdown reported
4923         by Juanma Barranquero <lekktu@gmail.com>).
4924         (verify_bytepos): Move under #ifdef MARKER_DEBUG.
4926 2012-07-08  Paul Eggert  <eggert@cs.ucla.edu>
4928         * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
4929         See <http://bugs.gnu.org/11825#29>.
4931 2012-07-08  Eli Zaretskii  <eliz@gnu.org>
4933         * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4934         has no font, use the frame's font.  (Bug#11813)
4935         (display_line): Add commentary about displaying truncation glyphs
4936         on GUI frames.
4937         (produce_special_glyphs): Move here from term.c.
4939         * term.c (produce_special_glyphs): Move to xdisp.c.
4941         * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
4942         section.
4944 2012-07-07  Andreas Schwab  <schwab@linux-m68k.org>
4946         * xdisp.c (display_line): Avoid warning about implicit declaration
4947         of FRAME_FONT.
4949         * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
4951         * lisp.h: Remove empty conditional.
4953 2012-07-07  Paul Eggert  <eggert@cs.ucla.edu>
4955         * lread.c (load_path_check): Now static.
4957         Fix some minor --with-ns problems found by static checking.
4958         * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
4959         (x_set_font) [!HAVE_X_WINDOWS]:
4960         * image.c (xpm_load_image) [HAVE_NS]:
4961         (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
4962         (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
4963         Remove unused local.
4964         (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
4965         (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
4966         * image.c (x_create_bitmap_from_file) [HAVE_NS]:
4967         (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
4968         * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
4969         * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
4970         Fix pointer signedness problem.
4971         * xfaces.c (FRAME_X_FONT_TABLE):
4972         * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
4974 2012-07-07  Glenn Morris  <rgm@gnu.org>
4976         * lread.c (load_path_check): New function, split from init_lread.
4977         (init_lread): Reorganize.  Motivation:
4978         If EMACSLOADPATH is set, check/warn about that rather than the
4979         defaults, which we are not going to use.  Hence we can remove
4980         the turn_off_warning and WINDOWSNT || HAVE_NS tests.
4981         Don't warn if site-lisp directories are missing.
4982         If not installed, start from a blank load-path, since
4983         PATH_LOADSEARCH refers to the eventual installation directories.
4985 2012-07-07  Eli Zaretskii  <eliz@gnu.org>
4987         Support truncation and continuation glyphs on GUI frames, when
4988         fringes are disabled.  (Bug#11832)
4989         * xdisp.c (init_iterator): Get dimensions of truncation and
4990         continuation glyphs even if on GUI frames.
4991         Adjust it->last_visible_x on GUI frames when the left or right fringes,
4992         or both, are absent.
4993         (start_display, move_it_in_display_line_to): Handle the case of a
4994         GUI frame without a fringe to display continuation or truncation
4995         glyphs.
4996         (insert_left_trunc_glyphs): Support GUI frames: make sure
4997         truncation glyphs overwrite enough glyphs from the current line to
4998         have sufficient space in pixels.
4999         (display_line): Support truncation and continuation glyphs on GUI
5000         frames.  If some spare pixels are left on the line after inserting
5001         the truncation glyphs, fill that space with a stretch glyph of a
5002         suitably computed width.
5004         * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5005         produce_glyphs, to support GUI sessions.
5007 2012-07-07  Paul Eggert  <eggert@cs.ucla.edu>
5009         * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5011         * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5013         Do not require float-time's arg to fit in time_t (Bug#11825).
5014         This works better on hosts where time_t is unsigned, and where
5015         float-time is applied to the (negative) difference between two times.
5016         * editfns.c (decode_time_components): Last arg is now double *,
5017         not int *, and means to store all the result as a double, without
5018         worrying about whether the seconds part fits in time_t.
5019         All callers changed.
5020         (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5021         All callers changed.
5022         (Ffloat_time): Do not fail merely because the specified time falls
5023         outside of time_t range.
5025 2012-07-07  Glenn Morris  <rgm@gnu.org>
5027         * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5028         * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5029         * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5031 2012-07-07  Juanma Barranquero  <lekktu@gmail.com>
5033         * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5034         Update dependencies.
5036         * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5038 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
5040         Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5041         * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5042         * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5043         * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5044         * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5045         * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5047         * xfont.c (compare_font_names): Redo to omit the need for casts.
5049 2012-07-06  Andreas Schwab  <schwab@linux-m68k.org>
5051         * xfns.c (Fx_change_window_property): Doc fix.
5052         * w32fns.c (Fx_change_window_property): Doc fix.
5054         * w32fns.c (Fx_window_property): Accept the same arguments as the
5055         X Windows version.  Doc fix.
5056         * xfns.c (Fx_window_property): Doc fix.  (Bug#11870)
5058 2012-07-06  Juanma Barranquero  <lekktu@gmail.com>
5059             Eli Zaretskii  <eliz@gnu.org>
5061         * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5062         Windows-specific code from nt/config.nt moved here.
5063         Obsolete settings removed.
5065 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
5067         * process.c: Avoid unnecessary calls to gettime.
5068         (wait_reading_process_output): Don't get the time of day
5069         when gobbling data immediately and not waiting, as there's no need
5070         for it in that case.  This removes a FIXME.
5072 2012-07-06  Jan Djärv  <jan.h.d@swipnet.se>
5074         * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5075         is defined (Bug#11768).
5077 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
5079         Fix marker debugging code.
5080         * marker.c (byte_char_debug_check): Do not perform the check
5081         if buffer is not multibyte.
5082         (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5083         Call byte_char_debug_check with correct arguments.
5085 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
5087         Compile marker debugging code only if ENABLE_CHECKING is defined.
5088         * marker.c (byte_char_debug_check, count_markers):
5089         Use only if ENABLE_CHECKING is defined.
5090         (byte_debug_flag): Remove.
5091         (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5092         Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5094 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
5096         Avoid code repetition in marker-related functions.
5097         * marker.c (attach_marker): New function.
5098         (Fset_marker, set_marker_restricted, set_marker_both)
5099         (set_marker_restricted_both): Use it.
5100         (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5101         Consistently rename charno to charpos.
5102         (marker_position): Add eassert.
5103         (marker_byte_position): Convert to eassert.
5105 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
5107         Simplify list operations in unchain_overlay and unchain_marker.
5108         * buffer.c (unchain_overlay): Simplify.  Add comment.
5109         * marker.c (unchain_marker): Simplify.  Fix comments.
5111 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
5113         Introduce fast path for the widely used marker operation.
5114         * alloc.c (build_marker): New function.
5115         * lisp.h (build_marker): New prototype.
5116         * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5117         * composite.c (autocmp_chars): Likewise.
5118         * editfns.c (buildmark): Remove.
5119         (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5120         (save_restriction_save): Use build_marker.
5121         * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5122         * window.c (save_window_save): Likewise.
5124 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
5126         Do not use Fdelete_overlay in delete_all_overlays
5127         to avoid redundant calls to unchain_overlay.
5128         * buffer.c (drop_overlay): New function.
5129         (delete_all_overlays, Fdelete_overlay): Use it.
5130         * minibuf.c (get_minibuffer): Fix comment.
5132 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
5134         Port to OpenBSD 5.1 amd64.
5135         * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5136         This is needed for OpenBSD, and should be harmless on all BSD systems.
5137         Also, include <sys/sysctl.h>, as it should be available on all
5138         BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5139         (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5140         use p_pid member, not kp_proc.pid.
5142 2012-07-06  Glenn Morris  <rgm@gnu.org>
5144         * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5146 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
5148         More xmalloc and related cleanup.
5149         * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5150         * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5151         * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5152         * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5153         * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5154         * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5155         * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5156         * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5157         * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5158         * xterm.c:
5159         Omit needless casts involving void * pointers and allocation.
5160         Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5161         as the former is more robust if P's type is changed.
5162         Prefer xzalloc to xmalloc + memset 0.
5163         Simplify malloc-or-realloc to realloc.
5164         Don't worry about xmalloc returning a null pointer.
5165         Prefer xstrdup to xmalloc + strcpy.
5166         * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5167         growing it.
5168         * keyboard.c (apply_modifiers_uncached): Prefer local array to
5169         alloca of a constant.
5171 2012-07-05  Eli Zaretskii  <eliz@gnu.org>
5173         * xdisp.c (display_line): Fix horizontal pixel coordinates when
5174         hscroll is larger than the line width.  Fixes long and futile
5175         looping inside extend_face_to_end_of_line (on a TTY) producing
5176         glyphs that are not needed and thrown away.
5178 2012-07-05  Dmitry Antipov  <dmantipov@yandex.ru>
5180         * marker.c (set_marker_restricted_both): Simplify by using
5181         clip_to_bounds.
5183 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
5185         * editfns.c (region_limit): Simplify by using clip_to_bounds.
5187 2012-07-05  Jan Djärv  <jan.h.d@swipnet.se>
5189         * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5190         not defined (Bug#11768).
5191         (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5192         (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5193         (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5194         followed by gtk_box_set_homogeneous (Bug#11768).
5195         (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
5196         (update_theme_scrollbar_width, xg_create_scroll_bar):
5197         Use gtk_scrollbar_new (Bug#11768).
5198         (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5199         (is_box_type): New function (Bug#11768).
5200         (xg_tool_item_stale_p): Call is_box_type.
5201         (xg_initialize): Get settings by calling gtk_settings_get_for_screen
5202         with default display (Bug#11768).
5204 2012-07-05  Eli Zaretskii  <eliz@gnu.org>
5206         * xdisp.c (window_hscroll_limited): New function.
5207         (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5208         coordinates when window's hscroll is set to insanely large
5209         values.  (Bug#11857)
5211 2012-07-05  Juanma Barranquero  <lekktu@gmail.com>
5213         * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5214         ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5216 2012-07-05  Dmitry Antipov  <dmantipov@yandex.ru>
5218         Cleanup xmalloc.
5219         * lisp.h (xzalloc): New prototype.  Omit needless casts.
5220         * alloc.c (xzalloc): New function.  Omit needless casts.
5221         * charset.c: Omit needless casts.  Convert all calls to
5222         xmalloc with following memset to xzalloc.
5223         * dispnew.c: Likewise.
5224         * fringe.c: Likewise.
5225         * image.c: Likewise.
5226         * sound.c: Likewise.
5227         * term.c: Likewise.
5228         * w32fns.c: Likewise.
5229         * w32font.c: Likewise.
5230         * w32term.c: Likewise.
5231         * xfaces.c: Likewise.
5232         * xfns.c: Likewise.
5233         * xterm.c: Likewise.
5234         * atimer.c: Omit needless casts.
5235         * buffer.c: Likewise.
5236         * callproc.c: Likewise.
5237         * ccl.c: Likewise.
5238         * coding.c: Likewise.
5239         * composite.c: Likewise.
5240         * doc.c: Likewise.
5241         * doprnt.c: Likewise.
5242         * editfns.c: Likewise.
5243         * emacs.c: Likewise.
5244         * eval.c: Likewise.
5245         * filelock.c: Likewise.
5246         * fns.c: Likewise.
5247         * gtkutil.c: Likewise.
5248         * keyboard.c: Likewise.
5249         * lisp.h: Likewise.
5250         * lread.c: Likewise.
5251         * minibuf.c: Likewise.
5252         * msdos.c: Likewise.
5253         * print.c: Likewise.
5254         * process.c: Likewise.
5255         * region-cache.c: Likewise.
5256         * search.c: Likewise.
5257         * sysdep.c: Likewise.
5258         * termcap.c: Likewise.
5259         * terminal.c: Likewise.
5260         * tparam.c: Likewise.
5261         * w16select.c: Likewise.
5262         * w32.c: Likewise.
5263         * w32reg.c: Likewise.
5264         * w32select.c: Likewise.
5265         * w32uniscribe.c: Likewise.
5266         * widget.c: Likewise.
5267         * xdisp.c: Likewise.
5268         * xmenu.c: Likewise.
5269         * xrdb.c: Likewise.
5270         * xselect.c: Likewise.
5272 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
5274         * fileio.c (time_error_value): Check the right error number.
5275         Problem reported by Troels Nielsen in
5276         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5278 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
5280         * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5281         This should be fixed in a better way; see Eli Zaretskii in
5282         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5283         (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5285         * fileio.c (time_error_value): Rename from special_mtime.
5286         The old name's problems were noted by Eli Zaretskii in
5287         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5289         * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5290         This variable's comment says Emacs needs at least one GDB-visible
5291         symbol of type enum pvec_type, to work around GDB problems.
5292         The symbol's value doesn't matter.
5294         * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5295         that causes compilation to fail on pre-C99 compilers.
5297 2012-07-04  Juanma Barranquero  <lekktu@gmail.com>
5299         * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5300         (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5302 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
5304         * buffer.c (init_buffer_once): Fix initialization of
5305         headers for buffer_defaults and buffer_local_symbols.
5306         Reported by Juanma Barranquero <lekktu@gmail.com>.
5308 2012-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
5310         Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5311         * lisp.h (enum pvec_type): Use fewer bits.
5312         (PSEUDOVECTOR_SIZE_BITS): New constant.
5313         (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5314         (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5315         change in pvec_type.
5316         (PSEUDOVECTOR_TYPEP): New macro.
5317         (TYPED_PSEUDOVECTORP): Use it.
5318         * fns.c (internal_equal): Adapt code to extract pvectype.
5319         * emacs.c (gdb_pvec_type): Update type.
5320         * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5321         (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5322         (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5323         (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5324         (sweep_vectors): Use it.  Use local var `total_bytes' instead of
5325         abusing vector->header.next.nbytes.
5326         (live_vector_p): Use PVEC_TYPE.
5327         (mark_object): Adapt code to extract pvectype.  Use switch.
5329 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
5331         * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5332         Tighten new eassert a bit.
5334 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
5336         Fix compilation with --enable-gcc-warnings and -O1
5337         optimization level.
5338         * doprnt.c (doprnt): Change type of tem to int, initialize
5339         to avoid compiler warning.  Add eassert.
5340         * search.c (simple_search): Initialize match_byte to avoid
5341         compiler warning.  Add eassert.
5343 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
5345         Avoid weird behavior with large horizontal scrolls.
5346         Without this change, for example, large hscroll values would
5347         mess up Emacs's display on Fedora 15 x86, presumably due to
5348         overflows in int calculations in the display code.
5349         Also, if buffers had long lines, Emacs would freeze.
5350         * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5351         (set_window_hscroll): New function, containing the old guts of
5352         Fset_window_hscroll.  Return the clipped value.
5353         (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5354         This avoids the need to check against PTRDIFF_MAX.
5356         * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5358 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
5360         * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5362 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
5364         * regex.c: Suppress GCC warning on RHEL 6.  (Bug#11207)
5365         Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5366         since GCC 4.4.6 issues a bogus warning for them.
5368         Fix bugs in file timestamp newness comparisons.
5369         * fileio.c (Ffile_newer_than_file_p):
5370         * lread.c (Fload): Use full timestamp resolution of files,
5371         not just the 1-second resolution, so that files that are only
5372         slightly newer still count as newer.
5373         * fileio.c (Ffile_newer_than_file_p): Don't assume file
5374         timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5376 2012-07-03  Paul Eggert  <eggert@cs.ucla.edu>
5378         * fileio.c: Improve handling of file time marker.  (Bug#11852)
5379         (special_mtime): New function.
5380         (Finsert_file_contents, Fverify_visited_file_modtime):
5381         Use it to set special mtime values consistently.
5383 2012-07-03  Andreas Schwab  <schwab@linux-m68k.org>
5385         * fileio.c (Finsert_file_contents): Properly handle st_mtime
5386         marker for non-existing file.  (Bug#11852)
5388 2012-07-03  Glenn Morris  <rgm@gnu.org>
5390         * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5391         and did not make it into globals.h).
5393 2012-07-03  Tom Tromey  <tromey@redhat.com>
5395         * window.c (Fset_window_margins, Fset_window_fringes)
5396         (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5397         * textprop.c (Fprevious_property_change): No longer static.
5398         * syntax.c (Fsyntax_table_p): No longer static.
5399         * process.c (Fget_process, Fprocess_datagram_address): No longer
5400         static.
5401         * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5402         * keyboard.c (Fcommand_execute): No longer static.
5403         Remove EXFUN.
5404         * insdel.c (Fcombine_after_change_execute): No longer static.
5405         * image.c (Finit_image_library): No longer static.
5406         * fileio.c (Fmake_symbolic_link): No longer static.
5407         * eval.c (Ffetch_bytecode): No longer static.
5408         * editfns.c (Fuser_full_name): No longer static.
5409         * doc.c (Fdocumentation_property, Fsnarf_documentation):
5410         No longer static.
5411         * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5412         static.
5413         * dired.c (Ffile_attributes): No longer static.
5414         * composite.c (Fcomposition_get_gstring): No longer static.
5415         * callproc.c (Fgetenv_internal): No longer static.
5417         * ccl.h: Remove EXFUNs.
5418         * buffer.h: Remove EXFUNs.
5419         * dispextern.h: Remove EXFUNs.
5420         * intervals.h: Remove EXFUNs.
5421         * fontset.h: Remove EXFUN.
5422         * font.h: Remove EXFUNs.
5423         * dosfns.c (system_process_attributes): Remove EXFUN.
5424         * keymap.h: Remove EXFUNs.
5425         * lisp.h: Remove EXFUNs.
5426         * w32term.h: Remove EXFUNs.
5427         * window.h: Remove EXFUNs.
5428         * xsettings.h: Remove EXFUN.
5429         * xterm.h: Remove EXFUN.
5431 2012-07-03  Glenn Morris  <rgm@gnu.org>
5433         * lisp.h (Frandom): Make it visible to C.
5434         * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5435         buffer for invisible buffers.  (Bug#1229)
5437 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
5439         Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5440         values which aren't power of 2.
5441         * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5442         Verify it's value and the value of VECTOR_BLOCK_SIZE.  Adjust users
5443         accordingly.
5445 2012-07-03  Stefan Monnier  <monnier@iro.umontreal.ca>
5447         * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5449         * alloc.c (mark_object): Revert part of last patch to use `switch'.
5451 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
5453         * alloc.c (allocate_vector_block): Remove redundant
5454         calls to mallopt if DOUG_LEA_MALLOC is defined.
5455         (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5456         avoid calls to mallopt if zero_vector is returned.
5458 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
5460         * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5461         is enabled, avoid dereferencing NULL current_sblock if
5462         running undumped.
5464 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
5466         Cleanup basic buffer management.
5467         * buffer.h (struct buffer): Change layout to use generic vector
5468         marking code.  Fix some comments.  Change type of 'clip_changed'
5469         to bitfield.  Remove unused #ifndef old.
5470         (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5471         (GET_OVERLAYS_AT): Fix indentation.
5472         (for_each_per_buffer_object_at): New macro.
5473         * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5474         (Fbuffer_local_variables): Use it.
5475         (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5476         * alloc.c (allocate_buffer): Adjust to match new layout of
5477         struct buffer.  Fix comment.
5478         (mark_overlay): New function.
5479         (mark_buffer): Use it.  Use mark_vectorlike to mark normal
5480         Lisp area of struct buffer.
5481         (mark_object): Use it.  Adjust marking of misc objects
5482         and related comments.
5484 2012-07-02  Paul Eggert  <eggert@cs.ucla.edu>
5486         * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5487         wrapper that is not needed because the wrapped code is a no-op (zero
5488         machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5489         This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5491 2012-07-02  Dmitry Antipov  <dmantipov@yandex.ru>
5493         * alloc.c (mark_buffer): Simplify.  Remove prototype.
5494         (mark_object): Add comment.  Reorganize marking of vector-like
5495         objects.  Use CHECK_LIVE for all vector-like objects except buffers
5496         and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5497         Avoid redundant calls to mark_vectorlike for bool vectors.
5499 2012-06-30  Glenn Morris  <rgm@gnu.org>
5501         * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5503         * epaths.in (PATH_SITELOADSEARCH): New.
5504         * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5505         This is rather than relying on --enable-locallisppath elements
5506         having "site-lisp" in their names.  (Bug#10208#25, 11658)
5508 2012-06-30  Eli Zaretskii  <eliz@gnu.org>
5510         * w32proc.c (sys_select): Accept and ignore one more argument.
5512         * w32.c (emacs_gnutls_pull): Call select with one more argument.
5514         * sysselect.h [DOS_NT]: Don't include sys/select.h.
5515         (pselect) [!MS_DOS]: Redirect to sys_select.
5517         * sysdep.c: Don't include dos.h and dosfns.h.
5519         * process.c (sys_select):
5520         * msdos.c (sys_select): Accept one more argument and ignore it.
5522         * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5523         adapt data types and code to that.
5525         * dosfns.c:
5526         * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5527         which clashes with the gnulib function of the same name.
5529 2012-06-30  Andreas Schwab  <schwab@linux-m68k.org>
5531         * font.c (font_style_to_value, font_style_symbolic)
5532         (font_prop_validate_style): Add type checks for values in
5533         font_style_table.
5535         * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5536         argument.
5537         * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5538         uses.
5540 2012-06-29  Eli Zaretskii  <eliz@gnu.org>
5542         * xdisp.c (try_window_id): Undo last change.
5544         * w32.c (getwd): Adjust commentary about startup_dir.
5545         (init_environment): Always call sys_access, even in non-MSVC
5546         builds.  Don't chdir to the directory of the Emacs executable.
5547         This undoes code from 1997 which was justified by the need to
5548         "avoid conflicts when removing and renaming directories".  But its
5549         downside was that every relative file name was being interpreted
5550         relative to the directory of the Emacs executable, which can never
5551         be TRT.  In particular, it broke sys_access when called with
5552         relative file names.
5553         (sys_access): Map GetLastError to errno.
5555 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
5557         * window.h (struct window): Change type of 'fringes_outside_margins'
5558         to bitfield.  Fix comment.  Adjust users accordingly.
5559         (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
5560         Adjust comment.
5561         * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5562         to ptrdiff_t.
5564 2012-06-29  Andreas Schwab  <schwab@linux-m68k.org>
5566         * gnutls.c (emacs_gnutls_handshake):
5567         Add QUIT to make the loop interruptible.
5569 2012-06-29  Glenn Morris  <rgm@gnu.org>
5571         * charset.c (init_charset): Make lack of etc/charsets fatal.
5573 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
5575         * editfns.c (region_limit): Fix type mismatch.
5577 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
5579         * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5580         undefined.  Convert from xassert to eassert.
5581         * nsmenu.m: Convert from xassert to eassert.
5582         * nsterm.m: Likewise.
5584 2012-06-28  Stefan Monnier  <monnier@iro.umontreal.ca>
5586         * editfns.c (region_limit): Clip to narrowing (bug#11770).
5588 2012-06-28  Paul Eggert  <eggert@cs.ucla.edu>
5590         Avoid integer overflow on scroll-left and scroll-right.
5591         * window.c (HSCROLL_MAX): New macro.
5592         (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5593         overflow when requested scroll falls outside ptrdiff_t range.
5595 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
5597         * window.h (struct window): Change type of 'hscroll',
5598         'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5599         'last_modified' and 'last_overlay_modified' to EMACS_INT.
5600         Adjust users accordingly.
5601         * xdisp.c (try_cursor_movement): Replace type check with eassert.
5602         * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5603         from EMACS_INT to ptrdiff_t.
5604         (make_window): Omit redundant initialization.
5606 2012-06-28  Juanma Barranquero  <lekktu@gmail.com>
5608         * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5610 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
5612         * window.h (struct window): Change type of 'use_time' and
5613         'sequence_number' from Lisp_Object to int.
5614         * frame.c (make_frame): Adjust users accordingly.
5615         * print.c (print_object): Likewise.
5616         * window.c (select_window, Fwindow_use_time, make_parent_window)
5617         (make_window): Likewise.
5619 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
5621         * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5622         enabled with --enable-checking=[all,glyphs] configure option.
5623         Fix GLYPH_DEBUG usage assuming that it may be undefined,
5624         adjust comments accordingly.
5625         * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5626         undefined, adjust comments accordingly.
5627         * image.c: Likewise.
5628         * scroll.c: Likewise.
5629         * w32fns.c: Likewise.
5630         * w32term.c: Likewise.
5631         * xdisp.c: Likewise.
5632         * xfaces.c: Likewise.
5633         * xfns.c: Likewise.
5634         * xterm.c: Likewise.
5636 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
5638         Generalize run-time debugging checks.
5639         * dispextern.h (XASSERTS): Remove.
5640         * fontset.c (xassert): Remove.
5641         Convert from xassert to eassert.
5642         * alloc.c: Convert from xassert to eassert.
5643         * bidi.c: Likewise.
5644         * dispnew.c: Likewise.
5645         * fns.c: Likewise.
5646         * fringe.c: Likewise.
5647         * ftfont.c: Likewise.
5648         * gtkutil.c: Likewise.
5649         * image.c: Likewise.
5650         * keyboard.c: Likewise.
5651         * menu.c: Likewise.
5652         * process.c: Likewise.
5653         * scroll.c: Likewise.
5654         * sound.c: Likewise.
5655         * term.c: Likewise.
5656         * w32console.c: Likewise.
5657         * w32fns.c: Likewise.
5658         * w32term.c: Likewise.
5659         * window.c: Likewise.
5660         * xdisp.c: Likewise.
5661         * xfaces.c: Likewise.
5662         * xfns.c: Likewise.
5663         * xselect.c: Likewise.
5664         * xterm.c: Likewise.
5666 2012-06-27  Stefan Monnier  <monnier@iro.umontreal.ca>
5668         * fns.c (maybe_resize_hash_table): Output message when growing the
5669         purify-hashtable.
5671 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
5673         * alloc.c (allocate_string_data): Remove dead code.
5674         * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5675         avoid GCC warning about unused macro.
5677 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
5679         * alloc.c (allocate_string): Omit intervals initialization.
5680         * alloc.c (make_uninit_multibyte_string): Initialize intervals
5681         as in make_pure_string and make_pure_c_string.
5683 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
5685         * alloc.c (allocate_string): Fix last change.
5687 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
5689         * alloc.c (allocate_string): Remove two redundant calls
5690         to memset, add explicit initialization where appropriate.
5692 2012-06-27  Glenn Morris  <rgm@gnu.org>
5694         * lisp.mk (lisp): Remove paths.elc.
5696 2012-06-27  Chong Yidong  <cyd@gnu.org>
5698         * doc.c (Fsubstitute_command_keys): Fix punctuation.
5700 2012-06-26  John Wiegley  <johnw@newartisans.com>
5702         * unexmacosx.c (copy_data_segment): Add two section names used
5703         on Mac OS X Lion: __mod_init_func and __mod_term_func.
5705         * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5706         when building with Clang.
5708 2012-06-26  Stefan Monnier  <monnier@iro.umontreal.ca>
5710         * eval.c (Fapply): Allow calling it with a single argument.
5712 2012-06-26  Eli Zaretskii  <eliz@gnu.org>
5714         * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5715         _stricmp and _strnicmp.
5716         (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5718 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
5720         * alloc.c (allocate_window): Zero out non-Lisp part of newly
5721         allocated window.
5722         (allocate_process): Likewise for new process.
5723         (allocate_terminal): Change to use offsetof.
5724         (allocate_frame): Likewise.
5725         * frame.c (make_frame): Omit redundant initialization.
5726         * window.c (make_parent_window): Use memset.
5727         (make_window): Omit redundant initialization.
5728         * process.c (make_process): Omit redundant initialization.
5729         * terminal.c (create_terminal): Likewise.
5731 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
5733         * term.c (delete_tty): Remove redundant call to memset.
5735 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
5737         * alloc.c: Remove build_string.
5738         * lisp.h: Define build_string as static inline.  This provides
5739         a better opportunity to optimize away calls to strlen when the
5740         function is called with compile-time constant argument.
5741         * image.c (imagemagick_error): Convert to build_string.
5742         * w32proc.c (sys_spawnve): Likewise.
5743         * xterm.c (x_term_init): Likewise.
5745 2012-06-26  Paul Eggert  <eggert@cs.ucla.edu>
5747         Use sprintf return value instead of invoking strlen on result.
5748         In the old days this wasn't portable, since some sprintf
5749         implementations returned char *.  But they died out years ago and
5750         Emacs already assumes sprintf returns int.
5751         Similarly for float_to_string.
5752         This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5753         * ccl.c (ccl_driver):
5754         * character.c (string_escape_byte8):
5755         * data.c (Fnumber_to_string):
5756         * doprnt.c (doprnt):
5757         * print.c (print_object):
5758         * xdisp.c (message_dolog):
5759         * xfns.c (syms_of_xfns):
5760         Use sprintf or float_to_string result to avoid need to call strlen.
5761         * data.c (Fnumber_to_string):
5762         Use make_unibyte_string, since the string must be ASCII.
5763         * lisp.h, print.c (float_to_string): Now returns int length.
5764         * term.c (produce_glyphless_glyph):
5765         Use sprintf result rather than recomputing it.
5767         Clean out last vestiges of the old HAVE_CONFIG_H stuff.
5768         * Makefile.in (ALL_CFLAGS):
5769         * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
5770         * gmalloc.c, regex.c: Include <config.h> unconditionally.
5772 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
5774         * dispextern.h (xstrcasecmp): Define to library function
5775         strcasecmp if available.
5776         * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
5778 2012-06-25  Andreas Schwab  <schwab@linux-m68k.org>
5780         * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
5781         Avoid comma operator.
5782         * menu.c (push_submenu_start, push_submenu_end)
5783         (push_left_right_boundary, push_menu_pane): Likewise.
5784         * msdos.c (dos_rawgetc): Likewise.
5786 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
5788         * xfns.c (xic_create_fontsetname): Remove redundant calls
5789         to memset.
5791 2012-06-25  Paul Eggert  <eggert@cs.ucla.edu>
5793         * gtkutil.c (get_utf8_string): Remove redundant assignment.
5794         sprintf already null-terminates its output.
5796         * xfns.c (x_window): Remove redundant cast.
5798 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
5800         * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5801         `const char *' to `char *' to avoid compiler warning.
5803 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
5805         * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5806         instead of truncating it to 63 (admittedly a generous limit).
5808         * process.c: Fix spelling and caps in comments.
5810 2012-06-24  Dan Nicolaescu  <dann@ics.uci.edu>
5812         * emacs.c (setpgrp): Remove definition, unused.
5813         * sysdep.c (setpgrp): Remove definition, not used in this file.
5815 2012-06-24  Juanma Barranquero  <lekktu@gmail.com>
5817         * makefile.w32-in: Update dependencies.
5819 2012-06-24  Eli Zaretskii  <eliz@gnu.org>
5821         * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5822         (SYSTIME_H): Add nt/inc/sys/time.h.
5824         * systime.h [WINDOWSNT]: Include sys/time.h.
5826         * s/ms-w32.h (struct timespec): Definition moved from
5827         nt/inc/sys/time.h.  Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5829 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
5831         Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5832         * buffer.h (buffer_slot_type_mismatch):
5833         * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5834         * eval.c (unwind_to_catch):
5835         * image.c (my_png_error, my_error_exit):
5836         * keyboard.c (quit_throw_to_read_char, user_error)
5837         (Fexit_recursive_edit, Fabort_recursive_edit):
5838         * lisp.h (die, args_out_of_range, args_out_of_range_3)
5839         (wrong_type_argument, buffer_overflow, __executable_start)
5840         (memory_full, buffer_memory_full, string_overflow, Fthrow)
5841         (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5842         (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5843         (fatal):
5844         (child_setup) [!DOS_NT]:
5845         * lread.c (end_of_file_error, invalid_syntax):
5846         * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5847         * puresize.h (pure_write_error):
5848         * search.c (matcher_overflow):
5849         * sound.c (sound_perror, alsa_sound_perror):
5850         * sysdep.c, syssignal.h (croak):
5851         * term.c (maybe_fatal, vfatal):
5852         * textprop.c (text_read_only):
5853         * undo.c (user_error):
5854         * unexmacosx.c (unexec_error):
5855         * xterm.c (x_ins_del_lines, x_delete_glyphs):
5856         Use _Noreturn rather than NO_RETURN.
5857         No need for separate decl merely because of _Noreturn.
5858         * sound.c (sound_warning, parse_sound):
5859         Remove unnecessary forward decls.
5861 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
5863         Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5864         * lisp.h (WAIT_READING_MAX): New macro.
5865         * dispnew.c (Fsleep_for, sit_for):
5866         * keyboard.c (kbd_buffer_get_event):
5867         * process.c (Faccept_process_output):
5868         Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5869         This improves on the previous patch, which introduced a bug
5870         when time_t is unsigned and as wide as intmax_t.
5871         See <http://bugs.gnu.org/9000#51>.
5873 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
5875         * dispnew.c (sit_for, Fsleep_for):
5876         * keyboard.c (kbd_buffer_get_event):
5877         * process.c (Faccept_process_output): Avoid compiler warnings when
5878         comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
5880 2012-06-23  Juanma Barranquero  <lekktu@gmail.com>
5882         * makefile.w32-in: Update dependencies.
5884         * w32.c (ltime): Add return type and declare static.
5885         (w32_get_internal_run_time): Remove usused variable `time_100ns'.
5887 2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
5889         * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
5890         Privately reported by Herbert J. Skuhra.
5891         (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
5892         All uses changed.
5893         (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
5894         not make_lisp_timeval, when the argument is of type EMACS_TIME.
5896 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
5898         * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
5899         last argument of make_unibyte_string.
5901         * keyboard.c (kbd_buffer_get_event): Include the codepage and the
5902         language ID in the event parameters.
5904         * w32term.c (w32_read_socket): Put the new keyboard codepage into
5905         event.code, not the obscure "character set ID".
5907 2012-06-23  Chong Yidong  <cyd@gnu.org>
5909         * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
5911 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
5913         Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
5914         * w32.c (fdutimens): New function.
5916         * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
5918         * s/ms-w32.h (pselect): Redirect to sys_select.
5920         * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
5922         * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
5923         in the logic of incrementing and decrementing the value of
5924         use_relocatable_buffers.
5926 2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
5928         * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
5929         Privately reported by Herbert J. Skuhra.
5930         [__FreeBSD__]: Remove "*/" typo after "#include".
5931         (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
5932         (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
5933         (TIMEVAL, system_process_attributes) [__FreeBSD__]:
5934         Don't assume EMACS_TIME and struct timeval are the same type.
5936 2012-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5938         Support higher-resolution time stamps (Bug#9000).
5939         The time stamps are only nanosecond-resolution at the C level,
5940         since that's the best that any real-world system supports now.
5941         But they are picosecond-resolution at the Lisp level, as that's
5942         easy, and leaves room for future OS improvements.
5944         * Makefile.in (LIB_CLOCK_GETTIME): New macro.
5945         (LIBES): Use it.
5947         * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
5948         Don't get current time unless it's needed.
5950         * atimer.c: Include <sys/time.h> unconditionally, since gnulib
5951         now provides it if it's absent.
5952         (start_atimer): Port to higher-res time stamps.
5953         Check for time stamp overflow.  Don't get current time more
5954         often than is needed.
5956         * buffer.h (struct buffer): Buffer modtime now has high resolution.
5957         Include systime.h, not time.h.
5958         (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
5960         * dired.c: Include stat-time.h.
5961         (Ffile-attributes): File times now have higher resolution.
5963         * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
5964         (struct image): Timestamp now has higher resolution.
5966         * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
5967         has at least microseconds now.  All uses removed.
5968         (update_frame, update_single_window, update_window, update_frame_1)
5969         (Fsleep_for, sit_for): Port to higher-resolution time stamps.
5970         (duration_to_sec_usec): Remove; no longer needed.
5972         * editfns.c (time_overflow): Now extern.
5973         (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
5974         (float-time, Fformat_time_string, Fcurrent_time_string)
5975         (Fcurrent_time_zone): Accept and generate higher-resolution
5976         time stamps.
5977         (make_time_tail, make_lisp_time, dissassemble_lisp_time)
5978         (decode_time_components, lisp_seconds_argument): New functions.
5979         (make_time): Now static.
5980         (lisp_time_argument): Now returns EMACS_TIME.  New arg ppsec.
5981         Report an error if the time is invalid, rather than having the caller
5982         do that.
5984         * fileio.c: Include <stat-time.h>
5985         (Fcopy_file): Copy higher-resolution time stamps.
5986         Prefer to set the time stamp via a file descriptor if that works.
5987         (Fset_file_times, Finsert_file_contents, Fwrite_region)
5988         (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
5989         (Fvisited_file_modtime, Fset_visited_file_modtime):
5990         Support higher-resolution time stamps.
5992         * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
5994         * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
5996         * image.c (prepare_image_for_display, clear_image_cache)
5997         (lookup_image): Port to higer-resolution time stamps.
5999         * keyboard.c (start_polling, bind_polling_period):
6000         Check for time stamp overflow.
6001         (read_char, kbd_buffer_get_event, timer_start_idle)
6002         (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6003         (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6004         Port to higher-resolution time stamps.  Do not assume time_t is signed.
6005         (decode_timer): New function.  Timers are now vectors of length 9,
6006         not 8, to accommodate the picosecond component.
6007         (timer_check_2): Use it.
6009         * nsterm.m (select_timeout, timeval_subtract): Remove.
6010         (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6011         as they're a bit more accurate and handle overflow better.
6012         (ns_select): Change prototype to be compatible with pselect.
6013         (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6014         * nsterm.h (ns_select): Adjust prototype.
6016         * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6017         us-resolution time stamps.
6018         (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6020         * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6022         * lisp.h (time_overflow): New decl.
6023         (wait_reading_process_output): First arg is now intmax_t, not int,
6024         to accommodate larger waits.
6026         * process.h (struct Lisp_Process.read_output_delay):
6027         Now counts nanoseconds, not microseconds.
6028         * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6029         EMACS_HAS_USECS.
6030         (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6031         (wait_reading_process_output):
6032         Port to ns-resolution time stamps.
6033         (Faccept_process_output, wait_reading_process_output):
6034         Check for time stamp overflow.  Do not assume time_t is signed.
6035         (select_wrapper): Remove; we now use pselect.
6036         (Fprocess_attributes): Now generates ns-resolution time stamps.
6038         * sysdep.c: Include utimens.h.  Don't include utime.h
6039         or worry about struct utimbuf; gnulib does that for us now.
6040         (gettimeofday): Remove; gnulib provides a substitute.
6041         (make_timeval): New function.
6042         (set_file_times): Now sets ns-resolution time stamps.
6043         New arg FD; all uses changed.
6044         (time_from_jiffies, ltime_from_jiffies, get_up_time)
6045         (system_process_attributes):
6046         Now returns ns-resolution time stamp.  All uses changed.
6047         Check for time stamp overflow.
6049         * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6050         provides a substitute now.
6052         * systime.h: Include timespec.h rather than sys/time.h and time.h,
6053         since it guarantees struct timespec.
6054         (EMACS_TIME): Now struct timespec, so that we can support
6055         ns-resolution time stamps.
6056         (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6057         (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6058         (EMACS_USECS): Remove.
6059         (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6060         so multiply the arg by 1000 before storing it.
6061         (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6062         New macros.
6063         (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6064         Port to ns-resolution time stamps.
6065         (EMACS_TIME_NEG_P): Remove; replaced by....
6066         (EMACS_TIME_SIGN): New macro.
6067         (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6068         (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6069         (set_file_times, make_time, lisp_time_argument): Adjust signature.
6070         (make_timeval, make_lisp_time, decode_time_components): New decls.
6071         (EMACS_TIME_CMP): Remove; no longer used.  Plus, it was buggy, in
6072         that it mishandled time_t overflow.  You can't compare by subtracting!
6073         (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6074         (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6076         * term.c: Include <sys/time.h>.
6077         (timeval_to_Time): New function, for proper overflow wraparound.
6078         (term_mouse_position, term_mouse_click): Use it.
6080         * undo.c (record_first_change): Support higher-resolution time stamps
6081         in the undo buffer.
6082         (Fprimitive_undo): Use them when restoring time stamps.
6084         * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6085         (w32_get_internal_run_time):
6086         Port to higher-resolution Emacs time stamps.
6087         (ltime): Now accepts single 64-bit integer, as that's more convenient
6088         for callers.
6090         * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6092         * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6093         for compatibility with pselect.  Support ns-resolution time stamps.
6095         * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6097         * xselect.c (wait_for_property_change, x_get_foreign_selection):
6098         Check for time stamp overflow, and support ns-resolution time stamps.
6100         * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6101         Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6102         (timeval_subtract): Remove; no longer needed.
6103         (XTflash, XTring_bell, x_wait_for_event):
6104         Port to ns-resolution time stamps.  Don't assume time_t is signed.
6106 2012-06-22  Chong Yidong  <cyd@gnu.org>
6108         * xdisp.c (x_consider_frame_title): Revert last change.
6110 2012-06-22  Eli Zaretskii  <eliz@gnu.org>
6112         * alloc.c (NSTATICS): Enlarge to 0x650.  Otherwise, Emacs compiled
6113         with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6114         aborts in staticpro during startup.  (Without -DBYTE_CODE_METER,
6115         staticidx goes up to 1597 out of 1600 = 0x640.)
6117 2012-06-20  Paul Eggert  <eggert@cs.ucla.edu>
6119         * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6120         Otherwise, the umask might be mistakenly 0 while handling input signals.
6122 2012-06-19  Stefan Monnier  <monnier@iro.umontreal.ca>
6124         * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6126 2012-06-19  Dmitry Antipov  <dmantipov@yandex.ru>
6128         * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6129         * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6130         * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6131         access to `contents' member of Lisp_Vector objects with AREF and ASET
6132         where appropriate.
6134 2012-06-19  Chong Yidong  <cyd@gnu.org>
6136         * frame.c (delete_frame): When selecting a frame on a different
6137         text terminal, do not alter the terminal's top-frame.
6139         * xdisp.c (format_mode_line_unwind_data): Record the target
6140         frame's selected window and its terminal's top-frame.
6141         (unwind_format_mode_line): Restore them.
6142         (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6143         Callers changed.
6144         (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6145         since tty frames can be explicitly named.
6146         (prepare_menu_bars): Likewise.
6148         * term.c (Ftty_top_frame): New function.
6150 2012-06-18  Paul Eggert  <eggert@cs.ucla.edu>
6152         Port byte-code-meter to modern targets.
6153         * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6154         !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG.  Problem with
6155         CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
6156         <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6157         (METER_1, METER_2): Simplify.
6159 2012-06-18  Stefan Monnier  <monnier@iro.umontreal.ca>
6161         * data.c (Fdefalias): Return `symbol' (bug#11686).
6163 2012-06-18  Martin Rudalics  <rudalics@gmx.at>
6165         * buffer.c (Fkill_buffer): Don't throw an error when the buffer
6166         gets killed during executing of this function (Bug#11665).
6167         Try to always return Qt when the buffer has been actually killed.
6168         (Vkill_buffer_query_functions): In doc-string say that functions
6169         run by this hook should not change the current buffer.
6171 2012-06-18  Paul Eggert  <eggert@cs.ucla.edu>
6173         Fix recently-introduced process.c problems found by static checking.
6174         * process.c (write_queue_push, write_queue_pop, send_process):
6175         Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6176         (write_queue_pop): Fix pointer signedness problem.
6177         (send_process): Remove unused local.
6179 2012-06-17  Chong Yidong  <cyd@gnu.org>
6181         * xdisp.c (redisplay_internal): No need to redisplay terminal
6182         frames that are not on top.
6184 2012-06-17  Troels Nielsen  <bn.troels@gmail.com>
6186         * process.c (make_process): Initialize write_queue.
6187         (write_queue_push, write_queue_pop): New functions.
6188         (send_process): Use them to maintain correct ordering of process
6189         writes (Bug#10815).
6191 2012-06-17  Paul Eggert  <eggert@cs.ucla.edu>
6193         * lisp.h (eassert): Assume C89 or later.
6194         This removes the need for CHECK.
6195         (CHECK): Remove.  Its comments about always evaluating its
6196         argument were confusing, as 'eassert' typically does not evaluate
6197         its argument.
6199         * coding.c (produce_chars): Use ptrdiff_t, not int.
6201         * xterm.c (x_draw_underwave): Check for integer overflow.
6202         This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6204 2012-06-17  Jan Djärv  <jan.h.d@swipnet.se>
6206         * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6207         referenced (Bug#11583).
6209 2012-06-16  Aurelien Aptel  <aurelien.aptel@gmail.com>
6211         Implement wave-style variant of underlining.
6212         * dispextern.h (face_underline_type): New enum.
6213         (face): Add field for underline type.
6214         * nsterm.m (ns_draw_underwave): New function.
6215         (ns_draw_text_decoration): Use it.
6216         * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6217         New functions.
6218         (x_draw_glyph_string): Use them.
6219         * xfaces.c (Qline, Qwave): New Lisp objects.
6220         (check_lface_attrs, merge_face_ref)
6221         (Finternal_set_lisp_face_attribute, realize_x_face):
6222         Handle wave-style underline face attributes.
6223         * xterm.c (x_draw_underwave): New function.
6224         (x_draw_glyph_string): Use it.
6226 2012-06-16  Juanma Barranquero  <lekktu@gmail.com>
6228         * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6229         ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6230         ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6231         ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6232         ($(BLD)/w32select.$(O)): Update dependencies.
6234 2012-06-16  Andreas Schwab  <schwab@linux-m68k.org>
6236         * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6237         (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6238         * character.c (_fetch_multibyte_char_p): Remove.
6239         * alloc.c: Include "character.h" before "buffer.h".
6240         * bidi.c: Likewise.
6241         * buffer.c: Likewise.
6242         * bytecode.c: Likewise.
6243         * callint.c: Likewise.
6244         * callproc.c: Likewise.
6245         * casefiddle.c: Likewise.
6246         * casetab.c: Likewise.
6247         * category.c: Likewise.
6248         * cmds.c: Likewise.
6249         * coding.c: Likewise.
6250         * composite.c: Likewise.
6251         * dired.c: Likewise.
6252         * dispnew.c: Likewise.
6253         * doc.c: Likewise.
6254         * dosfns.c: Likewise.
6255         * editfns.c: Likewise.
6256         * emacs.c: Likewise.
6257         * fileio.c: Likewise.
6258         * filelock.c: Likewise.
6259         * font.c: Likewise.
6260         * fontset.c: Likewise.
6261         * fringe.c: Likewise.
6262         * indent.c: Likewise.
6263         * insdel.c: Likewise.
6264         * intervals.c: Likewise.
6265         * keyboard.c: Likewise.
6266         * keymap.c: Likewise.
6267         * lread.c: Likewise.
6268         * macros.c: Likewise.
6269         * marker.c: Likewise.
6270         * minibuf.c: Likewise.
6271         * nsfns.m: Likewise.
6272         * nsmenu.m: Likewise.
6273         * print.c: Likewise.
6274         * process.c: Likewise.
6275         * regex.c: Likewise.
6276         * region-cache.c: Likewise.
6277         * search.c: Likewise.
6278         * syntax.c: Likewise.
6279         * term.c: Likewise.
6280         * textprop.c: Likewise.
6281         * undo.c: Likewise.
6282         * unexsol.c: Likewise.
6283         * w16select.c: Likewise.
6284         * w32fns.c: Likewise.
6285         * w32menu.c: Likewise.
6286         * window.c: Likewise.
6287         * xdisp.c: Likewise.
6288         * xfns.c: Likewise.
6289         * xmenu.c: Likewise.
6290         * xml.c: Likewise.
6291         * xselect.c: Likewise.
6293 2012-06-16  Eli Zaretskii  <eliz@gnu.org>
6295         * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6296         If all the glyphs of the glyph row came from strings, and we have no
6297         cursor positioning clues, put the cursor on the first glyph of the
6298         row.
6299         (handle_face_prop): Use chunk-relative overlay string index when
6300         indexing into it->string_overlays array.  (Bug#11653)
6301         (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6302         the rightmost.  (Bug#11720)
6304 2012-06-16  Andreas Schwab  <schwab@linux-m68k.org>
6306         * category.h (CHAR_HAS_CATEGORY): Define as inline.
6307         (CATEGORY_MEMBER): Enforce 1/0 value.
6308         * category.c (_temp_category_set): Remove.
6310 2012-06-16  Eli Zaretskii  <eliz@gnu.org>
6312         * window.c (Fdelete_other_windows_internal)
6313         (Fdelete_window_internal): Don't access frame's mouse highlight
6314         info of the initial frame.  (Bug#11677)
6316 2012-06-14  Paul Eggert  <eggert@cs.ucla.edu>
6318         * .gdbinit (xgetint): Fix recently-introduced paren typo.
6319         Assume USE_2_TAGS_FOR_INTS.
6320         (xreload): Adjust $tagmask width to match recent lisp.h change.
6322         Simplify lisp.h in minor ways that should not affect code.
6323         * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6324         (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6325         (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6326         Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6327         (INTTYPEBITS): New macro, for clarity.
6328         (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
6329         (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6330         Simplify now that USE_LSB_TAG is always defined.
6331         (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6332         (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6334 2012-06-13  Juanma Barranquero  <lekktu@gmail.com>
6336         * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6338 2012-06-13  Glenn Morris  <rgm@gnu.org>
6340         * s/bsd-common.h (BSD4_3):
6341         * s/usg5-4-common.h (USG5_4): No longer define; unused.
6343 2012-06-13  Andreas Schwab  <schwab@linux-m68k.org>
6345         * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6346         instead of union.
6347         (XLI, XIL): Define.
6348         (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6349         Use them.
6350         * emacs.c (gdb_use_struct): Rename from gdb_use_union.
6351         * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
6352         * alloc.c (widen_to_Lisp_Object): Remove.
6353         (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6354         * frame.c (delete_frame): Remove outdated comment.
6355         * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6356         USE_LISP_UNION_TYPE.
6357         (Fw32_unregister_hot_key): Likewise.
6358         (Fw32_toggle_lock_key): Likewise.
6359         * w32menu.c (add_menu_item): Likewise.
6360         (w32_menu_display_help): Use XIL instead of checking
6361         USE_LISP_UNION_TYPE.
6362         * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6363         (init_heap): Likewise.
6364         * w32term.c (w32_read_socket): Update comment.
6366 2012-06-13  Glenn Morris  <rgm@gnu.org>
6368         * s/usg5-4-common.h, src/s/unixware.h:
6369         Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6371         * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6373 2012-06-13  Paul Eggert  <eggert@cs.ucla.edu>
6375         USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6376         * alloc.c (make_number) [!defined make_number]:
6377         Remove, as lisp.h always defines this now.
6378         (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6379         (roundup_size): Verify that it is a power of 2.
6380         * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6381         * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6382         * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6383         -DUSE_LSB_TAG=0, to override the automatically-selected default.
6384         USE_LSB_TAG now is always defined to be either 0 or 1.
6385         All uses changed.
6386         (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6387         code works fine either way, and efficiency is not a concern here,
6388         as the union type is for debugging, not for production.
6389         (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6390         Use an inline function on all platforms when using the union type,
6391         since this is simpler and 'static inline' can be used portably
6392         within Emacs now.
6393         (LISP_INITIALLY_ZERO): New macro.
6394         (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6395         (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6397 2012-06-12  Glenn Morris  <rgm@gnu.org>
6399         * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6401         * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
6403         * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6404         Move BROKEN_SIGIO to configure.
6406         * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6407         Move NO_TERMIO to configure.
6409 2012-06-12  Chong Yidong  <cyd@gnu.org>
6411         * image.c (imagemagick_load_image): Use MagickFlattenImage if
6412         MagickMergeImageLayers is undefined.  Use pixel pusher loop if
6413         MagickExportImagePixels is undefined.
6415 2012-06-12  Paul Eggert  <eggert@cs.ucla.edu>
6417         * image.c (imagemagick_load_image): Remove unused label.
6419 2012-06-11  Glenn Morris  <rgm@gnu.org>
6421         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6422         * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6423         * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6424         * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6426 2012-06-11  Stefan Monnier  <monnier@iro.umontreal.ca>
6428         * alloc.c (make_byte_code): New function.
6429         (Fmake_byte_code): Use it.  Don't purify here.
6430         * lread.c (read1): Use it as well to avoid extra allocation.
6432 2012-06-11  Chong Yidong  <cyd@gnu.org>
6434         * image.c (imagemagick_load_image): Implement transparency.
6436 2012-06-10  Andreas Schwab  <schwab@linux-m68k.org>
6438         * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6439         account for preceding backslashes.  (Bug#11663)
6441 2012-06-09  Chong Yidong  <cyd@gnu.org>
6443         * term.c: Support italics in capable terminals (Bug#9652).
6444         (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6445         (turn_on_face): Output using TS_enter_italic_mode if available.
6446         Don't handle unused blinking and alt-charset cases.
6447         (turn_off_face): Handle italic case; discard unused tty_blinking_p
6448         and tty_alt_charset_p cases.
6449         (tty_capable_p, init_tty): Support italics.
6451         * termchar.h (struct tty_display_info): Add field for italics.
6452         Remove unused blink field.
6454         * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6455         Handle slant.
6457         * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6458         (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6459         tty_alt_charset_p.  Add tty_italic_p.
6461 2012-06-09  Michael Albinus  <michael.albinus@gmx.de>
6463         * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6464         dbus_type_is_basic if available.
6465         (xd_extract_signed, xd_extract_unsigned): Rename from
6466         extract_signed and extract_unsigned, respectively.  Adapt callers.
6468 2012-06-09  Chong Yidong  <cyd@gnu.org>
6470         * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6472         * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6473         case (Bug#9752).
6475 2012-06-08  Paul Eggert  <eggert@cs.ucla.edu>
6477         * xdisp.c (vmessage): Treat frame message as multibyte.
6478         Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6479         would generate the diagnostic "Making \302\247 buffer-local while
6480         let-bound!".
6482 2012-06-08  Eli Zaretskii  <eliz@gnu.org>
6484         * dispnew.c (showing_window_margins_p): Undo last change, which
6485         was done due to an inadvertent commit.
6486         (adjust_frame_glyphs_for_frame_redisplay): Do call
6487         showing_window_margins_p.
6489 2012-06-08  Stefan Monnier  <monnier@iro.umontreal.ca>
6491         * eval.c (Fmake_var_non_special): New primitive.
6492         (syms_of_eval): Defsubr it.
6493         * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6495 2012-06-08  Juanma Barranquero  <lekktu@gmail.com>
6497         * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6498         function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6500 2012-06-08  Eli Zaretskii  <eliz@gnu.org>
6502         * alloc.c (allocate_vectorlike): Fix last change.
6504 2012-06-08  Dmitry Antipov  <dmantipov@yandex.ru>
6506         Block-based vector allocation of small vectors.
6507         * lisp.h (struct vectorlike_header): New field `nbytes',
6508         adjust comment accordingly.
6509         * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
6510         to denote vector blocks.  Adjust users (live_vector_p,
6511         mark_maybe_pointer, valid_lisp_object_p) accordingly.
6512         (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6513         (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6514         (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6515         (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6516         (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6517         (roundup_size): New constant.
6518         (struct vector_block): New data type.
6519         (vector_blocks, vector_free_lists, zero_vector): New variables.
6520         (all_vectors): Rename to `large_vectors'.
6521         (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6522         (sweep_vectors): New functions.
6523         (allocate_vectorlike): Return `zero_vector' as the only vector of
6524         0 items.  Allocate new vector from block if vector size is less than
6525         or equal to VBLOCK_BYTES_MAX.
6526         (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6527         (init_alloc_once): Add call to init_vectors.
6529 2012-06-08  Stefan Monnier  <monnier@iro.umontreal.ca>
6531         * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6533 2012-06-07  Paul Eggert  <eggert@cs.ucla.edu>
6535         * doprnt.c (doprnt): Truncate multibyte char correctly.
6536         Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6537         would mishandle a string argument "Xc" if X was a multibyte
6538         character of length 2: it would truncate after X's first byte
6539         rather than including all of X.
6541 2012-06-06  Chong Yidong  <cyd@gnu.org>
6543         * buffer.c (word_wrap): Doc fix.
6545 2012-06-04  Paul Eggert  <eggert@cs.ucla.edu>
6547         * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6549 2012-06-03  Glenn Morris  <rgm@gnu.org>
6551         * xdisp.c (tool-bar-style): Doc fix.
6553 2012-06-03  Ulrich Müller  <ulm@gentoo.org>
6555         * Makefile.in (PAXCTL): Define.
6556         (temacs$(EXEEXT)): Disable memory randomization for the temacs
6557         binary via PaX flags if the paxctl utility is available.
6558         (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6559         Restore PaX flags to their default.  (Bug#11398)
6561 2012-06-03  Chong Yidong  <cyd@gnu.org>
6563         * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6564         buffer (Bug#11226).
6566 2012-06-03  Chong Yidong  <cyd@gnu.org>
6568         * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6569         (note_mode_line_or_margin_highlight): If there is no help echo,
6570         use mode-line-default-help-echo.  Handle the case where the mouse
6571         position is past the end of the mode line string.
6573         * buffer.c (buffer_local_value_1): New function, split from
6574         Fbuffer_local_value; can return Qunbound.
6575         (Fbuffer_local_value): Use it.
6576         (Vmode_line_format): Docstring tweaks.
6578 2012-06-02  Paul Eggert  <eggert@cs.ucla.edu>
6580         * sysdep.c (system_process_attributes): Improve comment.
6582 2012-06-02  Stefan Monnier  <monnier@iro.umontreal.ca>
6584         * keyboard.c: Export real-this-command to Elisp.
6585         (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6586         and DEFVAR it.  Update all users.
6588 2012-06-02  Paul Eggert  <eggert@cs.ucla.edu>
6590         * minibuf.c (Fassoc_string): Remove duplicate declaration.
6592         * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6593         Convert pctcpu and pctmem to Lisp float properly.
6594         Let the compiler fold better, as 100.0/0x8000 is exact.
6596 2012-06-02  Andreas Schwab  <schwab@linux-m68k.org>
6598         * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6599         cons_block.
6601 2012-06-01  Paul Eggert  <eggert@cs.ucla.edu>
6603         * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6605 2012-06-01  Dmitry Antipov  <dmantipov@yandex.ru>
6607         For a 'struct window', replace some Lisp_Object fields to
6608         bitfields where appropriate, remove unused fields.
6609         * window.h (struct window): Remove unused 'last_mark_x' and
6610         'last_mark_y' fields.  Rename 'mini_p' field to 'mini',
6611         change it's type from Lisp_Object to bitfield.
6612         Change type of 'force_start', 'optional_new_start',
6613         'last_had_star', 'update_mode_line' and 'start_at_line_beg'
6614         fields from Lisp_Object to bitfield.  Adjust users accordingly.
6616 2012-05-31  Paul Eggert  <eggert@cs.ucla.edu>
6618         Pacify gcc -Wdouble-precision when using Xaw.
6619         * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6620         [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6621         Use 'float' consistently, rather than 'float' in most places
6622         and 'double' in a couple of places.
6624 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
6626         * xdisp.c (handle_stop): Detect whether we have overlay strings
6627         loaded by testing it->current.overlay_string_index to be
6628         non-negative, instead of checking whether n_overlay_strings is
6629         positive.  (Bug#11587)
6631 2012-05-31  Chong Yidong  <cyd@gnu.org>
6633         * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6635         * doc.c (Fsubstitute_command_keys): Doc fix.
6637 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
6639         * search.c (search_buffer): Remove calls to
6640         r_alloc_inhibit_buffer_relocation, as it is now called by
6641         maybe_unify_char, which was the cause of relocation of buffer text
6642         in bug#11519.
6644 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
6646         * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6647         for the duration of call to load_charset, to avoid problems with
6648         callers of maybe_unify_char that access buffer text through C
6649         pointers.
6651         * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6652         decrement the inhibition flag, instead of just setting or
6653         resetting it.
6655 2012-05-31  Paul Eggert  <eggert@cs.ucla.edu>
6657         Remove obsolete '#define static' cruft.
6658         * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6659         This #undef was "temporary" in 2000; it is no longer needed
6660         now that '#define static' has gone away.
6661         * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6662         (gray_bitmap_bits): Remove; no longer needed.
6663         All uses replaced with definiens.
6664         * xterm.c: Include "bitmaps/gray.xbm".
6666 2012-05-30  Paul Eggert  <eggert@cs.ucla.edu>
6668         Clean up __executable_start, monstartup when --enable-profiling.
6669         The following changes affect the code only when profiling.
6670         * dispnew.c (__executable_start): Rename from safe_bcopy.
6671         Define only on platforms that need it.
6672         * emacs.c: Include <sys/gmon.h> when profiling.
6673         (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6674         (__executable_start): Remove decl, since lisp.h does it now.
6675         (safe_bcopy): Remove decl; no longer has that name.
6676         (main): Coalesce #if into single bit of code, for simplicity.
6677         Cast pointers to uintptr_t, since standard libraries want integers
6678         and not pointers.
6679         * lisp.h (__executable_start): New decl.
6681 2012-05-31  Glenn Morris  <rgm@gnu.org>
6683         * image.c (Fimagemagick_types): Doc fix.
6685 2012-05-30  Jim Meyering  <meyering@redhat.com>
6687         * callproc.c (Fcall_process_region): Include directory component
6688         in mkstemp error message (Bug#11586).
6690 2012-05-30  Paul Eggert  <eggert@cs.ucla.edu>
6692         * alloc.c, lisp.h (make_pure_vector): Now static.
6694 2012-05-30  Stefan Monnier  <monnier@iro.umontreal.ca>
6696         * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6697         Move to byte-run.el.
6698         (Fautoload): Do the hash-doc more carefully.
6699         * data.c (Fdefalias): Purify definition, except for keymaps.
6700         (Qdefun): Move from eval.c.
6701         * lisp.h (Qdefun): Remove.
6702         * lread.c (read1): Tiny simplification.
6704 2012-05-29  Troels Nielsen  <bn.troels@gmail.com>
6706         Do not create empty overlays with the evaporate property (Bug#9642).
6707         * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6708         Bug#9642, but explicitly check that the buffer the overlay would
6709         be moved to is live and rearrange lines to make sure that errors
6710         will not put the overlay in an inconsistent state.
6711         (Fdelete_overlay): Cosmetics.
6713 2012-05-28  Eli Zaretskii  <eliz@gnu.org>
6715         * w32term.c (my_bring_window_to_top): New function.
6716         (x_raise_frame): Use handle returned by DeferWindowPos, which
6717         could be different from the original one.
6718         Call my_bring_window_to_top instead of my_set_foreground_window.
6719         (Bug#11513)
6721         * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6722         by calling BringWindowToTop.
6724         * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6725         (WM_EMACS_END): Increase by one.
6727 2012-05-28  Paul Eggert  <eggert@cs.ucla.edu>
6729         * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6730         This avoids undefined behavior that might cause the eassert
6731         to not catch an out-of-range value.
6733 2012-05-28  Juanma Barranquero  <lekktu@gmail.com>
6735         * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6736         Update dependencies.
6738 2012-05-27  Eli Zaretskii  <eliz@gnu.org>
6740         * bidi.c (bidi_mirror_char): Fix last change.
6742 2012-05-27  Andreas Schwab  <schwab@linux-m68k.org>
6744         * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6745         when referring to sectname field in printf format.
6747 2012-05-27  Paul Eggert  <eggert@cs.ucla.edu>
6749         * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6750         Only r_alloc_inhibit_buffer_relocation needed to be added;
6751         the others were already declared.
6753         * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6754         before checking whether it's out of range.  Put the check inside
6755         eassert.  See
6756         <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6758 2012-05-27  Ken Brown  <kbrown@cornell.edu>
6760         * callproc.c (Fcall_process): Restore a line that was accidentally
6761         commented out in the 2011-02-13 change (bug#11547).
6763 2012-05-27  Eli Zaretskii  <eliz@gnu.org>
6765         * lisp.h [REL_ALLOC]: Add prototypes for external functions
6766         defined on ralloc.c.
6768         * buffer.c [REL_ALLOC]: Remove prototypes of
6769         r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
6770         they are now on lisp.h.
6772         * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
6774         * search.c (search_buffer): Use it to inhibit relocation of buffer
6775         text while re_search_2 is doing its job, because re_search_2 is
6776         passed C pointers to buffer text.  (Bug#11519)
6778         * msdos.c (internal_terminal_init) <Vwindow_system_version>:
6779         Update value to 24.
6781         * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
6782         state after an additional call to move_it_in_display_line_to, keep
6783         the values of it->max_ascent and it->max_descent found for the
6784         entire line.
6785         (pos_visible_p): Revert the comparison against bottom_y to what it
6786         was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
6787         (Bug#11464)
6789 2012-05-26  Paul Eggert  <eggert@cs.ucla.edu>
6791         Fix coding-related core dumps with gcc -ftrapv.
6792         The code was computing A - B, where A and B are pointers, and B is
6793         random garbage.  This can lead to core dumps on platforms that
6794         have special pointer registers, and it also leads to core dumps on
6795         x86-64 when compiled with gcc -ftrapv.  The fix is to compute
6796         A - B only when B is initialized properly.
6797         * coding.c (coding_set_source, coding_set_destination): Return void.
6798         (coding_change_source, coding_change_destinations): New functions,
6799         with the old behaviors of coding_set_source and coding_set_destination.
6800         All callers that need an offset changed to use these new functions.
6802 2012-05-26  Glenn Morris  <rgm@gnu.org>
6804         * nsterm.m (ns_init_paths): Don't mess with INFOPATH.  (Bug#2791)
6806 2012-05-26  Eli Zaretskii  <eliz@gnu.org>
6808         Extend mouse support on W32 text-mode console.
6809         * xdisp.c (draw_row_with_mouse_face):
6810         Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
6812         * w32console.c: Include window.h.
6813         (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6814         New functions.
6815         (initialize_w32_display): Initialize mouse-highlight data.
6817         * w32inevt.c: Include termchar.h and window.h.
6818         (do_mouse_event): Support mouse-autoselect-window.  When the mouse
6819         moves, call note_mouse_highlight.  If help_echo changed, call
6820         gen_help_event to produce help-echo message in the echo area.
6821         Call clear_mouse_face if mouse_face_hidden is set in the mouse
6822         highlight info.
6824 2012-05-26  Paul Eggert  <eggert@cs.ucla.edu>
6826         * lread.c (read1): Simplify slightly to avoid an overflow warning
6827         with GCC 4.7.0 on x86-64.
6829 2012-05-26  Eli Zaretskii  <eliz@gnu.org>
6831         * bidi.c (bidi_mirror_char): Revert last change: an int is
6832         definitely wide enough here.
6834 2012-05-25  Paul Eggert  <eggert@cs.ucla.edu>
6836         Fix integer width and related bugs (Bug#9874).
6837         * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
6838         (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6839         (string_bytes, check_sblock, allocate_string_data):
6840         (compact_small_strings, Fmake_bool_vector, make_string)
6841         (make_unibyte_string, make_multibyte_string)
6842         (make_string_from_bytes, make_specified_string)
6843         (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6844         (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6845         (mark_vectorlike):
6846         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6847         (allocate_pseudovector):
6848         Use int, not EMACS_INT, where int is wide enough.
6849         (inhibit_garbage_collection, Fgarbage_collect):
6850         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6851         * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6852         int might not be wide enough.
6853         (bidi_cache_search, bidi_cache_find, bidi_init_it)
6854         (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6855         (bidi_at_paragraph_end, bidi_find_paragraph_start)
6856         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6857         (bidi_level_of_next_char, bidi_move_to_visually_next):
6858         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6859         * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6860         (Fkill_buffer, Fset_buffer_major_mode)
6861         (advance_to_char_boundary, Fbuffer_swap_text)
6862         (Fset_buffer_multibyte, overlays_at, overlays_in)
6863         (overlay_touches_p, struct sortvec, record_overlay_string)
6864         (overlay_strings, recenter_overlay_lists)
6865         (adjust_overlays_for_insert, adjust_overlays_for_delete)
6866         (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6867         (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6868         (Foverlay_recenter, last_overlay_modification_hooks_used)
6869         (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
6870         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6871         (validate_region): Omit unnecessary test for b <= e,
6872         since that's guaranteed by the previous test.
6873         (adjust_overlays_for_delete): Avoid pos + length overflow.
6874         (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
6875         (report_overlay_modification):
6876         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6877         (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
6878         Omit pointer cast, which isn't needed anyway, and doesn't work
6879         after the EMACS_INT -> ptrdiff_t change.
6880         (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
6881         * buffer.h: Adjust decls to match defn changes elsewhere.
6882         (struct buffer_text, struct buffer):
6883         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6884         Use EMACS_INT, not int, where int might not be wide enough.
6885         * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
6886         not int, to avoid needless 32-bit limit on 64-bit hosts.
6887         (exec_byte_code): Use tighter memory-full test, one that checks
6888         for alloca overflow.  Don't compute the address of the object just
6889         before an array, as that's not portable.  Use EMACS_INT, not
6890         ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
6891         * callint.c (Fcall_interactively):
6892         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6893         * callproc.c (call_process_kill, Fcall_process):
6894         Don't assume pid_t fits into an Emacs fixnum.
6895         (call_process_cleanup, Fcall_process, child_setup):
6896         Don't assume pid_t fits into int.
6897         (call_process_cleanup, Fcall_process, delete_temp_file)
6898         (Fcall_process_region):
6899         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6900         (Fcall_process): Simplify handling of volatile integers.
6901         Use int, not EMACS_INT, where int will do.
6902         * casefiddle.c (casify_object, casify_region, operate_on_word)
6903         (Fupcase_word, Fdowncase_word, Fcapitalize_word):
6904         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6905         (casify_object): Avoid integer overflow when overallocating buffer.
6906         * casetab.c (set_identity, shuffle): Prefer int to unsigned when
6907         either works.  Use lint_assume to convince GCC 4.6.1 that it's OK.
6908         * category.c (Fchar_category_set): Don't assume fixnum fits in int.
6909         * category.h (CATEGORYP): Don't assume arg is nonnegative.
6910         * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
6911         integers are now checked earlier.  All uses replaced with XINT.
6912         (ccl_driver):
6913         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6914         For CCL_MapSingle, check that content and value are in int range.
6915         (ccl_driver, Fregister_code_conversion_map):
6916         Check that Vcode_version_map_vector is a vector.
6917         (resolve_symbol_ccl_program): Check that vector header is in range.
6918         Always copy the vector, so that we can check its contents reliably
6919         now rather than having to recheck each instruction as it's being
6920         executed.  Check that vector words fit in 'int'.
6921         (ccl_get_compiled_code, Fregister_ccl_program)
6922         (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
6923         program indexes, to avoid needless 32-bit limit on 64-bit hosts.
6924         (Fccl_execute, Fccl_execute_on_string): Check that initial reg
6925         contents are in range.
6926         (Fccl_execute_on_string): Check that status is in range.
6927         * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
6928         * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
6929         Accept and return EMACS_INT, not int, because callers can pass values
6930         out of 'int' range.
6931         (c_string_width, strwidth, lisp_string_width, chars_in_text)
6932         (multibyte_chars_in_text, parse_str_as_multibyte)
6933         (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
6934         (str_as_unibyte, str_to_unibyte, string_count_byte8)
6935         (string_escape_byte8, Fget_byte):
6936         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6937         (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
6938         avoid mishandling large integers.
6939         * character.h: Adjust decls to match defn changes elsewhere.
6940         * charset.c (load_charset_map_from_file, find_charsets_in_text)
6941         (Ffind_charset_region):
6942         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6943         (load_charset_map_from_file): Redo idx calculation to avoid overflow.
6944         (load_charset_map_from_vector, Fdefine_charset_internal):
6945         Don't assume fixnum fits in int.
6946         (load_charset_map_from_vector, Fmap_charset_chars):
6947         Remove now-unnecessary CHECK_NATNUMs.
6948         (Fdefine_charset_internal): Check ranges here, more carefully.
6949         Don't rely on undefined behavior with signed left shift overflow.
6950         Don't assume unsigned int fits into fixnum, or that fixnum fits
6951         into unsigned int.  Don't require max_code to be a valid fixnum;
6952         that's not true for gb10830 4-byte on a 32-bit host.  Allow
6953         invalid_code to be a cons, for the same reason.  Require code_offset
6954         to be a character.  Avoid int overflow if max_char is close
6955         to INT_MAX.
6956         (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
6957         this is intended anyway and avoids some undefined behavior.
6958         (load_charset_map): Pass unsigned, not int, as 2nd arg of
6959         INDEX_TO_CODE_POINT, as that's what it expects.
6960         (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
6961         * charset.h (DECODE_CHAR): Return int, not unsigned;
6962         this is what was intended anyway, and it avoids undefined behavior.
6963         (CHARSET_OFFSET): Remove unused macro, instead of fixing its
6964         integer-overflow issues.
6965         (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
6966         Formerly, it returned EMACS_INT on 64-bit hosts in the common case
6967         where the argument is EMACS_INT, and this behavior is not intended.
6968         * chartab.c (Fmake_char_table, Fset_char_table_range)
6969         (uniprop_get_decoder, uniprop_get_encoder):
6970         Don't assume fixnum fits in int.
6971         * cmds.c (move_point): New function, that does the gist of
6972         Fforward_char and Fbackward_char, but does so while checking
6973         for integer overflow more accurately.
6974         (Fforward_char, Fbackward_char): Use it.
6975         (Fforward_line, Fend_of_line, internal_self_insert)
6976         (internal_self_insert):
6977         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6978         Fix a FIXME, by checking for integer overflow when calculating
6979         target_clm and actual_clm.
6980         * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
6981         (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
6982         (ASSURE_DESTINATION, coding_alloc_by_realloc)
6983         (coding_alloc_by_making_gap, alloc_destination)
6984         (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
6985         (encode_coding_utf_16, detect_coding_emacs_mule)
6986         (decode_coding_emacs_mule, encode_coding_emacs_mule)
6987         (detect_coding_iso_2022, decode_coding_iso_2022)
6988         (encode_invocation_designation, encode_designation_at_bol)
6989         (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6990         (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
6991         (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
6992         (encode_coding_ccl, encode_coding_raw_text)
6993         (detect_coding_charset, decode_coding_charset)
6994         (encode_coding_charset, detect_eol, decode_eol, produce_chars)
6995         (produce_composition, produce_charset, produce_annotation)
6996         (decode_coding, handle_composition_annotation)
6997         (handle_charset_annotation, consume_chars, decode_coding_gap)
6998         (decode_coding_object, encode_coding_object, detect_coding_system)
6999         (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7000         (code_convert_region, code_convert_string)
7001         (Fdefine_coding_system_internal)
7002         (coding_set_source, coding_set_destination):
7003         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7004         (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7005         (Fdefine_coding_system_internal):
7006         Don't assume fixnums fit in int.
7007         (decode_coding_gap, decode_coding_object, encode_coding_object)
7008         (Fread_coding_system, Fdetect_coding_region)
7009         (Funencodable_char_position, Fcheck_coding_systems_region)
7010         (get_translation, handle_composition_annotation, consume_chars):
7011         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7012         (consume_chars): Rewrite to not calculate an address outside buffer.
7013         (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7014         Don't access memory outside of the args array.
7015         (Fdefine_coding_system_internal): Check for charset-id overflow.
7016         (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7017         result of ENCODE_CHAR.
7018         * coding.h: Adjust decls to match defn changes elsewhere.
7019         (struct coding_system):
7020         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7021         * composite.c (get_composition_id, find_composition)
7022         (run_composition_function, update_compositions)
7023         (compose_text, composition_gstring_put_cache)
7024         (composition_gstring_p, composition_gstring_width)
7025         (fill_gstring_header, fill_gstring_body, autocmp_chars)
7026         (composition_compute_stop_pos, composition_reseat_it)
7027         (composition_update_it, struct position_record)
7028         (find_automatic_composition, composition_adjust_point)
7029         (Fcomposition_get_gstring, Ffind_composition_internal):
7030         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7031         (update_compositions):
7032         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7033         * composite.h: Adjust decls to match defn changes elsewhere.
7034         (struct composition):
7035         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7036         * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7037         Do not attempt to compute the address of the object just before a
7038         buffer; this is not portable.
7039         (Faref, Faset):
7040         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7041         (Faset): Use int, not EMACS_INT, where int is wide enough.
7042         (Fstring_to_number): Don't assume fixnums fit in int.
7043         (Frem): Don't assume arg is nonnegative.
7044         * dbusbind.c (xd_append_arg): Check for integers out of range.
7045         (Fdbus_call_method): Don't overflow the timeout int.
7046         (extract_signed, extract_unsigned): New functions.
7047         (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7048         (xd_get_connection_references): Return ptrdiff_t, not int.
7049         All uses changed.
7050         (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7051         (xd_read_message_1):
7052         Use int, not unsigned, where the dbus API uses int.
7053         (Fdbus_message_internal): Don't overflow mtype.
7054         (syms_of_dbusbind): Allocate right-sized buffer for integers.
7055         * dired.c (directory_files_internal, file_name_completion, scmp)
7056         (file_name_completion_stat):
7057         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7058         (file_name_completion): Don't overflow matchcount.
7059         (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7060         * dispextern.h: Adjust decls to match defn changes elsewhere.
7061         (struct text_pos, struct glyph, struct bidi_saved_info)
7062         (struct bidi_string_data, struct bidi_it, struct composition_it)
7063         (struct it):
7064         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7065         (struct display_pos, struct composition_it, struct it):
7066         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7067         * dispnew.c (increment_matrix_positions)
7068         (increment_row_positions, mode_line_string)
7069         (marginal_area_string):
7070         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7071         (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
7072         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7073         (duration_to_sec_usec): New function, to check for overflow better.
7074         (Fsleep_for, sit_for): Use it.
7075         * doc.c (get_doc_string, store_function_docstring):
7076         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7077         (get_doc_string, Fsnarf_documentation):
7078         Use int, not EMACS_INT, where int is wide enough.
7079         (get_doc_string):
7080         Use SAFE_ALLOCA, not alloca.
7081         Check for overflow when converting EMACS_INT to off_t.
7082         * doprnt.c (doprnt):
7083         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7084         * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7085         Don't assume uid_t fits into fixnum.
7086         (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7087         (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7088         (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7089         (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7090         (general_insert_function)
7091         (Finsert_char, make_buffer_string, make_buffer_string_both)
7092         (update_buffer_properties, Fbuffer_substring)
7093         (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7094         (Fsubst_char_in_region, check_translation)
7095         (Ftranslate_region_internal, save_restriction_restore, Fformat)
7096         (transpose_markers, Ftranspose_regions):
7097         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7098         (clip_to_bounds): Move to lisp.h as an inline function).
7099         (Fconstrain_to_field): Don't assume integers are nonnegative.
7100         (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7101         (Fsubst_char_in_region, Fsave_restriction):
7102         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7103         (Femacs_pid): Don't assume pid_t fits into fixnum.
7104         (lo_time): Use int, not EMACS_INT, when int suffices.
7105         (lisp_time_argument): Check for usec out of range.
7106         (Fencode_time): Don't assume fixnum fits in int.
7107         (Fuser_login_name, Fuser_full_name): Signal an error
7108         if a uid argument is out of range, rather than relying on
7109         undefined behavior.
7110         (Fformat_time_string): Remove now-unnecessary check.
7111         lisp_time_argument checks for out-of-range usec now.
7112         Use ptrdiff_t, not size_t, where ptrdiff_t will do.
7113         * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7114         (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7115         (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7116         (init_cmdargs, Fdump_emacs):
7117         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7118         (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7119         the bottom (typically) 32 bits of the fixnum.
7120         * eval.c (specpdl_size, call_debugger):
7121         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7122         (when_entered_debugger, Fbacktrace_debug):
7123         Don't assume fixnum can fit in int.
7124         (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7125         the object just before a buffer; this is not portable.
7126         (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7127         (grow_specpdl, unbind_to):
7128         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7129         (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7130         (grow_specpdl): Simplify allocation by using xpalloc.
7131         (Fprog1, Fprog2): Don't assume list length fits in int.  Simplify.
7132         * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7133         (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7134         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7135         (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7136         (a_write, e_write):
7137         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7138         (Fcopy_file, non_regular_nbytes, read_non_regular)
7139         (Finsert_file_contents):
7140         Use int, not EMACS_INT, where int is wide enough.
7141         (READ_BUF_SIZE): Verify that it fits in int.
7142         (Finsert_file_contents): Check that counts are in proper range,
7143         rather than assuming fixnums fit into ptrdiff_t etc.
7144         Don't assume fixnums fit into int.
7145         * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
7146         * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7147         (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
7148         (string_char_to_byte, string_byte_to_char)
7149         (string_make_multibyte, string_to_multibyte)
7150         (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7151         (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7152         (substring_both, Fdelete, internal_equal, Ffillarray)
7153         (Fclear_string, mapcar1)
7154         (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7155         (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7156         (larger_vector, make_hash_table, maybe_resize_hash_table)
7157         (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7158         (Fmaphash, secure_hash):
7159         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7160         (concat): Check for string index and length overflow.
7161         (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7162         (Frequire):
7163         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7164         (larger_vector): New API (vec, incr_min, size_max) replaces old
7165         one (vec, new_size, init).  This catches size overflow.
7166         INIT was removed because it was always Qnil.
7167         All callers changed.
7168         (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7169         the upper bound on a hash table index size.
7170         (make_hash_table, maybe_resize_hash_table): Use it.
7171         (secure_hash): Computer start_byte and end_byte only after
7172         they're known to be in ptrdiff_t range.
7173         * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7174         (Ffont_get_glyphs, Ffont_at):
7175         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7176         (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7177         (Flist_fonts, Fopen_font):
7178         Don't assume fixnum can fit in int.
7179         (check_gstring): Don't assume index can fit in int.
7180         (font_match_p): Check that fixnum is a character, not a nonnegative
7181         fixnum, since the later code needs to stuff it into an int.
7182         (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7183         (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7184         conversion overflow issues.
7185         (Fopen_font): Check for integer out of  range.
7186         (Ffont_get_glyphs): Don't assume index can fit in int.
7187         * font.h: Adjust decls to match defn changes elsewhere.
7188         * fontset.c (reorder_font_vector): Redo score calculation to avoid
7189         integer overflow.
7190         (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7191         printmax_t, where ptrdiff_t is wide enough.
7192         (Finternal_char_font):
7193         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7194         * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7195         (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7196         (Fset_frame_position, x_set_frame_parameters)
7197         (x_set_line_spacing, x_set_border_width)
7198         (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7199         Check that fixnums are in proper range for system types.
7200         (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7201         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7202         (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7203         Use SAFE_ALLOCA_LISP, not alloca.
7204         * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7205         intptr_t is wide enough.
7206         * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7207         (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7208         (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7209         Check for fixnum out of range.
7210         * ftfont.c (ftfont_list): Don't assume index fits in int.
7211         Check that fixnums are in proper range for system types.
7212         (ftfont_shape_by_flt):
7213         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7214         * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7215         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7216         (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7217         Check that fixnums are in proper range for system types.
7218         * gnutls.h: Adjust decls to match defn changes elsewhere.
7219         * gtkutil.c (xg_dialog_run):
7220         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7221         (update_frame_tool_bar):
7222         Check that fixnums are in proper range for system types.
7223         * image.c (parse_image_spec): Redo count calculation to avoid overflow.
7224         (lookup_image): Check that fixnums are in range for system types.
7225         * indent.c (last_known_column, last_known_column_point):
7226         (current_column_bol_cache):
7227         (skip_invisible, current_column, check_display_width):
7228         (check_display_width, scan_for_column, current_column_1)
7229         (Findent_to, Fcurrent_indentation, position_indentation)
7230         (indented_beyond_p, Fmove_to_column, compute_motion):
7231         (Fcompute_motion, Fvertical_motion):
7232         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7233         (last_known_column_modified): Use EMACS_INT, not int.
7234         (check_display_width):
7235         (Fcompute_motion):
7236         Check that fixnums and floats are in proper range for system types.
7237         (compute_motion): Don't assume index or fixnum fits in int.
7238         (compute_motion, Fcompute_motion):
7239         Use int, not EMACS_INT, when it is wide enough.
7240         (vmotion): Omit local var start_hpos that is always 0; that way
7241         we don't need to worry about overflow in expressions involving it.
7242         * indent.h: Adjust decls to match defn changes elsewhere.
7243         (struct position):
7244         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7245         Use int, not EMACS_INT, where int is wide enough.
7246         Remove unused members ovstring_chars_done and tab_offset;
7247         all uses removed.
7248         * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7249         (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7250         (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7251         (make_gap, copy_text, insert, insert_and_inherit)
7252         (insert_before_markers, insert_before_markers_and_inherit)
7253         (insert_1, count_combining_before, count_combining_after)
7254         (insert_1_both, insert_from_string)
7255         (insert_from_string_before_markers, insert_from_string_1)
7256         (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7257         (adjust_after_replace, adjust_after_insert, replace_range)
7258         (replace_range_2, del_range, del_range_1, del_range_byte)
7259         (del_range_both, del_range_2, modify_region)
7260         (prepare_to_modify_buffer, signal_before_change)
7261         (signal_after_change, Fcombine_after_change_execute):
7262         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7263         * intervals.c (traverse_intervals, rotate_right, rotate_left)
7264         (balance_an_interval, split_interval_right, split_interval_left)
7265         (find_interval, next_interval, update_interval)
7266         (adjust_intervals_for_insertion, delete_node, delete_interval)
7267         (interval_deletion_adjustment, adjust_intervals_for_deletion)
7268         (static_offset_intervals, offset_intervals)
7269         (merge_interval_right, merge_interval_left, make_new_interval)
7270         (graft_intervals_into_buffer, temp_set_point_both)
7271         (temp_set_point, set_point, adjust_for_invis_intang)
7272         (set_point_both, move_if_not_intangible, get_property_and_range)
7273         (get_local_map, copy_intervals, copy_intervals_to_string)
7274         (compare_string_intervals, set_intervals_multibyte_1):
7275         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7276         * intervals.h: Adjust decls to match defn changes elsewhere.
7277         (struct interval):
7278         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7279         * keyboard.c (this_command_key_count, this_single_command_key_start)
7280         (before_command_key_count, before_command_echo_length, echo_now)
7281         (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7282         (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7283         (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7284         (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7285         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7286         (last_non_minibuf_size, last_point_position, echo_truncate)
7287         (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7288         (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7289         (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7290         (stuff_buffered_input):
7291         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7292         (last_auto_save, command_loop_1, read_char):
7293         Use EMACS_INT, not int, to avoid integer overflow.
7294         (record_char): Avoid overflow in total_keys computation.
7295         (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7296         * keyboard.h: Adjust decls to match defn changes elsewhere.
7297         * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7298         (Fkey_description, Fdescribe_vector, Flookup_key):
7299         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7300         (click_position): New function, to check that positions are in range.
7301         (Fcurrent_active_maps):
7302         (describe_command):
7303         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7304         (Faccessible_keymaps, Fkey_description):
7305         (preferred_sequence_p):
7306         Don't assume fixnum can fit into int.
7307         (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7308         Check for integer overflow in size calculations.
7309         (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7310         avoid mishandling large integers.
7311         * lisp.h: Adjust decls to match defn changes elsewhere.
7312         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7313         (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7314         (struct Lisp_Marker):
7315         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7316         (clip_to_bounds): Now an inline function, moved here from editfns.c.
7317         (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7318         need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7319         All callers changed.
7320         (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7321         Assume the arg has valid form, since it always does.
7322         (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7323         unsigned integer system type.
7324         (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7325         (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7326         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7327         (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7328         (duration_to_sec_usec): New decl.
7329         * lread.c (read_from_string_index, read_from_string_index_byte)
7330         (read_from_string_limit, readchar, unreadchar, openp)
7331         (read_internal_start, read1, oblookup):
7332         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7333         (Fload, readevalloop, Feval_buffer, Feval_region):
7334         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7335         (openp): Check for out-of-range argument to 'access'.
7336         (read1): Use int, not EMACS_INT, where int is wide enough.
7337         Don't assume fixnum fits into int.
7338         Fix off-by-one error that can read outside a buffer.
7339         (read_filtered_event): Use duration_to_sec_usec
7340         to do proper overflow checking on durations.
7341         * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7342         in size calculation.
7343         (Fexecute_kbd_macro):
7344         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7345         * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7346         (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7347         (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7348         (set_marker_both, set_marker_restricted_both, marker_position)
7349         (marker_byte_position, Fbuffer_has_markers_at):
7350         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7351         (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
7352         * menu.c (ensure_menu_items): Rename from grow_menu_items.
7353         It now merely ensures that the menu is large enough, without
7354         necessarily growing it, as this avoids some integer overflow issues.
7355         All callers changed.
7356         (keymap_panes, parse_single_submenu, Fx_popup_menu):
7357         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7358         (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7359         Use SAFE_ALLOCA_LISP, not alloca.
7360         (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7361         to EMACS_INT.  Check that fixnums are in proper range for system types.
7362         * minibuf.c (minibuf_prompt_width, string_to_object)
7363         (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7364         (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7365         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7366         (get_minibuffer, read_minibuf_unwind):
7367         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7368         (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7369         this simplifies overflow checking.  All callers changed.
7370         (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7371         (Ftest_completion):
7372         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7373         * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7374         (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7375         Check that fixnums are in proper range for system types.
7376         (Fx_create_frame, Fx_show_tip):
7377         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7378         * nsfont.m (ns_findfonts, nsfont_list_family):
7379         Don't assume fixnum fits in long.
7380         * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7381         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7382         (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7383         wide enough.
7384         * nsselect.m (ns_get_local_selection, clean_local_selection_data):
7385         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7386         * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7387         (PRINTDECLARE, PRINTPREPARE):
7388         (strout, print_string):
7389         (print, print_preprocess, print_check_string_charset_prop)
7390         (print_object):
7391         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7392         (PRINTDECLARE):
7393         (temp_output_buffer_setup, Fprin1_to_string, print_object):
7394         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7395         (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
7396         (printchar, strout): Use xpalloc to catch size calculation overflow.
7397         (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
7398         (print_error_message): Use SAFE_ALLOCA, not alloca.
7399         (print_object): Use int, not EMACS_INT, where int is wide enough.
7400         (print_depth, new_backquote_output, print_number_index):
7401         Use ptrdiff_t, not int, where int might not be wide enough.
7402         * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7403         (Fset_process_window_size, Fformat_network_address)
7404         (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
7405         (sigchld_handler):
7406         Check that fixnums are in proper range for system types.
7407         (Fsignal_process): Simplify by avoiding a goto.
7408         Check for process-ids out of pid_t range rather than relying on
7409         undefined behavior.
7410         (process_tick, update_tick): Use EMACS_INT, not int.
7411         (Fformat_network_address, read_process_output, send_process)
7412         (Fprocess_send_region, status_notify):
7413         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7414         (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7415         (wait_reading_process_output, read_process_output, exec_sentinel):
7416         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7417         (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7418         (Faccept_process_output): Use duration_to_sec_usec to do proper
7419         overflow checking on durations.
7420         (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7421         Don't assume pid_t fits in int.
7422         * process.h (struct Lisp_Process): Members tick and update_tick
7423         are now of type EMACS_INT, not int.
7424         * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7425         configured --with-wide-int.
7426         * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7427         (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7428         * search.c (looking_at_1, string_match_1):
7429         (fast_string_match, fast_c_string_match_ignore_case)
7430         (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7431         (scan_newline, find_before_next_newline, search_command)
7432         (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7433         (set_search_regs, wordify):
7434         (Freplace_match):
7435         (Fmatch_data):
7436         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7437         (string_match_1, search_buffer, set_search_regs):
7438         (Fmatch_data):
7439         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7440         (wordify): Check for overflow in size calculation.
7441         (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7442         (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7443         Check that fixnums are in proper range for system types.
7444         * sound.c (struct sound_device)
7445         (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7446         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7447         (Fplay_sound_internal):
7448         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7449         * syntax.c (struct lisp_parse_state, find_start_modiff)
7450         (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7451         (Fparse_partial_sexp):
7452         Don't assume fixnums can fit in int.
7453         (struct lisp_parse_state, find_start_pos, find_start_value)
7454         (find_start_value_byte, find_start_begv)
7455         (update_syntax_table, char_quoted, dec_bytepos)
7456         (find_defun_start, prev_char_comend_first, back_comment):
7457         (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7458         (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7459         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7460         (Finternal_describe_syntax_value): Check that match_lisp is a
7461         character, not an integer, since the code stuffs it into int.
7462         (scan_words, scan_sexps_forward):
7463         Check that fixnums are in proper range for system types.
7464         (Fforward_word):
7465         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7466         (scan_sexps_forward):
7467         Use CHARACTERP, not INTEGERP, since the value must fit into int.
7468         (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7469         * syntax.h: Adjust decls to match defn changes elsewhere.
7470         (struct gl_state_s):
7471         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7472         (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7473         MOST_POSITIVE_FIXNUM.
7474         * sysdep.c (wait_for_termination_1, wait_for_termination)
7475         (interruptible_wait_for_termination, mkdir):
7476         Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7477         (emacs_read, emacs_write):
7478         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7479         (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7480         and double all fit in int.
7481         * term.c (set_tty_color_mode):
7482         Check that fixnums are in proper range for system types.
7483         * termhooks.h (struct input_event):
7484         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7485         * textprop.c (validate_interval_range, interval_of)
7486         (Fadd_text_properties, set_text_properties_1)
7487         (Fremove_text_properties, Fremove_list_of_text_properties)
7488         (Ftext_property_any, Ftext_property_not_all)
7489         (copy_text_properties, text_property_list, extend_property_ranges)
7490         (verify_interval_modification):
7491         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7492         (Fnext_single_char_property_change)
7493         (Fprevious_single_char_property_change):
7494         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7495         (copy_text_properties):
7496         Check for integer overflow in index calculation.
7497         * undo.c (last_boundary_position, record_point, record_insert)
7498         (record_delete, record_marker_adjustment, record_change)
7499         (record_property_change):
7500         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7501         (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7502         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7503         * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7504         (Fx_hide_tip, Fx_file_dialog):
7505         * w32menu.c (set_frame_menubar):
7506         Use ptrdiff_t, not int, for consistency with rest of code.
7507         * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7508         (select_window, Fdelete_other_windows_internal)
7509         (window_scroll_pixel_based, window_scroll_line_based)
7510         (Frecenter, Fset_window_configuration):
7511         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7512         (Fset_window_hscroll, run_window_configuration_change_hook)
7513         (set_window_buffer, temp_output_buffer_show, scroll_command)
7514         (Fscroll_other_window, Frecenter):
7515         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7516         (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7517         Don't assume fixnum fits in int.
7518         (Fset_window_scroll_bars):
7519         Check that fixnums are in proper range for system types.
7520         * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7521         (string_pos, c_string_pos, number_of_chars, init_iterator)
7522         (in_ellipses_for_invisible_text_p, init_from_display_pos)
7523         (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7524         (compute_display_string_end, handle_face_prop)
7525         (face_before_or_after_it_pos, handle_invisible_prop)
7526         (handle_display_prop, handle_display_spec, handle_single_display_spec)
7527         (display_prop_intangible_p, string_buffer_position_lim)
7528         (string_buffer_position, handle_composition_prop, load_overlay_strings)
7529         (get_overlay_strings_1, get_overlay_strings)
7530         (iterate_out_of_display_property, forward_to_next_line_start)
7531         (back_to_previous_visible_line_start, reseat, reseat_to_string)
7532         (get_next_display_element, set_iterator_to_next)
7533         (get_visually_first_element, compute_stop_pos_backwards)
7534         (handle_stop_backwards, next_element_from_buffer)
7535         (move_it_in_display_line_to, move_it_in_display_line)
7536         (move_it_to, move_it_vertically_backward, move_it_by_lines)
7537         (add_to_log, message_dolog, message_log_check_duplicate)
7538         (message2, message2_nolog, message3, message3_nolog
7539         (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7540         (current_message_1, truncate_echo_area, truncate_message_1)
7541         (set_message, set_message_1, store_mode_line_noprop)
7542         (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7543         (text_outside_line_unchanged_p, check_point_in_composition)
7544         (reconsider_clip_changes)
7545         (redisplay_internal, set_cursor_from_row, try_scrolling)
7546         (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7547         (redisplay_window, find_last_unchanged_at_beg_row)
7548         (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7549         (trailing_whitespace_p, find_row_edges, display_line)
7550         (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7551         (display_mode_element, store_mode_line_string)
7552         (pint2str, pint2hrstr, decode_mode_spec)
7553         (display_count_lines, display_string, draw_glyphs)
7554         (x_produce_glyphs, x_insert_glyphs)
7555         (rows_from_pos_range, mouse_face_from_buffer_pos)
7556         (fast_find_string_pos, mouse_face_from_string_pos)
7557         (note_mode_line_or_margin_highlight, note_mouse_highlight):
7558         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7559         (safe_call, init_from_display_pos, handle_fontified_prop)
7560         (handle_single_display_spec, load_overlay_strings)
7561         (with_echo_area_buffer, setup_echo_area_for_printing)
7562         (display_echo_area, echo_area_display)
7563         (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7564         (update_tool_bar, hscroll_window_tree, redisplay_internal)
7565         (redisplay_window, dump_glyph_row, display_mode_line)
7566         (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
7567         (handle_display_spec, display_prop_string_p):
7568         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7569         (handle_single_display_spec, build_desired_tool_bar_string)
7570         (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7571         (get_specified_cursor_type):
7572         Check that fixnums are in proper range for system types.
7573         (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7574         (Flookup_image_map):
7575         Don't assume fixnums fit in int.
7576         (compare_overlay_entries):
7577         Avoid mishandling comparisons due to subtraction overflow.
7578         (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7579         (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7580         (handle_tool_bar_click):
7581         Use int, not unsigned, since we prefer signed and the signedness
7582         doesn't matter here.
7583         (get_next_display_element, next_element_from_display_vector):
7584         Use int, not EMACS_INT, when int is wide enough.
7585         (start_hourglass): Use duration_to_sec_usec to do proper
7586         overflow checking on durations.
7587         * xfaces.c (Fbitmap_spec_p):
7588         Check that fixnums are in proper range for system types.
7589         (compare_fonts_by_sort_order):
7590         Avoid mishandling comparisons due to subtraction overflow.
7591         (Fx_family_fonts, realize_basic_faces):
7592         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7593         (Fx_family_fonts):
7594         Don't assume fixnum fits in int.
7595         Use SAFE_ALLOCA_LISP, not alloca.
7596         (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7597         (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7598         (face_at_buffer_position, face_for_overlay_string)
7599         (face_at_string_position):
7600         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7601         (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7602         * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7603         (Fx_show_tip):
7604         Check that fixnums are in proper range for system types.
7605         (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7606         (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7607         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7608         (Fx_change_window_property): Don't assume fixnums fit in int.
7609         * xfont.c (xfont_chars_supported):
7610         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7611         * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7612         (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7613         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7614         * xml.c (parse_region):
7615         * xrdb.c (magic_file_p):
7616         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7617         * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7618         (x_get_local_selection, x_reply_selection_request)
7619         (x_handle_selection_request, wait_for_property_change):
7620         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7621         (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7622         short is wide enough.
7623         (x_send_client_event): Don't assume fixnum fits in int.
7624         * xterm.c (x_x_to_emacs_modifiers):
7625         Don't assume EMACS_INT overflows nicely into int.
7626         (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7627         may come from Lisp.
7628         (handle_one_xevent): NATNUMP can eval its arg twice.
7629         (x_connection_closed):
7630         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7631         * xterm.h: Adjust decls to match defn changes elsewhere.
7632         (struct scroll_bar): Use struct vectorlike_header
7633         rather than rolling our own approximation.
7634         (SCROLL_BAR_VEC_SIZE): Remove; not used.
7636 2012-05-25  Glenn Morris  <rgm@gnu.org>
7638         * lisp.mk (lisp): Update for more files being compiled now.
7640 2012-05-25  Stefan Monnier  <monnier@iro.umontreal.ca>
7642         * lread.c: Remove `read_pure' which makes no difference.
7643         (read_pure): Remove var.
7644         (unreadpure): Remove function.
7645         (readevalloop): Don't call read_list with -1 flag.
7646         (read1, read_vector): Don't test read_pure any more.
7647         (read_list): Simplify.
7649         * fileio.c, character.h: Minor style tweaks.
7651 2012-05-24  Dmitry Antipov  <dmantipov@yandex.ru>
7653         * window.h (clip_changed): Remove useless declaration.
7655 2012-05-22  Juanma Barranquero  <lekktu@gmail.com>
7657         * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7658         (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7660 2012-05-22  Paul Eggert  <eggert@cs.ucla.edu>
7662         Remove src/m/*.
7663         This directory predates autoconf and is no longer needed nowadays.
7664         Move its few remaining bits of functionality to where they're needed.
7665         * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7666         * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7667         * m/template.h: Remove.
7668         * Makefile.in (M_FILE): Remove.  All uses removed.
7669         * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7670         * lisp.h (USE_LSB_TAG):
7671         * mem-limits.h (EXCEEDS_LISP_PTR):
7672         Use VAL_MAX, not VALBITS, in #if.
7673         * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7674         (EMACS_UINT): Define unconditionally now.
7675         (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7676         (BITS_PER_EMACS_INT): New constants, replacing
7677         what used to be in config.h, but not useful in #if.
7678         (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7679         define them any more.
7680         (VAL_MAX): New macro.
7681         (VALMASK): Use it.
7682         * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7683         BITS_PER_EMACS_INT, in #if.
7684         * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7685         (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7686         * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7687         * s/ms-w32.h (DATA_START):
7688         Move here from removed file m/intel386.h.
7689         * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7690         * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7692 2012-05-21  Paul Eggert  <eggert@cs.ucla.edu>
7694         Assume C89 or later.
7695         * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7696         * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7697         (xrealloc):
7698         * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7699         * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7700         * textprop.c, tparam.c (NULL): Remove.
7701         * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7702         * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7703         * regex.h (_RE_ARGS): Remove.  All uses rewritten to use prototypes.
7704         * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7705         * xterm.c (input_signal_count): Assume volatile works.
7707 2012-05-21  Ken Brown  <kbrown@cornell.edu>
7709         * xgselect.c (xg_select): Fix first argument in call to 'select'
7710         (bug#11508).
7712 2012-05-20  Ken Brown  <kbrown@cornell.edu>
7714         * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
7715         [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
7717 2012-05-19  Ken Brown  <kbrown@cornell.edu>
7719         * xfns.c (x_in_use): Remove `static' qualifier.
7720         * xterm.h (x_in_use): Declare.
7721         * xgselect.c: Include xterm.h.
7722         (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7723         and `display_arg' (bug#9754).
7725 2012-05-19  Paul Eggert  <eggert@cs.ucla.edu>
7727         * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7729         * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7730         * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7732 2012-05-18  Eli Zaretskii  <eliz@gnu.org>
7734         Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7736         * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
7737         (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
7739         * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7740         reference to image_cache->refcount.
7741         (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7743 2012-05-17  Juri Linkov  <juri@jurta.org>
7745         * search.c (Fword_search_regexp, Fword_search_backward)
7746         (Fword_search_forward, Fword_search_backward_lax)
7747         (Fword_search_forward_lax): Move functions to isearch.el
7748         (bug#10145, bug#11381).
7750 2012-05-16  Paul Eggert  <eggert@cs.ucla.edu>
7752         * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7754 2012-05-15  Stefan Monnier  <monnier@iro.umontreal.ca>
7756         * lread.c (init_obarray): Declare Qt and Qnil as special.
7758 2012-05-14  Glenn Morris  <rgm@gnu.org>
7760         * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
7761         Put "libexec" before "bin", for the sake of init_callproc_1.
7763 2012-05-14  Paul Eggert  <eggert@cs.ucla.edu>
7765         * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
7767         * unexaix.c: Port to more-recent AIX compilers.
7768         (report_error, report_error_1, make_hdr, copy_sym)
7769         (mark_x, adjust_lnnoptrs, unrelocate_symbols):
7770         Make arguments const char *, not char *, to avoid violations of C
7771         standard and to fix some AIX warnings reported by Gilles Pion.
7773 2012-05-14  Eli Zaretskii  <eliz@gnu.org>
7775         * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
7776         already have overlays loaded.
7777         (handle_single_display_spec): Before returning without displaying
7778         fringe bitmap, synchronize the bidi iterator with the main display
7779         iterator, by calling iterate_out_of_display_property.
7780         (iterate_out_of_display_property): Detect buffer iteration by
7781         testing that it->string is a Lisp string.
7782         (get_next_display_element): When the current object is exhausted,
7783         and there's something on it->stack, call set_iterator_to_next to
7784         proceed with what's on the stack, instead of returning zero.
7785         (set_iterator_to_next): If called at the end of a Lisp string,
7786         proceed to consider_string_end without incrementing string
7787         position.  Don't increment display vector index past the end of
7788         the display vector.  (Bug#11417)
7789         (pos_visible_p): Don't report a position visible when move_it_to
7790         stopped at the last line of window, which happens to be scanned
7791         backwards by the bidi iteration.  (Bug#11464)
7793 2012-05-14  Eli Zaretskii  <eliz@gnu.org>
7795         * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7796         and right-margin display specs even if the spec is invalid or we
7797         are on a TTY, and thus unable to display on the fringes.
7798         That's because the text with the property will not be displayed anyway,
7799         so we need to signal to the caller that this is a "replacing"
7800         display spec.  This fixes display when the spec is invalid or we
7801         are on a TTY.
7803 2012-05-14  Paul Eggert  <eggert@cs.ucla.edu>
7805         * unexaix.c (make_hdr): Fix typo in prototype.
7806         This bug broke the build on AIX.  Problem reported by Gilles Pion.
7808 2012-05-14  Michael Albinus  <michael.albinus@gmx.de>
7810         * keyboard.c (kbd_buffer_get_event): Read special events also in
7811         batch mode.  (Bug#11415)
7813 2012-05-12  Glenn Morris  <rgm@gnu.org>
7815         * ns.mk: Update for ns_appbindir no longer having trailing "/".
7817 2012-05-12  Eli Zaretskii  <eliz@gnu.org>
7819         * lisp.mk (lisp): Add newcomment.elc.
7821 2012-05-12  Glenn Morris  <rgm@gnu.org>
7823         * Makefile.in (MKDIR_P): New, set by configure.
7824         * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7826 2012-05-11  Paul Eggert  <eggert@cs.ucla.edu>
7828         Remove unused function hourglass_started.
7829         * dispextern.h (hourglass_started):
7830         * w32fns.c (hourglass_started):
7831         * xdisp.c (hourglass_started): Remove.
7833 2012-05-10  Juanma Barranquero  <lekktu@gmail.com>
7835         * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7836         Update dependencies.
7838 2012-05-10  Paul Eggert  <eggert@cs.ucla.edu>
7840         * xgselect.c (xg_select): Put maxfds+1 into a var.
7841         This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7843         * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7845 2012-05-10  Dave Abrahams  <dave@boostpro.com>
7847         * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7848         (lock_file): If create_lockfiles is 0, do nothing.  (Bug#11227)
7850 2012-05-09  Michael Albinus  <michael.albinus@gmx.de>
7852         * dbusbind.c (xd_registered_buses): New internal Lisp object.
7853         Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7854         (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7855         Initialize xd_registered_buses.
7857 2012-05-09  Paul Eggert  <eggert@cs.ucla.edu>
7859         Untag more efficiently if USE_LSB_TAG.
7860         This is based on a proposal by YAMAMOTO Mitsuharu in
7861         <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7862         For an admittedly artificial (nth 8000 longlist) benchmark on
7863         Fedora 15 x86-64, this yields a 25% CPU speedup.  Also, it shrinks
7864         Emacs's overall text size by 1%.
7865         * lisp.h (XUNTAG): New macro.
7866         (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7867         (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7868         (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7869         * eval.c (Fautoload):
7870         * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
7871         * frame.h (XFRAME): Use XUNTAG.
7873         Port recent dbusbind.c changes to 32-bit --with-wide-int.
7874         * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
7875         Remove unportable assumptions about print widths of types like
7876         dbus_uint32_t.
7877         (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
7878         intptr_t when converting between pointer and integer, to avoid GCC
7879         warnings about wrong width.
7881 2012-05-09  Eli Zaretskii  <eliz@gnu.org>
7883         * w32proc.c (new_child): Force Windows to reserve only 64KB of
7884         stack for each reader_thread, instead of defaulting to 8MB
7885         determined by the linker.  This avoids failures in creating
7886         subprocesses on Windows 7, see the discussion in this thread:
7887         http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
7889 2012-05-07  Jérémy Compostella  <jeremy.compostella@gmail.com>
7891         Fix up display of the *Minibuf-0* buffer in the mini window.
7892         * keyboard.c (read_char): Don't clear the echo area if there's no
7893         message to clear.
7894         * xdisp.c (redisplay_internal): Redisplay the mini window (with the
7895         contents of *Minibuf-0*) if there's no message displayed in its stead.
7897 2012-05-07  Michael Albinus  <michael.albinus@gmx.de>
7899         * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
7900         batch mode.
7902 2012-05-06  Chong Yidong  <cyd@gnu.org>
7904         * lisp.mk (lisp): Update.
7906 2012-05-05  Jim Meyering  <meyering@redhat.com>
7908         * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
7910 2012-05-04  Stefan Monnier  <monnier@iro.umontreal.ca>
7912         * data.c (PUT_ERROR): New macro.
7913         (syms_of_data): Use it.  Add new error type `user-error'.
7914         * undo.c (user_error): New function.
7915         (Fprimitive_undo): Use it.
7916         * print.c (print_error_message): Adjust print style for `user-error'.
7917         * keyboard.c (user_error): New function.
7918         (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
7920 2012-05-03  Paul Eggert  <eggert@cs.ucla.edu>
7922         Do not limit current-time-string to years 1000..9999.
7923         * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
7924         (Fcurrent_time_string): Support any year that is supported by the
7925         underlying localtime representation.  Don't use asctime, as it
7926         has undefined behavior for years outside the range -999..9999.
7928 2012-05-02  Paul Eggert  <eggert@cs.ucla.edu>
7930         Fix race conditions involving setenv, gmtime, localtime, asctime.
7931         Without this fix, interrupts could mess up code that uses these
7932         nonreentrant functions, since setting TZ invalidates existing
7933         tm_zone or tzname values, and since most of these functions return
7934         pointers to static storage.
7935         * editfns.c (format_time_string, Fdecode_time, Fencode_time)
7936         (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
7937         Grow the critical sections to include not just invoking
7938         localtime/gmtime, but also accessing these functions' results
7939         including their tm_zone values if any, and any related TZ setting.
7940         (format_time_string): Last arg is now struct tm *, not struct tm **,
7941         so that the struct tm is saved in the critical section.
7942         All callers changed.  Simplify allocation of initial buffer, partly
7943         motivated by the fact that memory allocation needs to be outside
7944         the critical section.
7946 2012-05-02  Dmitry Antipov  <dmantipov@yandex.ru>
7948         * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
7949         with RESET_INTERVAL.
7951         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7952         Remove duplicated buffer name initialization.
7954 2012-05-02  Jim Meyering  <jim@meyering.net>
7956         * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
7958         * xfns.c (x_window): Use xstrdup (Bug#11375).
7960 2012-05-02  Eli Zaretskii  <eliz@gnu.org>
7962         * xdisp.c (pos_visible_p): If already at a newline from the
7963         display string before the 'while' loop, don't walk back the glyphs
7964         from it3.glyph_row.  Solves assertion violation when the display
7965         string begins with a newline (egg.el).  (Bug#11367)
7967 2012-05-01  Stefan Monnier  <monnier@iro.umontreal.ca>
7969         * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
7970         Move to simple.el.
7972 2012-05-01  Glenn Morris  <rgm@gnu.org>
7974         * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
7975         s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
7976         and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
7977         All were removed before 23.1.
7979         * dispnew.c: Remove HAVE_LIBNCURSES test;
7980         it is always true on relevant platforms.
7982         * Makefile.in (LD_SWITCH_X_SITE_RPATH):
7983         Rename from LD_SWITCH_X_SITE_AUX_RPATH.
7985         * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
7987 2012-04-30  Andreas Schwab  <schwab@linux-m68k.org>
7989         * .gdbinit (xpr): Remove checks for no longer existing misc types.
7990         (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
7991         Remove.
7993 2012-04-28  Paul Eggert  <eggert@cs.ucla.edu>
7995         Do not avoid creating empty evaporating overlays (Bug#9642).
7996         * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
7997         That is, do not delete an evaporating overlay if it becomes
7998         empty after its bounds are adjusted to fit within its buffer.
7999         This fix caused other problems, and I'm reverting it until we get
8000         to the bottom of them.
8002 2012-04-27  Chong Yidong  <cyd@gnu.org>
8004         * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8006 2012-04-27  Eli Zaretskii  <eliz@gnu.org>
8008         * xdisp.c (pos_visible_p): If the window start position is beyond
8009         ZV, start the display from buffer beginning.  Prevents assertion
8010         violation in init_iterator when the minibuffer window is scrolled
8011         via the scroll bar.
8013         * window.c (window_scroll_pixel_based): Likewise.
8015 2012-04-27  Chong Yidong  <cyd@gnu.org>
8017         * keymap.c (where_is_internal): Doc fix (Bug#10872).
8019 2012-04-27  Glenn Morris  <rgm@gnu.org>
8021         * fileio.c (Fcopy_file, Fset_file_selinux_context):
8022         Ignore ENOTSUP failures from setfilecon functions.  (Bug#11245)
8024 2012-04-27  Eli Zaretskii  <eliz@gnu.org>
8026         * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8027         Don't overrun array limits of glyph row's used[] array.  (Bug#11288)
8029 2012-04-26  Eli Zaretskii  <eliz@gnu.org>
8031         * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8032         display element, check also the underlying string or buffer
8033         character.  (Bug#11341)
8035         * w32menu.c: Include w32heap.h.
8036         (add_menu_item): If the call to AppendMenuW (via
8037         unicode_append_menu) fails, disable Unicode menus only if we are
8038         running on Windows 9X/Me.
8040 2012-04-24  Andreas Schwab  <schwab@linux-m68k.org>
8042         * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8043         (xgetint): Add missing shift for LSB tags.
8045 2012-04-24  Martin Rudalics  <rudalics@gmx.at>
8047         * keyboard.c (read_char): Don't wipe echo area for select window
8048         events: These might get delayed via `mouse-autoselect-window'
8049         (Bug#11304).
8051 2012-04-24  Juanma Barranquero  <lekktu@gmail.com>
8053         * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8054         manipulation of :loaded-from data.
8056 2012-04-23  Juanma Barranquero  <lekktu@gmail.com>
8058         * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8059         now a cons (bug#11311).
8061 2012-04-23  Paul Eggert  <eggert@cs.ucla.edu>
8063         Do not create empty overlays with the evaporate property (Bug#9642).
8064         * buffer.c (Fmove_overlay): Delete an evaporating overlay
8065         if it becomes empty after its bounds are adjusted to fit within
8066         its buffer.  Without this fix, in a nonempty buffer (let ((o
8067         (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8068         yields an empty overlay that has the evaporate property, which is
8069         not supposed to happen.
8071         Fix minor GTK3 problems found by static checking.
8072         * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8073         (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8074         (struct _EmacsFixedClass, emacs_fixed_get_type):
8075         Move decls here from emacsgtkfixed.h, since they needn't be public.
8076         (emacs_fixed_get_type): Now static.
8077         (emacs_fixed_class_init): Omit unused local.
8078         (emacs_fixed_child_type): Remove; unused.
8079         * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8080         (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8081         (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8082         (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8083         (EMACS_FIXED_GET_CLASS): Remove; unused.
8084         * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8086         * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8087         Problem reported by Juanma Barranquero for Windows -Wunused-function.
8089 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
8091         Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
8092         * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
8093         (__malloc_size_t, __malloc_ptrdiff_t):
8094         Remove.  All uses removed, replaced by the definiens if needed,
8095         since we can assume C89 or better now.
8096         Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8097         (protect_malloc_state, align, get_contiguous_space)
8098         (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8099         (malloc_atfork_handler_child, malloc_enable_thread)
8100         (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8101         (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8102         (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8103         (special_realloc, _realloc_internal_nolock, _realloc_internal)
8104         (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8105         (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8106         Define using prototypes, not old style.
8107         (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8108         Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8109         (align): Don't assume that signed integer overflow wraps around.
8110         Omit unused local var.
8111         (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8112         (_free_internal_nolock, memalign, mallochook, reallochook):
8113         Omit no-longer-needed casts.
8114         (valloc): Use getpagesize, not __getpagesize.
8115         (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8116         (struct hdr): The 'magic' member is now size_t, not unsigned long.
8118         * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8120 2012-04-22  Michael Albinus  <michael.albinus@gmx.de>
8122         Move functions from C to Lisp.  Make non-blocking method calls
8123         the default.  Implement further D-Bus standard interfaces.
8125         * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8126         (QCdbus_request_name_allow_replacement)
8127         (QCdbus_request_name_replace_existing)
8128         (QCdbus_request_name_do_not_queue)
8129         (QCdbus_request_name_reply_primary_owner)
8130         (QCdbus_request_name_reply_in_queue)
8131         (QCdbus_request_name_reply_exists)
8132         (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8133         (QCdbus_registered_serial, QCdbus_registered_method)
8134         (QCdbus_registered_signal): New Lisp objects.
8135         (XD_DEBUG_MESSAGE): Use sizeof.
8136         (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8137         (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8138         (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8139         (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8140         (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8141         (xd_signature, xd_append_arg): Allow float for integer types.
8142         (xd_get_connection_references): New function.
8143         (xd_get_connection_address): Rename from xd_initialize.
8144         Return cached address.
8145         (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8146         (xd_close_bus): Rename from Fdbus_close_bus.  Not needed on Lisp
8147         level.
8148         (Fdbus_init_bus): New optional arg PRIVATE.  Cache address.
8149         Return number of refcounts.
8150         (Fdbus_get_unique_name): Make stronger parameter check.
8151         (Fdbus_message_internal): New defun.
8152         (Fdbus_call_method, Fdbus_call_method_asynchronously)
8153         (Fdbus_method_return_internal, Fdbus_method_error_internal)
8154         (Fdbus_send_signal, Fdbus_register_service)
8155         (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8156         (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8157         (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8158         (Vdbus_compiled_version, Vdbus_runtime_version)
8159         (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8160         (Vdbus_message_type_method_return, Vdbus_message_type_error)
8161         (Vdbus_message_type_signal): New defvars.
8162         (Vdbus_registered_buses, Vdbus_registered_objects_table):
8163         Adapt docstring.
8165 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
8167         Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8168         * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8169         Do not assume ptrdiff_t is the same width as 'int'.
8171         * alloc.c: Handle unusual debugging option combinations.
8172         (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8173         since the two debugging options are incompatible.
8174         (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8175         is defined.
8176         (mem_init, mem_insert, mem_insert_fixup):
8177         Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8178         (NEED_MEM_INSERT): Remove; no longer needed.
8180 2012-04-22  Leo Liu  <sdl.web@gmail.com>
8182         * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8184 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
8186         * sysdep.c [__FreeBSD__]: Minor cleanups.
8187         (list_system_processes, system_process_attributes) [__FreeBSD__]:
8188         Use Emacs indenting style more consistently.  Avoid some casts.
8189         Use 'double' consistently rather than mixing 'float' and 'double'.
8191 2012-04-21  Eduard Wiebe  <usenet@pusto.de>
8193         * sysdep.c (list_system_processes, system_process_attributes):
8194         Add implementation for FreeBSD (Bug#5243).
8196 2012-04-21  Andreas Schwab  <schwab@linux-m68k.org>
8198         * lisp.mk (lisp): Update.
8200 2012-04-20  Paul Eggert  <eggert@cs.ucla.edu>
8202         * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8203         It is never used otherwise.
8205 2012-04-20  Stefan Monnier  <monnier@iro.umontreal.ca>
8207         * print.c (print_preprocess): Only check print_depth if print-circle
8208         is nil.
8209         (print_object): Check for cycles even when print-circle is nil and
8210         print-gensym is t, but only check print_depth if print-circle is nil.
8212 2012-04-20  Chong Yidong  <cyd@gnu.org>
8214         * process.c (wait_reading_process_output): If EIO occurs on a pty,
8215         set the status to "failed" and ensure that sentinel is run.
8217 2012-04-20  Glenn Morris  <rgm@gnu.org>
8219         * process.c (Fset_process_inherit_coding_system_flag)
8220         (Fset_process_query_on_exit_flag): Doc fix (mention return value).
8221         (Fmake_network_process, Fmake_serial_process): Doc fix.
8223 2012-04-20  Eli Zaretskii  <eliz@gnu.org>
8225         * xdisp.c (string_buffer_position_lim): Limit starting position to
8226         BEGV.
8227         (set_cursor_from_row): If called for a mode-line or header-line
8228         row, return zero immediately.
8229         (try_cursor_movement): If inside continuation line, don't back up
8230         farther than the first row after the header line, if any.
8231         Don't consider the header-line row as "partially visible", even if
8232         MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero.  (Bug#11261)
8234 2012-04-20  Atsuo Ohki  <ohki@gssm.otsuka.tsukuba.ac.jp>  (tiny change)
8236         * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8237         (bug#11238).
8239 2012-04-20  Teodor Zlatanov  <tzz@lifelogs.com>
8240 2012-04-18  Paul Eggert  <eggert@cs.ucla.edu>
8242         configure: new option --enable-gcc-warnings (Bug#11207)
8243         * Makefile.in (C_WARNINGS_SWITCH): Remove.
8244         (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8245         (ALL_CFLAGS): Use new macros rather than old.
8246         * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8247         * regex.c: Ignore -Wstrict-overflow.  If !emacs, also ignore
8248         -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8249         -Wunused-result, -Wunused-variable.  This should go away once
8250         the Emacs and Gnulib regex code is merged.
8251         (xmalloc, xrealloc): Now static.
8253 2012-04-17  Paul Eggert  <eggert@cs.ucla.edu>
8255         * dired.c (Fsystem_groups): Remove unused local.
8257 2012-04-17  Glenn Morris  <rgm@gnu.org>
8259         * dired.c (Fsystem_users): Doc fix.
8261 2012-04-17  Dmitry Antipov  <dmantipov@yandex.ru>
8263         * dired.c (Fsystem_users, Fsystem_groups): New functions.  (Bug#7900)
8264         (syms_of_dired): Add them.
8266 2012-04-16  Paul Eggert  <eggert@cs.ucla.edu>
8268         Fix minor alloc.c problems found by static checking.
8269         * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8270         New extern decls, to avoid calling undeclared functions.
8271         (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8272         && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8273         GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8274         (NEED_MEM_INSERT): New macro.
8275         (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
8276         Remove one incorrect comment and fix another.
8278         Fix minor ralloc.c problems found by static checking.
8279         See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8280         * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8281         (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8282         (r_alloc_sbrk): Now static.
8284         Improve ralloc.c interface checking.
8285         See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8286         * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8287         (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8288         * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8289         [REL_ALLOC]: ... to here, to check interface.
8290         * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8291         Remove decls.  This fixes an "It stinks!".
8293         * alloc.c (which_symbols): Fix alignment issue / type clash.
8295 2012-04-15  Andreas Schwab  <schwab@linux-m68k.org>
8297         * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8298         (struct Lisp_Misc_Any): Likewise.
8299         (struct Lisp_Free): Likewise.
8300         * alloc.c (union aligned_Lisp_Symbol): Define.
8301         (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8302         aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8303         (union aligned_Lisp_Misc): Define.
8304         (MARKER_BLOCK_SIZE, struct marker_block): Use union
8305         aligned_Lisp_Misc instead of union Lisp_Misc.
8306         (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
8308 2012-04-14  Paul Eggert  <eggert@cs.ucla.edu>
8310         Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8311         * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8312         * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8313         * s/netbsd.h, s/sol2-6.h:
8314         Remove definition of GC_MARK_STACK, since the default now works.
8315         * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8316         Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8317         no longer the default.
8318         * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8320 2012-04-14  Atsuo Ohki  <ohki@gssm.otsuka.tsukuba.ac.jp>  (tiny change)
8322         * lread.c (lisp_file_lexically_bound_p):
8323         Fix hang at ";-*-\n" (bug#11238).
8325 2012-04-14  Eli Zaretskii  <eliz@gnu.org>
8327         * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8328         "unchanged" if its end.pos is beyond ZV.  (Bug#11199)
8330 2012-04-14  Jan Djärv  <jan.h.d@swipnet.se>
8332         * nsterm.m (constrainFrameRect): Always constrain when there is only
8333         one screen (Bug#10962).
8335 2012-04-13  Ken Brown  <kbrown@cornell.edu>
8337         * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8339 2012-04-13  Reuben Thomas  <rrt@sc3d.org>
8341         * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8343 2012-04-11  Daniel Colascione  <dancol@dancol.org>
8345         * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8346         against is gone.  It's better to use vfork now so that when Cygwin
8347         gains a new, working vfork, we use it automatically (bug#10398).
8349 2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
8351         * window.c (save_window_save): Obey window-point-insertion-type.
8353 2012-04-11  Glenn Morris  <rgm@gnu.org>
8355         * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8357 2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
8359         * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8361 2012-04-10  Jason S. Cornez  <jcornez@ravenpack.com>  (tiny change)
8363         * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8364         (force_quit_count): New var.
8365         (handle_interrupt): Use it.
8367 2012-04-10  Juanma Barranquero  <lekktu@gmail.com>
8369         * w32.c (w32_delayed_load): Record the full path of the library
8370         being loaded (bug#10424).
8372 2012-04-09  Glenn Morris  <rgm@gnu.org>
8374         * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8375         not just in the obarray, before snarfing them.  (Bug#11036)
8377         * Makefile.in ($(leimdir)/leim-list.el):
8378         Pass EMACS rather than BUILT_EMACS.
8380 2012-04-09  Teodor Zlatanov  <tzz@lifelogs.com>
8382         * process.c (make_process):
8383         * process.h: Add integer `gnutls_handshakes_tried' member to
8384         process struct.
8386         * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8387         Add convenience `GNUTLS_LOG2i' macro.
8389         * gnutls.c (gnutls_log_function2i): Convenience log function.
8390         (emacs_gnutls_read): Use new log functions,
8391         `gnutls_handshakes_tried' process member, and
8392         `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8393         attempts per process (connection).
8395 2012-04-09  Chong Yidong  <cyd@gnu.org>
8397         * eval.c (Fuser_variable_p, user_variable_p_eh)
8398         (lisp_indirect_variable): Functions deleted.
8399         (Fdefvar): Caller changed.
8401         * callint.c (Finteractive, Fcall_interactively):
8402         * minibuf.c (Fread_variable): Callers changed.
8404 2012-04-09  Eli Zaretskii  <eliz@gnu.org>
8406         * xdisp.c (set_cursor_from_row): If the display string appears in
8407         the buffer at position that is closer to point than the position
8408         after the display string, display the cursor on the first glyph of
8409         the display string.  Fixes cursor display when a 'display' text
8410         property immediately follows invisible text.  (Bug#11094)
8412 2012-04-09  Paul Eggert  <eggert@cs.ucla.edu>
8414         composite.c: use 'double' consistently
8415         * composite.c (get_composition_id): Use 'double' consistently
8416         instead of converting 'float' to 'double' and vice versa; this is
8417         easier to understand and avoids a GCC warning.
8419 2012-04-09  Glenn Morris  <rgm@gnu.org>
8421         * Makefile.in: Generate leim-list with bootstrap-emacs, in
8422         preparation for dumping it with emacs.  (Bug#4789)
8423         (leimdir): New variable.
8424         ($(leimdir)/leim-list.el): New rule.
8425         (emacs$(EXEEXT)): Depend on leim-list.el.
8427         * buffer.c (Qucs_set_table_for_input): Remove.  (Bug#9821)
8428         (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8429         (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8431 2012-04-08  Andreas Schwab  <schwab@linux-m68k.org>
8433         * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8434         proper alignment.
8436 2012-04-07  Juanma Barranquero  <lekktu@gmail.com>
8438         * xml.c (init_libxml2_functions) [WINDOWSNT]:
8439         Remove unused local variable.
8441 2012-04-07  Paul Eggert  <eggert@cs.ucla.edu>
8443         Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8444         * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8445         (mark_memory): Mark Lisp_Objects only if pointers might hide in
8446         objects, as mark_maybe_pointer will catch them otherwise.
8447         (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8448         * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8450 2012-04-07  Paul Eggert  <eggert@cs.ucla.edu>
8452         Fix typo that broke non-Windows builds.
8453         * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8455 2012-04-07  Eli Zaretskii  <eliz@gnu.org>
8457         Support building on MS-Windows with libxml2.
8459         * makefile.w32-in (OBJ2): Add xml.$(O).
8460         (GLOBAL_SOURCES): Add xml.c.
8461         ($(BLD)/xml.$(O)): New dependency list.
8463         * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8464         (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8465         (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8466         [!WINDOWSNT]: New macros.
8467         (init_libxml2_functions, libxml2_loaded_p): New functions.
8468         (parse_region): Call fn_xmlCheckVersion instead of using the macro
8469         LIBXML_TEST_VERSION.  Call libxml2 functions via the fn_* macros.
8470         (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8471         Calls xmlCleanupParser only if libxml2 was loaded (or statically
8472         linked in).
8473         (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8474         Call init_libxml2_functions before calling libxml2 functions.
8475         (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8477         * emacs.c: Don't include libxml/parser.h.
8478         (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8479         xmlCleanupParser directly.
8481         * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8483 2012-04-07  Eli Zaretskii  <eliz@gnu.org>
8485         * indent.c (Fvertical_motion): If there is a display string at
8486         point, use it.vpos to compute how many lines to backtrack after
8487         move_it_to point.  (Bug#11133)
8489 2012-04-06  Eli Zaretskii  <eliz@gnu.org>
8491         * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8492         * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8493         about subtle differences between FETCH_CHAR* and STRING_CHAR*
8494         macros related to unification of CJK characters.  For the details,
8495         see the discussion following the message here:
8496         http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8498 2012-04-04  Chong Yidong  <cyd@gnu.org>
8500         * keyboard.c (Vdelayed_warnings_list): Doc fix.
8502 2012-04-01  Eli Zaretskii  <eliz@gnu.org>
8504         * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8505         instead of alloca.  (Bug#11138)
8507 2012-04-01  Andreas Schwab  <schwab@linux-m68k.org>
8509         * w32menu.c (is_simple_dialog): Properly check lisp types.
8510         (Bug#11141)
8512 2012-03-31  Eli Zaretskii  <eliz@gnu.org>
8514         * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8515         position we get to after a call to move_it_to fails the
8516         IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8517         only if we wind up in a string from display property.  (Bug#11063)
8519         * window.c (Fdelete_other_windows_internal): Invalidate the row
8520         and column information about mouse highlight, so that redisplay
8521         restores it after reallocating the glyph matrices.  (Bug#7464)
8523         * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8524         string comes from a `display' text property, use the buffer
8525         position of that property as if we actually saw that position in
8526         the row's glyphs.
8527         (move_it_by_lines): Remove the assertion that
8528         "it->current_x == 0 && it->hpos == 0" which can be legitimately
8529         violated when there's a before-string at the beginning of a line.
8530         (Bug#11063)
8532 2012-03-30  Eli Zaretskii  <eliz@gnu.org>
8534         * xdisp.c (append_space_for_newline): If the default face was
8535         remapped, use the remapped face for the appended newline.
8536         (extend_face_to_end_of_line): Use the remapped default face for
8537         extending the face to the end of the line.
8538         (display_line): Call extend_face_to_end_of_line when the default
8539         face was remapped.  (Bug#11068)
8541 2012-03-29  Eli Zaretskii  <eliz@gnu.org>
8543         * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8545 2012-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
8547         * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8549 2012-03-27  Glenn Morris  <rgm@gnu.org>
8551         * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8552         Doc fixes.
8554 2012-03-26  Kenichi Handa  <handa@m17n.org>
8556         * dispextern.h (struct glyph): Fix previous change.  Change the
8557         bit length of glyphless.ch to 25 (Bug#11082).
8559 2012-03-26  Chong Yidong  <cyd@gnu.org>
8561         * keyboard.c (Vselection_inhibit_update_commands): New variable.
8562         (command_loop_1): Use it; inhibit selection update for
8563         handle-select-window too (Bug#8996).
8565 2012-03-25  Fabrice Popineau  <fabrice.popineau@supelec.fr>
8567         * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
8569 2012-03-25  Kenichi Handa  <handa@m17n.org>
8571         * dispextern.h (struct glyph): Change the bit length of
8572         glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8574 2012-03-24  Eli Zaretskii  <eliz@gnu.org>
8576         * s/ms-w32.h (tzname): Include time.h before redirecting to
8577         _tzname.  Fixes the MSVC build.  (Bug#9960)
8579 2012-03-24  Andreas Schwab  <schwab@linux-m68k.org>
8581         * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8582         characters.
8584         * xterm.c (XTread_socket): Only modify handling_signal if
8585         !SYNC_INPUT.  (Bug#11080)
8587 2012-03-23  Eli Zaretskii  <eliz@gnu.org>
8589         * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8590         FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES.  Prevents crashes
8591         when fetching a multibyte character consumes more bytes than
8592         CHAR_BYTES returns, due to unification of CJK characters in
8593         string_char.  (Bug#11073)
8595 2012-03-23  Troels Nielsen  <bn.troels@gmail.com>  (tiny change)
8597         * process.c (wait_reading_process_output): Handle pty disconnect
8598         by refraining from sending oneself a SIGCHLD (bug#10933).
8600 2012-03-22  Chong Yidong  <cyd@gnu.org>
8602         * dispextern.h (struct it): New member string_from_prefix_prop_p.
8604         * xdisp.c (push_prefix_prop): Rename from push_display_prop.
8605         Mark string as coming from a prefix property.
8606         (handle_face_prop): Use default face for prefix strings (Bug#4281).
8607         (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8609 2012-03-21  Chong Yidong  <cyd@gnu.org>
8611         * xfaces.c (Vface_remapping_alist): Doc fix.
8613 2012-03-20  Eli Zaretskii  <eliz@gnu.org>
8615         * w32proc.c (Fw32_set_console_codepage)
8616         (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8617         Doc fixes.
8619 2012-03-20  Chong Yidong  <cyd@gnu.org>
8621         * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8622         to reflect default non-nil value of redisplay-dont-pause.
8624 2012-03-19  Kenichi Handa  <handa@m17n.org>
8626         * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8627         it fit in a valid range (Bug#11003).
8629 2012-03-18  Eli Zaretskii  <eliz@gnu.org>
8631         * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8632         that is not from display property, accept the row as a "cursor
8633         row" if one of the string's character has a non-nil `cursor'
8634         property.  Fixes cursor positioning when there are newlines in
8635         overlay strings, e.g. in icomplete.el.  (Bug#11035)
8637 2012-03-12  Paul Eggert  <eggert@cs.ucla.edu>
8639         * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8641 2012-03-12  Chong Yidong  <cyd@gnu.org>
8643         * eval.c (inhibit_lisp_code): Rename from
8644         inhibit_window_configuration_change_hook; move from window.c.
8646         * xfns.c (unwind_create_frame_1, Fx_create_frame):
8647         * window.c (run_window_configuration_change_hook)
8648         (syms_of_window): Callers changed.
8650 2012-03-11  Chong Yidong  <cyd@gnu.org>
8652         * keymap.c (Fkey_description): Doc fix (Bug#9700).
8654         * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8656 2012-03-10  Chong Yidong  <cyd@gnu.org>
8658         * frame.c (other_visible_frames): Don't assume the selected frame
8659         is visible (Bug#10955).
8661 2012-03-09  Stefan Monnier  <monnier@iro.umontreal.ca>
8663         * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8665 2012-03-08  Jan Djärv  <jan.h.d@swipnet.se>
8667         * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8668         FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8669         zero (Bug#10954).
8671 2012-03-03  Glenn Morris  <rgm@gnu.org>
8673         * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
8675 2012-03-02  Eli Zaretskii  <eliz@gnu.org>
8677         * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8678         position past the first glyph_row that ends at ZV.  (Bug#10902)
8679         (redisplay_window, next_element_from_string): Fix typos in
8680         comments.
8681         (redisplay_window): Pass to move_it_vertically the margin in
8682         pixels, not in screen lines.
8684 2012-03-02  Glenn Morris  <rgm@gnu.org>
8686         * buffer.c (buffer-list-update-hook): Doc fix.
8688 2012-02-29  Eli Zaretskii  <eliz@gnu.org>
8690         * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8691         push_it before setting up the iterator for the first overlay
8692         string, even if we have an empty string loaded.
8693         (next_overlay_string): If there's an empty string on the iterator
8694         stack, pop the stack.  (Bug#10903)
8696 2012-02-25  Paul Eggert  <eggert@cs.ucla.edu>
8698         Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8699         Suggested by Stefan Monnier in
8700         <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8701         * alloc.c (widen_to_Lisp_Object): New static function.
8702         (mark_memory): Also mark Lisp_Objects by fetching pointer words
8703         and widening them to Lisp_Objects.  This would work even if
8704         USE_LSB_TAG is defined and wide integers are used, which might
8705         happen in a future version of Emacs.
8707 2012-02-25  Chong Yidong  <cyd@gnu.org>
8709         * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8710         Doc fix.
8712         * xselect.c (Fx_selection_exists_p): Doc fix.
8713         (x_clipboard_manager_save_all): Print an informative message
8714         before saving to clipboard manager.
8716 2012-02-24  Chong Yidong  <cyd@gnu.org>
8718         * keyboard.c (process_special_events): Handle all X selection
8719         requests in kbd_buffer, not just the next one (Bug#8869).
8721 2012-02-23  Chong Yidong  <cyd@gnu.org>
8723         * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8724         call when setting menu-bar-lines and tool-bar-lines parameters.
8725         (unwind_create_frame_1): New helper function.
8727         * window.c (inhibit_window_configuration_change_hook): New var.
8728         (run_window_configuration_change_hook): Obey it.
8729         (syms_of_window): Initialize it.
8731 2012-02-22  Chong Yidong  <cyd@gnu.org>
8733         * xterm.c (x_draw_image_relief): Add missing type check for
8734         Vtool_bar_button_margin (Bug#10743).
8736 2012-02-21  Chong Yidong  <cyd@gnu.org>
8738         * fileio.c (Vfile_name_handler_alist): Doc fix.
8740         * buffer.c (Fget_file_buffer): Protect against invalid file
8741         handler return value.
8743 2012-02-20  Paul Eggert  <eggert@cs.ucla.edu>
8745         * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8746         when computing $valmask.
8748         Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8749         * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8750         (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8751         It's useless in that case, and it can cause problems on hosts
8752         that allocate halves of EMACS_INT values separately.
8753         Reported by Dan Horák.  Diagnosed by Andreas Schwab in
8754         <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8755         * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8756         UINTPTR_MAX >> VALBITS == 0.  This is required by the above change;
8757         it avoids undefined behavior on hosts where shifting right by more
8758         than the word width has undefined behavior.
8760 2012-02-19  Chong Yidong  <cyd@gnu.org>
8762         * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8763         (Funhandled_file_name_directory, Ffile_name_as_directory)
8764         (Fdirectory_file_name, Fexpand_file_name)
8765         (Fsubstitute_in_file_name): Protect against invalid file handler
8766         return values (Bug#10845).
8768 2012-02-18  Eli Zaretskii  <eliz@gnu.org>
8770         * .gdbinit (pitx): Fix incorrect references to fields of the
8771         iterator stack.
8773 2012-02-17  Chong Yidong  <cyd@gnu.org>
8775         * syntax.c (Fscan_lists): Doc fix (Bug#10833).
8777 2012-02-15  Paul Eggert  <eggert@cs.ucla.edu>
8779         * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
8780         <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
8782 2012-02-15  Chong Yidong  <cyd@gnu.org>
8784         * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
8785         marked as special.  Also, starting docstrings with * is obsolete.
8787 2012-02-13  Andreas Schwab  <schwab@linux-m68k.org>
8789         * gnutls.c (emacs_gnutls_write): Fix last change.
8791 2012-02-13  Lars Ingebrigtsen  <larsi@gnus.org>
8793         * gnutls.c (emacs_gnutls_write): Set errno appropriately for
8794         send_process.
8796 2012-02-13  Stefan Monnier  <monnier@iro.umontreal.ca>
8798         * keymap.c (Fsingle_key_description): Handle char ranges.
8800 2012-02-12  Chong Yidong  <cyd@gnu.org>
8802         * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8803         as that creates a dangerous corner case.
8805         * window.c (Fdelete_window_internal): Invalidate the mouse
8806         highlight (Bug#9904).
8808 2012-02-12  Glenn Morris  <rgm@gnu.org>
8810         * xselect.c (Fx_own_selection_internal)
8811         (Fx_get_selection_internal, Fx_disown_selection_internal)
8812         (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8813         * nsselect.m (Fx_own_selection_internal)
8814         (Fx_disown_selection_internal, Fx_selection_exists_p)
8815         (Fx_selection_owner_p, Fx_get_selection_internal):
8816         Sync docs and argument specs with the xselect.c versions.
8818 2012-02-11  Lars Ingebrigtsen  <larsi@gnus.org>
8820         * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8822 2012-02-11  Eli Zaretskii  <eliz@gnu.org>
8824         * w32select.c (Fx_selection_exists_p): Sync doc string and
8825         argument list with xselect.c.  (Bug#10783)
8827         * w16select.c (Fx_selection_exists_p): Sync doc string and
8828         argument list with xselect.c.  (Bug#10783)
8830 2012-02-10  Glenn Morris  <rgm@gnu.org>
8832         * fns.c (Fsecure_hash): Doc fix.
8834 2012-02-09  Kenichi Handa  <handa@m17n.org>
8836         * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8838 2012-02-07  Chong Yidong  <cyd@gnu.org>
8840         * buffer.c (Fbuffer_local_variables)
8841         (buffer_lisp_local_variables): Handle unbound vars correctly;
8842         don't let Qunbound leak into Lisp.
8844 2012-02-07  Glenn Morris  <rgm@gnu.org>
8846         * image.c (Fimagemagick_types): Doc fix.
8848         * image.c (imagemagick-render-type): Change it from a lisp object
8849         to an integer.  Move the doc here from the lisp manual.
8850         Treat all values not equal to 0 the same.
8852 2012-02-06  Chong Yidong  <cyd@gnu.org>
8854         * doc.c (store_function_docstring): Avoid applying docstring of
8855         alias to base function (Bug#2603).
8857 2012-02-04  Andreas Schwab  <schwab@linux-m68k.org>
8859         * .gdbinit (pp1, pv1): Remove redundant defines.
8860         (pr): Use pp.
8862 2012-02-04  Chong Yidong  <cyd@gnu.org>
8864         * nsterm.m: Declare a global (Bug#10694).
8866 2012-02-04  Eli Zaretskii  <eliz@gnu.org>
8868         * w32.c (get_emacs_configuration_options):
8869         Include --enable-checking, if specified, in the return value.
8871 2012-02-04  Martin Rudalics  <rudalics@gmx.at>
8873         * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
8874         after rounding frame sizes.  (Bug#9723)
8876 2012-02-04  Eli Zaretskii  <eliz@gnu.org>
8878         * keyboard.c (adjust_point_for_property): Don't position point
8879         before BEGV.  (Bug#10696)
8881 2012-02-03  Paul Eggert  <eggert@cs.ucla.edu>
8883         Handle overflow when computing char display width (Bug#9496).
8884         * character.c (char_width): Return EMACS_INT, not int.
8885         (char_width, c_string_width): Check for overflow when
8886         computing the width; this is possible now that individual
8887         characters can have unbounded width.  Problem introduced
8888         by merge from Emacs 23 on 2012-01-19.
8890 2012-02-02  Michael Albinus  <michael.albinus@gmx.de>
8892         * dbusbind.c (Fdbus_register_method): Mention the return value
8893         :ignore in the docstring.
8895 2012-02-02  Glenn Morris  <rgm@gnu.org>
8897         * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
8899         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8900         Unconditionally set to t.  (Bug#10673)
8901         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8902         * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8903         * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
8905 2012-02-02  Kenichi Handa  <handa@m17n.org>
8907         (x_produce_glyphs): Cancel previous change.  If cmp->glyph_len is
8908         0, do not call append_composite_glyph.
8910 2012-02-02  Kenichi Handa  <handa@m17n.org>
8912         * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
8913         NULL (Bug#6988).
8914         (x_produce_glyphs): If the component of a composition is a null
8915         string, set it->pixel_width to 1 to avoid zero-width glyph.
8917 2012-02-01  Eli Zaretskii  <eliz@gnu.org>
8919         * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
8920         first 2 arguments are identical.  This makes inserting large
8921         output from a subprocess an order of magnitude faster on
8922         MS-Windows, where all sbrk'ed memory is always contiguous.
8924 2012-01-31  Glenn Morris  <rgm@gnu.org>
8926         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8927         * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8928         * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
8930 2012-01-29  Glenn Morris  <rgm@gnu.org>
8932         * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
8934 2012-01-28  Samuel Thibault  <sthibault@debian.org>  (tiny change)
8936         * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
8938 2012-01-28  Chong Yidong  <cyd@gnu.org>
8940         * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
8942 2012-01-26  Chong Yidong  <cyd@gnu.org>
8944         * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
8946         * search.c (Fsearch_forward, Fsearch_backward): Document negative
8947         repeat counts (Bug#10507).
8949 2012-01-26  Glenn Morris  <rgm@gnu.org>
8951         * lread.c (syms_of_lread): Doc fix.
8953 2012-01-25  HIROSHI OOTA  <nil@mad.dog.cx>  (tiny change)
8955         * coding.c (encode_designation_at_bol): Change return value to
8956         EMACS_INT.
8958 2012-01-25  Chong Yidong  <cyd@gnu.org>
8960         * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
8962 2012-01-21  Chong Yidong  <cyd@gnu.org>
8964         * floatfns.c (Fcopysign): Make the second argument non-optional,
8965         since nil is not allowed anyway.
8967 2012-01-21  Andreas Schwab  <schwab@linux-m68k.org>
8969         * process.c (read_process_output): Use p instead of XPROCESS (proc).
8970         (send_process): Likewise.
8972 2012-01-19  Martin Rudalics  <rudalics@gmx.at>
8974         * window.c (save_window_save, Fcurrent_window_configuration)
8975         (Vwindow_persistent_parameters): Do not use Qstate.
8976         Rewrite doc-strings.
8978 2012-01-19  Kenichi Handa  <handa@m17n.org>
8980         * character.c (char_width): New function.
8981         (Fchar_width, c_string_width, lisp_string_width):
8982         Use char_width (Bug#9496).
8984 2012-01-16  Martin Rudalics  <rudalics@gmx.at>
8986         * window.c (Vwindow_persistent_parameters): New variable.
8987         (Fset_window_configuration, save_window_save): Handle persistent
8988         window parameters.
8990 2012-01-14  Eli Zaretskii  <eliz@gnu.org>
8992         * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
8993         thrashing the stack of the thread.  (Bug#9087)
8995 2012-01-12  Paul Eggert  <eggert@cs.ucla.edu>
8997         * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
8999 2012-01-11  Eli Zaretskii  <eliz@gnu.org>
9001         * xdisp.c (rows_from_pos_range): Handle the case where the
9002         highlight ends on a newline.  (Bug#10464)
9003         (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9004         he end column for display of highlight that ends on a newline
9005         before a R2L line.
9007 2012-01-11  Glenn Morris  <rgm@gnu.org>
9009         * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9010         from load-path also when installation-directory is nil.  (Bug#10208)
9012 2012-01-10  Glenn Morris  <rgm@gnu.org>
9014         * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9016         * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9017         Update template values to be closer to their typical values these days.
9019 2012-01-09  Eli Zaretskii  <eliz@gnu.org>
9021         * xdisp.c (rows_from_pos_range): Accept additional argument
9022         DISP_STRING, and accept any glyph in a row whose object is that
9023         string as eligible for mouse highlight.  Fixes mouse highlight of
9024         display strings from overlays.  (Bug#10464)
9026 2012-01-07  Paul Eggert  <eggert@cs.ucla.edu>
9028         emacs: fix an auto-save permissions race condition (Bug#10400)
9029         * fileio.c (auto_saving_dir_umask): New static var.
9030         (Fmake_directory_internal): Use it.
9031         (do_auto_save_make_dir): Set it, instead of invoking chmod after
9032         creating the directory.  The old code temporarily assigns
9033         too-generous permissions to the directory.
9034         (do_auto_save_eh): Clear it.
9035         (Fdo_auto_save): Catch all errors, not just file errors, so
9036         that the var is always cleared.
9038 2012-01-07  Eli Zaretskii  <eliz@gnu.org>
9040         * search.c (scan_buffer): Pass character positions to
9041         know_region_cache, not byte positions.  (Bug#6540)
9043 2012-01-07  LynX  <_LynX@bk.ru>  (tiny change)
9045         * w32.c (sys_rename): Report EXDEV when rename of a directory
9046         fails because the target is on another logical disk.  (Bug#10284)
9048 2012-01-07  David Benjamin  <davidben@mit.edu>  (tiny change)
9050         * xterm.c (x_embed_request_focus): New function.
9052         * xterm.h: Add prototype.
9054         * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9056 2012-01-05  Glenn Morris  <rgm@gnu.org>
9058         * emacs.c (emacs_copyright): Update short copyright year to 2012.
9060 2012-01-01  Eli Zaretskii  <eliz@gnu.org>
9062         * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9063         Load gnutls_transport_set_lowat only if GnuTLS version is below
9064         2.11.1.
9065         (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9066         GnuTLS versions below 2.11.1.
9068 2011-12-31  Antoine Levitt  <antoine.levitt@gmail.com>
9070         * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9071         to the doc string advising against its use for altering the way
9072         windows are scrolled.
9074 2011-12-28  Kenichi Handa  <handa@m17n.org>
9076         * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9077         coding-system ASCII compatible only when it does not produce BOM
9078         on encoding (Bug#10383).
9080 2011-12-26  Jan Djärv  <jan.h.d@swipnet.se>
9082         * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9083         can scroll.
9084         (create_and_show_popup_menu): Always use menu_position_func for
9085         Gtk3 (Bug#10361).
9087 2011-12-24  Andreas Schwab  <schwab@linux-m68k.org>
9089         * callint.c (Fcall_interactively): Don't truncate prompt string.
9091 2011-12-23  Eli Zaretskii  <eliz@gnu.org>
9093         * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9094         property that ends at ZV, so that the bidi iteration could be
9095         resumed from there (after widening).  (Bug#10360)
9097 2011-12-22  Jan Djärv  <jan.h.d@swipnet.se>
9099         * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9101 2011-12-21  Jan Djärv  <jan.h.d@swipnet.se>
9103         * nsterm.m (x_free_frame_resources):
9104         Release f->output_data.ns->miniimage.
9105         (ns_index_color): Fix indentation.  Do not retain
9106         color_table->colors[i].
9108         * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9109         before returning.
9111         * nsfns.m (x_set_background_color): Assign return value from
9112         ns_index_color to face-background instead of NSColor*.
9113         (ns_implicitly_set_icon_type): Fix indentation.
9114         Change assignment in for loop to comparison.
9116         * emacs.c (ns_pool): New variable.
9117         (main): Assign ns_pool.
9118         (Fkill_emacs): Call ns_release_autorelease_pool.
9120         * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9121         autorelease fdesc, release fdAttrs and tdict.
9122         (ns_get_covering_families): Release charset.
9123         (ns_findfonts): Release NSFontDescriptor created with new.
9124         (ns_uni_to_glyphs): Fix indentation.
9125         (setString): Release attrStr before assigning new value.
9127 2011-12-18  Jan Djärv  <jan.h.d@swipnet.se>
9129         * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9130         and NS_IMPL_COCOA.
9131         (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9132         (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9134 2011-12-18  David Reitter  <reitter@cmu.edu>
9136         * nsterm.m (ns_term_init): Subscribe for notifications
9137         NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9138         to method trackingNotification in EmacsMenu.
9140         * nsmenu.m (trackingMenu): New variable.
9141         (trackingNotification): New method (from Aquamacs).
9142         (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
9143         from Aquamacs (Bug#7030).
9145 2011-12-18  Jan Djärv  <jan.h.d@swipnet.se>
9147         * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9148         (symbol_to_nsstring): Fix indentation.
9149         (ns_symbol_to_pb): New function.
9150         (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9151         (Fns_rotate_cut_buffers_internal): Remove.
9152         (Fns_store_selection_internal): Rename from
9153         Fns_store_cut_buffer_internal.
9154         (ns_get_foreign_selection, Fx_own_selection_internal)
9155         (Fx_disown_selection_internal, Fx_selection_exists_p)
9156         (Fns_get_selection_internal, Fns_store_selection_internal):
9157         Use ns_symbol_to_pb and check if return value is nil.
9158         (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT.  Remove defsubr
9159         Sns_rotate_cut_buffers_internal.  Sns_get_cut_buffer_internal
9160         renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9161         renamed to Sns_store_selection_internal.
9162         (ns_handle_selection_request): Move code to Fx_own_selection_internal
9163         and remove this function.
9164         (ns_handle_selection_clear): Remove, never used.
9165         (Fx_own_selection_internal): Move code from ns_handle_selection_request
9166         here.
9168 2011-12-17  Ken Brown  <kbrown@cornell.edu>
9170         * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9171         GID is unknown (Bug#10257).
9173 2011-12-17  Paul Eggert  <eggert@cs.ucla.edu>
9175         * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9176         (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9177         which caused a build failure on GNU/Linux IA-64.  This problem was
9178         introduced by my 2011-10-07 patch.
9180 2011-12-15  Juri Linkov  <juri@jurta.org>
9182         * image.c (imagemagick_error): New function.  (Bug#10112)
9183         (imagemagick_load_image): Comment out `MagickSetResolution' call.
9184         Use `imagemagick_error' where ImageMagick functions return
9185         `MagickFalse'.
9186         (Fimagemagick_types): Add `Fnreverse' to return the list in the
9187         proper order.
9189 2011-12-15  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
9191         * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9192         fill background (Bug#8992).
9194 2011-12-13  Martin Rudalics  <rudalics@gmx.at>
9196         * window.c (Vwindow_combination_resize)
9197         (Vwindow_combination_limit): Use t instead of non-nil in
9198         doc-strings.
9199         (Vrecenter_redisplay): Add first sentence of doc-string on
9200         separate line.
9201         (Frecenter): Fix doc-string typo.
9203 2011-12-11  Kenichi Handa  <handa@m17n.org>
9205         * coding.c (Funencodable_char_position): Pay attention to the
9206         buffer text relocation (Bug#9389).
9208 2011-12-10  Jan Djärv  <jan.h.d@swipnet.se>
9210         * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9211         gtk_init (Bug#10100).
9213 2011-12-10  Eli Zaretskii  <eliz@gnu.org>
9215         * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9216         IT->string is nil.  (Bug#10263)
9218 2011-12-10  Jan Djärv  <jan.h.d@swipnet.se>
9220         * nsterm.h (x_free_frame_resources): Declare.
9222         * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9223         (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9225         * nsterm.h (ns_get_defaults_value): Declare.
9227         * nsterm.m (ns_default): Call ns_get_defaults_value.
9229 2011-12-09  Eli Zaretskii  <eliz@gnu.org>
9231         * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9232         (Bug#10170)
9234 2011-12-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
9236         * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9237         that where the value of an _OBJC_* symbol points to is in the .bss
9238         section (Bug#10240).
9240 2011-12-08  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
9242         * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
9243         after the loop to call ccl_driver at least once (Bug#8619).
9245 2011-12-08  Kenichi Handa  <handa@m17n.org>
9247         * ftfont.c (get_adstyle_property): Fix previous change
9248         (Bug#10233).
9250 2011-12-07  Juanma Barranquero  <lekktu@gmail.com>
9252         * w32.c (init_environment): If no_site_lisp, remove site-lisp
9253         dirs from the default value of EMACSLOADPATH (bug#10208).
9255 2011-12-07  Glenn Morris  <rgm@gnu.org>
9257         * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9258         installation and source directories as well.  (Bug#10208)
9260 2011-12-06  Chong Yidong  <cyd@gnu.org>
9262         * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9264 2011-12-06  Glenn Morris  <rgm@gnu.org>
9266         * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9267         as an error, not just -1.  (Bug#10217)
9269 2011-12-05  Chong Yidong  <cyd@gnu.org>
9271         * keyboard.c (process_special_events): New function.
9272         (swallow_events, Finput_pending_p): Use it (Bug#10195).
9274 2011-12-05  Paul Eggert  <eggert@cs.ucla.edu>
9276         * coding.c (encode_designation_at_bol): Don't use uninitialized
9277         local variable (Bug#9318).
9279 2011-12-05  Kenichi Handa  <handa@m17n.org>
9281         * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9282         return Qnil (Bug#8046, Bug#10193).
9284 2011-12-05  Kenichi Handa  <handa@m17n.org>
9286         * coding.c (encode_designation_at_bol): New args charbuf_end and
9287         dst.  Return the number of produced bytes.  Callers changed.
9288         (coding_set_source): Return how many bytes coding->source was
9289         relocated.
9290         (coding_set_destination): Return how many bytes
9291         coding->destination was relocated.
9292         (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
9293         (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
9295 2011-12-05  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
9297         * coding.c (CODING_CHAR_CHARSET_P): New macro.
9298         (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9299         macro (Bug#9318).
9301 2011-12-05  Andreas Schwab  <schwab@linux-m68k.org>
9303         The following changes are to fix Bug#9318.
9305         * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
9306         (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9307         (encode_coding_iso_2022, encode_coding_sjis)
9308         (encode_coding_big5, encode_coding_charset): Use the above macros.
9310 2011-12-05  Juanma Barranquero  <lekktu@gmail.com>
9312         * lisp.h (process_quit_flag): Fix external declaration.
9314 2011-12-04  Stefan Monnier  <monnier@iro.umontreal.ca>
9316         Don't macro-inline non-performance-critical code.
9317         * eval.c (process_quit_flag): New function.
9318         * lisp.h (QUIT): Use it.
9320 2011-12-04  Jan Djärv  <jan.h.d@swipnet.se>
9322         * nsfns.m (get_geometry_from_preferences): New function.
9323         (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9325 2011-12-04  Andreas Schwab  <schwab@linux-m68k.org>
9327         * emacs.c (Qkill_emacs): Define.
9328         (syms_of_emacs): Initialize it.
9329         * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9330         Qquit_flag to `kill-emacs' instead.
9331         (quit_throw_to_read_char): Add parameter `from_signal'.
9332         All callers changed.  Call Fkill_emacs if requested and safe.
9333         * lisp.h (QUIT): Call Fkill_emacs if requested.
9335 2011-12-03  Jan Djärv  <jan.h.d@swipnet.se>
9337         * widget.c (update_wm_hints): Return if wmshell is null.
9338         (widget_update_wm_size_hints): New function.
9340         * widget.h (widget_update_wm_size_hints): Declare.
9342         * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9343         widget_update_wm_size_hints (Bug#10104).
9345 2011-12-03  Eli Zaretskii  <eliz@gnu.org>
9347         * xdisp.c (handle_invisible_prop): If the invisible text ends just
9348         before a newline, prepare the bidi iterator for consuming the
9349         newline, and keep the current paragraph direction.  (Bug#10183)
9350         (redisplay_window): Don't let `margin' become negative.  (Bug#10192)
9352 2011-12-02  Juri Linkov  <juri@jurta.org>
9354         * search.c (Fword_search_regexp): New Lisp function created from
9355         `wordify'.  Change type of arg `lax' from `int' to `Lisp_Object'.
9356         (Fword_search_backward, Fword_search_forward)
9357         (Fword_search_backward_lax, Fword_search_forward_lax):
9358         Use `Fword_search_regexp' instead of `wordify'.  Doc fix.
9359         (syms_of_search): Define `Sword_search_regexp'.  (Bug#10145)
9361 2011-12-01  Stefan Monnier  <monnier@iro.umontreal.ca>
9363         * fileio.c (Finsert_file_contents): Move after-change-function call
9364         to before the "handled:" label, since all "goto handled" appear in
9365         cases where the *-change-functions have already been properly called
9366         (bug#10117).
9368 2011-12-01  Andreas Schwab  <schwab@linux-m68k.org>
9370         * keyboard.c (interrupt_signal): Don't call kill-emacs when
9371         waiting for input.  (Bug#10169)
9373 2011-11-30  Eli Zaretskii  <eliz@gnu.org>
9375         * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9376         verifies glyph row's hash code--we have just reallocated the
9377         glyphs, so their contents can be complete garbage.  (Bug#10164)
9379 2011-11-30  Juanma Barranquero  <lekktu@gmail.com>
9381         * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9383 2011-11-30  Eli Zaretskii  <eliz@gnu.org>
9385         * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9386         attributes are tested _before_ calling verify_row_hash, to protect
9387         against GCC re-ordering of the tests.  (Bug#10164)
9389 2011-11-29  Jan Djärv  <jan.h.d@swipnet.se>
9391         * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9393         * xterm.c (handle_one_xevent): Only set async_visible and friends
9394         if net_wm_state_hidden_seen is non-zero (Bug#10002)
9395         (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
9396         _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9398 2011-11-28  Paul Eggert  <eggert@cs.ucla.edu>
9400         Remove GCPRO-related macros that exist only to avoid shadowing locals.
9401         * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9402         (GCPRO6_VAR, UNGCPRO_VAR): Remove.  See
9403         <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9404         All uses changed to use GCPRO1 etc.
9405         (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9406         Revert to old implementation (i.e., before 2011-03-11).
9408 2011-11-28  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
9410         * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9411         of scroll runs so as to avoid assigning disabled bogus rows and
9412         unnecessary graphics copy operations.
9414 2011-11-27  Eli Zaretskii  <eliz@gnu.org>
9416         * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9417         (snprintf) [_MSC_VER]: Redirect to _snprintf.
9418         (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9419         (malloc, free, realloc, calloc): Redirect to e_* only when
9420         compiling Emacs.
9422         * lisp.h (GCTYPEBITS): Move before first use.
9423         (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9424         (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9425         this macro definition.
9427         * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9428         _MSC_VER.
9430 2011-11-27  Jan Djärv  <jan.h.d@swipnet.se>
9432         * gtkutil.c (xg_create_frame_widgets):
9433         Call gtk_window_set_has_resize_grip (FALSE) if that function is
9434         present with Gtk+ 2.0.
9436 2011-11-26  Paul Eggert  <eggert@cs.ucla.edu>
9438         * fileio.c (Finsert_file_contents): Undo previous change; see
9439         <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9441 2011-11-26  Paul Eggert  <eggert@cs.ucla.edu>
9443         Rename locals to avoid shadowing.
9444         * fileio.c (Finsert_file_contents):
9445         Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9446         * process.c (wait_reading_process_output):
9447         Rename inner 'proc' to 'p' to avoid shadowing.
9448         Indent for consistency with usual Emacs style.
9450 2011-11-25  Eli Zaretskii  <eliz@gnu.org>
9452         * xdisp.c (redisplay_window): If cursor row is not fully visible
9453         after recentering, and scroll-conservatively is set to a large
9454         number, scroll window by a few more lines to make the cursor fully
9455         visible and out of scroll-margin.  (Bug#10105)
9456         (start_display): Don't move to the next line if the display should
9457         start at a newline that is part of a display vector or an overlay
9458         string.  (Bug#10119)
9460 2011-11-24  Juri Linkov  <juri@jurta.org>
9462         * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9463         after the `MagickPingImage' call.  (Bug#10112)
9465 2011-11-23  Chong Yidong  <cyd@gnu.org>
9467         * window.c (Fcoordinates_in_window_p): Accept only live windows.
9469 2011-11-23  Martin Rudalics  <rudalics@gmx.at>
9471         * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9472         making another buffer current.  (Bug#10114)
9474 2011-11-23  Glenn Morris  <rgm@gnu.org>
9476         * font.c (font_find_for_lface) [HAVE_NS]: Ignore case.  (Bug#2526)
9478 2011-11-23  Chong Yidong  <cyd@gnu.org>
9480         * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9481         using it (Bug#5984).
9483 2011-11-22  Eli Zaretskii  <eliz@gnu.org>
9485         * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9486         and header-lines, as they don't have one computed for them.
9487         (Bug#10098)
9489         * .gdbinit (prow): Make displayed values more self-explaining.
9490         Add row's hash code.
9492 2011-11-21  Lars Magne Ingebrigtsen  <larsi@gnus.org>
9494         * process.c (wait_reading_process_output): Fix asynchrounous
9495         GnuTLS socket handling on some versions of the GnuTLS library.
9496         (wait_reading_process_output): Add comment and URL.
9498 2011-11-21  Jan Djärv  <jan.h.d@swipnet.se>
9500         * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9502 2011-11-21  Chong Yidong  <cyd@gnu.org>
9504         * window.c (Fnext_window, Fprevious_window): Doc fix.
9506 2011-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
9508         * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9510 2011-11-20  Juanma Barranquero  <lekktu@gmail.com>
9512         * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9514 2011-11-20  Martin Rudalics  <rudalics@gmx.at>
9516         * window.c (Fset_window_combination_limit): Rename argument
9517         STATUS to LIMIT.
9518         (Vwindow_combination_limit): Remove "status" from doc-string.
9520 2011-11-20  Andreas Schwab  <schwab@linux-m68k.org>
9522         * m/ibms390.h: Remove.
9523         * m/ibms390x.h: Don't include "ibms390.h".
9525 2011-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
9527         * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9528         Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9530 2011-11-20  Juanma Barranquero  <lekktu@gmail.com>
9532         * casetab.c (Fset_case_table):
9533         * charset.c (Fcharset_after): Fix typos.
9535 2011-11-20  Paul Eggert  <eggert@cs.ucla.edu>
9537         Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9538         Otherwise, valgrind does not work on some platforms.
9539         Problem reported by Andreas Schwab in
9540         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9541         * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9542         is set, removing the need for VIRT_ADDRESS_VARIES.
9543         (PURE_P): Use a more-efficient implementation that needs just one
9544         comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9545         number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9546         to 4 (xorl, subq, cmpq, setbe).
9547         * alloc.c (pure): Always extern now, since that's the
9548         VIRT_ADDR_VARIES behavior.
9549         (PURE_POINTER_P): Use a single comparison, not two, for
9550         consistency with the new puresize.h.
9551         * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9552         * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9553         Remove VIRT_ADDR_VARIES no longer needed.
9555 2011-11-19  Eli Zaretskii  <eliz@gnu.org>
9557         * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9558         (erase_phys_cursor, update_window_cursor, show_mouse_face)
9559         (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9560         behave as if the cursor position were at the window margin.
9562         * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9563         and the cursor position is out of bounds, behave as if the cursor
9564         position were at the window margin.  (Bug#10075)
9566 2011-11-18  Chong Yidong  <cyd@gnu.org>
9568         * window.c (Fwindow_combination_limit): Make first argument
9569         non-optional, since it is meaningless for live windows like the
9570         selected window.
9572 2011-11-18  Dmitry Antipov  <dmantipov@yandex.ru>
9574         * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9576 2011-11-18  Stefan Monnier  <monnier@iro.umontreal.ca>
9578         * intervals.c: Fix grafting over the whole buffer (bug#10071).
9579         (graft_intervals_into_buffer): Simplify.
9581 2011-11-18  Eli Zaretskii  <eliz@gnu.org>
9583         * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9584         hash values of the two rows.
9585         (copy_row_except_pointers): Preserve the used[] arrays and the
9586         hash values of the two rows.  (Bug#10035)
9587         (add_row_entry): Add xassert to verify that ROW's hash code is valid.
9589         * xdisp.c (row_hash): New function, body extracted from
9590         compute_line_metrics.
9591         (compute_line_metrics): Call row_hash, instead of computing the
9592         hash code inline.
9594         * dispnew.c (verify_row_hash): Call row_hash for computing the
9595         hash code of a row, instead of duplicating code from xdisp.c.
9597         * dispextern.h (row_hash): Add prototype.
9599 2011-11-18  Tassilo Horn  <tassilo@member.fsf.org>
9601         * frame.c (delete_frame): Don't delete the terminal when the last
9602         X frame is closed if emacs is built with GTK toolkit.
9604 2011-11-17  Juanma Barranquero  <lekktu@gmail.com>
9606         * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9608 2011-11-17  Martin Rudalics  <rudalics@gmx.at>
9610         * window.c (Vwindow_splits): Rename to
9611         Vwindow_combination_resize.  Suggested by Juri Linkov.
9612         (Fsplit_window_internal): Use Vwindow_combination_resize instead
9613         of Vwindow_splits.
9615 2011-11-16  Juanma Barranquero  <lekktu@gmail.com>
9617         * nsfns.m (Fns_font_name):
9618         * window.c (syms_of_window) <window-combination-limit>: Fix typos.
9620 2011-11-16  Martin Rudalics  <rudalics@gmx.at>
9622         * window.h (window): Rename slot "nest" to "combination_limit".
9623         * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9624         (Fset_window_nest): Rename to Fset_window_combination_limit.
9625         (Vwindow_nest): Rename to Vwindow_combination_limit.
9626         (recombine_windows, make_parent_window, make_window)
9627         (Fsplit_window_internal, saved_window)
9628         (Fset_window_configuration, save_window_save): Rename all
9629         occurrences of window_nest to window_combination_limit.
9631 2011-11-15  Juanma Barranquero  <lekktu@gmail.com>
9633         * image.c (imagemagick_load_image): Fix typo.
9635 2011-11-14  Eli Zaretskii  <eliz@gnu.org>
9637         * xdisp.c (display_line): Move the call to
9638         highlight_trailing_whitespace before the call to
9639         compute_line_metrics, since the latter needs to see the final
9640         faces of all the glyphs to compute ROW's hash value.
9641         Fixes assertion violations in row_equal_p.  (Bug#10035)
9643 2011-11-14  Juanma Barranquero  <lekktu@gmail.com>
9645         * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9646         just return (bug#10044).
9648 2011-11-12  Eli Zaretskii  <eliz@gnu.org>
9650         * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9651         with user-defined heap size.  Bump the default size of the temacs
9652         heap to 27MB, to avoid memory warning when running temacs.
9653         ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9655         * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9656         current_matrix and desired_matrix.  (Bug#9990)
9657         (verify_row_hash) [XASSERTS]: New function.
9658         (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9659         that the hash value of glyph rows is correct.
9661 2011-11-12  Martin Rudalics  <rudalics@gmx.at>
9663         * window.h (window): Remove splits slot.
9664         * window.c (Fwindow_splits, Fset_window_splits): Remove.
9665         (Fdelete_other_windows_internal, make_parent_window)
9666         (make_window, Fsplit_window_internal, Fdelete_window_internal)
9667         (Fset_window_configuration, save_window_save): Don't deal with
9668         split status of windows.
9669         (saved_window): Remove splits slot.
9670         (Vwindow_splits): Rewrite doc-string.
9672 2011-11-11  Jan Djärv  <jan.h.d@swipnet.se>
9674         * xfns.c (unwind_create_frame):
9675         * nsfns.m (unwind_create_frame):
9676         * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9677         Vframe_list (Bug#9999).
9679 2011-11-11  Dmitry Antipov  <dmantipov@yandex.ru>
9681         * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
9683 2011-11-11  Kenichi Handa  <handa@m17n.org>
9685         * callproc.c (Fcall_process): Set the member dst_multibyte of
9686         process_coding.
9688 2011-11-11  Johan Bockgård  <bojohan@gnu.org>
9690         * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9691         avoid a crash (bug#9496).
9693 2011-11-09  Chong Yidong  <cyd@gnu.org>
9695         * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9696         (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9698 2011-11-08  Paul Eggert  <eggert@cs.ucla.edu>
9700         * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9702 2011-11-08  Paul Eggert  <eggert@cs.ucla.edu>
9704         Avoid some portability problems by eschewing 'extern inline' functions.
9705         The trivial performance wins aren't worth the portability hassles; see
9706         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9707         et seq.
9708         * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9709         (window_box_width, window_box_left, window_box_left_offset)
9710         (window_box_right, window_box_right_offset): Undo previous change,
9711         by removing the "extern"s.
9712         * intervals.c (adjust_intervals_for_insertion)
9713         (adjust_intervals_for_deletion): Undo previous change,
9714         making these static again.
9715         (offset_intervals, temp_set_point_both, temp_set_point)
9716         (copy_intervals_to_string): No longer inline.
9717         * xdisp.c (window_text_bottom_y, window_box_width)
9718         (window_box_height, window_box_left_offset)
9719         (window_box_right_offset, window_box_left, window_box_right)
9720         (window_box): No longer inline.
9722 2011-11-08  Chong Yidong  <cyd@gnu.org>
9724         * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
9725         (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9726         Signal an error if not a live window.
9727         (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9728         (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9730 2011-11-07  Juanma Barranquero  <lekktu@gmail.com>
9732         * lisp.h (syms_of_abbrev): Remove declaration.
9733         Reported by CHENG Gao <chenggao@royau.me>.
9735 2011-11-07  Eli Zaretskii  <eliz@gnu.org>
9737         * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9738         if Vpurify_flag is non-nil.  Fixes a crash when running w32 build
9739         of temacs in GUI mode.
9741 2011-11-07  Martin Rudalics  <rudalics@gmx.at>
9743         * window.h: Declare delete_all_child_windows instead of
9744         delete_all_subwindows.
9745         * window.c (Fwindow_nest, Fset_window_nest)
9746         (Fset_window_new_total, Fset_window_new_normal)
9747         (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9748         (delete_all_subwindows): Rename to delete_all_child_windows.
9749         (Fdelete_other_windows_internal, Fset_window_configuration):
9750         Call delete_all_child_windows instead of delete_all_subwindows.
9751         * frame.c (delete_frame): Call delete_all_child_windows instead
9752         of delete_all_subwindows.
9754 2011-11-07  Paul Eggert  <eggert@cs.ucla.edu>
9756         * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9757         This is also needed for porting to any host where GC_MARK_STACK is
9758         not GC_MAKE_GCPROS_NOOPS.
9759         (which_symbols): Use it.
9761 2011-11-07  Kenichi Handa  <handa@m17n.org>
9763         * coding.c (coding_set_destination): Check coding->src_pos only
9764         when coding->src_object is a buffer (bug#9910).
9766         * process.c (send_process): Set the member src_multibyte of coding
9767         to 0 (bug#9911) when sending a unibyte text.
9769         * callproc.c (Fcall_process): Set the member src_multibyte of
9770         process_coding to 0 (bug#9912).
9772 2011-11-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
9774         * xmenu.c (cleanup_widget_value_tree): New function.
9775         (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
9776         calling free_menubar_widget_value_tree directly (Bug#9830).
9778 2011-11-06  Paul Eggert  <eggert@cs.ucla.edu>
9780         Fix some portability problems with 'inline'.
9781         * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9782         (window_box_width, window_box_left, window_box_left_offset)
9783         (window_box_right, window_box_right_offset): Declare extern.
9784         Otherwise, these inline functions do not conform to C99 and
9785         are miscompiled by Microsoft compilers.  Reported by Eli Zaretskii in
9786         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
9787         * intervals.c (adjust_intervals_for_insertion)
9788         (adjust_intervals_for_deletion): Now extern, because otherwise the
9789         extern inline functions 'offset_intervals' couldn't refer to it.
9790         (static_offset_intervals): Remove.
9791         (offset_intervals): Rewrite using the old contents of
9792         static_offset_intervals.  The old version didn't conform to C99
9793         because an extern inline function contained a reference to an
9794         identifier with static linkage.
9796 2011-11-06  Andreas Schwab  <schwab@linux-m68k.org>
9798         * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9799         GC.
9801 2011-11-06  Eli Zaretskii  <eliz@gnu.org>
9803         * xdisp.c (init_iterator, reseat_to_string): Don't set the
9804         iterator's bidi_p flag if Vpurify_flag is non-nil.  (Bug#9963)
9805         (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9806         return Qleft_to_right.
9808 2011-11-06  Chong Yidong  <cyd@gnu.org>
9810         * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9811         (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9812         (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9813         (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9814         (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9815         (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9816         (Fwindow_vscroll): Doc fix.
9817         (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9818         argument, since it makes no sense to pass a live window and for
9819         consistency with window-child.
9821 2011-11-05  Christoph Scholtes  <cschol2112@googlemail.com>
9823         * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9824         support MSVC.
9826 2011-11-05  Jason Rumney  <jasonr@gnu.org>
9828         * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9829         (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9830         fonts (Bug#6029).
9831         (add_font_entity_to_list): Fix logic errors in mixed boolean and
9832         bitwise arithmetic preventing use of unicode-sip and non-truetype
9833         opentype fonts.
9835 2011-11-05  Eli Zaretskii  <eliz@gnu.org>
9837         * s/ms-w32.h (fstat, stat, utime): Move redirections to
9838         "emacs"-only part.
9840         * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9841         initialization code to keep similarity to xfns.c after changes
9842         from 2011-11-05.
9844 2011-11-05  Jan Djärv  <jan.h.d@swipnet.se>
9846         * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9847         (unwind_create_frame): New function (Bug#9943).
9848         (Fx_create_frame): Restructure code to be more similar to the one in
9849         xfns.c.  Call record_unwind_protect with unwind_create_frame (Bug#9943).
9850         Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9851         Move terminal->reference_count++ just before making the frame official
9852         (Bug#9943).
9854         * nsterm.m (x_free_frame_resources): New function.
9855         (x_destroy_window): Move code to x_free_frame_resources.
9857         * xfns.c (unwind_create_frame): Fix comment.
9858         (Fx_create_frame, x_create_tip_frame):
9859         Move terminal->reference_count++ just before making the frame
9860         official.  Move initialization of image_cache_refcount and
9861         dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9863 2011-11-05  Eli Zaretskii  <eliz@gnu.org>
9865         Support MSVC build with newer versions of Visual Studio.
9866         * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9867         Nmake barfs on that.  Use $(OBJ*_c) variables instead, defined on
9868         nt/gmake.defs.
9870         * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
9871         which are not supported by MSVC.
9872         (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
9873         (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
9874         bitfields.
9875         (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
9876         types in bitfields.
9877         (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
9879         * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
9881 2011-11-05  Fabrice Popineau  <fabrice.popineau@supelec.fr>  (tiny change)
9883         Support MSVC build with newer versions of Visual Studio.
9884         * w32.c: Don't include w32api.h for MSVC.
9885         (init_environment) [_MSC_VER]: Call sys_access, not _access.
9887         * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
9888         [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
9889         (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
9890         (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
9891         e_* cousins.
9892         (alloca) [_MSC_VER]: Define to _alloca.
9894         * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
9896         * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
9898 2011-11-04  Eli Zaretskii  <eliz@gnu.org>
9900         * xdisp.c (note_mouse_highlight): If either of
9901         previous/next-single-property-change returns nil, treat that as
9902         the beginning or the end of the buffer.  (Bug#9955)
9904 2011-11-04  Jan Djärv  <jan.h.d@swipnet.se>
9906         * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
9907         label is not null (Bug#9951).
9908         (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
9909         may be NULL.
9911 2011-11-04  Eli Zaretskii  <eliz@gnu.org>
9913         * window.c (Fwindow_body_size): Mention in the doc string that the
9914         return value is in frame's canonical units.  (Bug#9949)
9916 2011-11-03  Eli Zaretskii  <eliz@gnu.org>
9918         * xdisp.c (note_mouse_highlight): Initialize `area'.  (Bug#9947)
9920         * w32fns.c (unwind_create_frame): If needed, free the glyph
9921         matrices of the partially constructed frame.  (Bug#9943)
9922         * xfns.c (unwind_create_frame): Likewise.
9924 2011-11-01  Eli Zaretskii  <eliz@gnu.org>
9926         * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
9927         Don't stop backward scan on the continuation glyph, even though
9928         its CHARPOS is positive.
9929         (mouse_face_from_buffer_pos, note_mouse_highlight):
9930         Rename cover_string to disp_string.
9932 2011-11-01  Martin Rudalics  <rudalics@gmx.at>
9934         * window.c (temp_output_buffer_show): Don't use
9935         Vtemp_buffer_show_specifiers.
9936         (Vtemp_buffer_show_specifiers): Remove unused variable.
9938 2011-10-30  Eli Zaretskii  <eliz@gnu.org>
9940         * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
9941         past the beginning of the current glyph matrix.
9943 2011-10-30  Adam Sjøgren  <asjo@koldfront.dk>  (tiny change)
9945         * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
9946         (x_error_handler): Ignore BadMatch for X_SetInputFocus for
9947         HAVE_GTK3 (Bug#9869).
9949         * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
9950         type to GDK_NOTHING so valgrind does not complain (Bug#9901).
9952         * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
9954         * xterm.c: Declare x_handle_net_wm_state to return int.
9955         (handle_one_xevent): Check if we are iconified but don't have
9956         _NET_WM_STATE_HIDDEN.  If do, treat as deiconify (Bug#9893).
9957         (get_current_wm_state): Return non-zero if not hidden,
9958         check for _NET_WM_STATE_HIDDEN (Bug#9893).
9959         (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
9960         (x_handle_net_wm_state): Return what get_current_wm_state returns.
9961         (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
9963 2011-10-29  Paul Eggert  <eggert@cs.ucla.edu>
9965         * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
9966         so that this new function doesn't get optimized away by a
9967         whole-program optimizer.  Make the 2nd arg EMACS_INT, not int.
9969 2011-10-29  Andreas Schwab  <schwab@linux-m68k.org>
9971         * frame.h (MOUSE_HL_INFO): Remove excess parens.
9973 2011-10-29  Eli Zaretskii  <eliz@gnu.org>
9975         Fix the `xbytecode' command.
9976         * .gdbinit (xprintbytestr): New command.
9977         (xwhichsymbols): Rename from `which'; all callers changed.
9978         (xbytecode): Print the byte-code string as well.
9980 2011-10-29  Kim Storm  <storm@cua.dk>
9982         * alloc.c (which_symbols): New function.
9984 2011-10-29  Andreas Schwab  <schwab@linux-m68k.org>
9986         * minibuf.c (read_minibuf_noninteractive): Allow reading empty
9987         line.  (Bug#9903)
9989 2011-10-29  Glenn Morris  <rgm@gnu.org>
9991         * process.c (wait_reading_process_output): Revert 2009-08-30 change.
9992         Not clear what it was for, and it causes various bugs.  (Bug#9839)
9994 2011-10-28  Eli Zaretskii  <eliz@gnu.org>
9996         * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
9997         possible random value that matches one of those tested as
9998         condition to clear the mouse face.
10000 2011-10-28  Chong Yidong  <cyd@gnu.org>
10002         * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10004 2011-10-28  Dan Nicolaescu  <dann@ics.uci.edu>
10006         * window.c (make_window): Initialize phys_cursor_on_p.
10008 2011-10-28  Stefan Monnier  <monnier@iro.umontreal.ca>
10010         * lisp.h (struct Lisp_Symbol): Update comments.
10012 2011-10-28  Juanma Barranquero  <lekktu@gmail.com>
10014         * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10016 2011-10-28  Eli Zaretskii  <eliz@gnu.org>
10018         Fix Emacs on Windows 9X (bug#8562).  Thanks to oslsachem
10019         <oslsachem@gmail.com> for helping to debug this.
10021         * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10022         (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10023         (g_b_init_get_glyph_outline_w): New static variables.
10024         (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10025         (GetGlyphOutlineW_Proc): New typedefs.
10026         (w32_load_unicows_or_gdi32, get_outline_metrics_w)
10027         (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10028         New functions.
10029         (w32font_open_internal, compute_metrics):
10030         Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
10031         instead of calling the "wide" APIs directly.
10033         * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10035         * w32.h (syms_of_w32font): Add prototype.
10037 2011-10-27  Juanma Barranquero  <lekktu@gmail.com>
10039         * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10040         (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10041         (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10042         (Fmove_to_window_line): Doc fix.
10044 2011-10-27  Chong Yidong  <cyd@gnu.org>
10046         * process.c (make_process): Set gnutls_state to NULL.
10048         * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10049         non-NULL, regardless of GNUTLS_INITSTAGE.
10050         (Fgnutls_boot): Cleanups.  Call emacs_gnutls_deinit if we signal
10051         an error.  Set process slots as soon as we allocate them.
10053         * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10055 2011-10-27  Chong Yidong  <cyd@gnu.org>
10057         * gnutls.c (emacs_gnutls_deinit): New function.
10058         Deallocate credentials structures as well as calling gnutls_deinit.
10059         (Fgnutls_deinit, Fgnutls_boot): Use it.
10061         * process.c (make_process): Initialize GnuTLS credentials to NULL.
10062         (deactivate_process): Call emacs_gnutls_deinit.
10064 2011-10-27  Juanma Barranquero  <lekktu@gmail.com>
10066         * image.c (x_create_x_image_and_pixmap):
10067         * w32.c (sys_rename, w32_delayed_load):
10068         * w32font.c (fill_in_logfont):
10069         * w32reg.c (x_get_string_resource): Silence compiler warnings.
10071 2011-10-26  Juanma Barranquero  <lekktu@gmail.com>
10073         * w32fns.c (w32_default_color_map): New function,
10074         extracted from Fw32_default_color_map.
10075         (Fw32_default_color_map, Fx_open_connection): Use it.  (Bug#9785)
10077 2011-10-25  Paul Eggert  <eggert@cs.ucla.edu>
10079         * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10081 2011-10-25  Stefan Monnier  <monnier@iro.umontreal.ca>
10083         * keyboard.c (test_undefined): New function (bug#9751).
10084         (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10086 2011-10-25  Enami Tsugutomo  <tsugutomo.enami@jp.sony.com>
10088         * sysdep.c (init_sys_modes): Fix the check for the controlling
10089         terminal (Bug#6649).
10091 2011-10-20  Eli Zaretskii  <eliz@gnu.org>
10093         * dispextern.h (struct bidi_it): New member next_en_type.
10095         * bidi.c (bidi_line_init): Initialize the next_en_type member.
10096         (bidi_resolve_explicit_1): When next_en_pos is valid for the
10097         current character, check also for next_en_type being WEAK_EN.
10098         (bidi_resolve_weak): Don't enter the expensive loop if the current
10099         position is before next_en_pos.  Record the bidi type of the first
10100         non-ET, non-BN character we find, in addition to its position.
10101         (bidi_level_of_next_char): Invalidate next_en_type when
10102         next_en_pos is over-stepped.
10104 2011-10-20  Paul Eggert  <eggert@cs.ucla.edu>
10106         Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10107         * editfns.c: Rewrite current-time-zone so that it invokes
10108         the equivalent of (format-time-string "%Z") to get the time zone name.
10109         This fixes a bug when the time zone name contains characters that
10110         need converting from the system time locale to Emacs internal format.
10111         This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10112         that patch fixed format-time-string to do the conversion, but
10113         I forgot to fix current-time-zone.
10114         (format_time_string): New function, containing most of
10115         what Fformat_time_string used to contain.
10116         (Fformat_time_string): Rewrite in terms of format_time_string.
10117         This doesn't change this function's behavior.
10118         (current-time-zone): Rewrite to use format_time_string.
10119         This fixes the bug reported by Michael Schierl in
10120         <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10121         Jason Rumney's 2007-06-07 change worked around this bug, but
10122         didn't fix it.
10123         * systime.h (tzname, timezone): Remove no-longer-used declarations.
10125 2011-10-19  Eli Zaretskii  <eliz@gnu.org>
10127         * xdisp.c (start_display): If the character at POS is displayed
10128         via a display vector, reset IT->current.dpvec_index to zero.
10129         (try_window_reusing_current_matrix): If a line ends in a display
10130         vector or the next line starts in a display vector, continue
10131         redrawing the window even though the character position of
10132         start_row was reached.
10133         (Bug#9771, part 2)
10135 2011-10-18  Chong Yidong  <cyd@gnu.org>
10137         * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10138         with nobreak-char-display too.
10140 2011-10-18  Eli Zaretskii  <eliz@gnu.org>
10142         Fix part 3 of bug#9771.
10143         * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10144         (bidi_resolve_neutral): Don't enter the expensive loop looking for
10145         non-neutral characters if the current character is a paragraph
10146         separator (a.k.a. Newline).  This avoids running the same
10147         expensive loop twice, once when we consume the preceding newline
10148         and the other time when the line actually needs to be displayed.
10149         Avoid the loop when we see neutrals on the base embedding level
10150         following a character whose directionality is the same as the
10151         paragraph's.  This avoids running the expensive loop when a line
10152         ends in a long sequence of neutrals, like control characters.
10153         Add assertion against STRONG_AL type.  Slightly rearrange code
10154         that determines the type of a neutral given the first non-neutral
10155         that follows it.
10156         (bidi_level_of_next_char): Set next_en_pos to zero when
10157         invalidating its info.
10159 2011-10-17  Eli Zaretskii  <eliz@gnu.org>
10161         * xdisp.c (push_display_prop): Determine whether to record string
10162         or buffer position by IT->string, not by IT->method.  Allow
10163         GET_FROM_DISPLAY_VECTOR as IT->method on entry.  (Bug#9771, part 4)
10164         (move_it_vertically_backward): Don't look for character position
10165         immediately after the newline when in a continuation line.
10166         (Bug#9771, part 1)
10168 2011-10-15  Martin Rudalics  <rudalics@gmx.at>
10170         * window.c (coordinates_in_window): Rewrite and delabelize
10171         vertical border check.  (Bug#5357) (Bug#9618)
10173 2011-10-14  Stefan Monnier  <monnier@iro.umontreal.ca>
10175         * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10176         errors in XSetWindowBorder (bug#9310).
10178 2011-10-13  Dmitry Antipov  <dmantipov@yandex.ru>
10180         * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10181         avoid crash when xmalloc overrun checking is enabled.
10183 2011-10-13  Eli Zaretskii  <eliz@gnu.org>
10185         * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10186         itb.paragraph_dir to NEUTRAL_DIR.  Fixes an occasional incorrect
10187         cursor motion with <left> and <right> arrow keys.
10189         * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10190         some callers set that themselves.
10192 2011-10-12  Eli Zaretskii  <eliz@gnu.org>
10194         * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10195         display string and the previous row comes from the same string and
10196         is empty.  (Bug#9739)  (Bug#9738)
10198 2011-10-12  Stefan Monnier  <monnier@iro.umontreal.ca>
10200         * doc.c (get_doc_string): Encode file name (bug#9735).
10202 2011-10-12  Eli Zaretskii  <eliz@gnu.org>
10204         * bidi.c (bidi_level_of_next_char):
10205         * xdisp.c (get_visually_first_element): Remove old incorrect
10206         comments regarding the Unicode Line Separator character.
10208         * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10210 2011-10-12  Dmitry Antipov  <dmantipov@yandex.ru>
10212         * alloc.c (Fgc_status): Do not access beyond zombies array
10213         boundary if nzombies > MAX_ZOMBIES.
10214         * alloc.c (dump_zombies): Add missing format specifier.
10216 2011-10-12  Paul Eggert  <eggert@cs.ucla.edu>
10218         * xdisp.c (set_cursor_from_row): Simplify conditionals,
10219         to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10221         * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10222         Some packages use them to denote characters with modifiers.
10224 2011-10-11  Andreas Schwab  <schwab@linux-m68k.org>
10226         * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10227         (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10228         matching a pp-number.  Rename parameter var to var1.
10230 2011-10-11  Stefan Monnier  <monnier@iro.umontreal.ca>
10232         * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10234 2011-10-08  Glenn Morris  <rgm@gnu.org>
10236         * callint.c (Fcall_interactively): Give a more explicit error for the
10237         'c' case with a non-character input.  (Bug#8479)
10239 2011-10-08  Eli Zaretskii  <eliz@gnu.org>
10241         * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10242         lines.
10243         (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10244         lines that are hscrolled on the left.
10246         * dispnew.c (buffer_posn_from_coords): Account for a possible
10247         presence of header-line.  (Bug#4426)
10249 2011-10-07  Stefan Monnier  <monnier@iro.umontreal.ca>
10251         * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10252         Don't advertise functionality which we discourage or doesn't work.
10254 2011-10-07  Paul Eggert  <eggert@cs.ucla.edu>
10256         * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10257         or sizeof.  __alignof__ gives the wrong answer on Fedora x86-64
10258         with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10259         this makes Emacs dump core during garbage collection on rare
10260         occasions.  sizeof is obviously inferior to offsetof here, so
10261         stick with offsetof.
10262         (GC_POINTER_ALIGNMENT): New macro.
10263         (mark_memory): Omit 3rd (offset) arg; caller changed.
10264         Don't assume EMACS_INT alignment is the same as pointer alignment.
10266 2011-10-03  Stefan Monnier  <monnier@iro.umontreal.ca>
10268         * keyboard.c (read_key_sequence_remapped): New var.
10269         (read_key_sequence): Compute remapping in the right buffer.
10270         (command_loop_1): Use read_key_sequence's remapping directly.
10272 2011-10-02  Stefan Monnier  <monnier@iro.umontreal.ca>
10274         * dired.c (file_name_completion): Don't expand file name.
10275         (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10276         before checking file name handler.
10278         * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10279         they've been requested explicitly (bug#9591).
10281 2011-10-01  Andreas Schwab  <schwab@linux-m68k.org>
10283         * keymap.c (Fsingle_key_description): Use make_specified_string
10284         instead of build_string to build string from push_key_description.
10285         (Bug#5193)
10287 2011-09-30  Paul Eggert  <eggert@cs.ucla.edu>
10289         * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10290         This fixes a Y2038 bug on 64-bit hosts.
10291         * buffer.c (reset_buffer):
10292         * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10293         (Fclear_buffer_auto_save_failure):
10294         Use 0, not -1, to represent an unset failure time, since time_t
10295         might not be signed.
10297         Remove dependency on glibc malloc internals.
10298         * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10299         Move back here from lisp.h, but with their new implementations.
10300         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10301         (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10302         * charset.c (charset_table_init): New static var.
10303         (syms_of_charset): Use it instead of xmalloc.  This removes a
10304         dependency on glibc malloc internals.  See Eli Zaretskii's comment in
10305         <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10306         * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10307         Move back to alloc.c.
10308         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10309         (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10311 2011-09-30  Jan Djärv  <jan.h.d@swipnet.se>
10313         * nsterm.m (windowDidResize): Call x_set_window_size only when
10314         ns_in_resize is true.  Otherwise set pixelwidth/height and
10315         call change_frame_size (Bug#9628).
10317 2011-09-30  Paul Eggert  <eggert@cs.ucla.edu>
10319         Port --enable-checking=all to Fedora 14 x86-64.
10320         * charset.c (syms_of_charset): Also account for glibc malloc's
10321         internal overhead when calculating the initial malloc maximum.
10323         Port --enable-checking=all to Fedora 14 x86.
10324         * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10325         Move to lisp.h.
10326         (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10327         (overrun_check_realloc, overrun_check_free):
10328         Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10329         That way, xmalloc returns a properly-aligned pointer even if
10330         XMALLOC_OVERRUN_CHECK is defined.  The old debugging code happened
10331         to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10332         * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10333         into account when calculating the initial malloc maximum.
10334         * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10335         Move here from alloc.c, so that charset.c can use it too.
10336         Properly align; the old code wasn't right for common 32-bit hosts
10337         when configured with --enable-checking=all.
10338         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10339         (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10341 2011-09-29  Eli Zaretskii  <eliz@gnu.org>
10343         * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
10344         use EDOM.
10346 2011-09-28  Eli Zaretskii  <eliz@gnu.org>
10348         * xdisp.c (compute_display_string_end): If there's no display
10349         string at CHARPOS, return -1.
10351         * bidi.c (bidi_fetch_char): When compute_display_string_end
10352         returns a negative value, treat the character as a normal
10353         character not covered by a display string.  (Bug#9624)
10355 2011-09-28  Juanma Barranquero  <lekktu@gmail.com>
10357         * lread.c (Fread_from_string): Fix typo in docstring.
10359 2011-09-27  Eli Zaretskii  <eliz@gnu.org>
10361         * xdisp.c (handle_invisible_prop): If invisible text ends on a
10362         newline, reseat the iterator instead of bidi-iterating there one
10363         character at a time.  (Bug#9610)
10364         (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10365         TO_CHARPOS if the bidi iterator is at base embedding level.
10367 2011-09-27  Andreas Schwab  <schwab@linux-m68k.org>
10369         * lread.c (readevalloop): Use correct code for NBSP.
10370         (read1): Likewise.  (Bug#9608)
10372 2011-09-25  Michael Albinus  <michael.albinus@gmx.de>
10374         * dbusbind.c (Fdbus_register_signal): When service is not
10375         registered, use nil in Vdbus_registered_objects_table.  (Bug#9581)
10377 2011-09-25  Glenn Morris  <rgm@gnu.org>
10379         * buffer.c (truncate-lines): Doc fix.
10381 2011-09-24  Chong Yidong  <cyd@stupidchicken.com>
10383         * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10384         (Fset_window_next_buffers): Doc fix.
10386 2011-09-24  Glenn Morris  <rgm@gnu.org>
10388         * minibuf.c (read_minibuf): Disable line truncation.  (Bug#5715)
10390 2011-09-24  Paul Eggert  <eggert@cs.ucla.edu>
10392         Fix minor problems found by static checking.
10393         * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
10394         * indent.c (Fvertical_motion): Fix == vs = typo.
10396 2011-09-24  Eli Zaretskii  <eliz@gnu.org>
10398         * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10399         Default value is now t.  Doc fix.
10401         * indent.c (Fvertical_motion): Compute and apply the overshoot
10402         logic when moving up, not only when moving down.  Fix the
10403         confusing name and values of the it_overshoot_expected variable;
10404         logic changes accordingly.  (Bug#9254) (Bug#9549)
10406         * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10407         CHARPOS is covered by a display string which includes newlines.
10408         (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10409         is covered by a display string with embedded newlines.
10411 2011-09-24  Michael Albinus  <michael.albinus@gmx.de>
10413         * dbusbind.c (Fdbus_register_signal): Add match rule to
10414         Vdbus_registered_objects_table.  (Bug#9581)
10415         (Fdbus_register_method, Vdbus_registered_objects_table):
10416         Fix docstring.
10418 2011-09-24  Jim Meyering  <meyering@redhat.com>
10420         do not ignore write error for any output size
10421         The previous change was incomplete.
10422         While it makes emacs --batch detect the vast majority of stdout
10423         write failures, errors were still ignored whenever the output size is
10424         k * (BUFSIZ+1) - 4.  E.g., on a system with BUFSIZ of 4096,
10425           $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10426               && echo FAIL: ignored write error
10427           FAIL: ignored write error
10428           $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10429               && echo FAIL: ignored write error
10430           FAIL: ignored write error
10431         * emacs.c (Fkill_emacs): Also test ferror.  (Bug#9574)
10433 2011-09-23  Andreas Schwab  <schwab@linux-m68k.org>
10435         * emacs.c (Fkill_emacs): In noninteractive mode exit
10436         non-successfully if a write error occurred on stdout.  (Bug#9574)
10438 2011-09-21  Eli Zaretskii  <eliz@gnu.org>
10440         * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10441         the xassert test.
10443         * dispextern.h (struct it): Update the comment documenting what
10444         can it->OBJECT be.
10446 2011-09-20  Eli Zaretskii  <eliz@gnu.org>
10448         * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10449         a display string, extend search for cursor position to end of row.
10450         (find_row_edges): If the row ends in a newline from a display
10451         string, increment its MATRIX_ROW_END_CHARPOS by one.  (Bug#9549)
10452         Handle the case of a display string with multiple newlines.
10453         (Fcurrent_bidi_paragraph_direction): Fix search for previous
10454         non-empty line.  Fixes confusing cursor motion with arrow keys at
10455         the beginning of a line that starts with whitespace.
10457 2011-09-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10459         * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10460         (bug#9493).
10462 2011-09-18  Chong Yidong  <cyd@stupidchicken.com>
10464         * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10465         boolean (Bug#9154).
10467 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
10469         * xdisp.c (display_line): Record maximum and minimum buffer
10470         positions even if no glyphs were produced (e.g., by a zero-width
10471         stretch).  Fixes bug#9530 on a TTY.  Under word-wrap, don't record
10472         buffer positions that will be removed from the glyph row because
10473         they don't fit.
10474         (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10475         column is beyond frame width: don't subtract 1 "pixel" when
10476         computing width of the stretch.
10477         (reseat_at_next_visible_line_start): Undo the change made on
10478         2011-09-17 that saved paragraph information and restored it after
10479         the call to `reseat'.  (Bug#9545)
10481 2011-09-18  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
10483         * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10484         and turn window cursor on if cleared (Bug#9415).
10486 2011-09-18  Andreas Schwab  <schwab@linux-m68k.org>
10488         * search.c (boyer_moore): Take unibyte characters from pattern
10489         literally.  (Bug#9458)
10491 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
10493         * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10495 2011-09-18  Paul Eggert  <eggert@cs.ucla.edu>
10497         Fix minor problem found by static checking.
10498         * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10499         initialized, to pacify gcc -Wuninitialized.
10501         * fileio.c: Report proper errno when syscall falls.
10502         (Finsert_file_contents): Save and restore errno,
10503         so that report_file_error outputs the correct diagnostic.
10504         (Fwrite_region) [CLASH_DETECTION]: Likewise.
10506 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
10508         * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10510 2011-09-17  Eli Zaretskii  <eliz@gnu.org>
10512         * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10513         2011-08-30T17:32:44Z!eliz@gnu.org.  (Bug#9530)
10515 2011-09-17  Eli Zaretskii  <eliz@gnu.org>
10517         * xdisp.c (reseat_at_next_visible_line_start): Keep information
10518         about the current paragraph and restore it after the call to reseat.
10520         * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10521         (bidi_find_paragraph_start): Search back for paragraph beginning
10522         at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10523         (bidi_move_to_visually_next): Only trigger paragraph-related
10524         computations when the last character is a newline or at EOB, not
10525         just any NEUTRAL_B.  (Bug#9470)
10527         * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10528         truncated lines if point is covered by a display string.  (Bug#9524)
10530 2011-09-16  Paul Eggert  <eggert@cs.ucla.edu>
10532         * xselect.c: Relax test for outgoing X longs (Bug#9498).
10533         (cons_to_x_long): New function.
10534         (lisp_data_to_selection_data): Use it.  Correct the test for
10535         short-versus-long data; it was negated.  Break out of vector
10536         loop, for efficiency, when a long datum is discovered.
10538 2011-09-16  Stefan Monnier  <monnier@iro.umontreal.ca>
10540         * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10542 2011-09-16  Eli Zaretskii  <eliz@gnu.org>
10544         * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10545         GCC PR/17406) by declaring this function with external scope.
10547 2011-09-15  Paul Eggert  <eggert@cs.ucla.edu>
10549         * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10550         Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10552 2011-09-15  Andreas Schwab  <schwab@linux-m68k.org>
10554         * editfns.c (Fformat): Correctly handle text properties on "%%".
10556 2011-09-15  Eli Zaretskii  <eliz@gnu.org>
10558         * xterm.c (x_draw_composite_glyph_string_foreground):
10559         * w32term.c (x_draw_composite_glyph_string_foreground):
10560         * term.c (encode_terminal_code):
10561         * composite.c (composition_update_it, get_composition_id):
10562         * xdisp.c (get_next_display_element)
10563         (fill_composite_glyph_string): Add comments about special meaning
10564         of TAB characters in a composition.
10566 2011-09-15  Paul Eggert  <eggert@cs.ucla.edu>
10568         * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
10569         This occurs when processing a multibyte format.
10570         Problem reported by Wolfgang Jenker.
10572 2011-09-15  Johan Bockgård  <bojohan@gnu.org>
10574         * xdisp.c (try_cursor_movement): Only check for exact match if
10575         cursor hpos found by set_cursor_from_row is valid.  (Bug#9495)
10577 2011-09-14  Paul Eggert  <eggert@cs.ucla.edu>
10579         Remove unused external symbols.
10580         * dispextern.h (calc_pixel_width_or_height): Remove decl.
10581         * xdisp.c (calc_pixel_width_or_height): Now static.
10582         * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10583         * indent.c (check_display_width):
10584         * w32term.c: Fix comment to match code.
10585         * xterm.c, xterm.h (x_catching_errors): Remove.
10587 2011-09-14  Paul Eggert  <eggert@cs.ucla.edu>
10589         * xselect.c: Use signed conversions more consistently (Bug#9498).
10590         (selection_data_to_lisp_data): Assume incoming selection data are
10591         signed integers, not unsigned.  This is to be consistent with
10592         outgoing selection data, which was modified to use signed integers
10593         in as part of the fix to Bug#9196 in response to Jan D.'s comment
10594         in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10595         expects long, not unsigned long.
10597 2011-09-14  Eli Zaretskii  <eliz@gnu.org>
10599         * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10600         computation of loop end.  Reported by Johan Bockgård
10601         <bojohan@gnu.org>.
10603 2011-09-13  Chong Yidong  <cyd@stupidchicken.com>
10605         * frame.c (Fother_visible_frames_p): Function deleted.
10607 2011-09-12  Eli Zaretskii  <eliz@gnu.org>
10609         * indent.c (compute_motion): Process display vector front to back
10610         rather than the other way around.  (Bug#2496)
10612 2011-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
10614         * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10616 2011-09-11  Chong Yidong  <cyd@stupidchicken.com>
10618         * minibuf.c (Fread_from_minibuffer): Doc fix.
10620 2011-09-11  Eli Zaretskii  <eliz@gnu.org>
10622         * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10623         2011-08-30T17:32:44Z!eliz@gnu.org.  (Bug#9475)
10625 2011-09-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10627         * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10628         value for non-existent files.
10630 2011-09-11  Eli Zaretskii  <eliz@gnu.org>
10632         * fileio.c (Finsert_file_contents): If the file cannot be opened,
10633         set its "size" to -1.  This will set the modtime_size field of
10634         the corresponding buffer to -1, which is what
10635         verify-visited-file-modtime expects for files that do not exist.
10636         (Bug#9139)
10638 2011-09-11  Paul Eggert  <eggert@cs.ucla.edu>
10640         * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10641         here ...
10642         * lisp.h: ... from here.  push_key_description is no longer
10643         defined in keyboard.c, so its declaration should not be in
10644         lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10645         logically belongs with push_key_description.
10647 2011-09-10  Paul Eggert  <eggert@cs.ucla.edu>
10649         * buffer.h: Include <sys/types.h> instead of <time.h>.
10650         Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10651         Problem reported by Herbert J. Skuhra.
10653 2011-09-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10655         * xml.c (parse_region): Make the parsing work for
10656         non-comment-starting XML files again (bug#9144).
10658 2011-09-10  Andreas Schwab  <schwab@linux-m68k.org>
10660         * image.c (gif_load): Fix calculation of bottom and right corner.
10661         (Bug#9468)
10663 2011-09-10  Eli Zaretskii  <eliz@gnu.org>
10665         * xdisp.c (MAX_DISP_SCAN): Decrease to 250.  Prevents sluggish
10666         redisplay in small windows.
10668 2011-09-09  Eli Zaretskii  <eliz@gnu.org>
10670         * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10672 2011-09-08  Martin Rudalics  <rudalics@gmx.at>
10674         * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10675         Operate on live windows only.
10677 2011-09-08  Juanma Barranquero  <lekktu@gmail.com>
10679         * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10681 2011-09-07  Eli Zaretskii  <eliz@gnu.org>
10683         * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10684         only under bidi iteration.
10686 2011-09-07  Jan Djärv  <jan.h.d@swipnet.se>
10688         * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10690 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
10692         isnan: Fix porting problem to Solaris 10 with bundled gcc.
10693         Without this fix, the command to link temacs failed due to an
10694         undefined symbol __builtin_isnan.  This is because
10695         /usr/include/iso/math_c99.h #defines isnan(x) to
10696         __builtin_isnan(x), but the bundled gcc, which identifies itself
10697         as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10698         a __builtin_isnan.
10699         * floatfns.c (isnan): #undef, and then #define to a clone of
10700         what's in data.c.
10701         (Fisnan): Always define, since it's always available now.
10702         (syms_of_floatfns): Always define isnan at the Lisp level.
10704 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
10706         * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10708 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
10710         * fileio.c: Fix bugs with large file offsets (Bug#9428).
10711         The previous code assumed that file offsets (off_t values) fit in
10712         EMACS_INT variables, which is not true on typical 32-bit hosts.
10713         The code messed up by falsely reporting buffer overflow in cases
10714         such as (insert-file-contents "big" nil 1 2) into an empty buffer
10715         when "big" contains more than 2**29 bytes, even though this
10716         inserts just one byte and does not overflow the buffer.
10717         (Finsert_file_contents): Store file offsets as off_t
10718         values, not as EMACS_INT values.  Check for overflow when
10719         converting between EMACS_INT and off_t.  When checking for
10720         buffer overflow or for overlap, take the offsets into account.
10721         Don't use EMACS_INT for small values where int suffices.
10722         When checking for overlap, fix a typo: ZV was used where
10723         ZV_BYTE was intended.
10724         (Fwrite_region): Don't assume off_t fits into 'long'.
10725         * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10727 2011-09-05  Michael Albinus  <michael.albinus@gmx.de>
10729         * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10731 2011-09-04  Paul Eggert  <eggert@cs.ucla.edu>
10733         sprintf-related integer and memory overflow issues (Bug#9412).
10735         * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
10736         (esprintf, exprintf, evxprintf): New functions.
10737         * keyboard.c (command_loop_level): Now EMACS_INT, not int.
10738         (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
10739         (modify_event_symbol): Do not assume that the length of
10740         name_alist_or_stem is safe to alloca and fits in int.
10741         (Fexecute_extended_command): Likewise for function name and binding.
10742         (Frecursion_depth): Wrap around reliably on integer overflow.
10743         * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10744         since some callers pass EMACS_INT values.
10745         (Fsingle_key_description): Don't crash if symbol name contains more
10746         than MAX_ALLOCA bytes.
10747         * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10748         (get_minibuffer): Arg is now EMACS_INT, not int.
10749         * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
10750         (esprintf, exprintf, evxprintf): New decls.
10751         * window.h (command_loop_level, minibuf_level): Reflect API changes.
10753         * dbusbind.c (signature_cat): New function.
10754         (xd_signature, Fdbus_register_signal):
10755         Do not overrun buffer; instead, report string overflow.
10757         * dispnew.c (add_window_display_history): Don't overrun buffer.
10758         Truncate instead; this is OK since it's just a log.
10760         * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10761         even if the time zone offset is outlandishly large.
10762         Don't mishandle offset == INT_MIN.
10764         * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
10765         when creating daemon; the previous buffer-overflow check was incorrect.
10767         * eval.c (verror): Simplify by rewriting in terms of evxprintf,
10768         which has the guts of the old verror function.
10770         * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
10771         use SAFE_ALLOCA instead.  Use esprintf to avoid int-overflow issues.
10773         * font.c: Include <float.h>, for DBL_MAX_10_EXP.
10774         (font_unparse_xlfd): Don't blindly alloca long strings.
10775         Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
10776         fits in int, when using sprintf.  Use single snprintf to count
10777         length of string rather than counting it via multiple sprintfs;
10778         that's simpler and more reliable.
10779         (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
10780         (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
10781         sprintf, in case result does not fit in int.
10783         * fontset.c (num_auto_fontsets): Now printmax_t, not int.
10784         (fontset_from_font): Print it.
10786         * frame.c (tty_frame_count): Now printmax_t, not int.
10787         (make_terminal_frame, set_term_frame_name): Print it.
10788         (x_report_frame_params): In X, window IDs are unsigned long,
10789         not signed long, so print them as unsigned.
10790         (validate_x_resource_name): Check for implausibly long names,
10791         and don't assume name length fits in 'int'.
10792         (x_get_resource_string): Don't blindly alloca invocation name;
10793         use SAFE_ALLOCA.  Use esprintf, not sprintf, in case result does
10794         not fit in int.
10796         * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10797         (xg_check_special_colors, xg_set_geometry):
10798         Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10800         * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10801         Use esprintf, not sprintf, in case result does not fit in int.
10803         * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10804         (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10805         it as a large positive number.
10806         (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10807         * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10809         * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10810         in case result does not fit in int.
10812         * print.c (float_to_string): Detect width overflow more reliably.
10813         (print_object): Make sprintf buffer a bit bigger, to avoid potential
10814         buffer overrun.  Don't assume list length fits in 'int'.  Treat
10815         print length of 0 as 0, not as infinity; to be consistent with other
10816         uses of print length in this function.  Don't overflow print length
10817         index.  Don't assume hash table size fits in 'long', or that
10818         vectorlike size fits in 'unsigned long'.
10820         * process.c (make_process): Use printmax_t, not int, to format
10821         process-name gensyms.
10823         * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10825         * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10826         to avoid potential buffer overrun.
10828         * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10829         if X resource line is longer than 512 bytes.
10831         * xfns.c (x_window): Make sprintf buffer a bit bigger
10832         to avoid potential buffer overrun.
10834         * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10836         * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10838 2011-09-04  Paul Eggert  <eggert@cs.ucla.edu>
10840         Integer overflow fixes for scrolling, etc.
10841         Without these, Emacs silently mishandles large integers sometimes.
10842         For example, "C-u 4294967297 M-x recenter" was treated as if
10843         it were "C-u 1 M-x recenter" on a typical 64-bit host.
10845         * xdisp.c (try_window_id): Check Emacs fixnum range before
10846         converting to 'int'.
10848         * window.c (window_scroll_line_based, Frecenter):
10849         Check that an Emacs fixnum is in range before assigning it to 'int'.
10850         (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10851         values converted from Emacs fixnums.
10852         (Frecenter): Don't wrap around a line count if it is out of 'int'
10853         range; instead, treat it as an extreme value.
10854         (Fset_window_configuration, compare_window_configurations):
10855         Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10857         * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10858         that can exceed INT_MAX.  Check that EMACS_INT value is in range
10859         before assigning it to the (possibly-narrower) index.
10860         (match_limit): Don't assume that a fixnum can fit in 'int'.
10862         * print.c (print_object): Use ptrdiff_t, not int, for index that can
10863         exceed INT_MAX.
10865         * indent.c (position_indentation): Now takes ptrdiff_t, not int.
10866         (Fvertical_motion): Don't wrap around LINES values that don't fit
10867         in 'int'.  Instead, treat them as extreme values.  This is good
10868         enough for windows, which can't have more than INT_MAX lines anyway.
10870 2011-09-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10872         * Require libxml/parser.h to avoid compilation warning.
10874         * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
10876         * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
10877         since this reportedly can destroy thread storage.
10879 2011-08-30  Chong Yidong  <cyd@stupidchicken.com>
10881         * syntax.c (find_defun_start): Update all cache variables if
10882         exiting early (Bug#9401).
10884 2011-08-30  Eli Zaretskii  <eliz@gnu.org>
10886         * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
10888         * xdisp.c (produce_stretch_glyph): No longer static, compiled also
10889         when HAVE_WINDOW_SYSTEM is not defined.  Support both GUI and TTY
10890         frames.  Call tty_append_glyph in the TTY case.  (Bug#9402)
10892         * term.c (tty_append_glyph): New function.
10893         (produce_stretch_glyph): Static function and its prototype deleted.
10895         * dispextern.h (produce_stretch_glyph, tty_append_glyph):
10896         Add prototypes.
10898 2011-08-29  Paul Eggert  <eggert@cs.ucla.edu>
10900         * image.c (parse_image_spec): Check for nonnegative, not for positive,
10901         when checking :margin (Bug#9390).
10902         (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
10903         Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
10904         so that the name doesn't mislead.  All uses changed.
10906 2011-08-28  Johan Bockgård  <bojohan@gnu.org>
10908         * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
10909         set_tty_hooks.
10911 2011-08-27  Eli Zaretskii  <eliz@gnu.org>
10913         * xdisp.c (move_it_to): Don't bail out early when reaching
10914         position beyond to_charpos, if we are scanning backwards.
10915         (move_it_vertically_backward): When DY == 0, make sure we get to
10916         the first character in the line after the newline.
10918 2011-08-27  Paul Eggert  <eggert@cs.ucla.edu>
10920         * ccl.c: Improve and simplify overflow checking (Bug#9196).
10921         (ccl_driver): Do not generate an out-of-range pointer.
10922         (Fccl_execute_on_string): Remove unnecessary check for
10923         integer overflow, noted by Stefan Monnier in
10924         <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
10925         Remove a FIXME that didn't need fixing.
10926         Simplify the newly-introduced buffer reallocation code.
10928 2011-08-27  Juanma Barranquero  <lekktu@gmail.com>
10930         * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
10932 2011-08-26  Paul Eggert  <eggert@cs.ucla.edu>
10934         Integer and memory overflow issues (Bug#9196).
10936         * doc.c (get_doc_string): Rework so that
10937         get_doc_string_buffer_size is the actual buffer size, rather than
10938         being 1 less than the actual buffer size; this makes xpalloc more
10939         convenient.
10941         * image.c (x_allocate_bitmap_record, cache_image):
10942         * xselect.c (Fx_register_dnd_atom):
10943         Simplify previous changes by using xpalloc.
10945         * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
10946         since either will do and ptrdiff_t is convenient with xpalloc.
10948         * charset.c (charset_table_size)
10949         (struct charset_sort_data.priority): Now ptrdiff_t.
10950         (charset_compare): Don't overflow if priorities differ greatly.
10951         (Fsort_charsets): Don't assume list length fits in int.
10952         Check for size-calculation overflow when allocating sort data.
10953         (syms_of_charset): Allocate an initial charset table that is
10954         just under 64 KiB, to avoid problems with glibc malloc and mmap.
10956         * cmds.c (internal_self_insert): Check for size-calculation overflow.
10958         * composite.h (struct composition.glyph_len): Now int, not unsigned.
10959         The actual value is always <= INT_MAX, and leaving it unsigned made
10960         overflow checking harder.
10962         * dispextern.h (struct glyph_matrix.rows_allocated)
10963         (struct face_cache.size): Now ptrdiff_t, for convenience in use
10964         with xpalloc.  The values are still always <= INT_MAX.
10966         * indent.c (compute_motion): Adjust to region_cache_forward sig change.
10968         * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
10969         (SAFE_NALLOCA): New macro.
10971         * region-cache.c (struct boundary.pos, find_cache_boundary)
10972         (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
10973         (set_cache_region, invalidate_region_cache)
10974         (revalidate_region_cache, know_region_cache, region_cache_forward)
10975         (region_cache_backward, pp_cache):
10976         Use ptrdiff_t, not EMACS_INT, since either will do.  This is needed
10977         so that ptrdiff_t * can be passed to xpalloc.
10978         (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
10979         beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
10980         (pp_cache): Don't assume cache_len fits in int.
10981         * region-cache.h: Adjust extern decls to match.
10983         * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
10984         EMACS_INT, since either will do, for xpalloc.
10986         * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
10987         (xnmalloc, xnrealloc, xpalloc): New functions.
10989         * bidi.c (bidi_shelve_header_size): New constant.
10990         (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
10991         (bidi_cache_ensure_space): Avoid integer overflow when allocating.
10993         * bidi.c (bidi_cache_shrink):
10994         * buffer.c (overlays_at, overlays_in, record_overlay_string)
10995         (overlay_strings):
10996         Don't update size of array until after memory allocation succeeds,
10997         because xmalloc/xrealloc may not return.
10998         (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
10999         now that we have proper integer overflow checking.
11000         (record_overlay_string, overlay_strings): Catch overflows when
11001         calculating size of overlay_str_buf.
11003         * callproc.c (Fcall_process): Check for size overflow when
11004         calculating size of args2.
11005         (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11006         Normally we prefer signed values, but sticking with ptrdiff_t would
11007         require adding more-complicated checks.
11009         * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11010         Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11011         Redo buffer-overflow calculations to avoid integer overflow.
11012         Add a FIXME comment where memory seems to be over-allocated.
11014         * character.c (Fstring): Check for size-calculation overflow.
11016         * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11017         unnecessary integer overflow.  Check for size overflow.
11018         (encode_coding_object): Don't update size until xmalloc succeeds.
11020         * composite.c (get_composition_id): Check for overflow in glyph
11021         length calculations.
11023         Integer and memory overflow fixes for display code.
11024         * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11025         * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11026         (scrolling_window): Check for overflow in size calculations.
11027         (line_draw_cost, realloc_glyph_pool, add_row_entry):
11028         Don't assume glyph table len fits in int.
11029         (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11030         (row_table_size): Now ptrdiff_t, not int.
11031         (scrolling_window): Avoid overflow in size calculations.
11032         Don't update size until allocation succeeds.
11033         * fns.c (concat): Check for overflow in size calculations.
11034         (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11035         * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11036         (NEXT_ALMOST_PRIME_LIMIT): New constant.
11038         * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11039         (get_doc_string): Check for size calculation overflow.
11040         Don't update size until allocation succeeds.
11041         (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11042         EMACS_INT, where ptrdiff_t will do.
11043         (Fsubstitute_command_keys): Check for string overflow.
11045         * editfns.c (set_time_zone_rule): Don't assume environment length
11046         fits in int.
11047         (message_length): Now ptrdiff_t, not int.
11048         (Fmessage_box): Don't update size until allocation succeeds.
11049         Don't assume message length fits in int.
11050         (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11052         * emacs.c (main): Do not reallocate argv, since there is a null at
11053         the end that can be overwritten, and this way there's no need to
11054         worry about size-calculation overflow.
11055         (sort_args): Check for size-calculation overflow.
11057         * eval.c (init_eval_once, grow_specpdl): Don't update size until
11058         alloc succeeds.
11059         (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11061         * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11062         (x_set_scroll_bar_width, x_figure_window_size):
11063         Check for integer overflow.
11064         (x_set_alpha): Do not assume XINT fits in int.
11066         * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11067         This is for the members text_lines, text_cols, total_lines, total_cols,
11068         where the system imposes an 'int' limit.
11070         * fringe.c (Fdefine_fringe_bitmap):
11071         Don't update size until alloc works.
11073         * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11074         (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11076         * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11077         Check for size-calculation overflow.
11078         (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11079         do, as we prefer signed integers.
11080         (id_to_widget.max_size, id_to_widget.used)
11081         (xg_store_widget_in_map, xg_remove_widget_from_map)
11082         (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11083         (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11084         Use and return ptrdiff_t, not int.
11085         (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11086         * gtkutil.h: Change prototypes to match the above.
11088         * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11089         are duplicate now that they've been promoted to lisp.h.
11090         (x_allocate_bitmap_record, x_alloc_image_color)
11091         (make_image_cache, cache_image, xpm_load):
11092         Don't update size until alloc is done.
11093         (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11094         (x_detect_edges):
11095         Check for size calculation overflow.
11096         (ct_colors_allocated_max): New constant.
11097         (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11098         overflow.
11100         * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11101         (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11102         (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11103         Use ptrdiff_t, not int, to count maps.
11104         (read_char_minibuf_menu_prompt): Check for overflow in size
11105         calculations.  Don't update size until allocation succeeds.
11106         Redo calculations to avoid overflow.
11107         * keyboard.h: Change prototypes to match the above.
11109         * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11110         to count maps.
11111         (current_minor_maps): Check for size calculation overflow.
11112         * keymap.h: Change prototypes to match the above.
11114         * lread.c (read1, init_obarray): Don't update size until alloc done.
11116         * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11117         (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11119         * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11120         Now ptrdiff_t, not int.
11121         * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11122         (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11124         * process.c (Fnetwork_interface_list): Check for overflow
11125         in size calculation.
11127         * region-cache.c (move_cache_gap): Check for size calculation overflow.
11129         * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11130         overflow.  Don't bother calling xmalloc when xrealloc will do.
11132         * search.c (Freplace_match): Check for size calculation overflow.
11133         (Fset_match_data): Don't assume list lengths fit in 'int'.
11135         * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11136         for command line length.  Do not attempt to address one before the
11137         beginning of an array, as that's not portable.
11139         * term.c (max_frame_lines): Remove; unused.
11140         (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11141         not int.
11142         (encode_terminal_code, calculate_costs): Check for size
11143         calculation overflow.
11144         (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11145         table lengths and related sizes.  Don't update size until alloc
11146         done.  Redo calculations to avoid overflow.
11147         (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11149         * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11150         subtracting pointers.
11151         (gobble_line): Check for overflow more carefully.  Don't update size
11152         until alloc done.
11154         * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11155         Don't update size until alloc done.
11156         Redo size calculations to avoid overflow.
11157         Check for size calculation overflow.
11158         (main) [DEBUG]: Fix typo in invoking tparam1.
11160         * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11161         Use ptrdiff_t, not int, for sizes.
11162         (store_mode_line_noprop_char): Don't update size until alloc done.
11164         * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11165         Use ptrdiff_t, not int, for sizes.
11166         (Finternal_make_lisp_face, cache_face):
11167         Check for size calculation overflow.
11168         (cache_face): Treat size calculation overflows as if they were
11169         memory exhaustion (the usual treatment), rather than aborting.
11171         * xfns.c (x_encode_text, x_set_name_internal)
11172         (Fx_change_window_property): Use ptrdiff_t, not int, to count
11173         sizes, since they can exceed INT_MAX in size.  Check for size
11174         calculation overflow.
11176         * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11177         (xg_select): Check for size calculation overflow.
11178         Don't update size until alloc done.
11180         * xrdb.c (get_environ_db): Don't assume path length fits in int,
11181         as sprintf is limited to int lengths.
11183         * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11184         (X_LONG_MIN): New macros.
11185         Use them to make the following changes clearer.
11186         (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11187         This change doesn't affect the value now, but it may help remind
11188         future maintainers not to raise the value too much later.
11189         (SELECTION_QUANTUM): Remove, replacing with ...
11190         (selection_quantum): ... new function, which avoids overflow.
11191         All uses changed.
11192         (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11193         assumption that selection length fits in 'int'.
11194         (x_reply_selection_request, x_handle_selection_request)
11195         (x_get_window_property, receive_incremental_selection)
11196         (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11197         (lisp_data_to_selection_data, clean_local_selection_data):
11198         Use ptrdiff_t, not int, to record length of selection.
11199         (x_reply_selection_request, x_get_window_property)
11200         (receive_incremental_selection, x_property_data_to_lisp):
11201         Redo calculations to avoid overflow.
11202         (x_reply_selection_request): When sending hint, ceiling it at
11203         X_LONG_MAX rather than relying on wraparound overflow to send
11204         something.
11205         (x_get_window_property, receive_incremental_selection)
11206         (lisp_data_to_selection_data, x_property_data_to_lisp):
11207         Check for size-calculation overflow.
11208         (x_get_window_property, receive_incremental_selection)
11209         (lisp_data_to_selection_data, Fx_register_dnd_atom):
11210         Don't store size until memory allocation succeeds.
11211         (x_get_window_property): Plug memory leak on memory exhaustion.
11212         Don't double-block input; malloc is safe here.  Don't assume 2**34
11213         - 4 fits in unsigned long.  Add an xassert to check
11214         XGetWindowProperty overflow.  Be more careful about overflow
11215         calculations, and distinguish size from memory overflow better.
11216         (receive_incremental_selection): When tracing, don't assume
11217         unsigned int is less than INT_MAX.
11218         (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11219         harmful) conversions of unsigned short to int.
11220         (lisp_data_to_selection_data): Don't assume that integers
11221         in the range -65535 through -1 fit in an X unsigned short.
11222         Don't assume that ULONG_MAX == X_ULONG_MAX.  Don't store into
11223         result parameters unless successful.  Rely on cons_to_unsigned
11224         to report problems with elements; the old code wasn't right anyway.
11225         (x_check_property_data): Check for int overflow; we cannot use
11226         a wider type due to X limits.
11227         (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11229         * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
11231         * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11232         (x_term_init): Check for size calculation overflow.
11233         (x_color_cells): Don't store size until memory allocation succeeds.
11234         (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
11235         Don't assume alloca size is less than MAX_ALLOCA.
11236         (x_term_init): Don't assume length fits in int (sprintf is limited
11237         to int size).
11239         Use ptrdiff_t for composition IDs.
11240         * character.c (lisp_string_width):
11241         * composite.c (composition_table_size, n_compositions)
11242         (get_composition_id, composition_gstring_from_id):
11243         * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11244         * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11245         * window.c (Frecenter):
11246         Use ptrdiff_t, not int, for composition IDs.
11247         * composite.c (get_composition_id): Check for integer overflow.
11248         * composite.h: Adjust prototypes to match the above changes.
11250         Use ptrdiff_t for hash table indexes.
11251         * category.c (hash_get_category_set):
11252         * ccl.c (ccl_driver):
11253         * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11254         * coding.c (coding_system_charset_list, detect_coding_system):
11255         * coding.h (struct coding_system.id):
11256         * composite.c (get_composition_id, gstring_lookup_cache):
11257         * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11258         * image.c (xpm_get_color_table_h):
11259         * lisp.h (hash_lookup, hash_put):
11260         * minibuf.c (Ftest_completion):
11261         Use ptrdiff_t for hash table indexes, not int (which is too
11262         narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11263         32-bit --with-wide-int hosts).
11265         * charset.c (Fdefine_charset_internal): Check for integer overflow.
11266         Add a FIXME comment about memory leaks.
11267         (syms_of_charset): Don't assume xmalloc returns.
11269         Don't assume that stated character widths fit in int.
11270         * character.c (Fchar_width, c_string_width, lisp_string_width):
11271         * character.h (CHAR_WIDTH):
11272         * indent.c (MULTIBYTE_BYTES_WIDTH):
11273         Use sanitize_char_width to avoid undefined and/or bad behavior
11274         with outlandish widths.
11275         * character.h (sanitize_tab_width): Rename from sanitize_width,
11276         now that we have two such functions.  All uses changed.
11277         (sanitize_char_width): New inline function.
11279         Don't assume that tab-width fits in int.
11280         * character.h (sanitize_width): New inline function.
11281         (SANE_TAB_WIDTH): New macro.
11282         (ASCII_CHAR_WIDTH): Use it.
11283         * indent.c (sane_tab_width): Remove.  All uses replaced by
11284         SANE_TAB_WIDTH (current_buffer).
11285         * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11287         * fileio.c: Integer overflow issues with file modes.
11288         (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11290         * charset.c (read_hex): New arg OVERFLOW.  All uses changed.
11291         Remove unreachable code.
11292         (read_hex, load_charset_map_from_file): Check for integer overflow.
11294         * xterm.c: Don't go over XClientMessageEvent limit.
11295         (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11296         (x_send_scroll_bar_event): Likewise.  Check that the size does not
11297         exceed limits imposed by XClientMessageEvent, as well as the usual
11298         ptrdiff_t and size_t limits.
11300         * keyboard.c: Overflow, signedness and related fixes.
11301         (make_lispy_movement): Use same integer type in forward decl
11302         that is used in the definition.
11303         (read_key_sequence, keyremap_step):
11304         Change bufsize argument back to int, undoing my 2011-03-30 change.
11305         We prefer signed types, and int is wide enough here.
11306         (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11307         than TYPE_MAXIMUM (EMACS_INT) / 2.  Don't let the label size grow
11308         larger than STRING_BYTES_BOUND.  Use ptrdiff_t for Emacs string
11309         length, not size_t.  Use ptrdiff_t for index, not int.
11310         (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11311         possibility of integer overflow.
11313         Overflow, signedness and related fixes for images.
11315         * dispextern.h (struct it.stack[0].u.image.image_id)
11316         (struct_it.image_id, struct image.id, struct image_cache.size)
11317         (struct image_cache.used, struct image_cache.ref_count):
11318         * gtkutil.c (update_frame_tool_bar):
11319         * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11320         (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11321         (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11322         * nsmenu.m (update_frame_tool_bar):
11323         * xdisp.c (calc_pixel_width_or_height):
11324         * xfns.c (image_cache_refcount):
11325         Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11326         on typical 64-bit hosts.
11328         * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11329         (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11330         Omit unnecessary casts to int.
11331         (parse_image_spec): Check that integers fall into 'int' range
11332         when the callers expect that.
11333         (image_ascent): Redo ascent calculation to avoid int overflow.
11334         (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11335         (lookup_image): Remove unnecessary tests.
11336         (xbm_image_p): Locals are now of int, not EMACS_INT,
11337         since parse_image_check makes sure they fit into int.
11338         (png_load, gif_load, svg_load_image):
11339         Prefer int to unsigned where either will do.
11340         (tiff_handler): New function, combining the cores of the
11341         old tiff_error_handler and tiff_warning_handler.
11342         This function is rewritten to use vsnprintf and thereby avoid
11343         stack buffer overflows.  It uses only the features of vsnprintf
11344         that are common to both POSIX and native Microsoft.
11345         (tiff_error_handler, tiff_warning_handler): Use it.
11346         (tiff_load, gif_load, imagemagick_load_image):
11347         Don't assume :index value fits in 'int'.
11348         (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11349         (imagemagick_load_image): Check that crop parameters fit into
11350         the integer types that MagickCropImage accepts.  Don't assume
11351         Vimagemagick_render_type has a nonnegative value.  Don't assume
11352         size_t fits in 'long'.
11353         (gs_load): Use printmax_t to print the widest integers possible.
11354         Check for integer overflow when computing image height and width.
11356 2011-08-26  Eli Zaretskii  <eliz@gnu.org>
11358         * xdisp.c (redisplay_window): Don't force window start if point
11359         will be invisible in the resulting window.  (Bug#9324)
11361 2011-08-25  Eli Zaretskii  <eliz@gnu.org>
11363         * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11364         the display spec is of the form `(space ...)'.
11365         (handle_display_spec): Return the value returned by
11366         handle_single_display_spec, not just 1 or zero.
11367         (handle_single_display_spec): If the display spec is of the form
11368         `(space ...)', and specifies display in the text area, return 2
11369         rather than 1.
11370         (try_cursor_movement): Check for the need to scroll more
11371         accurately, and prefer exact match for point under bidi.
11372         Don't advance `row' beyond the last row of the window.
11374         * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11375         into disp_prop; all users changed.
11377         * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11378         DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11379         for the text covered by the display property.
11381 2011-08-25  Chong Yidong  <cyd@stupidchicken.com>
11383         * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11384         Change return value to nil.
11385         (Frecord_buffer): Delete unused function.
11387 2011-08-24  Eli Zaretskii  <eliz@gnu.org>
11389         * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11390         buffers, return left-to-right.
11391         (set_cursor_from_row): Consider candidate row a win if its glyph
11392         represents a newline and point is on that newline.  Fixes cursor
11393         positioning on the newline at EOL of R2L text within L2R
11394         paragraph, and vice versa.
11395         (try_cursor_movement): Check continued rows, in addition to
11396         continuation rows.  Fixes unwarranted scroll when point enters a
11397         continued line of R2L text within an L2R paragraph, or vice versa.
11398         (cursor_row_p): Consider the case of point being equal to
11399         MATRIX_ROW_END_CHARPOS.  Prevents cursor being stuck when moving
11400         from the end of a short line to the beginning of a continued line
11401         of R2L text within L2R paragraph.
11402         (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11403         composed characters.
11405         * bidi.c (bidi_check_type): Use xassert.
11406         (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11407         members.
11409 2011-08-23  Eli Zaretskii  <eliz@gnu.org>
11411         * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11412         a character.
11414 2011-08-23  Chong Yidong  <cyd@stupidchicken.com>
11416         * nsfont.m (ns_otf_to_script): Fix typo.
11418 2011-08-22  Kenichi Handa  <handa@m17n.org>
11420         * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11421         extra slot even if the purpose is char-code-property-table.
11423 2011-08-23  Eli Zaretskii  <eliz@gnu.org>
11425         * xdisp.c (redisplay_window): When computing centering_position,
11426         account for the height of the header line.  (Bug#8874)
11428         * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11429         instead of CHAR_TO_BYTE.  Fixes a crash when a completion
11430         candidate is selected by the mouse, and that candidate has a
11431         composed character under the mouse.
11433         * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1.  Fixes pixel
11434         coordinates reported by pos-visible-in-window-p for a composed
11435         character in column zero.
11437 2011-08-23  Stefan Monnier  <monnier@iro.umontreal.ca>
11439         * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11441 2011-08-22  Eli Zaretskii  <eliz@gnu.org>
11443         * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11444         consider it a hit if to_charpos is anywhere in the range of the
11445         composed buffer positions.
11447 2011-08-22  Chong Yidong  <cyd@stupidchicken.com>
11449         * image.c (gif_load): Don't assume that each subimage has the same
11450         dimensions as the base image.  Handle disposal method that is
11451         "undefined" by the gif spec (Bug#9335).
11453 2011-08-20  Chong Yidong  <cyd@stupidchicken.com>
11455         * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
11456         (Fcondition_case): Document `debug' symbol in error handler.
11458 2011-08-19  Eli Zaretskii  <eliz@gnu.org>
11460         * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11461         face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11462         from an Org mode buffer to a Speedbar frame.
11464         * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11465         a composition, take its buffer position from IT->cmp_it.charpos.
11466         Fixes cursor positioning at the beginning of a line that begins
11467         with a composed character.
11469 2011-08-18  Eli Zaretskii  <eliz@gnu.org>
11471         * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11472         character bidirectional type, use STRONG_L instead.  Fixes crashes
11473         in a buffer produced by `describe-categories'.
11475         * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11476         members before the level stack, so they would be saved and
11477         restored when copying iterator state.  Fixes incorrect reordering
11478         around TABs covered by display properties.
11480 2011-08-18  Andreas Schwab  <schwab@linux-m68k.org>
11482         * process.c (Fnetwork_interface_list): Correctly determine buffer size.
11484 2011-08-17  Chong Yidong  <cyd@stupidchicken.com>
11486         * eval.c (internal_condition_case, internal_condition_case_1)
11487         (internal_condition_case_2, internal_condition_case_n):
11488         Remove unnecessary aborts (Bug#9081).
11490 2011-08-17  Eli Zaretskii  <eliz@gnu.org>
11492         * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11493         has no `load' handler, try opening the file locally.  (Bug#9311)
11495 2011-08-16  Ken Brown  <kbrown@cornell.edu>
11497         * gmalloc.c: Expand comment.
11499 2011-08-16  Eli Zaretskii  <eliz@gnu.org>
11501         * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11502         if it fails the cursor_row_p test.  Fixes cursor positioning at ZV.
11504 2011-08-16  Ken Brown  <kbrown@cornell.edu>
11506         Fix memory allocation problems in Cygwin build (Bug#9273).
11508         * unexcw.c ( __malloc_initialized): Declare external variable.
11509         (fixup_executable): Force the dumped emacs to reinitialize malloc.
11511         * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11512         New variables.
11513         (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11514         dumped emacs.
11515         (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11516         in the static heap.
11517         [CYGWIN] (special_realloc): New function.
11518         (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11519         requests to realloc storage in the static heap.
11521 2011-08-15  Paul Eggert  <eggert@cs.ucla.edu>
11523         * bidi.c (bidi_initialize): Remove unused local.
11525 2011-08-15  Eli Zaretskii  <eliz@gnu.org>
11527         * bidimirror.h:
11528         * biditype.h: Remove file.
11529         * makefile.w32-in ($(BLD)/bidi.$(O)):
11530         * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
11532         * dispextern.h: Fix a typo in the comment to bidi_type_t.
11534         * chartab.c: Improve commentary for the uniprop_table API.
11536         * bidi.c (bidi_paragraph_init): Support zero value of
11537         bidi_ignore_explicit_marks_for_paragraph_level.
11538         (bidi_initialize): Use uniprop_table instead of including
11539         biditype.h and bidimirror.h.
11541         * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11542         coordinates of the iterator when restoring from ppos_it.
11543         (Bug#9296)
11545 2011-08-14  Kenichi Handa  <handa@m17n.org>
11547         * process.c (create_process): Call setup_process_coding_systems
11548         after the pid of the process is set to -1 (Bug#8162).
11550 2011-08-14  Eli Zaretskii  <eliz@gnu.org>
11552         * xdisp.c (move_it_in_display_line_to): Don't invoke
11553         IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11554         ppos_it.  Fixes vertical cursor motion when line beginning is
11555         covered by an image.  (Bug#9296)
11557 2011-08-14  Jan Djärv  <jan.h.d@swipnet.se>
11559         * nsterm.h (ns_run_ascript): Declare.
11560         (NSAPP_DATA2_RUNASSCRIPT): Define.
11562         * nsfns.m (as_script, as_result, as_status): New static variables.
11563         (ns_run_ascript): New function.
11564         (Fns_do_applescript): Set variables as_*.  Make an NSApplicationDefined
11565         event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11566         the event loop.  Get status from as_status (Bug#7276).
11568         * nsterm.m (sendEvent): If event is NSApplicationDefined and
11569         data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11570         the event loop (Bug#7276).
11572 2011-08-14  Andreas Schwab  <schwab@linux-m68k.org>
11574         * gnutls.c (QCgnutls_bootprop_priority)
11575         (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11576         (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11577         (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11578         (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11579         (QCgnutls_bootprop_verify_hostname_error)
11580         (QCgnutls_bootprop_callbacks_verify): Rename from
11581         Qgnutls_bootprop_..., all uses changed.
11583         * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11584         uses changed.
11586 2011-08-14  Paul Eggert  <eggert@cs.ucla.edu>
11588         * xfaces.c (Qframe_set_background_mode): Now static.
11589         * dispextern.h (Qframe_set_background_mode): Remove decl.
11591         * process.c (Fnetwork_interface_info): Declare local only if needed.
11593 2011-08-13  Jan Djärv  <jan.h.d@swipnet.se>
11595         * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11596         (Fnetwork_interface_list): Allocate in increments of bytes instead
11597         of sizeof (struct ifreq).  Iterate over ifconf.ifc_req by counting
11598         bytes (Bug#8477).  Count bytes correctly when ifr_addr is a struct
11599         sockaddr.
11600         (struct ifflag_def): notrailers is smart on OSX.
11601         (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11602         Get hardware address with getifaddrs if available.
11604 2011-08-12  Eli Zaretskii  <eliz@gnu.org>
11606         * xdisp.c (iterate_out_of_display_property): xassert that
11607         IT->position is set to within IT->object's boundaries.  Break from
11608         the loop as soon as EOB is reached; avoids infloops in redisplay
11609         when IT->position is set up wrongly due to some bug.
11610         Set IT->current to match the bidi iterator unconditionally.
11611         (push_display_prop): Allow GET_FROM_STRING as IT->method on
11612         entry.  Force push_it to save on the stack the current
11613         buffer/string position, to be restored by pop_it.  Fix flags in
11614         the iterator structure wrt the object coming from a display
11615         property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11616         properties.  (Bug#9284)
11618 2011-08-09  Andreas Schwab  <schwab@linux-m68k.org>
11620         * fontset.c (fontset_get_font_group): Add proper type checks.
11621         (Bug#9172)
11623 2011-08-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
11625         * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11626         and LC_VERSION_MIN_MACOSX.
11627         (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11628         (dump_it) [LC_FUNCTION_STARTS]: Use it.
11630 2011-08-08  Eli Zaretskii  <eliz@gnu.org>
11632         * xdisp.c (forward_to_next_line_start): Allow to use the
11633         no-display-properties-and-no-overlays under bidi display.
11634         Set disp_pos in the bidi iterator to avoid searches for display
11635         properties and overlays.
11637 2011-08-08  Chong Yidong  <cyd@stupidchicken.com>
11639         * editfns.c (Fset_time_zone_rule): Document relationship with the
11640         setenv function.
11642         * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11643         the font entity extracted from the cache (Bug#8109).
11645 2011-08-07  Chong Yidong  <cyd@stupidchicken.com>
11647         * composite.c (autocmp_chars): Don't reset point.  That is done by
11648         restore_point_unwind (Bug#5984).
11650 2011-08-07  Juri Linkov  <juri@jurta.org>
11652         * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11653         to show the arg `TIME' instead of `TIMEVAL'.
11655 2011-08-06  Eli Zaretskii  <eliz@gnu.org>
11657         * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11658         display property strides EOL and includes a newline, as in
11659         longlines-mode.  (Bug#9254)
11660         (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11661         word-wrap under bidirectional display.  (Bug#9224)
11663         * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11664         is non-zero, even if the data buffer is NULL.  Fixes a crash in
11665         vertical-motion with longlines-mode.  (Bug#9254)
11667 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
11669         * bidi.c <bidi_cache_total_alloc>: Now static.
11670         (bidi_initialize): Initialize bidi_cache_total_alloc.
11672         * xdisp.c (display_line): Release buffer allocated for shelved bidi
11673         cache.  (Bug#9221)
11675         * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11676         amount allocated this far in `bidi_cache_total_alloc'.
11677         (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11678         non-zero, only free the data buffer without restoring the cache
11679         contents.  All callers changed.
11681         * dispextern.h (bidi_unshelve_cache): Update prototype.
11683         * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11684         (move_it_in_display_line, move_it_to)
11685         (move_it_vertically_backward, move_it_by_lines): Replace the call
11686         to xfree to an equivalent call to bidi_unshelve_cache.
11687         (move_it_in_display_line_to): Fix logic of returning
11688         MOVE_POS_MATCH_OR_ZV in the bidi case.  (Bug#9224)
11690 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
11692         * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11693         came from a string character with a `cursor' property.  (Bug#9229)
11695 2011-08-04  Jan Djärv  <jan.h.d@swipnet.se>
11697         * Makefile.in (LIB_PTHREAD): New variable.
11698         (LIBES): Add LIB_PTHREAD (Bug#9216).
11700         * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11701         Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11703 2011-08-04  Andreas Schwab  <schwab@linux-m68k.org>
11705         * regex.c (re_iswctype): Remove some redundant boolean conversions.
11707 2011-08-04  Jan Djärv  <jan.h.d@swipnet.se>
11709         * xterm.c (x_find_topmost_parent): New function.
11710         (x_set_frame_alpha): Find topmost parent window with
11711         x_find_topmost_parent and set the property there also (bug#9181).
11712         (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11714 2011-08-04  Paul Eggert  <eggert@cs.ucla.edu>
11716         * callproc.c (Fcall_process): Avoid vfork clobbering
11717         the local vars buffer, coding_systems, current_dir.
11719 2011-08-03  Stefan Monnier  <monnier@iro.umontreal.ca>
11721         * keymap.c (Fmake_composed_keymap): Move to subr.el.
11723 2011-08-03  Paul Eggert  <eggert@cs.ucla.edu>
11725         * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11726         so that it is not optimized away.
11728         * xdisp.c (compute_display_string_pos): Remove unused local.
11730 2011-08-02  Eli Zaretskii  <eliz@gnu.org>
11732         Fix slow cursor motion and scrolling in large buffers with
11733         selective display, like Org Mode buffers.  (Bug#9218)
11735         * dispextern.h (struct bidi_it): New member disp_prop_p.
11737         * xdisp.c: Remove one-slot cache of display string positions.
11738         (compute_display_string_pos): Accept an additional argument
11739         DISP_PROP_P; callers changed.  Scan at most 5K characters forward
11740         for a display string or property.  If found, set DISP_PROP_P
11741         non-zero.
11743         * bidi.c (bidi_fetch_char): Accept an additional argument
11744         DISP_PROP_P, and pass it to compute_display_string_pos.
11745         Only handle text covered by a display string if DISP_PROP_P is returned
11746         non-zero.  All callers of bidi_fetch_char changed.
11748 2011-08-02  Stefan Monnier  <monnier@iro.umontreal.ca>
11750         * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11752 2010-12-03  Don March  <don@ohspite.net>
11754         * keymap.c (Fdefine_key): Fix non-prefix key error message when
11755         last character M-[char] is translated to ESC [char] (bug#7541).
11757 2011-08-02  Kenichi Handa  <handa@m17n.org>
11759         * lisp.h (uniprop_table): Extern it.
11761         * chartab.c (uniprop_table): Make it non-static.
11763 2011-08-01  Eli Zaretskii  <eliz@gnu.org>
11765         * xdisp.c (forward_to_next_line_start): Accept additional argument
11766         BIDI_IT_PREV, and store into it the state of the bidi iterator had
11767         on the newline.
11768         (reseat_at_next_visible_line_start): Use the bidi iterator state
11769         returned by forward_to_next_line_start to restore the state of
11770         it->bidi_it after backing up to previous newline.  (Bug#9212)
11772 2011-07-30  Andreas Schwab  <schwab@linux-m68k.org>
11774         * regex.c (re_comp): Protoize.
11775         (re_exec): Fix return type.
11776         (regexec): Fix type of `ret'.  (Bug#9203)
11778 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
11780         * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
11781         This is needed if max-image-size is a floating-point number.
11783 2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
11785         * print.c (print_object): Print empty symbol as ##.
11787         * lread.c (read1): Read ## as empty symbol.
11789 2011-07-28  Alp Aker  <alp.tekin.aker@gmail.com>
11791         * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
11792         setting frame foreground color (Bug#9175).
11793         (x_set_background_color): Likewise.
11795         * nsmenu.m (-setText): Size tooltip dimensions precisely to
11796         contents (Bug#9176).
11797         (EmacsTooltip -init): Remove bezels and add shadows to
11798         tooltip windows.
11800         * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11801         or scroll bar (Bug#8470).
11803         * nsfont.m (nsfont_open): Remove assignment to voffset and
11804         unnecessary vars hshink, expand, hd, full_height, min_height.
11805         (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11807         * nsterm.h (nsfont_info): Remove voffset field.
11809 2011-07-28  Alp Aker  <alp.tekin.aker@gmail.com>
11811         Implement strike-through and overline on NextStep (Bug#8863).
11813         * nsfont.m (nsfont_open): Use underline position provided by font,
11814         instead of hard-coded value of 2.
11815         (nsfont_draw): Call ns_draw_text_decoration instead.
11817         * nsterm.h: Add declaration for ns_draw_text_decoration.
11819         * nsterm.m (ns_draw_text_decoration): New function for drawing
11820         underline, overline, and strike-through.
11821         (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11822         ns_draw_text_decoration.  Change treatment of cursor drawing to
11823         accommodate underlining, etc.
11825 2011-07-28  Eli Zaretskii  <eliz@gnu.org>
11827         * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11828         default.
11830 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
11832         * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11833         Without this fix, if a signal arrives just after memory fills up,
11834         'malloc' might be invoked reentrantly.
11836         * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11837         In other words, assume that every image size is allowed, on non-X
11838         hosts.  This assumption is probably wrong, but it lets Emacs compile.
11840 2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
11842         * regex.c (re_iswctype): Convert return values to boolean.
11844 2011-07-28  Eli Zaretskii  <eliz@fencepost.gnu.org>
11846         * xdisp.c (compute_display_string_pos): Don't use cached display
11847         string position if the buffer had its restriction changed.
11848         (Bug#9184)
11850 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
11852         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11854 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
11856         Integer signedness and overflow and related fixes.  (Bug#9079)
11858         * bidi.c: Integer size and overflow fixes.
11859         (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11860         (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11861         (bidi_cache_find_level_change, bidi_cache_ensure_space)
11862         (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11863         (bidi_find_other_level_edge):
11864         Use ptrdiff_t instead of EMACS_INT where either will do.
11865         This works better on 32-bit hosts configured --with-wide-int.
11866         (bidi_cache_ensure_space): Check for size-calculation overflow.
11867         Use % rather than repeated addition, for better worst-case speed.
11868         Don't set bidi_cache_size until after xrealloc returns, because it
11869         might not return.
11870         (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
11871         (bidi_cache_ensure_space): Also check that the bidi cache size
11872         does not exceed that of the largest Lisp string or buffer.  See Eli
11873         Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
11875         * alloc.c (__malloc_size_t): Remove.
11876         All uses replaced by size_t.  See Andreas Schwab's note
11877         <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
11879         * image.c: Improve checking for integer overflow.
11880         (check_image_size): Assume that f is nonnull, since
11881         it is always nonnull in practice.  This is one less thing to
11882         worry about when checking for integer overflow later.
11883         (x_check_image_size): New function, which checks for integer
11884         overflow issues inside X.
11885         (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
11886         This removes the need for a memory_full check.
11887         (xbm_image_p): Rewrite to avoid integer multiplication overflow.
11888         (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
11889         (xbm_read_bitmap_data): Change locals back to 'int', since
11890         their values must fit in 'int'.
11891         (xpm_load_image, png_load, tiff_load):
11892         Invoke x_create_x_image_and_pixmap earlier,
11893         to avoid much needless work if the image is too large.
11894         (tiff_load): Treat overly large images as if
11895         x_create_x_image_and_pixmap failed, not as malloc failures.
11896         (gs_load): Use x_check_image_size.
11898         * gtkutil.c: Omit integer casts.
11899         (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
11900         (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
11902         * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
11904         * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
11905         Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
11906         would wrongly return t on a 64-bit host.
11908         * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
11909         The plain *_OVERFLOW macros run afoul of GCC bug 49705
11910         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
11911         and therefore cause GCC to emit a bogus diagnostic in some cases.
11913         * image.c: Integer signedness and overflow and related fixes.
11914         This is not an exhaustive set of fixes, but it's time to
11915         record what I've got.
11916         (lookup_pixel_color, check_image_size): Remove redundant decls.
11917         (check_image_size): Don't assume that arbitrary EMACS_INT values
11918         fit in 'int', or that arbitrary 'double' values fit in 'int'.
11919         (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
11920         (tiff_load, imagemagick_load_image):
11921         Check for overflow in size calculations.
11922         (x_create_x_image_and_pixmap): Remove unnecessary test for
11923         xmalloc returning NULL; that can't happen.
11924         (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
11925         (xpm_color_bucket): Use better integer hashing function.
11926         (xpm_cache_color): Don't possibly over-allocate memory.
11927         (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
11928         (gif_memory_source):
11929         Use ptrdiff_t, not int or size_t, to record sizes.
11930         (png_load): Don't assume values greater than 2**31 fit in 'int'.
11931         (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
11932         either works, as we prefer signed integers.
11933         (tiff_read_from_memory, tiff_write_from_memory):
11934         Return tsize_t, not size_t, since that's what the TIFF API wants.
11935         (tiff_read_from_memory): Don't fail simply because the read would
11936         go past EOF; instead, return a short read.
11937         (tiff_load): Omit no-longer-needed casts.
11938         (Fimagemagick_types): Don't assume size fits into 'int'.
11940         Improve hashing quality when configured --with-wide-int.
11941         * fns.c (hash_string): New function, taken from sxhash_string.
11942         Do not discard information about ASCII character case; this
11943         discarding is no longer needed.
11944         (sxhash-string): Use it.  Change sig to match it.  Caller changed.
11945         * lisp.h: Declare it.
11946         * lread.c (hash_string): Remove, since we now use fns.c's version.
11947         The fns.c version returns a wider integer if --with-wide-int is
11948         specified, so this should help the quality of the hashing a bit.
11950         * emacs.c: Integer overflow minor fix.
11951         (heap_bss_diff): Now uprintmax_t, not unsigned long.  All used changed.
11952         Define only if GNU_LINUX.
11953         (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
11955         * dispnew.c: Integer signedness and overflow fixes.
11956         Remove unnecessary forward decls, that were a maintenance hassle.
11957         (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
11958         All uses changed.
11959         (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
11960         (scrolling_window): Use ptrdiff_t, not int, for byte count.
11961         (prepare_desired_row, line_draw_cost):
11962         Use int, not unsigned, where either works.
11963         (save_current_matrix, restore_current_matrix):
11964         Use ptrdiff_t, not size_t, where either works.
11965         (init_display): Check for overflow more accurately, and without
11966         relying on undefined behavior.
11968         * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
11969         Remove, replacing with the new symbols in lisp.h.  All uses changed.
11970         * fileio.c (make_temp_name):
11971         * filelock.c (lock_file_1, lock_file):
11972         * xdisp.c (message_dolog):
11973         Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
11974         Use pMd etc. instead.
11975         * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
11976         replacing the pWIDE etc. symbols removed from editfns.c.
11978         * keyboard.h (num_input_events): Now uintmax_t.
11979         This is (very slightly) less likely to mess up due to wraparound.
11980         All uses changed.
11982         * buffer.c: Integer signedness fixes.
11983         (alloc_buffer_text, enlarge_buffer_text):
11984         Use ptrdiff_t rather than size_t when either will do, as we prefer
11985         signed integers.
11987         * alloc.c: Integer signedness and overflow fixes.
11988         Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
11989         (__malloc_size_t): Default to size_t, not to int.
11990         (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
11991         (Fgarbage_collect, mark_object_loop_halt, mark_object):
11992         Prefer ptrdiff_t to size_t when either would do, as we prefer
11993         signed integers.
11994         (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
11995         (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
11996         Now const.  Initialize with values that are in range even if char
11997         is signed.
11998         (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
11999         (xmalloc_put_size, xmalloc_get_size): New functions.  All uses changed.
12000         These functions do the right thing with sizes > 2**32.
12001         (check_depth): Now ptrdiff_t, not int.
12002         (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12003         Adjust to new way of storing sizes.  Check for size overflow bugs
12004         in rest of code.
12005         (STRING_BYTES_MAX): Adjust to new overheads.  The old code was
12006         slightly wrong anyway, as it missed one instance of
12007         XMALLOC_OVERRUN_CHECK_OVERHEAD.
12008         (refill_memory_reserve): Omit needless cast to size_t.
12009         (mark_object_loop_halt): Mark as externally visible.
12011         * xselect.c: Integer signedness and overflow fixes.
12012         (Fx_register_dnd_atom, x_handle_dnd_message):
12013         Use ptrdiff_t, not size_t, since we prefer signed.
12014         (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12015         * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12016         x_dnd_atoms_size and x_dnd_atoms_length.
12018         * doprnt.c: Prefer signed to unsigned when either works.
12019         * eval.c (verror):
12020         * doprnt.c (doprnt):
12021         * lisp.h (doprnt):
12022         * xdisp.c (vmessage):
12023         Use ptrdiff_t, not size_t, when using or implementing doprnt,
12024         since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12025         prefer signed arithmetic to avoid comparison confusion.
12026         * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12027         but is a bit tricky.
12029         Assume freestanding C89 headers, string.h, stdlib.h.
12030         * data.c, doprnt.c, floatfns.c, print.c:
12031         Include float.h unconditionally.
12032         * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12033         limits.h, stddef.h, string.h.  Use memset instead of 'flood'.
12034         * regex.c: Likewise for stddef.h, string.h.
12035         (ISASCII): Remove; can assume it returns 1 now.  All uses removed.
12036         * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12037         * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12038         (STDC_HEADERS): Remove obsolete defines.
12039         * sysdep.c: Include limits.h unconditionally.
12041         Assume support for memcmp, memcpy, memmove, memset.
12042         * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12043         * regex.c (memcmp, memcpy):
12044         Remove; we assume C89 now.
12046         * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12047         (__malloc_safe_bcopy): Remove; no longer needed.
12049         * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
12050         Use EMACS_INT, not EMACS_UINT, for sizes.  The code works equally
12051         well either way, and we prefer signed to unsigned.
12053 2011-07-27  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12055         * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12056         closes the connection while we're reading (bug#9182).
12058 2011-07-25  Jan Djärv  <jan.h.d@swipnet.se>
12060         * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12061         are specified (Bug#9168).
12063 2011-07-25  Paul Eggert  <eggert@cs.ucla.edu>
12065         * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12066         Found by GCC static checking and --with-wide-int on a 32-bit host.
12068 2011-07-25  Eli Zaretskii  <eliz@gnu.org>
12070         * xdisp.c (compute_display_string_pos): Fix logic of caching
12071         previous display string position.  Initialize cached_prev_pos to
12072         -1.  Fixes slow-down at the beginning of a buffer.
12074 2011-07-24  Eli Zaretskii  <eliz@gnu.org>
12076         * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12077         for attrs[LFACE_FONTSET_INDEX].
12079 2011-07-23  Paul Eggert  <eggert@cs.ucla.edu>
12081         * xml.c (parse_region): Remove unused local
12082         that was recently introduced.
12084 2011-07-23  Eli Zaretskii  <eliz@gnu.org>
12086         * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12087         2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12089         * xdisp.c (move_it_in_display_line_to): Record the best matching
12090         position for TO_CHARPOS while scanning the line, and restore it on
12091         exit if none of the characters scanned was an exact match.
12092         Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
12093         when exact match is impossible due to invisible text, and the
12094         lines are truncated.
12096 2011-07-23  Jan Djärv  <jan.h.d@swipnet.se>
12098         * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12099         for OSX >= 10.7.
12101 2011-07-22  Eli Zaretskii  <eliz@gnu.org>
12103         Fix a significant slow-down of cursor motion with C-n, C-p,
12104         C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12105         auto-repeat under bidi redisplay in fontified buffers.
12106         * xdisp.c (compute_stop_pos_backwards): New function.
12107         (next_element_from_buffer): Call compute_stop_pos_backwards to
12108         find a suitable prev_stop when we find ourselves before
12109         base_level_stop.
12110         (reseat): Don't look for prev_stop, as that could mean a very long
12111         run.
12112         <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12113         <cached_disp_overlay_modiff>: Cache for last found display string
12114         position.
12115         (compute_display_string_pos): Return the cached position if asked
12116         about the same buffer in the same area of character positions, and
12117         the buffer wasn't changed since the time the display string
12118         position was cached.
12120 2011-07-22  Eli Zaretskii  <eliz@gnu.org>
12122         * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12123         is an integer, which is important for empty lines.  (Bug#9149)
12125 2011-07-22  Chong Yidong  <cyd@stupidchicken.com>
12127         * frame.c (Fmodify_frame_parameters): In tty case, update the
12128         default face if necessary (Bug#4238).
12130 2011-07-21  Chong Yidong  <cyd@stupidchicken.com>
12132         * editfns.c (Fstring_to_char): No need to explain what a character
12133         is in the docstring (Bug#6576).
12135 2011-07-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12137         * xml.c (parse_region): Make sure we always return a tree.
12139 2011-07-20  HAMANO Kiyoto  <khiker.mail@gmail.com>
12141         * xml.c (parse_region): If a document contains only comments,
12142         return that, too.
12144 2011-07-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12146         * xml.c (make_dom): Return comments, too.
12148 2011-07-19  Paul Eggert  <eggert@cs.ucla.edu>
12150         Port to OpenBSD.
12151         See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12152         and the surrounding thread.
12153         * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12154         rather than fgets, and retry after EINTR.  Otherwise, 'emacs
12155         --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12156         timer goes off.
12157         * s/openbsd.h (BROKEN_SIGIO): Define.
12158         * unexelf.c (unexec) [__OpenBSD__]:
12159         Don't update the .mdebug section of the Alpha COFF symbol table.
12161 2011-07-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12163         * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12164         (bug#8460).
12166 2011-07-18  Paul Eggert  <eggert@cs.ucla.edu>
12168         * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12169         This fixes some race conditions on the permissions of any newly
12170         created file.
12172         * alloc.c (valid_pointer_p): Use pipe, not open.
12173         This fixes some permissions issues when debugging.
12175         * fileio.c (Fcopy_file): Adjust mode if fchown fails.  (Bug#9002)
12176         If fchown fails to set both uid and gid, try to set just gid,
12177         as that is sometimes allowed.  Adjust the file's mode to eliminate
12178         setuid or setgid bits that are inappropriate if fchown fails.
12180 2011-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
12182         * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12183         to compare Lisp_Objects.
12184         * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12185         global_gnutls_log_level, don't mistake it for a Lisp_Object.
12186         (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12188 2011-07-17  Andreas Schwab  <schwab@linux-m68k.org>
12190         * lread.c (read_integer): Unread even EOF character.
12191         (read1): Likewise.  Properly record start position of symbol.
12193         * lread.c (read1): Read `#:' as empty uninterned symbol if no
12194         symbol character follows.
12196 2011-07-17  Paul Eggert  <eggert@cs.ucla.edu>
12198         * fileio.c (Fcopy_file): Pacify gcc re fchown.  (Bug#9002)
12199         This works around a problem with the previous change to Fcopy_file.
12200         Recent glibc declares fchown with __attribute__((warn_unused_result)),
12201         and without this change, GCC might complain about discarding
12202         fchown's return value.
12204 2011-07-16  Juanma Barranquero  <lekktu@gmail.com>
12206         * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12208 2011-07-16  Paul Eggert  <eggert@cs.ucla.edu>
12210         * fileio.c (Fcopy_file): Don't diagnose fchown failures.  (Bug#9002)
12212 2011-07-16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12214         * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12215         it's used from the C level.
12217         * process.c: Use the same condition for POLL_FOR_INPUT in both
12218         keyboard.c and process.c (bug#1858).
12220 2011-07-09  Lawrence Mitchell  <wence@gmx.li>
12222         * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12223         (Fgnutls_boot): Use it.
12225 2011-07-15  Andreas Schwab  <schwab@linux-m68k.org>
12227         * doc.c (Fsubstitute_command_keys): Revert last change.
12229 2011-07-15  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12231         * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12232         quotes the next character, and doesn't affect other longer
12233         sequences (bug#8935).
12235         * lread.c (syms_of_lread): Clarify that is isn't only
12236         `eval-buffer' and `eval-defun' that's affected by
12237         `lexical-binding' (bug#8460).
12239 2011-07-15  Eli Zaretskii  <eliz@gnu.org>
12241         * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
12242         bidi redisplay when a line includes both an image and is truncated.
12244 2011-07-14  Paul Eggert  <eggert@cs.ucla.edu>
12246         Fix minor problems found by static checking.
12247         * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12248         (elsz): Now a signed constant, not a size_t var.  We prefer signed
12249         types to unsigned, to avoid integer comparison confusion.  Without
12250         this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12251         "cannot optimize loop, the loop counter may overflow", a symptom
12252         of the confusion.
12253         * indent.c (Fvertical_motion): Mark locals as initialized.
12254         * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12256 2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12258         * search.c (Fre_search_backward): Mention `case-fold-search' in
12259         all the re_search_* functions (bug#8138).
12261         * keyboard.c (Fopen_dribble_file): Document when the file is
12262         closed (bug#8056).
12264 2011-07-14  Eli Zaretskii  <eliz@gnu.org>
12266         * bidi.c (bidi_dump_cached_states): Fix format of displaying
12267         bidi_cache_idx.
12269         Support bidi reordering of display and overlay strings.
12270         * xdisp.c (compute_display_string_pos)
12271         (compute_display_string_end): Accept additional argument STRING.
12272         (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12273         (reseat_to_string): Initialize bidi_it->string.s and
12274         bidi_it->string.schars.
12275         (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
12276         NULL (avoids a crash in bidi_paragraph_init).
12277         Initialize itb.string.lstring.
12278         (init_iterator): Call bidi_init_it only of a valid
12279         buffer position was specified.  Initialize paragraph_embedding to
12280         L2R.
12281         (reseat_to_string): Initialize the bidi iterator.
12282         (display_string): If we need to ignore text properties of
12283         LISP_STRING, set IT->stop_charpos to IT->end_charpos.  (The
12284         original value of -1 will not work with bidi.)
12285         (compute_display_string_pos): First arg is now struct
12286         `text_pos *'; all callers changed.  Support display properties on
12287         Lisp strings.
12288         (compute_display_string_end): Support display properties on Lisp
12289         strings.
12290         (init_iterator, reseat_1, reseat_to_string): Initialize the
12291         string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12292         when iterating on a string not from display properties).
12293         (compute_display_string_pos, compute_display_string_end):
12294         Fix calculation of the object to scan.  Fixes an error when using
12295         arrow keys.
12296         (next_element_from_buffer): Don't abort when IT_CHARPOS is before
12297         base_level_stop; instead, set base_level_stop to BEGV.
12298         Fixes crashes in vertical-motion.
12299         (next_element_from_buffer): Improve commentary for when
12300         the iterator is before prev_stop.
12301         (init_iterator): Initialize bidi_p from the default value of
12302         bidi-display-reordering, not from buffer-local value.  Use the
12303         buffer-local value only if initializing for buffer iteration.
12304         (handle_invisible_prop): Support invisible properties on strings
12305         that are being bidi-reordered.
12306         (set_iterator_to_next): Support bidi reordering of C strings and
12307         Lisp strings.
12308         (next_element_from_string): Support bidi reordering of Lisp
12309         strings.
12310         (handle_stop_backwards): Support Lisp strings as well.
12311         (display_string): Support display of R2L glyph rows.
12312         Use IT_STRING_CHARPOS when displaying from a Lisp string.
12313         (init_iterator): Don't initialize it->bidi_p for strings
12314         here.
12315         (reseat_to_string): Initialize it->bidi_p for strings here.
12316         (next_element_from_string, next_element_from_c_string)
12317         (next_element_from_buffer): Add xassert's for correspondence
12318         between IT's object being iterated and it->bidi_it.string
12319         structure.
12320         (face_before_or_after_it_pos): Support bidi iteration.
12321         (next_element_from_c_string): Handle the case of the first string
12322         character that is not the first one in the visual order.
12323         (get_visually_first_element): New function, refactored from common
12324         parts of next_element_from_buffer, next_element_from_string, and
12325         next_element_from_c_string.
12326         (tool_bar_lines_needed, redisplay_tool_bar)
12327         (display_menu_bar): Force left-to-right direction.  Add a FIXME
12328         comment for making that be controlled by a user option.
12329         (push_it, pop_it): Save and restore the state of the
12330         bidi iterator.  Save and restore the bidi_p flag.
12331         (pop_it): Iterate out of display property for string iteration as
12332         well.
12333         (iterate_out_of_display_property): Support iteration over strings.
12334         (handle_single_display_spec): Set up it->bidi_it for iteration
12335         over a display string, and call bidi_init_it.
12336         (handle_single_display_spec, next_overlay_string)
12337         (get_overlay_strings_1, push_display_prop): Set up the bidi
12338         iterator for displaying display or overlay strings.
12339         (forward_to_next_line_start): Don't use the shortcut if
12340         bidi-iterating.
12341         (back_to_previous_visible_line_start): If handle_display_prop
12342         pushed the iterator stack, restore the internal state of the bidi
12343         iterator by calling bidi_pop_it same number of times.
12344         (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12345         and we are bidi-iterating, don't decrement the iterator position;
12346         instead, set the first_elt flag in the bidi iterator, to produce
12347         the same effect.
12348         (reseat_1): Remove redundant setting of string_from_display_prop_p.
12349         (push_display_prop): xassert that we are iterating a buffer.
12350         (push_it, pop_it): Save and restore paragraph_embedding member.
12351         (handle_single_display_spec, next_overlay_string)
12352         (get_overlay_strings_1, reseat_1, reseat_to_string)
12353         (push_display_prop): Set up the `unibyte' member of bidi_it.string
12354         correctly.  Don't assume unibyte strings are not bidi-reordered.
12355         (compute_display_string_pos)
12356         (compute_display_string_end): Fix handling the case of C string.
12357         (push_it, pop_it): Save and restore from_disp_prop_p.
12358         (handle_single_display_spec, push_display_prop): Set the
12359         from_disp_prop_p flag.
12360         (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12361         (pop_it): Call iterate_out_of_display_property only if we are
12362         popping after iteration over a string that came from a display
12363         property.  Fix a typo in popping stretch info.  Add an assertion
12364         for verifying that the iterator position is in sync with the bidi
12365         iterator.
12366         (handle_single_display_spec, get_overlay_strings_1)
12367         (push_display_prop): Fix initialization of paragraph direction for
12368         string when that of the parent object is not yet determined.
12369         (reseat_1): Call bidi_init_it to resync the bidi
12370         iterator with IT's position.  (Bug#7616)
12371         (find_row_edges): If ROW->start.pos gives position
12372         smaller than min_pos, use it as ROW->minpos.  (Bug#7616)
12373         (handle_stop, back_to_previous_visible_line_start, reseat_1):
12374         Reset the from_disp_prop_p flag.
12375         (SAVE_IT, RESTORE_IT): New macros.
12376         (pos_visible_p, face_before_or_after_it_pos)
12377         (back_to_previous_visible_line_start)
12378         (move_it_in_display_line_to, move_it_in_display_line)
12379         (move_it_to, move_it_vertically_backward, move_it_by_lines)
12380         (try_scrolling, redisplay_window, display_line): Use them when
12381         saving a temporary copy of the iterator and restoring it back.
12382         (back_to_previous_visible_line_start, reseat_1)
12383         (init_iterator): Empty the bidi cache "stack".
12384         (move_it_in_display_line_to): If iterator ended up at
12385         EOL, but we never saw any buffer positions smaller than
12386         to_charpos, return MOVE_POS_MATCH_OR_ZV.  Fixes vertical cursor
12387         motion in bidi-reordered lines.
12388         (move_it_in_display_line_to): Record prev_method and prev_pos
12389         immediately before the call to set_iterator_to_next.  Fixes cursor
12390         motion in bidi-reordered lines with stretch glyphs and strings
12391         displayed in margins.  (Bug#8133) (Bug#8867)
12392         Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12393         TO_CHARPOS.
12394         (pos_visible_p): Support positions in bidi-reordered lines.
12395         Save and restore bidi cache.
12397         * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12398         (bidi_paragraph_info): Delete unused struct.
12399         (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12400         (bidi_cache_start): New variable.
12401         (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12402         to zero.
12403         (bidi_cache_fetch_state, bidi_cache_search)
12404         (bidi_cache_find_level_change, bidi_cache_iterator_state)
12405         (bidi_cache_find, bidi_peek_at_next_level)
12406         (bidi_level_of_next_char, bidi_find_other_level_edge)
12407         (bidi_move_to_visually_next): Compare cache index with
12408         bidi_cache_start rather than with zero.
12409         (bidi_fetch_char): Accept new argument STRING; all callers
12410         changed.  Support iteration over a string.  Support strings with
12411         display properties.  Support unibyte strings.  Fix the type of
12412         `len' according to what STRING_CHAR_AND_LENGTH expects.
12413         (bidi_paragraph_init, bidi_resolve_explicit_1)
12414         (bidi_resolve_explicit, bidi_resolve_weak)
12415         (bidi_level_of_next_char, bidi_move_to_visually_next):
12416         Support iteration over a string.
12417         (bidi_set_sor_type, bidi_resolve_explicit_1)
12418         (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12419         can now be zero (for strings); special values 0 and -1 were
12420         changed to -1 and -2, respectively.
12421         (bidi_char_at_pos): New function.
12422         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12423         Call it instead of FETCH_MULTIBYTE_CHAR.
12424         (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12425         initialized to valid values.
12426         (bidi_init_it): Don't initialize charpos and bytepos with invalid
12427         values.
12428         (bidi_level_of_next_char): Allow the sentinel "position" to pass
12429         the test for valid cached positions.  Fix the logic for looking up
12430         the sentinel state in the cache.  GCPRO the Lisp string we are
12431         iterating.
12432         (bidi_push_it, bidi_pop_it): New functions.
12433         (bidi_initialize): Initialize the bidi cache start stack pointer.
12434         (bidi_cache_ensure_space): New function, refactored from part of
12435         bidi_cache_iterator_state.  Don't assume the required size is just
12436         one BIDI_CACHE_CHUNK away.
12437         (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12438         (bidi_count_bytes, bidi_char_at_pos): New functions.
12439         (bidi_cache_search): Don't assume bidi_cache_last_idx is
12440         always valid if bidi_cache_idx is valid.
12441         (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12442         is valid if it's going to be used.
12443         (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12444         (bidi_cache_fetch_state, bidi_cache_search)
12445         (bidi_cache_find_level_change, bidi_cache_ensure_space)
12446         (bidi_cache_iterator_state, bidi_cache_find)
12447         (bidi_find_other_level_edge, bidi_cache_start_stack):
12448         All variables related to cache indices are now EMACS_INT.
12450         * dispextern.h (struct bidi_string_data): New structure.
12451         (struct bidi_it): New member `string'.  Make flag members be 1-bit
12452         fields, and put them last in the struct.
12453         (compute_display_string_pos, compute_display_string_end):
12454         Update prototypes.
12455         (bidi_push_it, bidi_pop_it): Add prototypes.
12456         (struct iterator_stack_entry): New members bidi_p,
12457         paragraph_embedding, and from_disp_prop_p.
12458         (struct it): Member bidi_p is now a bit field 1 bit wide.
12459         (bidi_shelve_cache, bidi_unshelve_cache):
12460         Declare prototypes.
12462         * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12463         (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12464         and vector-like objects.
12466         * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12467         cache around display iteration.
12469         * window.c (Fwindow_end, window_scroll_pixel_based)
12470         (displayed_window_lines, Frecenter): Save and restore the bidi
12471         cache around display iteration.
12473 2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12475         * editfns.c (Fdelete_region): Clarify the use of the named
12476         parameters (bug#6788).
12478 2011-07-14  Martin Rudalics  <rudalics@gmx.at>
12480         * indent.c (Fvertical_motion): Set and restore w->pointm when
12481         saving and restoring the window's buffer (Bug#9006).
12483 2011-07-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12485         * editfns.c (Fstring_to_char): Clarify just what is returned
12486         (bug#6576).  Text by Eli Zaretskii.
12488 2011-07-13  Juanma Barranquero  <lekktu@gmail.com>
12490         * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12492 2011-07-13  Eli Zaretskii  <eliz@gnu.org>
12494         * buffer.c (mmap_find): Fix a typo.
12496 2011-07-13  Johan Bockgård  <bojohan@gnu.org>
12498         Fix execution of x selection hooks.
12499         * xselect.c (Qx_lost_selection_functions)
12500         (Qx_sent_selection_functions): New vars.
12501         (syms_of_xselect): DEFSYM them.
12502         (x_handle_selection_request): Pass Qx_sent_selection_functions
12503         rather than Vx_sent_selection_functions to Frun_hook_with_args.
12504         (x_handle_selection_clear,x_clear_frame_selections):
12505         Pass Qx_lost_selection_functions rather than
12506         Vx_lost_selection_functions to Frun_hook_with_args.
12508 2011-07-13  Paul Eggert  <eggert@cs.ucla.edu>
12510         * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
12511         The old code sometimes used this field without initializing it.
12513         * alloc.c (gc_sweep): Don't read past end of array.
12514         In theory, the old code could also have corrupted Emacs internals,
12515         though it'd be very unlikely.
12517 2011-07-12  Andreas Schwab  <schwab@linux-m68k.org>
12519         * character.c (Fcharacterp): Don't advertise optional ignored
12520         argument.  (Bug#4026)
12522 2011-07-12  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12524         * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12525         key" (bug#4257).
12527         * window.c (Fset_window_start): Doc fix (bug#4199).
12528         (Fset_window_hscroll): Ditto.
12530 2011-07-12  Paul Eggert  <eggert@cs.ucla.edu>
12532         Fix minor new problems caught by GCC 4.6.1.
12533         * term.c (init_tty): Remove unused local.
12534         * xsettings.c (store_monospaced_changed): Define this function only
12535         if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
12536         not used otherwise.
12538 2011-07-12  Chong Yidong  <cyd@stupidchicken.com>
12540         * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12542 2011-07-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12544         * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12545         are the mini-buffer and the echo area (bug#3320).
12547         * term.c (init_tty): Remove support for supdup, c10 and perq
12548         terminals, which are no longer supported (bug#1482).
12550 2011-07-10  Johan Bockgård  <bojohan@gnu.org>
12552         * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12554 2011-07-10  Jan Djärv  <jan.h.d@swipnet.se>
12556         * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12557         for non-popups (Bug#3642).
12559 2011-07-10  Andreas Schwab  <schwab@linux-m68k.org>
12561         * alloc.c (reset_malloc_hooks): Protoize.
12562         * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
12563         (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12564         * cm.c (losecursor): Likewise.
12565         * data.c (fmod): Likewise.
12566         * dispnew.c (swap_glyphs_in_rows): Likewise.
12567         * emacs.c (memory_warning_signal): Likewise.
12568         * floatfns.c (float_error): Likewise.
12569         * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12570         (otf_open, font_otf_capability, generate_otf_features)
12571         (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12572         Likewise.
12573         * image.c (pbm_read_file): Likewise.
12574         * indent.c (string_display_width): Likewise.
12575         * intervals.c (check_for_interval, search_for_interval)
12576         (inc_interval_count, count_intervals, root_interval)
12577         (adjust_intervals_for_insertion, make_new_interval): Likewise.
12578         * lread.c (defalias): Likewise.
12579         * ralloc.c (r_alloc_check): Likewise.
12580         * regex.c (set_image_of_range_1, set_image_of_range)
12581         (regex_grow_registers): Likewise.
12582         * sysdep.c (strerror): Likewise.
12583         * termcap.c (valid_filename_p, tprint, main): Likewise.
12584         * tparam.c (main): Likewise.
12585         * unexhp9k800.c (run_time_remap, save_data_space)
12586         (update_file_ptrs, read_header, write_header, calculate_checksum)
12587         (copy_file, copy_rest, display_header): Likewise.
12588         * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12589         Likewise.
12590         * xdisp.c (check_it): Likewise.
12591         * xfaces.c (register_color, unregister_color, unregister_colors):
12592         Likewise.
12593         * xfns.c (print_fontset_result): Likewise.
12594         * xrdb.c (member, fatal, main): Likewise.
12596 2011-07-10  Paul Eggert  <eggert@cs.ucla.edu>
12598         Fix minor problems found by static checking (Bug#9031).
12599         * chartab.c (char_table_set_range, map_sub_char_table):
12600         Remove unused locals.
12601         (uniprop_table): Now static.
12602         * composite.c (_work_char): Remove unused static var.
12604 2011-07-09  Juanma Barranquero  <lekktu@gmail.com>
12606         * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12608 2011-07-09  Jan Djärv  <jan.h.d@swipnet.se>
12610         * gtkutil.c (qttip_cb): Remove code without function.
12612 2011-07-09  Eli Zaretskii  <eliz@gnu.org>
12614         * w32.c (pthread_sigmask): New stub.
12616 2011-07-08  Paul Eggert  <eggert@cs.ucla.edu>
12618         Use pthread_sigmask, not sigprocmask (Bug#9010).
12619         sigprocmask is portable only for single-threaded applications, and
12620         Emacs can be multi-threaded when it uses GTK.
12621         * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12622         (LIBES): Use it.
12623         * callproc.c (Fcall_process):
12624         * process.c (create_process):
12625         * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12626         Use pthread_sigmask, not sigprocmask.
12628 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
12630         * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12631         (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12632         wrong (Bug#8591).
12634 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
12636         * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12637         Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12638         (xg_hide_tooltip): Fix comment.
12640         * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12641         in registerServicesMenuSendTypes.
12642         (validRequestorForSendType): Don't check ns_return_types.
12644         * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12645         ns_return_type.
12647 2011-07-08  Jason Rumney  <jasonr@gnu.org>
12649         * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12650         SH_SHOW for hidden windows (Bug#5482).
12652         * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12653         frame struct members of non-existent frames (Bug#6284).
12655 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
12657         * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12658         variable firstTime not needed on OSX >= 10.6.
12659         (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12660         >= 10.5.  Use setKnobProportion, setDoubleValue.
12662         * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12663         (MAC_OS_X_VERSION_10_5): Define if not defined.
12664         (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12665         (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12666         (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12668         * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
12669         cString and lossyCString on OSX >= 10.4.
12671         * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
12672         sizeToFit on OSX >= 10.2.
12674         * nsimage.m (allocInitFromFile): Don't use deprecated method
12675         bestRepresentationForDevice on OSX >= 10.6.
12677         * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12678         to avoid warning.
12680         * emacs.c: Declare unexec_init_emacs_zone.
12682         * nsgui.h: Fix compiler warning about gnulib redefining verify.
12684         * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12686         * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12687         on svcsMenu (Bug#8842).
12689         * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12690         ns_return_types.
12691         (Fns_list_services): Just return Qnil on 10.6, code not working there.
12693         * nsterm.m (QUTF8_STRING): Declare.
12694         (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12695         (validRequestorForSendType): Return type is (id).
12696         Change indexOfObjectIdenticalTo to indexOfObject.
12697         Check if we have local selection before returning self (Bug#8842).
12698         (writeSelectionToPasteboard): Put local selection into paste board
12699         if we have a local selection (Bug#8842).
12700         (syms_of_nsterm): DEFSYM QUTF8_STRING.
12702         * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12703         (ns_get_local_selection): Declare.
12705 2011-07-07  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12707         * keymap.c (describe_map_tree): Don't insert a double newline at
12708         the end of the buffer (bug#1169) and return whether we inserted
12709         something.
12711         * callint.c (Fcall_interactively): Change "reading args" to
12712         "providing args" to try to clarify what it does (bug#1010).
12714 2011-07-07  Kenichi Handa  <handa@m17n.org>
12716         * composite.c (composition_compute_stop_pos): Ignore a static
12717         composition starting before CHARPOS (Bug#8915).
12719         * xdisp.c (handle_composition_prop): Likewise.
12721 2011-07-07  Eli Zaretskii  <eliz@gnu.org>
12723         * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12724         (Bug#9015)
12726 2011-07-07  Kenichi Handa  <handa@m17n.org>
12728         * character.h (unicode_category_t): New enum type.
12730         * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12731         (Qchar_code_property_table): New variable.
12732         (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12733         (UNIPROP_COMPRESSED_FORM_P): New macros.
12734         (char_table_ascii): Uncompress the compressed values.
12735         (sub_char_table_ref): New arg is_uniprop.  Callers changed.
12736         Uncompress the compressed values.
12737         (sub_char_table_ref_and_range): Likewise.
12738         (char_table_ref_and_range): Uncompress the compressed values.
12739         (sub_char_table_set): New arg is_uniprop.  Callers changed.
12740         Uncompress the compressed values.
12741         (sub_char_table_set_range): Args changed.  Callers changed.
12742         (char_table_set_range): Adjuted for the above change.
12743         (map_sub_char_table): Delete args default_val and parent.  Add arg
12744         top.  Give decoded values to a Lisp function.
12745         (map_char_table): Adjust for the above change.  Give decoded
12746         values to a Lisp function.  Gcpro more variables.
12747         (uniprop_table_uncompress)
12748         (uniprop_decode_value_run_length): New functions.
12749         (uniprop_decoder, uniprop_decoder_count): New variables.
12750         (uniprop_get_decoder, uniprop_encode_value_character)
12751         (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12752         New functions.
12753         (uniprop_encoder, uniprop_encoder_count): New variables.
12754         (uniprop_get_encoder, uniprop_table)
12755         (Funicode_property_table_internal, Fget_unicode_property_internal)
12756         (Fput_unicode_property_internal): New functions.
12757         (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12758         Sunicode_property_table_internal, Sget_unicode_property_internal,
12759         and Sput_unicode_property_internal.  Defvar_lisp
12760         char-code-property-alist.
12762         * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
12763         Vunicode_category_table.
12765         * font.c (font_range): Adjust for the change of
12766         Vunicode_category_table.
12768 2011-07-07  Dan Nicolaescu  <dann@ics.uci.edu>
12770         * m/iris4d.h: Remove file, move contents ...
12771         * s/irix6-5.h: ... here.
12773 2011-07-06  Paul Eggert  <eggert@cs.ucla.edu>
12775         Remove unportable assumption about struct layout (Bug#8884).
12776         * alloc.c (mark_buffer):
12777         * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
12778         (clone_per_buffer_values): Don't assume that
12779         sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
12780         This isn't true in general, and it's particularly not true
12781         if Emacs is configured with --with-wide-int.
12782         * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
12783         New macros, used in the buffer.c change.
12785 2011-07-05  Jan Djärv  <jan.h.d@swipnet.se>
12787         * xsettings.c: Use both GConf and GSettings if both are available.
12788         (store_config_changed_event): Add comment.
12789         (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
12790         (store_tool_bar_style_changed): New functions.
12791         (store_monospaced_changed): Add comment.  Call dpyinfo_valid.
12792         (struct xsettings): Move font inside HAVE_XFT.
12793         (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
12794         (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
12795         Move inside HAVE_XFT.
12796         (something_changed_gsettingsCB): Rename from something_changedCB.
12797         Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12798         also.
12799         (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
12800         (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT.  Move inside HAVE_XFT.
12801         (something_changed_gconfCB): Rename from something_changedCB.
12802         Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12803         (parse_settings): Move check for font inside HAVE_XFT.
12804         (read_settings, apply_xft_settings): Add comment.
12805         (read_and_apply_settings): Add comment.  Call map_tool_bar_style and
12806         store_tool_bar_style_changed.  Move check for font inside HAVE_XFT and
12807         call store_font_name_changed.
12808         (xft_settings_event): Add comment.
12809         (init_gsettings): Add comment.  Get values for GSETTINGS_TOOL_BAR_STYLE
12810         and GSETTINGS_FONT_NAME.  Move check for fonts within HAVE_XFT.
12811         (init_gconf): Add comment.  Get values for GCONF_TOOL_BAR_STYLE
12812         and GCONF_FONT_NAME.  Move check for fonts within HAVE_XFT.
12813         (xsettings_initialize): Call init_gsettings last.
12814         (xsettings_get_system_font, xsettings_get_system_normal_font):
12815         Add comment.
12817 2011-07-05  Paul Eggert  <eggert@cs.ucla.edu>
12819         Random fixes.  E.g., (random) never returned negative values.
12820         * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12821         subseconds part to the entropy, as that's a bit more random.
12822         Prefer signed to unsigned, since the signedness doesn't matter and
12823         in general we prefer signed.  When given a limit, use a
12824         denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12825         latter isn't right if USE_2_TAGS_FOR_INTS.
12826         * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12827         not 0..VALMASK.  Don't discard "excess" bits that random () returns.
12829 2011-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
12831         * textprop.c (text_property_stickiness):
12832         Obey Vtext_property_default_nonsticky.
12833         (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12834         * w32fns.c (syms_of_w32fns):
12835         * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12837 2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
12839         * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12840         This is more efficient than Ffile_directory_p and avoids a minor race.
12842 2011-07-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12844         * buffer.c (Foverlay_put): Say what the return value is
12845         (bug#7835).
12847         * fileio.c (barf_or_query_if_file_exists): Check first if the file
12848         is a directory before asking whether to use the file name
12849         (bug#7564).
12850         (barf_or_query_if_file_exists): Make the "File is a directory"
12851         error be more correct.
12853         * fns.c (Frequire): Remove the mention of the .gz files, since
12854         that's installation-specific, but keep the mention of
12855         `get-load-suffixes'.
12857 2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
12859         * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12860         Report string overflow if the output is too long.
12862 2011-07-04  Juanma Barranquero  <lekktu@gmail.com>
12864         * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12865         (syms_of_gnutls): Remove duplicate DEFSYM for
12866         Qgnutls_bootprop_verify_hostname_error, an error for
12867         Qgnutls_bootprop_verify_error (which is no longer used).
12869         * eval.c (find_handler_clause): Remove parameters `sig' and `data',
12870         unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca.  All callers changed.
12871         Also (re)move comments that are misplaced or no longer relevant.
12873 2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12875         * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
12877 2011-07-03  Chong Yidong  <cyd@stupidchicken.com>
12879         * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
12880         and background color parameters if they have been changed.
12882 2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12884         * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
12886 2011-07-03  Paul Eggert  <eggert@cs.ucla.edu>
12888         * xsettings.c (SYSTEM_FONT): Define only when used.
12889         No need to define when HAVE_GSETTINGS || !HAVE_XFT.
12891         * keymap.c (access_keymap_1): Now static.
12893 2011-07-02  Chong Yidong  <cyd@stupidchicken.com>
12895         * keyboard.c (command_loop_1): If a down-mouse event is unbound,
12896         leave any prefix arg for the up event (Bug#1586).
12898 2011-07-02  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12900         * lread.c (syms_of_lread): Mention single symbols defined by
12901         `defvar' or `defconst' (bug#7154).
12903         * fns.c (Frequire): Mention .el.gz files (bug#7314).
12904         (Frequire): Mention get-load-suffixes.
12906 2011-07-02  Martin Rudalics  <rudalics@gmx.at>
12908         * window.h (window): Remove clone_number slot.
12909         * window.c (Fwindow_clone_number, Fset_window_clone_number):
12910         Remove.
12911         (make_parent_window, make_window, saved_window)
12912         (Fset_window_configuration, save_window_save): Don't deal with
12913         clone numbers.
12914         * buffer.c (Qclone_number): Remove declaration.
12915         (sort_overlays, overlay_strings): Don't deal with clone numbers.
12917 2011-07-02  Stefan Monnier  <monnier@iro.umontreal.ca>
12919         Add multiple inheritance to keymaps.
12920         * keymap.c (Fmake_composed_keymap): New function.
12921         (Fset_keymap_parent): Simplify.
12922         (fix_submap_inheritance): Remove.
12923         (access_keymap_1): New function extracted from access_keymap to handle
12924         embedded parents and handle lists of maps.
12925         (access_keymap): Use it.
12926         (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
12927         (Fcopy_keymap): Handle embedded parents.
12928         (Fcommand_remapping, define_as_prefix): Simplify.
12929         (Fkey_binding): Simplify.
12930         (syms_of_keymap): Move minibuffer-local-completion-map,
12931         minibuffer-local-filename-completion-map,
12932         minibuffer-local-must-match-map, and
12933         minibuffer-local-filename-must-match-map to Elisp.
12934         (syms_of_keymap): Defsubr make-composed-keymap.
12935         * keyboard.c (menu_bar_items): Use map_keymap_canonical.
12936         (parse_menu_item): Trivial simplification.
12938 2011-07-01  Glenn Morris  <rgm@gnu.org>
12940         * Makefile.in (SETTINGS_LIBS): Fix typo.
12942 2011-07-01  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
12944         * coding.c (Fencode_coding_string): Record the last coding system
12945         used, as the function doc string says (bug#8738).
12947 2011-07-01  Jan Djärv  <jan.h.d@swipnet.se>
12949         * xsettings.c (store_monospaced_changed): Take new font as arg and
12950         check for change against current_mono_font.
12951         (EMACS_TYPE_SETTINGS): Remove this and related defines.
12952         (emacs_settings_constructor, emacs_settings_get_property)
12953         (emacs_settings_set_property, emacs_settings_class_init)
12954         (emacs_settings_init, gsettings_obj): Remove.
12955         (something_changedCB): New function for HAVE_GSETTINGS.
12956         (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
12957         with value as argument.
12958         (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
12959         g_settings_new (Bug#8967).  Do not create gsettings_obj.
12960         Remove calls to g_settings_bind.  Connect something_changedCB to
12961         "changed".
12963         * xgselect.c: Add defined (HAVE_GSETTINGS).
12964         (xgselect_initialize): Ditto.
12966         * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
12967         (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
12968         xg_select.
12970 2011-07-01  Paul Eggert  <eggert@cs.ucla.edu>
12972         * eval.c (struct backtrace): Simplify and port the data structure.
12973         Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
12974         signed bit field, as this assumption is not portable and it makes
12975         Emacs crash when compiled with Sun C 5.8 on sparc.  Do not use
12976         "char debug_on_exit : 1" as this is not portable either; instead,
12977         use the portable "unsigned int debug_on_exit : 1".  Remove unused
12978         member evalargs.  Remove obsolete comments about cc bombing out.
12980 2011-06-30  Jan Djärv  <jan.h.d@swipnet.se>
12982         * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
12983         Let HAVE_GSETTINGS override HAVE_GCONF.
12984         (store_monospaced_changed): New function.
12985         (EMACS_SETTINGS): A new type derived from GObject to handle
12986         GSettings notifications.
12987         (emacs_settings_constructor, emacs_settings_get_property)
12988         (emacs_settings_set_property, emacs_settings_class_init):
12989         New functions.
12990         (gsettings_client, gsettings_obj): New variables.
12991         (GSETTINGS_SCHEMA): New define.
12992         (something_changedCB): Call store_monospaced_changed.
12993         (init_gsettings): New function.
12994         (xsettings_initialize): Call init_gsettings.
12995         (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
12996         to NULL.
12998         * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
12999         GCONF_CFLAGS/LIBS.
13001 2011-06-29  Martin Rudalics  <rudalics@gmx.at>
13003         * window.c (resize_root_window, grow_mini_window)
13004         (shrink_mini_window): Rename Qresize_root_window to
13005         Qwindow_resize_root_window and Qresize_root_window_vertically to
13006         Qwindow_resize_root_window_vertically.
13008 2011-06-28  Paul Eggert  <eggert@cs.ucla.edu>
13010         * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13012 2011-06-27  Juanma Barranquero  <lekktu@gmail.com>
13014         * makefile.w32-in: Redesign dependencies so they reflect more
13015         clearly which files are directly included by each source file,
13016         and not through other includes.
13018 2011-06-27  Martin Rudalics  <rudalics@gmx.at>
13020         * buffer.c (Qclone_number): Declare static and DEFSYM it.
13021         (sort_overlays, overlay_strings): When an overlay's clone number
13022         matches the window's clone number process the overlay even if
13023         the overlay's window property doesn't match the current window.
13025         * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13026         (Fwindow_hchild): Rename to Fwindow_left_child.
13027         (Fwindow_next): Rename to Fwindow_next_sibling.
13028         (Fwindow_prev): Rename to Fwindow_prev_sibling.
13029         (resize_window_check): Rename to window_resize_check.
13030         (resize_window_apply): Rename to window_resize_apply.
13031         (Fresize_window_apply): Rename to Fwindow_resize_apply.
13032         (Fdelete_other_windows_internal, resize_frame_windows)
13033         (Fsplit_window_internal, Fdelete_window_internal)
13034         (grow_mini_window, shrink_mini_window)
13035         (Fresize_mini_window_internal): Fix callers accordingly.
13037 2011-06-26  Jan Djärv  <jan.h.d@swipnet.se>
13039         * emacsgtkfixed.h: State that this is only used with Gtk+3.
13040         (emacs_fixed_set_min_size): Remove.
13041         (emacs_fixed_new): Take frame as argument.
13043         * emacsgtkfixed.c: State that this is only used with Gtk+3.
13044         (_EmacsFixedPrivate): Remove minwidth/height.
13045         Add struct frame *f.
13046         (emacs_fixed_init): Initialize priv->f.
13047         (get_parent_class, emacs_fixed_set_min_size): Remove.
13048         (emacs_fixed_new): Set priv->f to argument.
13049         (emacs_fixed_get_preferred_width)
13050         (emacs_fixed_get_preferred_height): Use min_width/height from
13051         frames size_hint to set minimum and natural (Bug#8919).
13052         (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13053         and use min_width/height from frames size_hint to set
13054         min_width/height (Bug#8919).
13056         * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
13057         (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13058         Fix indentation.
13060 2011-06-26  Eli Zaretskii  <eliz@gnu.org>
13062         * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13063         bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13064         called at ZV.
13066 2011-06-26  Chong Yidong  <cyd@stupidchicken.com>
13068         * process.c (wait_reading_process_output): Bypass select if
13069         waiting for a cell while ignoring keyboard input, and input is
13070         pending.  Suggested by Jan Djärv (Bug#8869).
13072 2011-06-25  Paul Eggert  <eggert@cs.ucla.edu>
13074         Use gnulib's dup2 module instead of rolling our own.
13075         * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13077 2011-06-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
13079         * dispnew.c (scrolling_window): Before scrolling, turn off a
13080         mouse-highlight in the window being scrolled.
13082 2011-06-24  Juanma Barranquero  <lekktu@gmail.com>
13084         Move DEFSYM to lisp.h and use everywhere.
13086         * character.h (DEFSYM): Move declaration...
13087         * lisp.h (DEFSYM): ...here.
13089         * gnutls.c:
13090         * minibuf.c:
13091         * w32menu.c:
13092         * w32proc.c:
13093         * w32select.c: Don't include character.h.
13095         * alloc.c (syms_of_alloc):
13096         * buffer.c (syms_of_buffer):
13097         * bytecode.c (syms_of_bytecode):
13098         * callint.c (syms_of_callint):
13099         * casefiddle.c (syms_of_casefiddle):
13100         * casetab.c (init_casetab_once):
13101         * category.c (init_category_once, syms_of_category):
13102         * ccl.c (syms_of_ccl):
13103         * cmds.c (syms_of_cmds):
13104         * composite.c (syms_of_composite):
13105         * dbusbind.c (syms_of_dbusbind):
13106         * dired.c (syms_of_dired):
13107         * dispnew.c (syms_of_display):
13108         * doc.c (syms_of_doc):
13109         * editfns.c (syms_of_editfns):
13110         * emacs.c (syms_of_emacs):
13111         * eval.c (syms_of_eval):
13112         * fileio.c (syms_of_fileio):
13113         * fns.c (syms_of_fns):
13114         * frame.c (syms_of_frame):
13115         * fringe.c (syms_of_fringe):
13116         * insdel.c (syms_of_insdel):
13117         * keymap.c (syms_of_keymap):
13118         * lread.c (init_obarray, syms_of_lread):
13119         * macros.c (syms_of_macros):
13120         * msdos.c (syms_of_msdos):
13121         * print.c (syms_of_print):
13122         * process.c (syms_of_process):
13123         * search.c (syms_of_search):
13124         * sound.c (syms_of_sound):
13125         * syntax.c (init_syntax_once, syms_of_syntax):
13126         * terminal.c (syms_of_terminal):
13127         * textprop.c (syms_of_textprop):
13128         * undo.c (syms_of_undo):
13129         * w32.c (globals_of_w32):
13130         * window.c (syms_of_window):
13131         * xdisp.c (syms_of_xdisp):
13132         * xfaces.c (syms_of_xfaces):
13133         * xfns.c (syms_of_xfns):
13134         * xmenu.c (syms_of_xmenu):
13135         * xsettings.c (syms_of_xsettings):
13136         * xterm.c (syms_of_xterm): Use DEFSYM.
13138 2011-06-24  Teodor Zlatanov  <tzz@lifelogs.com>
13140         * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
13142 2011-06-23  Paul Eggert  <eggert@cs.ucla.edu>
13144         Integer and buffer overflow fixes (Bug#8873).
13146         * print.c (printchar, strout): Check for string overflow.
13147         (PRINTPREPARE, printchar, strout):
13148         Don't set size unless allocation succeeds.
13150         * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13151         for sizes.  Check for string overflow more accurately.
13152         Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13154         * macros.c: Integer and buffer overflow fixes.
13155         * keyboard.h (struct keyboard.kbd_macro_bufsize):
13156         * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13157         Use ptrdiff_t, not int, for sizes.
13158         Don't increment bufsize until after realloc succeeds.
13159         Check for size-calculation overflow.
13160         (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13162         * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13164         * lread.c: Integer overflow fixes.
13165         (read_integer): Radix is now EMACS_INT, not int,
13166         to improve quality of diagnostics for out-of-range radices.
13167         Calculate buffer size correctly for out-of-range radices.
13168         (read1): Check for integer overflow in radices, and in
13169         read-circle numbers.
13170         (read_escape): Avoid int overflow.
13171         (Fload, openp, read_buffer_size, read1)
13172         (substitute_object_recurse, read_vector, read_list, map_obarray):
13173         Use ptrdiff_t, not int, for sizes.
13174         (read1): Use EMACS_INT, not int, for sizes.
13175         Check for size overflow.
13177         * image.c (cache_image): Check for size arithmetic overflow.
13179         * lread.c: Integer overflow issues.
13180         (saved_doc_string_size, saved_doc_string_length)
13181         (prev_saved_doc_string_size, prev_saved_doc_string_length):
13182         Now ptrdiff_t, not int.
13183         (read1): Don't assume doc string length fits in int.  Check for
13184         out-of-range doc string lengths.
13185         (read_list): Don't assume file position fits in int.
13186         (read_escape): Check for hex character overflow.
13188 2011-06-22  Leo Liu  <sdl.web@gmail.com>
13190         * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13191         Move to minibuffer.el.
13193 2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
13195         Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
13196         The following patches are for when GLYPH_DEBUG && !XASSERT.
13197         * dispextern.h (trace_redisplay_p, dump_glyph_string):
13198         * dispnew.c (flush_stdout):
13199         * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13200         Mark as externally visible.
13201         * dispnew.c (check_window_matrix_pointers): Now static.
13202         * dispnew.c (window_to_frame_vpos):
13203         * xfns.c (unwind_create_frame):
13204         * xterm.c (x_check_font): Remove unused local.
13205         * scroll.c (CHECK_BOUNDS):
13206         * xfaces.c (cache_fache): Rename local to avoid shadowing.
13207         * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13208         * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13209         (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13210         (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13211         Now static.
13212         (debug_method_add): Use va_list and vsprintf rather than relying
13213         on undefined behavior with wrong number of arguments.
13214         (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13215         Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13216         In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13217         since we're not interested in debugging glyphs with old libraries.
13218         * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13219         GCC 4.6.0's static checking.
13221 2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
13223         Integer overflow and signedness fixes (Bug#8873).
13224         A few related buffer overrun fixes, too.
13226         * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13228         * dispextern.h (struct face.stipple):
13229         * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13230         (x_bitmap_mask, x_allocate_bitmap_record)
13231         (x_create_bitmap_from_data, x_create_bitmap_from_file)
13232         (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13233         (x_create_bitmap_from_xpm_data):
13234         * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13235         * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13236         (.bitmaps_last):
13237         * xfaces.c (load_pixmap):
13238         * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13239         * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13240         (.bitmaps_last, struct x_output.icon_bitmap):
13241         Use ptrdiff_t, not int, for bitmap indexes.
13242         (x_allocate_bitmap_record): Check for size overflow.
13243         * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13245         Use ptrdiff_t, not int, for overlay counts.
13246         * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13247         * editfns.c (overlays_around, get_pos_property):
13248         * textprop.c (get_char_property_and_overlay):
13249         * xdisp.c (next_overlay_change, note_mouse_highlight):
13250         * xfaces.c (face_at_buffer_position):
13251         * buffer.c (OVERLAY_COUNT_MAX): New macro.
13252         (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13253         (Fnext_overlay_change, Fprevious_overlay_change)
13254         (mouse_face_overlay_overlaps, Foverlays_in):
13255         Use ptrdiff_t, not int, for sizes.
13256         (overlays_at, overlays_in): Check for size-calculation overflow.
13258         * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13260         * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13261         (x_session_initialize): Do not assume string length fits in int.
13263         * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13264         This is unlikely, but can occur if DPI is outlandish.
13266         * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
13267         * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13269         * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13270         * xrdb.c (magic_file_p, search_magic_path):
13271         Omit last arg SUFFIX; it was always 0.  All callers changed.
13272         (magic_file_p): Use ptrdiff_t, not int.  Check for size overflow.
13274         * xfont.c (xfont_match): Avoid need for strlen.
13276         * xfns.c: Don't assume strlen fits in int.
13277         (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13279         * xdisp.c (message_log_check_duplicate): Return intmax_t,
13280         not unsigned long, as we prefer signed integers.  All callers changed.
13281         Detect integer overflow in repeat count.
13282         (message_dolog): Don't assume print length fits in 39 bytes.
13283         (display_mode_element): Don't assume strlen fits in int.
13285         * termcap.c: Don't assume sizes fit in int and never overflow.
13286         (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13287         (gobble_line): Check for size-calculation overflow.
13289         * minibuf.c (Fread_buffer):
13290         * lread.c (intern, intern_c_string):
13291         * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13292         Don't assume string length fits in int.
13294         * keyboard.c (parse_tool_bar_item):
13295         * gtkutil.c (style_changed_cb): Avoid need for strlen.
13297         * font.c: Don't assume string length fits in int.
13298         (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13299         Use ptrdiff_t, not int.
13300         (font_intern_prop): Don't assume string length fits in int.
13301         Don't assume integer property fits in fixnum.
13302         * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
13304         * filelock.c: Fix some buffer overrun and integer overflow issues.
13305         (get_boot_time): Don't assume gzip command string fits in 100 bytes.
13306         Reformulate so as not to need the command string.
13307         Invoke gzip -cd rather than gunzip, as it's more portable.
13308         (lock_info_type, lock_file_1, lock_file):
13309         Don't assume pid_t and time_t fit in unsigned long.
13310         (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13311         (current_lock_owner): Prefer signed type for sizes.
13312         Use memcpy, not strncpy, where memcpy is what is really wanted.
13313         Don't assume (via atoi) that time_t and pid_t fit in int.
13314         Check for time_t and/or pid_t out of range, e.g., via a network share.
13315         Don't alloca where an auto var works fine.
13317         * fileio.c: Fix some integer overflow issues.
13318         (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13319         Don't assume string length fits in int.
13320         (directory_file_name): Don't assume string length fits in long.
13321         (make_temp_name): Don't assume pid fits in int, or that its print
13322         length is less than 20.
13324         * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13326         * coding.c (make_subsidiaries): Don't assume string length fits in int.
13328         * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13330         * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13331         We prefer signed integers, even for size calculations.
13333         * emacs.c: Don't assume string length fits in 'int'.
13334         (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13335         (main): Don't invoke strlen when not needed.
13337         * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13338         (XD_DEBUG_MESSAGE): Don't waste a byte.
13340         * callproc.c (getenv_internal_1, getenv_internal)
13341         (Fgetenv_internal):
13342         * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13344         * lread.c (invalid_syntax): Omit length argument.
13345         All uses changed.  This doesn't fix a bug, but it simplifies the
13346         code away from its former Hollerith-constant appearance, and it's
13347         one less 'int' to worry about when looking at integer-overflow issues.
13348         (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
13350         * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13351         This didn't break anything, but it didn't help either.
13352         It's confusing to put a bogus integer in a place where the actual
13353         value does not matter.
13354         (LIST_END_P): Remove unused macro and its bogus comment.
13355         (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
13357         * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13358         This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13359         implementation.
13360         (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13361         We prefer signed types, and the value cannot exceed the EMACS_INT
13362         range anyway (because otherwise the length would not be representable).
13363         (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13364         not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13365         This avoids a GCC warning when WIDE_EMACS_INT.
13367         * indent.c (sane_tab_width): New function.
13368         (current_column, scan_for_column, Findent_to, position_indentation)
13369         (compute_motion): Use it.  This is just for clarity.
13370         (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
13372         * image.c (xbm_image_p): Don't assume stated width, height fit in int.
13374         * lisp.h (lint_assume): New macro.
13375         * composite.c (composition_gstring_put_cache):
13376         * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13378         * editfns.c, insdel.c:
13379         Omit unnecessary forward decls, to simplify future changes.
13381         * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13383         * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13385         * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
13386         Use much-faster test for byte-length change.
13387         Don't assume string byte-length fits in 'int'.
13388         Check that character arg fits in 'int'.
13389         (mapcar1): Declare byte as byte, for clarity.
13391         * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13393         * fns.c (concat): Catch string overflow earlier.
13394         Do not rely on integer wraparound.
13396         * dispextern.h (struct it.overlay_strings_charpos)
13397         (struct it.selective): Now EMACS_INT, not int.
13398         * xdisp.c (forward_to_next_line_start)
13399         (back_to_previous_visible_line_start)
13400         (reseat_at_next_visible_line_start, next_element_from_buffer):
13401         Don't arbitrarily truncate the value of 'selective' to int.
13403         * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13405         * composite.c: Don't truncate sizes to 'int'.
13406         (composition_gstring_p, composition_reseat_it)
13407         (composition_adjust_point): Use EMACS_INT, not int.
13408         (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13409         not EMACS_UINT, for indexes.
13411         * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13413         * buffer.c: Include <verify.h>.
13414         (struct sortvec.priority, struct sortstr.priority):
13415         Now EMACS_INT, not int.
13416         (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
13417         (struct sortstr.size, record_overlay_string)
13418         (struct sortstrlist.size, struct sortlist.used):
13419         Don't truncate size to int.
13420         (record_overlay_string): Check for size-calculation overflow.
13421         (init_buffer_once): Check at compile-time, not run-time.
13423 2011-06-22  Jim Meyering  <meyering@redhat.com>
13425         Don't leak an XBM-image-sized buffer
13426         * image.c (xbm_load): Free the image buffer after using it.
13428 2011-06-21  Paul Eggert  <eggert@cs.ucla.edu>
13430         Port to Sun C.
13431         * composite.c (find_automatic_composition): Omit needless 'return 0;'
13432         that Sun C diagnosed.
13433         * fns.c (secure_hash): Fix pointer signedness issue.
13434         * intervals.c (static_offset_intervals): New function.
13435         (offset_intervals): Use it.
13437 2011-06-21  Leo Liu  <sdl.web@gmail.com>
13439         * deps.mk (fns.o):
13440         * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13441         sha512.h.
13443         * fns.c (secure_hash): Rename from crypto_hash_function and change
13444         the first arg to accept symbols.
13445         (Fsecure_hash): New primitive.
13446         (syms_of_fns): New symbols.
13448 2011-06-20  Deniz Dogan  <deniz@dogan.se>
13450         * process.c (Fset_process_buffer): Clarify return value in
13451         docstring.
13453 2011-06-18  Chong Yidong  <cyd@stupidchicken.com>
13455         * dispnew.c (add_window_display_history): Use BVAR.
13457         * xdisp.c (debug_method_add): Use BVAR.
13458         (check_window_end, dump_glyph_matrix, dump_glyph)
13459         (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13461         * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13462         Likewise.
13464         * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13465         check till after the cache is created in init_frame_faces.
13467 2011-06-17  Stefan Monnier  <monnier@iro.umontreal.ca>
13469         * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13471 2011-06-16  Paul Eggert  <eggert@cs.ucla.edu>
13473         * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13474         Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13475         hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13477         Improve buffer-overflow checking (Bug#8873).
13478         * fileio.c (Finsert_file_contents):
13479         * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13480         Remove the old (too-loose) buffer overflow checks.
13481         They weren't needed, since make_gap checks for buffer overflow.
13482         * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13483         The old code merely checked for Emacs fixnum overflow, and relied
13484         on undefined (wraparound) behavior.  The new code avoids undefined
13485         behavior, and also checks for ptrdiff_t and/or size_t overflow.
13487         * editfns.c (Finsert_char): Don't dump core with very negative counts.
13488         Tune.  Don't use wider integers than needed.  Don't use alloca.
13489         Use a bigger 'string' buffer.  Rewrite to avoid 'n > 0' test.
13491         * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13493         * insdel.c, lisp.h (buffer_overflow): New function.
13494         (insert_from_buffer_1, replace_range, replace_range_2):
13495         * insdel.c (make_gap_larger):
13496         * editfns.c (Finsert_char):
13497         * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13499         * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13501 2011-06-15  Paul Eggert  <eggert@cs.ucla.edu>
13503         Integer overflow and signedness fixes (Bug#8873, Bug#8828).
13505         * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13506         (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13508         * fileio.c: Don't assume EMACS_INT fits in off_t.
13509         (emacs_lseek): New static function.
13510         (Finsert_file_contents, Fwrite_region): Use it.
13511         Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13513         * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13515         * fns.c: Don't overflow int when computing a list length.
13516         * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13517         (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13518         truncation on 64-bit hosts.  Check for QUIT every
13519         QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13520         faster and is responsive enough.
13521         (Flength): Report an error instead of overflowing an integer.
13522         (Fsafe_length): Return a float if the value is not representable
13523         as a fixnum.  This shouldn't happen except in contrived situations.
13524         (Fnthcdr, Fsort): Don't assume list length fits in int.
13525         (Fcopy_sequence): Don't assume vector length fits in int.
13527         * alloc.c: Check that resized vectors' lengths fit in fixnums.
13528         (header_size, word_size): New constants.
13529         (allocate_vectorlike): Don't check size overflow here.
13530         (allocate_vector): Check it here instead, since this is the only
13531         caller of allocate_vectorlike that could cause overflow.
13532         Check that the new vector's length is representable as a fixnum.
13534         * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13535         The previous code was bogus.  For example, next_almost_prime (32)
13536         returned 39, which is undesirable as it is a multiple of 3; and
13537         next_almost_prime (24) returned 25, which is a multiple of 5 so
13538         why was the code bothering to check for multiples of 7?
13540         * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13542         * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13544         Variadic C functions now count arguments with ptrdiff_t.
13545         This partly undoes my 2011-03-30 change, which replaced int with size_t.
13546         Back then I didn't know that the Emacs coding style prefers signed int.
13547         Also, in the meantime I found a few more instances where arguments
13548         were being counted with int, which may truncate counts on 64-bit
13549         machines, or EMACS_INT, which may be unnecessarily wide.
13550         * lisp.h (struct Lisp_Subr.function.aMANY)
13551         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13552         Arg counts are now ptrdiff_t, not size_t.
13553         All variadic functions and their callers changed accordingly.
13554         (struct gcpro.nvars): Now size_t, not size_t.  All uses changed.
13555         * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13556         to avoid potential buffer overrun.  Don't assume arg counts fit in 'int'.
13557         * callint.c (Fcall_interactively): Check arg count for overflow,
13558         to avoid potential buffer overrun.  Use signed char, not 'int',
13559         for 'varies' array, so that we needn't bother to check its size
13560         calculation for overflow.
13561         * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13562         * eval.c (apply_lambda):
13563         * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13564         (struct textprop_rec.argnum): Now ptrdiff_t, not int.  All uses changed.
13565         (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13567         * callint.c (Fcall_interactively): Don't use index var as event count.
13569         * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13570         * mem-limits.h (SIZE): Remove; no longer used.
13572         * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
13574         Remove unnecessary casts.
13575         * xterm.c (x_term_init):
13576         * xfns.c (x_set_border_pixel):
13577         * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13578         These aren't needed now that we assume ANSI C.
13580         * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13581         It's more likely to cause problems (due to unsigned overflow)
13582         than to cure them.
13584         * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13586         * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13588         * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13590         * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13592         * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13594         * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13596         GLYPH_CODE_FACE returns EMACS_INT, not int.
13597         * dispextern.h (merge_faces):
13598         * xfaces.c (merge_faces):
13599         * xdisp.c (get_next_display_element, next_element_from_display_vector):
13600         Don't assume EMACS_INT fits in int.
13602         * character.h (CHAR_VALID_P): Remove unused parameter.
13603         * fontset.c, lisp.h, xdisp.c: All uses changed.
13605         * editfns.c (Ftranslate_region_internal): Omit redundant test.
13607         * fns.c (concat): Minor tuning based on overflow analysis.
13608         This doesn't fix any bugs.  Use int to hold character, instead
13609         of constantly refetching from Emacs object.  Use XFASTINT, not
13610         XINT, for value known to be a character.  Don't bother comparing
13611         a single byte to 0400, as it's always less.
13613         * floatfns.c (Fexpt):
13614         * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13616         * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13617         for characters.
13619         * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13621         * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13622         Without this fix, on a 64-bit host (aset S 0 4294967386) would
13623         incorrectly succeed when S was a string, because 4294967386 was
13624         truncated before it was used.
13626         * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13627         Otherwise, an out-of-range integer could cause undefined behavior
13628         on a 64-bit host.
13630         * composite.c: Use int, not EMACS_INT, for characters.
13631         (fill_gstring_body, composition_compute_stop_pos): Use int, not
13632         EMACS_INT, for values that are known to be in character range.
13633         This doesn't fix any bugs but is the usual style inside Emacs and
13634         may generate better code on 32-bit machines.
13636         Make sure a 64-bit char is never passed to ENCODE_CHAR.
13637         This is for reasons similar to the recent CHAR_STRING fix.
13638         * charset.c (Fencode_char): Check that character arg is actually
13639         a character.  Pass an int to ENCODE_CHAR.
13640         * charset.h (ENCODE_CHAR): Verify that the character argument is no
13641         wider than 'int', as a compile-time check to prevent future regressions
13642         in this area.
13644         * character.c (char_string): Remove unnecessary casts.
13646         Make sure a 64-bit char is never passed to CHAR_STRING.
13647         Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13648         by silently ignoring the top 32 bits, allowing some values
13649         that were far too large to be valid characters.
13650         * character.h: Include <verify.h>.
13651         (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13652         arguments are no wider than unsigned, as a compile-time check
13653         to prevent future regressions in this area.
13654         * data.c (Faset):
13655         * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13656         (Fsubst_char_in_region):
13657         * fns.c (concat):
13658         * xdisp.c (decode_mode_spec_coding):
13659         Adjust to CHAR_STRING's new requirement.
13660         * editfns.c (Finsert_char, Fsubst_char_in_region):
13661         * fns.c (concat): Check that character args are actually
13662         characters.  Without this test, these functions did the wrong
13663         thing with wildly out-of-range values on 64-bit hosts.
13665         Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13666         These casts should not be needed on 32-bit hosts, either.
13667         * keyboard.c (read_char):
13668         * lread.c (Fload): Remove casts to unsigned.
13670         * lisp.h (UNSIGNED_CMP): New macro.
13671         This fixes comparison bugs on 64-bit hosts.
13672         (ASCII_CHAR_P): Use it.
13673         * casefiddle.c (casify_object):
13674         * character.h (ASCII_BYTE_P, CHAR_VALID_P)
13675         (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13676         * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13677         * dispextern.h (FACE_FROM_ID):
13678         * keyboard.c (read_char): Use UNSIGNED_CMP.
13680         * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13681         not to EMACS_INT, to avoid GCC warning.
13683         * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13685         * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13686         The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13687         isn't needed on 32-bit machines.
13689         * buffer.c (Fgenerate_new_buffer_name):
13690         Use EMACS_INT for count, not int.
13691         (advance_to_char_boundary): Return EMACS_INT, not int.
13693         * data.c (Qcompiled_function): Now static.
13695         * window.c (window_body_lines): Now static.
13697         * image.c (gif_load): Rename local to avoid shadowing.
13699         * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13700         (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13701         * alloc.c (make_save_value): Integer argument is now of type
13702         ptrdiff_t, not int.
13703         (mark_object): Use ptrdiff_t, not int.
13704         * lisp.h (pD): New macro.
13705         * print.c (print_object): Use it.
13707         * alloc.c: Use EMACS_INT, not int, to count objects.
13708         (total_conses, total_markers, total_symbols, total_vector_size)
13709         (total_free_conses, total_free_markers, total_free_symbols)
13710         (total_free_floats, total_floats, total_free_intervals)
13711         (total_intervals, total_strings, total_free_strings):
13712         Now EMACS_INT, not int.  All uses changed.
13713         (Fgarbage_collect): Compute overall total using a double, so that
13714         integer overflow is less likely to be a problem.  Check for overflow
13715         when converting back to an integer.
13716         (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13717         (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13718         These were 'int' variables that could overflow on 64-bit hosts;
13719         they were never used, so remove them instead of repairing them.
13720         (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
13721         (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13722         Previously, this ceilinged at INT_MAX, but that doesn't work on
13723         64-bit machines.
13724         (allocate_pseudovector): Don't use EMACS_INT when int would do.
13726         * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
13727         (allocate_vectorlike): Check for ptrdiff_t overflow.
13728         (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13729         when a (possibly-narrower) signed value would do just as well.
13730         We prefer using signed arithmetic, to avoid comparison confusion.
13732         * alloc.c: Catch some string size overflows that we were missing.
13733         (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13734         for convenience in STRING_BYTES_MAX.
13735         (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13736         The definition here is exact; the one in lisp.h was approximate.
13737         (allocate_string_data): Check for string overflow.  This catches
13738         some instances we weren't catching before.  Also, it catches
13739         size_t overflow on (unusual) hosts where SIZE_MAX <= min
13740         (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13741         and ptrdiff_t and EMACS_INT are both 64 bits.
13743         * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13744         All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
13745         * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
13747         * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13749         * alloc.c (Fmake_string): Check for out-of-range init.
13751 2011-06-15  Stefan Monnier  <monnier@iro.umontreal.ca>
13753         * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13755 2011-06-14  Jan Djärv  <jan.h.d@swipnet.se>
13757         * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13758         xg_get_default_scrollbar_width.
13760         * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13761         (int_gtk_range_get_value): Move to the scroll bar part of the file.
13762         (style_changed_cb): Call update_theme_scrollbar_width and call
13763         x_set_scroll_bar_default_width and xg_frame_set_char_size for
13764         all frames (Bug#8505).
13765         (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
13766         Call gtk_window_set_resizable if HAVE_GTK3.
13767         (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
13768         and height if HAVE_GTK3 (Bug#8505).
13769         (scroll_bar_width_for_theme): New variable.
13770         (update_theme_scrollbar_width): New function.
13771         (xg_get_default_scrollbar_width): Move code to
13772         update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
13773         (xg_initialize): Call update_theme_scrollbar_width.
13775         * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
13777         * emacsgtkfixed.c, emacsgtkfixed.h: New files.
13779 2011-06-12  Martin Rudalics  <rudalics@gmx.at>
13781         * frame.c (make_frame): Call other_buffer_safely instead of
13782         other_buffer.
13784         * window.c (temp_output_buffer_show): Call display_buffer with
13785         second argument Vtemp_buffer_show_specifiers and reset latter
13786         immediately after the call.
13787         (Vtemp_buffer_show_specifiers): New variable.
13788         (auto_window_vscroll_p, next_screen_context_lines)
13789         (Vscroll_preserve_screen_position): Remove leading asterisks from
13790         doc-strings.
13792 2011-06-12  Paul Eggert  <eggert@cs.ucla.edu>
13794         Fix minor problems found by GCC 4.6.0 static checking.
13795         * buffer.c (Qclone_number): Remove for now, as it's unused.
13796         (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13797         (record_buffer): Remove unused local.
13798         * frame.c (other_visible_frames, frame_buffer_list): Now static.
13799         (set_frame_buffer_list): Remove; unused.
13800         * frame.h (other_visible_frames): Remove decl.
13801         * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13802         * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13803         (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13804         if HAVE_GPM.
13805         * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13806         * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13807         Define only if HAVE_GPM.
13808         * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13809         (update_hints_inhibit): Remove; never set.  All uses removed.
13810         * widgetprv.h (emacsFrameClassRec): Remove decl.
13811         * window.c (delete_deletable_window): Now returns void, since it
13812         wasn't returning anything.
13813         (compare_window_configurations): Remove unused locals.
13814         * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13815         * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
13816         (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13817         the same widths as pointers.  This follows up on the 2011-05-06 patch.
13818         * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13819         * xterm.h: Likewise.
13820         (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13822 2011-06-12  Juanma Barranquero  <lekktu@gmail.com>
13824         * makefile.w32-in: Update dependencies.
13825         (LISP_H): Add lib/intprops.h.
13827 2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
13829         * image.c (gif_load): Add animation frame delay to the metadata.
13830         (syms_of_image): Use DEFSYM.  New symbol `delay'.
13832 2011-06-11  Martin Rudalics  <rudalics@gmx.at>
13834         * window.c (delete_deletable_window): Re-add.
13835         (Fset_window_configuration): Rewrite to handle dead buffers and
13836         consequently deletable windows.
13837         (window_tree, Fwindow_tree): Remove.  Supply functionality in
13838         window.el.
13839         (compare_window_configurations): Simplify code.
13841 2011-06-11  Andreas Schwab  <schwab@linux-m68k.org>
13843         * image.c (imagemagick_load_image): Fix type mismatch.
13844         (Fimagemagick_types): Likewise.
13846         * window.h (replace_buffer_in_windows): Declare.
13848 2011-06-11  Martin Rudalics  <rudalics@gmx.at>
13850         * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13851         Qclone_number.  Remove external declaration of Qdelete_window.
13852         (Fbuffer_list): Rewrite doc-string.  Minor restructuring of
13853         code.
13854         (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13855         Run Qbuffer_list_update_hook if allowed.
13856         (Fother_buffer): Rewrite doc-string.  Major rewrite for new
13857         buffer list implementation.
13858         (other_buffer_safely): New function.
13859         (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13860         calls to replace_buffer_in_windows and
13861         replace_buffer_in_windows_safely.  Run Qbuffer_list_update_hook
13862         if allowed.
13863         (record_buffer): Inhibit quitting and rewrite using quittable
13864         functions.  Run Qbuffer_list_update_hook if allowed.
13865         (Frecord_buffer, Funrecord_buffer): New functions.
13866         (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13867         Move switch-to-buffer to window.el.
13868         (bury-buffer): Move to window.el.
13869         (Vbuffer_list_update_hook): New variable.
13871         * lisp.h (other_buffer_safely): Add prototype in buffer.c
13872         section.
13874         * window.h (resize_frame_windows): Move up in code.
13875         (Fwindow_frame): Remove EXFUN.
13876         (replace_buffer_in_all_windows): Remove prototype.
13877         (replace_buffer_in_windows_safely): Add prototype.
13879         * window.c: Declare Qdelete_window static again.  Move down
13880         declaration of select_count.
13881         (Fnext_window, Fprevious_window): Rewrite doc-strings.
13882         (Fother_window): Move to window.el.
13883         (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
13884         cases.  Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
13885         (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
13886         window.el.
13887         (replace_buffer_in_windows): Implement by calling
13888         Qreplace_buffer_in_windows.
13889         (replace_buffer_in_all_windows): Remove with some functionality
13890         moved into replace_buffer_in_windows_safely.
13891         (replace_buffer_in_windows_safely): New function.
13892         (select_window_norecord, select_frame_norecord): Move in front
13893         of run_window_configuration_change_hook.  Remove now obsolete
13894         declarations.
13895         (Fset_window_buffer): Rewrite doc-string.
13896         Call Qrecord_window_buffer.
13897         (keys_of_window): Move binding for other-window to window.el.
13899 2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
13901         * dispextern.h (struct image): Replace data member, whose int_val
13902         and ptr_val fields were not used by anything, with a single
13903         lisp_val object.
13905         * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
13906         (gif_clear_image, gif_load, imagemagick_load_image)
13907         (gs_clear_image, gs_load): Callers changed.
13909 2011-06-10  Paul Eggert  <eggert@cs.ucla.edu>
13911         * buffer.h: Include <time.h>, for time_t.
13912         Needed to build on FreeBSD 8.2.  Problem reported by Herbert J. Skuhra.
13914         Fix minor problems found by static checking.
13916         * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
13918         Make identifiers static if they are not used in other modules.
13919         * data.c (Qcompiled_function, Qframe, Qvector):
13920         * image.c (QimageMagick, Qsvg):
13921         * minibuf.c (Qmetadata):
13922         * window.c (resize_window_check, resize_root_window): Now static.
13923         * window.h (resize_window_check, resize_root_window): Remove decls.
13925         * window.c (window_deletion_count, delete_deletable_window):
13926         Remove; unused.
13927         (window_body_lines): Now static.
13928         (Fdelete_other_windows_internal): Mark vars as initialized.
13929         Make sure 'resize_failed' is initialized.
13930         (run_window_configuration_change_hook): Rename local to avoid shadowing.
13931         (resize_window_apply): Remove unused local.
13932         * window.h (delete_deletable_window): Remove decl.
13934         * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
13935         (imagemagick_load_image): Fix pointer signedness problem by changing
13936         last arg from unsigned char * to char *.  All uses changed.
13937         Also, fix a local for similar reasons.
13938         Remove unused locals.  Remove locals to avoid shadowing.
13939         (fn_rsvg_handle_free): Remove; unused.
13940         (svg_load, svg_load_image): Fix pointer signedness problem.
13941         (imagemagick_load_image): Don't use garbage pointer image_wand.
13943         * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
13945 2011-06-10  Chong Yidong  <cyd@stupidchicken.com>
13947         * image.c (gif_load): Fix omitted cast error introduced by
13948         2011-06-06 change.
13950 2011-06-10  Martin Rudalics  <rudalics@gmx.at>
13952         * window.h (resize_proportionally, orig_total_lines)
13953         (orig_top_line): Remove from window structure.
13954         (set_window_height, set_window_width, change_window_heights)
13955         (Fdelete_window): Remove prototypes.
13956         (resize_frame_windows): Remove duplicate declaration.
13958 2011-06-10  Eli Zaretskii  <eliz@gnu.org>
13960         * window.h (resize_frame_windows, resize_window_check)
13961         (delete_deletable_window, resize_root_window)
13962         (resize_frame_windows): Declare prototypes.
13964         * window.c (resize_window_apply): Make definition be "static" to
13965         match the prototype.
13967 2011-06-10  Martin Rudalics  <rudalics@gmx.at>
13969         * window.c: Remove declarations of Qwindow_size_fixed,
13970         window_min_size_1, window_min_size_2, window_min_size,
13971         size_window, window_fixed_size_p, enlarge_window, delete_window.
13972         Remove static from declaration of Qdelete_window, it's
13973         temporarily needed by Fbury_buffer.
13974         (replace_window): Don't assign orig_top_line and
13975         orig_total_lines.
13976         (Fdelete_window, delete_window): Remove.  Window deletion is
13977         handled by window.el.
13978         (window_loop): Remove DELETE_OTHER_WINDOWS case.
13979         Replace Fdelete_window calls with calls to Qdelete_window.
13980         (Fdelete_other_windows): Remove.  Deleting other windows is
13981         handled by window.el.
13982         (window_fixed_size_p): Remove.  Fixed-sizeness of windows is
13983         handled in window.el.
13984         (window_min_size_2, window_min_size_1, window_min_size): Remove.
13985         Window minimum sizes are handled in window.el.
13986         (shrink_windows, size_window, set_window_height)
13987         (set_window_width, change_window_heights, window_height)
13988         (window_width, CURBEG, CURSIZE, enlarge_window)
13989         (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
13990         (Fenlarge_window, Fshrink_window): Remove.  Window resizing is
13991         handled in window.el.
13992         (make_dummy_parent): Rename to make_parent_window and give it a
13993         second argument horflag.
13994         (make_window): Don't set resize_proportionally any more.
13995         (Fsplit_window): Remove.  Windows are split in window.el.
13996         (save_restore_action, save_restore_orig_size)
13997         (shrink_window_lowest_first, save_restore_orig_size): Remove.
13998         Resize mini windows in window.el.
13999         (grow_mini_window, shrink_mini_window): Implement by calling
14000         Qresize_root_window_vertically, resize_window_check and
14001         resize_window_apply.
14002         (saved_window, Fset_window_configuration, save_window_save):
14003         Do not handle orig_top_line, orig_total_lines, and
14004         resize_proportionally.
14005         (window_min_height, window_min_width): Move to window.el.
14006         (keys_of_window): Move bindings for delete-other-windows,
14007         split-window, delete-window and enlarge-window to window.el.
14009         * buffer.c: Temporarily extern Qdelete_window.
14010         (Fbury_buffer): Temporarily call Qdelete_window instead of
14011         Fdelete_window (Fbury_buffer will move to window.el soon).
14013         * frame.c (set_menu_bar_lines_1): Remove code handling
14014         orig_top_line and orig_total_lines.
14016         * dispnew.c (adjust_frame_glyphs_initially): Don't use
14017         set_window_height but set heights directly.
14018         (change_frame_size_1): Use resize_frame_windows.
14020         * xdisp.c (init_xdisp): Don't use set_window_height but set
14021         heights directly.
14023         * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14024         Use resize_frame_windows instead of change_window_heights and run
14025         run_window_configuration_change_hook.
14027         * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14028         instead of change_window_heights and run
14029         run_window_configuration_change_hook.
14031 2011-06-09  Martin Rudalics  <rudalics@gmx.at>
14033         * window.c (replace_window): Rename second argument REPLACEMENT to
14034         NEW.  New third argument SETFLAG.  Rewrite.
14035         (delete_window, make_dummy_parent): Call replace_window with
14036         third argument 1.
14037         (window_list_1): Move down in code.
14038         (run_window_configuration_change_hook): Move set_buffer part
14039         before select_frame_norecord part in order to unwind correctly.
14040         Rename count1 to count.
14041         (recombine_windows, delete_deletable_window, resize_root_window)
14042         (Fdelete_other_windows_internal)
14043         (Frun_window_configuration_change_hook, make_parent_window)
14044         (resize_window_check, resize_window_apply, Fresize_window_apply)
14045         (resize_frame_windows, Fsplit_window_internal)
14046         (Fdelete_window_internal, Fresize_mini_window_internal):
14047         New functions.
14048         (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14050 2011-06-08  Martin Rudalics  <rudalics@gmx.at>
14052         * window.h (window): Add some new members to window structure -
14053         normal_lines, normal_cols, new_total, new_normal, clone_number,
14054         splits, nest, prev_buffers, next_buffers.
14055         (WINDOW_TOTAL_SIZE): Move here from window.c.
14056         (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
14058         * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14059         Remove.
14060         (make_dummy_parent): Set new members of windows structure.
14061         (make_window): Move down in code.  Handle new members of window
14062         structure.
14063         (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14064         (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14065         (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14066         (Fset_window_prev_buffers, Fwindow_next_buffers)
14067         (Fset_window_next_buffers, Fset_window_clone_number):
14068         New functions.
14069         (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14070         (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14071         Doc-string fixes.
14072         (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14073         Argument WINDOW can be now internal window too.
14074         (Fwindow_use_time): Move up in code.
14075         (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14076         Rewrite doc-string.
14077         (Fset_window_configuration, saved_window)
14078         (Fcurrent_window_configuration, save_window_save): Handle new
14079         members of window structure.
14080         (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14081         (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14082         (syms_of_window): New Lisp objects Qrecord_window_buffer,
14083         Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14084         Qget_mru_window, Qresize_root_window,
14085         Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14086         Qauto_buffer_name; staticpro them.
14088 2011-06-07  Martin Rudalics  <rudalics@gmx.at>
14090         * window.c (Fwindow_total_size, Fwindow_left_column)
14091         (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14092         (Fwindow_list_1): New functions.
14093         (window_box_text_cols): Replace with window_body_cols.
14094         (Fwindow_width, Fscroll_left, Fscroll_right):
14095         Use window_body_cols instead of window_box_text_cols.
14096         (delete_window, Fset_window_configuration):
14097         Call delete_all_subwindows with window as argument.
14098         (delete_all_subwindows): Take a window as argument and not a
14099         structure.  Rewrite.
14100         (window_loop): Remove handling of GET_LRU_WINDOW and
14101         GET_LARGEST_WINDOW.
14102         (Fget_lru_window, Fget_largest_window): Move to window.el.
14104         * window.h: Extern window_body_cols instead of
14105         window_box_text_cols.  delete_all_subwindows now takes a
14106         Lisp_Object as argument.
14108         * indent.c (compute_motion, Fcompute_motion):
14109         Use window_body_cols instead of window_box_text_cols.
14111         * frame.c (delete_frame): Call delete_all_subwindows with root
14112         window as argument.
14114 2011-06-07  Daniel Colascione  <dan.colascione@gmail.com>
14116         * fns.c (Fputhash): Document return value.
14118 2011-06-06  Chong Yidong  <cyd@stupidchicken.com>
14120         * image.c (gif_load): Implement gif89a spec "no disposal" method.
14122 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
14124         Cons<->int and similar integer overflow fixes (Bug#8794).
14126         Check for overflow when converting integer to cons and back.
14127         * charset.c (Fdefine_charset_internal, Fdecode_char):
14128         Use cons_to_unsigned to catch overflow.
14129         (Fencode_char): Use INTEGER_TO_CONS.
14130         * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14131         (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14132         * data.c (long_to_cons, cons_to_long): Remove.
14133         (cons_to_unsigned, cons_to_signed): New functions.
14134         These signal an error for invalid or out-of-range values.
14135         * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14136         * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14137         * font.c (Ffont_variation_glyphs):
14138         * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14139         * lisp.h: Include <intprops.h>.
14140         (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14141         (cons_to_signed, cons_to_unsigned): New decls.
14142         (long_to_cons, cons_to_long): Remove decls.
14143         * undo.c (record_first_change): Use INTEGER_TO_CONS.
14144         (Fprimitive_undo): Use CONS_TO_INTEGER.
14145         * xfns.c (Fx_window_property): Likewise.
14146         * xselect.c: Include <limits.h>.
14147         (x_own_selection, selection_data_to_lisp_data):
14148         Use INTEGER_TO_CONS.
14149         (x_handle_selection_request, x_handle_selection_clear)
14150         (x_get_foreign_selection, Fx_disown_selection_internal)
14151         (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14152         (lisp_data_to_selection_data): Use cons_to_unsigned.
14153         (x_fill_property_data): Use cons_to_signed.
14154         Report values out of range.
14156         Check for buffer and string overflow more precisely.
14157         * buffer.h (BUF_BYTES_MAX): New macro.
14158         * lisp.h (STRING_BYTES_MAX): New macro.
14159         * alloc.c (Fmake_string):
14160         * character.c (string_escape_byte8):
14161         * coding.c (coding_alloc_by_realloc):
14162         * doprnt.c (doprnt):
14163         * editfns.c (Fformat):
14164         * eval.c (verror):
14165         Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14166         since they may not be the same number.
14167         * editfns.c (Finsert_char):
14168         * fileio.c (Finsert_file_contents):
14169         Likewise for BUF_BYTES_MAX.
14171         * image.c: Use ptrdiff_t, not int, for sizes.
14172         (slurp_file): Switch from int to ptrdiff_t.
14173         All uses changed.
14174         (slurp_file): Check that file size fits in both size_t (for
14175         malloc) and ptrdiff_t (for sanity and safety).
14177         * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14178         if b->modtime has its maximal value.
14180         * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14182         Don't assume time_t can fit into int.
14183         * buffer.h (struct buffer.modtime): Now time_t, not int.
14184         * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14185         * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14187         Minor fixes for signed vs unsigned integers.
14188         * character.h (MAYBE_UNIFY_CHAR):
14189         * charset.c (maybe_unify_char):
14190         * keyboard.c (read_char, reorder_modifiers):
14191         XINT -> XFASTINT, since the integer must be nonnegative.
14192         * ftfont.c (ftfont_spec_pattern):
14193         * keymap.c (access_keymap, silly_event_symbol_error):
14194         XUINT -> XFASTINT, since the integer must be nonnegative.
14195         (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14196         since it makes no difference and we prefer signed.
14197         * keyboard.c (record_char): Use XUINT when all the neighbors do.
14198         (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14199         nonnegative.
14201 2011-06-06  Stefan Monnier  <monnier@iro.umontreal.ca>
14203         * window.h (Fwindow_frame): Declare.
14205 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
14207         * alloc.c: Simplify handling of large-request failures (Bug#8800).
14208         (SPARE_MEMORY): Always define.
14209         (LARGE_REQUEST): Remove.
14210         (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14212 2011-06-06  Martin Rudalics  <rudalics@gmx.at>
14214         * lisp.h: Move EXFUNS for Fframe_root_window,
14215         Fframe_first_window and Fset_frame_selected_window to window.h.
14217         * window.h: Move EXFUNS for Fframe_root_window,
14218         Fframe_first_window and Fset_frame_selected_window here from
14219         lisp.h.
14221         * frame.c (Fwindow_frame, Fframe_first_window)
14222         (Fframe_root_window, Fframe_selected_window)
14223         (Fset_frame_selected_window): Move to window.c.
14224         (Factive_minibuffer_window): Move to minibuf.c.
14225         (Fother_visible_frames_p): New function.
14227         * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14229         * window.c (decode_window, decode_any_window): Move up in code.
14230         (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14231         (inhibit_frame_unsplittable): Remove unused variable.
14232         (Fwindow_buffer): Move up and rewrite doc-string.
14233         (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14234         (Fwindow_prev): New functions.
14235         (Fwindow_frame): Move here from frame.c.  Accept any window as
14236         argument.
14237         (Fframe_root_window, Fframe_first_window)
14238         (Fframe_selected_window): Move here from frame.c.  Accept frame
14239         or arbitrary window as argument.  Update doc-strings.
14240         (Fminibuffer_window): Move up in code.
14241         (Fwindow_minibuffer_p): Move up in code and simplify.
14242         (Fset_frame_selected_window): Move here from frame.c.
14243         Marginal rewrite.
14244         (Fselected_window, select_window, Fselect_window): Move up in
14245         code.  Minor doc-string fixes.
14247 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
14249         * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14250         Do not assume that spare memory exists; that assumption is valid
14251         only if SYSTEM_MALLOC.
14252         (LARGE_REQUEST): New macro, so that the issue of large requests
14253         is separated from the issue of spare memory.
14255 2011-06-05  Andreas Schwab  <schwab@linux-m68k.org>
14257         * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14258         format.  (Bug#8806)
14260         * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14262         * xfns.c (x_set_scroll_bar_default_width): Move declarations
14263         before statements.
14265 2011-06-05  Jan Djärv  <jan.h.d@swipnet.se>
14267         * gtkutil.c (xg_get_default_scrollbar_width): New function.
14269         * gtkutil.h: Declare xg_get_default_scrollbar_width.
14271         * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14272         min width by calling x_set_scroll_bar_default_width (Bug#8505).
14274 2011-06-05  Juanma Barranquero  <lekktu@gmail.com>
14276         * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14278 2011-06-04  Chong Yidong  <cyd@stupidchicken.com>
14280         * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14281         (x_clipboard_manager_save): Add return value.
14282         (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14283         New error handlers.
14284         (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14285         Obey Vx_select_enable_clipboard_manager.  Catch errors in
14286         x_clipboard_manager_save (Bug#8779).
14287         (Vx_select_enable_clipboard_manager): New variable.
14288         (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
14290 2011-06-04  Dan Nicolaescu  <dann@ics.uci.edu>
14292         * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14294 2011-06-04  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
14296         * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14297         in the current matrix if keep_current_p is non-zero.
14299 2011-06-04  Eli Zaretskii  <eliz@gnu.org>
14301         * bidi.c (bidi_level_of_next_char): Fix last change.
14303 2011-06-03  Eli Zaretskii  <eliz@gnu.org>
14305         Support bidi reordering of text covered by display properties.
14307         * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14308         (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14309         (bidi_cache_search, bidi_cache_iterator_state)
14310         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
14311         (bidi_level_of_next_char, bidi_move_to_visually_next):
14312         Support character positions inside a run of characters covered by a
14313         display string.
14314         (bidi_paragraph_init, bidi_resolve_explicit_1)
14315         (bidi_level_of_next_char): Call bidi_fetch_char and
14316         bidi_fetch_char_advance instead of FETCH_CHAR and
14317         FETCH_CHAR_ADVANCE.
14318         (bidi_init_it): Initialize new members.
14319         (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14320         definitions.
14321         (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14322         instead of using explicit *_CHAR codes.
14323         (bidi_resolve_explicit, bidi_resolve_weak):
14324         Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
14325         bidirectional text is supported only in multibyte buffers.
14326         (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14327         it to initialize the frame_window_p member of struct bidi_it.
14328         (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14329         (bidi_resolve_explicit, bidi_resolve_weak)
14330         (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14331         bidi_it->nchars is non-positive.
14332         (bidi_level_of_next_char): Don't try to lookup the cache for the
14333         next/previous character if nothing is cached there yet, or if we
14334         were just reseat()'ed to a new position.
14336         * xdisp.c (set_cursor_from_row): Set start and stop points
14337         according to the row's direction when priming the loop that looks
14338         for the glyph on which to display cursor.
14339         (single_display_spec_intangible_p): Function deleted.
14340         (display_prop_intangible_p): Reimplement to call
14341         handle_display_spec instead of single_display_spec_intangible_p.
14342         Accept 3 additional arguments needed by handle_display_spec.
14343         This fixes incorrect cursor motion across display property with complex
14344         values: lists, `(when COND...)' forms, etc.
14345         (single_display_spec_string_p): Support property values that are
14346         lists with the argument STRING its top-level element.
14347         (display_prop_string_p): Fix the condition for processing a
14348         property that is a list to be consistent with handle_display_spec.
14349         (handle_display_spec): New function, refactored from the
14350         last portion of handle_display_prop.
14351         (compute_display_string_pos): Accept additional argument
14352         FRAME_WINDOW_P.  Call handle_display_spec to determine whether the
14353         value of a `display' property is a "replacing spec".
14354         (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14355         and FRAME_WINDOW_P.  If IT is NULL, don't set up the iterator from
14356         the display property, but just return a value indicating whether
14357         the display property will replace the characters it covers.
14358         (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14359         frame_window_p members of struct bidi_it.
14360         (compute_display_string_pos, compute_display_string_end):
14361         New functions.
14362         (push_it): Accept second argument POSITION, where pop_it should
14363         jump to continue iteration.
14364         (reseat_1): Initialize bidi_it.disp_pos.
14366         * keyboard.c (adjust_point_for_property): Adjust the call to
14367         display_prop_intangible_p to its new signature.
14369         * dispextern.h (struct bidi_it): New member frame_window_p.
14370         (bidi_init_it): Update prototypes.
14371         (display_prop_intangible_p): Update prototype.
14372         (compute_display_string_pos, compute_display_string_end):
14373         Declare prototypes.
14374         (struct bidi_it): New members nchars and disp_pos.  ch_len is now
14375         EMACS_INT.
14377 2011-06-02  Paul Eggert  <eggert@cs.ucla.edu>
14379         Malloc failure behavior now depends on size of allocation.
14380         * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14381         * lisp.h: Change signatures accordingly.
14382         * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14383         All callers changed.  (Bug#8762)
14385         * gnutls.c: Use Emacs's memory allocators.
14386         Without this change, the gnutls library would invoke malloc etc.
14387         directly, which causes problems on non-SYNC_INPUT hosts, and which
14388         runs afoul of improving memory_full behavior.  (Bug#8761)
14389         (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14390         (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14391         xfree instead of the default malloc, realloc, free.
14392         (Fgnutls_boot): No need to check for memory allocation failure,
14393         since xmalloc does that for us.
14395         Remove arbitrary limit of 2**31 entries in hash tables.  (Bug#8771)
14396         * category.c (hash_get_category_set):
14397         * ccl.c (ccl_driver):
14398         * charset.c (Fdefine_charset_internal):
14399         * charset.h (struct charset.hash_index):
14400         * composite.c (get_composition_id, gstring_lookup_cache)
14401         (composition_gstring_put_cache):
14402         * composite.h (struct composition.hash_index):
14403         * dispextern.h (struct image.hash):
14404         * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14405         (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14406         (hashfn_equal, hashfn_user_defined, make_hash_table)
14407         (maybe_resize_hash_table, hash_lookup, hash_put)
14408         (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14409         (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14410         (Fsxhash, Fgethash, Fputhash, Fmaphash):
14411         * image.c (make_image, search_image_cache, lookup_image)
14412         (xpm_put_color_table_h):
14413         * lisp.h (struct Lisp_Hash_Table):
14414         * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
14415         * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
14416         for hashes and hash indexes, instead of 'unsigned' and 'int'.
14417         * alloc.c (allocate_vectorlike):
14418         Check for overflow in vector size calculations.
14419         * ccl.c (ccl_driver):
14420         Check for overflow when converting EMACS_INT to int.
14421         * fns.c, image.c: Remove unnecessary static decls that would otherwise
14422         need to be updated by these changes.
14423         * fns.c (make_hash_table, maybe_resize_hash_table):
14424         Check for integer overflow with large hash tables.
14425         (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14426         Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14427         (SXHASH_REDUCE): New macro.
14428         (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14429         Use it instead of discarding useful hash info with large hash values.
14430         (sxhash_float): New function.
14431         (sxhash): Use it.  No more need for "& INTMASK" due to above changes.
14432         * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
14433         (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14434         Rewrite to use FIXNUM_BITS, as this simplifies things.
14435         (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14436         Adjust signatures to match updated version of code.
14437         (consing_since_gc): Now EMACS_INT, since a single hash table can
14438         use more than INT_MAX bytes.
14440 2011-06-01  Dan Nicolaescu  <dann@ics.uci.edu>
14442         Make it possible to build with GCC-4.6+ -O2 -flto.
14444         * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14446 2011-06-01  Stefan Monnier  <monnier@iro.umontreal.ca>
14448         * minibuf.c (get_minibuffer, read_minibuf_unwind):
14449         Call minibuffer-inactive-mode.
14451 2011-05-31  Juanma Barranquero  <lekktu@gmail.com>
14453         * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14454         Update dependencies.
14456 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
14458         * data.c (init_data): Remove code for UTS, this system is not
14459         supported anymore.
14461 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
14463         Don't force ./temacs to start in terminal mode.
14465         * frame.c (make_initial_frame): Initialize faces in all cases, not
14466         only when CANNOT_DUMP is defined.
14467         * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14469 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
14471         * dispnew.c (add_window_display_history): Use const for the string
14472         pointer.  Remove declaration, not needed.
14474 2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
14476         Use 'inline', not 'INLINE'.
14477         <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
14478         * alloc.c, fontset.c (INLINE): Remove.
14479         * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14480         * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14481         * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14482         * gmalloc.c (register_heapinfo): Use inline unconditionally.
14483         * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14485 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
14487         Make it possible to run ./temacs.
14489         * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14490         syms_of_callproc does the same thing.  Remove test for
14491         "initialized", do it in the caller.
14492         * emacs.c (main): Avoid calling set_initial_environment when dumping.
14494 2011-05-31  Stefan Monnier  <monnier@iro.umontreal.ca>
14496         * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14497         (read_minibuf): Use get_minibuffer.
14498         (syms_of_minibuf): Use DEFSYM.
14499         (Qmetadata): New var.
14500         * data.c (Qbuffer): Don't make it static.
14501         (syms_of_data): Use DEFSYM.
14503 2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
14505         * ccl.c (CCL_CODE_RANGE): Allow negative numbers.  (Bug#8751)
14506         (CCL_CODE_MIN): New macro.
14508 2011-05-30  Paul Eggert  <eggert@cs.ucla.edu>
14510         * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14512         * eval.c (Qdebug): Now static.
14513         * lisp.h (Qdebug): Remove decl.  This reverts a part of the
14514         2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14515         2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14517 2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
14519         * image.c: Various fixes to ImageMagick code comments.
14520         (Fimagemagick_types): Doc fix.
14522 2011-05-29  Paul Eggert  <eggert@cs.ucla.edu>
14524         Minor fixes prompted by GCC 4.6.0 warnings.
14526         * xselect.c (converted_selections, conversion_fail_tag): Now static.
14528         * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14529         (x_clipboard_manager_save_all): Move extern decl to ...
14530         * xterm.h: ... here, so that it can be checked for consistency.
14532 2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
14534         * xselect.c (x_clipboard_manager_save_frame)
14535         (x_clipboard_manager_save_all): New functions.
14536         (Fx_clipboard_manager_save): Lisp function deleted.
14538         * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14539         * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14541         * xterm.h: Update prototype.
14543 2011-05-28  William Xu  <william.xwl@gmail.com>
14545         * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14546         exiting (Bug#8239).
14548 2011-05-28  Jim Meyering  <meyering@redhat.com>
14550         Avoid a sign-extension bug in crypto_hash_function.
14551         * fns.c (to_uchar): Define.
14552         (crypto_hash_function): Use it to convert some newly-signed
14553         variables to unsigned, to avoid sign-extension bugs.  For example,
14554         without this change, (md5 "truc") would evaluate to
14555         45723a2aff78ff4fff7fff1114760e62 rather than the expected
14556         45723a2af3788c4ff17f8d1114760e62.  Reported by Antoine Levitt in
14557         https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
14559 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
14561         Integer overflow fixes.
14563         * dbusbind.c: Serial number integer overflow fixes.
14564         (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
14565         (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14566         to hold a serial number that is too large for a fixnum.
14567         (Fdbus_method_return_internal, Fdbus_method_error_internal):
14568         Check for serial numbers out of range.  Decode any serial number
14569         that was so large that it became a float.  (Bug#8722)
14571         * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14572         (Fdbus_call_method, Fdbus_call_method_asynchronously):
14573         Use XFASTINT rather than XUINT when numbers are nonnegative.
14574         (xd_append_arg, Fdbus_method_return_internal):
14575         (Fdbus_method_error_internal): Likewise.  Also, for unsigned
14576         arguments, check that Lisp number is nonnegative, rather than
14577         silently wrapping negative numbers around.  (Bug#8722)
14578         (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
14579         (Bug#8722)
14581         * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14583         * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14585         ccl: Add integer overflow checks.
14586         * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14587         (IN_INT_RANGE): New macros.
14588         (ccl_driver): Use them to check for integer overflow when
14589         decoding a CCL program.  Many of the new checks are whether XINT (x)
14590         fits in int; it doesn't always, on 64-bit hosts.  The new version
14591         doesn't catch all possible integer overflows, but it's an
14592         improvement.  (Bug#8719)
14594         * alloc.c (make_event_array): Use XINT, not XUINT.
14595         There's no need for unsigned here.
14597         * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14598         This follows up to the 2011-05-06 change that substituted uintptr_t
14599         for EMACS_INT.  This case wasn't caught back then.
14601         Rework Fformat to avoid integer overflow issues.
14602         * editfns.c: Include <float.h> unconditionally, as it's everywhere
14603         now (part of C89).  Include <verify.h>.
14604         (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14605         (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14606         (Fformat): Avoid the prepass trying to compute sizes; it was only
14607         approximate and thus did not catch overflow reliably.  Instead, walk
14608         through the format just once, formatting and computing sizes as we go,
14609         checking for integer overflow at every step, and allocating a larger
14610         buffer as needed.  Keep track separately whether the format is
14611         multibyte.  Keep only the most-recently calculated precision, rather
14612         than them all.  Record whether each argument has been converted to
14613         string.  Use EMACS_INT, not int, for byte and char and arg counts.
14614         Support field widths and precisions larger than INT_MAX.  Avoid
14615         sprintf's undefined behavior with conversion specifications such as %#d
14616         and %.0c.  Fix bug with strchr succeeding on '\0' when looking for
14617         flags.  Fix bug with (format "%c" 256.0).  Avoid integer overflow when
14618         formatting out-of-range floating point numbers with int
14619         formats.  (Bug#8668)
14621         * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14623         * data.c: Avoid integer truncation in expressions involving floats.
14624         * data.c: Include <intprops.h>.
14625         (arith_driver): When there's an integer overflow in an expression
14626         involving floating point, convert the integers to floating point
14627         so that the resulting value does not suffer from catastrophic
14628         integer truncation.  For example, on a 64-bit host (* 4
14629         most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14630         Do not rely on undefined behavior after integer overflow.
14632         merge count_size_as_multibyte, parse_str_to_multibyte
14633         * character.c, character.h (count_size_as_multibyte):
14634         Rename from parse_str_to_multibyte; all uses changed.
14635         Check for integer overflow.
14636         * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14637         since it's now a duplicate of the other.  This is more of
14638         a character than a buffer op, so better that it's in character.c.
14639         * fns.c, print.c: Adjust to above changes.
14641 2011-05-27  Stefan Monnier  <monnier@iro.umontreal.ca>
14643         * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14645 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
14647         * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14648         (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14649         (x_clipboard_manager_save): Now static.
14650         (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14652         * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14653         (crypto_hash_function): Now static.
14654         Fix pointer signedness problems.  Avoid unnecessary initializations.
14656 2011-05-27  Chong Yidong  <cyd@stupidchicken.com>
14658         * termhooks.h (Vselection_alist): Make it terminal-local.
14660         * terminal.c (create_terminal): Initialize it.
14662         * xselect.c: Support for clipboard managers.
14663         (Vselection_alist): Move to termhooks.h as terminal-local var.
14664         (LOCAL_SELECTION): New macro.
14665         (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14666         (symbol_to_x_atom): Remove gratuitous arg.
14667         (x_handle_selection_request, lisp_data_to_selection_data)
14668         (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
14669         (x_own_selection, x_get_local_selection, x_convert_selection):
14670         New arg, specifying work frame.  Use terminal-local Vselection_alist.
14671         (some_frame_on_display): Delete unused function.
14672         (Fx_own_selection_internal, Fx_get_selection_internal)
14673         (Fx_disown_selection_internal, Fx_selection_owner_p)
14674         (Fx_selection_exists_p): New optional frame arg.
14675         (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14676         (x_handle_selection_clear): Don't treat other terminals with the
14677         same keyboard specially.  Use the terminal-local Vselection_alist.
14678         (x_clear_frame_selections): Use Frun_hook_with_args.
14680         * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14682         * xterm.h: Add support for those atoms.
14684 2011-05-26  Chong Yidong  <cyd@stupidchicken.com>
14686         * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14687         (converted_selections, conversion_fail_tag): New global variables.
14688         (x_selection_request_lisp_error): Free the above.
14689         (x_get_local_selection): Remove unnecessary code.
14690         (x_reply_selection_request): Args changed; handle arbitrary array
14691         of converted selections stored in converted_selections.
14692         Separate the XChangeProperty and SelectionNotify steps.
14693         (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14694         (x_convert_selection): New function.
14695         (x_handle_selection_event): Simplify.
14696         (x_get_foreign_selection): Don't ignore incoming requests while
14697         waiting for an answer; this will fail when we implement
14698         SAVE_TARGETS, and seems unnecessary anyway.
14699         (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14700         (Vx_sent_selection_functions): Doc fix.
14702 2011-05-26  Leo Liu  <sdl.web@gmail.com>
14704         * editfns.c (Ftranspose_regions): Allow empty regions.  (Bug#8699)
14706 2011-05-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
14708         * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14710         * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14711         for fringe update if it has periodic bitmap.
14712         (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
14713         and fringe_bitmap_periodic_p.
14715         * fringe.c (get_fringe_bitmap_data): New function.
14716         (draw_fringe_bitmap_1, update_window_fringes): Use it.
14717         (update_window_fringes): Record periodicity of fringe bitmap in glyph
14718         row.  Mark glyph row for fringe update if periodicity changed.
14720         * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14721         for fringe update unless it has periodic bitmap.
14723 2011-05-25  Kenichi Handa  <handa@m17n.org>
14725         * xdisp.c (get_next_display_element): Set correct it->face_id for
14726         a static composition.
14728 2011-05-24  Leo Liu  <sdl.web@gmail.com>
14730         * deps.mk (fns.o):
14731         * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14733         * fns.c (crypto_hash_function, Fsha1): New function.
14734         (Fmd5): Use crypto_hash_function.
14735         (syms_of_fns): Add Ssha1.
14737 2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
14739         * gnutls.c: Remove unused macros.
14740         (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14741         (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14742         Remove macros that are defined and never used.
14743         Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14745 2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
14747         * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14748         (Fx_get_selection_internal): Minor cleanup.
14749         (Fx_own_selection_internal): Rename arguments for consistency with
14750         select.el.
14752 2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
14754         * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14756 2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
14758         * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14760 2011-05-21  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
14762         * dispnew.c (scrolling_window): Don't exclude the case that the
14763         last enabled row in the desired matrix touches the bottom boundary.
14765 2011-05-21  Glenn Morris  <rgm@gnu.org>
14767         * Makefile.in ($(etc)/DOC): Make second command line even shorter.
14768         (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
14769         and add some more files.
14771 2011-05-20  Eli Zaretskii  <eliz@gnu.org>
14773         * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
14774         report_file_error introduced by the change from 2011-05-07.
14776 2011-05-20  Paul Eggert  <eggert@cs.ucla.edu>
14778         * systime.h (Time): Define only if emacs is defined.
14779         This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
14780         where the include path doesn't have X11/X.h by default.  See
14781         <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
14783 2011-05-20  Kenichi Handa  <handa@m17n.org>
14785         * composite.c (find_automatic_composition): Fix previous change.
14787 2011-05-20  Glenn Morris  <rgm@gnu.org>
14789         * lisp.mk: New file, split from Makefile.in.
14790         * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
14791         (shortlisp): Remove.
14792         ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
14794 2011-05-19  Glenn Morris  <rgm@gnu.org>
14796         * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14797         (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14798         (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14799         (lisp): Set the order to that of loadup.el.
14800         (shortlisp): Make it a copy of $lisp.
14801         (SOME_MACHINE_LISP): Remove.
14802         ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14803         Use just $shortlisp, not $SOME_MACHINE_LISP too.
14805 2011-05-18  Kenichi Handa  <handa@m17n.org>
14807         * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14808         (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14809         (find_automatic_composition): Mostly rewrite for efficiency.
14811 2011-05-18  Juanma Barranquero  <lekktu@gmail.com>
14813         * makefile.w32-in: Update dependencies.
14815 2011-05-18  Christoph Scholtes  <cschol2112@googlemail.com>
14817         * menu.c: Include limits.h (fixes the MS-Windows build broken by
14818         2011-06-18T18:49:19Z!cyd@stupidchicken.com).
14820 2011-05-18  Paul Eggert  <eggert@cs.ucla.edu>
14822         Fix some integer overflow issues, such as string length overflow.
14824         * insdel.c (count_size_as_multibyte): Check for string overflow.
14826         * character.c (lisp_string_width): Check for string overflow.
14827         Use EMACS_INT, not int, for string indexes and lengths; in
14828         particular, 2nd arg is now EMACS_INT, not int.  Do not crash if
14829         the resulting string length overflows an EMACS_INT; instead,
14830         report a string overflow if no precision given.  When checking for
14831         precision exhaustion, use a check that cannot possibly have
14832         integer overflow.  (Bug#8675)
14833         * character.h (lisp_string_width): Adjust to new signature.
14835         * alloc.c (string_overflow): New function.
14836         (Fmake_string): Use it.  This doesn't change behavior, but saves
14837         a few bytes and will simplify future changes.
14838         * character.c (string_escape_byte8): Likewise.
14839         * lisp.h (string_overflow): New decl.
14841         Fixups, following up to the user-interface timestamp change.
14842         * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14843         for UI timestamps, instead of unsigned long.
14844         * msdos.c (mouse_get_pos): Likewise.
14845         * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
14846         * w32gui.h (Time): Define by including "systime.h" rather than by
14847         declaring it ourselves.  (Bug#8664)
14849         * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14850         * image.c (clear_image_cache): Likewise.
14852         * term.c (term_mouse_position): Don't assume time_t wraparound.
14854         Be more systematic about user-interface timestamps.
14855         Before, the code sometimes used 'Time', sometimes 'unsigned long',
14856         and sometimes 'EMACS_UINT', to represent these timestamps.
14857         This change causes it to use 'Time' uniformly, as that's what X uses.
14858         This makes the code easier to follow, and makes it easier to catch
14859         integer overflow bugs such as Bug#8664.
14860         * frame.c (Fmouse_position, Fmouse_pixel_position):
14861         Use Time, not unsigned long, for user-interface timestamps.
14862         * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14863         (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14864         * keyboard.h (last_event_timestamp): Likewise.
14865         * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14866         * menu.h (xmenu_show): Likewise.
14867         * term.c (term_mouse_position): Likewise.
14868         * termhooks.h (struct input_event.timestamp): Likewise.
14869         (struct terminal.mouse_position_hook): Likewise.
14870         * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
14871         * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
14872         * systime.h (Time): New decl.  Pull it in from <X11/X.h> if
14873         HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
14874         what it was before.
14875         * menu.h, termhooks.h: Include "systime.h", for Time.
14877         * keyboard.c (make_lispy_event): Fix problem in integer overflow.
14878         Don't assume that the difference between two unsigned long values
14879         can fit into an integer.  At this point, we know button_down_time
14880         <= event->timestamp, so the difference must be nonnegative, so
14881         there's no need to cast the result if double-click-time is
14882         nonnegative, as it should be; check that it's nonnegative, just in
14883         case.  This bug is triggered when events are more than 2**31 ms
14884         apart (about 25 days).  (Bug#8664)
14886         * xselect.c (last_event_timestamp): Remove duplicate decl.
14887         (x_own_selection): Remove needless cast to unsigned long.
14889         * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
14890         that always fit in int.  Use a sentinel instead of a counter, to
14891         avoid a temp and to allay GCC's concerns about possible int overflow.
14892         * frame.h (struct frame): Use int for menu_bar_items_used
14893         instead of EMACS_INT, since it always fits in int.
14895         * menu.c (grow_menu_items): Check for int overflow.
14897         * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
14899         * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
14900         Before, the code was not consistent.  These values cannot exceed
14901         2**31 - 1 so there's no need to make them unsigned.
14902         (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
14903         (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
14904         (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
14905         as modifiers.
14906         * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
14908         * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
14909         (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
14910         Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
14911         presumably because the widths might not match.
14913         * window.c (size_window): Avoid needless test at loop start.
14915 2011-05-18  Courtney Bane  <emacs-bugs-7626@cbane.org>  (tiny change)
14917         * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
14919 2011-05-12  Drew Adams  <drew.adams@oracle.com>
14921         * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
14923 2011-05-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
14925         * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
14926         `width' to `bar_area_x' and `bar_area_width', respectively.
14927         (x_scroll_run): Take account of fringe background extension.
14929         * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
14930         Rename local vars `left' and `width' to `bar_area_x' and
14931         `bar_area_width', respectively.
14932         (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
14933         background extension.
14935 2011-05-10  Jim Meyering  <meyering@redhat.com>
14937         * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
14939 2011-05-10  Juanma Barranquero  <lekktu@gmail.com>
14941         * image.c (Finit_image_library): Return t for built-in image types,
14942         like pbm and xbm.  (Bug#8640)
14944 2011-05-09  Andreas Schwab  <schwab@linux-m68k.org>
14946         * w32menu.c (set_frame_menubar): Fix submenu allocation.
14948 2011-05-07  Eli Zaretskii  <eliz@gnu.org>
14950         * w32console.c (Fset_screen_color): Doc fix.
14951         (Fget_screen_color): New function.
14952         (syms_of_ntterm): Defsubr it.
14954         * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
14955         unlink the temporary file if Fcall_process didn't create it in the
14956         first place.
14957         (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
14958         child process will be redirected to a file specified with `:file'.
14959         Don't try to re-open tempfile in that case, and set fd[0] to -1 as
14960         cue to call_process_cleanup not to close that handle.
14962 2011-05-07  Ben Key  <bkey76@gmail.com>
14964         * makefile.w32-in: The bootstrap-temacs rule now makes use of
14965         one of two shell specific rules, either bootstrap-temacs-CMD or
14966         bootstrap-temacs-SH.  The bootstrap-temacs-SH rule is identical
14967         to the previous implementation of the bootstrap-temacs rule.
14968         The bootstrap-temacs-CMD rule is similar to the previous
14969         implementation of the bootstrap-temacs rule except that it
14970         makes use of the ESC_CFLAGS variable instead of the CFLAGS
14971         variable.
14973         These changes, along with some changes to nt/configure.bat,
14974         nt/gmake.defs, and nt/nmake.defs, are required to extend my
14975         earlier fix to add support for --cflags and --ldflags options
14976         that include quotes so that it works whether make uses cmd or
14977         sh as the shell.
14979 2011-05-06  Michael Albinus  <michael.albinus@gmx.de>
14981         * dbusbind.c (QCdbus_type_unix_fd): Declare static.
14982         (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
14983         is a constant.
14984         (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
14985         a string.  Handle both cases.
14986         (Fdbus_call_method_asynchronously, Fdbus_register_signal)
14987         (Fdbus_register_method): Use Qinvalid_function.
14989 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
14991         * makefile.w32-in: Update dependencies.
14992         (LISP_H): Add inttypes.h and stdin.h.
14993         (PROCESS_H): Add unistd.h.
14995 2011-05-06  Eli Zaretskii  <eliz@gnu.org>
14997         * lread.c: Include limits.h (fixes the MS-Windows build broken by
14998         2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15000 2011-05-06  Paul Eggert  <eggert@cs.ucla.edu>
15002         * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15004         * term.c (vfatal): Remove stray call to va_end.
15005         It's not needed and the C Standard doesn't allow it here anyway.
15007         Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15008         * eval.c (verror): doprnt a copy of ap, not the original.  (Bug#8545)
15010         * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15011         bytes.
15013         * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15015         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15017         * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15019         * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15021         * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15023         * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15024         * charset.c (Fdefine_charset_internal): Don't initialize
15025         charset.code_space[15].  The value was garbage, on hosts with
15026         32-bit int (Bug#8600).
15028         * lread.c (read_integer): Be more consistent with string-to-number.
15029         Use string_to_number to do the actual conversion; this avoids
15030         rounding errors and fixes some other screwups.  Without this fix,
15031         for example, #x1fffffffffffffff was misread as -2305843009213693952.
15032         (digit_to_number): Move earlier, for benefit of read_integer.
15033         Return -1 if the digit is out of range for the base, -2 if it is
15034         not a digit in any supported base.  (Bug#8602)
15036         * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15038         * dispnew.c (scrolling_window): Return 1 if we scrolled,
15039         to match comment at start of function.  This also removes a
15040         GCC warning about overflow in a 32+64-bit port.
15042         * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15044         * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15045         Reported by Stefan Monnier in
15046         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
15047         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15048         Use SYMBOLP-guarded XSYMBOL, not XPNTR.
15050         * lisp.h (EMACS_INTPTR): Remove.  All uses changed to intptr_t.
15051         (EMACS_UINTPTR): Likewise, with uintptr_t.
15053         * lisp.h: Prefer 64-bit EMACS_INT if available.
15054         (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15055         on 32-bit hosts that have 64-bit int, so that they can access
15056         large files.
15057         However, temporarily disable this change unless the temporary
15058         symbol WIDE_EMACS_INT is defined.
15060         * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15062         Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15063         This removes an assumption that EMACS_INT and long are the same
15064         width as pointers.  The assumption is true for Emacs porting targets
15065         now, but we want to make other targets possible.
15066         * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15067         (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15068         In the rest of the code, change types of integers that hold casted
15069         pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15070         replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15071         (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15072         (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15073         No need to cast type when ORing.
15074         (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15075         * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15076         * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15077         assume EMACS_INT is the same width as char *.
15078         * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15079         (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15080         Remove no-longer-needed casts.
15081         (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15082         (xg_tool_bar_help_callback, xg_make_tool_item):
15083         Use EMACS_INTPTR to hold an integer
15084         that will be cast to void *; this can avoid a GCC warning
15085         if EMACS_INT is not the same width as void *.
15086         * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15087         * xdisp.c (display_echo_area_1, resize_mini_window_1):
15088         (current_message_1, set_message_1):
15089         Use a local to convert to proper width without a cast.
15090         * xmenu.c (dialog_selection_callback): Likewise.
15092         * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15093         Also, don't assume VALBITS / RAND_BITS is less than 5,
15094         and don't rely on undefined behavior when shifting a 1 left into
15095         the sign bit.
15096         * lisp.h (get_random): Change signature to match.
15098         * lread.c (hash_string): Use size_t, not int, for hash computation.
15099         Normally we prefer signed values; but hashing is special, because
15100         it's better to use unsigned division on hash table sizes so that
15101         the remainder is nonnegative.  Also, size_t is the natural width
15102         for hashing into memory.  The previous code used 'int', which doesn't
15103         retain enough info to hash well into very large tables.
15104         (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15106         * dbusbind.c: Don't possibly lose pointer info when converting.
15107         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15108         Use XPNTR rather than XHASH, so that the high-order bits of
15109         the pointer aren't lost when converting through void *.
15111         * eval.c (Fautoload): Don't double-shift a pointer.
15113         * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15115 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
15117         * gnutls.c (DEF_GNUTLS_FN):
15118         * image.c (DEF_IMGLIB_FN): Make function pointers static.
15120 2011-05-05  Andreas Schwab  <schwab@linux-m68k.org>
15122         * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15123         marker.  (Bug#8610)
15125 2011-05-05  Eli Zaretskii  <eliz@gnu.org>
15127         * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15128         New version that can reserve upto 2GB of heap space.
15130 2011-05-05  Chong Yidong  <cyd@stupidchicken.com>
15132         * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15134 2011-05-05  Teodor Zlatanov  <tzz@lifelogs.com>
15136         * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15137         `gnutls_certificate_set_x509_key_file'.
15139 2011-05-05  Juanma Barranquero  <lekktu@gmail.com>
15141         * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15142         Update dependencies.
15144 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
15146         * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15147         * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15148         Remove unused parameter `fildes'.
15149         * process.c (read_process_output, send_process): Don't pass it.
15151 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
15153         Fix previous change: the library cache is defined in w32.c.
15154         * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15155         (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15157 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
15159         Implement dynamic loading of GnuTLS on Windows.
15161         * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15162         (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15163         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15164         Declare.
15166         * gnutls.c (Qgnutls_dll): Define.
15167         (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15168         (gnutls_*): Declare function pointers.
15169         (init_gnutls_functions): New function to initialize function pointers.
15170         (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15171         (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15172         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15173         Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15174         (emacs_gnutls_write, emacs_gnutls_read)
15175         (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15176         (Fgnutls_available_p): New function.
15177         (Fgnutls_boot): Call Fgnutls_available_p.  Use function pointers.
15178         (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15179         (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15181         * image.c: Include w32.h.
15182         (Vimage_type_cache): Delete.
15183         (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15184         (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15185         (w32_delayed_load): Move to w32.c.
15187         * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15189         * w32.c (QCloaded_from, Vlibrary_cache): Define.
15190         (w32_delayed_load): Move from image.c.  When loading a library, record
15191         its filename in the :loaded-from property of the library id.
15192         (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15193         Initialize and staticpro them.
15194         (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15196         * process.c: Include lisp.h before w32.h, not after.
15197         (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15198         instead of gnutls_record_check_pending.
15200         * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15202 2011-05-04  Teodor Zlatanov  <tzz@lifelogs.com>
15204         * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15205         instead of :keyfiles.  Give GnuTLS the keylist and the CRL lists
15206         as passed in.
15208 2011-05-03  Jan Djärv  <jan.h.d@swipnet.se>
15210         * xterm.c (x_set_frame_alpha): Do not set property on anything
15211         else than FRAME_X_OUTER_WINDOW (Bug#8608).
15213 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
15215         * sysdep.c (get_tty_size) [WINDOWSNT]: Implement.  (Bug#8596)
15217 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
15219         * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15220         (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15221         (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15222         (gnutls_global_initialized, Qgnutls_bootprop_priority)
15223         (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15224         (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15225         (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15226         (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15227         (Qgnutls_bootprop_callbacks_verify): Make static.
15229 2011-05-01  Andreas Schwab  <schwab@linux-m68k.org>
15231         * callproc.c: Indentation fixup.
15233         * sysdep.c (wait_for_termination_1): Make static.
15234         (wait_for_termination, interruptible_wait_for_termination):
15235         Move after wait_for_termination_1.
15237 2011-05-01  Lars Magne Ingebrigtsen  <larsi@gnus.org>
15239         * sysdep.c (interruptible_wait_for_termination): New function
15240         which is like wait_for_termination, but allows keyboard
15241         interruptions.
15243         * callproc.c (Fcall_process): Add (:file "file") as an option for
15244         the STDOUT buffer.
15245         (Fcall_process_region): Ditto.
15247 2011-04-30  Eli Zaretskii  <eliz@gnu.org>
15249         * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15250         rather than `XVECTOR (FOO)->size'.
15252         * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15253         inttypes.h, as a gnulib replacement is used if it not available in
15254         system headers.
15256 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
15258         Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15259         * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15260         of MOST_POSITIVE_FIXNUM.  (Bug#8528)
15262         * coding.c (coding_alloc_by_realloc): Error out if destination
15263         will grow beyond MOST_POSITIVE_FIXNUM.
15264         (decode_coding_emacs_mule): Abort if there isn't enough place in
15265         charbuf for the composition carryover bytes.  Reserve an extra
15266         space for up to 2 characters produced in a loop.
15267         (decode_coding_iso_2022): Abort if there isn't enough place in
15268         charbuf for the composition carryover bytes.
15270 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
15272         * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15273         aborting when %lld or %lll format is passed.
15274         [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15275         %llo or %llx format is passed.  (Bug#8545)
15277         * window.c (window_scroll_line_based): Use a marker instead of
15278         simple variables to record original value of point.  (Bug#7952)
15280         * doprnt.c (doprnt): Fix the case where a multibyte sequence
15281         produced by %s or %c overflows available buffer space.  (Bug#8545)
15283 2011-04-28  Paul Eggert  <eggert@cs.ucla.edu>
15285         * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
15286         (SIZE_MAX): Move defn after all includes, as they might #define it.
15288 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
15290         * w32.c (init_environment): Warn about defaulting HOME to C:\.
15292 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
15294         * keyboard.c (Qdelayed_warnings_hook): Define.
15295         (command_loop_1): Run `delayed-warnings-hook'
15296         if Vdelayed_warnings_list is non-nil.
15297         (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15298         (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15300 2011-04-28  Eli Zaretskii  <eliz@gnu.org>
15302         * doprnt.c (doprnt): Don't return value smaller than the buffer
15303         size if the message was truncated.  (Bug#8545).
15305 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
15307         * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15308         (Fx_window_property): #if-0 the whole functions, not just the bodies.
15310 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
15312         * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15314 2011-04-27  Juanma Barranquero  <lekktu@gmail.com>
15316         * makefile.w32-in: Update dependencies.
15318 2011-04-27  Eli Zaretskii  <eliz@gnu.org>
15320         Improve `doprnt' and its usage.  (Bug#8545)
15321         * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15322         `format_end'.  Remove support for %l as a conversion specifier.
15323         Don't use xrealloc.  Improve diagnostics when the %l size modifier
15324         is used.  Update the commentary.
15326         * eval.c (verror): Simplify calculation of size_t.
15328         * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15329         messages.
15331 2011-04-27  Yoshiaki Kasahara  <kasahara@nc.kyushu-u.ac.jp>  (tiny change)
15333         * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15334         change.
15336 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
15338         * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15339         This makes this file independent of the recent pseudovector change.
15341 2011-04-26  Paul Eggert  <eggert@cs.ucla.edu>
15343         * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15345         * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
15346         (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
15347         Remove unused local.
15348         (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
15350         * lisp.h: Fix a problem with aliasing and vector headers.  (Bug#8546)
15351         GCC 4.6.0 optimizes based on type-based alias analysis.
15352         For example, if b is of type struct buffer * and v of type struct
15353         Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15354         != &v->size, and therefore "v->size = 1; b->size = 2; return
15355         v->size;" must therefore return 1.  This assumption is incorrect
15356         for Emacs, since it type-puns struct Lisp_Vector * with many other
15357         types.  To fix this problem, this patch adds a new type struct
15358         vectorlike_header that documents the constraints on layout of vectors
15359         and pseudovectors, and helps optimizing compilers not get fooled
15360         by Emacs's type punning.  It also adds the macros XSETTYPED_PVECTYPE
15361         XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
15362         * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15363         the size member.
15364         (XSETPVECTYPE): Rewrite in terms of new macro.
15365         (XSETPVECTYPESIZE): New macro, specifying both type and size.
15366         This is a bit clearer, and further avoids the possibility of
15367         undesirable aliasing.
15368         (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
15369         (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
15370         (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15371         since Lisp_Subr is a special case (no "next" field).
15372         (ASIZE): Now uses header.size rather than size.
15373         All previous uses of XVECTOR (foo)->size replaced to use this macro,
15374         to avoid the hassle of writing XVECTOR (foo)->header.size.
15375         (struct vectorlike_header): New type.
15376         (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15377         object, to help avoid aliasing.
15378         (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15379         (SUBRP): Likewise, since Lisp_Subr is a special case.
15380         * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15381         (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15382         (struct Lisp_Hash_Table): Combine first two members into a single
15383         struct vectorlike_header member.  All uses of "size" and "next" members
15384         changed to be "header.size" and "header.next".
15385         * buffer.h (struct buffer): Likewise.
15386         * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15387         * frame.h (struct frame): Likewise.
15388         * process.h (struct Lisp_Process): Likewise.
15389         * termhooks.h (struct terminal): Likewise.
15390         * window.c (struct save_window_data, struct saved_window): Likewise.
15391         * window.h (struct window): Likewise.
15392         * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15393         Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15394         * buffer.c (init_buffer_once): Likewise.
15395         * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15396         special case.
15397         * process.c (Fformat_network_address): Use local var for size,
15398         for brevity.
15400         * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15402         Make the Lisp reader and string-to-float more consistent (Bug#8525)
15403         * data.c (atof): Remove decl; no longer used or needed.
15404         (digit_to_number): Move to lread.c.
15405         (Fstring_to_number): Use new string_to_number function, to be
15406         consistent with how the Lisp reader treats infinities and NaNs.
15407         Do not assume that floating-point numbers represent EMACS_INT
15408         without losing information; this is not true on most 64-bit hosts.
15409         Avoid double-rounding errors, by insisting on integers when
15410         parsing non-base-10 numbers, as the documentation specifies.
15411         * lisp.h (string_to_number): New decl, replacing ...
15412         (isfloat_string): Remove.
15413         * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
15414         (read1): Do not accept +. and -. as integers; this
15415         appears to have been a coding error.  Similarly, do not accept
15416         strings like +-1e0 as floating point numbers.  Do not report
15417         overflow for integer overflows unless the base is not 10 which
15418         means we have no simple and reliable way to continue.
15419         Break out the floating-point parsing into a new
15420         function string_to_number, so that Fstring_to_number parses
15421         floating point numbers consistently with the Lisp reader.
15422         (digit_to_number): Move here from data.c.  Make it static inline.
15423         (E_CHAR, EXP_INT): Remove, replacing with ...
15424         (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15425         (string_to_number): New function, replacing isfloat_string.
15426         This function checks for valid syntax and produces the resulting
15427         Lisp float number too.  Rework it so that string-to-number
15428         no longer mishandles examples like "1.0e+".  Use strtoumax,
15429         so that overflow for non-base-10 numbers is reported only when
15430         there's no portable and simple way to convert to floating point.
15432         * textprop.c (set_text_properties_1): Rewrite for clarity,
15433         and to avoid GCC warning about integer overflow.
15435         * intervals.h (struct interval): Use EMACS_INT for members
15436         where EMACS_UINT might cause problems.  See
15437         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15438         (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15439         * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15440         All uses changed.
15441         (offset_intervals): Tell GCC not to worry about length overflow
15442         when negating a negative length.
15444         * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15445         (overrun_check_free): Likewise.
15447         * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15448         in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15449         word size.
15451         * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15452         (gnutls_make_error): Rename local to avoid shadowing.
15453         (gnutls_emacs_global_deinit): ifdef out; not used.
15454         (Fgnutls_boot): Use const for pointer to readonly storage.
15455         Comment out unused local.  Fix pointer signedness problems.
15457         * lread.c (openp): Don't stuff size_t into an 'int'.
15458         Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15459         about possible signed overflow.
15461         * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15462         (GDK_KEY_g): Don't define if already defined.
15463         (xg_prepare_tooltip): Avoid pointer signedness problem.
15464         (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15466         * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15467         behavior with 1 << 31.  GCC 4.6.0 warns about this on 32-bit hosts.
15469         * xfns.c (Fx_window_property): Simplify a bit,
15470         to make a bit faster and to avoid GCC 4.6.0 warning.
15471         * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15473         * fns.c (internal_equal): Don't assume size_t fits in int.
15475         * alloc.c (compact_small_strings): Tighten assertion a little.
15477         Replace pEd with more-general pI, and fix some printf arg casts.
15478         * lisp.h (pI): New macro, generalizing old pEd macro to other
15479         conversion specifiers.  For example, use "...%"pI"d..." rather
15480         than "...%"pEd"...".
15481         (pEd): Remove.  All uses replaced with similar uses of pI.
15482         * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
15483         * alloc.c (check_pure_size): Don't overflow by converting size to int.
15484         * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15485         * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15486         * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15487         (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15488         * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15489         64-bit hosts.
15490         (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15491         * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15492         * print.c (safe_debug_print, print_object): Likewise.
15493         (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15494         to int.
15495         Use pI instead of if-then-else-abort.  Use %p to avoid casts,
15496         avoiding the 0 flag, which is not portable.
15497         * process.c (Fmake_network_process): Use pI to avoid cast.
15498         * region-cache.c (pp_cache): Likewise.
15499         * xdisp.c (decode_mode_spec): Likewise.
15500         * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15501         behavior on 64-bit hosts with printf arg.
15502         * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
15503         (x_stop_queuing_selection_requests): Likewise.
15504         (x_get_window_property): Don't truncate byte count to an 'int'
15505         when tracing.
15507         * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15508         here, since it parses constructs like leading '-' and spaces,
15509         which are not wanted; and it overflows with large numbers.
15510         Instead, simply match F[0-9]+, which is what is wanted anyway.
15512         * alloc.c: Remove unportable assumptions about struct layout.
15513         (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15514         (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15515         (allocate_vectorlike, make_pure_vector): Use the new macros,
15516         plus offsetof, to remove unportable assumptions about struct layout.
15517         These assumptions hold on all porting targets that I know of, but
15518         they are not guaranteed, they're easy to remove, and removing them
15519         makes further changes easier.
15521         * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15522         This doesn't fix a bug but makes the code clearer.
15523         (string_overrun_cookie): Now const.  Use initializers that
15524         don't formally overflow signed char, to avoid warnings.
15525         (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15526         can cause Emacs to crash when string overrun checking is enabled.
15527         (allocate_buffer): Don't assume sizeof (struct buffer) is a
15528         multiple of sizeof (EMACS_INT); it need not be, if
15529         alignof(EMACS_INT) < sizeof (EMACS_INT).
15530         (check_sblock, check_string_bytes, check_string_free_list): Protoize.
15532 2011-04-26  Juanma Barranquero  <lekktu@gmail.com>
15534         * keyboard.c (QCrtl): Rename from Qrtl.  All uses changed.
15536 2011-04-26  Teodor Zlatanov  <tzz@lifelogs.com>
15538         * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
15539         supposed to be handshaking.  (Bug#8556)
15540         Reported by Paul Eggert <eggert@cs.ucla.edu>.
15542 2011-04-26  Daniel Colascione  <dan.colascione@gmail.com>
15544         * lisp.h (Qdebug): List symbol.
15545         * eval.c (Qdebug): Restore global linkage.
15546         * keyboard.c (debug-on-event): New variable.
15547         (handle_user_signal): Break into debugger when debug-on-event
15548         matches the current signal symbol.
15550 2011-04-25  Dan Nicolaescu  <dann@ics.uci.edu>
15552         * alloc.c (check_sblock, check_string_bytes)
15553         (check_string_free_list): Convert to standard C.
15555 2011-04-25  Teodor Zlatanov  <tzz@lifelogs.com>
15557         * w32.c (emacs_gnutls_push): Fix typo.
15559 2011-04-25  Eli Zaretskii  <eliz@gnu.org>
15561         * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15562         "cast to pointer from integer of different size".
15564         Improve doprnt and its use in verror.  (Bug#8545)
15565         * doprnt.c (doprnt): Document the set of format control sequences
15566         supported by the function.  Use SAFE_ALLOCA instead of always
15567         using `alloca'.
15569         * eval.c (verror): Don't limit the buffer size at size_max-1, that
15570         is one byte too soon.  Don't use xrealloc; instead xfree and
15571         xmalloc anew.
15573 2011-04-24  Teodor Zlatanov  <tzz@lifelogs.com>
15575         * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15576         callbacks stage.
15578         * gnutls.c: Renamed global_initialized to
15579         gnutls_global_initialized.  Added internals for the
15580         :verify-hostname-error, :verify-error, and :verify-flags
15581         parameters of `gnutls-boot' and documented those parameters in the
15582         docstring.  Start callback support.
15583         (emacs_gnutls_handshake): Add Woe32 support.  Retry handshake
15584         unless a fatal error occurred.  Call gnutls_alert_send_appropriate
15585         on error.  Return error code.
15586         (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15587         (emacs_gnutls_read): Likewise.
15588         (Fgnutls_boot): Return handshake error code.
15589         (emacs_gnutls_handle_error): New function.
15590         (wsaerror_to_errno): Likewise.
15592         * w32.h (emacs_gnutls_pull): Add prototype.
15593         (emacs_gnutls_push): Likewise.
15595         * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15596         (emacs_gnutls_push): Likewise.
15598 2011-04-24  Claudio Bley  <claudio.bley@gmail.com>  (tiny change)
15600         * process.c (wait_reading_process_output): Check if GnuTLS
15601         buffered some data internally if no FDs are set for TLS
15602         connections.
15604         * makefile.w32-in (OBJ2): Add gnutls.$(O).
15605         (LIBS): Link to USER_LIBS.
15606         ($(BLD)/gnutls.$(0)): New target.
15608 2011-04-24  Eli Zaretskii  <eliz@gnu.org>
15610         * xdisp.c (handle_single_display_spec): Rename the
15611         display_replaced_before_p argument into display_replaced_p, to
15612         make it consistent with the commentary.  Fix typos in the
15613         commentary.
15615         * textprop.c (syms_of_textprop): Remove dead code.
15616         (copy_text_properties): Delete obsolete commentary about an
15617         interface that was deleted long ago.  Fix typos in the description
15618         of arguments.
15620         * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15621         to changes in oldXMenu/XMenu.h from 2011-04-16.
15622         <menu_help_message, prev_menu_help_message>: Constify.
15623         (IT_menu_make_room): menu->help_text is now `const char **';
15624         adjust.
15626         * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15627         to changes in oldXMenu/XMenu.h from 2011-04-16.
15628         (struct XMenu): Declare `help_text' `const char **'.
15630         * xfaces.c <Qunspecified>: Make extern again.
15632         * syntax.c: Include sys/types.h before including regex.h, as
15633         required by POSIX.
15635         * doc.c (get_doc_string): Improve the format passed to `error'.
15637         * doprnt.c (doprnt): Improve commentary.
15639         * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15641         * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15642         them with etags.
15644         * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15645         changes in globals.h immediately force recompilation.
15646         (TAGS): Depend on $(CURDIR)/m/intel386.h and
15647         $(CURDIR)/s/ms-w32.h.
15648         (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
15650         * character.c (Fchar_direction): Function deleted.
15651         (syms_of_character): Don't defsubr it.
15652         <char-direction-table>: Deleted.
15654 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
15656         Fix doprnt so it could be used again safely in `verror'.  (Bug#8435)
15657         * doprnt.c: Include limits.h.
15658         (SIZE_MAX): New macro.
15659         (doprnt): Return a size_t value.  2nd arg is now size_t.
15660         Many local variables are now size_t instead of int or unsigned.
15661         Improve overflow protection.  Support `l' modifier for integer
15662         conversions.  Support %l conversion.  Don't assume an EMACS_INT
15663         argument for integer conversions and for %c.
15665         * lisp.h (doprnt): Restore prototype.
15667         * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15668         $(SRC)/character.h.
15670         * Makefile.in (base_obj): Add back doprnt.o.
15672         * deps.mk (doprnt.o): Add back prerequisites.
15673         (callint.o): Depend on character.h.
15675         * eval.c (internal_lisp_condition_case): Include the handler
15676         representation in the error message.
15677         (verror): Call doprnt instead of vsnprintf.  Fix an off-by-one bug
15678         when breaking from the loop.
15680         * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15682         * callint.c (Fcall_interactively): When displaying error message
15683         about invalid control letter, pass the character's codepoint, not
15684         a pointer to its multibyte form.  Improve display of the character
15685         in octal and display also its hex code.
15687         * character.c (char_string): Use %x to display the (unsigned)
15688         codepoint of an invalid character, to avoid displaying a bogus
15689         negative value.
15691         * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15692         `error', not SYMBOL_NAME itself.
15694         * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15695         character arguments to `error'.
15697         * charset.c (check_iso_charset_parameter): Fix incorrect argument
15698         to `error' in error message about FINAL_CHAR argument.  Make sure
15699         FINAL_CHAR is a character, and use %c when it is passed as
15700         argument to `error'.
15702 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
15704         * s/ms-w32.h (localtime): Redirect to sys_localtime.
15706         * w32.c: Include <time.h>.
15707         (sys_localtime): New function.
15709 2011-04-23  Chong Yidong  <cyd@stupidchicken.com>
15711         * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15713         * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
15715 2011-04-23  Samuel Thibault  <sthibault@debian.org>  (tiny change)
15717         * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15718         zombies (Bug#8467).
15720 2011-04-19  Eli Zaretskii  <eliz@gnu.org>
15722         * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15723         gl_state.e_property when gl_state.object is Qt.
15725         * insdel.c (make_gap_larger): Remove limitation of buffer size
15726         to <= INT_MAX.
15728 2011-04-18  Chong Yidong  <cyd@stupidchicken.com>
15730         * xdisp.c (lookup_glyphless_char_display)
15731         (produce_glyphless_glyph): Handle cons cell entry in
15732         glyphless-char-display.
15733         (Vglyphless_char_display): Document it.
15735         * term.c (produce_glyphless_glyph): Handle cons cell entry in
15736         glyphless-char-display.
15738 2011-04-17  Chong Yidong  <cyd@stupidchicken.com>
15740         * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15742         * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15744         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15745         definition for no-X builds.
15747 2011-04-16  Paul Eggert  <eggert@cs.ucla.edu>
15749         Static checks with GCC 4.6.0 and non-default toolkits.
15751         * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15753         * process.c (keyboard_bit_set): Define only if SIGIO.
15754         (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15755         (send_process): Repair possible setjmp clobbering.
15757         * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15759         * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15761         * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15763         * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
15764         Define only if needed.
15766         * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
15767         by pacifying GCC about it.  Maybe it's time to retire it?
15768         * xfaces.c (USG, __TIMEVAL__): Likewise.
15770         * dispextern.h (struct redisplay_interface): Rename param
15771         to avoid shadowing.
15772         * termhooks.h (struct terminal): Likewise.
15773         * xterm.c (xembed_send_message): Likewise.
15775         * insdel.c (make_gap_smaller): Define only if
15776         USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
15778         * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
15779         it.
15781         * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
15782         so that we aren't warned about unused symbols.
15784         * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
15786         * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
15788         * xfns.c (x_real_positions): Mark locals as initialized.
15790         * xmenu.c (xmenu_show): Don't use uninitialized vars.
15792         * xterm.c: Fix problems found by static analysis with other toolkits.
15793         (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
15794         (x_dispatch_event): Declare static if USE_GTK, and
15795         define if USE_GTK || USE_X_TOOLKIT.
15796         (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
15797         * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
15798         * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15799         if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
15801         * xmenu.c (menu_help_callback): Pointer type fixes.
15802         Use const pointers when pointing at readonly data.  Avoid pointer
15803         signedness clashes.
15804         (FALSE): Remove unused macro.
15805         (update_frame_menubar): Remove unused decl.
15807         * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15809         * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15810         USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15811         (single_menu_item): Rename local to avoid shadowing.
15813         * keyboard.c (make_lispy_event): Remove unused local var.
15815         * frame.c, frame.h (x_get_resource_string): Bring this back, but
15816         only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15818         * bitmaps: Change bitmaps from unsigned char back to the X11
15819         compatible char.  Avoid the old compiler warnings about
15820         out-of-range initializers by using, for example, '\xab' rather
15821         than 0xab.
15823         * xgselect.c (xgselect_initialize): Check vs interface
15824         even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15826         * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15828         * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15829         to read-only memory.
15831         * fns.c (vector): Remove; this old hack is no longer needed.
15833         * xsmfns.c (create_client_leader_window): Rename shadowing arg.
15834         Remove unused var.
15835         (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
15837         * xrdb.c (x_load_resources): Omit unused local.
15839         * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
15840         (x_window): Rename locals to avoid shadowing.
15841         (USG): Use the kludged USG macro, to pacify gcc.
15843         * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
15844         (x_term_init): Remove local to avoid shadowing.
15846         * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
15848         * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15849         USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15851 2011-04-16  Eli Zaretskii  <eliz@gnu.org>
15853         * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15855         Fix regex.c, syntax.c and friends for buffers > 2GB.
15856         * syntax.h (struct gl_state_s): Declare character position members
15857         EMACS_INT.
15859         * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15861         * textprop.c (verify_interval_modification, interval_of):
15862         Declare arguments EMACS_INT.
15864         * intervals.c (adjust_intervals_for_insertion): Declare arguments
15865         EMACS_INT.
15867         * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15869         * indent.c (Fvertical_motion): Local variable it_start is now
15870         EMACS_INT.
15872         * regex.c (re_match, re_match_2, re_match_2_internal)
15873         (bcmp_translate, regcomp, regexec, print_double_string)
15874         (group_in_compile_stack, re_search, re_search_2, regex_compile)
15875         (re_compile_pattern, re_exec): Declare arguments and local
15876         variables `size_t' and `ssize_t' and return values `regoff_t', as
15877         appropriate.
15878         (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
15879         (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
15880         <compile_stack_type>: `size' and `avail' are now `size_t'.
15882         * regex.h <regoff_t>: Use ssize_t, not int.
15883         (re_search, re_search_2, re_match, re_match_2): Arguments that
15884         specify buffer/string position and length are now ssize_t and
15885         size_t.  Return type is regoff_t.
15887 2011-04-16  Ben Key  <bkey76@gmail.com>
15889         * nsfont.m: Fixed bugs in ns_get_family and
15890         ns_descriptor_to_entity that were caused by using free to
15891         deallocate memory blocks that were allocated by xmalloc (via
15892         xstrdup).  This caused Emacs to crash when compiled with
15893         XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
15894         --enable-checking=xmallocoverrun).  xfree is now used to
15895         deallocate these memory blocks.
15897 2011-04-15  Paul Eggert  <eggert@cs.ucla.edu>
15899         * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
15901         emacs_write: Accept and return EMACS_INT for sizes.
15902         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
15903         et seq.
15904         * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
15905         Accept and return EMACS_INT.
15906         (emacs_gnutls_write): Return the number of bytes written on
15907         partial writes.
15908         * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
15909         (emacs_read, emacs_write): Remove check for negative size, as the
15910         Emacs source code has been audited now.
15911         * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
15912         (emacs_read, emacs_write): Use it.
15913         * process.c (send_process): Adjust to the new signatures of
15914         emacs_write and emacs_gnutls_write.  Do not attempt to store
15915         a byte offset into an 'int'; it might overflow.
15916         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
15918         * sound.c: Don't assume sizes fit in 'int'.
15919         (struct sound_device.period_size, alsa_period_size):
15920         Return EMACS_INT, not int.
15921         (struct sound_device.write, vox_write, alsa_write):
15922         Accept EMACS_INT, not int.
15923         (wav_play, au_play): Use EMACS_INT to store sizes and to
15924         record read return values.
15926 2011-04-15  Ben Key  <bkey76@gmail.com>
15928         * keyboard.c (Qundefined): Don't declare static since it is used
15929         in nsfns.m.
15930         * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
15931         static since they are used in nsfont.m.
15933 2011-04-15  Stefan Monnier  <monnier@iro.umontreal.ca>
15935         * process.c (Qprocessp): Don't declare static.
15936         * lisp.h (Qprocessp): Declare again.
15938 2011-04-15  Juanma Barranquero  <lekktu@gmail.com>
15940         * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
15942 2011-04-14  Paul Eggert  <eggert@cs.ucla.edu>
15944         Improve C-level modularity by making more things 'static'.
15946         Don't publish debugger-only interfaces to other modules.
15947         * lisp.h (safe_debug_print, debug_output_compilation_hack):
15948         (verify_bytepos, count_markers): Move decls to the only modules
15949         that need them.
15950         * region-cache.h (pp_cache): Likewise.
15951         * window.h (check_all_windows): Likewise.
15952         * marker.c, print.c, region-cache.c, window.c: Decls moved here.
15954         * sysdep.c (croak): Now static, if
15955         defined TIOCNOTTY || defined USG5 || defined CYGWIN.
15956         * syssignal.h (croak): Declare only if not static.
15958         * alloc.c (refill_memory_reserve): Now static if
15959         !defined REL_ALLOC || defined SYSTEM_MALLOC.
15960         * lisp.h (refill_memory_reserve): Declare only if not static.
15962         * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
15963         Define only if USE_LUCID.
15965         * xrdb.c (x_customization_string, x_rm_string): Now static.
15967         * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
15968         * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
15970         * xdisp.c (draw_row_with_mouse_face): Now static.
15971         * dispextern.h (draw_row_with_mouse_fave): Remove decl.
15973         * window.h (check_all_windows): Mark externally visible.
15975         * window.c (window_deletion_count): Now static.
15977         * undo.c: Make symbols static if they're not exported.
15978         (last_undo_buffer, last_boundary_position, pending_boundary):
15979         Now static.
15981         * textprop.c (interval_insert_behind_hooks): Now static.
15982         (interval_insert_in_front_hooks): Likewise.
15984         * term.c: Make symbols static if they're not exported.
15985         (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
15986         (max_frame_lines, tty_set_terminal_modes):
15987         (tty_reset_terminal_modes, tty_turn_off_highlight):
15988         (get_tty_terminal): Now static.
15989         (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
15990         * termhooks.h (term_mouse_moveto): Do not declare if
15991         HAVE_WINDOW_SYSTEM.
15992         * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
15993         (tty_turn_off_highlight, get_tty_terminal): Remove decls.
15995         * sysdep.c: Make symbols static if they're not exported.
15996         (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
15997         Now static.
15998         (sigprocmask_set, full_mask): Remove; unused.
15999         (wait_debugging): Mark as visible.
16000         * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16001         * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16003         * syntax.c (syntax_temp): Define only if !__GNUC__.
16005         * sound.c (current_sound_device, current_sound): Now static.
16007         * search.c (searchbufs, searchbuf_head): Now static.
16009         * scroll.c (scroll_cost): Remove; unused.
16010         * dispextern.h (scroll_cost): Remove decl.
16012         * region-cache.h (pp_cache): Mark as externally visible.
16014         * process.c: Make symbols static if they're not exported.
16015         (process_tick, update_tick, create_process, chan_process):
16016         (Vprocess_alist, proc_buffered_char, datagram_access):
16017         (fd_callback_data, send_process_frame, process_sent_to): Now static.
16018         (deactivate_process): Mark defn as static, as well as decl.
16019         * lisp.h (create_process): Remove decl.
16020         * process.h (chan_process, Vprocess_alist): Remove decls.
16022         * print.c: Make symbols static if they're not exported.
16023         (print_depth, new_backquote_output, being_printed, print_buffer):
16024         (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16025         (print_interval, print_number_index, initial_stderr_stream):
16026         Now static.
16027         * lisp.h (Fprinc): Remove decl.
16028         (debug_output_compilation_hack): Mark as externally visible.
16030         * sysdep.c (croak): Move decl from here to syssignal.h.
16031         * syssignal.h (croak): Put it here, so the API can be checked when
16032         'croak' is called from dissociate_if_controlling_tty.
16034         * minibuf.c: Make symbols static if they're not exported.
16035         (minibuf_save_list, choose_minibuf_frame): Now static.
16036         * lisp.h (choose_minibuf_frame): Remove decl.
16038         * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16040         * lread.c: Make symbols static if they're not exported.
16041         (read_objects, initial_obarray, oblookup_last_bucket_number):
16042         Now static.
16043         (make_symbol): Remove; unused.
16044         * lisp.h (initial_obarray, make_symbol): Remove decls.
16046         * keyboard.c: Make symbols static if they're not exported.
16047         (single_kboard, recent_keys_index, total_keys, recent_keys):
16048         (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16049         (this_single_command_key_start, echoing, last_auto_save):
16050         (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16051         (command_loop, echo_now, keyboard_init_hook, help_char_p):
16052         (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16053         (Vlispy_mouse_stem, double_click_count):
16054         Now static.
16055         (force_auto_save_soon): Define only if SIGDANGER.
16056         (ignore_mouse_drag_p): Now static if
16057         !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16058         (print_help): Remove; unused.
16059         (stop_character, last_timer_event): Mark as externally visible.
16060         * keyboard.h (ignore_mouse_drag_p): Declare only if
16061         defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16062         (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16063         * lisp.h (echoing): Remove decl.
16064         (force_auto_save_soon): Declare only if SIGDANGER.
16065         * xdisp.c (redisplay_window): Simplify code, to make it more
16066         obvious that ignore_mouse_drag_p is not accessed if !defined
16067         USE_GTK && !defined HAVE_NS.
16069         * intervals.c: Make symbols static if they're not exported.
16070         (merge_properties_sticky, merge_interval_right, delete_interval):
16071         Now static.
16072         * intervals.h (merge_interval_right, delete_interval): Remove decls.
16074         * insdel.c: Make symbols static if they're not exported.
16075         However, leave prepare_to_modify_buffer alone.  It's never
16076         called from outside this function, but that appears to be a bug.
16077         (combine_after_change_list, combine_after_change_buffer):
16078         (adjust_after_replace, signal_before_change): Now static.
16079         (adjust_after_replace_noundo): Remove; unused.
16080         * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
16081         (signal_before_change): Remove decls.
16083         * indent.c (val_compute_motion, val_vmotion): Now static.
16085         * image.c: Make symbols static if they're not exported.
16086         * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16087         if USE_GTK.
16088         * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16089         (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16091         * fringe.c (standard_bitmaps): Now static.
16092         (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16094         * frame.c: Make symbols static if they're not exported.
16095         (x_report_frame_params, make_terminal_frame): Now static.
16096         (get_frame_param): Now static, unless HAVE_NS.
16097         (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16098         (x_get_resource_string): Remove; not used.
16099         * frame.h (make_terminal_frame, x_report_frame_params):
16100         (x_get_resource_string); Remove decls.
16101         (x_fullscreen_adjust): Declare only if WINDOWSNT.
16102         * lisp.h (get_frame_param): Declare only if HAVE_NS.
16104         * font.c, fontset.c: Make symbols static if they're not exported.
16105         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16106         (FACE_SUITABLE_FOR_CHAR_P): Use it.
16107         * font.c (font_close_object): Now static.
16108         * font.h (font_close_object): Remove.
16109         * fontset.c (FONTSET_OBJLIST): Remove.
16110         (free_realized_fontset) #if-0 the body, which does nothing.
16111         (face_suitable_for_char_p): #if-0, as it's never called.
16112         * fontset.h (face_suitable_for_char_p): Remove decl.
16113         * xfaces.c (face_at_string_position):
16114         Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
16115         since 0 is always ASCII.
16117         * fns.c (weak_hash_tables): Now static.
16119         * fileio.c: Make symbols static if they're not exported.
16120         (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16121         (Vwrite_region_annotation_buffers): Now static.
16123         * eval.c: Make symbols static if they're not exported.
16124         (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16125         * lisp.h (backtrace_list): Remove decl.
16127         * emacs.c: Make symbols static if they're not exported.
16128         (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16129         (fatal_error_code, fatal_error_signal_hook, standard_args):
16130         Now static.
16131         (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16132         (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16133         (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16134         * lisp.h (fatal_error_signal_hook): Remove decl.
16135         (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16137         * editfns.c: Move a (normally-unused) function to its only use.
16138         * editfns.c, lisp.h (get_operating_system_release): Remove.
16139         * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16140         worth the hassle of breaking this out.
16142         * xterm.c: Make symbols static if they're not exported.
16143         (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16144         (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16145         (x_destroy_window, x_delete_display):
16146         Now static.
16147         (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16148         (x_mouse_leave): Remove; unused.
16149         * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16150         (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16151         (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16152         Remove decls.
16153         (x_mouse_leave): Declare only if WINDOWSNT.
16154         (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16155         (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16156         USE_X_TOOLKIT.
16158         * ftxfont.c: Make symbols static if they're not exported.
16159         (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16160         HAVE_FREETYPE.
16161         * font.h (ftxfont_driver): Likewise.
16163         * xfns.c: Make symbols static if they're not exported.
16164         (x_last_font_name, x_display_info_for_name):
16165         (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16166         (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16167         (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16168         (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16169         (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16170         (last_show_tip_args): Now static.
16171         (xic_defaut_fontset, xic_create_fontsetname): Define only if
16172         defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16173         (x_screen_planes): Remove; unused.
16174         * dispextern.h (x_screen_planes): Remove decl.
16176         * dispnew.c: Make symbols static if they're not exported.
16177         * dispextern.h (redraw_garbaged_frames, scrolling):
16178         (increment_row_positions): Remove.
16179         * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16180         (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16181         Now static.
16182         (redraw_garbaged_frames): Remove; unused.
16184         * xfaces.c: Make symbols static if they're not exported.
16185         * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16186         Remove decls.
16187         * xterm.h (defined_color): Remove decls.
16188         (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16189         * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16190         (menu_face_changed_default, defined_color, free_realized_face):
16191         (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16192         (ascii_face_of_lisp_face): Remove; unused.
16194         * xdisp.c: Make symbols static if they're not exported.
16195         * dispextern.h (scratch_glyph_row, window_box_edges):
16196         (glyph_to_pixel_coords, set_cursor_from_row):
16197         (get_next_display_element, set_iterator_to_next):
16198         (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16199         (show_mouse_face): Remove decls
16200         * frame.h (message_buf_print): Likewise.
16201         * lisp.h (pop_message, set_message, check_point_in_composition):
16202         Likewise.
16203         * xterm.h (set_vertical_scroll_bar): Likewise.
16204         * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16205         (message_buf_print, scratch_glyph_row, displayed_buffer):
16206         (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16207         (get_next_display_element, show_mouse_face, window_box_edges):
16208         (frame_to_window_pixel_xy, check_point_in_composition):
16209         (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16210         (glyph_to_pixel_coords): Remove; unused.
16212         * dired.c (file_name_completion): Now static.
16214         * dbusbind.c (xd_in_read_queued_messages): Now static.
16216         * lisp.h (circular_list_error, FOREACH): Remove; unused.
16217         * data.c (circular_list_error): Remove.
16219         * commands.h (last_point_position, last_point_position_buffer):
16220         (last_point_position_window): Remove decls.
16221         * keyboard.c: Make these variables static.
16223         * coding.h (coding, code_convert_region, encode_coding_gap):
16224         Remove decls.
16225         * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16226         (iso_code_class, detect_coding, code_convert_region): Now static.
16227         (encode_coding_gap): Remove; unused.
16229         * chartab.c (chartab_chars, chartab_bits): Now static.
16231         * charset.h (charset_iso_8859_1): Remove decl.
16232         * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16233         Now static.
16235         * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16236         * ccl.c (Vccl_program_table): Now static.
16237         (check_ccl_update): Remove; unused.
16239         * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16240         * category.h: ... from here.
16241         * category.c (check_category_table, set_category_set): Now static.
16243         * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16244         * lisp.h: Remove these decls.
16246         * buffer.c (buffer_count): Remove unused var.
16248         * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16249         so that it's not optimized away.
16250         (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16251         * dispextern.h (bidi_dump_cached_states): Remove, since it's
16252         exported only to the debugger.
16254         * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
16255         * atimer.h (run_all_atimers): Remove; not exported.
16257         font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16258         * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16259         was inaccessible from Lisp.
16260         (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16261         * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16263         alloc.c: Import and export fewer symbols, and remove unused items.
16264         * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16265         is defined.
16266         (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16267         it's not optimized away by whole-program optimization.
16268         (message_enable_multibyte, free_misc): Remove.
16269         (catchlist, handlerlist, mark_backtrace):
16270         Declare only if BYTE_MARK_STACK.
16271         (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16272         * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16273         (message_enable_multibyte): Remove decl.
16274         (free_misc, interval_free_list, float_block, float_block_index):
16275         (n_float_blocks, float_free_list, cons_block, cons_block_index):
16276         (cons_free_list, last_marked_index):
16277         Now static.
16278         (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16279         * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16280         (mark_backtrace): Define only if BYTE_MARK_STACK.
16281         * xdisp.c (message_enable_multibyte): Now static.
16283         Declare Lisp_Object Q* variables to be 'static' if not exported.
16284         This makes it easier for human readers (and static analyzers)
16285         to see whether these variables are used from other modules.
16286         * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16287         * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16288         * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16289         * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16290         * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16291         * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16292         * xmenu.c, xselect.c:
16293         Declare Q* vars static if they are not used in other modules.
16294         * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16295         * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16296         Remove decls of unexported vars.
16297         * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16299         * lisp.h (DEFINE_FUNC): Make sname 'static'.
16301         Make Emacs functions such as Fatom 'static' by default.
16302         This makes it easier for human readers (and static analyzers)
16303         to see whether these functions can be called from other modules.
16304         DEFUN now defines a static function.  To make the function external
16305         so that it can be used in other C modules, use the new macro DEFUE.
16306         * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16307         (Finit_image_library):
16308         (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16309         (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16310         (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16311         Remove decls, since these functions are now static.
16312         (Funintern, Fget_internal_run_time): New decls, since these functions
16313         were already external.
16315         * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16316         * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16317         * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16318         * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16319         * keyboard.c, keymap.c, lread.c:
16320         * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16321         * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16322         * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16323         Mark functions with DEFUE instead of DEFUN,
16324         if they are used in other modules.
16325         * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16326         decls for now-static functions.
16327         * buffer.h (Fdelete_overlay): Remove decl.
16328         * callproc.c (Fgetenv_internal): Mark as internal.
16329         * composite.c (Fremove_list_of_text_properties): Remove decl.
16330         (Fcomposition_get_gstring): New forward static decl.
16331         * composite.h (Fcomposite_get_gstring): Remove decl.
16332         * dired.c (Ffile_attributes): New forward static decl.
16333         * doc.c (Fdocumntation_property): New forward static decl.
16334         * eval.c (Ffetch_bytecode): New forward static decl.
16335         (Funintern): Remove extern decl; now in .h file where it belongs.
16336         * fileio.c (Fmake_symbolic_link): New forward static decl.
16337         * image.c (Finit_image_library): New forward static decl.
16338         * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16339         * intervals.h (Fprevious_property_change):
16340         (Fremove_list_of_text_properties): Remove decls.
16341         * keyboard.c (Fthis_command_keys): Remove decl.
16342         (Fcommand_execute): New forward static decl.
16343         * keymap.c (Flookup_key): New forward static decl.
16344         (Fcopy_keymap): Now static.
16345         * keymap.h (Flookup_key): Remove decl.
16346         * process.c (Fget_process): New forward static decl.
16347         (Fprocess_datagram_address): Mark as internal.
16348         * syntax.c (Fsyntax_table_p): New forward static decl.
16349         (skip_chars): Remove duplicate decl.
16350         * textprop.c (Fprevious_property_change): New forward static decl.
16351         * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16352         Now internal.
16353         (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16354         * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16356         * editfns.c (Fformat): Remove unreachable code.
16358 2011-04-14  Andreas Schwab  <schwab@linux-m68k.org>
16360         * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16361         change.  (Bug#8496)
16363 2011-04-13  Eli Zaretskii  <eliz@gnu.org>
16365         * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16366         when at ZV.  (Bug#8487)
16368 2011-04-12  Andreas Schwab  <schwab@linux-m68k.org>
16370         * charset.c (Fclear_charset_maps): Use xfree instead of free.
16371         (Bug#8437)
16372         * keyboard.c (parse_tool_bar_item): Likewise.
16373         * sound.c (sound_cleanup, alsa_close): Likewise.
16374         * termcap.c (tgetent): Likewise.
16375         * xfns.c (x_default_font_parameter): Likewise.
16376         * xsettings.c (read_and_apply_settings): Likewise.
16378         * alloc.c (overrun_check_malloc, overrun_check_realloc)
16379         (overrun_check_free): Protoize.
16381 2011-04-12  Paul Eggert  <eggert@cs.ucla.edu>
16383         * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16384         since callers should never pass a negative size.
16385         Change the signature to match that of plain 'read' and 'write'; see
16386         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16387         * lisp.h: Update prototypes of emacs_write and emacs_read.
16389 2011-04-11  Eli Zaretskii  <eliz@gnu.org>
16391         * xdisp.c (redisplay_window): Don't try to determine the character
16392         position of the scroll margin if the window start point w->startp
16393         is outside the buffer's accessible region.  (Bug#8468)
16395 2011-04-10  Eli Zaretskii  <eliz@gnu.org>
16397         Fix write-region and its subroutines for buffers > 2GB.
16398         * fileio.c (a_write, e_write): Modify declaration of arguments and
16399         local variables to support buffers larger than 2GB.
16400         (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16402         * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16403         argument, local variables, and return value.
16405         * lisp.h: Update prototypes of emacs_write and emacs_read.
16407         * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16409 2011-04-10  Paul Eggert  <eggert@cs.ucla.edu>
16411         * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16413         Fix more problems found by GCC 4.6.0's static checks.
16415         * xdisp.c (vmessage): Use a better test for character truncation.
16417         * charset.c (load_charset_map): <, not <=, for optimization,
16418         and to avoid potential problems with integer overflow.
16419         * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
16420         * casetab.c (set_identity, shuffle): Likewise.
16421         * editfns.c (Fformat): Likewise.
16422         * syntax.c (skip_chars): Likewise.
16424         * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16425         This also lets GCC 4.6.0 generate slightly better loop code.
16427         * callint.c (Fcall_interactively): <, not <=, for optimization.
16428         (Fcall_interactively): Count the number of arguments produced,
16429         not the number of arguments given.  This is simpler and lets GCC
16430         4.6.0 generate slightly better code.
16432         * ftfont.c: Distingish more carefully between FcChar8 and char.
16433         The previous code passed unsigned char * to a functions like
16434         strlen and xstrcasecmp that expect char *, which does not
16435         conform to the C standard.
16436         (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16437         arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16438         char * when the C standard requires it.
16440         * keyboard.c (read_char): Remove unused var.
16442         * eval.c: Port to Windows vsnprintf (Bug#8435).
16443         Include <limits.h>.
16444         (SIZE_MAX): Define if the headers do not.
16445         (verror): Do not give up if vsnprintf returns a negative count.
16446         Instead, grow the buffer.  This ports to Windows vsnprintf, which
16447         does not conform to C99.  Problem reported by Eli Zaretskii.
16448         Also, simplify the allocation scheme, by avoiding the need for
16449         calling realloc, and removing the ALLOCATED variable.
16451         * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16453         Remove invocations of doprnt, as Emacs now uses vsnprintf.
16454         But keep the doprint source code for now, as we might revamp it
16455         and use it again (Bug#8435).
16456         * lisp.h (doprnt): Remove.
16457         * Makefile.in (base_obj): Remove doprnt.o.
16458         * deps.mk (doprnt.o): Remove.
16460         error: Print 32- and 64-bit integers portably (Bug#8435).
16461         Without this change, on typical 64-bit hosts error ("...%d...", N)
16462         was used to print both 32- and 64-bit integers N, which relied on
16463         undefined behavior.
16464         * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
16465         * lisp.h (error, verror): Mark as printf-like functions.
16466         * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16467         Report overflow in size calculations when allocating printf buffer.
16468         Do not truncate output string at its first null byte.
16469         * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16470         Truncate the output at a character boundary, since vsnprintf does not
16471         do that.
16472         * charset.c (check_iso_charset_parameter): Convert internal
16473         character to string before calling 'error', since %c now has the
16474         printf meaning.
16475         * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16476         overflow when computing char to be passed to 'error'.  Do not
16477         pass Lisp_Object to 'error'; pass the integer instead.
16478         * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16479         formatted with plain %d.
16481         * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16483         * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16485         * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16487         * xterm.c (x_catch_errors): Remove duplicate declaration.
16489         * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16491         * xdisp.c, lisp.h (message_nolog): Remove; unused.
16493 2011-04-10  Jim Meyering  <meyering@redhat.com>
16495         use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16496         * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16497         return ssize_t not "int", and use size_t as the buffer length.
16498         (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16499         * gnutls.h: Update declarations.
16500         * process.c (read_process_output): Use ssize_t, to match.
16501         (send_process): Likewise.
16503 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
16505         * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16507 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
16509         * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16510         Use unsigned char, to match FcChar8 type definition.
16512         * xterm.c (handle_one_xevent):
16513         * xmenu.c (create_and_show_popup_menu):
16514         * xselect.c (x_decline_selection_request)
16515         (x_reply_selection_request): Avoid type-punned deref of X events.
16517 2011-04-09  Eli Zaretskii  <eliz@gnu.org>
16519         Fix some uses of `int' instead of EMACS_INT.
16520         * search.c (string_match_1, fast_string_match)
16521         (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16522         (scan_buffer, find_next_newline_no_quit)
16523         (find_before_next_newline, search_command, Freplace_match)
16524         (Fmatch_data): Make some `int' variables be EMACS_INT.
16526         * xdisp.c (display_count_lines): 3rd argument and return value now
16527         EMACS_INT.  All callers changed.
16528         (pint2hrstr): Last argument is now EMACS_INT.
16530         * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16531         (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16532         (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16533         (decode_coding_utf_16, decode_coding_emacs_mule)
16534         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16535         (decode_coding_ccl, decode_coding_charset)
16536         <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16537         (decode_coding_iso_2022, decode_coding_emacs_mule)
16538         (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16539         <char_offset, last_offset>: Declare EMACS_INT.
16540         (encode_coding_utf_8, encode_coding_utf_16)
16541         (encode_coding_emacs_mule, encode_invocation_designation)
16542         (encode_designation_at_bol, encode_coding_iso_2022)
16543         (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16544         (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16545         Declare EMACS_INT.
16546         (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16547         (encode_invocation_designation): Last argument P_NCHARS is now
16548         EMACS_INT.
16549         (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16550         (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16552         * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16553         All users changed.
16555         * ccl.c (Fccl_execute_on_string): Declare some variables
16556         EMACS_INT.
16558 2011-04-08  Samuel Thibault  <sthibault@debian.org>  (tiny change)
16560         * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16562 2011-03-19  Christoph Scholtes  <cschol2112@googlemail.com>
16564         * process.c (Fformat_network_address): Doc fix.
16566 2011-04-08  T.V. Raman  <tv.raman.tv@gmail.com>  (tiny change)
16568         * xml.c (parse_region): Avoid creating spurious whitespace nodes.
16570 2011-04-08  Chong Yidong  <cyd@stupidchicken.com>
16572         * keyboard.c (read_char): Call Lisp function help-form-show,
16573         instead of using internal_with_output_to_temp_buffer.
16574         (Qhelp_form_show): New var.
16575         (syms_of_keyboard): Use DEFSYM macro.
16577         * print.c (internal_with_output_to_temp_buffer): Function deleted.
16579         * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16581 2011-04-06  Chong Yidong  <cyd@stupidchicken.com>
16583         * process.c (Flist_processes): Remove to Lisp.
16584         (list_processes_1): Delete.
16586 2011-04-06  Eli Zaretskii  <eliz@gnu.org>
16588         * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16590         * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16592 2011-04-06  Paul Eggert  <eggert@cs.ucla.edu>
16594         Fix more problems found by GCC 4.6.0's static checks.
16596         * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16598         * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16600         * lisp.h (message, message_nolog, fatal): Mark as printf-like.
16602         * xdisp.c (vmessage): Mark as a printf-like function.
16604         * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16606         * sound.c (sound_warning): Don't crash if arg contains a printf format.
16608         * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16609         printf-like functions.
16610         (tiff_load): Add casts to remove these marks before passing them
16611         to system-supplied API.
16613         * eval.c (Fsignal): Remove excess argument to 'fatal'.
16615         * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16616         This avoids several warnings with gcc -Wstrict-overflow.
16617         (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16618         directly, rather than having caller test rule sign.  This avoids
16619         some unnecessary tests.
16620         * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16621         (COMPOSITION_ENCODE_RULE): Arguments now must be valid.  This
16622         affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
16624         * xfont.c (xfont_text_extents): Remove var that was set but not used.
16625         (xfont_open): Avoid unnecessary tests.
16627         * composite.c (composition_gstring_put_cache): Use unsigned integer.
16629         * composite.h, composite.c (composition_gstring_put_cache):
16630         Use EMACS_INT, not int, for length.
16632         * composite.h (COMPOSITION_DECODE_REFS): New macro,
16633         breaking out part of COMPOSITION_DECODE_RULE.
16634         (COMPOSITION_DECODE_RULE): Use it.
16635         * composite.c (get_composition_id): Remove unused local vars,
16636         by using the new macro.
16638         * textprop.c (set_text_properties_1): Change while to do-while,
16639         since the condition is always true at first.
16641         * intervals.c (graft_intervals_into_buffer): Mark var as used.
16642         (interval_deletion_adjustment): Return unsigned value.
16643         All uses changed.
16645         * process.c (list_processes_1, create_pty, read_process_output):
16646         (exec_sentinel): Remove vars that were set but not used.
16647         (create_pty): Remove unnecessary "volatile"s.
16648         (Fnetwork_interface_info): Avoid possibility of int overflow.
16649         (read_process_output): Do adaptive read buffering even if carryover.
16650         (read_process_output): Simplify nbytes computation if buffered.
16652         * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16654         * syntax.c (scan_words): Remove var that was set but not used.
16655         (update_syntax_table): Use unsigned instead of int.
16657         * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
16658         (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
16659         (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
16661         * print.c (print_error_message): Avoid int overflow.
16663         * font.c (font_list_entities): Redo for clarity,
16664         so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16666         * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
16667         (font_score): Avoid potential overflow in diff calculation.
16669         * fns.c (substring_both): Remove var that is set but not used.
16670         (sxhash): Redo loop for clarity and to avoid wraparound warning.
16672         * eval.c (funcall_lambda): Rename local to avoid shadowing.
16674         * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16675         Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16676         can always succeed if overflow has undefined behavior.
16678         * search.c (boyer_moore, wordify): Remove vars set but not used.
16679         (wordify): Omit three unnecessary tests.
16681         * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16682         All callers changed.  This avoids the need for an unused var.
16684         * casefiddle.c (casify_region): Remove var that is set but not used.
16686         * dired.c (file_name_completion): Remove var that is set but not used.
16688         * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16690         * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
16691         (Finsert_file_contents): Remove unnecessary code checking fd.
16693         * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16694         Check for integer overflow on size calculations.
16696         * buffer.c (Fprevious_overlay_change): Remove var that is set
16697         but not used.
16699         * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16700         Remove vars that are set but not used.
16701         (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
16702         (timer_check_2): Mark vars as initialized.
16704         * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16706         * image.c (lookup_image): Remove var that is set but not used.
16707         (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
16709         * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16710         that are set but not used.
16712         * xfns.c (make_invisible_cursor): Don't return garbage
16713         if XCreateBitmapFromData fails (Bug#8410).
16715         * xselect.c (x_get_local_selection, x_handle_property_notify):
16716         Remove vars that are set but not used.
16718         * xfns.c (x_create_tip_frame): Remove var that is set but not used.
16719         (make_invisible_cursor): Initialize a possibly-uninitialized variable.
16721         * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16722         Remove var that is set but not used.
16723         (scroll_bar_windows_size): Now size_t, not int.
16724         (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16725         Check for overflow.
16727         * xfaces.c (realize_named_face): Remove vars that are set but not used.
16728         (map_tty_color) [!defined MSDOS]: Likewise.
16730         * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16732         * coding.c: Remove vars that are set but not used.
16733         (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16734         All callers changed.
16735         (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16736         (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16737         (decode_coding_charset): Remove vars that are set but not used.
16739         * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16740         that is set but not used.
16742         * print.c (print_object): Remove var that is set but not used.
16744         Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
16745         The gnulib version avoids calling malloc in the usual case,
16746         and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16747         * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16748         * filelock.c (current_lock_owner): Likewise.
16749         * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16750         * sysdep.c: Include allocator.h, careadlinkat.h.
16751         (emacs_no_realloc_allocator): New static constant.
16752         (emacs_readlink): New function.
16753         * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16754         ../lib/careadlinkat.h.
16756 2011-04-04  Stefan Monnier  <monnier@iro.umontreal.ca>
16758         * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16759         first non-nil return value).
16761 2011-04-03  Jan Djärv  <jan.h.d@swipnet.se>
16763         * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
16764         if not defined (Bug#8403).
16766 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
16768         * xdisp.c (display_count_lines): Remove parameter `start',
16769         unused since 1998-01-01T02:27:27Z!rms@gnu.org.  All callers changed.
16770         (get_char_face_and_encoding): Remove parameter `multibyte_p',
16771         unused since 2008-05-14T01:40:23Z!handa@m17n.org.  All callers changed.
16772         (fill_stretch_glyph_string): Remove parameters `row' and `area',
16773         unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
16774         and thereabouts.  All callers changed.
16775         (get_per_char_metric): Remove parameter `f', unused since
16776         2008-05-14T01:40:23Z!handa@m17n.org.  All callers changed.
16778 2011-04-02  Jim Meyering  <meyering@redhat.com>
16780         do not dereference NULL upon failed strdup
16781         * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
16782         (ns_get_family): Likewise.
16784 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
16786         * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
16788 2011-04-02  Jan Djärv  <jan.h.d@swipnet.se>
16790         * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
16791         later (Bug#8403).
16793 2011-04-01  Stefan Monnier  <monnier@iro.umontreal.ca>
16795         Add lexical binding.
16797         * window.c (Ftemp_output_buffer_show): New fun.
16798         (Fsave_window_excursion):
16799         * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16801         * lread.c (lisp_file_lexically_bound_p): New function.
16802         (Fload): Bind Qlexical_binding.
16803         (readevalloop): Remove `evalfun' arg.
16804         Bind Qinternal_interpreter_environment.
16805         (Feval_buffer): Bind Qlexical_binding.
16806         (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16807         Mark as dynamic.
16808         (syms_of_lread): Declare `lexical-binding'.
16810         * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16812         * keyboard.c (eval_dyn): New fun.
16813         (menu_item_eval_property): Use it.
16815         * image.c (parse_image_spec): Use Ffunctionp.
16817         * fns.c (concat, mapcar1): Accept byte-code-functions.
16819         * eval.c (Fsetq): Handle lexical vars.
16820         (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16821         (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16822         (FletX, Flet): Obey lexical binding.
16823         (Fcommandp): Handle closures.
16824         (Feval): New `lexical' arg.
16825         (eval_sub): New function extracted from Feval.  Use it almost
16826         everywhere where Feval was used.  Look up vars in lexical env.
16827         Handle closures.
16828         (Ffunctionp): Move from subr.el.
16829         (Ffuncall): Handle closures.
16830         (apply_lambda): Remove `eval_flags'.
16831         (funcall_lambda): Handle closures and new byte-code-functions.
16832         (Fspecial_variable_p): New function.
16833         (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16834         but without exporting it to Lisp.
16836         * doc.c (Fdocumentation, store_function_docstring):
16837         * data.c (Finteractive_form): Handle closures.
16839         * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16840         interactive spec.
16842         * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16843         New byte-codes.
16844         (exec_byte_code): New function extracted from Fbyte_code to handle new
16845         calling convention for byte-code-functions.  Add new byte-codes.
16847         * buffer.c (defvar_per_buffer): Set new `declared_special' field.
16849         * alloc.c (Fmake_symbol): Init new `declared_special' field.
16851 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
16853         * xdisp.c (redisplay_internal): Fix prototype.
16855 2011-03-31  Eli Zaretskii  <eliz@gnu.org>
16857         * xdisp.c (SCROLL_LIMIT): New macro.
16858         (try_scrolling): Use it when setting scroll_limit.
16859         Limit scrolling to 100 screen lines.
16860         (redisplay_window): Even when falling back on "recentering",
16861         position point in the window according to scroll-conservatively,
16862         scroll-margin, and scroll-*-aggressively variables.  (Bug#6671)
16864         (try_scrolling): When point is above the window, allow searching
16865         as far as scroll_max, or one screenful, to compute vertical
16866         distance from PT to the scroll margin position.  This prevents
16867         try_scrolling from unnecessarily failing when
16868         scroll-conservatively is set to a value slightly larger than the
16869         window height.  Clean up the case of PT below the margin at bottom
16870         of window: scroll_max can no longer be INT_MAX.  When aggressive
16871         scrolling is in use, don't let point enter the opposite scroll
16872         margin as result of the scroll.
16873         (syms_of_xdisp) <scroll-conservatively>: Document the
16874         threshold of 100 lines for never-recentering scrolling.
16876 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
16878         * dispextern.h (move_it_by_lines):
16879         * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
16880         since 2000-12-29T14:24:09Z!gerd@gnu.org.  All callers changed.
16881         (message_log_check_duplicate): Remove parameters `prev_bol' and
16882         `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org.  All callers changed.
16883         (redisplay_internal): Remove parameter `preserve_echo_area',
16884         unused since 1999-07-21T21:43:52Z!gerd@gnu.org.  All callers changed.
16886         * indent.c (Fvertical_motion):
16887         * window.c (window_scroll_pixel_based, Frecenter):
16888         Don't pass `need_y_p' to `move_it_by_lines'.
16890 2011-03-30  Stefan Monnier  <monnier@iro.umontreal.ca>
16892         * eval.c (struct backtrace): Don't cheat with negative numbers, but do
16893         steal a few bits to be more compact.
16894         (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
16895         Remove unneeded casts.
16897         * bytecode.c (Fbyte_code): CAR and CDR can GC.
16899 2011-03-30  Zachary Kanfer  <zkanfer@gmail.com>  (tiny change)
16901         * keyboard.c (Fexecute_extended_command): Do log the "suggest key
16902         binding" message (bug#7967).
16904 2011-03-30  Paul Eggert  <eggert@cs.ucla.edu>
16906         Fix more problems found by GCC 4.6.0's static checks.
16908         * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
16909         Remove unused local var.
16911         * editfns.c (Fmessage_box): Remove unused local var.
16913         * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
16914         (note_mode_line_or_margin_highlight, note_mouse_highlight):
16915         Omit unused local vars.
16916         * window.c (shrink_windows): Omit unused local var.
16917         * menu.c (digest_single_submenu): Omit unused local var.
16918         * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16919         Omit unused local var.
16921         * keyboard.c (parse_modifiers_uncached, parse_modifiers):
16922         Don't assume string length fits in int.
16923         (keyremap_step, read_key_sequence): Use size_t for sizes.
16924         (read_key_sequence): Don't check last_real_key_start redundantly.
16926         * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
16927         instead of alloca (Bug#8344).
16929         * eval.c (Fbacktrace): Don't assume nargs fits in int.
16930         (Fbacktrace_frame): Don't assume nframes fits in int.
16932         * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
16934         * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
16935         concerns.
16937         * term.c (produce_glyphless_glyph): Remove unnecessary test.
16939         * cm.c (calccost): Turn while-do into do-while, for clarity.
16941         * keyboard.c (syms_of_keyboard): Use the same style as later
16942         in this function when indexing through an array.  This also
16943         works around GCC bug 48267.
16945         * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
16947         * xselect.c (x_check_property_data): Return correct size (Bug#8335).
16949         * chartab.c (sub_char_table_ref_and_range): Redo for slight
16950         efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
16952         * keyboard.c, keyboard.h (num_input_events): Now size_t.
16953         This avoids undefined behavior on integer overflow, and is a bit
16954         more convenient anyway since it is compared to a size_t variable.
16956         Variadic C functions now count arguments with size_t, not int.
16957         This avoids an unnecessary limitation on 64-bit machines, which
16958         caused (substring ...) to crash on large vectors (Bug#8344).
16959         * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
16960         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
16961         All variadic functions and their callers changed accordingly.
16962         (struct gcpro.nvars): Now size_t, not int.  All uses changed.
16963         * data.c (arith_driver, float_arith_driver): Likewise.
16964         * editfns.c (general_insert_function): Likewise.
16965         * eval.c (struct backtrace.nargs, interactive_p)
16966         (internal_condition_case_n, run_hook_with_args, apply_lambda)
16967         (funcall_lambda, mark_backtrace): Likewise.
16968         * fns.c (concat): Likewise.
16969         * frame.c (x_set_frame_parameters): Likewise.
16970         * fns.c (get_key_arg): Now accepts and returns size_t, and returns
16971         0 if not found, not -1.  All callers changed.
16973         * alloc.c (garbage_collect): Don't assume stack size fits in int.
16974         (stack_copy_size): Now size_t, not int.
16975         (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
16977 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
16979         * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
16980         unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16981         All callers changed.
16983         * lisp.h (multibyte_char_to_unibyte):
16984         * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
16985         unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16986         * character.h (CHAR_TO_BYTE8):
16987         * cmds.c (internal_self_insert):
16988         * editfns.c (general_insert_function):
16989         * keymap.c (push_key_description):
16990         * search.c (Freplace_match):
16991         * xdisp.c (message_dolog, set_message_1): All callers changed.
16993 2011-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
16995         * keyboard.c (safe_run_hook_funcall): New function.
16996         (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
16997         don't set the hook to nil, but remove the offending function instead.
16998         (Qcommand_hook_internal): Remove, unused.
16999         (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17000         Vcommand_hook_internal.
17002         * eval.c (enum run_hooks_condition): Remove.
17003         (funcall_nil, funcall_not): New functions.
17004         (run_hook_with_args): Call each function through a `funcall' argument.
17005         Remove `cond' argument, now redundant.
17006         (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17007         (Frun_hook_with_args_until_failure): Adjust accordingly.
17008         (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17010 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
17012         * dispextern.h (string_buffer_position): Remove declaration.
17014         * print.c (strout): Remove parameter `multibyte', unused since
17015         1999-08-21T19:30:21Z!gerd@gnu.org.  All callers changed.
17017         * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17018         never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17019         All callers changed.
17021         * w32.c (_wsa_errlist): Use braces for struct initializers.
17023         * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17024         never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17025         All callers changed.
17026         (string_buffer_position): Likewise.  Also, make static (it's never
17027         used outside xdisp.c).
17028         (cursor_row_p): Remove parameter `w', unused since
17029         2000-10-17T16:08:57Z!gerd@gnu.org.  All callers changed.
17030         (decode_mode_spec): Remove parameter `precision', introduced during
17031         Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17032         All callers changed.
17034 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
17036         * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17038 2011-03-27  Anders Lindgren  <andlind@gmail.com>
17040         * nsterm.m (ns_menu_bar_is_hidden): New variable.
17041         (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17042         (ns_update_auto_hide_menu_bar): New functions.
17043         (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17044         (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17045         ns_constrain_all_frames.
17046         (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17047         (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17049 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
17051         * nsmenu.m (runDialogAt): Remove argument to timer_check.
17053 2011-03-27  Glenn Morris  <rgm@gnu.org>
17055         * syssignal.h: Replace RETSIGTYPE with void.
17056         * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17057         * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17058         Replace SIGTYPE with void everywhere.
17059         * s/usg5-4-common.h (SIGTYPE): Remove definition.
17060         * s/template.h (SIGTYPE): Remove commented out definition.
17062 2011-03-26  Eli Zaretskii  <eliz@gnu.org>
17064         * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17065         flag as a prerequisite for invoking try_scrolling.  (Bug#6671)
17067 2011-03-26  Juanma Barranquero  <lekktu@gmail.com>
17069         * w32.c (read_unc_volume): Use parameter `henum', instead of
17070         global variable `wget_enum_handle'.
17072         * keymap.c (describe_vector): Remove parameters `indices' and
17073         `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17074         (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17076         * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17078         * keyboard.c (timer_check): Remove parameter `do_it_now',
17079         unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17080         (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17081         unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17083         * keyboard.c (read_char):
17084         * w32menu.c (w32_menu_display_help):
17085         * xmenu.c (show_help_event, menu_help_callback):
17086         Adjust calls to `show_help_echo'.
17088         * gtkutil.c (xg_maybe_add_timer):
17089         * keyboard.c (readable_events):
17090         * process.c (wait_reading_process_output):
17091         * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17093         * insdel.c (adjust_markers_gap_motion):
17094         Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17095         (gap_left, gap_right): Don't call it.
17097 2011-03-25  Chong Yidong  <cyd@stupidchicken.com>
17099         * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17100         incurred during fontification.
17102 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
17104         * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17105         (DEFVAR_PER_BUFFER): Don't pass it.
17107         * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17108         (scrolling_window): Don't pass it.
17110 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
17112         * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17114         * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17115         and `suffix'.
17116         (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17117         of variables specific to SELinux and computation of `encoded_absname'.
17119         * image.c (XPutPixel): Remove unused variable `height'.
17121         * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17123         * unexw32.c (get_section_info): Remove unused variable `section'.
17125         * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17126         (system_process_attributes): Remove unused variable `sess'.
17127         (sys_read): Remove unused variable `err'.
17129         * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17130         (w32_wnd_proc): Remove unused variable `isdead'.
17131         (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17132         (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17133         (x_create_tip_frame): Remove unused variable `tem'.
17135         * w32inevt.c (w32_console_read_socket):
17136         Remove unused variable `no_events'.
17138         * w32term.c (x_draw_composite_glyph_string_foreground):
17139         Remove unused variable `width'.
17141 2011-03-24  Juanma Barranquero  <lekktu@gmail.com>
17143         * w32term.c (x_set_glyph_string_clipping):
17144         Don't pass uninitialized region to CombineRgn.
17146 2011-03-23  Juanma Barranquero  <lekktu@gmail.com>
17148         * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17149         (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17150         (Fx_close_connection): Remove unused variable `i'.
17152         * w32font.c (w32font_draw): Return number of glyphs.
17153         (w32font_open_internal): Remove unused variable `i'.
17154         (w32font_driver): Add missing initializer.
17156         * w32menu.c (utf8to16): Remove unused variable `utf16'.
17157         (fill_in_menu): Remove unused variable `items_added'.
17159         * w32term.c (last_mouse_press_frame): Remove static global variable.
17160         (w32_clip_to_row): Remove unused variable `f'.
17161         (x_delete_terminal): Remove unused variable `i'.
17163         * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17164         (NOTHING): Remove unused static global variable.
17165         (uniscribe_check_otf): Remove unused variable `table'.
17166         (uniscribe_font_driver): Add missing initializers.
17168 2011-03-23  Julien Danjou  <julien@danjou.info>
17170         * term.c (Fsuspend_tty, Fresume_tty):
17171         * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17172         * window.c (temp_output_buffer_show):
17173         * insdel.c (signal_before_change):
17174         * frame.c (Fhandle_switch_frame):
17175         * fileio.c (Fdo_auto_save):
17176         * emacs.c (Fkill_emacs):
17177         * editfns.c (save_excursion_restore):
17178         * cmds.c (internal_self_insert):
17179         * callint.c (Fcall_interactively):
17180         * buffer.c (Fkill_all_local_variables):
17181         * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17182         Use Frun_hooks.
17183         (command_loop_1): Use Frun_hooks.  Call safe_run_hooks
17184         unconditionally since it does the check itself.
17186 2011-03-23  Paul Eggert  <eggert@cs.ucla.edu>
17188         Fix more problems found by GCC 4.5.2's static checks.
17190         * coding.c (encode_coding_raw_text): Avoid unnecessary test
17191         the first time through the loop, since we know p0 < p1 then.
17192         This also avoids a gcc -Wstrict-overflow warning.
17194         * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17195         leading to a memory leak, possible in functions like
17196         load_charset_map_from_file that can allocate an unbounded number
17197         of objects (Bug#8318).
17199         * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17200         that could (at least in theory) be that large.
17202         * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17203         This is less likely to overflow, and avoids undefined behavior if
17204         overflow does occur.  All callers changed.  Use strtoul to scan
17205         for the unsigned long integer.
17206         (pint2hrstr): Simplify and tune code slightly.
17207         This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
17209         * scroll.c (do_scrolling): Work around GCC bug 48228.
17210         See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17212         * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17213         This also avoids a warning with gcc -Wstrict-overflow.
17214         (validate_x_resource_name): Simplify count usage.
17215         This also avoids a warning with gcc -Wstrict-overflow.
17217         * fileio.c (Fcopy_file): Report error if fchown or fchmod
17218         fail (Bug#8306).
17220         * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
17222         * process.c (Fmake_network_process): Use socklen_t, not int,
17223         where POSIX says socklen_t is required in portable programs.
17224         This fixes a porting bug on hosts like 64-bit HP-UX, where
17225         socklen_t is wider than int (Bug#8277).
17226         (Fmake_network_process, server_accept_connection):
17227         (wait_reading_process_output, read_process_output):
17228         Likewise.
17230         * process.c: Rename or move locals to avoid shadowing.
17231         (list_processes_1, Fmake_network_process):
17232         (read_process_output_error_handler, exec_sentinel_error_handler):
17233         Rename or move locals.
17234         (Fmake_network_process): Define label "retry_connect" only if needed.
17235         (Fnetwork_interface_info): Fix pointer signedness.
17236         (process_send_signal): Add cast to avoid pointer signedness problem.
17237         (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
17238         (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
17240         Make tparam.h and terminfo.c consistent.
17241         * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17242         Include tparam.h instead, since it declares them.
17243         * cm.h (PC): Remove extern decl; tparam.h now does this.
17244         * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17245         * terminfo.c: Include tparam.h, to check interfaces.
17246         (tparm): Make 1st arg a const pointer in decl.  Put it at top level.
17247         (tparam): Adjust signature to match interface in tparam.h;
17248         this removes some undefined behavior.  Check that outstring and len
17249         are zero, which they always are with Emacs.
17250         * tparam.h (PC, BC, UP): New extern decls.
17252         * xftfont.c (xftfont_shape): Now static, and defined only if needed.
17253         (xftfont_open): Rename locals to avoid shadowing.
17255         * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
17256         (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17257         (OTF_TAG_SYM): Omit macro if not needed.
17258         (ftfont_list): Remove unused local.
17259         (get_adstyle_property, ftfont_pattern_entity):
17260         (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17261         Rename locals to avoid shadowing.
17263         * xfont.c (xfont_list_family): Mark var as initialized.
17265         * xml.c (make_dom): Now static.
17267         * composite.c (composition_compute_stop_pos): Rename local to
17268         avoid shadowing.
17269         (composition_reseat_it): Remove unused locals.
17270         (find_automatic_composition, composition_adjust_point): Likewise.
17271         (composition_update_it): Mark var as initialized.
17272         (find_automatic_composition): Mark vars as initialized,
17273         with a FIXME (Bug#8290).
17275         character.h: Rename locals to avoid shadowing.
17276         * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17277         (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17278         (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17279         (BUF_DEC_POS): Be more systematic about renaming local temporaries
17280         to avoid shadowing.
17282         * textprop.c (property_change_between_p): Remove; unused.
17284         * intervals.c (interval_start_pos): Now static.
17286         * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17288         * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17289         Rename locals to avoid shadowing.
17291         * sound.c (wav_play, au_play, Fplay_sound_internal):
17292         Fix pointer signedness.
17293         (alsa_choose_format): Remove unused local var.
17294         (wav_play): Initialize a variable to 0, to prevent undefined
17295         behavior (Bug#8278).
17297         * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17299         * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17301         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17302         clobbering (Bug#8298).
17303         * sysdep.c (sys_subshell): Likewise.
17304         Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
17306         * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17307         This should get cleaned up, so that child_setup has the
17308         same signature on all platforms.
17310         * callproc.c (call_process_cleanup): Now static.
17311         (relocate_fd): Rename locals to avoid shadowing.
17313 2011-03-22  Chong Yidong  <cyd@stupidchicken.com>
17315         * xterm.c (x_clear_frame): Remove XClearWindow call.  This appears
17316         not to be necessary, and produces flickering.
17318 2011-03-20  Glenn Morris  <rgm@gnu.org>
17320         * config.in: Remove file.
17322 2011-03-20  Juanma Barranquero  <lekktu@gmail.com>
17324         * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17325         are now in src/globals.h.
17326         (syms_of_minibuf): Remove spurious & from previous change.
17328 2011-03-20  Leo Liu  <sdl.web@gmail.com>
17330         * minibuf.c (completing-read-function): New variable.
17331         (completing-read-default): Rename from completing-read.
17332         (completing-read): Call completing-read-function.
17334 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
17336         * xfaces.c (Fx_load_color_file):
17337         Read color file from absolute filename (bug#8250).
17339 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
17341         * makefile.w32-in: Update dependencies.
17343 2011-03-17  Eli Zaretskii  <eliz@gnu.org>
17345         * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17347 2011-03-17  Paul Eggert  <eggert@cs.ucla.edu>
17349         Fix more problems found by GCC 4.5.2's static checks.
17351         * process.c (make_serial_process_unwind, send_process_trap):
17352         (sigchld_handler): Now static.
17354         * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17355         That way, the code declares only the vars that it needs.
17356         * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17357         * s/cygwin.h (PTY_ITERATION): Likewise.
17358         * s/darwin.h (PTY_ITERATION): Likewise.
17359         * s/gnu-linux.h (PTY_ITERATION): Likewise.
17361         * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17362         * process.c (allocate_pty): Don't declare stb unless it's needed.
17364         * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
17365         (CONSTANTLIM): Remove; unused.
17366         (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17367         Define only if needed.
17369         * unexelf.c (unexec): Name an expression,
17370         to avoid gcc -Wbad-function-cast warning.
17371         Use a different way to cause a compilation error if anyone uses
17372         n rather than nn, a way that does not involve shadowing.
17373         (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
17375         * deps.mk (unexalpha.o): Remove; unused.
17377         New file unexec.h, the (simple) interface for unexec (Bug#8267).
17378         * unexec.h: New file.
17379         * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17380         (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17381         Depend on unexec.h.
17382         * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17383         * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17384         * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
17385         Change as necessary to match prototype in unexec.h.
17387         * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17388         shadowing.
17389         (back_comment, skip_chars): Mark vars as initialized.
17391         * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17392         Rename locals to avoid shadowing.
17394         * lread.c (read1): Rewrite so as not to use empty "else".
17395         (Fload, readevalloop, read1): Rename locals to avoid shadowing.
17397         * print.c (Fredirect_debugging_output): Fix pointer signedess.
17399         * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17400         warning when compiling print.c.
17402         * font.c (font_unparse_fcname): Abort in an "impossible" situation
17403         instead of using an uninitialized var.
17404         (font_sort_entities): Mark var as initialized.
17406         * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17408         * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17409         pointers to constants.
17410         (font_parse_fcname): Remove unused vars.
17411         (font_delete_unmatched): Now static.
17412         (font_get_spec): Remove; unused.
17413         (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17414         (font_update_drivers, Ffont_get_glyphs, font_add_log):
17415         Rename or move locals to avoid shadowing.
17417         * fns.c (require_nesting_list, require_unwind): Now static.
17418         (Ffillarray): Rename locals to avoid shadowing.
17420         * floatfns.c (domain_error2): Define only if needed.
17421         (Ffrexp, Fldexp): Rename locals to avoid shadowing.
17423         * alloc.c (mark_backtrace): Move decl from here ...
17424         * lisp.h: ... to here, so that it can be checked.
17426         * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
17427         (Fdefvar): Rewrite so as not to use empty "else".
17428         (lisp_indirect_variable): Name an expression,
17429         to avoid gcc -Wbad-function-cast warning.
17430         (Fdefvar): Rename locals to avoid shadowing.
17432         * callint.c (quotify_arg, quotify_args): Now static.
17433         (Fcall_interactively): Rename locals to avoid shadowing.
17434         Use const pointer when appropriate.
17436         * lisp.h (get_system_name, get_operating_system_release):
17437         Move decls here, to check interfaces.
17438         * process.c (get_operating_system_release): Move decl to lisp.h.
17439         * xrdb.c (get_system_name): Likewise.
17440         * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17441         (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17442         some of which prompt warnings from gcc -Wbad-function-cast.
17443         (Fformat_time_string, Fencode_time, Finsert_char):
17444         (Ftranslate_region_internal, Fformat):
17445         Rename or remove local vars to avoid shadowing.
17446         (Ftranslate_region_internal): Mark var as initialized.
17448         * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17449         avoid shadowing.
17451         * lisp.h (eassert): Check that the argument compiles, even if
17452         ENABLE_CHECKING is not defined.
17454         * data.c (Findirect_variable): Name an expression, to avoid
17455         gcc -Wbad-function-cast warning.
17456         (default_value, arithcompare, arith_driver, arith_error): Now static.
17457         (store_symval_forwarding): Rename local to avoid shadowing.
17458         (Fmake_variable_buffer_local, Fmake_local_variable):
17459         Mark variables as initialized.
17460         (do_blv_forwarding, do_symval_forwarding): Remove; unused.
17462         * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
17463         (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17464         Rename locals to avoid shadowing.
17465         (mark_stack): Move local variables into the #ifdef region where
17466         they're used.
17467         (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17468         ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17469         needed otherwise.
17470         (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17471         (GC_STRING_CHARS): Remove; not used.
17472         (Fmemory_limit): Cast sbrk's returned value to char *.
17474         * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17475         avoids undefined behavior in theory.
17477         * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17479         Use functions, not macros, for up- and down-casing (Bug#8254).
17480         * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17481         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove.  All callers changed
17482         to use the following functions instead of these macros.
17483         (downcase): Adjust to lack of DOWNCASE_TABLE.  Return int, not
17484         EMACS_INT, since callers assume the returned value fits in int.
17485         (upcase1): Likewise, for UPCASE_TABLE.
17486         (uppercasep, lowercasep, upcase): New static inline functions.
17487         * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
17488         the race-condition problem in the old DOWNCASE.
17490         * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17491         Rename locals to avoid shadowing.
17492         (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
17493         (regex_compile, re_search_2, re_match_2_internal):
17494         Remove unused local vars.
17495         (FREE_VAR): Rewrite so as not to use empty "else",
17496         which gcc can warn about.
17497         (regex_compile, re_match_2_internal): Mark locals as initialized.
17498         (RETALLOC_IF): Define only if needed.
17499         (WORDCHAR_P): Likewise.  This one is never needed, but is used
17500         only in a comment talking about a compiler bug, so put inside
17501         the #if 0 of that comment.
17502         (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17503         (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17504         Remove; unused.
17506         * search.c (boyer_moore): Rename locals to avoid shadowing.
17507         * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17508         (PREV_CHAR_BOUNDARY): Likewise.
17510         * search.c (simple_search): Remove unused var.
17512         * dired.c (compile_pattern): Move decl from here ...
17513         * lisp.h: ... to here, so that it can be checked.
17514         (struct re_registers): New forward decl.
17516         * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17518         * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17519         All uses changed.
17520         (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17521         Rename locals to avoid shadowing.
17522         (Fvertical_motion): Mark locals as initialized.
17524         * casefiddle.c (casify_object, casify_region): Now static.
17525         (casify_region): Mark local as initialized.
17527         * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17529         * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17530         New macros, so that the caller can use some names other than
17531         gcpro1, gcpro2, etc.
17532         (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17533         of the new macros.
17534         (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17535         argument, for consistency with GCPRO2_VAR, etc: it is now the
17536         prefix of the variable, not the variable itself.  All uses
17537         changed.
17538         * dired.c (directory_files_internal, file_name_completion):
17539         Rename locals to avoid shadowing.
17541         Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17542         An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17543         dired.c's scmp function, had undefined behavior.
17544         * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17545         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17546         * buffer.h: ... to here, because these macros use current_buffer,
17547         and the new implementation with inline functions needs to have
17548         current_buffer in scope now, rather than later when the macros
17549         are used.
17550         (downcase, upcase1): New static inline functions.
17551         (DOWNCASE, UPCASE1): Reimplement using these functions.
17552         This avoids undefined behavior in expressions like
17553         DOWNCASE (x) == DOWNCASE (y), which previously suffered
17554         from race conditions in accessing the global variables
17555         case_temp1 and case_temp2.
17556         * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17557         * lisp.h (case_temp1, case_temp2): Remove their decls.
17558         * character.h (ASCII_CHAR_P): Move from here ...
17559         * lisp.h: ... to here, so that the inline functions mentioned
17560         above can use them.
17562         * dired.c (directory_files_internal_unwind): Now static.
17564         * fileio.c (file_name_as_directory, directory_file_name):
17565         (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17566         Now static.
17567         (file_name_as_directory): Use const pointers when appropriate.
17568         (Fexpand_file_name): Likewise.  In particular, newdir might
17569         point at constant storage, so make it a const pointer.
17570         (Fmake_directory_internal, Fread_file_name): Remove unused vars.
17571         (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17572         signedness issues.
17573         (Fset_file_times, Finsert_file_contents, auto_save_error):
17574         Rename locals to avoid shadowing.
17576         * minibuf.c (choose_minibuf_frame_1): Now static.
17577         (Ftry_completion, Fall_completions): Rename or remove locals
17578         to avoid shadowing.
17580         * marker.c (bytepos_to_charpos): Remove; unused.
17582         * lisp.h (verify_bytepos, count_markers): New decls,
17583         so that gcc does not warn that these functions aren't declared.
17585         * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17586         (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
17587         (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
17588         (copy_text): Remove unused local var.
17590         * filelock.c (within_one_second): Now static.
17591         (lock_file_1): Rename local to avoid shadowing.
17593         * buffer.c (fix_overlays_before): Mark locals as initialized.
17594         (fix_start_end_in_overlays): Likewise.  This function should be
17595         simplified by using pointers-to-pointers, but that's a different
17596         matter.
17597         (switch_to_buffer_1): Now static.
17598         (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17599         (report_overlay_modification): Rename locals to avoid shadowing.
17601         * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
17602         Fix pointer signedness issue.
17603         (sys_subshell): Mark local as volatile if checking for lint,
17604         to suppress a gcc -Wclobbered warning that does not seem to be right.
17605         (MAXPATHLEN): Define only if needed.
17607         * process.c (serial_open, serial_configure): Move decls from here ...
17608         * systty.h: ... to here, so that they can be checked.
17610         * fns.c (get_random, seed_random): Move extern decls from here ...
17611         * lisp.h: ... to here, so that they can be checked.
17613         * sysdep.c (reset_io): Now static.
17614         (wait_for_termination_signal): Remove; unused.
17616         * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17617         (copy_keymap_item, append_key, push_text_char_description):
17618         Now static.
17619         (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
17620         (DENSE_TABLE_SIZE): Remove; unused.
17621         (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17622         (describe_map_tree):
17623         Rename locals to avoid shadowing.
17625         * keyboard.c: Declare functions static if they are not used elsewhere.
17626         (echo_char, echo_dash, cmd_error, top_level_2):
17627         (poll_for_input, handle_async_input): Now static.
17628         (read_char, kbd_buffer_get_event, make_lispy_position):
17629         (make_lispy_event, make_lispy_movement, apply_modifiers):
17630         (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17631         (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17632         (Fread_key_sequence_vector): Rename locals to avoid shadowing.
17633         (read_key_sequence, read_char): Mark locals as initialized.
17634         (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
17636         * keyboard.h (make_ctrl_char): New decl.
17637         (mark_kboards): Move decl here ...
17638         * alloc.c (mark_kboards): ... from here.
17640         * lisp.h (force_auto_save_soon): New decl.
17642         * emacs.c (init_cmdargs): Rename local to avoid shadowing.
17643         (DEFINE_DUMMY_FUNCTION): New macro.
17644         (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17645         Use it.
17646         (main): Add casts to avoid warnings
17647         if GCC considers string literals to be constants.
17649         * lisp.h (fatal_error_signal): Add decl, since it's exported.
17651         * dbusbind.c: Pointer signedness fixes.
17652         (xd_signature, xd_append_arg, xd_initialize):
17653         (Fdbus_call_method, Fdbus_call_method_asynchronously):
17654         (Fdbus_method_return_internal, Fdbus_method_error_internal):
17655         (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17656         (Fdbus_register_signal): Use SSDATA when the context wants char *.
17658         * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17659         if GCC considers string literals to be constants.
17660         (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
17662 2011-03-16  Stefan Monnier  <monnier@iro.umontreal.ca>
17664         * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17665         (print_preprocess, print_object): New macro to fix last change.
17667         * print.c (print_preprocess): Don't forget font objects.
17669 2011-03-16  Juanma Barranquero  <lekktu@gmail.com>
17671         * emacs.c (USAGE3): Doc fixes.
17673 2011-03-15  Andreas Schwab  <schwab@linux-m68k.org>
17675         * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17676         structure.
17678 2011-03-14  Juanma Barranquero  <lekktu@gmail.com>
17680         * lisp.h (VWindow_system, Qfile_name_history):
17681         * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17682         * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17683         (w32_system_caret_x, w32_system_caret_y): Declare extern.
17685         * w32select.c: Don't #include "keyboard.h".
17686         (run_protected): Add extern declaration for waiting_for_input.
17688         * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17689         * w32console.c (detect_input_pending, read_input_pending)
17690         (encode_terminal_code):
17691         * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17692         (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17693         (w32_system_caret_y, Qfile_name_history):
17694         * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17695         * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17696         * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17697         (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17698         * w32proc.c (Qlocal, report_file_error):
17699         * w32term.c (Vwindow_system, updating_frame):
17700         * w32uniscribe.c (initialized, uniscribe_font_driver):
17701         Remove unneeded extern declarations.
17703 2011-03-14  Chong Yidong  <cyd@stupidchicken.com>
17705         * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
17707 2011-03-13  Chong Yidong  <cyd@stupidchicken.com>
17709         * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17710         (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17711         These macros can no longer be used for assignment.
17713         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17714         Assign struct members directly, instead of using BUF_BEGV etc.
17715         (record_buffer_markers, fetch_buffer_markers): New functions for
17716         recording and fetching special buffer markers.
17717         (set_buffer_internal_1, set_buffer_temp): Use them.
17719         * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17721         * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17723         * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17724         (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17726         * xdisp.c (hscroll_window_tree):
17727         (reconsider_clip_changes): Use PT instead of BUF_PT.
17729 2011-03-13  Eli Zaretskii  <eliz@gnu.org>
17731         * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17732         $(EMACS_ROOT)/lib/intprops.h.
17734 2011-03-13  Paul Eggert  <eggert@cs.ucla.edu>
17736         Fix more problems found by GCC 4.5.2's static checks.
17738         * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17739         to unsigned char * to avoid compiler diagnostic.
17740         (xg_free_frame_widgets): Make it clear that a local variable is
17741         needed only if USE_GTK_TOOLTIP.
17742         (gdk_window_get_screen): Make it clear that this macro is needed
17743         only if USE_GTK_TOOLTIP.
17744         (int_gtk_range_get_value): New function, which avoids a diagnostic
17745         from gcc -Wbad-function-cast.
17746         (xg_set_toolkit_scroll_bar_thumb): Use it.
17747         (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17748         diagnostic from gcc -Wbad-function-cast.
17749         (get_utf8_string, xg_get_file_with_chooser):
17750         Rename locals to avoid shadowing.
17751         (create_dialog): Move locals to avoid shadowing.
17753         * xgselect.c (xg_select): Remove unused var.
17755         * image.c (four_corners_best): Mark locals as initialized.
17756         (gif_load): Initialize transparent_p to zero (Bug#8238).
17757         Mark another local as initialized.
17758         (my_png_error, my_error_exit): Mark with NO_RETURN.
17760         * image.c (clear_image_cache): Now static.
17761         (DIM, HAVE_STDLIB_H_1): Remove unused macros.
17762         (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
17763         (x_edge_detection): Remove unnecessary cast that
17764         gcc -Wbad-function-cast diagnoses.
17765         (gif_load): Fix pointer signedness.
17766         (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
17767         (jpeg_load, gif_load): Rename locals to avoid shadowing.
17769 2011-03-12  Paul Eggert  <eggert@cs.ucla.edu>
17771         Improve quality of tests for time stamp overflow.
17772         For example, without this patch (encode-time 0 0 0 1 1
17773         1152921504606846976) returns the obviously-bogus value (-948597
17774         62170) on my RHEL 5.5 x86-64 host.  With the patch, it correctly
17775         reports time overflow.  See
17776         <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
17777         * deps.mk (editfns.o): Depend on ../lib/intprops.h.
17778         * editfns.c: Include limits.h and intprops.h.
17779         (TIME_T_MIN, TIME_T_MAX): New macros.
17780         (time_overflow): Move earlier, to before first use.
17781         (hi_time, lo_time): New functions, for an accurate test for
17782         out-of-range times.
17783         (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
17784         (Fget_internal_run_time): Don't assume time_t fits in int.
17785         (make_time): Use list2 instead of Fcons twice.
17786         (Fdecode_time): More accurate test for out-of-range times.
17787         (check_tm_member): New function.
17788         (Fencode_time): Use it, to test for out-of-range times.
17789         (lisp_time_argument): Don't rely on undefined left-shift and
17790         right-shift behavior when checking for time stamp overflow.
17792         * editfns.c (time_overflow): New function, refactoring common code.
17793         (Fformat_time_string, Fdecode_time, Fencode_time):
17794         (Fcurrent_time_string): Use it.
17796         Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17797         * dired.c (make_time): Move to ...
17798         * editfns.c (make_time): ... here.
17799         * systime.h: Note the move.
17801 2011-03-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
17803         * fringe.c (update_window_fringes): Remove unused variables.
17805         * unexmacosx.c (copy_data_segment): Also copy __got section.
17806         (Bug#8223)
17808 2011-03-12  Eli Zaretskii  <eliz@gnu.org>
17810         * termcap.c [MSDOS]: Include "msdos.h".
17811         (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17812         Constify `char *' arguments and their references according to
17813         prototypes in tparam.h.
17815         * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
17817         * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17818         Adapt all references accordingly.
17820         * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17822 2011-03-11  Tom Tromey  <tromey@redhat.com>
17824         * buffer.c (syms_of_buffer): Remove obsolete comment.
17826 2011-03-11  Eli Zaretskii  <eliz@gnu.org>
17828         * termhooks.h (encode_terminal_code): Declare prototype.
17830         * msdos.c (encode_terminal_code): Don't declare prototype.
17832         * term.c (encode_terminal_code): Now external again, used by
17833         w32console.c and msdos.c.
17835         * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17836         Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
17838 2011-03-11  Paul Eggert  <eggert@cs.ucla.edu>
17840         Fix some minor problems found by GCC 4.5.2's static checks.
17842         * fringe.c (update_window_fringes): Mark locals as initialized
17843         (Bug#8227).
17844         (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
17846         * alloc.c (mark_fringe_data): Move decl from here ...
17847         * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17848         to check its interface.
17849         (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17851         * fontset.c (free_realized_fontset): Now static.
17852         (Fset_fontset_font): Rename local to avoid shadowing.
17853         (fontset_font): Mark local as initialized.
17854         (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
17856         * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17858         * xselect.c (x_disown_buffer_selections): Remove; not used.
17859         (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
17860         (x_own_selection, Fx_disown_selection_internal): Rename locals
17861         to avoid shadowing.
17862         (x_handle_dnd_message): Remove local to avoid shadowing.
17864         * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17865         so that the caller can use some name other than gcpro1.
17866         (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
17867         * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17868         (Fx_backspace_delete_keys_p):
17869         Use them to avoid shadowing, and rename vars to avoid shadowing.
17870         (x_decode_color, x_set_name, x_window): Now static.
17871         (Fx_create_frame): Add braces to silence GCC warning.
17872         (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
17873         (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
17874         Remove unused locals.
17875         (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17876         (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
17877         Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
17878         macros.
17880         * xterm.h (x_mouse_leave): New decl.
17882         * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
17883         Remove unused functions.
17884         (x_shift_glyphs_for_insert, XTflash, XTring_bell):
17885         (x_calc_absolute_position): Now static.
17886         (XTread_socket): Don't define label "out" unless it's used.
17887         Don't declare local "event" unless it's used.
17888         (x_iconify_frame, x_free_frame_resources): Don't declare locals
17889         unless they are used.
17890         (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
17891         (x_fatal_error_signal): Remove; not used.
17892         (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
17893         (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
17894         (x_error_catcher, x_connection_closed, x_error_handler):
17895         (x_error_quitter, xembed_send_message, x_iconify_frame):
17896         (my_log_handler): Rename locals to avoid shadowing.
17897         (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
17898         (x_connection_closed): Tell GCC not to suggest NO_RETURN.
17900         * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
17901         Rename or move locals to avoid shadowing.
17902         (tty_defined_color, merge_face_heights): Now static.
17903         (free_realized_faces_for_fontset): Remove; not used.
17904         (Fx_list_fonts): Mark variable that gcc -Wuninitialized
17905         does not deduce is never used uninitialized.
17906         (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
17907         (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
17909         * terminal.c (store_terminal_param): Now static.
17911         * xmenu.c (menu_highlight_callback): Now static.
17912         (set_frame_menubar): Remove unused local.
17913         (xmenu_show): Rename parameter to avoid shadowing.
17914         (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
17915         since they might point to immutable storage.
17916         (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
17917         since it's unused otherwise.
17919         * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
17920         Add a FIXME, since the code still doesn't look right.  (Bug#8215)
17921         (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
17922         avoids a gcc -Wuninitialized diagnostic.
17923         (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
17924         (note_mouse_highlight): Mark variables that gcc -Wuninitialized
17925         does not deduce are never used uninitialized.
17927         * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
17929         * xdisp.c (redisplay_window): Rename local to avoid shadowing.
17930         * window.c (window_loop, size_window):
17931         (run_window_configuration_change_hook, enlarge_window): Likewise.
17933         * window.c (display_buffer): Now static.
17934         (size_window): Mark variables that gcc -Wuninitialized
17935         does not deduce are never used uninitialized.
17936         * window.h (check_all_windows): New decl, to forestall
17937         gcc -Wmissing-prototypes diagnostic.
17938         * dispextern.h (bidi_dump_cached_states): Likewise.
17940         * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
17941         shadowing.
17942         * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
17943         Include <limits.h>.
17944         (Fsort_charsets): Redo min/max calculation to shorten the code a bit
17945         and to avoid gcc -Wuninitialized warning.
17946         (load_charset_map): Mark variables that gcc -Wuninitialized
17947         does not deduce are never used uninitialized.
17948         (load_charset): Abort instead of using uninitialized var (Bug#8229).
17950         * coding.c (coding_set_source, coding_set_destination):
17951         Use "else { /* comment */ }" rather than "else /* comment */;"
17952         for clarity, and to avoid gcc -Wempty-body warning.
17953         (Fdefine_coding_system_internal): Don't redeclare 'i' inside
17954         a block, when the outer 'i' will do.
17955         (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
17956         (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
17957         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
17958         (decode_coding_raw_text, decode_coding_charset, get_translation_table):
17959         (Fdecode_sjis_char, Fdefine_coding_system_internal):
17960         Rename locals to avoid shadowing.
17961         * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
17962         * coding.c (emacs_mule_char, encode_invocation_designation):
17963         Now static, since they're not used elsewhere.
17964         (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
17965         (decode_coding_object, encode_coding_object, detect_coding_system):
17966         (decode_coding_emacs_mule): Mark variables that gcc
17967         -Wuninitialized does not deduce are never used uninitialized.
17968         (detect_coding_iso_2022): Initialize a local variable that might
17969         be used uninitialized.  Leave a FIXME because it's not clear that
17970         this initialization is needed.  (Bug#8211)
17971         (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
17972         (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
17973         (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
17974         (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
17975         Remove unused macros.
17977         * category.c (hash_get_category_set): Remove unused local var.
17978         (copy_category_table): Now static, since it's not used elsewhere.
17979         * character.c (string_count_byte8): Likewise.
17981         * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
17982         (Fregister_code_conversion_map): Rename locals to avoid shadowing.
17984         * chartab.c (copy_sub_char_table): Now static, since it's not used
17985         elsewhere.
17986         (sub_char_table_ref_and_range, char_table_ref_and_range):
17987         Rename locals to avoid shadowing.
17988         (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
17990         * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
17991         (BIDI_BOB): Remove unused macro.
17993         * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
17994         deduce are never used uninitialized.
17995         * term.c (encode_terminal_code): Likewise.
17997         * term.c (encode_terminal_code): Now static.  Remove unused local.
17999         * tparam.h: New file.
18000         * term.c, tparam.h: Include it.
18001         * deps.mk (term.o, tparam.o): Depend on tparam.h.
18002         * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18003         Move these decls to tparam.h, and make them agree with what
18004         is actually in tparam.c.  The previous trick of using incompatible
18005         decls in different modules does not conform to the C standard.
18006         All callers of tparam changed to use tparam's actual API.
18007         * tparam.c (tparam1, tparam, tgoto):
18008         Use const pointers where appropriate.
18010         * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18011         * cm.h (struct cm): Likewise.
18012         * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18013         * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18014         * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18015         (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18016         (turn_on_face, init_tty): Likewise.
18017         * termchar.h (struct tty_display_info): Likewise.
18019         * term.c (term_mouse_position): Rename local to avoid shadowing.
18021         * alloc.c (mark_ttys): Move decl from here ...
18022         * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18024 2011-03-11  Andreas Schwab  <schwab@linux-m68k.org>
18026         * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18028 2011-03-09  Juanma Barranquero  <lekktu@gmail.com>
18030         * search.c (compile_pattern_1): Remove argument regp, unused since
18031         revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18032         (compile_pattern): Don't pass it.
18034 2011-03-08  Jan Djärv  <jan.h.d@swipnet.se>
18036         * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18037         (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18038         for ! HAVE_GTK3.
18039         (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18041         * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18043         * gtkutil.c: Include gtkx.h if HAVE_GTK3.  If ! HAVE_GTK3, define
18044         gdk_window_get_screen, gdk_window_get_geometry,
18045         gdk_x11_window_lookup_for_display and GDK_KEY_g.
18046         (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18047         (xg_get_pixbuf_from_pixmap): New function.
18048         (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18049         to Pixmap, take frame as parameter, remove GdkColormap parameter.
18050         Call xg_get_pixbuf_from_pixmap instead of
18051         gdk_pixbuf_get_from_drawable.
18052         (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18053         xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18054         (xg_check_special_colors): Use GtkStyleContext and its functions
18055         for HAVE_GTK3.
18056         (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18057         (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18058         (xg_update_frame_menubar, xg_tool_bar_detach_callback)
18059         (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18060         Call gtk_widget_get_preferred_size.
18061         (xg_frame_resized): gdk_window_get_geometry only takes 5
18062         parameters.
18063         (xg_win_to_widget, xg_event_is_for_menubar):
18064         Call gdk_x11_window_lookup_for_display.
18065         (xg_set_widget_bg): New function.
18066         (delete_cb): New function.
18067         (xg_create_frame_widgets): Connect delete-event to delete_cb.
18068         Call xg_set_widget_bg.  Only set background pixmap for ! HAVE_GTK3
18069         (xg_set_background_color): Call xg_set_widget_bg.
18070         (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18071         (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18072         Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18073         (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18074         if ! HAVE_GTK3.
18075         (update_frame_tool_bar): Call gtk_widget_hide.
18076         (xg_initialize): Use GDK_KEY_g.
18078         * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18079         if ! HAVE_GTK3
18080         (x_session_initialize): Call gdk_x11_set_sm_client_id.
18082         * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18083         (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18084         Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18086 2011-03-08  Juanma Barranquero  <lekktu@gmail.com>
18088         * w32xfns.c (select_palette): Check success of RealizePalette against
18089         GDI_ERROR, not zero.
18091 See ChangeLog.11 for earlier changes.
18093 ;; Local Variables:
18094 ;; coding: utf-8
18095 ;; End:
18097   Copyright (C) 2011-2012 Free Software Foundation, Inc.
18099   This file is part of GNU Emacs.
18101   GNU Emacs is free software: you can redistribute it and/or modify
18102   it under the terms of the GNU General Public License as published by
18103   the Free Software Foundation, either version 3 of the License, or
18104   (at your option) any later version.
18106   GNU Emacs is distributed in the hope that it will be useful,
18107   but WITHOUT ANY WARRANTY; without even the implied warranty of
18108   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18109   GNU General Public License for more details.
18111   You should have received a copy of the GNU General Public License
18112   along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.