Link with LIB_TIMER_TIME as needed.
[emacs/old-mirror.git] / src / ChangeLog
blobc2dad8f18434dd4fb084168087a1160296dffb87
1 2012-09-27  Paul Eggert  <eggert@cs.ucla.edu>
3         Check more robustly for timer_settime.
4         * Makefile.in (LIB_TIMER_TIME): New macro.
5         (LIBES): Add it.
6         * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
7         Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
8         call timer_settime.
10 2012-09-26  Tomohiro Matsuyama  <tomo@cx4a.org>
12         * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
14 2012-09-26  Juanma Barranquero  <lekktu@gmail.com>
16         * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
18 2012-09-26  Paul Eggert  <eggert@cs.ucla.edu>
20         * character.h (MAYBE_UNIFY_CHAR): Remove.
21         * charset.c, charset.h (maybe_unify_char): Now static.
22         * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
23         Since this stuff is now private to charset.c, there's no need for
24         a public macro and no need to inline by hand.
26 2012-09-26  Tomohiro Matsuyama  <tomo@cx4a.org>
27             Stefan Monnier  <monnier@iro.umontreal.ca>
28             Juanma Barranquero  <lekktu@gmail.com>
30         * profiler.c: New file.
31         * Makefile.in (base_obj): Add profiler.o.
32         * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
33         ($(BLD)/profiler.$(O)): New target.
34         * emacs.c (main): Call syms_of_profiler.
35         * alloc.c (Qautomatic_gc): New constant.
36         (MALLOC_PROBE): New macro.
37         (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
38         (total_bytes_of_live_objects): New function.
39         (Fgarbage_collect): Use it.  Record itself in backtrace_list.
40         Call malloc_probe for the memory profiler.
41         (syms_of_alloc): Define Qautomatic_gc.
42         * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
43         race condition.
44         (struct backtrace): Move definition...
45         * lisp.h (struct backtrace): ..here.
46         (Qautomatic_gc, profiler_memory_running): Declare vars.
47         (malloc_probe, syms_of_profiler): Declare functions.
48         * xdisp.c (Qautomatic_redisplay): New constant.
49         (redisplay_internal): Record itself in backtrace_list.
50         (syms_of_xdisp): Define Qautomatic_redisplay.
52 2012-09-25  Juanma Barranquero  <lekktu@gmail.com>
54         * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
56 2012-09-25  Paul Eggert  <eggert@cs.ucla.edu>
58         Prefer POSIX timers if available.
59         They avoid a race if the timer is too close to the current time.
60         * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
61         (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
62         (init_atimer) [SIGEV_SIGNAL]: Initialize them.
64 2012-09-25  Eli Zaretskii  <eliz@gnu.org>
66         * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
67         CHAR_STRING_ADVANCE.
68         (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
69         STRING_CHAR_ADVANCE.
71 2012-09-25  Juanma Barranquero  <lekktu@gmail.com>
73         Move Vlibrary_cache to emacs.c and reset before dumping.
75         * lisp.h (reset_image_types): Declare.
76         [WINDOWSNT] (Vlibrary_cache): Declare.
78         * image.c (reset_image_types): New function.
80         * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
81         (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
82         (Fdump_emacs): Reset Vlibrary_cache and image_types.
84         * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
85         (globals_of_w32) <Vlibrary_cache>: Do not initialize.
87         * w32.h (Vlibrary_cache): Do not declare.
89 2012-09-25  Eli Zaretskii  <eliz@gnu.org>
91         * w32proc.c (sys_signal): Handle all signals defined by the
92         MS-Windows runtime, not just SIGCHLD.  Actually install the signal
93         handlers for signals supported by Windows.  Don't override
94         term_ntproc as the handler for SIGABRT.
95         (sigaction): Rewrite to call sys_signal instead of duplicating its
96         code.
97         (sys_kill): Improve commentary.
99         * w32.c (term_ntproc): Accept (and ignore) one argument, for
100         consistency with a signature of a signal handler.  All callers
101         changed.
102         (init_ntproc): Accept an argument DUMPING.  If dumping, don't
103         install term_ntproc as a signal handler for SIGABRT, as that
104         should be done by the dumped Emacs.
106         * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
108         * w32select.c (term_w32select): Protect against repeated
109         invocation by setting clipboard_owner to NULL after calling
110         DestroyWindow.
112         * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
113         and term_ntproc to their modified signatures.
115         * character.c (char_string, string_char): Remove calls to
116         MAYBE_UNIFY_CHAR.  See the discussion starting at
117         http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
118         for the details.
120 2012-09-25  Chong Yidong  <cyd@gnu.org>
122         * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
124 2012-09-24  Stefan Monnier  <monnier@iro.umontreal.ca>
126         * bytecode.c (exec_byte_code): Signal an error instead of aborting,
127         when encountering an unknown bytecode.
129 2012-09-24  Paul Eggert  <eggert@cs.ucla.edu>
131         image.c, indent.c: Use bool for booleans.
132         * dispextern.h (struct image_type): Members valid_p, load, init
133         now return bool, not int.  All uses changed.
134         * image.c: Omit unnecessary static decls.
135         (x_create_bitmap_mask, x_build_heuristic_mask):
136         Return void, not int, since callers don't care about the return value.
137         (x_create_bitmap_mask, define_image_type, valid_image_p)
138         (struct image_keyword, parse_image_spec, image_spec_value)
139         (check_image_size, image_background)
140         (image_background_transparent, x_clear_image_1)
141         (postprocess_image, lookup_image, x_check_image_size)
142         (x_create_x_image_and_pixmap, xbm_image_p)
143         (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
144         (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
145         (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
146         (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
147         (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
148         (png_image_p, init_png_functions, png_load_body, png_load)
149         (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
150         (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
151         (init_gif_functions, gif_load, imagemagick_image_p)
152         (imagemagick_load_image, imagemagick_load, svg_image_p)
153         (init_svg_functions, svg_load, svg_load_image, gs_image_p)
154         (gs_load):
155         * nsimage.m (ns_load_image):
156         * nsterm.m (ns_defined_color):
157         * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
158         * xfns.c (x_defined_color):
159         * xterm.c (x_alloc_lighter_color_for_widget)
160         (x_alloc_nearest_color_1, x_alloc_nearest_color)
161         (x_alloc_lighter_color):
162         * indent.c (disptab_matches_widthtab, current_column)
163         (scan_for_column, string_display_width, indented_beyond_p)
164         (compute_motion, vmotion, Fvertical_motion):
165         Use bool for booleans.
167 2012-09-24  Chong Yidong  <cyd@gnu.org>
169         * chartab.c (Fset_char_table_default): Obsolete function removed.
171 2012-09-23  Paul Eggert  <eggert@cs.ucla.edu>
173         Move pid_t related decls out of lisp.h.
174         * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
175         (interruptible_wait_for_termination):
176         Move these decls from lisp.h to syswait.h, since they use pid_t.
177         Needed on FreeBSD; see Herbert J. Skuhra in
178         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
179         * callproc.c: Include syswait.h.
181         gnutls.c, gtkutil.c: Use bool for boolean.
182         * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
183         (emacs_gnutls_handle_error):
184         * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
185         (xg_hide_tooltip, xg_create_frame_widgets)
186         (create_dialog, xg_uses_old_file_dialog)
187         (xg_get_file_with_chooser, xg_get_file_with_selection)
188         (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
189         (xg_item_label_same_p, xg_update_menubar)
190         (xg_modify_menubar_widgets, xg_event_is_for_menubar)
191         (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
192         (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
193         (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
194         (update_frame_tool_bar, free_frame_tool_bar):
195         * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
196         * nsmenu.m (ns_update_menubar):
197         * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
198         * xfns.c (Fx_show_tip) [USE_GTK]:
199         Use bool for boolean.
200         * gtkutil.c (xg_update_frame_menubar):
201         * xmenu.c (update_frame_menubar):
202         Return void, not int, since caller ignores return value.
203         * gtkutil.c (xg_change_toolbar_position):
204         Return void, not 1.
206 2012-09-23  Juanma Barranquero  <lekktu@gmail.com>
208         * makefile.w32-in (BLOCKINPUT_H): Remove.
209         (SYSSIGNAL_H): New macro.
210         ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
211         ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
212         ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
213         ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
214         ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
215         ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
216         ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
217         ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
218         ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
219         ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
220         ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
221         ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
222         ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
223         ($(BLD)/w32xfns.$(O)): Update dependencies.
225 2012-09-23  Eli Zaretskii  <eliz@gnu.org>
227         * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
228         fatal_error_backtrace.
230         * w32proc.c (sys_kill): Undo last change: don't do anything when
231         invoked to deliver SIGABRT to our own process.  This is now
232         handled by emacs_raise.
234 2012-09-23  Juanma Barranquero  <lekktu@gmail.com>
236         * w32term.c (w32_read_socket): Remove leftover reference to
237         interrupt_input_pending.
239 2012-09-23  Paul Eggert  <eggert@cs.ucla.edu>
241         Do not use SA_NODEFER.
242         Problem reported by Dani Moncayo in
243         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
244         * alloc.c (die):
245         * sysdep.c (emacs_abort): Do not reset signal handler.
246         * emacs.c (terminate_due_to_signal): Reset signal handler here.
247         * sysdep.c (init_signals): Do not use SA_NODEFER.  It wasn't
248         wanted even on POSIXish hosts, and it doesn't work on Windows.
250 2012-09-23  Jan Djärv  <jan.h.d@swipnet.se>
252         * xterm.c (x_term_init): Call fixup_locale before and after calling
253         gtk_init (Bug#12392).
255 2012-09-23  Chong Yidong  <cyd@gnu.org>
257         * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
258         Vdynamic_library_alist.
260         * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
261         (Fgnutls_available_p): Caller changed.
263         * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
264         (Flibxml_parse_xml_region): Likewise.
266         * dispextern.h (struct image_type): Remove arg from init function.
268         * image.c (Finit_image_library, lookup_image_type)
269         (define_image_type): Remove now-unneeded second arg.
270         (init_xpm_functions, init_png_functions, init_jpeg_functions)
271         (init_tiff_functions, init_gif_functions, init_svg_functions):
272         Arglist and w32_delayed_load calling convention changed.
273         (gs_type): Remove init_gs_functions; there is no such function.
274         (valid_image_p, make_image): Fix caller to lookup_image_type.
276 2012-09-23  Paul Eggert  <eggert@cs.ucla.edu>
278         Simplify and avoid signal-handling races (Bug#12471).
279         * alloc.c (die):
280         * sysdep.c (emacs_abort) [HAVE_NTGUI]:
281         Avoid recursive loop if there's a fatal error in the function itself.
282         * atimer.c (pending_atimers):
283         * blockinput.h: Don't include "atimer.h"; no longer needed.
284         (interrupt_input_pending): Remove.  All uses removed.
285         pending_signals now counts both atimers and ordinary interrupts.
286         This is less racy than having three separate pending-signal flags.
287         (block_input, unblock_input, totally_unblock_input, unblock_input_to)
288         (input_blocked_p):
289         Rename from their upper-case counterparts BLOCK_INPUT,
290         UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
291         INPUT_BLOCKED_P, and turn into functions.  All uses changed.
292         This makes it easier to access volatile variables more accurately.
293         (BLOCK_INPUT_RESIGNAL): Remove.  All uses replaced by unblock_input ().
294         (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
295         that's more reliable if the code is buggy and sets
296         interrupt_input_blocked to a negative value.  All uses changed.
297         * atimer.c (deliver_alarm_signal):
298         Remove.  No need to deliver this to the parent; any thread can
299         handle this signal now.  All uses replaced by underlying handler.
300         * atimer.c (turn_on_atimers):
301         * dispnew.c (handle_window_change_signal):
302         * emacs.c (handle_danger_signal):
303         * keyboard.c (kbd_buffer_get_event):
304         Don't reestablish signal handler; not needed with sigaction.
305         * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
306         (UNBLOCK_INPUT_TO):
307         Rework to avoid unnecessary accesses to volatile variables.
308         (UNBLOCK_INPUT_TO): Now a function.
309         (totally_unblock_input, unblock_input): New decls.
310         * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
311         (init_data): Remove.  Necessary stuff now done in init_signal.
312         * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
313         * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
314         (fatal_error_code): Remove; no longer needed.
315         (terminate_due_to_signal): Rename from fatal_error_backtrace, since
316         it doesn't always backtrace.  All uses changed.  No need to reset
317         signal to default, since sigaction and/or die does that for us now.
318         Use emacs_raise (FOO), not kill (getpid (), FOO).
319         (main): Check more-accurately whether we're dumping.
320         Move fatal-error setup to sysdep.c
321         * floatfns.c: Do not include "syssignal.h"; no longer needed.
322         * gtkutil.c (xg_get_file_name, xg_get_font):
323         Remove no-longer-needed signal-mask manipulation.
324         * keyboard.c, process.c (POLL_FOR_INPUT):
325         Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
326         * keyboard.c (read_avail_input): Remove.
327         All uses replaced by gobble_input.
328         (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
329         (kbd_buffer_store_event_hold, gobble_input):
330         (record_asynch_buffer_change) [USABLE_SIGIO]:
331         (store_user_signal_events):
332         No need to mess with signal mask.
333         (gobble_input): If blocking input and there are terminals, simply
334         set pending_signals to 1 and return.  All hooks changed to not
335         worry about whether input is blocked.
336         (process_pending_signals): Clear pending_signals before processing
337         them, in case a signal comes in while we're processing.
338         By convention callers now test pending_signals before calling us.
339         (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
340         New functions, to support changes to blockinput.h.
341         (handle_input_available_signal): Now extern.
342         (reinvoke_input_signal): Remove.  All uses replaced by
343         handle_async_input.
344         (quit_count): Now volatile, since a signal handler uses it.
345         (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
346         All callers changed.  Block SIGINT only if not already blocked.
347         Clear sigmask reliably, even if Fsignal returns, which it can.
348         Omit unnecessary accesses to volatile var.
349         (quit_throw_to_read_char): No need to restore sigmask.
350         * keyboard.c (gobble_input, handle_user_signal):
351         * process.c (wait_reading_process_output):
352         Call signal-handling code rather than killing ourselves.
353         * lisp.h: Include <float.h>, for...
354         (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
355         (pending_signals): Now volatile.
356         (syms_of_data): Now const if IEEE floating point.
357         (handle_input_available_signal) [USABLE_SIGIO]:
358         (terminate_due_to_signal, record_child_status_change): New decls.
359         * process.c (create_process): Avoid disaster if memory is exhausted
360         while we're processing a vfork, by tightening the critical section
361         around the vfork.
362         (send_process_frame, process_sent_to, handle_pipe_signal)
363         (deliver_pipe_signal): Remove.  No longer needed, as Emacs now
364         ignores SIGPIPE.
365         (send_process): No need for setjmp/longjmp any more, since the
366         SIGPIPE stuff is now gone.  Instead, report an error if errno
367         is EPIPE.
368         (record_child_status_change): Now extern.  PID and W are now args.
369         Return void, not bool.  All callers changed.
370         * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
371         Remove.  All uses removed.  This bug should be fixed now in a
372         different way.
373         (wait_for_termination_1): Use waitpid rather than sigsuspend,
374         and record the child status change directly.  This avoids the
375         need to futz with the signal mask.
376         (process_fatal_action): Move here from emacs.c.
377         (emacs_sigaction_flags): New function, containing
378         much of what used to be in emacs_sigaction_init.
379         (emacs_sigaction_init): Use it.  Block nonfatal system signals that are
380         caught by emacs, to make races less likely.
381         (deliver_process_signal): Rename from handle_on_main_thread.
382         All uses changed.
383         (BACKTRACE_LIMIT_MAX): Now at top level.
384         (thread_backtrace_buffer, threadback_backtrace_pointers):
385         New static vars.
386         (deliver_thread_signal, deliver_fatal_thread_signal):
387         New functions, for more-accurate delivery of thread-specific signals.
388         (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
389         (deliver_arith_signal): Handle in this thread, not
390         in the main thread, since it's triggered by this thread.
391         (maybe_fatal_sig): New function.
392         (init_signals): New arg DUMPING so that we can be more accurate
393         about whether we're dumping.  Caller changed.
394         Treat thread-specific signals differently from process-general signals.
395         Block all signals while handling fatal error; that's safer.
396         xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
397         on IEEE hosts.
398         When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
399         Ignore SIGPIPE unless batch.
400         (emacs_backtrace): Output backtrace for the appropriate thread,
401         which is not necessarily the main thread.
402         * syssignal.h: Include <stdbool.h>.
403         (emacs_raise): New macro.
404         * xterm.c (x_connection_signal): Remove; no longer needed
405         now that we use sigaction.
406         (x_connection_closed): No need to mess with sigmask now.
407         (x_initialize): No need to reset SIGPIPE handler here, since
408         init_signals does this for us now.
410 2012-09-23  Jan Djärv  <jan.h.d@swipnet.se>
412         * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
413         background rect may be larger (Bug#12245).
415 2012-09-23  Chong Yidong  <cyd@gnu.org>
417         * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
419 2012-09-22  Paul Eggert  <eggert@cs.ucla.edu>
421         * .gdbinit: Just stop at fatal_error_backtrace.
422         See Stefan Monnier's request in
423         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
424         Remove no-longer-used query of system type.
426 2012-09-22  Chong Yidong  <cyd@gnu.org>
428         * search.c (Freplace_match): Doc fix (Bug#12325).
430         * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
432         * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
433         (Fline_end_position): Doc fix.
435         * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
437 2012-09-22  Chong Yidong  <cyd@gnu.org>
439         * dispextern.h (struct image_type): Add new slot, storing a type
440         initialization function.
442         * image.c (define_image_type): Call the image initializer function
443         if it is defined.  Arguments and return value changed.
444         (valid_image_p, make_image): Callers changed.
445         (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
446         (gif_type, imagemagick_type, svg_type, gs_type):
447         Add initialization functions.
448         (Finit_image_library): Call lookup_image_type.
449         (CHECK_LIB_AVAILABLE): Macro deleted.
450         (lookup_image_type): Call define_image_type here, rather than via
451         Finit_image_library, and without using CHECK_LIB_AVAILABLE.
452         (syms_of_image): Move define_image_type calls for xbm_type and
453         pbm_type to lookup_image_type.
455 2012-09-22  Eli Zaretskii  <eliz@gnu.org>
457         * keyboard.c (timer_check_2): Move calculation of 'timers' and
458         'idle_timers' from here ...
459         (timer_check): ... to here.  Use Fcopy_sequence to copy the timer
460         lists, to avoid infloops when the timer does something stupid,
461         like reinvoke itself with the same or smaller time-out.
462         (Bug#12447)
464 2012-09-22  Martin Rudalics  <rudalics@gmx.at>
466         * window.c (Fsplit_window_internal): Handle only Qt value of
467         Vwindow_combination_limit separately.
468         (Qtemp_buffer_resize): New symbol.
469         (Vwindow_combination_limit): New default value.
470         Rewrite doc-string.
472 2012-09-22  Eli Zaretskii  <eliz@gnu.org>
474         * xdisp.c (next_overlay_string): Initialize it->end_charpos for
475         the new overlay string.  (Bug#10159)
477 2012-09-22  Paul Eggert  <eggert@cs.ucla.edu>
479         * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
480         or that fprintf is async-signal-safe.  POSIX doesn't require
481         either assumption.
483 2012-09-22  Chong Yidong  <cyd@gnu.org>
485         * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
486         (Bug#8207).
488 2012-09-22  Kenichi Handa  <handa@gnu.org>
490         * composite.c (composition_reseat_it): Handle the case that a
491         grapheme cluster is not covered by a single font (Bug#12352).
493 2012-09-21  Chong Yidong  <cyd@gnu.org>
495         * image.c (define_image_type): Avoid adding duplicate types to
496         image_types (Bug#12463).  Suggested by Jörg Walter.
498 2012-09-21  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
500         * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
501         (print_load_command_name): Add case LC_DATA_IN_CODE.
502         (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
504 2012-09-21  Glenn Morris  <rgm@gnu.org>
506         * eval.c (Frun_hook_with_args_until_success)
507         (Frun_hook_with_args_until_failure): Doc fixes.  (Bug#12393)
509 2012-09-21  Andreas Schwab  <schwab@linux-m68k.org>
511         * fileio.c (Ffile_selinux_context): Only call freecon when
512         lgetfilecon succeeded.
513         (Fset_file_selinux_context): Likewise.  (Bug#12444)
515 2012-09-21  Eli Zaretskii  <eliz@gnu.org>
517         * xdisp.c (try_window_reusing_current_matrix): Under bidi
518         reordering, locate the cursor by calling set_cursor_from_row; if
519         that fails, clear the desired glyph matrix before returning a
520         failure indication to the caller.  Fixes leaving garbled display
521         when fast scrolling with a down-key.  (Bug#12403)
522         (compute_stop_pos_backwards): Fix a typo that caused crashes while
523         scrolling through multibyte text.
525 2012-09-20  Stefan Monnier  <monnier@iro.umontreal.ca>
527         * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
528         calling mark_vectorlike since that's the one that marks the window.
529         (mark_discard_killed_buffers): Mark the final cdr.
530         * window.h (struct window): Move prev/next_buffers to the
531         non-standard fields.
532         * window.c (make_window): Initialize prev/next_buffers manually.
534 2012-09-20  Paul Eggert  <eggert@cs.ucla.edu>
536         Omit unused arg EXPECTED from socket hooks.
537         * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
538         * nsterm.m (ns_term_init):
539         * termhooks.h (struct terminal.read_socket_hook):
540         * w32inevt.c (w32_console_read_socket):
541         * w32term.c (w32_read_socket):
542         * xterm.c (XTread_socket):
543         Omit unused arg EXPECTED.  All callers changed.
544         (store_user_signal_events): Return void, not int, since callers no
545         longer care about the return value.  All uses changed.
547 2012-09-20  Juanma Barranquero  <lekktu@gmail.com>
549         * w32gui.h (XParseGeometry): Do not declare.
551 2012-09-19  Paul Eggert  <eggert@cs.ucla.edu>
553         * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
554         Ignore 'expected'. See Eli Zaretskii in
555         <http://bugs.gnu.org/12471#8> (last line).
557         * frame.c (read_integer): Remove.  All uses replaced by strtol/strtoul.
558         (XParseGeometry): Now static.  Substitute extremal values for
559         values that are out of range.
561 2012-09-19  Jan Djärv  <jan.h.d@swipnet.se>
563         * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
565         * nsfns.m (XParseGeometry): Remove.
566         (Fx_create_frame): Call x_set_offset to correctly interpret
567         top_pos in geometry.
569         * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
570         (Fx_parse_geometry): If there is a space in string, call
571         Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
573 2012-09-17  Eli Zaretskii  <eliz@gnu.org>
575         * search.c (scan_buffer): Use character positions in calls to
576         region_cache_forward and region_cache_backward, not byte
577         positions.  (Bug#12196)
579         * w32term.c (w32_read_socket): Set pending_signals to 1, like
580         xterm.c does.  Reported by Daniel Colascione <dancol@dancol.org>.
582         * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
583         __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
584         emacs_blocked_malloc, now deleted.
586 2012-09-17  Paul Eggert  <eggert@cs.ucla.edu>
588         Remove no-longer-needed Solaris 2.4 vfork bug workaround.
589         The workaround was for improving performance on Solaris 2.4, but
590         is getting in the way now.  Emacs will still work if someone is
591         still running Solaris 2.4 in a museum somewhere; Sun dropped
592         support for Solaris 2.4 in 2003.
593         * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
594         * process.c (create_process) [HAVE_WORKING_VFORK]:
595         Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
596         since Emacs no longer uses vfork on that platform.
598 2012-09-17  Glenn Morris  <rgm@gnu.org>
600         * emacs.c: Use COPYRIGHT.
602 2012-09-16  Paul Eggert  <eggert@cs.ucla.edu>
604         Remove configure's --without-sync-input option (Bug#12450).
605         When auditing signal-handling in preparation for cleaning it up,
606         I found that SYNC_INPUT has race conditions and would be a real
607         pain to fix.  Since it's an undocumented and deprecated
608         configure-time option, now seems like a good time to remove it.
609         Also see <http://bugs.gnu.org/11080#16>.
610         * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
611         (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
612         (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
613         (malloc_hysteresis):
614         (check_depth) [XMALLOC_OVERRUN_CHECK]:
615         (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
616         (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
617         (dont_register_blocks, bytes_used_when_reconsidered)
618         (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
619         (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
620         [!SYSTEM_MALLOC && !SYNC_INPUT]:
621         Remove. All uses removed.
622         (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
623         implementation, one that depends on whether the new macro
624         XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
625         is defined.
626         * atimer.c (run_timers, handle_alarm_signal):
627         * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
628         (handle_async_input, process_pending_signals)
629         (handle_input_available_signal, init_keyboard):
630         * nsterm.m (ns_read_socket):
631         * process.c (wait_reading_process_output):
632         * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
633         * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
634         (emacs_write):
635         * xterm.c (XTread_socket):
636         Assume SYNC_INPUT.
637         * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
638         * eval.c (handling_signal): Remove.  All uses removed.
639         * lisp.h (ELSE_PENDING_SIGNALS): Remove.
640         All uses replaced with the SYNC_INPUT version.
641         (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
642         Remove decls.
643         * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
644         Now static.
646         * font.c (Ffont_shape_gstring): Remove unused local.
648 2012-09-16  Glenn Morris  <rgm@gnu.org>
650         * Makefile.in (clean): No longer run nextstep's clean.
652         * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
653         (ns_frag): Remove.
654         (ns-app): Move here from ns.mk, and simplify.
655         (clean): Simplify nextstep entry.
656         * ns.mk: Remove file.
658 2012-09-17  Kenichi Handa  <handa@gnu.org>
660         * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
661         not covert the last few charactes.
663 2012-09-16  Kenichi Handa  <handa@gnu.org>
665         * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
666         here, but just check the validity of glyphs in the glyph-string.
668 2012-09-16  Martin Rudalics  <rudalics@gmx.at>
670         * window.c (Fwindow_parameter, Fset_window_parameter):
671         Accept any window as argument (Bug#12452).
673 2012-09-16  Jan Djärv  <jan.h.d@swipnet.se>
675         * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
676         to ns_term_init to avoid memory leak.
678         * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
679         explicit retain/release.
680         (ns_term_init): Only allow one display.  Initialize outerpool and
681         ns_*_types.
683 2012-09-15  Paul Eggert  <eggert@cs.ucla.edu>
685         Port _setjmp fix to POSIXish hosts as well as Microsoft.
686         * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
687         it's needed on POSIXish hosts that lack _setjmp.  Attempt to solve
688         the Microsoft problem in a different way, by altering ../nt/config.nt.
690 2012-09-15  Eli Zaretskii  <eliz@gnu.org>
692         * w32xfns.c:
693         * w32uniscribe.c:
694         * w32term.c:
695         * w32select.c:
696         * w32reg.c:
697         * w32proc.c:
698         * w32menu.c:
699         * w32inevt.c:
700         * w32heap.c:
701         * w32font.c:
702         * w32fns.c:
703         * w32console.c:
704         * w32.c:
705         * w16select.c: Remove inclusion of setjmp.h, as it is now included
706         by lisp.h.  This completes removal of setjmp.h inclusion
707         erroneously announced in the previous commit.  (Bug#12446)
709         * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
710         more accurate.
712         * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
713         not defined as a macro.  The latter happens on MS-Windows.
714         (Bug#12446)
716 2012-09-15  Paul Eggert  <eggert@cs.ucla.edu>
718         Port better to POSIX hosts lacking _setjmp (Bug#12446).
719         * lisp.h: Include <setjmp.h> here, since we use its symbols here.
720         Some instances of '#include <setjmp.h>' removed, if the
721         only reason for the instance was because "lisp.h" was included.
722         (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
723         Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
724         and _longjmp with the new symbols.  Emacs already uses _setjmp if
725         available, so this change affects only POSIXish hosts that have
726         sigsetjmp but not _setjmp, such as some versions of Solaris and
727         Unixware.  (Also, POSIX-2008 marks _setjmp as obsolescent.)
728         * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
729         (png_load_body) [HAVE_PNG]:
730         (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
731         (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
732         Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
733         since PNG requires jmp_buf.  This is the only exception to the
734         general rule that we now use sys_setjmp and sys_longjmp.
735         This exception is OK since this code does not change the signal
736         mask or longjmp out of a signal handler.
738 2012-09-14  Paul Eggert  <eggert@cs.ucla.edu>
740         * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
741         Include "syssignal.h", for 'main_thread'.
743 2012-09-14  Dmitry Antipov  <dmantipov@yandex.ru>
745         Avoid out-of-range marker position (Bug#12426).
746         * insdel.c (replace_range, replace_range_2):
747         Adjust markers before overlays, as suggested by comments.
748         (insert_1_both, insert_from_buffer_1, adjust_after_replace):
749         Remove redundant check before calling offset_intervals.
751 2012-09-14  Martin Rudalics  <rudalics@gmx.at>
753         * xdisp.c (Fformat_mode_line): Unconditionally save/restore
754         current buffer (Bug#12387).
756 2012-09-14  Juanma Barranquero  <lekktu@gmail.com>
758         * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
760 2012-09-13  Paul Eggert  <eggert@cs.ucla.edu>
762         Use a more backwards-compatible timer format (Bug#12430).
763         * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
764         vector element, not from the 4th, since PSECS is now at the end.
765         (Fcurrent_idle_time): Doc fix.
767 2012-09-13  Dmitry Antipov  <dmantipov@yandex.ru>
769         Function to mark objects and remove killed buffers at once.
770         * alloc.c (discard_killed_buffers): Rename to ...
771         (mark_discard_killed buffers) ... new name.  Add marking
772         of remaining objects.  Fix comment.  Adjust users.
773         (mark_object): Do not touch frame buffer lists here.
774         * frame.c (delete_frame): Reset frame buffer lists here.
776 2012-09-13  Paul Eggert  <eggert@cs.ucla.edu>
778         Better workaround for GNOME bug when --enable-gcc-warnings.
779         * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
780         Instead, disable -Wunused-local-typedefs.  See Dmitry Antipov in
781         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
783         Simplify SIGIO usage (Bug#12408).
784         The code that dealt with SIGIO was crufty and confusing, e.g., it
785         played tricks like "#undef SIGIO" but these tricks were not used
786         consistently.  Simplify mostly by not #undeffing standard symbols,
787         e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
788         or not as we please) rather than "defined SIGIO" (standard symbol
789         that we probably shouldn't #undef).
790         * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
791         Modules that need it can include it.
792         [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
793         * dispextern.h (ignore_sigio): New decl.
794         * emacs.c (shut_down_emacs): Invoke unrequest_sigio
795         unconditionally, since it's now a no-op if !USABLE_SIGIO.
796         * emacs.c (shut_down_emacs):
797         * keyboard.c (kbd_buffer_store_event_hold):
798         Use ignore_sigio rather than invoking 'signal' directly.
799         * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
800         for FIONREAD.
801         (FIONREAD, SIGIO): Do not #undef.
802         (tty_read_avail_input): Use #error rather than a syntax error.
803         * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
804         for I_PIPE, used by SETUP_SLAVE_PTY.
805         (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
806         * sysdep.c (croak): Remove; no longer needed.  This bit of
807         temporary code, with Fred N. Fish's comment that it's temporary,
808         has been in Emacs since at least 1992!
809         (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
810         Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
811         * syssignal.h (croak): Remove decl.
812         (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
813         * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
814         now that we're termios-only.
815         (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
816         * term.c (dissociate_if_controlling_tty): Use #error rather than
817         a run-time error.
819         Work around GCC and GNOME bugs when --enable-gcc-warnings.
820         * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
821         to work around GNOME bug 683906.
822         * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
823         (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
824         This works around GCC bug 54561.
826 2012-09-12  Paul Eggert  <eggert@cs.ucla.edu>
828         More fixes for 'volatile' and setjmp/longjmp.
829         * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
830         * image.c (struct png_load_context) [HAVE_PNG]: New type.
831         (png_load_body) [HAVE_PNG]:
832         (jpeg_load_body) [HAVE_JPEG]:
833         New function, with most of the old parent function's body.
834         (png_load) [HAVE_PNG]:
835         (jpeg_load) [HAVE_JPEG]:
836         Invoke the new function, to avoid longjmp munging our locals.
837         (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
838         (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
839         longjmp is passed 2, as the C standard doesn't guarantee this.
840         Instead, store the failure code into mgr->failure_code.
842 2012-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
844         * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
845         (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
846         (syms_of_keyboard): Remove support for unread-command-char.
848 2012-09-12  Eli Zaretskii  <eliz@gnu.org>
850         * w32proc.c (sys_kill): If PID is our process ID and the signal is
851         SIGABRT, call emacs_abort.  Avoids silently exiting upon assertion
852         violation.  (Bug#12426)
854 2012-09-12  Paul Eggert  <eggert@cs.ucla.edu>
856         * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
858 2012-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
860         * eval.c: Add `inhibit-debugger'.
861         (Qinhibit_debugger): New symbol.
862         (call_debugger): Bind it instead of Qdebug_on_error.
863         (maybe_call_debugger): Test Vinhibit_debugger.
864         (syms_of_eval): Define inhibit-debugger.
865         * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
866         (syms_of_xdisp): Remove inhibit-debug-on-message.
868 2012-09-11  Paul Eggert  <eggert@cs.ucla.edu>
870         Avoid _setjmp/_longjmp problems with local nonvolatile variables.
871         If a nonvolatile local variable is written before a _longjmp to
872         the frame containing the variable, and is read after the _longjmp,
873         the value read is indeterminate.  Some local variables of type
874         'struct handler' and 'struct catchtag' are used in this way, so
875         mark each of their slots as volatile if the slot can be set before
876         _longjmp and read afterwards.
877         * lisp.h (struct handler): var and chosen_clause are now volatile.
878         (struct catchtag): val, next, and pdlcount are now volatile.
880         * bidi.c (bidi_push_it, bidi_pop_it):
881         * fns.c (copy_hash_table):
882         * image.c (define_image_type):
883         * keyboard.c (kbd_buffer_store_event_hold):
884         * process.c (Fprocess_send_eof):
885         * xfaces.c (x_create_gc) [HAVE_NS]:
886         * xgselect.c (xg_select):
887         Prefer assignment to memcpy when either will do.
889         * alloc.c (discard_killed_buffers): Tune and simplify a bit.
890         Use pointer-to-a-pointer to simplify and avoid a NILP check each
891         time an item is removed.  No need to mark this function 'inline';
892         the compiler knows better than we do.
894 2012-09-11  Jan Djärv  <jan.h.d@swipnet.se>
896         * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
897         (updateFrameSize:): Add delay parameter to updateFrameSize, send it
898         to change_frame_size (Bug#12388).
899         (windowDidResize:): Pass YES to updateFrameSize.
901         * nsterm.h: Add delay parameter to updateFrameSize.
903 2012-09-11  Dmitry Antipov  <dmantipov@yandex.ru>
905         Discard killed buffers from deleted window and frame objects.
906         This reduces an amount of references to killed buffers and
907         helps GC to reclaim them faster.
908         * alloc.c (discard_killed_buffers): New function.
909         (mark_object): Use it for deleted windows and frames.
910         (mark_object): If symbol's value is set up for a killed buffer
911         or deleted frame, restore it's global binding.
912         * data.c (swap_in_global_binding): Add GC notice.
913         (swap_in_symval_forwarding): Use convenient set_blv_where.
914         * window.c (wset_next_buffers, wset_prev_buffers): Move ...
915         * window.h: ... to here.
917 2012-09-11  Dmitry Antipov  <dmantipov@yandex.ru>
919         Convenient macro to check whether the buffer is live.
920         * buffer.h (BUFFER_LIVE_P): New macro.
921         * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
922         * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
924 2012-09-11  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
926         * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
927         composition cases (Bug#12364).
929         * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
930         overhang of succeeding glyphs overlapping box cursor.
932         * w32term.c (x_draw_glyph_string): Likewise.
934 2012-09-11  Paul Eggert  <eggert@cs.ucla.edu>
936         Simplify, document, and port floating-point (Bug#12381).
937         The porting part of this patch fixes bugs on non-IEEE platforms
938         with frexp, ldexp, logb.
939         * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
940         Now static.
941         * floatfns.c: Simplify discussion of functions that Emacs doesn't
942         support, by removing commented-out code and briefly listing the
943         C89 functions excluded.  The commented-out stuff was confusing
944         maintenance, e.g., we thought we needed cbrt but it was commented out.
945         (logb): Remove decl; no longer needed.
946         (isfinite): New macro, if not already supplied.
947         (isnan): Don't replace any existing macro.
948         (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
949         are present on all C89 platforms.
950         (Ffrexp): Do not special-case zero, as frexp does the right thing
951         for that case.
952         (Flogb): Do not use logb, as it doesn't have the desired meaning
953         on hosts that use non-base-2 floating point.  Instead, stick with
954         frexp, which is C89 anyway.  Do not pass an infinity or a NaN to
955         frexp, to avoid getting an unspecified result.
957         * xdisp.c (Qinhibit_debug_on_message): Now static.
959 2012-09-10  Jan Djärv  <jan.h.d@swipnet.se>
961         * nsterm.m (ns_update_begin): Set clip path to whole view by using
962         NSBezierPath (Bug#12131).
964 2012-09-10  Chong Yidong  <cyd@gnu.org>
966         * fns.c (Fdelq, Fdelete): Doc fix.
968 2012-09-10  Paul Eggert  <eggert@cs.ucla.edu>
970         * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
971         (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
973 2012-09-09  Stefan Monnier  <monnier@iro.umontreal.ca>
975         * lisp.h (make_lisp_ptr): New macro to replace XSET.
976         (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
977         Use it.
979 2012-09-09  Eli Zaretskii  <eliz@gnu.org>
981         * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
982         left fringe if the window has a left margin.  This avoids leaving
983         traces of the cursor because its leftmost pixel is not drawn over.
985         * dispnew.c (update_window_line): When the left margin area of a
986         screen line is updated, set the redraw_fringe_bitmaps_p flag of
987         that screen line.  (Bug#12277)
989 2012-09-09  Paul Eggert  <eggert@cs.ucla.edu>
991         Assume C89 or later for math functions (Bug#12381).
992         This simplifies the code, and makes it a bit smaller and faster,
993         and (most important) makes it easier to clean up signal handling
994         since we can stop worring about floating-point exceptions in
995         library code.  That was a problem before C89, but the problem
996         went away many years ago on all practical Emacs targets.
997         * data.c, image.c, lread.c, print.c:
998         Don't include <math.h>; no longer needed.
999         * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1000         might be autoconfigured, as that never happens.
1001         * data.c (fmod):
1002         * doprnt.c (DBL_MAX_10_EXP):
1003         * print.c (DBL_DIG):
1004         Remove.  C89 or later always defines these.
1005         * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1006         (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1007         (arith_error, domain_error, domain_error2):
1008         Remove all this pre-C89 cruft.  Do not include <errno.h> as that's
1009         no longer needed -- we simply return what C returns.  All uses removed.
1010         (IN_FLOAT, IN_FLOAT2): Remove.  All uses replaced with
1011         the wrapped code.
1012         (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1013         Remove.  All uses expanded, as these macros are no longer used
1014         more than once and are now more trouble than they're worth.
1015         (Ftan): Use tan, not sin / cos.
1016         (Flogb): Assume C89 frexp.
1017         (fmod_float): Assume C89 fmod.
1018         (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1019         (init_floatfns): Remove.  All uses removed.
1021 2012-09-08  Jan Djärv  <jan.h.d@swipnet.se>
1023         * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1024         compositeToPoint for OSX < 10.6 (Bug#12390).
1026 2012-09-08  Paul Eggert  <eggert@cs.ucla.edu>
1028         * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1029         This produces more-accurate results.
1031 2012-09-08  Jan Djärv  <jan.h.d@swipnet.se>
1033         * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1034         changes (Bug#12088).
1036 2012-09-08  Chong Yidong  <cyd@gnu.org>
1038         * syntax.c (Fstring_to_syntax): Doc fix.
1040 2012-09-08  Jan Djärv  <jan.h.d@swipnet.se>
1042         * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1043         in the internal border.
1044         (x_set_window_size): Remove static variables and their usage.
1045         (ns_redraw_scroll_bars): Fix NSTRACE arg.
1046         (ns_after_update_window_line, ns_draw_fringe_bitmap):
1047         Remove fringe/internal border adjustment (Bug#11052).
1048         (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1049         (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1050         (ns_fix_rect_ibw): Remove.
1051         (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1052         (ns_dumpglyphs_box_or_relief): Ditto.
1053         (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1054         adjustment.
1055         (ns_dumpglyphs_image): Ditto.
1056         (ns_dumpglyphs_stretch): Fix coding style.  Remove fringe/internal
1057         border adjustment.
1058         (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1059         their usage.  Add fringe_extended_p and its use as in other terms.
1060         (ns_judge_scroll_bars): Code style fix.  Call updateFrameSize if
1061         scroll bar was removed.
1062         (updateFrameSize): New function.
1063         (windowDidResize): Move code to updateFrameSize and call it.
1065         * nsterm.h (EmacsView): Add updateFrameSize.
1067 2012-09-07  Chong Yidong  <cyd@gnu.org>
1069         * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1071         * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1073 2012-09-07  Paul Eggert  <eggert@cs.ucla.edu>
1075         More signal-handler cleanup (Bug#12327).
1076         * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1077         Problem introduced when merging patches.  Noted by Eli Zaretskii in
1078         <http://bugs.gnu.org/12327#67>.
1079         * floatfns.c: Comment fix.
1080         * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1081         SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1082         and anyway the declaration is harmless even if SIGDANGER is not defined.
1083         * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1084         defined BROKEN_FIONREAD).  systty.h formerly did this, but other
1085         source files not surprisingly expected syssignal.h to define, or
1086         not define, SIGIO, and it's cleaner to do it that way, for consistency.
1087         Include <sys/ioctl.h>, for FIONREAD.
1088         * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1089         This eliminates a problem whereby other files mysteriously had
1090         to include "syssignal.h" before including "systty.h" if they
1091         wanted to use "#ifdef SIGIO".
1093 2012-09-07  Eli Zaretskii  <eliz@gnu.org>
1095         * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1097         * w32.c (sigemptyset): Empty the set.
1098         (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1100         * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1102 2012-09-07  Dmitry Antipov  <dmantipov@yandex.ru>
1104         * alloc.c (mark_buffer): Revert unsafe marking optimization.
1105         (mark_object): Likewise for frame objects.
1107 2012-09-07  Paul Eggert  <eggert@cs.ucla.edu>
1109         * syssignal.h (handle_on_main_thread): Always declare,
1110         even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1111         This ports to platforms without HAVE_PTHREAD.
1113 2012-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1115         Signal-handler cleanup (Bug#12327).
1116         Emacs's signal handlers were written in the old 4.2BSD style with
1117         sigblock and sigmask and so forth, and this led to some
1118         inefficiencies and confusion.  Rewrite these to use
1119         pthread_sigmask etc. without copying signal sets around.  Also,
1120         get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1121         'signal', and instead use functions that do not attempt to take
1122         over the system name space.  This patch causes Emacs's text
1123         segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1124         * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1125         Do not include <signal.h> or "syssignal.h", as these
1126         modules do not use signals.
1127         * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1128         * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1129         Do not include <signal.h>, as "syssignal.h" does that for us now.
1130         * atimer.c (sigmask_atimers): New function.
1131         (block_atimers, unblock_atimers): New functions,
1132         replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1133         All uses replaced.
1134         * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1135         no longer needed here.
1136         * emacs.c (main): Inspect existing signal handler with sigaction,
1137         so that there's no need to block and unblock SIGHUP.
1138         * sysdep.c (struct save_signal): New member 'action', replacing
1139         old member 'handler'.
1140         (save_signal_handlers, restore_signal_handlers):
1141         Use sigaction instead of 'signal' to save and restore.
1142         (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1143         New function.  All users of 'signal' modified to use set_sighandler
1144         if they're writeonly, and to use sys_signal if they're read+write.
1145         (emacs_sigaction_init, forwarded_signal): New functions.
1146         (sys_signal): Remove.  All uses replaced by calls to sigaction
1147         and emacs_sigaction_init, or by direct calls to 'signal'.
1148         (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1149         (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1150         all uses replaced by pthread_sigmask etc. calls.
1151         * syssignal.h: Include <signal.h>.
1152         (emacs_sigaction_init, forwarded_signal): New decls.
1153         (SIGMASKTYPE): Remove.  All uses replaced by its definiens, sigset_t.
1154         (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1155         (sigmask, sys_sigmask): Remove; no longer needed.
1156         (sigpause): Remove.  All uses replaced by its definiens, sigsuspend.
1157         (sigblock, sigunblock, sigfree):
1158         (sigsetmask) [!defined sigsetmask]:
1159         Remove.  All uses replaced by pthread_sigmask.
1160         (signal): Remove.  Its remaining uses (with SIG_DFL and SIG_IGN)
1161         no longer need to be replaced, and its typical old uses
1162         are now done via emacs_sigaction_init and sigaction.
1163         (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1164         (sys_sigdel): Remove; unused.
1165         (NSIG): Remove a FIXME; the code's fine.  Remove an unnecessary ifdef.
1167 2012-09-06  Eli Zaretskii  <eliz@gnu.org>
1169         * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1170         SIGCHLD handling on systems that don't have WNOHANG.  (Bug#12327)
1172 2012-09-06  Dmitry Antipov  <dmantipov@yandex.ru>
1174         Explicitly mark buffer_defaults and buffer_local_symbols.
1175         * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1176         mark_local_symbols here.
1177         (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1178         since special buffers aren't marked here any more.
1179         (allocate_buffer): Chain new buffer with all_buffers here...
1180         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1181         not here.
1182         (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1183         (syms_of_buffer): Remove staticpro of the above.
1184         (init_buffer_once): Set names for buffer_defaults and
1185         buffer_local_symbols.
1187 2012-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1189         Use bool for booleans in font-related modules.
1190         * font.c (font_intern_prop, font_style_to_value)
1191         (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1192         (generate_otf_features, font_check_otf_features, font_check_otf)
1193         (font_match_p, font_list_entities, font_at):
1194         * fontset.c (fontset_id_valid_p, reorder_font_vector
1195         (fontset_find_font, Fset_fontset_font)
1196         (face_suitable_for_char_p) [0]:
1197         * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1198         (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1199         (m17n_flt_initialized, ftfont_shape_by_flt):
1200         * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1201         * nsfont.m (nsfont_draw):
1202         * w32font.c (w32font_draw):
1203         * w32term.c (x_draw_glyphless_glyph_string_foreground):
1204         Use bool for booleans.
1205         * font.h: Adjust to above API changes.
1206         (struct font, struct font_driver, struct font_driver_list):
1207         Use bool for booleans.
1208         (struct font): Remove useless member encoding_type.
1209         All users removed.
1210         * fontset.c, xftfont.c: Omit unnecessary static decls.
1212 2012-09-06  Dmitry Antipov  <dmantipov@yandex.ru>
1214         * alloc.c (mark_object): Revert window marking code
1215         since it's unsafe for the Fset_window_configuration.
1217 2012-09-05  Paul Eggert  <eggert@cs.ucla.edu>
1219         Fix race conditions with signal handlers and errno (Bug#12327).
1220         Be more systematic about preserving errno whenever a signal
1221         handler returns, even if it's not in the main thread.  Do this by
1222         renaming signal handlers to distinguish between signal delivery
1223         and signal handling.  All uses changed.
1224         * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1225         * data.c (deliver_arith_signal): Rename from arith_error.
1226         * dispnew.c (deliver_window_change_signal): Rename from
1227         window_change_signal.
1228         * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1229         (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1230         * keyboard.c (deliver_input_available_signal): Rename from
1231         input_available_signal.
1232         (deliver_user_signal): Rename from handle_user_signal.
1233         (deliver_interrupt_signal): Rename from interrupt_signal.
1234         * process.c (deliver_pipe_signal): Rename from send_process_trap.
1235         (deliver_child_signal): Rename from sigchld_handler.
1236         * atimer.c (handle_alarm_signal):
1237         * data.c (handle_arith_signal):
1238         * dispnew.c (handle_window_change_signal):
1239         * emacs.c (handle_fatal_signal, handle_danger_signal):
1240         * keyboard.c (handle_input_available_signal):
1241         * keyboard.c (handle_user_signal, handle_interrupt_signal):
1242         * process.c (handle_pipe_signal, handle_child_signal):
1243         New functions, with the actual signal-handling code taken from the
1244         original respective signal handlers, sans the sporadic attempts to
1245         preserve errno, since that's now done by handle_on_main_thread.
1246         * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1247         * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1248         * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1249         Move to sysdep.c.
1250         (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1251         Move initialization of main_thread to sysdep.c's init_signals.
1252         * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1253         our usage, and simplifies the mainline code.
1254         (record_child_status_change): New static function, as a helper
1255         for handle_child_signal, and with most of the old child handler's
1256         contents.
1257         (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1258         (handle_child_signal): Use the above.
1259         * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1260         Moved here from emacs.c.
1261         (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1262         code moved here from emacs.c's main function.
1263         * sysdep.c, syssignal.h (handle_on_main_thread): New function,
1264         replacing the old SIGNAL_THREAD_CHECK.  All uses changed.
1265         This lets callers save and restore errno properly.
1267 2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
1269         Remove redundant or unused things here and there.
1270         * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1271         * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1272         * editfns.c (Fcompare_buffer_substrings): Likewise.
1273         * frame.h (struct terminal, struct font_driver_list):
1274         Remove redundant declarations.
1275         * window.h (Qleft, Qright): Likewise.
1277 2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
1279         Do not mark objects from deleted buffers, windows and frames.
1280         * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1281         (mark_object): Likewise for windows and frames.
1283 2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
1285         * alloc.c (valid_lisp_object_p): Treat killed buffers,
1286         buffer_defaults and buffer_local_symbols as valid objects.
1287         Return special value to denote them.
1289 2012-09-05  Paul Eggert  <eggert@cs.ucla.edu>
1291         * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1292         * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1293         (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1294         (file_name_absolute_p, Fsubstitute_in_file_name):
1295         (check_executable, check_writable, Ffile_accessible_directory_p)
1296         (Fset_file_selinux_context, Fdefault_file_modes)
1297         (Finsert_file_contents, choose_write_coding_system)
1298         (Fwrite_region, build_annotations, a_write, e_write)
1299         (Fdo_auto_save):
1300         * filelock.c (boot_time_initialized, get_boot_time)
1301         (get_boot_time_1, lock_file_1, within_one_second):
1302         * floatfns.c (in_float):
1303         * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1304         (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1305         (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1306         * lisp.h (struct Lisp_Hash_Table.cmpfn):
1307         * window.c (compare_window_configurations):
1308         Use bool for booleans.
1309         * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1310         (Fdefault_file_modes): Now mode_t, not int, for modes.
1311         (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1312         (internal_delete_file): Now returns void, not a (boolean) int,
1313         since nobody was looking at the return value.
1314         * lisp.h, window.h: Adjust to above API changes.
1316         * xdisp.c (set_message): Simplify and reindent last change.
1318 2012-09-05  Juanma Barranquero  <lekktu@gmail.com>
1320         * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1322 2012-09-04  Lars Ingebrigtsen  <larsi@gnus.org>
1324         * eval.c (call_debugger): Make the function non-static so that we
1325         can call it from set_message.
1327         * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1328         (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1330 2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
1332         Give more-useful info on a fatal error (Bug#12328).
1333         * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1334         (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1335         of doing the work ourselves.
1336         * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1337         do most of the work.
1338         (fatal_error_backtrace): New function, taken from the guts
1339         of the old fatal_error_signal, but with a new option to output
1340         a backtrace.
1341         (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1342         info about the signal than just its number.
1343         * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1344         * sysdep.c: Include <execinfo.h>
1345         (emacs_backtrace): New function, taken partly from the previous
1346         code of the 'die' function.
1347         (emacs_abort): Call fatal_error_backtrace rather than abort.
1349 2012-09-04  Stefan Monnier  <monnier@iro.umontreal.ca>
1351         * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1352         eager (load-time) macro-expansion.
1353         * lisp.mk (lisp): Add macroexp.
1355 2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
1357         Simplify redefinition of 'abort' (Bug#12316).
1358         Do not try to redefine the 'abort' function.  Instead, redo
1359         the code so that it calls 'emacs_abort' rather than 'abort'.
1360         This removes the need for the NO_ABORT configure-time macro
1361         and makes it easier to change the abort code to do a backtrace.
1362         * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1363         * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1364         Remove; sysdep.c's emacs_abort now takes its place.
1365         * lisp.h (emacs_abort): New decl.  All calls from Emacs code to
1366         'abort' changed to use 'emacs_abort'.
1367         * msdos.c (dos_abort) [defined abort]: Remove; not used.
1368         (abort) [!defined abort]: Rename to ...
1369         (emacs_abort): ... new name.
1370         * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1371         the place of the old 'abort' in emacs.c.
1372         * w32.c, w32fns.c (abort): Do not #undef.
1373         * w32.c (emacs_abort): Rename from w32_abort.
1375 2012-09-04  Eli Zaretskii  <eliz@gnu.org>
1377         * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1378         offsets[j].dv, since the y axis of the screen coordinates points
1379         down, while the y axis of the font definition coordinates points
1380         up.  This fixes display of Arabic diacritics such as KASRA and
1381         KASRATAN.  (Bug#11860)
1383 2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
1385         Be more systematic about _setjmp vs setjmp.
1386         * alloc.c (test_setjmp, mark_stack):
1387         * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1388         (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1389         (png_load, my_error_exit, jpeg_load):
1390         * process.c (send_process_trap, send_process):
1391         Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1392         The underscored versions are up to 30x faster on some hosts.
1393         Formerly, the code used setjmp+longjmp sometimes and
1394         _setjmp+_longjmp at other times, with no particular reason to
1395         prefer setjmp+longjmp.
1397 2012-09-03  Paul Eggert  <eggert@cs.ucla.edu>
1399         Fix minor problem found by static checking.
1400         * buffer.c (Fdelete_all_overlays): Return nil.
1402 2012-09-03  Martin Rudalics  <rudalics@gmx.at>
1404         * buffer.c (Fdelete_all_overlays): New function.
1406 2012-09-03  Chong Yidong  <cyd@gnu.org>
1408         * gtkutil.c: Add extern decl for Qxft.
1410 2012-09-02  Paul Eggert  <eggert@cs.ucla.edu>
1412         * emacs.c, eval.c: Use bool for boolean.
1413         * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1414         (malloc_using_checking) [DOUG_LEA_MALLOC]:
1415         (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1416         (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1417         (main, decode_env_path, Fdaemon_initialized):
1418         * eval.c (call_debugger, Finteractive_p, interactive_p):
1419         (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1420         (maybe_call_debugger, Fbacktrace):
1421         * process.c (read_process_output, exec_sentinel):
1422         Use bool for booleans.
1423         * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1424         All callers changed.
1425         * eval.c (interactive_p): Omit always-true boolean argument
1426         EXCLUDE_SUBRS_P.  All callers changed.
1427         * dispextern.h, lisp.h: Reflect above API changes.
1428         * firstfile.c (dummy): Use the address of 'main', whose signature
1429         won't change, instead of the address of 'initialize', whose
1430         signature just changed from int to bool.
1431         * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1432         * msdos.c (fatal_error_in_progress): ... from here.
1433         * xdisp.c (redisplaying_p): Now a boolean.  Set it to 1 instead
1434         of incrementing it.
1435         (redisplay_internal, unwind_redisplay): Simply clear
1436         REDISPLAYING_P when unwinding, instead of saving its previous,
1437         always-false value and then restoring it.
1439         Clean up some extern decls.
1440         Mostly, this hoists extern decls out of .c files and into .h files.
1441         That way, we're more likely to catch errors if the interfaces change.
1442         * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1443         declare xg_mark_data.
1444         * dispextern.h (x_frame_parm_handlers):
1445         * font.h (Qxft):
1446         * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1447         (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1448         (Qultra_bold, Qoblique, Qitalic):
1449         Move extern decl here from .c file.
1450         * alloc.c (xg_mark_data) [USE_GTK]:
1451         * doc.c (Qclosure):
1452         * eval.c (Qlexical_binding):
1453         * fns.c (time) [!HAVE_UNISTD_H]:
1454         * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1455         (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1456         * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1457         * lread.c (Qinternal_interpreter_environment):
1458         * minibuf.c (Qbuffer):
1459         * process.c (QCfamily, QCfilter):
1460         * widget.c (free_frame_faces):
1461         * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1462         * xfont.c (x_clear_errors):
1463         * xterm.c (x_frame_parm_handlers):
1464         Remove now-redundant extern decls.
1465         * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1466         * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1467         Now static.
1468         * xfaces.c: Remove unnecessary static decls.
1469         * xterm.c (updating_frame): Remove decl of nonexistent object.
1471         * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1472         when building globals.h, as the objects that are not built on
1473         this host are not needed to compile C files on this host.
1475 2012-09-02  Jan Djärv  <jan.h.d@swipnet.se>
1477         * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1479         * frame.h: Add missing prototype for x_wm_set_size_hint.
1481 2012-09-02  Paul Eggert  <eggert@cs.ucla.edu>
1483         * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1484         * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1485         (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1486         (Fsubstitute_command_keys):
1487         * editfns.c (region_limit, find_field, Fconstrain_to_field)
1488         (save_excursion_save, save_excursion_restore)
1489         (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1490         (format_time_string, general_insert_function)
1491         (make_buffer_string, make_buffer_string_both)
1492         (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1493         * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1494         (copy_text, insert_1, insert_1_both, insert_from_string)
1495         (insert_from_string_before_markers, insert_from_string_1)
1496         (insert_from_buffer, insert_from_buffer_1, replace_range)
1497         (replace_range_2, del_range_1, del_range_byte, del_range_both)
1498         (del_range_2, modify_region):
1499         * intervals.c (intervals_equal, balance_possible_root_interval)
1500         (adjust_intervals_for_insertion, merge_properties_sticky)
1501         (graft_intervals_into_buffer, lookup_char_property)
1502         (adjust_for_invis_intang, set_point_both)
1503         (get_property_and_range, compare_string_intervals)
1504         (set_intervals_multibyte_1, set_intervals_multibyte):
1505         * keyboard.c (decode_timer):
1506         Use bool for boolean.
1507         * intervals.h, lisp.h, systime.h: Reflect above API changes.
1508         * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1510 2012-09-02  Chong Yidong  <cyd@gnu.org>
1512         * keymap.c (push_key_description): Print M-TAB as C-M-i
1513         (Bug#11758).
1515 2012-09-02  Juanma Barranquero  <lekktu@gmail.com>
1517         * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1518         (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1519         ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1520         ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1521         ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1522         ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1523         ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1525 2012-09-01  Eli Zaretskii  <eliz@gnu.org>
1527         * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1528         more than one grapheme cluster passed to the shaper: compute the
1529         offset adjustment values separately for each cluster.  (Bug#11860)
1531         * image.c: Restore mistakenly removed inclusion of w32.h.  Without
1532         it, GCC doesn't see prototypes of w32_delayed_load, and complains
1533         about implicit conversions from integer to pointer.
1535 2012-09-01  Daniel Colascione  <dancol@dancol.org>
1537         * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1538         system used too early.
1540 2012-09-01  Paul Eggert  <eggert@cs.ucla.edu>
1542         Better seed support for (random).
1543         * emacs.c (main): Call init_random.
1544         * fns.c (Frandom): Set the seed from a string argument, if given.
1545         Remove long-obsolete Gentzel cruft.
1546         * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1547         (init_random): New function.
1549 2012-09-01  Daniel Colascione  <dancol@dancol.org>
1551         * xterm.h: Add header guards.  Declare x_menubar_window_to_frame.
1552         Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1553         x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1554         x_wm_set_size_hint, x_query_colors, x_real_positions,
1555         x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1556         x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1557         all of which have been moved to common code.
1559         * xfaces.c: Include TERM_HEADER instead of listing all possible
1560         window-system headers.
1562         * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1563         to match header.
1565         * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1566         directly accessing frame internals.
1568         * w32font.h: Include font.h.  Define syms_of_w32font and
1569         globals_of_w32font.
1571         * process.c: Include TERM_HEADER instead of listing all possible
1572         window-system headers.
1574         * nsterm.h: Remove declarations now in frame.h.
1575         Define FRAME_X_SCREEN, FRAME_X_VISUAL.
1577         * menu.c: Include TERM_HEADER instead of listing all possible
1578         window-system headers.
1580         * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1581         window system.
1583         * keyboard.c: Include TERM_HEADER instead of listing all possible
1584         window-system headers.
1586         * image.c: Include TERM_HEADER instead of listing all possible
1587         window-system headers.  Declare Vlibrary_cache when compiling for
1588         Windows.
1590         * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1591         window system declarations.
1593         * frame.h: Move common functions here: set_frame_menubar,
1594         x_set_window_size, x_sync, x_get_focus_frame,
1595         x_set_mouse_position, x_set_mouse_pixel_position,
1596         x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1597         x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1598         x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1599         x_activate_menubar, x_real_positions, x_bitmap_icon,
1600         x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1601         and x_query_colors.
1603         * frame.c: Include TERM_HEADER instead of listing all possible
1604         window-system headers.
1606         * font.c: Include TERM_HEADER instead of listing all possible
1607         window-system headers.
1609         * emacs.c: Include TERM_HEADER.
1611         * dispnew.c: Include TERM_HEADER instead of listing all possible
1612         window-system headers.
1614         * ccl.h: Include character.h.
1616         * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1617         the current window system; include in list of objects to link into
1618         Emacs.
1620 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
1622         Remove mark_ttys function and fix tty_display_info initialization.
1623         * lisp.h (mark_ttys): Remove prototype.
1624         * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1625         to mark_ttys because all possible values of 'top_frame' slot are
1626         the frames which are reachable from Vframe_list.
1627         * term.c (mark_ttys): Remove.
1628         (init_tty): Safely initialize 'top_frame' slot with Qnil.
1630 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
1632         Change struct frame bitfields from unsigned char to unsigned.
1633         * frame.h (struct frame): Change type of 'display_preempted',
1634         'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1635         'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
1636         'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
1637         bitfields from unsigned char to unsigned.
1639 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
1641         Remove unused member of struct x_output and struct w32_output.
1642         * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
1643         * w32term.h (struct w32_output): Likewise.
1645 2012-08-30  Jan Djärv  <jan.h.d@swipnet.se>
1647         * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
1648         does not become zero (Bug#12234).
1650 2012-08-30  Paul Eggert  <eggert@cs.ucla.edu>
1652         * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
1653         for GCC 4.7.1 x86-64.
1655 2012-08-30  Glenn Morris  <rgm@gnu.org>
1657         * lread.c (init_lread): For out-of-tree builds, only add the
1658         source directory's site-lisp dir to the load-path if it exists,
1659         consistent with in-tree builds.  (Bug#12302)
1661 2012-08-28  Jan Djärv  <jan.h.d@swipnet.se>
1663         * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1664         button_values to NULL.  Call setStykeMask so dialogs get a close button.
1665         (windowShouldClose:): Set window_closed.
1666         (dealloc): New member, free button_values.
1667         (process_dialog:): Make member function.  Remove window argument,
1668         replace window with self.  Count buttons and allocate and store values
1669         in button_values.
1670         (addButton:value:row:): value is int with the name tag.  Call setTag
1671         with tag.  Remove return self, declare return value as void.
1672         (addString:row:): Remove return self, declare return value as void.
1673         (addSplit): Remove return self, declare return value as void.
1674         (clicked:): Remove return self, declare return value as void.
1675         Set dialog_return to button_values[seltag].  Code formatting change.
1676         (initFromContents:isQuestion:): Adjust call to process_dialog.
1677         Code formatting change.
1678         (timeout_handler:): Set timer_fired to YES.
1679         (runDialogAt:): Set timer_fired to NO.
1680         Handle click on close button as quit.
1682         * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1683         Add window_closed and button_values.  Add void as return value for
1684         add(Button|String|Split).  addButton takes int instead of Lisp_Object.
1685         Add process_dialog as new member.
1687 2012-08-28  Eli Zaretskii  <eliz@gnu.org>
1689         * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1690         is not one of the heaps we manage.  (Bug#12242)
1692 2012-08-28  Glenn Morris  <rgm@gnu.org>
1694         * eval.c (Fcalled_interactively_p): Doc fix.  (Bug#11747)
1696 2012-08-28  Martin Rudalics  <rudalics@gmx.at>
1698         * window.c (Fset_window_configuration): Remove handling of
1699         auto-buffer-name window parameter.  Install revision of reverted
1700         fix.
1702 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
1704         Do not allow to set major mode for a dead buffer.
1705         * buffer.c (Fset_buffer_major_mode): Signal an error
1706         if the buffer is dead.
1707         (Fother_buffer, other_buffer_safely): Remove redundant
1708         nested declaration.
1710 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
1712         Always use set_buffer_if_live to restore original buffer at unwind.
1713         * buffer.h (record_unwind_current_buffer): New function.
1714         * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1715         * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1716         * undo.c, window.c: Adjust users.
1717         * buffer.c (set_buffer_if_live): Fix comment.
1719 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
1721         Fix usage of set_buffer_internal.
1722         * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1723         * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1724         * coding.c (decode_coding): Omit redundant test.
1725         * fileio.c (decide_coding_unwind): Likewise.
1726         * fns.c (secure_hash): Likewise.
1727         * insdel.c (modify_region): Likewise.
1728         * keyboard.c (command_loop_1): Likewise.
1729         * print.c (PRINTFINISH): Likewise.
1730         * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1732 2012-08-27  Paul Eggert  <eggert@cs.ucla.edu>
1734         * dispnew.c: Use bool for boolean.
1735         (frame_garbaged, display_completed, delayed_size_change)
1736         (fonts_changed_p, add_window_display_history)
1737         (add_frame_display_history, verify_row_hash)
1738         (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1739         (row_equal_p, realloc_glyph_pool)
1740         (allocate_matrices_for_frame_redisplay)
1741         (showing_window_margins_p)
1742         (adjust_frame_glyphs_for_frame_redisplay)
1743         (build_frame_matrix_from_leaf_window, make_current)
1744         (mirrored_line_dance, mirror_line_dance, update_frame)
1745         (update_window_tree, update_single_window)
1746         (check_current_matrix_flags, update_window, update_text_area)
1747         (update_window_line, set_window_update_flags, scrolling_window)
1748         (update_frame_1, scrolling, buffer_posn_from_coords)
1749         (do_pending_window_change, change_frame_size)
1750         (change_frame_size_1, sit_for):
1751         Use bool for boolean.
1752         (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
1753         and remove last int (actually boolean) argument, which was always 0.
1754         All callers changed.
1755         * dispextern.h, frame.h, lisp.h: Reflect above API changes.
1756         * dispextern.h (struct composition_it): Use bool for boolean.
1757         (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
1758         (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
1759         * dired.c (file_name_completion):
1760         Use bool for boolean.  (This was missed in an earlier change.)
1762 2012-08-27  Martin Rudalics  <rudalics@gmx.at>
1764         * window.c (Fset_window_configuration): Revert first part of
1765         last change.
1767 2012-08-27  Jan Djärv  <jan.h.d@swipnet.se>
1769         * nsterm.h (NSPanel): New class variable dialog_return.
1771         * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
1772         Initialize dialog_return.
1773         (windowShouldClose:): Use stop instead of stopModalWithCode.
1774         (clicked:): Ditto, and also set dialog_return (Bug#12258).
1775         (timeout_handler:): Use stop instead of abortModal.  Send a dummy
1776         event.
1777         (runDialogAt:): Make ret Lisp_Object.  Set it from dialog_return when
1778         modal loop returns.
1780 2012-08-27  Paul Eggert  <eggert@cs.ucla.edu>
1782         * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
1783         * composite.c (find_composition, composition_gstring_p)
1784         (composition_reseat_it, find_automatic_composition):
1785         * data.c (let_shadows_buffer_binding_p)
1786         (let_shadows_global_binding_p, set_internal, make_blv)
1787         (Fmake_variable_buffer_local, Fmake_local_variable)
1788         (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
1789         (cons_to_signed, arith_driver):
1790         * dbusbind.c (xd_in_read_queued_messages):
1791         * dired.c (directory_files_internal, file_name_completion):
1792         Use bool for booleans.
1793         * dired.c (file_name_completion):
1794         * process.h (fd_callback):
1795         Omit int (actually boolean) argument.  It wasn't being used.
1796         All uses changed.
1797         * composite.h, lisp.h: Reflect above API changes.
1799         * cmds.c, coding.c: Use bool for booleans.
1800         * cmds.c (move_point, Fself_insert_command):
1801         * coding.h (struct composition status, struct coding_system):
1802         * coding.c (detect_coding_utf_8, encode_coding_utf_8)
1803         (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
1804         (emacs_mule_char, decode_coding_emacs_mule)
1805         (encode_coding_emacs_mule, detect_coding_iso_2022)
1806         (decode_coding_iso_2022, encode_invocation_designation)
1807         (encode_designation_at_bol, encode_coding_iso_2022)
1808         (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
1809         (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
1810         (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
1811         (encode_coding_raw_text, detect_coding_charset)
1812         (decode_coding_charset, encode_coding_charset, detect_eol)
1813         (detect_coding, get_translation_table, produce_chars)
1814         (consume_chars, reused_workbuf_in_use)
1815         (make_conversion_work_buffer, code_conversion_save)
1816         (decode_coding_object, encode_coding_object)
1817         (detect_coding_system, char_encodable_p)
1818         (Funencodable_char_position, code_convert_region)
1819         (code_convert_string, code_convert_string_norecord)
1820         (Fset_coding_system_priority):
1821         * fileio.c (Finsert_file_contents):
1822         Use bool for booleans.
1823         * coding.h, lisp.h: Reflect above API changes.
1824         * coding.c: Remove unnecessary static function decls.
1825         (detect_coding): Use unsigned, not signed, to copy an unsigned field.
1826         (decode_coding, encode_coding, decode_coding_gap): Return 'void',
1827         not a boolean 'int', since callers never look at the return value.
1828         (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
1829         * coding.h (decoding_buffer_size, encoding_buffer_size)
1830         (emacs_mule_string_char): Remove unused extern decls.
1831         (struct iso_2022_spec, struct coding_system):
1832         Use 'unsigned int : 1' for boolean fields, since there's more than one.
1833         (struct emacs_mule_spec): Remove unused field 'full_support'.
1834         All initializations removed.
1835         * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
1837 2012-08-27  Dmitry Antipov  <dmantipov@yandex.ru>
1839         Fix spare memory change (Bug#12286).
1840         * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
1841         (valid_lisp_object_p): Likewise.
1843 2012-08-27  Martin Rudalics  <rudalics@gmx.at>
1845         * window.c (Fset_window_configuration): Record any window's old
1846         buffer if it's replaced (see Bug#8789).  If the new current
1847         buffer doesn't appear in the selected window, go to its old
1848         point (Bug#12208).
1850 2012-08-27  Dmitry Antipov  <dmantipov@yandex.ru>
1852         Special MEM_TYPE_SPARE to denote reserved memory.
1853         * alloc.c (enum mem_type): New memory type.
1854         (refill_memory_reserve): Use new type for spare memory.
1855         This prevents live_cons_p and live_string_p from incorrect
1856         detection of uninitialized objects from spare memory as live.
1858 2012-08-26  Paul Eggert  <eggert@cs.ucla.edu>
1860         Spelling fixes.
1861         * Makefile.in (.PHONY): versioclean -> versionclean.
1863         Remove unused external symbols.
1864         * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
1865         * window.c (Qwindow_valid_p, decode_valid_window):
1866         Now static, not extern.
1867         * data.c (Qinterval): Remove; unused.
1868         (syms_of_data): Do not define 'interval'.
1869         * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
1870         * window.h (decode_valid_window):
1871         Remove decls.
1873         * character.c, charset.c, chartab.c: Use bool for booleans.
1874         * character.c (lisp_string_width, string_count_byte8)
1875         (string_escape_byte8):
1876         * charset.c (charset_map_loaded, load_charset_map, read_hex):
1877         (load_charset_map_from_file, map_charset_chars)
1878         (Fdefine_charset_internal, define_charset_internal)
1879         (Fdeclare_equiv_charset, find_charsets_in_text)
1880         (Ffind_charset_region, char_charset, Fiso_charset):
1881         * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
1882         (sub_char_table_set, sub_char_table_set_range)
1883         (char_table_set_range, optimize_sub_char_table)
1884         (map_sub_char_table):
1885         Use bool for boolean.
1886         * character.c (str_to_unibyte): Omit last boolean argument; it was
1887         always 0.  All callers changed.
1888         * character.h, charset.h: Adjust to match previous changes.
1889         * character.h (char_printable_p): Remove decl of nonexistent function.
1890         * charset.h (struct charset): Members code_linear_p, iso_chars_96,
1891         ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
1892         are all boolean, so make them single-bit bitfields.
1894         * lisp.h (ASET): Remove attempt to detect side effects.
1895         It was meant to be temporary and it often doesn't work,
1896         because when IDX has side effects the behavior of IDX==IDX
1897         is undefined.  See Stefan Monnier in
1898         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
1900 2012-08-26  Barry OReilly  <gundaetiapo@gmail.com>  (tiny change)
1902         * lisp.h (functionp): New function (extracted from Ffunctionp).
1903         (FUNCTIONP): Use it.
1904         * eval.c (Ffunctionp): Use it.
1906 2012-08-25  Paul Eggert  <eggert@cs.ucla.edu>
1908         * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
1909         as that's faster and simpler than static storage.  Don't bother
1910         with the g_main_context_query overhead if g_main_context_pending
1911         says no events are pending.
1912         (gfds, gfds_size): Remove these static vars.
1913         (xgselect_initialize): Remove; no longer needed.
1914         All uses and decls removed.
1916         * emacs.c (fatal_error_signal_hook): Remove.
1917         All uses removed.  This leftover from old code was always 0.
1919         * casefiddle.c, casetab.c, category.c: Use bool for boolean.
1920         * casefiddle.c (casify_object, casify_region):
1921         * casetab.c (set_case_table):
1922         * category.c, category.h (word_boundary_p):
1923         * category.h (CHAR_HAS_CATEGORY):
1924         Use bool for booleans, instead of int.
1926 2012-08-25  Eli Zaretskii  <eliz@gnu.org>
1928         * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
1930 2012-08-25  Paul Eggert  <eggert@cs.ucla.edu>
1932         On assertion failure, print backtrace if available.
1933         * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
1934         (die) [ENABLE_CHECKING]: Print a backtrace if available.
1935         * Makefile.in (LIB_EXECINFO): New macro.
1936         (LIBES): Use it.
1938         * bytecode.c, callint.c, callproc.c: Use bool for boolean.
1939         * bytecode.c (exec_byte_code):
1940         * callint.c (check_mark, Fcall_interactively):
1941         * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
1942         (getenv_internal, sync_process_alive, call_process_exited):
1943         * lisp.h (USE_SAFE_ALLOCA):
1944         Use bool for booleans, instead of int.
1945         * lisp.h, process.h: Adjust prototypes to match above changes.
1946         * callint.c (Fcall_interactively): Don't assume the mark's
1947         offset fits in 'int'.
1949 2012-08-24  Paul Eggert  <eggert@cs.ucla.edu>
1951         * buffer.c, buffer.h: Use bool for boolean.
1952         * buffer.c (reset_buffer_local_variables)
1953         (buffer_lisp_local_variables, Fset_buffer_modified_p)
1954         (Frestore_buffer_modified_p, Fset_buffer_multibyte):
1955         (overlays_at, overlays_in, mouse_face_overlay_overlaps)
1956         (overlay_touches_p, overlay_strings, Foverlay_put)
1957         (report_overlay_modification, call_overlay_mod_hooks):
1958         (mmap_enlarge, mmap_set_vars):
1959         * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
1960         Use bool for booleans, instead of int.
1961         * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
1962         since the 1-or-0 return value is always ignored anyway.
1963         (mmap_initialized_p):
1964         * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
1965         * buffer.h, lisp.h: Adjust prototypes to match above changes.
1967 2012-08-23  Paul Eggert  <eggert@cs.ucla.edu>
1969         * bidi.c: Use bool for boolean.
1970         This is a bit more readable, and makes the text segment of bidi.o
1971         0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
1972         Presumably it's faster too.
1973         (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
1974         Now bool.
1975         (bidi_cache_find_level_change, bidi_cache_iterator_state)
1976         (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
1977         (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
1978         (bidi_explicit_dir_char, bidi_level_of_next_char)
1979         (bidi_find_other_level_edge, bidi_move_to_visually_next):
1980         Use bool for booleans, instead of int.
1981         * dispextern.h (bidi_init_it, bidi_paragraph_init)
1982         (bidi_unshelve_cache): Adjust decls to match code.
1984 2012-08-23  Martin Rudalics  <rudalics@gmx.at>
1986         * keyboard.c (Fposn_at_x_y): Do not allow internal window as
1987         argument.
1989 2012-08-23  Paul Eggert  <eggert@cs.ucla.edu>
1991         * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
1992         * atimer.h: Include <stdbool.h>.
1994 2012-08-22  Dan Nicolaescu  <dann@gnu.org>
1996         * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
1997         compile time tests instead of run time tests on systems that do
1998         not use them.
1999         (FRAME_MAC_P): Remove leftover from deleted code.
2000         * frame.c (syms_of_frame): Remove leftover from deleted code.
2002 2012-08-22  Jan Djärv  <jan.h.d@swipnet.se>
2004         * nsterm.m (insertText:): Don't clear modifiers if code is space.
2006 2012-08-22  Paul Eggert  <eggert@cs.ucla.edu>
2008         * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2009         Otherwise, the compiler complains about (A?B:C) where B is void
2010         and C is Lisp_Object.  This fixes an incompatibility with Sun C 5.12.
2011         (fontset_add): Return void, for FONTSET_ADD.
2013 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
2015         * alloc.c: Use bool for booleans.
2016         (gc_in_progress, abort_on_gc)
2017         (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2018         (dont_register_blocks) [GC_MALLOC_CHECK]:
2019         (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2020         (check_string_bytes, make_specified_string, memory_full)
2021         (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2022         (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2023         (mark_stack, valid_pointer_p, make_pure_string)
2024         (Fgarbage_collect, survives_gc_p, gc_sweep):
2025         Use bool for booleans, instead of int.
2026         (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2027         Remove unused local.
2028         * alloc.c (PURE_POINTER_P):
2029         * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2030         * editfns.c (Fformat):
2031         * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2032         (Fdo_auto_save):
2033         * fns.c (sweep_weak_table):
2034         * lisp.h (suppress_checking, push_message, survives_gc_p)
2035         (make_pure_string, gc_in_progress, abort_on_gc):
2036         * lread.c (readchar, read1):
2037         * print.c (Fprin1_to_string):
2038         * xdisp.c (push_message):
2039         Use bool for booleans affected directly or indirectly by
2040         alloc.c's changes.
2042         Make recently-introduced setters macros.
2043         * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2044         (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2045         (set_fontset_default, set_fontset_fallback): Rename from their
2046         upper-case counterparts, and make them functions rather than macros.
2047         This is more consistent with the other recently-introduced setters.
2048         These don't need to be inline, since they're local.
2050 2012-08-21  Jan Djärv  <jan.h.d@swipnet.se>
2052         * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2053         the loop (Bug#12247).
2055 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
2057         * lisp.h (vcopy): Use memcpy rather than our own loop.
2058         This fixes a performance regression introduced by the recent
2059         addition of vcopy.  This means 'vcopy' will need to be modified
2060         for a copying collector, but that's OK.  Also, tighten the
2061         checking in the assertion.
2063 2012-08-21  Eli Zaretskii  <eliz@gnu.org>
2065         * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2066         components for RTL text (Bug#11860).  Adjust X-OFFSET of each
2067         non-base glyph for the width of the base character, according to
2068         what x_draw_composite_glyph_string_foreground expects.
2069         Generate WADJUST value according to composition_gstring_width's
2070         expectations, to produce correct width of the composed character.
2071         Reverse the sign of the DU offset produced by ScriptPlace.
2073 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
2075         * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2077 2012-08-21  Dmitry Antipov  <dmantipov@yandex.ru>
2079         Avoid direct writes to contents member of struct Lisp_Vector.
2080         * lisp.h (vcopy): New function to copy data into vector.
2081         * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2082         * fns.c (Ffillarray): Use ASET.
2083         * keyboard.c (timer_check_2): Use AREF and ASET.
2084         (append_tool_bar_item, Frecent_keys): Use vcopy.
2085         * lread.c (read_vector): Use ASET.
2086         * msdos.c (Frecent_doskeys): Use vcopy.
2087         * xface.c (Finternal_copy_lisp_face): Use vcopy.
2088         (Finternal_merge_in_global_face): Use ASET and vcopy.
2089         * xfont.c (xfont_list_pattern): Likewise.
2091 2012-08-21  Martin Rudalics  <rudalics@gmx.at>
2093         * window.c (Fwindow_point): For the selected window always return
2094         the position of its buffer's point.
2095         (Fset_window_point): For the selected window always go in its
2096         buffer to the specified position.
2098 2012-08-21  Dmitry Antipov  <dmantipov@yandex.ru>
2100         Setter macros for fontsets.
2101         * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2102         (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2103         (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2104         Adjust users.
2106 2012-08-20  Glenn Morris  <rgm@gnu.org>
2108         * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2109         Don't assume that `ln -f' works.
2111 2012-08-20  Eli Zaretskii  <eliz@gnu.org>
2113         * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2114         and later about non-assignments with no effect.  See discussion at
2115         http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2116         details.
2118 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
2120         Inline setter functions for Lisp_Objects slots of struct specbinding.
2121         * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2122         Adjust users.
2124 2012-08-20  Martin Rudalics  <rudalics@gmx.at>
2126         * window.c (select_window): Always make selected window's buffer
2127         current.
2129 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
2131         Use AREF and ASET for docstrings of category tables.
2132         * category.h (CATEGORY_DOCSTRING): Use AREF.
2133         (SET_CATEGORY_DOCSTRING): Use ASET.
2134         * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2136 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
2138         Inline setter functions for hash table members.
2139         * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2140         (set_hash_hash, set_hash_index): Rename with _slot suffix.
2141         (set_hash_key_and_value, set_hash_index, set_hash_next)
2142         (set_hash_hash): New functions.
2143         * charset.c, fns.c: Adjust users.
2145 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
2147         Inline getter and setter functions for per-buffer values.
2148         * buffer.h (per_buffer_default, set_per_buffer_default)
2149         (per_buffer_value, set_per_buffer_value): New functions.
2150         (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2151         * buffer.c, data.c: Adjust users.
2153 2012-08-20  Juanma Barranquero  <lekktu@gmail.com>
2155         * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2157 2012-08-19  Paul Eggert  <eggert@cs.ucla.edu>
2159         Rely on <config.h> + <unistd.h> to declare 'environ',
2160         as gnulib does this if the system doesn't.
2161         * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
2162         Remove declaration.  MS-Windows declares it on stdlib.h which is
2163         included by conf_post.h.
2164         * emacs.c (environ) [DOUG_LEA_MALLOC]:
2165         * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2166         * vm-limit.c: Include <unistd.h>, for 'environ'.
2168         * unexaix.c, unexcoff.c: Include "mem-limits.h".
2169         (start_of_data): Remove decl; mem-limits.h provides it.
2171         * xdisp.c (handle_invisible_prop): Make it a bit faster
2172         and avoid a gcc -Wmaybe-uninitialized diagnostic.
2174 2012-08-19  Chong Yidong  <cyd@gnu.org>
2176         * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2177         ends (Bug#3874).
2179 2012-08-19  Andreas Schwab  <schwab@linux-m68k.org>
2181         * .gdbinit: Use call instead of set when calling a function in the
2182         inferior.
2184         * data.c (set_internal): Don't use set_blv_found.
2185         (Fkill_local_variable): Likewise.
2187 2012-08-18  Alp Aker  <alp.tekin.aker@gmail.com>
2189         * nsfont.m (ns_ascii_average_width): Ensure the string
2190         ascii_printable is initialized with a null-terminated character
2191         array.  Otherwise, it can contain undesired extra characters.
2193 2012-08-18  Paul Eggert  <eggert@cs.ucla.edu>
2195         port new setting code to Sun C 5.8 2005/10/13
2196         * chartab.c, lisp.h (char_table_set, char_table_set_range):
2197         Return void, not Lisp_Object.  Otherwise, the compiler
2198         complains about (A?B:C) where B is void and C is Lisp_Object
2199         when compiling CHAR_TABLE_SET, due to the recent change to
2200         the API of sub_char_table_set_contents.
2202 2012-08-18  Chong Yidong  <cyd@gnu.org>
2204         * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2205         for the string case (Bug#3874).
2207 2012-08-18  Paul Eggert  <eggert@cs.ucla.edu>
2209         * buffer.h (BSET): Remove (Bug#12215).
2210         Replace all uses with calls to new setter functions.
2211         (bset_bidi_paragraph_direction, bset_case_canon_table)
2212         (bset_case_eqv_table, bset_directory, bset_display_count)
2213         (bset_display_time, bset_downcase_table)
2214         (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2215         (bset_last_selected_window, bset_local_var_alist)
2216         (bset_mark_active, bset_point_before_scroll, bset_read_only)
2217         (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2218         (bset_width_table):
2219         * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2220         (bset_auto_fill_function, bset_auto_save_file_format)
2221         (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2222         (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2223         (bset_cache_long_line_scans, bset_case_fold_search)
2224         (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2225         (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2226         (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2227         (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2228         (bset_header_line_format, bset_indicate_buffer_boundaries)
2229         (bset_indicate_empty_lines, bset_invisibility_spec)
2230         (bset_left_fringe_width, bset_major_mode, bset_mark)
2231         (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2232         (bset_name, bset_overwrite_mode, bset_pt_marker)
2233         (bset_right_fringe_width, bset_save_length)
2234         (bset_scroll_bar_width, bset_scroll_down_aggressively)
2235         (bset_scroll_up_aggressively, bset_selective_display)
2236         (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2237         (bset_word_wrap, bset_zv_marker):
2238         * category.c (bset_category_table):
2239         * syntax.c (bset_syntax_table):
2240         New setter functions.
2242         * process.h (PSET): Remove (Bug#12215).
2243         Replace all uses with calls to new setter functions.
2244         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2245         (PROCESS_INLINE): New macro.
2246         (pset_childp): New setter function.
2247         (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2248         * process.c (PROCESS_INLINE):
2249         Define to EXTERN_INLINE, so that the corresponding functions
2250         are compiled into code.
2251         (pset_buffer, pset_command, pset_decode_coding_system)
2252         (pset_decoding_buf, pset_encode_coding_system)
2253         (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2254         (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2255         (pset_type, pset_write_queue): New setter functions.
2257         * window.h (WSET): Remove (Bug#12215).
2258         Replace all uses with calls to new setter functions.
2259         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2260         (WINDOW_INLINE): New macro.
2261         (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2262         (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2263         (wset_total_lines, wset_vertical_scroll_bar)
2264         (wset_window_end_pos, wset_window_end_valid)
2265         (wset_window_end_vpos): New setter functions.
2266         * window.c (WINDOW_INLINE):
2267         Define to EXTERN_INLINE, so that the corresponding functions
2268         are compiled into code.
2269         (wset_combination_limit, wset_dedicated, wset_display_table)
2270         (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2271         (wset_new_normal, wset_new_total, wset_next_buffers)
2272         (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2273         (wset_prev_buffers, wset_right_fringe_width)
2274         (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2275         (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2276         (wset_window_parameters):
2277         * xdisp.c (wset_base_line_number, wset_base_line_pos)
2278         (wset_column_number_displayed, wset_region_showing):
2279         New setter functions.
2281         * termhooks.h (TSET): Remove (Bug#12215).
2282         Replace all uses with calls to new setter functions.
2283         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2284         (TERMHOOKS_INLINE): New macro.
2285         (tset_charset_list, tset_selection_alist): New setter functions.
2286         * terminal.c (TERMHOOKS_INLINE):
2287         Define to EXTERN_INLINE, so that the corresponding functions
2288         are compiled into code.
2289         (tset_param_alist): New setter function.
2291 2012-08-17  Paul Eggert  <eggert@cs.ucla.edu>
2293         * keyboard.h (KSET): Remove (Bug#12215).
2294         Replace all uses with calls to new setter functions.
2295         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2296         (KEYBOARD_INLINE): New macro.
2297         (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2298         (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2299         (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2300         New setter functions.
2301         * keyboard.c (KEYBOARD_INLINE):
2302         Define to EXTERN_INLINE, so that the corresponding functions
2303         are compiled into code.
2304         (kset_echo_string, kset_kbd_queue)
2305         (kset_keyboard_translate_table, kset_last_prefix_arg)
2306         (kset_last_repeatable_command, kset_local_function_key_map)
2307         (kset_overriding_terminal_local_map, kset_real_last_command)
2308         (kset_system_key_syms): New setter functions.
2310         * frame.h (FSET): Remove (Bug#12215).
2311         Replace all uses with calls to new setter functions.
2312         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2313         (FRAME_INLINE): New macro.
2314         (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2315         (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2316         (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2317         (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2318         (fset_param_alist, fset_root_window, fset_scroll_bars)
2319         (fset_selected_window, fset_title, fset_tool_bar_items)
2320         (fset_tool_bar_position, fset_tool_bar_window): New functions.
2321         * frame.c (FRAME_INLINE):
2322         Define to EXTERN_INLINE, so that the corresponding functions
2323         are compiled into code.
2324         (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2326         A few more naming-convention fixes for getters and setters.
2327         * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2328         and rename from buffer_overlays_set_before.
2329         (set_buffer_overlays_after): Move here from buffer.h, and rename
2330         from buffer_overlays_set_after.
2331         * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2332         All uses changed.
2333         (set_buffer_intervals): Rename from buffer_set_intervals.
2334         * intervals.c (set_interval_object): Move here from intervals.h,
2335         and rename from interval_set_object.
2336         (set_interval_left): Move here from intervals.h, and rename from
2337         interval_set_left.
2338         (set_interval_right): Move here from intervals.h, and rename from
2339         interval_set_right.
2340         (copy_interval_parent): Move here from intervals.h, and rename from
2341         interval_copy_parent.
2342         * intervals.h (set_interval_parent): Rename from interval_set_parent.
2343         (set_interval_plist): Rename from interval_set_plist.
2344         Return void, not Lisp_Object, since no caller uses the result.
2345         * lisp.h (string_intervals): Rename from string_get_intervals.
2346         (set_string_intervals): Rename from string_set_intervals.
2348         * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2349         (set_char_table_contents): Rename from char_table_set_contents.
2350         (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
2351         All uses changed.  See the end of
2352         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2354         * lisp.h (CSET): Remove (Bug#12215).
2355         (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2356         (set_char_table_purpose): New functions,
2357         replacing CSET.  All uses changed.  For example, replace
2358         "CSET (XCHAR_TABLE (char_table), parent, parent);" with
2359         "set_char_table_parent (char_table, parent);".
2360         The old version was confusing because it used the same name
2361         'parent' for two different things.
2363 2012-08-17  Dmitry Antipov  <dmantipov@yandex.ru>
2365         Functions to get and set Lisp_Object fields of buffer-local variables.
2366         * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2367         (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2368         (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2369         * data.c, eval.c, frame.c: Adjust users.
2371 2012-08-17  Chong Yidong  <cyd@gnu.org>
2373         * xfaces.c (merge_face_vectors): If the target font specfies a
2374         font spec, make the font's attributes take precedence over
2375         directly-specified attributes.
2376         (merge_face_ref): Recognize :font.
2378 2012-08-17  Dmitry Antipov  <dmantipov@yandex.ru>
2380         Do not use memcpy for copying intervals.
2381         * intervals.c (reproduce_interval): New function.
2382         (reproduce_tree, reproduce_tree_obj): Use it.
2383         (reproduce_tree_obj): Remove prototype.
2385 2012-08-17  Paul Eggert  <eggert@cs.ucla.edu>
2387         * lisp.h (duration_to_sec_usec): Remove unused decl.
2389 2012-08-17  Alp Aker  <alp.tekin.aker@gmail.com>
2391         * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2392         to an allocated instance of NSString, not to the class itself.
2394 2012-08-17  Juanma Barranquero  <lekktu@gmail.com>
2396         * makefile.w32-in (C_CTYPE_H): New macro.
2397         (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2398         ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2399         ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2401 2012-08-16  Paul Eggert  <eggert@cs.ucla.edu>
2403         Use ASCII tests for character types.
2404         * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2405         * xfns.c, xterm.c:
2406         Don't include <ctype.h>; was not needed.
2407         * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2408         * sysdep.c, xfaces.c:
2409         Include <c-ctype.h> instead of <ctype.h>.
2410         * nsterm.m: Include <c-ctype.h>.
2411         * charset.c (read_hex):
2412         * doc.c (Fsnarf_documentation):
2413         * fileio.c (IS_DRIVE) [WINDOWSNT]:
2414         (DRIVE_LETTER) [DOS_NT]:
2415         (Ffile_name_directory, Fexpand_file_name)
2416         (Fsubstitute_in_file_name):
2417         * font.c (font_parse_xlfd, font_parse_fcname):
2418         * frame.c (x_set_font_backend):
2419         * gtkutil.c (xg_get_font):
2420         * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2421         * nsimage.m (hexchar):
2422         * nsterm.m (ns_xlfd_to_fontname):
2423         * sysdep.c (system_process_attributes):
2424         * xfaces.c (hash_string_case_insensitive):
2425         Use C-locale tests instead of locale-specific tests for character
2426         types, since we want the ASCII interpretation here, not the
2427         interpretation suitable for whatever happens to be the current locale.
2429 2012-08-16  Martin Rudalics  <rudalics@gmx.at>
2431         Consistently check windows for validity/liveness
2432         (Bug#11984, Bug#12025, Bug#12026).
2433         * lisp.h (CHECK_VALID_WINDOW): New macro.
2434         * window.c (decode_window): Rename to decode_live_window.
2435         (decode_valid_window, Fwindow_valid_p): New functions.
2436         (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2437         (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2438         (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2439         (Fwindow_prev_sibling, Fwindow_combination_limit)
2440         (Fset_window_combination_limit, Fwindow_use_time)
2441         (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2442         (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2443         (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2444         (Fwindow_hscroll, Fset_window_hscroll)
2445         (Fwindow_redisplay_end_trigger)
2446         (Fset_window_redisplay_end_trigger, Fwindow_edges)
2447         (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2448         (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2449         (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2450         (Fwindow_end, Fset_window_point, Fset_window_start)
2451         (Fpos_visible_in_window_p, Fwindow_line_height)
2452         (Fwindow_dedicated_p, Fset_window_dedicated_p)
2453         (Fwindow_prev_buffers, Fset_window_prev_buffers)
2454         (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2455         (Fset_window_parameter, Fwindow_display_table)
2456         (Fset_window_display_table, Fdelete_other_windows_internal)
2457         (Fset_window_buffer, Fset_window_new_total)
2458         (Fset_window_new_normal, Fdelete_window_internal)
2459         (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2460         (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2461         (Fwindow_scroll_bars): Check whether argument window is a valid or
2462         live window.  Update doc-strings.
2463         (syms_of_window): New symbol Qwindow_valid_p.
2464         * keyboard.c (Fposn_at_x_y): Check whether argument
2465         frame_or_window denotes a valid window.
2467 2012-08-16  Dmitry Antipov  <dmantipov@yandex.ru>
2469         Fix previous char table change.
2470         * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2471         * chartab.c (optimize_sub_char_table): Likewise.
2473 2012-08-16  Chong Yidong  <cyd@gnu.org>
2475         * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2477         * xfont.c (xfont_open):
2478         * xftfont.c (xftfont_open): Set the font's max_width field.
2480         * nsfont.m (nsfont_open): Similar to the Xft backend, set
2481         min_width to space_width and average_width to the average over
2482         printable ASCII characters.
2483         (ns_char_width): Code cleanup.
2484         (ns_ascii_average_width): New utility function.
2486         * font.h (struct font): Update comments.
2488 2012-08-16  Dmitry Antipov  <dmantipov@yandex.ru>
2490         Simple interface to set Lisp_Object fields of character tables.
2491         * lisp.h (CSET): New macro.
2492         (char_table_set_extras, char_table_set_contents)
2493         (sub_char_table_set_contents): New function.
2494         * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2495         * syntax.c: Adjust users.
2497 2012-08-16  Stefan Monnier  <monnier@iro.umontreal.ca>
2499         * eval.c (eval_sub): Bind lexical-binding.
2500         * lread.c (Qlexical_binding): Make non-static.
2502 2012-08-15  Jan Djärv  <jan.h.d@swipnet.se>
2504         * nsmenu.m (popupSession): Remove.
2505         (pop_down_menu): Remove endModalSession.
2506         (timeout_handler:): New method.
2507         (runDialogAt:): Get next timeout.  Start a NSTimer with that timeout.
2508         Call runModalForWindow.  Check timer_fired when it returns.
2509         If not set, cancel timer and break out of loop.
2510         Otherwise loop again, with a new timeout.
2512         * nsterm.m: Include fcntl.h if present.
2513         (fd_entry, t_readfds, inNsSelect): Remove.
2514         (select_writefds, select_valid, select_timeout, selfds)
2515         (select_mutex, apploopnr): Add.
2516         (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2517         Otherwise call kbd_buffer_store_event.
2518         (ns_send_appdefined): Remove release of fd_entry.
2519         (ns_read_socket): Always send appdefined.  Remove inNsSelect check.
2520         Increment and decrement apploopnr.
2521         (ns_select): If no file descriptors, just do a NSTimer.
2522         Otherwise copy read/write masks and start select thread (fd_handler).
2523         Start main loop and wait for application defined event.
2524         Inform select thread to stop selecting after main loop is exited.
2525         (ns_term_init): Create selfds pipe and set non-blocking.
2526         Initialize select_mutex.  Start the select thread (fd_handler).
2527         (fd_handler:): Loop forever, wait for info from the main thread
2528         to either start or stop selecting.  When select returns, send
2529         and appdefined event.
2530         (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2531         If not call kbd_buffer_store_event.
2533         * nsterm.h (EmacsApp): fd_handler takes id argument.
2534         (EmacsDialogPanel): Add timer_fired and timeout_handler.
2536         * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2538 2012-08-15  Eli Zaretskii  <eliz@gnu.org>
2540         * region-cache.c (move_cache_gap): Update gap_len using the actual
2541         growth of the boundaries array.  Do not change cache_len.
2542         (Bug#12196)
2544 2012-08-15  Dmitry Antipov  <dmantipov@yandex.ru>
2546         Generalize and cleanup font subsystem checks.
2547         * font.h (FONT_DEBUG, font_assert): Remove.
2548         * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2549         Change font_assert to eassert.  Use eassert where appropriate.
2551 2012-08-15  Dmitry Antipov  <dmantipov@yandex.ru>
2553         * gtkutil.c (xg_get_font): Use pango_units_to_double.
2555 2012-08-15  Chong Yidong  <cyd@gnu.org>
2557         * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2558         When using the new font chooser, use gtk_font_chooser_get_font_desc to
2559         extract the font descriptor instead of just the font name.
2560         In that case, return a font spec instead of a string.
2561         (x_last_font_name): Move to this file from xfns.c.
2563         * xfns.c (Fx_select_font): The return value can also be a font
2564         spec.  Move x_last_font_name management to gtkutil.c.
2566         * xfaces.c: Make font weight and style symbols non-static.
2568 2012-08-15  Stefan Monnier  <monnier@iro.umontreal.ca>
2570         * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2571         (bug#12117).
2573 2012-08-14  Stefan Monnier  <monnier@iro.umontreal.ca>
2575         * alloc.c (Fgarbage_collect): Use plural form consistently.
2577 2012-08-14  Eli Zaretskii  <eliz@gnu.org>
2579         * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2580         iteration through the command loop.  Fixes a problem whereby mouse
2581         movements are ignored until the first mouse click.
2583 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
2585         Use bool, not int, for Lisp booleans.
2586         This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2587         makes Emacs a bit smaller and presumably a bit faster.
2588         * lisp.h: Include <stdbool.h>.
2589         (struct Lisp_Boolfwd, defvar_bool):
2590         * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2591         * regex.c [!emacs]: Include <stdbool.h>.
2592         (false, true): Remove; <stdbool.h> does this for us now.
2594 2012-08-14  Chong Yidong  <cyd@gnu.org>
2596         * character.c (Fcharacterp): Doc fix (Bug#12076).
2598         * data.c (Findirect_variable): Doc fix (Bug#11040).
2600         * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2602         * editfns.c (Fformat): Doc fix (Bug#12059).
2603         (Fsave_current_buffer): Doc fix (Bug#11542).
2605 2012-08-14  Barry OReilly  <gundaetiapo@gmail.com>  (tiny change)
2607         * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2608         (bug#12022).
2610 2012-08-14  Martin Rudalics  <rudalics@gmx.at>
2612         * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2613         (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2614         * minibuf.c (choose_minibuf_frame, read_minibuf):
2615         * w32fns.c (x_create_tip_frame):
2616         * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2617         Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2619 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
2621         * intervals.c (offset_intervals): Remove obsolete comment.
2623 2012-08-14  Andreas Schwab  <schwab@linux-m68k.org>
2625         * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2627 2012-08-14  Gergely Risko  <gergely@risko.hu>
2629         * coding.c (decode_coding): Record buffer modification before
2630         disabling undo_list (Bug#11773).
2632 2012-08-14  Dmitry Antipov  <dmantipov@yandex.ru>
2634         Revert and cleanup some recent overlay changes.
2635         * buffer.h (enum overlay_type): Remove.
2636         (buffer_get_overlays, buffer_set_overlays): Likewise.
2637         (buffer_set_overlays_before, buffer_set_overlays_after):
2638         New function.  Adjust users.
2639         (unchain_both): Add eassert.
2641 2012-08-14  Dmitry Antipov  <dmantipov@yandex.ru>
2643         * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
2645 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
2647         * gtkutil.c (xg_mark_data): Don't assume C99.
2649 2012-08-13  Jan Djärv  <jan.h.d@swipnet.se>
2651         * gtkutil.c (xg_frame_tb_info): New struct.
2652         (TB_INFO_KEY): New define.
2653         (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
2654         (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
2655         (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
2656         if not present.
2657         (update_frame_tool_bar): Return early if data in xg_frame_tb_info
2658         is up to date.  Otherwise store new data.
2659         (free_frame_tool_bar): Free xg_frame_tb_info if present.
2661 2012-08-13  Dmitry Antipov  <dmantipov@yandex.ru>
2663         Use KSET for write access to Lisp_Object members of struct kboard.
2664         * keyboard.h (KSET): New macro.
2665         * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
2666         * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2667         * xterm.c: Adjust users.
2669 2012-08-13  Dmitry Antipov  <dmantipov@yandex.ru>
2671         Use BSET for write access to Lisp_Object members of struct buffer.
2672         * buffer.h (BSET): New macro.
2673         * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2674         * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2675         * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2676         * window.c, xdisp.c, xfns.c: Adjust users.
2678 2012-08-11  BT Templeton  <bpt@hcoop.net>  (tiny change)
2680         * lread.c (syms_of_lread): Initialize Vlexical_binding.
2682 2012-08-11  Jan Djärv  <jan.h.d@swipnet.se>
2684         * nsterm.m (not_in_argv): New function.
2685         (application:openFile, application:openTempFile:):
2686         (application:openFileWithoutUI:, application:openFiles:): Open file
2687         if not_in_argv returns non-zero (bug#12171).
2689         * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
2690         (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2691         Define for Gtk+ versions less than 3.2.
2692         (xg_get_font_name): Use those functions/macros here.
2693         Reported by Frans Oilinki <moilinki@gmail.com>.
2695 2012-08-11  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
2697         * unexmacosx.c (copy_data_segment): Copy initialized data in
2698         statically linked libraries from input file rather than memory.
2700         * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2701         LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2702         (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2704 2012-08-10  Glenn Morris  <rgm@gnu.org>
2706         * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2707         * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2709 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
2711         Fix last change to allow compilation with low optimization levels.
2712         * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2713         Reported by Jan Djärv <jan.h.d@swipnet.se>.
2715 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
2717         Use common inline syntax in intervals.h.
2718         * intervals.h (INTERVALS_INLINE): New macro.
2719         Change all users from LISP_INLINE.
2721 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
2723         Define Qnone once for all platforms.
2724         * frame.c (Qnone): Define here.
2725         (syms_of_frame): DEFSYM it.
2726         * lisp.h (Qnone): New declaration.
2727         * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2728         * xfns.c: Remove duplication.  Adjust users.
2730 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
2732         Remove unused macros from intervals.h.
2733         * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2734         * intervals.c: Adjust comment.
2736 2012-08-10  Eli Zaretskii  <eliz@gnu.org>
2738         * w32fns.c <w32_unicode_gui>: New static variable.
2739         (globals_of_w32fns): Initialize it according to os_subtype.
2740         (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2741         testing os_subtype.
2743 2012-08-10  Joakim Hårsman  <joakim.harsman@gmail.com>  (tiny change)
2744             Eli Zaretskii  <eliz@gnu.org>
2746         Fix bug #10299 with Unicode characters sent by customized
2747         keyboards created by MSKLC.
2748         * w32fns.c (INIT_WINDOW_CLASS): New macro.
2749         (w32_init_class): Use it to initialize the Emacs class with either
2750         ANSI or Unicode API calls.
2751         (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
2752         later.
2753         (w32_wnd_proc): If the character code sent by WM_CHAR or
2754         WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
2755         original message.  Call DefWindowProcW on NT and later.
2757 2012-08-10  Glenn Morris  <rgm@gnu.org>
2759         * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
2761         * lisp.h (DIRECTORY_SEP): Let configure set it.
2763 2012-08-09  Dmitry Antipov  <dmantipov@yandex.ru>
2765         Use TSET for write access to Lisp_Object slots of struct terminal.
2766         * termhooks.h (TSET): New macro.
2767         * coding.c, terminal.c, xselect.c: Adjust users.
2769 2012-08-08  Stefan Monnier  <monnier@iro.umontreal.ca>
2771         * xdisp.c (safe_eval_handler): Remove prototype.  Receive args describing
2772         the failing expression, include them in the error message.
2773         * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
2774         * lisp.h (internal_condition_case_n): Update declaration.
2776 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
2778         Inline functions to examine and change buffer overlays.
2779         * buffer.c (unchain_both): New function.
2780         * buffer.h (buffer_get_overlays, buffer_set_overlays):
2781         (buffer_has_overlays): New function.
2782         (enum overlay_type): New enum.
2783         * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
2784         * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
2786 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
2788         Inline functions to examine and change buffer intervals.
2789         * alloc.c (mark_interval_tree): Remove.
2790         (MARK_INTERVAL_TREE): Simplify.
2791         (UNMARK_BALANCE_INTERVALS): Remove.  Adjust users.
2792         * intervals.c (buffer_balance_intervals): New function.
2793         (graft_intervals_into_buffer): Adjust indentation.
2794         (set_intervals_multibyte): Simplify.
2795         * buffer.h (BUF_INTERVALS): Remove.
2796         (buffer_get_intervals, buffer_set_intervals): New function.
2797         * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
2798         * intervals.c, textprop.c: Adjust users.
2800 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
2802         Inline functions to examine and change string intervals.
2803         * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
2804         (string_get_intervals, string_set_intervals): New function.
2805         * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2806         * lread.c, print.c, textprop.c: Adjust users.
2808 2012-08-08  Glenn Morris  <rgm@gnu.org>
2810         * lisp.mk (lisp): Remove language/persian.elc.
2812 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
2814         Cleanup intervals.
2815         * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
2816         (NULL_INTERVAL_P): Likewise.  Adjust users.
2817         (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
2818         Adjust comment.  Move under #if 0.
2819         * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2820         * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2822 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
2824         Check total length of intervals with eassert.
2825         * intervals.h (CHECK_TOTAL_LENGTH): Remove.
2826         * intervals.c: Change all users to eassert.
2828 2012-08-07  Eli Zaretskii  <eliz@gnu.org>
2830         * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
2831         Rename fields to match removal of FGET and WGET and disuse of
2832         INTERNAL_FIELD in Lisp_Cons.
2834 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
2836         Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
2837         * lisp.h (struct Lisp_Symbol): Change xname to meaningful
2838         name since all xname users are fixed long time ago.  Do not
2839         use INTERNAL_FIELD.
2840         (set_symbol_name, set_symbol_function, set_symbol_plist):
2841         (set_symbol_next, set_overlay_plist): New function.
2842         (struct Lisp_Cons): Do not use INTERNAL_FIELD.
2843         (struct Lisp_Overlay): Likewise.
2844         (CVAR, MVAR, SVAR): Remove.
2845         * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
2846         * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
2847         * xterm.c: Adjust users.
2848         * .gdbinit: Change to use name field of struct Lisp_Symbol
2849         where appropriate.
2851 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
2853         Basic functions to set Lisp_Object and pointer slots of intervals.
2854         * intervals.h (interval_set_parent, interval_set_object):
2855         (interval_set_left, interval_set_right, interval_set_plist):
2856         (interval_copy_parent): New function.
2857         (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
2858         (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
2859         Adjust indentation.
2860         (INTERVAL_SIZE): Remove.  Adjust users.
2861         * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
2863 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
2865         Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
2866         * process.h (PGET): Remove.
2867         (struct Lisp_Process): Do not use INTERNAL_FIELD.
2868         * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2870 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
2872         Drop WGET and revert read access to Lisp_Objects slots of struct window.
2873         * window.h (WGET): Remove.
2874         (struct window): Do not use INTERNAL_FIELD.
2875         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2876         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2877         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2878         * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2879         * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2880         Adjust users.
2882 2012-08-07  Chong Yidong  <cyd@gnu.org>
2884         * window.c (Fwindow_edges, Fwindow_pixel_edges)
2885         (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
2886         (Fdelete_window_internal): Signal an error if the window is not on
2887         a live frame (Bug#12025).
2889 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
2891         Drop FGET and revert read access to Lisp_Objects slots of struct frame.
2892         * frame.h (FGET): Remove.
2893         (struct frame): Do not use INTERNAL_FIELD.
2894         * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2895         * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2896         * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2897         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2899 2012-08-06  Juanma Barranquero  <lekktu@gmail.com>
2901         * w32.c: Silence compiler warnings.
2902         (map_w32_filename): Remove unused variable `is_fat'.
2903         (chase_symlinks): Add parentheses around expression.
2905 2012-08-06  Glenn Morris  <rgm@gnu.org>
2907         * sysdep.c: Respect BROKEN_GETWD.
2909         * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
2910         Let configure handle it.
2911         (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
2913 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
2915         Use GCALIGNMENT where appropriate.
2916         * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
2917         (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
2918         (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
2920 2012-08-06  Eli Zaretskii  <eliz@gnu.org>
2922         * w32menu.c (set_frame_menubar, initialize_frame_menubar):
2923         Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
2925 2012-08-06  Stefan Monnier  <monnier@iro.umontreal.ca>
2927         * buffer.h (struct buffer): Revert `indirections' to a simple int;
2928         that should be sufficient for everyone.
2930 2012-08-06  Jan Djärv  <jan.h.d@swipnet.se>
2932         * keyboard.c (timer_check_2): Add break so timer_check returns next
2933         timeout.
2935 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
2937         Fix Windows build errors introduced after converting to WGET and WSET.
2938         * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
2939         Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2941 2012-08-06  Jan Djärv  <jan.h.d@swipnet.se>
2943         * nsterm.m (ns_frame_rehighlight): Use FSET.
2945         * nsmenu.m (ns_update_menubar): Use FSET.
2947 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
2949         Separate read and write access to Lisp_Object slots of Lisp_Process.
2950         * process.h (PGET, PSET): New macros similar to AREF and ASET.
2951         * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2953 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
2955         Separate read and write access to Lisp_Object slots of struct window.
2956         * window.h (WGET, WSET): New macros similar to AREF and ASET.
2957         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2958         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2959         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2960         * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2961         * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2962         Adjust users.
2964 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
2966         Fix Windows build errors introduced after converting to FGET and FSET.
2967         * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
2968         (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
2969         (w32_judge_scroll_bars): Change to use FSET.
2970         Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2972 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
2974         Fix replacement typo.
2975         * window.c (replace_window): Set root_window instead of
2976         selected_window.  This fixes a total window subsystem
2977         malfunction reported by Bastien Guerry <bzg@gnu.org>.
2979 2012-08-06  Glenn Morris  <rgm@gnu.org>
2981         * lisp.mk (lisp): Add language/persian.elc.
2983 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
2985         Separate read and write access to Lisp_Object slots of struct frame.
2986         * frame.h (FGET, FSET): New macros similar to AREF and ASET.
2987         * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2988         * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2989         * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2990         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2992 2012-08-05  Andreas Schwab  <schwab@linux-m68k.org>
2994         * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
2996 2012-08-05  Dmitry Antipov  <dmantipov@yandex.ru>
2998         Generalize common compile-time constants.
2999         * lisp.h (header_size, bool_header_size, word_size): Now here.
3000         (struct Lisp_Vector): Add comment.
3001         (struct Lisp_Bool_Vector): Move up to define handy constants.
3002         (VECSIZE, PSEUDOVECSIZE): Simplify.
3003         (SAFE_ALLOCA_LISP): Use new constant.  Adjust indentation.
3004         * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3005         * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3006         * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3007         * xfont.c, xmenu.c: Use word_size where appropriate.
3009 2012-08-05  Lawrence Mitchell  <wence@gmx.li>
3011         * search.c (Freplace_match): Treat \? in the replacement text
3012         literally (Bug#8161).
3014 2012-08-05  Chong Yidong  <cyd@gnu.org>
3016         * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3017         * frame.c (Vdelete_frame_functions):
3018         * emacs.c (Vkill_emacs_hook): Doc fix.
3020 2012-08-04  Eli Zaretskii  <eliz@gnu.org>
3022         * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3023         --with-x-toolkit=no builds.
3024         Reported by Carsten Mattner <carstenmattner@gmail.com>.
3026 2012-08-04  Chong Yidong  <cyd@gnu.org>
3028         * syntax.c (Fmodify_syntax_entry): Doc fix.
3030 2012-08-04  Eli Zaretskii  <eliz@gnu.org>
3032         Fix startup warnings about ../site-lisp on MS-Windows.  (Bug#11959)
3033         * w32.c (init_environment): Change the default values of many
3034         environment variables in dflt_envvars[] to NULL, to avoid pushing
3035         them into environment when they were not already defined.
3036         Remove the code that deletes site-lisp subdirectories from the default
3037         value of EMACSLOADPATH, as it is no longer needed.
3038         (check_windows_init_file): Now external, not static.
3039         Use Vload_path as is, without adding anything, as this function is now
3040         called when Vload_path is already set up.
3042         * w32.h (check_windows_init_file): Add prototype.
3044         * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3045         directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3046         compatibility with Posix platforms.
3047         (main): Move the call to check_windows_init_file to here from
3048         w32.c.
3049         (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3050         any, in the DEFALT argument into the root of the Emacs build or
3051         installation tree, as appropriate.
3053         * callproc.c (init_callproc_1): Call decode_env_path instead of
3054         doing its equivalent by hand.
3055         (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3056         the code that sets Vexec_path run on MS-Windows.
3058         * lread.c (init_lread): Add comments to #ifdef's.
3060         * msdos.c (dos_set_window_size, IT_update_begin)
3061         (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3062         instead of direct references.
3064 2012-08-04  Paul Eggert  <eggert@cs.ucla.edu>
3066         Export DEFAULT_REHASH_* to GDB.
3067         * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3068         Now constants, not macros.
3070 2012-08-03  Paul Eggert  <eggert@cs.ucla.edu>
3072         Remove unnecessary casts involving pointers.
3073         These casts are no longer needed now that we assume C89 or later,
3074         since they involve casting to or from void *.
3075         * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3076         (make_pure_float, make_pure_vector):
3077         * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3078         * macros.c (Fstart_kbd_macro):
3079         * menu.c (find_and_return_menu_selection):
3080         * minibuf.c (read_minibuf_noninteractive):
3081         * sysdep.c (closedir):
3082         * xdisp.c (x_produce_glyphs):
3083         * xfaces.c (compare_fonts_by_sort_order):
3084         * xfns.c (x_real_positions, select_visual):
3085         * xselect.c (x_stop_queuing_selection_requests)
3086         (x_get_window_property, x_get_window_property_as_lisp_data):
3087         * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3088         Remove unnecessary pointer casts.
3089         * alloc.c (record_xmalloc): New function.
3090         * lisp.h (record_xmalloc): New decl.
3091         (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3092         more like a function.  This is because the pointer cast is not
3093         needed.  All uses changed.
3094         * print.c (print_string, print_error_message): Avoid length recalc.
3096         Improve fix for macroexp crash with debugging (Bug#12118).
3097         * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3098         ARRAY_MARK_FLAG when checking subscripts, because ASET is
3099         not supposed to be invoked from the garbage collector.
3100         See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3101         (gc_aset): New function, which is like ASET but can be
3102         used in the garbage collector.
3103         (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3104         (set_hash_index): Use it instead of ASET.
3106 2012-08-03  Eli Zaretskii  <eliz@gnu.org>
3108         Support symlinks on latest versions of MS-Windows.
3109         * w32.c: Include winioctl.h and aclapi.h.
3110         (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3111         (revert_to_self): Forward declarations of static functions.
3112         <static BOOL g_b_init_get_security_info>:
3113         <g_b_init_create_symbolic_link>: New static flags.
3114         (globals_of_w32): Initialize them to zero.
3115         (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3116         (map_w32_filename): Improve commentary.  Simplify switch.
3117         (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3118         headers (most versions of MinGW w32api don't).
3119         (get_security_info, create_symbolic_link)
3120         (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3121         New functions.
3122         (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3123         in the argument file name.
3124         (sys_access): Call unc_volume_file_attributes only if
3125         GetFileAttributes fails with network-related error codes.
3126         (sys_rename): Diagnose renaming of a symlink when the user doesn't
3127         have the required privileges.
3128         (get_file_security_desc_by_name): Rename from
3129         get_file_security_desc.
3130         (stat_worker): New function, with most of the guts of 'stat', and
3131         with addition of handling of symlinks and support for 'lstat'.
3132         If possible, get file's attributes and security information by
3133         handle, not by name.  Produce S_IFLNK bit for symlinks, when
3134         called from 'lstat'.
3135         (stat, lstat): New functions, call 'stat_worker'.
3136         (symlink, readlink, careadlinkat): Rewritten to create and resolve
3137         symlinks when the underlying filesystem supports them.
3139 2012-08-02  Paul Eggert  <eggert@cs.ucla.edu>
3141         Fix macroexp crash on Windows with debugging (Bug#12118).
3142         * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3143         checking subscripts; problem introduced with the recent
3144         "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3145         (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3146         since it's used in non-static inline functions now.
3148         * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3149         Don't assume buffer size fits in 'int'.  Remove unused local.
3151         Use C99-style 'extern inline' if available.
3152         * buffer.h (BUFFER_INLINE):
3153         * category.h (CATEGORY_INLINE):
3154         * character.h (CHARACTER_INLINE):
3155         * charset.h (CHARSET_INLINE):
3156         * composite.h (COMPOSITE_INLINE):
3157         * dispextern.h (DISPEXTERN_INLINE):
3158         * lisp.h (LISP_INLINE):
3159         * systime.h (SYSTIME_INLINE):
3160         New macro, replacing 'static inline' in this header.
3161         * buffer.h, category.h, character.h, charset.h, composite.h:
3162         * dispextern.h, lisp.h, systime.h:
3163         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3164         * alloc.c (LISP_INLINE):
3165         * buffer.c (BUFFER_INLINE):
3166         * category.c (CATEGORY_INLINE):
3167         * character.c (CHARACTER_INLINE):
3168         * charset.c (CHARSET_INLINE):
3169         * composite.c (COMPOSITE_INLINE):
3170         * dispnew.c (DISPEXTERN_INLINE):
3171         * sysdep.c (SYSTIME_INLINE):
3172         Define to EXTERN_INLINE, so that the corresponding functions
3173         are compiled into code.
3174         * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3175         (INLINE_HEADER_END): New macros.
3176         * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3177         since it's used in non-static inline functions now.
3178         (VALMASK) [!USE_LSB_TAG]: Likewise.
3180 2012-08-02  Glenn Morris  <rgm@gnu.org>
3182         * s/: Remove empty directory.
3184         * s/ms-w32.h: Move to ../nt/inc.
3185         * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3186         Update for new ms-w32.h location.
3188 2012-08-02  Paul Eggert  <eggert@cs.ucla.edu>
3190         Port to Solaris 8.
3191         * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3193 2012-08-02  Glenn Morris  <rgm@gnu.org>
3195         * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3196         hard-coding the path separator.
3198 2012-08-01  Paul Eggert  <eggert@cs.ucla.edu>
3200         Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3201         This how ASET and AREF are supposed to work, and makes
3202         it easier to think about future improvements.  See
3203         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3204         * charset.h (set_charset_attr): New function.
3205         All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3206         * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3207         (aref_addr): New function.  All uses of &AREF(...) changed.
3208         (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3209         (set_hash_index): New functions.  All lvalue-style uses of
3210         HASH_KEY etc. changed.
3211         * keyboard.c (set_prop): New function.  All lvalue-style uses
3212         of PROP changed.
3214 2012-08-01  Alp Aker  <alp.tekin.aker@gmail.com>
3216         * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3217         (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3218         (EmacsScroller-dealloc):  Adjust to use WVAR.  (Bug#12114)
3219         * nsfns.m (ns_set_name_as_filename): Likewise.
3220         * nsmenu.m (ns_update_menubar): Likewise.
3221         * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3223 2012-08-01  Eli Zaretskii  <eliz@gnu.org>
3225         * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3226         Adapt to latest changes in field names of the corresponding Lisp
3227         objects.
3229         * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3231 2012-08-01  Glenn Morris  <rgm@gnu.org>
3233         * s/msdos.h: Remove file.
3234         * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3235         * Makefile.in (S_FILE): Remove.
3236         (config_h): Remove S_FILE.
3238 2012-08-01  Juanma Barranquero  <lekktu@gmail.com>
3240         * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3241         Remove; moved to nt/config.nt.
3243 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
3245         Use INTERNAL_FIELD for conses and overlays.
3246         * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3247         Remove obsolete comment.
3248         (MVAR): New macro.
3249         (struct Lisp_Overlay): Use INTERNAL_FIELD.
3250         * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3252 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
3254         Use INTERNAL_FIELD for symbols.
3255         * lisp.h (SVAR): New macro.  Adjust users.
3256         * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3257         * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3259 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
3261         Use INTERNAL_FIELD for processes.
3262         * process.h (PVAR): New macro.  Adjust style.
3263         (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3264         * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3266 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
3268         Use INTERNAL_FIELD for windows.
3269         * window.h (WVAR): New macro.
3270         (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3271         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3272         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3273         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3274         * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3275         * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3277 2012-08-01  Paul Eggert  <eggert@cs.ucla.edu>
3279         * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3281 2012-08-01  Glenn Morris  <rgm@gnu.org>
3283         * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3284         Move to configure.ac.
3286 2012-08-01  Juanma Barranquero  <lekktu@gmail.com>
3288         * makefile.w32-in (CONFIG_H): Update dependencies.
3289         (CONF_POST_H): New macro.
3291         * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3293 2012-07-31  Glenn Morris  <rgm@gnu.org>
3295         * Makefile.in (S_FILE): No longer set by configure.
3297         * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3298         is available.
3299         (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3301         * process.h (NULL_DEVICE):
3302         * emacs.c (SEPCHAR):
3303         * editfns.c (USER_FULL_NAME): Let configure set them.
3305         * s/README, s/template.h: Remove files.
3307         * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3309         * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3310         Move to configure.ac.
3312 2012-07-31  Eli Zaretskii  <eliz@gnu.org>
3314         * .gdbinit (xframe): Adapt to introduction of FVAR and the
3315         resulting renaming of 'struct frame' members.
3317         * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3319         * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3320         after introduction of FVAR.
3322 2012-07-31  Jan Djärv  <jan.h.d@swipnet.se>
3324         * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3326         * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3327         instead of compositeToPoint.
3328         (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3330         * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
3332 2012-07-31  Dmitry Antipov  <dmantipov@yandex.ru>
3334         Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3335         * lisp.h (INTERNAL_FIELD): New macro.
3336         * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
3337         (BVAR): Change to use INTERNAL_FIELD.
3338         * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3339         (KVAR): Change to use INTERNAL_FIELD.
3340         * frame.h (FVAR): New macro.
3341         (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3342         * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3343         * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3344         * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3345         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3347 2012-07-31  Dmitry Antipov  <dmantipov@yandex.ru>
3349         Miscellaneous fixes for non-default X toolkits.
3350         * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3351         * xterm.c (x_frame_of_widget): Remove redundant prototype.
3352         Move under #ifdef USE_LUCID.
3353         (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3354         definition and usage to avoid warnings.
3356 2012-07-31  Jan Djärv  <jan.h.d@swipnet.se>
3358         * nsterm.m (openFiles): Fix previous checkin.
3360 2012-07-31  Paul Eggert  <eggert@cs.ucla.edu>
3362         * indent.c (compute_motion): Remove unused local.
3364 2012-07-31  Glenn Morris  <rgm@gnu.org>
3366         * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3368         * conf_post.h [USG5_4]:
3369         Move remaining contents of s/usg5-4-common.h here.
3370         * s/usg5-4-common.h: Remove file.
3372         * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3373         * s/irix6-5.h: Remove file.
3375         * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3376         * s/darwin.h: Remove file.
3378         * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3379         * s/hpux10-20.h: Remove file, which is now empty.
3381 2012-07-30  Glenn Morris  <rgm@gnu.org>
3383         * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3384         * Makefile.in (config_h): Add conf_post.h.
3385         * makefile.w32-in (CONFIG_H): Add conf_post.h.
3387 2012-07-30  Jan Djärv  <jan.h.d@swipnet.se>
3389         * nsterm.m (ns_do_open_file): New variable.
3390         (ns_term_init): Set ns_do_open_file to YES after run returns.
3391         (openFile, openTempFile, openFileWithoutUI, openFiles):
3392         Open files only if ns_do_open_file.
3394 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
3396         * lisp.h (SWITCH_ENUM_CAST): Remove.  All uses removed.
3397         This no-op macro hasn't been needed for many years.
3398         * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3400         Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3401         * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3402         * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3403         gdb_make_enums_visible.
3404         (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3405         (DIRECTORY_SEP): Now a constant, not a macro.
3407 2012-07-30  Eli Zaretskii  <eliz@gnu.org>
3409         * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3410         w32_kbd_patch_key as the 2nd arg.  (Bug#12082)
3412         * w32term.c <w32_keyboard_codepage>: Renamed from
3413         keyboard_codepage and now external.  All users changed.
3415         * w32term.h: Add declaration of w32_keyboard_codepage.
3417         * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3418         the codepage to translate keys to Unicode.  If this argument is
3419         -1, use the value returned by GetConsoleCP.  All callers changed.
3421 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
3423         Update .PHONY listings in makefiles.
3424         * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3425         bootstrap-clean, distclean, maintainer-clean, versioclean,
3426         extraclean, frc.
3428         * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3429         This is a bit clearer.  Fix some commentary typos.
3431 2012-07-30  Glenn Morris  <rgm@gnu.org>
3433         * s/netbsd.h: Let configure include signal.h if needed.
3434         Remove file, which is now empty.
3436         * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3437         Let configure set them.
3438         * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3439         No more need to undefine.
3441 2012-07-30  Andreas Schwab  <schwab@linux-m68k.org>
3443         * keymap.c (Fkey_description): Don't remove 0x80 bit from
3444         non-single-byte char when adding meta modifier.  (Bug#12090)
3446 2012-07-30  Dmitry Antipov  <dmantipov@yandex.ru>
3448         Convert safe_call to use variable number of arguments.
3449         * xdisp.c (safe_call): Convert to use varargs.  Adjust users.
3450         (safe_call2): Fix comment.
3451         * lisp.h (safe_call): Adjust prototype.
3452         * coding.c (encode_coding_object): Change to use safe_call2.
3453         * xfaces.c (merge_face_heights): Change to use safe_call1.
3455 2012-07-30  Glenn Morris  <rgm@gnu.org>
3457         * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
3458         does that unconditionally.  Remove file, which is now empty.
3460         * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3461         Remove empty files.
3463 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
3465         Export to GDB most of lisp.h's remaining object-like macros.
3466         * lisp.h (min, max): Move earlier, because they're used earlier now.
3467         (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3468         (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3469         (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3470         (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3471         (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3472         (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3473         (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3474         (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3475         Now constants, for GDB.  They need not be macros.
3476         (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3477         Now constants, for GDB, as well as macros, for static initializers.
3478         (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3479         Move to after the definition of struct Lisp_Char_Table,
3480         since the former now needs that type defined.
3481         (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3482         (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3483         (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3484         New enums, for gdb_make_enums_visible.
3485         (GLYPH_MODE_LINE_FACE): Remove; unused.
3486         * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
3487         (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3488         CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3489         enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3490         enum maxargs, enum MAX_ALLOCA.
3491         (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3492         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3493         no longer needed, now that they are done in lisp.h.
3495 2012-07-30  Dmitry Antipov  <dmantipov@yandex.ru>
3497         Cleanup string bytes checking.
3498         * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove.  Convert
3499         all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3500         (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3501         (check_sblock, compact_small_strings): Simplify.
3503 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
3505         * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3506         These macros are confusing and no longer need to be defined, as
3507         the enum values now suffice.  All uses replaced with definiens.
3508         (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3510 2012-07-29  Juanma Barranquero  <lekktu@gmail.com>
3512         * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3513         ($(BLD)/w32console.$(O)): Update dependencies.
3515 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
3517         Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3518         * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3519         time.  Adjust users.
3520         (CHECK_CONS_LIST): Remove.  Convert all users to check_cons_list.
3522 2012-07-29  Jan Djärv  <jan.h.d@swipnet.se>
3524         * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3525         setting sitelisp (Bug#12010).
3527 2012-07-29  Eli Zaretskii  <eliz@gnu.org>
3529         * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
3531         * w32heap.c (cache_system_info):
3532         * w32.c (sys_rename):
3533         * w32proc.c (find_child_console, sys_kill): All users changed.
3535 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
3537         * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3539 2012-07-29  Eli Zaretskii  <eliz@gnu.org>
3541         * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3543 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
3545         Cleanup statistics calculation in Fgarbage_collect.
3546         * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3547         Fix zombies percentage calculation.  Simplify elapsed time calculation.
3549 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
3551         Generalize marker debugging code under MARKER_DEBUG and use eassert.
3552         * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3553         (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3554         (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3555         (replace_range, replace_range_2, del_range_2): Change to eassert.
3556         * marker.c (byte_char_debug_check): Adjust style.
3558 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
3560         Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3561         * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3562         long-ago-commented-out code that talks about "WIN32".
3563         * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3564         All uses changed.
3566 2012-07-28  Paul Eggert  <eggert@cs.ucla.edu>
3568         Use Gnulib stdalign module (Bug#9772, Bug#9960).
3569         * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3570         Simplify by using alignof.
3571         (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3572         * lisp.h: Include <stdalign.h>.
3573         (GCALIGNMENT): New macro and constant.
3574         (DECL_ALIGN): Remove.  All uses replaced by alignas (GCALIGNMENT).
3575         (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3576         (stdalign): New macro, if not already defined.
3578 2012-07-28  Eli Zaretskii  <eliz@gnu.org>
3580         Fix non-ASCII input in non-GUI frames on MS-Windows.  (Bug#12055)
3581         * w32inevt.c: Include w32inevt.h.
3582         (w32_read_console_input): New inline function, calls either
3583         ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3584         w32_console_unicode_input.
3585         (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3586         (w32_kbd_patch_key, key_event): Use the codepage returned by
3587         GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3588         (key_event): use uChar.UnicodeChar only if
3589         w32_console_unicode_input is non-zero.
3591         * w32console.c: Include w32heap.h.
3592         <w32_console_unicode_input>: New global variable.
3593         (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3594         family of Windows, zero otherwise.
3596         * w32inevt.h: Declare w32_console_unicode_input.
3598         * xdisp.c (init_iterator): Don't reference tip_frame in a build
3599         --without-x.  (Bug#11742)
3601 2012-07-27  Paul Eggert  <eggert@cs.ucla.edu>
3603         Adjust GDB to reflect pvec_type changes (Bug#12036).
3604         * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
3605         2012-07-04 changes to pseudovector representation.
3606         Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
3608 2012-07-27  Michael Albinus  <michael.albinus@gmx.de>
3610         * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3611         bus address.
3612         (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3614 2012-07-27  Eli Zaretskii  <eliz@gnu.org>
3616         * alloc.c (listn): Fix the order the arguments are consed onto the
3617         list.
3619         * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3620         enumeration constants, as PURE and HEAP are too general, and clash
3621         with other headers and sources, such as gmalloc.c and the
3622         MS-Windows system headers.  All users changed.
3624 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
3626         Revert last save_excursion_save and save_excursion_restore changes.
3627         * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3628         Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3630 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
3632         Fix recently-introduced typos in Windows port.
3633         Reported by Martin Rudalics <rudalics@gmx.at>.
3634         * w32.c (init_environment): Replace comma with semicolon.
3635         * w32fns.c (syms_of_w32fns): Add missing parenthesis.
3637 2012-07-27  Paul Eggert  <eggert@cs.ucla.edu>
3639         Improve GDB symbol export (Bug#12036).
3640         * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
3641         arms of an 'if', not using conditional expressions; otherwise GDB
3642         complains about the types in the unevaluated arm when the argument
3643         is an integer literal.
3644         (xgetint): Simplify expression.
3645         * alloc.c (gdb_make_enums_visible): New constant.  This ports to
3646         GCC 3.4.2 the export of symbols to GDB.  Problem reported by Eli
3647         Zaretskii in <http://bugs.gnu.org/12036#13>.
3648         * lisp.h (PUBLISH_TO_GDB): Remove.  All uses removed.  No longer
3649         needed now that we have gdb_make_enums_visible.
3650         (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
3651         (enum enum_USE_LSB_TAG):
3652         New enum types, packaging up enums that need to be exported to GDB.
3654 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
3656         Utility function to make a list from specified amount of objects.
3657         * lisp.h (enum constype): New datatype.
3658         (listn): New prototype.
3659         * alloc.c (listn): New function.
3660         (Fmemory_use_count, syms_of_alloc): Use it.
3661         * buffer.c (syms_of_buffer): Likewise.
3662         * callint.c (syms_of_callint): Likewise.
3663         * charset.c (define_charset_internal): Likewise.
3664         * coding.c (syms_of_coding): Likewise.
3665         * keymap.c (syms_of_keymap): Likewise.
3666         * search.c (syms_of_search): Likewise.
3667         * syntax.c (syms_of_syntax): Likewise.
3668         * w32.c (init_environment): Likewise.
3669         * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3670         * xdisp.c (syms_of_xdisp): Likewise.
3671         * xfns.c (syms_of_xfns): Likewise.
3673 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
3675         Fast save_excursion_save and save_excursion_restore.
3676         * lisp.h (struct Lisp_Excursion): New data type.
3677         (PVEC_EXCURSION): New pseudovector type.
3678         (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3679         to deal with it.  Adjust comments.
3680         (init_marker, attach_marker): New prototype.
3681         (unchain_marker): Adjust prototype.
3682         * marker.c (attach_marker): Change to global.
3683         (init_marker): New function.
3684         * alloc.c (Fmake_marker, build_marker): Use it.
3685         (build_marker): More easserts.
3686         (mark_object): Handle struct Lisp_Excursion.
3687         * editfns.c (save_excursion_save, save_excursion_restore):
3688         Reimplement to use struct Lisp_Excursion.  Add comments.
3690 2012-07-26  Paul Eggert  <eggert@cs.ucla.edu>
3692         Fix export of symbols to GDB (Bug#12036).
3693         * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3694         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3695         emacs.c, as this is a more-suitable home.  Had this been done earlier
3696         the fix for 12036 would have avoided some of the problems noted in
3697         <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3698         would have been more obvious.
3699         * emacs.c: Do not include <verify.h>; no longer needed.
3700         (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
3701         (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3702         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3703         Remove; now done in lisp.h.
3704         * lisp.h (PUBLISH_TO_GDB): New macro.
3705         (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3706         (DATA_SEG_BITS): Use it.
3707         (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3708         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3709         * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3710         not be usable in #if.  This simplifies things.
3712 2012-07-26  Juanma Barranquero  <lekktu@gmail.com>
3714         * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3716 2012-07-26  Paul Eggert  <eggert@cs.ucla.edu>
3718         Simplify export of symbols to GDB (Bug#12036).
3719         * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3720         $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3721         (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3722         Adjust to changes in lisp.h and emacs.c, by using
3723         CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3724         of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3725         INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3726         gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3727         instead of gdb_valbits.
3728         (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3729         PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3730         instead of gdb_array_mark_flag.
3731         (xboolvector): Get size from $->size, not $->header.size.
3732         Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3733         (xreload, hook-run, hookpost-run): Remove.
3734         * emacs.c: Include <verify.h>.
3735         (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3736         (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3737         Remove.
3738         (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3739         (gdb_USE_LSB_TAG): New enum constants.
3740         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3741         Also define these as enum constants, so they're visible to GDB.
3742         (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
3743         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
3744         as constants, so they're visible to GDB.
3745         * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
3746         (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
3747         Now enum constants, not macros, so they're visible to GDB.
3748         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
3749         more convenient now.  All uses changed.
3750         (VALMASK) [USE_LSB_TAG]: Also define in this case.
3751         * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
3753 2012-07-26  Dmitry Antipov  <dmantipov@yandex.ru>
3755         Explicitly free restriction data that are not needed anymore.
3756         * editfns.c (save_restriction_restore): Free restriction data.
3758 2012-07-26  Stefan Monnier  <monnier@iro.umontreal.ca>
3760         * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
3761         add argument, tune behavior, and adjust all callers.
3763 2012-07-25  Paul Eggert  <eggert@cs.ucla.edu>
3765         Use typedef for EMACS_INT, EMACS_UINT.
3766         * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
3767         than macros.  This simplifies debugging in the usual case, since
3768         it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
3769         and it allows expressions involving EMACS_INT casts.
3770         * .gdbinit (xreload): Simplify by using EMACS_INT cast.
3772 2012-07-25  Jan Djärv  <jan.h.d@swipnet.se>
3774         * nsterm.m (ns_read_socket): Return early if there is a modal
3775         window (Bug#12043).
3777 2012-07-25  Martin Rudalics  <rudalics@gmx.at>
3779         * frame.c (Fredirect_frame_focus): In doc-string don't mention
3780         that FOCUS-FRAME can be omitted.
3782 2012-07-25  Dmitry Antipov  <dmantipov@yandex.ru>
3784         Adjust buffer text indirection counters at the end of Fkill_buffer.
3785         * buffer.c (Fkill_buffer): Adjust indirection counters when the
3786         buffer is definitely dead.  This should really fix an issue reported
3787         by Christoph Scholtes again.  (Bug#12007).
3788         (init_buffer_once): Initialize indirection counters of
3789         buffer_defaults and buffer_local_symbols (for sanity and safety).
3791 2012-07-24  Eli Zaretskii  <eliz@gnu.org>
3793         * xdisp.c (init_iterator): Don't compute dimensions of truncation
3794         and continuation glyphs on tooltip frames, leave them at zero.
3795         Avoids continued lines in tooltips.  (Bug#11832)
3797 2012-07-24  Dmitry Antipov  <dmantipov@yandex.ru>
3799         Simplify copy_overlay.
3800         * buffer.c (copy_overlay): Simplify.  Use build_marker.
3801         * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
3803 2012-07-23  Eli Zaretskii  <eliz@gnu.org>
3805         * print.c (print_object): Don't crash when a frame's name is nil
3806         or invalid.  (Bug#12025)
3808         * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
3809         it signals an error when a tooltip frame is being created.
3811 2012-07-23  Dmitry Antipov  <dmantipov@yandex.ru>
3813         Cleanup miscellaneous objects allocation and initialization.
3814         * alloc.c (allocate_misc): Change to static.  Add argument to
3815         specify the subtype.  Adjust comment and users.
3816         (build_overlay): New function.
3817         * buffer.c (copy_overlays, Fmake_overlay): Use it.
3818         * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
3819         (allocate_misc): Remove prototype.
3820         (build_overlay): Add prototype.
3822 2012-07-23  Dmitry Antipov  <dmantipov@yandex.ru>
3824         Swap buffer text indirection counters in Fbuffer_swap_text.
3825         * buffer.c (Fbuffer_swap_text): Swap indirections too.
3826         This avoids crash reported by Christoph Scholtes at
3827         http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
3829 2012-07-22  Jan Djärv  <jan.h.d@swipnet.se>
3831         * nsmenu.m (Popdown_data): New struct.
3832         (pop_down_menu): p->pointer is Popdown_data.  Release the pool and
3833         free Popdown_data.
3834         (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
3835         (initWithContentRect): Make imgView and contentView non-static
3836         and autorelease them.  Also autorelease img and matrix (Bug#12005).
3837         (dealloc): Remove (Bug#12005).
3839 2012-07-22  Dmitry Antipov  <dmantipov@yandex.ru>
3841         Adjust consing_since_gc when objects are explicitly freed.
3842         * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
3843         (Fgarbage_collect): Use it.  Change minimum to 1/10 of default.
3844         (free_cons, free_misc): Subtract object size from consing_since_gc.
3846 2012-07-22  Dmitry Antipov  <dmantipov@yandex.ru>
3848         Simplify and cleanup markers positioning code.
3849         * marker.c (attach_marker): More useful eassert.
3850         (live_buffer, set_marker_internal): New function.
3851         (Fset_marker, set_marker_restricted): Use set_marker_internal.
3852         (set_marker_both, set_marker_restricted_both): Use live_buffer.
3854 2012-07-22  Paul Eggert  <eggert@cs.ucla.edu>
3856         * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
3857         as it's limited by the amount of memory, not by INT_MAX.
3859 2012-07-21  Eli Zaretskii  <eliz@gnu.org>
3861         * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
3862         in special-event-map.  See the discussion at
3863         http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
3864         for the reasons.
3866         * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
3867         info.dwItemData.  Fixes crashes on 64-bit Windows.
3868         Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3870 2012-07-21  Jan Djärv  <jan.h.d@swipnet.se>
3872         * nsterm.m (accessibilityAttributeValue): New function.  (Bug#11134).
3873         (conversationIdentifier): Return value is NSInteger.
3874         * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
3876 2012-07-21  Chong Yidong  <cyd@gnu.org>
3878         * window.c (decode_any_window): Signal an error if the window is
3879         on a dead frame (Bug#11984).
3881 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
3883         Add indirection counting to speed up Fkill_buffer.
3884         * buffer.h (struct buffer): New member.
3885         * buffer.c (Fget_buffer_create): Set indirection counter to 0.
3886         (Fmake_indirect_buffer): Set indirection counter to -1, increment
3887         base buffer indirection counter.
3888         (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
3889         (Fkill_buffer): Adjust indirection counters as needed, don't walk
3890         through buffer list if indirection counter is 0.
3892 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
3894         Extend the value returned by Fgarbage_collect with heap statistics.
3895         * alloc.c (Qheap): New symbol.
3896         (syms_of_alloc): DEFSYM it.
3897         (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
3898         (Fmemory_free): Remove.
3899         (syms_of_alloc): Don't defsubr it.
3900         * buffer.c (Fcompact_buffer): Remove.
3901         (syms_of_buffer): Don't defsubr it.
3903 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
3905         Make maybe_gc inline.
3906         Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
3907         * lisp.h (consing_since_gc, gc_relative_threshold)
3908         (memory_full_cons_threshold): Revert declaration.
3909         (maybe_gc): Remove prototype, define as inline.
3910         * alloc.c: Remove old commented-out code.
3911         (consing_since_gc, gc_relative_threshold)
3912         (memory_full_cons_threshold): Revert to global.
3913         (maybe_gc): Remove.
3915 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
3917         Simple wrapper for make_unibyte_string, adjust font_open_by_name.
3918         * lisp.h (build_unibyte_string): New function.
3919         * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
3920         * sysdep.c, w32fns.c, xfns.c: Use it.
3921         * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
3922         of type Lisp_Object to avoid redundant calls to make_unibyte_string.
3923         Adjust users accordingly.
3924         * font.h (font_open_by_name): Adjust prototype.
3926 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
3928         Cleanup calls to Fgarbage_collect.
3929         * lisp.h (maybe_gc): New prototype.
3930         (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3931         Remove declarations.
3932         * alloc.c (maybe_gc): New function.
3933         (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3934         Make them static.
3935         * bytecode.c (MAYBE_GC): Use maybe_gc.
3936         * eval.c (eval_sub, Ffuncall): Likewise.
3937         * keyboard.c (read_char): Likewise.  Adjust call to maybe_gc
3938         to avoid dependency from auto-save feature.
3940 2012-07-19  Paul Eggert  <eggert@cs.ucla.edu>
3942         * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
3943         (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
3944         'for_each_per_buffer_object_at'.
3945         All uses changed.  It's better to use upper-case for macros that
3946         cannot be implemented as functions, to give the reader a clue
3947         that they're special.
3949 2012-07-19  Stefan Monnier  <monnier@iro.umontreal.ca>
3951         * alloc.c (Fgarbage_collect): Tweak docstring.
3953 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
3955         Tweak the value returned from Fgarbage_collect again.
3956         * alloc.c (Fgarbage_collect): New return value, as confirmed in
3957         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
3958         Adjust documentation.
3959         (total_vector_bytes): Rename to total_vector_slots, adjust
3960         accounting.
3961         (total_free_vector_bytes): Rename to total_free_vector_slots,
3962         adjust accounting.
3963         (Qstring_bytes, Qvector_slots): New symbols.
3964         (syms_of_alloc): DEFSYM them.
3966 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
3968         Buffer compaction primitive which may be used from Lisp.
3969         * buffer.c (compact_buffer, Fcompact_buffer): New function.
3970         (syms_of_buffer): Register Fcompact_buffer.
3971         * alloc.c (Fgarbage_collect): Use compact_buffer.
3972         * buffer.h (compact_buffer): New prototype.
3973         (struct buffer_text): New member.
3975 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
3977         New macro to iterate over all buffers, miscellaneous cleanups.
3978         * lisp.h (all_buffers): Remove declaration.
3979         * buffer.h (all_buffers): Add declaration, with comment.
3980         (for_each_buffer): New macro.
3981         * alloc.c (Fgarbage_collect, mark_object): Use it.
3982         * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
3983         (init_buffer): Likewise.
3984         * data.c (Fset_default): Likewise.
3985         * coding.c (code_conversion_restore): Remove redundant check
3986         for dead buffer.
3987         * buffer.c (Fkill_buffer): Likewise.  Remove obsolete comment.
3989 2012-07-18  Andreas Schwab  <schwab@linux-m68k.org>
3991         Fix bug that created negative-length intervals.
3992         * intervals.c (merge_interval_right, merge_interval_left):
3993         Do not zero out this interval if it is absorbed by its children,
3994         as this interval's total length doesn't change in that case.  See
3995         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
3997 2012-07-18  Paul Eggert  <eggert@cs.ucla.edu>
3999         * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4000         when invoking (make-bool-vector N t) and N is a positive
4001         multiple of 8 -- the last 8 bits were mistakenly cleared.
4003         Remove some struct layout assumptions in bool vectors.
4004         * alloc.c (bool_header_size): New constant.
4005         (header_size, word_size): Move earlier, as they're now used earlier.
4006         Use 'word_size' in a few more places, where it's appropriate.
4007         (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4008         padding before the data member of a bool vector.
4009         (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4010         than doing the check by hand with an abort ().
4012 2012-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
4014         * eval.c (Fdefvar): Don't check constants since we only set the var if
4015         it's not yet defined anyway (bug#11904).
4017         * lisp.h (last_undo_boundary): Declare new var.
4018         * keyboard.c (command_loop_1): Set it.
4019         * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4020         were auto-added by the command loop (bug#11774).
4022 2012-07-18  Andreas Schwab  <schwab@linux-m68k.org>
4024         * w32font.c (Qsymbol): Remove local definition.
4025         (syms_of_w32font): Don't DEFSYM it.
4027 2012-07-18  Dmitry Antipov  <dmantipov@yandex.ru>
4029         Fix sweep_vectors to handle large bool vectors correctly.
4030         * alloc.c (sweep_vectors): Account total_vector_bytes for
4031         bool vectors larger than VBLOCK_BYTES_MAX.
4033 2012-07-18  Chong Yidong  <cyd@gnu.org>
4035         * frame.c (x_set_frame_parameters): Revert bogus change introduced
4036         in 2012-05-25 commit by Paul Eggert (Bug#11738).
4038 2012-07-18  Dmitry Antipov  <dmantipov@yandex.ru>
4040         Return more descriptive data from Fgarbage_collect.
4041         Suggested by Stefan Monnier in
4042         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4043         * alloc.c (bounded_number): New function.
4044         (total_buffers, total_vectors): New variable.
4045         (total_string_size): Rename to total_string_bytes, adjust users.
4046         (total_vector_size): Rename to total_vector_bytes, adjust users.
4047         (sweep_vectors): Account total_vectors and total_vector_bytes.
4048         (Fgarbage_collect): New return value.  Adjust documentation.
4049         (gc_sweep): Account total_buffers.
4050         (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4051         (VECTOR_SIZE): Remove.
4052         * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4053         (Qinterval, Qmisc): New symbols.
4054         (syms_of_data): Initialize them.
4055         * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4056         (Qcons, Qbuffer): New declarations.
4058 2012-07-17  Paul Eggert  <eggert@cs.ucla.edu>
4060         * alloc.c (Fmemory_free): Account for memory-free's own storage.
4061         Round up, not down.  Improve doc.
4063 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
4065         Restore old code in allocate_string_data to avoid Faset breakage.
4066         Reported by Julien Danjou <julien@danjou.info> in
4067         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4068         * alloc.c (allocate_string_data): Restore old code with minor
4069         adjustments, fix comment to explain this subtle issue.
4071 2012-07-17  Eli Zaretskii  <eliz@gnu.org>
4073         Remove FILE_SYSTEM_CASE.
4074         * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4076         * fileio.c (FILE_SYSTEM_CASE): Don't define.
4077         (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4078         Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4079         call-process-region passes it through expand-file-name.
4081         * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4083 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
4085         Fix crash when creating indirect buffer (Bug#11917)
4086         * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4087         Don't handle unbound variables specially if non-zero.
4088         (Fbuffer_local_variables): Pass zero.
4089         (clone_per_buffer_values): Pass non-zero.
4091 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
4093         * gnutls.c (emacs_gnutls_handshake): Revert last change.  Add QUIT
4094         to make the loop interruptible.
4096 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
4098         * gnutls.c (emacs_gnutls_handshake): Only retry if
4099         GNUTLS_E_INTERRUPTED.
4101 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
4103         Cleanup and convert miscellaneous checks to eassert.
4104         * alloc.c (mark_interval): Fix comment, partially rephrase
4105         old comment from intervals.h (see below).
4106         * intervals.c (find_interval, adjust_intervals_for_insertion)
4107         (delete_interval, adjust_intervals_for_deletion)
4108         (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4109         Convert to eassert.
4110         (adjust_intervals_for_insertion, make_new_interval):
4111         Remove obsolete and unused code.
4112         * intervals.h (struct interval): Remove obsolete comment.
4113         * textprotp.c (erase_properties): Remove unused code.
4114         (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4115         (Fremove_list_of_text_properties): Convert to eassert.
4117 2012-07-17  Chong Yidong  <cyd@gnu.org>
4119         * editfns.c (Finsert_char): Doc fix.
4121 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
4123         Fix previous change to make Fmemory_free always accurate.
4124         * alloc.c (make_interval): Update total_free_intervals.
4125         (make_float): Likewise for total_free_floats.
4126         (free_cons, Fcons): Likewise for total_free_conses.
4127         (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4128         Likewise for total_free_vector_bytes.
4129         (Fmake_symbol): Likewise for total_free_symbols.
4130         (bytes_free): Remove.
4132 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
4134         Simple free memory accounting feature.
4135         * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4136         (sweep_vectors): Accumulate size of free vectors.
4137         (Fgarbage_collect): Setup bytes_free.
4138         (Fmemory_free): New function.
4139         (syms_of_alloc): Register it.
4141 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
4143         Cleanup overlays checking.
4144         * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4145         * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4146         eassert and OVERLAYP.
4147         (sort_overlays): Change to use OVERLAYP.
4149 2012-07-16  René Kyllingstad  <Rene@Kyllingstad.com>  (tiny change)
4151         * editfns.c (Finsert_char): Make it interactive, and make the
4152         second arg optional.  Copy interactive spec and docstring from
4153         ucs-insert.
4155 2012-07-17  Paul Eggert  <eggert@cs.ucla.edu>
4157         * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4158         Unlike the other wrapped functions, fabs has an unspecified
4159         effect on errno.
4161 2012-07-16  Jan Djärv  <jan.h.d@swipnet.se>
4163         * nsterm.m (keyDown): Interpret flags without left/right bits
4164         as the left key (Bug#11670).
4166 2012-07-16  Dmitry Antipov  <dmantipov@yandex.ru>
4168         Remove empty and useless init functions.
4169         * lisp.h (init_character_once, init_fns, init_image)
4170         (init_filelock, init_sound): Remove prototype.
4171         * character.c (init_character_once): Remove.
4172         * filelock.c (init_filelock): Likewise.
4173         * fns.c (init_fns): Likewise.
4174         * image.c (init_image): Likewise.
4175         * sound.c (init_sound): Likewise.
4176         * emacs.c (main): Adjust accordingly.
4178 2012-07-16  Dmitry Antipov  <dmantipov@yandex.ru>
4180         * gtkutil.h: Tiny cleanups.
4181         (use_old_gtk_file_dialog): Remove useless declaration.
4182         (xg_uses_old_file_dialog): Add suggested const attribute.
4184 2012-07-15  Eli Zaretskii  <eliz@gnu.org>
4186         * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4187         (bidi_paragraph_init): Use it to limit search forward for a strong
4188         directional character in abnormally large paragraphs full of
4189         neutral or weak characters.  (Bug#11943)
4191 2012-07-15  Stefano Facchini  <stefano.facchini@gmail.com>  (tiny change)
4193         * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4194         the toolbar (Bug#9451).
4195         (xg_make_tool_item): Give the widget event box a transparent
4196         background.
4198 2012-07-15  Dmitry Antipov  <dmantipov@yandex.ru>
4200         Cleanup basic allocation variables and functions.
4201         * alloc.c (ignore_warnings, init_intervals, init_float)
4202         (init_cons, init_symbol, init_marker): Remove.
4203         (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4204         (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4205         (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4206         (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4207         (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4208         (staticidx, init_alloc_once, init_strings, free_ablock):
4209         Remove redundant initialization.
4210         * fns.c (init_weak_hash_tables): Remove.
4211         * lisp.h (init_weak_hash_tables): Remove prototype.
4213 2012-07-15  Dmitry Antipov  <dmantipov@yandex.ru>
4215         Use zero_vector where appropriate.
4216         * alloc.c (zero_vector): Define as Lisp_Object.  Adjust users
4217         accordingly.
4218         * lisp.h (zero_vector): New declaration.
4219         * font.c (null_vector): Remove.
4220         (syms_of_font): Remove initialization and staticpro.
4221         (font_list_entities, font_find_for_lface): Change to use zero_vector.
4222         * keymap.c (Faccessible_keymaps): Likewise.
4224 2012-07-15  Leo Liu  <sdl.web@gmail.com>
4226         * fringe.c: Fix typo in comments.
4228 2012-07-14  Leo Liu  <sdl.web@gmail.com>
4230         * fringe.c: Add a new bitmap exclamation-mark.
4232 2012-07-14  Eli Zaretskii  <eliz@gnu.org>
4234         * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4236         * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4237         (HAVE_MENUS): Don't define, defined by editing config.in with
4238         msdos/sed2v2.inp.
4239         (GMALLOC_INHIBIT_VALLOC): Don't define.
4240         (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4242 2012-07-14  Juanma Barranquero  <lekktu@gmail.com>
4244         * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4246 2012-07-14  Glenn Morris  <rgm@gnu.org>
4248         * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4249         * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4250         Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4252 2012-07-13  Glenn Morris  <rgm@gnu.org>
4254         * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4256         * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4257         * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4259 2012-07-13  Jan Djärv  <jan.h.d@swipnet.se>
4261         * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4262         (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4263         (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4264         (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4265         where appropriate.
4266         (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4267         as boolean expression.
4268         (x_set_window_size): Remove unused variable toolbar.
4269         (ns_get_color_default, ns_mod_to_lisp): Remove.
4270         (ns_mouse_position): Remove unused variables xchar and ychar.
4271         (ns_compute_glyph_string_overhangs): Remove unused variable face.
4272         (ns_set_vertical_scroll_bar): Remove unused variable count.
4273         (ns_delete_terminal): Remove unused variable i.
4274         (ns_term_init): Remove unused variables r, g and b.
4275         (mouseDown): Remove unused variable window.
4276         (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4277         (initFrameFromEmacs): Remove unused variable vbextra.
4278         (mouseEntered): Remove unused variables p and dpyinfo.
4279         (mouseExited): Remove unused variables p and r.
4280         (ns_define_frame_cursor, ns_clear_frame_area)
4281         (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4282         (menuDown): Assign [sender tag] to variable and cast the variable.
4284         * nsterm.h (menuDown): Add id as type to argument sender.
4285         (ns_display_info_for_name): Add Lisp_Object argument.
4286         (ns_term_init): Add Lisp_Object argument.
4287         (ns_map_event_to_object): Add void argument.
4288         (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4289         prototype with arguments and only declare if __OBJC__.
4290         (nxatoms_of_nsselect): Add void argument.
4291         (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4292         (ns_alloc_autorelease_pool): Add void argument.
4293         (ns_release_autorelease_pool): Add void* argument.
4294         (ns_get_defaults_value): Add const char* argument.
4296         * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4297         (initFromContents): Use SSDATA where appropriate.
4298         (ns_update_menubar): Add braces to ambigous if-else.
4299         (initWithTitle): Put () around assignment in if statement.
4300         (ns_menu_show): Remove unused variables window and keymap.
4301         (update_frame_tool_bar): Remove unused variable selected_p.
4302         (initWithContentRect): Remove unused variable this_cmd_name.
4304         * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4305         appropriate.
4306         (setXBMColor): Remove unused variable len.
4307         (setPixmapData): Put () around assignment in loop statement.
4309         * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4310         (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4311         where appropriate.
4312         (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4313         around assignment in loop statement.
4314         (nsfont_open): Remove unused variable i.
4315         (nsfont_open): Remove unused variable len.
4316         (nsfont_draw): Remove unused variable cs.
4318         * nsfns.m (x_set_icon_name, ns_set_name_internal)
4319         (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4320         (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4321         (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4322         (Fns_font_name, Fns_perform_service)
4323         (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4324         (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4325         (ns_set_name): Remove unused variable view.
4326         (x_set_menu_bar_lines): Remove unused variable olines.
4327         (x_set_tool_bar_lines): Remove unused variable root_window.
4328         (Fns_list_colors): Put () around assignment in while statement.
4329         (Fns_perform_service): Remove unused variable len.
4330         (Fns_display_usable_bounds): Remove unused variable top.
4331         (syms_of_nsfns): Remove unused variable i.
4333         * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4334         memcpy (Bug#11907).
4336 2012-07-13  Kalle Kankare  <kalle.kankare@iki.fi>  (tiny change)
4338         * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4339         and free it with DestroyExceptionInfo (Bug#11558).
4341 2012-07-13  Juanma Barranquero  <lekktu@gmail.com>
4343         * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4344         (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4345         Set here, not in nt/config.nt.
4347 2012-07-13  Eli Zaretskii  <eliz@gnu.org>
4349         * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4350         cursor overflow into the last glyph on display line when the right
4351         fringe is off.  (Bug#11832)
4353 2012-07-13  Paul Eggert  <eggert@cs.ucla.edu>
4355         * xdisp.c (produce_special_glyphs): Now static.
4356         * dispextern.h (produce_special_glyphs): Remove decl.
4358 2012-07-13  Glenn Morris  <rgm@gnu.org>
4360         * s/bsd-common.h, s/cygwin.h: Remove empty files.
4361         * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4363         * s/usg5-4-common.h (USG, USG5):
4364         * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4365         * s/sol2-6.h (SOLARIS2):
4366         * s/irix6-5.h (IRIX6_5):
4367         * s/hpux10-20.h (USG, USG5, HPUX):
4368         * s/gnu-linux.h (USG, GNU_LINUX):
4369         * s/freebsd.h (BSD_SYSTEM):
4370         * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4371         * s/cygwin.h (CYGWIN):
4372         * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4373         * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4375 2012-07-13  BT Templeton  <bpt@hcoop.net>  (tiny change)
4377         * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
4379 2012-07-13  Glenn Morris  <rgm@gnu.org>
4381         * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4383         * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4385         * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4386         * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4388 2012-07-12  Glenn Morris  <rgm@gnu.org>
4390         * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
4392         * process.c (init_process_emacs): Rename from init_process.
4393         The old name is also the name of a Mach system call.
4394         * lisp.h, emacs.c: Update for this name change.
4395         * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4396         longer needed.
4398 2012-07-12  Eli Zaretskii  <eliz@gnu.org>
4400         * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4401         memmove call that removes glyphs covered by the left truncation
4402         glyph.  Improve commentary.
4403         (display_line): Fix display of continuation glyphs on GUI frames
4404         when the right fringe is turned off and variable-size fonts are
4405         used in the window.  Move the code that appends a stretch glyph to
4406         produce_special_glyphs, so that it could be used for truncation
4407         and continuation glyphs alike.
4408         (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4409         glyph of a suitably computed width, to align the special glyphs at
4410         the window margin.  Code moved from display_line.  (Bug#11832)
4412 2012-07-12  Glenn Morris  <rgm@gnu.org>
4414         * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4416         * s/gnu-linux.h, s/hpux10-20.h:
4417         Do not unconditionally define HAVE_XRMSETDATABASE.
4419         * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4421 2012-07-12  Paul Eggert  <eggert@cs.ucla.edu>
4423         Fix typos that broke OS X build.
4424         Reported by Randal L. Schwartz in
4425         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4426         * nsterm.m (ns_timeout): Add missing local decl.
4427         (ns_get_color): snprintf -> sprintf, to fix typo.
4429 2012-07-12  Glenn Morris  <rgm@gnu.org>
4431         * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4432         * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4433         * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4434         Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4436         * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4437         Move PTY_OPEN to configure.
4439         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4440         * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4441         * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4443 2012-07-12  Dmitry Antipov  <dmantipov@yandex.ru>
4445         Use empty_unibyte_string where applicable.
4446         * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4447         * lread.c (read1): Likewise.
4448         * xsettings.c (syms_of_xsettings): Likewise.
4450 2012-07-12  Glenn Morris  <rgm@gnu.org>
4452         * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4453         * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
4454         * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4455         * s/hpux10-20.h (RUN_TIME_REMAP):
4456         * s/bsd-common.h (TABDLY): Move to configure.
4458         * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4460         * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4462         * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4463         (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
4465         * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
4467         * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4468         * s/template.h: Move NARROWPROTO to configure.
4470 2012-07-11  Glenn Morris  <rgm@gnu.org>
4472         * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4473         unused since 2011-01-17 change to systty.h.
4475         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4476         * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4477         Move HAVE_PTYS and HAVE_SOCKETS to configure.
4479 2012-07-11  Paul Eggert  <eggert@cs.ucla.edu>
4481         * s/sol2-6.h (HAVE_LIBKSTAT): Remove.  (Bug#11914)
4483 2012-07-11  Glenn Morris  <rgm@gnu.org>
4485         * s/darwin.h, s/gnu-linux.h, s/template.h:
4486         Move INTERRUPT_INPUT to configure.
4488 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
4490         Minor adjustments to interning code.
4491         * lisp.h (intern, intern_c_string): Redefine as static inline
4492         wrappers for intern_1 and intern_c_string_1, respectively.
4493         (intern_1, intern_c_string_1): Rename prototypes.
4494         * lread.c (intern_1, intern_c_string_1, oblookup):
4495         Simplify Vobarray checking.
4496         * font.c (font_intern_prop): Likewise.  Adjust comment.
4497         * w32font.c (intern_font_name): Likewise.
4499 2012-07-11  Andreas Schwab  <schwab@linux-m68k.org>
4501         * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4503         * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4504         of Fcar/Fcdr if possible.
4505         * font.c (check_otf_features): Likewise.
4506         * fontset.c (Fnew_fontset): Likewise.
4507         * gnutls.c (Fgnutls_boot): Likewise.
4508         * minibuf.c (read_minibuf): Likewise.
4509         * msdos.c (IT_set_frame_parameters): Likewise.
4510         * xmenu.c (Fx_popup_dialog): Likewise.
4511         * w32menu.c (Fx_popup_dialog): Likewise.
4513 2012-07-11  Glenn Morris  <rgm@gnu.org>
4515         * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4516         since nothing has defined it on these platforms.
4518         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4519         * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4521         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4522         * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4523         Move CLASH_DETECTION to configure.
4525         * s/gnu.h: Remove file, which is now empty.
4527         * s/gnu.h, s/gnu-linux.h:
4528         Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4530 2012-07-11  John Wiegley  <johnw@newartisans.com>
4532         * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4533         function attribute, so we only use it if it exists in the
4534         compiler.
4536 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
4538         Avoid call to strlen in fast_c_string_match_ignore_case.
4539         * search.c (fast_c_string_match_ignore_case): Change to use
4540         length argument.  Adjust users accordingly.
4541         * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4543 2012-07-11  Paul Eggert  <eggert@cs.ucla.edu>
4545         Assume mkdir, rmdir.
4546         * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4547         * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4549         Assume rename.
4550         * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4552         Assume perror.
4553         * s/hpux10-20.h (HAVE_PERROR): Remove.
4554         * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4555         Remove dummy definition, as this problem was obsolete long ago.
4557         Assume strerror.
4558         * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4560 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
4562         Avoid calls to strlen in font processing functions.
4563         * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
4564         (font_open_by_name): Change to use length argument.
4565         Adjust users accordingly.
4566         * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4567         Adjust prototypes.
4568         * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4569         Change to return ptrdiff_t.
4570         (xfont_list_pattern, xfont_match): Use length returned by
4571         xfont_decode_coding_xlfd.
4572         * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4574 2012-07-11  Glenn Morris  <rgm@gnu.org>
4576         * s/darwin.h, s/freebsd.h, s/netbsd.h:
4577         Move DONT_REOPEN_PTY to configure.
4579         * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4580         * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4582 2012-07-10  Paul Eggert  <eggert@cs.ucla.edu>
4584         Remove "#define unix" that is no longer needed (Bug#11905).
4585         * s/aix4-2.h (unix): Remove; no longer needed.
4587         EMACS_TIME simplification (Bug#11875).
4588         This replaces macros (which typically do not work in GDB)
4589         with functions, typedefs and enums, making the code easier to debug.
4590         The functional style also makes code easier to read and maintain.
4591         * systime.h: Include <sys/time.h> on all hosts, not just if
4592         WINDOWSNT, since 'struct timeval' is needed in general.
4593         (EMACS_TIME): Now a typedef, not a macro.
4594         (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4595         not macros.
4596         (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4597         (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4598         (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4599         (EMACS_TIME_LE): Now functions, not macros.
4600         (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4601         (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4602         which are not functions.  All uses rewritten to use:
4603         (make_emacs_time): New function.
4604         (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4605         (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4606         not functions.  All uses rewritten to use the following, respectively:
4607         (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4608         (add_emacs_time, sub_emacs_time): New functions.
4609         * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
4610         * fileio.c (Fcopy_file):
4611         * xterm.c (XTflash): Get the current time closer to when it's used.
4612         * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4614         * bytecode.c (targets): Suppress -Woverride-init warnings.
4616         Simplify by avoiding confusing use of strncpy etc.
4617         * doc.c (Fsnarf_documentation):
4618         * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4619         * frame.c (Fmake_terminal_frame):
4620         * gtkutil.c (get_utf8_string):
4621         * lread.c (openp):
4622         * nsmenu.m (ns_update_menubar):
4623         * regex.c (regerror):
4624         Prefer memcpy to strncpy and strncat when either will do.
4625         * fileio.c (Fsubstitute_in_file_name):
4626         * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4627         (menu_separator_name_p):
4628         * nsmenu.m (ns_update_menubar):
4629         Prefer memcmp to strncmp when either will do.
4630         * nsterm.m: Include <ftoastr.h>.
4631         (ns_get_color):
4632         * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4633         Prefer snprintf to strncpy.
4634         * nsterm.m (ns_term_init):
4635         * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
4636         * nsterm.m (ns_term_init):
4637         Avoid the need for strncpy, by using build_string or
4638         make_unibyte_string directly.  Use dtoastr, not snprintf.
4639         * process.c (Fmake_network_process): Diagnose service names that
4640         are too long, rather than silently truncating them or creating
4641         non-null-terminated names.
4642         (Fnetwork_interface_info): Likewise, for interface names.
4643         * sysdep.c (system_process_attributes) [GNU_LINUX]:
4644         Prefer sprintf to strncat.
4645         * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
4646         Prefer vsnprintf to vsprintf + strncpy.
4648 2012-07-10  Glenn Morris  <rgm@gnu.org>
4650         * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
4651         Clarify fallback case.
4653 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
4655         Use XCAR and XCDR instead of Fcar and Fcdr where possible.
4656         * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
4657         * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
4658         * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
4659         where argument type is known to be a Lisp_Cons.
4661 2012-07-10  Tom Tromey  <tromey@redhat.com>
4663         * bytecode.c (BYTE_CODE_THREADED): New macro.
4664         (BYTE_CODES): New macro.  Replaces all old byte-code defines.
4665         (enum byte_code_op): New type.
4666         (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4667         (exec_byte_code): Use them.  Use token threading when applicable.
4669 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
4671         Optimize pure C strings initialization.
4672         * lisp.h (make_pure_string): Fix prototype.
4673         (build_pure_c_string): New function, defined as static inline.  This
4674         provides a better opportunity to optimize away calls to strlen when
4675         the function is called with compile-time constant argument.
4676         * alloc.c (make_pure_c_string): Fix comment.  Change to add nchars
4677         argument, adjust users accordingly.  Use build_pure_c_string where
4678         appropriate.
4679         * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4680         * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4681         * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4683 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
4685         Avoid calls to strlen in miscellaneous functions.
4686         * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4687         * font.c (Ffont_xlfd_name): Likewise.  Change to call make_string.
4688         * lread.c (openp): Likewise.
4690 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
4692         Avoid calls to strlen in path processing functions.
4693         * fileio.c (file_name_as_directory): Add comment.  Change to add
4694         srclen argument and return the length of result.  Adjust users
4695         accordingly.
4696         (directory_file_name): Fix comment.  Change to add srclen argument,
4697         swap 1st and 2nd arguments to obey the common convention.
4698         Adjust users accordingly.
4699         * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4701 2012-07-10  Glenn Morris  <rgm@gnu.org>
4703         * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4704         Move PENDING_OUTPUT_COUNT definition to configure.
4706         * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4707         * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4708         * s/gnu.h (DATA_START): Move definitions to configure.
4710         * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4711         We include usg5-4-common.h, which defines them both.
4713         * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4714         O_RDONLY already includes it).
4716         Stop ns builds setting the EMACSLOADPATH environment variable.
4717         * nsterm.m (ns_load_path): Rename from ns_init_paths.
4718         Now it does not set EMACSLOADPATH, just returns the load-path string.
4719         * nsterm.h: Update accordingly.
4720         * lread.c [HAVE_NS]: Include nsterm.h.
4721         (init_lread) [HAVE_NS]: Use ns_load_path.
4722         * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4724 2012-07-09  Glenn Morris  <rgm@gnu.org>
4726         * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4727         since the included bsd-common.h does so.
4729         Stop ns builds setting the EMACSPATH environment variable.
4730         * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4731         (ns_init_paths): Do not set EMACSPATH.
4732         * nsterm.h (ns_exec_path): Add it.
4733         * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4734         Use ns_exec_path.
4736         * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4738 2012-07-09  Paul Eggert  <eggert@cs.ucla.edu>
4740         * process.c (wait_reading_process_output): 'waitchannels' was unset
4741         when read_kbd || !NILP (wait_for_cell); fix this.
4743         Add GCC-style 'const' attribute to functions that can use it.
4744         * character.h (char_resolve_modifier_mask):
4745         * keyboard.h (make_ctrl_char):
4746         * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
4747         (init_character_once, next_almost_prime, init_fns, init_image)
4748         (flush_pending_output, init_sound):
4749         * mem-limits.h (start_of_data):
4750         * menu.h (finish_menu_items):
4751         Add ATTRIBUTE_CONST.
4752         * emacs.c (DEFINE_DUMMY_FUNCTION):
4753         Declare the dummy function with ATTRIBUTE_CONST.
4754         * lisp.h (Fbyteorder, Fmax_char, Fidentity):
4755         Add decls with ATTRIBUTE_CONST.
4757         Minor improvements to make_formatted_string.
4758         * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
4759         where int is good enough, as vsprintf returns an int.
4760         * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
4762 2012-07-09  Dmitry Antipov  <dmantipov@yandex.ru>
4764         Use make_formatted_string to avoid double length calculation.
4765         * lisp.h (make_formatted_string): New prototype.
4766         * alloc.c (make_formatted_string): New function.
4767         * buffer.c (Fgenerate_new_buffer_name): Use it.
4768         * dbus.c (syms_of_dbusbind): Likewise.
4769         * editfns.c (Fcurrent_time_zone): Likewise.
4770         * filelock.c (get_boot_time): Likewise.
4771         * frame.c (make_terminal_frame, set_term_frame_name)
4772         (x_report_frame_params): Likewise.
4773         * image.c (gs_load): Likewise.
4774         * minibuf.c (get_minibuffer): Likewise.
4775         * msdos.c (dos_set_window_size): Likewise.
4776         * process.c (make_process): Likewise.
4777         * xdisp.c (ensure_echo_area_buffers): Likewise.
4778         * xsettings.c (apply_xft_settings): Likewise.
4780 2012-07-09  Glenn Morris  <rgm@gnu.org>
4782         Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
4783         * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
4784         (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
4785         * nsterm.h (ns_etc_directory): Add it.
4786         * callproc.c [HAVE_NS]: Include nsterm.h.
4787         (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
4789 2012-07-09  Dmitry Antipov  <dmantipov@yandex.ru>
4791         Move marker debugging code under MARKER_DEBUG.
4792         * marker.c (MARKER_DEBUG): Move marker debugging code under
4793         #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
4794         for bootstrap with --enable-checking (~3x slowdown reported
4795         by Juanma Barranquero <lekktu@gmail.com>).
4796         (verify_bytepos): Move under #ifdef MARKER_DEBUG.
4798 2012-07-08  Paul Eggert  <eggert@cs.ucla.edu>
4800         * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
4801         See <http://bugs.gnu.org/11825#29>.
4803 2012-07-08  Eli Zaretskii  <eliz@gnu.org>
4805         * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4806         has no font, use the frame's font.  (Bug#11813)
4807         (display_line): Add commentary about displaying truncation glyphs
4808         on GUI frames.
4809         (produce_special_glyphs): Move here from term.c.
4811         * term.c (produce_special_glyphs): Move to xdisp.c.
4813         * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
4814         section.
4816 2012-07-07  Andreas Schwab  <schwab@linux-m68k.org>
4818         * xdisp.c (display_line): Avoid warning about implicit declaration
4819         of FRAME_FONT.
4821         * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
4823         * lisp.h: Remove empty conditional.
4825 2012-07-07  Paul Eggert  <eggert@cs.ucla.edu>
4827         * lread.c (load_path_check): Now static.
4829         Fix some minor --with-ns problems found by static checking.
4830         * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
4831         (x_set_font) [!HAVE_X_WINDOWS]:
4832         * image.c (xpm_load_image) [HAVE_NS]:
4833         (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
4834         (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
4835         Remove unused local.
4836         (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
4837         (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
4838         * image.c (x_create_bitmap_from_file) [HAVE_NS]:
4839         (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
4840         * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
4841         * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
4842         Fix pointer signedness problem.
4843         * xfaces.c (FRAME_X_FONT_TABLE):
4844         * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
4846 2012-07-07  Glenn Morris  <rgm@gnu.org>
4848         * lread.c (load_path_check): New function, split from init_lread.
4849         (init_lread): Reorganize.  Motivation:
4850         If EMACSLOADPATH is set, check/warn about that rather than the
4851         defaults, which we are not going to use.  Hence we can remove
4852         the turn_off_warning and WINDOWSNT || HAVE_NS tests.
4853         Don't warn if site-lisp directories are missing.
4854         If not installed, start from a blank load-path, since
4855         PATH_LOADSEARCH refers to the eventual installation directories.
4857 2012-07-07  Eli Zaretskii  <eliz@gnu.org>
4859         Support truncation and continuation glyphs on GUI frames, when
4860         fringes are disabled.  (Bug#11832)
4861         * xdisp.c (init_iterator): Get dimensions of truncation and
4862         continuation glyphs even if on GUI frames.
4863         Adjust it->last_visible_x on GUI frames when the left or right fringes,
4864         or both, are absent.
4865         (start_display, move_it_in_display_line_to): Handle the case of a
4866         GUI frame without a fringe to display continuation or truncation
4867         glyphs.
4868         (insert_left_trunc_glyphs): Support GUI frames: make sure
4869         truncation glyphs overwrite enough glyphs from the current line to
4870         have sufficient space in pixels.
4871         (display_line): Support truncation and continuation glyphs on GUI
4872         frames.  If some spare pixels are left on the line after inserting
4873         the truncation glyphs, fill that space with a stretch glyph of a
4874         suitably computed width.
4876         * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
4877         produce_glyphs, to support GUI sessions.
4879 2012-07-07  Paul Eggert  <eggert@cs.ucla.edu>
4881         * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
4883         * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
4885         Do not require float-time's arg to fit in time_t (Bug#11825).
4886         This works better on hosts where time_t is unsigned, and where
4887         float-time is applied to the (negative) difference between two times.
4888         * editfns.c (decode_time_components): Last arg is now double *,
4889         not int *, and means to store all the result as a double, without
4890         worrying about whether the seconds part fits in time_t.
4891         All callers changed.
4892         (lisp_time_argument): Remove last int * arg, as it's no longer needed.
4893         All callers changed.
4894         (Ffloat_time): Do not fail merely because the specified time falls
4895         outside of time_t range.
4897 2012-07-07  Glenn Morris  <rgm@gnu.org>
4899         * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
4900         * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
4901         * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
4903 2012-07-07  Juanma Barranquero  <lekktu@gmail.com>
4905         * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
4906         Update dependencies.
4908         * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
4910 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
4912         Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
4913         * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
4914         * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
4915         * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
4916         * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
4917         * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
4919         * xfont.c (compare_font_names): Redo to omit the need for casts.
4921 2012-07-06  Andreas Schwab  <schwab@linux-m68k.org>
4923         * xfns.c (Fx_change_window_property): Doc fix.
4924         * w32fns.c (Fx_change_window_property): Doc fix.
4926         * w32fns.c (Fx_window_property): Accept the same arguments as the
4927         X Windows version.  Doc fix.
4928         * xfns.c (Fx_window_property): Doc fix.  (Bug#11870)
4930 2012-07-06  Juanma Barranquero  <lekktu@gmail.com>
4931             Eli Zaretskii  <eliz@gnu.org>
4933         * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
4934         Windows-specific code from nt/config.nt moved here.
4935         Obsolete settings removed.
4937 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
4939         * process.c: Avoid unnecessary calls to gettime.
4940         (wait_reading_process_output): Don't get the time of day
4941         when gobbling data immediately and not waiting, as there's no need
4942         for it in that case.  This removes a FIXME.
4944 2012-07-06  Jan Djärv  <jan.h.d@swipnet.se>
4946         * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
4947         is defined (Bug#11768).
4949 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
4951         Fix marker debugging code.
4952         * marker.c (byte_char_debug_check): Do not perform the check
4953         if buffer is not multibyte.
4954         (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4955         Call byte_char_debug_check with correct arguments.
4957 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
4959         Compile marker debugging code only if ENABLE_CHECKING is defined.
4960         * marker.c (byte_char_debug_check, count_markers):
4961         Use only if ENABLE_CHECKING is defined.
4962         (byte_debug_flag): Remove.
4963         (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4964         Always call byte_char_debug_check if ENABLE_CHECKING is defined.
4966 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
4968         Avoid code repetition in marker-related functions.
4969         * marker.c (attach_marker): New function.
4970         (Fset_marker, set_marker_restricted, set_marker_both)
4971         (set_marker_restricted_both): Use it.
4972         (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
4973         Consistently rename charno to charpos.
4974         (marker_position): Add eassert.
4975         (marker_byte_position): Convert to eassert.
4977 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
4979         Simplify list operations in unchain_overlay and unchain_marker.
4980         * buffer.c (unchain_overlay): Simplify.  Add comment.
4981         * marker.c (unchain_marker): Simplify.  Fix comments.
4983 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
4985         Introduce fast path for the widely used marker operation.
4986         * alloc.c (build_marker): New function.
4987         * lisp.h (build_marker): New prototype.
4988         * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
4989         * composite.c (autocmp_chars): Likewise.
4990         * editfns.c (buildmark): Remove.
4991         (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
4992         (save_restriction_save): Use build_marker.
4993         * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
4994         * window.c (save_window_save): Likewise.
4996 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
4998         Do not use Fdelete_overlay in delete_all_overlays
4999         to avoid redundant calls to unchain_overlay.
5000         * buffer.c (drop_overlay): New function.
5001         (delete_all_overlays, Fdelete_overlay): Use it.
5002         * minibuf.c (get_minibuffer): Fix comment.
5004 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
5006         Port to OpenBSD 5.1 amd64.
5007         * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5008         This is needed for OpenBSD, and should be harmless on all BSD systems.
5009         Also, include <sys/sysctl.h>, as it should be available on all
5010         BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5011         (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5012         use p_pid member, not kp_proc.pid.
5014 2012-07-06  Glenn Morris  <rgm@gnu.org>
5016         * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5018 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
5020         More xmalloc and related cleanup.
5021         * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5022         * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5023         * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5024         * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5025         * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5026         * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5027         * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5028         * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5029         * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5030         * xterm.c:
5031         Omit needless casts involving void * pointers and allocation.
5032         Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5033         as the former is more robust if P's type is changed.
5034         Prefer xzalloc to xmalloc + memset 0.
5035         Simplify malloc-or-realloc to realloc.
5036         Don't worry about xmalloc returning a null pointer.
5037         Prefer xstrdup to xmalloc + strcpy.
5038         * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5039         growing it.
5040         * keyboard.c (apply_modifiers_uncached): Prefer local array to
5041         alloca of a constant.
5043 2012-07-05  Eli Zaretskii  <eliz@gnu.org>
5045         * xdisp.c (display_line): Fix horizontal pixel coordinates when
5046         hscroll is larger than the line width.  Fixes long and futile
5047         looping inside extend_face_to_end_of_line (on a TTY) producing
5048         glyphs that are not needed and thrown away.
5050 2012-07-05  Dmitry Antipov  <dmantipov@yandex.ru>
5052         * marker.c (set_marker_restricted_both): Simplify by using
5053         clip_to_bounds.
5055 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
5057         * editfns.c (region_limit): Simplify by using clip_to_bounds.
5059 2012-07-05  Jan Djärv  <jan.h.d@swipnet.se>
5061         * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5062         not defined (Bug#11768).
5063         (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5064         (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5065         (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5066         followed by gtk_box_set_homogeneous (Bug#11768).
5067         (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
5068         (update_theme_scrollbar_width, xg_create_scroll_bar):
5069         Use gtk_scrollbar_new (Bug#11768).
5070         (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5071         (is_box_type): New function (Bug#11768).
5072         (xg_tool_item_stale_p): Call is_box_type.
5073         (xg_initialize): Get settings by calling gtk_settings_get_for_screen
5074         with default display (Bug#11768).
5076 2012-07-05  Eli Zaretskii  <eliz@gnu.org>
5078         * xdisp.c (window_hscroll_limited): New function.
5079         (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5080         coordinates when window's hscroll is set to insanely large
5081         values.  (Bug#11857)
5083 2012-07-05  Juanma Barranquero  <lekktu@gmail.com>
5085         * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5086         ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5088 2012-07-05  Dmitry Antipov  <dmantipov@yandex.ru>
5090         Cleanup xmalloc.
5091         * lisp.h (xzalloc): New prototype.  Omit needless casts.
5092         * alloc.c (xzalloc): New function.  Omit needless casts.
5093         * charset.c: Omit needless casts.  Convert all calls to
5094         xmalloc with following memset to xzalloc.
5095         * dispnew.c: Likewise.
5096         * fringe.c: Likewise.
5097         * image.c: Likewise.
5098         * sound.c: Likewise.
5099         * term.c: Likewise.
5100         * w32fns.c: Likewise.
5101         * w32font.c: Likewise.
5102         * w32term.c: Likewise.
5103         * xfaces.c: Likewise.
5104         * xfns.c: Likewise.
5105         * xterm.c: Likewise.
5106         * atimer.c: Omit needless casts.
5107         * buffer.c: Likewise.
5108         * callproc.c: Likewise.
5109         * ccl.c: Likewise.
5110         * coding.c: Likewise.
5111         * composite.c: Likewise.
5112         * doc.c: Likewise.
5113         * doprnt.c: Likewise.
5114         * editfns.c: Likewise.
5115         * emacs.c: Likewise.
5116         * eval.c: Likewise.
5117         * filelock.c: Likewise.
5118         * fns.c: Likewise.
5119         * gtkutil.c: Likewise.
5120         * keyboard.c: Likewise.
5121         * lisp.h: Likewise.
5122         * lread.c: Likewise.
5123         * minibuf.c: Likewise.
5124         * msdos.c: Likewise.
5125         * print.c: Likewise.
5126         * process.c: Likewise.
5127         * region-cache.c: Likewise.
5128         * search.c: Likewise.
5129         * sysdep.c: Likewise.
5130         * termcap.c: Likewise.
5131         * terminal.c: Likewise.
5132         * tparam.c: Likewise.
5133         * w16select.c: Likewise.
5134         * w32.c: Likewise.
5135         * w32reg.c: Likewise.
5136         * w32select.c: Likewise.
5137         * w32uniscribe.c: Likewise.
5138         * widget.c: Likewise.
5139         * xdisp.c: Likewise.
5140         * xmenu.c: Likewise.
5141         * xrdb.c: Likewise.
5142         * xselect.c: Likewise.
5144 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
5146         * fileio.c (time_error_value): Check the right error number.
5147         Problem reported by Troels Nielsen in
5148         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5150 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
5152         * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5153         This should be fixed in a better way; see Eli Zaretskii in
5154         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5155         (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5157         * fileio.c (time_error_value): Rename from special_mtime.
5158         The old name's problems were noted by Eli Zaretskii in
5159         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5161         * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5162         This variable's comment says Emacs needs at least one GDB-visible
5163         symbol of type enum pvec_type, to work around GDB problems.
5164         The symbol's value doesn't matter.
5166         * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5167         that causes compilation to fail on pre-C99 compilers.
5169 2012-07-04  Juanma Barranquero  <lekktu@gmail.com>
5171         * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5172         (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5174 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
5176         * buffer.c (init_buffer_once): Fix initialization of
5177         headers for buffer_defaults and buffer_local_symbols.
5178         Reported by Juanma Barranquero <lekktu@gmail.com>.
5180 2012-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
5182         Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5183         * lisp.h (enum pvec_type): Use fewer bits.
5184         (PSEUDOVECTOR_SIZE_BITS): New constant.
5185         (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5186         (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5187         change in pvec_type.
5188         (PSEUDOVECTOR_TYPEP): New macro.
5189         (TYPED_PSEUDOVECTORP): Use it.
5190         * fns.c (internal_equal): Adapt code to extract pvectype.
5191         * emacs.c (gdb_pvec_type): Update type.
5192         * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5193         (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5194         (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5195         (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5196         (sweep_vectors): Use it.  Use local var `total_bytes' instead of
5197         abusing vector->header.next.nbytes.
5198         (live_vector_p): Use PVEC_TYPE.
5199         (mark_object): Adapt code to extract pvectype.  Use switch.
5201 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
5203         * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5204         Tighten new eassert a bit.
5206 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
5208         Fix compilation with --enable-gcc-warnings and -O1
5209         optimization level.
5210         * doprnt.c (doprnt): Change type of tem to int, initialize
5211         to avoid compiler warning.  Add eassert.
5212         * search.c (simple_search): Initialize match_byte to avoid
5213         compiler warning.  Add eassert.
5215 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
5217         Avoid weird behavior with large horizontal scrolls.
5218         Without this change, for example, large hscroll values would
5219         mess up Emacs's display on Fedora 15 x86, presumably due to
5220         overflows in int calculations in the display code.
5221         Also, if buffers had long lines, Emacs would freeze.
5222         * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5223         (set_window_hscroll): New function, containing the old guts of
5224         Fset_window_hscroll.  Return the clipped value.
5225         (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5226         This avoids the need to check against PTRDIFF_MAX.
5228         * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5230 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
5232         * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5234 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
5236         * regex.c: Suppress GCC warning on RHEL 6.  (Bug#11207)
5237         Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5238         since GCC 4.4.6 issues a bogus warning for them.
5240         Fix bugs in file timestamp newness comparisons.
5241         * fileio.c (Ffile_newer_than_file_p):
5242         * lread.c (Fload): Use full timestamp resolution of files,
5243         not just the 1-second resolution, so that files that are only
5244         slightly newer still count as newer.
5245         * fileio.c (Ffile_newer_than_file_p): Don't assume file
5246         timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5248 2012-07-03  Paul Eggert  <eggert@cs.ucla.edu>
5250         * fileio.c: Improve handling of file time marker.  (Bug#11852)
5251         (special_mtime): New function.
5252         (Finsert_file_contents, Fverify_visited_file_modtime):
5253         Use it to set special mtime values consistently.
5255 2012-07-03  Andreas Schwab  <schwab@linux-m68k.org>
5257         * fileio.c (Finsert_file_contents): Properly handle st_mtime
5258         marker for non-existing file.  (Bug#11852)
5260 2012-07-03  Glenn Morris  <rgm@gnu.org>
5262         * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5263         and did not make it into globals.h).
5265 2012-07-03  Tom Tromey  <tromey@redhat.com>
5267         * window.c (Fset_window_margins, Fset_window_fringes)
5268         (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5269         * textprop.c (Fprevious_property_change): No longer static.
5270         * syntax.c (Fsyntax_table_p): No longer static.
5271         * process.c (Fget_process, Fprocess_datagram_address): No longer
5272         static.
5273         * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5274         * keyboard.c (Fcommand_execute): No longer static.
5275         Remove EXFUN.
5276         * insdel.c (Fcombine_after_change_execute): No longer static.
5277         * image.c (Finit_image_library): No longer static.
5278         * fileio.c (Fmake_symbolic_link): No longer static.
5279         * eval.c (Ffetch_bytecode): No longer static.
5280         * editfns.c (Fuser_full_name): No longer static.
5281         * doc.c (Fdocumentation_property, Fsnarf_documentation):
5282         No longer static.
5283         * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5284         static.
5285         * dired.c (Ffile_attributes): No longer static.
5286         * composite.c (Fcomposition_get_gstring): No longer static.
5287         * callproc.c (Fgetenv_internal): No longer static.
5289         * ccl.h: Remove EXFUNs.
5290         * buffer.h: Remove EXFUNs.
5291         * dispextern.h: Remove EXFUNs.
5292         * intervals.h: Remove EXFUNs.
5293         * fontset.h: Remove EXFUN.
5294         * font.h: Remove EXFUNs.
5295         * dosfns.c (system_process_attributes): Remove EXFUN.
5296         * keymap.h: Remove EXFUNs.
5297         * lisp.h: Remove EXFUNs.
5298         * w32term.h: Remove EXFUNs.
5299         * window.h: Remove EXFUNs.
5300         * xsettings.h: Remove EXFUN.
5301         * xterm.h: Remove EXFUN.
5303 2012-07-03  Glenn Morris  <rgm@gnu.org>
5305         * lisp.h (Frandom): Make it visible to C.
5306         * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5307         buffer for invisible buffers.  (Bug#1229)
5309 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
5311         Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5312         values which aren't power of 2.
5313         * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5314         Verify it's value and the value of VECTOR_BLOCK_SIZE.  Adjust users
5315         accordingly.
5317 2012-07-03  Stefan Monnier  <monnier@iro.umontreal.ca>
5319         * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5321         * alloc.c (mark_object): Revert part of last patch to use `switch'.
5323 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
5325         * alloc.c (allocate_vector_block): Remove redundant
5326         calls to mallopt if DOUG_LEA_MALLOC is defined.
5327         (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5328         avoid calls to mallopt if zero_vector is returned.
5330 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
5332         * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5333         is enabled, avoid dereferencing NULL current_sblock if
5334         running undumped.
5336 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
5338         Cleanup basic buffer management.
5339         * buffer.h (struct buffer): Change layout to use generic vector
5340         marking code.  Fix some comments.  Change type of 'clip_changed'
5341         to bitfield.  Remove unused #ifndef old.
5342         (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5343         (GET_OVERLAYS_AT): Fix indentation.
5344         (for_each_per_buffer_object_at): New macro.
5345         * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5346         (Fbuffer_local_variables): Use it.
5347         (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5348         * alloc.c (allocate_buffer): Adjust to match new layout of
5349         struct buffer.  Fix comment.
5350         (mark_overlay): New function.
5351         (mark_buffer): Use it.  Use mark_vectorlike to mark normal
5352         Lisp area of struct buffer.
5353         (mark_object): Use it.  Adjust marking of misc objects
5354         and related comments.
5356 2012-07-02  Paul Eggert  <eggert@cs.ucla.edu>
5358         * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5359         wrapper that is not needed because the wrapped code is a no-op (zero
5360         machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5361         This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5363 2012-07-02  Dmitry Antipov  <dmantipov@yandex.ru>
5365         * alloc.c (mark_buffer): Simplify.  Remove prototype.
5366         (mark_object): Add comment.  Reorganize marking of vector-like
5367         objects.  Use CHECK_LIVE for all vector-like objects except buffers
5368         and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5369         Avoid redundant calls to mark_vectorlike for bool vectors.
5371 2012-06-30  Glenn Morris  <rgm@gnu.org>
5373         * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5375         * epaths.in (PATH_SITELOADSEARCH): New.
5376         * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5377         This is rather than relying on --enable-locallisppath elements
5378         having "site-lisp" in their names.  (Bug#10208#25, 11658)
5380 2012-06-30  Eli Zaretskii  <eliz@gnu.org>
5382         * w32proc.c (sys_select): Accept and ignore one more argument.
5384         * w32.c (emacs_gnutls_pull): Call select with one more argument.
5386         * sysselect.h [DOS_NT]: Don't include sys/select.h.
5387         (pselect) [!MS_DOS]: Redirect to sys_select.
5389         * sysdep.c: Don't include dos.h and dosfns.h.
5391         * process.c (sys_select):
5392         * msdos.c (sys_select): Accept one more argument and ignore it.
5394         * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5395         adapt data types and code to that.
5397         * dosfns.c:
5398         * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5399         which clashes with the gnulib function of the same name.
5401 2012-06-30  Andreas Schwab  <schwab@linux-m68k.org>
5403         * font.c (font_style_to_value, font_style_symbolic)
5404         (font_prop_validate_style): Add type checks for values in
5405         font_style_table.
5407         * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5408         argument.
5409         * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5410         uses.
5412 2012-06-29  Eli Zaretskii  <eliz@gnu.org>
5414         * xdisp.c (try_window_id): Undo last change.
5416         * w32.c (getwd): Adjust commentary about startup_dir.
5417         (init_environment): Always call sys_access, even in non-MSVC
5418         builds.  Don't chdir to the directory of the Emacs executable.
5419         This undoes code from 1997 which was justified by the need to
5420         "avoid conflicts when removing and renaming directories".  But its
5421         downside was that every relative file name was being interpreted
5422         relative to the directory of the Emacs executable, which can never
5423         be TRT.  In particular, it broke sys_access when called with
5424         relative file names.
5425         (sys_access): Map GetLastError to errno.
5427 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
5429         * window.h (struct window): Change type of 'fringes_outside_margins'
5430         to bitfield.  Fix comment.  Adjust users accordingly.
5431         (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
5432         Adjust comment.
5433         * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5434         to ptrdiff_t.
5436 2012-06-29  Andreas Schwab  <schwab@linux-m68k.org>
5438         * gnutls.c (emacs_gnutls_handshake):
5439         Add QUIT to make the loop interruptible.
5441 2012-06-29  Glenn Morris  <rgm@gnu.org>
5443         * charset.c (init_charset): Make lack of etc/charsets fatal.
5445 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
5447         * editfns.c (region_limit): Fix type mismatch.
5449 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
5451         * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5452         undefined.  Convert from xassert to eassert.
5453         * nsmenu.m: Convert from xassert to eassert.
5454         * nsterm.m: Likewise.
5456 2012-06-28  Stefan Monnier  <monnier@iro.umontreal.ca>
5458         * editfns.c (region_limit): Clip to narrowing (bug#11770).
5460 2012-06-28  Paul Eggert  <eggert@cs.ucla.edu>
5462         Avoid integer overflow on scroll-left and scroll-right.
5463         * window.c (HSCROLL_MAX): New macro.
5464         (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5465         overflow when requested scroll falls outside ptrdiff_t range.
5467 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
5469         * window.h (struct window): Change type of 'hscroll',
5470         'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5471         'last_modified' and 'last_overlay_modified' to EMACS_INT.
5472         Adjust users accordingly.
5473         * xdisp.c (try_cursor_movement): Replace type check with eassert.
5474         * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5475         from EMACS_INT to ptrdiff_t.
5476         (make_window): Omit redundant initialization.
5478 2012-06-28  Juanma Barranquero  <lekktu@gmail.com>
5480         * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5482 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
5484         * window.h (struct window): Change type of 'use_time' and
5485         'sequence_number' from Lisp_Object to int.
5486         * frame.c (make_frame): Adjust users accordingly.
5487         * print.c (print_object): Likewise.
5488         * window.c (select_window, Fwindow_use_time, make_parent_window)
5489         (make_window): Likewise.
5491 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
5493         * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5494         enabled with --enable-checking=[all,glyphs] configure option.
5495         Fix GLYPH_DEBUG usage assuming that it may be undefined,
5496         adjust comments accordingly.
5497         * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5498         undefined, adjust comments accordingly.
5499         * image.c: Likewise.
5500         * scroll.c: Likewise.
5501         * w32fns.c: Likewise.
5502         * w32term.c: Likewise.
5503         * xdisp.c: Likewise.
5504         * xfaces.c: Likewise.
5505         * xfns.c: Likewise.
5506         * xterm.c: Likewise.
5508 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
5510         Generalize run-time debugging checks.
5511         * dispextern.h (XASSERTS): Remove.
5512         * fontset.c (xassert): Remove.
5513         Convert from xassert to eassert.
5514         * alloc.c: Convert from xassert to eassert.
5515         * bidi.c: Likewise.
5516         * dispnew.c: Likewise.
5517         * fns.c: Likewise.
5518         * fringe.c: Likewise.
5519         * ftfont.c: Likewise.
5520         * gtkutil.c: Likewise.
5521         * image.c: Likewise.
5522         * keyboard.c: Likewise.
5523         * menu.c: Likewise.
5524         * process.c: Likewise.
5525         * scroll.c: Likewise.
5526         * sound.c: Likewise.
5527         * term.c: Likewise.
5528         * w32console.c: Likewise.
5529         * w32fns.c: Likewise.
5530         * w32term.c: Likewise.
5531         * window.c: Likewise.
5532         * xdisp.c: Likewise.
5533         * xfaces.c: Likewise.
5534         * xfns.c: Likewise.
5535         * xselect.c: Likewise.
5536         * xterm.c: Likewise.
5538 2012-06-27  Stefan Monnier  <monnier@iro.umontreal.ca>
5540         * fns.c (maybe_resize_hash_table): Output message when growing the
5541         purify-hashtable.
5543 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
5545         * alloc.c (allocate_string_data): Remove dead code.
5546         * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5547         avoid GCC warning about unused macro.
5549 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
5551         * alloc.c (allocate_string): Omit intervals initialization.
5552         * alloc.c (make_uninit_multibyte_string): Initialize intervals
5553         as in make_pure_string and make_pure_c_string.
5555 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
5557         * alloc.c (allocate_string): Fix last change.
5559 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
5561         * alloc.c (allocate_string): Remove two redundant calls
5562         to memset, add explicit initialization where appropriate.
5564 2012-06-27  Glenn Morris  <rgm@gnu.org>
5566         * lisp.mk (lisp): Remove paths.elc.
5568 2012-06-27  Chong Yidong  <cyd@gnu.org>
5570         * doc.c (Fsubstitute_command_keys): Fix punctuation.
5572 2012-06-26  John Wiegley  <johnw@newartisans.com>
5574         * unexmacosx.c (copy_data_segment): Add two section names used
5575         on Mac OS X Lion: __mod_init_func and __mod_term_func.
5577         * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5578         when building with Clang.
5580 2012-06-26  Stefan Monnier  <monnier@iro.umontreal.ca>
5582         * eval.c (Fapply): Allow calling it with a single argument.
5584 2012-06-26  Eli Zaretskii  <eliz@gnu.org>
5586         * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5587         _stricmp and _strnicmp.
5588         (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5590 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
5592         * alloc.c (allocate_window): Zero out non-Lisp part of newly
5593         allocated window.
5594         (allocate_process): Likewise for new process.
5595         (allocate_terminal): Change to use offsetof.
5596         (allocate_frame): Likewise.
5597         * frame.c (make_frame): Omit redundant initialization.
5598         * window.c (make_parent_window): Use memset.
5599         (make_window): Omit redundant initialization.
5600         * process.c (make_process): Omit redundant initialization.
5601         * terminal.c (create_terminal): Likewise.
5603 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
5605         * term.c (delete_tty): Remove redundant call to memset.
5607 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
5609         * alloc.c: Remove build_string.
5610         * lisp.h: Define build_string as static inline.  This provides
5611         a better opportunity to optimize away calls to strlen when the
5612         function is called with compile-time constant argument.
5613         * image.c (imagemagick_error): Convert to build_string.
5614         * w32proc.c (sys_spawnve): Likewise.
5615         * xterm.c (x_term_init): Likewise.
5617 2012-06-26  Paul Eggert  <eggert@cs.ucla.edu>
5619         Use sprintf return value instead of invoking strlen on result.
5620         In the old days this wasn't portable, since some sprintf
5621         implementations returned char *.  But they died out years ago and
5622         Emacs already assumes sprintf returns int.
5623         Similarly for float_to_string.
5624         This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5625         * ccl.c (ccl_driver):
5626         * character.c (string_escape_byte8):
5627         * data.c (Fnumber_to_string):
5628         * doprnt.c (doprnt):
5629         * print.c (print_object):
5630         * xdisp.c (message_dolog):
5631         * xfns.c (syms_of_xfns):
5632         Use sprintf or float_to_string result to avoid need to call strlen.
5633         * data.c (Fnumber_to_string):
5634         Use make_unibyte_string, since the string must be ASCII.
5635         * lisp.h, print.c (float_to_string): Now returns int length.
5636         * term.c (produce_glyphless_glyph):
5637         Use sprintf result rather than recomputing it.
5639         Clean out last vestiges of the old HAVE_CONFIG_H stuff.
5640         * Makefile.in (ALL_CFLAGS):
5641         * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
5642         * gmalloc.c, regex.c: Include <config.h> unconditionally.
5644 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
5646         * dispextern.h (xstrcasecmp): Define to library function
5647         strcasecmp if available.
5648         * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
5650 2012-06-25  Andreas Schwab  <schwab@linux-m68k.org>
5652         * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
5653         Avoid comma operator.
5654         * menu.c (push_submenu_start, push_submenu_end)
5655         (push_left_right_boundary, push_menu_pane): Likewise.
5656         * msdos.c (dos_rawgetc): Likewise.
5658 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
5660         * xfns.c (xic_create_fontsetname): Remove redundant calls
5661         to memset.
5663 2012-06-25  Paul Eggert  <eggert@cs.ucla.edu>
5665         * gtkutil.c (get_utf8_string): Remove redundant assignment.
5666         sprintf already null-terminates its output.
5668         * xfns.c (x_window): Remove redundant cast.
5670 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
5672         * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5673         `const char *' to `char *' to avoid compiler warning.
5675 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
5677         * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5678         instead of truncating it to 63 (admittedly a generous limit).
5680         * process.c: Fix spelling and caps in comments.
5682 2012-06-24  Dan Nicolaescu  <dann@ics.uci.edu>
5684         * emacs.c (setpgrp): Remove definition, unused.
5685         * sysdep.c (setpgrp): Remove definition, not used in this file.
5687 2012-06-24  Juanma Barranquero  <lekktu@gmail.com>
5689         * makefile.w32-in: Update dependencies.
5691 2012-06-24  Eli Zaretskii  <eliz@gnu.org>
5693         * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5694         (SYSTIME_H): Add nt/inc/sys/time.h.
5696         * systime.h [WINDOWSNT]: Include sys/time.h.
5698         * s/ms-w32.h (struct timespec): Definition moved from
5699         nt/inc/sys/time.h.  Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5701 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
5703         Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5704         * buffer.h (buffer_slot_type_mismatch):
5705         * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5706         * eval.c (unwind_to_catch):
5707         * image.c (my_png_error, my_error_exit):
5708         * keyboard.c (quit_throw_to_read_char, user_error)
5709         (Fexit_recursive_edit, Fabort_recursive_edit):
5710         * lisp.h (die, args_out_of_range, args_out_of_range_3)
5711         (wrong_type_argument, buffer_overflow, __executable_start)
5712         (memory_full, buffer_memory_full, string_overflow, Fthrow)
5713         (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5714         (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5715         (fatal):
5716         (child_setup) [!DOS_NT]:
5717         * lread.c (end_of_file_error, invalid_syntax):
5718         * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5719         * puresize.h (pure_write_error):
5720         * search.c (matcher_overflow):
5721         * sound.c (sound_perror, alsa_sound_perror):
5722         * sysdep.c, syssignal.h (croak):
5723         * term.c (maybe_fatal, vfatal):
5724         * textprop.c (text_read_only):
5725         * undo.c (user_error):
5726         * unexmacosx.c (unexec_error):
5727         * xterm.c (x_ins_del_lines, x_delete_glyphs):
5728         Use _Noreturn rather than NO_RETURN.
5729         No need for separate decl merely because of _Noreturn.
5730         * sound.c (sound_warning, parse_sound):
5731         Remove unnecessary forward decls.
5733 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
5735         Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5736         * lisp.h (WAIT_READING_MAX): New macro.
5737         * dispnew.c (Fsleep_for, sit_for):
5738         * keyboard.c (kbd_buffer_get_event):
5739         * process.c (Faccept_process_output):
5740         Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5741         This improves on the previous patch, which introduced a bug
5742         when time_t is unsigned and as wide as intmax_t.
5743         See <http://bugs.gnu.org/9000#51>.
5745 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
5747         * dispnew.c (sit_for, Fsleep_for):
5748         * keyboard.c (kbd_buffer_get_event):
5749         * process.c (Faccept_process_output): Avoid compiler warnings when
5750         comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
5752 2012-06-23  Juanma Barranquero  <lekktu@gmail.com>
5754         * makefile.w32-in: Update dependencies.
5756         * w32.c (ltime): Add return type and declare static.
5757         (w32_get_internal_run_time): Remove usused variable `time_100ns'.
5759 2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
5761         * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
5762         Privately reported by Herbert J. Skuhra.
5763         (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
5764         All uses changed.
5765         (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
5766         not make_lisp_timeval, when the argument is of type EMACS_TIME.
5768 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
5770         * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
5771         last argument of make_unibyte_string.
5773         * keyboard.c (kbd_buffer_get_event): Include the codepage and the
5774         language ID in the event parameters.
5776         * w32term.c (w32_read_socket): Put the new keyboard codepage into
5777         event.code, not the obscure "character set ID".
5779 2012-06-23  Chong Yidong  <cyd@gnu.org>
5781         * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
5783 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
5785         Fix the MS-Windows build broken by revno 108687.
5786         * w32.c (fdutimens): New function.
5788         * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
5790         * s/ms-w32.h (pselect): Redirect to sys_select.
5792         * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
5794         * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
5795         in the logic of incrementing and decrementing the value of
5796         use_relocatable_buffers.
5798 2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
5800         * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
5801         Privately reported by Herbert J. Skuhra.
5802         [__FreeBSD__]: Remove "*/" typo after "#include".
5803         (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
5804         (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
5805         (TIMEVAL, system_process_attributes) [__FreeBSD__]:
5806         Don't assume EMACS_TIME and struct timeval are the same type.
5808 2012-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5810         Support higher-resolution time stamps (Bug#9000).
5811         The time stamps are only nanosecond-resolution at the C level,
5812         since that's the best that any real-world system supports now.
5813         But they are picosecond-resolution at the Lisp level, as that's
5814         easy, and leaves room for future OS improvements.
5816         * Makefile.in (LIB_CLOCK_GETTIME): New macro.
5817         (LIBES): Use it.
5819         * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
5820         Don't get current time unless it's needed.
5822         * atimer.c: Include <sys/time.h> unconditionally, since gnulib
5823         now provides it if it's absent.
5824         (start_atimer): Port to higher-res time stamps.
5825         Check for time stamp overflow.  Don't get current time more
5826         often than is needed.
5828         * buffer.h (struct buffer): Buffer modtime now has high resolution.
5829         Include systime.h, not time.h.
5830         (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
5832         * dired.c: Include stat-time.h.
5833         (Ffile-attributes): File times now have higher resolution.
5835         * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
5836         (struct image): Timestamp now has higher resolution.
5838         * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
5839         has at least microseconds now.  All uses removed.
5840         (update_frame, update_single_window, update_window, update_frame_1)
5841         (Fsleep_for, sit_for): Port to higher-resolution time stamps.
5842         (duration_to_sec_usec): Remove; no longer needed.
5844         * editfns.c (time_overflow): Now extern.
5845         (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
5846         (float-time, Fformat_time_string, Fcurrent_time_string)
5847         (Fcurrent_time_zone): Accept and generate higher-resolution
5848         time stamps.
5849         (make_time_tail, make_lisp_time, dissassemble_lisp_time)
5850         (decode_time_components, lisp_seconds_argument): New functions.
5851         (make_time): Now static.
5852         (lisp_time_argument): Now returns EMACS_TIME.  New arg ppsec.
5853         Report an error if the time is invalid, rather than having the caller
5854         do that.
5856         * fileio.c: Include <stat-time.h>
5857         (Fcopy_file): Copy higher-resolution time stamps.
5858         Prefer to set the time stamp via a file descriptor if that works.
5859         (Fset_file_times, Finsert_file_contents, Fwrite_region)
5860         (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
5861         (Fvisited_file_modtime, Fset_visited_file_modtime):
5862         Support higher-resolution time stamps.
5864         * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
5866         * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
5868         * image.c (prepare_image_for_display, clear_image_cache)
5869         (lookup_image): Port to higer-resolution time stamps.
5871         * keyboard.c (start_polling, bind_polling_period):
5872         Check for time stamp overflow.
5873         (read_char, kbd_buffer_get_event, timer_start_idle)
5874         (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
5875         (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
5876         Port to higher-resolution time stamps.  Do not assume time_t is signed.
5877         (decode_timer): New function.  Timers are now vectors of length 9,
5878         not 8, to accommodate the picosecond component.
5879         (timer_check_2): Use it.
5881         * nsterm.m (select_timeout, timeval_subtract): Remove.
5882         (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
5883         as they're a bit more accurate and handle overflow better.
5884         (ns_select): Change prototype to be compatible with pselect.
5885         (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
5886         * nsterm.h (ns_select): Adjust prototype.
5888         * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
5889         us-resolution time stamps.
5890         (sys_select): Use the new EMACS_TIME_SIGN macro instead.
5892         * lread.c (read_filtered_event): Port to ns-resolution time stamps.
5894         * lisp.h (time_overflow): New decl.
5895         (wait_reading_process_output): First arg is now intmax_t, not int,
5896         to accommodate larger waits.
5898         * process.h (struct Lisp_Process.read_output_delay):
5899         Now counts nanoseconds, not microseconds.
5900         * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
5901         EMACS_HAS_USECS.
5902         (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
5903         (wait_reading_process_output):
5904         Port to ns-resolution time stamps.
5905         (Faccept_process_output, wait_reading_process_output):
5906         Check for time stamp overflow.  Do not assume time_t is signed.
5907         (select_wrapper): Remove; we now use pselect.
5908         (Fprocess_attributes): Now generates ns-resolution time stamps.
5910         * sysdep.c: Include utimens.h.  Don't include utime.h
5911         or worry about struct utimbuf; gnulib does that for us now.
5912         (gettimeofday): Remove; gnulib provides a substitute.
5913         (make_timeval): New function.
5914         (set_file_times): Now sets ns-resolution time stamps.
5915         New arg FD; all uses changed.
5916         (time_from_jiffies, ltime_from_jiffies, get_up_time)
5917         (system_process_attributes):
5918         Now returns ns-resolution time stamp.  All uses changed.
5919         Check for time stamp overflow.
5921         * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
5922         provides a substitute now.
5924         * systime.h: Include timespec.h rather than sys/time.h and time.h,
5925         since it guarantees struct timespec.
5926         (EMACS_TIME): Now struct timespec, so that we can support
5927         ns-resolution time stamps.
5928         (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
5929         (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
5930         (EMACS_USECS): Remove.
5931         (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
5932         so multiply the arg by 1000 before storing it.
5933         (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
5934         New macros.
5935         (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
5936         Port to ns-resolution time stamps.
5937         (EMACS_TIME_NEG_P): Remove; replaced by....
5938         (EMACS_TIME_SIGN): New macro.
5939         (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
5940         (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
5941         (set_file_times, make_time, lisp_time_argument): Adjust signature.
5942         (make_timeval, make_lisp_time, decode_time_components): New decls.
5943         (EMACS_TIME_CMP): Remove; no longer used.  Plus, it was buggy, in
5944         that it mishandled time_t overflow.  You can't compare by subtracting!
5945         (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
5946         (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
5948         * term.c: Include <sys/time.h>.
5949         (timeval_to_Time): New function, for proper overflow wraparound.
5950         (term_mouse_position, term_mouse_click): Use it.
5952         * undo.c (record_first_change): Support higher-resolution time stamps
5953         in the undo buffer.
5954         (Fprimitive_undo): Use them when restoring time stamps.
5956         * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
5957         (w32_get_internal_run_time):
5958         Port to higher-resolution Emacs time stamps.
5959         (ltime): Now accepts single 64-bit integer, as that's more convenient
5960         for callers.
5962         * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
5964         * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
5965         for compatibility with pselect.  Support ns-resolution time stamps.
5967         * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
5969         * xselect.c (wait_for_property_change, x_get_foreign_selection):
5970         Check for time stamp overflow, and support ns-resolution time stamps.
5972         * xterm.c: Don't include sys/time.h; gnulib does that for us now.
5973         Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
5974         (timeval_subtract): Remove; no longer needed.
5975         (XTflash, XTring_bell, x_wait_for_event):
5976         Port to ns-resolution time stamps.  Don't assume time_t is signed.
5978 2012-06-22  Chong Yidong  <cyd@gnu.org>
5980         * xdisp.c (x_consider_frame_title): Revert last change.
5982 2012-06-22  Eli Zaretskii  <eliz@gnu.org>
5984         * alloc.c (NSTATICS): Enlarge to 0x650.  Otherwise, Emacs compiled
5985         with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
5986         aborts in staticpro during startup.  (Without -DBYTE_CODE_METER,
5987         staticidx goes up to 1597 out of 1600 = 0x640.)
5989 2012-06-20  Paul Eggert  <eggert@cs.ucla.edu>
5991         * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
5992         Otherwise, the umask might be mistakenly 0 while handling input signals.
5994 2012-06-19  Stefan Monnier  <monnier@iro.umontreal.ca>
5996         * minibuf.c (Fread_string): Bind minibuffer-completion-table.
5998 2012-06-19  Dmitry Antipov  <dmantipov@yandex.ru>
6000         * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6001         * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6002         * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6003         access to `contents' member of Lisp_Vector objects with AREF and ASET
6004         where appropriate.
6006 2012-06-19  Chong Yidong  <cyd@gnu.org>
6008         * frame.c (delete_frame): When selecting a frame on a different
6009         text terminal, do not alter the terminal's top-frame.
6011         * xdisp.c (format_mode_line_unwind_data): Record the target
6012         frame's selected window and its terminal's top-frame.
6013         (unwind_format_mode_line): Restore them.
6014         (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6015         Callers changed.
6016         (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6017         since tty frames can be explicitly named.
6018         (prepare_menu_bars): Likewise.
6020         * term.c (Ftty_top_frame): New function.
6022 2012-06-18  Paul Eggert  <eggert@cs.ucla.edu>
6024         Port byte-code-meter to modern targets.
6025         * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6026         !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG.  Problem with
6027         CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
6028         <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6029         (METER_1, METER_2): Simplify.
6031 2012-06-18  Stefan Monnier  <monnier@iro.umontreal.ca>
6033         * data.c (Fdefalias): Return `symbol' (bug#11686).
6035 2012-06-18  Martin Rudalics  <rudalics@gmx.at>
6037         * buffer.c (Fkill_buffer): Don't throw an error when the buffer
6038         gets killed during executing of this function (Bug#11665).
6039         Try to always return Qt when the buffer has been actually killed.
6040         (Vkill_buffer_query_functions): In doc-string say that functions
6041         run by this hook should not change the current buffer.
6043 2012-06-18  Paul Eggert  <eggert@cs.ucla.edu>
6045         Fix recently-introduced process.c problems found by static checking.
6046         * process.c (write_queue_push, write_queue_pop, send_process):
6047         Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6048         (write_queue_pop): Fix pointer signedness problem.
6049         (send_process): Remove unused local.
6051 2012-06-17  Chong Yidong  <cyd@gnu.org>
6053         * xdisp.c (redisplay_internal): No need to redisplay terminal
6054         frames that are not on top.
6056 2012-06-17  Troels Nielsen  <bn.troels@gmail.com>
6058         * process.c (make_process): Initialize write_queue.
6059         (write_queue_push, write_queue_pop): New functions.
6060         (send_process): Use them to maintain correct ordering of process
6061         writes (Bug#10815).
6063 2012-06-17  Paul Eggert  <eggert@cs.ucla.edu>
6065         * lisp.h (eassert): Assume C89 or later.
6066         This removes the need for CHECK.
6067         (CHECK): Remove.  Its comments about always evaluating its
6068         argument were confusing, as 'eassert' typically does not evaluate
6069         its argument.
6071         * coding.c (produce_chars): Use ptrdiff_t, not int.
6073         * xterm.c (x_draw_underwave): Check for integer overflow.
6074         This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6076 2012-06-17  Jan Djärv  <jan.h.d@swipnet.se>
6078         * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6079         referenced (Bug#11583).
6081 2012-06-16  Aurelien Aptel  <aurelien.aptel@gmail.com>
6083         Implement wave-style variant of underlining.
6084         * dispextern.h (face_underline_type): New enum.
6085         (face): Add field for underline type.
6086         * nsterm.m (ns_draw_underwave): New function.
6087         (ns_draw_text_decoration): Use it.
6088         * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6089         New functions.
6090         (x_draw_glyph_string): Use them.
6091         * xfaces.c (Qline, Qwave): New Lisp objects.
6092         (check_lface_attrs, merge_face_ref)
6093         (Finternal_set_lisp_face_attribute, realize_x_face):
6094         Handle wave-style underline face attributes.
6095         * xterm.c (x_draw_underwave): New function.
6096         (x_draw_glyph_string): Use it.
6098 2012-06-16  Juanma Barranquero  <lekktu@gmail.com>
6100         * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6101         ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6102         ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6103         ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6104         ($(BLD)/w32select.$(O)): Update dependencies.
6106 2012-06-16  Andreas Schwab  <schwab@linux-m68k.org>
6108         * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6109         (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6110         * character.c (_fetch_multibyte_char_p): Remove.
6111         * alloc.c: Include "character.h" before "buffer.h".
6112         * bidi.c: Likewise.
6113         * buffer.c: Likewise.
6114         * bytecode.c: Likewise.
6115         * callint.c: Likewise.
6116         * callproc.c: Likewise.
6117         * casefiddle.c: Likewise.
6118         * casetab.c: Likewise.
6119         * category.c: Likewise.
6120         * cmds.c: Likewise.
6121         * coding.c: Likewise.
6122         * composite.c: Likewise.
6123         * dired.c: Likewise.
6124         * dispnew.c: Likewise.
6125         * doc.c: Likewise.
6126         * dosfns.c: Likewise.
6127         * editfns.c: Likewise.
6128         * emacs.c: Likewise.
6129         * fileio.c: Likewise.
6130         * filelock.c: Likewise.
6131         * font.c: Likewise.
6132         * fontset.c: Likewise.
6133         * fringe.c: Likewise.
6134         * indent.c: Likewise.
6135         * insdel.c: Likewise.
6136         * intervals.c: Likewise.
6137         * keyboard.c: Likewise.
6138         * keymap.c: Likewise.
6139         * lread.c: Likewise.
6140         * macros.c: Likewise.
6141         * marker.c: Likewise.
6142         * minibuf.c: Likewise.
6143         * nsfns.m: Likewise.
6144         * nsmenu.m: Likewise.
6145         * print.c: Likewise.
6146         * process.c: Likewise.
6147         * regex.c: Likewise.
6148         * region-cache.c: Likewise.
6149         * search.c: Likewise.
6150         * syntax.c: Likewise.
6151         * term.c: Likewise.
6152         * textprop.c: Likewise.
6153         * undo.c: Likewise.
6154         * unexsol.c: Likewise.
6155         * w16select.c: Likewise.
6156         * w32fns.c: Likewise.
6157         * w32menu.c: Likewise.
6158         * window.c: Likewise.
6159         * xdisp.c: Likewise.
6160         * xfns.c: Likewise.
6161         * xmenu.c: Likewise.
6162         * xml.c: Likewise.
6163         * xselect.c: Likewise.
6165 2012-06-16  Eli Zaretskii  <eliz@gnu.org>
6167         * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6168         If all the glyphs of the glyph row came from strings, and we have no
6169         cursor positioning clues, put the cursor on the first glyph of the
6170         row.
6171         (handle_face_prop): Use chunk-relative overlay string index when
6172         indexing into it->string_overlays array.  (Bug#11653)
6173         (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6174         the rightmost.  (Bug#11720)
6176 2012-06-16  Andreas Schwab  <schwab@linux-m68k.org>
6178         * category.h (CHAR_HAS_CATEGORY): Define as inline.
6179         (CATEGORY_MEMBER): Enforce 1/0 value.
6180         * category.c (_temp_category_set): Remove.
6182 2012-06-16  Eli Zaretskii  <eliz@gnu.org>
6184         * window.c (Fdelete_other_windows_internal)
6185         (Fdelete_window_internal): Don't access frame's mouse highlight
6186         info of the initial frame.  (Bug#11677)
6188 2012-06-14  Paul Eggert  <eggert@cs.ucla.edu>
6190         * .gdbinit (xgetint): Fix recently-introduced paren typo.
6191         Assume USE_2_TAGS_FOR_INTS.
6192         (xreload): Adjust $tagmask width to match recent lisp.h change.
6194         Simplify lisp.h in minor ways that should not affect code.
6195         * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6196         (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6197         (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6198         Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6199         (INTTYPEBITS): New macro, for clarity.
6200         (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
6201         (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6202         Simplify now that USE_LSB_TAG is always defined.
6203         (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6204         (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6206 2012-06-13  Juanma Barranquero  <lekktu@gmail.com>
6208         * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6210 2012-06-13  Glenn Morris  <rgm@gnu.org>
6212         * s/bsd-common.h (BSD4_3):
6213         * s/usg5-4-common.h (USG5_4): No longer define; unused.
6215 2012-06-13  Andreas Schwab  <schwab@linux-m68k.org>
6217         * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6218         instead of union.
6219         (XLI, XIL): Define.
6220         (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6221         Use them.
6222         * emacs.c (gdb_use_struct): Rename from gdb_use_union.
6223         * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
6224         * alloc.c (widen_to_Lisp_Object): Remove.
6225         (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6226         * frame.c (delete_frame): Remove outdated comment.
6227         * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6228         USE_LISP_UNION_TYPE.
6229         (Fw32_unregister_hot_key): Likewise.
6230         (Fw32_toggle_lock_key): Likewise.
6231         * w32menu.c (add_menu_item): Likewise.
6232         (w32_menu_display_help): Use XIL instead of checking
6233         USE_LISP_UNION_TYPE.
6234         * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6235         (init_heap): Likewise.
6236         * w32term.c (w32_read_socket): Update comment.
6238 2012-06-13  Glenn Morris  <rgm@gnu.org>
6240         * s/usg5-4-common.h, src/s/unixware.h:
6241         Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6243         * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6245 2012-06-13  Paul Eggert  <eggert@cs.ucla.edu>
6247         USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6248         * alloc.c (make_number) [!defined make_number]:
6249         Remove, as lisp.h always defines this now.
6250         (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6251         (roundup_size): Verify that it is a power of 2.
6252         * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6253         * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6254         * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6255         -DUSE_LSB_TAG=0, to override the automatically-selected default.
6256         USE_LSB_TAG now is always defined to be either 0 or 1.
6257         All uses changed.
6258         (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6259         code works fine either way, and efficiency is not a concern here,
6260         as the union type is for debugging, not for production.
6261         (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6262         Use an inline function on all platforms when using the union type,
6263         since this is simpler and 'static inline' can be used portably
6264         within Emacs now.
6265         (LISP_INITIALLY_ZERO): New macro.
6266         (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6267         (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6269 2012-06-12  Glenn Morris  <rgm@gnu.org>
6271         * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6273         * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
6275         * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6276         Move BROKEN_SIGIO to configure.
6278         * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6279         Move NO_TERMIO to configure.
6281 2012-06-12  Chong Yidong  <cyd@gnu.org>
6283         * image.c (imagemagick_load_image): Use MagickFlattenImage if
6284         MagickMergeImageLayers is undefined.  Use pixel pusher loop if
6285         MagickExportImagePixels is undefined.
6287 2012-06-12  Paul Eggert  <eggert@cs.ucla.edu>
6289         * image.c (imagemagick_load_image): Remove unused label.
6291 2012-06-11  Glenn Morris  <rgm@gnu.org>
6293         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6294         * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6295         * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6296         * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6298 2012-06-11  Stefan Monnier  <monnier@iro.umontreal.ca>
6300         * alloc.c (make_byte_code): New function.
6301         (Fmake_byte_code): Use it.  Don't purify here.
6302         * lread.c (read1): Use it as well to avoid extra allocation.
6304 2012-06-11  Chong Yidong  <cyd@gnu.org>
6306         * image.c (imagemagick_load_image): Implement transparency.
6308 2012-06-10  Andreas Schwab  <schwab@linux-m68k.org>
6310         * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6311         account for preceding backslashes.  (Bug#11663)
6313 2012-06-09  Chong Yidong  <cyd@gnu.org>
6315         * term.c: Support italics in capable terminals (Bug#9652).
6316         (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6317         (turn_on_face): Output using TS_enter_italic_mode if available.
6318         Don't handle unused blinking and alt-charset cases.
6319         (turn_off_face): Handle italic case; discard unused tty_blinking_p
6320         and tty_alt_charset_p cases.
6321         (tty_capable_p, init_tty): Support italics.
6323         * termchar.h (struct tty_display_info): Add field for italics.
6324         Remove unused blink field.
6326         * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6327         Handle slant.
6329         * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6330         (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6331         tty_alt_charset_p.  Add tty_italic_p.
6333 2012-06-09  Michael Albinus  <michael.albinus@gmx.de>
6335         * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6336         dbus_type_is_basic if available.
6337         (xd_extract_signed, xd_extract_unsigned): Rename from
6338         extract_signed and extract_unsigned, respectively.  Adapt callers.
6340 2012-06-09  Chong Yidong  <cyd@gnu.org>
6342         * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6344         * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6345         case (Bug#9752).
6347 2012-06-08  Paul Eggert  <eggert@cs.ucla.edu>
6349         * xdisp.c (vmessage): Treat frame message as multibyte.
6350         Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6351         would generate the diagnostic "Making \302\247 buffer-local while
6352         let-bound!".
6354 2012-06-08  Eli Zaretskii  <eliz@gnu.org>
6356         * dispnew.c (showing_window_margins_p): Undo last change, which
6357         was done due to an inadvertent commit.
6358         (adjust_frame_glyphs_for_frame_redisplay): Do call
6359         showing_window_margins_p.
6361 2012-06-08  Stefan Monnier  <monnier@iro.umontreal.ca>
6363         * eval.c (Fmake_var_non_special): New primitive.
6364         (syms_of_eval): Defsubr it.
6365         * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6367 2012-06-08  Juanma Barranquero  <lekktu@gmail.com>
6369         * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6370         function warning (the only call is inside #if 0 since revno:108521).
6372 2012-06-08  Eli Zaretskii  <eliz@gnu.org>
6374         * alloc.c (allocate_vectorlike): Fix last change.
6376 2012-06-08  Dmitry Antipov  <dmantipov@yandex.ru>
6378         Block-based vector allocation of small vectors.
6379         * lisp.h (struct vectorlike_header): New field `nbytes',
6380         adjust comment accordingly.
6381         * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
6382         to denote vector blocks.  Adjust users (live_vector_p,
6383         mark_maybe_pointer, valid_lisp_object_p) accordingly.
6384         (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6385         (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6386         (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6387         (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6388         (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6389         (roundup_size): New constant.
6390         (struct vector_block): New data type.
6391         (vector_blocks, vector_free_lists, zero_vector): New variables.
6392         (all_vectors): Rename to `large_vectors'.
6393         (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6394         (sweep_vectors): New functions.
6395         (allocate_vectorlike): Return `zero_vector' as the only vector of
6396         0 items.  Allocate new vector from block if vector size is less than
6397         or equal to VBLOCK_BYTES_MAX.
6398         (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6399         (init_alloc_once): Add call to init_vectors.
6401 2012-06-08  Stefan Monnier  <monnier@iro.umontreal.ca>
6403         * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6405 2012-06-07  Paul Eggert  <eggert@cs.ucla.edu>
6407         * doprnt.c (doprnt): Truncate multibyte char correctly.
6408         Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6409         would mishandle a string argument "Xc" if X was a multibyte
6410         character of length 2: it would truncate after X's first byte
6411         rather than including all of X.
6413 2012-06-06  Chong Yidong  <cyd@gnu.org>
6415         * buffer.c (word_wrap): Doc fix.
6417 2012-06-04  Paul Eggert  <eggert@cs.ucla.edu>
6419         * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6421 2012-06-03  Glenn Morris  <rgm@gnu.org>
6423         * xdisp.c (tool-bar-style): Doc fix.
6425 2012-06-03  Ulrich Müller  <ulm@gentoo.org>
6427         * Makefile.in (PAXCTL): Define.
6428         (temacs$(EXEEXT)): Disable memory randomization for the temacs
6429         binary via PaX flags if the paxctl utility is available.
6430         (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6431         Restore PaX flags to their default.  (Bug#11398)
6433 2012-06-03  Chong Yidong  <cyd@gnu.org>
6435         * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6436         buffer (Bug#11226).
6438 2012-06-03  Chong Yidong  <cyd@gnu.org>
6440         * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6441         (note_mode_line_or_margin_highlight): If there is no help echo,
6442         use mode-line-default-help-echo.  Handle the case where the mouse
6443         position is past the end of the mode line string.
6445         * buffer.c (buffer_local_value_1): New function, split from
6446         Fbuffer_local_value; can return Qunbound.
6447         (Fbuffer_local_value): Use it.
6448         (Vmode_line_format): Docstring tweaks.
6450 2012-06-02  Paul Eggert  <eggert@cs.ucla.edu>
6452         * sysdep.c (system_process_attributes): Improve comment.
6454 2012-06-02  Stefan Monnier  <monnier@iro.umontreal.ca>
6456         * keyboard.c: Export real-this-command to Elisp.
6457         (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6458         and DEFVAR it.  Update all users.
6460 2012-06-02  Paul Eggert  <eggert@cs.ucla.edu>
6462         * minibuf.c (Fassoc_string): Remove duplicate declaration.
6464         * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6465         Convert pctcpu and pctmem to Lisp float properly.
6466         Let the compiler fold better, as 100.0/0x8000 is exact.
6468 2012-06-02  Andreas Schwab  <schwab@linux-m68k.org>
6470         * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6471         cons_block.
6473 2012-06-01  Paul Eggert  <eggert@cs.ucla.edu>
6475         * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6477 2012-06-01  Dmitry Antipov  <dmantipov@yandex.ru>
6479         For a 'struct window', replace some Lisp_Object fields to
6480         bitfields where appropriate, remove unused fields.
6481         * window.h (struct window): Remove unused 'last_mark_x' and
6482         'last_mark_y' fields.  Rename 'mini_p' field to 'mini',
6483         change it's type from Lisp_Object to bitfield.
6484         Change type of 'force_start', 'optional_new_start',
6485         'last_had_star', 'update_mode_line' and 'start_at_line_beg'
6486         fields from Lisp_Object to bitfield.  Adjust users accordingly.
6488 2012-05-31  Paul Eggert  <eggert@cs.ucla.edu>
6490         Pacify gcc -Wdouble-precision when using Xaw.
6491         * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6492         [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6493         Use 'float' consistently, rather than 'float' in most places
6494         and 'double' in a couple of places.
6496 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
6498         * xdisp.c (handle_stop): Detect whether we have overlay strings
6499         loaded by testing it->current.overlay_string_index to be
6500         non-negative, instead of checking whether n_overlay_strings is
6501         positive.  (Bug#11587)
6503 2012-05-31  Chong Yidong  <cyd@gnu.org>
6505         * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6507         * doc.c (Fsubstitute_command_keys): Doc fix.
6509 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
6511         * search.c (search_buffer): Remove calls to
6512         r_alloc_inhibit_buffer_relocation, as it is now called by
6513         maybe_unify_char, which was the cause of relocation of buffer text
6514         in bug#11519.
6516 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
6518         * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6519         for the duration of call to load_charset, to avoid problems with
6520         callers of maybe_unify_char that access buffer text through C
6521         pointers.
6523         * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6524         decrement the inhibition flag, instead of just setting or
6525         resetting it.
6527 2012-05-31  Paul Eggert  <eggert@cs.ucla.edu>
6529         Remove obsolete '#define static' cruft.
6530         * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6531         This #undef was "temporary" in 2000; it is no longer needed
6532         now that '#define static' has gone away.
6533         * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6534         (gray_bitmap_bits): Remove; no longer needed.
6535         All uses replaced with definiens.
6536         * xterm.c: Include "bitmaps/gray.xbm".
6538 2012-05-30  Paul Eggert  <eggert@cs.ucla.edu>
6540         Clean up __executable_start, monstartup when --enable-profiling.
6541         The following changes affect the code only when profiling.
6542         * dispnew.c (__executable_start): Rename from safe_bcopy.
6543         Define only on platforms that need it.
6544         * emacs.c: Include <sys/gmon.h> when profiling.
6545         (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6546         (__executable_start): Remove decl, since lisp.h does it now.
6547         (safe_bcopy): Remove decl; no longer has that name.
6548         (main): Coalesce #if into single bit of code, for simplicity.
6549         Cast pointers to uintptr_t, since standard libraries want integers
6550         and not pointers.
6551         * lisp.h (__executable_start): New decl.
6553 2012-05-31  Glenn Morris  <rgm@gnu.org>
6555         * image.c (Fimagemagick_types): Doc fix.
6557 2012-05-30  Jim Meyering  <meyering@redhat.com>
6559         * callproc.c (Fcall_process_region): Include directory component
6560         in mkstemp error message (Bug#11586).
6562 2012-05-30  Paul Eggert  <eggert@cs.ucla.edu>
6564         * alloc.c, lisp.h (make_pure_vector): Now static.
6566 2012-05-30  Stefan Monnier  <monnier@iro.umontreal.ca>
6568         * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6569         Move to byte-run.el.
6570         (Fautoload): Do the hash-doc more carefully.
6571         * data.c (Fdefalias): Purify definition, except for keymaps.
6572         (Qdefun): Move from eval.c.
6573         * lisp.h (Qdefun): Remove.
6574         * lread.c (read1): Tiny simplification.
6576 2012-05-29  Troels Nielsen  <bn.troels@gmail.com>
6578         Do not create empty overlays with the evaporate property (Bug#9642).
6579         * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6580         Bug#9642, but explicitly check that the buffer the overlay would
6581         be moved to is live and rearrange lines to make sure that errors
6582         will not put the overlay in an inconsistent state.
6583         (Fdelete_overlay): Cosmetics.
6585 2012-05-28  Eli Zaretskii  <eliz@gnu.org>
6587         * w32term.c (my_bring_window_to_top): New function.
6588         (x_raise_frame): Use handle returned by DeferWindowPos, which
6589         could be different from the original one.
6590         Call my_bring_window_to_top instead of my_set_foreground_window.
6591         (Bug#11513)
6593         * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6594         by calling BringWindowToTop.
6596         * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6597         (WM_EMACS_END): Increase by one.
6599 2012-05-28  Paul Eggert  <eggert@cs.ucla.edu>
6601         * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6602         This avoids undefined behavior that might cause the eassert
6603         to not catch an out-of-range value.
6605 2012-05-28  Juanma Barranquero  <lekktu@gmail.com>
6607         * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6608         Update dependencies.
6610 2012-05-27  Eli Zaretskii  <eliz@gnu.org>
6612         * bidi.c (bidi_mirror_char): Fix last change.
6614 2012-05-27  Andreas Schwab  <schwab@linux-m68k.org>
6616         * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6617         when referring to sectname field in printf format.
6619 2012-05-27  Paul Eggert  <eggert@cs.ucla.edu>
6621         * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6622         Only r_alloc_inhibit_buffer_relocation needed to be added;
6623         the others were already declared.
6625         * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6626         before checking whether it's out of range.  Put the check inside
6627         eassert.  See
6628         <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6630 2012-05-27  Ken Brown  <kbrown@cornell.edu>
6632         * callproc.c (Fcall_process): Restore a line that was accidentally
6633         commented out in the 2011-02-13 change (bug#11547).
6635 2012-05-27  Eli Zaretskii  <eliz@gnu.org>
6637         * lisp.h [REL_ALLOC]: Add prototypes for external functions
6638         defined on ralloc.c.
6640         * buffer.c [REL_ALLOC]: Remove prototypes of
6641         r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
6642         they are now on lisp.h.
6644         * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
6646         * search.c (search_buffer): Use it to inhibit relocation of buffer
6647         text while re_search_2 is doing its job, because re_search_2 is
6648         passed C pointers to buffer text.  (Bug#11519)
6650         * msdos.c (internal_terminal_init) <Vwindow_system_version>:
6651         Update value to 24.
6653         * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
6654         state after an additional call to move_it_in_display_line_to, keep
6655         the values of it->max_ascent and it->max_descent found for the
6656         entire line.
6657         (pos_visible_p): Revert the comparison against bottom_y to what it
6658         was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
6659         (Bug#11464)
6661 2012-05-26  Paul Eggert  <eggert@cs.ucla.edu>
6663         Fix coding-related core dumps with gcc -ftrapv.
6664         The code was computing A - B, where A and B are pointers, and B is
6665         random garbage.  This can lead to core dumps on platforms that
6666         have special pointer registers, and it also leads to core dumps on
6667         x86-64 when compiled with gcc -ftrapv.  The fix is to compute
6668         A - B only when B is initialized properly.
6669         * coding.c (coding_set_source, coding_set_destination): Return void.
6670         (coding_change_source, coding_change_destinations): New functions,
6671         with the old behaviors of coding_set_source and coding_set_destination.
6672         All callers that need an offset changed to use these new functions.
6674 2012-05-26  Glenn Morris  <rgm@gnu.org>
6676         * nsterm.m (ns_init_paths): Don't mess with INFOPATH.  (Bug#2791)
6678 2012-05-26  Eli Zaretskii  <eliz@gnu.org>
6680         Extend mouse support on W32 text-mode console.
6681         * xdisp.c (draw_row_with_mouse_face):
6682         Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
6684         * w32console.c: Include window.h.
6685         (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6686         New functions.
6687         (initialize_w32_display): Initialize mouse-highlight data.
6689         * w32inevt.c: Include termchar.h and window.h.
6690         (do_mouse_event): Support mouse-autoselect-window.  When the mouse
6691         moves, call note_mouse_highlight.  If help_echo changed, call
6692         gen_help_event to produce help-echo message in the echo area.
6693         Call clear_mouse_face if mouse_face_hidden is set in the mouse
6694         highlight info.
6696 2012-05-26  Paul Eggert  <eggert@cs.ucla.edu>
6698         * lread.c (read1): Simplify slightly to avoid an overflow warning
6699         with GCC 4.7.0 on x86-64.
6701 2012-05-26  Eli Zaretskii  <eliz@gnu.org>
6703         * bidi.c (bidi_mirror_char): Revert last change: an int is
6704         definitely wide enough here.
6706 2012-05-25  Paul Eggert  <eggert@cs.ucla.edu>
6708         Fix integer width and related bugs (Bug#9874).
6709         * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
6710         (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6711         (string_bytes, check_sblock, allocate_string_data):
6712         (compact_small_strings, Fmake_bool_vector, make_string)
6713         (make_unibyte_string, make_multibyte_string)
6714         (make_string_from_bytes, make_specified_string)
6715         (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6716         (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6717         (mark_vectorlike):
6718         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6719         (allocate_pseudovector):
6720         Use int, not EMACS_INT, where int is wide enough.
6721         (inhibit_garbage_collection, Fgarbage_collect):
6722         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6723         * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6724         int might not be wide enough.
6725         (bidi_cache_search, bidi_cache_find, bidi_init_it)
6726         (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6727         (bidi_at_paragraph_end, bidi_find_paragraph_start)
6728         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6729         (bidi_level_of_next_char, bidi_move_to_visually_next):
6730         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6731         * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6732         (Fkill_buffer, Fset_buffer_major_mode)
6733         (advance_to_char_boundary, Fbuffer_swap_text)
6734         (Fset_buffer_multibyte, overlays_at, overlays_in)
6735         (overlay_touches_p, struct sortvec, record_overlay_string)
6736         (overlay_strings, recenter_overlay_lists)
6737         (adjust_overlays_for_insert, adjust_overlays_for_delete)
6738         (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6739         (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6740         (Foverlay_recenter, last_overlay_modification_hooks_used)
6741         (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
6742         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6743         (validate_region): Omit unnecessary test for b <= e,
6744         since that's guaranteed by the previous test.
6745         (adjust_overlays_for_delete): Avoid pos + length overflow.
6746         (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
6747         (report_overlay_modification):
6748         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6749         (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
6750         Omit pointer cast, which isn't needed anyway, and doesn't work
6751         after the EMACS_INT -> ptrdiff_t change.
6752         (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
6753         * buffer.h: Adjust decls to match defn changes elsewhere.
6754         (struct buffer_text, struct buffer):
6755         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6756         Use EMACS_INT, not int, where int might not be wide enough.
6757         * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
6758         not int, to avoid needless 32-bit limit on 64-bit hosts.
6759         (exec_byte_code): Use tighter memory-full test, one that checks
6760         for alloca overflow.  Don't compute the address of the object just
6761         before an array, as that's not portable.  Use EMACS_INT, not
6762         ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
6763         * callint.c (Fcall_interactively):
6764         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6765         * callproc.c (call_process_kill, Fcall_process):
6766         Don't assume pid_t fits into an Emacs fixnum.
6767         (call_process_cleanup, Fcall_process, child_setup):
6768         Don't assume pid_t fits into int.
6769         (call_process_cleanup, Fcall_process, delete_temp_file)
6770         (Fcall_process_region):
6771         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6772         (Fcall_process): Simplify handling of volatile integers.
6773         Use int, not EMACS_INT, where int will do.
6774         * casefiddle.c (casify_object, casify_region, operate_on_word)
6775         (Fupcase_word, Fdowncase_word, Fcapitalize_word):
6776         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6777         (casify_object): Avoid integer overflow when overallocating buffer.
6778         * casetab.c (set_identity, shuffle): Prefer int to unsigned when
6779         either works.  Use lint_assume to convince GCC 4.6.1 that it's OK.
6780         * category.c (Fchar_category_set): Don't assume fixnum fits in int.
6781         * category.h (CATEGORYP): Don't assume arg is nonnegative.
6782         * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
6783         integers are now checked earlier.  All uses replaced with XINT.
6784         (ccl_driver):
6785         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6786         For CCL_MapSingle, check that content and value are in int range.
6787         (ccl_driver, Fregister_code_conversion_map):
6788         Check that Vcode_version_map_vector is a vector.
6789         (resolve_symbol_ccl_program): Check that vector header is in range.
6790         Always copy the vector, so that we can check its contents reliably
6791         now rather than having to recheck each instruction as it's being
6792         executed.  Check that vector words fit in 'int'.
6793         (ccl_get_compiled_code, Fregister_ccl_program)
6794         (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
6795         program indexes, to avoid needless 32-bit limit on 64-bit hosts.
6796         (Fccl_execute, Fccl_execute_on_string): Check that initial reg
6797         contents are in range.
6798         (Fccl_execute_on_string): Check that status is in range.
6799         * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
6800         * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
6801         Accept and return EMACS_INT, not int, because callers can pass values
6802         out of 'int' range.
6803         (c_string_width, strwidth, lisp_string_width, chars_in_text)
6804         (multibyte_chars_in_text, parse_str_as_multibyte)
6805         (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
6806         (str_as_unibyte, str_to_unibyte, string_count_byte8)
6807         (string_escape_byte8, Fget_byte):
6808         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6809         (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
6810         avoid mishandling large integers.
6811         * character.h: Adjust decls to match defn changes elsewhere.
6812         * charset.c (load_charset_map_from_file, find_charsets_in_text)
6813         (Ffind_charset_region):
6814         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6815         (load_charset_map_from_file): Redo idx calculation to avoid overflow.
6816         (load_charset_map_from_vector, Fdefine_charset_internal):
6817         Don't assume fixnum fits in int.
6818         (load_charset_map_from_vector, Fmap_charset_chars):
6819         Remove now-unnecessary CHECK_NATNUMs.
6820         (Fdefine_charset_internal): Check ranges here, more carefully.
6821         Don't rely on undefined behavior with signed left shift overflow.
6822         Don't assume unsigned int fits into fixnum, or that fixnum fits
6823         into unsigned int.  Don't require max_code to be a valid fixnum;
6824         that's not true for gb10830 4-byte on a 32-bit host.  Allow
6825         invalid_code to be a cons, for the same reason.  Require code_offset
6826         to be a character.  Avoid int overflow if max_char is close
6827         to INT_MAX.
6828         (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
6829         this is intended anyway and avoids some undefined behavior.
6830         (load_charset_map): Pass unsigned, not int, as 2nd arg of
6831         INDEX_TO_CODE_POINT, as that's what it expects.
6832         (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
6833         * charset.h (DECODE_CHAR): Return int, not unsigned;
6834         this is what was intended anyway, and it avoids undefined behavior.
6835         (CHARSET_OFFSET): Remove unused macro, instead of fixing its
6836         integer-overflow issues.
6837         (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
6838         Formerly, it returned EMACS_INT on 64-bit hosts in the common case
6839         where the argument is EMACS_INT, and this behavior is not intended.
6840         * chartab.c (Fmake_char_table, Fset_char_table_range)
6841         (uniprop_get_decoder, uniprop_get_encoder):
6842         Don't assume fixnum fits in int.
6843         * cmds.c (move_point): New function, that does the gist of
6844         Fforward_char and Fbackward_char, but does so while checking
6845         for integer overflow more accurately.
6846         (Fforward_char, Fbackward_char): Use it.
6847         (Fforward_line, Fend_of_line, internal_self_insert)
6848         (internal_self_insert):
6849         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6850         Fix a FIXME, by checking for integer overflow when calculating
6851         target_clm and actual_clm.
6852         * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
6853         (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
6854         (ASSURE_DESTINATION, coding_alloc_by_realloc)
6855         (coding_alloc_by_making_gap, alloc_destination)
6856         (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
6857         (encode_coding_utf_16, detect_coding_emacs_mule)
6858         (decode_coding_emacs_mule, encode_coding_emacs_mule)
6859         (detect_coding_iso_2022, decode_coding_iso_2022)
6860         (encode_invocation_designation, encode_designation_at_bol)
6861         (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6862         (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
6863         (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
6864         (encode_coding_ccl, encode_coding_raw_text)
6865         (detect_coding_charset, decode_coding_charset)
6866         (encode_coding_charset, detect_eol, decode_eol, produce_chars)
6867         (produce_composition, produce_charset, produce_annotation)
6868         (decode_coding, handle_composition_annotation)
6869         (handle_charset_annotation, consume_chars, decode_coding_gap)
6870         (decode_coding_object, encode_coding_object, detect_coding_system)
6871         (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
6872         (code_convert_region, code_convert_string)
6873         (Fdefine_coding_system_internal)
6874         (coding_set_source, coding_set_destination):
6875         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6876         (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
6877         (Fdefine_coding_system_internal):
6878         Don't assume fixnums fit in int.
6879         (decode_coding_gap, decode_coding_object, encode_coding_object)
6880         (Fread_coding_system, Fdetect_coding_region)
6881         (Funencodable_char_position, Fcheck_coding_systems_region)
6882         (get_translation, handle_composition_annotation, consume_chars):
6883         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6884         (consume_chars): Rewrite to not calculate an address outside buffer.
6885         (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
6886         Don't access memory outside of the args array.
6887         (Fdefine_coding_system_internal): Check for charset-id overflow.
6888         (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
6889         result of ENCODE_CHAR.
6890         * coding.h: Adjust decls to match defn changes elsewhere.
6891         (struct coding_system):
6892         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6893         * composite.c (get_composition_id, find_composition)
6894         (run_composition_function, update_compositions)
6895         (compose_text, composition_gstring_put_cache)
6896         (composition_gstring_p, composition_gstring_width)
6897         (fill_gstring_header, fill_gstring_body, autocmp_chars)
6898         (composition_compute_stop_pos, composition_reseat_it)
6899         (composition_update_it, struct position_record)
6900         (find_automatic_composition, composition_adjust_point)
6901         (Fcomposition_get_gstring, Ffind_composition_internal):
6902         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6903         (update_compositions):
6904         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6905         * composite.h: Adjust decls to match defn changes elsewhere.
6906         (struct composition):
6907         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6908         * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
6909         Do not attempt to compute the address of the object just before a
6910         buffer; this is not portable.
6911         (Faref, Faset):
6912         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6913         (Faset): Use int, not EMACS_INT, where int is wide enough.
6914         (Fstring_to_number): Don't assume fixnums fit in int.
6915         (Frem): Don't assume arg is nonnegative.
6916         * dbusbind.c (xd_append_arg): Check for integers out of range.
6917         (Fdbus_call_method): Don't overflow the timeout int.
6918         (extract_signed, extract_unsigned): New functions.
6919         (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
6920         (xd_get_connection_references): Return ptrdiff_t, not int.
6921         All uses changed.
6922         (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
6923         (xd_read_message_1):
6924         Use int, not unsigned, where the dbus API uses int.
6925         (Fdbus_message_internal): Don't overflow mtype.
6926         (syms_of_dbusbind): Allocate right-sized buffer for integers.
6927         * dired.c (directory_files_internal, file_name_completion, scmp)
6928         (file_name_completion_stat):
6929         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6930         (file_name_completion): Don't overflow matchcount.
6931         (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
6932         * dispextern.h: Adjust decls to match defn changes elsewhere.
6933         (struct text_pos, struct glyph, struct bidi_saved_info)
6934         (struct bidi_string_data, struct bidi_it, struct composition_it)
6935         (struct it):
6936         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6937         (struct display_pos, struct composition_it, struct it):
6938         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6939         * dispnew.c (increment_matrix_positions)
6940         (increment_row_positions, mode_line_string)
6941         (marginal_area_string):
6942         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6943         (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
6944         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6945         (duration_to_sec_usec): New function, to check for overflow better.
6946         (Fsleep_for, sit_for): Use it.
6947         * doc.c (get_doc_string, store_function_docstring):
6948         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6949         (get_doc_string, Fsnarf_documentation):
6950         Use int, not EMACS_INT, where int is wide enough.
6951         (get_doc_string):
6952         Use SAFE_ALLOCA, not alloca.
6953         Check for overflow when converting EMACS_INT to off_t.
6954         * doprnt.c (doprnt):
6955         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6956         * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
6957         Don't assume uid_t fits into fixnum.
6958         (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
6959         (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
6960         (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
6961         (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
6962         (general_insert_function)
6963         (Finsert_char, make_buffer_string, make_buffer_string_both)
6964         (update_buffer_properties, Fbuffer_substring)
6965         (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
6966         (Fsubst_char_in_region, check_translation)
6967         (Ftranslate_region_internal, save_restriction_restore, Fformat)
6968         (transpose_markers, Ftranspose_regions):
6969         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6970         (clip_to_bounds): Move to lisp.h as an inline function).
6971         (Fconstrain_to_field): Don't assume integers are nonnegative.
6972         (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
6973         (Fsubst_char_in_region, Fsave_restriction):
6974         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6975         (Femacs_pid): Don't assume pid_t fits into fixnum.
6976         (lo_time): Use int, not EMACS_INT, when int suffices.
6977         (lisp_time_argument): Check for usec out of range.
6978         (Fencode_time): Don't assume fixnum fits in int.
6979         (Fuser_login_name, Fuser_full_name): Signal an error
6980         if a uid argument is out of range, rather than relying on
6981         undefined behavior.
6982         (Fformat_time_string): Remove now-unnecessary check.
6983         lisp_time_argument checks for out-of-range usec now.
6984         Use ptrdiff_t, not size_t, where ptrdiff_t will do.
6985         * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
6986         (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
6987         (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
6988         (init_cmdargs, Fdump_emacs):
6989         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6990         (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
6991         the bottom (typically) 32 bits of the fixnum.
6992         * eval.c (specpdl_size, call_debugger):
6993         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6994         (when_entered_debugger, Fbacktrace_debug):
6995         Don't assume fixnum can fit in int.
6996         (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
6997         the object just before a buffer; this is not portable.
6998         (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
6999         (grow_specpdl, unbind_to):
7000         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7001         (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7002         (grow_specpdl): Simplify allocation by using xpalloc.
7003         (Fprog1, Fprog2): Don't assume list length fits in int.  Simplify.
7004         * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7005         (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7006         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7007         (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7008         (a_write, e_write):
7009         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7010         (Fcopy_file, non_regular_nbytes, read_non_regular)
7011         (Finsert_file_contents):
7012         Use int, not EMACS_INT, where int is wide enough.
7013         (READ_BUF_SIZE): Verify that it fits in int.
7014         (Finsert_file_contents): Check that counts are in proper range,
7015         rather than assuming fixnums fit into ptrdiff_t etc.
7016         Don't assume fixnums fit into int.
7017         * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
7018         * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7019         (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
7020         (string_char_to_byte, string_byte_to_char)
7021         (string_make_multibyte, string_to_multibyte)
7022         (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7023         (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7024         (substring_both, Fdelete, internal_equal, Ffillarray)
7025         (Fclear_string, mapcar1)
7026         (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7027         (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7028         (larger_vector, make_hash_table, maybe_resize_hash_table)
7029         (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7030         (Fmaphash, secure_hash):
7031         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7032         (concat): Check for string index and length overflow.
7033         (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7034         (Frequire):
7035         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7036         (larger_vector): New API (vec, incr_min, size_max) replaces old
7037         one (vec, new_size, init).  This catches size overflow.
7038         INIT was removed because it was always Qnil.
7039         All callers changed.
7040         (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7041         the upper bound on a hash table index size.
7042         (make_hash_table, maybe_resize_hash_table): Use it.
7043         (secure_hash): Computer start_byte and end_byte only after
7044         they're known to be in ptrdiff_t range.
7045         * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7046         (Ffont_get_glyphs, Ffont_at):
7047         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7048         (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7049         (Flist_fonts, Fopen_font):
7050         Don't assume fixnum can fit in int.
7051         (check_gstring): Don't assume index can fit in int.
7052         (font_match_p): Check that fixnum is a character, not a nonnegative
7053         fixnum, since the later code needs to stuff it into an int.
7054         (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7055         (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7056         conversion overflow issues.
7057         (Fopen_font): Check for integer out of  range.
7058         (Ffont_get_glyphs): Don't assume index can fit in int.
7059         * font.h: Adjust decls to match defn changes elsewhere.
7060         * fontset.c (reorder_font_vector): Redo score calculation to avoid
7061         integer overflow.
7062         (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7063         printmax_t, where ptrdiff_t is wide enough.
7064         (Finternal_char_font):
7065         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7066         * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7067         (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7068         (Fset_frame_position, x_set_frame_parameters)
7069         (x_set_line_spacing, x_set_border_width)
7070         (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7071         Check that fixnums are in proper range for system types.
7072         (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7073         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7074         (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7075         Use SAFE_ALLOCA_LISP, not alloca.
7076         * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7077         intptr_t is wide enough.
7078         * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7079         (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7080         (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7081         Check for fixnum out of range.
7082         * ftfont.c (ftfont_list): Don't assume index fits in int.
7083         Check that fixnums are in proper range for system types.
7084         (ftfont_shape_by_flt):
7085         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7086         * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7087         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7088         (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7089         Check that fixnums are in proper range for system types.
7090         * gnutls.h: Adjust decls to match defn changes elsewhere.
7091         * gtkutil.c (xg_dialog_run):
7092         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7093         (update_frame_tool_bar):
7094         Check that fixnums are in proper range for system types.
7095         * image.c (parse_image_spec): Redo count calculation to avoid overflow.
7096         (lookup_image): Check that fixnums are in range for system types.
7097         * indent.c (last_known_column, last_known_column_point):
7098         (current_column_bol_cache):
7099         (skip_invisible, current_column, check_display_width):
7100         (check_display_width, scan_for_column, current_column_1)
7101         (Findent_to, Fcurrent_indentation, position_indentation)
7102         (indented_beyond_p, Fmove_to_column, compute_motion):
7103         (Fcompute_motion, Fvertical_motion):
7104         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7105         (last_known_column_modified): Use EMACS_INT, not int.
7106         (check_display_width):
7107         (Fcompute_motion):
7108         Check that fixnums and floats are in proper range for system types.
7109         (compute_motion): Don't assume index or fixnum fits in int.
7110         (compute_motion, Fcompute_motion):
7111         Use int, not EMACS_INT, when it is wide enough.
7112         (vmotion): Omit local var start_hpos that is always 0; that way
7113         we don't need to worry about overflow in expressions involving it.
7114         * indent.h: Adjust decls to match defn changes elsewhere.
7115         (struct position):
7116         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7117         Use int, not EMACS_INT, where int is wide enough.
7118         Remove unused members ovstring_chars_done and tab_offset;
7119         all uses removed.
7120         * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7121         (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7122         (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7123         (make_gap, copy_text, insert, insert_and_inherit)
7124         (insert_before_markers, insert_before_markers_and_inherit)
7125         (insert_1, count_combining_before, count_combining_after)
7126         (insert_1_both, insert_from_string)
7127         (insert_from_string_before_markers, insert_from_string_1)
7128         (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7129         (adjust_after_replace, adjust_after_insert, replace_range)
7130         (replace_range_2, del_range, del_range_1, del_range_byte)
7131         (del_range_both, del_range_2, modify_region)
7132         (prepare_to_modify_buffer, signal_before_change)
7133         (signal_after_change, Fcombine_after_change_execute):
7134         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7135         * intervals.c (traverse_intervals, rotate_right, rotate_left)
7136         (balance_an_interval, split_interval_right, split_interval_left)
7137         (find_interval, next_interval, update_interval)
7138         (adjust_intervals_for_insertion, delete_node, delete_interval)
7139         (interval_deletion_adjustment, adjust_intervals_for_deletion)
7140         (static_offset_intervals, offset_intervals)
7141         (merge_interval_right, merge_interval_left, make_new_interval)
7142         (graft_intervals_into_buffer, temp_set_point_both)
7143         (temp_set_point, set_point, adjust_for_invis_intang)
7144         (set_point_both, move_if_not_intangible, get_property_and_range)
7145         (get_local_map, copy_intervals, copy_intervals_to_string)
7146         (compare_string_intervals, set_intervals_multibyte_1):
7147         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7148         * intervals.h: Adjust decls to match defn changes elsewhere.
7149         (struct interval):
7150         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7151         * keyboard.c (this_command_key_count, this_single_command_key_start)
7152         (before_command_key_count, before_command_echo_length, echo_now)
7153         (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7154         (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7155         (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7156         (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7157         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7158         (last_non_minibuf_size, last_point_position, echo_truncate)
7159         (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7160         (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7161         (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7162         (stuff_buffered_input):
7163         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7164         (last_auto_save, command_loop_1, read_char):
7165         Use EMACS_INT, not int, to avoid integer overflow.
7166         (record_char): Avoid overflow in total_keys computation.
7167         (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7168         * keyboard.h: Adjust decls to match defn changes elsewhere.
7169         * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7170         (Fkey_description, Fdescribe_vector, Flookup_key):
7171         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7172         (click_position): New function, to check that positions are in range.
7173         (Fcurrent_active_maps):
7174         (describe_command):
7175         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7176         (Faccessible_keymaps, Fkey_description):
7177         (preferred_sequence_p):
7178         Don't assume fixnum can fit into int.
7179         (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7180         Check for integer overflow in size calculations.
7181         (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7182         avoid mishandling large integers.
7183         * lisp.h: Adjust decls to match defn changes elsewhere.
7184         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7185         (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7186         (struct Lisp_Marker):
7187         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7188         (clip_to_bounds): Now an inline function, moved here from editfns.c.
7189         (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7190         need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7191         All callers changed.
7192         (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7193         Assume the arg has valid form, since it always does.
7194         (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7195         unsigned integer system type.
7196         (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7197         (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7198         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7199         (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7200         (duration_to_sec_usec): New decl.
7201         * lread.c (read_from_string_index, read_from_string_index_byte)
7202         (read_from_string_limit, readchar, unreadchar, openp)
7203         (read_internal_start, read1, oblookup):
7204         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7205         (Fload, readevalloop, Feval_buffer, Feval_region):
7206         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7207         (openp): Check for out-of-range argument to 'access'.
7208         (read1): Use int, not EMACS_INT, where int is wide enough.
7209         Don't assume fixnum fits into int.
7210         Fix off-by-one error that can read outside a buffer.
7211         (read_filtered_event): Use duration_to_sec_usec
7212         to do proper overflow checking on durations.
7213         * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7214         in size calculation.
7215         (Fexecute_kbd_macro):
7216         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7217         * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7218         (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7219         (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7220         (set_marker_both, set_marker_restricted_both, marker_position)
7221         (marker_byte_position, Fbuffer_has_markers_at):
7222         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7223         (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
7224         * menu.c (ensure_menu_items): Rename from grow_menu_items.
7225         It now merely ensures that the menu is large enough, without
7226         necessarily growing it, as this avoids some integer overflow issues.
7227         All callers changed.
7228         (keymap_panes, parse_single_submenu, Fx_popup_menu):
7229         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7230         (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7231         Use SAFE_ALLOCA_LISP, not alloca.
7232         (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7233         to EMACS_INT.  Check that fixnums are in proper range for system types.
7234         * minibuf.c (minibuf_prompt_width, string_to_object)
7235         (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7236         (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7237         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7238         (get_minibuffer, read_minibuf_unwind):
7239         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7240         (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7241         this simplifies overflow checking.  All callers changed.
7242         (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7243         (Ftest_completion):
7244         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7245         * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7246         (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7247         Check that fixnums are in proper range for system types.
7248         (Fx_create_frame, Fx_show_tip):
7249         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7250         * nsfont.m (ns_findfonts, nsfont_list_family):
7251         Don't assume fixnum fits in long.
7252         * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7253         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7254         (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7255         wide enough.
7256         * nsselect.m (ns_get_local_selection, clean_local_selection_data):
7257         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7258         * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7259         (PRINTDECLARE, PRINTPREPARE):
7260         (strout, print_string):
7261         (print, print_preprocess, print_check_string_charset_prop)
7262         (print_object):
7263         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7264         (PRINTDECLARE):
7265         (temp_output_buffer_setup, Fprin1_to_string, print_object):
7266         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7267         (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
7268         (printchar, strout): Use xpalloc to catch size calculation overflow.
7269         (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
7270         (print_error_message): Use SAFE_ALLOCA, not alloca.
7271         (print_object): Use int, not EMACS_INT, where int is wide enough.
7272         (print_depth, new_backquote_output, print_number_index):
7273         Use ptrdiff_t, not int, where int might not be wide enough.
7274         * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7275         (Fset_process_window_size, Fformat_network_address)
7276         (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
7277         (sigchld_handler):
7278         Check that fixnums are in proper range for system types.
7279         (Fsignal_process): Simplify by avoiding a goto.
7280         Check for process-ids out of pid_t range rather than relying on
7281         undefined behavior.
7282         (process_tick, update_tick): Use EMACS_INT, not int.
7283         (Fformat_network_address, read_process_output, send_process)
7284         (Fprocess_send_region, status_notify):
7285         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7286         (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7287         (wait_reading_process_output, read_process_output, exec_sentinel):
7288         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7289         (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7290         (Faccept_process_output): Use duration_to_sec_usec to do proper
7291         overflow checking on durations.
7292         (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7293         Don't assume pid_t fits in int.
7294         * process.h (struct Lisp_Process): Members tick and update_tick
7295         are now of type EMACS_INT, not int.
7296         * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7297         configured --with-wide-int.
7298         * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7299         (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7300         * search.c (looking_at_1, string_match_1):
7301         (fast_string_match, fast_c_string_match_ignore_case)
7302         (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7303         (scan_newline, find_before_next_newline, search_command)
7304         (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7305         (set_search_regs, wordify):
7306         (Freplace_match):
7307         (Fmatch_data):
7308         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7309         (string_match_1, search_buffer, set_search_regs):
7310         (Fmatch_data):
7311         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7312         (wordify): Check for overflow in size calculation.
7313         (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7314         (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7315         Check that fixnums are in proper range for system types.
7316         * sound.c (struct sound_device)
7317         (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7318         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7319         (Fplay_sound_internal):
7320         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7321         * syntax.c (struct lisp_parse_state, find_start_modiff)
7322         (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7323         (Fparse_partial_sexp):
7324         Don't assume fixnums can fit in int.
7325         (struct lisp_parse_state, find_start_pos, find_start_value)
7326         (find_start_value_byte, find_start_begv)
7327         (update_syntax_table, char_quoted, dec_bytepos)
7328         (find_defun_start, prev_char_comend_first, back_comment):
7329         (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7330         (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7331         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7332         (Finternal_describe_syntax_value): Check that match_lisp is a
7333         character, not an integer, since the code stuffs it into int.
7334         (scan_words, scan_sexps_forward):
7335         Check that fixnums are in proper range for system types.
7336         (Fforward_word):
7337         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7338         (scan_sexps_forward):
7339         Use CHARACTERP, not INTEGERP, since the value must fit into int.
7340         (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7341         * syntax.h: Adjust decls to match defn changes elsewhere.
7342         (struct gl_state_s):
7343         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7344         (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7345         MOST_POSITIVE_FIXNUM.
7346         * sysdep.c (wait_for_termination_1, wait_for_termination)
7347         (interruptible_wait_for_termination, mkdir):
7348         Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7349         (emacs_read, emacs_write):
7350         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7351         (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7352         and double all fit in int.
7353         * term.c (set_tty_color_mode):
7354         Check that fixnums are in proper range for system types.
7355         * termhooks.h (struct input_event):
7356         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7357         * textprop.c (validate_interval_range, interval_of)
7358         (Fadd_text_properties, set_text_properties_1)
7359         (Fremove_text_properties, Fremove_list_of_text_properties)
7360         (Ftext_property_any, Ftext_property_not_all)
7361         (copy_text_properties, text_property_list, extend_property_ranges)
7362         (verify_interval_modification):
7363         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7364         (Fnext_single_char_property_change)
7365         (Fprevious_single_char_property_change):
7366         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7367         (copy_text_properties):
7368         Check for integer overflow in index calculation.
7369         * undo.c (last_boundary_position, record_point, record_insert)
7370         (record_delete, record_marker_adjustment, record_change)
7371         (record_property_change):
7372         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7373         (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7374         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7375         * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7376         (Fx_hide_tip, Fx_file_dialog):
7377         * w32menu.c (set_frame_menubar):
7378         Use ptrdiff_t, not int, for consistency with rest of code.
7379         * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7380         (select_window, Fdelete_other_windows_internal)
7381         (window_scroll_pixel_based, window_scroll_line_based)
7382         (Frecenter, Fset_window_configuration):
7383         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7384         (Fset_window_hscroll, run_window_configuration_change_hook)
7385         (set_window_buffer, temp_output_buffer_show, scroll_command)
7386         (Fscroll_other_window, Frecenter):
7387         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7388         (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7389         Don't assume fixnum fits in int.
7390         (Fset_window_scroll_bars):
7391         Check that fixnums are in proper range for system types.
7392         * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7393         (string_pos, c_string_pos, number_of_chars, init_iterator)
7394         (in_ellipses_for_invisible_text_p, init_from_display_pos)
7395         (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7396         (compute_display_string_end, handle_face_prop)
7397         (face_before_or_after_it_pos, handle_invisible_prop)
7398         (handle_display_prop, handle_display_spec, handle_single_display_spec)
7399         (display_prop_intangible_p, string_buffer_position_lim)
7400         (string_buffer_position, handle_composition_prop, load_overlay_strings)
7401         (get_overlay_strings_1, get_overlay_strings)
7402         (iterate_out_of_display_property, forward_to_next_line_start)
7403         (back_to_previous_visible_line_start, reseat, reseat_to_string)
7404         (get_next_display_element, set_iterator_to_next)
7405         (get_visually_first_element, compute_stop_pos_backwards)
7406         (handle_stop_backwards, next_element_from_buffer)
7407         (move_it_in_display_line_to, move_it_in_display_line)
7408         (move_it_to, move_it_vertically_backward, move_it_by_lines)
7409         (add_to_log, message_dolog, message_log_check_duplicate)
7410         (message2, message2_nolog, message3, message3_nolog
7411         (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7412         (current_message_1, truncate_echo_area, truncate_message_1)
7413         (set_message, set_message_1, store_mode_line_noprop)
7414         (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7415         (text_outside_line_unchanged_p, check_point_in_composition)
7416         (reconsider_clip_changes)
7417         (redisplay_internal, set_cursor_from_row, try_scrolling)
7418         (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7419         (redisplay_window, find_last_unchanged_at_beg_row)
7420         (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7421         (trailing_whitespace_p, find_row_edges, display_line)
7422         (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7423         (display_mode_element, store_mode_line_string)
7424         (pint2str, pint2hrstr, decode_mode_spec)
7425         (display_count_lines, display_string, draw_glyphs)
7426         (x_produce_glyphs, x_insert_glyphs)
7427         (rows_from_pos_range, mouse_face_from_buffer_pos)
7428         (fast_find_string_pos, mouse_face_from_string_pos)
7429         (note_mode_line_or_margin_highlight, note_mouse_highlight):
7430         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7431         (safe_call, init_from_display_pos, handle_fontified_prop)
7432         (handle_single_display_spec, load_overlay_strings)
7433         (with_echo_area_buffer, setup_echo_area_for_printing)
7434         (display_echo_area, echo_area_display)
7435         (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7436         (update_tool_bar, hscroll_window_tree, redisplay_internal)
7437         (redisplay_window, dump_glyph_row, display_mode_line)
7438         (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
7439         (handle_display_spec, display_prop_string_p):
7440         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7441         (handle_single_display_spec, build_desired_tool_bar_string)
7442         (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7443         (get_specified_cursor_type):
7444         Check that fixnums are in proper range for system types.
7445         (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7446         (Flookup_image_map):
7447         Don't assume fixnums fit in int.
7448         (compare_overlay_entries):
7449         Avoid mishandling comparisons due to subtraction overflow.
7450         (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7451         (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7452         (handle_tool_bar_click):
7453         Use int, not unsigned, since we prefer signed and the signedness
7454         doesn't matter here.
7455         (get_next_display_element, next_element_from_display_vector):
7456         Use int, not EMACS_INT, when int is wide enough.
7457         (start_hourglass): Use duration_to_sec_usec to do proper
7458         overflow checking on durations.
7459         * xfaces.c (Fbitmap_spec_p):
7460         Check that fixnums are in proper range for system types.
7461         (compare_fonts_by_sort_order):
7462         Avoid mishandling comparisons due to subtraction overflow.
7463         (Fx_family_fonts, realize_basic_faces):
7464         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7465         (Fx_family_fonts):
7466         Don't assume fixnum fits in int.
7467         Use SAFE_ALLOCA_LISP, not alloca.
7468         (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7469         (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7470         (face_at_buffer_position, face_for_overlay_string)
7471         (face_at_string_position):
7472         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7473         (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7474         * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7475         (Fx_show_tip):
7476         Check that fixnums are in proper range for system types.
7477         (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7478         (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7479         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7480         (Fx_change_window_property): Don't assume fixnums fit in int.
7481         * xfont.c (xfont_chars_supported):
7482         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7483         * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7484         (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7485         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7486         * xml.c (parse_region):
7487         * xrdb.c (magic_file_p):
7488         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7489         * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7490         (x_get_local_selection, x_reply_selection_request)
7491         (x_handle_selection_request, wait_for_property_change):
7492         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7493         (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7494         short is wide enough.
7495         (x_send_client_event): Don't assume fixnum fits in int.
7496         * xterm.c (x_x_to_emacs_modifiers):
7497         Don't assume EMACS_INT overflows nicely into int.
7498         (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7499         may come from Lisp.
7500         (handle_one_xevent): NATNUMP can eval its arg twice.
7501         (x_connection_closed):
7502         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7503         * xterm.h: Adjust decls to match defn changes elsewhere.
7504         (struct scroll_bar): Use struct vectorlike_header
7505         rather than rolling our own approximation.
7506         (SCROLL_BAR_VEC_SIZE): Remove; not used.
7508 2012-05-25  Glenn Morris  <rgm@gnu.org>
7510         * lisp.mk (lisp): Update for more files being compiled now.
7512 2012-05-25  Stefan Monnier  <monnier@iro.umontreal.ca>
7514         * lread.c: Remove `read_pure' which makes no difference.
7515         (read_pure): Remove var.
7516         (unreadpure): Remove function.
7517         (readevalloop): Don't call read_list with -1 flag.
7518         (read1, read_vector): Don't test read_pure any more.
7519         (read_list): Simplify.
7521         * fileio.c, character.h: Minor style tweaks.
7523 2012-05-24  Dmitry Antipov  <dmantipov@yandex.ru>
7525         * window.h (clip_changed): Remove useless declaration.
7527 2012-05-22  Juanma Barranquero  <lekktu@gmail.com>
7529         * makefile.w32-in: Follow-up to revno:108341.
7530         (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7532 2012-05-22  Paul Eggert  <eggert@cs.ucla.edu>
7534         Remove src/m/*.
7535         This directory predates autoconf and is no longer needed nowadays.
7536         Move its few remaining bits of functionality to where they're needed.
7537         * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7538         * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7539         * m/template.h: Remove.
7540         * Makefile.in (M_FILE): Remove.  All uses removed.
7541         * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7542         * lisp.h (USE_LSB_TAG):
7543         * mem-limits.h (EXCEEDS_LISP_PTR):
7544         Use VAL_MAX, not VALBITS, in #if.
7545         * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7546         (EMACS_UINT): Define unconditionally now.
7547         (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7548         (BITS_PER_EMACS_INT): New constants, replacing
7549         what used to be in config.h, but not useful in #if.
7550         (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7551         define them any more.
7552         (VAL_MAX): New macro.
7553         (VALMASK): Use it.
7554         * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7555         BITS_PER_EMACS_INT, in #if.
7556         * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7557         (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7558         * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7559         * s/ms-w32.h (DATA_START):
7560         Move here from removed file m/intel386.h.
7561         * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7562         * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7564 2012-05-21  Paul Eggert  <eggert@cs.ucla.edu>
7566         Assume C89 or later.
7567         * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7568         * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7569         (xrealloc):
7570         * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7571         * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7572         * textprop.c, tparam.c (NULL): Remove.
7573         * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7574         * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7575         * regex.h (_RE_ARGS): Remove.  All uses rewritten to use prototypes.
7576         * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7577         * xterm.c (input_signal_count): Assume volatile works.
7579 2012-05-21  Ken Brown  <kbrown@cornell.edu>
7581         * xgselect.c (xg_select): Fix first argument in call to 'select'
7582         (bug#11508).
7584 2012-05-20  Ken Brown  <kbrown@cornell.edu>
7586         * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
7587         [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
7589 2012-05-19  Ken Brown  <kbrown@cornell.edu>
7591         * xfns.c (x_in_use): Remove `static' qualifier.
7592         * xterm.h (x_in_use): Declare.
7593         * xgselect.c: Include xterm.h.
7594         (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7595         and `display_arg' (bug#9754).
7597 2012-05-19  Paul Eggert  <eggert@cs.ucla.edu>
7599         * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7601         * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7602         * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7604 2012-05-18  Eli Zaretskii  <eliz@gnu.org>
7606         Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7608         * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
7609         (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
7611         * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7612         reference to image_cache->refcount.
7613         (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7615 2012-05-17  Juri Linkov  <juri@jurta.org>
7617         * search.c (Fword_search_regexp, Fword_search_backward)
7618         (Fword_search_forward, Fword_search_backward_lax)
7619         (Fword_search_forward_lax): Move functions to isearch.el
7620         (bug#10145, bug#11381).
7622 2012-05-16  Paul Eggert  <eggert@cs.ucla.edu>
7624         * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7626 2012-05-15  Stefan Monnier  <monnier@iro.umontreal.ca>
7628         * lread.c (init_obarray): Declare Qt and Qnil as special.
7630 2012-05-14  Glenn Morris  <rgm@gnu.org>
7632         * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
7633         Put "libexec" before "bin", for the sake of init_callproc_1.
7635 2012-05-14  Paul Eggert  <eggert@cs.ucla.edu>
7637         * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
7639         * unexaix.c: Port to more-recent AIX compilers.
7640         (report_error, report_error_1, make_hdr, copy_sym)
7641         (mark_x, adjust_lnnoptrs, unrelocate_symbols):
7642         Make arguments const char *, not char *, to avoid violations of C
7643         standard and to fix some AIX warnings reported by Gilles Pion.
7645 2012-05-14  Eli Zaretskii  <eliz@gnu.org>
7647         * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
7648         already have overlays loaded.
7649         (handle_single_display_spec): Before returning without displaying
7650         fringe bitmap, synchronize the bidi iterator with the main display
7651         iterator, by calling iterate_out_of_display_property.
7652         (iterate_out_of_display_property): Detect buffer iteration by
7653         testing that it->string is a Lisp string.
7654         (get_next_display_element): When the current object is exhausted,
7655         and there's something on it->stack, call set_iterator_to_next to
7656         proceed with what's on the stack, instead of returning zero.
7657         (set_iterator_to_next): If called at the end of a Lisp string,
7658         proceed to consider_string_end without incrementing string
7659         position.  Don't increment display vector index past the end of
7660         the display vector.  (Bug#11417)
7661         (pos_visible_p): Don't report a position visible when move_it_to
7662         stopped at the last line of window, which happens to be scanned
7663         backwards by the bidi iteration.  (Bug#11464)
7665 2012-05-14  Eli Zaretskii  <eliz@gnu.org>
7667         * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7668         and right-margin display specs even if the spec is invalid or we
7669         are on a TTY, and thus unable to display on the fringes.
7670         That's because the text with the property will not be displayed anyway,
7671         so we need to signal to the caller that this is a "replacing"
7672         display spec.  This fixes display when the spec is invalid or we
7673         are on a TTY.
7675 2012-05-14  Paul Eggert  <eggert@cs.ucla.edu>
7677         * unexaix.c (make_hdr): Fix typo in prototype.
7678         This bug broke the build on AIX.  Problem reported by Gilles Pion.
7680 2012-05-14  Michael Albinus  <michael.albinus@gmx.de>
7682         * keyboard.c (kbd_buffer_get_event): Read special events also in
7683         batch mode.  (Bug#11415)
7685 2012-05-12  Glenn Morris  <rgm@gnu.org>
7687         * ns.mk: Update for ns_appbindir no longer having trailing "/".
7689 2012-05-12  Eli Zaretskii  <eliz@gnu.org>
7691         * lisp.mk (lisp): Add newcomment.elc.
7693 2012-05-12  Glenn Morris  <rgm@gnu.org>
7695         * Makefile.in (MKDIR_P): New, set by configure.
7696         * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7698 2012-05-11  Paul Eggert  <eggert@cs.ucla.edu>
7700         Remove unused function hourglass_started.
7701         * dispextern.h (hourglass_started):
7702         * w32fns.c (hourglass_started):
7703         * xdisp.c (hourglass_started): Remove.
7705 2012-05-10  Juanma Barranquero  <lekktu@gmail.com>
7707         * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7708         Update dependencies.
7710 2012-05-10  Paul Eggert  <eggert@cs.ucla.edu>
7712         * xgselect.c (xg_select): Put maxfds+1 into a var.
7713         This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7715         * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7717 2012-05-10  Dave Abrahams  <dave@boostpro.com>
7719         * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7720         (lock_file): If create_lockfiles is 0, do nothing.  (Bug#11227)
7722 2012-05-09  Michael Albinus  <michael.albinus@gmx.de>
7724         * dbusbind.c (xd_registered_buses): New internal Lisp object.
7725         Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7726         (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7727         Initialize xd_registered_buses.
7729 2012-05-09  Paul Eggert  <eggert@cs.ucla.edu>
7731         Untag more efficiently if USE_LSB_TAG.
7732         This is based on a proposal by YAMAMOTO Mitsuharu in
7733         <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7734         For an admittedly artificial (nth 8000 longlist) benchmark on
7735         Fedora 15 x86-64, this yields a 25% CPU speedup.  Also, it shrinks
7736         Emacs's overall text size by 1%.
7737         * lisp.h (XUNTAG): New macro.
7738         (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7739         (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7740         (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7741         * eval.c (Fautoload):
7742         * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
7743         * frame.h (XFRAME): Use XUNTAG.
7745         Port recent dbusbind.c changes to 32-bit --with-wide-int.
7746         * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
7747         Remove unportable assumptions about print widths of types like
7748         dbus_uint32_t.
7749         (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
7750         intptr_t when converting between pointer and integer, to avoid GCC
7751         warnings about wrong width.
7753 2012-05-09  Eli Zaretskii  <eliz@gnu.org>
7755         * w32proc.c (new_child): Force Windows to reserve only 64KB of
7756         stack for each reader_thread, instead of defaulting to 8MB
7757         determined by the linker.  This avoids failures in creating
7758         subprocesses on Windows 7, see the discussion in this thread:
7759         http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
7761 2012-05-07  Jérémy Compostella  <jeremy.compostella@gmail.com>
7763         Fix up display of the *Minibuf-0* buffer in the mini window.
7764         * keyboard.c (read_char): Don't clear the echo area if there's no
7765         message to clear.
7766         * xdisp.c (redisplay_internal): Redisplay the mini window (with the
7767         contents of *Minibuf-0*) if there's no message displayed in its stead.
7769 2012-05-07  Michael Albinus  <michael.albinus@gmx.de>
7771         * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
7772         batch mode.
7774 2012-05-06  Chong Yidong  <cyd@gnu.org>
7776         * lisp.mk (lisp): Update.
7778 2012-05-05  Jim Meyering  <meyering@redhat.com>
7780         * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
7782 2012-05-04  Stefan Monnier  <monnier@iro.umontreal.ca>
7784         * data.c (PUT_ERROR): New macro.
7785         (syms_of_data): Use it.  Add new error type `user-error'.
7786         * undo.c (user_error): New function.
7787         (Fprimitive_undo): Use it.
7788         * print.c (print_error_message): Adjust print style for `user-error'.
7789         * keyboard.c (user_error): New function.
7790         (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
7792 2012-05-03  Paul Eggert  <eggert@cs.ucla.edu>
7794         Do not limit current-time-string to years 1000..9999.
7795         * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
7796         (Fcurrent_time_string): Support any year that is supported by the
7797         underlying localtime representation.  Don't use asctime, as it
7798         has undefined behavior for years outside the range -999..9999.
7800 2012-05-02  Paul Eggert  <eggert@cs.ucla.edu>
7802         Fix race conditions involving setenv, gmtime, localtime, asctime.
7803         Without this fix, interrupts could mess up code that uses these
7804         nonreentrant functions, since setting TZ invalidates existing
7805         tm_zone or tzname values, and since most of these functions return
7806         pointers to static storage.
7807         * editfns.c (format_time_string, Fdecode_time, Fencode_time)
7808         (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
7809         Grow the critical sections to include not just invoking
7810         localtime/gmtime, but also accessing these functions' results
7811         including their tm_zone values if any, and any related TZ setting.
7812         (format_time_string): Last arg is now struct tm *, not struct tm **,
7813         so that the struct tm is saved in the critical section.
7814         All callers changed.  Simplify allocation of initial buffer, partly
7815         motivated by the fact that memory allocation needs to be outside
7816         the critical section.
7818 2012-05-02  Dmitry Antipov  <dmantipov@yandex.ru>
7820         * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
7821         with RESET_INTERVAL.
7823         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7824         Remove duplicated buffer name initialization.
7826 2012-05-02  Jim Meyering  <jim@meyering.net>
7828         * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
7830         * xfns.c (x_window): Use xstrdup (Bug#11375).
7832 2012-05-02  Eli Zaretskii  <eliz@gnu.org>
7834         * xdisp.c (pos_visible_p): If already at a newline from the
7835         display string before the 'while' loop, don't walk back the glyphs
7836         from it3.glyph_row.  Solves assertion violation when the display
7837         string begins with a newline (egg.el).  (Bug#11367)
7839 2012-05-01  Stefan Monnier  <monnier@iro.umontreal.ca>
7841         * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
7842         Move to simple.el.
7844 2012-05-01  Glenn Morris  <rgm@gnu.org>
7846         * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
7847         s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
7848         and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
7849         All were removed before 23.1.
7851         * dispnew.c: Remove HAVE_LIBNCURSES test;
7852         it is always true on relevant platforms.
7854         * Makefile.in (LD_SWITCH_X_SITE_RPATH):
7855         Rename from LD_SWITCH_X_SITE_AUX_RPATH.
7857         * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
7859 2012-04-30  Andreas Schwab  <schwab@linux-m68k.org>
7861         * .gdbinit (xpr): Remove checks for no longer existing misc types.
7862         (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
7863         Remove.
7865 2012-04-28  Paul Eggert  <eggert@cs.ucla.edu>
7867         Do not avoid creating empty evaporating overlays (Bug#9642).
7868         * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
7869         That is, do not delete an evaporating overlay if it becomes
7870         empty after its bounds are adjusted to fit within its buffer.
7871         This fix caused other problems, and I'm reverting it until we get
7872         to the bottom of them.
7874 2012-04-27  Chong Yidong  <cyd@gnu.org>
7876         * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
7878 2012-04-27  Eli Zaretskii  <eliz@gnu.org>
7880         * xdisp.c (pos_visible_p): If the window start position is beyond
7881         ZV, start the display from buffer beginning.  Prevents assertion
7882         violation in init_iterator when the minibuffer window is scrolled
7883         via the scroll bar.
7885         * window.c (window_scroll_pixel_based): Likewise.
7887 2012-04-27  Chong Yidong  <cyd@gnu.org>
7889         * keymap.c (where_is_internal): Doc fix (Bug#10872).
7891 2012-04-27  Glenn Morris  <rgm@gnu.org>
7893         * fileio.c (Fcopy_file, Fset_file_selinux_context):
7894         Ignore ENOTSUP failures from setfilecon functions.  (Bug#11245)
7896 2012-04-27  Eli Zaretskii  <eliz@gnu.org>
7898         * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
7899         Don't overrun array limits of glyph row's used[] array.  (Bug#11288)
7901 2012-04-26  Eli Zaretskii  <eliz@gnu.org>
7903         * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
7904         display element, check also the underlying string or buffer
7905         character.  (Bug#11341)
7907         * w32menu.c: Include w32heap.h.
7908         (add_menu_item): If the call to AppendMenuW (via
7909         unicode_append_menu) fails, disable Unicode menus only if we are
7910         running on Windows 9X/Me.
7912 2012-04-24  Andreas Schwab  <schwab@linux-m68k.org>
7914         * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
7915         (xgetint): Add missing shift for LSB tags.
7917 2012-04-24  Martin Rudalics  <rudalics@gmx.at>
7919         * keyboard.c (read_char): Don't wipe echo area for select window
7920         events: These might get delayed via `mouse-autoselect-window'
7921         (Bug#11304).
7923 2012-04-24  Juanma Barranquero  <lekktu@gmail.com>
7925         * gnutls.c (init_gnutls_functions): Protect against (unlikely)
7926         manipulation of :loaded-from data.
7928 2012-04-23  Juanma Barranquero  <lekktu@gmail.com>
7930         * gnutls.c (init_gnutls_functions): The value of :loaded-from is
7931         now a cons (bug#11311).
7933 2012-04-23  Paul Eggert  <eggert@cs.ucla.edu>
7935         Do not create empty overlays with the evaporate property (Bug#9642).
7936         * buffer.c (Fmove_overlay): Delete an evaporating overlay
7937         if it becomes empty after its bounds are adjusted to fit within
7938         its buffer.  Without this fix, in a nonempty buffer (let ((o
7939         (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
7940         yields an empty overlay that has the evaporate property, which is
7941         not supposed to happen.
7943         Fix minor GTK3 problems found by static checking.
7944         * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7945         (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7946         (struct _EmacsFixedClass, emacs_fixed_get_type):
7947         Move decls here from emacsgtkfixed.h, since they needn't be public.
7948         (emacs_fixed_get_type): Now static.
7949         (emacs_fixed_class_init): Omit unused local.
7950         (emacs_fixed_child_type): Remove; unused.
7951         * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7952         (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7953         (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
7954         (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
7955         (EMACS_FIXED_GET_CLASS): Remove; unused.
7956         * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
7958         * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
7959         Problem reported by Juanma Barranquero for Windows -Wunused-function.
7961 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
7963         Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
7964         * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
7965         (__malloc_size_t, __malloc_ptrdiff_t):
7966         Remove.  All uses removed, replaced by the definiens if needed,
7967         since we can assume C89 or better now.
7968         Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
7969         (protect_malloc_state, align, get_contiguous_space)
7970         (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
7971         (malloc_atfork_handler_child, malloc_enable_thread)
7972         (malloc_initialize_1, __malloc_initialize, morecore_nolock)
7973         (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
7974         (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
7975         (special_realloc, _realloc_internal_nolock, _realloc_internal)
7976         (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
7977         (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
7978         Define using prototypes, not old style.
7979         (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
7980         Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
7981         (align): Don't assume that signed integer overflow wraps around.
7982         Omit unused local var.
7983         (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
7984         (_free_internal_nolock, memalign, mallochook, reallochook):
7985         Omit no-longer-needed casts.
7986         (valloc): Use getpagesize, not __getpagesize.
7987         (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
7988         (struct hdr): The 'magic' member is now size_t, not unsigned long.
7990         * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
7992 2012-04-22  Michael Albinus  <michael.albinus@gmx.de>
7994         Move functions from C to Lisp.  Make non-blocking method calls
7995         the default.  Implement further D-Bus standard interfaces.
7997         * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
7998         (QCdbus_request_name_allow_replacement)
7999         (QCdbus_request_name_replace_existing)
8000         (QCdbus_request_name_do_not_queue)
8001         (QCdbus_request_name_reply_primary_owner)
8002         (QCdbus_request_name_reply_in_queue)
8003         (QCdbus_request_name_reply_exists)
8004         (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8005         (QCdbus_registered_serial, QCdbus_registered_method)
8006         (QCdbus_registered_signal): New Lisp objects.
8007         (XD_DEBUG_MESSAGE): Use sizeof.
8008         (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8009         (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8010         (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8011         (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8012         (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8013         (xd_signature, xd_append_arg): Allow float for integer types.
8014         (xd_get_connection_references): New function.
8015         (xd_get_connection_address): Rename from xd_initialize.
8016         Return cached address.
8017         (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8018         (xd_close_bus): Rename from Fdbus_close_bus.  Not needed on Lisp
8019         level.
8020         (Fdbus_init_bus): New optional arg PRIVATE.  Cache address.
8021         Return number of refcounts.
8022         (Fdbus_get_unique_name): Make stronger parameter check.
8023         (Fdbus_message_internal): New defun.
8024         (Fdbus_call_method, Fdbus_call_method_asynchronously)
8025         (Fdbus_method_return_internal, Fdbus_method_error_internal)
8026         (Fdbus_send_signal, Fdbus_register_service)
8027         (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8028         (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8029         (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8030         (Vdbus_compiled_version, Vdbus_runtime_version)
8031         (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8032         (Vdbus_message_type_method_return, Vdbus_message_type_error)
8033         (Vdbus_message_type_signal): New defvars.
8034         (Vdbus_registered_buses, Vdbus_registered_objects_table):
8035         Adapt docstring.
8037 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
8039         Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8040         * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8041         Do not assume ptrdiff_t is the same width as 'int'.
8043         * alloc.c: Handle unusual debugging option combinations.
8044         (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8045         since the two debugging options are incompatible.
8046         (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8047         is defined.
8048         (mem_init, mem_insert, mem_insert_fixup):
8049         Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8050         (NEED_MEM_INSERT): Remove; no longer needed.
8052 2012-04-22  Leo Liu  <sdl.web@gmail.com>
8054         * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8056 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
8058         * sysdep.c [__FreeBSD__]: Minor cleanups.
8059         (list_system_processes, system_process_attributes) [__FreeBSD__]:
8060         Use Emacs indenting style more consistently.  Avoid some casts.
8061         Use 'double' consistently rather than mixing 'float' and 'double'.
8063 2012-04-21  Eduard Wiebe  <usenet@pusto.de>
8065         * sysdep.c (list_system_processes, system_process_attributes):
8066         Add implementation for FreeBSD (Bug#5243).
8068 2012-04-21  Andreas Schwab  <schwab@linux-m68k.org>
8070         * lisp.mk (lisp): Update.
8072 2012-04-20  Paul Eggert  <eggert@cs.ucla.edu>
8074         * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8075         It is never used otherwise.
8077 2012-04-20  Stefan Monnier  <monnier@iro.umontreal.ca>
8079         * print.c (print_preprocess): Only check print_depth if print-circle
8080         is nil.
8081         (print_object): Check for cycles even when print-circle is nil and
8082         print-gensym is t, but only check print_depth if print-circle is nil.
8084 2012-04-20  Chong Yidong  <cyd@gnu.org>
8086         * process.c (wait_reading_process_output): If EIO occurs on a pty,
8087         set the status to "failed" and ensure that sentinel is run.
8089 2012-04-20  Glenn Morris  <rgm@gnu.org>
8091         * process.c (Fset_process_inherit_coding_system_flag)
8092         (Fset_process_query_on_exit_flag): Doc fix (mention return value).
8093         (Fmake_network_process, Fmake_serial_process): Doc fix.
8095 2012-04-20  Eli Zaretskii  <eliz@gnu.org>
8097         * xdisp.c (string_buffer_position_lim): Limit starting position to
8098         BEGV.
8099         (set_cursor_from_row): If called for a mode-line or header-line
8100         row, return zero immediately.
8101         (try_cursor_movement): If inside continuation line, don't back up
8102         farther than the first row after the header line, if any.
8103         Don't consider the header-line row as "partially visible", even if
8104         MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero.  (Bug#11261)
8106 2012-04-20  Atsuo Ohki  <ohki@gssm.otsuka.tsukuba.ac.jp>  (tiny change)
8108         * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8109         (bug#11238).
8111 2012-04-20  Teodor Zlatanov  <tzz@lifelogs.com>
8112 2012-04-18  Paul Eggert  <eggert@cs.ucla.edu>
8114         configure: new option --enable-gcc-warnings (Bug#11207)
8115         * Makefile.in (C_WARNINGS_SWITCH): Remove.
8116         (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8117         (ALL_CFLAGS): Use new macros rather than old.
8118         * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8119         * regex.c: Ignore -Wstrict-overflow.  If !emacs, also ignore
8120         -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8121         -Wunused-result, -Wunused-variable.  This should go away once
8122         the Emacs and Gnulib regex code is merged.
8123         (xmalloc, xrealloc): Now static.
8125 2012-04-17  Paul Eggert  <eggert@cs.ucla.edu>
8127         * dired.c (Fsystem_groups): Remove unused local.
8129 2012-04-17  Glenn Morris  <rgm@gnu.org>
8131         * dired.c (Fsystem_users): Doc fix.
8133 2012-04-17  Dmitry Antipov  <dmantipov@yandex.ru>
8135         * dired.c (Fsystem_users, Fsystem_groups): New functions.  (Bug#7900)
8136         (syms_of_dired): Add them.
8138 2012-04-16  Paul Eggert  <eggert@cs.ucla.edu>
8140         Fix minor alloc.c problems found by static checking.
8141         * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8142         New extern decls, to avoid calling undeclared functions.
8143         (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8144         && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8145         GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8146         (NEED_MEM_INSERT): New macro.
8147         (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
8148         Remove one incorrect comment and fix another.
8150         Fix minor ralloc.c problems found by static checking.
8151         See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8152         * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8153         (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8154         (r_alloc_sbrk): Now static.
8156         Improve ralloc.c interface checking.
8157         See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8158         * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8159         (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8160         * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8161         [REL_ALLOC]: ... to here, to check interface.
8162         * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8163         Remove decls.  This fixes an "It stinks!".
8165         * alloc.c (which_symbols): Fix alignment issue / type clash.
8167 2012-04-15  Andreas Schwab  <schwab@linux-m68k.org>
8169         * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8170         (struct Lisp_Misc_Any): Likewise.
8171         (struct Lisp_Free): Likewise.
8172         * alloc.c (union aligned_Lisp_Symbol): Define.
8173         (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8174         aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8175         (union aligned_Lisp_Misc): Define.
8176         (MARKER_BLOCK_SIZE, struct marker_block): Use union
8177         aligned_Lisp_Misc instead of union Lisp_Misc.
8178         (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
8180 2012-04-14  Paul Eggert  <eggert@cs.ucla.edu>
8182         Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8183         * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8184         * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8185         * s/netbsd.h, s/sol2-6.h:
8186         Remove definition of GC_MARK_STACK, since the default now works.
8187         * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8188         Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8189         no longer the default.
8190         * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8192 2012-04-14  Atsuo Ohki  <ohki@gssm.otsuka.tsukuba.ac.jp>  (tiny change)
8194         * lread.c (lisp_file_lexically_bound_p):
8195         Fix hang at ";-*-\n" (bug#11238).
8197 2012-04-14  Eli Zaretskii  <eliz@gnu.org>
8199         * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8200         "unchanged" if its end.pos is beyond ZV.  (Bug#11199)
8202 2012-04-14  Jan Djärv  <jan.h.d@swipnet.se>
8204         * nsterm.m (constrainFrameRect): Always constrain when there is only
8205         one screen (Bug#10962).
8207 2012-04-13  Ken Brown  <kbrown@cornell.edu>
8209         * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8211 2012-04-13  Reuben Thomas  <rrt@sc3d.org>
8213         * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8215 2012-04-11  Daniel Colascione  <dancol@dancol.org>
8217         * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8218         against is gone.  It's better to use vfork now so that when Cygwin
8219         gains a new, working vfork, we use it automatically (bug#10398).
8221 2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
8223         * window.c (save_window_save): Obey window-point-insertion-type.
8225 2012-04-11  Glenn Morris  <rgm@gnu.org>
8227         * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8229 2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
8231         * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8233 2012-04-10  Jason S. Cornez  <jcornez@ravenpack.com>  (tiny change)
8235         * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8236         (force_quit_count): New var.
8237         (handle_interrupt): Use it.
8239 2012-04-10  Juanma Barranquero  <lekktu@gmail.com>
8241         * w32.c (w32_delayed_load): Record the full path of the library
8242         being loaded (bug#10424).
8244 2012-04-09  Glenn Morris  <rgm@gnu.org>
8246         * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8247         not just in the obarray, before snarfing them.  (Bug#11036)
8249         * Makefile.in ($(leimdir)/leim-list.el):
8250         Pass EMACS rather than BUILT_EMACS.
8252 2012-04-09  Teodor Zlatanov  <tzz@lifelogs.com>
8254         * process.c (make_process):
8255         * process.h: Add integer `gnutls_handshakes_tried' member to
8256         process struct.
8258         * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8259         Add convenience `GNUTLS_LOG2i' macro.
8261         * gnutls.c (gnutls_log_function2i): Convenience log function.
8262         (emacs_gnutls_read): Use new log functions,
8263         `gnutls_handshakes_tried' process member, and
8264         `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8265         attempts per process (connection).
8267 2012-04-09  Chong Yidong  <cyd@gnu.org>
8269         * eval.c (Fuser_variable_p, user_variable_p_eh)
8270         (lisp_indirect_variable): Functions deleted.
8271         (Fdefvar): Caller changed.
8273         * callint.c (Finteractive, Fcall_interactively):
8274         * minibuf.c (Fread_variable): Callers changed.
8276 2012-04-09  Eli Zaretskii  <eliz@gnu.org>
8278         * xdisp.c (set_cursor_from_row): If the display string appears in
8279         the buffer at position that is closer to point than the position
8280         after the display string, display the cursor on the first glyph of
8281         the display string.  Fixes cursor display when a 'display' text
8282         property immediately follows invisible text.  (Bug#11094)
8284 2012-04-09  Paul Eggert  <eggert@cs.ucla.edu>
8286         composite.c: use 'double' consistently
8287         * composite.c (get_composition_id): Use 'double' consistently
8288         instead of converting 'float' to 'double' and vice versa; this is
8289         easier to understand and avoids a GCC warning.
8291 2012-04-09  Glenn Morris  <rgm@gnu.org>
8293         * Makefile.in: Generate leim-list with bootstrap-emacs, in
8294         preparation for dumping it with emacs.  (Bug#4789)
8295         (leimdir): New variable.
8296         ($(leimdir)/leim-list.el): New rule.
8297         (emacs$(EXEEXT)): Depend on leim-list.el.
8299         * buffer.c (Qucs_set_table_for_input): Remove.  (Bug#9821)
8300         (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8301         (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8303 2012-04-08  Andreas Schwab  <schwab@linux-m68k.org>
8305         * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8306         proper alignment.
8308 2012-04-07  Juanma Barranquero  <lekktu@gmail.com>
8310         * xml.c (init_libxml2_functions) [WINDOWSNT]:
8311         Remove unused local variable.
8313 2012-04-07  Paul Eggert  <eggert@cs.ucla.edu>
8315         Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8316         * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8317         (mark_memory): Mark Lisp_Objects only if pointers might hide in
8318         objects, as mark_maybe_pointer will catch them otherwise.
8319         (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8320         * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8322 2012-04-07  Paul Eggert  <eggert@cs.ucla.edu>
8324         Fix typo that broke non-Windows builds.
8325         * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8327 2012-04-07  Eli Zaretskii  <eliz@gnu.org>
8329         Support building on MS-Windows with libxml2.
8331         * makefile.w32-in (OBJ2): Add xml.$(O).
8332         (GLOBAL_SOURCES): Add xml.c.
8333         ($(BLD)/xml.$(O)): New dependency list.
8335         * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8336         (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8337         (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8338         [!WINDOWSNT]: New macros.
8339         (init_libxml2_functions, libxml2_loaded_p): New functions.
8340         (parse_region): Call fn_xmlCheckVersion instead of using the macro
8341         LIBXML_TEST_VERSION.  Call libxml2 functions via the fn_* macros.
8342         (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8343         Calls xmlCleanupParser only if libxml2 was loaded (or statically
8344         linked in).
8345         (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8346         Call init_libxml2_functions before calling libxml2 functions.
8347         (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8349         * emacs.c: Don't include libxml/parser.h.
8350         (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8351         xmlCleanupParser directly.
8353         * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8355 2012-04-07  Eli Zaretskii  <eliz@gnu.org>
8357         * indent.c (Fvertical_motion): If there is a display string at
8358         point, use it.vpos to compute how many lines to backtrack after
8359         move_it_to point.  (Bug#11133)
8361 2012-04-06  Eli Zaretskii  <eliz@gnu.org>
8363         * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8364         * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8365         about subtle differences between FETCH_CHAR* and STRING_CHAR*
8366         macros related to unification of CJK characters.  For the details,
8367         see the discussion following the message here:
8368         http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8370 2012-04-04  Chong Yidong  <cyd@gnu.org>
8372         * keyboard.c (Vdelayed_warnings_list): Doc fix.
8374 2012-04-01  Eli Zaretskii  <eliz@gnu.org>
8376         * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8377         instead of alloca.  (Bug#11138)
8379 2012-04-01  Andreas Schwab  <schwab@linux-m68k.org>
8381         * w32menu.c (is_simple_dialog): Properly check lisp types.
8382         (Bug#11141)
8384 2012-03-31  Eli Zaretskii  <eliz@gnu.org>
8386         * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8387         position we get to after a call to move_it_to fails the
8388         IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8389         only if we wind up in a string from display property.  (Bug#11063)
8391         * window.c (Fdelete_other_windows_internal): Invalidate the row
8392         and column information about mouse highlight, so that redisplay
8393         restores it after reallocating the glyph matrices.  (Bug#7464)
8395         * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8396         string comes from a `display' text property, use the buffer
8397         position of that property as if we actually saw that position in
8398         the row's glyphs.
8399         (move_it_by_lines): Remove the assertion that
8400         "it->current_x == 0 && it->hpos == 0" which can be legitimately
8401         violated when there's a before-string at the beginning of a line.
8402         (Bug#11063)
8404 2012-03-30  Eli Zaretskii  <eliz@gnu.org>
8406         * xdisp.c (append_space_for_newline): If the default face was
8407         remapped, use the remapped face for the appended newline.
8408         (extend_face_to_end_of_line): Use the remapped default face for
8409         extending the face to the end of the line.
8410         (display_line): Call extend_face_to_end_of_line when the default
8411         face was remapped.  (Bug#11068)
8413 2012-03-29  Eli Zaretskii  <eliz@gnu.org>
8415         * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8417 2012-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
8419         * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8421 2012-03-27  Glenn Morris  <rgm@gnu.org>
8423         * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8424         Doc fixes.
8426 2012-03-26  Kenichi Handa  <handa@m17n.org>
8428         * dispextern.h (struct glyph): Fix previous change.  Change the
8429         bit length of glyphless.ch to 25 (Bug#11082).
8431 2012-03-26  Chong Yidong  <cyd@gnu.org>
8433         * keyboard.c (Vselection_inhibit_update_commands): New variable.
8434         (command_loop_1): Use it; inhibit selection update for
8435         handle-select-window too (Bug#8996).
8437 2012-03-25  Fabrice Popineau  <fabrice.popineau@supelec.fr>
8439         * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
8441 2012-03-25  Kenichi Handa  <handa@m17n.org>
8443         * dispextern.h (struct glyph): Change the bit length of
8444         glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8446 2012-03-24  Eli Zaretskii  <eliz@gnu.org>
8448         * s/ms-w32.h (tzname): Include time.h before redirecting to
8449         _tzname.  Fixes the MSVC build.  (Bug#9960)
8451 2012-03-24  Andreas Schwab  <schwab@linux-m68k.org>
8453         * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8454         characters.
8456         * xterm.c (XTread_socket): Only modify handling_signal if
8457         !SYNC_INPUT.  (Bug#11080)
8459 2012-03-23  Eli Zaretskii  <eliz@gnu.org>
8461         * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8462         FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES.  Prevents crashes
8463         when fetching a multibyte character consumes more bytes than
8464         CHAR_BYTES returns, due to unification of CJK characters in
8465         string_char.  (Bug#11073)
8467 2012-03-23  Troels Nielsen  <bn.troels@gmail.com>  (tiny change)
8469         * process.c (wait_reading_process_output): Handle pty disconnect
8470         by refraining from sending oneself a SIGCHLD (bug#10933).
8472 2012-03-22  Chong Yidong  <cyd@gnu.org>
8474         * dispextern.h (struct it): New member string_from_prefix_prop_p.
8476         * xdisp.c (push_prefix_prop): Rename from push_display_prop.
8477         Mark string as coming from a prefix property.
8478         (handle_face_prop): Use default face for prefix strings (Bug#4281).
8479         (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8481 2012-03-21  Chong Yidong  <cyd@gnu.org>
8483         * xfaces.c (Vface_remapping_alist): Doc fix.
8485 2012-03-20  Eli Zaretskii  <eliz@gnu.org>
8487         * w32proc.c (Fw32_set_console_codepage)
8488         (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8489         Doc fixes.
8491 2012-03-20  Chong Yidong  <cyd@gnu.org>
8493         * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8494         to reflect default non-nil value of redisplay-dont-pause.
8496 2012-03-19  Kenichi Handa  <handa@m17n.org>
8498         * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8499         it fit in a valid range (Bug#11003).
8501 2012-03-18  Eli Zaretskii  <eliz@gnu.org>
8503         * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8504         that is not from display property, accept the row as a "cursor
8505         row" if one of the string's character has a non-nil `cursor'
8506         property.  Fixes cursor positioning when there are newlines in
8507         overlay strings, e.g. in icomplete.el.  (Bug#11035)
8509 2012-03-12  Paul Eggert  <eggert@cs.ucla.edu>
8511         * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8513 2012-03-12  Chong Yidong  <cyd@gnu.org>
8515         * eval.c (inhibit_lisp_code): Rename from
8516         inhibit_window_configuration_change_hook; move from window.c.
8518         * xfns.c (unwind_create_frame_1, Fx_create_frame):
8519         * window.c (run_window_configuration_change_hook)
8520         (syms_of_window): Callers changed.
8522 2012-03-11  Chong Yidong  <cyd@gnu.org>
8524         * keymap.c (Fkey_description): Doc fix (Bug#9700).
8526         * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8528 2012-03-10  Chong Yidong  <cyd@gnu.org>
8530         * frame.c (other_visible_frames): Don't assume the selected frame
8531         is visible (Bug#10955).
8533 2012-03-09  Stefan Monnier  <monnier@iro.umontreal.ca>
8535         * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8537 2012-03-08  Jan Djärv  <jan.h.d@swipnet.se>
8539         * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8540         FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8541         zero (Bug#10954).
8543 2012-03-03  Glenn Morris  <rgm@gnu.org>
8545         * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
8547 2012-03-02  Eli Zaretskii  <eliz@gnu.org>
8549         * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8550         position past the first glyph_row that ends at ZV.  (Bug#10902)
8551         (redisplay_window, next_element_from_string): Fix typos in
8552         comments.
8553         (redisplay_window): Pass to move_it_vertically the margin in
8554         pixels, not in screen lines.
8556 2012-03-02  Glenn Morris  <rgm@gnu.org>
8558         * buffer.c (buffer-list-update-hook): Doc fix.
8560 2012-02-29  Eli Zaretskii  <eliz@gnu.org>
8562         * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8563         push_it before setting up the iterator for the first overlay
8564         string, even if we have an empty string loaded.
8565         (next_overlay_string): If there's an empty string on the iterator
8566         stack, pop the stack.  (Bug#10903)
8568 2012-02-25  Paul Eggert  <eggert@cs.ucla.edu>
8570         Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8571         Suggested by Stefan Monnier in
8572         <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8573         * alloc.c (widen_to_Lisp_Object): New static function.
8574         (mark_memory): Also mark Lisp_Objects by fetching pointer words
8575         and widening them to Lisp_Objects.  This would work even if
8576         USE_LSB_TAG is defined and wide integers are used, which might
8577         happen in a future version of Emacs.
8579 2012-02-25  Chong Yidong  <cyd@gnu.org>
8581         * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8582         Doc fix.
8584         * xselect.c (Fx_selection_exists_p): Doc fix.
8585         (x_clipboard_manager_save_all): Print an informative message
8586         before saving to clipboard manager.
8588 2012-02-24  Chong Yidong  <cyd@gnu.org>
8590         * keyboard.c (process_special_events): Handle all X selection
8591         requests in kbd_buffer, not just the next one (Bug#8869).
8593 2012-02-23  Chong Yidong  <cyd@gnu.org>
8595         * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8596         call when setting menu-bar-lines and tool-bar-lines parameters.
8597         (unwind_create_frame_1): New helper function.
8599         * window.c (inhibit_window_configuration_change_hook): New var.
8600         (run_window_configuration_change_hook): Obey it.
8601         (syms_of_window): Initialize it.
8603 2012-02-22  Chong Yidong  <cyd@gnu.org>
8605         * xterm.c (x_draw_image_relief): Add missing type check for
8606         Vtool_bar_button_margin (Bug#10743).
8608 2012-02-21  Chong Yidong  <cyd@gnu.org>
8610         * fileio.c (Vfile_name_handler_alist): Doc fix.
8612         * buffer.c (Fget_file_buffer): Protect against invalid file
8613         handler return value.
8615 2012-02-20  Paul Eggert  <eggert@cs.ucla.edu>
8617         * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8618         when computing $valmask.
8620         Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8621         * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8622         (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8623         It's useless in that case, and it can cause problems on hosts
8624         that allocate halves of EMACS_INT values separately.
8625         Reported by Dan Horák.  Diagnosed by Andreas Schwab in
8626         <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8627         * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8628         UINTPTR_MAX >> VALBITS == 0.  This is required by the above change;
8629         it avoids undefined behavior on hosts where shifting right by more
8630         than the word width has undefined behavior.
8632 2012-02-19  Chong Yidong  <cyd@gnu.org>
8634         * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8635         (Funhandled_file_name_directory, Ffile_name_as_directory)
8636         (Fdirectory_file_name, Fexpand_file_name)
8637         (Fsubstitute_in_file_name): Protect against invalid file handler
8638         return values (Bug#10845).
8640 2012-02-18  Eli Zaretskii  <eliz@gnu.org>
8642         * .gdbinit (pitx): Fix incorrect references to fields of the
8643         iterator stack.
8645 2012-02-17  Chong Yidong  <cyd@gnu.org>
8647         * syntax.c (Fscan_lists): Doc fix (Bug#10833).
8649 2012-02-15  Paul Eggert  <eggert@cs.ucla.edu>
8651         * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
8652         <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
8654 2012-02-15  Chong Yidong  <cyd@gnu.org>
8656         * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
8657         marked as special.  Also, starting docstrings with * is obsolete.
8659 2012-02-13  Andreas Schwab  <schwab@linux-m68k.org>
8661         * gnutls.c (emacs_gnutls_write): Fix last change.
8663 2012-02-13  Lars Ingebrigtsen  <larsi@gnus.org>
8665         * gnutls.c (emacs_gnutls_write): Set errno appropriately for
8666         send_process.
8668 2012-02-13  Stefan Monnier  <monnier@iro.umontreal.ca>
8670         * keymap.c (Fsingle_key_description): Handle char ranges.
8672 2012-02-12  Chong Yidong  <cyd@gnu.org>
8674         * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8675         as that creates a dangerous corner case.
8677         * window.c (Fdelete_window_internal): Invalidate the mouse
8678         highlight (Bug#9904).
8680 2012-02-12  Glenn Morris  <rgm@gnu.org>
8682         * xselect.c (Fx_own_selection_internal)
8683         (Fx_get_selection_internal, Fx_disown_selection_internal)
8684         (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8685         * nsselect.m (Fx_own_selection_internal)
8686         (Fx_disown_selection_internal, Fx_selection_exists_p)
8687         (Fx_selection_owner_p, Fx_get_selection_internal):
8688         Sync docs and argument specs with the xselect.c versions.
8690 2012-02-11  Lars Ingebrigtsen  <larsi@gnus.org>
8692         * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8694 2012-02-11  Eli Zaretskii  <eliz@gnu.org>
8696         * w32select.c (Fx_selection_exists_p): Sync doc string and
8697         argument list with xselect.c.  (Bug#10783)
8699         * w16select.c (Fx_selection_exists_p): Sync doc string and
8700         argument list with xselect.c.  (Bug#10783)
8702 2012-02-10  Glenn Morris  <rgm@gnu.org>
8704         * fns.c (Fsecure_hash): Doc fix.
8706 2012-02-09  Kenichi Handa  <handa@m17n.org>
8708         * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8710 2012-02-07  Chong Yidong  <cyd@gnu.org>
8712         * buffer.c (Fbuffer_local_variables)
8713         (buffer_lisp_local_variables): Handle unbound vars correctly;
8714         don't let Qunbound leak into Lisp.
8716 2012-02-07  Glenn Morris  <rgm@gnu.org>
8718         * image.c (Fimagemagick_types): Doc fix.
8720         * image.c (imagemagick-render-type): Change it from a lisp object
8721         to an integer.  Move the doc here from the lisp manual.
8722         Treat all values not equal to 0 the same.
8724 2012-02-06  Chong Yidong  <cyd@gnu.org>
8726         * doc.c (store_function_docstring): Avoid applying docstring of
8727         alias to base function (Bug#2603).
8729 2012-02-04  Andreas Schwab  <schwab@linux-m68k.org>
8731         * .gdbinit (pp1, pv1): Remove redundant defines.
8732         (pr): Use pp.
8734 2012-02-04  Chong Yidong  <cyd@gnu.org>
8736         * nsterm.m: Declare a global (Bug#10694).
8738 2012-02-04  Eli Zaretskii  <eliz@gnu.org>
8740         * w32.c (get_emacs_configuration_options):
8741         Include --enable-checking, if specified, in the return value.
8743 2012-02-04  Martin Rudalics  <rudalics@gmx.at>
8745         * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
8746         after rounding frame sizes.  (Bug#9723)
8748 2012-02-04  Eli Zaretskii  <eliz@gnu.org>
8750         * keyboard.c (adjust_point_for_property): Don't position point
8751         before BEGV.  (Bug#10696)
8753 2012-02-03  Paul Eggert  <eggert@cs.ucla.edu>
8755         Handle overflow when computing char display width (Bug#9496).
8756         * character.c (char_width): Return EMACS_INT, not int.
8757         (char_width, c_string_width): Check for overflow when
8758         computing the width; this is possible now that individual
8759         characters can have unbounded width.  Problem introduced
8760         by merge from Emacs 23 on 2012-01-19.
8762 2012-02-02  Michael Albinus  <michael.albinus@gmx.de>
8764         * dbusbind.c (Fdbus_register_method): Mention the return value
8765         :ignore in the docstring.
8767 2012-02-02  Glenn Morris  <rgm@gnu.org>
8769         * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
8771         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8772         Unconditionally set to t.  (Bug#10673)
8773         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8774         * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8775         * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
8777 2012-02-02  Kenichi Handa  <handa@m17n.org>
8779         (x_produce_glyphs): Cancel previous change.  If cmp->glyph_len is
8780         0, do not call append_composite_glyph.
8782 2012-02-02  Kenichi Handa  <handa@m17n.org>
8784         * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
8785         NULL (Bug#6988).
8786         (x_produce_glyphs): If the component of a composition is a null
8787         string, set it->pixel_width to 1 to avoid zero-width glyph.
8789 2012-02-01  Eli Zaretskii  <eliz@gnu.org>
8791         * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
8792         first 2 arguments are identical.  This makes inserting large
8793         output from a subprocess an order of magnitude faster on
8794         MS-Windows, where all sbrk'ed memory is always contiguous.
8796 2012-01-31  Glenn Morris  <rgm@gnu.org>
8798         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8799         * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8800         * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
8802 2012-01-29  Glenn Morris  <rgm@gnu.org>
8804         * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
8806 2012-01-28  Samuel Thibault  <sthibault@debian.org>  (tiny change)
8808         * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
8810 2012-01-28  Chong Yidong  <cyd@gnu.org>
8812         * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
8814 2012-01-26  Chong Yidong  <cyd@gnu.org>
8816         * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
8818         * search.c (Fsearch_forward, Fsearch_backward): Document negative
8819         repeat counts (Bug#10507).
8821 2012-01-26  Glenn Morris  <rgm@gnu.org>
8823         * lread.c (syms_of_lread): Doc fix.
8825 2012-01-25  HIROSHI OOTA  <nil@mad.dog.cx>  (tiny change)
8827         * coding.c (encode_designation_at_bol): Change return value to
8828         EMACS_INT.
8830 2012-01-25  Chong Yidong  <cyd@gnu.org>
8832         * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
8834 2012-01-21  Chong Yidong  <cyd@gnu.org>
8836         * floatfns.c (Fcopysign): Make the second argument non-optional,
8837         since nil is not allowed anyway.
8839 2012-01-21  Andreas Schwab  <schwab@linux-m68k.org>
8841         * process.c (read_process_output): Use p instead of XPROCESS (proc).
8842         (send_process): Likewise.
8844 2012-01-19  Martin Rudalics  <rudalics@gmx.at>
8846         * window.c (save_window_save, Fcurrent_window_configuration)
8847         (Vwindow_persistent_parameters): Do not use Qstate.
8848         Rewrite doc-strings.
8850 2012-01-19  Kenichi Handa  <handa@m17n.org>
8852         * character.c (char_width): New function.
8853         (Fchar_width, c_string_width, lisp_string_width):
8854         Use char_width (Bug#9496).
8856 2012-01-16  Martin Rudalics  <rudalics@gmx.at>
8858         * window.c (Vwindow_persistent_parameters): New variable.
8859         (Fset_window_configuration, save_window_save): Handle persistent
8860         window parameters.
8862 2012-01-14  Eli Zaretskii  <eliz@gnu.org>
8864         * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
8865         thrashing the stack of the thread.  (Bug#9087)
8867 2012-01-12  Paul Eggert  <eggert@cs.ucla.edu>
8869         * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
8871 2012-01-11  Eli Zaretskii  <eliz@gnu.org>
8873         * xdisp.c (rows_from_pos_range): Handle the case where the
8874         highlight ends on a newline.  (Bug#10464)
8875         (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
8876         he end column for display of highlight that ends on a newline
8877         before a R2L line.
8879 2012-01-11  Glenn Morris  <rgm@gnu.org>
8881         * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
8882         from load-path also when installation-directory is nil.  (Bug#10208)
8884 2012-01-10  Glenn Morris  <rgm@gnu.org>
8886         * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
8888         * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
8889         Update template values to be closer to their typical values these days.
8891 2012-01-09  Eli Zaretskii  <eliz@gnu.org>
8893         * xdisp.c (rows_from_pos_range): Accept additional argument
8894         DISP_STRING, and accept any glyph in a row whose object is that
8895         string as eligible for mouse highlight.  Fixes mouse highlight of
8896         display strings from overlays.  (Bug#10464)
8898 2012-01-07  Paul Eggert  <eggert@cs.ucla.edu>
8900         emacs: fix an auto-save permissions race condition (Bug#10400)
8901         * fileio.c (auto_saving_dir_umask): New static var.
8902         (Fmake_directory_internal): Use it.
8903         (do_auto_save_make_dir): Set it, instead of invoking chmod after
8904         creating the directory.  The old code temporarily assigns
8905         too-generous permissions to the directory.
8906         (do_auto_save_eh): Clear it.
8907         (Fdo_auto_save): Catch all errors, not just file errors, so
8908         that the var is always cleared.
8910 2012-01-07  Eli Zaretskii  <eliz@gnu.org>
8912         * search.c (scan_buffer): Pass character positions to
8913         know_region_cache, not byte positions.  (Bug#6540)
8915 2012-01-07  LynX  <_LynX@bk.ru>  (tiny change)
8917         * w32.c (sys_rename): Report EXDEV when rename of a directory
8918         fails because the target is on another logical disk.  (Bug#10284)
8920 2012-01-07  David Benjamin  <davidben@mit.edu>  (tiny change)
8922         * xterm.c (x_embed_request_focus): New function.
8924         * xterm.h: Add prototype.
8926         * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
8928 2012-01-05  Glenn Morris  <rgm@gnu.org>
8930         * emacs.c (emacs_copyright): Update short copyright year to 2012.
8932 2012-01-01  Eli Zaretskii  <eliz@gnu.org>
8934         * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
8935         Load gnutls_transport_set_lowat only if GnuTLS version is below
8936         2.11.1.
8937         (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
8938         GnuTLS versions below 2.11.1.
8940 2011-12-31  Antoine Levitt  <antoine.levitt@gmail.com>
8942         * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
8943         to the doc string advising against its use for altering the way
8944         windows are scrolled.
8946 2011-12-28  Kenichi Handa  <handa@m17n.org>
8948         * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
8949         coding-system ASCII compatible only when it does not produce BOM
8950         on encoding (Bug#10383).
8952 2011-12-26  Jan Djärv  <jan.h.d@swipnet.se>
8954         * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
8955         can scroll.
8956         (create_and_show_popup_menu): Always use menu_position_func for
8957         Gtk3 (Bug#10361).
8959 2011-12-24  Andreas Schwab  <schwab@linux-m68k.org>
8961         * callint.c (Fcall_interactively): Don't truncate prompt string.
8963 2011-12-23  Eli Zaretskii  <eliz@gnu.org>
8965         * xdisp.c (handle_invisible_prop): Handle correctly an invisible
8966         property that ends at ZV, so that the bidi iteration could be
8967         resumed from there (after widening).  (Bug#10360)
8969 2011-12-22  Jan Djärv  <jan.h.d@swipnet.se>
8971         * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
8973 2011-12-21  Jan Djärv  <jan.h.d@swipnet.se>
8975         * nsterm.m (x_free_frame_resources):
8976         Release f->output_data.ns->miniimage.
8977         (ns_index_color): Fix indentation.  Do not retain
8978         color_table->colors[i].
8980         * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
8981         before returning.
8983         * nsfns.m (x_set_background_color): Assign return value from
8984         ns_index_color to face-background instead of NSColor*.
8985         (ns_implicitly_set_icon_type): Fix indentation.
8986         Change assignment in for loop to comparison.
8988         * emacs.c (ns_pool): New variable.
8989         (main): Assign ns_pool.
8990         (Fkill_emacs): Call ns_release_autorelease_pool.
8992         * nsfont.m (ns_spec_to_descriptor): Fix indentation,
8993         autorelease fdesc, release fdAttrs and tdict.
8994         (ns_get_covering_families): Release charset.
8995         (ns_findfonts): Release NSFontDescriptor created with new.
8996         (ns_uni_to_glyphs): Fix indentation.
8997         (setString): Release attrStr before assigning new value.
8999 2011-12-18  Jan Djärv  <jan.h.d@swipnet.se>
9001         * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9002         and NS_IMPL_COCOA.
9003         (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9004         (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9006 2011-12-18  David Reitter  <reitter@cmu.edu>
9008         * nsterm.m (ns_term_init): Subscribe for notifications
9009         NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9010         to method trackingNotification in EmacsMenu.
9012         * nsmenu.m (trackingMenu): New variable.
9013         (trackingNotification): New method (from Aquamacs).
9014         (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
9015         from Aquamacs (Bug#7030).
9017 2011-12-18  Jan Djärv  <jan.h.d@swipnet.se>
9019         * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9020         (symbol_to_nsstring): Fix indentation.
9021         (ns_symbol_to_pb): New function.
9022         (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9023         (Fns_rotate_cut_buffers_internal): Remove.
9024         (Fns_store_selection_internal): Rename from
9025         Fns_store_cut_buffer_internal.
9026         (ns_get_foreign_selection, Fx_own_selection_internal)
9027         (Fx_disown_selection_internal, Fx_selection_exists_p)
9028         (Fns_get_selection_internal, Fns_store_selection_internal):
9029         Use ns_symbol_to_pb and check if return value is nil.
9030         (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT.  Remove defsubr
9031         Sns_rotate_cut_buffers_internal.  Sns_get_cut_buffer_internal
9032         renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9033         renamed to Sns_store_selection_internal.
9034         (ns_handle_selection_request): Move code to Fx_own_selection_internal
9035         and remove this function.
9036         (ns_handle_selection_clear): Remove, never used.
9037         (Fx_own_selection_internal): Move code from ns_handle_selection_request
9038         here.
9040 2011-12-17  Ken Brown  <kbrown@cornell.edu>
9042         * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9043         GID is unknown (Bug#10257).
9045 2011-12-17  Paul Eggert  <eggert@cs.ucla.edu>
9047         * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9048         (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9049         which caused a build failure on GNU/Linux IA-64.  This problem was
9050         introduced by my 2011-10-07 patch.
9052 2011-12-15  Juri Linkov  <juri@jurta.org>
9054         * image.c (imagemagick_error): New function.  (Bug#10112)
9055         (imagemagick_load_image): Comment out `MagickSetResolution' call.
9056         Use `imagemagick_error' where ImageMagick functions return
9057         `MagickFalse'.
9058         (Fimagemagick_types): Add `Fnreverse' to return the list in the
9059         proper order.
9061 2011-12-15  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
9063         * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9064         fill background (Bug#8992).
9066 2011-12-13  Martin Rudalics  <rudalics@gmx.at>
9068         * window.c (Vwindow_combination_resize)
9069         (Vwindow_combination_limit): Use t instead of non-nil in
9070         doc-strings.
9071         (Vrecenter_redisplay): Add first sentence of doc-string on
9072         separate line.
9073         (Frecenter): Fix doc-string typo.
9075 2011-12-11  Kenichi Handa  <handa@m17n.org>
9077         * coding.c (Funencodable_char_position): Pay attention to the
9078         buffer text relocation (Bug#9389).
9080 2011-12-10  Jan Djärv  <jan.h.d@swipnet.se>
9082         * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9083         gtk_init (Bug#10100).
9085 2011-12-10  Eli Zaretskii  <eliz@gnu.org>
9087         * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9088         IT->string is nil.  (Bug#10263)
9090 2011-12-10  Jan Djärv  <jan.h.d@swipnet.se>
9092         * nsterm.h (x_free_frame_resources): Declare.
9094         * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9095         (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9097         * nsterm.h (ns_get_defaults_value): Declare.
9099         * nsterm.m (ns_default): Call ns_get_defaults_value.
9101 2011-12-09  Eli Zaretskii  <eliz@gnu.org>
9103         * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9104         (Bug#10170)
9106 2011-12-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
9108         * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9109         that where the value of an _OBJC_* symbol points to is in the .bss
9110         section (Bug#10240).
9112 2011-12-08  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
9114         * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
9115         after the loop to call ccl_driver at least once (Bug#8619).
9117 2011-12-08  Kenichi Handa  <handa@m17n.org>
9119         * ftfont.c (get_adstyle_property): Fix previous change
9120         (Bug#10233).
9122 2011-12-07  Juanma Barranquero  <lekktu@gmail.com>
9124         * w32.c (init_environment): If no_site_lisp, remove site-lisp
9125         dirs from the default value of EMACSLOADPATH (bug#10208).
9127 2011-12-07  Glenn Morris  <rgm@gnu.org>
9129         * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9130         installation and source directories as well.  (Bug#10208)
9132 2011-12-06  Chong Yidong  <cyd@gnu.org>
9134         * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9136 2011-12-06  Glenn Morris  <rgm@gnu.org>
9138         * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9139         as an error, not just -1.  (Bug#10217)
9141 2011-12-05  Chong Yidong  <cyd@gnu.org>
9143         * keyboard.c (process_special_events): New function.
9144         (swallow_events, Finput_pending_p): Use it (Bug#10195).
9146 2011-12-05  Paul Eggert  <eggert@cs.ucla.edu>
9148         * coding.c (encode_designation_at_bol): Don't use uninitialized
9149         local variable (Bug#9318).
9151 2011-12-05  Kenichi Handa  <handa@m17n.org>
9153         * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9154         return Qnil (Bug#8046, Bug#10193).
9156 2011-12-05  Kenichi Handa  <handa@m17n.org>
9158         * coding.c (encode_designation_at_bol): New args charbuf_end and
9159         dst.  Return the number of produced bytes.  Callers changed.
9160         (coding_set_source): Return how many bytes coding->source was
9161         relocated.
9162         (coding_set_destination): Return how many bytes
9163         coding->destination was relocated.
9164         (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
9165         (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
9167 2011-12-05  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
9169         * coding.c (CODING_CHAR_CHARSET_P): New macro.
9170         (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9171         macro (Bug#9318).
9173 2011-12-05  Andreas Schwab  <schwab@linux-m68k.org>
9175         The following changes are to fix Bug#9318.
9177         * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
9178         (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9179         (encode_coding_iso_2022, encode_coding_sjis)
9180         (encode_coding_big5, encode_coding_charset): Use the above macros.
9182 2011-12-05  Juanma Barranquero  <lekktu@gmail.com>
9184         * lisp.h (process_quit_flag): Fix external declaration.
9186 2011-12-04  Stefan Monnier  <monnier@iro.umontreal.ca>
9188         Don't macro-inline non-performance-critical code.
9189         * eval.c (process_quit_flag): New function.
9190         * lisp.h (QUIT): Use it.
9192 2011-12-04  Jan Djärv  <jan.h.d@swipnet.se>
9194         * nsfns.m (get_geometry_from_preferences): New function.
9195         (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9197 2011-12-04  Andreas Schwab  <schwab@linux-m68k.org>
9199         * emacs.c (Qkill_emacs): Define.
9200         (syms_of_emacs): Initialize it.
9201         * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9202         Qquit_flag to `kill-emacs' instead.
9203         (quit_throw_to_read_char): Add parameter `from_signal'.
9204         All callers changed.  Call Fkill_emacs if requested and safe.
9205         * lisp.h (QUIT): Call Fkill_emacs if requested.
9207 2011-12-03  Jan Djärv  <jan.h.d@swipnet.se>
9209         * widget.c (update_wm_hints): Return if wmshell is null.
9210         (widget_update_wm_size_hints): New function.
9212         * widget.h (widget_update_wm_size_hints): Declare.
9214         * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9215         widget_update_wm_size_hints (Bug#10104).
9217 2011-12-03  Eli Zaretskii  <eliz@gnu.org>
9219         * xdisp.c (handle_invisible_prop): If the invisible text ends just
9220         before a newline, prepare the bidi iterator for consuming the
9221         newline, and keep the current paragraph direction.  (Bug#10183)
9222         (redisplay_window): Don't let `margin' become negative.  (Bug#10192)
9224 2011-12-02  Juri Linkov  <juri@jurta.org>
9226         * search.c (Fword_search_regexp): New Lisp function created from
9227         `wordify'.  Change type of arg `lax' from `int' to `Lisp_Object'.
9228         (Fword_search_backward, Fword_search_forward)
9229         (Fword_search_backward_lax, Fword_search_forward_lax):
9230         Use `Fword_search_regexp' instead of `wordify'.  Doc fix.
9231         (syms_of_search): Define `Sword_search_regexp'.  (Bug#10145)
9233 2011-12-01  Stefan Monnier  <monnier@iro.umontreal.ca>
9235         * fileio.c (Finsert_file_contents): Move after-change-function call
9236         to before the "handled:" label, since all "goto handled" appear in
9237         cases where the *-change-functions have already been properly called
9238         (bug#10117).
9240 2011-12-01  Andreas Schwab  <schwab@linux-m68k.org>
9242         * keyboard.c (interrupt_signal): Don't call kill-emacs when
9243         waiting for input.  (Bug#10169)
9245 2011-11-30  Eli Zaretskii  <eliz@gnu.org>
9247         * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9248         verifies glyph row's hash code--we have just reallocated the
9249         glyphs, so their contents can be complete garbage.  (Bug#10164)
9251 2011-11-30  Juanma Barranquero  <lekktu@gmail.com>
9253         * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9255 2011-11-30  Eli Zaretskii  <eliz@gnu.org>
9257         * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9258         attributes are tested _before_ calling verify_row_hash, to protect
9259         against GCC re-ordering of the tests.  (Bug#10164)
9261 2011-11-29  Jan Djärv  <jan.h.d@swipnet.se>
9263         * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9265         * xterm.c (handle_one_xevent): Only set async_visible and friends
9266         if net_wm_state_hidden_seen is non-zero (Bug#10002)
9267         (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
9268         _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9270 2011-11-28  Paul Eggert  <eggert@cs.ucla.edu>
9272         Remove GCPRO-related macros that exist only to avoid shadowing locals.
9273         * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9274         (GCPRO6_VAR, UNGCPRO_VAR): Remove.  See
9275         <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9276         All uses changed to use GCPRO1 etc.
9277         (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9278         Revert to old implementation (i.e., before 2011-03-11).
9280 2011-11-28  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
9282         * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9283         of scroll runs so as to avoid assigning disabled bogus rows and
9284         unnecessary graphics copy operations.
9286 2011-11-27  Eli Zaretskii  <eliz@gnu.org>
9288         * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9289         (snprintf) [_MSC_VER]: Redirect to _snprintf.
9290         (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9291         (malloc, free, realloc, calloc): Redirect to e_* only when
9292         compiling Emacs.
9294         * lisp.h (GCTYPEBITS): Move before first use.
9295         (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9296         (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9297         this macro definition.
9299         * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9300         _MSC_VER.
9302 2011-11-27  Jan Djärv  <jan.h.d@swipnet.se>
9304         * gtkutil.c (xg_create_frame_widgets):
9305         Call gtk_window_set_has_resize_grip (FALSE) if that function is
9306         present with Gtk+ 2.0.
9308 2011-11-26  Paul Eggert  <eggert@cs.ucla.edu>
9310         * fileio.c (Finsert_file_contents): Undo previous change; see
9311         <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9313 2011-11-26  Paul Eggert  <eggert@cs.ucla.edu>
9315         Rename locals to avoid shadowing.
9316         * fileio.c (Finsert_file_contents):
9317         Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9318         * process.c (wait_reading_process_output):
9319         Rename inner 'proc' to 'p' to avoid shadowing.
9320         Indent for consistency with usual Emacs style.
9322 2011-11-25  Eli Zaretskii  <eliz@gnu.org>
9324         * xdisp.c (redisplay_window): If cursor row is not fully visible
9325         after recentering, and scroll-conservatively is set to a large
9326         number, scroll window by a few more lines to make the cursor fully
9327         visible and out of scroll-margin.  (Bug#10105)
9328         (start_display): Don't move to the next line if the display should
9329         start at a newline that is part of a display vector or an overlay
9330         string.  (Bug#10119)
9332 2011-11-24  Juri Linkov  <juri@jurta.org>
9334         * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9335         after the `MagickPingImage' call.  (Bug#10112)
9337 2011-11-23  Chong Yidong  <cyd@gnu.org>
9339         * window.c (Fcoordinates_in_window_p): Accept only live windows.
9341 2011-11-23  Martin Rudalics  <rudalics@gmx.at>
9343         * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9344         making another buffer current.  (Bug#10114)
9346 2011-11-23  Glenn Morris  <rgm@gnu.org>
9348         * font.c (font_find_for_lface) [HAVE_NS]: Ignore case.  (Bug#2526)
9350 2011-11-23  Chong Yidong  <cyd@gnu.org>
9352         * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9353         using it (Bug#5984).
9355 2011-11-22  Eli Zaretskii  <eliz@gnu.org>
9357         * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9358         and header-lines, as they don't have one computed for them.
9359         (Bug#10098)
9361         * .gdbinit (prow): Make displayed values more self-explaining.
9362         Add row's hash code.
9364 2011-11-21  Lars Magne Ingebrigtsen  <larsi@gnus.org>
9366         * process.c (wait_reading_process_output): Fix asynchrounous
9367         GnuTLS socket handling on some versions of the GnuTLS library.
9368         (wait_reading_process_output): Add comment and URL.
9370 2011-11-21  Jan Djärv  <jan.h.d@swipnet.se>
9372         * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9374 2011-11-21  Chong Yidong  <cyd@gnu.org>
9376         * window.c (Fnext_window, Fprevious_window): Doc fix.
9378 2011-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
9380         * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9382 2011-11-20  Juanma Barranquero  <lekktu@gmail.com>
9384         * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9386 2011-11-20  Martin Rudalics  <rudalics@gmx.at>
9388         * window.c (Fset_window_combination_limit): Rename argument
9389         STATUS to LIMIT.
9390         (Vwindow_combination_limit): Remove "status" from doc-string.
9392 2011-11-20  Andreas Schwab  <schwab@linux-m68k.org>
9394         * m/ibms390.h: Remove.
9395         * m/ibms390x.h: Don't include "ibms390.h".
9397 2011-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
9399         * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9400         Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9402 2011-11-20  Juanma Barranquero  <lekktu@gmail.com>
9404         * casetab.c (Fset_case_table):
9405         * charset.c (Fcharset_after): Fix typos.
9407 2011-11-20  Paul Eggert  <eggert@cs.ucla.edu>
9409         Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9410         Otherwise, valgrind does not work on some platforms.
9411         Problem reported by Andreas Schwab in
9412         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9413         * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9414         is set, removing the need for VIRT_ADDRESS_VARIES.
9415         (PURE_P): Use a more-efficient implementation that needs just one
9416         comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9417         number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9418         to 4 (xorl, subq, cmpq, setbe).
9419         * alloc.c (pure): Always extern now, since that's the
9420         VIRT_ADDR_VARIES behavior.
9421         (PURE_POINTER_P): Use a single comparison, not two, for
9422         consistency with the new puresize.h.
9423         * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9424         * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9425         Remove VIRT_ADDR_VARIES no longer needed.
9427 2011-11-19  Eli Zaretskii  <eliz@gnu.org>
9429         * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9430         (erase_phys_cursor, update_window_cursor, show_mouse_face)
9431         (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9432         behave as if the cursor position were at the window margin.
9434         * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9435         and the cursor position is out of bounds, behave as if the cursor
9436         position were at the window margin.  (Bug#10075)
9438 2011-11-18  Chong Yidong  <cyd@gnu.org>
9440         * window.c (Fwindow_combination_limit): Make first argument
9441         non-optional, since it is meaningless for live windows like the
9442         selected window.
9444 2011-11-18  Dmitry Antipov  <dmantipov@yandex.ru>
9446         * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9448 2011-11-18  Stefan Monnier  <monnier@iro.umontreal.ca>
9450         * intervals.c: Fix grafting over the whole buffer (bug#10071).
9451         (graft_intervals_into_buffer): Simplify.
9453 2011-11-18  Eli Zaretskii  <eliz@gnu.org>
9455         * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9456         hash values of the two rows.
9457         (copy_row_except_pointers): Preserve the used[] arrays and the
9458         hash values of the two rows.  (Bug#10035)
9459         (add_row_entry): Add xassert to verify that ROW's hash code is valid.
9461         * xdisp.c (row_hash): New function, body extracted from
9462         compute_line_metrics.
9463         (compute_line_metrics): Call row_hash, instead of computing the
9464         hash code inline.
9466         * dispnew.c (verify_row_hash): Call row_hash for computing the
9467         hash code of a row, instead of duplicating code from xdisp.c.
9469         * dispextern.h (row_hash): Add prototype.
9471 2011-11-18  Tassilo Horn  <tassilo@member.fsf.org>
9473         * frame.c (delete_frame): Don't delete the terminal when the last
9474         X frame is closed if emacs is built with GTK toolkit.
9476 2011-11-17  Juanma Barranquero  <lekktu@gmail.com>
9478         * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9480 2011-11-17  Martin Rudalics  <rudalics@gmx.at>
9482         * window.c (Vwindow_splits): Rename to
9483         Vwindow_combination_resize.  Suggested by Juri Linkov.
9484         (Fsplit_window_internal): Use Vwindow_combination_resize instead
9485         of Vwindow_splits.
9487 2011-11-16  Juanma Barranquero  <lekktu@gmail.com>
9489         * nsfns.m (Fns_font_name):
9490         * window.c (syms_of_window) <window-combination-limit>: Fix typos.
9492 2011-11-16  Martin Rudalics  <rudalics@gmx.at>
9494         * window.h (window): Rename slot "nest" to "combination_limit".
9495         * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9496         (Fset_window_nest): Rename to Fset_window_combination_limit.
9497         (Vwindow_nest): Rename to Vwindow_combination_limit.
9498         (recombine_windows, make_parent_window, make_window)
9499         (Fsplit_window_internal, saved_window)
9500         (Fset_window_configuration, save_window_save): Rename all
9501         occurrences of window_nest to window_combination_limit.
9503 2011-11-15  Juanma Barranquero  <lekktu@gmail.com>
9505         * image.c (imagemagick_load_image): Fix typo.
9507 2011-11-14  Eli Zaretskii  <eliz@gnu.org>
9509         * xdisp.c (display_line): Move the call to
9510         highlight_trailing_whitespace before the call to
9511         compute_line_metrics, since the latter needs to see the final
9512         faces of all the glyphs to compute ROW's hash value.
9513         Fixes assertion violations in row_equal_p.  (Bug#10035)
9515 2011-11-14  Juanma Barranquero  <lekktu@gmail.com>
9517         * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9518         just return (bug#10044).
9520 2011-11-12  Eli Zaretskii  <eliz@gnu.org>
9522         * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9523         with user-defined heap size.  Bump the default size of the temacs
9524         heap to 27MB, to avoid memory warning when running temacs.
9525         ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9527         * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9528         current_matrix and desired_matrix.  (Bug#9990)
9529         (verify_row_hash) [XASSERTS]: New function.
9530         (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9531         that the hash value of glyph rows is correct.
9533 2011-11-12  Martin Rudalics  <rudalics@gmx.at>
9535         * window.h (window): Remove splits slot.
9536         * window.c (Fwindow_splits, Fset_window_splits): Remove.
9537         (Fdelete_other_windows_internal, make_parent_window)
9538         (make_window, Fsplit_window_internal, Fdelete_window_internal)
9539         (Fset_window_configuration, save_window_save): Don't deal with
9540         split status of windows.
9541         (saved_window): Remove splits slot.
9542         (Vwindow_splits): Rewrite doc-string.
9544 2011-11-11  Jan Djärv  <jan.h.d@swipnet.se>
9546         * xfns.c (unwind_create_frame):
9547         * nsfns.m (unwind_create_frame):
9548         * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9549         Vframe_list (Bug#9999).
9551 2011-11-11  Dmitry Antipov  <dmantipov@yandex.ru>
9553         * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
9555 2011-11-11  Kenichi Handa  <handa@m17n.org>
9557         * callproc.c (Fcall_process): Set the member dst_multibyte of
9558         process_coding.
9560 2011-11-11  Johan Bockgård  <bojohan@gnu.org>
9562         * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9563         avoid a crash (bug#9496).
9565 2011-11-09  Chong Yidong  <cyd@gnu.org>
9567         * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9568         (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9570 2011-11-08  Paul Eggert  <eggert@cs.ucla.edu>
9572         * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9574 2011-11-08  Paul Eggert  <eggert@cs.ucla.edu>
9576         Avoid some portability problems by eschewing 'extern inline' functions.
9577         The trivial performance wins aren't worth the portability hassles; see
9578         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9579         et seq.
9580         * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9581         (window_box_width, window_box_left, window_box_left_offset)
9582         (window_box_right, window_box_right_offset): Undo previous change,
9583         by removing the "extern"s.
9584         * intervals.c (adjust_intervals_for_insertion)
9585         (adjust_intervals_for_deletion): Undo previous change,
9586         making these static again.
9587         (offset_intervals, temp_set_point_both, temp_set_point)
9588         (copy_intervals_to_string): No longer inline.
9589         * xdisp.c (window_text_bottom_y, window_box_width)
9590         (window_box_height, window_box_left_offset)
9591         (window_box_right_offset, window_box_left, window_box_right)
9592         (window_box): No longer inline.
9594 2011-11-08  Chong Yidong  <cyd@gnu.org>
9596         * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
9597         (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9598         Signal an error if not a live window.
9599         (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9600         (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9602 2011-11-07  Juanma Barranquero  <lekktu@gmail.com>
9604         * lisp.h (syms_of_abbrev): Remove declaration.
9605         Reported by CHENG Gao <chenggao@royau.me>.
9607 2011-11-07  Eli Zaretskii  <eliz@gnu.org>
9609         * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9610         if Vpurify_flag is non-nil.  Fixes a crash when running w32 build
9611         of temacs in GUI mode.
9613 2011-11-07  Martin Rudalics  <rudalics@gmx.at>
9615         * window.h: Declare delete_all_child_windows instead of
9616         delete_all_subwindows.
9617         * window.c (Fwindow_nest, Fset_window_nest)
9618         (Fset_window_new_total, Fset_window_new_normal)
9619         (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9620         (delete_all_subwindows): Rename to delete_all_child_windows.
9621         (Fdelete_other_windows_internal, Fset_window_configuration):
9622         Call delete_all_child_windows instead of delete_all_subwindows.
9623         * frame.c (delete_frame): Call delete_all_child_windows instead
9624         of delete_all_subwindows.
9626 2011-11-07  Paul Eggert  <eggert@cs.ucla.edu>
9628         * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9629         This is also needed for porting to any host where GC_MARK_STACK is
9630         not GC_MAKE_GCPROS_NOOPS.
9631         (which_symbols): Use it.
9633 2011-11-07  Kenichi Handa  <handa@m17n.org>
9635         * coding.c (coding_set_destination): Check coding->src_pos only
9636         when coding->src_object is a buffer (bug#9910).
9638         * process.c (send_process): Set the member src_multibyte of coding
9639         to 0 (bug#9911) when sending a unibyte text.
9641         * callproc.c (Fcall_process): Set the member src_multibyte of
9642         process_coding to 0 (bug#9912).
9644 2011-11-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
9646         * xmenu.c (cleanup_widget_value_tree): New function.
9647         (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
9648         calling free_menubar_widget_value_tree directly (Bug#9830).
9650 2011-11-06  Paul Eggert  <eggert@cs.ucla.edu>
9652         Fix some portability problems with 'inline'.
9653         * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9654         (window_box_width, window_box_left, window_box_left_offset)
9655         (window_box_right, window_box_right_offset): Declare extern.
9656         Otherwise, these inline functions do not conform to C99 and
9657         are miscompiled by Microsoft compilers.  Reported by Eli Zaretskii in
9658         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
9659         * intervals.c (adjust_intervals_for_insertion)
9660         (adjust_intervals_for_deletion): Now extern, because otherwise the
9661         extern inline functions 'offset_intervals' couldn't refer to it.
9662         (static_offset_intervals): Remove.
9663         (offset_intervals): Rewrite using the old contents of
9664         static_offset_intervals.  The old version didn't conform to C99
9665         because an extern inline function contained a reference to an
9666         identifier with static linkage.
9668 2011-11-06  Andreas Schwab  <schwab@linux-m68k.org>
9670         * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9671         GC.
9673 2011-11-06  Eli Zaretskii  <eliz@gnu.org>
9675         * xdisp.c (init_iterator, reseat_to_string): Don't set the
9676         iterator's bidi_p flag if Vpurify_flag is non-nil.  (Bug#9963)
9677         (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9678         return Qleft_to_right.
9680 2011-11-06  Chong Yidong  <cyd@gnu.org>
9682         * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9683         (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9684         (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9685         (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9686         (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9687         (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9688         (Fwindow_vscroll): Doc fix.
9689         (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9690         argument, since it makes no sense to pass a live window and for
9691         consistency with window-child.
9693 2011-11-05  Christoph Scholtes  <cschol2112@googlemail.com>
9695         * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9696         support MSVC.
9698 2011-11-05  Jason Rumney  <jasonr@gnu.org>
9700         * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9701         (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9702         fonts (Bug#6029).
9703         (add_font_entity_to_list): Fix logic errors in mixed boolean and
9704         bitwise arithmetic preventing use of unicode-sip and non-truetype
9705         opentype fonts.
9707 2011-11-05  Eli Zaretskii  <eliz@gnu.org>
9709         * s/ms-w32.h (fstat, stat, utime): Move redirections to
9710         "emacs"-only part.
9712         * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9713         initialization code to keep similarity to xfns.c after changes
9714         from 2011-11-05.
9716 2011-11-05  Jan Djärv  <jan.h.d@swipnet.se>
9718         * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9719         (unwind_create_frame): New function (Bug#9943).
9720         (Fx_create_frame): Restructure code to be more similar to the one in
9721         xfns.c.  Call record_unwind_protect with unwind_create_frame (Bug#9943).
9722         Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9723         Move terminal->reference_count++ just before making the frame official
9724         (Bug#9943).
9726         * nsterm.m (x_free_frame_resources): New function.
9727         (x_destroy_window): Move code to x_free_frame_resources.
9729         * xfns.c (unwind_create_frame): Fix comment.
9730         (Fx_create_frame, x_create_tip_frame):
9731         Move terminal->reference_count++ just before making the frame
9732         official.  Move initialization of image_cache_refcount and
9733         dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9735 2011-11-05  Eli Zaretskii  <eliz@gnu.org>
9737         Support MSVC build with newer versions of Visual Studio.
9738         * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9739         Nmake barfs on that.  Use $(OBJ*_c) variables instead, defined on
9740         nt/gmake.defs.
9742         * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
9743         which are not supported by MSVC.
9744         (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
9745         (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
9746         bitfields.
9747         (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
9748         types in bitfields.
9749         (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
9751         * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
9753 2011-11-05  Fabrice Popineau  <fabrice.popineau@supelec.fr>  (tiny change)
9755         Support MSVC build with newer versions of Visual Studio.
9756         * w32.c: Don't include w32api.h for MSVC.
9757         (init_environment) [_MSC_VER]: Call sys_access, not _access.
9759         * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
9760         [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
9761         (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
9762         (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
9763         e_* cousins.
9764         (alloca) [_MSC_VER]: Define to _alloca.
9766         * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
9768         * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
9770 2011-11-04  Eli Zaretskii  <eliz@gnu.org>
9772         * xdisp.c (note_mouse_highlight): If either of
9773         previous/next-single-property-change returns nil, treat that as
9774         the beginning or the end of the buffer.  (Bug#9955)
9776 2011-11-04  Jan Djärv  <jan.h.d@swipnet.se>
9778         * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
9779         label is not null (Bug#9951).
9780         (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
9781         may be NULL.
9783 2011-11-04  Eli Zaretskii  <eliz@gnu.org>
9785         * window.c (Fwindow_body_size): Mention in the doc string that the
9786         return value is in frame's canonical units.  (Bug#9949)
9788 2011-11-03  Eli Zaretskii  <eliz@gnu.org>
9790         * xdisp.c (note_mouse_highlight): Initialize `area'.  (Bug#9947)
9792         * w32fns.c (unwind_create_frame): If needed, free the glyph
9793         matrices of the partially constructed frame.  (Bug#9943)
9794         * xfns.c (unwind_create_frame): Likewise.
9796 2011-11-01  Eli Zaretskii  <eliz@gnu.org>
9798         * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
9799         Don't stop backward scan on the continuation glyph, even though
9800         its CHARPOS is positive.
9801         (mouse_face_from_buffer_pos, note_mouse_highlight):
9802         Rename cover_string to disp_string.
9804 2011-11-01  Martin Rudalics  <rudalics@gmx.at>
9806         * window.c (temp_output_buffer_show): Don't use
9807         Vtemp_buffer_show_specifiers.
9808         (Vtemp_buffer_show_specifiers): Remove unused variable.
9810 2011-10-30  Eli Zaretskii  <eliz@gnu.org>
9812         * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
9813         past the beginning of the current glyph matrix.
9815 2011-10-30  Adam Sjøgren  <asjo@koldfront.dk>  (tiny change)
9817         * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
9818         (x_error_handler): Ignore BadMatch for X_SetInputFocus for
9819         HAVE_GTK3 (Bug#9869).
9821         * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
9822         type to GDK_NOTHING so valgrind does not complain (Bug#9901).
9824         * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
9826         * xterm.c: Declare x_handle_net_wm_state to return int.
9827         (handle_one_xevent): Check if we are iconified but don't have
9828         _NET_WM_STATE_HIDDEN.  If do, treat as deiconify (Bug#9893).
9829         (get_current_wm_state): Return non-zero if not hidden,
9830         check for _NET_WM_STATE_HIDDEN (Bug#9893).
9831         (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
9832         (x_handle_net_wm_state): Return what get_current_wm_state returns.
9833         (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
9835 2011-10-29  Paul Eggert  <eggert@cs.ucla.edu>
9837         * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
9838         so that this new function doesn't get optimized away by a
9839         whole-program optimizer.  Make the 2nd arg EMACS_INT, not int.
9841 2011-10-29  Andreas Schwab  <schwab@linux-m68k.org>
9843         * frame.h (MOUSE_HL_INFO): Remove excess parens.
9845 2011-10-29  Eli Zaretskii  <eliz@gnu.org>
9847         Fix the `xbytecode' command.
9848         * .gdbinit (xprintbytestr): New command.
9849         (xwhichsymbols): Rename from `which'; all callers changed.
9850         (xbytecode): Print the byte-code string as well.
9852 2011-10-29  Kim Storm  <storm@cua.dk>
9854         * alloc.c (which_symbols): New function.
9856 2011-10-29  Andreas Schwab  <schwab@linux-m68k.org>
9858         * minibuf.c (read_minibuf_noninteractive): Allow reading empty
9859         line.  (Bug#9903)
9861 2011-10-29  Glenn Morris  <rgm@gnu.org>
9863         * process.c (wait_reading_process_output): Revert 2009-08-30 change.
9864         Not clear what it was for, and it causes various bugs.  (Bug#9839)
9866 2011-10-28  Eli Zaretskii  <eliz@gnu.org>
9868         * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
9869         possible random value that matches one of those tested as
9870         condition to clear the mouse face.
9872 2011-10-28  Chong Yidong  <cyd@gnu.org>
9874         * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
9876 2011-10-28  Dan Nicolaescu  <dann@ics.uci.edu>
9878         * window.c (make_window): Initialize phys_cursor_on_p.
9880 2011-10-28  Stefan Monnier  <monnier@iro.umontreal.ca>
9882         * lisp.h (struct Lisp_Symbol): Update comments.
9884 2011-10-28  Juanma Barranquero  <lekktu@gmail.com>
9886         * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
9888 2011-10-28  Eli Zaretskii  <eliz@gnu.org>
9890         Fix Emacs on Windows 9X (bug#8562).  Thanks to oslsachem
9891         <oslsachem@gmail.com> for helping to debug this.
9893         * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
9894         (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
9895         (g_b_init_get_glyph_outline_w): New static variables.
9896         (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
9897         (GetGlyphOutlineW_Proc): New typedefs.
9898         (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9899         (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
9900         New functions.
9901         (w32font_open_internal, compute_metrics):
9902         Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
9903         instead of calling the "wide" APIs directly.
9905         * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
9907         * w32.h (syms_of_w32font): Add prototype.
9909 2011-10-27  Juanma Barranquero  <lekktu@gmail.com>
9911         * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
9912         (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
9913         (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
9914         (Fmove_to_window_line): Doc fix.
9916 2011-10-27  Chong Yidong  <cyd@gnu.org>
9918         * process.c (make_process): Set gnutls_state to NULL.
9920         * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
9921         non-NULL, regardless of GNUTLS_INITSTAGE.
9922         (Fgnutls_boot): Cleanups.  Call emacs_gnutls_deinit if we signal
9923         an error.  Set process slots as soon as we allocate them.
9925         * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
9927 2011-10-27  Chong Yidong  <cyd@gnu.org>
9929         * gnutls.c (emacs_gnutls_deinit): New function.
9930         Deallocate credentials structures as well as calling gnutls_deinit.
9931         (Fgnutls_deinit, Fgnutls_boot): Use it.
9933         * process.c (make_process): Initialize GnuTLS credentials to NULL.
9934         (deactivate_process): Call emacs_gnutls_deinit.
9936 2011-10-27  Juanma Barranquero  <lekktu@gmail.com>
9938         * image.c (x_create_x_image_and_pixmap):
9939         * w32.c (sys_rename, w32_delayed_load):
9940         * w32font.c (fill_in_logfont):
9941         * w32reg.c (x_get_string_resource): Silence compiler warnings.
9943 2011-10-26  Juanma Barranquero  <lekktu@gmail.com>
9945         * w32fns.c (w32_default_color_map): New function,
9946         extracted from Fw32_default_color_map.
9947         (Fw32_default_color_map, Fx_open_connection): Use it.  (Bug#9785)
9949 2011-10-25  Paul Eggert  <eggert@cs.ucla.edu>
9951         * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
9953 2011-10-25  Stefan Monnier  <monnier@iro.umontreal.ca>
9955         * keyboard.c (test_undefined): New function (bug#9751).
9956         (read_key_sequence): Use it to detect when a key is bound to `undefined'.
9958 2011-10-25  Enami Tsugutomo  <tsugutomo.enami@jp.sony.com>
9960         * sysdep.c (init_sys_modes): Fix the check for the controlling
9961         terminal (Bug#6649).
9963 2011-10-20  Eli Zaretskii  <eliz@gnu.org>
9965         * dispextern.h (struct bidi_it): New member next_en_type.
9967         * bidi.c (bidi_line_init): Initialize the next_en_type member.
9968         (bidi_resolve_explicit_1): When next_en_pos is valid for the
9969         current character, check also for next_en_type being WEAK_EN.
9970         (bidi_resolve_weak): Don't enter the expensive loop if the current
9971         position is before next_en_pos.  Record the bidi type of the first
9972         non-ET, non-BN character we find, in addition to its position.
9973         (bidi_level_of_next_char): Invalidate next_en_type when
9974         next_en_pos is over-stepped.
9976 2011-10-20  Paul Eggert  <eggert@cs.ucla.edu>
9978         Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
9979         * editfns.c: Rewrite current-time-zone so that it invokes
9980         the equivalent of (format-time-string "%Z") to get the time zone name.
9981         This fixes a bug when the time zone name contains characters that
9982         need converting from the system time locale to Emacs internal format.
9983         This fixes a shortcoming that I introduced in my 1999-10-19 patch:
9984         that patch fixed format-time-string to do the conversion, but
9985         I forgot to fix current-time-zone.
9986         (format_time_string): New function, containing most of
9987         what Fformat_time_string used to contain.
9988         (Fformat_time_string): Rewrite in terms of format_time_string.
9989         This doesn't change this function's behavior.
9990         (current-time-zone): Rewrite to use format_time_string.
9991         This fixes the bug reported by Michael Schierl in
9992         <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
9993         Jason Rumney's 2007-06-07 change worked around this bug, but
9994         didn't fix it.
9995         * systime.h (tzname, timezone): Remove no-longer-used declarations.
9997 2011-10-19  Eli Zaretskii  <eliz@gnu.org>
9999         * xdisp.c (start_display): If the character at POS is displayed
10000         via a display vector, reset IT->current.dpvec_index to zero.
10001         (try_window_reusing_current_matrix): If a line ends in a display
10002         vector or the next line starts in a display vector, continue
10003         redrawing the window even though the character position of
10004         start_row was reached.
10005         (Bug#9771, part 2)
10007 2011-10-18  Chong Yidong  <cyd@gnu.org>
10009         * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10010         with nobreak-char-display too.
10012 2011-10-18  Eli Zaretskii  <eliz@gnu.org>
10014         Fix part 3 of bug#9771.
10015         * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10016         (bidi_resolve_neutral): Don't enter the expensive loop looking for
10017         non-neutral characters if the current character is a paragraph
10018         separator (a.k.a. Newline).  This avoids running the same
10019         expensive loop twice, once when we consume the preceding newline
10020         and the other time when the line actually needs to be displayed.
10021         Avoid the loop when we see neutrals on the base embedding level
10022         following a character whose directionality is the same as the
10023         paragraph's.  This avoids running the expensive loop when a line
10024         ends in a long sequence of neutrals, like control characters.
10025         Add assertion against STRONG_AL type.  Slightly rearrange code
10026         that determines the type of a neutral given the first non-neutral
10027         that follows it.
10028         (bidi_level_of_next_char): Set next_en_pos to zero when
10029         invalidating its info.
10031 2011-10-17  Eli Zaretskii  <eliz@gnu.org>
10033         * xdisp.c (push_display_prop): Determine whether to record string
10034         or buffer position by IT->string, not by IT->method.  Allow
10035         GET_FROM_DISPLAY_VECTOR as IT->method on entry.  (Bug#9771, part 4)
10036         (move_it_vertically_backward): Don't look for character position
10037         immediately after the newline when in a continuation line.
10038         (Bug#9771, part 1)
10040 2011-10-15  Martin Rudalics  <rudalics@gmx.at>
10042         * window.c (coordinates_in_window): Rewrite and delabelize
10043         vertical border check.  (Bug#5357) (Bug#9618)
10045 2011-10-14  Stefan Monnier  <monnier@iro.umontreal.ca>
10047         * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10048         errors in XSetWindowBorder (bug#9310).
10050 2011-10-13  Dmitry Antipov  <dmantipov@yandex.ru>
10052         * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10053         avoid crash when xmalloc overrun checking is enabled.
10055 2011-10-13  Eli Zaretskii  <eliz@gnu.org>
10057         * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10058         itb.paragraph_dir to NEUTRAL_DIR.  Fixes an occasional incorrect
10059         cursor motion with <left> and <right> arrow keys.
10061         * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10062         some callers set that themselves.
10064 2011-10-12  Eli Zaretskii  <eliz@gnu.org>
10066         * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10067         display string and the previous row comes from the same string and
10068         is empty.  (Bug#9739)  (Bug#9738)
10070 2011-10-12  Stefan Monnier  <monnier@iro.umontreal.ca>
10072         * doc.c (get_doc_string): Encode file name (bug#9735).
10074 2011-10-12  Eli Zaretskii  <eliz@gnu.org>
10076         * bidi.c (bidi_level_of_next_char):
10077         * xdisp.c (get_visually_first_element): Remove old incorrect
10078         comments regarding the Unicode Line Separator character.
10080         * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10082 2011-10-12  Dmitry Antipov  <dmantipov@yandex.ru>
10084         * alloc.c (Fgc_status): Do not access beyond zombies array
10085         boundary if nzombies > MAX_ZOMBIES.
10086         * alloc.c (dump_zombies): Add missing format specifier.
10088 2011-10-12  Paul Eggert  <eggert@cs.ucla.edu>
10090         * xdisp.c (set_cursor_from_row): Simplify conditionals,
10091         to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10093         * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10094         Some packages use them to denote characters with modifiers.
10096 2011-10-11  Andreas Schwab  <schwab@linux-m68k.org>
10098         * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10099         (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10100         matching a pp-number.  Rename parameter var to var1.
10102 2011-10-11  Stefan Monnier  <monnier@iro.umontreal.ca>
10104         * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10106 2011-10-08  Glenn Morris  <rgm@gnu.org>
10108         * callint.c (Fcall_interactively): Give a more explicit error for the
10109         'c' case with a non-character input.  (Bug#8479)
10111 2011-10-08  Eli Zaretskii  <eliz@gnu.org>
10113         * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10114         lines.
10115         (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10116         lines that are hscrolled on the left.
10118         * dispnew.c (buffer_posn_from_coords): Account for a possible
10119         presence of header-line.  (Bug#4426)
10121 2011-10-07  Stefan Monnier  <monnier@iro.umontreal.ca>
10123         * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10124         Don't advertise functionality which we discourage or doesn't work.
10126 2011-10-07  Paul Eggert  <eggert@cs.ucla.edu>
10128         * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10129         or sizeof.  __alignof__ gives the wrong answer on Fedora x86-64
10130         with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10131         this makes Emacs dump core during garbage collection on rare
10132         occasions.  sizeof is obviously inferior to offsetof here, so
10133         stick with offsetof.
10134         (GC_POINTER_ALIGNMENT): New macro.
10135         (mark_memory): Omit 3rd (offset) arg; caller changed.
10136         Don't assume EMACS_INT alignment is the same as pointer alignment.
10138 2011-10-03  Stefan Monnier  <monnier@iro.umontreal.ca>
10140         * keyboard.c (read_key_sequence_remapped): New var.
10141         (read_key_sequence): Compute remapping in the right buffer.
10142         (command_loop_1): Use read_key_sequence's remapping directly.
10144 2011-10-02  Stefan Monnier  <monnier@iro.umontreal.ca>
10146         * dired.c (file_name_completion): Don't expand file name.
10147         (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10148         before checking file name handler.
10150         * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10151         they've been requested explicitly (bug#9591).
10153 2011-10-01  Andreas Schwab  <schwab@linux-m68k.org>
10155         * keymap.c (Fsingle_key_description): Use make_specified_string
10156         instead of build_string to build string from push_key_description.
10157         (Bug#5193)
10159 2011-09-30  Paul Eggert  <eggert@cs.ucla.edu>
10161         * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10162         This fixes a Y2038 bug on 64-bit hosts.
10163         * buffer.c (reset_buffer):
10164         * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10165         (Fclear_buffer_auto_save_failure):
10166         Use 0, not -1, to represent an unset failure time, since time_t
10167         might not be signed.
10169         Remove dependency on glibc malloc internals.
10170         * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10171         Move back here from lisp.h, but with their new implementations.
10172         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10173         (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10174         * charset.c (charset_table_init): New static var.
10175         (syms_of_charset): Use it instead of xmalloc.  This removes a
10176         dependency on glibc malloc internals.  See Eli Zaretskii's comment in
10177         <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10178         * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10179         Move back to alloc.c.
10180         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10181         (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10183 2011-09-30  Jan Djärv  <jan.h.d@swipnet.se>
10185         * nsterm.m (windowDidResize): Call x_set_window_size only when
10186         ns_in_resize is true.  Otherwise set pixelwidth/height and
10187         call change_frame_size (Bug#9628).
10189 2011-09-30  Paul Eggert  <eggert@cs.ucla.edu>
10191         Port --enable-checking=all to Fedora 14 x86-64.
10192         * charset.c (syms_of_charset): Also account for glibc malloc's
10193         internal overhead when calculating the initial malloc maximum.
10195         Port --enable-checking=all to Fedora 14 x86.
10196         * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10197         Move to lisp.h.
10198         (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10199         (overrun_check_realloc, overrun_check_free):
10200         Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10201         That way, xmalloc returns a properly-aligned pointer even if
10202         XMALLOC_OVERRUN_CHECK is defined.  The old debugging code happened
10203         to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10204         * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10205         into account when calculating the initial malloc maximum.
10206         * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10207         Move here from alloc.c, so that charset.c can use it too.
10208         Properly align; the old code wasn't right for common 32-bit hosts
10209         when configured with --enable-checking=all.
10210         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10211         (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10213 2011-09-29  Eli Zaretskii  <eliz@gnu.org>
10215         * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
10216         use EDOM.
10218 2011-09-28  Eli Zaretskii  <eliz@gnu.org>
10220         * xdisp.c (compute_display_string_end): If there's no display
10221         string at CHARPOS, return -1.
10223         * bidi.c (bidi_fetch_char): When compute_display_string_end
10224         returns a negative value, treat the character as a normal
10225         character not covered by a display string.  (Bug#9624)
10227 2011-09-28  Juanma Barranquero  <lekktu@gmail.com>
10229         * lread.c (Fread_from_string): Fix typo in docstring.
10231 2011-09-27  Eli Zaretskii  <eliz@gnu.org>
10233         * xdisp.c (handle_invisible_prop): If invisible text ends on a
10234         newline, reseat the iterator instead of bidi-iterating there one
10235         character at a time.  (Bug#9610)
10236         (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10237         TO_CHARPOS if the bidi iterator is at base embedding level.
10239 2011-09-27  Andreas Schwab  <schwab@linux-m68k.org>
10241         * lread.c (readevalloop): Use correct code for NBSP.
10242         (read1): Likewise.  (Bug#9608)
10244 2011-09-25  Michael Albinus  <michael.albinus@gmx.de>
10246         * dbusbind.c (Fdbus_register_signal): When service is not
10247         registered, use nil in Vdbus_registered_objects_table.  (Bug#9581)
10249 2011-09-25  Glenn Morris  <rgm@gnu.org>
10251         * buffer.c (truncate-lines): Doc fix.
10253 2011-09-24  Chong Yidong  <cyd@stupidchicken.com>
10255         * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10256         (Fset_window_next_buffers): Doc fix.
10258 2011-09-24  Glenn Morris  <rgm@gnu.org>
10260         * minibuf.c (read_minibuf): Disable line truncation.  (Bug#5715)
10262 2011-09-24  Paul Eggert  <eggert@cs.ucla.edu>
10264         Fix minor problems found by static checking.
10265         * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
10266         * indent.c (Fvertical_motion): Fix == vs = typo.
10268 2011-09-24  Eli Zaretskii  <eliz@gnu.org>
10270         * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10271         Default value is now t.  Doc fix.
10273         * indent.c (Fvertical_motion): Compute and apply the overshoot
10274         logic when moving up, not only when moving down.  Fix the
10275         confusing name and values of the it_overshoot_expected variable;
10276         logic changes accordingly.  (Bug#9254) (Bug#9549)
10278         * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10279         CHARPOS is covered by a display string which includes newlines.
10280         (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10281         is covered by a display string with embedded newlines.
10283 2011-09-24  Michael Albinus  <michael.albinus@gmx.de>
10285         * dbusbind.c (Fdbus_register_signal): Add match rule to
10286         Vdbus_registered_objects_table.  (Bug#9581)
10287         (Fdbus_register_method, Vdbus_registered_objects_table):
10288         Fix docstring.
10290 2011-09-24  Jim Meyering  <meyering@redhat.com>
10292         do not ignore write error for any output size
10293         The previous change was incomplete.
10294         While it makes emacs --batch detect the vast majority of stdout
10295         write failures, errors were still ignored whenever the output size is
10296         k * (BUFSIZ+1) - 4.  E.g., on a system with BUFSIZ of 4096,
10297           $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10298               && echo FAIL: ignored write error
10299           FAIL: ignored write error
10300           $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10301               && echo FAIL: ignored write error
10302           FAIL: ignored write error
10303         * emacs.c (Fkill_emacs): Also test ferror.  (Bug#9574)
10305 2011-09-23  Andreas Schwab  <schwab@linux-m68k.org>
10307         * emacs.c (Fkill_emacs): In noninteractive mode exit
10308         non-successfully if a write error occurred on stdout.  (Bug#9574)
10310 2011-09-21  Eli Zaretskii  <eliz@gnu.org>
10312         * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10313         the xassert test.
10315         * dispextern.h (struct it): Update the comment documenting what
10316         can it->OBJECT be.
10318 2011-09-20  Eli Zaretskii  <eliz@gnu.org>
10320         * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10321         a display string, extend search for cursor position to end of row.
10322         (find_row_edges): If the row ends in a newline from a display
10323         string, increment its MATRIX_ROW_END_CHARPOS by one.  (Bug#9549)
10324         Handle the case of a display string with multiple newlines.
10325         (Fcurrent_bidi_paragraph_direction): Fix search for previous
10326         non-empty line.  Fixes confusing cursor motion with arrow keys at
10327         the beginning of a line that starts with whitespace.
10329 2011-09-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10331         * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10332         (bug#9493).
10334 2011-09-18  Chong Yidong  <cyd@stupidchicken.com>
10336         * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10337         boolean (Bug#9154).
10339 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
10341         * xdisp.c (display_line): Record maximum and minimum buffer
10342         positions even if no glyphs were produced (e.g., by a zero-width
10343         stretch).  Fixes bug#9530 on a TTY.  Under word-wrap, don't record
10344         buffer positions that will be removed from the glyph row because
10345         they don't fit.
10346         (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10347         column is beyond frame width: don't subtract 1 "pixel" when
10348         computing width of the stretch.
10349         (reseat_at_next_visible_line_start): Undo the change made on
10350         2011-09-17 that saved paragraph information and restored it after
10351         the call to `reseat'.  (Bug#9545)
10353 2011-09-18  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
10355         * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10356         and turn window cursor on if cleared (Bug#9415).
10358 2011-09-18  Andreas Schwab  <schwab@linux-m68k.org>
10360         * search.c (boyer_moore): Take unibyte characters from pattern
10361         literally.  (Bug#9458)
10363 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
10365         * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10367 2011-09-18  Paul Eggert  <eggert@cs.ucla.edu>
10369         Fix minor problem found by static checking.
10370         * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10371         initialized, to pacify gcc -Wuninitialized.
10373         * fileio.c: Report proper errno when syscall falls.
10374         (Finsert_file_contents): Save and restore errno,
10375         so that report_file_error outputs the correct diagnostic.
10376         (Fwrite_region) [CLASH_DETECTION]: Likewise.
10378 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
10380         * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10382 2011-09-17  Eli Zaretskii  <eliz@gnu.org>
10384         * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10385         2011-08-30 (revision 105619).  (Bug#9530)
10387 2011-09-17  Eli Zaretskii  <eliz@gnu.org>
10389         * xdisp.c (reseat_at_next_visible_line_start): Keep information
10390         about the current paragraph and restore it after the call to reseat.
10392         * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10393         (bidi_find_paragraph_start): Search back for paragraph beginning
10394         at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10395         (bidi_move_to_visually_next): Only trigger paragraph-related
10396         computations when the last character is a newline or at EOB, not
10397         just any NEUTRAL_B.  (Bug#9470)
10399         * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10400         truncated lines if point is covered by a display string.  (Bug#9524)
10402 2011-09-16  Paul Eggert  <eggert@cs.ucla.edu>
10404         * xselect.c: Relax test for outgoing X longs (Bug#9498).
10405         (cons_to_x_long): New function.
10406         (lisp_data_to_selection_data): Use it.  Correct the test for
10407         short-versus-long data; it was negated.  Break out of vector
10408         loop, for efficiency, when a long datum is discovered.
10410 2011-09-16  Stefan Monnier  <monnier@iro.umontreal.ca>
10412         * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10414 2011-09-16  Eli Zaretskii  <eliz@gnu.org>
10416         * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10417         GCC PR/17406) by declaring this function with external scope.
10419 2011-09-15  Paul Eggert  <eggert@cs.ucla.edu>
10421         * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10422         Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10424 2011-09-15  Andreas Schwab  <schwab@linux-m68k.org>
10426         * editfns.c (Fformat): Correctly handle text properties on "%%".
10428 2011-09-15  Eli Zaretskii  <eliz@gnu.org>
10430         * xterm.c (x_draw_composite_glyph_string_foreground):
10431         * w32term.c (x_draw_composite_glyph_string_foreground):
10432         * term.c (encode_terminal_code):
10433         * composite.c (composition_update_it, get_composition_id):
10434         * xdisp.c (get_next_display_element)
10435         (fill_composite_glyph_string): Add comments about special meaning
10436         of TAB characters in a composition.
10438 2011-09-15  Paul Eggert  <eggert@cs.ucla.edu>
10440         * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
10441         This occurs when processing a multibyte format.
10442         Problem reported by Wolfgang Jenker.
10444 2011-09-15  Johan Bockgård  <bojohan@gnu.org>
10446         * xdisp.c (try_cursor_movement): Only check for exact match if
10447         cursor hpos found by set_cursor_from_row is valid.  (Bug#9495)
10449 2011-09-14  Paul Eggert  <eggert@cs.ucla.edu>
10451         Remove unused external symbols.
10452         * dispextern.h (calc_pixel_width_or_height): Remove decl.
10453         * xdisp.c (calc_pixel_width_or_height): Now static.
10454         * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10455         * indent.c (check_display_width):
10456         * w32term.c: Fix comment to match code.
10457         * xterm.c, xterm.h (x_catching_errors): Remove.
10459 2011-09-14  Paul Eggert  <eggert@cs.ucla.edu>
10461         * xselect.c: Use signed conversions more consistently (Bug#9498).
10462         (selection_data_to_lisp_data): Assume incoming selection data are
10463         signed integers, not unsigned.  This is to be consistent with
10464         outgoing selection data, which was modified to use signed integers
10465         in as part of the fix to Bug#9196 in response to Jan D.'s comment
10466         in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10467         expects long, not unsigned long.
10469 2011-09-14  Eli Zaretskii  <eliz@gnu.org>
10471         * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10472         computation of loop end.  Reported by Johan Bockgård
10473         <bojohan@gnu.org>.
10475 2011-09-13  Chong Yidong  <cyd@stupidchicken.com>
10477         * frame.c (Fother_visible_frames_p): Function deleted.
10479 2011-09-12  Eli Zaretskii  <eliz@gnu.org>
10481         * indent.c (compute_motion): Process display vector front to back
10482         rather than the other way around.  (Bug#2496)
10484 2011-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
10486         * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10488 2011-09-11  Chong Yidong  <cyd@stupidchicken.com>
10490         * minibuf.c (Fread_from_minibuffer): Doc fix.
10492 2011-09-11  Eli Zaretskii  <eliz@gnu.org>
10494         * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10495         2011-08-30 (revision 105619).  (Bug#9475)
10497 2011-09-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10499         * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10500         value for non-existent files.
10502 2011-09-11  Eli Zaretskii  <eliz@gnu.org>
10504         * fileio.c (Finsert_file_contents): If the file cannot be opened,
10505         set its "size" to -1.  This will set the modtime_size field of
10506         the corresponding buffer to -1, which is what
10507         verify-visited-file-modtime expects for files that do not exist.
10508         (Bug#9139)
10510 2011-09-11  Paul Eggert  <eggert@cs.ucla.edu>
10512         * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10513         here ...
10514         * lisp.h: ... from here.  push_key_description is no longer
10515         defined in keyboard.c, so its declaration should not be in
10516         lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10517         logically belongs with push_key_description.
10519 2011-09-10  Paul Eggert  <eggert@cs.ucla.edu>
10521         * buffer.h: Include <sys/types.h> instead of <time.h>.
10522         Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10523         Problem reported by Herbert J. Skuhra.
10525 2011-09-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10527         * xml.c (parse_region): Make the parsing work for
10528         non-comment-starting XML files again (bug#9144).
10530 2011-09-10  Andreas Schwab  <schwab@linux-m68k.org>
10532         * image.c (gif_load): Fix calculation of bottom and right corner.
10533         (Bug#9468)
10535 2011-09-10  Eli Zaretskii  <eliz@gnu.org>
10537         * xdisp.c (MAX_DISP_SCAN): Decrease to 250.  Prevents sluggish
10538         redisplay in small windows.
10540 2011-09-09  Eli Zaretskii  <eliz@gnu.org>
10542         * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10544 2011-09-08  Martin Rudalics  <rudalics@gmx.at>
10546         * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10547         Operate on live windows only.
10549 2011-09-08  Juanma Barranquero  <lekktu@gmail.com>
10551         * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10553 2011-09-07  Eli Zaretskii  <eliz@gnu.org>
10555         * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10556         only under bidi iteration.
10558 2011-09-07  Jan Djärv  <jan.h.d@swipnet.se>
10560         * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10562 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
10564         isnan: Fix porting problem to Solaris 10 with bundled gcc.
10565         Without this fix, the command to link temacs failed due to an
10566         undefined symbol __builtin_isnan.  This is because
10567         /usr/include/iso/math_c99.h #defines isnan(x) to
10568         __builtin_isnan(x), but the bundled gcc, which identifies itself
10569         as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10570         a __builtin_isnan.
10571         * floatfns.c (isnan): #undef, and then #define to a clone of
10572         what's in data.c.
10573         (Fisnan): Always define, since it's always available now.
10574         (syms_of_floatfns): Always define isnan at the Lisp level.
10576 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
10578         * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10580 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
10582         * fileio.c: Fix bugs with large file offsets (Bug#9428).
10583         The previous code assumed that file offsets (off_t values) fit in
10584         EMACS_INT variables, which is not true on typical 32-bit hosts.
10585         The code messed up by falsely reporting buffer overflow in cases
10586         such as (insert-file-contents "big" nil 1 2) into an empty buffer
10587         when "big" contains more than 2**29 bytes, even though this
10588         inserts just one byte and does not overflow the buffer.
10589         (Finsert_file_contents): Store file offsets as off_t
10590         values, not as EMACS_INT values.  Check for overflow when
10591         converting between EMACS_INT and off_t.  When checking for
10592         buffer overflow or for overlap, take the offsets into account.
10593         Don't use EMACS_INT for small values where int suffices.
10594         When checking for overlap, fix a typo: ZV was used where
10595         ZV_BYTE was intended.
10596         (Fwrite_region): Don't assume off_t fits into 'long'.
10597         * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10599 2011-09-05  Michael Albinus  <michael.albinus@gmx.de>
10601         * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10603 2011-09-04  Paul Eggert  <eggert@cs.ucla.edu>
10605         sprintf-related integer and memory overflow issues (Bug#9412).
10607         * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
10608         (esprintf, exprintf, evxprintf): New functions.
10609         * keyboard.c (command_loop_level): Now EMACS_INT, not int.
10610         (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
10611         (modify_event_symbol): Do not assume that the length of
10612         name_alist_or_stem is safe to alloca and fits in int.
10613         (Fexecute_extended_command): Likewise for function name and binding.
10614         (Frecursion_depth): Wrap around reliably on integer overflow.
10615         * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10616         since some callers pass EMACS_INT values.
10617         (Fsingle_key_description): Don't crash if symbol name contains more
10618         than MAX_ALLOCA bytes.
10619         * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10620         (get_minibuffer): Arg is now EMACS_INT, not int.
10621         * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
10622         (esprintf, exprintf, evxprintf): New decls.
10623         * window.h (command_loop_level, minibuf_level): Reflect API changes.
10625         * dbusbind.c (signature_cat): New function.
10626         (xd_signature, Fdbus_register_signal):
10627         Do not overrun buffer; instead, report string overflow.
10629         * dispnew.c (add_window_display_history): Don't overrun buffer.
10630         Truncate instead; this is OK since it's just a log.
10632         * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10633         even if the time zone offset is outlandishly large.
10634         Don't mishandle offset == INT_MIN.
10636         * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
10637         when creating daemon; the previous buffer-overflow check was incorrect.
10639         * eval.c (verror): Simplify by rewriting in terms of evxprintf,
10640         which has the guts of the old verror function.
10642         * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
10643         use SAFE_ALLOCA instead.  Use esprintf to avoid int-overflow issues.
10645         * font.c: Include <float.h>, for DBL_MAX_10_EXP.
10646         (font_unparse_xlfd): Don't blindly alloca long strings.
10647         Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
10648         fits in int, when using sprintf.  Use single snprintf to count
10649         length of string rather than counting it via multiple sprintfs;
10650         that's simpler and more reliable.
10651         (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
10652         (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
10653         sprintf, in case result does not fit in int.
10655         * fontset.c (num_auto_fontsets): Now printmax_t, not int.
10656         (fontset_from_font): Print it.
10658         * frame.c (tty_frame_count): Now printmax_t, not int.
10659         (make_terminal_frame, set_term_frame_name): Print it.
10660         (x_report_frame_params): In X, window IDs are unsigned long,
10661         not signed long, so print them as unsigned.
10662         (validate_x_resource_name): Check for implausibly long names,
10663         and don't assume name length fits in 'int'.
10664         (x_get_resource_string): Don't blindly alloca invocation name;
10665         use SAFE_ALLOCA.  Use esprintf, not sprintf, in case result does
10666         not fit in int.
10668         * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10669         (xg_check_special_colors, xg_set_geometry):
10670         Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10672         * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10673         Use esprintf, not sprintf, in case result does not fit in int.
10675         * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10676         (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10677         it as a large positive number.
10678         (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10679         * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10681         * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10682         in case result does not fit in int.
10684         * print.c (float_to_string): Detect width overflow more reliably.
10685         (print_object): Make sprintf buffer a bit bigger, to avoid potential
10686         buffer overrun.  Don't assume list length fits in 'int'.  Treat
10687         print length of 0 as 0, not as infinity; to be consistent with other
10688         uses of print length in this function.  Don't overflow print length
10689         index.  Don't assume hash table size fits in 'long', or that
10690         vectorlike size fits in 'unsigned long'.
10692         * process.c (make_process): Use printmax_t, not int, to format
10693         process-name gensyms.
10695         * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10697         * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10698         to avoid potential buffer overrun.
10700         * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10701         if X resource line is longer than 512 bytes.
10703         * xfns.c (x_window): Make sprintf buffer a bit bigger
10704         to avoid potential buffer overrun.
10706         * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10708         * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10710 2011-09-04  Paul Eggert  <eggert@cs.ucla.edu>
10712         Integer overflow fixes for scrolling, etc.
10713         Without these, Emacs silently mishandles large integers sometimes.
10714         For example, "C-u 4294967297 M-x recenter" was treated as if
10715         it were "C-u 1 M-x recenter" on a typical 64-bit host.
10717         * xdisp.c (try_window_id): Check Emacs fixnum range before
10718         converting to 'int'.
10720         * window.c (window_scroll_line_based, Frecenter):
10721         Check that an Emacs fixnum is in range before assigning it to 'int'.
10722         (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10723         values converted from Emacs fixnums.
10724         (Frecenter): Don't wrap around a line count if it is out of 'int'
10725         range; instead, treat it as an extreme value.
10726         (Fset_window_configuration, compare_window_configurations):
10727         Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10729         * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10730         that can exceed INT_MAX.  Check that EMACS_INT value is in range
10731         before assigning it to the (possibly-narrower) index.
10732         (match_limit): Don't assume that a fixnum can fit in 'int'.
10734         * print.c (print_object): Use ptrdiff_t, not int, for index that can
10735         exceed INT_MAX.
10737         * indent.c (position_indentation): Now takes ptrdiff_t, not int.
10738         (Fvertical_motion): Don't wrap around LINES values that don't fit
10739         in 'int'.  Instead, treat them as extreme values.  This is good
10740         enough for windows, which can't have more than INT_MAX lines anyway.
10742 2011-09-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10744         * Require libxml/parser.h to avoid compilation warning.
10746         * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
10748         * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
10749         since this reportedly can destroy thread storage.
10751 2011-08-30  Chong Yidong  <cyd@stupidchicken.com>
10753         * syntax.c (find_defun_start): Update all cache variables if
10754         exiting early (Bug#9401).
10756 2011-08-30  Eli Zaretskii  <eliz@gnu.org>
10758         * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
10760         * xdisp.c (produce_stretch_glyph): No longer static, compiled also
10761         when HAVE_WINDOW_SYSTEM is not defined.  Support both GUI and TTY
10762         frames.  Call tty_append_glyph in the TTY case.  (Bug#9402)
10764         * term.c (tty_append_glyph): New function.
10765         (produce_stretch_glyph): Static function and its prototype deleted.
10767         * dispextern.h (produce_stretch_glyph, tty_append_glyph):
10768         Add prototypes.
10770 2011-08-29  Paul Eggert  <eggert@cs.ucla.edu>
10772         * image.c (parse_image_spec): Check for nonnegative, not for positive,
10773         when checking :margin (Bug#9390).
10774         (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
10775         Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
10776         so that the name doesn't mislead.  All uses changed.
10778 2011-08-28  Johan Bockgård  <bojohan@gnu.org>
10780         * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
10781         set_tty_hooks.
10783 2011-08-27  Eli Zaretskii  <eliz@gnu.org>
10785         * xdisp.c (move_it_to): Don't bail out early when reaching
10786         position beyond to_charpos, if we are scanning backwards.
10787         (move_it_vertically_backward): When DY == 0, make sure we get to
10788         the first character in the line after the newline.
10790 2011-08-27  Paul Eggert  <eggert@cs.ucla.edu>
10792         * ccl.c: Improve and simplify overflow checking (Bug#9196).
10793         (ccl_driver): Do not generate an out-of-range pointer.
10794         (Fccl_execute_on_string): Remove unnecessary check for
10795         integer overflow, noted by Stefan Monnier in
10796         <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
10797         Remove a FIXME that didn't need fixing.
10798         Simplify the newly-introduced buffer reallocation code.
10800 2011-08-27  Juanma Barranquero  <lekktu@gmail.com>
10802         * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
10804 2011-08-26  Paul Eggert  <eggert@cs.ucla.edu>
10806         Integer and memory overflow issues (Bug#9196).
10808         * doc.c (get_doc_string): Rework so that
10809         get_doc_string_buffer_size is the actual buffer size, rather than
10810         being 1 less than the actual buffer size; this makes xpalloc more
10811         convenient.
10813         * image.c (x_allocate_bitmap_record, cache_image):
10814         * xselect.c (Fx_register_dnd_atom):
10815         Simplify previous changes by using xpalloc.
10817         * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
10818         since either will do and ptrdiff_t is convenient with xpalloc.
10820         * charset.c (charset_table_size)
10821         (struct charset_sort_data.priority): Now ptrdiff_t.
10822         (charset_compare): Don't overflow if priorities differ greatly.
10823         (Fsort_charsets): Don't assume list length fits in int.
10824         Check for size-calculation overflow when allocating sort data.
10825         (syms_of_charset): Allocate an initial charset table that is
10826         just under 64 KiB, to avoid problems with glibc malloc and mmap.
10828         * cmds.c (internal_self_insert): Check for size-calculation overflow.
10830         * composite.h (struct composition.glyph_len): Now int, not unsigned.
10831         The actual value is always <= INT_MAX, and leaving it unsigned made
10832         overflow checking harder.
10834         * dispextern.h (struct glyph_matrix.rows_allocated)
10835         (struct face_cache.size): Now ptrdiff_t, for convenience in use
10836         with xpalloc.  The values are still always <= INT_MAX.
10838         * indent.c (compute_motion): Adjust to region_cache_forward sig change.
10840         * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
10841         (SAFE_NALLOCA): New macro.
10843         * region-cache.c (struct boundary.pos, find_cache_boundary)
10844         (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
10845         (set_cache_region, invalidate_region_cache)
10846         (revalidate_region_cache, know_region_cache, region_cache_forward)
10847         (region_cache_backward, pp_cache):
10848         Use ptrdiff_t, not EMACS_INT, since either will do.  This is needed
10849         so that ptrdiff_t * can be passed to xpalloc.
10850         (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
10851         beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
10852         (pp_cache): Don't assume cache_len fits in int.
10853         * region-cache.h: Adjust extern decls to match.
10855         * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
10856         EMACS_INT, since either will do, for xpalloc.
10858         * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
10859         (xnmalloc, xnrealloc, xpalloc): New functions.
10861         * bidi.c (bidi_shelve_header_size): New constant.
10862         (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
10863         (bidi_cache_ensure_space): Avoid integer overflow when allocating.
10865         * bidi.c (bidi_cache_shrink):
10866         * buffer.c (overlays_at, overlays_in, record_overlay_string)
10867         (overlay_strings):
10868         Don't update size of array until after memory allocation succeeds,
10869         because xmalloc/xrealloc may not return.
10870         (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
10871         now that we have proper integer overflow checking.
10872         (record_overlay_string, overlay_strings): Catch overflows when
10873         calculating size of overlay_str_buf.
10875         * callproc.c (Fcall_process): Check for size overflow when
10876         calculating size of args2.
10877         (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
10878         Normally we prefer signed values, but sticking with ptrdiff_t would
10879         require adding more-complicated checks.
10881         * ccl.c (Fccl_execute_on_string): Check for memory overflow.
10882         Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
10883         Redo buffer-overflow calculations to avoid integer overflow.
10884         Add a FIXME comment where memory seems to be over-allocated.
10886         * character.c (Fstring): Check for size-calculation overflow.
10888         * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
10889         unnecessary integer overflow.  Check for size overflow.
10890         (encode_coding_object): Don't update size until xmalloc succeeds.
10892         * composite.c (get_composition_id): Check for overflow in glyph
10893         length calculations.
10895         Integer and memory overflow fixes for display code.
10896         * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
10897         * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
10898         (scrolling_window): Check for overflow in size calculations.
10899         (line_draw_cost, realloc_glyph_pool, add_row_entry):
10900         Don't assume glyph table len fits in int.
10901         (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
10902         (row_table_size): Now ptrdiff_t, not int.
10903         (scrolling_window): Avoid overflow in size calculations.
10904         Don't update size until allocation succeeds.
10905         * fns.c (concat): Check for overflow in size calculations.
10906         (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
10907         * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10908         (NEXT_ALMOST_PRIME_LIMIT): New constant.
10910         * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
10911         (get_doc_string): Check for size calculation overflow.
10912         Don't update size until allocation succeeds.
10913         (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
10914         EMACS_INT, where ptrdiff_t will do.
10915         (Fsubstitute_command_keys): Check for string overflow.
10917         * editfns.c (set_time_zone_rule): Don't assume environment length
10918         fits in int.
10919         (message_length): Now ptrdiff_t, not int.
10920         (Fmessage_box): Don't update size until allocation succeeds.
10921         Don't assume message length fits in int.
10922         (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
10924         * emacs.c (main): Do not reallocate argv, since there is a null at
10925         the end that can be overwritten, and this way there's no need to
10926         worry about size-calculation overflow.
10927         (sort_args): Check for size-calculation overflow.
10929         * eval.c (init_eval_once, grow_specpdl): Don't update size until
10930         alloc succeeds.
10931         (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
10933         * frame.c (set_menu_bar_lines, x_set_frame_parameters)
10934         (x_set_scroll_bar_width, x_figure_window_size):
10935         Check for integer overflow.
10936         (x_set_alpha): Do not assume XINT fits in int.
10938         * frame.h (struct frame): Use int, not EMACS_INT, where int works.
10939         This is for the members text_lines, text_cols, total_lines, total_cols,
10940         where the system imposes an 'int' limit.
10942         * fringe.c (Fdefine_fringe_bitmap):
10943         Don't update size until alloc works.
10945         * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
10946         (ftfont_shape_by_flt): Check for integer overflow in size calculations.
10948         * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
10949         Check for size-calculation overflow.
10950         (get_utf8_string): Use ptrdiff_t, not size_t, where either will
10951         do, as we prefer signed integers.
10952         (id_to_widget.max_size, id_to_widget.used)
10953         (xg_store_widget_in_map, xg_remove_widget_from_map)
10954         (xg_get_widget_from_map, xg_get_scroll_id_for_window)
10955         (xg_remove_scroll_bar, xg_update_scrollbar_pos):
10956         Use and return ptrdiff_t, not int.
10957         (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
10958         * gtkutil.h: Change prototypes to match the above.
10960         * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
10961         are duplicate now that they've been promoted to lisp.h.
10962         (x_allocate_bitmap_record, x_alloc_image_color)
10963         (make_image_cache, cache_image, xpm_load):
10964         Don't update size until alloc is done.
10965         (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
10966         (x_detect_edges):
10967         Check for size calculation overflow.
10968         (ct_colors_allocated_max): New constant.
10969         (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
10970         overflow.
10972         * keyboard.c (read_char, menu_bar_items, tool_bar_items)
10973         (read_char_x_menu_prompt, read_char_minibuf_menu_width)
10974         (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
10975         Use ptrdiff_t, not int, to count maps.
10976         (read_char_minibuf_menu_prompt): Check for overflow in size
10977         calculations.  Don't update size until allocation succeeds.
10978         Redo calculations to avoid overflow.
10979         * keyboard.h: Change prototypes to match the above.
10981         * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
10982         to count maps.
10983         (current_minor_maps): Check for size calculation overflow.
10984         * keymap.h: Change prototypes to match the above.
10986         * lread.c (read1, init_obarray): Don't update size until alloc done.
10988         * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
10989         (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
10991         * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
10992         Now ptrdiff_t, not int.
10993         * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
10994         (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
10996         * process.c (Fnetwork_interface_list): Check for overflow
10997         in size calculation.
10999         * region-cache.c (move_cache_gap): Check for size calculation overflow.
11001         * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11002         overflow.  Don't bother calling xmalloc when xrealloc will do.
11004         * search.c (Freplace_match): Check for size calculation overflow.
11005         (Fset_match_data): Don't assume list lengths fit in 'int'.
11007         * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11008         for command line length.  Do not attempt to address one before the
11009         beginning of an array, as that's not portable.
11011         * term.c (max_frame_lines): Remove; unused.
11012         (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11013         not int.
11014         (encode_terminal_code, calculate_costs): Check for size
11015         calculation overflow.
11016         (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11017         table lengths and related sizes.  Don't update size until alloc
11018         done.  Redo calculations to avoid overflow.
11019         (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11021         * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11022         subtracting pointers.
11023         (gobble_line): Check for overflow more carefully.  Don't update size
11024         until alloc done.
11026         * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11027         Don't update size until alloc done.
11028         Redo size calculations to avoid overflow.
11029         Check for size calculation overflow.
11030         (main) [DEBUG]: Fix typo in invoking tparam1.
11032         * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11033         Use ptrdiff_t, not int, for sizes.
11034         (store_mode_line_noprop_char): Don't update size until alloc done.
11036         * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11037         Use ptrdiff_t, not int, for sizes.
11038         (Finternal_make_lisp_face, cache_face):
11039         Check for size calculation overflow.
11040         (cache_face): Treat size calculation overflows as if they were
11041         memory exhaustion (the usual treatment), rather than aborting.
11043         * xfns.c (x_encode_text, x_set_name_internal)
11044         (Fx_change_window_property): Use ptrdiff_t, not int, to count
11045         sizes, since they can exceed INT_MAX in size.  Check for size
11046         calculation overflow.
11048         * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11049         (xg_select): Check for size calculation overflow.
11050         Don't update size until alloc done.
11052         * xrdb.c (get_environ_db): Don't assume path length fits in int,
11053         as sprintf is limited to int lengths.
11055         * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11056         (X_LONG_MIN): New macros.
11057         Use them to make the following changes clearer.
11058         (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11059         This change doesn't affect the value now, but it may help remind
11060         future maintainers not to raise the value too much later.
11061         (SELECTION_QUANTUM): Remove, replacing with ...
11062         (selection_quantum): ... new function, which avoids overflow.
11063         All uses changed.
11064         (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11065         assumption that selection length fits in 'int'.
11066         (x_reply_selection_request, x_handle_selection_request)
11067         (x_get_window_property, receive_incremental_selection)
11068         (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11069         (lisp_data_to_selection_data, clean_local_selection_data):
11070         Use ptrdiff_t, not int, to record length of selection.
11071         (x_reply_selection_request, x_get_window_property)
11072         (receive_incremental_selection, x_property_data_to_lisp):
11073         Redo calculations to avoid overflow.
11074         (x_reply_selection_request): When sending hint, ceiling it at
11075         X_LONG_MAX rather than relying on wraparound overflow to send
11076         something.
11077         (x_get_window_property, receive_incremental_selection)
11078         (lisp_data_to_selection_data, x_property_data_to_lisp):
11079         Check for size-calculation overflow.
11080         (x_get_window_property, receive_incremental_selection)
11081         (lisp_data_to_selection_data, Fx_register_dnd_atom):
11082         Don't store size until memory allocation succeeds.
11083         (x_get_window_property): Plug memory leak on memory exhaustion.
11084         Don't double-block input; malloc is safe here.  Don't assume 2**34
11085         - 4 fits in unsigned long.  Add an xassert to check
11086         XGetWindowProperty overflow.  Be more careful about overflow
11087         calculations, and distinguish size from memory overflow better.
11088         (receive_incremental_selection): When tracing, don't assume
11089         unsigned int is less than INT_MAX.
11090         (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11091         harmful) conversions of unsigned short to int.
11092         (lisp_data_to_selection_data): Don't assume that integers
11093         in the range -65535 through -1 fit in an X unsigned short.
11094         Don't assume that ULONG_MAX == X_ULONG_MAX.  Don't store into
11095         result parameters unless successful.  Rely on cons_to_unsigned
11096         to report problems with elements; the old code wasn't right anyway.
11097         (x_check_property_data): Check for int overflow; we cannot use
11098         a wider type due to X limits.
11099         (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11101         * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
11103         * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11104         (x_term_init): Check for size calculation overflow.
11105         (x_color_cells): Don't store size until memory allocation succeeds.
11106         (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
11107         Don't assume alloca size is less than MAX_ALLOCA.
11108         (x_term_init): Don't assume length fits in int (sprintf is limited
11109         to int size).
11111         Use ptrdiff_t for composition IDs.
11112         * character.c (lisp_string_width):
11113         * composite.c (composition_table_size, n_compositions)
11114         (get_composition_id, composition_gstring_from_id):
11115         * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11116         * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11117         * window.c (Frecenter):
11118         Use ptrdiff_t, not int, for composition IDs.
11119         * composite.c (get_composition_id): Check for integer overflow.
11120         * composite.h: Adjust prototypes to match the above changes.
11122         Use ptrdiff_t for hash table indexes.
11123         * category.c (hash_get_category_set):
11124         * ccl.c (ccl_driver):
11125         * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11126         * coding.c (coding_system_charset_list, detect_coding_system):
11127         * coding.h (struct coding_system.id):
11128         * composite.c (get_composition_id, gstring_lookup_cache):
11129         * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11130         * image.c (xpm_get_color_table_h):
11131         * lisp.h (hash_lookup, hash_put):
11132         * minibuf.c (Ftest_completion):
11133         Use ptrdiff_t for hash table indexes, not int (which is too
11134         narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11135         32-bit --with-wide-int hosts).
11137         * charset.c (Fdefine_charset_internal): Check for integer overflow.
11138         Add a FIXME comment about memory leaks.
11139         (syms_of_charset): Don't assume xmalloc returns.
11141         Don't assume that stated character widths fit in int.
11142         * character.c (Fchar_width, c_string_width, lisp_string_width):
11143         * character.h (CHAR_WIDTH):
11144         * indent.c (MULTIBYTE_BYTES_WIDTH):
11145         Use sanitize_char_width to avoid undefined and/or bad behavior
11146         with outlandish widths.
11147         * character.h (sanitize_tab_width): Rename from sanitize_width,
11148         now that we have two such functions.  All uses changed.
11149         (sanitize_char_width): New inline function.
11151         Don't assume that tab-width fits in int.
11152         * character.h (sanitize_width): New inline function.
11153         (SANE_TAB_WIDTH): New macro.
11154         (ASCII_CHAR_WIDTH): Use it.
11155         * indent.c (sane_tab_width): Remove.  All uses replaced by
11156         SANE_TAB_WIDTH (current_buffer).
11157         * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11159         * fileio.c: Integer overflow issues with file modes.
11160         (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11162         * charset.c (read_hex): New arg OVERFLOW.  All uses changed.
11163         Remove unreachable code.
11164         (read_hex, load_charset_map_from_file): Check for integer overflow.
11166         * xterm.c: Don't go over XClientMessageEvent limit.
11167         (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11168         (x_send_scroll_bar_event): Likewise.  Check that the size does not
11169         exceed limits imposed by XClientMessageEvent, as well as the usual
11170         ptrdiff_t and size_t limits.
11172         * keyboard.c: Overflow, signedness and related fixes.
11173         (make_lispy_movement): Use same integer type in forward decl
11174         that is used in the definition.
11175         (read_key_sequence, keyremap_step):
11176         Change bufsize argument back to int, undoing my 2011-03-30 change.
11177         We prefer signed types, and int is wide enough here.
11178         (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11179         than TYPE_MAXIMUM (EMACS_INT) / 2.  Don't let the label size grow
11180         larger than STRING_BYTES_BOUND.  Use ptrdiff_t for Emacs string
11181         length, not size_t.  Use ptrdiff_t for index, not int.
11182         (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11183         possibility of integer overflow.
11185         Overflow, signedness and related fixes for images.
11187         * dispextern.h (struct it.stack[0].u.image.image_id)
11188         (struct_it.image_id, struct image.id, struct image_cache.size)
11189         (struct image_cache.used, struct image_cache.ref_count):
11190         * gtkutil.c (update_frame_tool_bar):
11191         * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11192         (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11193         (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11194         * nsmenu.m (update_frame_tool_bar):
11195         * xdisp.c (calc_pixel_width_or_height):
11196         * xfns.c (image_cache_refcount):
11197         Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11198         on typical 64-bit hosts.
11200         * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11201         (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11202         Omit unnecessary casts to int.
11203         (parse_image_spec): Check that integers fall into 'int' range
11204         when the callers expect that.
11205         (image_ascent): Redo ascent calculation to avoid int overflow.
11206         (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11207         (lookup_image): Remove unnecessary tests.
11208         (xbm_image_p): Locals are now of int, not EMACS_INT,
11209         since parse_image_check makes sure they fit into int.
11210         (png_load, gif_load, svg_load_image):
11211         Prefer int to unsigned where either will do.
11212         (tiff_handler): New function, combining the cores of the
11213         old tiff_error_handler and tiff_warning_handler.
11214         This function is rewritten to use vsnprintf and thereby avoid
11215         stack buffer overflows.  It uses only the features of vsnprintf
11216         that are common to both POSIX and native Microsoft.
11217         (tiff_error_handler, tiff_warning_handler): Use it.
11218         (tiff_load, gif_load, imagemagick_load_image):
11219         Don't assume :index value fits in 'int'.
11220         (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11221         (imagemagick_load_image): Check that crop parameters fit into
11222         the integer types that MagickCropImage accepts.  Don't assume
11223         Vimagemagick_render_type has a nonnegative value.  Don't assume
11224         size_t fits in 'long'.
11225         (gs_load): Use printmax_t to print the widest integers possible.
11226         Check for integer overflow when computing image height and width.
11228 2011-08-26  Eli Zaretskii  <eliz@gnu.org>
11230         * xdisp.c (redisplay_window): Don't force window start if point
11231         will be invisible in the resulting window.  (Bug#9324)
11233 2011-08-25  Eli Zaretskii  <eliz@gnu.org>
11235         * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11236         the display spec is of the form `(space ...)'.
11237         (handle_display_spec): Return the value returned by
11238         handle_single_display_spec, not just 1 or zero.
11239         (handle_single_display_spec): If the display spec is of the form
11240         `(space ...)', and specifies display in the text area, return 2
11241         rather than 1.
11242         (try_cursor_movement): Check for the need to scroll more
11243         accurately, and prefer exact match for point under bidi.
11244         Don't advance `row' beyond the last row of the window.
11246         * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11247         into disp_prop; all users changed.
11249         * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11250         DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11251         for the text covered by the display property.
11253 2011-08-25  Chong Yidong  <cyd@stupidchicken.com>
11255         * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11256         Change return value to nil.
11257         (Frecord_buffer): Delete unused function.
11259 2011-08-24  Eli Zaretskii  <eliz@gnu.org>
11261         * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11262         buffers, return left-to-right.
11263         (set_cursor_from_row): Consider candidate row a win if its glyph
11264         represents a newline and point is on that newline.  Fixes cursor
11265         positioning on the newline at EOL of R2L text within L2R
11266         paragraph, and vice versa.
11267         (try_cursor_movement): Check continued rows, in addition to
11268         continuation rows.  Fixes unwarranted scroll when point enters a
11269         continued line of R2L text within an L2R paragraph, or vice versa.
11270         (cursor_row_p): Consider the case of point being equal to
11271         MATRIX_ROW_END_CHARPOS.  Prevents cursor being stuck when moving
11272         from the end of a short line to the beginning of a continued line
11273         of R2L text within L2R paragraph.
11274         (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11275         composed characters.
11277         * bidi.c (bidi_check_type): Use xassert.
11278         (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11279         members.
11281 2011-08-23  Eli Zaretskii  <eliz@gnu.org>
11283         * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11284         a character.
11286 2011-08-23  Chong Yidong  <cyd@stupidchicken.com>
11288         * nsfont.m (ns_otf_to_script): Fix typo.
11290 2011-08-22  Kenichi Handa  <handa@m17n.org>
11292         * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11293         extra slot even if the purpose is char-code-property-table.
11295 2011-08-23  Eli Zaretskii  <eliz@gnu.org>
11297         * xdisp.c (redisplay_window): When computing centering_position,
11298         account for the height of the header line.  (Bug#8874)
11300         * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11301         instead of CHAR_TO_BYTE.  Fixes a crash when a completion
11302         candidate is selected by the mouse, and that candidate has a
11303         composed character under the mouse.
11305         * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1.  Fixes pixel
11306         coordinates reported by pos-visible-in-window-p for a composed
11307         character in column zero.
11309 2011-08-23  Stefan Monnier  <monnier@iro.umontreal.ca>
11311         * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11313 2011-08-22  Eli Zaretskii  <eliz@gnu.org>
11315         * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11316         consider it a hit if to_charpos is anywhere in the range of the
11317         composed buffer positions.
11319 2011-08-22  Chong Yidong  <cyd@stupidchicken.com>
11321         * image.c (gif_load): Don't assume that each subimage has the same
11322         dimensions as the base image.  Handle disposal method that is
11323         "undefined" by the gif spec (Bug#9335).
11325 2011-08-20  Chong Yidong  <cyd@stupidchicken.com>
11327         * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
11328         (Fcondition_case): Document `debug' symbol in error handler.
11330 2011-08-19  Eli Zaretskii  <eliz@gnu.org>
11332         * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11333         face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11334         from an Org mode buffer to a Speedbar frame.
11336         * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11337         a composition, take its buffer position from IT->cmp_it.charpos.
11338         Fixes cursor positioning at the beginning of a line that begins
11339         with a composed character.
11341 2011-08-18  Eli Zaretskii  <eliz@gnu.org>
11343         * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11344         character bidirectional type, use STRONG_L instead.  Fixes crashes
11345         in a buffer produced by `describe-categories'.
11347         * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11348         members before the level stack, so they would be saved and
11349         restored when copying iterator state.  Fixes incorrect reordering
11350         around TABs covered by display properties.
11352 2011-08-18  Andreas Schwab  <schwab@linux-m68k.org>
11354         * process.c (Fnetwork_interface_list): Correctly determine buffer size.
11356 2011-08-17  Chong Yidong  <cyd@stupidchicken.com>
11358         * eval.c (internal_condition_case, internal_condition_case_1)
11359         (internal_condition_case_2, internal_condition_case_n):
11360         Remove unnecessary aborts (Bug#9081).
11362 2011-08-17  Eli Zaretskii  <eliz@gnu.org>
11364         * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11365         has no `load' handler, try opening the file locally.  (Bug#9311)
11367 2011-08-16  Ken Brown  <kbrown@cornell.edu>
11369         * gmalloc.c: Expand comment.
11371 2011-08-16  Eli Zaretskii  <eliz@gnu.org>
11373         * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11374         if it fails the cursor_row_p test.  Fixes cursor positioning at ZV.
11376 2011-08-16  Ken Brown  <kbrown@cornell.edu>
11378         Fix memory allocation problems in Cygwin build (Bug#9273).
11380         * unexcw.c ( __malloc_initialized): Declare external variable.
11381         (fixup_executable): Force the dumped emacs to reinitialize malloc.
11383         * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11384         New variables.
11385         (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11386         dumped emacs.
11387         (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11388         in the static heap.
11389         [CYGWIN] (special_realloc): New function.
11390         (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11391         requests to realloc storage in the static heap.
11393 2011-08-15  Paul Eggert  <eggert@cs.ucla.edu>
11395         * bidi.c (bidi_initialize): Remove unused local.
11397 2011-08-15  Eli Zaretskii  <eliz@gnu.org>
11399         * bidimirror.h:
11400         * biditype.h: Remove file.
11401         * makefile.w32-in ($(BLD)/bidi.$(O)):
11402         * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
11404         * dispextern.h: Fix a typo in the comment to bidi_type_t.
11406         * chartab.c: Improve commentary for the uniprop_table API.
11408         * bidi.c (bidi_paragraph_init): Support zero value of
11409         bidi_ignore_explicit_marks_for_paragraph_level.
11410         (bidi_initialize): Use uniprop_table instead of including
11411         biditype.h and bidimirror.h.
11413         * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11414         coordinates of the iterator when restoring from ppos_it.
11415         (Bug#9296)
11417 2011-08-14  Kenichi Handa  <handa@m17n.org>
11419         * process.c (create_process): Call setup_process_coding_systems
11420         after the pid of the process is set to -1 (Bug#8162).
11422 2011-08-14  Eli Zaretskii  <eliz@gnu.org>
11424         * xdisp.c (move_it_in_display_line_to): Don't invoke
11425         IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11426         ppos_it.  Fixes vertical cursor motion when line beginning is
11427         covered by an image.  (Bug#9296)
11429 2011-08-14  Jan Djärv  <jan.h.d@swipnet.se>
11431         * nsterm.h (ns_run_ascript): Declare.
11432         (NSAPP_DATA2_RUNASSCRIPT): Define.
11434         * nsfns.m (as_script, as_result, as_status): New static variables.
11435         (ns_run_ascript): New function.
11436         (Fns_do_applescript): Set variables as_*.  Make an NSApplicationDefined
11437         event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11438         the event loop.  Get status from as_status (Bug#7276).
11440         * nsterm.m (sendEvent): If event is NSApplicationDefined and
11441         data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11442         the event loop (Bug#7276).
11444 2011-08-14  Andreas Schwab  <schwab@linux-m68k.org>
11446         * gnutls.c (QCgnutls_bootprop_priority)
11447         (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11448         (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11449         (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11450         (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11451         (QCgnutls_bootprop_verify_hostname_error)
11452         (QCgnutls_bootprop_callbacks_verify): Rename from
11453         Qgnutls_bootprop_..., all uses changed.
11455         * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11456         uses changed.
11458 2011-08-14  Paul Eggert  <eggert@cs.ucla.edu>
11460         * xfaces.c (Qframe_set_background_mode): Now static.
11461         * dispextern.h (Qframe_set_background_mode): Remove decl.
11463         * process.c (Fnetwork_interface_info): Declare local only if needed.
11465 2011-08-13  Jan Djärv  <jan.h.d@swipnet.se>
11467         * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11468         (Fnetwork_interface_list): Allocate in increments of bytes instead
11469         of sizeof (struct ifreq).  Iterate over ifconf.ifc_req by counting
11470         bytes (Bug#8477).  Count bytes correctly when ifr_addr is a struct
11471         sockaddr.
11472         (struct ifflag_def): notrailers is smart on OSX.
11473         (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11474         Get hardware address with getifaddrs if available.
11476 2011-08-12  Eli Zaretskii  <eliz@gnu.org>
11478         * xdisp.c (iterate_out_of_display_property): xassert that
11479         IT->position is set to within IT->object's boundaries.  Break from
11480         the loop as soon as EOB is reached; avoids infloops in redisplay
11481         when IT->position is set up wrongly due to some bug.
11482         Set IT->current to match the bidi iterator unconditionally.
11483         (push_display_prop): Allow GET_FROM_STRING as IT->method on
11484         entry.  Force push_it to save on the stack the current
11485         buffer/string position, to be restored by pop_it.  Fix flags in
11486         the iterator structure wrt the object coming from a display
11487         property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11488         properties.  (Bug#9284)
11490 2011-08-09  Andreas Schwab  <schwab@linux-m68k.org>
11492         * fontset.c (fontset_get_font_group): Add proper type checks.
11493         (Bug#9172)
11495 2011-08-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
11497         * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11498         and LC_VERSION_MIN_MACOSX.
11499         (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11500         (dump_it) [LC_FUNCTION_STARTS]: Use it.
11502 2011-08-08  Eli Zaretskii  <eliz@gnu.org>
11504         * xdisp.c (forward_to_next_line_start): Allow to use the
11505         no-display-properties-and-no-overlays under bidi display.
11506         Set disp_pos in the bidi iterator to avoid searches for display
11507         properties and overlays.
11509 2011-08-08  Chong Yidong  <cyd@stupidchicken.com>
11511         * editfns.c (Fset_time_zone_rule): Document relationship with the
11512         setenv function.
11514         * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11515         the font entity extracted from the cache (Bug#8109).
11517 2011-08-07  Chong Yidong  <cyd@stupidchicken.com>
11519         * composite.c (autocmp_chars): Don't reset point.  That is done by
11520         restore_point_unwind (Bug#5984).
11522 2011-08-07  Juri Linkov  <juri@jurta.org>
11524         * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11525         to show the arg `TIME' instead of `TIMEVAL'.
11527 2011-08-06  Eli Zaretskii  <eliz@gnu.org>
11529         * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11530         display property strides EOL and includes a newline, as in
11531         longlines-mode.  (Bug#9254)
11532         (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11533         word-wrap under bidirectional display.  (Bug#9224)
11535         * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11536         is non-zero, even if the data buffer is NULL.  Fixes a crash in
11537         vertical-motion with longlines-mode.  (Bug#9254)
11539 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
11541         * bidi.c <bidi_cache_total_alloc>: Now static.
11542         (bidi_initialize): Initialize bidi_cache_total_alloc.
11544         * xdisp.c (display_line): Release buffer allocated for shelved bidi
11545         cache.  (Bug#9221)
11547         * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11548         amount allocated this far in `bidi_cache_total_alloc'.
11549         (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11550         non-zero, only free the data buffer without restoring the cache
11551         contents.  All callers changed.
11553         * dispextern.h (bidi_unshelve_cache): Update prototype.
11555         * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11556         (move_it_in_display_line, move_it_to)
11557         (move_it_vertically_backward, move_it_by_lines): Replace the call
11558         to xfree to an equivalent call to bidi_unshelve_cache.
11559         (move_it_in_display_line_to): Fix logic of returning
11560         MOVE_POS_MATCH_OR_ZV in the bidi case.  (Bug#9224)
11562 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
11564         * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11565         came from a string character with a `cursor' property.  (Bug#9229)
11567 2011-08-04  Jan Djärv  <jan.h.d@swipnet.se>
11569         * Makefile.in (LIB_PTHREAD): New variable.
11570         (LIBES): Add LIB_PTHREAD (Bug#9216).
11572         * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11573         Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11575 2011-08-04  Andreas Schwab  <schwab@linux-m68k.org>
11577         * regex.c (re_iswctype): Remove some redundant boolean conversions.
11579 2011-08-04  Jan Djärv  <jan.h.d@swipnet.se>
11581         * xterm.c (x_find_topmost_parent): New function.
11582         (x_set_frame_alpha): Find topmost parent window with
11583         x_find_topmost_parent and set the property there also (bug#9181).
11584         (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11586 2011-08-04  Paul Eggert  <eggert@cs.ucla.edu>
11588         * callproc.c (Fcall_process): Avoid vfork clobbering
11589         the local vars buffer, coding_systems, current_dir.
11591 2011-08-03  Stefan Monnier  <monnier@iro.umontreal.ca>
11593         * keymap.c (Fmake_composed_keymap): Move to subr.el.
11595 2011-08-03  Paul Eggert  <eggert@cs.ucla.edu>
11597         * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11598         so that it is not optimized away.
11600         * xdisp.c (compute_display_string_pos): Remove unused local.
11602 2011-08-02  Eli Zaretskii  <eliz@gnu.org>
11604         Fix slow cursor motion and scrolling in large buffers with
11605         selective display, like Org Mode buffers.  (Bug#9218)
11607         * dispextern.h (struct bidi_it): New member disp_prop_p.
11609         * xdisp.c: Remove one-slot cache of display string positions.
11610         (compute_display_string_pos): Accept an additional argument
11611         DISP_PROP_P; callers changed.  Scan at most 5K characters forward
11612         for a display string or property.  If found, set DISP_PROP_P
11613         non-zero.
11615         * bidi.c (bidi_fetch_char): Accept an additional argument
11616         DISP_PROP_P, and pass it to compute_display_string_pos.
11617         Only handle text covered by a display string if DISP_PROP_P is returned
11618         non-zero.  All callers of bidi_fetch_char changed.
11620 2011-08-02  Stefan Monnier  <monnier@iro.umontreal.ca>
11622         * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11624 2010-12-03  Don March  <don@ohspite.net>
11626         * keymap.c (Fdefine_key): Fix non-prefix key error message when
11627         last character M-[char] is translated to ESC [char] (bug#7541).
11629 2011-08-02  Kenichi Handa  <handa@m17n.org>
11631         * lisp.h (uniprop_table): Extern it.
11633         * chartab.c (uniprop_table): Make it non-static.
11635 2011-08-01  Eli Zaretskii  <eliz@gnu.org>
11637         * xdisp.c (forward_to_next_line_start): Accept additional argument
11638         BIDI_IT_PREV, and store into it the state of the bidi iterator had
11639         on the newline.
11640         (reseat_at_next_visible_line_start): Use the bidi iterator state
11641         returned by forward_to_next_line_start to restore the state of
11642         it->bidi_it after backing up to previous newline.  (Bug#9212)
11644 2011-07-30  Andreas Schwab  <schwab@linux-m68k.org>
11646         * regex.c (re_comp): Protoize.
11647         (re_exec): Fix return type.
11648         (regexec): Fix type of `ret'.  (Bug#9203)
11650 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
11652         * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
11653         This is needed if max-image-size is a floating-point number.
11655 2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
11657         * print.c (print_object): Print empty symbol as ##.
11659         * lread.c (read1): Read ## as empty symbol.
11661 2011-07-28  Alp Aker  <alp.tekin.aker@gmail.com>
11663         * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
11664         setting frame foreground color (Bug#9175).
11665         (x_set_background_color): Likewise.
11667         * nsmenu.m (-setText): Size tooltip dimensions precisely to
11668         contents (Bug#9176).
11669         (EmacsTooltip -init): Remove bezels and add shadows to
11670         tooltip windows.
11672         * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11673         or scroll bar (Bug#8470).
11675         * nsfont.m (nsfont_open): Remove assignment to voffset and
11676         unnecessary vars hshink, expand, hd, full_height, min_height.
11677         (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11679         * nsterm.h (nsfont_info): Remove voffset field.
11681 2011-07-28  Alp Aker  <alp.tekin.aker@gmail.com>
11683         Implement strike-through and overline on NextStep (Bug#8863).
11685         * nsfont.m (nsfont_open): Use underline position provided by font,
11686         instead of hard-coded value of 2.
11687         (nsfont_draw): Call ns_draw_text_decoration instead.
11689         * nsterm.h: Add declaration for ns_draw_text_decoration.
11691         * nsterm.m (ns_draw_text_decoration): New function for drawing
11692         underline, overline, and strike-through.
11693         (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11694         ns_draw_text_decoration.  Change treatment of cursor drawing to
11695         accommodate underlining, etc.
11697 2011-07-28  Eli Zaretskii  <eliz@gnu.org>
11699         * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11700         default.
11702 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
11704         * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11705         Without this fix, if a signal arrives just after memory fills up,
11706         'malloc' might be invoked reentrantly.
11708         * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11709         In other words, assume that every image size is allowed, on non-X
11710         hosts.  This assumption is probably wrong, but it lets Emacs compile.
11712 2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
11714         * regex.c (re_iswctype): Convert return values to boolean.
11716 2011-07-28  Eli Zaretskii  <eliz@fencepost.gnu.org>
11718         * xdisp.c (compute_display_string_pos): Don't use cached display
11719         string position if the buffer had its restriction changed.
11720         (Bug#9184)
11722 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
11724         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11726 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
11728         Integer signedness and overflow and related fixes.  (Bug#9079)
11730         * bidi.c: Integer size and overflow fixes.
11731         (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11732         (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11733         (bidi_cache_find_level_change, bidi_cache_ensure_space)
11734         (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11735         (bidi_find_other_level_edge):
11736         Use ptrdiff_t instead of EMACS_INT where either will do.
11737         This works better on 32-bit hosts configured --with-wide-int.
11738         (bidi_cache_ensure_space): Check for size-calculation overflow.
11739         Use % rather than repeated addition, for better worst-case speed.
11740         Don't set bidi_cache_size until after xrealloc returns, because it
11741         might not return.
11742         (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
11743         (bidi_cache_ensure_space): Also check that the bidi cache size
11744         does not exceed that of the largest Lisp string or buffer.  See Eli
11745         Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
11747         * alloc.c (__malloc_size_t): Remove.
11748         All uses replaced by size_t.  See Andreas Schwab's note
11749         <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
11751         * image.c: Improve checking for integer overflow.
11752         (check_image_size): Assume that f is nonnull, since
11753         it is always nonnull in practice.  This is one less thing to
11754         worry about when checking for integer overflow later.
11755         (x_check_image_size): New function, which checks for integer
11756         overflow issues inside X.
11757         (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
11758         This removes the need for a memory_full check.
11759         (xbm_image_p): Rewrite to avoid integer multiplication overflow.
11760         (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
11761         (xbm_read_bitmap_data): Change locals back to 'int', since
11762         their values must fit in 'int'.
11763         (xpm_load_image, png_load, tiff_load):
11764         Invoke x_create_x_image_and_pixmap earlier,
11765         to avoid much needless work if the image is too large.
11766         (tiff_load): Treat overly large images as if
11767         x_create_x_image_and_pixmap failed, not as malloc failures.
11768         (gs_load): Use x_check_image_size.
11770         * gtkutil.c: Omit integer casts.
11771         (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
11772         (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
11774         * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
11776         * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
11777         Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
11778         would wrongly return t on a 64-bit host.
11780         * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
11781         The plain *_OVERFLOW macros run afoul of GCC bug 49705
11782         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
11783         and therefore cause GCC to emit a bogus diagnostic in some cases.
11785         * image.c: Integer signedness and overflow and related fixes.
11786         This is not an exhaustive set of fixes, but it's time to
11787         record what I've got.
11788         (lookup_pixel_color, check_image_size): Remove redundant decls.
11789         (check_image_size): Don't assume that arbitrary EMACS_INT values
11790         fit in 'int', or that arbitrary 'double' values fit in 'int'.
11791         (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
11792         (tiff_load, imagemagick_load_image):
11793         Check for overflow in size calculations.
11794         (x_create_x_image_and_pixmap): Remove unnecessary test for
11795         xmalloc returning NULL; that can't happen.
11796         (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
11797         (xpm_color_bucket): Use better integer hashing function.
11798         (xpm_cache_color): Don't possibly over-allocate memory.
11799         (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
11800         (gif_memory_source):
11801         Use ptrdiff_t, not int or size_t, to record sizes.
11802         (png_load): Don't assume values greater than 2**31 fit in 'int'.
11803         (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
11804         either works, as we prefer signed integers.
11805         (tiff_read_from_memory, tiff_write_from_memory):
11806         Return tsize_t, not size_t, since that's what the TIFF API wants.
11807         (tiff_read_from_memory): Don't fail simply because the read would
11808         go past EOF; instead, return a short read.
11809         (tiff_load): Omit no-longer-needed casts.
11810         (Fimagemagick_types): Don't assume size fits into 'int'.
11812         Improve hashing quality when configured --with-wide-int.
11813         * fns.c (hash_string): New function, taken from sxhash_string.
11814         Do not discard information about ASCII character case; this
11815         discarding is no longer needed.
11816         (sxhash-string): Use it.  Change sig to match it.  Caller changed.
11817         * lisp.h: Declare it.
11818         * lread.c (hash_string): Remove, since we now use fns.c's version.
11819         The fns.c version returns a wider integer if --with-wide-int is
11820         specified, so this should help the quality of the hashing a bit.
11822         * emacs.c: Integer overflow minor fix.
11823         (heap_bss_diff): Now uprintmax_t, not unsigned long.  All used changed.
11824         Define only if GNU_LINUX.
11825         (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
11827         * dispnew.c: Integer signedness and overflow fixes.
11828         Remove unnecessary forward decls, that were a maintenance hassle.
11829         (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
11830         All uses changed.
11831         (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
11832         (scrolling_window): Use ptrdiff_t, not int, for byte count.
11833         (prepare_desired_row, line_draw_cost):
11834         Use int, not unsigned, where either works.
11835         (save_current_matrix, restore_current_matrix):
11836         Use ptrdiff_t, not size_t, where either works.
11837         (init_display): Check for overflow more accurately, and without
11838         relying on undefined behavior.
11840         * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
11841         Remove, replacing with the new symbols in lisp.h.  All uses changed.
11842         * fileio.c (make_temp_name):
11843         * filelock.c (lock_file_1, lock_file):
11844         * xdisp.c (message_dolog):
11845         Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
11846         Use pMd etc. instead.
11847         * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
11848         replacing the pWIDE etc. symbols removed from editfns.c.
11850         * keyboard.h (num_input_events): Now uintmax_t.
11851         This is (very slightly) less likely to mess up due to wraparound.
11852         All uses changed.
11854         * buffer.c: Integer signedness fixes.
11855         (alloc_buffer_text, enlarge_buffer_text):
11856         Use ptrdiff_t rather than size_t when either will do, as we prefer
11857         signed integers.
11859         * alloc.c: Integer signedness and overflow fixes.
11860         Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
11861         (__malloc_size_t): Default to size_t, not to int.
11862         (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
11863         (Fgarbage_collect, mark_object_loop_halt, mark_object):
11864         Prefer ptrdiff_t to size_t when either would do, as we prefer
11865         signed integers.
11866         (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
11867         (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
11868         Now const.  Initialize with values that are in range even if char
11869         is signed.
11870         (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
11871         (xmalloc_put_size, xmalloc_get_size): New functions.  All uses changed.
11872         These functions do the right thing with sizes > 2**32.
11873         (check_depth): Now ptrdiff_t, not int.
11874         (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
11875         Adjust to new way of storing sizes.  Check for size overflow bugs
11876         in rest of code.
11877         (STRING_BYTES_MAX): Adjust to new overheads.  The old code was
11878         slightly wrong anyway, as it missed one instance of
11879         XMALLOC_OVERRUN_CHECK_OVERHEAD.
11880         (refill_memory_reserve): Omit needless cast to size_t.
11881         (mark_object_loop_halt): Mark as externally visible.
11883         * xselect.c: Integer signedness and overflow fixes.
11884         (Fx_register_dnd_atom, x_handle_dnd_message):
11885         Use ptrdiff_t, not size_t, since we prefer signed.
11886         (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
11887         * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
11888         x_dnd_atoms_size and x_dnd_atoms_length.
11890         * doprnt.c: Prefer signed to unsigned when either works.
11891         * eval.c (verror):
11892         * doprnt.c (doprnt):
11893         * lisp.h (doprnt):
11894         * xdisp.c (vmessage):
11895         Use ptrdiff_t, not size_t, when using or implementing doprnt,
11896         since the sizes cannot exceed ptrdiff_t bounds anyway, and we
11897         prefer signed arithmetic to avoid comparison confusion.
11898         * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
11899         but is a bit tricky.
11901         Assume freestanding C89 headers, string.h, stdlib.h.
11902         * data.c, doprnt.c, floatfns.c, print.c:
11903         Include float.h unconditionally.
11904         * gmalloc.c: Assume C89-at-least behavior for preprocessor,
11905         limits.h, stddef.h, string.h.  Use memset instead of 'flood'.
11906         * regex.c: Likewise for stddef.h, string.h.
11907         (ISASCII): Remove; can assume it returns 1 now.  All uses removed.
11908         * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
11909         * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
11910         (STDC_HEADERS): Remove obsolete defines.
11911         * sysdep.c: Include limits.h unconditionally.
11913         Assume support for memcmp, memcpy, memmove, memset.
11914         * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
11915         * regex.c (memcmp, memcpy):
11916         Remove; we assume C89 now.
11918         * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
11919         (__malloc_safe_bcopy): Remove; no longer needed.
11921         * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
11922         Use EMACS_INT, not EMACS_UINT, for sizes.  The code works equally
11923         well either way, and we prefer signed to unsigned.
11925 2011-07-27  Lars Magne Ingebrigtsen  <larsi@gnus.org>
11927         * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
11928         closes the connection while we're reading (bug#9182).
11930 2011-07-25  Jan Djärv  <jan.h.d@swipnet.se>
11932         * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
11933         are specified (Bug#9168).
11935 2011-07-25  Paul Eggert  <eggert@cs.ucla.edu>
11937         * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
11938         Found by GCC static checking and --with-wide-int on a 32-bit host.
11940 2011-07-25  Eli Zaretskii  <eliz@gnu.org>
11942         * xdisp.c (compute_display_string_pos): Fix logic of caching
11943         previous display string position.  Initialize cached_prev_pos to
11944         -1.  Fixes slow-down at the beginning of a buffer.
11946 2011-07-24  Eli Zaretskii  <eliz@gnu.org>
11948         * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
11949         for attrs[LFACE_FONTSET_INDEX].
11951 2011-07-23  Paul Eggert  <eggert@cs.ucla.edu>
11953         * xml.c (parse_region): Remove unused local
11954         that was recently introduced.
11956 2011-07-23  Eli Zaretskii  <eliz@gnu.org>
11958         * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
11959         revision 84777 on 2008-02-22.
11961         * xdisp.c (move_it_in_display_line_to): Record the best matching
11962         position for TO_CHARPOS while scanning the line, and restore it on
11963         exit if none of the characters scanned was an exact match.
11964         Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
11965         when exact match is impossible due to invisible text, and the
11966         lines are truncated.
11968 2011-07-23  Jan Djärv  <jan.h.d@swipnet.se>
11970         * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
11971         for OSX >= 10.7.
11973 2011-07-22  Eli Zaretskii  <eliz@gnu.org>
11975         Fix a significant slow-down of cursor motion with C-n, C-p,
11976         C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
11977         auto-repeat under bidi redisplay in fontified buffers.
11978         * xdisp.c (compute_stop_pos_backwards): New function.
11979         (next_element_from_buffer): Call compute_stop_pos_backwards to
11980         find a suitable prev_stop when we find ourselves before
11981         base_level_stop.
11982         (reseat): Don't look for prev_stop, as that could mean a very long
11983         run.
11984         <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
11985         <cached_disp_overlay_modiff>: Cache for last found display string
11986         position.
11987         (compute_display_string_pos): Return the cached position if asked
11988         about the same buffer in the same area of character positions, and
11989         the buffer wasn't changed since the time the display string
11990         position was cached.
11992 2011-07-22  Eli Zaretskii  <eliz@gnu.org>
11994         * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
11995         is an integer, which is important for empty lines.  (Bug#9149)
11997 2011-07-22  Chong Yidong  <cyd@stupidchicken.com>
11999         * frame.c (Fmodify_frame_parameters): In tty case, update the
12000         default face if necessary (Bug#4238).
12002 2011-07-21  Chong Yidong  <cyd@stupidchicken.com>
12004         * editfns.c (Fstring_to_char): No need to explain what a character
12005         is in the docstring (Bug#6576).
12007 2011-07-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12009         * xml.c (parse_region): Make sure we always return a tree.
12011 2011-07-20  HAMANO Kiyoto  <khiker.mail@gmail.com>
12013         * xml.c (parse_region): If a document contains only comments,
12014         return that, too.
12016 2011-07-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12018         * xml.c (make_dom): Return comments, too.
12020 2011-07-19  Paul Eggert  <eggert@cs.ucla.edu>
12022         Port to OpenBSD.
12023         See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12024         and the surrounding thread.
12025         * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12026         rather than fgets, and retry after EINTR.  Otherwise, 'emacs
12027         --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12028         timer goes off.
12029         * s/openbsd.h (BROKEN_SIGIO): Define.
12030         * unexelf.c (unexec) [__OpenBSD__]:
12031         Don't update the .mdebug section of the Alpha COFF symbol table.
12033 2011-07-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12035         * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12036         (bug#8460).
12038 2011-07-18  Paul Eggert  <eggert@cs.ucla.edu>
12040         * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12041         This fixes some race conditions on the permissions of any newly
12042         created file.
12044         * alloc.c (valid_pointer_p): Use pipe, not open.
12045         This fixes some permissions issues when debugging.
12047         * fileio.c (Fcopy_file): Adjust mode if fchown fails.  (Bug#9002)
12048         If fchown fails to set both uid and gid, try to set just gid,
12049         as that is sometimes allowed.  Adjust the file's mode to eliminate
12050         setuid or setgid bits that are inappropriate if fchown fails.
12052 2011-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
12054         * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12055         to compare Lisp_Objects.
12056         * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12057         global_gnutls_log_level, don't mistake it for a Lisp_Object.
12058         (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12060 2011-07-17  Andreas Schwab  <schwab@linux-m68k.org>
12062         * lread.c (read_integer): Unread even EOF character.
12063         (read1): Likewise.  Properly record start position of symbol.
12065         * lread.c (read1): Read `#:' as empty uninterned symbol if no
12066         symbol character follows.
12068 2011-07-17  Paul Eggert  <eggert@cs.ucla.edu>
12070         * fileio.c (Fcopy_file): Pacify gcc re fchown.  (Bug#9002)
12071         This works around a problem with the previous change to Fcopy_file.
12072         Recent glibc declares fchown with __attribute__((warn_unused_result)),
12073         and without this change, GCC might complain about discarding
12074         fchown's return value.
12076 2011-07-16  Juanma Barranquero  <lekktu@gmail.com>
12078         * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12080 2011-07-16  Paul Eggert  <eggert@cs.ucla.edu>
12082         * fileio.c (Fcopy_file): Don't diagnose fchown failures.  (Bug#9002)
12084 2011-07-16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12086         * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12087         it's used from the C level.
12089         * process.c: Use the same condition for POLL_FOR_INPUT in both
12090         keyboard.c and process.c (bug#1858).
12092 2011-07-09  Lawrence Mitchell  <wence@gmx.li>
12094         * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12095         (Fgnutls_boot): Use it.
12097 2011-07-15  Andreas Schwab  <schwab@linux-m68k.org>
12099         * doc.c (Fsubstitute_command_keys): Revert last change.
12101 2011-07-15  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12103         * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12104         quotes the next character, and doesn't affect other longer
12105         sequences (bug#8935).
12107         * lread.c (syms_of_lread): Clarify that is isn't only
12108         `eval-buffer' and `eval-defun' that's affected by
12109         `lexical-binding' (bug#8460).
12111 2011-07-15  Eli Zaretskii  <eliz@gnu.org>
12113         * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
12114         bidi redisplay when a line includes both an image and is truncated.
12116 2011-07-14  Paul Eggert  <eggert@cs.ucla.edu>
12118         Fix minor problems found by static checking.
12119         * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12120         (elsz): Now a signed constant, not a size_t var.  We prefer signed
12121         types to unsigned, to avoid integer comparison confusion.  Without
12122         this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12123         "cannot optimize loop, the loop counter may overflow", a symptom
12124         of the confusion.
12125         * indent.c (Fvertical_motion): Mark locals as initialized.
12126         * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12128 2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12130         * search.c (Fre_search_backward): Mention `case-fold-search' in
12131         all the re_search_* functions (bug#8138).
12133         * keyboard.c (Fopen_dribble_file): Document when the file is
12134         closed (bug#8056).
12136 2011-07-14  Eli Zaretskii  <eliz@gnu.org>
12138         * bidi.c (bidi_dump_cached_states): Fix format of displaying
12139         bidi_cache_idx.
12141         Support bidi reordering of display and overlay strings.
12142         * xdisp.c (compute_display_string_pos)
12143         (compute_display_string_end): Accept additional argument STRING.
12144         (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12145         (reseat_to_string): Initialize bidi_it->string.s and
12146         bidi_it->string.schars.
12147         (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
12148         NULL (avoids a crash in bidi_paragraph_init).
12149         Initialize itb.string.lstring.
12150         (init_iterator): Call bidi_init_it only of a valid
12151         buffer position was specified.  Initialize paragraph_embedding to
12152         L2R.
12153         (reseat_to_string): Initialize the bidi iterator.
12154         (display_string): If we need to ignore text properties of
12155         LISP_STRING, set IT->stop_charpos to IT->end_charpos.  (The
12156         original value of -1 will not work with bidi.)
12157         (compute_display_string_pos): First arg is now struct
12158         `text_pos *'; all callers changed.  Support display properties on
12159         Lisp strings.
12160         (compute_display_string_end): Support display properties on Lisp
12161         strings.
12162         (init_iterator, reseat_1, reseat_to_string): Initialize the
12163         string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12164         when iterating on a string not from display properties).
12165         (compute_display_string_pos, compute_display_string_end):
12166         Fix calculation of the object to scan.  Fixes an error when using
12167         arrow keys.
12168         (next_element_from_buffer): Don't abort when IT_CHARPOS is before
12169         base_level_stop; instead, set base_level_stop to BEGV.
12170         Fixes crashes in vertical-motion.
12171         (next_element_from_buffer): Improve commentary for when
12172         the iterator is before prev_stop.
12173         (init_iterator): Initialize bidi_p from the default value of
12174         bidi-display-reordering, not from buffer-local value.  Use the
12175         buffer-local value only if initializing for buffer iteration.
12176         (handle_invisible_prop): Support invisible properties on strings
12177         that are being bidi-reordered.
12178         (set_iterator_to_next): Support bidi reordering of C strings and
12179         Lisp strings.
12180         (next_element_from_string): Support bidi reordering of Lisp
12181         strings.
12182         (handle_stop_backwards): Support Lisp strings as well.
12183         (display_string): Support display of R2L glyph rows.
12184         Use IT_STRING_CHARPOS when displaying from a Lisp string.
12185         (init_iterator): Don't initialize it->bidi_p for strings
12186         here.
12187         (reseat_to_string): Initialize it->bidi_p for strings here.
12188         (next_element_from_string, next_element_from_c_string)
12189         (next_element_from_buffer): Add xassert's for correspondence
12190         between IT's object being iterated and it->bidi_it.string
12191         structure.
12192         (face_before_or_after_it_pos): Support bidi iteration.
12193         (next_element_from_c_string): Handle the case of the first string
12194         character that is not the first one in the visual order.
12195         (get_visually_first_element): New function, refactored from common
12196         parts of next_element_from_buffer, next_element_from_string, and
12197         next_element_from_c_string.
12198         (tool_bar_lines_needed, redisplay_tool_bar)
12199         (display_menu_bar): Force left-to-right direction.  Add a FIXME
12200         comment for making that be controlled by a user option.
12201         (push_it, pop_it): Save and restore the state of the
12202         bidi iterator.  Save and restore the bidi_p flag.
12203         (pop_it): Iterate out of display property for string iteration as
12204         well.
12205         (iterate_out_of_display_property): Support iteration over strings.
12206         (handle_single_display_spec): Set up it->bidi_it for iteration
12207         over a display string, and call bidi_init_it.
12208         (handle_single_display_spec, next_overlay_string)
12209         (get_overlay_strings_1, push_display_prop): Set up the bidi
12210         iterator for displaying display or overlay strings.
12211         (forward_to_next_line_start): Don't use the shortcut if
12212         bidi-iterating.
12213         (back_to_previous_visible_line_start): If handle_display_prop
12214         pushed the iterator stack, restore the internal state of the bidi
12215         iterator by calling bidi_pop_it same number of times.
12216         (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12217         and we are bidi-iterating, don't decrement the iterator position;
12218         instead, set the first_elt flag in the bidi iterator, to produce
12219         the same effect.
12220         (reseat_1): Remove redundant setting of string_from_display_prop_p.
12221         (push_display_prop): xassert that we are iterating a buffer.
12222         (push_it, pop_it): Save and restore paragraph_embedding member.
12223         (handle_single_display_spec, next_overlay_string)
12224         (get_overlay_strings_1, reseat_1, reseat_to_string)
12225         (push_display_prop): Set up the `unibyte' member of bidi_it.string
12226         correctly.  Don't assume unibyte strings are not bidi-reordered.
12227         (compute_display_string_pos)
12228         (compute_display_string_end): Fix handling the case of C string.
12229         (push_it, pop_it): Save and restore from_disp_prop_p.
12230         (handle_single_display_spec, push_display_prop): Set the
12231         from_disp_prop_p flag.
12232         (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12233         (pop_it): Call iterate_out_of_display_property only if we are
12234         popping after iteration over a string that came from a display
12235         property.  Fix a typo in popping stretch info.  Add an assertion
12236         for verifying that the iterator position is in sync with the bidi
12237         iterator.
12238         (handle_single_display_spec, get_overlay_strings_1)
12239         (push_display_prop): Fix initialization of paragraph direction for
12240         string when that of the parent object is not yet determined.
12241         (reseat_1): Call bidi_init_it to resync the bidi
12242         iterator with IT's position.  (Bug#7616)
12243         (find_row_edges): If ROW->start.pos gives position
12244         smaller than min_pos, use it as ROW->minpos.  (Bug#7616)
12245         (handle_stop, back_to_previous_visible_line_start, reseat_1):
12246         Reset the from_disp_prop_p flag.
12247         (SAVE_IT, RESTORE_IT): New macros.
12248         (pos_visible_p, face_before_or_after_it_pos)
12249         (back_to_previous_visible_line_start)
12250         (move_it_in_display_line_to, move_it_in_display_line)
12251         (move_it_to, move_it_vertically_backward, move_it_by_lines)
12252         (try_scrolling, redisplay_window, display_line): Use them when
12253         saving a temporary copy of the iterator and restoring it back.
12254         (back_to_previous_visible_line_start, reseat_1)
12255         (init_iterator): Empty the bidi cache "stack".
12256         (move_it_in_display_line_to): If iterator ended up at
12257         EOL, but we never saw any buffer positions smaller than
12258         to_charpos, return MOVE_POS_MATCH_OR_ZV.  Fixes vertical cursor
12259         motion in bidi-reordered lines.
12260         (move_it_in_display_line_to): Record prev_method and prev_pos
12261         immediately before the call to set_iterator_to_next.  Fixes cursor
12262         motion in bidi-reordered lines with stretch glyphs and strings
12263         displayed in margins.  (Bug#8133) (Bug#8867)
12264         Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12265         TO_CHARPOS.
12266         (pos_visible_p): Support positions in bidi-reordered lines.
12267         Save and restore bidi cache.
12269         * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12270         (bidi_paragraph_info): Delete unused struct.
12271         (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12272         (bidi_cache_start): New variable.
12273         (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12274         to zero.
12275         (bidi_cache_fetch_state, bidi_cache_search)
12276         (bidi_cache_find_level_change, bidi_cache_iterator_state)
12277         (bidi_cache_find, bidi_peek_at_next_level)
12278         (bidi_level_of_next_char, bidi_find_other_level_edge)
12279         (bidi_move_to_visually_next): Compare cache index with
12280         bidi_cache_start rather than with zero.
12281         (bidi_fetch_char): Accept new argument STRING; all callers
12282         changed.  Support iteration over a string.  Support strings with
12283         display properties.  Support unibyte strings.  Fix the type of
12284         `len' according to what STRING_CHAR_AND_LENGTH expects.
12285         (bidi_paragraph_init, bidi_resolve_explicit_1)
12286         (bidi_resolve_explicit, bidi_resolve_weak)
12287         (bidi_level_of_next_char, bidi_move_to_visually_next):
12288         Support iteration over a string.
12289         (bidi_set_sor_type, bidi_resolve_explicit_1)
12290         (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12291         can now be zero (for strings); special values 0 and -1 were
12292         changed to -1 and -2, respectively.
12293         (bidi_char_at_pos): New function.
12294         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12295         Call it instead of FETCH_MULTIBYTE_CHAR.
12296         (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12297         initialized to valid values.
12298         (bidi_init_it): Don't initialize charpos and bytepos with invalid
12299         values.
12300         (bidi_level_of_next_char): Allow the sentinel "position" to pass
12301         the test for valid cached positions.  Fix the logic for looking up
12302         the sentinel state in the cache.  GCPRO the Lisp string we are
12303         iterating.
12304         (bidi_push_it, bidi_pop_it): New functions.
12305         (bidi_initialize): Initialize the bidi cache start stack pointer.
12306         (bidi_cache_ensure_space): New function, refactored from part of
12307         bidi_cache_iterator_state.  Don't assume the required size is just
12308         one BIDI_CACHE_CHUNK away.
12309         (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12310         (bidi_count_bytes, bidi_char_at_pos): New functions.
12311         (bidi_cache_search): Don't assume bidi_cache_last_idx is
12312         always valid if bidi_cache_idx is valid.
12313         (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12314         is valid if it's going to be used.
12315         (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12316         (bidi_cache_fetch_state, bidi_cache_search)
12317         (bidi_cache_find_level_change, bidi_cache_ensure_space)
12318         (bidi_cache_iterator_state, bidi_cache_find)
12319         (bidi_find_other_level_edge, bidi_cache_start_stack):
12320         All variables related to cache indices are now EMACS_INT.
12322         * dispextern.h (struct bidi_string_data): New structure.
12323         (struct bidi_it): New member `string'.  Make flag members be 1-bit
12324         fields, and put them last in the struct.
12325         (compute_display_string_pos, compute_display_string_end):
12326         Update prototypes.
12327         (bidi_push_it, bidi_pop_it): Add prototypes.
12328         (struct iterator_stack_entry): New members bidi_p,
12329         paragraph_embedding, and from_disp_prop_p.
12330         (struct it): Member bidi_p is now a bit field 1 bit wide.
12331         (bidi_shelve_cache, bidi_unshelve_cache):
12332         Declare prototypes.
12334         * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12335         (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12336         and vector-like objects.
12338         * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12339         cache around display iteration.
12341         * window.c (Fwindow_end, window_scroll_pixel_based)
12342         (displayed_window_lines, Frecenter): Save and restore the bidi
12343         cache around display iteration.
12345 2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12347         * editfns.c (Fdelete_region): Clarify the use of the named
12348         parameters (bug#6788).
12350 2011-07-14  Martin Rudalics  <rudalics@gmx.at>
12352         * indent.c (Fvertical_motion): Set and restore w->pointm when
12353         saving and restoring the window's buffer (Bug#9006).
12355 2011-07-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12357         * editfns.c (Fstring_to_char): Clarify just what is returned
12358         (bug#6576).  Text by Eli Zaretskii.
12360 2011-07-13  Juanma Barranquero  <lekktu@gmail.com>
12362         * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12364 2011-07-13  Eli Zaretskii  <eliz@gnu.org>
12366         * buffer.c (mmap_find): Fix a typo.
12368 2011-07-13  Johan Bockgård  <bojohan@gnu.org>
12370         Fix execution of x selection hooks.
12371         * xselect.c (Qx_lost_selection_functions)
12372         (Qx_sent_selection_functions): New vars.
12373         (syms_of_xselect): DEFSYM them.
12374         (x_handle_selection_request): Pass Qx_sent_selection_functions
12375         rather than Vx_sent_selection_functions to Frun_hook_with_args.
12376         (x_handle_selection_clear,x_clear_frame_selections):
12377         Pass Qx_lost_selection_functions rather than
12378         Vx_lost_selection_functions to Frun_hook_with_args.
12380 2011-07-13  Paul Eggert  <eggert@cs.ucla.edu>
12382         * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
12383         The old code sometimes used this field without initializing it.
12385         * alloc.c (gc_sweep): Don't read past end of array.
12386         In theory, the old code could also have corrupted Emacs internals,
12387         though it'd be very unlikely.
12389 2011-07-12  Andreas Schwab  <schwab@linux-m68k.org>
12391         * character.c (Fcharacterp): Don't advertise optional ignored
12392         argument.  (Bug#4026)
12394 2011-07-12  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12396         * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12397         key" (bug#4257).
12399         * window.c (Fset_window_start): Doc fix (bug#4199).
12400         (Fset_window_hscroll): Ditto.
12402 2011-07-12  Paul Eggert  <eggert@cs.ucla.edu>
12404         Fix minor new problems caught by GCC 4.6.1.
12405         * term.c (init_tty): Remove unused local.
12406         * xsettings.c (store_monospaced_changed): Define this function only
12407         if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
12408         not used otherwise.
12410 2011-07-12  Chong Yidong  <cyd@stupidchicken.com>
12412         * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12414 2011-07-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12416         * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12417         are the mini-buffer and the echo area (bug#3320).
12419         * term.c (init_tty): Remove support for supdup, c10 and perq
12420         terminals, which are no longer supported (bug#1482).
12422 2011-07-10  Johan Bockgård  <bojohan@gnu.org>
12424         * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12426 2011-07-10  Jan Djärv  <jan.h.d@swipnet.se>
12428         * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12429         for non-popups (Bug#3642).
12431 2011-07-10  Andreas Schwab  <schwab@linux-m68k.org>
12433         * alloc.c (reset_malloc_hooks): Protoize.
12434         * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
12435         (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12436         * cm.c (losecursor): Likewise.
12437         * data.c (fmod): Likewise.
12438         * dispnew.c (swap_glyphs_in_rows): Likewise.
12439         * emacs.c (memory_warning_signal): Likewise.
12440         * floatfns.c (float_error): Likewise.
12441         * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12442         (otf_open, font_otf_capability, generate_otf_features)
12443         (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12444         Likewise.
12445         * image.c (pbm_read_file): Likewise.
12446         * indent.c (string_display_width): Likewise.
12447         * intervals.c (check_for_interval, search_for_interval)
12448         (inc_interval_count, count_intervals, root_interval)
12449         (adjust_intervals_for_insertion, make_new_interval): Likewise.
12450         * lread.c (defalias): Likewise.
12451         * ralloc.c (r_alloc_check): Likewise.
12452         * regex.c (set_image_of_range_1, set_image_of_range)
12453         (regex_grow_registers): Likewise.
12454         * sysdep.c (strerror): Likewise.
12455         * termcap.c (valid_filename_p, tprint, main): Likewise.
12456         * tparam.c (main): Likewise.
12457         * unexhp9k800.c (run_time_remap, save_data_space)
12458         (update_file_ptrs, read_header, write_header, calculate_checksum)
12459         (copy_file, copy_rest, display_header): Likewise.
12460         * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12461         Likewise.
12462         * xdisp.c (check_it): Likewise.
12463         * xfaces.c (register_color, unregister_color, unregister_colors):
12464         Likewise.
12465         * xfns.c (print_fontset_result): Likewise.
12466         * xrdb.c (member, fatal, main): Likewise.
12468 2011-07-10  Paul Eggert  <eggert@cs.ucla.edu>
12470         Fix minor problems found by static checking (Bug#9031).
12471         * chartab.c (char_table_set_range, map_sub_char_table):
12472         Remove unused locals.
12473         (uniprop_table): Now static.
12474         * composite.c (_work_char): Remove unused static var.
12476 2011-07-09  Juanma Barranquero  <lekktu@gmail.com>
12478         * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12480 2011-07-09  Jan Djärv  <jan.h.d@swipnet.se>
12482         * gtkutil.c (qttip_cb): Remove code without function.
12484 2011-07-09  Eli Zaretskii  <eliz@gnu.org>
12486         * w32.c (pthread_sigmask): New stub.
12488 2011-07-08  Paul Eggert  <eggert@cs.ucla.edu>
12490         Use pthread_sigmask, not sigprocmask (Bug#9010).
12491         sigprocmask is portable only for single-threaded applications, and
12492         Emacs can be multi-threaded when it uses GTK.
12493         * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12494         (LIBES): Use it.
12495         * callproc.c (Fcall_process):
12496         * process.c (create_process):
12497         * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12498         Use pthread_sigmask, not sigprocmask.
12500 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
12502         * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12503         (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12504         wrong (Bug#8591).
12506 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
12508         * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12509         Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12510         (xg_hide_tooltip): Fix comment.
12512         * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12513         in registerServicesMenuSendTypes.
12514         (validRequestorForSendType): Don't check ns_return_types.
12516         * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12517         ns_return_type.
12519 2011-07-08  Jason Rumney  <jasonr@gnu.org>
12521         * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12522         SH_SHOW for hidden windows (Bug#5482).
12524         * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12525         frame struct members of non-existent frames (Bug#6284).
12527 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
12529         * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12530         variable firstTime not needed on OSX >= 10.6.
12531         (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12532         >= 10.5.  Use setKnobProportion, setDoubleValue.
12534         * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12535         (MAC_OS_X_VERSION_10_5): Define if not defined.
12536         (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12537         (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12538         (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12540         * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
12541         cString and lossyCString on OSX >= 10.4.
12543         * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
12544         sizeToFit on OSX >= 10.2.
12546         * nsimage.m (allocInitFromFile): Don't use deprecated method
12547         bestRepresentationForDevice on OSX >= 10.6.
12549         * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12550         to avoid warning.
12552         * emacs.c: Declare unexec_init_emacs_zone.
12554         * nsgui.h: Fix compiler warning about gnulib redefining verify.
12556         * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12558         * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12559         on svcsMenu (Bug#8842).
12561         * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12562         ns_return_types.
12563         (Fns_list_services): Just return Qnil on 10.6, code not working there.
12565         * nsterm.m (QUTF8_STRING): Declare.
12566         (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12567         (validRequestorForSendType): Return type is (id).
12568         Change indexOfObjectIdenticalTo to indexOfObject.
12569         Check if we have local selection before returning self (Bug#8842).
12570         (writeSelectionToPasteboard): Put local selection into paste board
12571         if we have a local selection (Bug#8842).
12572         (syms_of_nsterm): DEFSYM QUTF8_STRING.
12574         * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12575         (ns_get_local_selection): Declare.
12577 2011-07-07  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12579         * keymap.c (describe_map_tree): Don't insert a double newline at
12580         the end of the buffer (bug#1169) and return whether we inserted
12581         something.
12583         * callint.c (Fcall_interactively): Change "reading args" to
12584         "providing args" to try to clarify what it does (bug#1010).
12586 2011-07-07  Kenichi Handa  <handa@m17n.org>
12588         * composite.c (composition_compute_stop_pos): Ignore a static
12589         composition starting before CHARPOS (Bug#8915).
12591         * xdisp.c (handle_composition_prop): Likewise.
12593 2011-07-07  Eli Zaretskii  <eliz@gnu.org>
12595         * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12596         (Bug#9015)
12598 2011-07-07  Kenichi Handa  <handa@m17n.org>
12600         * character.h (unicode_category_t): New enum type.
12602         * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12603         (Qchar_code_property_table): New variable.
12604         (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12605         (UNIPROP_COMPRESSED_FORM_P): New macros.
12606         (char_table_ascii): Uncompress the compressed values.
12607         (sub_char_table_ref): New arg is_uniprop.  Callers changed.
12608         Uncompress the compressed values.
12609         (sub_char_table_ref_and_range): Likewise.
12610         (char_table_ref_and_range): Uncompress the compressed values.
12611         (sub_char_table_set): New arg is_uniprop.  Callers changed.
12612         Uncompress the compressed values.
12613         (sub_char_table_set_range): Args changed.  Callers changed.
12614         (char_table_set_range): Adjuted for the above change.
12615         (map_sub_char_table): Delete args default_val and parent.  Add arg
12616         top.  Give decoded values to a Lisp function.
12617         (map_char_table): Adjust for the above change.  Give decoded
12618         values to a Lisp function.  Gcpro more variables.
12619         (uniprop_table_uncompress)
12620         (uniprop_decode_value_run_length): New functions.
12621         (uniprop_decoder, uniprop_decoder_count): New variables.
12622         (uniprop_get_decoder, uniprop_encode_value_character)
12623         (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12624         New functions.
12625         (uniprop_encoder, uniprop_encoder_count): New variables.
12626         (uniprop_get_encoder, uniprop_table)
12627         (Funicode_property_table_internal, Fget_unicode_property_internal)
12628         (Fput_unicode_property_internal): New functions.
12629         (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12630         Sunicode_property_table_internal, Sget_unicode_property_internal,
12631         and Sput_unicode_property_internal.  Defvar_lisp
12632         char-code-property-alist.
12634         * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
12635         Vunicode_category_table.
12637         * font.c (font_range): Adjust for the change of
12638         Vunicode_category_table.
12640 2011-07-07  Dan Nicolaescu  <dann@ics.uci.edu>
12642         * m/iris4d.h: Remove file, move contents ...
12643         * s/irix6-5.h: ... here.
12645 2011-07-06  Paul Eggert  <eggert@cs.ucla.edu>
12647         Remove unportable assumption about struct layout (Bug#8884).
12648         * alloc.c (mark_buffer):
12649         * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
12650         (clone_per_buffer_values): Don't assume that
12651         sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
12652         This isn't true in general, and it's particularly not true
12653         if Emacs is configured with --with-wide-int.
12654         * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
12655         New macros, used in the buffer.c change.
12657 2011-07-05  Jan Djärv  <jan.h.d@swipnet.se>
12659         * xsettings.c: Use both GConf and GSettings if both are available.
12660         (store_config_changed_event): Add comment.
12661         (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
12662         (store_tool_bar_style_changed): New functions.
12663         (store_monospaced_changed): Add comment.  Call dpyinfo_valid.
12664         (struct xsettings): Move font inside HAVE_XFT.
12665         (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
12666         (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
12667         Move inside HAVE_XFT.
12668         (something_changed_gsettingsCB): Rename from something_changedCB.
12669         Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12670         also.
12671         (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
12672         (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT.  Move inside HAVE_XFT.
12673         (something_changed_gconfCB): Rename from something_changedCB.
12674         Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12675         (parse_settings): Move check for font inside HAVE_XFT.
12676         (read_settings, apply_xft_settings): Add comment.
12677         (read_and_apply_settings): Add comment.  Call map_tool_bar_style and
12678         store_tool_bar_style_changed.  Move check for font inside HAVE_XFT and
12679         call store_font_name_changed.
12680         (xft_settings_event): Add comment.
12681         (init_gsettings): Add comment.  Get values for GSETTINGS_TOOL_BAR_STYLE
12682         and GSETTINGS_FONT_NAME.  Move check for fonts within HAVE_XFT.
12683         (init_gconf): Add comment.  Get values for GCONF_TOOL_BAR_STYLE
12684         and GCONF_FONT_NAME.  Move check for fonts within HAVE_XFT.
12685         (xsettings_initialize): Call init_gsettings last.
12686         (xsettings_get_system_font, xsettings_get_system_normal_font):
12687         Add comment.
12689 2011-07-05  Paul Eggert  <eggert@cs.ucla.edu>
12691         Random fixes.  E.g., (random) never returned negative values.
12692         * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12693         subseconds part to the entropy, as that's a bit more random.
12694         Prefer signed to unsigned, since the signedness doesn't matter and
12695         in general we prefer signed.  When given a limit, use a
12696         denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12697         latter isn't right if USE_2_TAGS_FOR_INTS.
12698         * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12699         not 0..VALMASK.  Don't discard "excess" bits that random () returns.
12701 2011-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
12703         * textprop.c (text_property_stickiness):
12704         Obey Vtext_property_default_nonsticky.
12705         (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12706         * w32fns.c (syms_of_w32fns):
12707         * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12709 2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
12711         * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12712         This is more efficient than Ffile_directory_p and avoids a minor race.
12714 2011-07-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12716         * buffer.c (Foverlay_put): Say what the return value is
12717         (bug#7835).
12719         * fileio.c (barf_or_query_if_file_exists): Check first if the file
12720         is a directory before asking whether to use the file name
12721         (bug#7564).
12722         (barf_or_query_if_file_exists): Make the "File is a directory"
12723         error be more correct.
12725         * fns.c (Frequire): Remove the mention of the .gz files, since
12726         that's installation-specific, but keep the mention of
12727         `get-load-suffixes'.
12729 2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
12731         * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12732         Report string overflow if the output is too long.
12734 2011-07-04  Juanma Barranquero  <lekktu@gmail.com>
12736         * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12737         (syms_of_gnutls): Remove duplicate DEFSYM for
12738         Qgnutls_bootprop_verify_hostname_error, an error for
12739         Qgnutls_bootprop_verify_error (which is no longer used).
12741         * eval.c (find_handler_clause): Remove parameters `sig' and `data',
12742         unused since revno:102982 (2011-01-26).  All callers changed.
12743         Also (re)move comments that are misplaced or no longer relevant.
12745 2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12747         * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
12749 2011-07-03  Chong Yidong  <cyd@stupidchicken.com>
12751         * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
12752         and background color parameters if they have been changed.
12754 2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12756         * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
12758 2011-07-03  Paul Eggert  <eggert@cs.ucla.edu>
12760         * xsettings.c (SYSTEM_FONT): Define only when used.
12761         No need to define when HAVE_GSETTINGS || !HAVE_XFT.
12763         * keymap.c (access_keymap_1): Now static.
12765 2011-07-02  Chong Yidong  <cyd@stupidchicken.com>
12767         * keyboard.c (command_loop_1): If a down-mouse event is unbound,
12768         leave any prefix arg for the up event (Bug#1586).
12770 2011-07-02  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12772         * lread.c (syms_of_lread): Mention single symbols defined by
12773         `defvar' or `defconst' (bug#7154).
12775         * fns.c (Frequire): Mention .el.gz files (bug#7314).
12776         (Frequire): Mention get-load-suffixes.
12778 2011-07-02  Martin Rudalics  <rudalics@gmx.at>
12780         * window.h (window): Remove clone_number slot.
12781         * window.c (Fwindow_clone_number, Fset_window_clone_number):
12782         Remove.
12783         (make_parent_window, make_window, saved_window)
12784         (Fset_window_configuration, save_window_save): Don't deal with
12785         clone numbers.
12786         * buffer.c (Qclone_number): Remove declaration.
12787         (sort_overlays, overlay_strings): Don't deal with clone numbers.
12789 2011-07-02  Stefan Monnier  <monnier@iro.umontreal.ca>
12791         Add multiple inheritance to keymaps.
12792         * keymap.c (Fmake_composed_keymap): New function.
12793         (Fset_keymap_parent): Simplify.
12794         (fix_submap_inheritance): Remove.
12795         (access_keymap_1): New function extracted from access_keymap to handle
12796         embedded parents and handle lists of maps.
12797         (access_keymap): Use it.
12798         (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
12799         (Fcopy_keymap): Handle embedded parents.
12800         (Fcommand_remapping, define_as_prefix): Simplify.
12801         (Fkey_binding): Simplify.
12802         (syms_of_keymap): Move minibuffer-local-completion-map,
12803         minibuffer-local-filename-completion-map,
12804         minibuffer-local-must-match-map, and
12805         minibuffer-local-filename-must-match-map to Elisp.
12806         (syms_of_keymap): Defsubr make-composed-keymap.
12807         * keyboard.c (menu_bar_items): Use map_keymap_canonical.
12808         (parse_menu_item): Trivial simplification.
12810 2011-07-01  Glenn Morris  <rgm@gnu.org>
12812         * Makefile.in (SETTINGS_LIBS): Fix typo.
12814 2011-07-01  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
12816         * coding.c (Fencode_coding_string): Record the last coding system
12817         used, as the function doc string says (bug#8738).
12819 2011-07-01  Jan Djärv  <jan.h.d@swipnet.se>
12821         * xsettings.c (store_monospaced_changed): Take new font as arg and
12822         check for change against current_mono_font.
12823         (EMACS_TYPE_SETTINGS): Remove this and related defines.
12824         (emacs_settings_constructor, emacs_settings_get_property)
12825         (emacs_settings_set_property, emacs_settings_class_init)
12826         (emacs_settings_init, gsettings_obj): Remove.
12827         (something_changedCB): New function for HAVE_GSETTINGS.
12828         (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
12829         with value as argument.
12830         (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
12831         g_settings_new (Bug#8967).  Do not create gsettings_obj.
12832         Remove calls to g_settings_bind.  Connect something_changedCB to
12833         "changed".
12835         * xgselect.c: Add defined (HAVE_GSETTINGS).
12836         (xgselect_initialize): Ditto.
12838         * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
12839         (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
12840         xg_select.
12842 2011-07-01  Paul Eggert  <eggert@cs.ucla.edu>
12844         * eval.c (struct backtrace): Simplify and port the data structure.
12845         Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
12846         signed bit field, as this assumption is not portable and it makes
12847         Emacs crash when compiled with Sun C 5.8 on sparc.  Do not use
12848         "char debug_on_exit : 1" as this is not portable either; instead,
12849         use the portable "unsigned int debug_on_exit : 1".  Remove unused
12850         member evalargs.  Remove obsolete comments about cc bombing out.
12852 2011-06-30  Jan Djärv  <jan.h.d@swipnet.se>
12854         * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
12855         Let HAVE_GSETTINGS override HAVE_GCONF.
12856         (store_monospaced_changed): New function.
12857         (EMACS_SETTINGS): A new type derived from GObject to handle
12858         GSettings notifications.
12859         (emacs_settings_constructor, emacs_settings_get_property)
12860         (emacs_settings_set_property, emacs_settings_class_init):
12861         New functions.
12862         (gsettings_client, gsettings_obj): New variables.
12863         (GSETTINGS_SCHEMA): New define.
12864         (something_changedCB): Call store_monospaced_changed.
12865         (init_gsettings): New function.
12866         (xsettings_initialize): Call init_gsettings.
12867         (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
12868         to NULL.
12870         * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
12871         GCONF_CFLAGS/LIBS.
12873 2011-06-29  Martin Rudalics  <rudalics@gmx.at>
12875         * window.c (resize_root_window, grow_mini_window)
12876         (shrink_mini_window): Rename Qresize_root_window to
12877         Qwindow_resize_root_window and Qresize_root_window_vertically to
12878         Qwindow_resize_root_window_vertically.
12880 2011-06-28  Paul Eggert  <eggert@cs.ucla.edu>
12882         * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
12884 2011-06-27  Juanma Barranquero  <lekktu@gmail.com>
12886         * makefile.w32-in: Redesign dependencies so they reflect more
12887         clearly which files are directly included by each source file,
12888         and not through other includes.
12890 2011-06-27  Martin Rudalics  <rudalics@gmx.at>
12892         * buffer.c (Qclone_number): Declare static and DEFSYM it.
12893         (sort_overlays, overlay_strings): When an overlay's clone number
12894         matches the window's clone number process the overlay even if
12895         the overlay's window property doesn't match the current window.
12897         * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
12898         (Fwindow_hchild): Rename to Fwindow_left_child.
12899         (Fwindow_next): Rename to Fwindow_next_sibling.
12900         (Fwindow_prev): Rename to Fwindow_prev_sibling.
12901         (resize_window_check): Rename to window_resize_check.
12902         (resize_window_apply): Rename to window_resize_apply.
12903         (Fresize_window_apply): Rename to Fwindow_resize_apply.
12904         (Fdelete_other_windows_internal, resize_frame_windows)
12905         (Fsplit_window_internal, Fdelete_window_internal)
12906         (grow_mini_window, shrink_mini_window)
12907         (Fresize_mini_window_internal): Fix callers accordingly.
12909 2011-06-26  Jan Djärv  <jan.h.d@swipnet.se>
12911         * emacsgtkfixed.h: State that this is only used with Gtk+3.
12912         (emacs_fixed_set_min_size): Remove.
12913         (emacs_fixed_new): Take frame as argument.
12915         * emacsgtkfixed.c: State that this is only used with Gtk+3.
12916         (_EmacsFixedPrivate): Remove minwidth/height.
12917         Add struct frame *f.
12918         (emacs_fixed_init): Initialize priv->f.
12919         (get_parent_class, emacs_fixed_set_min_size): Remove.
12920         (emacs_fixed_new): Set priv->f to argument.
12921         (emacs_fixed_get_preferred_width)
12922         (emacs_fixed_get_preferred_height): Use min_width/height from
12923         frames size_hint to set minimum and natural (Bug#8919).
12924         (XSetWMSizeHints, XSetWMNormalHints): Override these functions
12925         and use min_width/height from frames size_hint to set
12926         min_width/height (Bug#8919).
12928         * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
12929         (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
12930         Fix indentation.
12932 2011-06-26  Eli Zaretskii  <eliz@gnu.org>
12934         * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
12935         bidi_at_paragraph_end, since fast_looking_at doesn't like to be
12936         called at ZV.
12938 2011-06-26  Chong Yidong  <cyd@stupidchicken.com>
12940         * process.c (wait_reading_process_output): Bypass select if
12941         waiting for a cell while ignoring keyboard input, and input is
12942         pending.  Suggested by Jan Djärv (Bug#8869).
12944 2011-06-25  Paul Eggert  <eggert@cs.ucla.edu>
12946         Use gnulib's dup2 module instead of rolling our own.
12947         * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
12949 2011-06-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
12951         * dispnew.c (scrolling_window): Before scrolling, turn off a
12952         mouse-highlight in the window being scrolled.
12954 2011-06-24  Juanma Barranquero  <lekktu@gmail.com>
12956         Move DEFSYM to lisp.h and use everywhere.
12958         * character.h (DEFSYM): Move declaration...
12959         * lisp.h (DEFSYM): ...here.
12961         * gnutls.c:
12962         * minibuf.c:
12963         * w32menu.c:
12964         * w32proc.c:
12965         * w32select.c: Don't include character.h.
12967         * alloc.c (syms_of_alloc):
12968         * buffer.c (syms_of_buffer):
12969         * bytecode.c (syms_of_bytecode):
12970         * callint.c (syms_of_callint):
12971         * casefiddle.c (syms_of_casefiddle):
12972         * casetab.c (init_casetab_once):
12973         * category.c (init_category_once, syms_of_category):
12974         * ccl.c (syms_of_ccl):
12975         * cmds.c (syms_of_cmds):
12976         * composite.c (syms_of_composite):
12977         * dbusbind.c (syms_of_dbusbind):
12978         * dired.c (syms_of_dired):
12979         * dispnew.c (syms_of_display):
12980         * doc.c (syms_of_doc):
12981         * editfns.c (syms_of_editfns):
12982         * emacs.c (syms_of_emacs):
12983         * eval.c (syms_of_eval):
12984         * fileio.c (syms_of_fileio):
12985         * fns.c (syms_of_fns):
12986         * frame.c (syms_of_frame):
12987         * fringe.c (syms_of_fringe):
12988         * insdel.c (syms_of_insdel):
12989         * keymap.c (syms_of_keymap):
12990         * lread.c (init_obarray, syms_of_lread):
12991         * macros.c (syms_of_macros):
12992         * msdos.c (syms_of_msdos):
12993         * print.c (syms_of_print):
12994         * process.c (syms_of_process):
12995         * search.c (syms_of_search):
12996         * sound.c (syms_of_sound):
12997         * syntax.c (init_syntax_once, syms_of_syntax):
12998         * terminal.c (syms_of_terminal):
12999         * textprop.c (syms_of_textprop):
13000         * undo.c (syms_of_undo):
13001         * w32.c (globals_of_w32):
13002         * window.c (syms_of_window):
13003         * xdisp.c (syms_of_xdisp):
13004         * xfaces.c (syms_of_xfaces):
13005         * xfns.c (syms_of_xfns):
13006         * xmenu.c (syms_of_xmenu):
13007         * xsettings.c (syms_of_xsettings):
13008         * xterm.c (syms_of_xterm): Use DEFSYM.
13010 2011-06-24  Teodor Zlatanov  <tzz@lifelogs.com>
13012         * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
13014 2011-06-23  Paul Eggert  <eggert@cs.ucla.edu>
13016         Integer and buffer overflow fixes (Bug#8873).
13018         * print.c (printchar, strout): Check for string overflow.
13019         (PRINTPREPARE, printchar, strout):
13020         Don't set size unless allocation succeeds.
13022         * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13023         for sizes.  Check for string overflow more accurately.
13024         Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13026         * macros.c: Integer and buffer overflow fixes.
13027         * keyboard.h (struct keyboard.kbd_macro_bufsize):
13028         * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13029         Use ptrdiff_t, not int, for sizes.
13030         Don't increment bufsize until after realloc succeeds.
13031         Check for size-calculation overflow.
13032         (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13034         * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13036         * lread.c: Integer overflow fixes.
13037         (read_integer): Radix is now EMACS_INT, not int,
13038         to improve quality of diagnostics for out-of-range radices.
13039         Calculate buffer size correctly for out-of-range radices.
13040         (read1): Check for integer overflow in radices, and in
13041         read-circle numbers.
13042         (read_escape): Avoid int overflow.
13043         (Fload, openp, read_buffer_size, read1)
13044         (substitute_object_recurse, read_vector, read_list, map_obarray):
13045         Use ptrdiff_t, not int, for sizes.
13046         (read1): Use EMACS_INT, not int, for sizes.
13047         Check for size overflow.
13049         * image.c (cache_image): Check for size arithmetic overflow.
13051         * lread.c: Integer overflow issues.
13052         (saved_doc_string_size, saved_doc_string_length)
13053         (prev_saved_doc_string_size, prev_saved_doc_string_length):
13054         Now ptrdiff_t, not int.
13055         (read1): Don't assume doc string length fits in int.  Check for
13056         out-of-range doc string lengths.
13057         (read_list): Don't assume file position fits in int.
13058         (read_escape): Check for hex character overflow.
13060 2011-06-22  Leo Liu  <sdl.web@gmail.com>
13062         * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13063         Move to minibuffer.el.
13065 2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
13067         Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
13068         The following patches are for when GLYPH_DEBUG && !XASSERT.
13069         * dispextern.h (trace_redisplay_p, dump_glyph_string):
13070         * dispnew.c (flush_stdout):
13071         * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13072         Mark as externally visible.
13073         * dispnew.c (check_window_matrix_pointers): Now static.
13074         * dispnew.c (window_to_frame_vpos):
13075         * xfns.c (unwind_create_frame):
13076         * xterm.c (x_check_font): Remove unused local.
13077         * scroll.c (CHECK_BOUNDS):
13078         * xfaces.c (cache_fache): Rename local to avoid shadowing.
13079         * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13080         * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13081         (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13082         (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13083         Now static.
13084         (debug_method_add): Use va_list and vsprintf rather than relying
13085         on undefined behavior with wrong number of arguments.
13086         (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13087         Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13088         In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13089         since we're not interested in debugging glyphs with old libraries.
13090         * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13091         GCC 4.6.0's static checking.
13093 2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
13095         Integer overflow and signedness fixes (Bug#8873).
13096         A few related buffer overrun fixes, too.
13098         * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13100         * dispextern.h (struct face.stipple):
13101         * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13102         (x_bitmap_mask, x_allocate_bitmap_record)
13103         (x_create_bitmap_from_data, x_create_bitmap_from_file)
13104         (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13105         (x_create_bitmap_from_xpm_data):
13106         * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13107         * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13108         (.bitmaps_last):
13109         * xfaces.c (load_pixmap):
13110         * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13111         * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13112         (.bitmaps_last, struct x_output.icon_bitmap):
13113         Use ptrdiff_t, not int, for bitmap indexes.
13114         (x_allocate_bitmap_record): Check for size overflow.
13115         * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13117         Use ptrdiff_t, not int, for overlay counts.
13118         * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13119         * editfns.c (overlays_around, get_pos_property):
13120         * textprop.c (get_char_property_and_overlay):
13121         * xdisp.c (next_overlay_change, note_mouse_highlight):
13122         * xfaces.c (face_at_buffer_position):
13123         * buffer.c (OVERLAY_COUNT_MAX): New macro.
13124         (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13125         (Fnext_overlay_change, Fprevious_overlay_change)
13126         (mouse_face_overlay_overlaps, Foverlays_in):
13127         Use ptrdiff_t, not int, for sizes.
13128         (overlays_at, overlays_in): Check for size-calculation overflow.
13130         * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13132         * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13133         (x_session_initialize): Do not assume string length fits in int.
13135         * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13136         This is unlikely, but can occur if DPI is outlandish.
13138         * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
13139         * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13141         * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13142         * xrdb.c (magic_file_p, search_magic_path):
13143         Omit last arg SUFFIX; it was always 0.  All callers changed.
13144         (magic_file_p): Use ptrdiff_t, not int.  Check for size overflow.
13146         * xfont.c (xfont_match): Avoid need for strlen.
13148         * xfns.c: Don't assume strlen fits in int.
13149         (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13151         * xdisp.c (message_log_check_duplicate): Return intmax_t,
13152         not unsigned long, as we prefer signed integers.  All callers changed.
13153         Detect integer overflow in repeat count.
13154         (message_dolog): Don't assume print length fits in 39 bytes.
13155         (display_mode_element): Don't assume strlen fits in int.
13157         * termcap.c: Don't assume sizes fit in int and never overflow.
13158         (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13159         (gobble_line): Check for size-calculation overflow.
13161         * minibuf.c (Fread_buffer):
13162         * lread.c (intern, intern_c_string):
13163         * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13164         Don't assume string length fits in int.
13166         * keyboard.c (parse_tool_bar_item):
13167         * gtkutil.c (style_changed_cb): Avoid need for strlen.
13169         * font.c: Don't assume string length fits in int.
13170         (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13171         Use ptrdiff_t, not int.
13172         (font_intern_prop): Don't assume string length fits in int.
13173         Don't assume integer property fits in fixnum.
13174         * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
13176         * filelock.c: Fix some buffer overrun and integer overflow issues.
13177         (get_boot_time): Don't assume gzip command string fits in 100 bytes.
13178         Reformulate so as not to need the command string.
13179         Invoke gzip -cd rather than gunzip, as it's more portable.
13180         (lock_info_type, lock_file_1, lock_file):
13181         Don't assume pid_t and time_t fit in unsigned long.
13182         (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13183         (current_lock_owner): Prefer signed type for sizes.
13184         Use memcpy, not strncpy, where memcpy is what is really wanted.
13185         Don't assume (via atoi) that time_t and pid_t fit in int.
13186         Check for time_t and/or pid_t out of range, e.g., via a network share.
13187         Don't alloca where an auto var works fine.
13189         * fileio.c: Fix some integer overflow issues.
13190         (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13191         Don't assume string length fits in int.
13192         (directory_file_name): Don't assume string length fits in long.
13193         (make_temp_name): Don't assume pid fits in int, or that its print
13194         length is less than 20.
13196         * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13198         * coding.c (make_subsidiaries): Don't assume string length fits in int.
13200         * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13202         * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13203         We prefer signed integers, even for size calculations.
13205         * emacs.c: Don't assume string length fits in 'int'.
13206         (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13207         (main): Don't invoke strlen when not needed.
13209         * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13210         (XD_DEBUG_MESSAGE): Don't waste a byte.
13212         * callproc.c (getenv_internal_1, getenv_internal)
13213         (Fgetenv_internal):
13214         * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13216         * lread.c (invalid_syntax): Omit length argument.
13217         All uses changed.  This doesn't fix a bug, but it simplifies the
13218         code away from its former Hollerith-constant appearance, and it's
13219         one less 'int' to worry about when looking at integer-overflow issues.
13220         (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
13222         * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13223         This didn't break anything, but it didn't help either.
13224         It's confusing to put a bogus integer in a place where the actual
13225         value does not matter.
13226         (LIST_END_P): Remove unused macro and its bogus comment.
13227         (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
13229         * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13230         This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13231         implementation.
13232         (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13233         We prefer signed types, and the value cannot exceed the EMACS_INT
13234         range anyway (because otherwise the length would not be representable).
13235         (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13236         not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13237         This avoids a GCC warning when WIDE_EMACS_INT.
13239         * indent.c (sane_tab_width): New function.
13240         (current_column, scan_for_column, Findent_to, position_indentation)
13241         (compute_motion): Use it.  This is just for clarity.
13242         (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
13244         * image.c (xbm_image_p): Don't assume stated width, height fit in int.
13246         * lisp.h (lint_assume): New macro.
13247         * composite.c (composition_gstring_put_cache):
13248         * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13250         * editfns.c, insdel.c:
13251         Omit unnecessary forward decls, to simplify future changes.
13253         * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13255         * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13257         * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
13258         Use much-faster test for byte-length change.
13259         Don't assume string byte-length fits in 'int'.
13260         Check that character arg fits in 'int'.
13261         (mapcar1): Declare byte as byte, for clarity.
13263         * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13265         * fns.c (concat): Catch string overflow earlier.
13266         Do not rely on integer wraparound.
13268         * dispextern.h (struct it.overlay_strings_charpos)
13269         (struct it.selective): Now EMACS_INT, not int.
13270         * xdisp.c (forward_to_next_line_start)
13271         (back_to_previous_visible_line_start)
13272         (reseat_at_next_visible_line_start, next_element_from_buffer):
13273         Don't arbitrarily truncate the value of 'selective' to int.
13275         * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13277         * composite.c: Don't truncate sizes to 'int'.
13278         (composition_gstring_p, composition_reseat_it)
13279         (composition_adjust_point): Use EMACS_INT, not int.
13280         (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13281         not EMACS_UINT, for indexes.
13283         * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13285         * buffer.c: Include <verify.h>.
13286         (struct sortvec.priority, struct sortstr.priority):
13287         Now EMACS_INT, not int.
13288         (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
13289         (struct sortstr.size, record_overlay_string)
13290         (struct sortstrlist.size, struct sortlist.used):
13291         Don't truncate size to int.
13292         (record_overlay_string): Check for size-calculation overflow.
13293         (init_buffer_once): Check at compile-time, not run-time.
13295 2011-06-22  Jim Meyering  <meyering@redhat.com>
13297         Don't leak an XBM-image-sized buffer
13298         * image.c (xbm_load): Free the image buffer after using it.
13300 2011-06-21  Paul Eggert  <eggert@cs.ucla.edu>
13302         Port to Sun C.
13303         * composite.c (find_automatic_composition): Omit needless 'return 0;'
13304         that Sun C diagnosed.
13305         * fns.c (secure_hash): Fix pointer signedness issue.
13306         * intervals.c (static_offset_intervals): New function.
13307         (offset_intervals): Use it.
13309 2011-06-21  Leo Liu  <sdl.web@gmail.com>
13311         * deps.mk (fns.o):
13312         * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13313         sha512.h.
13315         * fns.c (secure_hash): Rename from crypto_hash_function and change
13316         the first arg to accept symbols.
13317         (Fsecure_hash): New primitive.
13318         (syms_of_fns): New symbols.
13320 2011-06-20  Deniz Dogan  <deniz@dogan.se>
13322         * process.c (Fset_process_buffer): Clarify return value in
13323         docstring.
13325 2011-06-18  Chong Yidong  <cyd@stupidchicken.com>
13327         * dispnew.c (add_window_display_history): Use BVAR.
13329         * xdisp.c (debug_method_add): Use BVAR.
13330         (check_window_end, dump_glyph_matrix, dump_glyph)
13331         (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13333         * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13334         Likewise.
13336         * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13337         check till after the cache is created in init_frame_faces.
13339 2011-06-17  Stefan Monnier  <monnier@iro.umontreal.ca>
13341         * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13343 2011-06-16  Paul Eggert  <eggert@cs.ucla.edu>
13345         * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13346         Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13347         hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13349         Improve buffer-overflow checking (Bug#8873).
13350         * fileio.c (Finsert_file_contents):
13351         * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13352         Remove the old (too-loose) buffer overflow checks.
13353         They weren't needed, since make_gap checks for buffer overflow.
13354         * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13355         The old code merely checked for Emacs fixnum overflow, and relied
13356         on undefined (wraparound) behavior.  The new code avoids undefined
13357         behavior, and also checks for ptrdiff_t and/or size_t overflow.
13359         * editfns.c (Finsert_char): Don't dump core with very negative counts.
13360         Tune.  Don't use wider integers than needed.  Don't use alloca.
13361         Use a bigger 'string' buffer.  Rewrite to avoid 'n > 0' test.
13363         * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13365         * insdel.c, lisp.h (buffer_overflow): New function.
13366         (insert_from_buffer_1, replace_range, replace_range_2):
13367         * insdel.c (make_gap_larger):
13368         * editfns.c (Finsert_char):
13369         * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13371         * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13373 2011-06-15  Paul Eggert  <eggert@cs.ucla.edu>
13375         Integer overflow and signedness fixes (Bug#8873, Bug#8828).
13377         * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13378         (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13380         * fileio.c: Don't assume EMACS_INT fits in off_t.
13381         (emacs_lseek): New static function.
13382         (Finsert_file_contents, Fwrite_region): Use it.
13383         Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13385         * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13387         * fns.c: Don't overflow int when computing a list length.
13388         * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13389         (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13390         truncation on 64-bit hosts.  Check for QUIT every
13391         QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13392         faster and is responsive enough.
13393         (Flength): Report an error instead of overflowing an integer.
13394         (Fsafe_length): Return a float if the value is not representable
13395         as a fixnum.  This shouldn't happen except in contrived situations.
13396         (Fnthcdr, Fsort): Don't assume list length fits in int.
13397         (Fcopy_sequence): Don't assume vector length fits in int.
13399         * alloc.c: Check that resized vectors' lengths fit in fixnums.
13400         (header_size, word_size): New constants.
13401         (allocate_vectorlike): Don't check size overflow here.
13402         (allocate_vector): Check it here instead, since this is the only
13403         caller of allocate_vectorlike that could cause overflow.
13404         Check that the new vector's length is representable as a fixnum.
13406         * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13407         The previous code was bogus.  For example, next_almost_prime (32)
13408         returned 39, which is undesirable as it is a multiple of 3; and
13409         next_almost_prime (24) returned 25, which is a multiple of 5 so
13410         why was the code bothering to check for multiples of 7?
13412         * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13414         * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13416         Variadic C functions now count arguments with ptrdiff_t.
13417         This partly undoes my 2011-03-30 change, which replaced int with size_t.
13418         Back then I didn't know that the Emacs coding style prefers signed int.
13419         Also, in the meantime I found a few more instances where arguments
13420         were being counted with int, which may truncate counts on 64-bit
13421         machines, or EMACS_INT, which may be unnecessarily wide.
13422         * lisp.h (struct Lisp_Subr.function.aMANY)
13423         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13424         Arg counts are now ptrdiff_t, not size_t.
13425         All variadic functions and their callers changed accordingly.
13426         (struct gcpro.nvars): Now size_t, not size_t.  All uses changed.
13427         * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13428         to avoid potential buffer overrun.  Don't assume arg counts fit in 'int'.
13429         * callint.c (Fcall_interactively): Check arg count for overflow,
13430         to avoid potential buffer overrun.  Use signed char, not 'int',
13431         for 'varies' array, so that we needn't bother to check its size
13432         calculation for overflow.
13433         * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13434         * eval.c (apply_lambda):
13435         * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13436         (struct textprop_rec.argnum): Now ptrdiff_t, not int.  All uses changed.
13437         (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13439         * callint.c (Fcall_interactively): Don't use index var as event count.
13441         * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13442         * mem-limits.h (SIZE): Remove; no longer used.
13444         * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
13446         Remove unnecessary casts.
13447         * xterm.c (x_term_init):
13448         * xfns.c (x_set_border_pixel):
13449         * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13450         These aren't needed now that we assume ANSI C.
13452         * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13453         It's more likely to cause problems (due to unsigned overflow)
13454         than to cure them.
13456         * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13458         * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13460         * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13462         * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13464         * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13466         * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13468         GLYPH_CODE_FACE returns EMACS_INT, not int.
13469         * dispextern.h (merge_faces):
13470         * xfaces.c (merge_faces):
13471         * xdisp.c (get_next_display_element, next_element_from_display_vector):
13472         Don't assume EMACS_INT fits in int.
13474         * character.h (CHAR_VALID_P): Remove unused parameter.
13475         * fontset.c, lisp.h, xdisp.c: All uses changed.
13477         * editfns.c (Ftranslate_region_internal): Omit redundant test.
13479         * fns.c (concat): Minor tuning based on overflow analysis.
13480         This doesn't fix any bugs.  Use int to hold character, instead
13481         of constantly refetching from Emacs object.  Use XFASTINT, not
13482         XINT, for value known to be a character.  Don't bother comparing
13483         a single byte to 0400, as it's always less.
13485         * floatfns.c (Fexpt):
13486         * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13488         * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13489         for characters.
13491         * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13493         * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13494         Without this fix, on a 64-bit host (aset S 0 4294967386) would
13495         incorrectly succeed when S was a string, because 4294967386 was
13496         truncated before it was used.
13498         * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13499         Otherwise, an out-of-range integer could cause undefined behavior
13500         on a 64-bit host.
13502         * composite.c: Use int, not EMACS_INT, for characters.
13503         (fill_gstring_body, composition_compute_stop_pos): Use int, not
13504         EMACS_INT, for values that are known to be in character range.
13505         This doesn't fix any bugs but is the usual style inside Emacs and
13506         may generate better code on 32-bit machines.
13508         Make sure a 64-bit char is never passed to ENCODE_CHAR.
13509         This is for reasons similar to the recent CHAR_STRING fix.
13510         * charset.c (Fencode_char): Check that character arg is actually
13511         a character.  Pass an int to ENCODE_CHAR.
13512         * charset.h (ENCODE_CHAR): Verify that the character argument is no
13513         wider than 'int', as a compile-time check to prevent future regressions
13514         in this area.
13516         * character.c (char_string): Remove unnecessary casts.
13518         Make sure a 64-bit char is never passed to CHAR_STRING.
13519         Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13520         by silently ignoring the top 32 bits, allowing some values
13521         that were far too large to be valid characters.
13522         * character.h: Include <verify.h>.
13523         (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13524         arguments are no wider than unsigned, as a compile-time check
13525         to prevent future regressions in this area.
13526         * data.c (Faset):
13527         * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13528         (Fsubst_char_in_region):
13529         * fns.c (concat):
13530         * xdisp.c (decode_mode_spec_coding):
13531         Adjust to CHAR_STRING's new requirement.
13532         * editfns.c (Finsert_char, Fsubst_char_in_region):
13533         * fns.c (concat): Check that character args are actually
13534         characters.  Without this test, these functions did the wrong
13535         thing with wildly out-of-range values on 64-bit hosts.
13537         Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13538         These casts should not be needed on 32-bit hosts, either.
13539         * keyboard.c (read_char):
13540         * lread.c (Fload): Remove casts to unsigned.
13542         * lisp.h (UNSIGNED_CMP): New macro.
13543         This fixes comparison bugs on 64-bit hosts.
13544         (ASCII_CHAR_P): Use it.
13545         * casefiddle.c (casify_object):
13546         * character.h (ASCII_BYTE_P, CHAR_VALID_P)
13547         (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13548         * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13549         * dispextern.h (FACE_FROM_ID):
13550         * keyboard.c (read_char): Use UNSIGNED_CMP.
13552         * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13553         not to EMACS_INT, to avoid GCC warning.
13555         * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13557         * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13558         The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13559         isn't needed on 32-bit machines.
13561         * buffer.c (Fgenerate_new_buffer_name):
13562         Use EMACS_INT for count, not int.
13563         (advance_to_char_boundary): Return EMACS_INT, not int.
13565         * data.c (Qcompiled_function): Now static.
13567         * window.c (window_body_lines): Now static.
13569         * image.c (gif_load): Rename local to avoid shadowing.
13571         * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13572         (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13573         * alloc.c (make_save_value): Integer argument is now of type
13574         ptrdiff_t, not int.
13575         (mark_object): Use ptrdiff_t, not int.
13576         * lisp.h (pD): New macro.
13577         * print.c (print_object): Use it.
13579         * alloc.c: Use EMACS_INT, not int, to count objects.
13580         (total_conses, total_markers, total_symbols, total_vector_size)
13581         (total_free_conses, total_free_markers, total_free_symbols)
13582         (total_free_floats, total_floats, total_free_intervals)
13583         (total_intervals, total_strings, total_free_strings):
13584         Now EMACS_INT, not int.  All uses changed.
13585         (Fgarbage_collect): Compute overall total using a double, so that
13586         integer overflow is less likely to be a problem.  Check for overflow
13587         when converting back to an integer.
13588         (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13589         (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13590         These were 'int' variables that could overflow on 64-bit hosts;
13591         they were never used, so remove them instead of repairing them.
13592         (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
13593         (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13594         Previously, this ceilinged at INT_MAX, but that doesn't work on
13595         64-bit machines.
13596         (allocate_pseudovector): Don't use EMACS_INT when int would do.
13598         * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
13599         (allocate_vectorlike): Check for ptrdiff_t overflow.
13600         (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13601         when a (possibly-narrower) signed value would do just as well.
13602         We prefer using signed arithmetic, to avoid comparison confusion.
13604         * alloc.c: Catch some string size overflows that we were missing.
13605         (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13606         for convenience in STRING_BYTES_MAX.
13607         (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13608         The definition here is exact; the one in lisp.h was approximate.
13609         (allocate_string_data): Check for string overflow.  This catches
13610         some instances we weren't catching before.  Also, it catches
13611         size_t overflow on (unusual) hosts where SIZE_MAX <= min
13612         (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13613         and ptrdiff_t and EMACS_INT are both 64 bits.
13615         * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13616         All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
13617         * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
13619         * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13621         * alloc.c (Fmake_string): Check for out-of-range init.
13623 2011-06-15  Stefan Monnier  <monnier@iro.umontreal.ca>
13625         * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13627 2011-06-14  Jan Djärv  <jan.h.d@swipnet.se>
13629         * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13630         xg_get_default_scrollbar_width.
13632         * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13633         (int_gtk_range_get_value): Move to the scroll bar part of the file.
13634         (style_changed_cb): Call update_theme_scrollbar_width and call
13635         x_set_scroll_bar_default_width and xg_frame_set_char_size for
13636         all frames (Bug#8505).
13637         (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
13638         Call gtk_window_set_resizable if HAVE_GTK3.
13639         (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
13640         and height if HAVE_GTK3 (Bug#8505).
13641         (scroll_bar_width_for_theme): New variable.
13642         (update_theme_scrollbar_width): New function.
13643         (xg_get_default_scrollbar_width): Move code to
13644         update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
13645         (xg_initialize): Call update_theme_scrollbar_width.
13647         * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
13649         * emacsgtkfixed.c, emacsgtkfixed.h: New files.
13651 2011-06-12  Martin Rudalics  <rudalics@gmx.at>
13653         * frame.c (make_frame): Call other_buffer_safely instead of
13654         other_buffer.
13656         * window.c (temp_output_buffer_show): Call display_buffer with
13657         second argument Vtemp_buffer_show_specifiers and reset latter
13658         immediately after the call.
13659         (Vtemp_buffer_show_specifiers): New variable.
13660         (auto_window_vscroll_p, next_screen_context_lines)
13661         (Vscroll_preserve_screen_position): Remove leading asterisks from
13662         doc-strings.
13664 2011-06-12  Paul Eggert  <eggert@cs.ucla.edu>
13666         Fix minor problems found by GCC 4.6.0 static checking.
13667         * buffer.c (Qclone_number): Remove for now, as it's unused.
13668         (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13669         (record_buffer): Remove unused local.
13670         * frame.c (other_visible_frames, frame_buffer_list): Now static.
13671         (set_frame_buffer_list): Remove; unused.
13672         * frame.h (other_visible_frames): Remove decl.
13673         * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13674         * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13675         (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13676         if HAVE_GPM.
13677         * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13678         * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13679         Define only if HAVE_GPM.
13680         * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13681         (update_hints_inhibit): Remove; never set.  All uses removed.
13682         * widgetprv.h (emacsFrameClassRec): Remove decl.
13683         * window.c (delete_deletable_window): Now returns void, since it
13684         wasn't returning anything.
13685         (compare_window_configurations): Remove unused locals.
13686         * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13687         * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
13688         (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13689         the same widths as pointers.  This follows up on the 2011-05-06 patch.
13690         * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13691         * xterm.h: Likewise.
13692         (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13694 2011-06-12  Juanma Barranquero  <lekktu@gmail.com>
13696         * makefile.w32-in: Update dependencies.
13697         (LISP_H): Add lib/intprops.h.
13699 2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
13701         * image.c (gif_load): Add animation frame delay to the metadata.
13702         (syms_of_image): Use DEFSYM.  New symbol `delay'.
13704 2011-06-11  Martin Rudalics  <rudalics@gmx.at>
13706         * window.c (delete_deletable_window): Re-add.
13707         (Fset_window_configuration): Rewrite to handle dead buffers and
13708         consequently deletable windows.
13709         (window_tree, Fwindow_tree): Remove.  Supply functionality in
13710         window.el.
13711         (compare_window_configurations): Simplify code.
13713 2011-06-11  Andreas Schwab  <schwab@linux-m68k.org>
13715         * image.c (imagemagick_load_image): Fix type mismatch.
13716         (Fimagemagick_types): Likewise.
13718         * window.h (replace_buffer_in_windows): Declare.
13720 2011-06-11  Martin Rudalics  <rudalics@gmx.at>
13722         * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13723         Qclone_number.  Remove external declaration of Qdelete_window.
13724         (Fbuffer_list): Rewrite doc-string.  Minor restructuring of
13725         code.
13726         (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13727         Run Qbuffer_list_update_hook if allowed.
13728         (Fother_buffer): Rewrite doc-string.  Major rewrite for new
13729         buffer list implementation.
13730         (other_buffer_safely): New function.
13731         (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13732         calls to replace_buffer_in_windows and
13733         replace_buffer_in_windows_safely.  Run Qbuffer_list_update_hook
13734         if allowed.
13735         (record_buffer): Inhibit quitting and rewrite using quittable
13736         functions.  Run Qbuffer_list_update_hook if allowed.
13737         (Frecord_buffer, Funrecord_buffer): New functions.
13738         (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13739         Move switch-to-buffer to window.el.
13740         (bury-buffer): Move to window.el.
13741         (Vbuffer_list_update_hook): New variable.
13743         * lisp.h (other_buffer_safely): Add prototype in buffer.c
13744         section.
13746         * window.h (resize_frame_windows): Move up in code.
13747         (Fwindow_frame): Remove EXFUN.
13748         (replace_buffer_in_all_windows): Remove prototype.
13749         (replace_buffer_in_windows_safely): Add prototype.
13751         * window.c: Declare Qdelete_window static again.  Move down
13752         declaration of select_count.
13753         (Fnext_window, Fprevious_window): Rewrite doc-strings.
13754         (Fother_window): Move to window.el.
13755         (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
13756         cases.  Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
13757         (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
13758         window.el.
13759         (replace_buffer_in_windows): Implement by calling
13760         Qreplace_buffer_in_windows.
13761         (replace_buffer_in_all_windows): Remove with some functionality
13762         moved into replace_buffer_in_windows_safely.
13763         (replace_buffer_in_windows_safely): New function.
13764         (select_window_norecord, select_frame_norecord): Move in front
13765         of run_window_configuration_change_hook.  Remove now obsolete
13766         declarations.
13767         (Fset_window_buffer): Rewrite doc-string.
13768         Call Qrecord_window_buffer.
13769         (keys_of_window): Move binding for other-window to window.el.
13771 2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
13773         * dispextern.h (struct image): Replace data member, whose int_val
13774         and ptr_val fields were not used by anything, with a single
13775         lisp_val object.
13777         * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
13778         (gif_clear_image, gif_load, imagemagick_load_image)
13779         (gs_clear_image, gs_load): Callers changed.
13781 2011-06-10  Paul Eggert  <eggert@cs.ucla.edu>
13783         * buffer.h: Include <time.h>, for time_t.
13784         Needed to build on FreeBSD 8.2.  Problem reported by Herbert J. Skuhra.
13786         Fix minor problems found by static checking.
13788         * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
13790         Make identifiers static if they are not used in other modules.
13791         * data.c (Qcompiled_function, Qframe, Qvector):
13792         * image.c (QimageMagick, Qsvg):
13793         * minibuf.c (Qmetadata):
13794         * window.c (resize_window_check, resize_root_window): Now static.
13795         * window.h (resize_window_check, resize_root_window): Remove decls.
13797         * window.c (window_deletion_count, delete_deletable_window):
13798         Remove; unused.
13799         (window_body_lines): Now static.
13800         (Fdelete_other_windows_internal): Mark vars as initialized.
13801         Make sure 'resize_failed' is initialized.
13802         (run_window_configuration_change_hook): Rename local to avoid shadowing.
13803         (resize_window_apply): Remove unused local.
13804         * window.h (delete_deletable_window): Remove decl.
13806         * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
13807         (imagemagick_load_image): Fix pointer signedness problem by changing
13808         last arg from unsigned char * to char *.  All uses changed.
13809         Also, fix a local for similar reasons.
13810         Remove unused locals.  Remove locals to avoid shadowing.
13811         (fn_rsvg_handle_free): Remove; unused.
13812         (svg_load, svg_load_image): Fix pointer signedness problem.
13813         (imagemagick_load_image): Don't use garbage pointer image_wand.
13815         * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
13817 2011-06-10  Chong Yidong  <cyd@stupidchicken.com>
13819         * image.c (gif_load): Fix omitted cast error introduced by
13820         2011-06-06 change.
13822 2011-06-10  Martin Rudalics  <rudalics@gmx.at>
13824         * window.h (resize_proportionally, orig_total_lines)
13825         (orig_top_line): Remove from window structure.
13826         (set_window_height, set_window_width, change_window_heights)
13827         (Fdelete_window): Remove prototypes.
13828         (resize_frame_windows): Remove duplicate declaration.
13830 2011-06-10  Eli Zaretskii  <eliz@gnu.org>
13832         * window.h (resize_frame_windows, resize_window_check)
13833         (delete_deletable_window, resize_root_window)
13834         (resize_frame_windows): Declare prototypes.
13836         * window.c (resize_window_apply): Make definition be "static" to
13837         match the prototype.
13839 2011-06-10  Martin Rudalics  <rudalics@gmx.at>
13841         * window.c: Remove declarations of Qwindow_size_fixed,
13842         window_min_size_1, window_min_size_2, window_min_size,
13843         size_window, window_fixed_size_p, enlarge_window, delete_window.
13844         Remove static from declaration of Qdelete_window, it's
13845         temporarily needed by Fbury_buffer.
13846         (replace_window): Don't assign orig_top_line and
13847         orig_total_lines.
13848         (Fdelete_window, delete_window): Remove.  Window deletion is
13849         handled by window.el.
13850         (window_loop): Remove DELETE_OTHER_WINDOWS case.
13851         Replace Fdelete_window calls with calls to Qdelete_window.
13852         (Fdelete_other_windows): Remove.  Deleting other windows is
13853         handled by window.el.
13854         (window_fixed_size_p): Remove.  Fixed-sizeness of windows is
13855         handled in window.el.
13856         (window_min_size_2, window_min_size_1, window_min_size): Remove.
13857         Window minimum sizes are handled in window.el.
13858         (shrink_windows, size_window, set_window_height)
13859         (set_window_width, change_window_heights, window_height)
13860         (window_width, CURBEG, CURSIZE, enlarge_window)
13861         (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
13862         (Fenlarge_window, Fshrink_window): Remove.  Window resizing is
13863         handled in window.el.
13864         (make_dummy_parent): Rename to make_parent_window and give it a
13865         second argument horflag.
13866         (make_window): Don't set resize_proportionally any more.
13867         (Fsplit_window): Remove.  Windows are split in window.el.
13868         (save_restore_action, save_restore_orig_size)
13869         (shrink_window_lowest_first, save_restore_orig_size): Remove.
13870         Resize mini windows in window.el.
13871         (grow_mini_window, shrink_mini_window): Implement by calling
13872         Qresize_root_window_vertically, resize_window_check and
13873         resize_window_apply.
13874         (saved_window, Fset_window_configuration, save_window_save):
13875         Do not handle orig_top_line, orig_total_lines, and
13876         resize_proportionally.
13877         (window_min_height, window_min_width): Move to window.el.
13878         (keys_of_window): Move bindings for delete-other-windows,
13879         split-window, delete-window and enlarge-window to window.el.
13881         * buffer.c: Temporarily extern Qdelete_window.
13882         (Fbury_buffer): Temporarily call Qdelete_window instead of
13883         Fdelete_window (Fbury_buffer will move to window.el soon).
13885         * frame.c (set_menu_bar_lines_1): Remove code handling
13886         orig_top_line and orig_total_lines.
13888         * dispnew.c (adjust_frame_glyphs_initially): Don't use
13889         set_window_height but set heights directly.
13890         (change_frame_size_1): Use resize_frame_windows.
13892         * xdisp.c (init_xdisp): Don't use set_window_height but set
13893         heights directly.
13895         * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
13896         Use resize_frame_windows instead of change_window_heights and run
13897         run_window_configuration_change_hook.
13899         * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
13900         instead of change_window_heights and run
13901         run_window_configuration_change_hook.
13903 2011-06-09  Martin Rudalics  <rudalics@gmx.at>
13905         * window.c (replace_window): Rename second argument REPLACEMENT to
13906         NEW.  New third argument SETFLAG.  Rewrite.
13907         (delete_window, make_dummy_parent): Call replace_window with
13908         third argument 1.
13909         (window_list_1): Move down in code.
13910         (run_window_configuration_change_hook): Move set_buffer part
13911         before select_frame_norecord part in order to unwind correctly.
13912         Rename count1 to count.
13913         (recombine_windows, delete_deletable_window, resize_root_window)
13914         (Fdelete_other_windows_internal)
13915         (Frun_window_configuration_change_hook, make_parent_window)
13916         (resize_window_check, resize_window_apply, Fresize_window_apply)
13917         (resize_frame_windows, Fsplit_window_internal)
13918         (Fdelete_window_internal, Fresize_mini_window_internal):
13919         New functions.
13920         (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
13922 2011-06-08  Martin Rudalics  <rudalics@gmx.at>
13924         * window.h (window): Add some new members to window structure -
13925         normal_lines, normal_cols, new_total, new_normal, clone_number,
13926         splits, nest, prev_buffers, next_buffers.
13927         (WINDOW_TOTAL_SIZE): Move here from window.c.
13928         (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
13930         * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
13931         Remove.
13932         (make_dummy_parent): Set new members of windows structure.
13933         (make_window): Move down in code.  Handle new members of window
13934         structure.
13935         (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
13936         (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
13937         (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
13938         (Fset_window_prev_buffers, Fwindow_next_buffers)
13939         (Fset_window_next_buffers, Fset_window_clone_number):
13940         New functions.
13941         (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
13942         (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
13943         Doc-string fixes.
13944         (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
13945         Argument WINDOW can be now internal window too.
13946         (Fwindow_use_time): Move up in code.
13947         (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
13948         Rewrite doc-string.
13949         (Fset_window_configuration, saved_window)
13950         (Fcurrent_window_configuration, save_window_save): Handle new
13951         members of window structure.
13952         (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
13953         (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
13954         (syms_of_window): New Lisp objects Qrecord_window_buffer,
13955         Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
13956         Qget_mru_window, Qresize_root_window,
13957         Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
13958         Qauto_buffer_name; staticpro them.
13960 2011-06-07  Martin Rudalics  <rudalics@gmx.at>
13962         * window.c (Fwindow_total_size, Fwindow_left_column)
13963         (Fwindow_top_line, window_body_lines, Fwindow_body_size)
13964         (Fwindow_list_1): New functions.
13965         (window_box_text_cols): Replace with window_body_cols.
13966         (Fwindow_width, Fscroll_left, Fscroll_right):
13967         Use window_body_cols instead of window_box_text_cols.
13968         (delete_window, Fset_window_configuration):
13969         Call delete_all_subwindows with window as argument.
13970         (delete_all_subwindows): Take a window as argument and not a
13971         structure.  Rewrite.
13972         (window_loop): Remove handling of GET_LRU_WINDOW and
13973         GET_LARGEST_WINDOW.
13974         (Fget_lru_window, Fget_largest_window): Move to window.el.
13976         * window.h: Extern window_body_cols instead of
13977         window_box_text_cols.  delete_all_subwindows now takes a
13978         Lisp_Object as argument.
13980         * indent.c (compute_motion, Fcompute_motion):
13981         Use window_body_cols instead of window_box_text_cols.
13983         * frame.c (delete_frame): Call delete_all_subwindows with root
13984         window as argument.
13986 2011-06-07  Daniel Colascione  <dan.colascione@gmail.com>
13988         * fns.c (Fputhash): Document return value.
13990 2011-06-06  Chong Yidong  <cyd@stupidchicken.com>
13992         * image.c (gif_load): Implement gif89a spec "no disposal" method.
13994 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
13996         Cons<->int and similar integer overflow fixes (Bug#8794).
13998         Check for overflow when converting integer to cons and back.
13999         * charset.c (Fdefine_charset_internal, Fdecode_char):
14000         Use cons_to_unsigned to catch overflow.
14001         (Fencode_char): Use INTEGER_TO_CONS.
14002         * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14003         (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14004         * data.c (long_to_cons, cons_to_long): Remove.
14005         (cons_to_unsigned, cons_to_signed): New functions.
14006         These signal an error for invalid or out-of-range values.
14007         * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14008         * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14009         * font.c (Ffont_variation_glyphs):
14010         * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14011         * lisp.h: Include <intprops.h>.
14012         (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14013         (cons_to_signed, cons_to_unsigned): New decls.
14014         (long_to_cons, cons_to_long): Remove decls.
14015         * undo.c (record_first_change): Use INTEGER_TO_CONS.
14016         (Fprimitive_undo): Use CONS_TO_INTEGER.
14017         * xfns.c (Fx_window_property): Likewise.
14018         * xselect.c: Include <limits.h>.
14019         (x_own_selection, selection_data_to_lisp_data):
14020         Use INTEGER_TO_CONS.
14021         (x_handle_selection_request, x_handle_selection_clear)
14022         (x_get_foreign_selection, Fx_disown_selection_internal)
14023         (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14024         (lisp_data_to_selection_data): Use cons_to_unsigned.
14025         (x_fill_property_data): Use cons_to_signed.
14026         Report values out of range.
14028         Check for buffer and string overflow more precisely.
14029         * buffer.h (BUF_BYTES_MAX): New macro.
14030         * lisp.h (STRING_BYTES_MAX): New macro.
14031         * alloc.c (Fmake_string):
14032         * character.c (string_escape_byte8):
14033         * coding.c (coding_alloc_by_realloc):
14034         * doprnt.c (doprnt):
14035         * editfns.c (Fformat):
14036         * eval.c (verror):
14037         Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14038         since they may not be the same number.
14039         * editfns.c (Finsert_char):
14040         * fileio.c (Finsert_file_contents):
14041         Likewise for BUF_BYTES_MAX.
14043         * image.c: Use ptrdiff_t, not int, for sizes.
14044         (slurp_file): Switch from int to ptrdiff_t.
14045         All uses changed.
14046         (slurp_file): Check that file size fits in both size_t (for
14047         malloc) and ptrdiff_t (for sanity and safety).
14049         * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14050         if b->modtime has its maximal value.
14052         * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14054         Don't assume time_t can fit into int.
14055         * buffer.h (struct buffer.modtime): Now time_t, not int.
14056         * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14057         * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14059         Minor fixes for signed vs unsigned integers.
14060         * character.h (MAYBE_UNIFY_CHAR):
14061         * charset.c (maybe_unify_char):
14062         * keyboard.c (read_char, reorder_modifiers):
14063         XINT -> XFASTINT, since the integer must be nonnegative.
14064         * ftfont.c (ftfont_spec_pattern):
14065         * keymap.c (access_keymap, silly_event_symbol_error):
14066         XUINT -> XFASTINT, since the integer must be nonnegative.
14067         (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14068         since it makes no difference and we prefer signed.
14069         * keyboard.c (record_char): Use XUINT when all the neighbors do.
14070         (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14071         nonnegative.
14073 2011-06-06  Stefan Monnier  <monnier@iro.umontreal.ca>
14075         * window.h (Fwindow_frame): Declare.
14077 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
14079         * alloc.c: Simplify handling of large-request failures (Bug#8800).
14080         (SPARE_MEMORY): Always define.
14081         (LARGE_REQUEST): Remove.
14082         (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14084 2011-06-06  Martin Rudalics  <rudalics@gmx.at>
14086         * lisp.h: Move EXFUNS for Fframe_root_window,
14087         Fframe_first_window and Fset_frame_selected_window to window.h.
14089         * window.h: Move EXFUNS for Fframe_root_window,
14090         Fframe_first_window and Fset_frame_selected_window here from
14091         lisp.h.
14093         * frame.c (Fwindow_frame, Fframe_first_window)
14094         (Fframe_root_window, Fframe_selected_window)
14095         (Fset_frame_selected_window): Move to window.c.
14096         (Factive_minibuffer_window): Move to minibuf.c.
14097         (Fother_visible_frames_p): New function.
14099         * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14101         * window.c (decode_window, decode_any_window): Move up in code.
14102         (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14103         (inhibit_frame_unsplittable): Remove unused variable.
14104         (Fwindow_buffer): Move up and rewrite doc-string.
14105         (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14106         (Fwindow_prev): New functions.
14107         (Fwindow_frame): Move here from frame.c.  Accept any window as
14108         argument.
14109         (Fframe_root_window, Fframe_first_window)
14110         (Fframe_selected_window): Move here from frame.c.  Accept frame
14111         or arbitrary window as argument.  Update doc-strings.
14112         (Fminibuffer_window): Move up in code.
14113         (Fwindow_minibuffer_p): Move up in code and simplify.
14114         (Fset_frame_selected_window): Move here from frame.c.
14115         Marginal rewrite.
14116         (Fselected_window, select_window, Fselect_window): Move up in
14117         code.  Minor doc-string fixes.
14119 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
14121         * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14122         Do not assume that spare memory exists; that assumption is valid
14123         only if SYSTEM_MALLOC.
14124         (LARGE_REQUEST): New macro, so that the issue of large requests
14125         is separated from the issue of spare memory.
14127 2011-06-05  Andreas Schwab  <schwab@linux-m68k.org>
14129         * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14130         format.  (Bug#8806)
14132         * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14134         * xfns.c (x_set_scroll_bar_default_width): Move declarations
14135         before statements.
14137 2011-06-05  Jan Djärv  <jan.h.d@swipnet.se>
14139         * gtkutil.c (xg_get_default_scrollbar_width): New function.
14141         * gtkutil.h: Declare xg_get_default_scrollbar_width.
14143         * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14144         min width by calling x_set_scroll_bar_default_width (Bug#8505).
14146 2011-06-05  Juanma Barranquero  <lekktu@gmail.com>
14148         * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14150 2011-06-04  Chong Yidong  <cyd@stupidchicken.com>
14152         * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14153         (x_clipboard_manager_save): Add return value.
14154         (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14155         New error handlers.
14156         (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14157         Obey Vx_select_enable_clipboard_manager.  Catch errors in
14158         x_clipboard_manager_save (Bug#8779).
14159         (Vx_select_enable_clipboard_manager): New variable.
14160         (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
14162 2011-06-04  Dan Nicolaescu  <dann@ics.uci.edu>
14164         * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14166 2011-06-04  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
14168         * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14169         in the current matrix if keep_current_p is non-zero.
14171 2011-06-04  Eli Zaretskii  <eliz@gnu.org>
14173         * bidi.c (bidi_level_of_next_char): Fix last change.
14175 2011-06-03  Eli Zaretskii  <eliz@gnu.org>
14177         Support bidi reordering of text covered by display properties.
14179         * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14180         (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14181         (bidi_cache_search, bidi_cache_iterator_state)
14182         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
14183         (bidi_level_of_next_char, bidi_move_to_visually_next):
14184         Support character positions inside a run of characters covered by a
14185         display string.
14186         (bidi_paragraph_init, bidi_resolve_explicit_1)
14187         (bidi_level_of_next_char): Call bidi_fetch_char and
14188         bidi_fetch_char_advance instead of FETCH_CHAR and
14189         FETCH_CHAR_ADVANCE.
14190         (bidi_init_it): Initialize new members.
14191         (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14192         definitions.
14193         (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14194         instead of using explicit *_CHAR codes.
14195         (bidi_resolve_explicit, bidi_resolve_weak):
14196         Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
14197         bidirectional text is supported only in multibyte buffers.
14198         (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14199         it to initialize the frame_window_p member of struct bidi_it.
14200         (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14201         (bidi_resolve_explicit, bidi_resolve_weak)
14202         (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14203         bidi_it->nchars is non-positive.
14204         (bidi_level_of_next_char): Don't try to lookup the cache for the
14205         next/previous character if nothing is cached there yet, or if we
14206         were just reseat()'ed to a new position.
14208         * xdisp.c (set_cursor_from_row): Set start and stop points
14209         according to the row's direction when priming the loop that looks
14210         for the glyph on which to display cursor.
14211         (single_display_spec_intangible_p): Function deleted.
14212         (display_prop_intangible_p): Reimplement to call
14213         handle_display_spec instead of single_display_spec_intangible_p.
14214         Accept 3 additional arguments needed by handle_display_spec.
14215         This fixes incorrect cursor motion across display property with complex
14216         values: lists, `(when COND...)' forms, etc.
14217         (single_display_spec_string_p): Support property values that are
14218         lists with the argument STRING its top-level element.
14219         (display_prop_string_p): Fix the condition for processing a
14220         property that is a list to be consistent with handle_display_spec.
14221         (handle_display_spec): New function, refactored from the
14222         last portion of handle_display_prop.
14223         (compute_display_string_pos): Accept additional argument
14224         FRAME_WINDOW_P.  Call handle_display_spec to determine whether the
14225         value of a `display' property is a "replacing spec".
14226         (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14227         and FRAME_WINDOW_P.  If IT is NULL, don't set up the iterator from
14228         the display property, but just return a value indicating whether
14229         the display property will replace the characters it covers.
14230         (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14231         frame_window_p members of struct bidi_it.
14232         (compute_display_string_pos, compute_display_string_end):
14233         New functions.
14234         (push_it): Accept second argument POSITION, where pop_it should
14235         jump to continue iteration.
14236         (reseat_1): Initialize bidi_it.disp_pos.
14238         * keyboard.c (adjust_point_for_property): Adjust the call to
14239         display_prop_intangible_p to its new signature.
14241         * dispextern.h (struct bidi_it): New member frame_window_p.
14242         (bidi_init_it): Update prototypes.
14243         (display_prop_intangible_p): Update prototype.
14244         (compute_display_string_pos, compute_display_string_end):
14245         Declare prototypes.
14246         (struct bidi_it): New members nchars and disp_pos.  ch_len is now
14247         EMACS_INT.
14249 2011-06-02  Paul Eggert  <eggert@cs.ucla.edu>
14251         Malloc failure behavior now depends on size of allocation.
14252         * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14253         * lisp.h: Change signatures accordingly.
14254         * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14255         All callers changed.  (Bug#8762)
14257         * gnutls.c: Use Emacs's memory allocators.
14258         Without this change, the gnutls library would invoke malloc etc.
14259         directly, which causes problems on non-SYNC_INPUT hosts, and which
14260         runs afoul of improving memory_full behavior.  (Bug#8761)
14261         (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14262         (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14263         xfree instead of the default malloc, realloc, free.
14264         (Fgnutls_boot): No need to check for memory allocation failure,
14265         since xmalloc does that for us.
14267         Remove arbitrary limit of 2**31 entries in hash tables.  (Bug#8771)
14268         * category.c (hash_get_category_set):
14269         * ccl.c (ccl_driver):
14270         * charset.c (Fdefine_charset_internal):
14271         * charset.h (struct charset.hash_index):
14272         * composite.c (get_composition_id, gstring_lookup_cache)
14273         (composition_gstring_put_cache):
14274         * composite.h (struct composition.hash_index):
14275         * dispextern.h (struct image.hash):
14276         * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14277         (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14278         (hashfn_equal, hashfn_user_defined, make_hash_table)
14279         (maybe_resize_hash_table, hash_lookup, hash_put)
14280         (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14281         (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14282         (Fsxhash, Fgethash, Fputhash, Fmaphash):
14283         * image.c (make_image, search_image_cache, lookup_image)
14284         (xpm_put_color_table_h):
14285         * lisp.h (struct Lisp_Hash_Table):
14286         * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
14287         * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
14288         for hashes and hash indexes, instead of 'unsigned' and 'int'.
14289         * alloc.c (allocate_vectorlike):
14290         Check for overflow in vector size calculations.
14291         * ccl.c (ccl_driver):
14292         Check for overflow when converting EMACS_INT to int.
14293         * fns.c, image.c: Remove unnecessary static decls that would otherwise
14294         need to be updated by these changes.
14295         * fns.c (make_hash_table, maybe_resize_hash_table):
14296         Check for integer overflow with large hash tables.
14297         (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14298         Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14299         (SXHASH_REDUCE): New macro.
14300         (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14301         Use it instead of discarding useful hash info with large hash values.
14302         (sxhash_float): New function.
14303         (sxhash): Use it.  No more need for "& INTMASK" due to above changes.
14304         * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
14305         (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14306         Rewrite to use FIXNUM_BITS, as this simplifies things.
14307         (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14308         Adjust signatures to match updated version of code.
14309         (consing_since_gc): Now EMACS_INT, since a single hash table can
14310         use more than INT_MAX bytes.
14312 2011-06-01  Dan Nicolaescu  <dann@ics.uci.edu>
14314         Make it possible to build with GCC-4.6+ -O2 -flto.
14316         * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14318 2011-06-01  Stefan Monnier  <monnier@iro.umontreal.ca>
14320         * minibuf.c (get_minibuffer, read_minibuf_unwind):
14321         Call minibuffer-inactive-mode.
14323 2011-05-31  Juanma Barranquero  <lekktu@gmail.com>
14325         * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14326         Update dependencies.
14328 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
14330         * data.c (init_data): Remove code for UTS, this system is not
14331         supported anymore.
14333 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
14335         Don't force ./temacs to start in terminal mode.
14337         * frame.c (make_initial_frame): Initialize faces in all cases, not
14338         only when CANNOT_DUMP is defined.
14339         * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14341 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
14343         * dispnew.c (add_window_display_history): Use const for the string
14344         pointer.  Remove declaration, not needed.
14346 2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
14348         Use 'inline', not 'INLINE'.
14349         <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
14350         * alloc.c, fontset.c (INLINE): Remove.
14351         * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14352         * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14353         * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14354         * gmalloc.c (register_heapinfo): Use inline unconditionally.
14355         * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14357 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
14359         Make it possible to run ./temacs.
14361         * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14362         syms_of_callproc does the same thing.  Remove test for
14363         "initialized", do it in the caller.
14364         * emacs.c (main): Avoid calling set_initial_environment when dumping.
14366 2011-05-31  Stefan Monnier  <monnier@iro.umontreal.ca>
14368         * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14369         (read_minibuf): Use get_minibuffer.
14370         (syms_of_minibuf): Use DEFSYM.
14371         (Qmetadata): New var.
14372         * data.c (Qbuffer): Don't make it static.
14373         (syms_of_data): Use DEFSYM.
14375 2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
14377         * ccl.c (CCL_CODE_RANGE): Allow negative numbers.  (Bug#8751)
14378         (CCL_CODE_MIN): New macro.
14380 2011-05-30  Paul Eggert  <eggert@cs.ucla.edu>
14382         * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14384         * eval.c (Qdebug): Now static.
14385         * lisp.h (Qdebug): Remove decl.  This reverts a part of the
14386         2011-04-26 change (bzr 104015) that inadvertently undid part of
14387         the 2011-04-14 change (bzr 103913).
14389 2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
14391         * image.c: Various fixes to ImageMagick code comments.
14392         (Fimagemagick_types): Doc fix.
14394 2011-05-29  Paul Eggert  <eggert@cs.ucla.edu>
14396         Minor fixes prompted by GCC 4.6.0 warnings.
14398         * xselect.c (converted_selections, conversion_fail_tag): Now static.
14400         * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14401         (x_clipboard_manager_save_all): Move extern decl to ...
14402         * xterm.h: ... here, so that it can be checked for consistency.
14404 2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
14406         * xselect.c (x_clipboard_manager_save_frame)
14407         (x_clipboard_manager_save_all): New functions.
14408         (Fx_clipboard_manager_save): Lisp function deleted.
14410         * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14411         * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14413         * xterm.h: Update prototype.
14415 2011-05-28  William Xu  <william.xwl@gmail.com>
14417         * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14418         exiting (Bug#8239).
14420 2011-05-28  Jim Meyering  <meyering@redhat.com>
14422         Avoid a sign-extension bug in crypto_hash_function.
14423         * fns.c (to_uchar): Define.
14424         (crypto_hash_function): Use it to convert some newly-signed
14425         variables to unsigned, to avoid sign-extension bugs.  For example,
14426         without this change, (md5 "truc") would evaluate to
14427         45723a2aff78ff4fff7fff1114760e62 rather than the expected
14428         45723a2af3788c4ff17f8d1114760e62.  Reported by Antoine Levitt in
14429         https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
14431 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
14433         Integer overflow fixes.
14435         * dbusbind.c: Serial number integer overflow fixes.
14436         (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
14437         (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14438         to hold a serial number that is too large for a fixnum.
14439         (Fdbus_method_return_internal, Fdbus_method_error_internal):
14440         Check for serial numbers out of range.  Decode any serial number
14441         that was so large that it became a float.  (Bug#8722)
14443         * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14444         (Fdbus_call_method, Fdbus_call_method_asynchronously):
14445         Use XFASTINT rather than XUINT when numbers are nonnegative.
14446         (xd_append_arg, Fdbus_method_return_internal):
14447         (Fdbus_method_error_internal): Likewise.  Also, for unsigned
14448         arguments, check that Lisp number is nonnegative, rather than
14449         silently wrapping negative numbers around.  (Bug#8722)
14450         (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
14451         (Bug#8722)
14453         * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14455         * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14457         ccl: Add integer overflow checks.
14458         * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14459         (IN_INT_RANGE): New macros.
14460         (ccl_driver): Use them to check for integer overflow when
14461         decoding a CCL program.  Many of the new checks are whether XINT (x)
14462         fits in int; it doesn't always, on 64-bit hosts.  The new version
14463         doesn't catch all possible integer overflows, but it's an
14464         improvement.  (Bug#8719)
14466         * alloc.c (make_event_array): Use XINT, not XUINT.
14467         There's no need for unsigned here.
14469         * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14470         This follows up to the 2011-05-06 change that substituted uintptr_t
14471         for EMACS_INT.  This case wasn't caught back then.
14473         Rework Fformat to avoid integer overflow issues.
14474         * editfns.c: Include <float.h> unconditionally, as it's everywhere
14475         now (part of C89).  Include <verify.h>.
14476         (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14477         (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14478         (Fformat): Avoid the prepass trying to compute sizes; it was only
14479         approximate and thus did not catch overflow reliably.  Instead, walk
14480         through the format just once, formatting and computing sizes as we go,
14481         checking for integer overflow at every step, and allocating a larger
14482         buffer as needed.  Keep track separately whether the format is
14483         multibyte.  Keep only the most-recently calculated precision, rather
14484         than them all.  Record whether each argument has been converted to
14485         string.  Use EMACS_INT, not int, for byte and char and arg counts.
14486         Support field widths and precisions larger than INT_MAX.  Avoid
14487         sprintf's undefined behavior with conversion specifications such as %#d
14488         and %.0c.  Fix bug with strchr succeeding on '\0' when looking for
14489         flags.  Fix bug with (format "%c" 256.0).  Avoid integer overflow when
14490         formatting out-of-range floating point numbers with int
14491         formats.  (Bug#8668)
14493         * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14495         * data.c: Avoid integer truncation in expressions involving floats.
14496         * data.c: Include <intprops.h>.
14497         (arith_driver): When there's an integer overflow in an expression
14498         involving floating point, convert the integers to floating point
14499         so that the resulting value does not suffer from catastrophic
14500         integer truncation.  For example, on a 64-bit host (* 4
14501         most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14502         Do not rely on undefined behavior after integer overflow.
14504         merge count_size_as_multibyte, parse_str_to_multibyte
14505         * character.c, character.h (count_size_as_multibyte):
14506         Rename from parse_str_to_multibyte; all uses changed.
14507         Check for integer overflow.
14508         * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14509         since it's now a duplicate of the other.  This is more of
14510         a character than a buffer op, so better that it's in character.c.
14511         * fns.c, print.c: Adjust to above changes.
14513 2011-05-27  Stefan Monnier  <monnier@iro.umontreal.ca>
14515         * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14517 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
14519         * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14520         (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14521         (x_clipboard_manager_save): Now static.
14522         (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14524         * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14525         (crypto_hash_function): Now static.
14526         Fix pointer signedness problems.  Avoid unnecessary initializations.
14528 2011-05-27  Chong Yidong  <cyd@stupidchicken.com>
14530         * termhooks.h (Vselection_alist): Make it terminal-local.
14532         * terminal.c (create_terminal): Initialize it.
14534         * xselect.c: Support for clipboard managers.
14535         (Vselection_alist): Move to termhooks.h as terminal-local var.
14536         (LOCAL_SELECTION): New macro.
14537         (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14538         (symbol_to_x_atom): Remove gratuitous arg.
14539         (x_handle_selection_request, lisp_data_to_selection_data)
14540         (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
14541         (x_own_selection, x_get_local_selection, x_convert_selection):
14542         New arg, specifying work frame.  Use terminal-local Vselection_alist.
14543         (some_frame_on_display): Delete unused function.
14544         (Fx_own_selection_internal, Fx_get_selection_internal)
14545         (Fx_disown_selection_internal, Fx_selection_owner_p)
14546         (Fx_selection_exists_p): New optional frame arg.
14547         (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14548         (x_handle_selection_clear): Don't treat other terminals with the
14549         same keyboard specially.  Use the terminal-local Vselection_alist.
14550         (x_clear_frame_selections): Use Frun_hook_with_args.
14552         * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14554         * xterm.h: Add support for those atoms.
14556 2011-05-26  Chong Yidong  <cyd@stupidchicken.com>
14558         * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14559         (converted_selections, conversion_fail_tag): New global variables.
14560         (x_selection_request_lisp_error): Free the above.
14561         (x_get_local_selection): Remove unnecessary code.
14562         (x_reply_selection_request): Args changed; handle arbitrary array
14563         of converted selections stored in converted_selections.
14564         Separate the XChangeProperty and SelectionNotify steps.
14565         (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14566         (x_convert_selection): New function.
14567         (x_handle_selection_event): Simplify.
14568         (x_get_foreign_selection): Don't ignore incoming requests while
14569         waiting for an answer; this will fail when we implement
14570         SAVE_TARGETS, and seems unnecessary anyway.
14571         (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14572         (Vx_sent_selection_functions): Doc fix.
14574 2011-05-26  Leo Liu  <sdl.web@gmail.com>
14576         * editfns.c (Ftranspose_regions): Allow empty regions.  (Bug#8699)
14578 2011-05-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
14580         * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14582         * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14583         for fringe update if it has periodic bitmap.
14584         (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
14585         and fringe_bitmap_periodic_p.
14587         * fringe.c (get_fringe_bitmap_data): New function.
14588         (draw_fringe_bitmap_1, update_window_fringes): Use it.
14589         (update_window_fringes): Record periodicity of fringe bitmap in glyph
14590         row.  Mark glyph row for fringe update if periodicity changed.
14592         * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14593         for fringe update unless it has periodic bitmap.
14595 2011-05-25  Kenichi Handa  <handa@m17n.org>
14597         * xdisp.c (get_next_display_element): Set correct it->face_id for
14598         a static composition.
14600 2011-05-24  Leo Liu  <sdl.web@gmail.com>
14602         * deps.mk (fns.o):
14603         * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14605         * fns.c (crypto_hash_function, Fsha1): New function.
14606         (Fmd5): Use crypto_hash_function.
14607         (syms_of_fns): Add Ssha1.
14609 2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
14611         * gnutls.c: Remove unused macros.
14612         (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14613         (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14614         Remove macros that are defined and never used.
14615         Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14617 2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
14619         * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14620         (Fx_get_selection_internal): Minor cleanup.
14621         (Fx_own_selection_internal): Rename arguments for consistency with
14622         select.el.
14624 2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
14626         * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14628 2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
14630         * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14632 2011-05-21  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
14634         * dispnew.c (scrolling_window): Don't exclude the case that the
14635         last enabled row in the desired matrix touches the bottom boundary.
14637 2011-05-21  Glenn Morris  <rgm@gnu.org>
14639         * Makefile.in ($(etc)/DOC): Make second command line even shorter.
14640         (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
14641         and add some more files.
14643 2011-05-20  Eli Zaretskii  <eliz@gnu.org>
14645         * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
14646         report_file_error introduced by the change from 2011-05-07.
14648 2011-05-20  Paul Eggert  <eggert@cs.ucla.edu>
14650         * systime.h (Time): Define only if emacs is defined.
14651         This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
14652         where the include path doesn't have X11/X.h by default.  See
14653         <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
14655 2011-05-20  Kenichi Handa  <handa@m17n.org>
14657         * composite.c (find_automatic_composition): Fix previous change.
14659 2011-05-20  Glenn Morris  <rgm@gnu.org>
14661         * lisp.mk: New file, split from Makefile.in.
14662         * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
14663         (shortlisp): Remove.
14664         ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
14666 2011-05-19  Glenn Morris  <rgm@gnu.org>
14668         * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14669         (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14670         (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14671         (lisp): Set the order to that of loadup.el.
14672         (shortlisp): Make it a copy of $lisp.
14673         (SOME_MACHINE_LISP): Remove.
14674         ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14675         Use just $shortlisp, not $SOME_MACHINE_LISP too.
14677 2011-05-18  Kenichi Handa  <handa@m17n.org>
14679         * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14680         (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14681         (find_automatic_composition): Mostly rewrite for efficiency.
14683 2011-05-18  Juanma Barranquero  <lekktu@gmail.com>
14685         * makefile.w32-in: Update dependencies.
14687 2011-05-18  Christoph Scholtes  <cschol2112@googlemail.com>
14689         * menu.c: Include limits.h (fixes the MS-Windows build broken by
14690         revision 104625).
14692 2011-05-18  Paul Eggert  <eggert@cs.ucla.edu>
14694         Fix some integer overflow issues, such as string length overflow.
14696         * insdel.c (count_size_as_multibyte): Check for string overflow.
14698         * character.c (lisp_string_width): Check for string overflow.
14699         Use EMACS_INT, not int, for string indexes and lengths; in
14700         particular, 2nd arg is now EMACS_INT, not int.  Do not crash if
14701         the resulting string length overflows an EMACS_INT; instead,
14702         report a string overflow if no precision given.  When checking for
14703         precision exhaustion, use a check that cannot possibly have
14704         integer overflow.  (Bug#8675)
14705         * character.h (lisp_string_width): Adjust to new signature.
14707         * alloc.c (string_overflow): New function.
14708         (Fmake_string): Use it.  This doesn't change behavior, but saves
14709         a few bytes and will simplify future changes.
14710         * character.c (string_escape_byte8): Likewise.
14711         * lisp.h (string_overflow): New decl.
14713         Fixups, following up to the user-interface timestamp change.
14714         * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14715         for UI timestamps, instead of unsigned long.
14716         * msdos.c (mouse_get_pos): Likewise.
14717         * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
14718         * w32gui.h (Time): Define by including "systime.h" rather than by
14719         declaring it ourselves.  (Bug#8664)
14721         * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14722         * image.c (clear_image_cache): Likewise.
14724         * term.c (term_mouse_position): Don't assume time_t wraparound.
14726         Be more systematic about user-interface timestamps.
14727         Before, the code sometimes used 'Time', sometimes 'unsigned long',
14728         and sometimes 'EMACS_UINT', to represent these timestamps.
14729         This change causes it to use 'Time' uniformly, as that's what X uses.
14730         This makes the code easier to follow, and makes it easier to catch
14731         integer overflow bugs such as Bug#8664.
14732         * frame.c (Fmouse_position, Fmouse_pixel_position):
14733         Use Time, not unsigned long, for user-interface timestamps.
14734         * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14735         (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14736         * keyboard.h (last_event_timestamp): Likewise.
14737         * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14738         * menu.h (xmenu_show): Likewise.
14739         * term.c (term_mouse_position): Likewise.
14740         * termhooks.h (struct input_event.timestamp): Likewise.
14741         (struct terminal.mouse_position_hook): Likewise.
14742         * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
14743         * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
14744         * systime.h (Time): New decl.  Pull it in from <X11/X.h> if
14745         HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
14746         what it was before.
14747         * menu.h, termhooks.h: Include "systime.h", for Time.
14749         * keyboard.c (make_lispy_event): Fix problem in integer overflow.
14750         Don't assume that the difference between two unsigned long values
14751         can fit into an integer.  At this point, we know button_down_time
14752         <= event->timestamp, so the difference must be nonnegative, so
14753         there's no need to cast the result if double-click-time is
14754         nonnegative, as it should be; check that it's nonnegative, just in
14755         case.  This bug is triggered when events are more than 2**31 ms
14756         apart (about 25 days).  (Bug#8664)
14758         * xselect.c (last_event_timestamp): Remove duplicate decl.
14759         (x_own_selection): Remove needless cast to unsigned long.
14761         * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
14762         that always fit in int.  Use a sentinel instead of a counter, to
14763         avoid a temp and to allay GCC's concerns about possible int overflow.
14764         * frame.h (struct frame): Use int for menu_bar_items_used
14765         instead of EMACS_INT, since it always fits in int.
14767         * menu.c (grow_menu_items): Check for int overflow.
14769         * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
14771         * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
14772         Before, the code was not consistent.  These values cannot exceed
14773         2**31 - 1 so there's no need to make them unsigned.
14774         (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
14775         (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
14776         (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
14777         as modifiers.
14778         * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
14780         * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
14781         (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
14782         Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
14783         presumably because the widths might not match.
14785         * window.c (size_window): Avoid needless test at loop start.
14787 2011-05-18  Courtney Bane  <emacs-bugs-7626@cbane.org>  (tiny change)
14789         * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
14791 2011-05-12  Drew Adams  <drew.adams@oracle.com>
14793         * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
14795 2011-05-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
14797         * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
14798         `width' to `bar_area_x' and `bar_area_width', respectively.
14799         (x_scroll_run): Take account of fringe background extension.
14801         * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
14802         Rename local vars `left' and `width' to `bar_area_x' and
14803         `bar_area_width', respectively.
14804         (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
14805         background extension.
14807 2011-05-10  Jim Meyering  <meyering@redhat.com>
14809         * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
14811 2011-05-10  Juanma Barranquero  <lekktu@gmail.com>
14813         * image.c (Finit_image_library): Return t for built-in image types,
14814         like pbm and xbm.  (Bug#8640)
14816 2011-05-09  Andreas Schwab  <schwab@linux-m68k.org>
14818         * w32menu.c (set_frame_menubar): Fix submenu allocation.
14820 2011-05-07  Eli Zaretskii  <eliz@gnu.org>
14822         * w32console.c (Fset_screen_color): Doc fix.
14823         (Fget_screen_color): New function.
14824         (syms_of_ntterm): Defsubr it.
14826         * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
14827         unlink the temporary file if Fcall_process didn't create it in the
14828         first place.
14829         (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
14830         child process will be redirected to a file specified with `:file'.
14831         Don't try to re-open tempfile in that case, and set fd[0] to -1 as
14832         cue to call_process_cleanup not to close that handle.
14834 2011-05-07  Ben Key  <bkey76@gmail.com>
14836         * makefile.w32-in: The bootstrap-temacs rule now makes use of
14837         one of two shell specific rules, either bootstrap-temacs-CMD or
14838         bootstrap-temacs-SH.  The bootstrap-temacs-SH rule is identical
14839         to the previous implementation of the bootstrap-temacs rule.
14840         The bootstrap-temacs-CMD rule is similar to the previous
14841         implementation of the bootstrap-temacs rule except that it
14842         makes use of the ESC_CFLAGS variable instead of the CFLAGS
14843         variable.
14845         These changes, along with some changes to nt/configure.bat,
14846         nt/gmake.defs, and nt/nmake.defs, are required to extend my
14847         earlier fix to add support for --cflags and --ldflags options
14848         that include quotes so that it works whether make uses cmd or
14849         sh as the shell.
14851 2011-05-06  Michael Albinus  <michael.albinus@gmx.de>
14853         * dbusbind.c (QCdbus_type_unix_fd): Declare static.
14854         (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
14855         is a constant.
14856         (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
14857         a string.  Handle both cases.
14858         (Fdbus_call_method_asynchronously, Fdbus_register_signal)
14859         (Fdbus_register_method): Use Qinvalid_function.
14861 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
14863         * makefile.w32-in: Update dependencies.
14864         (LISP_H): Add inttypes.h and stdin.h.
14865         (PROCESS_H): Add unistd.h.
14867 2011-05-06  Eli Zaretskii  <eliz@gnu.org>
14869         * lread.c: Include limits.h (fixes the MS-Windows build broken by
14870         revision 104134).
14872 2011-05-06  Paul Eggert  <eggert@cs.ucla.edu>
14874         * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
14876         * term.c (vfatal): Remove stray call to va_end.
14877         It's not needed and the C Standard doesn't allow it here anyway.
14879         Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
14880         * eval.c (verror): doprnt a copy of ap, not the original.  (Bug#8545)
14882         * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
14883         bytes.
14885         * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
14887         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14889         * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
14891         * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
14893         * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
14895         * charset.h (struct charset.code_space): Now has 15 elements, not 16.
14896         * charset.c (Fdefine_charset_internal): Don't initialize
14897         charset.code_space[15].  The value was garbage, on hosts with
14898         32-bit int (Bug#8600).
14900         * lread.c (read_integer): Be more consistent with string-to-number.
14901         Use string_to_number to do the actual conversion; this avoids
14902         rounding errors and fixes some other screwups.  Without this fix,
14903         for example, #x1fffffffffffffff was misread as -2305843009213693952.
14904         (digit_to_number): Move earlier, for benefit of read_integer.
14905         Return -1 if the digit is out of range for the base, -2 if it is
14906         not a digit in any supported base.  (Bug#8602)
14908         * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
14910         * dispnew.c (scrolling_window): Return 1 if we scrolled,
14911         to match comment at start of function.  This also removes a
14912         GCC warning about overflow in a 32+64-bit port.
14914         * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
14916         * dbusbind.c: Do not use XPNTR on a value that may be an integer.
14917         Reported by Stefan Monnier in
14918         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
14919         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14920         Use SYMBOLP-guarded XSYMBOL, not XPNTR.
14922         * lisp.h (EMACS_INTPTR): Remove.  All uses changed to intptr_t.
14923         (EMACS_UINTPTR): Likewise, with uintptr_t.
14925         * lisp.h: Prefer 64-bit EMACS_INT if available.
14926         (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
14927         on 32-bit hosts that have 64-bit int, so that they can access
14928         large files.
14929         However, temporarily disable this change unless the temporary
14930         symbol WIDE_EMACS_INT is defined.
14932         * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
14934         Prefer intptr_t/uintptr_t for integers the same widths as pointers.
14935         This removes an assumption that EMACS_INT and long are the same
14936         width as pointers.  The assumption is true for Emacs porting targets
14937         now, but we want to make other targets possible.
14938         * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
14939         (EMACS_INTPTR, EMACS_UINTPTR): New macros.
14940         In the rest of the code, change types of integers that hold casted
14941         pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
14942         replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
14943         (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
14944         (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
14945         No need to cast type when ORing.
14946         (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
14947         * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
14948         * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
14949         assume EMACS_INT is the same width as char *.
14950         * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
14951         (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
14952         Remove no-longer-needed casts.
14953         (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
14954         (xg_tool_bar_help_callback, xg_make_tool_item):
14955         Use EMACS_INTPTR to hold an integer
14956         that will be cast to void *; this can avoid a GCC warning
14957         if EMACS_INT is not the same width as void *.
14958         * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
14959         * xdisp.c (display_echo_area_1, resize_mini_window_1):
14960         (current_message_1, set_message_1):
14961         Use a local to convert to proper width without a cast.
14962         * xmenu.c (dialog_selection_callback): Likewise.
14964         * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
14965         Also, don't assume VALBITS / RAND_BITS is less than 5,
14966         and don't rely on undefined behavior when shifting a 1 left into
14967         the sign bit.
14968         * lisp.h (get_random): Change signature to match.
14970         * lread.c (hash_string): Use size_t, not int, for hash computation.
14971         Normally we prefer signed values; but hashing is special, because
14972         it's better to use unsigned division on hash table sizes so that
14973         the remainder is nonnegative.  Also, size_t is the natural width
14974         for hashing into memory.  The previous code used 'int', which doesn't
14975         retain enough info to hash well into very large tables.
14976         (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
14978         * dbusbind.c: Don't possibly lose pointer info when converting.
14979         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14980         Use XPNTR rather than XHASH, so that the high-order bits of
14981         the pointer aren't lost when converting through void *.
14983         * eval.c (Fautoload): Don't double-shift a pointer.
14985         * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
14987 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
14989         * gnutls.c (DEF_GNUTLS_FN):
14990         * image.c (DEF_IMGLIB_FN): Make function pointers static.
14992 2011-05-05  Andreas Schwab  <schwab@linux-m68k.org>
14994         * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
14995         marker.  (Bug#8610)
14997 2011-05-05  Eli Zaretskii  <eliz@gnu.org>
14999         * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15000         New version that can reserve upto 2GB of heap space.
15002 2011-05-05  Chong Yidong  <cyd@stupidchicken.com>
15004         * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15006 2011-05-05  Teodor Zlatanov  <tzz@lifelogs.com>
15008         * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15009         `gnutls_certificate_set_x509_key_file'.
15011 2011-05-05  Juanma Barranquero  <lekktu@gmail.com>
15013         * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15014         Update dependencies.
15016 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
15018         * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15019         * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15020         Remove unused parameter `fildes'.
15021         * process.c (read_process_output, send_process): Don't pass it.
15023 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
15025         Fix previous change: the library cache is defined in w32.c.
15026         * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15027         (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15029 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
15031         Implement dynamic loading of GnuTLS on Windows.
15033         * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15034         (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15035         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15036         Declare.
15038         * gnutls.c (Qgnutls_dll): Define.
15039         (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15040         (gnutls_*): Declare function pointers.
15041         (init_gnutls_functions): New function to initialize function pointers.
15042         (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15043         (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15044         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15045         Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15046         (emacs_gnutls_write, emacs_gnutls_read)
15047         (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15048         (Fgnutls_available_p): New function.
15049         (Fgnutls_boot): Call Fgnutls_available_p.  Use function pointers.
15050         (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15051         (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15053         * image.c: Include w32.h.
15054         (Vimage_type_cache): Delete.
15055         (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15056         (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15057         (w32_delayed_load): Move to w32.c.
15059         * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15061         * w32.c (QCloaded_from, Vlibrary_cache): Define.
15062         (w32_delayed_load): Move from image.c.  When loading a library, record
15063         its filename in the :loaded-from property of the library id.
15064         (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15065         Initialize and staticpro them.
15066         (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15068         * process.c: Include lisp.h before w32.h, not after.
15069         (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15070         instead of gnutls_record_check_pending.
15072         * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15074 2011-05-04  Teodor Zlatanov  <tzz@lifelogs.com>
15076         * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15077         instead of :keyfiles.  Give GnuTLS the keylist and the CRL lists
15078         as passed in.
15080 2011-05-03  Jan Djärv  <jan.h.d@swipnet.se>
15082         * xterm.c (x_set_frame_alpha): Do not set property on anything
15083         else than FRAME_X_OUTER_WINDOW (Bug#8608).
15085 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
15087         * sysdep.c (get_tty_size) [WINDOWSNT]: Implement.  (Bug#8596)
15089 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
15091         * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15092         (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15093         (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15094         (gnutls_global_initialized, Qgnutls_bootprop_priority)
15095         (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15096         (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15097         (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15098         (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15099         (Qgnutls_bootprop_callbacks_verify): Make static.
15101 2011-05-01  Andreas Schwab  <schwab@linux-m68k.org>
15103         * callproc.c: Indentation fixup.
15105         * sysdep.c (wait_for_termination_1): Make static.
15106         (wait_for_termination, interruptible_wait_for_termination):
15107         Move after wait_for_termination_1.
15109 2011-05-01  Lars Magne Ingebrigtsen  <larsi@gnus.org>
15111         * sysdep.c (interruptible_wait_for_termination): New function
15112         which is like wait_for_termination, but allows keyboard
15113         interruptions.
15115         * callproc.c (Fcall_process): Add (:file "file") as an option for
15116         the STDOUT buffer.
15117         (Fcall_process_region): Ditto.
15119 2011-04-30  Eli Zaretskii  <eliz@gnu.org>
15121         * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15122         rather than `XVECTOR (FOO)->size'.
15124         * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15125         inttypes.h, as a gnulib replacement is used if it not available in
15126         system headers.
15128 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
15130         Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15131         * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15132         of MOST_POSITIVE_FIXNUM.  (Bug#8528)
15134         * coding.c (coding_alloc_by_realloc): Error out if destination
15135         will grow beyond MOST_POSITIVE_FIXNUM.
15136         (decode_coding_emacs_mule): Abort if there isn't enough place in
15137         charbuf for the composition carryover bytes.  Reserve an extra
15138         space for up to 2 characters produced in a loop.
15139         (decode_coding_iso_2022): Abort if there isn't enough place in
15140         charbuf for the composition carryover bytes.
15142 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
15144         * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15145         aborting when %lld or %lll format is passed.
15146         [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15147         %llo or %llx format is passed.  (Bug#8545)
15149         * window.c (window_scroll_line_based): Use a marker instead of
15150         simple variables to record original value of point.  (Bug#7952)
15152         * doprnt.c (doprnt): Fix the case where a multibyte sequence
15153         produced by %s or %c overflows available buffer space.  (Bug#8545)
15155 2011-04-28  Paul Eggert  <eggert@cs.ucla.edu>
15157         * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
15158         (SIZE_MAX): Move defn after all includes, as they might #define it.
15160 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
15162         * w32.c (init_environment): Warn about defaulting HOME to C:\.
15164 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
15166         * keyboard.c (Qdelayed_warnings_hook): Define.
15167         (command_loop_1): Run `delayed-warnings-hook'
15168         if Vdelayed_warnings_list is non-nil.
15169         (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15170         (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15172 2011-04-28  Eli Zaretskii  <eliz@gnu.org>
15174         * doprnt.c (doprnt): Don't return value smaller than the buffer
15175         size if the message was truncated.  (Bug#8545).
15177 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
15179         * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15180         (Fx_window_property): #if-0 the whole functions, not just the bodies.
15182 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
15184         * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15186 2011-04-27  Juanma Barranquero  <lekktu@gmail.com>
15188         * makefile.w32-in: Update dependencies.
15190 2011-04-27  Eli Zaretskii  <eliz@gnu.org>
15192         Improve `doprnt' and its usage.  (Bug#8545)
15193         * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15194         `format_end'.  Remove support for %l as a conversion specifier.
15195         Don't use xrealloc.  Improve diagnostics when the %l size modifier
15196         is used.  Update the commentary.
15198         * eval.c (verror): Simplify calculation of size_t.
15200         * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15201         messages.
15203 2011-04-27  Yoshiaki Kasahara  <kasahara@nc.kyushu-u.ac.jp>  (tiny change)
15205         * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15206         change.
15208 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
15210         * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15211         This makes this file independent of the recent pseudovector change.
15213 2011-04-26  Paul Eggert  <eggert@cs.ucla.edu>
15215         * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15217         * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
15218         (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
15219         Remove unused local.
15220         (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
15222         * lisp.h: Fix a problem with aliasing and vector headers.  (Bug#8546)
15223         GCC 4.6.0 optimizes based on type-based alias analysis.
15224         For example, if b is of type struct buffer * and v of type struct
15225         Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15226         != &v->size, and therefore "v->size = 1; b->size = 2; return
15227         v->size;" must therefore return 1.  This assumption is incorrect
15228         for Emacs, since it type-puns struct Lisp_Vector * with many other
15229         types.  To fix this problem, this patch adds a new type struct
15230         vectorlike_header that documents the constraints on layout of vectors
15231         and pseudovectors, and helps optimizing compilers not get fooled
15232         by Emacs's type punning.  It also adds the macros XSETTYPED_PVECTYPE
15233         XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
15234         * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15235         the size member.
15236         (XSETPVECTYPE): Rewrite in terms of new macro.
15237         (XSETPVECTYPESIZE): New macro, specifying both type and size.
15238         This is a bit clearer, and further avoids the possibility of
15239         undesirable aliasing.
15240         (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
15241         (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
15242         (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15243         since Lisp_Subr is a special case (no "next" field).
15244         (ASIZE): Now uses header.size rather than size.
15245         All previous uses of XVECTOR (foo)->size replaced to use this macro,
15246         to avoid the hassle of writing XVECTOR (foo)->header.size.
15247         (struct vectorlike_header): New type.
15248         (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15249         object, to help avoid aliasing.
15250         (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15251         (SUBRP): Likewise, since Lisp_Subr is a special case.
15252         * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15253         (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15254         (struct Lisp_Hash_Table): Combine first two members into a single
15255         struct vectorlike_header member.  All uses of "size" and "next" members
15256         changed to be "header.size" and "header.next".
15257         * buffer.h (struct buffer): Likewise.
15258         * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15259         * frame.h (struct frame): Likewise.
15260         * process.h (struct Lisp_Process): Likewise.
15261         * termhooks.h (struct terminal): Likewise.
15262         * window.c (struct save_window_data, struct saved_window): Likewise.
15263         * window.h (struct window): Likewise.
15264         * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15265         Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15266         * buffer.c (init_buffer_once): Likewise.
15267         * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15268         special case.
15269         * process.c (Fformat_network_address): Use local var for size,
15270         for brevity.
15272         * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15274         Make the Lisp reader and string-to-float more consistent (Bug#8525)
15275         * data.c (atof): Remove decl; no longer used or needed.
15276         (digit_to_number): Move to lread.c.
15277         (Fstring_to_number): Use new string_to_number function, to be
15278         consistent with how the Lisp reader treats infinities and NaNs.
15279         Do not assume that floating-point numbers represent EMACS_INT
15280         without losing information; this is not true on most 64-bit hosts.
15281         Avoid double-rounding errors, by insisting on integers when
15282         parsing non-base-10 numbers, as the documentation specifies.
15283         * lisp.h (string_to_number): New decl, replacing ...
15284         (isfloat_string): Remove.
15285         * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
15286         (read1): Do not accept +. and -. as integers; this
15287         appears to have been a coding error.  Similarly, do not accept
15288         strings like +-1e0 as floating point numbers.  Do not report
15289         overflow for integer overflows unless the base is not 10 which
15290         means we have no simple and reliable way to continue.
15291         Break out the floating-point parsing into a new
15292         function string_to_number, so that Fstring_to_number parses
15293         floating point numbers consistently with the Lisp reader.
15294         (digit_to_number): Move here from data.c.  Make it static inline.
15295         (E_CHAR, EXP_INT): Remove, replacing with ...
15296         (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15297         (string_to_number): New function, replacing isfloat_string.
15298         This function checks for valid syntax and produces the resulting
15299         Lisp float number too.  Rework it so that string-to-number
15300         no longer mishandles examples like "1.0e+".  Use strtoumax,
15301         so that overflow for non-base-10 numbers is reported only when
15302         there's no portable and simple way to convert to floating point.
15304         * textprop.c (set_text_properties_1): Rewrite for clarity,
15305         and to avoid GCC warning about integer overflow.
15307         * intervals.h (struct interval): Use EMACS_INT for members
15308         where EMACS_UINT might cause problems.  See
15309         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15310         (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15311         * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15312         All uses changed.
15313         (offset_intervals): Tell GCC not to worry about length overflow
15314         when negating a negative length.
15316         * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15317         (overrun_check_free): Likewise.
15319         * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15320         in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15321         word size.
15323         * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15324         (gnutls_make_error): Rename local to avoid shadowing.
15325         (gnutls_emacs_global_deinit): ifdef out; not used.
15326         (Fgnutls_boot): Use const for pointer to readonly storage.
15327         Comment out unused local.  Fix pointer signedness problems.
15329         * lread.c (openp): Don't stuff size_t into an 'int'.
15330         Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15331         about possible signed overflow.
15333         * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15334         (GDK_KEY_g): Don't define if already defined.
15335         (xg_prepare_tooltip): Avoid pointer signedness problem.
15336         (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15338         * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15339         behavior with 1 << 31.  GCC 4.6.0 warns about this on 32-bit hosts.
15341         * xfns.c (Fx_window_property): Simplify a bit,
15342         to make a bit faster and to avoid GCC 4.6.0 warning.
15343         * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15345         * fns.c (internal_equal): Don't assume size_t fits in int.
15347         * alloc.c (compact_small_strings): Tighten assertion a little.
15349         Replace pEd with more-general pI, and fix some printf arg casts.
15350         * lisp.h (pI): New macro, generalizing old pEd macro to other
15351         conversion specifiers.  For example, use "...%"pI"d..." rather
15352         than "...%"pEd"...".
15353         (pEd): Remove.  All uses replaced with similar uses of pI.
15354         * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
15355         * alloc.c (check_pure_size): Don't overflow by converting size to int.
15356         * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15357         * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15358         * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15359         (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15360         * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15361         64-bit hosts.
15362         (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15363         * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15364         * print.c (safe_debug_print, print_object): Likewise.
15365         (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15366         to int.
15367         Use pI instead of if-then-else-abort.  Use %p to avoid casts,
15368         avoiding the 0 flag, which is not portable.
15369         * process.c (Fmake_network_process): Use pI to avoid cast.
15370         * region-cache.c (pp_cache): Likewise.
15371         * xdisp.c (decode_mode_spec): Likewise.
15372         * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15373         behavior on 64-bit hosts with printf arg.
15374         * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
15375         (x_stop_queuing_selection_requests): Likewise.
15376         (x_get_window_property): Don't truncate byte count to an 'int'
15377         when tracing.
15379         * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15380         here, since it parses constructs like leading '-' and spaces,
15381         which are not wanted; and it overflows with large numbers.
15382         Instead, simply match F[0-9]+, which is what is wanted anyway.
15384         * alloc.c: Remove unportable assumptions about struct layout.
15385         (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15386         (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15387         (allocate_vectorlike, make_pure_vector): Use the new macros,
15388         plus offsetof, to remove unportable assumptions about struct layout.
15389         These assumptions hold on all porting targets that I know of, but
15390         they are not guaranteed, they're easy to remove, and removing them
15391         makes further changes easier.
15393         * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15394         This doesn't fix a bug but makes the code clearer.
15395         (string_overrun_cookie): Now const.  Use initializers that
15396         don't formally overflow signed char, to avoid warnings.
15397         (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15398         can cause Emacs to crash when string overrun checking is enabled.
15399         (allocate_buffer): Don't assume sizeof (struct buffer) is a
15400         multiple of sizeof (EMACS_INT); it need not be, if
15401         alignof(EMACS_INT) < sizeof (EMACS_INT).
15402         (check_sblock, check_string_bytes, check_string_free_list): Protoize.
15404 2011-04-26  Juanma Barranquero  <lekktu@gmail.com>
15406         * keyboard.c (QCrtl): Rename from Qrtl.  All uses changed.
15408 2011-04-26  Teodor Zlatanov  <tzz@lifelogs.com>
15410         * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
15411         supposed to be handshaking.  (Bug#8556)
15412         Reported by Paul Eggert <eggert@cs.ucla.edu>.
15414 2011-04-26  Daniel Colascione  <dan.colascione@gmail.com>
15416         * lisp.h (Qdebug): List symbol.
15417         * eval.c (Qdebug): Restore global linkage.
15418         * keyboard.c (debug-on-event): New variable.
15419         (handle_user_signal): Break into debugger when debug-on-event
15420         matches the current signal symbol.
15422 2011-04-25  Dan Nicolaescu  <dann@ics.uci.edu>
15424         * alloc.c (check_sblock, check_string_bytes)
15425         (check_string_free_list): Convert to standard C.
15427 2011-04-25  Teodor Zlatanov  <tzz@lifelogs.com>
15429         * w32.c (emacs_gnutls_push): Fix typo.
15431 2011-04-25  Eli Zaretskii  <eliz@gnu.org>
15433         * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15434         "cast to pointer from integer of different size".
15436         Improve doprnt and its use in verror.  (Bug#8545)
15437         * doprnt.c (doprnt): Document the set of format control sequences
15438         supported by the function.  Use SAFE_ALLOCA instead of always
15439         using `alloca'.
15441         * eval.c (verror): Don't limit the buffer size at size_max-1, that
15442         is one byte too soon.  Don't use xrealloc; instead xfree and
15443         xmalloc anew.
15445 2011-04-24  Teodor Zlatanov  <tzz@lifelogs.com>
15447         * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15448         callbacks stage.
15450         * gnutls.c: Renamed global_initialized to
15451         gnutls_global_initialized.  Added internals for the
15452         :verify-hostname-error, :verify-error, and :verify-flags
15453         parameters of `gnutls-boot' and documented those parameters in the
15454         docstring.  Start callback support.
15455         (emacs_gnutls_handshake): Add Woe32 support.  Retry handshake
15456         unless a fatal error occurred.  Call gnutls_alert_send_appropriate
15457         on error.  Return error code.
15458         (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15459         (emacs_gnutls_read): Likewise.
15460         (Fgnutls_boot): Return handshake error code.
15461         (emacs_gnutls_handle_error): New function.
15462         (wsaerror_to_errno): Likewise.
15464         * w32.h (emacs_gnutls_pull): Add prototype.
15465         (emacs_gnutls_push): Likewise.
15467         * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15468         (emacs_gnutls_push): Likewise.
15470 2011-04-24  Claudio Bley  <claudio.bley@gmail.com>  (tiny change)
15472         * process.c (wait_reading_process_output): Check if GnuTLS
15473         buffered some data internally if no FDs are set for TLS
15474         connections.
15476         * makefile.w32-in (OBJ2): Add gnutls.$(O).
15477         (LIBS): Link to USER_LIBS.
15478         ($(BLD)/gnutls.$(0)): New target.
15480 2011-04-24  Eli Zaretskii  <eliz@gnu.org>
15482         * xdisp.c (handle_single_display_spec): Rename the
15483         display_replaced_before_p argument into display_replaced_p, to
15484         make it consistent with the commentary.  Fix typos in the
15485         commentary.
15487         * textprop.c (syms_of_textprop): Remove dead code.
15488         (copy_text_properties): Delete obsolete commentary about an
15489         interface that was deleted long ago.  Fix typos in the description
15490         of arguments.
15492         * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15493         to changes in oldXMenu/XMenu.h from 2011-04-16.
15494         <menu_help_message, prev_menu_help_message>: Constify.
15495         (IT_menu_make_room): menu->help_text is now `const char **';
15496         adjust.
15498         * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15499         to changes in oldXMenu/XMenu.h from 2011-04-16.
15500         (struct XMenu): Declare `help_text' `const char **'.
15502         * xfaces.c <Qunspecified>: Make extern again.
15504         * syntax.c: Include sys/types.h before including regex.h, as
15505         required by POSIX.
15507         * doc.c (get_doc_string): Improve the format passed to `error'.
15509         * doprnt.c (doprnt): Improve commentary.
15511         * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15513         * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15514         them with etags.
15516         * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15517         changes in globals.h immediately force recompilation.
15518         (TAGS): Depend on $(CURDIR)/m/intel386.h and
15519         $(CURDIR)/s/ms-w32.h.
15520         (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
15522         * character.c (Fchar_direction): Function deleted.
15523         (syms_of_character): Don't defsubr it.
15524         <char-direction-table>: Deleted.
15526 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
15528         Fix doprnt so it could be used again safely in `verror'.  (Bug#8435)
15529         * doprnt.c: Include limits.h.
15530         (SIZE_MAX): New macro.
15531         (doprnt): Return a size_t value.  2nd arg is now size_t.
15532         Many local variables are now size_t instead of int or unsigned.
15533         Improve overflow protection.  Support `l' modifier for integer
15534         conversions.  Support %l conversion.  Don't assume an EMACS_INT
15535         argument for integer conversions and for %c.
15537         * lisp.h (doprnt): Restore prototype.
15539         * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15540         $(SRC)/character.h.
15542         * Makefile.in (base_obj): Add back doprnt.o.
15544         * deps.mk (doprnt.o): Add back prerequisites.
15545         (callint.o): Depend on character.h.
15547         * eval.c (internal_lisp_condition_case): Include the handler
15548         representation in the error message.
15549         (verror): Call doprnt instead of vsnprintf.  Fix an off-by-one bug
15550         when breaking from the loop.
15552         * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15554         * callint.c (Fcall_interactively): When displaying error message
15555         about invalid control letter, pass the character's codepoint, not
15556         a pointer to its multibyte form.  Improve display of the character
15557         in octal and display also its hex code.
15559         * character.c (char_string): Use %x to display the (unsigned)
15560         codepoint of an invalid character, to avoid displaying a bogus
15561         negative value.
15563         * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15564         `error', not SYMBOL_NAME itself.
15566         * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15567         character arguments to `error'.
15569         * charset.c (check_iso_charset_parameter): Fix incorrect argument
15570         to `error' in error message about FINAL_CHAR argument.  Make sure
15571         FINAL_CHAR is a character, and use %c when it is passed as
15572         argument to `error'.
15574 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
15576         * s/ms-w32.h (localtime): Redirect to sys_localtime.
15578         * w32.c: Include <time.h>.
15579         (sys_localtime): New function.
15581 2011-04-23  Chong Yidong  <cyd@stupidchicken.com>
15583         * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15585         * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
15587 2011-04-23  Samuel Thibault  <sthibault@debian.org>  (tiny change)
15589         * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15590         zombies (Bug#8467).
15592 2011-04-19  Eli Zaretskii  <eliz@gnu.org>
15594         * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15595         gl_state.e_property when gl_state.object is Qt.
15597         * insdel.c (make_gap_larger): Remove limitation of buffer size
15598         to <= INT_MAX.
15600 2011-04-18  Chong Yidong  <cyd@stupidchicken.com>
15602         * xdisp.c (lookup_glyphless_char_display)
15603         (produce_glyphless_glyph): Handle cons cell entry in
15604         glyphless-char-display.
15605         (Vglyphless_char_display): Document it.
15607         * term.c (produce_glyphless_glyph): Handle cons cell entry in
15608         glyphless-char-display.
15610 2011-04-17  Chong Yidong  <cyd@stupidchicken.com>
15612         * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15614         * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15616         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15617         definition for no-X builds.
15619 2011-04-16  Paul Eggert  <eggert@cs.ucla.edu>
15621         Static checks with GCC 4.6.0 and non-default toolkits.
15623         * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15625         * process.c (keyboard_bit_set): Define only if SIGIO.
15626         (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15627         (send_process): Repair possible setjmp clobbering.
15629         * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15631         * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15633         * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15635         * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
15636         Define only if needed.
15638         * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
15639         by pacifying GCC about it.  Maybe it's time to retire it?
15640         * xfaces.c (USG, __TIMEVAL__): Likewise.
15642         * dispextern.h (struct redisplay_interface): Rename param
15643         to avoid shadowing.
15644         * termhooks.h (struct terminal): Likewise.
15645         * xterm.c (xembed_send_message): Likewise.
15647         * insdel.c (make_gap_smaller): Define only if
15648         USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
15650         * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
15651         it.
15653         * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
15654         so that we aren't warned about unused symbols.
15656         * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
15658         * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
15660         * xfns.c (x_real_positions): Mark locals as initialized.
15662         * xmenu.c (xmenu_show): Don't use uninitialized vars.
15664         * xterm.c: Fix problems found by static analysis with other toolkits.
15665         (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
15666         (x_dispatch_event): Declare static if USE_GTK, and
15667         define if USE_GTK || USE_X_TOOLKIT.
15668         (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
15669         * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
15670         * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15671         if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
15673         * xmenu.c (menu_help_callback): Pointer type fixes.
15674         Use const pointers when pointing at readonly data.  Avoid pointer
15675         signedness clashes.
15676         (FALSE): Remove unused macro.
15677         (update_frame_menubar): Remove unused decl.
15679         * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15681         * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15682         USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15683         (single_menu_item): Rename local to avoid shadowing.
15685         * keyboard.c (make_lispy_event): Remove unused local var.
15687         * frame.c, frame.h (x_get_resource_string): Bring this back, but
15688         only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15690         * bitmaps: Change bitmaps from unsigned char back to the X11
15691         compatible char.  Avoid the old compiler warnings about
15692         out-of-range initializers by using, for example, '\xab' rather
15693         than 0xab.
15695         * xgselect.c (xgselect_initialize): Check vs interface
15696         even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15698         * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15700         * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15701         to read-only memory.
15703         * fns.c (vector): Remove; this old hack is no longer needed.
15705         * xsmfns.c (create_client_leader_window): Rename shadowing arg.
15706         Remove unused var.
15707         (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
15709         * xrdb.c (x_load_resources): Omit unused local.
15711         * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
15712         (x_window): Rename locals to avoid shadowing.
15713         (USG): Use the kludged USG macro, to pacify gcc.
15715         * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
15716         (x_term_init): Remove local to avoid shadowing.
15718         * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
15720         * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15721         USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15723 2011-04-16  Eli Zaretskii  <eliz@gnu.org>
15725         * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15727         Fix regex.c, syntax.c and friends for buffers > 2GB.
15728         * syntax.h (struct gl_state_s): Declare character position members
15729         EMACS_INT.
15731         * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15733         * textprop.c (verify_interval_modification, interval_of):
15734         Declare arguments EMACS_INT.
15736         * intervals.c (adjust_intervals_for_insertion): Declare arguments
15737         EMACS_INT.
15739         * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15741         * indent.c (Fvertical_motion): Local variable it_start is now
15742         EMACS_INT.
15744         * regex.c (re_match, re_match_2, re_match_2_internal)
15745         (bcmp_translate, regcomp, regexec, print_double_string)
15746         (group_in_compile_stack, re_search, re_search_2, regex_compile)
15747         (re_compile_pattern, re_exec): Declare arguments and local
15748         variables `size_t' and `ssize_t' and return values `regoff_t', as
15749         appropriate.
15750         (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
15751         (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
15752         <compile_stack_type>: `size' and `avail' are now `size_t'.
15754         * regex.h <regoff_t>: Use ssize_t, not int.
15755         (re_search, re_search_2, re_match, re_match_2): Arguments that
15756         specify buffer/string position and length are now ssize_t and
15757         size_t.  Return type is regoff_t.
15759 2011-04-16  Ben Key  <bkey76@gmail.com>
15761         * nsfont.m: Fixed bugs in ns_get_family and
15762         ns_descriptor_to_entity that were caused by using free to
15763         deallocate memory blocks that were allocated by xmalloc (via
15764         xstrdup).  This caused Emacs to crash when compiled with
15765         XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
15766         --enable-checking=xmallocoverrun).  xfree is now used to
15767         deallocate these memory blocks.
15769 2011-04-15  Paul Eggert  <eggert@cs.ucla.edu>
15771         * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
15773         emacs_write: Accept and return EMACS_INT for sizes.
15774         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
15775         et seq.
15776         * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
15777         Accept and return EMACS_INT.
15778         (emacs_gnutls_write): Return the number of bytes written on
15779         partial writes.
15780         * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
15781         (emacs_read, emacs_write): Remove check for negative size, as the
15782         Emacs source code has been audited now.
15783         * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
15784         (emacs_read, emacs_write): Use it.
15785         * process.c (send_process): Adjust to the new signatures of
15786         emacs_write and emacs_gnutls_write.  Do not attempt to store
15787         a byte offset into an 'int'; it might overflow.
15788         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
15790         * sound.c: Don't assume sizes fit in 'int'.
15791         (struct sound_device.period_size, alsa_period_size):
15792         Return EMACS_INT, not int.
15793         (struct sound_device.write, vox_write, alsa_write):
15794         Accept EMACS_INT, not int.
15795         (wav_play, au_play): Use EMACS_INT to store sizes and to
15796         record read return values.
15798 2011-04-15  Ben Key  <bkey76@gmail.com>
15800         * keyboard.c (Qundefined): Don't declare static since it is used
15801         in nsfns.m.
15802         * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
15803         static since they are used in nsfont.m.
15805 2011-04-15  Stefan Monnier  <monnier@iro.umontreal.ca>
15807         * process.c (Qprocessp): Don't declare static.
15808         * lisp.h (Qprocessp): Declare again.
15810 2011-04-15  Juanma Barranquero  <lekktu@gmail.com>
15812         * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
15814 2011-04-14  Paul Eggert  <eggert@cs.ucla.edu>
15816         Improve C-level modularity by making more things 'static'.
15818         Don't publish debugger-only interfaces to other modules.
15819         * lisp.h (safe_debug_print, debug_output_compilation_hack):
15820         (verify_bytepos, count_markers): Move decls to the only modules
15821         that need them.
15822         * region-cache.h (pp_cache): Likewise.
15823         * window.h (check_all_windows): Likewise.
15824         * marker.c, print.c, region-cache.c, window.c: Decls moved here.
15826         * sysdep.c (croak): Now static, if
15827         defined TIOCNOTTY || defined USG5 || defined CYGWIN.
15828         * syssignal.h (croak): Declare only if not static.
15830         * alloc.c (refill_memory_reserve): Now static if
15831         !defined REL_ALLOC || defined SYSTEM_MALLOC.
15832         * lisp.h (refill_memory_reserve): Declare only if not static.
15834         * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
15835         Define only if USE_LUCID.
15837         * xrdb.c (x_customization_string, x_rm_string): Now static.
15839         * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
15840         * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
15842         * xdisp.c (draw_row_with_mouse_face): Now static.
15843         * dispextern.h (draw_row_with_mouse_fave): Remove decl.
15845         * window.h (check_all_windows): Mark externally visible.
15847         * window.c (window_deletion_count): Now static.
15849         * undo.c: Make symbols static if they're not exported.
15850         (last_undo_buffer, last_boundary_position, pending_boundary):
15851         Now static.
15853         * textprop.c (interval_insert_behind_hooks): Now static.
15854         (interval_insert_in_front_hooks): Likewise.
15856         * term.c: Make symbols static if they're not exported.
15857         (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
15858         (max_frame_lines, tty_set_terminal_modes):
15859         (tty_reset_terminal_modes, tty_turn_off_highlight):
15860         (get_tty_terminal): Now static.
15861         (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
15862         * termhooks.h (term_mouse_moveto): Do not declare if
15863         HAVE_WINDOW_SYSTEM.
15864         * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
15865         (tty_turn_off_highlight, get_tty_terminal): Remove decls.
15867         * sysdep.c: Make symbols static if they're not exported.
15868         (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
15869         Now static.
15870         (sigprocmask_set, full_mask): Remove; unused.
15871         (wait_debugging): Mark as visible.
15872         * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
15873         * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
15875         * syntax.c (syntax_temp): Define only if !__GNUC__.
15877         * sound.c (current_sound_device, current_sound): Now static.
15879         * search.c (searchbufs, searchbuf_head): Now static.
15881         * scroll.c (scroll_cost): Remove; unused.
15882         * dispextern.h (scroll_cost): Remove decl.
15884         * region-cache.h (pp_cache): Mark as externally visible.
15886         * process.c: Make symbols static if they're not exported.
15887         (process_tick, update_tick, create_process, chan_process):
15888         (Vprocess_alist, proc_buffered_char, datagram_access):
15889         (fd_callback_data, send_process_frame, process_sent_to): Now static.
15890         (deactivate_process): Mark defn as static, as well as decl.
15891         * lisp.h (create_process): Remove decl.
15892         * process.h (chan_process, Vprocess_alist): Remove decls.
15894         * print.c: Make symbols static if they're not exported.
15895         (print_depth, new_backquote_output, being_printed, print_buffer):
15896         (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
15897         (print_interval, print_number_index, initial_stderr_stream):
15898         Now static.
15899         * lisp.h (Fprinc): Remove decl.
15900         (debug_output_compilation_hack): Mark as externally visible.
15902         * sysdep.c (croak): Move decl from here to syssignal.h.
15903         * syssignal.h (croak): Put it here, so the API can be checked when
15904         'croak' is called from dissociate_if_controlling_tty.
15906         * minibuf.c: Make symbols static if they're not exported.
15907         (minibuf_save_list, choose_minibuf_frame): Now static.
15908         * lisp.h (choose_minibuf_frame): Remove decl.
15910         * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
15912         * lread.c: Make symbols static if they're not exported.
15913         (read_objects, initial_obarray, oblookup_last_bucket_number):
15914         Now static.
15915         (make_symbol): Remove; unused.
15916         * lisp.h (initial_obarray, make_symbol): Remove decls.
15918         * keyboard.c: Make symbols static if they're not exported.
15919         (single_kboard, recent_keys_index, total_keys, recent_keys):
15920         (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
15921         (this_single_command_key_start, echoing, last_auto_save):
15922         (read_key_sequence_cmd, dribble, recursive_edit_unwind):
15923         (command_loop, echo_now, keyboard_init_hook, help_char_p):
15924         (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
15925         (Vlispy_mouse_stem, double_click_count):
15926         Now static.
15927         (force_auto_save_soon): Define only if SIGDANGER.
15928         (ignore_mouse_drag_p): Now static if
15929         !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
15930         (print_help): Remove; unused.
15931         (stop_character, last_timer_event): Mark as externally visible.
15932         * keyboard.h (ignore_mouse_drag_p): Declare only if
15933         defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
15934         (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
15935         * lisp.h (echoing): Remove decl.
15936         (force_auto_save_soon): Declare only if SIGDANGER.
15937         * xdisp.c (redisplay_window): Simplify code, to make it more
15938         obvious that ignore_mouse_drag_p is not accessed if !defined
15939         USE_GTK && !defined HAVE_NS.
15941         * intervals.c: Make symbols static if they're not exported.
15942         (merge_properties_sticky, merge_interval_right, delete_interval):
15943         Now static.
15944         * intervals.h (merge_interval_right, delete_interval): Remove decls.
15946         * insdel.c: Make symbols static if they're not exported.
15947         However, leave prepare_to_modify_buffer alone.  It's never
15948         called from outside this function, but that appears to be a bug.
15949         (combine_after_change_list, combine_after_change_buffer):
15950         (adjust_after_replace, signal_before_change): Now static.
15951         (adjust_after_replace_noundo): Remove; unused.
15952         * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
15953         (signal_before_change): Remove decls.
15955         * indent.c (val_compute_motion, val_vmotion): Now static.
15957         * image.c: Make symbols static if they're not exported.
15958         * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
15959         if USE_GTK.
15960         * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
15961         (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
15963         * fringe.c (standard_bitmaps): Now static.
15964         (max_used_fringe_bitmap): Now static, unless HAVE_NS.
15966         * frame.c: Make symbols static if they're not exported.
15967         (x_report_frame_params, make_terminal_frame): Now static.
15968         (get_frame_param): Now static, unless HAVE_NS.
15969         (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
15970         (x_get_resource_string): Remove; not used.
15971         * frame.h (make_terminal_frame, x_report_frame_params):
15972         (x_get_resource_string); Remove decls.
15973         (x_fullscreen_adjust): Declare only if WINDOWSNT.
15974         * lisp.h (get_frame_param): Declare only if HAVE_NS.
15976         * font.c, fontset.c: Make symbols static if they're not exported.
15977         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
15978         (FACE_SUITABLE_FOR_CHAR_P): Use it.
15979         * font.c (font_close_object): Now static.
15980         * font.h (font_close_object): Remove.
15981         * fontset.c (FONTSET_OBJLIST): Remove.
15982         (free_realized_fontset) #if-0 the body, which does nothing.
15983         (face_suitable_for_char_p): #if-0, as it's never called.
15984         * fontset.h (face_suitable_for_char_p): Remove decl.
15985         * xfaces.c (face_at_string_position):
15986         Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
15987         since 0 is always ASCII.
15989         * fns.c (weak_hash_tables): Now static.
15991         * fileio.c: Make symbols static if they're not exported.
15992         (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
15993         (Vwrite_region_annotation_buffers): Now static.
15995         * eval.c: Make symbols static if they're not exported.
15996         (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
15997         * lisp.h (backtrace_list): Remove decl.
15999         * emacs.c: Make symbols static if they're not exported.
16000         (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16001         (fatal_error_code, fatal_error_signal_hook, standard_args):
16002         Now static.
16003         (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16004         (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16005         (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16006         * lisp.h (fatal_error_signal_hook): Remove decl.
16007         (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16009         * editfns.c: Move a (normally-unused) function to its only use.
16010         * editfns.c, lisp.h (get_operating_system_release): Remove.
16011         * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16012         worth the hassle of breaking this out.
16014         * xterm.c: Make symbols static if they're not exported.
16015         (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16016         (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16017         (x_destroy_window, x_delete_display):
16018         Now static.
16019         (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16020         (x_mouse_leave): Remove; unused.
16021         * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16022         (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16023         (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16024         Remove decls.
16025         (x_mouse_leave): Declare only if WINDOWSNT.
16026         (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16027         (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16028         USE_X_TOOLKIT.
16030         * ftxfont.c: Make symbols static if they're not exported.
16031         (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16032         HAVE_FREETYPE.
16033         * font.h (ftxfont_driver): Likewise.
16035         * xfns.c: Make symbols static if they're not exported.
16036         (x_last_font_name, x_display_info_for_name):
16037         (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16038         (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16039         (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16040         (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16041         (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16042         (last_show_tip_args): Now static.
16043         (xic_defaut_fontset, xic_create_fontsetname): Define only if
16044         defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16045         (x_screen_planes): Remove; unused.
16046         * dispextern.h (x_screen_planes): Remove decl.
16048         * dispnew.c: Make symbols static if they're not exported.
16049         * dispextern.h (redraw_garbaged_frames, scrolling):
16050         (increment_row_positions): Remove.
16051         * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16052         (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16053         Now static.
16054         (redraw_garbaged_frames): Remove; unused.
16056         * xfaces.c: Make symbols static if they're not exported.
16057         * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16058         Remove decls.
16059         * xterm.h (defined_color): Remove decls.
16060         (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16061         * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16062         (menu_face_changed_default, defined_color, free_realized_face):
16063         (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16064         (ascii_face_of_lisp_face): Remove; unused.
16066         * xdisp.c: Make symbols static if they're not exported.
16067         * dispextern.h (scratch_glyph_row, window_box_edges):
16068         (glyph_to_pixel_coords, set_cursor_from_row):
16069         (get_next_display_element, set_iterator_to_next):
16070         (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16071         (show_mouse_face): Remove decls
16072         * frame.h (message_buf_print): Likewise.
16073         * lisp.h (pop_message, set_message, check_point_in_composition):
16074         Likewise.
16075         * xterm.h (set_vertical_scroll_bar): Likewise.
16076         * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16077         (message_buf_print, scratch_glyph_row, displayed_buffer):
16078         (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16079         (get_next_display_element, show_mouse_face, window_box_edges):
16080         (frame_to_window_pixel_xy, check_point_in_composition):
16081         (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16082         (glyph_to_pixel_coords): Remove; unused.
16084         * dired.c (file_name_completion): Now static.
16086         * dbusbind.c (xd_in_read_queued_messages): Now static.
16088         * lisp.h (circular_list_error, FOREACH): Remove; unused.
16089         * data.c (circular_list_error): Remove.
16091         * commands.h (last_point_position, last_point_position_buffer):
16092         (last_point_position_window): Remove decls.
16093         * keyboard.c: Make these variables static.
16095         * coding.h (coding, code_convert_region, encode_coding_gap):
16096         Remove decls.
16097         * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16098         (iso_code_class, detect_coding, code_convert_region): Now static.
16099         (encode_coding_gap): Remove; unused.
16101         * chartab.c (chartab_chars, chartab_bits): Now static.
16103         * charset.h (charset_iso_8859_1): Remove decl.
16104         * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16105         Now static.
16107         * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16108         * ccl.c (Vccl_program_table): Now static.
16109         (check_ccl_update): Remove; unused.
16111         * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16112         * category.h: ... from here.
16113         * category.c (check_category_table, set_category_set): Now static.
16115         * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16116         * lisp.h: Remove these decls.
16118         * buffer.c (buffer_count): Remove unused var.
16120         * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16121         so that it's not optimized away.
16122         (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16123         * dispextern.h (bidi_dump_cached_states): Remove, since it's
16124         exported only to the debugger.
16126         * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
16127         * atimer.h (run_all_atimers): Remove; not exported.
16129         font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16130         * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16131         was inaccessible from Lisp.
16132         (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16133         * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16135         alloc.c: Import and export fewer symbols, and remove unused items.
16136         * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16137         is defined.
16138         (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16139         it's not optimized away by whole-program optimization.
16140         (message_enable_multibyte, free_misc): Remove.
16141         (catchlist, handlerlist, mark_backtrace):
16142         Declare only if BYTE_MARK_STACK.
16143         (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16144         * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16145         (message_enable_multibyte): Remove decl.
16146         (free_misc, interval_free_list, float_block, float_block_index):
16147         (n_float_blocks, float_free_list, cons_block, cons_block_index):
16148         (cons_free_list, last_marked_index):
16149         Now static.
16150         (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16151         * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16152         (mark_backtrace): Define only if BYTE_MARK_STACK.
16153         * xdisp.c (message_enable_multibyte): Now static.
16155         Declare Lisp_Object Q* variables to be 'static' if not exported.
16156         This makes it easier for human readers (and static analyzers)
16157         to see whether these variables are used from other modules.
16158         * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16159         * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16160         * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16161         * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16162         * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16163         * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16164         * xmenu.c, xselect.c:
16165         Declare Q* vars static if they are not used in other modules.
16166         * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16167         * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16168         Remove decls of unexported vars.
16169         * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16171         * lisp.h (DEFINE_FUNC): Make sname 'static'.
16173         Make Emacs functions such as Fatom 'static' by default.
16174         This makes it easier for human readers (and static analyzers)
16175         to see whether these functions can be called from other modules.
16176         DEFUN now defines a static function.  To make the function external
16177         so that it can be used in other C modules, use the new macro DEFUE.
16178         * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16179         (Finit_image_library):
16180         (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16181         (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16182         (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16183         Remove decls, since these functions are now static.
16184         (Funintern, Fget_internal_run_time): New decls, since these functions
16185         were already external.
16187         * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16188         * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16189         * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16190         * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16191         * keyboard.c, keymap.c, lread.c:
16192         * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16193         * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16194         * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16195         Mark functions with DEFUE instead of DEFUN,
16196         if they are used in other modules.
16197         * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16198         decls for now-static functions.
16199         * buffer.h (Fdelete_overlay): Remove decl.
16200         * callproc.c (Fgetenv_internal): Mark as internal.
16201         * composite.c (Fremove_list_of_text_properties): Remove decl.
16202         (Fcomposition_get_gstring): New forward static decl.
16203         * composite.h (Fcomposite_get_gstring): Remove decl.
16204         * dired.c (Ffile_attributes): New forward static decl.
16205         * doc.c (Fdocumntation_property): New forward static decl.
16206         * eval.c (Ffetch_bytecode): New forward static decl.
16207         (Funintern): Remove extern decl; now in .h file where it belongs.
16208         * fileio.c (Fmake_symbolic_link): New forward static decl.
16209         * image.c (Finit_image_library): New forward static decl.
16210         * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16211         * intervals.h (Fprevious_property_change):
16212         (Fremove_list_of_text_properties): Remove decls.
16213         * keyboard.c (Fthis_command_keys): Remove decl.
16214         (Fcommand_execute): New forward static decl.
16215         * keymap.c (Flookup_key): New forward static decl.
16216         (Fcopy_keymap): Now static.
16217         * keymap.h (Flookup_key): Remove decl.
16218         * process.c (Fget_process): New forward static decl.
16219         (Fprocess_datagram_address): Mark as internal.
16220         * syntax.c (Fsyntax_table_p): New forward static decl.
16221         (skip_chars): Remove duplicate decl.
16222         * textprop.c (Fprevious_property_change): New forward static decl.
16223         * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16224         Now internal.
16225         (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16226         * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16228         * editfns.c (Fformat): Remove unreachable code.
16230 2011-04-14  Andreas Schwab  <schwab@linux-m68k.org>
16232         * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16233         change.  (Bug#8496)
16235 2011-04-13  Eli Zaretskii  <eliz@gnu.org>
16237         * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16238         when at ZV.  (Bug#8487)
16240 2011-04-12  Andreas Schwab  <schwab@linux-m68k.org>
16242         * charset.c (Fclear_charset_maps): Use xfree instead of free.
16243         (Bug#8437)
16244         * keyboard.c (parse_tool_bar_item): Likewise.
16245         * sound.c (sound_cleanup, alsa_close): Likewise.
16246         * termcap.c (tgetent): Likewise.
16247         * xfns.c (x_default_font_parameter): Likewise.
16248         * xsettings.c (read_and_apply_settings): Likewise.
16250         * alloc.c (overrun_check_malloc, overrun_check_realloc)
16251         (overrun_check_free): Protoize.
16253 2011-04-12  Paul Eggert  <eggert@cs.ucla.edu>
16255         * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16256         since callers should never pass a negative size.
16257         Change the signature to match that of plain 'read' and 'write'; see
16258         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16259         * lisp.h: Update prototypes of emacs_write and emacs_read.
16261 2011-04-11  Eli Zaretskii  <eliz@gnu.org>
16263         * xdisp.c (redisplay_window): Don't try to determine the character
16264         position of the scroll margin if the window start point w->startp
16265         is outside the buffer's accessible region.  (Bug#8468)
16267 2011-04-10  Eli Zaretskii  <eliz@gnu.org>
16269         Fix write-region and its subroutines for buffers > 2GB.
16270         * fileio.c (a_write, e_write): Modify declaration of arguments and
16271         local variables to support buffers larger than 2GB.
16272         (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16274         * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16275         argument, local variables, and return value.
16277         * lisp.h: Update prototypes of emacs_write and emacs_read.
16279         * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16281 2011-04-10  Paul Eggert  <eggert@cs.ucla.edu>
16283         * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16285         Fix more problems found by GCC 4.6.0's static checks.
16287         * xdisp.c (vmessage): Use a better test for character truncation.
16289         * charset.c (load_charset_map): <, not <=, for optimization,
16290         and to avoid potential problems with integer overflow.
16291         * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
16292         * casetab.c (set_identity, shuffle): Likewise.
16293         * editfns.c (Fformat): Likewise.
16294         * syntax.c (skip_chars): Likewise.
16296         * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16297         This also lets GCC 4.6.0 generate slightly better loop code.
16299         * callint.c (Fcall_interactively): <, not <=, for optimization.
16300         (Fcall_interactively): Count the number of arguments produced,
16301         not the number of arguments given.  This is simpler and lets GCC
16302         4.6.0 generate slightly better code.
16304         * ftfont.c: Distingish more carefully between FcChar8 and char.
16305         The previous code passed unsigned char * to a functions like
16306         strlen and xstrcasecmp that expect char *, which does not
16307         conform to the C standard.
16308         (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16309         arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16310         char * when the C standard requires it.
16312         * keyboard.c (read_char): Remove unused var.
16314         * eval.c: Port to Windows vsnprintf (Bug#8435).
16315         Include <limits.h>.
16316         (SIZE_MAX): Define if the headers do not.
16317         (verror): Do not give up if vsnprintf returns a negative count.
16318         Instead, grow the buffer.  This ports to Windows vsnprintf, which
16319         does not conform to C99.  Problem reported by Eli Zaretskii.
16320         Also, simplify the allocation scheme, by avoiding the need for
16321         calling realloc, and removing the ALLOCATED variable.
16323         * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16325         Remove invocations of doprnt, as Emacs now uses vsnprintf.
16326         But keep the doprint source code for now, as we might revamp it
16327         and use it again (Bug#8435).
16328         * lisp.h (doprnt): Remove.
16329         * Makefile.in (base_obj): Remove doprnt.o.
16330         * deps.mk (doprnt.o): Remove.
16332         error: Print 32- and 64-bit integers portably (Bug#8435).
16333         Without this change, on typical 64-bit hosts error ("...%d...", N)
16334         was used to print both 32- and 64-bit integers N, which relied on
16335         undefined behavior.
16336         * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
16337         * lisp.h (error, verror): Mark as printf-like functions.
16338         * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16339         Report overflow in size calculations when allocating printf buffer.
16340         Do not truncate output string at its first null byte.
16341         * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16342         Truncate the output at a character boundary, since vsnprintf does not
16343         do that.
16344         * charset.c (check_iso_charset_parameter): Convert internal
16345         character to string before calling 'error', since %c now has the
16346         printf meaning.
16347         * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16348         overflow when computing char to be passed to 'error'.  Do not
16349         pass Lisp_Object to 'error'; pass the integer instead.
16350         * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16351         formatted with plain %d.
16353         * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16355         * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16357         * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16359         * xterm.c (x_catch_errors): Remove duplicate declaration.
16361         * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16363         * xdisp.c, lisp.h (message_nolog): Remove; unused.
16365 2011-04-10  Jim Meyering  <meyering@redhat.com>
16367         use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16368         * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16369         return ssize_t not "int", and use size_t as the buffer length.
16370         (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16371         * gnutls.h: Update declarations.
16372         * process.c (read_process_output): Use ssize_t, to match.
16373         (send_process): Likewise.
16375 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
16377         * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16379 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
16381         * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16382         Use unsigned char, to match FcChar8 type definition.
16384         * xterm.c (handle_one_xevent):
16385         * xmenu.c (create_and_show_popup_menu):
16386         * xselect.c (x_decline_selection_request)
16387         (x_reply_selection_request): Avoid type-punned deref of X events.
16389 2011-04-09  Eli Zaretskii  <eliz@gnu.org>
16391         Fix some uses of `int' instead of EMACS_INT.
16392         * search.c (string_match_1, fast_string_match)
16393         (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16394         (scan_buffer, find_next_newline_no_quit)
16395         (find_before_next_newline, search_command, Freplace_match)
16396         (Fmatch_data): Make some `int' variables be EMACS_INT.
16398         * xdisp.c (display_count_lines): 3rd argument and return value now
16399         EMACS_INT.  All callers changed.
16400         (pint2hrstr): Last argument is now EMACS_INT.
16402         * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16403         (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16404         (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16405         (decode_coding_utf_16, decode_coding_emacs_mule)
16406         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16407         (decode_coding_ccl, decode_coding_charset)
16408         <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16409         (decode_coding_iso_2022, decode_coding_emacs_mule)
16410         (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16411         <char_offset, last_offset>: Declare EMACS_INT.
16412         (encode_coding_utf_8, encode_coding_utf_16)
16413         (encode_coding_emacs_mule, encode_invocation_designation)
16414         (encode_designation_at_bol, encode_coding_iso_2022)
16415         (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16416         (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16417         Declare EMACS_INT.
16418         (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16419         (encode_invocation_designation): Last argument P_NCHARS is now
16420         EMACS_INT.
16421         (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16422         (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16424         * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16425         All users changed.
16427         * ccl.c (Fccl_execute_on_string): Declare some variables
16428         EMACS_INT.
16430 2011-04-08  Samuel Thibault  <sthibault@debian.org>  (tiny change)
16432         * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16434 2011-03-19  Christoph Scholtes  <cschol2112@googlemail.com>
16436         * process.c (Fformat_network_address): Doc fix.
16438 2011-04-08  T.V. Raman  <tv.raman.tv@gmail.com>  (tiny change)
16440         * xml.c (parse_region): Avoid creating spurious whitespace nodes.
16442 2011-04-08  Chong Yidong  <cyd@stupidchicken.com>
16444         * keyboard.c (read_char): Call Lisp function help-form-show,
16445         instead of using internal_with_output_to_temp_buffer.
16446         (Qhelp_form_show): New var.
16447         (syms_of_keyboard): Use DEFSYM macro.
16449         * print.c (internal_with_output_to_temp_buffer): Function deleted.
16451         * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16453 2011-04-06  Chong Yidong  <cyd@stupidchicken.com>
16455         * process.c (Flist_processes): Remove to Lisp.
16456         (list_processes_1): Delete.
16458 2011-04-06  Eli Zaretskii  <eliz@gnu.org>
16460         * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16462         * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16464 2011-04-06  Paul Eggert  <eggert@cs.ucla.edu>
16466         Fix more problems found by GCC 4.6.0's static checks.
16468         * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16470         * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16472         * lisp.h (message, message_nolog, fatal): Mark as printf-like.
16474         * xdisp.c (vmessage): Mark as a printf-like function.
16476         * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16478         * sound.c (sound_warning): Don't crash if arg contains a printf format.
16480         * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16481         printf-like functions.
16482         (tiff_load): Add casts to remove these marks before passing them
16483         to system-supplied API.
16485         * eval.c (Fsignal): Remove excess argument to 'fatal'.
16487         * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16488         This avoids several warnings with gcc -Wstrict-overflow.
16489         (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16490         directly, rather than having caller test rule sign.  This avoids
16491         some unnecessary tests.
16492         * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16493         (COMPOSITION_ENCODE_RULE): Arguments now must be valid.  This
16494         affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
16496         * xfont.c (xfont_text_extents): Remove var that was set but not used.
16497         (xfont_open): Avoid unnecessary tests.
16499         * composite.c (composition_gstring_put_cache): Use unsigned integer.
16501         * composite.h, composite.c (composition_gstring_put_cache):
16502         Use EMACS_INT, not int, for length.
16504         * composite.h (COMPOSITION_DECODE_REFS): New macro,
16505         breaking out part of COMPOSITION_DECODE_RULE.
16506         (COMPOSITION_DECODE_RULE): Use it.
16507         * composite.c (get_composition_id): Remove unused local vars,
16508         by using the new macro.
16510         * textprop.c (set_text_properties_1): Change while to do-while,
16511         since the condition is always true at first.
16513         * intervals.c (graft_intervals_into_buffer): Mark var as used.
16514         (interval_deletion_adjustment): Return unsigned value.
16515         All uses changed.
16517         * process.c (list_processes_1, create_pty, read_process_output):
16518         (exec_sentinel): Remove vars that were set but not used.
16519         (create_pty): Remove unnecessary "volatile"s.
16520         (Fnetwork_interface_info): Avoid possibility of int overflow.
16521         (read_process_output): Do adaptive read buffering even if carryover.
16522         (read_process_output): Simplify nbytes computation if buffered.
16524         * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16526         * syntax.c (scan_words): Remove var that was set but not used.
16527         (update_syntax_table): Use unsigned instead of int.
16529         * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
16530         (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
16531         (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
16533         * print.c (print_error_message): Avoid int overflow.
16535         * font.c (font_list_entities): Redo for clarity,
16536         so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16538         * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
16539         (font_score): Avoid potential overflow in diff calculation.
16541         * fns.c (substring_both): Remove var that is set but not used.
16542         (sxhash): Redo loop for clarity and to avoid wraparound warning.
16544         * eval.c (funcall_lambda): Rename local to avoid shadowing.
16546         * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16547         Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16548         can always succeed if overflow has undefined behavior.
16550         * search.c (boyer_moore, wordify): Remove vars set but not used.
16551         (wordify): Omit three unnecessary tests.
16553         * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16554         All callers changed.  This avoids the need for an unused var.
16556         * casefiddle.c (casify_region): Remove var that is set but not used.
16558         * dired.c (file_name_completion): Remove var that is set but not used.
16560         * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16562         * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
16563         (Finsert_file_contents): Remove unnecessary code checking fd.
16565         * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16566         Check for integer overflow on size calculations.
16568         * buffer.c (Fprevious_overlay_change): Remove var that is set
16569         but not used.
16571         * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16572         Remove vars that are set but not used.
16573         (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
16574         (timer_check_2): Mark vars as initialized.
16576         * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16578         * image.c (lookup_image): Remove var that is set but not used.
16579         (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
16581         * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16582         that are set but not used.
16584         * xfns.c (make_invisible_cursor): Don't return garbage
16585         if XCreateBitmapFromData fails (Bug#8410).
16587         * xselect.c (x_get_local_selection, x_handle_property_notify):
16588         Remove vars that are set but not used.
16590         * xfns.c (x_create_tip_frame): Remove var that is set but not used.
16591         (make_invisible_cursor): Initialize a possibly-uninitialized variable.
16593         * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16594         Remove var that is set but not used.
16595         (scroll_bar_windows_size): Now size_t, not int.
16596         (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16597         Check for overflow.
16599         * xfaces.c (realize_named_face): Remove vars that are set but not used.
16600         (map_tty_color) [!defined MSDOS]: Likewise.
16602         * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16604         * coding.c: Remove vars that are set but not used.
16605         (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16606         All callers changed.
16607         (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16608         (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16609         (decode_coding_charset): Remove vars that are set but not used.
16611         * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16612         that is set but not used.
16614         * print.c (print_object): Remove var that is set but not used.
16616         Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
16617         The gnulib version avoids calling malloc in the usual case,
16618         and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16619         * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16620         * filelock.c (current_lock_owner): Likewise.
16621         * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16622         * sysdep.c: Include allocator.h, careadlinkat.h.
16623         (emacs_no_realloc_allocator): New static constant.
16624         (emacs_readlink): New function.
16625         * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16626         ../lib/careadlinkat.h.
16628 2011-04-04  Stefan Monnier  <monnier@iro.umontreal.ca>
16630         * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16631         first non-nil return value).
16633 2011-04-03  Jan Djärv  <jan.h.d@swipnet.se>
16635         * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
16636         if not defined (Bug#8403).
16638 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
16640         * xdisp.c (display_count_lines): Remove parameter `start',
16641         unused since revno:20537 (1998-01-01).  All callers changed.
16642         (get_char_face_and_encoding): Remove parameter `multibyte_p',
16643         unused since revno:87605 (2008-05-14).  All callers changed.
16644         (fill_stretch_glyph_string): Remove parameters `row' and `area',
16645         unused at least since Kim's GUI unification at revno:50135 (2003-03-16)
16646         and thereabouts.  All callers changed.
16647         (get_per_char_metric): Remove parameter `f', unused since
16648         revno:87605 (2008-05-14).  All callers changed.
16650 2011-04-02  Jim Meyering  <meyering@redhat.com>
16652         do not dereference NULL upon failed strdup
16653         * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
16654         (ns_get_family): Likewise.
16656 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
16658         * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
16660 2011-04-02  Jan Djärv  <jan.h.d@swipnet.se>
16662         * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
16663         later (Bug#8403).
16665 2011-04-01  Stefan Monnier  <monnier@iro.umontreal.ca>
16667         Add lexical binding.
16669         * window.c (Ftemp_output_buffer_show): New fun.
16670         (Fsave_window_excursion):
16671         * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16673         * lread.c (lisp_file_lexically_bound_p): New function.
16674         (Fload): Bind Qlexical_binding.
16675         (readevalloop): Remove `evalfun' arg.
16676         Bind Qinternal_interpreter_environment.
16677         (Feval_buffer): Bind Qlexical_binding.
16678         (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16679         Mark as dynamic.
16680         (syms_of_lread): Declare `lexical-binding'.
16682         * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16684         * keyboard.c (eval_dyn): New fun.
16685         (menu_item_eval_property): Use it.
16687         * image.c (parse_image_spec): Use Ffunctionp.
16689         * fns.c (concat, mapcar1): Accept byte-code-functions.
16691         * eval.c (Fsetq): Handle lexical vars.
16692         (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16693         (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16694         (FletX, Flet): Obey lexical binding.
16695         (Fcommandp): Handle closures.
16696         (Feval): New `lexical' arg.
16697         (eval_sub): New function extracted from Feval.  Use it almost
16698         everywhere where Feval was used.  Look up vars in lexical env.
16699         Handle closures.
16700         (Ffunctionp): Move from subr.el.
16701         (Ffuncall): Handle closures.
16702         (apply_lambda): Remove `eval_flags'.
16703         (funcall_lambda): Handle closures and new byte-code-functions.
16704         (Fspecial_variable_p): New function.
16705         (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16706         but without exporting it to Lisp.
16708         * doc.c (Fdocumentation, store_function_docstring):
16709         * data.c (Finteractive_form): Handle closures.
16711         * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16712         interactive spec.
16714         * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16715         New byte-codes.
16716         (exec_byte_code): New function extracted from Fbyte_code to handle new
16717         calling convention for byte-code-functions.  Add new byte-codes.
16719         * buffer.c (defvar_per_buffer): Set new `declared_special' field.
16721         * alloc.c (Fmake_symbol): Init new `declared_special' field.
16723 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
16725         * xdisp.c (redisplay_internal): Fix prototype.
16727 2011-03-31  Eli Zaretskii  <eliz@gnu.org>
16729         * xdisp.c (SCROLL_LIMIT): New macro.
16730         (try_scrolling): Use it when setting scroll_limit.
16731         Limit scrolling to 100 screen lines.
16732         (redisplay_window): Even when falling back on "recentering",
16733         position point in the window according to scroll-conservatively,
16734         scroll-margin, and scroll-*-aggressively variables.  (Bug#6671)
16736         (try_scrolling): When point is above the window, allow searching
16737         as far as scroll_max, or one screenful, to compute vertical
16738         distance from PT to the scroll margin position.  This prevents
16739         try_scrolling from unnecessarily failing when
16740         scroll-conservatively is set to a value slightly larger than the
16741         window height.  Clean up the case of PT below the margin at bottom
16742         of window: scroll_max can no longer be INT_MAX.  When aggressive
16743         scrolling is in use, don't let point enter the opposite scroll
16744         margin as result of the scroll.
16745         (syms_of_xdisp) <scroll-conservatively>: Document the
16746         threshold of 100 lines for never-recentering scrolling.
16748 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
16750         * dispextern.h (move_it_by_lines):
16751         * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
16752         since revno:34925 (2000-12-29).  All callers changed.
16753         (message_log_check_duplicate): Remove parameters `prev_bol' and
16754         `this_bol', unused since revno:20537 (1998-01-01).  All callers changed.
16755         (redisplay_internal): Remove parameter `preserve_echo_area',
16756         unused since revno:25013 (1999-07-21).  All callers changed.
16758         * indent.c (Fvertical_motion):
16759         * window.c (window_scroll_pixel_based, Frecenter):
16760         Don't pass `need_y_p' to `move_it_by_lines'.
16762 2011-03-30  Stefan Monnier  <monnier@iro.umontreal.ca>
16764         * eval.c (struct backtrace): Don't cheat with negative numbers, but do
16765         steal a few bits to be more compact.
16766         (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
16767         Remove unneeded casts.
16769         * bytecode.c (Fbyte_code): CAR and CDR can GC.
16771 2011-03-30  Zachary Kanfer  <zkanfer@gmail.com>  (tiny change)
16773         * keyboard.c (Fexecute_extended_command): Do log the "suggest key
16774         binding" message (bug#7967).
16776 2011-03-30  Paul Eggert  <eggert@cs.ucla.edu>
16778         Fix more problems found by GCC 4.6.0's static checks.
16780         * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
16781         Remove unused local var.
16783         * editfns.c (Fmessage_box): Remove unused local var.
16785         * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
16786         (note_mode_line_or_margin_highlight, note_mouse_highlight):
16787         Omit unused local vars.
16788         * window.c (shrink_windows): Omit unused local var.
16789         * menu.c (digest_single_submenu): Omit unused local var.
16790         * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16791         Omit unused local var.
16793         * keyboard.c (parse_modifiers_uncached, parse_modifiers):
16794         Don't assume string length fits in int.
16795         (keyremap_step, read_key_sequence): Use size_t for sizes.
16796         (read_key_sequence): Don't check last_real_key_start redundantly.
16798         * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
16799         instead of alloca (Bug#8344).
16801         * eval.c (Fbacktrace): Don't assume nargs fits in int.
16802         (Fbacktrace_frame): Don't assume nframes fits in int.
16804         * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
16806         * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
16807         concerns.
16809         * term.c (produce_glyphless_glyph): Remove unnecessary test.
16811         * cm.c (calccost): Turn while-do into do-while, for clarity.
16813         * keyboard.c (syms_of_keyboard): Use the same style as later
16814         in this function when indexing through an array.  This also
16815         works around GCC bug 48267.
16817         * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
16819         * xselect.c (x_check_property_data): Return correct size (Bug#8335).
16821         * chartab.c (sub_char_table_ref_and_range): Redo for slight
16822         efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
16824         * keyboard.c, keyboard.h (num_input_events): Now size_t.
16825         This avoids undefined behavior on integer overflow, and is a bit
16826         more convenient anyway since it is compared to a size_t variable.
16828         Variadic C functions now count arguments with size_t, not int.
16829         This avoids an unnecessary limitation on 64-bit machines, which
16830         caused (substring ...) to crash on large vectors (Bug#8344).
16831         * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
16832         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
16833         All variadic functions and their callers changed accordingly.
16834         (struct gcpro.nvars): Now size_t, not int.  All uses changed.
16835         * data.c (arith_driver, float_arith_driver): Likewise.
16836         * editfns.c (general_insert_function): Likewise.
16837         * eval.c (struct backtrace.nargs, interactive_p)
16838         (internal_condition_case_n, run_hook_with_args, apply_lambda)
16839         (funcall_lambda, mark_backtrace): Likewise.
16840         * fns.c (concat): Likewise.
16841         * frame.c (x_set_frame_parameters): Likewise.
16842         * fns.c (get_key_arg): Now accepts and returns size_t, and returns
16843         0 if not found, not -1.  All callers changed.
16845         * alloc.c (garbage_collect): Don't assume stack size fits in int.
16846         (stack_copy_size): Now size_t, not int.
16847         (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
16849 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
16851         * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
16852         unused since revno:43563.1.17 (2002-03-01) and revno:84043 (2008-02-1).
16853         All callers changed.
16855         * lisp.h (multibyte_char_to_unibyte):
16856         * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
16857         unused since revno:43563.1.16 (2002-03-01) and revno:84043 (2008-02-1).
16858         * character.h (CHAR_TO_BYTE8):
16859         * cmds.c (internal_self_insert):
16860         * editfns.c (general_insert_function):
16861         * keymap.c (push_key_description):
16862         * search.c (Freplace_match):
16863         * xdisp.c (message_dolog, set_message_1): All callers changed.
16865 2011-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
16867         * keyboard.c (safe_run_hook_funcall): New function.
16868         (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
16869         don't set the hook to nil, but remove the offending function instead.
16870         (Qcommand_hook_internal): Remove, unused.
16871         (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
16872         Vcommand_hook_internal.
16874         * eval.c (enum run_hooks_condition): Remove.
16875         (funcall_nil, funcall_not): New functions.
16876         (run_hook_with_args): Call each function through a `funcall' argument.
16877         Remove `cond' argument, now redundant.
16878         (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
16879         (Frun_hook_with_args_until_failure): Adjust accordingly.
16880         (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
16882 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
16884         * dispextern.h (string_buffer_position): Remove declaration.
16886         * print.c (strout): Remove parameter `multibyte', unused since
16887         revno:25356 (1999-08-21).  All callers changed.
16889         * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
16890         never used since function introduction in revno:20870 (1998-02-08).
16891         All callers changed.
16893         * w32.c (_wsa_errlist): Use braces for struct initializers.
16895         * xdisp.c (string_buffer_position_lim): Remove parameter `w',
16896         never used since function introduction in revno:36704 (2001-03-09).
16897         All callers changed.
16898         (string_buffer_position): Likewise.  Also, make static (it's never
16899         used outside xdisp.c).
16900         (cursor_row_p): Remove parameter `w', unused since
16901         revno:32591 (2000-10-17).  All callers changed.
16902         (decode_mode_spec): Remove parameter `precision', introduced during
16903         Gerd Moellmann's rewrite at revno:25013 (1999-07-21), but never used.
16904         All callers changed.
16906 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
16908         * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
16910 2011-03-27  Anders Lindgren  <andlind@gmail.com>
16912         * nsterm.m (ns_menu_bar_is_hidden): New variable.
16913         (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
16914         (ns_update_auto_hide_menu_bar): New functions.
16915         (ns_update_begin): Call ns_update_auto_hide_menu_bar.
16916         (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
16917         ns_constrain_all_frames.
16918         (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
16919         (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
16921 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
16923         * nsmenu.m (runDialogAt): Remove argument to timer_check.
16925 2011-03-27  Glenn Morris  <rgm@gnu.org>
16927         * syssignal.h: Replace RETSIGTYPE with void.
16928         * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
16929         * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
16930         Replace SIGTYPE with void everywhere.
16931         * s/usg5-4-common.h (SIGTYPE): Remove definition.
16932         * s/template.h (SIGTYPE): Remove commented out definition.
16934 2011-03-26  Eli Zaretskii  <eliz@gnu.org>
16936         * xdisp.c (redisplay_window): Don't check buffer's clip_changed
16937         flag as a prerequisite for invoking try_scrolling.  (Bug#6671)
16939 2011-03-26  Juanma Barranquero  <lekktu@gmail.com>
16941         * w32.c (read_unc_volume): Use parameter `henum', instead of
16942         global variable `wget_enum_handle'.
16944         * keymap.c (describe_vector): Remove parameters `indices' and
16945         `char_table_depth', unused since revno:43563.1.32 (2002-03-01).
16946         (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
16948         * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
16950         * keyboard.c (timer_check): Remove parameter `do_it_now',
16951         unused since revno:14998 (1996-04-12).
16952         (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
16953         unused since revno:86854 (2008-04-19).
16955         * keyboard.c (read_char):
16956         * w32menu.c (w32_menu_display_help):
16957         * xmenu.c (show_help_event, menu_help_callback):
16958         Adjust calls to `show_help_echo'.
16960         * gtkutil.c (xg_maybe_add_timer):
16961         * keyboard.c (readable_events):
16962         * process.c (wait_reading_process_output):
16963         * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
16965         * insdel.c (adjust_markers_gap_motion):
16966         Remove; no-op since revno:20569 (1998-01-02).
16967         (gap_left, gap_right): Don't call it.
16969 2011-03-25  Chong Yidong  <cyd@stupidchicken.com>
16971         * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
16972         incurred during fontification.
16974 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
16976         * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
16977         (DEFVAR_PER_BUFFER): Don't pass it.
16979         * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
16980         (scrolling_window): Don't pass it.
16982 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
16984         * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
16986         * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
16987         and `suffix'.
16988         (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
16989         of variables specific to SELinux and computation of `encoded_absname'.
16991         * image.c (XPutPixel): Remove unused variable `height'.
16993         * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
16995         * unexw32.c (get_section_info): Remove unused variable `section'.
16997         * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
16998         (system_process_attributes): Remove unused variable `sess'.
16999         (sys_read): Remove unused variable `err'.
17001         * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17002         (w32_wnd_proc): Remove unused variable `isdead'.
17003         (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17004         (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17005         (x_create_tip_frame): Remove unused variable `tem'.
17007         * w32inevt.c (w32_console_read_socket):
17008         Remove unused variable `no_events'.
17010         * w32term.c (x_draw_composite_glyph_string_foreground):
17011         Remove unused variable `width'.
17013 2011-03-24  Juanma Barranquero  <lekktu@gmail.com>
17015         * w32term.c (x_set_glyph_string_clipping):
17016         Don't pass uninitialized region to CombineRgn.
17018 2011-03-23  Juanma Barranquero  <lekktu@gmail.com>
17020         * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17021         (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17022         (Fx_close_connection): Remove unused variable `i'.
17024         * w32font.c (w32font_draw): Return number of glyphs.
17025         (w32font_open_internal): Remove unused variable `i'.
17026         (w32font_driver): Add missing initializer.
17028         * w32menu.c (utf8to16): Remove unused variable `utf16'.
17029         (fill_in_menu): Remove unused variable `items_added'.
17031         * w32term.c (last_mouse_press_frame): Remove static global variable.
17032         (w32_clip_to_row): Remove unused variable `f'.
17033         (x_delete_terminal): Remove unused variable `i'.
17035         * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17036         (NOTHING): Remove unused static global variable.
17037         (uniscribe_check_otf): Remove unused variable `table'.
17038         (uniscribe_font_driver): Add missing initializers.
17040 2011-03-23  Julien Danjou  <julien@danjou.info>
17042         * term.c (Fsuspend_tty, Fresume_tty):
17043         * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17044         * window.c (temp_output_buffer_show):
17045         * insdel.c (signal_before_change):
17046         * frame.c (Fhandle_switch_frame):
17047         * fileio.c (Fdo_auto_save):
17048         * emacs.c (Fkill_emacs):
17049         * editfns.c (save_excursion_restore):
17050         * cmds.c (internal_self_insert):
17051         * callint.c (Fcall_interactively):
17052         * buffer.c (Fkill_all_local_variables):
17053         * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17054         Use Frun_hooks.
17055         (command_loop_1): Use Frun_hooks.  Call safe_run_hooks
17056         unconditionally since it does the check itself.
17058 2011-03-23  Paul Eggert  <eggert@cs.ucla.edu>
17060         Fix more problems found by GCC 4.5.2's static checks.
17062         * coding.c (encode_coding_raw_text): Avoid unnecessary test
17063         the first time through the loop, since we know p0 < p1 then.
17064         This also avoids a gcc -Wstrict-overflow warning.
17066         * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17067         leading to a memory leak, possible in functions like
17068         load_charset_map_from_file that can allocate an unbounded number
17069         of objects (Bug#8318).
17071         * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17072         that could (at least in theory) be that large.
17074         * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17075         This is less likely to overflow, and avoids undefined behavior if
17076         overflow does occur.  All callers changed.  Use strtoul to scan
17077         for the unsigned long integer.
17078         (pint2hrstr): Simplify and tune code slightly.
17079         This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
17081         * scroll.c (do_scrolling): Work around GCC bug 48228.
17082         See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17084         * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17085         This also avoids a warning with gcc -Wstrict-overflow.
17086         (validate_x_resource_name): Simplify count usage.
17087         This also avoids a warning with gcc -Wstrict-overflow.
17089         * fileio.c (Fcopy_file): Report error if fchown or fchmod
17090         fail (Bug#8306).
17092         * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
17094         * process.c (Fmake_network_process): Use socklen_t, not int,
17095         where POSIX says socklen_t is required in portable programs.
17096         This fixes a porting bug on hosts like 64-bit HP-UX, where
17097         socklen_t is wider than int (Bug#8277).
17098         (Fmake_network_process, server_accept_connection):
17099         (wait_reading_process_output, read_process_output):
17100         Likewise.
17102         * process.c: Rename or move locals to avoid shadowing.
17103         (list_processes_1, Fmake_network_process):
17104         (read_process_output_error_handler, exec_sentinel_error_handler):
17105         Rename or move locals.
17106         (Fmake_network_process): Define label "retry_connect" only if needed.
17107         (Fnetwork_interface_info): Fix pointer signedness.
17108         (process_send_signal): Add cast to avoid pointer signedness problem.
17109         (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
17110         (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
17112         Make tparam.h and terminfo.c consistent.
17113         * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17114         Include tparam.h instead, since it declares them.
17115         * cm.h (PC): Remove extern decl; tparam.h now does this.
17116         * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17117         * terminfo.c: Include tparam.h, to check interfaces.
17118         (tparm): Make 1st arg a const pointer in decl.  Put it at top level.
17119         (tparam): Adjust signature to match interface in tparam.h;
17120         this removes some undefined behavior.  Check that outstring and len
17121         are zero, which they always are with Emacs.
17122         * tparam.h (PC, BC, UP): New extern decls.
17124         * xftfont.c (xftfont_shape): Now static, and defined only if needed.
17125         (xftfont_open): Rename locals to avoid shadowing.
17127         * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
17128         (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17129         (OTF_TAG_SYM): Omit macro if not needed.
17130         (ftfont_list): Remove unused local.
17131         (get_adstyle_property, ftfont_pattern_entity):
17132         (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17133         Rename locals to avoid shadowing.
17135         * xfont.c (xfont_list_family): Mark var as initialized.
17137         * xml.c (make_dom): Now static.
17139         * composite.c (composition_compute_stop_pos): Rename local to
17140         avoid shadowing.
17141         (composition_reseat_it): Remove unused locals.
17142         (find_automatic_composition, composition_adjust_point): Likewise.
17143         (composition_update_it): Mark var as initialized.
17144         (find_automatic_composition): Mark vars as initialized,
17145         with a FIXME (Bug#8290).
17147         character.h: Rename locals to avoid shadowing.
17148         * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17149         (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17150         (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17151         (BUF_DEC_POS): Be more systematic about renaming local temporaries
17152         to avoid shadowing.
17154         * textprop.c (property_change_between_p): Remove; unused.
17156         * intervals.c (interval_start_pos): Now static.
17158         * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17160         * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17161         Rename locals to avoid shadowing.
17163         * sound.c (wav_play, au_play, Fplay_sound_internal):
17164         Fix pointer signedness.
17165         (alsa_choose_format): Remove unused local var.
17166         (wav_play): Initialize a variable to 0, to prevent undefined
17167         behavior (Bug#8278).
17169         * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17171         * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17173         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17174         clobbering (Bug#8298).
17175         * sysdep.c (sys_subshell): Likewise.
17176         Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
17178         * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17179         This should get cleaned up, so that child_setup has the
17180         same signature on all platforms.
17182         * callproc.c (call_process_cleanup): Now static.
17183         (relocate_fd): Rename locals to avoid shadowing.
17185 2011-03-22  Chong Yidong  <cyd@stupidchicken.com>
17187         * xterm.c (x_clear_frame): Remove XClearWindow call.  This appears
17188         not to be necessary, and produces flickering.
17190 2011-03-20  Glenn Morris  <rgm@gnu.org>
17192         * config.in: Remove file.
17194 2011-03-20  Juanma Barranquero  <lekktu@gmail.com>
17196         * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17197         are now in src/globals.h.
17198         (syms_of_minibuf): Remove spurious & from previous change.
17200 2011-03-20  Leo Liu  <sdl.web@gmail.com>
17202         * minibuf.c (completing-read-function): New variable.
17203         (completing-read-default): Rename from completing-read.
17204         (completing-read): Call completing-read-function.
17206 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
17208         * xfaces.c (Fx_load_color_file):
17209         Read color file from absolute filename (bug#8250).
17211 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
17213         * makefile.w32-in: Update dependencies.
17215 2011-03-17  Eli Zaretskii  <eliz@gnu.org>
17217         * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17219 2011-03-17  Paul Eggert  <eggert@cs.ucla.edu>
17221         Fix more problems found by GCC 4.5.2's static checks.
17223         * process.c (make_serial_process_unwind, send_process_trap):
17224         (sigchld_handler): Now static.
17226         * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17227         That way, the code declares only the vars that it needs.
17228         * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17229         * s/cygwin.h (PTY_ITERATION): Likewise.
17230         * s/darwin.h (PTY_ITERATION): Likewise.
17231         * s/gnu-linux.h (PTY_ITERATION): Likewise.
17233         * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17234         * process.c (allocate_pty): Don't declare stb unless it's needed.
17236         * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
17237         (CONSTANTLIM): Remove; unused.
17238         (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17239         Define only if needed.
17241         * unexelf.c (unexec): Name an expression,
17242         to avoid gcc -Wbad-function-cast warning.
17243         Use a different way to cause a compilation error if anyone uses
17244         n rather than nn, a way that does not involve shadowing.
17245         (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
17247         * deps.mk (unexalpha.o): Remove; unused.
17249         New file unexec.h, the (simple) interface for unexec (Bug#8267).
17250         * unexec.h: New file.
17251         * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17252         (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17253         Depend on unexec.h.
17254         * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17255         * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17256         * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
17257         Change as necessary to match prototype in unexec.h.
17259         * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17260         shadowing.
17261         (back_comment, skip_chars): Mark vars as initialized.
17263         * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17264         Rename locals to avoid shadowing.
17266         * lread.c (read1): Rewrite so as not to use empty "else".
17267         (Fload, readevalloop, read1): Rename locals to avoid shadowing.
17269         * print.c (Fredirect_debugging_output): Fix pointer signedess.
17271         * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17272         warning when compiling print.c.
17274         * font.c (font_unparse_fcname): Abort in an "impossible" situation
17275         instead of using an uninitialized var.
17276         (font_sort_entities): Mark var as initialized.
17278         * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17280         * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17281         pointers to constants.
17282         (font_parse_fcname): Remove unused vars.
17283         (font_delete_unmatched): Now static.
17284         (font_get_spec): Remove; unused.
17285         (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17286         (font_update_drivers, Ffont_get_glyphs, font_add_log):
17287         Rename or move locals to avoid shadowing.
17289         * fns.c (require_nesting_list, require_unwind): Now static.
17290         (Ffillarray): Rename locals to avoid shadowing.
17292         * floatfns.c (domain_error2): Define only if needed.
17293         (Ffrexp, Fldexp): Rename locals to avoid shadowing.
17295         * alloc.c (mark_backtrace): Move decl from here ...
17296         * lisp.h: ... to here, so that it can be checked.
17298         * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
17299         (Fdefvar): Rewrite so as not to use empty "else".
17300         (lisp_indirect_variable): Name an expression,
17301         to avoid gcc -Wbad-function-cast warning.
17302         (Fdefvar): Rename locals to avoid shadowing.
17304         * callint.c (quotify_arg, quotify_args): Now static.
17305         (Fcall_interactively): Rename locals to avoid shadowing.
17306         Use const pointer when appropriate.
17308         * lisp.h (get_system_name, get_operating_system_release):
17309         Move decls here, to check interfaces.
17310         * process.c (get_operating_system_release): Move decl to lisp.h.
17311         * xrdb.c (get_system_name): Likewise.
17312         * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17313         (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17314         some of which prompt warnings from gcc -Wbad-function-cast.
17315         (Fformat_time_string, Fencode_time, Finsert_char):
17316         (Ftranslate_region_internal, Fformat):
17317         Rename or remove local vars to avoid shadowing.
17318         (Ftranslate_region_internal): Mark var as initialized.
17320         * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17321         avoid shadowing.
17323         * lisp.h (eassert): Check that the argument compiles, even if
17324         ENABLE_CHECKING is not defined.
17326         * data.c (Findirect_variable): Name an expression, to avoid
17327         gcc -Wbad-function-cast warning.
17328         (default_value, arithcompare, arith_driver, arith_error): Now static.
17329         (store_symval_forwarding): Rename local to avoid shadowing.
17330         (Fmake_variable_buffer_local, Fmake_local_variable):
17331         Mark variables as initialized.
17332         (do_blv_forwarding, do_symval_forwarding): Remove; unused.
17334         * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
17335         (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17336         Rename locals to avoid shadowing.
17337         (mark_stack): Move local variables into the #ifdef region where
17338         they're used.
17339         (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17340         ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17341         needed otherwise.
17342         (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17343         (GC_STRING_CHARS): Remove; not used.
17344         (Fmemory_limit): Cast sbrk's returned value to char *.
17346         * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17347         avoids undefined behavior in theory.
17349         * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17351         Use functions, not macros, for up- and down-casing (Bug#8254).
17352         * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17353         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove.  All callers changed
17354         to use the following functions instead of these macros.
17355         (downcase): Adjust to lack of DOWNCASE_TABLE.  Return int, not
17356         EMACS_INT, since callers assume the returned value fits in int.
17357         (upcase1): Likewise, for UPCASE_TABLE.
17358         (uppercasep, lowercasep, upcase): New static inline functions.
17359         * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
17360         the race-condition problem in the old DOWNCASE.
17362         * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17363         Rename locals to avoid shadowing.
17364         (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
17365         (regex_compile, re_search_2, re_match_2_internal):
17366         Remove unused local vars.
17367         (FREE_VAR): Rewrite so as not to use empty "else",
17368         which gcc can warn about.
17369         (regex_compile, re_match_2_internal): Mark locals as initialized.
17370         (RETALLOC_IF): Define only if needed.
17371         (WORDCHAR_P): Likewise.  This one is never needed, but is used
17372         only in a comment talking about a compiler bug, so put inside
17373         the #if 0 of that comment.
17374         (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17375         (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17376         Remove; unused.
17378         * search.c (boyer_moore): Rename locals to avoid shadowing.
17379         * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17380         (PREV_CHAR_BOUNDARY): Likewise.
17382         * search.c (simple_search): Remove unused var.
17384         * dired.c (compile_pattern): Move decl from here ...
17385         * lisp.h: ... to here, so that it can be checked.
17386         (struct re_registers): New forward decl.
17388         * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17390         * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17391         All uses changed.
17392         (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17393         Rename locals to avoid shadowing.
17394         (Fvertical_motion): Mark locals as initialized.
17396         * casefiddle.c (casify_object, casify_region): Now static.
17397         (casify_region): Mark local as initialized.
17399         * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17401         * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17402         New macros, so that the caller can use some names other than
17403         gcpro1, gcpro2, etc.
17404         (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17405         of the new macros.
17406         (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17407         argument, for consistency with GCPRO2_VAR, etc: it is now the
17408         prefix of the variable, not the variable itself.  All uses
17409         changed.
17410         * dired.c (directory_files_internal, file_name_completion):
17411         Rename locals to avoid shadowing.
17413         Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17414         An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17415         dired.c's scmp function, had undefined behavior.
17416         * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17417         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17418         * buffer.h: ... to here, because these macros use current_buffer,
17419         and the new implementation with inline functions needs to have
17420         current_buffer in scope now, rather than later when the macros
17421         are used.
17422         (downcase, upcase1): New static inline functions.
17423         (DOWNCASE, UPCASE1): Reimplement using these functions.
17424         This avoids undefined behavior in expressions like
17425         DOWNCASE (x) == DOWNCASE (y), which previously suffered
17426         from race conditions in accessing the global variables
17427         case_temp1 and case_temp2.
17428         * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17429         * lisp.h (case_temp1, case_temp2): Remove their decls.
17430         * character.h (ASCII_CHAR_P): Move from here ...
17431         * lisp.h: ... to here, so that the inline functions mentioned
17432         above can use them.
17434         * dired.c (directory_files_internal_unwind): Now static.
17436         * fileio.c (file_name_as_directory, directory_file_name):
17437         (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17438         Now static.
17439         (file_name_as_directory): Use const pointers when appropriate.
17440         (Fexpand_file_name): Likewise.  In particular, newdir might
17441         point at constant storage, so make it a const pointer.
17442         (Fmake_directory_internal, Fread_file_name): Remove unused vars.
17443         (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17444         signedness issues.
17445         (Fset_file_times, Finsert_file_contents, auto_save_error):
17446         Rename locals to avoid shadowing.
17448         * minibuf.c (choose_minibuf_frame_1): Now static.
17449         (Ftry_completion, Fall_completions): Rename or remove locals
17450         to avoid shadowing.
17452         * marker.c (bytepos_to_charpos): Remove; unused.
17454         * lisp.h (verify_bytepos, count_markers): New decls,
17455         so that gcc does not warn that these functions aren't declared.
17457         * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17458         (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
17459         (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
17460         (copy_text): Remove unused local var.
17462         * filelock.c (within_one_second): Now static.
17463         (lock_file_1): Rename local to avoid shadowing.
17465         * buffer.c (fix_overlays_before): Mark locals as initialized.
17466         (fix_start_end_in_overlays): Likewise.  This function should be
17467         simplified by using pointers-to-pointers, but that's a different
17468         matter.
17469         (switch_to_buffer_1): Now static.
17470         (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17471         (report_overlay_modification): Rename locals to avoid shadowing.
17473         * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
17474         Fix pointer signedness issue.
17475         (sys_subshell): Mark local as volatile if checking for lint,
17476         to suppress a gcc -Wclobbered warning that does not seem to be right.
17477         (MAXPATHLEN): Define only if needed.
17479         * process.c (serial_open, serial_configure): Move decls from here ...
17480         * systty.h: ... to here, so that they can be checked.
17482         * fns.c (get_random, seed_random): Move extern decls from here ...
17483         * lisp.h: ... to here, so that they can be checked.
17485         * sysdep.c (reset_io): Now static.
17486         (wait_for_termination_signal): Remove; unused.
17488         * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17489         (copy_keymap_item, append_key, push_text_char_description):
17490         Now static.
17491         (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
17492         (DENSE_TABLE_SIZE): Remove; unused.
17493         (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17494         (describe_map_tree):
17495         Rename locals to avoid shadowing.
17497         * keyboard.c: Declare functions static if they are not used elsewhere.
17498         (echo_char, echo_dash, cmd_error, top_level_2):
17499         (poll_for_input, handle_async_input): Now static.
17500         (read_char, kbd_buffer_get_event, make_lispy_position):
17501         (make_lispy_event, make_lispy_movement, apply_modifiers):
17502         (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17503         (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17504         (Fread_key_sequence_vector): Rename locals to avoid shadowing.
17505         (read_key_sequence, read_char): Mark locals as initialized.
17506         (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
17508         * keyboard.h (make_ctrl_char): New decl.
17509         (mark_kboards): Move decl here ...
17510         * alloc.c (mark_kboards): ... from here.
17512         * lisp.h (force_auto_save_soon): New decl.
17514         * emacs.c (init_cmdargs): Rename local to avoid shadowing.
17515         (DEFINE_DUMMY_FUNCTION): New macro.
17516         (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17517         Use it.
17518         (main): Add casts to avoid warnings
17519         if GCC considers string literals to be constants.
17521         * lisp.h (fatal_error_signal): Add decl, since it's exported.
17523         * dbusbind.c: Pointer signedness fixes.
17524         (xd_signature, xd_append_arg, xd_initialize):
17525         (Fdbus_call_method, Fdbus_call_method_asynchronously):
17526         (Fdbus_method_return_internal, Fdbus_method_error_internal):
17527         (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17528         (Fdbus_register_signal): Use SSDATA when the context wants char *.
17530         * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17531         if GCC considers string literals to be constants.
17532         (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
17534 2011-03-16  Stefan Monnier  <monnier@iro.umontreal.ca>
17536         * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17537         (print_preprocess, print_object): New macro to fix last change.
17539         * print.c (print_preprocess): Don't forget font objects.
17541 2011-03-16  Juanma Barranquero  <lekktu@gmail.com>
17543         * emacs.c (USAGE3): Doc fixes.
17545 2011-03-15  Andreas Schwab  <schwab@linux-m68k.org>
17547         * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17548         structure.
17550 2011-03-14  Juanma Barranquero  <lekktu@gmail.com>
17552         * lisp.h (VWindow_system, Qfile_name_history):
17553         * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17554         * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17555         (w32_system_caret_x, w32_system_caret_y): Declare extern.
17557         * w32select.c: Don't #include "keyboard.h".
17558         (run_protected): Add extern declaration for waiting_for_input.
17560         * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17561         * w32console.c (detect_input_pending, read_input_pending)
17562         (encode_terminal_code):
17563         * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17564         (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17565         (w32_system_caret_y, Qfile_name_history):
17566         * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17567         * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17568         * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17569         (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17570         * w32proc.c (Qlocal, report_file_error):
17571         * w32term.c (Vwindow_system, updating_frame):
17572         * w32uniscribe.c (initialized, uniscribe_font_driver):
17573         Remove unneeded extern declarations.
17575 2011-03-14  Chong Yidong  <cyd@stupidchicken.com>
17577         * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
17579 2011-03-13  Chong Yidong  <cyd@stupidchicken.com>
17581         * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17582         (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17583         These macros can no longer be used for assignment.
17585         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17586         Assign struct members directly, instead of using BUF_BEGV etc.
17587         (record_buffer_markers, fetch_buffer_markers): New functions for
17588         recording and fetching special buffer markers.
17589         (set_buffer_internal_1, set_buffer_temp): Use them.
17591         * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17593         * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17595         * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17596         (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17598         * xdisp.c (hscroll_window_tree):
17599         (reconsider_clip_changes): Use PT instead of BUF_PT.
17601 2011-03-13  Eli Zaretskii  <eliz@gnu.org>
17603         * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17604         $(EMACS_ROOT)/lib/intprops.h.
17606 2011-03-13  Paul Eggert  <eggert@cs.ucla.edu>
17608         Fix more problems found by GCC 4.5.2's static checks.
17610         * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17611         to unsigned char * to avoid compiler diagnostic.
17612         (xg_free_frame_widgets): Make it clear that a local variable is
17613         needed only if USE_GTK_TOOLTIP.
17614         (gdk_window_get_screen): Make it clear that this macro is needed
17615         only if USE_GTK_TOOLTIP.
17616         (int_gtk_range_get_value): New function, which avoids a diagnostic
17617         from gcc -Wbad-function-cast.
17618         (xg_set_toolkit_scroll_bar_thumb): Use it.
17619         (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17620         diagnostic from gcc -Wbad-function-cast.
17621         (get_utf8_string, xg_get_file_with_chooser):
17622         Rename locals to avoid shadowing.
17623         (create_dialog): Move locals to avoid shadowing.
17625         * xgselect.c (xg_select): Remove unused var.
17627         * image.c (four_corners_best): Mark locals as initialized.
17628         (gif_load): Initialize transparent_p to zero (Bug#8238).
17629         Mark another local as initialized.
17630         (my_png_error, my_error_exit): Mark with NO_RETURN.
17632         * image.c (clear_image_cache): Now static.
17633         (DIM, HAVE_STDLIB_H_1): Remove unused macros.
17634         (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
17635         (x_edge_detection): Remove unnecessary cast that
17636         gcc -Wbad-function-cast diagnoses.
17637         (gif_load): Fix pointer signedness.
17638         (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
17639         (jpeg_load, gif_load): Rename locals to avoid shadowing.
17641 2011-03-12  Paul Eggert  <eggert@cs.ucla.edu>
17643         Improve quality of tests for time stamp overflow.
17644         For example, without this patch (encode-time 0 0 0 1 1
17645         1152921504606846976) returns the obviously-bogus value (-948597
17646         62170) on my RHEL 5.5 x86-64 host.  With the patch, it correctly
17647         reports time overflow.  See
17648         <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
17649         * deps.mk (editfns.o): Depend on ../lib/intprops.h.
17650         * editfns.c: Include limits.h and intprops.h.
17651         (TIME_T_MIN, TIME_T_MAX): New macros.
17652         (time_overflow): Move earlier, to before first use.
17653         (hi_time, lo_time): New functions, for an accurate test for
17654         out-of-range times.
17655         (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
17656         (Fget_internal_run_time): Don't assume time_t fits in int.
17657         (make_time): Use list2 instead of Fcons twice.
17658         (Fdecode_time): More accurate test for out-of-range times.
17659         (check_tm_member): New function.
17660         (Fencode_time): Use it, to test for out-of-range times.
17661         (lisp_time_argument): Don't rely on undefined left-shift and
17662         right-shift behavior when checking for time stamp overflow.
17664         * editfns.c (time_overflow): New function, refactoring common code.
17665         (Fformat_time_string, Fdecode_time, Fencode_time):
17666         (Fcurrent_time_string): Use it.
17668         Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17669         * dired.c (make_time): Move to ...
17670         * editfns.c (make_time): ... here.
17671         * systime.h: Note the move.
17673 2011-03-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
17675         * fringe.c (update_window_fringes): Remove unused variables.
17677         * unexmacosx.c (copy_data_segment): Also copy __got section.
17678         (Bug#8223)
17680 2011-03-12  Eli Zaretskii  <eliz@gnu.org>
17682         * termcap.c [MSDOS]: Include "msdos.h".
17683         (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17684         Constify `char *' arguments and their references according to
17685         prototypes in tparam.h.
17687         * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
17689         * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17690         Adapt all references accordingly.
17692         * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17694 2011-03-11  Tom Tromey  <tromey@redhat.com>
17696         * buffer.c (syms_of_buffer): Remove obsolete comment.
17698 2011-03-11  Eli Zaretskii  <eliz@gnu.org>
17700         * termhooks.h (encode_terminal_code): Declare prototype.
17702         * msdos.c (encode_terminal_code): Don't declare prototype.
17704         * term.c (encode_terminal_code): Now external again, used by
17705         w32console.c and msdos.c.
17707         * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17708         Depend on $(SRC)/tparam.h, see revno 103623.
17710 2011-03-11  Paul Eggert  <eggert@cs.ucla.edu>
17712         Fix some minor problems found by GCC 4.5.2's static checks.
17714         * fringe.c (update_window_fringes): Mark locals as initialized
17715         (Bug#8227).
17716         (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
17718         * alloc.c (mark_fringe_data): Move decl from here ...
17719         * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17720         to check its interface.
17721         (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17723         * fontset.c (free_realized_fontset): Now static.
17724         (Fset_fontset_font): Rename local to avoid shadowing.
17725         (fontset_font): Mark local as initialized.
17726         (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
17728         * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17730         * xselect.c (x_disown_buffer_selections): Remove; not used.
17731         (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
17732         (x_own_selection, Fx_disown_selection_internal): Rename locals
17733         to avoid shadowing.
17734         (x_handle_dnd_message): Remove local to avoid shadowing.
17736         * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17737         so that the caller can use some name other than gcpro1.
17738         (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
17739         * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17740         (Fx_backspace_delete_keys_p):
17741         Use them to avoid shadowing, and rename vars to avoid shadowing.
17742         (x_decode_color, x_set_name, x_window): Now static.
17743         (Fx_create_frame): Add braces to silence GCC warning.
17744         (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
17745         (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
17746         Remove unused locals.
17747         (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17748         (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
17749         Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
17750         macros.
17752         * xterm.h (x_mouse_leave): New decl.
17754         * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
17755         Remove unused functions.
17756         (x_shift_glyphs_for_insert, XTflash, XTring_bell):
17757         (x_calc_absolute_position): Now static.
17758         (XTread_socket): Don't define label "out" unless it's used.
17759         Don't declare local "event" unless it's used.
17760         (x_iconify_frame, x_free_frame_resources): Don't declare locals
17761         unless they are used.
17762         (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
17763         (x_fatal_error_signal): Remove; not used.
17764         (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
17765         (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
17766         (x_error_catcher, x_connection_closed, x_error_handler):
17767         (x_error_quitter, xembed_send_message, x_iconify_frame):
17768         (my_log_handler): Rename locals to avoid shadowing.
17769         (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
17770         (x_connection_closed): Tell GCC not to suggest NO_RETURN.
17772         * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
17773         Rename or move locals to avoid shadowing.
17774         (tty_defined_color, merge_face_heights): Now static.
17775         (free_realized_faces_for_fontset): Remove; not used.
17776         (Fx_list_fonts): Mark variable that gcc -Wuninitialized
17777         does not deduce is never used uninitialized.
17778         (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
17779         (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
17781         * terminal.c (store_terminal_param): Now static.
17783         * xmenu.c (menu_highlight_callback): Now static.
17784         (set_frame_menubar): Remove unused local.
17785         (xmenu_show): Rename parameter to avoid shadowing.
17786         (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
17787         since they might point to immutable storage.
17788         (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
17789         since it's unused otherwise.
17791         * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
17792         Add a FIXME, since the code still doesn't look right.  (Bug#8215)
17793         (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
17794         avoids a gcc -Wuninitialized diagnostic.
17795         (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
17796         (note_mouse_highlight): Mark variables that gcc -Wuninitialized
17797         does not deduce are never used uninitialized.
17799         * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
17801         * xdisp.c (redisplay_window): Rename local to avoid shadowing.
17802         * window.c (window_loop, size_window):
17803         (run_window_configuration_change_hook, enlarge_window): Likewise.
17805         * window.c (display_buffer): Now static.
17806         (size_window): Mark variables that gcc -Wuninitialized
17807         does not deduce are never used uninitialized.
17808         * window.h (check_all_windows): New decl, to forestall
17809         gcc -Wmissing-prototypes diagnostic.
17810         * dispextern.h (bidi_dump_cached_states): Likewise.
17812         * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
17813         shadowing.
17814         * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
17815         Include <limits.h>.
17816         (Fsort_charsets): Redo min/max calculation to shorten the code a bit
17817         and to avoid gcc -Wuninitialized warning.
17818         (load_charset_map): Mark variables that gcc -Wuninitialized
17819         does not deduce are never used uninitialized.
17820         (load_charset): Abort instead of using uninitialized var (Bug#8229).
17822         * coding.c (coding_set_source, coding_set_destination):
17823         Use "else { /* comment */ }" rather than "else /* comment */;"
17824         for clarity, and to avoid gcc -Wempty-body warning.
17825         (Fdefine_coding_system_internal): Don't redeclare 'i' inside
17826         a block, when the outer 'i' will do.
17827         (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
17828         (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
17829         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
17830         (decode_coding_raw_text, decode_coding_charset, get_translation_table):
17831         (Fdecode_sjis_char, Fdefine_coding_system_internal):
17832         Rename locals to avoid shadowing.
17833         * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
17834         * coding.c (emacs_mule_char, encode_invocation_designation):
17835         Now static, since they're not used elsewhere.
17836         (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
17837         (decode_coding_object, encode_coding_object, detect_coding_system):
17838         (decode_coding_emacs_mule): Mark variables that gcc
17839         -Wuninitialized does not deduce are never used uninitialized.
17840         (detect_coding_iso_2022): Initialize a local variable that might
17841         be used uninitialized.  Leave a FIXME because it's not clear that
17842         this initialization is needed.  (Bug#8211)
17843         (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
17844         (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
17845         (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
17846         (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
17847         Remove unused macros.
17849         * category.c (hash_get_category_set): Remove unused local var.
17850         (copy_category_table): Now static, since it's not used elsewhere.
17851         * character.c (string_count_byte8): Likewise.
17853         * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
17854         (Fregister_code_conversion_map): Rename locals to avoid shadowing.
17856         * chartab.c (copy_sub_char_table): Now static, since it's not used
17857         elsewhere.
17858         (sub_char_table_ref_and_range, char_table_ref_and_range):
17859         Rename locals to avoid shadowing.
17860         (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
17862         * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
17863         (BIDI_BOB): Remove unused macro.
17865         * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
17866         deduce are never used uninitialized.
17867         * term.c (encode_terminal_code): Likewise.
17869         * term.c (encode_terminal_code): Now static.  Remove unused local.
17871         * tparam.h: New file.
17872         * term.c, tparam.h: Include it.
17873         * deps.mk (term.o, tparam.o): Depend on tparam.h.
17874         * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
17875         Move these decls to tparam.h, and make them agree with what
17876         is actually in tparam.c.  The previous trick of using incompatible
17877         decls in different modules does not conform to the C standard.
17878         All callers of tparam changed to use tparam's actual API.
17879         * tparam.c (tparam1, tparam, tgoto):
17880         Use const pointers where appropriate.
17882         * cm.c (calccost, cmgoto): Use const pointers where appropriate.
17883         * cm.h (struct cm): Likewise.
17884         * dispextern.h (do_line_insertion_deletion_costs): Likewise.
17885         * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
17886         * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
17887         (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
17888         (turn_on_face, init_tty): Likewise.
17889         * termchar.h (struct tty_display_info): Likewise.
17891         * term.c (term_mouse_position): Rename local to avoid shadowing.
17893         * alloc.c (mark_ttys): Move decl from here ...
17894         * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
17896 2011-03-11  Andreas Schwab  <schwab@linux-m68k.org>
17898         * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
17900 2011-03-09  Juanma Barranquero  <lekktu@gmail.com>
17902         * search.c (compile_pattern_1): Remove argument regp, unused since
17903         revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
17904         (compile_pattern): Don't pass it.
17906 2011-03-08  Jan Djärv  <jan.h.d@swipnet.se>
17908         * xterm.h (DEFAULT_GDK_DISPLAY): New define.
17909         (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
17910         for ! HAVE_GTK3.
17911         (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
17913         * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
17915         * gtkutil.c: Include gtkx.h if HAVE_GTK3.  If ! HAVE_GTK3, define
17916         gdk_window_get_screen, gdk_window_get_geometry,
17917         gdk_x11_window_lookup_for_display and GDK_KEY_g.
17918         (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
17919         (xg_get_pixbuf_from_pixmap): New function.
17920         (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
17921         to Pixmap, take frame as parameter, remove GdkColormap parameter.
17922         Call xg_get_pixbuf_from_pixmap instead of
17923         gdk_pixbuf_get_from_drawable.
17924         (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
17925         xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
17926         (xg_check_special_colors): Use GtkStyleContext and its functions
17927         for HAVE_GTK3.
17928         (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
17929         (xg_prepare_tooltip, create_dialog, menubar_map_cb)
17930         (xg_update_frame_menubar, xg_tool_bar_detach_callback)
17931         (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
17932         Call gtk_widget_get_preferred_size.
17933         (xg_frame_resized): gdk_window_get_geometry only takes 5
17934         parameters.
17935         (xg_win_to_widget, xg_event_is_for_menubar):
17936         Call gdk_x11_window_lookup_for_display.
17937         (xg_set_widget_bg): New function.
17938         (delete_cb): New function.
17939         (xg_create_frame_widgets): Connect delete-event to delete_cb.
17940         Call xg_set_widget_bg.  Only set background pixmap for ! HAVE_GTK3
17941         (xg_set_background_color): Call xg_set_widget_bg.
17942         (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
17943         (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
17944         Only call gtk_range_set_update_policy if ! HAVE_GTK3.
17945         (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
17946         if ! HAVE_GTK3.
17947         (update_frame_tool_bar): Call gtk_widget_hide.
17948         (xg_initialize): Use GDK_KEY_g.
17950         * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
17951         if ! HAVE_GTK3
17952         (x_session_initialize): Call gdk_x11_set_sm_client_id.
17954         * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
17955         (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
17956         Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
17958 2011-03-08  Juanma Barranquero  <lekktu@gmail.com>
17960         * w32xfns.c (select_palette): Check success of RealizePalette against
17961         GDI_ERROR, not zero.
17963 See ChangeLog.11 for earlier changes.
17965 ;; Local Variables:
17966 ;; coding: utf-8
17967 ;; End:
17969   Copyright (C) 2011-2012 Free Software Foundation, Inc.
17971   This file is part of GNU Emacs.
17973   GNU Emacs is free software: you can redistribute it and/or modify
17974   it under the terms of the GNU General Public License as published by
17975   the Free Software Foundation, either version 3 of the License, or
17976   (at your option) any later version.
17978   GNU Emacs is distributed in the hope that it will be useful,
17979   but WITHOUT ANY WARRANTY; without even the implied warranty of
17980   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17981   GNU General Public License for more details.
17983   You should have received a copy of the GNU General Public License
17984   along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.