* profiler.c (handle_profiler_signal): Inhibit pending signals too,
[emacs.git] / src / ChangeLog
blob744376b0efd10a5d5c8da02cb93fded6edadf426
1 2012-10-04  Paul Eggert  <eggert@cs.ucla.edu>
3         * profiler.c (handle_profiler_signal): Inhibit pending signals too,
4         to avoid similar races.
5         * keyboard.c (pending_signals): Now bool, not int.
7 2012-10-02  Paul Eggert  <eggert@cs.ucla.edu>
9         * profiler.c (handle_profiler_signal): Fix a malloc race
10         that caused Emacs to hang on Fedora 17 when profiling Lisp.
12 2012-10-02  Jan Djärv  <jan.h.d@swipnet.se>
14         * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
16 2012-10-02  Eli Zaretskii  <eliz@gnu.org>
18         * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
19         consistent with the change in return value of 'safe_strsignal'.
21 2012-10-02  Paul Eggert  <eggert@cs.ucla.edu>
23         Prefer plain 'static' to 'static inline' (Bug#12541).
24         * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
25         (bidi_set_sor_type, bidi_push_embedding_level)
26         (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
27         (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
28         (bidi_cache_search, bidi_cache_ensure_space)
29         (bidi_cache_iterator_state, bidi_cache_find)
30         (bidi_peek_at_next_level, bidi_set_paragraph_end)
31         (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
32         (bidi_explicit_dir_char, bidi_resolve_neutral_1):
33         Now 'static', not 'static inline'.
35         Count overruns when profiling; change units to ns.
36         * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
37         Give extra weight to samples after overruns, to attempt to count
38         the time more accurately.
39         (setup_cpu_timer): Change sampling interval units from ms to ns, since
40         the underlying primitives nominally do ns.
41         (Fprofiler_cpu_start): Document the change.  Mention that
42         the sampling intervals are only approximate.
44 2012-10-02  Stefan Monnier  <monnier@iro.umontreal.ca>
46         * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
48         * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
49         case for the special 0 coding-system.
51         * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
52         (Fmake_overlay): Remove redundant tests.
53         (fix_start_end_in_overlays): Remove redundant recentering.
55 2012-10-02  Juanma Barranquero  <lekktu@gmail.com>
57         * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
58         Update dependencies.
60 2012-10-01  Paul Eggert  <eggert@cs.ucla.edu>
62         Fix a malloc race condition involving strsignal.
63         A signal can arrive in the middle of a malloc, and Emacs's signal
64         handler can invoke strsignal, which can invoke malloc, which is
65         not portable.  This race condition bug makes Emacs hang on GNU/Linux.
66         Fix it by altering the signal handler so that it does not invoke
67         strsignal.
68         * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
69         * process.c (status_message): Use const pointer, in case strsignal
70         is #defined to safe_strsignal.
71         * sysdep.c (sys_siglist, init_signals): Always define and
72         initialize a substitute sys_siglist if the system does not define
73         one, even if HAVE_STRSIGNAL.
74         (safe_strsignal): Rename from strsignal.  Always define,
75         using sys_siglist.  Return a const pointer.
76         * syssignal.h (safe_strsignal): New decl.
77         (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
79 2012-10-01  Eli Zaretskii  <eliz@gnu.org>
81         * w32proc.c (timer_loop): Fix code that waits for timer
82         expiration, to avoid high CPU usage.
84 2012-10-01  Stefan Monnier  <monnier@iro.umontreal.ca>
86         * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
87         (sweep_weak_table): Remove redundant prototypes.
89 2012-10-01  Fabrice Popineau  <fabrice.popineau@gmail.com>
91         * emacs.c: Move the inclusion of TERM_HEADER after including
92         windows.h on WINDOWSNT.  This avoids compilation problems with
93         MSVC.
95 2012-10-01  Eli Zaretskii  <eliz@gnu.org>
97         * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
98         (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
99         (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
100         as the previous version used 'void *'.
102         * ralloc.c (ROUNDUP): Fix last change.
103         (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
104         'size_t'.
106         * w32proc.c <disable_itimers>: New static flag.
107         (init_timers): Initialize it to zero, after creating the critical
108         sections used by the timer threads.
109         (term_timers): Set to 1 before deleting the critical sections.
110         (getitimer, setitimer): If disable_itimers is non-zero, return an
111         error indication without doing anything.  Reported by Fabrice
112         Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
113         (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
114         return results.
115         [!HAVE_SETITIMER]: Behave as the previous version that didn't
116         support timers.
118         * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
119         term_ntproc after all the other bookkeeping, to get timers working
120         as long as possible.
122 2012-10-01  Paul Eggert  <eggert@cs.ucla.edu>
124         * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
125         Suggested by Juri Linkov in
126         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
128         Prefer plain 'static' to 'static inline' (Bug#12541).
129         With static functions, modern compilers inline pretty well by
130         themselves; advice from programmers often hurts as much as it helps.
131         On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
132         this change shrinks the text size of the Emacs executable by 1.1%
133         without affecting CPU significantly in my benchmark.
134         * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
135         (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
136         (mark_maybe_object, mark_maybe_pointer, bounded_number):
137         * buffer.c (bset_abbrev_mode, bset_abbrev_table)
138         (bset_auto_fill_function, bset_auto_save_file_format)
139         (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
140         (bset_bidi_display_reordering, bset_buffer_file_coding_system)
141         (bset_cache_long_line_scans, bset_case_fold_search)
142         (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
143         (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
144         (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
145         (bset_fringe_indicator_alist, bset_fringes_outside_margins)
146         (bset_header_line_format, bset_indicate_buffer_boundaries)
147         (bset_indicate_empty_lines, bset_invisibility_spec)
148         (bset_left_fringe_width, bset_major_mode, bset_mark)
149         (bset_minor_modes, bset_mode_line_format, bset_mode_name)
150         (bset_name, bset_overwrite_mode, bset_pt_marker)
151         (bset_right_fringe_width, bset_save_length)
152         (bset_scroll_bar_width, bset_scroll_down_aggressively)
153         (bset_scroll_up_aggressively, bset_selective_display)
154         (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
155         (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
156         (set_buffer_overlays_after):
157         * category.c (bset_category_table):
158         * charset.c (read_hex):
159         * coding.c (produce_composition, produce_charset)
160         (handle_composition_annotation, handle_charset_annotation)
161         (char_encodable_p):
162         * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
163         (assign_row, set_frame_matrix_frame, make_current)
164         (add_row_entry):
165         * eval.c (set_specpdl_symbol, set_specpdl_old_value):
166         * fns.c (maybe_resize_hash_table):
167         * frame.c (fset_buffer_predicate, fset_minibuffer_window):
168         * gmalloc.c (register_heapinfo):
169         * image.c (lookup_image_type):
170         * intervals.c (set_interval_object, set_interval_left)
171         (set_interval_right, copy_interval_parent, rotate_right)
172         (rotate_left, balance_possible_root_interval):
173         * keyboard.c (kset_echo_string, kset_kbd_queue)
174         (kset_keyboard_translate_table, kset_last_prefix_arg)
175         (kset_last_repeatable_command, kset_local_function_key_map)
176         (kset_overriding_terminal_local_map, kset_real_last_command)
177         (kset_system_key_syms, clear_event, set_prop):
178         * lread.c (digit_to_number):
179         * marker.c (attach_marker, live_buffer, set_marker_internal):
180         * nsterm.m (ns_compute_glyph_string_overhangs):
181         * process.c (pset_buffer, pset_command)
182         (pset_decode_coding_system, pset_decoding_buf)
183         (pset_encode_coding_system, pset_encoding_buf, pset_filter)
184         (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
185         (pset_status, pset_tty_name, pset_type, pset_write_queue):
186         * syntax.c (bset_syntax_table, dec_bytepos):
187         * terminal.c (tset_param_alist):
188         * textprop.c (interval_has_some_properties)
189         (interval_has_some_properties_list):
190         * window.c (wset_combination_limit, wset_dedicated)
191         (wset_display_table, wset_hchild, wset_left_fringe_width)
192         (wset_left_margin_cols, wset_new_normal, wset_new_total)
193         (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
194         (wset_right_fringe_width, wset_right_margin_cols)
195         (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
196         (wset_vertical_scroll_bar_type, wset_window_parameters):
197         * xdisp.c (wset_base_line_number, wset_base_line_pos)
198         (wset_column_number_displayed, wset_region_showing)
199         (window_box_edges, run_window_scroll_functions)
200         (append_glyph_string_lists, prepend_glyph_string_lists)
201         (append_glyph_string, set_glyph_string_background_width)
202         (append_glyph, append_composite_glyph)
203         (take_vertical_position_into_account):
204         * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
205         (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
206         (lface_hash, lface_same_font_attributes_p, lookup_face):
207         * xml.c (libxml2_loaded_p):
208         * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
209         (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
210         Now 'static', not 'static inline'.
212         * bidi.c: Tune.
213         (bidi_copy_it): Do the whole copy with a single memcpy.
214         (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
216         Revert the FOLLOW-SYMLINKS change for file-attributes.
217         Doing it right would require several changes to Tramp, and there's
218         not enough time to get that tested before the freeze today.
219         * dired.c (directory_files_internal, Ffile_attributes):
220         Undo last change.
222         * frame.c (x_report_frame_params): Port better to wider ints.
223         Do not assume that EMACS_UINT is the same width as uprintmax_t,
224         or that pointers can be printed in 15 decimal digits.
225         Avoid GCC warnings if EMACS_UINT is wider than a pointer.
227 2012-09-30  Fabrice Popineau  <fabrice.popineau@supelec.fr>
229         Support x64 build on MS-Windows.
230         * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
231         (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
232         compatibility with x64.
233         (x_get_focus_frame): Add prototype.
235         * w32term.c (w32_draw_underwave): Don't use GCC extensions for
236         defining an XRectangle structure.
238         * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
239         arithmetics for compatibility with x64.
241         * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
242         compatibility with x64.
244         * w32heap.h: Adjust prototypes and declarations.
246         * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
247         (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
248         DWORD, long, and unsigned long, for compatibility with x64.
249         (allocate_heap) [_WIN64]: Reserve 32GB of memory.
250         (sbrk): Argument is now of type ptrdiff_t.
252         * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
253         less than 0x0500.
254         (w32_msg_pump): Use WPARAM type for 'result'.
256         * w32.c (init_environment, get_emacs_configuration): Support AMD64
257         architecture.
258         (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
259         compatibility with x64.
261         * vm-limit.c (lim_data): Now size_t.
262         (check_memory_limits): Adjust prototypes of real_morecore and
263         __morecore to receive argument of type ptrdiff_t.  Use size_t for
264         five_percent and data_size.
266         * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
267         variables, for compatibility with x64.
268         (rva_to_section, offset_to_section, relocate_offset)
269         (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
270         (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
271         (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
272         for compatibility with x64.
274         * sysdep.c (STDERR_FILENO): Define if not already defined.
276         * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
277         (__morecore): Argument type is now ptrdiff_t.
278         (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
279         (relinquish): Use ptrdiff_t type for 'excess'.
280         (r_alloc_sbrk): Argument type is now ptrdiff_t.
282         * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
283         (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
284         instead of a literal number.
286         * gmalloc.c [WINDOWSNT]: Include w32heap.h.
287         (min): Define only if not already defined.
289         * frame.c (x_report_frame_params): Use EMACS_UINT for the return
290         value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
291         hosts.
293         * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
294         'bitmaps' is a pointer.
296         * dispextern.h (x_bitmap_pixmap): Adjust prototype.
298         * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
300 2012-09-30  Paul Eggert  <eggert@cs.ucla.edu>
302         file-attributes has a new optional arg FOLLOW-SYMLINKS.
303         * dired.c (directory_files_internal, Ffile_attributes):
304         New arg follow_symlinks.  All uses changed.
306 2012-09-30  Stefan Monnier  <monnier@iro.umontreal.ca>
308         * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
310 2012-09-30  Eli Zaretskii  <eliz@gnu.org>
312         Support atimers and CPU profiler via profile.c on MS-Windows.
313         * w32proc.c (sig_mask, crit_sig): New static variables.
314         (sys_signal): Support SIGALRM and SIGPROF.
315         (sigemptyset, sigaddset, sigfillset, sigprocmask)
316         (pthread_sigmask, setpgrp): Move here from w32.c.  sigaddset,
317         sigfillset, and sigprocmask are no longer no-ops.
318         (sigismember): New function.
319         (struct itimer_data): New definition.
320         (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
321         (crit_prof): New static variables.
322         (MAX_SINGLE_SLEEP): New definition.
323         (timer_loop, stop_timer_thread, term_timers, init_timers)
324         (start_timer_thread, getitimer, setitimer): New functions.
325         (alarm): No longer a no-op, calls setitimer.
327         * w32.c (term_ntproc): Call term_timers.
328         (init_ntproc): Make sure all signals are unblocked at startup, to
329         erase any traces of dumping.  Call init_timers.
331         * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
332         Windows-specific code to display the hourglass mouse pointer is no
333         longer used.
334         (w32_wnd_proc): Remove code that handled the WM_TIMER message due
335         to hourglass timer expiration.
336         (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
337         Remove, no longer used.
338         (w32_note_current_window, show_hourglass, hide_hourglass):
339         New functions, in support of hourglass cursor display similar to other
340         window systems.
341         (syms_of_w32fns): Don't initialize hourglass_timer.
343         * xdisp.c (start_hourglass, cancel_hourglass): Now used on
344         WINDOWSNT as well.
345         (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
347         * w32.h (init_timers, term_timers): Add prototypes.
349 2012-09-30  Kenichi Handa  <handa@gnu.org>
351         * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
352         to the buffer relocation which may be caused by ccl_driver.
354 2012-09-30  Jan Djärv  <jan.h.d@swipnet.se>
356         * xfns.c (Fx_file_dialog): Update comment.
358         * w32fns.c (Fx_file_dialog): Update comment.
360         * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
361         Initialize panel name field if OSX >= 10.6.
363         * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
365         * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
367         * nsterm.m (NEW_STYLE_FS): New define.
368         (ns_fullscreen_hook, windowWillEnterFullScreen)
369         (windowDidEnterFullScreen, windowWillExitFullScreen)
370         (windowDidExitFullScreen, toggleFullScreen, handleFS)
371         (setFSValue): New functions.
372         (EmacsFSWindow): New implementation.
373         (canBecomeKeyWindow): New function for EmacsFSWindow.
374         (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
375         (dealloc): Release nonfs_window if in fullscreen.
376         (updateFrameSize:): Call windowDidMove to update top/left.
377         (windowWillResize:toSize:): Check if frame is still maximized.
378         (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
379         next_maximized, maximized_width, maximized_height and nonfs_window.
380         Call setCollectionBehavior if NEW_STYLE_FS.  Initialize bwidth and
381         tbar_height.
382         (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
383         fullscreen. Set maximized_width/height.  Act on next_maximized.
385         * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
386         (EmacsView): Add variables for fullscreen.
387         (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
388         (EmacsFSWindow): New interface for fullscreen.
390 2012-09-30  Juanma Barranquero  <lekktu@gmail.com>
392         * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
394 2012-09-30  Chong Yidong  <cyd@gnu.org>
396         * fns.c (Frandom): Doc fix.
398 2012-09-30  Martin Rudalics  <rudalics@gmx.at>
400         * window.c (Vwindow_combination_limit): New default value.
401         (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
403 2012-09-30  Paul Eggert  <eggert@cs.ucla.edu>
405         * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
406         Suggested by Eli Zaretskii in
407         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
409 2012-09-30  Eli Zaretskii  <eliz@gnu.org>
411         * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
412         HAVE_TIMER_SETTIME is defined.
414 2012-09-30  Paul Eggert  <eggert@cs.ucla.edu>
416         Profiler improvements: more-accurate timers, overflow checks.
417         * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
418         signal.h, setjmp.h.  Include systime.h instead.
419         (saturated_add): New function.
420         (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
421         (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
422         (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
423         New static vars.
424         (enum profiler_cpu_running): New enum.
425         (profiler_cpu_running): Now of that enum type, not bool.
426         All uses changed to store the new value.
427         (handle_profiler_signal): Rename from sigprof_handler_1,
428         for consistency with other handlers.  Do not check whether
429         cpu_log is a hash-table if garbage collecting, since it
430         doesn't matter in that case.
431         (deliver_profiler_signal): Rename from sigprof_handler,
432         for consistency with other handlers.
433         (setup_cpu_timer): New function, with much of what used to be in
434         Fprofiler_cpu_start.  Check for out-of-range argument.
435         Prefer timer_settime if available, and prefer
436         thread cputime clocks, then process cputime clocks, then
437         monotonic clocks, to the old realtime clock.  Use make_timeval
438         to round more-correctly when falling back to setitimer.
439         (Fprofiler_cpu_start): Use it.
440         (Fprofiler_cpu_stop): Prefer timer_settime if available.
441         Don't assume that passing NULL as the 2nd argument of setitimer
442         is the same as passing a pointer to all-zero storage.
443         Ignore SIGPROF afterwards.
444         (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
445         * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
446         non-fatal signal handlers.  Ignore SIGPROF on startup.
447         * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
448         in profiler.c, since sysdep.c now uses it.
450         * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
451         Suggested by Eli Zaretskii in
452         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
454 2012-09-29  Juanma Barranquero  <lekktu@gmail.com>
456         * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
458 2012-09-29  Stefan Monnier  <monnier@iro.umontreal.ca>
460         * lisp.h (struct backtrace): Remove indirection for `function' field.
461         * xdisp.c (redisplay_internal):
462         * profiler.c (record_backtrace, sigprof_handler_1):
463         * alloc.c (Fgarbage_collect):
464         * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
465         (Fbacktrace_frame): Adjust accordingly.
467 2012-09-28  Glenn Morris  <rgm@gnu.org>
469         * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
470         (Frun_hook_with_args_until_failure): Doc fixes.
472 2012-09-28  Eli Zaretskii  <eliz@gnu.org>
474         * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
475         Qautomatic_redisplay and change the symbol name.  All users changed.
477 2012-09-28  Tomohiro Matsuyama  <tomo@cx4a.org>
479         * profiler.c (sigprof_handler): Fix race condition.
481 2012-09-28  Glenn Morris  <rgm@gnu.org>
483         * lread.c (lisp_file_lexically_bound_p): Handle #! lines.  (Bug#12528)
485 2012-09-27  Paul Eggert  <eggert@cs.ucla.edu>
487         Check more robustly for timer_settime.
488         * Makefile.in (LIB_TIMER_TIME): New macro.
489         (LIBES): Add it.
490         * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
491         Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
492         call timer_settime.
494 2012-09-26  Tomohiro Matsuyama  <tomo@cx4a.org>
496         * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
498 2012-09-26  Juanma Barranquero  <lekktu@gmail.com>
500         * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
502 2012-09-26  Paul Eggert  <eggert@cs.ucla.edu>
504         * character.h (MAYBE_UNIFY_CHAR): Remove.
505         * charset.c, charset.h (maybe_unify_char): Now static.
506         * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
507         Since this stuff is now private to charset.c, there's no need for
508         a public macro and no need to inline by hand.
510 2012-09-26  Tomohiro Matsuyama  <tomo@cx4a.org>
511             Stefan Monnier  <monnier@iro.umontreal.ca>
512             Juanma Barranquero  <lekktu@gmail.com>
514         * profiler.c: New file.
515         * Makefile.in (base_obj): Add profiler.o.
516         * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
517         ($(BLD)/profiler.$(O)): New target.
518         * emacs.c (main): Call syms_of_profiler.
519         * alloc.c (Qautomatic_gc): New constant.
520         (MALLOC_PROBE): New macro.
521         (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
522         (total_bytes_of_live_objects): New function.
523         (Fgarbage_collect): Use it.  Record itself in backtrace_list.
524         Call malloc_probe for the memory profiler.
525         (syms_of_alloc): Define Qautomatic_gc.
526         * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
527         race condition.
528         (struct backtrace): Move definition...
529         * lisp.h (struct backtrace): ..here.
530         (Qautomatic_gc, profiler_memory_running): Declare vars.
531         (malloc_probe, syms_of_profiler): Declare functions.
532         * xdisp.c (Qautomatic_redisplay): New constant.
533         (redisplay_internal): Record itself in backtrace_list.
534         (syms_of_xdisp): Define Qautomatic_redisplay.
536 2012-09-25  Eli Zaretskii  <eliz@gnu.org>
537 2012-09-25  Juanma Barranquero  <lekktu@gmail.com>
539         * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
541 2012-09-25  Paul Eggert  <eggert@cs.ucla.edu>
543         Prefer POSIX timers if available.
544         They avoid a race if the timer is too close to the current time.
545         * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
546         (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
547         (init_atimer) [SIGEV_SIGNAL]: Initialize them.
549 2012-09-25  Eli Zaretskii  <eliz@gnu.org>
551         * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
552         CHAR_STRING_ADVANCE.
553         (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
554         STRING_CHAR_ADVANCE.
556 2012-09-25  Juanma Barranquero  <lekktu@gmail.com>
558         Move Vlibrary_cache to emacs.c and reset before dumping.
560         * lisp.h (reset_image_types): Declare.
561         [WINDOWSNT] (Vlibrary_cache): Declare.
563         * image.c (reset_image_types): New function.
565         * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
566         (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
567         (Fdump_emacs): Reset Vlibrary_cache and image_types.
569         * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
570         (globals_of_w32) <Vlibrary_cache>: Do not initialize.
572         * w32.h (Vlibrary_cache): Do not declare.
574 2012-09-25  Eli Zaretskii  <eliz@gnu.org>
576         * w32proc.c (sys_signal): Handle all signals defined by the
577         MS-Windows runtime, not just SIGCHLD.  Actually install the signal
578         handlers for signals supported by Windows.  Don't override
579         term_ntproc as the handler for SIGABRT.
580         (sigaction): Rewrite to call sys_signal instead of duplicating its
581         code.
582         (sys_kill): Improve commentary.
584         * w32.c (term_ntproc): Accept (and ignore) one argument, for
585         consistency with a signature of a signal handler.  All callers
586         changed.
587         (init_ntproc): Accept an argument DUMPING.  If dumping, don't
588         install term_ntproc as a signal handler for SIGABRT, as that
589         should be done by the dumped Emacs.
591         * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
593         * w32select.c (term_w32select): Protect against repeated
594         invocation by setting clipboard_owner to NULL after calling
595         DestroyWindow.
597         * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
598         and term_ntproc to their modified signatures.
600         * character.c (char_string, string_char): Remove calls to
601         MAYBE_UNIFY_CHAR.  See the discussion starting at
602         http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
603         for the details.
605 2012-09-25  Chong Yidong  <cyd@gnu.org>
607         * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
609 2012-09-24  Stefan Monnier  <monnier@iro.umontreal.ca>
611         * bytecode.c (exec_byte_code): Signal an error instead of aborting,
612         when encountering an unknown bytecode.
614 2012-09-24  Paul Eggert  <eggert@cs.ucla.edu>
616         image.c, indent.c: Use bool for booleans.
617         * dispextern.h (struct image_type): Members valid_p, load, init
618         now return bool, not int.  All uses changed.
619         * image.c: Omit unnecessary static decls.
620         (x_create_bitmap_mask, x_build_heuristic_mask):
621         Return void, not int, since callers don't care about the return value.
622         (x_create_bitmap_mask, define_image_type, valid_image_p)
623         (struct image_keyword, parse_image_spec, image_spec_value)
624         (check_image_size, image_background)
625         (image_background_transparent, x_clear_image_1)
626         (postprocess_image, lookup_image, x_check_image_size)
627         (x_create_x_image_and_pixmap, xbm_image_p)
628         (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
629         (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
630         (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
631         (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
632         (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
633         (png_image_p, init_png_functions, png_load_body, png_load)
634         (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
635         (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
636         (init_gif_functions, gif_load, imagemagick_image_p)
637         (imagemagick_load_image, imagemagick_load, svg_image_p)
638         (init_svg_functions, svg_load, svg_load_image, gs_image_p)
639         (gs_load):
640         * nsimage.m (ns_load_image):
641         * nsterm.m (ns_defined_color):
642         * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
643         * xfns.c (x_defined_color):
644         * xterm.c (x_alloc_lighter_color_for_widget)
645         (x_alloc_nearest_color_1, x_alloc_nearest_color)
646         (x_alloc_lighter_color):
647         * indent.c (disptab_matches_widthtab, current_column)
648         (scan_for_column, string_display_width, indented_beyond_p)
649         (compute_motion, vmotion, Fvertical_motion):
650         Use bool for booleans.
652 2012-09-24  Chong Yidong  <cyd@gnu.org>
654         * chartab.c (Fset_char_table_default): Obsolete function removed.
656 2012-09-23  Paul Eggert  <eggert@cs.ucla.edu>
658         Move pid_t related decls out of lisp.h.
659         * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
660         (interruptible_wait_for_termination):
661         Move these decls from lisp.h to syswait.h, since they use pid_t.
662         Needed on FreeBSD; see Herbert J. Skuhra in
663         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
664         * callproc.c: Include syswait.h.
666         gnutls.c, gtkutil.c: Use bool for boolean.
667         * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
668         (emacs_gnutls_handle_error):
669         * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
670         (xg_hide_tooltip, xg_create_frame_widgets)
671         (create_dialog, xg_uses_old_file_dialog)
672         (xg_get_file_with_chooser, xg_get_file_with_selection)
673         (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
674         (xg_item_label_same_p, xg_update_menubar)
675         (xg_modify_menubar_widgets, xg_event_is_for_menubar)
676         (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
677         (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
678         (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
679         (update_frame_tool_bar, free_frame_tool_bar):
680         * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
681         * nsmenu.m (ns_update_menubar):
682         * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
683         * xfns.c (Fx_show_tip) [USE_GTK]:
684         Use bool for boolean.
685         * gtkutil.c (xg_update_frame_menubar):
686         * xmenu.c (update_frame_menubar):
687         Return void, not int, since caller ignores return value.
688         * gtkutil.c (xg_change_toolbar_position):
689         Return void, not 1.
691 2012-09-23  Juanma Barranquero  <lekktu@gmail.com>
693         * makefile.w32-in (BLOCKINPUT_H): Remove.
694         (SYSSIGNAL_H): New macro.
695         ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
696         ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
697         ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
698         ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
699         ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
700         ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
701         ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
702         ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
703         ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
704         ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
705         ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
706         ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
707         ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
708         ($(BLD)/w32xfns.$(O)): Update dependencies.
710 2012-09-23  Eli Zaretskii  <eliz@gnu.org>
712         * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
713         fatal_error_backtrace.
715         * w32proc.c (sys_kill): Undo last change: don't do anything when
716         invoked to deliver SIGABRT to our own process.  This is now
717         handled by emacs_raise.
719 2012-09-23  Juanma Barranquero  <lekktu@gmail.com>
721         * w32term.c (w32_read_socket): Remove leftover reference to
722         interrupt_input_pending.
724 2012-09-23  Paul Eggert  <eggert@cs.ucla.edu>
726         Do not use SA_NODEFER.
727         Problem reported by Dani Moncayo in
728         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
729         * alloc.c (die):
730         * sysdep.c (emacs_abort): Do not reset signal handler.
731         * emacs.c (terminate_due_to_signal): Reset signal handler here.
732         * sysdep.c (init_signals): Do not use SA_NODEFER.  It wasn't
733         wanted even on POSIXish hosts, and it doesn't work on Windows.
735 2012-09-23  Jan Djärv  <jan.h.d@swipnet.se>
737         * xterm.c (x_term_init): Call fixup_locale before and after calling
738         gtk_init (Bug#12392).
740 2012-09-23  Chong Yidong  <cyd@gnu.org>
742         * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
743         Vdynamic_library_alist.
745         * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
746         (Fgnutls_available_p): Caller changed.
748         * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
749         (Flibxml_parse_xml_region): Likewise.
751         * dispextern.h (struct image_type): Remove arg from init function.
753         * image.c (Finit_image_library, lookup_image_type)
754         (define_image_type): Remove now-unneeded second arg.
755         (init_xpm_functions, init_png_functions, init_jpeg_functions)
756         (init_tiff_functions, init_gif_functions, init_svg_functions):
757         Arglist and w32_delayed_load calling convention changed.
758         (gs_type): Remove init_gs_functions; there is no such function.
759         (valid_image_p, make_image): Fix caller to lookup_image_type.
761 2012-09-23  Paul Eggert  <eggert@cs.ucla.edu>
763         Simplify and avoid signal-handling races (Bug#12471).
764         * alloc.c (die):
765         * sysdep.c (emacs_abort) [HAVE_NTGUI]:
766         Avoid recursive loop if there's a fatal error in the function itself.
767         * atimer.c (pending_atimers):
768         * blockinput.h: Don't include "atimer.h"; no longer needed.
769         (interrupt_input_pending): Remove.  All uses removed.
770         pending_signals now counts both atimers and ordinary interrupts.
771         This is less racy than having three separate pending-signal flags.
772         (block_input, unblock_input, totally_unblock_input, unblock_input_to)
773         (input_blocked_p):
774         Rename from their upper-case counterparts BLOCK_INPUT,
775         UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
776         INPUT_BLOCKED_P, and turn into functions.  All uses changed.
777         This makes it easier to access volatile variables more accurately.
778         (BLOCK_INPUT_RESIGNAL): Remove.  All uses replaced by unblock_input ().
779         (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
780         that's more reliable if the code is buggy and sets
781         interrupt_input_blocked to a negative value.  All uses changed.
782         * atimer.c (deliver_alarm_signal):
783         Remove.  No need to deliver this to the parent; any thread can
784         handle this signal now.  All uses replaced by underlying handler.
785         * atimer.c (turn_on_atimers):
786         * dispnew.c (handle_window_change_signal):
787         * emacs.c (handle_danger_signal):
788         * keyboard.c (kbd_buffer_get_event):
789         Don't reestablish signal handler; not needed with sigaction.
790         * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
791         (UNBLOCK_INPUT_TO):
792         Rework to avoid unnecessary accesses to volatile variables.
793         (UNBLOCK_INPUT_TO): Now a function.
794         (totally_unblock_input, unblock_input): New decls.
795         * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
796         (init_data): Remove.  Necessary stuff now done in init_signal.
797         * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
798         * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
799         (fatal_error_code): Remove; no longer needed.
800         (terminate_due_to_signal): Rename from fatal_error_backtrace, since
801         it doesn't always backtrace.  All uses changed.  No need to reset
802         signal to default, since sigaction and/or die does that for us now.
803         Use emacs_raise (FOO), not kill (getpid (), FOO).
804         (main): Check more-accurately whether we're dumping.
805         Move fatal-error setup to sysdep.c
806         * floatfns.c: Do not include "syssignal.h"; no longer needed.
807         * gtkutil.c (xg_get_file_name, xg_get_font):
808         Remove no-longer-needed signal-mask manipulation.
809         * keyboard.c, process.c (POLL_FOR_INPUT):
810         Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
811         * keyboard.c (read_avail_input): Remove.
812         All uses replaced by gobble_input.
813         (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
814         (kbd_buffer_store_event_hold, gobble_input):
815         (record_asynch_buffer_change) [USABLE_SIGIO]:
816         (store_user_signal_events):
817         No need to mess with signal mask.
818         (gobble_input): If blocking input and there are terminals, simply
819         set pending_signals to 1 and return.  All hooks changed to not
820         worry about whether input is blocked.
821         (process_pending_signals): Clear pending_signals before processing
822         them, in case a signal comes in while we're processing.
823         By convention callers now test pending_signals before calling us.
824         (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
825         New functions, to support changes to blockinput.h.
826         (handle_input_available_signal): Now extern.
827         (reinvoke_input_signal): Remove.  All uses replaced by
828         handle_async_input.
829         (quit_count): Now volatile, since a signal handler uses it.
830         (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
831         All callers changed.  Block SIGINT only if not already blocked.
832         Clear sigmask reliably, even if Fsignal returns, which it can.
833         Omit unnecessary accesses to volatile var.
834         (quit_throw_to_read_char): No need to restore sigmask.
835         * keyboard.c (gobble_input, handle_user_signal):
836         * process.c (wait_reading_process_output):
837         Call signal-handling code rather than killing ourselves.
838         * lisp.h: Include <float.h>, for...
839         (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
840         (pending_signals): Now volatile.
841         (syms_of_data): Now const if IEEE floating point.
842         (handle_input_available_signal) [USABLE_SIGIO]:
843         (terminate_due_to_signal, record_child_status_change): New decls.
844         * process.c (create_process): Avoid disaster if memory is exhausted
845         while we're processing a vfork, by tightening the critical section
846         around the vfork.
847         (send_process_frame, process_sent_to, handle_pipe_signal)
848         (deliver_pipe_signal): Remove.  No longer needed, as Emacs now
849         ignores SIGPIPE.
850         (send_process): No need for setjmp/longjmp any more, since the
851         SIGPIPE stuff is now gone.  Instead, report an error if errno
852         is EPIPE.
853         (record_child_status_change): Now extern.  PID and W are now args.
854         Return void, not bool.  All callers changed.
855         * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
856         Remove.  All uses removed.  This bug should be fixed now in a
857         different way.
858         (wait_for_termination_1): Use waitpid rather than sigsuspend,
859         and record the child status change directly.  This avoids the
860         need to futz with the signal mask.
861         (process_fatal_action): Move here from emacs.c.
862         (emacs_sigaction_flags): New function, containing
863         much of what used to be in emacs_sigaction_init.
864         (emacs_sigaction_init): Use it.  Block nonfatal system signals that are
865         caught by emacs, to make races less likely.
866         (deliver_process_signal): Rename from handle_on_main_thread.
867         All uses changed.
868         (BACKTRACE_LIMIT_MAX): Now at top level.
869         (thread_backtrace_buffer, threadback_backtrace_pointers):
870         New static vars.
871         (deliver_thread_signal, deliver_fatal_thread_signal):
872         New functions, for more-accurate delivery of thread-specific signals.
873         (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
874         (deliver_arith_signal): Handle in this thread, not
875         in the main thread, since it's triggered by this thread.
876         (maybe_fatal_sig): New function.
877         (init_signals): New arg DUMPING so that we can be more accurate
878         about whether we're dumping.  Caller changed.
879         Treat thread-specific signals differently from process-general signals.
880         Block all signals while handling fatal error; that's safer.
881         xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
882         on IEEE hosts.
883         When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
884         Ignore SIGPIPE unless batch.
885         (emacs_backtrace): Output backtrace for the appropriate thread,
886         which is not necessarily the main thread.
887         * syssignal.h: Include <stdbool.h>.
888         (emacs_raise): New macro.
889         * xterm.c (x_connection_signal): Remove; no longer needed
890         now that we use sigaction.
891         (x_connection_closed): No need to mess with sigmask now.
892         (x_initialize): No need to reset SIGPIPE handler here, since
893         init_signals does this for us now.
895 2012-09-23  Jan Djärv  <jan.h.d@swipnet.se>
897         * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
898         background rect may be larger (Bug#12245).
900 2012-09-23  Chong Yidong  <cyd@gnu.org>
902         * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
904 2012-09-22  Paul Eggert  <eggert@cs.ucla.edu>
906         * .gdbinit: Just stop at fatal_error_backtrace.
907         See Stefan Monnier's request in
908         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
909         Remove no-longer-used query of system type.
911 2012-09-22  Chong Yidong  <cyd@gnu.org>
913         * search.c (Freplace_match): Doc fix (Bug#12325).
915         * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
917         * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
918         (Fline_end_position): Doc fix.
920         * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
922 2012-09-22  Chong Yidong  <cyd@gnu.org>
924         * dispextern.h (struct image_type): Add new slot, storing a type
925         initialization function.
927         * image.c (define_image_type): Call the image initializer function
928         if it is defined.  Arguments and return value changed.
929         (valid_image_p, make_image): Callers changed.
930         (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
931         (gif_type, imagemagick_type, svg_type, gs_type):
932         Add initialization functions.
933         (Finit_image_library): Call lookup_image_type.
934         (CHECK_LIB_AVAILABLE): Macro deleted.
935         (lookup_image_type): Call define_image_type here, rather than via
936         Finit_image_library, and without using CHECK_LIB_AVAILABLE.
937         (syms_of_image): Move define_image_type calls for xbm_type and
938         pbm_type to lookup_image_type.
940 2012-09-22  Eli Zaretskii  <eliz@gnu.org>
942         * keyboard.c (timer_check_2): Move calculation of 'timers' and
943         'idle_timers' from here ...
944         (timer_check): ... to here.  Use Fcopy_sequence to copy the timer
945         lists, to avoid infloops when the timer does something stupid,
946         like reinvoke itself with the same or smaller time-out.
947         (Bug#12447)
949 2012-09-22  Martin Rudalics  <rudalics@gmx.at>
951         * window.c (Fsplit_window_internal): Handle only Qt value of
952         Vwindow_combination_limit separately.
953         (Qtemp_buffer_resize): New symbol.
954         (Vwindow_combination_limit): New default value.
955         Rewrite doc-string.
957 2012-09-22  Eli Zaretskii  <eliz@gnu.org>
959         * xdisp.c (next_overlay_string): Initialize it->end_charpos for
960         the new overlay string.  (Bug#10159)
962 2012-09-22  Paul Eggert  <eggert@cs.ucla.edu>
964         * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
965         or that fprintf is async-signal-safe.  POSIX doesn't require
966         either assumption.
968 2012-09-22  Chong Yidong  <cyd@gnu.org>
970         * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
971         (Bug#8207).
973 2012-09-22  Kenichi Handa  <handa@gnu.org>
975         * composite.c (composition_reseat_it): Handle the case that a
976         grapheme cluster is not covered by a single font (Bug#12352).
978 2012-09-21  Chong Yidong  <cyd@gnu.org>
980         * image.c (define_image_type): Avoid adding duplicate types to
981         image_types (Bug#12463).  Suggested by Jörg Walter.
983 2012-09-21  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
985         * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
986         (print_load_command_name): Add case LC_DATA_IN_CODE.
987         (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
989 2012-09-21  Glenn Morris  <rgm@gnu.org>
991         * eval.c (Frun_hook_with_args_until_success)
992         (Frun_hook_with_args_until_failure): Doc fixes.  (Bug#12393)
994 2012-09-21  Andreas Schwab  <schwab@linux-m68k.org>
996         * fileio.c (Ffile_selinux_context): Only call freecon when
997         lgetfilecon succeeded.
998         (Fset_file_selinux_context): Likewise.  (Bug#12444)
1000 2012-09-21  Eli Zaretskii  <eliz@gnu.org>
1002         * xdisp.c (try_window_reusing_current_matrix): Under bidi
1003         reordering, locate the cursor by calling set_cursor_from_row; if
1004         that fails, clear the desired glyph matrix before returning a
1005         failure indication to the caller.  Fixes leaving garbled display
1006         when fast scrolling with a down-key.  (Bug#12403)
1007         (compute_stop_pos_backwards): Fix a typo that caused crashes while
1008         scrolling through multibyte text.
1010 2012-09-20  Stefan Monnier  <monnier@iro.umontreal.ca>
1012         * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1013         calling mark_vectorlike since that's the one that marks the window.
1014         (mark_discard_killed_buffers): Mark the final cdr.
1015         * window.h (struct window): Move prev/next_buffers to the
1016         non-standard fields.
1017         * window.c (make_window): Initialize prev/next_buffers manually.
1019 2012-09-20  Paul Eggert  <eggert@cs.ucla.edu>
1021         Omit unused arg EXPECTED from socket hooks.
1022         * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1023         * nsterm.m (ns_term_init):
1024         * termhooks.h (struct terminal.read_socket_hook):
1025         * w32inevt.c (w32_console_read_socket):
1026         * w32term.c (w32_read_socket):
1027         * xterm.c (XTread_socket):
1028         Omit unused arg EXPECTED.  All callers changed.
1029         (store_user_signal_events): Return void, not int, since callers no
1030         longer care about the return value.  All uses changed.
1032 2012-09-20  Juanma Barranquero  <lekktu@gmail.com>
1034         * w32gui.h (XParseGeometry): Do not declare.
1036 2012-09-19  Paul Eggert  <eggert@cs.ucla.edu>
1038         * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1039         Ignore 'expected'. See Eli Zaretskii in
1040         <http://bugs.gnu.org/12471#8> (last line).
1042         * frame.c (read_integer): Remove.  All uses replaced by strtol/strtoul.
1043         (XParseGeometry): Now static.  Substitute extremal values for
1044         values that are out of range.
1046 2012-09-19  Jan Djärv  <jan.h.d@swipnet.se>
1048         * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1050         * nsfns.m (XParseGeometry): Remove.
1051         (Fx_create_frame): Call x_set_offset to correctly interpret
1052         top_pos in geometry.
1054         * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
1055         (Fx_parse_geometry): If there is a space in string, call
1056         Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1058 2012-09-17  Eli Zaretskii  <eliz@gnu.org>
1060         * search.c (scan_buffer): Use character positions in calls to
1061         region_cache_forward and region_cache_backward, not byte
1062         positions.  (Bug#12196)
1064         * w32term.c (w32_read_socket): Set pending_signals to 1, like
1065         xterm.c does.  Reported by Daniel Colascione <dancol@dancol.org>.
1067         * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1068         __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1069         emacs_blocked_malloc, now deleted.
1071 2012-09-17  Paul Eggert  <eggert@cs.ucla.edu>
1073         Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1074         The workaround was for improving performance on Solaris 2.4, but
1075         is getting in the way now.  Emacs will still work if someone is
1076         still running Solaris 2.4 in a museum somewhere; Sun dropped
1077         support for Solaris 2.4 in 2003.
1078         * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1079         * process.c (create_process) [HAVE_WORKING_VFORK]:
1080         Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1081         since Emacs no longer uses vfork on that platform.
1083 2012-09-17  Glenn Morris  <rgm@gnu.org>
1085         * emacs.c: Use COPYRIGHT.
1087 2012-09-16  Paul Eggert  <eggert@cs.ucla.edu>
1089         Remove configure's --without-sync-input option (Bug#12450).
1090         When auditing signal-handling in preparation for cleaning it up,
1091         I found that SYNC_INPUT has race conditions and would be a real
1092         pain to fix.  Since it's an undocumented and deprecated
1093         configure-time option, now seems like a good time to remove it.
1094         Also see <http://bugs.gnu.org/11080#16>.
1095         * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1096         (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1097         (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1098         (malloc_hysteresis):
1099         (check_depth) [XMALLOC_OVERRUN_CHECK]:
1100         (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1101         (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1102         (dont_register_blocks, bytes_used_when_reconsidered)
1103         (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1104         (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1105         [!SYSTEM_MALLOC && !SYNC_INPUT]:
1106         Remove. All uses removed.
1107         (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1108         implementation, one that depends on whether the new macro
1109         XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1110         is defined.
1111         * atimer.c (run_timers, handle_alarm_signal):
1112         * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1113         (handle_async_input, process_pending_signals)
1114         (handle_input_available_signal, init_keyboard):
1115         * nsterm.m (ns_read_socket):
1116         * process.c (wait_reading_process_output):
1117         * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1118         * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1119         (emacs_write):
1120         * xterm.c (XTread_socket):
1121         Assume SYNC_INPUT.
1122         * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1123         * eval.c (handling_signal): Remove.  All uses removed.
1124         * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1125         All uses replaced with the SYNC_INPUT version.
1126         (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1127         Remove decls.
1128         * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1129         Now static.
1131         * font.c (Ffont_shape_gstring): Remove unused local.
1133 2012-09-16  Glenn Morris  <rgm@gnu.org>
1135         * Makefile.in (clean): No longer run nextstep's clean.
1137         * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1138         (ns_frag): Remove.
1139         (ns-app): Move here from ns.mk, and simplify.
1140         (clean): Simplify nextstep entry.
1141         * ns.mk: Remove file.
1143 2012-09-17  Kenichi Handa  <handa@gnu.org>
1145         * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1146         not covert the last few charactes.
1148 2012-09-16  Kenichi Handa  <handa@gnu.org>
1150         * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1151         here, but just check the validity of glyphs in the glyph-string.
1153 2012-09-16  Martin Rudalics  <rudalics@gmx.at>
1155         * window.c (Fwindow_parameter, Fset_window_parameter):
1156         Accept any window as argument (Bug#12452).
1158 2012-09-16  Jan Djärv  <jan.h.d@swipnet.se>
1160         * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1161         to ns_term_init to avoid memory leak.
1163         * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1164         explicit retain/release.
1165         (ns_term_init): Only allow one display.  Initialize outerpool and
1166         ns_*_types.
1168 2012-09-15  Paul Eggert  <eggert@cs.ucla.edu>
1170         Port _setjmp fix to POSIXish hosts as well as Microsoft.
1171         * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1172         it's needed on POSIXish hosts that lack _setjmp.  Attempt to solve
1173         the Microsoft problem in a different way, by altering ../nt/config.nt.
1175 2012-09-15  Eli Zaretskii  <eliz@gnu.org>
1177         * w32xfns.c:
1178         * w32uniscribe.c:
1179         * w32term.c:
1180         * w32select.c:
1181         * w32reg.c:
1182         * w32proc.c:
1183         * w32menu.c:
1184         * w32inevt.c:
1185         * w32heap.c:
1186         * w32font.c:
1187         * w32fns.c:
1188         * w32console.c:
1189         * w32.c:
1190         * w16select.c: Remove inclusion of setjmp.h, as it is now included
1191         by lisp.h.  This completes removal of setjmp.h inclusion
1192         erroneously announced in the previous commit.  (Bug#12446)
1194         * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1195         more accurate.
1197         * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1198         not defined as a macro.  The latter happens on MS-Windows.
1199         (Bug#12446)
1201 2012-09-15  Paul Eggert  <eggert@cs.ucla.edu>
1203         Port better to POSIX hosts lacking _setjmp (Bug#12446).
1204         * lisp.h: Include <setjmp.h> here, since we use its symbols here.
1205         Some instances of '#include <setjmp.h>' removed, if the
1206         only reason for the instance was because "lisp.h" was included.
1207         (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1208         Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1209         and _longjmp with the new symbols.  Emacs already uses _setjmp if
1210         available, so this change affects only POSIXish hosts that have
1211         sigsetjmp but not _setjmp, such as some versions of Solaris and
1212         Unixware.  (Also, POSIX-2008 marks _setjmp as obsolescent.)
1213         * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1214         (png_load_body) [HAVE_PNG]:
1215         (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1216         (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1217         Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1218         since PNG requires jmp_buf.  This is the only exception to the
1219         general rule that we now use sys_setjmp and sys_longjmp.
1220         This exception is OK since this code does not change the signal
1221         mask or longjmp out of a signal handler.
1223 2012-09-14  Paul Eggert  <eggert@cs.ucla.edu>
1225         * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1226         Include "syssignal.h", for 'main_thread'.
1228 2012-09-14  Dmitry Antipov  <dmantipov@yandex.ru>
1230         Avoid out-of-range marker position (Bug#12426).
1231         * insdel.c (replace_range, replace_range_2):
1232         Adjust markers before overlays, as suggested by comments.
1233         (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1234         Remove redundant check before calling offset_intervals.
1236 2012-09-14  Martin Rudalics  <rudalics@gmx.at>
1238         * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1239         current buffer (Bug#12387).
1241 2012-09-14  Juanma Barranquero  <lekktu@gmail.com>
1243         * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1245 2012-09-13  Paul Eggert  <eggert@cs.ucla.edu>
1247         Use a more backwards-compatible timer format (Bug#12430).
1248         * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1249         vector element, not from the 4th, since PSECS is now at the end.
1250         (Fcurrent_idle_time): Doc fix.
1252 2012-09-13  Dmitry Antipov  <dmantipov@yandex.ru>
1254         Function to mark objects and remove killed buffers at once.
1255         * alloc.c (discard_killed_buffers): Rename to ...
1256         (mark_discard_killed buffers) ... new name.  Add marking
1257         of remaining objects.  Fix comment.  Adjust users.
1258         (mark_object): Do not touch frame buffer lists here.
1259         * frame.c (delete_frame): Reset frame buffer lists here.
1261 2012-09-13  Paul Eggert  <eggert@cs.ucla.edu>
1263         Better workaround for GNOME bug when --enable-gcc-warnings.
1264         * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1265         Instead, disable -Wunused-local-typedefs.  See Dmitry Antipov in
1266         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1268         Simplify SIGIO usage (Bug#12408).
1269         The code that dealt with SIGIO was crufty and confusing, e.g., it
1270         played tricks like "#undef SIGIO" but these tricks were not used
1271         consistently.  Simplify mostly by not #undeffing standard symbols,
1272         e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1273         or not as we please) rather than "defined SIGIO" (standard symbol
1274         that we probably shouldn't #undef).
1275         * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1276         Modules that need it can include it.
1277         [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1278         * dispextern.h (ignore_sigio): New decl.
1279         * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1280         unconditionally, since it's now a no-op if !USABLE_SIGIO.
1281         * emacs.c (shut_down_emacs):
1282         * keyboard.c (kbd_buffer_store_event_hold):
1283         Use ignore_sigio rather than invoking 'signal' directly.
1284         * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1285         for FIONREAD.
1286         (FIONREAD, SIGIO): Do not #undef.
1287         (tty_read_avail_input): Use #error rather than a syntax error.
1288         * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1289         for I_PIPE, used by SETUP_SLAVE_PTY.
1290         (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1291         * sysdep.c (croak): Remove; no longer needed.  This bit of
1292         temporary code, with Fred N. Fish's comment that it's temporary,
1293         has been in Emacs since at least 1992!
1294         (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1295         Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1296         * syssignal.h (croak): Remove decl.
1297         (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1298         * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1299         now that we're termios-only.
1300         (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1301         * term.c (dissociate_if_controlling_tty): Use #error rather than
1302         a run-time error.
1304         Work around GCC and GNOME bugs when --enable-gcc-warnings.
1305         * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1306         to work around GNOME bug 683906.
1307         * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1308         (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1309         This works around GCC bug 54561.
1311 2012-09-12  Paul Eggert  <eggert@cs.ucla.edu>
1313         More fixes for 'volatile' and setjmp/longjmp.
1314         * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1315         * image.c (struct png_load_context) [HAVE_PNG]: New type.
1316         (png_load_body) [HAVE_PNG]:
1317         (jpeg_load_body) [HAVE_JPEG]:
1318         New function, with most of the old parent function's body.
1319         (png_load) [HAVE_PNG]:
1320         (jpeg_load) [HAVE_JPEG]:
1321         Invoke the new function, to avoid longjmp munging our locals.
1322         (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1323         (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1324         longjmp is passed 2, as the C standard doesn't guarantee this.
1325         Instead, store the failure code into mgr->failure_code.
1327 2012-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
1329         * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1330         (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1331         (syms_of_keyboard): Remove support for unread-command-char.
1333 2012-09-12  Eli Zaretskii  <eliz@gnu.org>
1335         * w32proc.c (sys_kill): If PID is our process ID and the signal is
1336         SIGABRT, call emacs_abort.  Avoids silently exiting upon assertion
1337         violation.  (Bug#12426)
1339 2012-09-12  Paul Eggert  <eggert@cs.ucla.edu>
1341         * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1343 2012-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
1345         * eval.c: Add `inhibit-debugger'.
1346         (Qinhibit_debugger): New symbol.
1347         (call_debugger): Bind it instead of Qdebug_on_error.
1348         (maybe_call_debugger): Test Vinhibit_debugger.
1349         (syms_of_eval): Define inhibit-debugger.
1350         * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1351         (syms_of_xdisp): Remove inhibit-debug-on-message.
1353 2012-09-11  Paul Eggert  <eggert@cs.ucla.edu>
1355         Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1356         If a nonvolatile local variable is written before a _longjmp to
1357         the frame containing the variable, and is read after the _longjmp,
1358         the value read is indeterminate.  Some local variables of type
1359         'struct handler' and 'struct catchtag' are used in this way, so
1360         mark each of their slots as volatile if the slot can be set before
1361         _longjmp and read afterwards.
1362         * lisp.h (struct handler): var and chosen_clause are now volatile.
1363         (struct catchtag): val, next, and pdlcount are now volatile.
1365         * bidi.c (bidi_push_it, bidi_pop_it):
1366         * fns.c (copy_hash_table):
1367         * image.c (define_image_type):
1368         * keyboard.c (kbd_buffer_store_event_hold):
1369         * process.c (Fprocess_send_eof):
1370         * xfaces.c (x_create_gc) [HAVE_NS]:
1371         * xgselect.c (xg_select):
1372         Prefer assignment to memcpy when either will do.
1374         * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1375         Use pointer-to-a-pointer to simplify and avoid a NILP check each
1376         time an item is removed.  No need to mark this function 'inline';
1377         the compiler knows better than we do.
1379 2012-09-11  Jan Djärv  <jan.h.d@swipnet.se>
1381         * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1382         (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1383         to change_frame_size (Bug#12388).
1384         (windowDidResize:): Pass YES to updateFrameSize.
1386         * nsterm.h: Add delay parameter to updateFrameSize.
1388 2012-09-11  Dmitry Antipov  <dmantipov@yandex.ru>
1390         Discard killed buffers from deleted window and frame objects.
1391         This reduces an amount of references to killed buffers and
1392         helps GC to reclaim them faster.
1393         * alloc.c (discard_killed_buffers): New function.
1394         (mark_object): Use it for deleted windows and frames.
1395         (mark_object): If symbol's value is set up for a killed buffer
1396         or deleted frame, restore it's global binding.
1397         * data.c (swap_in_global_binding): Add GC notice.
1398         (swap_in_symval_forwarding): Use convenient set_blv_where.
1399         * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1400         * window.h: ... to here.
1402 2012-09-11  Dmitry Antipov  <dmantipov@yandex.ru>
1404         Convenient macro to check whether the buffer is live.
1405         * buffer.h (BUFFER_LIVE_P): New macro.
1406         * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1407         * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1409 2012-09-11  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
1411         * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1412         composition cases (Bug#12364).
1414         * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1415         overhang of succeeding glyphs overlapping box cursor.
1417         * w32term.c (x_draw_glyph_string): Likewise.
1419 2012-09-11  Paul Eggert  <eggert@cs.ucla.edu>
1421         Simplify, document, and port floating-point (Bug#12381).
1422         The porting part of this patch fixes bugs on non-IEEE platforms
1423         with frexp, ldexp, logb.
1424         * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1425         Now static.
1426         * floatfns.c: Simplify discussion of functions that Emacs doesn't
1427         support, by removing commented-out code and briefly listing the
1428         C89 functions excluded.  The commented-out stuff was confusing
1429         maintenance, e.g., we thought we needed cbrt but it was commented out.
1430         (logb): Remove decl; no longer needed.
1431         (isfinite): New macro, if not already supplied.
1432         (isnan): Don't replace any existing macro.
1433         (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1434         are present on all C89 platforms.
1435         (Ffrexp): Do not special-case zero, as frexp does the right thing
1436         for that case.
1437         (Flogb): Do not use logb, as it doesn't have the desired meaning
1438         on hosts that use non-base-2 floating point.  Instead, stick with
1439         frexp, which is C89 anyway.  Do not pass an infinity or a NaN to
1440         frexp, to avoid getting an unspecified result.
1442         * xdisp.c (Qinhibit_debug_on_message): Now static.
1444 2012-09-10  Jan Djärv  <jan.h.d@swipnet.se>
1446         * nsterm.m (ns_update_begin): Set clip path to whole view by using
1447         NSBezierPath (Bug#12131).
1449 2012-09-10  Chong Yidong  <cyd@gnu.org>
1451         * fns.c (Fdelq, Fdelete): Doc fix.
1453 2012-09-10  Paul Eggert  <eggert@cs.ucla.edu>
1455         * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1456         (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1458 2012-09-09  Stefan Monnier  <monnier@iro.umontreal.ca>
1460         * lisp.h (make_lisp_ptr): New macro to replace XSET.
1461         (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1462         Use it.
1464 2012-09-09  Eli Zaretskii  <eliz@gnu.org>
1466         * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1467         left fringe if the window has a left margin.  This avoids leaving
1468         traces of the cursor because its leftmost pixel is not drawn over.
1470         * dispnew.c (update_window_line): When the left margin area of a
1471         screen line is updated, set the redraw_fringe_bitmaps_p flag of
1472         that screen line.  (Bug#12277)
1474 2012-09-09  Paul Eggert  <eggert@cs.ucla.edu>
1476         Assume C89 or later for math functions (Bug#12381).
1477         This simplifies the code, and makes it a bit smaller and faster,
1478         and (most important) makes it easier to clean up signal handling
1479         since we can stop worring about floating-point exceptions in
1480         library code.  That was a problem before C89, but the problem
1481         went away many years ago on all practical Emacs targets.
1482         * data.c, image.c, lread.c, print.c:
1483         Don't include <math.h>; no longer needed.
1484         * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1485         might be autoconfigured, as that never happens.
1486         * data.c (fmod):
1487         * doprnt.c (DBL_MAX_10_EXP):
1488         * print.c (DBL_DIG):
1489         Remove.  C89 or later always defines these.
1490         * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1491         (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1492         (arith_error, domain_error, domain_error2):
1493         Remove all this pre-C89 cruft.  Do not include <errno.h> as that's
1494         no longer needed -- we simply return what C returns.  All uses removed.
1495         (IN_FLOAT, IN_FLOAT2): Remove.  All uses replaced with
1496         the wrapped code.
1497         (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1498         Remove.  All uses expanded, as these macros are no longer used
1499         more than once and are now more trouble than they're worth.
1500         (Ftan): Use tan, not sin / cos.
1501         (Flogb): Assume C89 frexp.
1502         (fmod_float): Assume C89 fmod.
1503         (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1504         (init_floatfns): Remove.  All uses removed.
1506 2012-09-08  Jan Djärv  <jan.h.d@swipnet.se>
1508         * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1509         compositeToPoint for OSX < 10.6 (Bug#12390).
1511 2012-09-08  Paul Eggert  <eggert@cs.ucla.edu>
1513         * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1514         This produces more-accurate results.
1516 2012-09-08  Jan Djärv  <jan.h.d@swipnet.se>
1518         * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1519         changes (Bug#12088).
1521 2012-09-08  Chong Yidong  <cyd@gnu.org>
1523         * syntax.c (Fstring_to_syntax): Doc fix.
1525 2012-09-08  Jan Djärv  <jan.h.d@swipnet.se>
1527         * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1528         in the internal border.
1529         (x_set_window_size): Remove static variables and their usage.
1530         (ns_redraw_scroll_bars): Fix NSTRACE arg.
1531         (ns_after_update_window_line, ns_draw_fringe_bitmap):
1532         Remove fringe/internal border adjustment (Bug#11052).
1533         (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1534         (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1535         (ns_fix_rect_ibw): Remove.
1536         (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1537         (ns_dumpglyphs_box_or_relief): Ditto.
1538         (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1539         adjustment.
1540         (ns_dumpglyphs_image): Ditto.
1541         (ns_dumpglyphs_stretch): Fix coding style.  Remove fringe/internal
1542         border adjustment.
1543         (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1544         their usage.  Add fringe_extended_p and its use as in other terms.
1545         (ns_judge_scroll_bars): Code style fix.  Call updateFrameSize if
1546         scroll bar was removed.
1547         (updateFrameSize): New function.
1548         (windowDidResize): Move code to updateFrameSize and call it.
1550         * nsterm.h (EmacsView): Add updateFrameSize.
1552 2012-09-07  Chong Yidong  <cyd@gnu.org>
1554         * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1556         * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1558 2012-09-07  Paul Eggert  <eggert@cs.ucla.edu>
1560         More signal-handler cleanup (Bug#12327).
1561         * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1562         Problem introduced when merging patches.  Noted by Eli Zaretskii in
1563         <http://bugs.gnu.org/12327#67>.
1564         * floatfns.c: Comment fix.
1565         * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1566         SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1567         and anyway the declaration is harmless even if SIGDANGER is not defined.
1568         * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1569         defined BROKEN_FIONREAD).  systty.h formerly did this, but other
1570         source files not surprisingly expected syssignal.h to define, or
1571         not define, SIGIO, and it's cleaner to do it that way, for consistency.
1572         Include <sys/ioctl.h>, for FIONREAD.
1573         * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1574         This eliminates a problem whereby other files mysteriously had
1575         to include "syssignal.h" before including "systty.h" if they
1576         wanted to use "#ifdef SIGIO".
1578 2012-09-07  Eli Zaretskii  <eliz@gnu.org>
1580         * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1582         * w32.c (sigemptyset): Empty the set.
1583         (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1585         * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1587 2012-09-07  Dmitry Antipov  <dmantipov@yandex.ru>
1589         * alloc.c (mark_buffer): Revert unsafe marking optimization.
1590         (mark_object): Likewise for frame objects.
1592 2012-09-07  Paul Eggert  <eggert@cs.ucla.edu>
1594         * syssignal.h (handle_on_main_thread): Always declare,
1595         even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1596         This ports to platforms without HAVE_PTHREAD.
1598 2012-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1600         Signal-handler cleanup (Bug#12327).
1601         Emacs's signal handlers were written in the old 4.2BSD style with
1602         sigblock and sigmask and so forth, and this led to some
1603         inefficiencies and confusion.  Rewrite these to use
1604         pthread_sigmask etc. without copying signal sets around.  Also,
1605         get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1606         'signal', and instead use functions that do not attempt to take
1607         over the system name space.  This patch causes Emacs's text
1608         segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1609         * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1610         Do not include <signal.h> or "syssignal.h", as these
1611         modules do not use signals.
1612         * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1613         * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1614         Do not include <signal.h>, as "syssignal.h" does that for us now.
1615         * atimer.c (sigmask_atimers): New function.
1616         (block_atimers, unblock_atimers): New functions,
1617         replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1618         All uses replaced.
1619         * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1620         no longer needed here.
1621         * emacs.c (main): Inspect existing signal handler with sigaction,
1622         so that there's no need to block and unblock SIGHUP.
1623         * sysdep.c (struct save_signal): New member 'action', replacing
1624         old member 'handler'.
1625         (save_signal_handlers, restore_signal_handlers):
1626         Use sigaction instead of 'signal' to save and restore.
1627         (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1628         New function.  All users of 'signal' modified to use set_sighandler
1629         if they're writeonly, and to use sys_signal if they're read+write.
1630         (emacs_sigaction_init, forwarded_signal): New functions.
1631         (sys_signal): Remove.  All uses replaced by calls to sigaction
1632         and emacs_sigaction_init, or by direct calls to 'signal'.
1633         (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1634         (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1635         all uses replaced by pthread_sigmask etc. calls.
1636         * syssignal.h: Include <signal.h>.
1637         (emacs_sigaction_init, forwarded_signal): New decls.
1638         (SIGMASKTYPE): Remove.  All uses replaced by its definiens, sigset_t.
1639         (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1640         (sigmask, sys_sigmask): Remove; no longer needed.
1641         (sigpause): Remove.  All uses replaced by its definiens, sigsuspend.
1642         (sigblock, sigunblock, sigfree):
1643         (sigsetmask) [!defined sigsetmask]:
1644         Remove.  All uses replaced by pthread_sigmask.
1645         (signal): Remove.  Its remaining uses (with SIG_DFL and SIG_IGN)
1646         no longer need to be replaced, and its typical old uses
1647         are now done via emacs_sigaction_init and sigaction.
1648         (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1649         (sys_sigdel): Remove; unused.
1650         (NSIG): Remove a FIXME; the code's fine.  Remove an unnecessary ifdef.
1652 2012-09-06  Eli Zaretskii  <eliz@gnu.org>
1654         * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1655         SIGCHLD handling on systems that don't have WNOHANG.  (Bug#12327)
1657 2012-09-06  Dmitry Antipov  <dmantipov@yandex.ru>
1659         Explicitly mark buffer_defaults and buffer_local_symbols.
1660         * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1661         mark_local_symbols here.
1662         (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1663         since special buffers aren't marked here any more.
1664         (allocate_buffer): Chain new buffer with all_buffers here...
1665         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1666         not here.
1667         (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1668         (syms_of_buffer): Remove staticpro of the above.
1669         (init_buffer_once): Set names for buffer_defaults and
1670         buffer_local_symbols.
1672 2012-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1674         Use bool for booleans in font-related modules.
1675         * font.c (font_intern_prop, font_style_to_value)
1676         (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1677         (generate_otf_features, font_check_otf_features, font_check_otf)
1678         (font_match_p, font_list_entities, font_at):
1679         * fontset.c (fontset_id_valid_p, reorder_font_vector
1680         (fontset_find_font, Fset_fontset_font)
1681         (face_suitable_for_char_p) [0]:
1682         * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1683         (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1684         (m17n_flt_initialized, ftfont_shape_by_flt):
1685         * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1686         * nsfont.m (nsfont_draw):
1687         * w32font.c (w32font_draw):
1688         * w32term.c (x_draw_glyphless_glyph_string_foreground):
1689         Use bool for booleans.
1690         * font.h: Adjust to above API changes.
1691         (struct font, struct font_driver, struct font_driver_list):
1692         Use bool for booleans.
1693         (struct font): Remove useless member encoding_type.
1694         All users removed.
1695         * fontset.c, xftfont.c: Omit unnecessary static decls.
1697 2012-09-06  Dmitry Antipov  <dmantipov@yandex.ru>
1699         * alloc.c (mark_object): Revert window marking code
1700         since it's unsafe for the Fset_window_configuration.
1702 2012-09-05  Paul Eggert  <eggert@cs.ucla.edu>
1704         Fix race conditions with signal handlers and errno (Bug#12327).
1705         Be more systematic about preserving errno whenever a signal
1706         handler returns, even if it's not in the main thread.  Do this by
1707         renaming signal handlers to distinguish between signal delivery
1708         and signal handling.  All uses changed.
1709         * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1710         * data.c (deliver_arith_signal): Rename from arith_error.
1711         * dispnew.c (deliver_window_change_signal): Rename from
1712         window_change_signal.
1713         * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1714         (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1715         * keyboard.c (deliver_input_available_signal): Rename from
1716         input_available_signal.
1717         (deliver_user_signal): Rename from handle_user_signal.
1718         (deliver_interrupt_signal): Rename from interrupt_signal.
1719         * process.c (deliver_pipe_signal): Rename from send_process_trap.
1720         (deliver_child_signal): Rename from sigchld_handler.
1721         * atimer.c (handle_alarm_signal):
1722         * data.c (handle_arith_signal):
1723         * dispnew.c (handle_window_change_signal):
1724         * emacs.c (handle_fatal_signal, handle_danger_signal):
1725         * keyboard.c (handle_input_available_signal):
1726         * keyboard.c (handle_user_signal, handle_interrupt_signal):
1727         * process.c (handle_pipe_signal, handle_child_signal):
1728         New functions, with the actual signal-handling code taken from the
1729         original respective signal handlers, sans the sporadic attempts to
1730         preserve errno, since that's now done by handle_on_main_thread.
1731         * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1732         * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1733         * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1734         Move to sysdep.c.
1735         (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1736         Move initialization of main_thread to sysdep.c's init_signals.
1737         * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1738         our usage, and simplifies the mainline code.
1739         (record_child_status_change): New static function, as a helper
1740         for handle_child_signal, and with most of the old child handler's
1741         contents.
1742         (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1743         (handle_child_signal): Use the above.
1744         * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1745         Moved here from emacs.c.
1746         (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1747         code moved here from emacs.c's main function.
1748         * sysdep.c, syssignal.h (handle_on_main_thread): New function,
1749         replacing the old SIGNAL_THREAD_CHECK.  All uses changed.
1750         This lets callers save and restore errno properly.
1752 2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
1754         Remove redundant or unused things here and there.
1755         * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1756         * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1757         * editfns.c (Fcompare_buffer_substrings): Likewise.
1758         * frame.h (struct terminal, struct font_driver_list):
1759         Remove redundant declarations.
1760         * window.h (Qleft, Qright): Likewise.
1762 2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
1764         Do not mark objects from deleted buffers, windows and frames.
1765         * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1766         (mark_object): Likewise for windows and frames.
1768 2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
1770         * alloc.c (valid_lisp_object_p): Treat killed buffers,
1771         buffer_defaults and buffer_local_symbols as valid objects.
1772         Return special value to denote them.
1774 2012-09-05  Paul Eggert  <eggert@cs.ucla.edu>
1776         * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1777         * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1778         (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1779         (file_name_absolute_p, Fsubstitute_in_file_name):
1780         (check_executable, check_writable, Ffile_accessible_directory_p)
1781         (Fset_file_selinux_context, Fdefault_file_modes)
1782         (Finsert_file_contents, choose_write_coding_system)
1783         (Fwrite_region, build_annotations, a_write, e_write)
1784         (Fdo_auto_save):
1785         * filelock.c (boot_time_initialized, get_boot_time)
1786         (get_boot_time_1, lock_file_1, within_one_second):
1787         * floatfns.c (in_float):
1788         * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1789         (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1790         (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1791         * lisp.h (struct Lisp_Hash_Table.cmpfn):
1792         * window.c (compare_window_configurations):
1793         Use bool for booleans.
1794         * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1795         (Fdefault_file_modes): Now mode_t, not int, for modes.
1796         (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1797         (internal_delete_file): Now returns void, not a (boolean) int,
1798         since nobody was looking at the return value.
1799         * lisp.h, window.h: Adjust to above API changes.
1801         * xdisp.c (set_message): Simplify and reindent last change.
1803 2012-09-05  Juanma Barranquero  <lekktu@gmail.com>
1805         * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1807 2012-09-04  Lars Ingebrigtsen  <larsi@gnus.org>
1809         * eval.c (call_debugger): Make the function non-static so that we
1810         can call it from set_message.
1812         * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1813         (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1815 2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
1817         Give more-useful info on a fatal error (Bug#12328).
1818         * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1819         (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1820         of doing the work ourselves.
1821         * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1822         do most of the work.
1823         (fatal_error_backtrace): New function, taken from the guts
1824         of the old fatal_error_signal, but with a new option to output
1825         a backtrace.
1826         (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1827         info about the signal than just its number.
1828         * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1829         * sysdep.c: Include <execinfo.h>
1830         (emacs_backtrace): New function, taken partly from the previous
1831         code of the 'die' function.
1832         (emacs_abort): Call fatal_error_backtrace rather than abort.
1834 2012-09-04  Stefan Monnier  <monnier@iro.umontreal.ca>
1836         * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1837         eager (load-time) macro-expansion.
1838         * lisp.mk (lisp): Add macroexp.
1840 2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
1842         Simplify redefinition of 'abort' (Bug#12316).
1843         Do not try to redefine the 'abort' function.  Instead, redo
1844         the code so that it calls 'emacs_abort' rather than 'abort'.
1845         This removes the need for the NO_ABORT configure-time macro
1846         and makes it easier to change the abort code to do a backtrace.
1847         * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1848         * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1849         Remove; sysdep.c's emacs_abort now takes its place.
1850         * lisp.h (emacs_abort): New decl.  All calls from Emacs code to
1851         'abort' changed to use 'emacs_abort'.
1852         * msdos.c (dos_abort) [defined abort]: Remove; not used.
1853         (abort) [!defined abort]: Rename to ...
1854         (emacs_abort): ... new name.
1855         * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1856         the place of the old 'abort' in emacs.c.
1857         * w32.c, w32fns.c (abort): Do not #undef.
1858         * w32.c (emacs_abort): Rename from w32_abort.
1860 2012-09-04  Eli Zaretskii  <eliz@gnu.org>
1862         * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1863         offsets[j].dv, since the y axis of the screen coordinates points
1864         down, while the y axis of the font definition coordinates points
1865         up.  This fixes display of Arabic diacritics such as KASRA and
1866         KASRATAN.  (Bug#11860)
1868 2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
1870         Be more systematic about _setjmp vs setjmp.
1871         * alloc.c (test_setjmp, mark_stack):
1872         * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1873         (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1874         (png_load, my_error_exit, jpeg_load):
1875         * process.c (send_process_trap, send_process):
1876         Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1877         The underscored versions are up to 30x faster on some hosts.
1878         Formerly, the code used setjmp+longjmp sometimes and
1879         _setjmp+_longjmp at other times, with no particular reason to
1880         prefer setjmp+longjmp.
1882 2012-09-03  Paul Eggert  <eggert@cs.ucla.edu>
1884         Fix minor problem found by static checking.
1885         * buffer.c (Fdelete_all_overlays): Return nil.
1887 2012-09-03  Martin Rudalics  <rudalics@gmx.at>
1889         * buffer.c (Fdelete_all_overlays): New function.
1891 2012-09-03  Chong Yidong  <cyd@gnu.org>
1893         * gtkutil.c: Add extern decl for Qxft.
1895 2012-09-02  Paul Eggert  <eggert@cs.ucla.edu>
1897         * emacs.c, eval.c: Use bool for boolean.
1898         * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1899         (malloc_using_checking) [DOUG_LEA_MALLOC]:
1900         (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1901         (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1902         (main, decode_env_path, Fdaemon_initialized):
1903         * eval.c (call_debugger, Finteractive_p, interactive_p):
1904         (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1905         (maybe_call_debugger, Fbacktrace):
1906         * process.c (read_process_output, exec_sentinel):
1907         Use bool for booleans.
1908         * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1909         All callers changed.
1910         * eval.c (interactive_p): Omit always-true boolean argument
1911         EXCLUDE_SUBRS_P.  All callers changed.
1912         * dispextern.h, lisp.h: Reflect above API changes.
1913         * firstfile.c (dummy): Use the address of 'main', whose signature
1914         won't change, instead of the address of 'initialize', whose
1915         signature just changed from int to bool.
1916         * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1917         * msdos.c (fatal_error_in_progress): ... from here.
1918         * xdisp.c (redisplaying_p): Now a boolean.  Set it to 1 instead
1919         of incrementing it.
1920         (redisplay_internal, unwind_redisplay): Simply clear
1921         REDISPLAYING_P when unwinding, instead of saving its previous,
1922         always-false value and then restoring it.
1924         Clean up some extern decls.
1925         Mostly, this hoists extern decls out of .c files and into .h files.
1926         That way, we're more likely to catch errors if the interfaces change.
1927         * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1928         declare xg_mark_data.
1929         * dispextern.h (x_frame_parm_handlers):
1930         * font.h (Qxft):
1931         * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1932         (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1933         (Qultra_bold, Qoblique, Qitalic):
1934         Move extern decl here from .c file.
1935         * alloc.c (xg_mark_data) [USE_GTK]:
1936         * doc.c (Qclosure):
1937         * eval.c (Qlexical_binding):
1938         * fns.c (time) [!HAVE_UNISTD_H]:
1939         * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1940         (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1941         * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1942         * lread.c (Qinternal_interpreter_environment):
1943         * minibuf.c (Qbuffer):
1944         * process.c (QCfamily, QCfilter):
1945         * widget.c (free_frame_faces):
1946         * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1947         * xfont.c (x_clear_errors):
1948         * xterm.c (x_frame_parm_handlers):
1949         Remove now-redundant extern decls.
1950         * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1951         * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1952         Now static.
1953         * xfaces.c: Remove unnecessary static decls.
1954         * xterm.c (updating_frame): Remove decl of nonexistent object.
1956         * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1957         when building globals.h, as the objects that are not built on
1958         this host are not needed to compile C files on this host.
1960 2012-09-02  Jan Djärv  <jan.h.d@swipnet.se>
1962         * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1964         * frame.h: Add missing prototype for x_wm_set_size_hint.
1966 2012-09-02  Paul Eggert  <eggert@cs.ucla.edu>
1968         * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1969         * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1970         (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1971         (Fsubstitute_command_keys):
1972         * editfns.c (region_limit, find_field, Fconstrain_to_field)
1973         (save_excursion_save, save_excursion_restore)
1974         (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1975         (format_time_string, general_insert_function)
1976         (make_buffer_string, make_buffer_string_both)
1977         (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1978         * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1979         (copy_text, insert_1, insert_1_both, insert_from_string)
1980         (insert_from_string_before_markers, insert_from_string_1)
1981         (insert_from_buffer, insert_from_buffer_1, replace_range)
1982         (replace_range_2, del_range_1, del_range_byte, del_range_both)
1983         (del_range_2, modify_region):
1984         * intervals.c (intervals_equal, balance_possible_root_interval)
1985         (adjust_intervals_for_insertion, merge_properties_sticky)
1986         (graft_intervals_into_buffer, lookup_char_property)
1987         (adjust_for_invis_intang, set_point_both)
1988         (get_property_and_range, compare_string_intervals)
1989         (set_intervals_multibyte_1, set_intervals_multibyte):
1990         * keyboard.c (decode_timer):
1991         Use bool for boolean.
1992         * intervals.h, lisp.h, systime.h: Reflect above API changes.
1993         * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1995 2012-09-02  Chong Yidong  <cyd@gnu.org>
1997         * keymap.c (push_key_description): Print M-TAB as C-M-i
1998         (Bug#11758).
2000 2012-09-02  Juanma Barranquero  <lekktu@gmail.com>
2002         * makefile.w32-in (CCL_H, W32FONT_H): New macros.
2003         (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
2004         ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
2005         ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
2006         ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
2007         ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
2008         ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2010 2012-09-01  Eli Zaretskii  <eliz@gnu.org>
2012         * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2013         more than one grapheme cluster passed to the shaper: compute the
2014         offset adjustment values separately for each cluster.  (Bug#11860)
2016         * image.c: Restore mistakenly removed inclusion of w32.h.  Without
2017         it, GCC doesn't see prototypes of w32_delayed_load, and complains
2018         about implicit conversions from integer to pointer.
2020 2012-09-01  Daniel Colascione  <dancol@dancol.org>
2022         * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2023         system used too early.
2025 2012-09-01  Paul Eggert  <eggert@cs.ucla.edu>
2027         Better seed support for (random).
2028         * emacs.c (main): Call init_random.
2029         * fns.c (Frandom): Set the seed from a string argument, if given.
2030         Remove long-obsolete Gentzel cruft.
2031         * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2032         (init_random): New function.
2034 2012-09-01  Daniel Colascione  <dancol@dancol.org>
2036         * xterm.h: Add header guards.  Declare x_menubar_window_to_frame.
2037         Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
2038         x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
2039         x_wm_set_size_hint, x_query_colors, x_real_positions,
2040         x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
2041         x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
2042         all of which have been moved to common code.
2044         * xfaces.c: Include TERM_HEADER instead of listing all possible
2045         window-system headers.
2047         * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2048         to match header.
2050         * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2051         directly accessing frame internals.
2053         * w32font.h: Include font.h.  Define syms_of_w32font and
2054         globals_of_w32font.
2056         * process.c: Include TERM_HEADER instead of listing all possible
2057         window-system headers.
2059         * nsterm.h: Remove declarations now in frame.h.
2060         Define FRAME_X_SCREEN, FRAME_X_VISUAL.
2062         * menu.c: Include TERM_HEADER instead of listing all possible
2063         window-system headers.
2065         * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2066         window system.
2068         * keyboard.c: Include TERM_HEADER instead of listing all possible
2069         window-system headers.
2071         * image.c: Include TERM_HEADER instead of listing all possible
2072         window-system headers.  Declare Vlibrary_cache when compiling for
2073         Windows.
2075         * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2076         window system declarations.
2078         * frame.h: Move common functions here: set_frame_menubar,
2079         x_set_window_size, x_sync, x_get_focus_frame,
2080         x_set_mouse_position, x_set_mouse_pixel_position,
2081         x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2082         x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2083         x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2084         x_activate_menubar, x_real_positions, x_bitmap_icon,
2085         x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2086         and x_query_colors.
2088         * frame.c: Include TERM_HEADER instead of listing all possible
2089         window-system headers.
2091         * font.c: Include TERM_HEADER instead of listing all possible
2092         window-system headers.
2094         * emacs.c: Include TERM_HEADER.
2096         * dispnew.c: Include TERM_HEADER instead of listing all possible
2097         window-system headers.
2099         * ccl.h: Include character.h.
2101         * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2102         the current window system; include in list of objects to link into
2103         Emacs.
2105 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
2107         Remove mark_ttys function and fix tty_display_info initialization.
2108         * lisp.h (mark_ttys): Remove prototype.
2109         * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2110         to mark_ttys because all possible values of 'top_frame' slot are
2111         the frames which are reachable from Vframe_list.
2112         * term.c (mark_ttys): Remove.
2113         (init_tty): Safely initialize 'top_frame' slot with Qnil.
2115 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
2117         Change struct frame bitfields from unsigned char to unsigned.
2118         * frame.h (struct frame): Change type of 'display_preempted',
2119         'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2120         'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2121         'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2122         bitfields from unsigned char to unsigned.
2124 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
2126         Remove unused member of struct x_output and struct w32_output.
2127         * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2128         * w32term.h (struct w32_output): Likewise.
2130 2012-08-30  Jan Djärv  <jan.h.d@swipnet.se>
2132         * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2133         does not become zero (Bug#12234).
2135 2012-08-30  Paul Eggert  <eggert@cs.ucla.edu>
2137         * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2138         for GCC 4.7.1 x86-64.
2140 2012-08-30  Glenn Morris  <rgm@gnu.org>
2142         * lread.c (init_lread): For out-of-tree builds, only add the
2143         source directory's site-lisp dir to the load-path if it exists,
2144         consistent with in-tree builds.  (Bug#12302)
2146 2012-08-28  Jan Djärv  <jan.h.d@swipnet.se>
2148         * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
2149         button_values to NULL.  Call setStykeMask so dialogs get a close button.
2150         (windowShouldClose:): Set window_closed.
2151         (dealloc): New member, free button_values.
2152         (process_dialog:): Make member function.  Remove window argument,
2153         replace window with self.  Count buttons and allocate and store values
2154         in button_values.
2155         (addButton:value:row:): value is int with the name tag.  Call setTag
2156         with tag.  Remove return self, declare return value as void.
2157         (addString:row:): Remove return self, declare return value as void.
2158         (addSplit): Remove return self, declare return value as void.
2159         (clicked:): Remove return self, declare return value as void.
2160         Set dialog_return to button_values[seltag].  Code formatting change.
2161         (initFromContents:isQuestion:): Adjust call to process_dialog.
2162         Code formatting change.
2163         (timeout_handler:): Set timer_fired to YES.
2164         (runDialogAt:): Set timer_fired to NO.
2165         Handle click on close button as quit.
2167         * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2168         Add window_closed and button_values.  Add void as return value for
2169         add(Button|String|Split).  addButton takes int instead of Lisp_Object.
2170         Add process_dialog as new member.
2172 2012-08-28  Eli Zaretskii  <eliz@gnu.org>
2174         * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2175         is not one of the heaps we manage.  (Bug#12242)
2177 2012-08-28  Glenn Morris  <rgm@gnu.org>
2179         * eval.c (Fcalled_interactively_p): Doc fix.  (Bug#11747)
2181 2012-08-28  Martin Rudalics  <rudalics@gmx.at>
2183         * window.c (Fset_window_configuration): Remove handling of
2184         auto-buffer-name window parameter.  Install revision of reverted
2185         fix.
2187 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
2189         Do not allow to set major mode for a dead buffer.
2190         * buffer.c (Fset_buffer_major_mode): Signal an error
2191         if the buffer is dead.
2192         (Fother_buffer, other_buffer_safely): Remove redundant
2193         nested declaration.
2195 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
2197         Always use set_buffer_if_live to restore original buffer at unwind.
2198         * buffer.h (record_unwind_current_buffer): New function.
2199         * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2200         * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2201         * undo.c, window.c: Adjust users.
2202         * buffer.c (set_buffer_if_live): Fix comment.
2204 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
2206         Fix usage of set_buffer_internal.
2207         * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2208         * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2209         * coding.c (decode_coding): Omit redundant test.
2210         * fileio.c (decide_coding_unwind): Likewise.
2211         * fns.c (secure_hash): Likewise.
2212         * insdel.c (modify_region): Likewise.
2213         * keyboard.c (command_loop_1): Likewise.
2214         * print.c (PRINTFINISH): Likewise.
2215         * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2217 2012-08-27  Paul Eggert  <eggert@cs.ucla.edu>
2219         * dispnew.c: Use bool for boolean.
2220         (frame_garbaged, display_completed, delayed_size_change)
2221         (fonts_changed_p, add_window_display_history)
2222         (add_frame_display_history, verify_row_hash)
2223         (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2224         (row_equal_p, realloc_glyph_pool)
2225         (allocate_matrices_for_frame_redisplay)
2226         (showing_window_margins_p)
2227         (adjust_frame_glyphs_for_frame_redisplay)
2228         (build_frame_matrix_from_leaf_window, make_current)
2229         (mirrored_line_dance, mirror_line_dance, update_frame)
2230         (update_window_tree, update_single_window)
2231         (check_current_matrix_flags, update_window, update_text_area)
2232         (update_window_line, set_window_update_flags, scrolling_window)
2233         (update_frame_1, scrolling, buffer_posn_from_coords)
2234         (do_pending_window_change, change_frame_size)
2235         (change_frame_size_1, sit_for):
2236         Use bool for boolean.
2237         (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2238         and remove last int (actually boolean) argument, which was always 0.
2239         All callers changed.
2240         * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2241         * dispextern.h (struct composition_it): Use bool for boolean.
2242         (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2243         (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2244         * dired.c (file_name_completion):
2245         Use bool for boolean.  (This was missed in an earlier change.)
2247 2012-08-27  Martin Rudalics  <rudalics@gmx.at>
2249         * window.c (Fset_window_configuration): Revert first part of
2250         last change.
2252 2012-08-27  Jan Djärv  <jan.h.d@swipnet.se>
2254         * nsterm.h (NSPanel): New class variable dialog_return.
2256         * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2257         Initialize dialog_return.
2258         (windowShouldClose:): Use stop instead of stopModalWithCode.
2259         (clicked:): Ditto, and also set dialog_return (Bug#12258).
2260         (timeout_handler:): Use stop instead of abortModal.  Send a dummy
2261         event.
2262         (runDialogAt:): Make ret Lisp_Object.  Set it from dialog_return when
2263         modal loop returns.
2265 2012-08-27  Paul Eggert  <eggert@cs.ucla.edu>
2267         * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2268         * composite.c (find_composition, composition_gstring_p)
2269         (composition_reseat_it, find_automatic_composition):
2270         * data.c (let_shadows_buffer_binding_p)
2271         (let_shadows_global_binding_p, set_internal, make_blv)
2272         (Fmake_variable_buffer_local, Fmake_local_variable)
2273         (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2274         (cons_to_signed, arith_driver):
2275         * dbusbind.c (xd_in_read_queued_messages):
2276         * dired.c (directory_files_internal, file_name_completion):
2277         Use bool for booleans.
2278         * dired.c (file_name_completion):
2279         * process.h (fd_callback):
2280         Omit int (actually boolean) argument.  It wasn't being used.
2281         All uses changed.
2282         * composite.h, lisp.h: Reflect above API changes.
2284         * cmds.c, coding.c: Use bool for booleans.
2285         * cmds.c (move_point, Fself_insert_command):
2286         * coding.h (struct composition status, struct coding_system):
2287         * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2288         (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2289         (emacs_mule_char, decode_coding_emacs_mule)
2290         (encode_coding_emacs_mule, detect_coding_iso_2022)
2291         (decode_coding_iso_2022, encode_invocation_designation)
2292         (encode_designation_at_bol, encode_coding_iso_2022)
2293         (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2294         (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2295         (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2296         (encode_coding_raw_text, detect_coding_charset)
2297         (decode_coding_charset, encode_coding_charset, detect_eol)
2298         (detect_coding, get_translation_table, produce_chars)
2299         (consume_chars, reused_workbuf_in_use)
2300         (make_conversion_work_buffer, code_conversion_save)
2301         (decode_coding_object, encode_coding_object)
2302         (detect_coding_system, char_encodable_p)
2303         (Funencodable_char_position, code_convert_region)
2304         (code_convert_string, code_convert_string_norecord)
2305         (Fset_coding_system_priority):
2306         * fileio.c (Finsert_file_contents):
2307         Use bool for booleans.
2308         * coding.h, lisp.h: Reflect above API changes.
2309         * coding.c: Remove unnecessary static function decls.
2310         (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2311         (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2312         not a boolean 'int', since callers never look at the return value.
2313         (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2314         * coding.h (decoding_buffer_size, encoding_buffer_size)
2315         (emacs_mule_string_char): Remove unused extern decls.
2316         (struct iso_2022_spec, struct coding_system):
2317         Use 'unsigned int : 1' for boolean fields, since there's more than one.
2318         (struct emacs_mule_spec): Remove unused field 'full_support'.
2319         All initializations removed.
2320         * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2322 2012-08-27  Dmitry Antipov  <dmantipov@yandex.ru>
2324         Fix spare memory change (Bug#12286).
2325         * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2326         (valid_lisp_object_p): Likewise.
2328 2012-08-27  Martin Rudalics  <rudalics@gmx.at>
2330         * window.c (Fset_window_configuration): Record any window's old
2331         buffer if it's replaced (see Bug#8789).  If the new current
2332         buffer doesn't appear in the selected window, go to its old
2333         point (Bug#12208).
2335 2012-08-27  Dmitry Antipov  <dmantipov@yandex.ru>
2337         Special MEM_TYPE_SPARE to denote reserved memory.
2338         * alloc.c (enum mem_type): New memory type.
2339         (refill_memory_reserve): Use new type for spare memory.
2340         This prevents live_cons_p and live_string_p from incorrect
2341         detection of uninitialized objects from spare memory as live.
2343 2012-08-26  Paul Eggert  <eggert@cs.ucla.edu>
2345         Spelling fixes.
2346         * Makefile.in (.PHONY): versioclean -> versionclean.
2348         Remove unused external symbols.
2349         * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2350         * window.c (Qwindow_valid_p, decode_valid_window):
2351         Now static, not extern.
2352         * data.c (Qinterval): Remove; unused.
2353         (syms_of_data): Do not define 'interval'.
2354         * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2355         * window.h (decode_valid_window):
2356         Remove decls.
2358         * character.c, charset.c, chartab.c: Use bool for booleans.
2359         * character.c (lisp_string_width, string_count_byte8)
2360         (string_escape_byte8):
2361         * charset.c (charset_map_loaded, load_charset_map, read_hex):
2362         (load_charset_map_from_file, map_charset_chars)
2363         (Fdefine_charset_internal, define_charset_internal)
2364         (Fdeclare_equiv_charset, find_charsets_in_text)
2365         (Ffind_charset_region, char_charset, Fiso_charset):
2366         * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2367         (sub_char_table_set, sub_char_table_set_range)
2368         (char_table_set_range, optimize_sub_char_table)
2369         (map_sub_char_table):
2370         Use bool for boolean.
2371         * character.c (str_to_unibyte): Omit last boolean argument; it was
2372         always 0.  All callers changed.
2373         * character.h, charset.h: Adjust to match previous changes.
2374         * character.h (char_printable_p): Remove decl of nonexistent function.
2375         * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2376         ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2377         are all boolean, so make them single-bit bitfields.
2379         * lisp.h (ASET): Remove attempt to detect side effects.
2380         It was meant to be temporary and it often doesn't work,
2381         because when IDX has side effects the behavior of IDX==IDX
2382         is undefined.  See Stefan Monnier in
2383         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2385 2012-08-26  Barry OReilly  <gundaetiapo@gmail.com>  (tiny change)
2387         * lisp.h (functionp): New function (extracted from Ffunctionp).
2388         (FUNCTIONP): Use it.
2389         * eval.c (Ffunctionp): Use it.
2391 2012-08-25  Paul Eggert  <eggert@cs.ucla.edu>
2393         * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2394         as that's faster and simpler than static storage.  Don't bother
2395         with the g_main_context_query overhead if g_main_context_pending
2396         says no events are pending.
2397         (gfds, gfds_size): Remove these static vars.
2398         (xgselect_initialize): Remove; no longer needed.
2399         All uses and decls removed.
2401         * emacs.c (fatal_error_signal_hook): Remove.
2402         All uses removed.  This leftover from old code was always 0.
2404         * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2405         * casefiddle.c (casify_object, casify_region):
2406         * casetab.c (set_case_table):
2407         * category.c, category.h (word_boundary_p):
2408         * category.h (CHAR_HAS_CATEGORY):
2409         Use bool for booleans, instead of int.
2411 2012-08-25  Eli Zaretskii  <eliz@gnu.org>
2413         * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2415 2012-08-25  Paul Eggert  <eggert@cs.ucla.edu>
2417         On assertion failure, print backtrace if available.
2418         * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2419         (die) [ENABLE_CHECKING]: Print a backtrace if available.
2420         * Makefile.in (LIB_EXECINFO): New macro.
2421         (LIBES): Use it.
2423         * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2424         * bytecode.c (exec_byte_code):
2425         * callint.c (check_mark, Fcall_interactively):
2426         * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2427         (getenv_internal, sync_process_alive, call_process_exited):
2428         * lisp.h (USE_SAFE_ALLOCA):
2429         Use bool for booleans, instead of int.
2430         * lisp.h, process.h: Adjust prototypes to match above changes.
2431         * callint.c (Fcall_interactively): Don't assume the mark's
2432         offset fits in 'int'.
2434 2012-08-24  Paul Eggert  <eggert@cs.ucla.edu>
2436         * buffer.c, buffer.h: Use bool for boolean.
2437         * buffer.c (reset_buffer_local_variables)
2438         (buffer_lisp_local_variables, Fset_buffer_modified_p)
2439         (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2440         (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2441         (overlay_touches_p, overlay_strings, Foverlay_put)
2442         (report_overlay_modification, call_overlay_mod_hooks):
2443         (mmap_enlarge, mmap_set_vars):
2444         * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2445         Use bool for booleans, instead of int.
2446         * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2447         since the 1-or-0 return value is always ignored anyway.
2448         (mmap_initialized_p):
2449         * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2450         * buffer.h, lisp.h: Adjust prototypes to match above changes.
2452 2012-08-23  Paul Eggert  <eggert@cs.ucla.edu>
2454         * bidi.c: Use bool for boolean.
2455         This is a bit more readable, and makes the text segment of bidi.o
2456         0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2457         Presumably it's faster too.
2458         (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2459         Now bool.
2460         (bidi_cache_find_level_change, bidi_cache_iterator_state)
2461         (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2462         (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2463         (bidi_explicit_dir_char, bidi_level_of_next_char)
2464         (bidi_find_other_level_edge, bidi_move_to_visually_next):
2465         Use bool for booleans, instead of int.
2466         * dispextern.h (bidi_init_it, bidi_paragraph_init)
2467         (bidi_unshelve_cache): Adjust decls to match code.
2469 2012-08-23  Martin Rudalics  <rudalics@gmx.at>
2471         * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2472         argument.
2474 2012-08-23  Paul Eggert  <eggert@cs.ucla.edu>
2476         * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2477         * atimer.h: Include <stdbool.h>.
2479 2012-08-22  Dan Nicolaescu  <dann@gnu.org>
2481         * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2482         compile time tests instead of run time tests on systems that do
2483         not use them.
2484         (FRAME_MAC_P): Remove leftover from deleted code.
2485         * frame.c (syms_of_frame): Remove leftover from deleted code.
2487 2012-08-22  Jan Djärv  <jan.h.d@swipnet.se>
2489         * nsterm.m (insertText:): Don't clear modifiers if code is space.
2491 2012-08-22  Paul Eggert  <eggert@cs.ucla.edu>
2493         * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2494         Otherwise, the compiler complains about (A?B:C) where B is void
2495         and C is Lisp_Object.  This fixes an incompatibility with Sun C 5.12.
2496         (fontset_add): Return void, for FONTSET_ADD.
2498 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
2500         * alloc.c: Use bool for booleans.
2501         (gc_in_progress, abort_on_gc)
2502         (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2503         (dont_register_blocks) [GC_MALLOC_CHECK]:
2504         (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2505         (check_string_bytes, make_specified_string, memory_full)
2506         (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2507         (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2508         (mark_stack, valid_pointer_p, make_pure_string)
2509         (Fgarbage_collect, survives_gc_p, gc_sweep):
2510         Use bool for booleans, instead of int.
2511         (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2512         Remove unused local.
2513         * alloc.c (PURE_POINTER_P):
2514         * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2515         * editfns.c (Fformat):
2516         * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2517         (Fdo_auto_save):
2518         * fns.c (sweep_weak_table):
2519         * lisp.h (suppress_checking, push_message, survives_gc_p)
2520         (make_pure_string, gc_in_progress, abort_on_gc):
2521         * lread.c (readchar, read1):
2522         * print.c (Fprin1_to_string):
2523         * xdisp.c (push_message):
2524         Use bool for booleans affected directly or indirectly by
2525         alloc.c's changes.
2527         Make recently-introduced setters macros.
2528         * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2529         (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2530         (set_fontset_default, set_fontset_fallback): Rename from their
2531         upper-case counterparts, and make them functions rather than macros.
2532         This is more consistent with the other recently-introduced setters.
2533         These don't need to be inline, since they're local.
2535 2012-08-21  Jan Djärv  <jan.h.d@swipnet.se>
2537         * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2538         the loop (Bug#12247).
2540 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
2542         * lisp.h (vcopy): Use memcpy rather than our own loop.
2543         This fixes a performance regression introduced by the recent
2544         addition of vcopy.  This means 'vcopy' will need to be modified
2545         for a copying collector, but that's OK.  Also, tighten the
2546         checking in the assertion.
2548 2012-08-21  Eli Zaretskii  <eliz@gnu.org>
2550         * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2551         components for RTL text (Bug#11860).  Adjust X-OFFSET of each
2552         non-base glyph for the width of the base character, according to
2553         what x_draw_composite_glyph_string_foreground expects.
2554         Generate WADJUST value according to composition_gstring_width's
2555         expectations, to produce correct width of the composed character.
2556         Reverse the sign of the DU offset produced by ScriptPlace.
2558 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
2560         * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2562 2012-08-21  Dmitry Antipov  <dmantipov@yandex.ru>
2564         Avoid direct writes to contents member of struct Lisp_Vector.
2565         * lisp.h (vcopy): New function to copy data into vector.
2566         * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2567         * fns.c (Ffillarray): Use ASET.
2568         * keyboard.c (timer_check_2): Use AREF and ASET.
2569         (append_tool_bar_item, Frecent_keys): Use vcopy.
2570         * lread.c (read_vector): Use ASET.
2571         * msdos.c (Frecent_doskeys): Use vcopy.
2572         * xface.c (Finternal_copy_lisp_face): Use vcopy.
2573         (Finternal_merge_in_global_face): Use ASET and vcopy.
2574         * xfont.c (xfont_list_pattern): Likewise.
2576 2012-08-21  Martin Rudalics  <rudalics@gmx.at>
2578         * window.c (Fwindow_point): For the selected window always return
2579         the position of its buffer's point.
2580         (Fset_window_point): For the selected window always go in its
2581         buffer to the specified position.
2583 2012-08-21  Dmitry Antipov  <dmantipov@yandex.ru>
2585         Setter macros for fontsets.
2586         * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2587         (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2588         (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2589         Adjust users.
2591 2012-08-20  Glenn Morris  <rgm@gnu.org>
2593         * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2594         Don't assume that `ln -f' works.
2596 2012-08-20  Eli Zaretskii  <eliz@gnu.org>
2598         * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2599         and later about non-assignments with no effect.  See discussion at
2600         http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2601         details.
2603 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
2605         Inline setter functions for Lisp_Objects slots of struct specbinding.
2606         * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2607         Adjust users.
2609 2012-08-20  Martin Rudalics  <rudalics@gmx.at>
2611         * window.c (select_window): Always make selected window's buffer
2612         current.
2614 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
2616         Use AREF and ASET for docstrings of category tables.
2617         * category.h (CATEGORY_DOCSTRING): Use AREF.
2618         (SET_CATEGORY_DOCSTRING): Use ASET.
2619         * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2621 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
2623         Inline setter functions for hash table members.
2624         * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2625         (set_hash_hash, set_hash_index): Rename with _slot suffix.
2626         (set_hash_key_and_value, set_hash_index, set_hash_next)
2627         (set_hash_hash): New functions.
2628         * charset.c, fns.c: Adjust users.
2630 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
2632         Inline getter and setter functions for per-buffer values.
2633         * buffer.h (per_buffer_default, set_per_buffer_default)
2634         (per_buffer_value, set_per_buffer_value): New functions.
2635         (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2636         * buffer.c, data.c: Adjust users.
2638 2012-08-20  Juanma Barranquero  <lekktu@gmail.com>
2640         * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2642 2012-08-19  Paul Eggert  <eggert@cs.ucla.edu>
2644         Rely on <config.h> + <unistd.h> to declare 'environ',
2645         as gnulib does this if the system doesn't.
2646         * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
2647         Remove declaration.  MS-Windows declares it on stdlib.h which is
2648         included by conf_post.h.
2649         * emacs.c (environ) [DOUG_LEA_MALLOC]:
2650         * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2651         * vm-limit.c: Include <unistd.h>, for 'environ'.
2653         * unexaix.c, unexcoff.c: Include "mem-limits.h".
2654         (start_of_data): Remove decl; mem-limits.h provides it.
2656         * xdisp.c (handle_invisible_prop): Make it a bit faster
2657         and avoid a gcc -Wmaybe-uninitialized diagnostic.
2659 2012-08-19  Chong Yidong  <cyd@gnu.org>
2661         * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2662         ends (Bug#3874).
2664 2012-08-19  Andreas Schwab  <schwab@linux-m68k.org>
2666         * .gdbinit: Use call instead of set when calling a function in the
2667         inferior.
2669         * data.c (set_internal): Don't use set_blv_found.
2670         (Fkill_local_variable): Likewise.
2672 2012-08-18  Alp Aker  <alp.tekin.aker@gmail.com>
2674         * nsfont.m (ns_ascii_average_width): Ensure the string
2675         ascii_printable is initialized with a null-terminated character
2676         array.  Otherwise, it can contain undesired extra characters.
2678 2012-08-18  Paul Eggert  <eggert@cs.ucla.edu>
2680         port new setting code to Sun C 5.8 2005/10/13
2681         * chartab.c, lisp.h (char_table_set, char_table_set_range):
2682         Return void, not Lisp_Object.  Otherwise, the compiler
2683         complains about (A?B:C) where B is void and C is Lisp_Object
2684         when compiling CHAR_TABLE_SET, due to the recent change to
2685         the API of sub_char_table_set_contents.
2687 2012-08-18  Chong Yidong  <cyd@gnu.org>
2689         * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2690         for the string case (Bug#3874).
2692 2012-08-18  Paul Eggert  <eggert@cs.ucla.edu>
2694         * buffer.h (BSET): Remove (Bug#12215).
2695         Replace all uses with calls to new setter functions.
2696         (bset_bidi_paragraph_direction, bset_case_canon_table)
2697         (bset_case_eqv_table, bset_directory, bset_display_count)
2698         (bset_display_time, bset_downcase_table)
2699         (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2700         (bset_last_selected_window, bset_local_var_alist)
2701         (bset_mark_active, bset_point_before_scroll, bset_read_only)
2702         (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2703         (bset_width_table):
2704         * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2705         (bset_auto_fill_function, bset_auto_save_file_format)
2706         (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2707         (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2708         (bset_cache_long_line_scans, bset_case_fold_search)
2709         (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2710         (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2711         (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2712         (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2713         (bset_header_line_format, bset_indicate_buffer_boundaries)
2714         (bset_indicate_empty_lines, bset_invisibility_spec)
2715         (bset_left_fringe_width, bset_major_mode, bset_mark)
2716         (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2717         (bset_name, bset_overwrite_mode, bset_pt_marker)
2718         (bset_right_fringe_width, bset_save_length)
2719         (bset_scroll_bar_width, bset_scroll_down_aggressively)
2720         (bset_scroll_up_aggressively, bset_selective_display)
2721         (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2722         (bset_word_wrap, bset_zv_marker):
2723         * category.c (bset_category_table):
2724         * syntax.c (bset_syntax_table):
2725         New setter functions.
2727         * process.h (PSET): Remove (Bug#12215).
2728         Replace all uses with calls to new setter functions.
2729         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2730         (PROCESS_INLINE): New macro.
2731         (pset_childp): New setter function.
2732         (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2733         * process.c (PROCESS_INLINE):
2734         Define to EXTERN_INLINE, so that the corresponding functions
2735         are compiled into code.
2736         (pset_buffer, pset_command, pset_decode_coding_system)
2737         (pset_decoding_buf, pset_encode_coding_system)
2738         (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2739         (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2740         (pset_type, pset_write_queue): New setter functions.
2742         * window.h (WSET): Remove (Bug#12215).
2743         Replace all uses with calls to new setter functions.
2744         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2745         (WINDOW_INLINE): New macro.
2746         (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2747         (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2748         (wset_total_lines, wset_vertical_scroll_bar)
2749         (wset_window_end_pos, wset_window_end_valid)
2750         (wset_window_end_vpos): New setter functions.
2751         * window.c (WINDOW_INLINE):
2752         Define to EXTERN_INLINE, so that the corresponding functions
2753         are compiled into code.
2754         (wset_combination_limit, wset_dedicated, wset_display_table)
2755         (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2756         (wset_new_normal, wset_new_total, wset_next_buffers)
2757         (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2758         (wset_prev_buffers, wset_right_fringe_width)
2759         (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2760         (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2761         (wset_window_parameters):
2762         * xdisp.c (wset_base_line_number, wset_base_line_pos)
2763         (wset_column_number_displayed, wset_region_showing):
2764         New setter functions.
2766         * termhooks.h (TSET): Remove (Bug#12215).
2767         Replace all uses with calls to new setter functions.
2768         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2769         (TERMHOOKS_INLINE): New macro.
2770         (tset_charset_list, tset_selection_alist): New setter functions.
2771         * terminal.c (TERMHOOKS_INLINE):
2772         Define to EXTERN_INLINE, so that the corresponding functions
2773         are compiled into code.
2774         (tset_param_alist): New setter function.
2776 2012-08-17  Paul Eggert  <eggert@cs.ucla.edu>
2778         * keyboard.h (KSET): Remove (Bug#12215).
2779         Replace all uses with calls to new setter functions.
2780         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2781         (KEYBOARD_INLINE): New macro.
2782         (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2783         (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2784         (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2785         New setter functions.
2786         * keyboard.c (KEYBOARD_INLINE):
2787         Define to EXTERN_INLINE, so that the corresponding functions
2788         are compiled into code.
2789         (kset_echo_string, kset_kbd_queue)
2790         (kset_keyboard_translate_table, kset_last_prefix_arg)
2791         (kset_last_repeatable_command, kset_local_function_key_map)
2792         (kset_overriding_terminal_local_map, kset_real_last_command)
2793         (kset_system_key_syms): New setter functions.
2795         * frame.h (FSET): Remove (Bug#12215).
2796         Replace all uses with calls to new setter functions.
2797         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2798         (FRAME_INLINE): New macro.
2799         (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2800         (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2801         (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2802         (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2803         (fset_param_alist, fset_root_window, fset_scroll_bars)
2804         (fset_selected_window, fset_title, fset_tool_bar_items)
2805         (fset_tool_bar_position, fset_tool_bar_window): New functions.
2806         * frame.c (FRAME_INLINE):
2807         Define to EXTERN_INLINE, so that the corresponding functions
2808         are compiled into code.
2809         (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2811         A few more naming-convention fixes for getters and setters.
2812         * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2813         and rename from buffer_overlays_set_before.
2814         (set_buffer_overlays_after): Move here from buffer.h, and rename
2815         from buffer_overlays_set_after.
2816         * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2817         All uses changed.
2818         (set_buffer_intervals): Rename from buffer_set_intervals.
2819         * intervals.c (set_interval_object): Move here from intervals.h,
2820         and rename from interval_set_object.
2821         (set_interval_left): Move here from intervals.h, and rename from
2822         interval_set_left.
2823         (set_interval_right): Move here from intervals.h, and rename from
2824         interval_set_right.
2825         (copy_interval_parent): Move here from intervals.h, and rename from
2826         interval_copy_parent.
2827         * intervals.h (set_interval_parent): Rename from interval_set_parent.
2828         (set_interval_plist): Rename from interval_set_plist.
2829         Return void, not Lisp_Object, since no caller uses the result.
2830         * lisp.h (string_intervals): Rename from string_get_intervals.
2831         (set_string_intervals): Rename from string_set_intervals.
2833         * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2834         (set_char_table_contents): Rename from char_table_set_contents.
2835         (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
2836         All uses changed.  See the end of
2837         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2839         * lisp.h (CSET): Remove (Bug#12215).
2840         (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2841         (set_char_table_purpose): New functions,
2842         replacing CSET.  All uses changed.  For example, replace
2843         "CSET (XCHAR_TABLE (char_table), parent, parent);" with
2844         "set_char_table_parent (char_table, parent);".
2845         The old version was confusing because it used the same name
2846         'parent' for two different things.
2848 2012-08-17  Dmitry Antipov  <dmantipov@yandex.ru>
2850         Functions to get and set Lisp_Object fields of buffer-local variables.
2851         * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2852         (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2853         (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2854         * data.c, eval.c, frame.c: Adjust users.
2856 2012-08-17  Chong Yidong  <cyd@gnu.org>
2858         * xfaces.c (merge_face_vectors): If the target font specfies a
2859         font spec, make the font's attributes take precedence over
2860         directly-specified attributes.
2861         (merge_face_ref): Recognize :font.
2863 2012-08-17  Dmitry Antipov  <dmantipov@yandex.ru>
2865         Do not use memcpy for copying intervals.
2866         * intervals.c (reproduce_interval): New function.
2867         (reproduce_tree, reproduce_tree_obj): Use it.
2868         (reproduce_tree_obj): Remove prototype.
2870 2012-08-17  Paul Eggert  <eggert@cs.ucla.edu>
2872         * lisp.h (duration_to_sec_usec): Remove unused decl.
2874 2012-08-17  Alp Aker  <alp.tekin.aker@gmail.com>
2876         * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2877         to an allocated instance of NSString, not to the class itself.
2879 2012-08-17  Juanma Barranquero  <lekktu@gmail.com>
2881         * makefile.w32-in (C_CTYPE_H): New macro.
2882         (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2883         ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2884         ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2886 2012-08-16  Paul Eggert  <eggert@cs.ucla.edu>
2888         Use ASCII tests for character types.
2889         * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2890         * xfns.c, xterm.c:
2891         Don't include <ctype.h>; was not needed.
2892         * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2893         * sysdep.c, xfaces.c:
2894         Include <c-ctype.h> instead of <ctype.h>.
2895         * nsterm.m: Include <c-ctype.h>.
2896         * charset.c (read_hex):
2897         * doc.c (Fsnarf_documentation):
2898         * fileio.c (IS_DRIVE) [WINDOWSNT]:
2899         (DRIVE_LETTER) [DOS_NT]:
2900         (Ffile_name_directory, Fexpand_file_name)
2901         (Fsubstitute_in_file_name):
2902         * font.c (font_parse_xlfd, font_parse_fcname):
2903         * frame.c (x_set_font_backend):
2904         * gtkutil.c (xg_get_font):
2905         * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2906         * nsimage.m (hexchar):
2907         * nsterm.m (ns_xlfd_to_fontname):
2908         * sysdep.c (system_process_attributes):
2909         * xfaces.c (hash_string_case_insensitive):
2910         Use C-locale tests instead of locale-specific tests for character
2911         types, since we want the ASCII interpretation here, not the
2912         interpretation suitable for whatever happens to be the current locale.
2914 2012-08-16  Martin Rudalics  <rudalics@gmx.at>
2916         Consistently check windows for validity/liveness
2917         (Bug#11984, Bug#12025, Bug#12026).
2918         * lisp.h (CHECK_VALID_WINDOW): New macro.
2919         * window.c (decode_window): Rename to decode_live_window.
2920         (decode_valid_window, Fwindow_valid_p): New functions.
2921         (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2922         (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2923         (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2924         (Fwindow_prev_sibling, Fwindow_combination_limit)
2925         (Fset_window_combination_limit, Fwindow_use_time)
2926         (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2927         (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2928         (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2929         (Fwindow_hscroll, Fset_window_hscroll)
2930         (Fwindow_redisplay_end_trigger)
2931         (Fset_window_redisplay_end_trigger, Fwindow_edges)
2932         (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2933         (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2934         (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2935         (Fwindow_end, Fset_window_point, Fset_window_start)
2936         (Fpos_visible_in_window_p, Fwindow_line_height)
2937         (Fwindow_dedicated_p, Fset_window_dedicated_p)
2938         (Fwindow_prev_buffers, Fset_window_prev_buffers)
2939         (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2940         (Fset_window_parameter, Fwindow_display_table)
2941         (Fset_window_display_table, Fdelete_other_windows_internal)
2942         (Fset_window_buffer, Fset_window_new_total)
2943         (Fset_window_new_normal, Fdelete_window_internal)
2944         (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2945         (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2946         (Fwindow_scroll_bars): Check whether argument window is a valid or
2947         live window.  Update doc-strings.
2948         (syms_of_window): New symbol Qwindow_valid_p.
2949         * keyboard.c (Fposn_at_x_y): Check whether argument
2950         frame_or_window denotes a valid window.
2952 2012-08-16  Dmitry Antipov  <dmantipov@yandex.ru>
2954         Fix previous char table change.
2955         * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2956         * chartab.c (optimize_sub_char_table): Likewise.
2958 2012-08-16  Chong Yidong  <cyd@gnu.org>
2960         * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2962         * xfont.c (xfont_open):
2963         * xftfont.c (xftfont_open): Set the font's max_width field.
2965         * nsfont.m (nsfont_open): Similar to the Xft backend, set
2966         min_width to space_width and average_width to the average over
2967         printable ASCII characters.
2968         (ns_char_width): Code cleanup.
2969         (ns_ascii_average_width): New utility function.
2971         * font.h (struct font): Update comments.
2973 2012-08-16  Dmitry Antipov  <dmantipov@yandex.ru>
2975         Simple interface to set Lisp_Object fields of character tables.
2976         * lisp.h (CSET): New macro.
2977         (char_table_set_extras, char_table_set_contents)
2978         (sub_char_table_set_contents): New function.
2979         * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2980         * syntax.c: Adjust users.
2982 2012-08-16  Stefan Monnier  <monnier@iro.umontreal.ca>
2984         * eval.c (eval_sub): Bind lexical-binding.
2985         * lread.c (Qlexical_binding): Make non-static.
2987 2012-08-15  Jan Djärv  <jan.h.d@swipnet.se>
2989         * nsmenu.m (popupSession): Remove.
2990         (pop_down_menu): Remove endModalSession.
2991         (timeout_handler:): New method.
2992         (runDialogAt:): Get next timeout.  Start a NSTimer with that timeout.
2993         Call runModalForWindow.  Check timer_fired when it returns.
2994         If not set, cancel timer and break out of loop.
2995         Otherwise loop again, with a new timeout.
2997         * nsterm.m: Include fcntl.h if present.
2998         (fd_entry, t_readfds, inNsSelect): Remove.
2999         (select_writefds, select_valid, select_timeout, selfds)
3000         (select_mutex, apploopnr): Add.
3001         (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
3002         Otherwise call kbd_buffer_store_event.
3003         (ns_send_appdefined): Remove release of fd_entry.
3004         (ns_read_socket): Always send appdefined.  Remove inNsSelect check.
3005         Increment and decrement apploopnr.
3006         (ns_select): If no file descriptors, just do a NSTimer.
3007         Otherwise copy read/write masks and start select thread (fd_handler).
3008         Start main loop and wait for application defined event.
3009         Inform select thread to stop selecting after main loop is exited.
3010         (ns_term_init): Create selfds pipe and set non-blocking.
3011         Initialize select_mutex.  Start the select thread (fd_handler).
3012         (fd_handler:): Loop forever, wait for info from the main thread
3013         to either start or stop selecting.  When select returns, send
3014         and appdefined event.
3015         (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3016         If not call kbd_buffer_store_event.
3018         * nsterm.h (EmacsApp): fd_handler takes id argument.
3019         (EmacsDialogPanel): Add timer_fired and timeout_handler.
3021         * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3023 2012-08-15  Eli Zaretskii  <eliz@gnu.org>
3025         * region-cache.c (move_cache_gap): Update gap_len using the actual
3026         growth of the boundaries array.  Do not change cache_len.
3027         (Bug#12196)
3029 2012-08-15  Dmitry Antipov  <dmantipov@yandex.ru>
3031         Generalize and cleanup font subsystem checks.
3032         * font.h (FONT_DEBUG, font_assert): Remove.
3033         * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3034         Change font_assert to eassert.  Use eassert where appropriate.
3036 2012-08-15  Dmitry Antipov  <dmantipov@yandex.ru>
3038         * gtkutil.c (xg_get_font): Use pango_units_to_double.
3040 2012-08-15  Chong Yidong  <cyd@gnu.org>
3042         * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3043         When using the new font chooser, use gtk_font_chooser_get_font_desc to
3044         extract the font descriptor instead of just the font name.
3045         In that case, return a font spec instead of a string.
3046         (x_last_font_name): Move to this file from xfns.c.
3048         * xfns.c (Fx_select_font): The return value can also be a font
3049         spec.  Move x_last_font_name management to gtkutil.c.
3051         * xfaces.c: Make font weight and style symbols non-static.
3053 2012-08-15  Stefan Monnier  <monnier@iro.umontreal.ca>
3055         * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3056         (bug#12117).
3058 2012-08-14  Stefan Monnier  <monnier@iro.umontreal.ca>
3060         * alloc.c (Fgarbage_collect): Use plural form consistently.
3062 2012-08-14  Eli Zaretskii  <eliz@gnu.org>
3064         * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3065         iteration through the command loop.  Fixes a problem whereby mouse
3066         movements are ignored until the first mouse click.
3068 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
3070         Use bool, not int, for Lisp booleans.
3071         This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3072         makes Emacs a bit smaller and presumably a bit faster.
3073         * lisp.h: Include <stdbool.h>.
3074         (struct Lisp_Boolfwd, defvar_bool):
3075         * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3076         * regex.c [!emacs]: Include <stdbool.h>.
3077         (false, true): Remove; <stdbool.h> does this for us now.
3079 2012-08-14  Chong Yidong  <cyd@gnu.org>
3081         * character.c (Fcharacterp): Doc fix (Bug#12076).
3083         * data.c (Findirect_variable): Doc fix (Bug#11040).
3085         * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3087         * editfns.c (Fformat): Doc fix (Bug#12059).
3088         (Fsave_current_buffer): Doc fix (Bug#11542).
3090 2012-08-14  Barry OReilly  <gundaetiapo@gmail.com>  (tiny change)
3092         * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3093         (bug#12022).
3095 2012-08-14  Martin Rudalics  <rudalics@gmx.at>
3097         * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3098         (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3099         * minibuf.c (choose_minibuf_frame, read_minibuf):
3100         * w32fns.c (x_create_tip_frame):
3101         * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3102         Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3104 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
3106         * intervals.c (offset_intervals): Remove obsolete comment.
3108 2012-08-14  Andreas Schwab  <schwab@linux-m68k.org>
3110         * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3112 2012-08-14  Gergely Risko  <gergely@risko.hu>
3114         * coding.c (decode_coding): Record buffer modification before
3115         disabling undo_list (Bug#11773).
3117 2012-08-14  Dmitry Antipov  <dmantipov@yandex.ru>
3119         Revert and cleanup some recent overlay changes.
3120         * buffer.h (enum overlay_type): Remove.
3121         (buffer_get_overlays, buffer_set_overlays): Likewise.
3122         (buffer_set_overlays_before, buffer_set_overlays_after):
3123         New function.  Adjust users.
3124         (unchain_both): Add eassert.
3126 2012-08-14  Dmitry Antipov  <dmantipov@yandex.ru>
3128         * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3130 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
3132         * gtkutil.c (xg_mark_data): Don't assume C99.
3134 2012-08-13  Jan Djärv  <jan.h.d@swipnet.se>
3136         * gtkutil.c (xg_frame_tb_info): New struct.
3137         (TB_INFO_KEY): New define.
3138         (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3139         (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3140         (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3141         if not present.
3142         (update_frame_tool_bar): Return early if data in xg_frame_tb_info
3143         is up to date.  Otherwise store new data.
3144         (free_frame_tool_bar): Free xg_frame_tb_info if present.
3146 2012-08-13  Dmitry Antipov  <dmantipov@yandex.ru>
3148         Use KSET for write access to Lisp_Object members of struct kboard.
3149         * keyboard.h (KSET): New macro.
3150         * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3151         * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3152         * xterm.c: Adjust users.
3154 2012-08-13  Dmitry Antipov  <dmantipov@yandex.ru>
3156         Use BSET for write access to Lisp_Object members of struct buffer.
3157         * buffer.h (BSET): New macro.
3158         * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3159         * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3160         * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3161         * window.c, xdisp.c, xfns.c: Adjust users.
3163 2012-08-11  BT Templeton  <bpt@hcoop.net>  (tiny change)
3165         * lread.c (syms_of_lread): Initialize Vlexical_binding.
3167 2012-08-11  Jan Djärv  <jan.h.d@swipnet.se>
3169         * nsterm.m (not_in_argv): New function.
3170         (application:openFile, application:openTempFile:):
3171         (application:openFileWithoutUI:, application:openFiles:): Open file
3172         if not_in_argv returns non-zero (bug#12171).
3174         * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
3175         (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3176         Define for Gtk+ versions less than 3.2.
3177         (xg_get_font_name): Use those functions/macros here.
3178         Reported by Frans Oilinki <moilinki@gmail.com>.
3180 2012-08-11  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
3182         * unexmacosx.c (copy_data_segment): Copy initialized data in
3183         statically linked libraries from input file rather than memory.
3185         * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3186         LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3187         (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3189 2012-08-10  Glenn Morris  <rgm@gnu.org>
3191         * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3192         * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3194 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
3196         Fix last change to allow compilation with low optimization levels.
3197         * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3198         Reported by Jan Djärv <jan.h.d@swipnet.se>.
3200 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
3202         Use common inline syntax in intervals.h.
3203         * intervals.h (INTERVALS_INLINE): New macro.
3204         Change all users from LISP_INLINE.
3206 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
3208         Define Qnone once for all platforms.
3209         * frame.c (Qnone): Define here.
3210         (syms_of_frame): DEFSYM it.
3211         * lisp.h (Qnone): New declaration.
3212         * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3213         * xfns.c: Remove duplication.  Adjust users.
3215 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
3217         Remove unused macros from intervals.h.
3218         * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3219         * intervals.c: Adjust comment.
3221 2012-08-10  Eli Zaretskii  <eliz@gnu.org>
3223         * w32fns.c <w32_unicode_gui>: New static variable.
3224         (globals_of_w32fns): Initialize it according to os_subtype.
3225         (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3226         testing os_subtype.
3228 2012-08-10  Joakim Hårsman  <joakim.harsman@gmail.com>  (tiny change)
3229             Eli Zaretskii  <eliz@gnu.org>
3231         Fix bug #10299 with Unicode characters sent by customized
3232         keyboards created by MSKLC.
3233         * w32fns.c (INIT_WINDOW_CLASS): New macro.
3234         (w32_init_class): Use it to initialize the Emacs class with either
3235         ANSI or Unicode API calls.
3236         (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3237         later.
3238         (w32_wnd_proc): If the character code sent by WM_CHAR or
3239         WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3240         original message.  Call DefWindowProcW on NT and later.
3242 2012-08-10  Glenn Morris  <rgm@gnu.org>
3244         * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3246         * lisp.h (DIRECTORY_SEP): Let configure set it.
3248 2012-08-09  Dmitry Antipov  <dmantipov@yandex.ru>
3250         Use TSET for write access to Lisp_Object slots of struct terminal.
3251         * termhooks.h (TSET): New macro.
3252         * coding.c, terminal.c, xselect.c: Adjust users.
3254 2012-08-08  Stefan Monnier  <monnier@iro.umontreal.ca>
3256         * xdisp.c (safe_eval_handler): Remove prototype.  Receive args describing
3257         the failing expression, include them in the error message.
3258         * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3259         * lisp.h (internal_condition_case_n): Update declaration.
3261 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
3263         Inline functions to examine and change buffer overlays.
3264         * buffer.c (unchain_both): New function.
3265         * buffer.h (buffer_get_overlays, buffer_set_overlays):
3266         (buffer_has_overlays): New function.
3267         (enum overlay_type): New enum.
3268         * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3269         * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3271 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
3273         Inline functions to examine and change buffer intervals.
3274         * alloc.c (mark_interval_tree): Remove.
3275         (MARK_INTERVAL_TREE): Simplify.
3276         (UNMARK_BALANCE_INTERVALS): Remove.  Adjust users.
3277         * intervals.c (buffer_balance_intervals): New function.
3278         (graft_intervals_into_buffer): Adjust indentation.
3279         (set_intervals_multibyte): Simplify.
3280         * buffer.h (BUF_INTERVALS): Remove.
3281         (buffer_get_intervals, buffer_set_intervals): New function.
3282         * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3283         * intervals.c, textprop.c: Adjust users.
3285 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
3287         Inline functions to examine and change string intervals.
3288         * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3289         (string_get_intervals, string_set_intervals): New function.
3290         * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3291         * lread.c, print.c, textprop.c: Adjust users.
3293 2012-08-08  Glenn Morris  <rgm@gnu.org>
3295         * lisp.mk (lisp): Remove language/persian.elc.
3297 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
3299         Cleanup intervals.
3300         * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3301         (NULL_INTERVAL_P): Likewise.  Adjust users.
3302         (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3303         Adjust comment.  Move under #if 0.
3304         * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3305         * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3307 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
3309         Check total length of intervals with eassert.
3310         * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3311         * intervals.c: Change all users to eassert.
3313 2012-08-07  Eli Zaretskii  <eliz@gnu.org>
3315         * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3316         Rename fields to match removal of FGET and WGET and disuse of
3317         INTERNAL_FIELD in Lisp_Cons.
3319 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
3321         Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3322         * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3323         name since all xname users are fixed long time ago.  Do not
3324         use INTERNAL_FIELD.
3325         (set_symbol_name, set_symbol_function, set_symbol_plist):
3326         (set_symbol_next, set_overlay_plist): New function.
3327         (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3328         (struct Lisp_Overlay): Likewise.
3329         (CVAR, MVAR, SVAR): Remove.
3330         * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3331         * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3332         * xterm.c: Adjust users.
3333         * .gdbinit: Change to use name field of struct Lisp_Symbol
3334         where appropriate.
3336 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
3338         Basic functions to set Lisp_Object and pointer slots of intervals.
3339         * intervals.h (interval_set_parent, interval_set_object):
3340         (interval_set_left, interval_set_right, interval_set_plist):
3341         (interval_copy_parent): New function.
3342         (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
3343         (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3344         Adjust indentation.
3345         (INTERVAL_SIZE): Remove.  Adjust users.
3346         * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3348 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
3350         Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3351         * process.h (PGET): Remove.
3352         (struct Lisp_Process): Do not use INTERNAL_FIELD.
3353         * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3355 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
3357         Drop WGET and revert read access to Lisp_Objects slots of struct window.
3358         * window.h (WGET): Remove.
3359         (struct window): Do not use INTERNAL_FIELD.
3360         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3361         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3362         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3363         * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3364         * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3365         Adjust users.
3367 2012-08-07  Chong Yidong  <cyd@gnu.org>
3369         * window.c (Fwindow_edges, Fwindow_pixel_edges)
3370         (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3371         (Fdelete_window_internal): Signal an error if the window is not on
3372         a live frame (Bug#12025).
3374 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
3376         Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3377         * frame.h (FGET): Remove.
3378         (struct frame): Do not use INTERNAL_FIELD.
3379         * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3380         * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3381         * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3382         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3384 2012-08-06  Juanma Barranquero  <lekktu@gmail.com>
3386         * w32.c: Silence compiler warnings.
3387         (map_w32_filename): Remove unused variable `is_fat'.
3388         (chase_symlinks): Add parentheses around expression.
3390 2012-08-06  Glenn Morris  <rgm@gnu.org>
3392         * sysdep.c: Respect BROKEN_GETWD.
3394         * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3395         Let configure handle it.
3396         (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3398 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
3400         Use GCALIGNMENT where appropriate.
3401         * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3402         (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3403         (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3405 2012-08-06  Eli Zaretskii  <eliz@gnu.org>
3407         * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3408         Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
3410 2012-08-06  Stefan Monnier  <monnier@iro.umontreal.ca>
3412         * buffer.h (struct buffer): Revert `indirections' to a simple int;
3413         that should be sufficient for everyone.
3415 2012-08-06  Jan Djärv  <jan.h.d@swipnet.se>
3417         * keyboard.c (timer_check_2): Add break so timer_check returns next
3418         timeout.
3420 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
3422         Fix Windows build errors introduced after converting to WGET and WSET.
3423         * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3424         Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3426 2012-08-06  Jan Djärv  <jan.h.d@swipnet.se>
3428         * nsterm.m (ns_frame_rehighlight): Use FSET.
3430         * nsmenu.m (ns_update_menubar): Use FSET.
3432 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
3434         Separate read and write access to Lisp_Object slots of Lisp_Process.
3435         * process.h (PGET, PSET): New macros similar to AREF and ASET.
3436         * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3438 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
3440         Separate read and write access to Lisp_Object slots of struct window.
3441         * window.h (WGET, WSET): New macros similar to AREF and ASET.
3442         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3443         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3444         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3445         * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3446         * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3447         Adjust users.
3449 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
3451         Fix Windows build errors introduced after converting to FGET and FSET.
3452         * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3453         (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3454         (w32_judge_scroll_bars): Change to use FSET.
3455         Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3457 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
3459         Fix replacement typo.
3460         * window.c (replace_window): Set root_window instead of
3461         selected_window.  This fixes a total window subsystem
3462         malfunction reported by Bastien Guerry <bzg@gnu.org>.
3464 2012-08-06  Glenn Morris  <rgm@gnu.org>
3466         * lisp.mk (lisp): Add language/persian.elc.
3468 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
3470         Separate read and write access to Lisp_Object slots of struct frame.
3471         * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3472         * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3473         * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3474         * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3475         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3477 2012-08-05  Andreas Schwab  <schwab@linux-m68k.org>
3479         * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3481 2012-08-05  Dmitry Antipov  <dmantipov@yandex.ru>
3483         Generalize common compile-time constants.
3484         * lisp.h (header_size, bool_header_size, word_size): Now here.
3485         (struct Lisp_Vector): Add comment.
3486         (struct Lisp_Bool_Vector): Move up to define handy constants.
3487         (VECSIZE, PSEUDOVECSIZE): Simplify.
3488         (SAFE_ALLOCA_LISP): Use new constant.  Adjust indentation.
3489         * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3490         * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3491         * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3492         * xfont.c, xmenu.c: Use word_size where appropriate.
3494 2012-08-05  Lawrence Mitchell  <wence@gmx.li>
3496         * search.c (Freplace_match): Treat \? in the replacement text
3497         literally (Bug#8161).
3499 2012-08-05  Chong Yidong  <cyd@gnu.org>
3501         * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3502         * frame.c (Vdelete_frame_functions):
3503         * emacs.c (Vkill_emacs_hook): Doc fix.
3505 2012-08-04  Eli Zaretskii  <eliz@gnu.org>
3507         * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3508         --with-x-toolkit=no builds.
3509         Reported by Carsten Mattner <carstenmattner@gmail.com>.
3511 2012-08-04  Chong Yidong  <cyd@gnu.org>
3513         * syntax.c (Fmodify_syntax_entry): Doc fix.
3515 2012-08-04  Eli Zaretskii  <eliz@gnu.org>
3517         Fix startup warnings about ../site-lisp on MS-Windows.  (Bug#11959)
3518         * w32.c (init_environment): Change the default values of many
3519         environment variables in dflt_envvars[] to NULL, to avoid pushing
3520         them into environment when they were not already defined.
3521         Remove the code that deletes site-lisp subdirectories from the default
3522         value of EMACSLOADPATH, as it is no longer needed.
3523         (check_windows_init_file): Now external, not static.
3524         Use Vload_path as is, without adding anything, as this function is now
3525         called when Vload_path is already set up.
3527         * w32.h (check_windows_init_file): Add prototype.
3529         * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3530         directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3531         compatibility with Posix platforms.
3532         (main): Move the call to check_windows_init_file to here from
3533         w32.c.
3534         (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3535         any, in the DEFALT argument into the root of the Emacs build or
3536         installation tree, as appropriate.
3538         * callproc.c (init_callproc_1): Call decode_env_path instead of
3539         doing its equivalent by hand.
3540         (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3541         the code that sets Vexec_path run on MS-Windows.
3543         * lread.c (init_lread): Add comments to #ifdef's.
3545         * msdos.c (dos_set_window_size, IT_update_begin)
3546         (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3547         instead of direct references.
3549 2012-08-04  Paul Eggert  <eggert@cs.ucla.edu>
3551         Export DEFAULT_REHASH_* to GDB.
3552         * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3553         Now constants, not macros.
3555 2012-08-03  Paul Eggert  <eggert@cs.ucla.edu>
3557         Remove unnecessary casts involving pointers.
3558         These casts are no longer needed now that we assume C89 or later,
3559         since they involve casting to or from void *.
3560         * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3561         (make_pure_float, make_pure_vector):
3562         * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3563         * macros.c (Fstart_kbd_macro):
3564         * menu.c (find_and_return_menu_selection):
3565         * minibuf.c (read_minibuf_noninteractive):
3566         * sysdep.c (closedir):
3567         * xdisp.c (x_produce_glyphs):
3568         * xfaces.c (compare_fonts_by_sort_order):
3569         * xfns.c (x_real_positions, select_visual):
3570         * xselect.c (x_stop_queuing_selection_requests)
3571         (x_get_window_property, x_get_window_property_as_lisp_data):
3572         * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3573         Remove unnecessary pointer casts.
3574         * alloc.c (record_xmalloc): New function.
3575         * lisp.h (record_xmalloc): New decl.
3576         (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3577         more like a function.  This is because the pointer cast is not
3578         needed.  All uses changed.
3579         * print.c (print_string, print_error_message): Avoid length recalc.
3581         Improve fix for macroexp crash with debugging (Bug#12118).
3582         * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3583         ARRAY_MARK_FLAG when checking subscripts, because ASET is
3584         not supposed to be invoked from the garbage collector.
3585         See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3586         (gc_aset): New function, which is like ASET but can be
3587         used in the garbage collector.
3588         (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3589         (set_hash_index): Use it instead of ASET.
3591 2012-08-03  Eli Zaretskii  <eliz@gnu.org>
3593         Support symlinks on latest versions of MS-Windows.
3594         * w32.c: Include winioctl.h and aclapi.h.
3595         (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3596         (revert_to_self): Forward declarations of static functions.
3597         <static BOOL g_b_init_get_security_info>:
3598         <g_b_init_create_symbolic_link>: New static flags.
3599         (globals_of_w32): Initialize them to zero.
3600         (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3601         (map_w32_filename): Improve commentary.  Simplify switch.
3602         (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3603         headers (most versions of MinGW w32api don't).
3604         (get_security_info, create_symbolic_link)
3605         (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3606         New functions.
3607         (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3608         in the argument file name.
3609         (sys_access): Call unc_volume_file_attributes only if
3610         GetFileAttributes fails with network-related error codes.
3611         (sys_rename): Diagnose renaming of a symlink when the user doesn't
3612         have the required privileges.
3613         (get_file_security_desc_by_name): Rename from
3614         get_file_security_desc.
3615         (stat_worker): New function, with most of the guts of 'stat', and
3616         with addition of handling of symlinks and support for 'lstat'.
3617         If possible, get file's attributes and security information by
3618         handle, not by name.  Produce S_IFLNK bit for symlinks, when
3619         called from 'lstat'.
3620         (stat, lstat): New functions, call 'stat_worker'.
3621         (symlink, readlink, careadlinkat): Rewritten to create and resolve
3622         symlinks when the underlying filesystem supports them.
3624 2012-08-02  Paul Eggert  <eggert@cs.ucla.edu>
3626         Fix macroexp crash on Windows with debugging (Bug#12118).
3627         * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3628         checking subscripts; problem introduced with the recent
3629         "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3630         (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3631         since it's used in non-static inline functions now.
3633         * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3634         Don't assume buffer size fits in 'int'.  Remove unused local.
3636         Use C99-style 'extern inline' if available.
3637         * buffer.h (BUFFER_INLINE):
3638         * category.h (CATEGORY_INLINE):
3639         * character.h (CHARACTER_INLINE):
3640         * charset.h (CHARSET_INLINE):
3641         * composite.h (COMPOSITE_INLINE):
3642         * dispextern.h (DISPEXTERN_INLINE):
3643         * lisp.h (LISP_INLINE):
3644         * systime.h (SYSTIME_INLINE):
3645         New macro, replacing 'static inline' in this header.
3646         * buffer.h, category.h, character.h, charset.h, composite.h:
3647         * dispextern.h, lisp.h, systime.h:
3648         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3649         * alloc.c (LISP_INLINE):
3650         * buffer.c (BUFFER_INLINE):
3651         * category.c (CATEGORY_INLINE):
3652         * character.c (CHARACTER_INLINE):
3653         * charset.c (CHARSET_INLINE):
3654         * composite.c (COMPOSITE_INLINE):
3655         * dispnew.c (DISPEXTERN_INLINE):
3656         * sysdep.c (SYSTIME_INLINE):
3657         Define to EXTERN_INLINE, so that the corresponding functions
3658         are compiled into code.
3659         * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3660         (INLINE_HEADER_END): New macros.
3661         * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3662         since it's used in non-static inline functions now.
3663         (VALMASK) [!USE_LSB_TAG]: Likewise.
3665 2012-08-02  Glenn Morris  <rgm@gnu.org>
3667         * s/: Remove empty directory.
3669         * s/ms-w32.h: Move to ../nt/inc.
3670         * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3671         Update for new ms-w32.h location.
3673 2012-08-02  Paul Eggert  <eggert@cs.ucla.edu>
3675         Port to Solaris 8.
3676         * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3678 2012-08-02  Glenn Morris  <rgm@gnu.org>
3680         * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3681         hard-coding the path separator.
3683 2012-08-01  Paul Eggert  <eggert@cs.ucla.edu>
3685         Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3686         This how ASET and AREF are supposed to work, and makes
3687         it easier to think about future improvements.  See
3688         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3689         * charset.h (set_charset_attr): New function.
3690         All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3691         * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3692         (aref_addr): New function.  All uses of &AREF(...) changed.
3693         (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3694         (set_hash_index): New functions.  All lvalue-style uses of
3695         HASH_KEY etc. changed.
3696         * keyboard.c (set_prop): New function.  All lvalue-style uses
3697         of PROP changed.
3699 2012-08-01  Alp Aker  <alp.tekin.aker@gmail.com>
3701         * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3702         (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3703         (EmacsScroller-dealloc):  Adjust to use WVAR.  (Bug#12114)
3704         * nsfns.m (ns_set_name_as_filename): Likewise.
3705         * nsmenu.m (ns_update_menubar): Likewise.
3706         * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3708 2012-08-01  Eli Zaretskii  <eliz@gnu.org>
3710         * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3711         Adapt to latest changes in field names of the corresponding Lisp
3712         objects.
3714         * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3716 2012-08-01  Glenn Morris  <rgm@gnu.org>
3718         * s/msdos.h: Remove file.
3719         * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3720         * Makefile.in (S_FILE): Remove.
3721         (config_h): Remove S_FILE.
3723 2012-08-01  Juanma Barranquero  <lekktu@gmail.com>
3725         * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3726         Remove; moved to nt/config.nt.
3728 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
3730         Use INTERNAL_FIELD for conses and overlays.
3731         * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3732         Remove obsolete comment.
3733         (MVAR): New macro.
3734         (struct Lisp_Overlay): Use INTERNAL_FIELD.
3735         * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3737 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
3739         Use INTERNAL_FIELD for symbols.
3740         * lisp.h (SVAR): New macro.  Adjust users.
3741         * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3742         * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3744 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
3746         Use INTERNAL_FIELD for processes.
3747         * process.h (PVAR): New macro.  Adjust style.
3748         (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3749         * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3751 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
3753         Use INTERNAL_FIELD for windows.
3754         * window.h (WVAR): New macro.
3755         (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3756         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3757         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3758         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3759         * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3760         * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3762 2012-08-01  Paul Eggert  <eggert@cs.ucla.edu>
3764         * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3766 2012-08-01  Glenn Morris  <rgm@gnu.org>
3768         * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3769         Move to configure.ac.
3771 2012-08-01  Juanma Barranquero  <lekktu@gmail.com>
3773         * makefile.w32-in (CONFIG_H): Update dependencies.
3774         (CONF_POST_H): New macro.
3776         * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3778 2012-07-31  Glenn Morris  <rgm@gnu.org>
3780         * Makefile.in (S_FILE): No longer set by configure.
3782         * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3783         is available.
3784         (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3786         * process.h (NULL_DEVICE):
3787         * emacs.c (SEPCHAR):
3788         * editfns.c (USER_FULL_NAME): Let configure set them.
3790         * s/README, s/template.h: Remove files.
3792         * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3794         * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3795         Move to configure.ac.
3797 2012-07-31  Eli Zaretskii  <eliz@gnu.org>
3799         * .gdbinit (xframe): Adapt to introduction of FVAR and the
3800         resulting renaming of 'struct frame' members.
3802         * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3804         * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3805         after introduction of FVAR.
3807 2012-07-31  Jan Djärv  <jan.h.d@swipnet.se>
3809         * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3811         * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3812         instead of compositeToPoint.
3813         (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3815         * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
3817 2012-07-31  Dmitry Antipov  <dmantipov@yandex.ru>
3819         Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3820         * lisp.h (INTERNAL_FIELD): New macro.
3821         * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
3822         (BVAR): Change to use INTERNAL_FIELD.
3823         * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3824         (KVAR): Change to use INTERNAL_FIELD.
3825         * frame.h (FVAR): New macro.
3826         (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3827         * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3828         * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3829         * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3830         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3832 2012-07-31  Dmitry Antipov  <dmantipov@yandex.ru>
3834         Miscellaneous fixes for non-default X toolkits.
3835         * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3836         * xterm.c (x_frame_of_widget): Remove redundant prototype.
3837         Move under #ifdef USE_LUCID.
3838         (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3839         definition and usage to avoid warnings.
3841 2012-07-31  Jan Djärv  <jan.h.d@swipnet.se>
3843         * nsterm.m (openFiles): Fix previous checkin.
3845 2012-07-31  Paul Eggert  <eggert@cs.ucla.edu>
3847         * indent.c (compute_motion): Remove unused local.
3849 2012-07-31  Glenn Morris  <rgm@gnu.org>
3851         * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3853         * conf_post.h [USG5_4]:
3854         Move remaining contents of s/usg5-4-common.h here.
3855         * s/usg5-4-common.h: Remove file.
3857         * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3858         * s/irix6-5.h: Remove file.
3860         * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3861         * s/darwin.h: Remove file.
3863         * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3864         * s/hpux10-20.h: Remove file, which is now empty.
3866 2012-07-30  Glenn Morris  <rgm@gnu.org>
3868         * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3869         * Makefile.in (config_h): Add conf_post.h.
3870         * makefile.w32-in (CONFIG_H): Add conf_post.h.
3872 2012-07-30  Jan Djärv  <jan.h.d@swipnet.se>
3874         * nsterm.m (ns_do_open_file): New variable.
3875         (ns_term_init): Set ns_do_open_file to YES after run returns.
3876         (openFile, openTempFile, openFileWithoutUI, openFiles):
3877         Open files only if ns_do_open_file.
3879 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
3881         * lisp.h (SWITCH_ENUM_CAST): Remove.  All uses removed.
3882         This no-op macro hasn't been needed for many years.
3883         * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3885         Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3886         * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3887         * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3888         gdb_make_enums_visible.
3889         (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3890         (DIRECTORY_SEP): Now a constant, not a macro.
3892 2012-07-30  Eli Zaretskii  <eliz@gnu.org>
3894         * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3895         w32_kbd_patch_key as the 2nd arg.  (Bug#12082)
3897         * w32term.c <w32_keyboard_codepage>: Renamed from
3898         keyboard_codepage and now external.  All users changed.
3900         * w32term.h: Add declaration of w32_keyboard_codepage.
3902         * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3903         the codepage to translate keys to Unicode.  If this argument is
3904         -1, use the value returned by GetConsoleCP.  All callers changed.
3906 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
3908         Update .PHONY listings in makefiles.
3909         * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3910         bootstrap-clean, distclean, maintainer-clean, versioclean,
3911         extraclean, frc.
3913         * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3914         This is a bit clearer.  Fix some commentary typos.
3916 2012-07-30  Glenn Morris  <rgm@gnu.org>
3918         * s/netbsd.h: Let configure include signal.h if needed.
3919         Remove file, which is now empty.
3921         * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3922         Let configure set them.
3923         * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3924         No more need to undefine.
3926 2012-07-30  Andreas Schwab  <schwab@linux-m68k.org>
3928         * keymap.c (Fkey_description): Don't remove 0x80 bit from
3929         non-single-byte char when adding meta modifier.  (Bug#12090)
3931 2012-07-30  Dmitry Antipov  <dmantipov@yandex.ru>
3933         Convert safe_call to use variable number of arguments.
3934         * xdisp.c (safe_call): Convert to use varargs.  Adjust users.
3935         (safe_call2): Fix comment.
3936         * lisp.h (safe_call): Adjust prototype.
3937         * coding.c (encode_coding_object): Change to use safe_call2.
3938         * xfaces.c (merge_face_heights): Change to use safe_call1.
3940 2012-07-30  Glenn Morris  <rgm@gnu.org>
3942         * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
3943         does that unconditionally.  Remove file, which is now empty.
3945         * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3946         Remove empty files.
3948 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
3950         Export to GDB most of lisp.h's remaining object-like macros.
3951         * lisp.h (min, max): Move earlier, because they're used earlier now.
3952         (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3953         (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3954         (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3955         (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3956         (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3957         (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3958         (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3959         (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3960         Now constants, for GDB.  They need not be macros.
3961         (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3962         Now constants, for GDB, as well as macros, for static initializers.
3963         (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3964         Move to after the definition of struct Lisp_Char_Table,
3965         since the former now needs that type defined.
3966         (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3967         (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3968         (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3969         New enums, for gdb_make_enums_visible.
3970         (GLYPH_MODE_LINE_FACE): Remove; unused.
3971         * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
3972         (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3973         CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3974         enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3975         enum maxargs, enum MAX_ALLOCA.
3976         (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3977         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3978         no longer needed, now that they are done in lisp.h.
3980 2012-07-30  Dmitry Antipov  <dmantipov@yandex.ru>
3982         Cleanup string bytes checking.
3983         * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove.  Convert
3984         all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3985         (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3986         (check_sblock, compact_small_strings): Simplify.
3988 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
3990         * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3991         These macros are confusing and no longer need to be defined, as
3992         the enum values now suffice.  All uses replaced with definiens.
3993         (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3995 2012-07-29  Juanma Barranquero  <lekktu@gmail.com>
3997         * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3998         ($(BLD)/w32console.$(O)): Update dependencies.
4000 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
4002         Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
4003         * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
4004         time.  Adjust users.
4005         (CHECK_CONS_LIST): Remove.  Convert all users to check_cons_list.
4007 2012-07-29  Jan Djärv  <jan.h.d@swipnet.se>
4009         * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
4010         setting sitelisp (Bug#12010).
4012 2012-07-29  Eli Zaretskii  <eliz@gnu.org>
4014         * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
4016         * w32heap.c (cache_system_info):
4017         * w32.c (sys_rename):
4018         * w32proc.c (find_child_console, sys_kill): All users changed.
4020 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
4022         * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4024 2012-07-29  Eli Zaretskii  <eliz@gnu.org>
4026         * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4028 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
4030         Cleanup statistics calculation in Fgarbage_collect.
4031         * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4032         Fix zombies percentage calculation.  Simplify elapsed time calculation.
4034 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
4036         Generalize marker debugging code under MARKER_DEBUG and use eassert.
4037         * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
4038         (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
4039         (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
4040         (replace_range, replace_range_2, del_range_2): Change to eassert.
4041         * marker.c (byte_char_debug_check): Adjust style.
4043 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
4045         Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4046         * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4047         long-ago-commented-out code that talks about "WIN32".
4048         * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4049         All uses changed.
4051 2012-07-28  Paul Eggert  <eggert@cs.ucla.edu>
4053         Use Gnulib stdalign module (Bug#9772, Bug#9960).
4054         * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4055         Simplify by using alignof.
4056         (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4057         * lisp.h: Include <stdalign.h>.
4058         (GCALIGNMENT): New macro and constant.
4059         (DECL_ALIGN): Remove.  All uses replaced by alignas (GCALIGNMENT).
4060         (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4061         (stdalign): New macro, if not already defined.
4063 2012-07-28  Eli Zaretskii  <eliz@gnu.org>
4065         Fix non-ASCII input in non-GUI frames on MS-Windows.  (Bug#12055)
4066         * w32inevt.c: Include w32inevt.h.
4067         (w32_read_console_input): New inline function, calls either
4068         ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4069         w32_console_unicode_input.
4070         (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4071         (w32_kbd_patch_key, key_event): Use the codepage returned by
4072         GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4073         (key_event): use uChar.UnicodeChar only if
4074         w32_console_unicode_input is non-zero.
4076         * w32console.c: Include w32heap.h.
4077         <w32_console_unicode_input>: New global variable.
4078         (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4079         family of Windows, zero otherwise.
4081         * w32inevt.h: Declare w32_console_unicode_input.
4083         * xdisp.c (init_iterator): Don't reference tip_frame in a build
4084         --without-x.  (Bug#11742)
4086 2012-07-27  Paul Eggert  <eggert@cs.ucla.edu>
4088         Adjust GDB to reflect pvec_type changes (Bug#12036).
4089         * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
4090         2012-07-04 changes to pseudovector representation.
4091         Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
4093 2012-07-27  Michael Albinus  <michael.albinus@gmx.de>
4095         * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4096         bus address.
4097         (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4099 2012-07-27  Eli Zaretskii  <eliz@gnu.org>
4101         * alloc.c (listn): Fix the order the arguments are consed onto the
4102         list.
4104         * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4105         enumeration constants, as PURE and HEAP are too general, and clash
4106         with other headers and sources, such as gmalloc.c and the
4107         MS-Windows system headers.  All users changed.
4109 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
4111         Revert last save_excursion_save and save_excursion_restore changes.
4112         * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4113         Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4115 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
4117         Fix recently-introduced typos in Windows port.
4118         Reported by Martin Rudalics <rudalics@gmx.at>.
4119         * w32.c (init_environment): Replace comma with semicolon.
4120         * w32fns.c (syms_of_w32fns): Add missing parenthesis.
4122 2012-07-27  Paul Eggert  <eggert@cs.ucla.edu>
4124         Improve GDB symbol export (Bug#12036).
4125         * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4126         arms of an 'if', not using conditional expressions; otherwise GDB
4127         complains about the types in the unevaluated arm when the argument
4128         is an integer literal.
4129         (xgetint): Simplify expression.
4130         * alloc.c (gdb_make_enums_visible): New constant.  This ports to
4131         GCC 3.4.2 the export of symbols to GDB.  Problem reported by Eli
4132         Zaretskii in <http://bugs.gnu.org/12036#13>.
4133         * lisp.h (PUBLISH_TO_GDB): Remove.  All uses removed.  No longer
4134         needed now that we have gdb_make_enums_visible.
4135         (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4136         (enum enum_USE_LSB_TAG):
4137         New enum types, packaging up enums that need to be exported to GDB.
4139 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
4141         Utility function to make a list from specified amount of objects.
4142         * lisp.h (enum constype): New datatype.
4143         (listn): New prototype.
4144         * alloc.c (listn): New function.
4145         (Fmemory_use_count, syms_of_alloc): Use it.
4146         * buffer.c (syms_of_buffer): Likewise.
4147         * callint.c (syms_of_callint): Likewise.
4148         * charset.c (define_charset_internal): Likewise.
4149         * coding.c (syms_of_coding): Likewise.
4150         * keymap.c (syms_of_keymap): Likewise.
4151         * search.c (syms_of_search): Likewise.
4152         * syntax.c (syms_of_syntax): Likewise.
4153         * w32.c (init_environment): Likewise.
4154         * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4155         * xdisp.c (syms_of_xdisp): Likewise.
4156         * xfns.c (syms_of_xfns): Likewise.
4158 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
4160         Fast save_excursion_save and save_excursion_restore.
4161         * lisp.h (struct Lisp_Excursion): New data type.
4162         (PVEC_EXCURSION): New pseudovector type.
4163         (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4164         to deal with it.  Adjust comments.
4165         (init_marker, attach_marker): New prototype.
4166         (unchain_marker): Adjust prototype.
4167         * marker.c (attach_marker): Change to global.
4168         (init_marker): New function.
4169         * alloc.c (Fmake_marker, build_marker): Use it.
4170         (build_marker): More easserts.
4171         (mark_object): Handle struct Lisp_Excursion.
4172         * editfns.c (save_excursion_save, save_excursion_restore):
4173         Reimplement to use struct Lisp_Excursion.  Add comments.
4175 2012-07-26  Paul Eggert  <eggert@cs.ucla.edu>
4177         Fix export of symbols to GDB (Bug#12036).
4178         * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4179         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4180         emacs.c, as this is a more-suitable home.  Had this been done earlier
4181         the fix for 12036 would have avoided some of the problems noted in
4182         <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4183         would have been more obvious.
4184         * emacs.c: Do not include <verify.h>; no longer needed.
4185         (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
4186         (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4187         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4188         Remove; now done in lisp.h.
4189         * lisp.h (PUBLISH_TO_GDB): New macro.
4190         (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4191         (DATA_SEG_BITS): Use it.
4192         (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4193         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4194         * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4195         not be usable in #if.  This simplifies things.
4197 2012-07-26  Juanma Barranquero  <lekktu@gmail.com>
4199         * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4201 2012-07-26  Paul Eggert  <eggert@cs.ucla.edu>
4203         Simplify export of symbols to GDB (Bug#12036).
4204         * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4205         $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4206         (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4207         Adjust to changes in lisp.h and emacs.c, by using
4208         CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4209         of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4210         INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4211         gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4212         instead of gdb_valbits.
4213         (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4214         PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4215         instead of gdb_array_mark_flag.
4216         (xboolvector): Get size from $->size, not $->header.size.
4217         Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4218         (xreload, hook-run, hookpost-run): Remove.
4219         * emacs.c: Include <verify.h>.
4220         (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4221         (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4222         Remove.
4223         (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4224         (gdb_USE_LSB_TAG): New enum constants.
4225         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4226         Also define these as enum constants, so they're visible to GDB.
4227         (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4228         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4229         as constants, so they're visible to GDB.
4230         * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4231         (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4232         Now enum constants, not macros, so they're visible to GDB.
4233         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4234         more convenient now.  All uses changed.
4235         (VALMASK) [USE_LSB_TAG]: Also define in this case.
4236         * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4238 2012-07-26  Dmitry Antipov  <dmantipov@yandex.ru>
4240         Explicitly free restriction data that are not needed anymore.
4241         * editfns.c (save_restriction_restore): Free restriction data.
4243 2012-07-26  Stefan Monnier  <monnier@iro.umontreal.ca>
4245         * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4246         add argument, tune behavior, and adjust all callers.
4248 2012-07-25  Paul Eggert  <eggert@cs.ucla.edu>
4250         Use typedef for EMACS_INT, EMACS_UINT.
4251         * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4252         than macros.  This simplifies debugging in the usual case, since
4253         it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4254         and it allows expressions involving EMACS_INT casts.
4255         * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4257 2012-07-25  Jan Djärv  <jan.h.d@swipnet.se>
4259         * nsterm.m (ns_read_socket): Return early if there is a modal
4260         window (Bug#12043).
4262 2012-07-25  Martin Rudalics  <rudalics@gmx.at>
4264         * frame.c (Fredirect_frame_focus): In doc-string don't mention
4265         that FOCUS-FRAME can be omitted.
4267 2012-07-25  Dmitry Antipov  <dmantipov@yandex.ru>
4269         Adjust buffer text indirection counters at the end of Fkill_buffer.
4270         * buffer.c (Fkill_buffer): Adjust indirection counters when the
4271         buffer is definitely dead.  This should really fix an issue reported
4272         by Christoph Scholtes again.  (Bug#12007).
4273         (init_buffer_once): Initialize indirection counters of
4274         buffer_defaults and buffer_local_symbols (for sanity and safety).
4276 2012-07-24  Eli Zaretskii  <eliz@gnu.org>
4278         * xdisp.c (init_iterator): Don't compute dimensions of truncation
4279         and continuation glyphs on tooltip frames, leave them at zero.
4280         Avoids continued lines in tooltips.  (Bug#11832)
4282 2012-07-24  Dmitry Antipov  <dmantipov@yandex.ru>
4284         Simplify copy_overlay.
4285         * buffer.c (copy_overlay): Simplify.  Use build_marker.
4286         * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4288 2012-07-23  Eli Zaretskii  <eliz@gnu.org>
4290         * print.c (print_object): Don't crash when a frame's name is nil
4291         or invalid.  (Bug#12025)
4293         * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4294         it signals an error when a tooltip frame is being created.
4296 2012-07-23  Dmitry Antipov  <dmantipov@yandex.ru>
4298         Cleanup miscellaneous objects allocation and initialization.
4299         * alloc.c (allocate_misc): Change to static.  Add argument to
4300         specify the subtype.  Adjust comment and users.
4301         (build_overlay): New function.
4302         * buffer.c (copy_overlays, Fmake_overlay): Use it.
4303         * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4304         (allocate_misc): Remove prototype.
4305         (build_overlay): Add prototype.
4307 2012-07-23  Dmitry Antipov  <dmantipov@yandex.ru>
4309         Swap buffer text indirection counters in Fbuffer_swap_text.
4310         * buffer.c (Fbuffer_swap_text): Swap indirections too.
4311         This avoids crash reported by Christoph Scholtes at
4312         http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4314 2012-07-22  Jan Djärv  <jan.h.d@swipnet.se>
4316         * nsmenu.m (Popdown_data): New struct.
4317         (pop_down_menu): p->pointer is Popdown_data.  Release the pool and
4318         free Popdown_data.
4319         (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4320         (initWithContentRect): Make imgView and contentView non-static
4321         and autorelease them.  Also autorelease img and matrix (Bug#12005).
4322         (dealloc): Remove (Bug#12005).
4324 2012-07-22  Dmitry Antipov  <dmantipov@yandex.ru>
4326         Adjust consing_since_gc when objects are explicitly freed.
4327         * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4328         (Fgarbage_collect): Use it.  Change minimum to 1/10 of default.
4329         (free_cons, free_misc): Subtract object size from consing_since_gc.
4331 2012-07-22  Dmitry Antipov  <dmantipov@yandex.ru>
4333         Simplify and cleanup markers positioning code.
4334         * marker.c (attach_marker): More useful eassert.
4335         (live_buffer, set_marker_internal): New function.
4336         (Fset_marker, set_marker_restricted): Use set_marker_internal.
4337         (set_marker_both, set_marker_restricted_both): Use live_buffer.
4339 2012-07-22  Paul Eggert  <eggert@cs.ucla.edu>
4341         * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4342         as it's limited by the amount of memory, not by INT_MAX.
4344 2012-07-21  Eli Zaretskii  <eliz@gnu.org>
4346         * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4347         in special-event-map.  See the discussion at
4348         http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4349         for the reasons.
4351         * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
4352         info.dwItemData.  Fixes crashes on 64-bit Windows.
4353         Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
4355 2012-07-21  Jan Djärv  <jan.h.d@swipnet.se>
4357         * nsterm.m (accessibilityAttributeValue): New function.  (Bug#11134).
4358         (conversationIdentifier): Return value is NSInteger.
4359         * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
4361 2012-07-21  Chong Yidong  <cyd@gnu.org>
4363         * window.c (decode_any_window): Signal an error if the window is
4364         on a dead frame (Bug#11984).
4366 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
4368         Add indirection counting to speed up Fkill_buffer.
4369         * buffer.h (struct buffer): New member.
4370         * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4371         (Fmake_indirect_buffer): Set indirection counter to -1, increment
4372         base buffer indirection counter.
4373         (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4374         (Fkill_buffer): Adjust indirection counters as needed, don't walk
4375         through buffer list if indirection counter is 0.
4377 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
4379         Extend the value returned by Fgarbage_collect with heap statistics.
4380         * alloc.c (Qheap): New symbol.
4381         (syms_of_alloc): DEFSYM it.
4382         (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4383         (Fmemory_free): Remove.
4384         (syms_of_alloc): Don't defsubr it.
4385         * buffer.c (Fcompact_buffer): Remove.
4386         (syms_of_buffer): Don't defsubr it.
4388 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
4390         Make maybe_gc inline.
4391         Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4392         * lisp.h (consing_since_gc, gc_relative_threshold)
4393         (memory_full_cons_threshold): Revert declaration.
4394         (maybe_gc): Remove prototype, define as inline.
4395         * alloc.c: Remove old commented-out code.
4396         (consing_since_gc, gc_relative_threshold)
4397         (memory_full_cons_threshold): Revert to global.
4398         (maybe_gc): Remove.
4400 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
4402         Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4403         * lisp.h (build_unibyte_string): New function.
4404         * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4405         * sysdep.c, w32fns.c, xfns.c: Use it.
4406         * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4407         of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4408         Adjust users accordingly.
4409         * font.h (font_open_by_name): Adjust prototype.
4411 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
4413         Cleanup calls to Fgarbage_collect.
4414         * lisp.h (maybe_gc): New prototype.
4415         (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4416         Remove declarations.
4417         * alloc.c (maybe_gc): New function.
4418         (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4419         Make them static.
4420         * bytecode.c (MAYBE_GC): Use maybe_gc.
4421         * eval.c (eval_sub, Ffuncall): Likewise.
4422         * keyboard.c (read_char): Likewise.  Adjust call to maybe_gc
4423         to avoid dependency from auto-save feature.
4425 2012-07-19  Paul Eggert  <eggert@cs.ucla.edu>
4427         * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4428         (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4429         'for_each_per_buffer_object_at'.
4430         All uses changed.  It's better to use upper-case for macros that
4431         cannot be implemented as functions, to give the reader a clue
4432         that they're special.
4434 2012-07-19  Stefan Monnier  <monnier@iro.umontreal.ca>
4436         * alloc.c (Fgarbage_collect): Tweak docstring.
4438 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
4440         Tweak the value returned from Fgarbage_collect again.
4441         * alloc.c (Fgarbage_collect): New return value, as confirmed in
4442         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4443         Adjust documentation.
4444         (total_vector_bytes): Rename to total_vector_slots, adjust
4445         accounting.
4446         (total_free_vector_bytes): Rename to total_free_vector_slots,
4447         adjust accounting.
4448         (Qstring_bytes, Qvector_slots): New symbols.
4449         (syms_of_alloc): DEFSYM them.
4451 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
4453         Buffer compaction primitive which may be used from Lisp.
4454         * buffer.c (compact_buffer, Fcompact_buffer): New function.
4455         (syms_of_buffer): Register Fcompact_buffer.
4456         * alloc.c (Fgarbage_collect): Use compact_buffer.
4457         * buffer.h (compact_buffer): New prototype.
4458         (struct buffer_text): New member.
4460 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
4462         New macro to iterate over all buffers, miscellaneous cleanups.
4463         * lisp.h (all_buffers): Remove declaration.
4464         * buffer.h (all_buffers): Add declaration, with comment.
4465         (for_each_buffer): New macro.
4466         * alloc.c (Fgarbage_collect, mark_object): Use it.
4467         * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4468         (init_buffer): Likewise.
4469         * data.c (Fset_default): Likewise.
4470         * coding.c (code_conversion_restore): Remove redundant check
4471         for dead buffer.
4472         * buffer.c (Fkill_buffer): Likewise.  Remove obsolete comment.
4474 2012-07-18  Andreas Schwab  <schwab@linux-m68k.org>
4476         Fix bug that created negative-length intervals.
4477         * intervals.c (merge_interval_right, merge_interval_left):
4478         Do not zero out this interval if it is absorbed by its children,
4479         as this interval's total length doesn't change in that case.  See
4480         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4482 2012-07-18  Paul Eggert  <eggert@cs.ucla.edu>
4484         * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4485         when invoking (make-bool-vector N t) and N is a positive
4486         multiple of 8 -- the last 8 bits were mistakenly cleared.
4488         Remove some struct layout assumptions in bool vectors.
4489         * alloc.c (bool_header_size): New constant.
4490         (header_size, word_size): Move earlier, as they're now used earlier.
4491         Use 'word_size' in a few more places, where it's appropriate.
4492         (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4493         padding before the data member of a bool vector.
4494         (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4495         than doing the check by hand with an abort ().
4497 2012-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
4499         * eval.c (Fdefvar): Don't check constants since we only set the var if
4500         it's not yet defined anyway (bug#11904).
4502         * lisp.h (last_undo_boundary): Declare new var.
4503         * keyboard.c (command_loop_1): Set it.
4504         * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4505         were auto-added by the command loop (bug#11774).
4507 2012-07-18  Andreas Schwab  <schwab@linux-m68k.org>
4509         * w32font.c (Qsymbol): Remove local definition.
4510         (syms_of_w32font): Don't DEFSYM it.
4512 2012-07-18  Dmitry Antipov  <dmantipov@yandex.ru>
4514         Fix sweep_vectors to handle large bool vectors correctly.
4515         * alloc.c (sweep_vectors): Account total_vector_bytes for
4516         bool vectors larger than VBLOCK_BYTES_MAX.
4518 2012-07-18  Chong Yidong  <cyd@gnu.org>
4520         * frame.c (x_set_frame_parameters): Revert bogus change introduced
4521         in 2012-05-25 commit by Paul Eggert (Bug#11738).
4523 2012-07-18  Dmitry Antipov  <dmantipov@yandex.ru>
4525         Return more descriptive data from Fgarbage_collect.
4526         Suggested by Stefan Monnier in
4527         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4528         * alloc.c (bounded_number): New function.
4529         (total_buffers, total_vectors): New variable.
4530         (total_string_size): Rename to total_string_bytes, adjust users.
4531         (total_vector_size): Rename to total_vector_bytes, adjust users.
4532         (sweep_vectors): Account total_vectors and total_vector_bytes.
4533         (Fgarbage_collect): New return value.  Adjust documentation.
4534         (gc_sweep): Account total_buffers.
4535         (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4536         (VECTOR_SIZE): Remove.
4537         * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4538         (Qinterval, Qmisc): New symbols.
4539         (syms_of_data): Initialize them.
4540         * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4541         (Qcons, Qbuffer): New declarations.
4543 2012-07-17  Paul Eggert  <eggert@cs.ucla.edu>
4545         * alloc.c (Fmemory_free): Account for memory-free's own storage.
4546         Round up, not down.  Improve doc.
4548 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
4550         Restore old code in allocate_string_data to avoid Faset breakage.
4551         Reported by Julien Danjou <julien@danjou.info> in
4552         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4553         * alloc.c (allocate_string_data): Restore old code with minor
4554         adjustments, fix comment to explain this subtle issue.
4556 2012-07-17  Eli Zaretskii  <eliz@gnu.org>
4558         Remove FILE_SYSTEM_CASE.
4559         * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4561         * fileio.c (FILE_SYSTEM_CASE): Don't define.
4562         (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4563         Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4564         call-process-region passes it through expand-file-name.
4566         * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4568 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
4570         Fix crash when creating indirect buffer (Bug#11917)
4571         * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4572         Don't handle unbound variables specially if non-zero.
4573         (Fbuffer_local_variables): Pass zero.
4574         (clone_per_buffer_values): Pass non-zero.
4576 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
4578         * gnutls.c (emacs_gnutls_handshake): Revert last change.  Add QUIT
4579         to make the loop interruptible.
4581 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
4583         * gnutls.c (emacs_gnutls_handshake): Only retry if
4584         GNUTLS_E_INTERRUPTED.
4586 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
4588         Cleanup and convert miscellaneous checks to eassert.
4589         * alloc.c (mark_interval): Fix comment, partially rephrase
4590         old comment from intervals.h (see below).
4591         * intervals.c (find_interval, adjust_intervals_for_insertion)
4592         (delete_interval, adjust_intervals_for_deletion)
4593         (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4594         Convert to eassert.
4595         (adjust_intervals_for_insertion, make_new_interval):
4596         Remove obsolete and unused code.
4597         * intervals.h (struct interval): Remove obsolete comment.
4598         * textprotp.c (erase_properties): Remove unused code.
4599         (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4600         (Fremove_list_of_text_properties): Convert to eassert.
4602 2012-07-17  Chong Yidong  <cyd@gnu.org>
4604         * editfns.c (Finsert_char): Doc fix.
4606 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
4608         Fix previous change to make Fmemory_free always accurate.
4609         * alloc.c (make_interval): Update total_free_intervals.
4610         (make_float): Likewise for total_free_floats.
4611         (free_cons, Fcons): Likewise for total_free_conses.
4612         (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4613         Likewise for total_free_vector_bytes.
4614         (Fmake_symbol): Likewise for total_free_symbols.
4615         (bytes_free): Remove.
4617 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
4619         Simple free memory accounting feature.
4620         * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4621         (sweep_vectors): Accumulate size of free vectors.
4622         (Fgarbage_collect): Setup bytes_free.
4623         (Fmemory_free): New function.
4624         (syms_of_alloc): Register it.
4626 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
4628         Cleanup overlays checking.
4629         * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4630         * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4631         eassert and OVERLAYP.
4632         (sort_overlays): Change to use OVERLAYP.
4634 2012-07-16  René Kyllingstad  <Rene@Kyllingstad.com>  (tiny change)
4636         * editfns.c (Finsert_char): Make it interactive, and make the
4637         second arg optional.  Copy interactive spec and docstring from
4638         ucs-insert.
4640 2012-07-17  Paul Eggert  <eggert@cs.ucla.edu>
4642         * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4643         Unlike the other wrapped functions, fabs has an unspecified
4644         effect on errno.
4646 2012-07-16  Jan Djärv  <jan.h.d@swipnet.se>
4648         * nsterm.m (keyDown): Interpret flags without left/right bits
4649         as the left key (Bug#11670).
4651 2012-07-16  Dmitry Antipov  <dmantipov@yandex.ru>
4653         Remove empty and useless init functions.
4654         * lisp.h (init_character_once, init_fns, init_image)
4655         (init_filelock, init_sound): Remove prototype.
4656         * character.c (init_character_once): Remove.
4657         * filelock.c (init_filelock): Likewise.
4658         * fns.c (init_fns): Likewise.
4659         * image.c (init_image): Likewise.
4660         * sound.c (init_sound): Likewise.
4661         * emacs.c (main): Adjust accordingly.
4663 2012-07-16  Dmitry Antipov  <dmantipov@yandex.ru>
4665         * gtkutil.h: Tiny cleanups.
4666         (use_old_gtk_file_dialog): Remove useless declaration.
4667         (xg_uses_old_file_dialog): Add suggested const attribute.
4669 2012-07-15  Eli Zaretskii  <eliz@gnu.org>
4671         * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4672         (bidi_paragraph_init): Use it to limit search forward for a strong
4673         directional character in abnormally large paragraphs full of
4674         neutral or weak characters.  (Bug#11943)
4676 2012-07-15  Stefano Facchini  <stefano.facchini@gmail.com>  (tiny change)
4678         * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4679         the toolbar (Bug#9451).
4680         (xg_make_tool_item): Give the widget event box a transparent
4681         background.
4683 2012-07-15  Dmitry Antipov  <dmantipov@yandex.ru>
4685         Cleanup basic allocation variables and functions.
4686         * alloc.c (ignore_warnings, init_intervals, init_float)
4687         (init_cons, init_symbol, init_marker): Remove.
4688         (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4689         (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4690         (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4691         (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4692         (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4693         (staticidx, init_alloc_once, init_strings, free_ablock):
4694         Remove redundant initialization.
4695         * fns.c (init_weak_hash_tables): Remove.
4696         * lisp.h (init_weak_hash_tables): Remove prototype.
4698 2012-07-15  Dmitry Antipov  <dmantipov@yandex.ru>
4700         Use zero_vector where appropriate.
4701         * alloc.c (zero_vector): Define as Lisp_Object.  Adjust users
4702         accordingly.
4703         * lisp.h (zero_vector): New declaration.
4704         * font.c (null_vector): Remove.
4705         (syms_of_font): Remove initialization and staticpro.
4706         (font_list_entities, font_find_for_lface): Change to use zero_vector.
4707         * keymap.c (Faccessible_keymaps): Likewise.
4709 2012-07-15  Leo Liu  <sdl.web@gmail.com>
4711         * fringe.c: Fix typo in comments.
4713 2012-07-14  Leo Liu  <sdl.web@gmail.com>
4715         * fringe.c: Add a new bitmap exclamation-mark.
4717 2012-07-14  Eli Zaretskii  <eliz@gnu.org>
4719         * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4721         * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4722         (HAVE_MENUS): Don't define, defined by editing config.in with
4723         msdos/sed2v2.inp.
4724         (GMALLOC_INHIBIT_VALLOC): Don't define.
4725         (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4727 2012-07-14  Juanma Barranquero  <lekktu@gmail.com>
4729         * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4731 2012-07-14  Glenn Morris  <rgm@gnu.org>
4733         * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4734         * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4735         Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4737 2012-07-13  Glenn Morris  <rgm@gnu.org>
4739         * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4741         * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4742         * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4744 2012-07-13  Jan Djärv  <jan.h.d@swipnet.se>
4746         * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4747         (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4748         (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4749         (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4750         where appropriate.
4751         (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4752         as boolean expression.
4753         (x_set_window_size): Remove unused variable toolbar.
4754         (ns_get_color_default, ns_mod_to_lisp): Remove.
4755         (ns_mouse_position): Remove unused variables xchar and ychar.
4756         (ns_compute_glyph_string_overhangs): Remove unused variable face.
4757         (ns_set_vertical_scroll_bar): Remove unused variable count.
4758         (ns_delete_terminal): Remove unused variable i.
4759         (ns_term_init): Remove unused variables r, g and b.
4760         (mouseDown): Remove unused variable window.
4761         (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4762         (initFrameFromEmacs): Remove unused variable vbextra.
4763         (mouseEntered): Remove unused variables p and dpyinfo.
4764         (mouseExited): Remove unused variables p and r.
4765         (ns_define_frame_cursor, ns_clear_frame_area)
4766         (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4767         (menuDown): Assign [sender tag] to variable and cast the variable.
4769         * nsterm.h (menuDown): Add id as type to argument sender.
4770         (ns_display_info_for_name): Add Lisp_Object argument.
4771         (ns_term_init): Add Lisp_Object argument.
4772         (ns_map_event_to_object): Add void argument.
4773         (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4774         prototype with arguments and only declare if __OBJC__.
4775         (nxatoms_of_nsselect): Add void argument.
4776         (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4777         (ns_alloc_autorelease_pool): Add void argument.
4778         (ns_release_autorelease_pool): Add void* argument.
4779         (ns_get_defaults_value): Add const char* argument.
4781         * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4782         (initFromContents): Use SSDATA where appropriate.
4783         (ns_update_menubar): Add braces to ambigous if-else.
4784         (initWithTitle): Put () around assignment in if statement.
4785         (ns_menu_show): Remove unused variables window and keymap.
4786         (update_frame_tool_bar): Remove unused variable selected_p.
4787         (initWithContentRect): Remove unused variable this_cmd_name.
4789         * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4790         appropriate.
4791         (setXBMColor): Remove unused variable len.
4792         (setPixmapData): Put () around assignment in loop statement.
4794         * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4795         (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4796         where appropriate.
4797         (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4798         around assignment in loop statement.
4799         (nsfont_open): Remove unused variable i.
4800         (nsfont_open): Remove unused variable len.
4801         (nsfont_draw): Remove unused variable cs.
4803         * nsfns.m (x_set_icon_name, ns_set_name_internal)
4804         (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4805         (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4806         (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4807         (Fns_font_name, Fns_perform_service)
4808         (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4809         (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4810         (ns_set_name): Remove unused variable view.
4811         (x_set_menu_bar_lines): Remove unused variable olines.
4812         (x_set_tool_bar_lines): Remove unused variable root_window.
4813         (Fns_list_colors): Put () around assignment in while statement.
4814         (Fns_perform_service): Remove unused variable len.
4815         (Fns_display_usable_bounds): Remove unused variable top.
4816         (syms_of_nsfns): Remove unused variable i.
4818         * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4819         memcpy (Bug#11907).
4821 2012-07-13  Kalle Kankare  <kalle.kankare@iki.fi>  (tiny change)
4823         * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4824         and free it with DestroyExceptionInfo (Bug#11558).
4826 2012-07-13  Juanma Barranquero  <lekktu@gmail.com>
4828         * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4829         (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4830         Set here, not in nt/config.nt.
4832 2012-07-13  Eli Zaretskii  <eliz@gnu.org>
4834         * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4835         cursor overflow into the last glyph on display line when the right
4836         fringe is off.  (Bug#11832)
4838 2012-07-13  Paul Eggert  <eggert@cs.ucla.edu>
4840         * xdisp.c (produce_special_glyphs): Now static.
4841         * dispextern.h (produce_special_glyphs): Remove decl.
4843 2012-07-13  Glenn Morris  <rgm@gnu.org>
4845         * s/bsd-common.h, s/cygwin.h: Remove empty files.
4846         * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4848         * s/usg5-4-common.h (USG, USG5):
4849         * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4850         * s/sol2-6.h (SOLARIS2):
4851         * s/irix6-5.h (IRIX6_5):
4852         * s/hpux10-20.h (USG, USG5, HPUX):
4853         * s/gnu-linux.h (USG, GNU_LINUX):
4854         * s/freebsd.h (BSD_SYSTEM):
4855         * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4856         * s/cygwin.h (CYGWIN):
4857         * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4858         * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4860 2012-07-13  BT Templeton  <bpt@hcoop.net>  (tiny change)
4862         * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
4864 2012-07-13  Glenn Morris  <rgm@gnu.org>
4866         * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4868         * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4870         * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4871         * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4873 2012-07-12  Glenn Morris  <rgm@gnu.org>
4875         * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
4877         * process.c (init_process_emacs): Rename from init_process.
4878         The old name is also the name of a Mach system call.
4879         * lisp.h, emacs.c: Update for this name change.
4880         * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4881         longer needed.
4883 2012-07-12  Eli Zaretskii  <eliz@gnu.org>
4885         * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4886         memmove call that removes glyphs covered by the left truncation
4887         glyph.  Improve commentary.
4888         (display_line): Fix display of continuation glyphs on GUI frames
4889         when the right fringe is turned off and variable-size fonts are
4890         used in the window.  Move the code that appends a stretch glyph to
4891         produce_special_glyphs, so that it could be used for truncation
4892         and continuation glyphs alike.
4893         (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4894         glyph of a suitably computed width, to align the special glyphs at
4895         the window margin.  Code moved from display_line.  (Bug#11832)
4897 2012-07-12  Glenn Morris  <rgm@gnu.org>
4899         * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4901         * s/gnu-linux.h, s/hpux10-20.h:
4902         Do not unconditionally define HAVE_XRMSETDATABASE.
4904         * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4906 2012-07-12  Paul Eggert  <eggert@cs.ucla.edu>
4908         Fix typos that broke OS X build.
4909         Reported by Randal L. Schwartz in
4910         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4911         * nsterm.m (ns_timeout): Add missing local decl.
4912         (ns_get_color): snprintf -> sprintf, to fix typo.
4914 2012-07-12  Glenn Morris  <rgm@gnu.org>
4916         * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4917         * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4918         * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4919         Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4921         * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4922         Move PTY_OPEN to configure.
4924         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4925         * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4926         * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4928 2012-07-12  Dmitry Antipov  <dmantipov@yandex.ru>
4930         Use empty_unibyte_string where applicable.
4931         * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4932         * lread.c (read1): Likewise.
4933         * xsettings.c (syms_of_xsettings): Likewise.
4935 2012-07-12  Glenn Morris  <rgm@gnu.org>
4937         * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4938         * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
4939         * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4940         * s/hpux10-20.h (RUN_TIME_REMAP):
4941         * s/bsd-common.h (TABDLY): Move to configure.
4943         * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4945         * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4947         * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4948         (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
4950         * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
4952         * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4953         * s/template.h: Move NARROWPROTO to configure.
4955 2012-07-11  Glenn Morris  <rgm@gnu.org>
4957         * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4958         unused since 2011-01-17 change to systty.h.
4960         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4961         * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4962         Move HAVE_PTYS and HAVE_SOCKETS to configure.
4964 2012-07-11  Paul Eggert  <eggert@cs.ucla.edu>
4966         * s/sol2-6.h (HAVE_LIBKSTAT): Remove.  (Bug#11914)
4968 2012-07-11  Glenn Morris  <rgm@gnu.org>
4970         * s/darwin.h, s/gnu-linux.h, s/template.h:
4971         Move INTERRUPT_INPUT to configure.
4973 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
4975         Minor adjustments to interning code.
4976         * lisp.h (intern, intern_c_string): Redefine as static inline
4977         wrappers for intern_1 and intern_c_string_1, respectively.
4978         (intern_1, intern_c_string_1): Rename prototypes.
4979         * lread.c (intern_1, intern_c_string_1, oblookup):
4980         Simplify Vobarray checking.
4981         * font.c (font_intern_prop): Likewise.  Adjust comment.
4982         * w32font.c (intern_font_name): Likewise.
4984 2012-07-11  Andreas Schwab  <schwab@linux-m68k.org>
4986         * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4988         * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4989         of Fcar/Fcdr if possible.
4990         * font.c (check_otf_features): Likewise.
4991         * fontset.c (Fnew_fontset): Likewise.
4992         * gnutls.c (Fgnutls_boot): Likewise.
4993         * minibuf.c (read_minibuf): Likewise.
4994         * msdos.c (IT_set_frame_parameters): Likewise.
4995         * xmenu.c (Fx_popup_dialog): Likewise.
4996         * w32menu.c (Fx_popup_dialog): Likewise.
4998 2012-07-11  Glenn Morris  <rgm@gnu.org>
5000         * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
5001         since nothing has defined it on these platforms.
5003         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
5004         * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
5006         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5007         * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5008         Move CLASH_DETECTION to configure.
5010         * s/gnu.h: Remove file, which is now empty.
5012         * s/gnu.h, s/gnu-linux.h:
5013         Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5015 2012-07-11  John Wiegley  <johnw@newartisans.com>
5017         * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5018         function attribute, so we only use it if it exists in the
5019         compiler.
5021 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
5023         Avoid call to strlen in fast_c_string_match_ignore_case.
5024         * search.c (fast_c_string_match_ignore_case): Change to use
5025         length argument.  Adjust users accordingly.
5026         * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5028 2012-07-11  Paul Eggert  <eggert@cs.ucla.edu>
5030         Assume mkdir, rmdir.
5031         * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5032         * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5034         Assume rename.
5035         * sysdep.c (rename) [!HAVE_RENAME]: Remove.
5037         Assume perror.
5038         * s/hpux10-20.h (HAVE_PERROR): Remove.
5039         * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
5040         Remove dummy definition, as this problem was obsolete long ago.
5042         Assume strerror.
5043         * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5045 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
5047         Avoid calls to strlen in font processing functions.
5048         * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
5049         (font_open_by_name): Change to use length argument.
5050         Adjust users accordingly.
5051         * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5052         Adjust prototypes.
5053         * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5054         Change to return ptrdiff_t.
5055         (xfont_list_pattern, xfont_match): Use length returned by
5056         xfont_decode_coding_xlfd.
5057         * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5059 2012-07-11  Glenn Morris  <rgm@gnu.org>
5061         * s/darwin.h, s/freebsd.h, s/netbsd.h:
5062         Move DONT_REOPEN_PTY to configure.
5064         * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5065         * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5067 2012-07-10  Paul Eggert  <eggert@cs.ucla.edu>
5069         Remove "#define unix" that is no longer needed (Bug#11905).
5070         * s/aix4-2.h (unix): Remove; no longer needed.
5072         EMACS_TIME simplification (Bug#11875).
5073         This replaces macros (which typically do not work in GDB)
5074         with functions, typedefs and enums, making the code easier to debug.
5075         The functional style also makes code easier to read and maintain.
5076         * systime.h: Include <sys/time.h> on all hosts, not just if
5077         WINDOWSNT, since 'struct timeval' is needed in general.
5078         (EMACS_TIME): Now a typedef, not a macro.
5079         (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5080         not macros.
5081         (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5082         (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5083         (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5084         (EMACS_TIME_LE): Now functions, not macros.
5085         (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5086         (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5087         which are not functions.  All uses rewritten to use:
5088         (make_emacs_time): New function.
5089         (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5090         (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5091         not functions.  All uses rewritten to use the following, respectively:
5092         (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5093         (add_emacs_time, sub_emacs_time): New functions.
5094         * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
5095         * fileio.c (Fcopy_file):
5096         * xterm.c (XTflash): Get the current time closer to when it's used.
5097         * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5099         * bytecode.c (targets): Suppress -Woverride-init warnings.
5101         Simplify by avoiding confusing use of strncpy etc.
5102         * doc.c (Fsnarf_documentation):
5103         * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5104         * frame.c (Fmake_terminal_frame):
5105         * gtkutil.c (get_utf8_string):
5106         * lread.c (openp):
5107         * nsmenu.m (ns_update_menubar):
5108         * regex.c (regerror):
5109         Prefer memcpy to strncpy and strncat when either will do.
5110         * fileio.c (Fsubstitute_in_file_name):
5111         * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5112         (menu_separator_name_p):
5113         * nsmenu.m (ns_update_menubar):
5114         Prefer memcmp to strncmp when either will do.
5115         * nsterm.m: Include <ftoastr.h>.
5116         (ns_get_color):
5117         * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5118         Prefer snprintf to strncpy.
5119         * nsterm.m (ns_term_init):
5120         * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5121         * nsterm.m (ns_term_init):
5122         Avoid the need for strncpy, by using build_string or
5123         make_unibyte_string directly.  Use dtoastr, not snprintf.
5124         * process.c (Fmake_network_process): Diagnose service names that
5125         are too long, rather than silently truncating them or creating
5126         non-null-terminated names.
5127         (Fnetwork_interface_info): Likewise, for interface names.
5128         * sysdep.c (system_process_attributes) [GNU_LINUX]:
5129         Prefer sprintf to strncat.
5130         * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5131         Prefer vsnprintf to vsprintf + strncpy.
5133 2012-07-10  Glenn Morris  <rgm@gnu.org>
5135         * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5136         Clarify fallback case.
5138 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
5140         Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5141         * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5142         * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
5143         * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
5144         where argument type is known to be a Lisp_Cons.
5146 2012-07-10  Tom Tromey  <tromey@redhat.com>
5148         * bytecode.c (BYTE_CODE_THREADED): New macro.
5149         (BYTE_CODES): New macro.  Replaces all old byte-code defines.
5150         (enum byte_code_op): New type.
5151         (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5152         (exec_byte_code): Use them.  Use token threading when applicable.
5154 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
5156         Optimize pure C strings initialization.
5157         * lisp.h (make_pure_string): Fix prototype.
5158         (build_pure_c_string): New function, defined as static inline.  This
5159         provides a better opportunity to optimize away calls to strlen when
5160         the function is called with compile-time constant argument.
5161         * alloc.c (make_pure_c_string): Fix comment.  Change to add nchars
5162         argument, adjust users accordingly.  Use build_pure_c_string where
5163         appropriate.
5164         * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5165         * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5166         * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5168 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
5170         Avoid calls to strlen in miscellaneous functions.
5171         * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5172         * font.c (Ffont_xlfd_name): Likewise.  Change to call make_string.
5173         * lread.c (openp): Likewise.
5175 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
5177         Avoid calls to strlen in path processing functions.
5178         * fileio.c (file_name_as_directory): Add comment.  Change to add
5179         srclen argument and return the length of result.  Adjust users
5180         accordingly.
5181         (directory_file_name): Fix comment.  Change to add srclen argument,
5182         swap 1st and 2nd arguments to obey the common convention.
5183         Adjust users accordingly.
5184         * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5186 2012-07-10  Glenn Morris  <rgm@gnu.org>
5188         * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5189         Move PENDING_OUTPUT_COUNT definition to configure.
5191         * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5192         * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5193         * s/gnu.h (DATA_START): Move definitions to configure.
5195         * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5196         We include usg5-4-common.h, which defines them both.
5198         * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5199         O_RDONLY already includes it).
5201         Stop ns builds setting the EMACSLOADPATH environment variable.
5202         * nsterm.m (ns_load_path): Rename from ns_init_paths.
5203         Now it does not set EMACSLOADPATH, just returns the load-path string.
5204         * nsterm.h: Update accordingly.
5205         * lread.c [HAVE_NS]: Include nsterm.h.
5206         (init_lread) [HAVE_NS]: Use ns_load_path.
5207         * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5209 2012-07-09  Glenn Morris  <rgm@gnu.org>
5211         * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5212         since the included bsd-common.h does so.
5214         Stop ns builds setting the EMACSPATH environment variable.
5215         * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5216         (ns_init_paths): Do not set EMACSPATH.
5217         * nsterm.h (ns_exec_path): Add it.
5218         * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5219         Use ns_exec_path.
5221         * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5223 2012-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5225         * process.c (wait_reading_process_output): 'waitchannels' was unset
5226         when read_kbd || !NILP (wait_for_cell); fix this.
5228         Add GCC-style 'const' attribute to functions that can use it.
5229         * character.h (char_resolve_modifier_mask):
5230         * keyboard.h (make_ctrl_char):
5231         * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5232         (init_character_once, next_almost_prime, init_fns, init_image)
5233         (flush_pending_output, init_sound):
5234         * mem-limits.h (start_of_data):
5235         * menu.h (finish_menu_items):
5236         Add ATTRIBUTE_CONST.
5237         * emacs.c (DEFINE_DUMMY_FUNCTION):
5238         Declare the dummy function with ATTRIBUTE_CONST.
5239         * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5240         Add decls with ATTRIBUTE_CONST.
5242         Minor improvements to make_formatted_string.
5243         * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5244         where int is good enough, as vsprintf returns an int.
5245         * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5247 2012-07-09  Dmitry Antipov  <dmantipov@yandex.ru>
5249         Use make_formatted_string to avoid double length calculation.
5250         * lisp.h (make_formatted_string): New prototype.
5251         * alloc.c (make_formatted_string): New function.
5252         * buffer.c (Fgenerate_new_buffer_name): Use it.
5253         * dbus.c (syms_of_dbusbind): Likewise.
5254         * editfns.c (Fcurrent_time_zone): Likewise.
5255         * filelock.c (get_boot_time): Likewise.
5256         * frame.c (make_terminal_frame, set_term_frame_name)
5257         (x_report_frame_params): Likewise.
5258         * image.c (gs_load): Likewise.
5259         * minibuf.c (get_minibuffer): Likewise.
5260         * msdos.c (dos_set_window_size): Likewise.
5261         * process.c (make_process): Likewise.
5262         * xdisp.c (ensure_echo_area_buffers): Likewise.
5263         * xsettings.c (apply_xft_settings): Likewise.
5265 2012-07-09  Glenn Morris  <rgm@gnu.org>
5267         Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5268         * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5269         (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5270         * nsterm.h (ns_etc_directory): Add it.
5271         * callproc.c [HAVE_NS]: Include nsterm.h.
5272         (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5274 2012-07-09  Dmitry Antipov  <dmantipov@yandex.ru>
5276         Move marker debugging code under MARKER_DEBUG.
5277         * marker.c (MARKER_DEBUG): Move marker debugging code under
5278         #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5279         for bootstrap with --enable-checking (~3x slowdown reported
5280         by Juanma Barranquero <lekktu@gmail.com>).
5281         (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5283 2012-07-08  Paul Eggert  <eggert@cs.ucla.edu>
5285         * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5286         See <http://bugs.gnu.org/11825#29>.
5288 2012-07-08  Eli Zaretskii  <eliz@gnu.org>
5290         * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5291         has no font, use the frame's font.  (Bug#11813)
5292         (display_line): Add commentary about displaying truncation glyphs
5293         on GUI frames.
5294         (produce_special_glyphs): Move here from term.c.
5296         * term.c (produce_special_glyphs): Move to xdisp.c.
5298         * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5299         section.
5301 2012-07-07  Andreas Schwab  <schwab@linux-m68k.org>
5303         * xdisp.c (display_line): Avoid warning about implicit declaration
5304         of FRAME_FONT.
5306         * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5308         * lisp.h: Remove empty conditional.
5310 2012-07-07  Paul Eggert  <eggert@cs.ucla.edu>
5312         * lread.c (load_path_check): Now static.
5314         Fix some minor --with-ns problems found by static checking.
5315         * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5316         (x_set_font) [!HAVE_X_WINDOWS]:
5317         * image.c (xpm_load_image) [HAVE_NS]:
5318         (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5319         (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5320         Remove unused local.
5321         (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5322         (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5323         * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5324         (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5325         * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5326         * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5327         Fix pointer signedness problem.
5328         * xfaces.c (FRAME_X_FONT_TABLE):
5329         * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5331 2012-07-07  Glenn Morris  <rgm@gnu.org>
5333         * lread.c (load_path_check): New function, split from init_lread.
5334         (init_lread): Reorganize.  Motivation:
5335         If EMACSLOADPATH is set, check/warn about that rather than the
5336         defaults, which we are not going to use.  Hence we can remove
5337         the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5338         Don't warn if site-lisp directories are missing.
5339         If not installed, start from a blank load-path, since
5340         PATH_LOADSEARCH refers to the eventual installation directories.
5342 2012-07-07  Eli Zaretskii  <eliz@gnu.org>
5344         Support truncation and continuation glyphs on GUI frames, when
5345         fringes are disabled.  (Bug#11832)
5346         * xdisp.c (init_iterator): Get dimensions of truncation and
5347         continuation glyphs even if on GUI frames.
5348         Adjust it->last_visible_x on GUI frames when the left or right fringes,
5349         or both, are absent.
5350         (start_display, move_it_in_display_line_to): Handle the case of a
5351         GUI frame without a fringe to display continuation or truncation
5352         glyphs.
5353         (insert_left_trunc_glyphs): Support GUI frames: make sure
5354         truncation glyphs overwrite enough glyphs from the current line to
5355         have sufficient space in pixels.
5356         (display_line): Support truncation and continuation glyphs on GUI
5357         frames.  If some spare pixels are left on the line after inserting
5358         the truncation glyphs, fill that space with a stretch glyph of a
5359         suitably computed width.
5361         * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5362         produce_glyphs, to support GUI sessions.
5364 2012-07-07  Paul Eggert  <eggert@cs.ucla.edu>
5366         * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5368         * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5370         Do not require float-time's arg to fit in time_t (Bug#11825).
5371         This works better on hosts where time_t is unsigned, and where
5372         float-time is applied to the (negative) difference between two times.
5373         * editfns.c (decode_time_components): Last arg is now double *,
5374         not int *, and means to store all the result as a double, without
5375         worrying about whether the seconds part fits in time_t.
5376         All callers changed.
5377         (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5378         All callers changed.
5379         (Ffloat_time): Do not fail merely because the specified time falls
5380         outside of time_t range.
5382 2012-07-07  Glenn Morris  <rgm@gnu.org>
5384         * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5385         * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5386         * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5388 2012-07-07  Juanma Barranquero  <lekktu@gmail.com>
5390         * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5391         Update dependencies.
5393         * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5395 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
5397         Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5398         * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5399         * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5400         * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5401         * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5402         * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5404         * xfont.c (compare_font_names): Redo to omit the need for casts.
5406 2012-07-06  Andreas Schwab  <schwab@linux-m68k.org>
5408         * xfns.c (Fx_change_window_property): Doc fix.
5409         * w32fns.c (Fx_change_window_property): Doc fix.
5411         * w32fns.c (Fx_window_property): Accept the same arguments as the
5412         X Windows version.  Doc fix.
5413         * xfns.c (Fx_window_property): Doc fix.  (Bug#11870)
5415 2012-07-06  Juanma Barranquero  <lekktu@gmail.com>
5416             Eli Zaretskii  <eliz@gnu.org>
5418         * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5419         Windows-specific code from nt/config.nt moved here.
5420         Obsolete settings removed.
5422 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
5424         * process.c: Avoid unnecessary calls to gettime.
5425         (wait_reading_process_output): Don't get the time of day
5426         when gobbling data immediately and not waiting, as there's no need
5427         for it in that case.  This removes a FIXME.
5429 2012-07-06  Jan Djärv  <jan.h.d@swipnet.se>
5431         * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5432         is defined (Bug#11768).
5434 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
5436         Fix marker debugging code.
5437         * marker.c (byte_char_debug_check): Do not perform the check
5438         if buffer is not multibyte.
5439         (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5440         Call byte_char_debug_check with correct arguments.
5442 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
5444         Compile marker debugging code only if ENABLE_CHECKING is defined.
5445         * marker.c (byte_char_debug_check, count_markers):
5446         Use only if ENABLE_CHECKING is defined.
5447         (byte_debug_flag): Remove.
5448         (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5449         Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5451 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
5453         Avoid code repetition in marker-related functions.
5454         * marker.c (attach_marker): New function.
5455         (Fset_marker, set_marker_restricted, set_marker_both)
5456         (set_marker_restricted_both): Use it.
5457         (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5458         Consistently rename charno to charpos.
5459         (marker_position): Add eassert.
5460         (marker_byte_position): Convert to eassert.
5462 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
5464         Simplify list operations in unchain_overlay and unchain_marker.
5465         * buffer.c (unchain_overlay): Simplify.  Add comment.
5466         * marker.c (unchain_marker): Simplify.  Fix comments.
5468 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
5470         Introduce fast path for the widely used marker operation.
5471         * alloc.c (build_marker): New function.
5472         * lisp.h (build_marker): New prototype.
5473         * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5474         * composite.c (autocmp_chars): Likewise.
5475         * editfns.c (buildmark): Remove.
5476         (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5477         (save_restriction_save): Use build_marker.
5478         * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5479         * window.c (save_window_save): Likewise.
5481 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
5483         Do not use Fdelete_overlay in delete_all_overlays
5484         to avoid redundant calls to unchain_overlay.
5485         * buffer.c (drop_overlay): New function.
5486         (delete_all_overlays, Fdelete_overlay): Use it.
5487         * minibuf.c (get_minibuffer): Fix comment.
5489 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
5491         Port to OpenBSD 5.1 amd64.
5492         * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5493         This is needed for OpenBSD, and should be harmless on all BSD systems.
5494         Also, include <sys/sysctl.h>, as it should be available on all
5495         BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5496         (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5497         use p_pid member, not kp_proc.pid.
5499 2012-07-06  Glenn Morris  <rgm@gnu.org>
5501         * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5503 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
5505         More xmalloc and related cleanup.
5506         * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5507         * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5508         * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5509         * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5510         * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5511         * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5512         * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5513         * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5514         * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5515         * xterm.c:
5516         Omit needless casts involving void * pointers and allocation.
5517         Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5518         as the former is more robust if P's type is changed.
5519         Prefer xzalloc to xmalloc + memset 0.
5520         Simplify malloc-or-realloc to realloc.
5521         Don't worry about xmalloc returning a null pointer.
5522         Prefer xstrdup to xmalloc + strcpy.
5523         * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5524         growing it.
5525         * keyboard.c (apply_modifiers_uncached): Prefer local array to
5526         alloca of a constant.
5528 2012-07-05  Eli Zaretskii  <eliz@gnu.org>
5530         * xdisp.c (display_line): Fix horizontal pixel coordinates when
5531         hscroll is larger than the line width.  Fixes long and futile
5532         looping inside extend_face_to_end_of_line (on a TTY) producing
5533         glyphs that are not needed and thrown away.
5535 2012-07-05  Dmitry Antipov  <dmantipov@yandex.ru>
5537         * marker.c (set_marker_restricted_both): Simplify by using
5538         clip_to_bounds.
5540 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
5542         * editfns.c (region_limit): Simplify by using clip_to_bounds.
5544 2012-07-05  Jan Djärv  <jan.h.d@swipnet.se>
5546         * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5547         not defined (Bug#11768).
5548         (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5549         (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5550         (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5551         followed by gtk_box_set_homogeneous (Bug#11768).
5552         (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
5553         (update_theme_scrollbar_width, xg_create_scroll_bar):
5554         Use gtk_scrollbar_new (Bug#11768).
5555         (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5556         (is_box_type): New function (Bug#11768).
5557         (xg_tool_item_stale_p): Call is_box_type.
5558         (xg_initialize): Get settings by calling gtk_settings_get_for_screen
5559         with default display (Bug#11768).
5561 2012-07-05  Eli Zaretskii  <eliz@gnu.org>
5563         * xdisp.c (window_hscroll_limited): New function.
5564         (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5565         coordinates when window's hscroll is set to insanely large
5566         values.  (Bug#11857)
5568 2012-07-05  Juanma Barranquero  <lekktu@gmail.com>
5570         * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5571         ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5573 2012-07-05  Dmitry Antipov  <dmantipov@yandex.ru>
5575         Cleanup xmalloc.
5576         * lisp.h (xzalloc): New prototype.  Omit needless casts.
5577         * alloc.c (xzalloc): New function.  Omit needless casts.
5578         * charset.c: Omit needless casts.  Convert all calls to
5579         xmalloc with following memset to xzalloc.
5580         * dispnew.c: Likewise.
5581         * fringe.c: Likewise.
5582         * image.c: Likewise.
5583         * sound.c: Likewise.
5584         * term.c: Likewise.
5585         * w32fns.c: Likewise.
5586         * w32font.c: Likewise.
5587         * w32term.c: Likewise.
5588         * xfaces.c: Likewise.
5589         * xfns.c: Likewise.
5590         * xterm.c: Likewise.
5591         * atimer.c: Omit needless casts.
5592         * buffer.c: Likewise.
5593         * callproc.c: Likewise.
5594         * ccl.c: Likewise.
5595         * coding.c: Likewise.
5596         * composite.c: Likewise.
5597         * doc.c: Likewise.
5598         * doprnt.c: Likewise.
5599         * editfns.c: Likewise.
5600         * emacs.c: Likewise.
5601         * eval.c: Likewise.
5602         * filelock.c: Likewise.
5603         * fns.c: Likewise.
5604         * gtkutil.c: Likewise.
5605         * keyboard.c: Likewise.
5606         * lisp.h: Likewise.
5607         * lread.c: Likewise.
5608         * minibuf.c: Likewise.
5609         * msdos.c: Likewise.
5610         * print.c: Likewise.
5611         * process.c: Likewise.
5612         * region-cache.c: Likewise.
5613         * search.c: Likewise.
5614         * sysdep.c: Likewise.
5615         * termcap.c: Likewise.
5616         * terminal.c: Likewise.
5617         * tparam.c: Likewise.
5618         * w16select.c: Likewise.
5619         * w32.c: Likewise.
5620         * w32reg.c: Likewise.
5621         * w32select.c: Likewise.
5622         * w32uniscribe.c: Likewise.
5623         * widget.c: Likewise.
5624         * xdisp.c: Likewise.
5625         * xmenu.c: Likewise.
5626         * xrdb.c: Likewise.
5627         * xselect.c: Likewise.
5629 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
5631         * fileio.c (time_error_value): Check the right error number.
5632         Problem reported by Troels Nielsen in
5633         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5635 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
5637         * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5638         This should be fixed in a better way; see Eli Zaretskii in
5639         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5640         (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5642         * fileio.c (time_error_value): Rename from special_mtime.
5643         The old name's problems were noted by Eli Zaretskii in
5644         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5646         * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5647         This variable's comment says Emacs needs at least one GDB-visible
5648         symbol of type enum pvec_type, to work around GDB problems.
5649         The symbol's value doesn't matter.
5651         * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5652         that causes compilation to fail on pre-C99 compilers.
5654 2012-07-04  Juanma Barranquero  <lekktu@gmail.com>
5656         * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5657         (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5659 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
5661         * buffer.c (init_buffer_once): Fix initialization of
5662         headers for buffer_defaults and buffer_local_symbols.
5663         Reported by Juanma Barranquero <lekktu@gmail.com>.
5665 2012-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
5667         Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5668         * lisp.h (enum pvec_type): Use fewer bits.
5669         (PSEUDOVECTOR_SIZE_BITS): New constant.
5670         (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5671         (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5672         change in pvec_type.
5673         (PSEUDOVECTOR_TYPEP): New macro.
5674         (TYPED_PSEUDOVECTORP): Use it.
5675         * fns.c (internal_equal): Adapt code to extract pvectype.
5676         * emacs.c (gdb_pvec_type): Update type.
5677         * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5678         (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5679         (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5680         (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5681         (sweep_vectors): Use it.  Use local var `total_bytes' instead of
5682         abusing vector->header.next.nbytes.
5683         (live_vector_p): Use PVEC_TYPE.
5684         (mark_object): Adapt code to extract pvectype.  Use switch.
5686 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
5688         * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5689         Tighten new eassert a bit.
5691 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
5693         Fix compilation with --enable-gcc-warnings and -O1
5694         optimization level.
5695         * doprnt.c (doprnt): Change type of tem to int, initialize
5696         to avoid compiler warning.  Add eassert.
5697         * search.c (simple_search): Initialize match_byte to avoid
5698         compiler warning.  Add eassert.
5700 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
5702         Avoid weird behavior with large horizontal scrolls.
5703         Without this change, for example, large hscroll values would
5704         mess up Emacs's display on Fedora 15 x86, presumably due to
5705         overflows in int calculations in the display code.
5706         Also, if buffers had long lines, Emacs would freeze.
5707         * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5708         (set_window_hscroll): New function, containing the old guts of
5709         Fset_window_hscroll.  Return the clipped value.
5710         (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5711         This avoids the need to check against PTRDIFF_MAX.
5713         * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5715 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
5717         * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5719 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
5721         * regex.c: Suppress GCC warning on RHEL 6.  (Bug#11207)
5722         Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5723         since GCC 4.4.6 issues a bogus warning for them.
5725         Fix bugs in file timestamp newness comparisons.
5726         * fileio.c (Ffile_newer_than_file_p):
5727         * lread.c (Fload): Use full timestamp resolution of files,
5728         not just the 1-second resolution, so that files that are only
5729         slightly newer still count as newer.
5730         * fileio.c (Ffile_newer_than_file_p): Don't assume file
5731         timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5733 2012-07-03  Paul Eggert  <eggert@cs.ucla.edu>
5735         * fileio.c: Improve handling of file time marker.  (Bug#11852)
5736         (special_mtime): New function.
5737         (Finsert_file_contents, Fverify_visited_file_modtime):
5738         Use it to set special mtime values consistently.
5740 2012-07-03  Andreas Schwab  <schwab@linux-m68k.org>
5742         * fileio.c (Finsert_file_contents): Properly handle st_mtime
5743         marker for non-existing file.  (Bug#11852)
5745 2012-07-03  Glenn Morris  <rgm@gnu.org>
5747         * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5748         and did not make it into globals.h).
5750 2012-07-03  Tom Tromey  <tromey@redhat.com>
5752         * window.c (Fset_window_margins, Fset_window_fringes)
5753         (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5754         * textprop.c (Fprevious_property_change): No longer static.
5755         * syntax.c (Fsyntax_table_p): No longer static.
5756         * process.c (Fget_process, Fprocess_datagram_address): No longer
5757         static.
5758         * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5759         * keyboard.c (Fcommand_execute): No longer static.
5760         Remove EXFUN.
5761         * insdel.c (Fcombine_after_change_execute): No longer static.
5762         * image.c (Finit_image_library): No longer static.
5763         * fileio.c (Fmake_symbolic_link): No longer static.
5764         * eval.c (Ffetch_bytecode): No longer static.
5765         * editfns.c (Fuser_full_name): No longer static.
5766         * doc.c (Fdocumentation_property, Fsnarf_documentation):
5767         No longer static.
5768         * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5769         static.
5770         * dired.c (Ffile_attributes): No longer static.
5771         * composite.c (Fcomposition_get_gstring): No longer static.
5772         * callproc.c (Fgetenv_internal): No longer static.
5774         * ccl.h: Remove EXFUNs.
5775         * buffer.h: Remove EXFUNs.
5776         * dispextern.h: Remove EXFUNs.
5777         * intervals.h: Remove EXFUNs.
5778         * fontset.h: Remove EXFUN.
5779         * font.h: Remove EXFUNs.
5780         * dosfns.c (system_process_attributes): Remove EXFUN.
5781         * keymap.h: Remove EXFUNs.
5782         * lisp.h: Remove EXFUNs.
5783         * w32term.h: Remove EXFUNs.
5784         * window.h: Remove EXFUNs.
5785         * xsettings.h: Remove EXFUN.
5786         * xterm.h: Remove EXFUN.
5788 2012-07-03  Glenn Morris  <rgm@gnu.org>
5790         * lisp.h (Frandom): Make it visible to C.
5791         * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5792         buffer for invisible buffers.  (Bug#1229)
5794 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
5796         Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5797         values which aren't power of 2.
5798         * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5799         Verify it's value and the value of VECTOR_BLOCK_SIZE.  Adjust users
5800         accordingly.
5802 2012-07-03  Stefan Monnier  <monnier@iro.umontreal.ca>
5804         * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5806         * alloc.c (mark_object): Revert part of last patch to use `switch'.
5808 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
5810         * alloc.c (allocate_vector_block): Remove redundant
5811         calls to mallopt if DOUG_LEA_MALLOC is defined.
5812         (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5813         avoid calls to mallopt if zero_vector is returned.
5815 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
5817         * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5818         is enabled, avoid dereferencing NULL current_sblock if
5819         running undumped.
5821 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
5823         Cleanup basic buffer management.
5824         * buffer.h (struct buffer): Change layout to use generic vector
5825         marking code.  Fix some comments.  Change type of 'clip_changed'
5826         to bitfield.  Remove unused #ifndef old.
5827         (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5828         (GET_OVERLAYS_AT): Fix indentation.
5829         (for_each_per_buffer_object_at): New macro.
5830         * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5831         (Fbuffer_local_variables): Use it.
5832         (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5833         * alloc.c (allocate_buffer): Adjust to match new layout of
5834         struct buffer.  Fix comment.
5835         (mark_overlay): New function.
5836         (mark_buffer): Use it.  Use mark_vectorlike to mark normal
5837         Lisp area of struct buffer.
5838         (mark_object): Use it.  Adjust marking of misc objects
5839         and related comments.
5841 2012-07-02  Paul Eggert  <eggert@cs.ucla.edu>
5843         * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5844         wrapper that is not needed because the wrapped code is a no-op (zero
5845         machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5846         This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5848 2012-07-02  Dmitry Antipov  <dmantipov@yandex.ru>
5850         * alloc.c (mark_buffer): Simplify.  Remove prototype.
5851         (mark_object): Add comment.  Reorganize marking of vector-like
5852         objects.  Use CHECK_LIVE for all vector-like objects except buffers
5853         and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5854         Avoid redundant calls to mark_vectorlike for bool vectors.
5856 2012-06-30  Glenn Morris  <rgm@gnu.org>
5858         * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5860         * epaths.in (PATH_SITELOADSEARCH): New.
5861         * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5862         This is rather than relying on --enable-locallisppath elements
5863         having "site-lisp" in their names.  (Bug#10208#25, 11658)
5865 2012-06-30  Eli Zaretskii  <eliz@gnu.org>
5867         * w32proc.c (sys_select): Accept and ignore one more argument.
5869         * w32.c (emacs_gnutls_pull): Call select with one more argument.
5871         * sysselect.h [DOS_NT]: Don't include sys/select.h.
5872         (pselect) [!MS_DOS]: Redirect to sys_select.
5874         * sysdep.c: Don't include dos.h and dosfns.h.
5876         * process.c (sys_select):
5877         * msdos.c (sys_select): Accept one more argument and ignore it.
5879         * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5880         adapt data types and code to that.
5882         * dosfns.c:
5883         * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5884         which clashes with the gnulib function of the same name.
5886 2012-06-30  Andreas Schwab  <schwab@linux-m68k.org>
5888         * font.c (font_style_to_value, font_style_symbolic)
5889         (font_prop_validate_style): Add type checks for values in
5890         font_style_table.
5892         * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5893         argument.
5894         * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5895         uses.
5897 2012-06-29  Eli Zaretskii  <eliz@gnu.org>
5899         * xdisp.c (try_window_id): Undo last change.
5901         * w32.c (getwd): Adjust commentary about startup_dir.
5902         (init_environment): Always call sys_access, even in non-MSVC
5903         builds.  Don't chdir to the directory of the Emacs executable.
5904         This undoes code from 1997 which was justified by the need to
5905         "avoid conflicts when removing and renaming directories".  But its
5906         downside was that every relative file name was being interpreted
5907         relative to the directory of the Emacs executable, which can never
5908         be TRT.  In particular, it broke sys_access when called with
5909         relative file names.
5910         (sys_access): Map GetLastError to errno.
5912 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
5914         * window.h (struct window): Change type of 'fringes_outside_margins'
5915         to bitfield.  Fix comment.  Adjust users accordingly.
5916         (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
5917         Adjust comment.
5918         * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5919         to ptrdiff_t.
5921 2012-06-29  Andreas Schwab  <schwab@linux-m68k.org>
5923         * gnutls.c (emacs_gnutls_handshake):
5924         Add QUIT to make the loop interruptible.
5926 2012-06-29  Glenn Morris  <rgm@gnu.org>
5928         * charset.c (init_charset): Make lack of etc/charsets fatal.
5930 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
5932         * editfns.c (region_limit): Fix type mismatch.
5934 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
5936         * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5937         undefined.  Convert from xassert to eassert.
5938         * nsmenu.m: Convert from xassert to eassert.
5939         * nsterm.m: Likewise.
5941 2012-06-28  Stefan Monnier  <monnier@iro.umontreal.ca>
5943         * editfns.c (region_limit): Clip to narrowing (bug#11770).
5945 2012-06-28  Paul Eggert  <eggert@cs.ucla.edu>
5947         Avoid integer overflow on scroll-left and scroll-right.
5948         * window.c (HSCROLL_MAX): New macro.
5949         (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5950         overflow when requested scroll falls outside ptrdiff_t range.
5952 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
5954         * window.h (struct window): Change type of 'hscroll',
5955         'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5956         'last_modified' and 'last_overlay_modified' to EMACS_INT.
5957         Adjust users accordingly.
5958         * xdisp.c (try_cursor_movement): Replace type check with eassert.
5959         * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5960         from EMACS_INT to ptrdiff_t.
5961         (make_window): Omit redundant initialization.
5963 2012-06-28  Juanma Barranquero  <lekktu@gmail.com>
5965         * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5967 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
5969         * window.h (struct window): Change type of 'use_time' and
5970         'sequence_number' from Lisp_Object to int.
5971         * frame.c (make_frame): Adjust users accordingly.
5972         * print.c (print_object): Likewise.
5973         * window.c (select_window, Fwindow_use_time, make_parent_window)
5974         (make_window): Likewise.
5976 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
5978         * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5979         enabled with --enable-checking=[all,glyphs] configure option.
5980         Fix GLYPH_DEBUG usage assuming that it may be undefined,
5981         adjust comments accordingly.
5982         * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5983         undefined, adjust comments accordingly.
5984         * image.c: Likewise.
5985         * scroll.c: Likewise.
5986         * w32fns.c: Likewise.
5987         * w32term.c: Likewise.
5988         * xdisp.c: Likewise.
5989         * xfaces.c: Likewise.
5990         * xfns.c: Likewise.
5991         * xterm.c: Likewise.
5993 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
5995         Generalize run-time debugging checks.
5996         * dispextern.h (XASSERTS): Remove.
5997         * fontset.c (xassert): Remove.
5998         Convert from xassert to eassert.
5999         * alloc.c: Convert from xassert to eassert.
6000         * bidi.c: Likewise.
6001         * dispnew.c: Likewise.
6002         * fns.c: Likewise.
6003         * fringe.c: Likewise.
6004         * ftfont.c: Likewise.
6005         * gtkutil.c: Likewise.
6006         * image.c: Likewise.
6007         * keyboard.c: Likewise.
6008         * menu.c: Likewise.
6009         * process.c: Likewise.
6010         * scroll.c: Likewise.
6011         * sound.c: Likewise.
6012         * term.c: Likewise.
6013         * w32console.c: Likewise.
6014         * w32fns.c: Likewise.
6015         * w32term.c: Likewise.
6016         * window.c: Likewise.
6017         * xdisp.c: Likewise.
6018         * xfaces.c: Likewise.
6019         * xfns.c: Likewise.
6020         * xselect.c: Likewise.
6021         * xterm.c: Likewise.
6023 2012-06-27  Stefan Monnier  <monnier@iro.umontreal.ca>
6025         * fns.c (maybe_resize_hash_table): Output message when growing the
6026         purify-hashtable.
6028 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
6030         * alloc.c (allocate_string_data): Remove dead code.
6031         * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6032         avoid GCC warning about unused macro.
6034 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
6036         * alloc.c (allocate_string): Omit intervals initialization.
6037         * alloc.c (make_uninit_multibyte_string): Initialize intervals
6038         as in make_pure_string and make_pure_c_string.
6040 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
6042         * alloc.c (allocate_string): Fix last change.
6044 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
6046         * alloc.c (allocate_string): Remove two redundant calls
6047         to memset, add explicit initialization where appropriate.
6049 2012-06-27  Glenn Morris  <rgm@gnu.org>
6051         * lisp.mk (lisp): Remove paths.elc.
6053 2012-06-27  Chong Yidong  <cyd@gnu.org>
6055         * doc.c (Fsubstitute_command_keys): Fix punctuation.
6057 2012-06-26  John Wiegley  <johnw@newartisans.com>
6059         * unexmacosx.c (copy_data_segment): Add two section names used
6060         on Mac OS X Lion: __mod_init_func and __mod_term_func.
6062         * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6063         when building with Clang.
6065 2012-06-26  Stefan Monnier  <monnier@iro.umontreal.ca>
6067         * eval.c (Fapply): Allow calling it with a single argument.
6069 2012-06-26  Eli Zaretskii  <eliz@gnu.org>
6071         * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6072         _stricmp and _strnicmp.
6073         (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6075 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
6077         * alloc.c (allocate_window): Zero out non-Lisp part of newly
6078         allocated window.
6079         (allocate_process): Likewise for new process.
6080         (allocate_terminal): Change to use offsetof.
6081         (allocate_frame): Likewise.
6082         * frame.c (make_frame): Omit redundant initialization.
6083         * window.c (make_parent_window): Use memset.
6084         (make_window): Omit redundant initialization.
6085         * process.c (make_process): Omit redundant initialization.
6086         * terminal.c (create_terminal): Likewise.
6088 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
6090         * term.c (delete_tty): Remove redundant call to memset.
6092 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
6094         * alloc.c: Remove build_string.
6095         * lisp.h: Define build_string as static inline.  This provides
6096         a better opportunity to optimize away calls to strlen when the
6097         function is called with compile-time constant argument.
6098         * image.c (imagemagick_error): Convert to build_string.
6099         * w32proc.c (sys_spawnve): Likewise.
6100         * xterm.c (x_term_init): Likewise.
6102 2012-06-26  Paul Eggert  <eggert@cs.ucla.edu>
6104         Use sprintf return value instead of invoking strlen on result.
6105         In the old days this wasn't portable, since some sprintf
6106         implementations returned char *.  But they died out years ago and
6107         Emacs already assumes sprintf returns int.
6108         Similarly for float_to_string.
6109         This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6110         * ccl.c (ccl_driver):
6111         * character.c (string_escape_byte8):
6112         * data.c (Fnumber_to_string):
6113         * doprnt.c (doprnt):
6114         * print.c (print_object):
6115         * xdisp.c (message_dolog):
6116         * xfns.c (syms_of_xfns):
6117         Use sprintf or float_to_string result to avoid need to call strlen.
6118         * data.c (Fnumber_to_string):
6119         Use make_unibyte_string, since the string must be ASCII.
6120         * lisp.h, print.c (float_to_string): Now returns int length.
6121         * term.c (produce_glyphless_glyph):
6122         Use sprintf result rather than recomputing it.
6124         Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6125         * Makefile.in (ALL_CFLAGS):
6126         * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6127         * gmalloc.c, regex.c: Include <config.h> unconditionally.
6129 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
6131         * dispextern.h (xstrcasecmp): Define to library function
6132         strcasecmp if available.
6133         * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6135 2012-06-25  Andreas Schwab  <schwab@linux-m68k.org>
6137         * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6138         Avoid comma operator.
6139         * menu.c (push_submenu_start, push_submenu_end)
6140         (push_left_right_boundary, push_menu_pane): Likewise.
6141         * msdos.c (dos_rawgetc): Likewise.
6143 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
6145         * xfns.c (xic_create_fontsetname): Remove redundant calls
6146         to memset.
6148 2012-06-25  Paul Eggert  <eggert@cs.ucla.edu>
6150         * gtkutil.c (get_utf8_string): Remove redundant assignment.
6151         sprintf already null-terminates its output.
6153         * xfns.c (x_window): Remove redundant cast.
6155 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
6157         * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6158         `const char *' to `char *' to avoid compiler warning.
6160 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
6162         * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6163         instead of truncating it to 63 (admittedly a generous limit).
6165         * process.c: Fix spelling and caps in comments.
6167 2012-06-24  Dan Nicolaescu  <dann@ics.uci.edu>
6169         * emacs.c (setpgrp): Remove definition, unused.
6170         * sysdep.c (setpgrp): Remove definition, not used in this file.
6172 2012-06-24  Juanma Barranquero  <lekktu@gmail.com>
6174         * makefile.w32-in: Update dependencies.
6176 2012-06-24  Eli Zaretskii  <eliz@gnu.org>
6178         * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6179         (SYSTIME_H): Add nt/inc/sys/time.h.
6181         * systime.h [WINDOWSNT]: Include sys/time.h.
6183         * s/ms-w32.h (struct timespec): Definition moved from
6184         nt/inc/sys/time.h.  Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6186 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
6188         Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6189         * buffer.h (buffer_slot_type_mismatch):
6190         * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6191         * eval.c (unwind_to_catch):
6192         * image.c (my_png_error, my_error_exit):
6193         * keyboard.c (quit_throw_to_read_char, user_error)
6194         (Fexit_recursive_edit, Fabort_recursive_edit):
6195         * lisp.h (die, args_out_of_range, args_out_of_range_3)
6196         (wrong_type_argument, buffer_overflow, __executable_start)
6197         (memory_full, buffer_memory_full, string_overflow, Fthrow)
6198         (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6199         (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6200         (fatal):
6201         (child_setup) [!DOS_NT]:
6202         * lread.c (end_of_file_error, invalid_syntax):
6203         * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6204         * puresize.h (pure_write_error):
6205         * search.c (matcher_overflow):
6206         * sound.c (sound_perror, alsa_sound_perror):
6207         * sysdep.c, syssignal.h (croak):
6208         * term.c (maybe_fatal, vfatal):
6209         * textprop.c (text_read_only):
6210         * undo.c (user_error):
6211         * unexmacosx.c (unexec_error):
6212         * xterm.c (x_ins_del_lines, x_delete_glyphs):
6213         Use _Noreturn rather than NO_RETURN.
6214         No need for separate decl merely because of _Noreturn.
6215         * sound.c (sound_warning, parse_sound):
6216         Remove unnecessary forward decls.
6218 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
6220         Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6221         * lisp.h (WAIT_READING_MAX): New macro.
6222         * dispnew.c (Fsleep_for, sit_for):
6223         * keyboard.c (kbd_buffer_get_event):
6224         * process.c (Faccept_process_output):
6225         Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6226         This improves on the previous patch, which introduced a bug
6227         when time_t is unsigned and as wide as intmax_t.
6228         See <http://bugs.gnu.org/9000#51>.
6230 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
6232         * dispnew.c (sit_for, Fsleep_for):
6233         * keyboard.c (kbd_buffer_get_event):
6234         * process.c (Faccept_process_output): Avoid compiler warnings when
6235         comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6237 2012-06-23  Juanma Barranquero  <lekktu@gmail.com>
6239         * makefile.w32-in: Update dependencies.
6241         * w32.c (ltime): Add return type and declare static.
6242         (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6244 2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
6246         * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6247         Privately reported by Herbert J. Skuhra.
6248         (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6249         All uses changed.
6250         (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6251         not make_lisp_timeval, when the argument is of type EMACS_TIME.
6253 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
6255         * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6256         last argument of make_unibyte_string.
6258         * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6259         language ID in the event parameters.
6261         * w32term.c (w32_read_socket): Put the new keyboard codepage into
6262         event.code, not the obscure "character set ID".
6264 2012-06-23  Chong Yidong  <cyd@gnu.org>
6266         * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6268 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
6270         Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6271         * w32.c (fdutimens): New function.
6273         * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6275         * s/ms-w32.h (pselect): Redirect to sys_select.
6277         * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6279         * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6280         in the logic of incrementing and decrementing the value of
6281         use_relocatable_buffers.
6283 2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
6285         * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6286         Privately reported by Herbert J. Skuhra.
6287         [__FreeBSD__]: Remove "*/" typo after "#include".
6288         (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6289         (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6290         (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6291         Don't assume EMACS_TIME and struct timeval are the same type.
6293 2012-06-22  Paul Eggert  <eggert@cs.ucla.edu>
6295         Support higher-resolution time stamps (Bug#9000).
6296         The time stamps are only nanosecond-resolution at the C level,
6297         since that's the best that any real-world system supports now.
6298         But they are picosecond-resolution at the Lisp level, as that's
6299         easy, and leaves room for future OS improvements.
6301         * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6302         (LIBES): Use it.
6304         * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6305         Don't get current time unless it's needed.
6307         * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6308         now provides it if it's absent.
6309         (start_atimer): Port to higher-res time stamps.
6310         Check for time stamp overflow.  Don't get current time more
6311         often than is needed.
6313         * buffer.h (struct buffer): Buffer modtime now has high resolution.
6314         Include systime.h, not time.h.
6315         (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6317         * dired.c: Include stat-time.h.
6318         (Ffile-attributes): File times now have higher resolution.
6320         * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6321         (struct image): Timestamp now has higher resolution.
6323         * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6324         has at least microseconds now.  All uses removed.
6325         (update_frame, update_single_window, update_window, update_frame_1)
6326         (Fsleep_for, sit_for): Port to higher-resolution time stamps.
6327         (duration_to_sec_usec): Remove; no longer needed.
6329         * editfns.c (time_overflow): Now extern.
6330         (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6331         (float-time, Fformat_time_string, Fcurrent_time_string)
6332         (Fcurrent_time_zone): Accept and generate higher-resolution
6333         time stamps.
6334         (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6335         (decode_time_components, lisp_seconds_argument): New functions.
6336         (make_time): Now static.
6337         (lisp_time_argument): Now returns EMACS_TIME.  New arg ppsec.
6338         Report an error if the time is invalid, rather than having the caller
6339         do that.
6341         * fileio.c: Include <stat-time.h>
6342         (Fcopy_file): Copy higher-resolution time stamps.
6343         Prefer to set the time stamp via a file descriptor if that works.
6344         (Fset_file_times, Finsert_file_contents, Fwrite_region)
6345         (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6346         (Fvisited_file_modtime, Fset_visited_file_modtime):
6347         Support higher-resolution time stamps.
6349         * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6351         * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6353         * image.c (prepare_image_for_display, clear_image_cache)
6354         (lookup_image): Port to higer-resolution time stamps.
6356         * keyboard.c (start_polling, bind_polling_period):
6357         Check for time stamp overflow.
6358         (read_char, kbd_buffer_get_event, timer_start_idle)
6359         (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6360         (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6361         Port to higher-resolution time stamps.  Do not assume time_t is signed.
6362         (decode_timer): New function.  Timers are now vectors of length 9,
6363         not 8, to accommodate the picosecond component.
6364         (timer_check_2): Use it.
6366         * nsterm.m (select_timeout, timeval_subtract): Remove.
6367         (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6368         as they're a bit more accurate and handle overflow better.
6369         (ns_select): Change prototype to be compatible with pselect.
6370         (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6371         * nsterm.h (ns_select): Adjust prototype.
6373         * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6374         us-resolution time stamps.
6375         (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6377         * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6379         * lisp.h (time_overflow): New decl.
6380         (wait_reading_process_output): First arg is now intmax_t, not int,
6381         to accommodate larger waits.
6383         * process.h (struct Lisp_Process.read_output_delay):
6384         Now counts nanoseconds, not microseconds.
6385         * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6386         EMACS_HAS_USECS.
6387         (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6388         (wait_reading_process_output):
6389         Port to ns-resolution time stamps.
6390         (Faccept_process_output, wait_reading_process_output):
6391         Check for time stamp overflow.  Do not assume time_t is signed.
6392         (select_wrapper): Remove; we now use pselect.
6393         (Fprocess_attributes): Now generates ns-resolution time stamps.
6395         * sysdep.c: Include utimens.h.  Don't include utime.h
6396         or worry about struct utimbuf; gnulib does that for us now.
6397         (gettimeofday): Remove; gnulib provides a substitute.
6398         (make_timeval): New function.
6399         (set_file_times): Now sets ns-resolution time stamps.
6400         New arg FD; all uses changed.
6401         (time_from_jiffies, ltime_from_jiffies, get_up_time)
6402         (system_process_attributes):
6403         Now returns ns-resolution time stamp.  All uses changed.
6404         Check for time stamp overflow.
6406         * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6407         provides a substitute now.
6409         * systime.h: Include timespec.h rather than sys/time.h and time.h,
6410         since it guarantees struct timespec.
6411         (EMACS_TIME): Now struct timespec, so that we can support
6412         ns-resolution time stamps.
6413         (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6414         (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6415         (EMACS_USECS): Remove.
6416         (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6417         so multiply the arg by 1000 before storing it.
6418         (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6419         New macros.
6420         (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6421         Port to ns-resolution time stamps.
6422         (EMACS_TIME_NEG_P): Remove; replaced by....
6423         (EMACS_TIME_SIGN): New macro.
6424         (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6425         (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6426         (set_file_times, make_time, lisp_time_argument): Adjust signature.
6427         (make_timeval, make_lisp_time, decode_time_components): New decls.
6428         (EMACS_TIME_CMP): Remove; no longer used.  Plus, it was buggy, in
6429         that it mishandled time_t overflow.  You can't compare by subtracting!
6430         (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6431         (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6433         * term.c: Include <sys/time.h>.
6434         (timeval_to_Time): New function, for proper overflow wraparound.
6435         (term_mouse_position, term_mouse_click): Use it.
6437         * undo.c (record_first_change): Support higher-resolution time stamps
6438         in the undo buffer.
6439         (Fprimitive_undo): Use them when restoring time stamps.
6441         * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6442         (w32_get_internal_run_time):
6443         Port to higher-resolution Emacs time stamps.
6444         (ltime): Now accepts single 64-bit integer, as that's more convenient
6445         for callers.
6447         * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6449         * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6450         for compatibility with pselect.  Support ns-resolution time stamps.
6452         * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6454         * xselect.c (wait_for_property_change, x_get_foreign_selection):
6455         Check for time stamp overflow, and support ns-resolution time stamps.
6457         * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6458         Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6459         (timeval_subtract): Remove; no longer needed.
6460         (XTflash, XTring_bell, x_wait_for_event):
6461         Port to ns-resolution time stamps.  Don't assume time_t is signed.
6463 2012-06-22  Chong Yidong  <cyd@gnu.org>
6465         * xdisp.c (x_consider_frame_title): Revert last change.
6467 2012-06-22  Eli Zaretskii  <eliz@gnu.org>
6469         * alloc.c (NSTATICS): Enlarge to 0x650.  Otherwise, Emacs compiled
6470         with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6471         aborts in staticpro during startup.  (Without -DBYTE_CODE_METER,
6472         staticidx goes up to 1597 out of 1600 = 0x640.)
6474 2012-06-20  Paul Eggert  <eggert@cs.ucla.edu>
6476         * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6477         Otherwise, the umask might be mistakenly 0 while handling input signals.
6479 2012-06-19  Stefan Monnier  <monnier@iro.umontreal.ca>
6481         * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6483 2012-06-19  Dmitry Antipov  <dmantipov@yandex.ru>
6485         * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6486         * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6487         * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6488         access to `contents' member of Lisp_Vector objects with AREF and ASET
6489         where appropriate.
6491 2012-06-19  Chong Yidong  <cyd@gnu.org>
6493         * frame.c (delete_frame): When selecting a frame on a different
6494         text terminal, do not alter the terminal's top-frame.
6496         * xdisp.c (format_mode_line_unwind_data): Record the target
6497         frame's selected window and its terminal's top-frame.
6498         (unwind_format_mode_line): Restore them.
6499         (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6500         Callers changed.
6501         (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6502         since tty frames can be explicitly named.
6503         (prepare_menu_bars): Likewise.
6505         * term.c (Ftty_top_frame): New function.
6507 2012-06-18  Paul Eggert  <eggert@cs.ucla.edu>
6509         Port byte-code-meter to modern targets.
6510         * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6511         !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG.  Problem with
6512         CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
6513         <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6514         (METER_1, METER_2): Simplify.
6516 2012-06-18  Stefan Monnier  <monnier@iro.umontreal.ca>
6518         * data.c (Fdefalias): Return `symbol' (bug#11686).
6520 2012-06-18  Martin Rudalics  <rudalics@gmx.at>
6522         * buffer.c (Fkill_buffer): Don't throw an error when the buffer
6523         gets killed during executing of this function (Bug#11665).
6524         Try to always return Qt when the buffer has been actually killed.
6525         (Vkill_buffer_query_functions): In doc-string say that functions
6526         run by this hook should not change the current buffer.
6528 2012-06-18  Paul Eggert  <eggert@cs.ucla.edu>
6530         Fix recently-introduced process.c problems found by static checking.
6531         * process.c (write_queue_push, write_queue_pop, send_process):
6532         Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6533         (write_queue_pop): Fix pointer signedness problem.
6534         (send_process): Remove unused local.
6536 2012-06-17  Chong Yidong  <cyd@gnu.org>
6538         * xdisp.c (redisplay_internal): No need to redisplay terminal
6539         frames that are not on top.
6541 2012-06-17  Troels Nielsen  <bn.troels@gmail.com>
6543         * process.c (make_process): Initialize write_queue.
6544         (write_queue_push, write_queue_pop): New functions.
6545         (send_process): Use them to maintain correct ordering of process
6546         writes (Bug#10815).
6548 2012-06-17  Paul Eggert  <eggert@cs.ucla.edu>
6550         * lisp.h (eassert): Assume C89 or later.
6551         This removes the need for CHECK.
6552         (CHECK): Remove.  Its comments about always evaluating its
6553         argument were confusing, as 'eassert' typically does not evaluate
6554         its argument.
6556         * coding.c (produce_chars): Use ptrdiff_t, not int.
6558         * xterm.c (x_draw_underwave): Check for integer overflow.
6559         This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6561 2012-06-17  Jan Djärv  <jan.h.d@swipnet.se>
6563         * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6564         referenced (Bug#11583).
6566 2012-06-16  Aurelien Aptel  <aurelien.aptel@gmail.com>
6568         Implement wave-style variant of underlining.
6569         * dispextern.h (face_underline_type): New enum.
6570         (face): Add field for underline type.
6571         * nsterm.m (ns_draw_underwave): New function.
6572         (ns_draw_text_decoration): Use it.
6573         * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6574         New functions.
6575         (x_draw_glyph_string): Use them.
6576         * xfaces.c (Qline, Qwave): New Lisp objects.
6577         (check_lface_attrs, merge_face_ref)
6578         (Finternal_set_lisp_face_attribute, realize_x_face):
6579         Handle wave-style underline face attributes.
6580         * xterm.c (x_draw_underwave): New function.
6581         (x_draw_glyph_string): Use it.
6583 2012-06-16  Juanma Barranquero  <lekktu@gmail.com>
6585         * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6586         ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6587         ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6588         ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6589         ($(BLD)/w32select.$(O)): Update dependencies.
6591 2012-06-16  Andreas Schwab  <schwab@linux-m68k.org>
6593         * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6594         (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6595         * character.c (_fetch_multibyte_char_p): Remove.
6596         * alloc.c: Include "character.h" before "buffer.h".
6597         * bidi.c: Likewise.
6598         * buffer.c: Likewise.
6599         * bytecode.c: Likewise.
6600         * callint.c: Likewise.
6601         * callproc.c: Likewise.
6602         * casefiddle.c: Likewise.
6603         * casetab.c: Likewise.
6604         * category.c: Likewise.
6605         * cmds.c: Likewise.
6606         * coding.c: Likewise.
6607         * composite.c: Likewise.
6608         * dired.c: Likewise.
6609         * dispnew.c: Likewise.
6610         * doc.c: Likewise.
6611         * dosfns.c: Likewise.
6612         * editfns.c: Likewise.
6613         * emacs.c: Likewise.
6614         * fileio.c: Likewise.
6615         * filelock.c: Likewise.
6616         * font.c: Likewise.
6617         * fontset.c: Likewise.
6618         * fringe.c: Likewise.
6619         * indent.c: Likewise.
6620         * insdel.c: Likewise.
6621         * intervals.c: Likewise.
6622         * keyboard.c: Likewise.
6623         * keymap.c: Likewise.
6624         * lread.c: Likewise.
6625         * macros.c: Likewise.
6626         * marker.c: Likewise.
6627         * minibuf.c: Likewise.
6628         * nsfns.m: Likewise.
6629         * nsmenu.m: Likewise.
6630         * print.c: Likewise.
6631         * process.c: Likewise.
6632         * regex.c: Likewise.
6633         * region-cache.c: Likewise.
6634         * search.c: Likewise.
6635         * syntax.c: Likewise.
6636         * term.c: Likewise.
6637         * textprop.c: Likewise.
6638         * undo.c: Likewise.
6639         * unexsol.c: Likewise.
6640         * w16select.c: Likewise.
6641         * w32fns.c: Likewise.
6642         * w32menu.c: Likewise.
6643         * window.c: Likewise.
6644         * xdisp.c: Likewise.
6645         * xfns.c: Likewise.
6646         * xmenu.c: Likewise.
6647         * xml.c: Likewise.
6648         * xselect.c: Likewise.
6650 2012-06-16  Eli Zaretskii  <eliz@gnu.org>
6652         * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6653         If all the glyphs of the glyph row came from strings, and we have no
6654         cursor positioning clues, put the cursor on the first glyph of the
6655         row.
6656         (handle_face_prop): Use chunk-relative overlay string index when
6657         indexing into it->string_overlays array.  (Bug#11653)
6658         (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6659         the rightmost.  (Bug#11720)
6661 2012-06-16  Andreas Schwab  <schwab@linux-m68k.org>
6663         * category.h (CHAR_HAS_CATEGORY): Define as inline.
6664         (CATEGORY_MEMBER): Enforce 1/0 value.
6665         * category.c (_temp_category_set): Remove.
6667 2012-06-16  Eli Zaretskii  <eliz@gnu.org>
6669         * window.c (Fdelete_other_windows_internal)
6670         (Fdelete_window_internal): Don't access frame's mouse highlight
6671         info of the initial frame.  (Bug#11677)
6673 2012-06-14  Paul Eggert  <eggert@cs.ucla.edu>
6675         * .gdbinit (xgetint): Fix recently-introduced paren typo.
6676         Assume USE_2_TAGS_FOR_INTS.
6677         (xreload): Adjust $tagmask width to match recent lisp.h change.
6679         Simplify lisp.h in minor ways that should not affect code.
6680         * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6681         (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6682         (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6683         Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6684         (INTTYPEBITS): New macro, for clarity.
6685         (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
6686         (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6687         Simplify now that USE_LSB_TAG is always defined.
6688         (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6689         (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6691 2012-06-13  Juanma Barranquero  <lekktu@gmail.com>
6693         * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6695 2012-06-13  Glenn Morris  <rgm@gnu.org>
6697         * s/bsd-common.h (BSD4_3):
6698         * s/usg5-4-common.h (USG5_4): No longer define; unused.
6700 2012-06-13  Andreas Schwab  <schwab@linux-m68k.org>
6702         * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6703         instead of union.
6704         (XLI, XIL): Define.
6705         (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6706         Use them.
6707         * emacs.c (gdb_use_struct): Rename from gdb_use_union.
6708         * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
6709         * alloc.c (widen_to_Lisp_Object): Remove.
6710         (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6711         * frame.c (delete_frame): Remove outdated comment.
6712         * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6713         USE_LISP_UNION_TYPE.
6714         (Fw32_unregister_hot_key): Likewise.
6715         (Fw32_toggle_lock_key): Likewise.
6716         * w32menu.c (add_menu_item): Likewise.
6717         (w32_menu_display_help): Use XIL instead of checking
6718         USE_LISP_UNION_TYPE.
6719         * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6720         (init_heap): Likewise.
6721         * w32term.c (w32_read_socket): Update comment.
6723 2012-06-13  Glenn Morris  <rgm@gnu.org>
6725         * s/usg5-4-common.h, src/s/unixware.h:
6726         Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6728         * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6730 2012-06-13  Paul Eggert  <eggert@cs.ucla.edu>
6732         USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6733         * alloc.c (make_number) [!defined make_number]:
6734         Remove, as lisp.h always defines this now.
6735         (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6736         (roundup_size): Verify that it is a power of 2.
6737         * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6738         * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6739         * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6740         -DUSE_LSB_TAG=0, to override the automatically-selected default.
6741         USE_LSB_TAG now is always defined to be either 0 or 1.
6742         All uses changed.
6743         (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6744         code works fine either way, and efficiency is not a concern here,
6745         as the union type is for debugging, not for production.
6746         (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6747         Use an inline function on all platforms when using the union type,
6748         since this is simpler and 'static inline' can be used portably
6749         within Emacs now.
6750         (LISP_INITIALLY_ZERO): New macro.
6751         (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6752         (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6754 2012-06-12  Glenn Morris  <rgm@gnu.org>
6756         * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6758         * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
6760         * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6761         Move BROKEN_SIGIO to configure.
6763         * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6764         Move NO_TERMIO to configure.
6766 2012-06-12  Chong Yidong  <cyd@gnu.org>
6768         * image.c (imagemagick_load_image): Use MagickFlattenImage if
6769         MagickMergeImageLayers is undefined.  Use pixel pusher loop if
6770         MagickExportImagePixels is undefined.
6772 2012-06-12  Paul Eggert  <eggert@cs.ucla.edu>
6774         * image.c (imagemagick_load_image): Remove unused label.
6776 2012-06-11  Glenn Morris  <rgm@gnu.org>
6778         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6779         * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6780         * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6781         * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6783 2012-06-11  Stefan Monnier  <monnier@iro.umontreal.ca>
6785         * alloc.c (make_byte_code): New function.
6786         (Fmake_byte_code): Use it.  Don't purify here.
6787         * lread.c (read1): Use it as well to avoid extra allocation.
6789 2012-06-11  Chong Yidong  <cyd@gnu.org>
6791         * image.c (imagemagick_load_image): Implement transparency.
6793 2012-06-10  Andreas Schwab  <schwab@linux-m68k.org>
6795         * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6796         account for preceding backslashes.  (Bug#11663)
6798 2012-06-09  Chong Yidong  <cyd@gnu.org>
6800         * term.c: Support italics in capable terminals (Bug#9652).
6801         (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6802         (turn_on_face): Output using TS_enter_italic_mode if available.
6803         Don't handle unused blinking and alt-charset cases.
6804         (turn_off_face): Handle italic case; discard unused tty_blinking_p
6805         and tty_alt_charset_p cases.
6806         (tty_capable_p, init_tty): Support italics.
6808         * termchar.h (struct tty_display_info): Add field for italics.
6809         Remove unused blink field.
6811         * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6812         Handle slant.
6814         * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6815         (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6816         tty_alt_charset_p.  Add tty_italic_p.
6818 2012-06-09  Michael Albinus  <michael.albinus@gmx.de>
6820         * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6821         dbus_type_is_basic if available.
6822         (xd_extract_signed, xd_extract_unsigned): Rename from
6823         extract_signed and extract_unsigned, respectively.  Adapt callers.
6825 2012-06-09  Chong Yidong  <cyd@gnu.org>
6827         * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6829         * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6830         case (Bug#9752).
6832 2012-06-08  Paul Eggert  <eggert@cs.ucla.edu>
6834         * xdisp.c (vmessage): Treat frame message as multibyte.
6835         Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6836         would generate the diagnostic "Making \302\247 buffer-local while
6837         let-bound!".
6839 2012-06-08  Eli Zaretskii  <eliz@gnu.org>
6841         * dispnew.c (showing_window_margins_p): Undo last change, which
6842         was done due to an inadvertent commit.
6843         (adjust_frame_glyphs_for_frame_redisplay): Do call
6844         showing_window_margins_p.
6846 2012-06-08  Stefan Monnier  <monnier@iro.umontreal.ca>
6848         * eval.c (Fmake_var_non_special): New primitive.
6849         (syms_of_eval): Defsubr it.
6850         * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6852 2012-06-08  Juanma Barranquero  <lekktu@gmail.com>
6854         * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6855         function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6857 2012-06-08  Eli Zaretskii  <eliz@gnu.org>
6859         * alloc.c (allocate_vectorlike): Fix last change.
6861 2012-06-08  Dmitry Antipov  <dmantipov@yandex.ru>
6863         Block-based vector allocation of small vectors.
6864         * lisp.h (struct vectorlike_header): New field `nbytes',
6865         adjust comment accordingly.
6866         * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
6867         to denote vector blocks.  Adjust users (live_vector_p,
6868         mark_maybe_pointer, valid_lisp_object_p) accordingly.
6869         (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6870         (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6871         (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6872         (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6873         (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6874         (roundup_size): New constant.
6875         (struct vector_block): New data type.
6876         (vector_blocks, vector_free_lists, zero_vector): New variables.
6877         (all_vectors): Rename to `large_vectors'.
6878         (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6879         (sweep_vectors): New functions.
6880         (allocate_vectorlike): Return `zero_vector' as the only vector of
6881         0 items.  Allocate new vector from block if vector size is less than
6882         or equal to VBLOCK_BYTES_MAX.
6883         (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6884         (init_alloc_once): Add call to init_vectors.
6886 2012-06-08  Stefan Monnier  <monnier@iro.umontreal.ca>
6888         * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6890 2012-06-07  Paul Eggert  <eggert@cs.ucla.edu>
6892         * doprnt.c (doprnt): Truncate multibyte char correctly.
6893         Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6894         would mishandle a string argument "Xc" if X was a multibyte
6895         character of length 2: it would truncate after X's first byte
6896         rather than including all of X.
6898 2012-06-06  Chong Yidong  <cyd@gnu.org>
6900         * buffer.c (word_wrap): Doc fix.
6902 2012-06-04  Paul Eggert  <eggert@cs.ucla.edu>
6904         * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6906 2012-06-03  Glenn Morris  <rgm@gnu.org>
6908         * xdisp.c (tool-bar-style): Doc fix.
6910 2012-06-03  Ulrich Müller  <ulm@gentoo.org>
6912         * Makefile.in (PAXCTL): Define.
6913         (temacs$(EXEEXT)): Disable memory randomization for the temacs
6914         binary via PaX flags if the paxctl utility is available.
6915         (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6916         Restore PaX flags to their default.  (Bug#11398)
6918 2012-06-03  Chong Yidong  <cyd@gnu.org>
6920         * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6921         buffer (Bug#11226).
6923 2012-06-03  Chong Yidong  <cyd@gnu.org>
6925         * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6926         (note_mode_line_or_margin_highlight): If there is no help echo,
6927         use mode-line-default-help-echo.  Handle the case where the mouse
6928         position is past the end of the mode line string.
6930         * buffer.c (buffer_local_value_1): New function, split from
6931         Fbuffer_local_value; can return Qunbound.
6932         (Fbuffer_local_value): Use it.
6933         (Vmode_line_format): Docstring tweaks.
6935 2012-06-02  Paul Eggert  <eggert@cs.ucla.edu>
6937         * sysdep.c (system_process_attributes): Improve comment.
6939 2012-06-02  Stefan Monnier  <monnier@iro.umontreal.ca>
6941         * keyboard.c: Export real-this-command to Elisp.
6942         (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6943         and DEFVAR it.  Update all users.
6945 2012-06-02  Paul Eggert  <eggert@cs.ucla.edu>
6947         * minibuf.c (Fassoc_string): Remove duplicate declaration.
6949         * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6950         Convert pctcpu and pctmem to Lisp float properly.
6951         Let the compiler fold better, as 100.0/0x8000 is exact.
6953 2012-06-02  Andreas Schwab  <schwab@linux-m68k.org>
6955         * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6956         cons_block.
6958 2012-06-01  Paul Eggert  <eggert@cs.ucla.edu>
6960         * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6962 2012-06-01  Dmitry Antipov  <dmantipov@yandex.ru>
6964         For a 'struct window', replace some Lisp_Object fields to
6965         bitfields where appropriate, remove unused fields.
6966         * window.h (struct window): Remove unused 'last_mark_x' and
6967         'last_mark_y' fields.  Rename 'mini_p' field to 'mini',
6968         change it's type from Lisp_Object to bitfield.
6969         Change type of 'force_start', 'optional_new_start',
6970         'last_had_star', 'update_mode_line' and 'start_at_line_beg'
6971         fields from Lisp_Object to bitfield.  Adjust users accordingly.
6973 2012-05-31  Paul Eggert  <eggert@cs.ucla.edu>
6975         Pacify gcc -Wdouble-precision when using Xaw.
6976         * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6977         [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6978         Use 'float' consistently, rather than 'float' in most places
6979         and 'double' in a couple of places.
6981 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
6983         * xdisp.c (handle_stop): Detect whether we have overlay strings
6984         loaded by testing it->current.overlay_string_index to be
6985         non-negative, instead of checking whether n_overlay_strings is
6986         positive.  (Bug#11587)
6988 2012-05-31  Chong Yidong  <cyd@gnu.org>
6990         * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6992         * doc.c (Fsubstitute_command_keys): Doc fix.
6994 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
6996         * search.c (search_buffer): Remove calls to
6997         r_alloc_inhibit_buffer_relocation, as it is now called by
6998         maybe_unify_char, which was the cause of relocation of buffer text
6999         in bug#11519.
7001 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
7003         * charset.c (maybe_unify_char): Inhibit relocation of buffer text
7004         for the duration of call to load_charset, to avoid problems with
7005         callers of maybe_unify_char that access buffer text through C
7006         pointers.
7008         * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
7009         decrement the inhibition flag, instead of just setting or
7010         resetting it.
7012 2012-05-31  Paul Eggert  <eggert@cs.ucla.edu>
7014         Remove obsolete '#define static' cruft.
7015         * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7016         This #undef was "temporary" in 2000; it is no longer needed
7017         now that '#define static' has gone away.
7018         * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7019         (gray_bitmap_bits): Remove; no longer needed.
7020         All uses replaced with definiens.
7021         * xterm.c: Include "bitmaps/gray.xbm".
7023 2012-05-30  Paul Eggert  <eggert@cs.ucla.edu>
7025         Clean up __executable_start, monstartup when --enable-profiling.
7026         The following changes affect the code only when profiling.
7027         * dispnew.c (__executable_start): Rename from safe_bcopy.
7028         Define only on platforms that need it.
7029         * emacs.c: Include <sys/gmon.h> when profiling.
7030         (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7031         (__executable_start): Remove decl, since lisp.h does it now.
7032         (safe_bcopy): Remove decl; no longer has that name.
7033         (main): Coalesce #if into single bit of code, for simplicity.
7034         Cast pointers to uintptr_t, since standard libraries want integers
7035         and not pointers.
7036         * lisp.h (__executable_start): New decl.
7038 2012-05-31  Glenn Morris  <rgm@gnu.org>
7040         * image.c (Fimagemagick_types): Doc fix.
7042 2012-05-30  Jim Meyering  <meyering@redhat.com>
7044         * callproc.c (Fcall_process_region): Include directory component
7045         in mkstemp error message (Bug#11586).
7047 2012-05-30  Paul Eggert  <eggert@cs.ucla.edu>
7049         * alloc.c, lisp.h (make_pure_vector): Now static.
7051 2012-05-30  Stefan Monnier  <monnier@iro.umontreal.ca>
7053         * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7054         Move to byte-run.el.
7055         (Fautoload): Do the hash-doc more carefully.
7056         * data.c (Fdefalias): Purify definition, except for keymaps.
7057         (Qdefun): Move from eval.c.
7058         * lisp.h (Qdefun): Remove.
7059         * lread.c (read1): Tiny simplification.
7061 2012-05-29  Troels Nielsen  <bn.troels@gmail.com>
7063         Do not create empty overlays with the evaporate property (Bug#9642).
7064         * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7065         Bug#9642, but explicitly check that the buffer the overlay would
7066         be moved to is live and rearrange lines to make sure that errors
7067         will not put the overlay in an inconsistent state.
7068         (Fdelete_overlay): Cosmetics.
7070 2012-05-28  Eli Zaretskii  <eliz@gnu.org>
7072         * w32term.c (my_bring_window_to_top): New function.
7073         (x_raise_frame): Use handle returned by DeferWindowPos, which
7074         could be different from the original one.
7075         Call my_bring_window_to_top instead of my_set_foreground_window.
7076         (Bug#11513)
7078         * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7079         by calling BringWindowToTop.
7081         * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7082         (WM_EMACS_END): Increase by one.
7084 2012-05-28  Paul Eggert  <eggert@cs.ucla.edu>
7086         * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7087         This avoids undefined behavior that might cause the eassert
7088         to not catch an out-of-range value.
7090 2012-05-28  Juanma Barranquero  <lekktu@gmail.com>
7092         * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7093         Update dependencies.
7095 2012-05-27  Eli Zaretskii  <eliz@gnu.org>
7097         * bidi.c (bidi_mirror_char): Fix last change.
7099 2012-05-27  Andreas Schwab  <schwab@linux-m68k.org>
7101         * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7102         when referring to sectname field in printf format.
7104 2012-05-27  Paul Eggert  <eggert@cs.ucla.edu>
7106         * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7107         Only r_alloc_inhibit_buffer_relocation needed to be added;
7108         the others were already declared.
7110         * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7111         before checking whether it's out of range.  Put the check inside
7112         eassert.  See
7113         <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7115 2012-05-27  Ken Brown  <kbrown@cornell.edu>
7117         * callproc.c (Fcall_process): Restore a line that was accidentally
7118         commented out in the 2011-02-13 change (bug#11547).
7120 2012-05-27  Eli Zaretskii  <eliz@gnu.org>
7122         * lisp.h [REL_ALLOC]: Add prototypes for external functions
7123         defined on ralloc.c.
7125         * buffer.c [REL_ALLOC]: Remove prototypes of
7126         r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7127         they are now on lisp.h.
7129         * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7131         * search.c (search_buffer): Use it to inhibit relocation of buffer
7132         text while re_search_2 is doing its job, because re_search_2 is
7133         passed C pointers to buffer text.  (Bug#11519)
7135         * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7136         Update value to 24.
7138         * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7139         state after an additional call to move_it_in_display_line_to, keep
7140         the values of it->max_ascent and it->max_descent found for the
7141         entire line.
7142         (pos_visible_p): Revert the comparison against bottom_y to what it
7143         was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7144         (Bug#11464)
7146 2012-05-26  Paul Eggert  <eggert@cs.ucla.edu>
7148         Fix coding-related core dumps with gcc -ftrapv.
7149         The code was computing A - B, where A and B are pointers, and B is
7150         random garbage.  This can lead to core dumps on platforms that
7151         have special pointer registers, and it also leads to core dumps on
7152         x86-64 when compiled with gcc -ftrapv.  The fix is to compute
7153         A - B only when B is initialized properly.
7154         * coding.c (coding_set_source, coding_set_destination): Return void.
7155         (coding_change_source, coding_change_destinations): New functions,
7156         with the old behaviors of coding_set_source and coding_set_destination.
7157         All callers that need an offset changed to use these new functions.
7159 2012-05-26  Glenn Morris  <rgm@gnu.org>
7161         * nsterm.m (ns_init_paths): Don't mess with INFOPATH.  (Bug#2791)
7163 2012-05-26  Eli Zaretskii  <eliz@gnu.org>
7165         Extend mouse support on W32 text-mode console.
7166         * xdisp.c (draw_row_with_mouse_face):
7167         Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
7169         * w32console.c: Include window.h.
7170         (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7171         New functions.
7172         (initialize_w32_display): Initialize mouse-highlight data.
7174         * w32inevt.c: Include termchar.h and window.h.
7175         (do_mouse_event): Support mouse-autoselect-window.  When the mouse
7176         moves, call note_mouse_highlight.  If help_echo changed, call
7177         gen_help_event to produce help-echo message in the echo area.
7178         Call clear_mouse_face if mouse_face_hidden is set in the mouse
7179         highlight info.
7181 2012-05-26  Paul Eggert  <eggert@cs.ucla.edu>
7183         * lread.c (read1): Simplify slightly to avoid an overflow warning
7184         with GCC 4.7.0 on x86-64.
7186 2012-05-26  Eli Zaretskii  <eliz@gnu.org>
7188         * bidi.c (bidi_mirror_char): Revert last change: an int is
7189         definitely wide enough here.
7191 2012-05-25  Paul Eggert  <eggert@cs.ucla.edu>
7193         Fix integer width and related bugs (Bug#9874).
7194         * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
7195         (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7196         (string_bytes, check_sblock, allocate_string_data):
7197         (compact_small_strings, Fmake_bool_vector, make_string)
7198         (make_unibyte_string, make_multibyte_string)
7199         (make_string_from_bytes, make_specified_string)
7200         (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7201         (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7202         (mark_vectorlike):
7203         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7204         (allocate_pseudovector):
7205         Use int, not EMACS_INT, where int is wide enough.
7206         (inhibit_garbage_collection, Fgarbage_collect):
7207         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7208         * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7209         int might not be wide enough.
7210         (bidi_cache_search, bidi_cache_find, bidi_init_it)
7211         (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7212         (bidi_at_paragraph_end, bidi_find_paragraph_start)
7213         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7214         (bidi_level_of_next_char, bidi_move_to_visually_next):
7215         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7216         * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7217         (Fkill_buffer, Fset_buffer_major_mode)
7218         (advance_to_char_boundary, Fbuffer_swap_text)
7219         (Fset_buffer_multibyte, overlays_at, overlays_in)
7220         (overlay_touches_p, struct sortvec, record_overlay_string)
7221         (overlay_strings, recenter_overlay_lists)
7222         (adjust_overlays_for_insert, adjust_overlays_for_delete)
7223         (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7224         (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7225         (Foverlay_recenter, last_overlay_modification_hooks_used)
7226         (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7227         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7228         (validate_region): Omit unnecessary test for b <= e,
7229         since that's guaranteed by the previous test.
7230         (adjust_overlays_for_delete): Avoid pos + length overflow.
7231         (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7232         (report_overlay_modification):
7233         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7234         (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7235         Omit pointer cast, which isn't needed anyway, and doesn't work
7236         after the EMACS_INT -> ptrdiff_t change.
7237         (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
7238         * buffer.h: Adjust decls to match defn changes elsewhere.
7239         (struct buffer_text, struct buffer):
7240         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7241         Use EMACS_INT, not int, where int might not be wide enough.
7242         * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7243         not int, to avoid needless 32-bit limit on 64-bit hosts.
7244         (exec_byte_code): Use tighter memory-full test, one that checks
7245         for alloca overflow.  Don't compute the address of the object just
7246         before an array, as that's not portable.  Use EMACS_INT, not
7247         ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
7248         * callint.c (Fcall_interactively):
7249         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7250         * callproc.c (call_process_kill, Fcall_process):
7251         Don't assume pid_t fits into an Emacs fixnum.
7252         (call_process_cleanup, Fcall_process, child_setup):
7253         Don't assume pid_t fits into int.
7254         (call_process_cleanup, Fcall_process, delete_temp_file)
7255         (Fcall_process_region):
7256         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7257         (Fcall_process): Simplify handling of volatile integers.
7258         Use int, not EMACS_INT, where int will do.
7259         * casefiddle.c (casify_object, casify_region, operate_on_word)
7260         (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7261         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7262         (casify_object): Avoid integer overflow when overallocating buffer.
7263         * casetab.c (set_identity, shuffle): Prefer int to unsigned when
7264         either works.  Use lint_assume to convince GCC 4.6.1 that it's OK.
7265         * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7266         * category.h (CATEGORYP): Don't assume arg is nonnegative.
7267         * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7268         integers are now checked earlier.  All uses replaced with XINT.
7269         (ccl_driver):
7270         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7271         For CCL_MapSingle, check that content and value are in int range.
7272         (ccl_driver, Fregister_code_conversion_map):
7273         Check that Vcode_version_map_vector is a vector.
7274         (resolve_symbol_ccl_program): Check that vector header is in range.
7275         Always copy the vector, so that we can check its contents reliably
7276         now rather than having to recheck each instruction as it's being
7277         executed.  Check that vector words fit in 'int'.
7278         (ccl_get_compiled_code, Fregister_ccl_program)
7279         (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7280         program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7281         (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7282         contents are in range.
7283         (Fccl_execute_on_string): Check that status is in range.
7284         * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7285         * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7286         Accept and return EMACS_INT, not int, because callers can pass values
7287         out of 'int' range.
7288         (c_string_width, strwidth, lisp_string_width, chars_in_text)
7289         (multibyte_chars_in_text, parse_str_as_multibyte)
7290         (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7291         (str_as_unibyte, str_to_unibyte, string_count_byte8)
7292         (string_escape_byte8, Fget_byte):
7293         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7294         (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
7295         avoid mishandling large integers.
7296         * character.h: Adjust decls to match defn changes elsewhere.
7297         * charset.c (load_charset_map_from_file, find_charsets_in_text)
7298         (Ffind_charset_region):
7299         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7300         (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7301         (load_charset_map_from_vector, Fdefine_charset_internal):
7302         Don't assume fixnum fits in int.
7303         (load_charset_map_from_vector, Fmap_charset_chars):
7304         Remove now-unnecessary CHECK_NATNUMs.
7305         (Fdefine_charset_internal): Check ranges here, more carefully.
7306         Don't rely on undefined behavior with signed left shift overflow.
7307         Don't assume unsigned int fits into fixnum, or that fixnum fits
7308         into unsigned int.  Don't require max_code to be a valid fixnum;
7309         that's not true for gb10830 4-byte on a 32-bit host.  Allow
7310         invalid_code to be a cons, for the same reason.  Require code_offset
7311         to be a character.  Avoid int overflow if max_char is close
7312         to INT_MAX.
7313         (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7314         this is intended anyway and avoids some undefined behavior.
7315         (load_charset_map): Pass unsigned, not int, as 2nd arg of
7316         INDEX_TO_CODE_POINT, as that's what it expects.
7317         (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
7318         * charset.h (DECODE_CHAR): Return int, not unsigned;
7319         this is what was intended anyway, and it avoids undefined behavior.
7320         (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7321         integer-overflow issues.
7322         (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7323         Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7324         where the argument is EMACS_INT, and this behavior is not intended.
7325         * chartab.c (Fmake_char_table, Fset_char_table_range)
7326         (uniprop_get_decoder, uniprop_get_encoder):
7327         Don't assume fixnum fits in int.
7328         * cmds.c (move_point): New function, that does the gist of
7329         Fforward_char and Fbackward_char, but does so while checking
7330         for integer overflow more accurately.
7331         (Fforward_char, Fbackward_char): Use it.
7332         (Fforward_line, Fend_of_line, internal_self_insert)
7333         (internal_self_insert):
7334         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7335         Fix a FIXME, by checking for integer overflow when calculating
7336         target_clm and actual_clm.
7337         * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
7338         (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
7339         (ASSURE_DESTINATION, coding_alloc_by_realloc)
7340         (coding_alloc_by_making_gap, alloc_destination)
7341         (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7342         (encode_coding_utf_16, detect_coding_emacs_mule)
7343         (decode_coding_emacs_mule, encode_coding_emacs_mule)
7344         (detect_coding_iso_2022, decode_coding_iso_2022)
7345         (encode_invocation_designation, encode_designation_at_bol)
7346         (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7347         (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7348         (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7349         (encode_coding_ccl, encode_coding_raw_text)
7350         (detect_coding_charset, decode_coding_charset)
7351         (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7352         (produce_composition, produce_charset, produce_annotation)
7353         (decode_coding, handle_composition_annotation)
7354         (handle_charset_annotation, consume_chars, decode_coding_gap)
7355         (decode_coding_object, encode_coding_object, detect_coding_system)
7356         (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7357         (code_convert_region, code_convert_string)
7358         (Fdefine_coding_system_internal)
7359         (coding_set_source, coding_set_destination):
7360         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7361         (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7362         (Fdefine_coding_system_internal):
7363         Don't assume fixnums fit in int.
7364         (decode_coding_gap, decode_coding_object, encode_coding_object)
7365         (Fread_coding_system, Fdetect_coding_region)
7366         (Funencodable_char_position, Fcheck_coding_systems_region)
7367         (get_translation, handle_composition_annotation, consume_chars):
7368         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7369         (consume_chars): Rewrite to not calculate an address outside buffer.
7370         (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7371         Don't access memory outside of the args array.
7372         (Fdefine_coding_system_internal): Check for charset-id overflow.
7373         (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7374         result of ENCODE_CHAR.
7375         * coding.h: Adjust decls to match defn changes elsewhere.
7376         (struct coding_system):
7377         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7378         * composite.c (get_composition_id, find_composition)
7379         (run_composition_function, update_compositions)
7380         (compose_text, composition_gstring_put_cache)
7381         (composition_gstring_p, composition_gstring_width)
7382         (fill_gstring_header, fill_gstring_body, autocmp_chars)
7383         (composition_compute_stop_pos, composition_reseat_it)
7384         (composition_update_it, struct position_record)
7385         (find_automatic_composition, composition_adjust_point)
7386         (Fcomposition_get_gstring, Ffind_composition_internal):
7387         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7388         (update_compositions):
7389         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7390         * composite.h: Adjust decls to match defn changes elsewhere.
7391         (struct composition):
7392         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7393         * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7394         Do not attempt to compute the address of the object just before a
7395         buffer; this is not portable.
7396         (Faref, Faset):
7397         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7398         (Faset): Use int, not EMACS_INT, where int is wide enough.
7399         (Fstring_to_number): Don't assume fixnums fit in int.
7400         (Frem): Don't assume arg is nonnegative.
7401         * dbusbind.c (xd_append_arg): Check for integers out of range.
7402         (Fdbus_call_method): Don't overflow the timeout int.
7403         (extract_signed, extract_unsigned): New functions.
7404         (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7405         (xd_get_connection_references): Return ptrdiff_t, not int.
7406         All uses changed.
7407         (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7408         (xd_read_message_1):
7409         Use int, not unsigned, where the dbus API uses int.
7410         (Fdbus_message_internal): Don't overflow mtype.
7411         (syms_of_dbusbind): Allocate right-sized buffer for integers.
7412         * dired.c (directory_files_internal, file_name_completion, scmp)
7413         (file_name_completion_stat):
7414         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7415         (file_name_completion): Don't overflow matchcount.
7416         (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7417         * dispextern.h: Adjust decls to match defn changes elsewhere.
7418         (struct text_pos, struct glyph, struct bidi_saved_info)
7419         (struct bidi_string_data, struct bidi_it, struct composition_it)
7420         (struct it):
7421         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7422         (struct display_pos, struct composition_it, struct it):
7423         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7424         * dispnew.c (increment_matrix_positions)
7425         (increment_row_positions, mode_line_string)
7426         (marginal_area_string):
7427         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7428         (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
7429         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7430         (duration_to_sec_usec): New function, to check for overflow better.
7431         (Fsleep_for, sit_for): Use it.
7432         * doc.c (get_doc_string, store_function_docstring):
7433         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7434         (get_doc_string, Fsnarf_documentation):
7435         Use int, not EMACS_INT, where int is wide enough.
7436         (get_doc_string):
7437         Use SAFE_ALLOCA, not alloca.
7438         Check for overflow when converting EMACS_INT to off_t.
7439         * doprnt.c (doprnt):
7440         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7441         * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7442         Don't assume uid_t fits into fixnum.
7443         (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7444         (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7445         (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7446         (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7447         (general_insert_function)
7448         (Finsert_char, make_buffer_string, make_buffer_string_both)
7449         (update_buffer_properties, Fbuffer_substring)
7450         (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7451         (Fsubst_char_in_region, check_translation)
7452         (Ftranslate_region_internal, save_restriction_restore, Fformat)
7453         (transpose_markers, Ftranspose_regions):
7454         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7455         (clip_to_bounds): Move to lisp.h as an inline function).
7456         (Fconstrain_to_field): Don't assume integers are nonnegative.
7457         (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7458         (Fsubst_char_in_region, Fsave_restriction):
7459         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7460         (Femacs_pid): Don't assume pid_t fits into fixnum.
7461         (lo_time): Use int, not EMACS_INT, when int suffices.
7462         (lisp_time_argument): Check for usec out of range.
7463         (Fencode_time): Don't assume fixnum fits in int.
7464         (Fuser_login_name, Fuser_full_name): Signal an error
7465         if a uid argument is out of range, rather than relying on
7466         undefined behavior.
7467         (Fformat_time_string): Remove now-unnecessary check.
7468         lisp_time_argument checks for out-of-range usec now.
7469         Use ptrdiff_t, not size_t, where ptrdiff_t will do.
7470         * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7471         (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7472         (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7473         (init_cmdargs, Fdump_emacs):
7474         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7475         (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7476         the bottom (typically) 32 bits of the fixnum.
7477         * eval.c (specpdl_size, call_debugger):
7478         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7479         (when_entered_debugger, Fbacktrace_debug):
7480         Don't assume fixnum can fit in int.
7481         (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7482         the object just before a buffer; this is not portable.
7483         (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7484         (grow_specpdl, unbind_to):
7485         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7486         (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7487         (grow_specpdl): Simplify allocation by using xpalloc.
7488         (Fprog1, Fprog2): Don't assume list length fits in int.  Simplify.
7489         * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7490         (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7491         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7492         (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7493         (a_write, e_write):
7494         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7495         (Fcopy_file, non_regular_nbytes, read_non_regular)
7496         (Finsert_file_contents):
7497         Use int, not EMACS_INT, where int is wide enough.
7498         (READ_BUF_SIZE): Verify that it fits in int.
7499         (Finsert_file_contents): Check that counts are in proper range,
7500         rather than assuming fixnums fit into ptrdiff_t etc.
7501         Don't assume fixnums fit into int.
7502         * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
7503         * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7504         (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
7505         (string_char_to_byte, string_byte_to_char)
7506         (string_make_multibyte, string_to_multibyte)
7507         (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7508         (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7509         (substring_both, Fdelete, internal_equal, Ffillarray)
7510         (Fclear_string, mapcar1)
7511         (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7512         (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7513         (larger_vector, make_hash_table, maybe_resize_hash_table)
7514         (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7515         (Fmaphash, secure_hash):
7516         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7517         (concat): Check for string index and length overflow.
7518         (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7519         (Frequire):
7520         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7521         (larger_vector): New API (vec, incr_min, size_max) replaces old
7522         one (vec, new_size, init).  This catches size overflow.
7523         INIT was removed because it was always Qnil.
7524         All callers changed.
7525         (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7526         the upper bound on a hash table index size.
7527         (make_hash_table, maybe_resize_hash_table): Use it.
7528         (secure_hash): Computer start_byte and end_byte only after
7529         they're known to be in ptrdiff_t range.
7530         * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7531         (Ffont_get_glyphs, Ffont_at):
7532         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7533         (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7534         (Flist_fonts, Fopen_font):
7535         Don't assume fixnum can fit in int.
7536         (check_gstring): Don't assume index can fit in int.
7537         (font_match_p): Check that fixnum is a character, not a nonnegative
7538         fixnum, since the later code needs to stuff it into an int.
7539         (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7540         (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7541         conversion overflow issues.
7542         (Fopen_font): Check for integer out of  range.
7543         (Ffont_get_glyphs): Don't assume index can fit in int.
7544         * font.h: Adjust decls to match defn changes elsewhere.
7545         * fontset.c (reorder_font_vector): Redo score calculation to avoid
7546         integer overflow.
7547         (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7548         printmax_t, where ptrdiff_t is wide enough.
7549         (Finternal_char_font):
7550         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7551         * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7552         (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7553         (Fset_frame_position, x_set_frame_parameters)
7554         (x_set_line_spacing, x_set_border_width)
7555         (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7556         Check that fixnums are in proper range for system types.
7557         (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7558         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7559         (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7560         Use SAFE_ALLOCA_LISP, not alloca.
7561         * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7562         intptr_t is wide enough.
7563         * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7564         (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7565         (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7566         Check for fixnum out of range.
7567         * ftfont.c (ftfont_list): Don't assume index fits in int.
7568         Check that fixnums are in proper range for system types.
7569         (ftfont_shape_by_flt):
7570         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7571         * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7572         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7573         (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7574         Check that fixnums are in proper range for system types.
7575         * gnutls.h: Adjust decls to match defn changes elsewhere.
7576         * gtkutil.c (xg_dialog_run):
7577         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7578         (update_frame_tool_bar):
7579         Check that fixnums are in proper range for system types.
7580         * image.c (parse_image_spec): Redo count calculation to avoid overflow.
7581         (lookup_image): Check that fixnums are in range for system types.
7582         * indent.c (last_known_column, last_known_column_point):
7583         (current_column_bol_cache):
7584         (skip_invisible, current_column, check_display_width):
7585         (check_display_width, scan_for_column, current_column_1)
7586         (Findent_to, Fcurrent_indentation, position_indentation)
7587         (indented_beyond_p, Fmove_to_column, compute_motion):
7588         (Fcompute_motion, Fvertical_motion):
7589         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7590         (last_known_column_modified): Use EMACS_INT, not int.
7591         (check_display_width):
7592         (Fcompute_motion):
7593         Check that fixnums and floats are in proper range for system types.
7594         (compute_motion): Don't assume index or fixnum fits in int.
7595         (compute_motion, Fcompute_motion):
7596         Use int, not EMACS_INT, when it is wide enough.
7597         (vmotion): Omit local var start_hpos that is always 0; that way
7598         we don't need to worry about overflow in expressions involving it.
7599         * indent.h: Adjust decls to match defn changes elsewhere.
7600         (struct position):
7601         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7602         Use int, not EMACS_INT, where int is wide enough.
7603         Remove unused members ovstring_chars_done and tab_offset;
7604         all uses removed.
7605         * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7606         (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7607         (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7608         (make_gap, copy_text, insert, insert_and_inherit)
7609         (insert_before_markers, insert_before_markers_and_inherit)
7610         (insert_1, count_combining_before, count_combining_after)
7611         (insert_1_both, insert_from_string)
7612         (insert_from_string_before_markers, insert_from_string_1)
7613         (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7614         (adjust_after_replace, adjust_after_insert, replace_range)
7615         (replace_range_2, del_range, del_range_1, del_range_byte)
7616         (del_range_both, del_range_2, modify_region)
7617         (prepare_to_modify_buffer, signal_before_change)
7618         (signal_after_change, Fcombine_after_change_execute):
7619         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7620         * intervals.c (traverse_intervals, rotate_right, rotate_left)
7621         (balance_an_interval, split_interval_right, split_interval_left)
7622         (find_interval, next_interval, update_interval)
7623         (adjust_intervals_for_insertion, delete_node, delete_interval)
7624         (interval_deletion_adjustment, adjust_intervals_for_deletion)
7625         (static_offset_intervals, offset_intervals)
7626         (merge_interval_right, merge_interval_left, make_new_interval)
7627         (graft_intervals_into_buffer, temp_set_point_both)
7628         (temp_set_point, set_point, adjust_for_invis_intang)
7629         (set_point_both, move_if_not_intangible, get_property_and_range)
7630         (get_local_map, copy_intervals, copy_intervals_to_string)
7631         (compare_string_intervals, set_intervals_multibyte_1):
7632         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7633         * intervals.h: Adjust decls to match defn changes elsewhere.
7634         (struct interval):
7635         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7636         * keyboard.c (this_command_key_count, this_single_command_key_start)
7637         (before_command_key_count, before_command_echo_length, echo_now)
7638         (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7639         (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7640         (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7641         (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7642         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7643         (last_non_minibuf_size, last_point_position, echo_truncate)
7644         (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7645         (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7646         (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7647         (stuff_buffered_input):
7648         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7649         (last_auto_save, command_loop_1, read_char):
7650         Use EMACS_INT, not int, to avoid integer overflow.
7651         (record_char): Avoid overflow in total_keys computation.
7652         (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7653         * keyboard.h: Adjust decls to match defn changes elsewhere.
7654         * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7655         (Fkey_description, Fdescribe_vector, Flookup_key):
7656         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7657         (click_position): New function, to check that positions are in range.
7658         (Fcurrent_active_maps):
7659         (describe_command):
7660         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7661         (Faccessible_keymaps, Fkey_description):
7662         (preferred_sequence_p):
7663         Don't assume fixnum can fit into int.
7664         (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7665         Check for integer overflow in size calculations.
7666         (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7667         avoid mishandling large integers.
7668         * lisp.h: Adjust decls to match defn changes elsewhere.
7669         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7670         (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7671         (struct Lisp_Marker):
7672         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7673         (clip_to_bounds): Now an inline function, moved here from editfns.c.
7674         (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7675         need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7676         All callers changed.
7677         (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7678         Assume the arg has valid form, since it always does.
7679         (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7680         unsigned integer system type.
7681         (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7682         (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7683         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7684         (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7685         (duration_to_sec_usec): New decl.
7686         * lread.c (read_from_string_index, read_from_string_index_byte)
7687         (read_from_string_limit, readchar, unreadchar, openp)
7688         (read_internal_start, read1, oblookup):
7689         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7690         (Fload, readevalloop, Feval_buffer, Feval_region):
7691         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7692         (openp): Check for out-of-range argument to 'access'.
7693         (read1): Use int, not EMACS_INT, where int is wide enough.
7694         Don't assume fixnum fits into int.
7695         Fix off-by-one error that can read outside a buffer.
7696         (read_filtered_event): Use duration_to_sec_usec
7697         to do proper overflow checking on durations.
7698         * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7699         in size calculation.
7700         (Fexecute_kbd_macro):
7701         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7702         * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7703         (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7704         (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7705         (set_marker_both, set_marker_restricted_both, marker_position)
7706         (marker_byte_position, Fbuffer_has_markers_at):
7707         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7708         (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
7709         * menu.c (ensure_menu_items): Rename from grow_menu_items.
7710         It now merely ensures that the menu is large enough, without
7711         necessarily growing it, as this avoids some integer overflow issues.
7712         All callers changed.
7713         (keymap_panes, parse_single_submenu, Fx_popup_menu):
7714         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7715         (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7716         Use SAFE_ALLOCA_LISP, not alloca.
7717         (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7718         to EMACS_INT.  Check that fixnums are in proper range for system types.
7719         * minibuf.c (minibuf_prompt_width, string_to_object)
7720         (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7721         (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7722         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7723         (get_minibuffer, read_minibuf_unwind):
7724         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7725         (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7726         this simplifies overflow checking.  All callers changed.
7727         (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7728         (Ftest_completion):
7729         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7730         * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7731         (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7732         Check that fixnums are in proper range for system types.
7733         (Fx_create_frame, Fx_show_tip):
7734         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7735         * nsfont.m (ns_findfonts, nsfont_list_family):
7736         Don't assume fixnum fits in long.
7737         * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7738         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7739         (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7740         wide enough.
7741         * nsselect.m (ns_get_local_selection, clean_local_selection_data):
7742         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7743         * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7744         (PRINTDECLARE, PRINTPREPARE):
7745         (strout, print_string):
7746         (print, print_preprocess, print_check_string_charset_prop)
7747         (print_object):
7748         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7749         (PRINTDECLARE):
7750         (temp_output_buffer_setup, Fprin1_to_string, print_object):
7751         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7752         (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
7753         (printchar, strout): Use xpalloc to catch size calculation overflow.
7754         (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
7755         (print_error_message): Use SAFE_ALLOCA, not alloca.
7756         (print_object): Use int, not EMACS_INT, where int is wide enough.
7757         (print_depth, new_backquote_output, print_number_index):
7758         Use ptrdiff_t, not int, where int might not be wide enough.
7759         * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7760         (Fset_process_window_size, Fformat_network_address)
7761         (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
7762         (sigchld_handler):
7763         Check that fixnums are in proper range for system types.
7764         (Fsignal_process): Simplify by avoiding a goto.
7765         Check for process-ids out of pid_t range rather than relying on
7766         undefined behavior.
7767         (process_tick, update_tick): Use EMACS_INT, not int.
7768         (Fformat_network_address, read_process_output, send_process)
7769         (Fprocess_send_region, status_notify):
7770         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7771         (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7772         (wait_reading_process_output, read_process_output, exec_sentinel):
7773         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7774         (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7775         (Faccept_process_output): Use duration_to_sec_usec to do proper
7776         overflow checking on durations.
7777         (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7778         Don't assume pid_t fits in int.
7779         * process.h (struct Lisp_Process): Members tick and update_tick
7780         are now of type EMACS_INT, not int.
7781         * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7782         configured --with-wide-int.
7783         * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7784         (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7785         * search.c (looking_at_1, string_match_1):
7786         (fast_string_match, fast_c_string_match_ignore_case)
7787         (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7788         (scan_newline, find_before_next_newline, search_command)
7789         (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7790         (set_search_regs, wordify):
7791         (Freplace_match):
7792         (Fmatch_data):
7793         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7794         (string_match_1, search_buffer, set_search_regs):
7795         (Fmatch_data):
7796         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7797         (wordify): Check for overflow in size calculation.
7798         (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7799         (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7800         Check that fixnums are in proper range for system types.
7801         * sound.c (struct sound_device)
7802         (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7803         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7804         (Fplay_sound_internal):
7805         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7806         * syntax.c (struct lisp_parse_state, find_start_modiff)
7807         (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7808         (Fparse_partial_sexp):
7809         Don't assume fixnums can fit in int.
7810         (struct lisp_parse_state, find_start_pos, find_start_value)
7811         (find_start_value_byte, find_start_begv)
7812         (update_syntax_table, char_quoted, dec_bytepos)
7813         (find_defun_start, prev_char_comend_first, back_comment):
7814         (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7815         (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7816         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7817         (Finternal_describe_syntax_value): Check that match_lisp is a
7818         character, not an integer, since the code stuffs it into int.
7819         (scan_words, scan_sexps_forward):
7820         Check that fixnums are in proper range for system types.
7821         (Fforward_word):
7822         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7823         (scan_sexps_forward):
7824         Use CHARACTERP, not INTEGERP, since the value must fit into int.
7825         (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7826         * syntax.h: Adjust decls to match defn changes elsewhere.
7827         (struct gl_state_s):
7828         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7829         (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7830         MOST_POSITIVE_FIXNUM.
7831         * sysdep.c (wait_for_termination_1, wait_for_termination)
7832         (interruptible_wait_for_termination, mkdir):
7833         Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7834         (emacs_read, emacs_write):
7835         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7836         (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7837         and double all fit in int.
7838         * term.c (set_tty_color_mode):
7839         Check that fixnums are in proper range for system types.
7840         * termhooks.h (struct input_event):
7841         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7842         * textprop.c (validate_interval_range, interval_of)
7843         (Fadd_text_properties, set_text_properties_1)
7844         (Fremove_text_properties, Fremove_list_of_text_properties)
7845         (Ftext_property_any, Ftext_property_not_all)
7846         (copy_text_properties, text_property_list, extend_property_ranges)
7847         (verify_interval_modification):
7848         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7849         (Fnext_single_char_property_change)
7850         (Fprevious_single_char_property_change):
7851         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7852         (copy_text_properties):
7853         Check for integer overflow in index calculation.
7854         * undo.c (last_boundary_position, record_point, record_insert)
7855         (record_delete, record_marker_adjustment, record_change)
7856         (record_property_change):
7857         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7858         (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7859         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7860         * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7861         (Fx_hide_tip, Fx_file_dialog):
7862         * w32menu.c (set_frame_menubar):
7863         Use ptrdiff_t, not int, for consistency with rest of code.
7864         * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7865         (select_window, Fdelete_other_windows_internal)
7866         (window_scroll_pixel_based, window_scroll_line_based)
7867         (Frecenter, Fset_window_configuration):
7868         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7869         (Fset_window_hscroll, run_window_configuration_change_hook)
7870         (set_window_buffer, temp_output_buffer_show, scroll_command)
7871         (Fscroll_other_window, Frecenter):
7872         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7873         (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7874         Don't assume fixnum fits in int.
7875         (Fset_window_scroll_bars):
7876         Check that fixnums are in proper range for system types.
7877         * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7878         (string_pos, c_string_pos, number_of_chars, init_iterator)
7879         (in_ellipses_for_invisible_text_p, init_from_display_pos)
7880         (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7881         (compute_display_string_end, handle_face_prop)
7882         (face_before_or_after_it_pos, handle_invisible_prop)
7883         (handle_display_prop, handle_display_spec, handle_single_display_spec)
7884         (display_prop_intangible_p, string_buffer_position_lim)
7885         (string_buffer_position, handle_composition_prop, load_overlay_strings)
7886         (get_overlay_strings_1, get_overlay_strings)
7887         (iterate_out_of_display_property, forward_to_next_line_start)
7888         (back_to_previous_visible_line_start, reseat, reseat_to_string)
7889         (get_next_display_element, set_iterator_to_next)
7890         (get_visually_first_element, compute_stop_pos_backwards)
7891         (handle_stop_backwards, next_element_from_buffer)
7892         (move_it_in_display_line_to, move_it_in_display_line)
7893         (move_it_to, move_it_vertically_backward, move_it_by_lines)
7894         (add_to_log, message_dolog, message_log_check_duplicate)
7895         (message2, message2_nolog, message3, message3_nolog
7896         (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7897         (current_message_1, truncate_echo_area, truncate_message_1)
7898         (set_message, set_message_1, store_mode_line_noprop)
7899         (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7900         (text_outside_line_unchanged_p, check_point_in_composition)
7901         (reconsider_clip_changes)
7902         (redisplay_internal, set_cursor_from_row, try_scrolling)
7903         (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7904         (redisplay_window, find_last_unchanged_at_beg_row)
7905         (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7906         (trailing_whitespace_p, find_row_edges, display_line)
7907         (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7908         (display_mode_element, store_mode_line_string)
7909         (pint2str, pint2hrstr, decode_mode_spec)
7910         (display_count_lines, display_string, draw_glyphs)
7911         (x_produce_glyphs, x_insert_glyphs)
7912         (rows_from_pos_range, mouse_face_from_buffer_pos)
7913         (fast_find_string_pos, mouse_face_from_string_pos)
7914         (note_mode_line_or_margin_highlight, note_mouse_highlight):
7915         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7916         (safe_call, init_from_display_pos, handle_fontified_prop)
7917         (handle_single_display_spec, load_overlay_strings)
7918         (with_echo_area_buffer, setup_echo_area_for_printing)
7919         (display_echo_area, echo_area_display)
7920         (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7921         (update_tool_bar, hscroll_window_tree, redisplay_internal)
7922         (redisplay_window, dump_glyph_row, display_mode_line)
7923         (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
7924         (handle_display_spec, display_prop_string_p):
7925         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7926         (handle_single_display_spec, build_desired_tool_bar_string)
7927         (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7928         (get_specified_cursor_type):
7929         Check that fixnums are in proper range for system types.
7930         (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7931         (Flookup_image_map):
7932         Don't assume fixnums fit in int.
7933         (compare_overlay_entries):
7934         Avoid mishandling comparisons due to subtraction overflow.
7935         (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7936         (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7937         (handle_tool_bar_click):
7938         Use int, not unsigned, since we prefer signed and the signedness
7939         doesn't matter here.
7940         (get_next_display_element, next_element_from_display_vector):
7941         Use int, not EMACS_INT, when int is wide enough.
7942         (start_hourglass): Use duration_to_sec_usec to do proper
7943         overflow checking on durations.
7944         * xfaces.c (Fbitmap_spec_p):
7945         Check that fixnums are in proper range for system types.
7946         (compare_fonts_by_sort_order):
7947         Avoid mishandling comparisons due to subtraction overflow.
7948         (Fx_family_fonts, realize_basic_faces):
7949         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7950         (Fx_family_fonts):
7951         Don't assume fixnum fits in int.
7952         Use SAFE_ALLOCA_LISP, not alloca.
7953         (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7954         (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7955         (face_at_buffer_position, face_for_overlay_string)
7956         (face_at_string_position):
7957         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7958         (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7959         * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7960         (Fx_show_tip):
7961         Check that fixnums are in proper range for system types.
7962         (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7963         (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7964         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7965         (Fx_change_window_property): Don't assume fixnums fit in int.
7966         * xfont.c (xfont_chars_supported):
7967         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7968         * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7969         (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7970         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7971         * xml.c (parse_region):
7972         * xrdb.c (magic_file_p):
7973         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7974         * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7975         (x_get_local_selection, x_reply_selection_request)
7976         (x_handle_selection_request, wait_for_property_change):
7977         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7978         (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7979         short is wide enough.
7980         (x_send_client_event): Don't assume fixnum fits in int.
7981         * xterm.c (x_x_to_emacs_modifiers):
7982         Don't assume EMACS_INT overflows nicely into int.
7983         (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7984         may come from Lisp.
7985         (handle_one_xevent): NATNUMP can eval its arg twice.
7986         (x_connection_closed):
7987         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7988         * xterm.h: Adjust decls to match defn changes elsewhere.
7989         (struct scroll_bar): Use struct vectorlike_header
7990         rather than rolling our own approximation.
7991         (SCROLL_BAR_VEC_SIZE): Remove; not used.
7993 2012-05-25  Glenn Morris  <rgm@gnu.org>
7995         * lisp.mk (lisp): Update for more files being compiled now.
7997 2012-05-25  Stefan Monnier  <monnier@iro.umontreal.ca>
7999         * lread.c: Remove `read_pure' which makes no difference.
8000         (read_pure): Remove var.
8001         (unreadpure): Remove function.
8002         (readevalloop): Don't call read_list with -1 flag.
8003         (read1, read_vector): Don't test read_pure any more.
8004         (read_list): Simplify.
8006         * fileio.c, character.h: Minor style tweaks.
8008 2012-05-24  Dmitry Antipov  <dmantipov@yandex.ru>
8010         * window.h (clip_changed): Remove useless declaration.
8012 2012-05-22  Juanma Barranquero  <lekktu@gmail.com>
8014         * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8015         (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8017 2012-05-22  Paul Eggert  <eggert@cs.ucla.edu>
8019         Remove src/m/*.
8020         This directory predates autoconf and is no longer needed nowadays.
8021         Move its few remaining bits of functionality to where they're needed.
8022         * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8023         * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8024         * m/template.h: Remove.
8025         * Makefile.in (M_FILE): Remove.  All uses removed.
8026         * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8027         * lisp.h (USE_LSB_TAG):
8028         * mem-limits.h (EXCEEDS_LISP_PTR):
8029         Use VAL_MAX, not VALBITS, in #if.
8030         * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8031         (EMACS_UINT): Define unconditionally now.
8032         (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8033         (BITS_PER_EMACS_INT): New constants, replacing
8034         what used to be in config.h, but not useful in #if.
8035         (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
8036         define them any more.
8037         (VAL_MAX): New macro.
8038         (VALMASK): Use it.
8039         * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
8040         BITS_PER_EMACS_INT, in #if.
8041         * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8042         (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8043         * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8044         * s/ms-w32.h (DATA_START):
8045         Move here from removed file m/intel386.h.
8046         * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8047         * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8049 2012-05-21  Paul Eggert  <eggert@cs.ucla.edu>
8051         Assume C89 or later.
8052         * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8053         * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8054         (xrealloc):
8055         * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8056         * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8057         * textprop.c, tparam.c (NULL): Remove.
8058         * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8059         * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8060         * regex.h (_RE_ARGS): Remove.  All uses rewritten to use prototypes.
8061         * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8062         * xterm.c (input_signal_count): Assume volatile works.
8064 2012-05-21  Ken Brown  <kbrown@cornell.edu>
8066         * xgselect.c (xg_select): Fix first argument in call to 'select'
8067         (bug#11508).
8069 2012-05-20  Ken Brown  <kbrown@cornell.edu>
8071         * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
8072         [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
8074 2012-05-19  Ken Brown  <kbrown@cornell.edu>
8076         * xfns.c (x_in_use): Remove `static' qualifier.
8077         * xterm.h (x_in_use): Declare.
8078         * xgselect.c: Include xterm.h.
8079         (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8080         and `display_arg' (bug#9754).
8082 2012-05-19  Paul Eggert  <eggert@cs.ucla.edu>
8084         * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8086         * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8087         * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8089 2012-05-18  Eli Zaretskii  <eliz@gnu.org>
8091         Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8093         * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
8094         (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
8096         * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8097         reference to image_cache->refcount.
8098         (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8100 2012-05-17  Juri Linkov  <juri@jurta.org>
8102         * search.c (Fword_search_regexp, Fword_search_backward)
8103         (Fword_search_forward, Fword_search_backward_lax)
8104         (Fword_search_forward_lax): Move functions to isearch.el
8105         (bug#10145, bug#11381).
8107 2012-05-16  Paul Eggert  <eggert@cs.ucla.edu>
8109         * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8111 2012-05-15  Stefan Monnier  <monnier@iro.umontreal.ca>
8113         * lread.c (init_obarray): Declare Qt and Qnil as special.
8115 2012-05-14  Glenn Morris  <rgm@gnu.org>
8117         * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
8118         Put "libexec" before "bin", for the sake of init_callproc_1.
8120 2012-05-14  Paul Eggert  <eggert@cs.ucla.edu>
8122         * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8124         * unexaix.c: Port to more-recent AIX compilers.
8125         (report_error, report_error_1, make_hdr, copy_sym)
8126         (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8127         Make arguments const char *, not char *, to avoid violations of C
8128         standard and to fix some AIX warnings reported by Gilles Pion.
8130 2012-05-14  Eli Zaretskii  <eliz@gnu.org>
8132         * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8133         already have overlays loaded.
8134         (handle_single_display_spec): Before returning without displaying
8135         fringe bitmap, synchronize the bidi iterator with the main display
8136         iterator, by calling iterate_out_of_display_property.
8137         (iterate_out_of_display_property): Detect buffer iteration by
8138         testing that it->string is a Lisp string.
8139         (get_next_display_element): When the current object is exhausted,
8140         and there's something on it->stack, call set_iterator_to_next to
8141         proceed with what's on the stack, instead of returning zero.
8142         (set_iterator_to_next): If called at the end of a Lisp string,
8143         proceed to consider_string_end without incrementing string
8144         position.  Don't increment display vector index past the end of
8145         the display vector.  (Bug#11417)
8146         (pos_visible_p): Don't report a position visible when move_it_to
8147         stopped at the last line of window, which happens to be scanned
8148         backwards by the bidi iteration.  (Bug#11464)
8150 2012-05-14  Eli Zaretskii  <eliz@gnu.org>
8152         * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8153         and right-margin display specs even if the spec is invalid or we
8154         are on a TTY, and thus unable to display on the fringes.
8155         That's because the text with the property will not be displayed anyway,
8156         so we need to signal to the caller that this is a "replacing"
8157         display spec.  This fixes display when the spec is invalid or we
8158         are on a TTY.
8160 2012-05-14  Paul Eggert  <eggert@cs.ucla.edu>
8162         * unexaix.c (make_hdr): Fix typo in prototype.
8163         This bug broke the build on AIX.  Problem reported by Gilles Pion.
8165 2012-05-14  Michael Albinus  <michael.albinus@gmx.de>
8167         * keyboard.c (kbd_buffer_get_event): Read special events also in
8168         batch mode.  (Bug#11415)
8170 2012-05-12  Glenn Morris  <rgm@gnu.org>
8172         * ns.mk: Update for ns_appbindir no longer having trailing "/".
8174 2012-05-12  Eli Zaretskii  <eliz@gnu.org>
8176         * lisp.mk (lisp): Add newcomment.elc.
8178 2012-05-12  Glenn Morris  <rgm@gnu.org>
8180         * Makefile.in (MKDIR_P): New, set by configure.
8181         * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8183 2012-05-11  Paul Eggert  <eggert@cs.ucla.edu>
8185         Remove unused function hourglass_started.
8186         * dispextern.h (hourglass_started):
8187         * w32fns.c (hourglass_started):
8188         * xdisp.c (hourglass_started): Remove.
8190 2012-05-10  Juanma Barranquero  <lekktu@gmail.com>
8192         * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8193         Update dependencies.
8195 2012-05-10  Paul Eggert  <eggert@cs.ucla.edu>
8197         * xgselect.c (xg_select): Put maxfds+1 into a var.
8198         This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8200         * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8202 2012-05-10  Dave Abrahams  <dave@boostpro.com>
8204         * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8205         (lock_file): If create_lockfiles is 0, do nothing.  (Bug#11227)
8207 2012-05-09  Michael Albinus  <michael.albinus@gmx.de>
8209         * dbusbind.c (xd_registered_buses): New internal Lisp object.
8210         Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8211         (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8212         Initialize xd_registered_buses.
8214 2012-05-09  Paul Eggert  <eggert@cs.ucla.edu>
8216         Untag more efficiently if USE_LSB_TAG.
8217         This is based on a proposal by YAMAMOTO Mitsuharu in
8218         <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8219         For an admittedly artificial (nth 8000 longlist) benchmark on
8220         Fedora 15 x86-64, this yields a 25% CPU speedup.  Also, it shrinks
8221         Emacs's overall text size by 1%.
8222         * lisp.h (XUNTAG): New macro.
8223         (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8224         (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8225         (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8226         * eval.c (Fautoload):
8227         * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8228         * frame.h (XFRAME): Use XUNTAG.
8230         Port recent dbusbind.c changes to 32-bit --with-wide-int.
8231         * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8232         Remove unportable assumptions about print widths of types like
8233         dbus_uint32_t.
8234         (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8235         intptr_t when converting between pointer and integer, to avoid GCC
8236         warnings about wrong width.
8238 2012-05-09  Eli Zaretskii  <eliz@gnu.org>
8240         * w32proc.c (new_child): Force Windows to reserve only 64KB of
8241         stack for each reader_thread, instead of defaulting to 8MB
8242         determined by the linker.  This avoids failures in creating
8243         subprocesses on Windows 7, see the discussion in this thread:
8244         http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8246 2012-05-07  Jérémy Compostella  <jeremy.compostella@gmail.com>
8248         Fix up display of the *Minibuf-0* buffer in the mini window.
8249         * keyboard.c (read_char): Don't clear the echo area if there's no
8250         message to clear.
8251         * xdisp.c (redisplay_internal): Redisplay the mini window (with the
8252         contents of *Minibuf-0*) if there's no message displayed in its stead.
8254 2012-05-07  Michael Albinus  <michael.albinus@gmx.de>
8256         * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8257         batch mode.
8259 2012-05-06  Chong Yidong  <cyd@gnu.org>
8261         * lisp.mk (lisp): Update.
8263 2012-05-05  Jim Meyering  <meyering@redhat.com>
8265         * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8267 2012-05-04  Stefan Monnier  <monnier@iro.umontreal.ca>
8269         * data.c (PUT_ERROR): New macro.
8270         (syms_of_data): Use it.  Add new error type `user-error'.
8271         * undo.c (user_error): New function.
8272         (Fprimitive_undo): Use it.
8273         * print.c (print_error_message): Adjust print style for `user-error'.
8274         * keyboard.c (user_error): New function.
8275         (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8277 2012-05-03  Paul Eggert  <eggert@cs.ucla.edu>
8279         Do not limit current-time-string to years 1000..9999.
8280         * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8281         (Fcurrent_time_string): Support any year that is supported by the
8282         underlying localtime representation.  Don't use asctime, as it
8283         has undefined behavior for years outside the range -999..9999.
8285 2012-05-02  Paul Eggert  <eggert@cs.ucla.edu>
8287         Fix race conditions involving setenv, gmtime, localtime, asctime.
8288         Without this fix, interrupts could mess up code that uses these
8289         nonreentrant functions, since setting TZ invalidates existing
8290         tm_zone or tzname values, and since most of these functions return
8291         pointers to static storage.
8292         * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8293         (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8294         Grow the critical sections to include not just invoking
8295         localtime/gmtime, but also accessing these functions' results
8296         including their tm_zone values if any, and any related TZ setting.
8297         (format_time_string): Last arg is now struct tm *, not struct tm **,
8298         so that the struct tm is saved in the critical section.
8299         All callers changed.  Simplify allocation of initial buffer, partly
8300         motivated by the fact that memory allocation needs to be outside
8301         the critical section.
8303 2012-05-02  Dmitry Antipov  <dmantipov@yandex.ru>
8305         * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8306         with RESET_INTERVAL.
8308         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8309         Remove duplicated buffer name initialization.
8311 2012-05-02  Jim Meyering  <jim@meyering.net>
8313         * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8315         * xfns.c (x_window): Use xstrdup (Bug#11375).
8317 2012-05-02  Eli Zaretskii  <eliz@gnu.org>
8319         * xdisp.c (pos_visible_p): If already at a newline from the
8320         display string before the 'while' loop, don't walk back the glyphs
8321         from it3.glyph_row.  Solves assertion violation when the display
8322         string begins with a newline (egg.el).  (Bug#11367)
8324 2012-05-01  Stefan Monnier  <monnier@iro.umontreal.ca>
8326         * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8327         Move to simple.el.
8329 2012-05-01  Glenn Morris  <rgm@gnu.org>
8331         * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8332         s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8333         and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8334         All were removed before 23.1.
8336         * dispnew.c: Remove HAVE_LIBNCURSES test;
8337         it is always true on relevant platforms.
8339         * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8340         Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8342         * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8344 2012-04-30  Andreas Schwab  <schwab@linux-m68k.org>
8346         * .gdbinit (xpr): Remove checks for no longer existing misc types.
8347         (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8348         Remove.
8350 2012-04-28  Paul Eggert  <eggert@cs.ucla.edu>
8352         Do not avoid creating empty evaporating overlays (Bug#9642).
8353         * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8354         That is, do not delete an evaporating overlay if it becomes
8355         empty after its bounds are adjusted to fit within its buffer.
8356         This fix caused other problems, and I'm reverting it until we get
8357         to the bottom of them.
8359 2012-04-27  Chong Yidong  <cyd@gnu.org>
8361         * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8363 2012-04-27  Eli Zaretskii  <eliz@gnu.org>
8365         * xdisp.c (pos_visible_p): If the window start position is beyond
8366         ZV, start the display from buffer beginning.  Prevents assertion
8367         violation in init_iterator when the minibuffer window is scrolled
8368         via the scroll bar.
8370         * window.c (window_scroll_pixel_based): Likewise.
8372 2012-04-27  Chong Yidong  <cyd@gnu.org>
8374         * keymap.c (where_is_internal): Doc fix (Bug#10872).
8376 2012-04-27  Glenn Morris  <rgm@gnu.org>
8378         * fileio.c (Fcopy_file, Fset_file_selinux_context):
8379         Ignore ENOTSUP failures from setfilecon functions.  (Bug#11245)
8381 2012-04-27  Eli Zaretskii  <eliz@gnu.org>
8383         * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8384         Don't overrun array limits of glyph row's used[] array.  (Bug#11288)
8386 2012-04-26  Eli Zaretskii  <eliz@gnu.org>
8388         * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8389         display element, check also the underlying string or buffer
8390         character.  (Bug#11341)
8392         * w32menu.c: Include w32heap.h.
8393         (add_menu_item): If the call to AppendMenuW (via
8394         unicode_append_menu) fails, disable Unicode menus only if we are
8395         running on Windows 9X/Me.
8397 2012-04-24  Andreas Schwab  <schwab@linux-m68k.org>
8399         * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8400         (xgetint): Add missing shift for LSB tags.
8402 2012-04-24  Martin Rudalics  <rudalics@gmx.at>
8404         * keyboard.c (read_char): Don't wipe echo area for select window
8405         events: These might get delayed via `mouse-autoselect-window'
8406         (Bug#11304).
8408 2012-04-24  Juanma Barranquero  <lekktu@gmail.com>
8410         * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8411         manipulation of :loaded-from data.
8413 2012-04-23  Juanma Barranquero  <lekktu@gmail.com>
8415         * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8416         now a cons (bug#11311).
8418 2012-04-23  Paul Eggert  <eggert@cs.ucla.edu>
8420         Do not create empty overlays with the evaporate property (Bug#9642).
8421         * buffer.c (Fmove_overlay): Delete an evaporating overlay
8422         if it becomes empty after its bounds are adjusted to fit within
8423         its buffer.  Without this fix, in a nonempty buffer (let ((o
8424         (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8425         yields an empty overlay that has the evaporate property, which is
8426         not supposed to happen.
8428         Fix minor GTK3 problems found by static checking.
8429         * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8430         (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8431         (struct _EmacsFixedClass, emacs_fixed_get_type):
8432         Move decls here from emacsgtkfixed.h, since they needn't be public.
8433         (emacs_fixed_get_type): Now static.
8434         (emacs_fixed_class_init): Omit unused local.
8435         (emacs_fixed_child_type): Remove; unused.
8436         * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8437         (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8438         (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8439         (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8440         (EMACS_FIXED_GET_CLASS): Remove; unused.
8441         * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8443         * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8444         Problem reported by Juanma Barranquero for Windows -Wunused-function.
8446 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
8448         Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
8449         * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
8450         (__malloc_size_t, __malloc_ptrdiff_t):
8451         Remove.  All uses removed, replaced by the definiens if needed,
8452         since we can assume C89 or better now.
8453         Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8454         (protect_malloc_state, align, get_contiguous_space)
8455         (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8456         (malloc_atfork_handler_child, malloc_enable_thread)
8457         (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8458         (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8459         (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8460         (special_realloc, _realloc_internal_nolock, _realloc_internal)
8461         (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8462         (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8463         Define using prototypes, not old style.
8464         (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8465         Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8466         (align): Don't assume that signed integer overflow wraps around.
8467         Omit unused local var.
8468         (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8469         (_free_internal_nolock, memalign, mallochook, reallochook):
8470         Omit no-longer-needed casts.
8471         (valloc): Use getpagesize, not __getpagesize.
8472         (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8473         (struct hdr): The 'magic' member is now size_t, not unsigned long.
8475         * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8477 2012-04-22  Michael Albinus  <michael.albinus@gmx.de>
8479         Move functions from C to Lisp.  Make non-blocking method calls
8480         the default.  Implement further D-Bus standard interfaces.
8482         * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8483         (QCdbus_request_name_allow_replacement)
8484         (QCdbus_request_name_replace_existing)
8485         (QCdbus_request_name_do_not_queue)
8486         (QCdbus_request_name_reply_primary_owner)
8487         (QCdbus_request_name_reply_in_queue)
8488         (QCdbus_request_name_reply_exists)
8489         (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8490         (QCdbus_registered_serial, QCdbus_registered_method)
8491         (QCdbus_registered_signal): New Lisp objects.
8492         (XD_DEBUG_MESSAGE): Use sizeof.
8493         (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8494         (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8495         (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8496         (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8497         (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8498         (xd_signature, xd_append_arg): Allow float for integer types.
8499         (xd_get_connection_references): New function.
8500         (xd_get_connection_address): Rename from xd_initialize.
8501         Return cached address.
8502         (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8503         (xd_close_bus): Rename from Fdbus_close_bus.  Not needed on Lisp
8504         level.
8505         (Fdbus_init_bus): New optional arg PRIVATE.  Cache address.
8506         Return number of refcounts.
8507         (Fdbus_get_unique_name): Make stronger parameter check.
8508         (Fdbus_message_internal): New defun.
8509         (Fdbus_call_method, Fdbus_call_method_asynchronously)
8510         (Fdbus_method_return_internal, Fdbus_method_error_internal)
8511         (Fdbus_send_signal, Fdbus_register_service)
8512         (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8513         (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8514         (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8515         (Vdbus_compiled_version, Vdbus_runtime_version)
8516         (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8517         (Vdbus_message_type_method_return, Vdbus_message_type_error)
8518         (Vdbus_message_type_signal): New defvars.
8519         (Vdbus_registered_buses, Vdbus_registered_objects_table):
8520         Adapt docstring.
8522 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
8524         Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8525         * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8526         Do not assume ptrdiff_t is the same width as 'int'.
8528         * alloc.c: Handle unusual debugging option combinations.
8529         (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8530         since the two debugging options are incompatible.
8531         (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8532         is defined.
8533         (mem_init, mem_insert, mem_insert_fixup):
8534         Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8535         (NEED_MEM_INSERT): Remove; no longer needed.
8537 2012-04-22  Leo Liu  <sdl.web@gmail.com>
8539         * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8541 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
8543         * sysdep.c [__FreeBSD__]: Minor cleanups.
8544         (list_system_processes, system_process_attributes) [__FreeBSD__]:
8545         Use Emacs indenting style more consistently.  Avoid some casts.
8546         Use 'double' consistently rather than mixing 'float' and 'double'.
8548 2012-04-21  Eduard Wiebe  <usenet@pusto.de>
8550         * sysdep.c (list_system_processes, system_process_attributes):
8551         Add implementation for FreeBSD (Bug#5243).
8553 2012-04-21  Andreas Schwab  <schwab@linux-m68k.org>
8555         * lisp.mk (lisp): Update.
8557 2012-04-20  Paul Eggert  <eggert@cs.ucla.edu>
8559         * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8560         It is never used otherwise.
8562 2012-04-20  Stefan Monnier  <monnier@iro.umontreal.ca>
8564         * print.c (print_preprocess): Only check print_depth if print-circle
8565         is nil.
8566         (print_object): Check for cycles even when print-circle is nil and
8567         print-gensym is t, but only check print_depth if print-circle is nil.
8569 2012-04-20  Chong Yidong  <cyd@gnu.org>
8571         * process.c (wait_reading_process_output): If EIO occurs on a pty,
8572         set the status to "failed" and ensure that sentinel is run.
8574 2012-04-20  Glenn Morris  <rgm@gnu.org>
8576         * process.c (Fset_process_inherit_coding_system_flag)
8577         (Fset_process_query_on_exit_flag): Doc fix (mention return value).
8578         (Fmake_network_process, Fmake_serial_process): Doc fix.
8580 2012-04-20  Eli Zaretskii  <eliz@gnu.org>
8582         * xdisp.c (string_buffer_position_lim): Limit starting position to
8583         BEGV.
8584         (set_cursor_from_row): If called for a mode-line or header-line
8585         row, return zero immediately.
8586         (try_cursor_movement): If inside continuation line, don't back up
8587         farther than the first row after the header line, if any.
8588         Don't consider the header-line row as "partially visible", even if
8589         MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero.  (Bug#11261)
8591 2012-04-20  Atsuo Ohki  <ohki@gssm.otsuka.tsukuba.ac.jp>  (tiny change)
8593         * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8594         (bug#11238).
8596 2012-04-20  Teodor Zlatanov  <tzz@lifelogs.com>
8597 2012-04-18  Paul Eggert  <eggert@cs.ucla.edu>
8599         configure: new option --enable-gcc-warnings (Bug#11207)
8600         * Makefile.in (C_WARNINGS_SWITCH): Remove.
8601         (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8602         (ALL_CFLAGS): Use new macros rather than old.
8603         * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8604         * regex.c: Ignore -Wstrict-overflow.  If !emacs, also ignore
8605         -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8606         -Wunused-result, -Wunused-variable.  This should go away once
8607         the Emacs and Gnulib regex code is merged.
8608         (xmalloc, xrealloc): Now static.
8610 2012-04-17  Paul Eggert  <eggert@cs.ucla.edu>
8612         * dired.c (Fsystem_groups): Remove unused local.
8614 2012-04-17  Glenn Morris  <rgm@gnu.org>
8616         * dired.c (Fsystem_users): Doc fix.
8618 2012-04-17  Dmitry Antipov  <dmantipov@yandex.ru>
8620         * dired.c (Fsystem_users, Fsystem_groups): New functions.  (Bug#7900)
8621         (syms_of_dired): Add them.
8623 2012-04-16  Paul Eggert  <eggert@cs.ucla.edu>
8625         Fix minor alloc.c problems found by static checking.
8626         * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8627         New extern decls, to avoid calling undeclared functions.
8628         (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8629         && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8630         GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8631         (NEED_MEM_INSERT): New macro.
8632         (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
8633         Remove one incorrect comment and fix another.
8635         Fix minor ralloc.c problems found by static checking.
8636         See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8637         * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8638         (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8639         (r_alloc_sbrk): Now static.
8641         Improve ralloc.c interface checking.
8642         See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8643         * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8644         (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8645         * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8646         [REL_ALLOC]: ... to here, to check interface.
8647         * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8648         Remove decls.  This fixes an "It stinks!".
8650         * alloc.c (which_symbols): Fix alignment issue / type clash.
8652 2012-04-15  Andreas Schwab  <schwab@linux-m68k.org>
8654         * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8655         (struct Lisp_Misc_Any): Likewise.
8656         (struct Lisp_Free): Likewise.
8657         * alloc.c (union aligned_Lisp_Symbol): Define.
8658         (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8659         aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8660         (union aligned_Lisp_Misc): Define.
8661         (MARKER_BLOCK_SIZE, struct marker_block): Use union
8662         aligned_Lisp_Misc instead of union Lisp_Misc.
8663         (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
8665 2012-04-14  Paul Eggert  <eggert@cs.ucla.edu>
8667         Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8668         * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8669         * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8670         * s/netbsd.h, s/sol2-6.h:
8671         Remove definition of GC_MARK_STACK, since the default now works.
8672         * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8673         Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8674         no longer the default.
8675         * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8677 2012-04-14  Atsuo Ohki  <ohki@gssm.otsuka.tsukuba.ac.jp>  (tiny change)
8679         * lread.c (lisp_file_lexically_bound_p):
8680         Fix hang at ";-*-\n" (bug#11238).
8682 2012-04-14  Eli Zaretskii  <eliz@gnu.org>
8684         * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8685         "unchanged" if its end.pos is beyond ZV.  (Bug#11199)
8687 2012-04-14  Jan Djärv  <jan.h.d@swipnet.se>
8689         * nsterm.m (constrainFrameRect): Always constrain when there is only
8690         one screen (Bug#10962).
8692 2012-04-13  Ken Brown  <kbrown@cornell.edu>
8694         * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8696 2012-04-13  Reuben Thomas  <rrt@sc3d.org>
8698         * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8700 2012-04-11  Daniel Colascione  <dancol@dancol.org>
8702         * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8703         against is gone.  It's better to use vfork now so that when Cygwin
8704         gains a new, working vfork, we use it automatically (bug#10398).
8706 2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
8708         * window.c (save_window_save): Obey window-point-insertion-type.
8710 2012-04-11  Glenn Morris  <rgm@gnu.org>
8712         * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8714 2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
8716         * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8718 2012-04-10  Jason S. Cornez  <jcornez@ravenpack.com>  (tiny change)
8720         * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8721         (force_quit_count): New var.
8722         (handle_interrupt): Use it.
8724 2012-04-10  Juanma Barranquero  <lekktu@gmail.com>
8726         * w32.c (w32_delayed_load): Record the full path of the library
8727         being loaded (bug#10424).
8729 2012-04-09  Glenn Morris  <rgm@gnu.org>
8731         * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8732         not just in the obarray, before snarfing them.  (Bug#11036)
8734         * Makefile.in ($(leimdir)/leim-list.el):
8735         Pass EMACS rather than BUILT_EMACS.
8737 2012-04-09  Teodor Zlatanov  <tzz@lifelogs.com>
8739         * process.c (make_process):
8740         * process.h: Add integer `gnutls_handshakes_tried' member to
8741         process struct.
8743         * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8744         Add convenience `GNUTLS_LOG2i' macro.
8746         * gnutls.c (gnutls_log_function2i): Convenience log function.
8747         (emacs_gnutls_read): Use new log functions,
8748         `gnutls_handshakes_tried' process member, and
8749         `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8750         attempts per process (connection).
8752 2012-04-09  Chong Yidong  <cyd@gnu.org>
8754         * eval.c (Fuser_variable_p, user_variable_p_eh)
8755         (lisp_indirect_variable): Functions deleted.
8756         (Fdefvar): Caller changed.
8758         * callint.c (Finteractive, Fcall_interactively):
8759         * minibuf.c (Fread_variable): Callers changed.
8761 2012-04-09  Eli Zaretskii  <eliz@gnu.org>
8763         * xdisp.c (set_cursor_from_row): If the display string appears in
8764         the buffer at position that is closer to point than the position
8765         after the display string, display the cursor on the first glyph of
8766         the display string.  Fixes cursor display when a 'display' text
8767         property immediately follows invisible text.  (Bug#11094)
8769 2012-04-09  Paul Eggert  <eggert@cs.ucla.edu>
8771         composite.c: use 'double' consistently
8772         * composite.c (get_composition_id): Use 'double' consistently
8773         instead of converting 'float' to 'double' and vice versa; this is
8774         easier to understand and avoids a GCC warning.
8776 2012-04-09  Glenn Morris  <rgm@gnu.org>
8778         * Makefile.in: Generate leim-list with bootstrap-emacs, in
8779         preparation for dumping it with emacs.  (Bug#4789)
8780         (leimdir): New variable.
8781         ($(leimdir)/leim-list.el): New rule.
8782         (emacs$(EXEEXT)): Depend on leim-list.el.
8784         * buffer.c (Qucs_set_table_for_input): Remove.  (Bug#9821)
8785         (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8786         (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8788 2012-04-08  Andreas Schwab  <schwab@linux-m68k.org>
8790         * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8791         proper alignment.
8793 2012-04-07  Juanma Barranquero  <lekktu@gmail.com>
8795         * xml.c (init_libxml2_functions) [WINDOWSNT]:
8796         Remove unused local variable.
8798 2012-04-07  Paul Eggert  <eggert@cs.ucla.edu>
8800         Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8801         * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8802         (mark_memory): Mark Lisp_Objects only if pointers might hide in
8803         objects, as mark_maybe_pointer will catch them otherwise.
8804         (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8805         * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8807 2012-04-07  Paul Eggert  <eggert@cs.ucla.edu>
8809         Fix typo that broke non-Windows builds.
8810         * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8812 2012-04-07  Eli Zaretskii  <eliz@gnu.org>
8814         Support building on MS-Windows with libxml2.
8816         * makefile.w32-in (OBJ2): Add xml.$(O).
8817         (GLOBAL_SOURCES): Add xml.c.
8818         ($(BLD)/xml.$(O)): New dependency list.
8820         * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8821         (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8822         (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8823         [!WINDOWSNT]: New macros.
8824         (init_libxml2_functions, libxml2_loaded_p): New functions.
8825         (parse_region): Call fn_xmlCheckVersion instead of using the macro
8826         LIBXML_TEST_VERSION.  Call libxml2 functions via the fn_* macros.
8827         (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8828         Calls xmlCleanupParser only if libxml2 was loaded (or statically
8829         linked in).
8830         (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8831         Call init_libxml2_functions before calling libxml2 functions.
8832         (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8834         * emacs.c: Don't include libxml/parser.h.
8835         (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8836         xmlCleanupParser directly.
8838         * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8840 2012-04-07  Eli Zaretskii  <eliz@gnu.org>
8842         * indent.c (Fvertical_motion): If there is a display string at
8843         point, use it.vpos to compute how many lines to backtrack after
8844         move_it_to point.  (Bug#11133)
8846 2012-04-06  Eli Zaretskii  <eliz@gnu.org>
8848         * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8849         * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8850         about subtle differences between FETCH_CHAR* and STRING_CHAR*
8851         macros related to unification of CJK characters.  For the details,
8852         see the discussion following the message here:
8853         http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8855 2012-04-04  Chong Yidong  <cyd@gnu.org>
8857         * keyboard.c (Vdelayed_warnings_list): Doc fix.
8859 2012-04-01  Eli Zaretskii  <eliz@gnu.org>
8861         * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8862         instead of alloca.  (Bug#11138)
8864 2012-04-01  Andreas Schwab  <schwab@linux-m68k.org>
8866         * w32menu.c (is_simple_dialog): Properly check lisp types.
8867         (Bug#11141)
8869 2012-03-31  Eli Zaretskii  <eliz@gnu.org>
8871         * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8872         position we get to after a call to move_it_to fails the
8873         IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8874         only if we wind up in a string from display property.  (Bug#11063)
8876         * window.c (Fdelete_other_windows_internal): Invalidate the row
8877         and column information about mouse highlight, so that redisplay
8878         restores it after reallocating the glyph matrices.  (Bug#7464)
8880         * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8881         string comes from a `display' text property, use the buffer
8882         position of that property as if we actually saw that position in
8883         the row's glyphs.
8884         (move_it_by_lines): Remove the assertion that
8885         "it->current_x == 0 && it->hpos == 0" which can be legitimately
8886         violated when there's a before-string at the beginning of a line.
8887         (Bug#11063)
8889 2012-03-30  Eli Zaretskii  <eliz@gnu.org>
8891         * xdisp.c (append_space_for_newline): If the default face was
8892         remapped, use the remapped face for the appended newline.
8893         (extend_face_to_end_of_line): Use the remapped default face for
8894         extending the face to the end of the line.
8895         (display_line): Call extend_face_to_end_of_line when the default
8896         face was remapped.  (Bug#11068)
8898 2012-03-29  Eli Zaretskii  <eliz@gnu.org>
8900         * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8902 2012-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
8904         * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8906 2012-03-27  Glenn Morris  <rgm@gnu.org>
8908         * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8909         Doc fixes.
8911 2012-03-26  Kenichi Handa  <handa@m17n.org>
8913         * dispextern.h (struct glyph): Fix previous change.  Change the
8914         bit length of glyphless.ch to 25 (Bug#11082).
8916 2012-03-26  Chong Yidong  <cyd@gnu.org>
8918         * keyboard.c (Vselection_inhibit_update_commands): New variable.
8919         (command_loop_1): Use it; inhibit selection update for
8920         handle-select-window too (Bug#8996).
8922 2012-03-25  Fabrice Popineau  <fabrice.popineau@supelec.fr>
8924         * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
8926 2012-03-25  Kenichi Handa  <handa@m17n.org>
8928         * dispextern.h (struct glyph): Change the bit length of
8929         glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8931 2012-03-24  Eli Zaretskii  <eliz@gnu.org>
8933         * s/ms-w32.h (tzname): Include time.h before redirecting to
8934         _tzname.  Fixes the MSVC build.  (Bug#9960)
8936 2012-03-24  Andreas Schwab  <schwab@linux-m68k.org>
8938         * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8939         characters.
8941         * xterm.c (XTread_socket): Only modify handling_signal if
8942         !SYNC_INPUT.  (Bug#11080)
8944 2012-03-23  Eli Zaretskii  <eliz@gnu.org>
8946         * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8947         FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES.  Prevents crashes
8948         when fetching a multibyte character consumes more bytes than
8949         CHAR_BYTES returns, due to unification of CJK characters in
8950         string_char.  (Bug#11073)
8952 2012-03-23  Troels Nielsen  <bn.troels@gmail.com>  (tiny change)
8954         * process.c (wait_reading_process_output): Handle pty disconnect
8955         by refraining from sending oneself a SIGCHLD (bug#10933).
8957 2012-03-22  Chong Yidong  <cyd@gnu.org>
8959         * dispextern.h (struct it): New member string_from_prefix_prop_p.
8961         * xdisp.c (push_prefix_prop): Rename from push_display_prop.
8962         Mark string as coming from a prefix property.
8963         (handle_face_prop): Use default face for prefix strings (Bug#4281).
8964         (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8966 2012-03-21  Chong Yidong  <cyd@gnu.org>
8968         * xfaces.c (Vface_remapping_alist): Doc fix.
8970 2012-03-20  Eli Zaretskii  <eliz@gnu.org>
8972         * w32proc.c (Fw32_set_console_codepage)
8973         (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8974         Doc fixes.
8976 2012-03-20  Chong Yidong  <cyd@gnu.org>
8978         * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8979         to reflect default non-nil value of redisplay-dont-pause.
8981 2012-03-19  Kenichi Handa  <handa@m17n.org>
8983         * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8984         it fit in a valid range (Bug#11003).
8986 2012-03-18  Eli Zaretskii  <eliz@gnu.org>
8988         * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8989         that is not from display property, accept the row as a "cursor
8990         row" if one of the string's character has a non-nil `cursor'
8991         property.  Fixes cursor positioning when there are newlines in
8992         overlay strings, e.g. in icomplete.el.  (Bug#11035)
8994 2012-03-12  Paul Eggert  <eggert@cs.ucla.edu>
8996         * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8998 2012-03-12  Chong Yidong  <cyd@gnu.org>
9000         * eval.c (inhibit_lisp_code): Rename from
9001         inhibit_window_configuration_change_hook; move from window.c.
9003         * xfns.c (unwind_create_frame_1, Fx_create_frame):
9004         * window.c (run_window_configuration_change_hook)
9005         (syms_of_window): Callers changed.
9007 2012-03-11  Chong Yidong  <cyd@gnu.org>
9009         * keymap.c (Fkey_description): Doc fix (Bug#9700).
9011         * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9013 2012-03-10  Chong Yidong  <cyd@gnu.org>
9015         * frame.c (other_visible_frames): Don't assume the selected frame
9016         is visible (Bug#10955).
9018 2012-03-09  Stefan Monnier  <monnier@iro.umontreal.ca>
9020         * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9022 2012-03-08  Jan Djärv  <jan.h.d@swipnet.se>
9024         * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9025         FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9026         zero (Bug#10954).
9028 2012-03-03  Glenn Morris  <rgm@gnu.org>
9030         * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
9032 2012-03-02  Eli Zaretskii  <eliz@gnu.org>
9034         * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
9035         position past the first glyph_row that ends at ZV.  (Bug#10902)
9036         (redisplay_window, next_element_from_string): Fix typos in
9037         comments.
9038         (redisplay_window): Pass to move_it_vertically the margin in
9039         pixels, not in screen lines.
9041 2012-03-02  Glenn Morris  <rgm@gnu.org>
9043         * buffer.c (buffer-list-update-hook): Doc fix.
9045 2012-02-29  Eli Zaretskii  <eliz@gnu.org>
9047         * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9048         push_it before setting up the iterator for the first overlay
9049         string, even if we have an empty string loaded.
9050         (next_overlay_string): If there's an empty string on the iterator
9051         stack, pop the stack.  (Bug#10903)
9053 2012-02-25  Paul Eggert  <eggert@cs.ucla.edu>
9055         Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9056         Suggested by Stefan Monnier in
9057         <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9058         * alloc.c (widen_to_Lisp_Object): New static function.
9059         (mark_memory): Also mark Lisp_Objects by fetching pointer words
9060         and widening them to Lisp_Objects.  This would work even if
9061         USE_LSB_TAG is defined and wide integers are used, which might
9062         happen in a future version of Emacs.
9064 2012-02-25  Chong Yidong  <cyd@gnu.org>
9066         * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9067         Doc fix.
9069         * xselect.c (Fx_selection_exists_p): Doc fix.
9070         (x_clipboard_manager_save_all): Print an informative message
9071         before saving to clipboard manager.
9073 2012-02-24  Chong Yidong  <cyd@gnu.org>
9075         * keyboard.c (process_special_events): Handle all X selection
9076         requests in kbd_buffer, not just the next one (Bug#8869).
9078 2012-02-23  Chong Yidong  <cyd@gnu.org>
9080         * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9081         call when setting menu-bar-lines and tool-bar-lines parameters.
9082         (unwind_create_frame_1): New helper function.
9084         * window.c (inhibit_window_configuration_change_hook): New var.
9085         (run_window_configuration_change_hook): Obey it.
9086         (syms_of_window): Initialize it.
9088 2012-02-22  Chong Yidong  <cyd@gnu.org>
9090         * xterm.c (x_draw_image_relief): Add missing type check for
9091         Vtool_bar_button_margin (Bug#10743).
9093 2012-02-21  Chong Yidong  <cyd@gnu.org>
9095         * fileio.c (Vfile_name_handler_alist): Doc fix.
9097         * buffer.c (Fget_file_buffer): Protect against invalid file
9098         handler return value.
9100 2012-02-20  Paul Eggert  <eggert@cs.ucla.edu>
9102         * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9103         when computing $valmask.
9105         Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9106         * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9107         (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9108         It's useless in that case, and it can cause problems on hosts
9109         that allocate halves of EMACS_INT values separately.
9110         Reported by Dan Horák.  Diagnosed by Andreas Schwab in
9111         <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9112         * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9113         UINTPTR_MAX >> VALBITS == 0.  This is required by the above change;
9114         it avoids undefined behavior on hosts where shifting right by more
9115         than the word width has undefined behavior.
9117 2012-02-19  Chong Yidong  <cyd@gnu.org>
9119         * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9120         (Funhandled_file_name_directory, Ffile_name_as_directory)
9121         (Fdirectory_file_name, Fexpand_file_name)
9122         (Fsubstitute_in_file_name): Protect against invalid file handler
9123         return values (Bug#10845).
9125 2012-02-18  Eli Zaretskii  <eliz@gnu.org>
9127         * .gdbinit (pitx): Fix incorrect references to fields of the
9128         iterator stack.
9130 2012-02-17  Chong Yidong  <cyd@gnu.org>
9132         * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9134 2012-02-15  Paul Eggert  <eggert@cs.ucla.edu>
9136         * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9137         <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9139 2012-02-15  Chong Yidong  <cyd@gnu.org>
9141         * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9142         marked as special.  Also, starting docstrings with * is obsolete.
9144 2012-02-13  Andreas Schwab  <schwab@linux-m68k.org>
9146         * gnutls.c (emacs_gnutls_write): Fix last change.
9148 2012-02-13  Lars Ingebrigtsen  <larsi@gnus.org>
9150         * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9151         send_process.
9153 2012-02-13  Stefan Monnier  <monnier@iro.umontreal.ca>
9155         * keymap.c (Fsingle_key_description): Handle char ranges.
9157 2012-02-12  Chong Yidong  <cyd@gnu.org>
9159         * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9160         as that creates a dangerous corner case.
9162         * window.c (Fdelete_window_internal): Invalidate the mouse
9163         highlight (Bug#9904).
9165 2012-02-12  Glenn Morris  <rgm@gnu.org>
9167         * xselect.c (Fx_own_selection_internal)
9168         (Fx_get_selection_internal, Fx_disown_selection_internal)
9169         (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9170         * nsselect.m (Fx_own_selection_internal)
9171         (Fx_disown_selection_internal, Fx_selection_exists_p)
9172         (Fx_selection_owner_p, Fx_get_selection_internal):
9173         Sync docs and argument specs with the xselect.c versions.
9175 2012-02-11  Lars Ingebrigtsen  <larsi@gnus.org>
9177         * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9179 2012-02-11  Eli Zaretskii  <eliz@gnu.org>
9181         * w32select.c (Fx_selection_exists_p): Sync doc string and
9182         argument list with xselect.c.  (Bug#10783)
9184         * w16select.c (Fx_selection_exists_p): Sync doc string and
9185         argument list with xselect.c.  (Bug#10783)
9187 2012-02-10  Glenn Morris  <rgm@gnu.org>
9189         * fns.c (Fsecure_hash): Doc fix.
9191 2012-02-09  Kenichi Handa  <handa@m17n.org>
9193         * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9195 2012-02-07  Chong Yidong  <cyd@gnu.org>
9197         * buffer.c (Fbuffer_local_variables)
9198         (buffer_lisp_local_variables): Handle unbound vars correctly;
9199         don't let Qunbound leak into Lisp.
9201 2012-02-07  Glenn Morris  <rgm@gnu.org>
9203         * image.c (Fimagemagick_types): Doc fix.
9205         * image.c (imagemagick-render-type): Change it from a lisp object
9206         to an integer.  Move the doc here from the lisp manual.
9207         Treat all values not equal to 0 the same.
9209 2012-02-06  Chong Yidong  <cyd@gnu.org>
9211         * doc.c (store_function_docstring): Avoid applying docstring of
9212         alias to base function (Bug#2603).
9214 2012-02-04  Andreas Schwab  <schwab@linux-m68k.org>
9216         * .gdbinit (pp1, pv1): Remove redundant defines.
9217         (pr): Use pp.
9219 2012-02-04  Chong Yidong  <cyd@gnu.org>
9221         * nsterm.m: Declare a global (Bug#10694).
9223 2012-02-04  Eli Zaretskii  <eliz@gnu.org>
9225         * w32.c (get_emacs_configuration_options):
9226         Include --enable-checking, if specified, in the return value.
9228 2012-02-04  Martin Rudalics  <rudalics@gmx.at>
9230         * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9231         after rounding frame sizes.  (Bug#9723)
9233 2012-02-04  Eli Zaretskii  <eliz@gnu.org>
9235         * keyboard.c (adjust_point_for_property): Don't position point
9236         before BEGV.  (Bug#10696)
9238 2012-02-03  Paul Eggert  <eggert@cs.ucla.edu>
9240         Handle overflow when computing char display width (Bug#9496).
9241         * character.c (char_width): Return EMACS_INT, not int.
9242         (char_width, c_string_width): Check for overflow when
9243         computing the width; this is possible now that individual
9244         characters can have unbounded width.  Problem introduced
9245         by merge from Emacs 23 on 2012-01-19.
9247 2012-02-02  Michael Albinus  <michael.albinus@gmx.de>
9249         * dbusbind.c (Fdbus_register_method): Mention the return value
9250         :ignore in the docstring.
9252 2012-02-02  Glenn Morris  <rgm@gnu.org>
9254         * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9256         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9257         Unconditionally set to t.  (Bug#10673)
9258         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9259         * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9260         * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9262 2012-02-02  Kenichi Handa  <handa@m17n.org>
9264         (x_produce_glyphs): Cancel previous change.  If cmp->glyph_len is
9265         0, do not call append_composite_glyph.
9267 2012-02-02  Kenichi Handa  <handa@m17n.org>
9269         * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9270         NULL (Bug#6988).
9271         (x_produce_glyphs): If the component of a composition is a null
9272         string, set it->pixel_width to 1 to avoid zero-width glyph.
9274 2012-02-01  Eli Zaretskii  <eliz@gnu.org>
9276         * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9277         first 2 arguments are identical.  This makes inserting large
9278         output from a subprocess an order of magnitude faster on
9279         MS-Windows, where all sbrk'ed memory is always contiguous.
9281 2012-01-31  Glenn Morris  <rgm@gnu.org>
9283         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9284         * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9285         * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9287 2012-01-29  Glenn Morris  <rgm@gnu.org>
9289         * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9291 2012-01-28  Samuel Thibault  <sthibault@debian.org>  (tiny change)
9293         * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9295 2012-01-28  Chong Yidong  <cyd@gnu.org>
9297         * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9299 2012-01-26  Chong Yidong  <cyd@gnu.org>
9301         * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9303         * search.c (Fsearch_forward, Fsearch_backward): Document negative
9304         repeat counts (Bug#10507).
9306 2012-01-26  Glenn Morris  <rgm@gnu.org>
9308         * lread.c (syms_of_lread): Doc fix.
9310 2012-01-25  HIROSHI OOTA  <nil@mad.dog.cx>  (tiny change)
9312         * coding.c (encode_designation_at_bol): Change return value to
9313         EMACS_INT.
9315 2012-01-25  Chong Yidong  <cyd@gnu.org>
9317         * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9319 2012-01-21  Chong Yidong  <cyd@gnu.org>
9321         * floatfns.c (Fcopysign): Make the second argument non-optional,
9322         since nil is not allowed anyway.
9324 2012-01-21  Andreas Schwab  <schwab@linux-m68k.org>
9326         * process.c (read_process_output): Use p instead of XPROCESS (proc).
9327         (send_process): Likewise.
9329 2012-01-19  Martin Rudalics  <rudalics@gmx.at>
9331         * window.c (save_window_save, Fcurrent_window_configuration)
9332         (Vwindow_persistent_parameters): Do not use Qstate.
9333         Rewrite doc-strings.
9335 2012-01-19  Kenichi Handa  <handa@m17n.org>
9337         * character.c (char_width): New function.
9338         (Fchar_width, c_string_width, lisp_string_width):
9339         Use char_width (Bug#9496).
9341 2012-01-16  Martin Rudalics  <rudalics@gmx.at>
9343         * window.c (Vwindow_persistent_parameters): New variable.
9344         (Fset_window_configuration, save_window_save): Handle persistent
9345         window parameters.
9347 2012-01-14  Eli Zaretskii  <eliz@gnu.org>
9349         * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9350         thrashing the stack of the thread.  (Bug#9087)
9352 2012-01-12  Paul Eggert  <eggert@cs.ucla.edu>
9354         * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9356 2012-01-11  Eli Zaretskii  <eliz@gnu.org>
9358         * xdisp.c (rows_from_pos_range): Handle the case where the
9359         highlight ends on a newline.  (Bug#10464)
9360         (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9361         he end column for display of highlight that ends on a newline
9362         before a R2L line.
9364 2012-01-11  Glenn Morris  <rgm@gnu.org>
9366         * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9367         from load-path also when installation-directory is nil.  (Bug#10208)
9369 2012-01-10  Glenn Morris  <rgm@gnu.org>
9371         * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9373         * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9374         Update template values to be closer to their typical values these days.
9376 2012-01-09  Eli Zaretskii  <eliz@gnu.org>
9378         * xdisp.c (rows_from_pos_range): Accept additional argument
9379         DISP_STRING, and accept any glyph in a row whose object is that
9380         string as eligible for mouse highlight.  Fixes mouse highlight of
9381         display strings from overlays.  (Bug#10464)
9383 2012-01-07  Paul Eggert  <eggert@cs.ucla.edu>
9385         emacs: fix an auto-save permissions race condition (Bug#10400)
9386         * fileio.c (auto_saving_dir_umask): New static var.
9387         (Fmake_directory_internal): Use it.
9388         (do_auto_save_make_dir): Set it, instead of invoking chmod after
9389         creating the directory.  The old code temporarily assigns
9390         too-generous permissions to the directory.
9391         (do_auto_save_eh): Clear it.
9392         (Fdo_auto_save): Catch all errors, not just file errors, so
9393         that the var is always cleared.
9395 2012-01-07  Eli Zaretskii  <eliz@gnu.org>
9397         * search.c (scan_buffer): Pass character positions to
9398         know_region_cache, not byte positions.  (Bug#6540)
9400 2012-01-07  LynX  <_LynX@bk.ru>  (tiny change)
9402         * w32.c (sys_rename): Report EXDEV when rename of a directory
9403         fails because the target is on another logical disk.  (Bug#10284)
9405 2012-01-07  David Benjamin  <davidben@mit.edu>  (tiny change)
9407         * xterm.c (x_embed_request_focus): New function.
9409         * xterm.h: Add prototype.
9411         * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9413 2012-01-05  Glenn Morris  <rgm@gnu.org>
9415         * emacs.c (emacs_copyright): Update short copyright year to 2012.
9417 2012-01-01  Eli Zaretskii  <eliz@gnu.org>
9419         * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9420         Load gnutls_transport_set_lowat only if GnuTLS version is below
9421         2.11.1.
9422         (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9423         GnuTLS versions below 2.11.1.
9425 2011-12-31  Antoine Levitt  <antoine.levitt@gmail.com>
9427         * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9428         to the doc string advising against its use for altering the way
9429         windows are scrolled.
9431 2011-12-28  Kenichi Handa  <handa@m17n.org>
9433         * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9434         coding-system ASCII compatible only when it does not produce BOM
9435         on encoding (Bug#10383).
9437 2011-12-26  Jan Djärv  <jan.h.d@swipnet.se>
9439         * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9440         can scroll.
9441         (create_and_show_popup_menu): Always use menu_position_func for
9442         Gtk3 (Bug#10361).
9444 2011-12-24  Andreas Schwab  <schwab@linux-m68k.org>
9446         * callint.c (Fcall_interactively): Don't truncate prompt string.
9448 2011-12-23  Eli Zaretskii  <eliz@gnu.org>
9450         * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9451         property that ends at ZV, so that the bidi iteration could be
9452         resumed from there (after widening).  (Bug#10360)
9454 2011-12-22  Jan Djärv  <jan.h.d@swipnet.se>
9456         * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9458 2011-12-21  Jan Djärv  <jan.h.d@swipnet.se>
9460         * nsterm.m (x_free_frame_resources):
9461         Release f->output_data.ns->miniimage.
9462         (ns_index_color): Fix indentation.  Do not retain
9463         color_table->colors[i].
9465         * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9466         before returning.
9468         * nsfns.m (x_set_background_color): Assign return value from
9469         ns_index_color to face-background instead of NSColor*.
9470         (ns_implicitly_set_icon_type): Fix indentation.
9471         Change assignment in for loop to comparison.
9473         * emacs.c (ns_pool): New variable.
9474         (main): Assign ns_pool.
9475         (Fkill_emacs): Call ns_release_autorelease_pool.
9477         * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9478         autorelease fdesc, release fdAttrs and tdict.
9479         (ns_get_covering_families): Release charset.
9480         (ns_findfonts): Release NSFontDescriptor created with new.
9481         (ns_uni_to_glyphs): Fix indentation.
9482         (setString): Release attrStr before assigning new value.
9484 2011-12-18  Jan Djärv  <jan.h.d@swipnet.se>
9486         * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9487         and NS_IMPL_COCOA.
9488         (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9489         (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9491 2011-12-18  David Reitter  <reitter@cmu.edu>
9493         * nsterm.m (ns_term_init): Subscribe for notifications
9494         NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9495         to method trackingNotification in EmacsMenu.
9497         * nsmenu.m (trackingMenu): New variable.
9498         (trackingNotification): New method (from Aquamacs).
9499         (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
9500         from Aquamacs (Bug#7030).
9502 2011-12-18  Jan Djärv  <jan.h.d@swipnet.se>
9504         * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9505         (symbol_to_nsstring): Fix indentation.
9506         (ns_symbol_to_pb): New function.
9507         (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9508         (Fns_rotate_cut_buffers_internal): Remove.
9509         (Fns_store_selection_internal): Rename from
9510         Fns_store_cut_buffer_internal.
9511         (ns_get_foreign_selection, Fx_own_selection_internal)
9512         (Fx_disown_selection_internal, Fx_selection_exists_p)
9513         (Fns_get_selection_internal, Fns_store_selection_internal):
9514         Use ns_symbol_to_pb and check if return value is nil.
9515         (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT.  Remove defsubr
9516         Sns_rotate_cut_buffers_internal.  Sns_get_cut_buffer_internal
9517         renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9518         renamed to Sns_store_selection_internal.
9519         (ns_handle_selection_request): Move code to Fx_own_selection_internal
9520         and remove this function.
9521         (ns_handle_selection_clear): Remove, never used.
9522         (Fx_own_selection_internal): Move code from ns_handle_selection_request
9523         here.
9525 2011-12-17  Ken Brown  <kbrown@cornell.edu>
9527         * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9528         GID is unknown (Bug#10257).
9530 2011-12-17  Paul Eggert  <eggert@cs.ucla.edu>
9532         * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9533         (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9534         which caused a build failure on GNU/Linux IA-64.  This problem was
9535         introduced by my 2011-10-07 patch.
9537 2011-12-15  Juri Linkov  <juri@jurta.org>
9539         * image.c (imagemagick_error): New function.  (Bug#10112)
9540         (imagemagick_load_image): Comment out `MagickSetResolution' call.
9541         Use `imagemagick_error' where ImageMagick functions return
9542         `MagickFalse'.
9543         (Fimagemagick_types): Add `Fnreverse' to return the list in the
9544         proper order.
9546 2011-12-15  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
9548         * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9549         fill background (Bug#8992).
9551 2011-12-13  Martin Rudalics  <rudalics@gmx.at>
9553         * window.c (Vwindow_combination_resize)
9554         (Vwindow_combination_limit): Use t instead of non-nil in
9555         doc-strings.
9556         (Vrecenter_redisplay): Add first sentence of doc-string on
9557         separate line.
9558         (Frecenter): Fix doc-string typo.
9560 2011-12-11  Kenichi Handa  <handa@m17n.org>
9562         * coding.c (Funencodable_char_position): Pay attention to the
9563         buffer text relocation (Bug#9389).
9565 2011-12-10  Jan Djärv  <jan.h.d@swipnet.se>
9567         * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9568         gtk_init (Bug#10100).
9570 2011-12-10  Eli Zaretskii  <eliz@gnu.org>
9572         * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9573         IT->string is nil.  (Bug#10263)
9575 2011-12-10  Jan Djärv  <jan.h.d@swipnet.se>
9577         * nsterm.h (x_free_frame_resources): Declare.
9579         * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9580         (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9582         * nsterm.h (ns_get_defaults_value): Declare.
9584         * nsterm.m (ns_default): Call ns_get_defaults_value.
9586 2011-12-09  Eli Zaretskii  <eliz@gnu.org>
9588         * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9589         (Bug#10170)
9591 2011-12-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
9593         * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9594         that where the value of an _OBJC_* symbol points to is in the .bss
9595         section (Bug#10240).
9597 2011-12-08  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
9599         * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
9600         after the loop to call ccl_driver at least once (Bug#8619).
9602 2011-12-08  Kenichi Handa  <handa@m17n.org>
9604         * ftfont.c (get_adstyle_property): Fix previous change
9605         (Bug#10233).
9607 2011-12-07  Juanma Barranquero  <lekktu@gmail.com>
9609         * w32.c (init_environment): If no_site_lisp, remove site-lisp
9610         dirs from the default value of EMACSLOADPATH (bug#10208).
9612 2011-12-07  Glenn Morris  <rgm@gnu.org>
9614         * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9615         installation and source directories as well.  (Bug#10208)
9617 2011-12-06  Chong Yidong  <cyd@gnu.org>
9619         * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9621 2011-12-06  Glenn Morris  <rgm@gnu.org>
9623         * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9624         as an error, not just -1.  (Bug#10217)
9626 2011-12-05  Chong Yidong  <cyd@gnu.org>
9628         * keyboard.c (process_special_events): New function.
9629         (swallow_events, Finput_pending_p): Use it (Bug#10195).
9631 2011-12-05  Paul Eggert  <eggert@cs.ucla.edu>
9633         * coding.c (encode_designation_at_bol): Don't use uninitialized
9634         local variable (Bug#9318).
9636 2011-12-05  Kenichi Handa  <handa@m17n.org>
9638         * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9639         return Qnil (Bug#8046, Bug#10193).
9641 2011-12-05  Kenichi Handa  <handa@m17n.org>
9643         * coding.c (encode_designation_at_bol): New args charbuf_end and
9644         dst.  Return the number of produced bytes.  Callers changed.
9645         (coding_set_source): Return how many bytes coding->source was
9646         relocated.
9647         (coding_set_destination): Return how many bytes
9648         coding->destination was relocated.
9649         (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
9650         (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
9652 2011-12-05  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
9654         * coding.c (CODING_CHAR_CHARSET_P): New macro.
9655         (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9656         macro (Bug#9318).
9658 2011-12-05  Andreas Schwab  <schwab@linux-m68k.org>
9660         The following changes are to fix Bug#9318.
9662         * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
9663         (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9664         (encode_coding_iso_2022, encode_coding_sjis)
9665         (encode_coding_big5, encode_coding_charset): Use the above macros.
9667 2011-12-05  Juanma Barranquero  <lekktu@gmail.com>
9669         * lisp.h (process_quit_flag): Fix external declaration.
9671 2011-12-04  Stefan Monnier  <monnier@iro.umontreal.ca>
9673         Don't macro-inline non-performance-critical code.
9674         * eval.c (process_quit_flag): New function.
9675         * lisp.h (QUIT): Use it.
9677 2011-12-04  Jan Djärv  <jan.h.d@swipnet.se>
9679         * nsfns.m (get_geometry_from_preferences): New function.
9680         (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9682 2011-12-04  Andreas Schwab  <schwab@linux-m68k.org>
9684         * emacs.c (Qkill_emacs): Define.
9685         (syms_of_emacs): Initialize it.
9686         * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9687         Qquit_flag to `kill-emacs' instead.
9688         (quit_throw_to_read_char): Add parameter `from_signal'.
9689         All callers changed.  Call Fkill_emacs if requested and safe.
9690         * lisp.h (QUIT): Call Fkill_emacs if requested.
9692 2011-12-03  Jan Djärv  <jan.h.d@swipnet.se>
9694         * widget.c (update_wm_hints): Return if wmshell is null.
9695         (widget_update_wm_size_hints): New function.
9697         * widget.h (widget_update_wm_size_hints): Declare.
9699         * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9700         widget_update_wm_size_hints (Bug#10104).
9702 2011-12-03  Eli Zaretskii  <eliz@gnu.org>
9704         * xdisp.c (handle_invisible_prop): If the invisible text ends just
9705         before a newline, prepare the bidi iterator for consuming the
9706         newline, and keep the current paragraph direction.  (Bug#10183)
9707         (redisplay_window): Don't let `margin' become negative.  (Bug#10192)
9709 2011-12-02  Juri Linkov  <juri@jurta.org>
9711         * search.c (Fword_search_regexp): New Lisp function created from
9712         `wordify'.  Change type of arg `lax' from `int' to `Lisp_Object'.
9713         (Fword_search_backward, Fword_search_forward)
9714         (Fword_search_backward_lax, Fword_search_forward_lax):
9715         Use `Fword_search_regexp' instead of `wordify'.  Doc fix.
9716         (syms_of_search): Define `Sword_search_regexp'.  (Bug#10145)
9718 2011-12-01  Stefan Monnier  <monnier@iro.umontreal.ca>
9720         * fileio.c (Finsert_file_contents): Move after-change-function call
9721         to before the "handled:" label, since all "goto handled" appear in
9722         cases where the *-change-functions have already been properly called
9723         (bug#10117).
9725 2011-12-01  Andreas Schwab  <schwab@linux-m68k.org>
9727         * keyboard.c (interrupt_signal): Don't call kill-emacs when
9728         waiting for input.  (Bug#10169)
9730 2011-11-30  Eli Zaretskii  <eliz@gnu.org>
9732         * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9733         verifies glyph row's hash code--we have just reallocated the
9734         glyphs, so their contents can be complete garbage.  (Bug#10164)
9736 2011-11-30  Juanma Barranquero  <lekktu@gmail.com>
9738         * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9740 2011-11-30  Eli Zaretskii  <eliz@gnu.org>
9742         * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9743         attributes are tested _before_ calling verify_row_hash, to protect
9744         against GCC re-ordering of the tests.  (Bug#10164)
9746 2011-11-29  Jan Djärv  <jan.h.d@swipnet.se>
9748         * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9750         * xterm.c (handle_one_xevent): Only set async_visible and friends
9751         if net_wm_state_hidden_seen is non-zero (Bug#10002)
9752         (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
9753         _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9755 2011-11-28  Paul Eggert  <eggert@cs.ucla.edu>
9757         Remove GCPRO-related macros that exist only to avoid shadowing locals.
9758         * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9759         (GCPRO6_VAR, UNGCPRO_VAR): Remove.  See
9760         <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9761         All uses changed to use GCPRO1 etc.
9762         (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9763         Revert to old implementation (i.e., before 2011-03-11).
9765 2011-11-28  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
9767         * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9768         of scroll runs so as to avoid assigning disabled bogus rows and
9769         unnecessary graphics copy operations.
9771 2011-11-27  Eli Zaretskii  <eliz@gnu.org>
9773         * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9774         (snprintf) [_MSC_VER]: Redirect to _snprintf.
9775         (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9776         (malloc, free, realloc, calloc): Redirect to e_* only when
9777         compiling Emacs.
9779         * lisp.h (GCTYPEBITS): Move before first use.
9780         (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9781         (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9782         this macro definition.
9784         * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9785         _MSC_VER.
9787 2011-11-27  Jan Djärv  <jan.h.d@swipnet.se>
9789         * gtkutil.c (xg_create_frame_widgets):
9790         Call gtk_window_set_has_resize_grip (FALSE) if that function is
9791         present with Gtk+ 2.0.
9793 2011-11-26  Paul Eggert  <eggert@cs.ucla.edu>
9795         * fileio.c (Finsert_file_contents): Undo previous change; see
9796         <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9798 2011-11-26  Paul Eggert  <eggert@cs.ucla.edu>
9800         Rename locals to avoid shadowing.
9801         * fileio.c (Finsert_file_contents):
9802         Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9803         * process.c (wait_reading_process_output):
9804         Rename inner 'proc' to 'p' to avoid shadowing.
9805         Indent for consistency with usual Emacs style.
9807 2011-11-25  Eli Zaretskii  <eliz@gnu.org>
9809         * xdisp.c (redisplay_window): If cursor row is not fully visible
9810         after recentering, and scroll-conservatively is set to a large
9811         number, scroll window by a few more lines to make the cursor fully
9812         visible and out of scroll-margin.  (Bug#10105)
9813         (start_display): Don't move to the next line if the display should
9814         start at a newline that is part of a display vector or an overlay
9815         string.  (Bug#10119)
9817 2011-11-24  Juri Linkov  <juri@jurta.org>
9819         * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9820         after the `MagickPingImage' call.  (Bug#10112)
9822 2011-11-23  Chong Yidong  <cyd@gnu.org>
9824         * window.c (Fcoordinates_in_window_p): Accept only live windows.
9826 2011-11-23  Martin Rudalics  <rudalics@gmx.at>
9828         * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9829         making another buffer current.  (Bug#10114)
9831 2011-11-23  Glenn Morris  <rgm@gnu.org>
9833         * font.c (font_find_for_lface) [HAVE_NS]: Ignore case.  (Bug#2526)
9835 2011-11-23  Chong Yidong  <cyd@gnu.org>
9837         * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9838         using it (Bug#5984).
9840 2011-11-22  Eli Zaretskii  <eliz@gnu.org>
9842         * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9843         and header-lines, as they don't have one computed for them.
9844         (Bug#10098)
9846         * .gdbinit (prow): Make displayed values more self-explaining.
9847         Add row's hash code.
9849 2011-11-21  Lars Magne Ingebrigtsen  <larsi@gnus.org>
9851         * process.c (wait_reading_process_output): Fix asynchrounous
9852         GnuTLS socket handling on some versions of the GnuTLS library.
9853         (wait_reading_process_output): Add comment and URL.
9855 2011-11-21  Jan Djärv  <jan.h.d@swipnet.se>
9857         * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9859 2011-11-21  Chong Yidong  <cyd@gnu.org>
9861         * window.c (Fnext_window, Fprevious_window): Doc fix.
9863 2011-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
9865         * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9867 2011-11-20  Juanma Barranquero  <lekktu@gmail.com>
9869         * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9871 2011-11-20  Martin Rudalics  <rudalics@gmx.at>
9873         * window.c (Fset_window_combination_limit): Rename argument
9874         STATUS to LIMIT.
9875         (Vwindow_combination_limit): Remove "status" from doc-string.
9877 2011-11-20  Andreas Schwab  <schwab@linux-m68k.org>
9879         * m/ibms390.h: Remove.
9880         * m/ibms390x.h: Don't include "ibms390.h".
9882 2011-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
9884         * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9885         Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9887 2011-11-20  Juanma Barranquero  <lekktu@gmail.com>
9889         * casetab.c (Fset_case_table):
9890         * charset.c (Fcharset_after): Fix typos.
9892 2011-11-20  Paul Eggert  <eggert@cs.ucla.edu>
9894         Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9895         Otherwise, valgrind does not work on some platforms.
9896         Problem reported by Andreas Schwab in
9897         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9898         * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9899         is set, removing the need for VIRT_ADDRESS_VARIES.
9900         (PURE_P): Use a more-efficient implementation that needs just one
9901         comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9902         number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9903         to 4 (xorl, subq, cmpq, setbe).
9904         * alloc.c (pure): Always extern now, since that's the
9905         VIRT_ADDR_VARIES behavior.
9906         (PURE_POINTER_P): Use a single comparison, not two, for
9907         consistency with the new puresize.h.
9908         * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9909         * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9910         Remove VIRT_ADDR_VARIES no longer needed.
9912 2011-11-19  Eli Zaretskii  <eliz@gnu.org>
9914         * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9915         (erase_phys_cursor, update_window_cursor, show_mouse_face)
9916         (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9917         behave as if the cursor position were at the window margin.
9919         * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9920         and the cursor position is out of bounds, behave as if the cursor
9921         position were at the window margin.  (Bug#10075)
9923 2011-11-18  Chong Yidong  <cyd@gnu.org>
9925         * window.c (Fwindow_combination_limit): Make first argument
9926         non-optional, since it is meaningless for live windows like the
9927         selected window.
9929 2011-11-18  Dmitry Antipov  <dmantipov@yandex.ru>
9931         * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9933 2011-11-18  Stefan Monnier  <monnier@iro.umontreal.ca>
9935         * intervals.c: Fix grafting over the whole buffer (bug#10071).
9936         (graft_intervals_into_buffer): Simplify.
9938 2011-11-18  Eli Zaretskii  <eliz@gnu.org>
9940         * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9941         hash values of the two rows.
9942         (copy_row_except_pointers): Preserve the used[] arrays and the
9943         hash values of the two rows.  (Bug#10035)
9944         (add_row_entry): Add xassert to verify that ROW's hash code is valid.
9946         * xdisp.c (row_hash): New function, body extracted from
9947         compute_line_metrics.
9948         (compute_line_metrics): Call row_hash, instead of computing the
9949         hash code inline.
9951         * dispnew.c (verify_row_hash): Call row_hash for computing the
9952         hash code of a row, instead of duplicating code from xdisp.c.
9954         * dispextern.h (row_hash): Add prototype.
9956 2011-11-18  Tassilo Horn  <tassilo@member.fsf.org>
9958         * frame.c (delete_frame): Don't delete the terminal when the last
9959         X frame is closed if emacs is built with GTK toolkit.
9961 2011-11-17  Juanma Barranquero  <lekktu@gmail.com>
9963         * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9965 2011-11-17  Martin Rudalics  <rudalics@gmx.at>
9967         * window.c (Vwindow_splits): Rename to
9968         Vwindow_combination_resize.  Suggested by Juri Linkov.
9969         (Fsplit_window_internal): Use Vwindow_combination_resize instead
9970         of Vwindow_splits.
9972 2011-11-16  Juanma Barranquero  <lekktu@gmail.com>
9974         * nsfns.m (Fns_font_name):
9975         * window.c (syms_of_window) <window-combination-limit>: Fix typos.
9977 2011-11-16  Martin Rudalics  <rudalics@gmx.at>
9979         * window.h (window): Rename slot "nest" to "combination_limit".
9980         * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9981         (Fset_window_nest): Rename to Fset_window_combination_limit.
9982         (Vwindow_nest): Rename to Vwindow_combination_limit.
9983         (recombine_windows, make_parent_window, make_window)
9984         (Fsplit_window_internal, saved_window)
9985         (Fset_window_configuration, save_window_save): Rename all
9986         occurrences of window_nest to window_combination_limit.
9988 2011-11-15  Juanma Barranquero  <lekktu@gmail.com>
9990         * image.c (imagemagick_load_image): Fix typo.
9992 2011-11-14  Eli Zaretskii  <eliz@gnu.org>
9994         * xdisp.c (display_line): Move the call to
9995         highlight_trailing_whitespace before the call to
9996         compute_line_metrics, since the latter needs to see the final
9997         faces of all the glyphs to compute ROW's hash value.
9998         Fixes assertion violations in row_equal_p.  (Bug#10035)
10000 2011-11-14  Juanma Barranquero  <lekktu@gmail.com>
10002         * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
10003         just return (bug#10044).
10005 2011-11-12  Eli Zaretskii  <eliz@gnu.org>
10007         * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
10008         with user-defined heap size.  Bump the default size of the temacs
10009         heap to 27MB, to avoid memory warning when running temacs.
10010         ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10012         * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10013         current_matrix and desired_matrix.  (Bug#9990)
10014         (verify_row_hash) [XASSERTS]: New function.
10015         (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10016         that the hash value of glyph rows is correct.
10018 2011-11-12  Martin Rudalics  <rudalics@gmx.at>
10020         * window.h (window): Remove splits slot.
10021         * window.c (Fwindow_splits, Fset_window_splits): Remove.
10022         (Fdelete_other_windows_internal, make_parent_window)
10023         (make_window, Fsplit_window_internal, Fdelete_window_internal)
10024         (Fset_window_configuration, save_window_save): Don't deal with
10025         split status of windows.
10026         (saved_window): Remove splits slot.
10027         (Vwindow_splits): Rewrite doc-string.
10029 2011-11-11  Jan Djärv  <jan.h.d@swipnet.se>
10031         * xfns.c (unwind_create_frame):
10032         * nsfns.m (unwind_create_frame):
10033         * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10034         Vframe_list (Bug#9999).
10036 2011-11-11  Dmitry Antipov  <dmantipov@yandex.ru>
10038         * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
10040 2011-11-11  Kenichi Handa  <handa@m17n.org>
10042         * callproc.c (Fcall_process): Set the member dst_multibyte of
10043         process_coding.
10045 2011-11-11  Johan Bockgård  <bojohan@gnu.org>
10047         * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10048         avoid a crash (bug#9496).
10050 2011-11-09  Chong Yidong  <cyd@gnu.org>
10052         * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10053         (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10055 2011-11-08  Paul Eggert  <eggert@cs.ucla.edu>
10057         * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10059 2011-11-08  Paul Eggert  <eggert@cs.ucla.edu>
10061         Avoid some portability problems by eschewing 'extern inline' functions.
10062         The trivial performance wins aren't worth the portability hassles; see
10063         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10064         et seq.
10065         * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10066         (window_box_width, window_box_left, window_box_left_offset)
10067         (window_box_right, window_box_right_offset): Undo previous change,
10068         by removing the "extern"s.
10069         * intervals.c (adjust_intervals_for_insertion)
10070         (adjust_intervals_for_deletion): Undo previous change,
10071         making these static again.
10072         (offset_intervals, temp_set_point_both, temp_set_point)
10073         (copy_intervals_to_string): No longer inline.
10074         * xdisp.c (window_text_bottom_y, window_box_width)
10075         (window_box_height, window_box_left_offset)
10076         (window_box_right_offset, window_box_left, window_box_right)
10077         (window_box): No longer inline.
10079 2011-11-08  Chong Yidong  <cyd@gnu.org>
10081         * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
10082         (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10083         Signal an error if not a live window.
10084         (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10085         (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10087 2011-11-07  Juanma Barranquero  <lekktu@gmail.com>
10089         * lisp.h (syms_of_abbrev): Remove declaration.
10090         Reported by CHENG Gao <chenggao@royau.me>.
10092 2011-11-07  Eli Zaretskii  <eliz@gnu.org>
10094         * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10095         if Vpurify_flag is non-nil.  Fixes a crash when running w32 build
10096         of temacs in GUI mode.
10098 2011-11-07  Martin Rudalics  <rudalics@gmx.at>
10100         * window.h: Declare delete_all_child_windows instead of
10101         delete_all_subwindows.
10102         * window.c (Fwindow_nest, Fset_window_nest)
10103         (Fset_window_new_total, Fset_window_new_normal)
10104         (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10105         (delete_all_subwindows): Rename to delete_all_child_windows.
10106         (Fdelete_other_windows_internal, Fset_window_configuration):
10107         Call delete_all_child_windows instead of delete_all_subwindows.
10108         * frame.c (delete_frame): Call delete_all_child_windows instead
10109         of delete_all_subwindows.
10111 2011-11-07  Paul Eggert  <eggert@cs.ucla.edu>
10113         * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10114         This is also needed for porting to any host where GC_MARK_STACK is
10115         not GC_MAKE_GCPROS_NOOPS.
10116         (which_symbols): Use it.
10118 2011-11-07  Kenichi Handa  <handa@m17n.org>
10120         * coding.c (coding_set_destination): Check coding->src_pos only
10121         when coding->src_object is a buffer (bug#9910).
10123         * process.c (send_process): Set the member src_multibyte of coding
10124         to 0 (bug#9911) when sending a unibyte text.
10126         * callproc.c (Fcall_process): Set the member src_multibyte of
10127         process_coding to 0 (bug#9912).
10129 2011-11-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
10131         * xmenu.c (cleanup_widget_value_tree): New function.
10132         (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10133         calling free_menubar_widget_value_tree directly (Bug#9830).
10135 2011-11-06  Paul Eggert  <eggert@cs.ucla.edu>
10137         Fix some portability problems with 'inline'.
10138         * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10139         (window_box_width, window_box_left, window_box_left_offset)
10140         (window_box_right, window_box_right_offset): Declare extern.
10141         Otherwise, these inline functions do not conform to C99 and
10142         are miscompiled by Microsoft compilers.  Reported by Eli Zaretskii in
10143         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10144         * intervals.c (adjust_intervals_for_insertion)
10145         (adjust_intervals_for_deletion): Now extern, because otherwise the
10146         extern inline functions 'offset_intervals' couldn't refer to it.
10147         (static_offset_intervals): Remove.
10148         (offset_intervals): Rewrite using the old contents of
10149         static_offset_intervals.  The old version didn't conform to C99
10150         because an extern inline function contained a reference to an
10151         identifier with static linkage.
10153 2011-11-06  Andreas Schwab  <schwab@linux-m68k.org>
10155         * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10156         GC.
10158 2011-11-06  Eli Zaretskii  <eliz@gnu.org>
10160         * xdisp.c (init_iterator, reseat_to_string): Don't set the
10161         iterator's bidi_p flag if Vpurify_flag is non-nil.  (Bug#9963)
10162         (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10163         return Qleft_to_right.
10165 2011-11-06  Chong Yidong  <cyd@gnu.org>
10167         * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10168         (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10169         (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10170         (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10171         (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10172         (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10173         (Fwindow_vscroll): Doc fix.
10174         (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10175         argument, since it makes no sense to pass a live window and for
10176         consistency with window-child.
10178 2011-11-05  Christoph Scholtes  <cschol2112@googlemail.com>
10180         * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10181         support MSVC.
10183 2011-11-05  Jason Rumney  <jasonr@gnu.org>
10185         * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10186         (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10187         fonts (Bug#6029).
10188         (add_font_entity_to_list): Fix logic errors in mixed boolean and
10189         bitwise arithmetic preventing use of unicode-sip and non-truetype
10190         opentype fonts.
10192 2011-11-05  Eli Zaretskii  <eliz@gnu.org>
10194         * s/ms-w32.h (fstat, stat, utime): Move redirections to
10195         "emacs"-only part.
10197         * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10198         initialization code to keep similarity to xfns.c after changes
10199         from 2011-11-05.
10201 2011-11-05  Jan Djärv  <jan.h.d@swipnet.se>
10203         * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10204         (unwind_create_frame): New function (Bug#9943).
10205         (Fx_create_frame): Restructure code to be more similar to the one in
10206         xfns.c.  Call record_unwind_protect with unwind_create_frame (Bug#9943).
10207         Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10208         Move terminal->reference_count++ just before making the frame official
10209         (Bug#9943).
10211         * nsterm.m (x_free_frame_resources): New function.
10212         (x_destroy_window): Move code to x_free_frame_resources.
10214         * xfns.c (unwind_create_frame): Fix comment.
10215         (Fx_create_frame, x_create_tip_frame):
10216         Move terminal->reference_count++ just before making the frame
10217         official.  Move initialization of image_cache_refcount and
10218         dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10220 2011-11-05  Eli Zaretskii  <eliz@gnu.org>
10222         Support MSVC build with newer versions of Visual Studio.
10223         * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10224         Nmake barfs on that.  Use $(OBJ*_c) variables instead, defined on
10225         nt/gmake.defs.
10227         * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10228         which are not supported by MSVC.
10229         (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10230         (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10231         bitfields.
10232         (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10233         types in bitfields.
10234         (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10236         * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10238 2011-11-05  Fabrice Popineau  <fabrice.popineau@supelec.fr>  (tiny change)
10240         Support MSVC build with newer versions of Visual Studio.
10241         * w32.c: Don't include w32api.h for MSVC.
10242         (init_environment) [_MSC_VER]: Call sys_access, not _access.
10244         * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10245         [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10246         (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10247         (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10248         e_* cousins.
10249         (alloca) [_MSC_VER]: Define to _alloca.
10251         * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10253         * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10255 2011-11-04  Eli Zaretskii  <eliz@gnu.org>
10257         * xdisp.c (note_mouse_highlight): If either of
10258         previous/next-single-property-change returns nil, treat that as
10259         the beginning or the end of the buffer.  (Bug#9955)
10261 2011-11-04  Jan Djärv  <jan.h.d@swipnet.se>
10263         * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
10264         label is not null (Bug#9951).
10265         (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10266         may be NULL.
10268 2011-11-04  Eli Zaretskii  <eliz@gnu.org>
10270         * window.c (Fwindow_body_size): Mention in the doc string that the
10271         return value is in frame's canonical units.  (Bug#9949)
10273 2011-11-03  Eli Zaretskii  <eliz@gnu.org>
10275         * xdisp.c (note_mouse_highlight): Initialize `area'.  (Bug#9947)
10277         * w32fns.c (unwind_create_frame): If needed, free the glyph
10278         matrices of the partially constructed frame.  (Bug#9943)
10279         * xfns.c (unwind_create_frame): Likewise.
10281 2011-11-01  Eli Zaretskii  <eliz@gnu.org>
10283         * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10284         Don't stop backward scan on the continuation glyph, even though
10285         its CHARPOS is positive.
10286         (mouse_face_from_buffer_pos, note_mouse_highlight):
10287         Rename cover_string to disp_string.
10289 2011-11-01  Martin Rudalics  <rudalics@gmx.at>
10291         * window.c (temp_output_buffer_show): Don't use
10292         Vtemp_buffer_show_specifiers.
10293         (Vtemp_buffer_show_specifiers): Remove unused variable.
10295 2011-10-30  Eli Zaretskii  <eliz@gnu.org>
10297         * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10298         past the beginning of the current glyph matrix.
10300 2011-10-30  Adam Sjøgren  <asjo@koldfront.dk>  (tiny change)
10302         * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10303         (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10304         HAVE_GTK3 (Bug#9869).
10306         * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10307         type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10309         * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10311         * xterm.c: Declare x_handle_net_wm_state to return int.
10312         (handle_one_xevent): Check if we are iconified but don't have
10313         _NET_WM_STATE_HIDDEN.  If do, treat as deiconify (Bug#9893).
10314         (get_current_wm_state): Return non-zero if not hidden,
10315         check for _NET_WM_STATE_HIDDEN (Bug#9893).
10316         (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10317         (x_handle_net_wm_state): Return what get_current_wm_state returns.
10318         (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10320 2011-10-29  Paul Eggert  <eggert@cs.ucla.edu>
10322         * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10323         so that this new function doesn't get optimized away by a
10324         whole-program optimizer.  Make the 2nd arg EMACS_INT, not int.
10326 2011-10-29  Andreas Schwab  <schwab@linux-m68k.org>
10328         * frame.h (MOUSE_HL_INFO): Remove excess parens.
10330 2011-10-29  Eli Zaretskii  <eliz@gnu.org>
10332         Fix the `xbytecode' command.
10333         * .gdbinit (xprintbytestr): New command.
10334         (xwhichsymbols): Rename from `which'; all callers changed.
10335         (xbytecode): Print the byte-code string as well.
10337 2011-10-29  Kim Storm  <storm@cua.dk>
10339         * alloc.c (which_symbols): New function.
10341 2011-10-29  Andreas Schwab  <schwab@linux-m68k.org>
10343         * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10344         line.  (Bug#9903)
10346 2011-10-29  Glenn Morris  <rgm@gnu.org>
10348         * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10349         Not clear what it was for, and it causes various bugs.  (Bug#9839)
10351 2011-10-28  Eli Zaretskii  <eliz@gnu.org>
10353         * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10354         possible random value that matches one of those tested as
10355         condition to clear the mouse face.
10357 2011-10-28  Chong Yidong  <cyd@gnu.org>
10359         * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10361 2011-10-28  Dan Nicolaescu  <dann@ics.uci.edu>
10363         * window.c (make_window): Initialize phys_cursor_on_p.
10365 2011-10-28  Stefan Monnier  <monnier@iro.umontreal.ca>
10367         * lisp.h (struct Lisp_Symbol): Update comments.
10369 2011-10-28  Juanma Barranquero  <lekktu@gmail.com>
10371         * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10373 2011-10-28  Eli Zaretskii  <eliz@gnu.org>
10375         Fix Emacs on Windows 9X (bug#8562).  Thanks to oslsachem
10376         <oslsachem@gmail.com> for helping to debug this.
10378         * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10379         (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10380         (g_b_init_get_glyph_outline_w): New static variables.
10381         (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10382         (GetGlyphOutlineW_Proc): New typedefs.
10383         (w32_load_unicows_or_gdi32, get_outline_metrics_w)
10384         (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10385         New functions.
10386         (w32font_open_internal, compute_metrics):
10387         Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
10388         instead of calling the "wide" APIs directly.
10390         * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10392         * w32.h (syms_of_w32font): Add prototype.
10394 2011-10-27  Juanma Barranquero  <lekktu@gmail.com>
10396         * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10397         (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10398         (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10399         (Fmove_to_window_line): Doc fix.
10401 2011-10-27  Chong Yidong  <cyd@gnu.org>
10403         * process.c (make_process): Set gnutls_state to NULL.
10405         * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10406         non-NULL, regardless of GNUTLS_INITSTAGE.
10407         (Fgnutls_boot): Cleanups.  Call emacs_gnutls_deinit if we signal
10408         an error.  Set process slots as soon as we allocate them.
10410         * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10412 2011-10-27  Chong Yidong  <cyd@gnu.org>
10414         * gnutls.c (emacs_gnutls_deinit): New function.
10415         Deallocate credentials structures as well as calling gnutls_deinit.
10416         (Fgnutls_deinit, Fgnutls_boot): Use it.
10418         * process.c (make_process): Initialize GnuTLS credentials to NULL.
10419         (deactivate_process): Call emacs_gnutls_deinit.
10421 2011-10-27  Juanma Barranquero  <lekktu@gmail.com>
10423         * image.c (x_create_x_image_and_pixmap):
10424         * w32.c (sys_rename, w32_delayed_load):
10425         * w32font.c (fill_in_logfont):
10426         * w32reg.c (x_get_string_resource): Silence compiler warnings.
10428 2011-10-26  Juanma Barranquero  <lekktu@gmail.com>
10430         * w32fns.c (w32_default_color_map): New function,
10431         extracted from Fw32_default_color_map.
10432         (Fw32_default_color_map, Fx_open_connection): Use it.  (Bug#9785)
10434 2011-10-25  Paul Eggert  <eggert@cs.ucla.edu>
10436         * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10438 2011-10-25  Stefan Monnier  <monnier@iro.umontreal.ca>
10440         * keyboard.c (test_undefined): New function (bug#9751).
10441         (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10443 2011-10-25  Enami Tsugutomo  <tsugutomo.enami@jp.sony.com>
10445         * sysdep.c (init_sys_modes): Fix the check for the controlling
10446         terminal (Bug#6649).
10448 2011-10-20  Eli Zaretskii  <eliz@gnu.org>
10450         * dispextern.h (struct bidi_it): New member next_en_type.
10452         * bidi.c (bidi_line_init): Initialize the next_en_type member.
10453         (bidi_resolve_explicit_1): When next_en_pos is valid for the
10454         current character, check also for next_en_type being WEAK_EN.
10455         (bidi_resolve_weak): Don't enter the expensive loop if the current
10456         position is before next_en_pos.  Record the bidi type of the first
10457         non-ET, non-BN character we find, in addition to its position.
10458         (bidi_level_of_next_char): Invalidate next_en_type when
10459         next_en_pos is over-stepped.
10461 2011-10-20  Paul Eggert  <eggert@cs.ucla.edu>
10463         Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10464         * editfns.c: Rewrite current-time-zone so that it invokes
10465         the equivalent of (format-time-string "%Z") to get the time zone name.
10466         This fixes a bug when the time zone name contains characters that
10467         need converting from the system time locale to Emacs internal format.
10468         This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10469         that patch fixed format-time-string to do the conversion, but
10470         I forgot to fix current-time-zone.
10471         (format_time_string): New function, containing most of
10472         what Fformat_time_string used to contain.
10473         (Fformat_time_string): Rewrite in terms of format_time_string.
10474         This doesn't change this function's behavior.
10475         (current-time-zone): Rewrite to use format_time_string.
10476         This fixes the bug reported by Michael Schierl in
10477         <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10478         Jason Rumney's 2007-06-07 change worked around this bug, but
10479         didn't fix it.
10480         * systime.h (tzname, timezone): Remove no-longer-used declarations.
10482 2011-10-19  Eli Zaretskii  <eliz@gnu.org>
10484         * xdisp.c (start_display): If the character at POS is displayed
10485         via a display vector, reset IT->current.dpvec_index to zero.
10486         (try_window_reusing_current_matrix): If a line ends in a display
10487         vector or the next line starts in a display vector, continue
10488         redrawing the window even though the character position of
10489         start_row was reached.
10490         (Bug#9771, part 2)
10492 2011-10-18  Chong Yidong  <cyd@gnu.org>
10494         * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10495         with nobreak-char-display too.
10497 2011-10-18  Eli Zaretskii  <eliz@gnu.org>
10499         Fix part 3 of bug#9771.
10500         * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10501         (bidi_resolve_neutral): Don't enter the expensive loop looking for
10502         non-neutral characters if the current character is a paragraph
10503         separator (a.k.a. Newline).  This avoids running the same
10504         expensive loop twice, once when we consume the preceding newline
10505         and the other time when the line actually needs to be displayed.
10506         Avoid the loop when we see neutrals on the base embedding level
10507         following a character whose directionality is the same as the
10508         paragraph's.  This avoids running the expensive loop when a line
10509         ends in a long sequence of neutrals, like control characters.
10510         Add assertion against STRONG_AL type.  Slightly rearrange code
10511         that determines the type of a neutral given the first non-neutral
10512         that follows it.
10513         (bidi_level_of_next_char): Set next_en_pos to zero when
10514         invalidating its info.
10516 2011-10-17  Eli Zaretskii  <eliz@gnu.org>
10518         * xdisp.c (push_display_prop): Determine whether to record string
10519         or buffer position by IT->string, not by IT->method.  Allow
10520         GET_FROM_DISPLAY_VECTOR as IT->method on entry.  (Bug#9771, part 4)
10521         (move_it_vertically_backward): Don't look for character position
10522         immediately after the newline when in a continuation line.
10523         (Bug#9771, part 1)
10525 2011-10-15  Martin Rudalics  <rudalics@gmx.at>
10527         * window.c (coordinates_in_window): Rewrite and delabelize
10528         vertical border check.  (Bug#5357) (Bug#9618)
10530 2011-10-14  Stefan Monnier  <monnier@iro.umontreal.ca>
10532         * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10533         errors in XSetWindowBorder (bug#9310).
10535 2011-10-13  Dmitry Antipov  <dmantipov@yandex.ru>
10537         * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10538         avoid crash when xmalloc overrun checking is enabled.
10540 2011-10-13  Eli Zaretskii  <eliz@gnu.org>
10542         * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10543         itb.paragraph_dir to NEUTRAL_DIR.  Fixes an occasional incorrect
10544         cursor motion with <left> and <right> arrow keys.
10546         * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10547         some callers set that themselves.
10549 2011-10-12  Eli Zaretskii  <eliz@gnu.org>
10551         * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10552         display string and the previous row comes from the same string and
10553         is empty.  (Bug#9739)  (Bug#9738)
10555 2011-10-12  Stefan Monnier  <monnier@iro.umontreal.ca>
10557         * doc.c (get_doc_string): Encode file name (bug#9735).
10559 2011-10-12  Eli Zaretskii  <eliz@gnu.org>
10561         * bidi.c (bidi_level_of_next_char):
10562         * xdisp.c (get_visually_first_element): Remove old incorrect
10563         comments regarding the Unicode Line Separator character.
10565         * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10567 2011-10-12  Dmitry Antipov  <dmantipov@yandex.ru>
10569         * alloc.c (Fgc_status): Do not access beyond zombies array
10570         boundary if nzombies > MAX_ZOMBIES.
10571         * alloc.c (dump_zombies): Add missing format specifier.
10573 2011-10-12  Paul Eggert  <eggert@cs.ucla.edu>
10575         * xdisp.c (set_cursor_from_row): Simplify conditionals,
10576         to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10578         * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10579         Some packages use them to denote characters with modifiers.
10581 2011-10-11  Andreas Schwab  <schwab@linux-m68k.org>
10583         * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10584         (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10585         matching a pp-number.  Rename parameter var to var1.
10587 2011-10-11  Stefan Monnier  <monnier@iro.umontreal.ca>
10589         * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10591 2011-10-08  Glenn Morris  <rgm@gnu.org>
10593         * callint.c (Fcall_interactively): Give a more explicit error for the
10594         'c' case with a non-character input.  (Bug#8479)
10596 2011-10-08  Eli Zaretskii  <eliz@gnu.org>
10598         * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10599         lines.
10600         (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10601         lines that are hscrolled on the left.
10603         * dispnew.c (buffer_posn_from_coords): Account for a possible
10604         presence of header-line.  (Bug#4426)
10606 2011-10-07  Stefan Monnier  <monnier@iro.umontreal.ca>
10608         * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10609         Don't advertise functionality which we discourage or doesn't work.
10611 2011-10-07  Paul Eggert  <eggert@cs.ucla.edu>
10613         * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10614         or sizeof.  __alignof__ gives the wrong answer on Fedora x86-64
10615         with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10616         this makes Emacs dump core during garbage collection on rare
10617         occasions.  sizeof is obviously inferior to offsetof here, so
10618         stick with offsetof.
10619         (GC_POINTER_ALIGNMENT): New macro.
10620         (mark_memory): Omit 3rd (offset) arg; caller changed.
10621         Don't assume EMACS_INT alignment is the same as pointer alignment.
10623 2011-10-03  Stefan Monnier  <monnier@iro.umontreal.ca>
10625         * keyboard.c (read_key_sequence_remapped): New var.
10626         (read_key_sequence): Compute remapping in the right buffer.
10627         (command_loop_1): Use read_key_sequence's remapping directly.
10629 2011-10-02  Stefan Monnier  <monnier@iro.umontreal.ca>
10631         * dired.c (file_name_completion): Don't expand file name.
10632         (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10633         before checking file name handler.
10635         * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10636         they've been requested explicitly (bug#9591).
10638 2011-10-01  Andreas Schwab  <schwab@linux-m68k.org>
10640         * keymap.c (Fsingle_key_description): Use make_specified_string
10641         instead of build_string to build string from push_key_description.
10642         (Bug#5193)
10644 2011-09-30  Paul Eggert  <eggert@cs.ucla.edu>
10646         * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10647         This fixes a Y2038 bug on 64-bit hosts.
10648         * buffer.c (reset_buffer):
10649         * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10650         (Fclear_buffer_auto_save_failure):
10651         Use 0, not -1, to represent an unset failure time, since time_t
10652         might not be signed.
10654         Remove dependency on glibc malloc internals.
10655         * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10656         Move back here from lisp.h, but with their new implementations.
10657         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10658         (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10659         * charset.c (charset_table_init): New static var.
10660         (syms_of_charset): Use it instead of xmalloc.  This removes a
10661         dependency on glibc malloc internals.  See Eli Zaretskii's comment in
10662         <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10663         * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10664         Move back to alloc.c.
10665         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10666         (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10668 2011-09-30  Jan Djärv  <jan.h.d@swipnet.se>
10670         * nsterm.m (windowDidResize): Call x_set_window_size only when
10671         ns_in_resize is true.  Otherwise set pixelwidth/height and
10672         call change_frame_size (Bug#9628).
10674 2011-09-30  Paul Eggert  <eggert@cs.ucla.edu>
10676         Port --enable-checking=all to Fedora 14 x86-64.
10677         * charset.c (syms_of_charset): Also account for glibc malloc's
10678         internal overhead when calculating the initial malloc maximum.
10680         Port --enable-checking=all to Fedora 14 x86.
10681         * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10682         Move to lisp.h.
10683         (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10684         (overrun_check_realloc, overrun_check_free):
10685         Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10686         That way, xmalloc returns a properly-aligned pointer even if
10687         XMALLOC_OVERRUN_CHECK is defined.  The old debugging code happened
10688         to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10689         * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10690         into account when calculating the initial malloc maximum.
10691         * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10692         Move here from alloc.c, so that charset.c can use it too.
10693         Properly align; the old code wasn't right for common 32-bit hosts
10694         when configured with --enable-checking=all.
10695         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10696         (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10698 2011-09-29  Eli Zaretskii  <eliz@gnu.org>
10700         * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
10701         use EDOM.
10703 2011-09-28  Eli Zaretskii  <eliz@gnu.org>
10705         * xdisp.c (compute_display_string_end): If there's no display
10706         string at CHARPOS, return -1.
10708         * bidi.c (bidi_fetch_char): When compute_display_string_end
10709         returns a negative value, treat the character as a normal
10710         character not covered by a display string.  (Bug#9624)
10712 2011-09-28  Juanma Barranquero  <lekktu@gmail.com>
10714         * lread.c (Fread_from_string): Fix typo in docstring.
10716 2011-09-27  Eli Zaretskii  <eliz@gnu.org>
10718         * xdisp.c (handle_invisible_prop): If invisible text ends on a
10719         newline, reseat the iterator instead of bidi-iterating there one
10720         character at a time.  (Bug#9610)
10721         (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10722         TO_CHARPOS if the bidi iterator is at base embedding level.
10724 2011-09-27  Andreas Schwab  <schwab@linux-m68k.org>
10726         * lread.c (readevalloop): Use correct code for NBSP.
10727         (read1): Likewise.  (Bug#9608)
10729 2011-09-25  Michael Albinus  <michael.albinus@gmx.de>
10731         * dbusbind.c (Fdbus_register_signal): When service is not
10732         registered, use nil in Vdbus_registered_objects_table.  (Bug#9581)
10734 2011-09-25  Glenn Morris  <rgm@gnu.org>
10736         * buffer.c (truncate-lines): Doc fix.
10738 2011-09-24  Chong Yidong  <cyd@stupidchicken.com>
10740         * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10741         (Fset_window_next_buffers): Doc fix.
10743 2011-09-24  Glenn Morris  <rgm@gnu.org>
10745         * minibuf.c (read_minibuf): Disable line truncation.  (Bug#5715)
10747 2011-09-24  Paul Eggert  <eggert@cs.ucla.edu>
10749         Fix minor problems found by static checking.
10750         * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
10751         * indent.c (Fvertical_motion): Fix == vs = typo.
10753 2011-09-24  Eli Zaretskii  <eliz@gnu.org>
10755         * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10756         Default value is now t.  Doc fix.
10758         * indent.c (Fvertical_motion): Compute and apply the overshoot
10759         logic when moving up, not only when moving down.  Fix the
10760         confusing name and values of the it_overshoot_expected variable;
10761         logic changes accordingly.  (Bug#9254) (Bug#9549)
10763         * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10764         CHARPOS is covered by a display string which includes newlines.
10765         (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10766         is covered by a display string with embedded newlines.
10768 2011-09-24  Michael Albinus  <michael.albinus@gmx.de>
10770         * dbusbind.c (Fdbus_register_signal): Add match rule to
10771         Vdbus_registered_objects_table.  (Bug#9581)
10772         (Fdbus_register_method, Vdbus_registered_objects_table):
10773         Fix docstring.
10775 2011-09-24  Jim Meyering  <meyering@redhat.com>
10777         do not ignore write error for any output size
10778         The previous change was incomplete.
10779         While it makes emacs --batch detect the vast majority of stdout
10780         write failures, errors were still ignored whenever the output size is
10781         k * (BUFSIZ+1) - 4.  E.g., on a system with BUFSIZ of 4096,
10782           $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10783               && echo FAIL: ignored write error
10784           FAIL: ignored write error
10785           $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10786               && echo FAIL: ignored write error
10787           FAIL: ignored write error
10788         * emacs.c (Fkill_emacs): Also test ferror.  (Bug#9574)
10790 2011-09-23  Andreas Schwab  <schwab@linux-m68k.org>
10792         * emacs.c (Fkill_emacs): In noninteractive mode exit
10793         non-successfully if a write error occurred on stdout.  (Bug#9574)
10795 2011-09-21  Eli Zaretskii  <eliz@gnu.org>
10797         * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10798         the xassert test.
10800         * dispextern.h (struct it): Update the comment documenting what
10801         can it->OBJECT be.
10803 2011-09-20  Eli Zaretskii  <eliz@gnu.org>
10805         * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10806         a display string, extend search for cursor position to end of row.
10807         (find_row_edges): If the row ends in a newline from a display
10808         string, increment its MATRIX_ROW_END_CHARPOS by one.  (Bug#9549)
10809         Handle the case of a display string with multiple newlines.
10810         (Fcurrent_bidi_paragraph_direction): Fix search for previous
10811         non-empty line.  Fixes confusing cursor motion with arrow keys at
10812         the beginning of a line that starts with whitespace.
10814 2011-09-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10816         * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10817         (bug#9493).
10819 2011-09-18  Chong Yidong  <cyd@stupidchicken.com>
10821         * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10822         boolean (Bug#9154).
10824 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
10826         * xdisp.c (display_line): Record maximum and minimum buffer
10827         positions even if no glyphs were produced (e.g., by a zero-width
10828         stretch).  Fixes bug#9530 on a TTY.  Under word-wrap, don't record
10829         buffer positions that will be removed from the glyph row because
10830         they don't fit.
10831         (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10832         column is beyond frame width: don't subtract 1 "pixel" when
10833         computing width of the stretch.
10834         (reseat_at_next_visible_line_start): Undo the change made on
10835         2011-09-17 that saved paragraph information and restored it after
10836         the call to `reseat'.  (Bug#9545)
10838 2011-09-18  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
10840         * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10841         and turn window cursor on if cleared (Bug#9415).
10843 2011-09-18  Andreas Schwab  <schwab@linux-m68k.org>
10845         * search.c (boyer_moore): Take unibyte characters from pattern
10846         literally.  (Bug#9458)
10848 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
10850         * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10852 2011-09-18  Paul Eggert  <eggert@cs.ucla.edu>
10854         Fix minor problem found by static checking.
10855         * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10856         initialized, to pacify gcc -Wuninitialized.
10858         * fileio.c: Report proper errno when syscall falls.
10859         (Finsert_file_contents): Save and restore errno,
10860         so that report_file_error outputs the correct diagnostic.
10861         (Fwrite_region) [CLASH_DETECTION]: Likewise.
10863 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
10865         * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10867 2011-09-17  Eli Zaretskii  <eliz@gnu.org>
10869         * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10870         2011-08-30T17:32:44Z!eliz@gnu.org.  (Bug#9530)
10872 2011-09-17  Eli Zaretskii  <eliz@gnu.org>
10874         * xdisp.c (reseat_at_next_visible_line_start): Keep information
10875         about the current paragraph and restore it after the call to reseat.
10877         * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10878         (bidi_find_paragraph_start): Search back for paragraph beginning
10879         at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10880         (bidi_move_to_visually_next): Only trigger paragraph-related
10881         computations when the last character is a newline or at EOB, not
10882         just any NEUTRAL_B.  (Bug#9470)
10884         * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10885         truncated lines if point is covered by a display string.  (Bug#9524)
10887 2011-09-16  Paul Eggert  <eggert@cs.ucla.edu>
10889         * xselect.c: Relax test for outgoing X longs (Bug#9498).
10890         (cons_to_x_long): New function.
10891         (lisp_data_to_selection_data): Use it.  Correct the test for
10892         short-versus-long data; it was negated.  Break out of vector
10893         loop, for efficiency, when a long datum is discovered.
10895 2011-09-16  Stefan Monnier  <monnier@iro.umontreal.ca>
10897         * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10899 2011-09-16  Eli Zaretskii  <eliz@gnu.org>
10901         * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10902         GCC PR/17406) by declaring this function with external scope.
10904 2011-09-15  Paul Eggert  <eggert@cs.ucla.edu>
10906         * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10907         Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10909 2011-09-15  Andreas Schwab  <schwab@linux-m68k.org>
10911         * editfns.c (Fformat): Correctly handle text properties on "%%".
10913 2011-09-15  Eli Zaretskii  <eliz@gnu.org>
10915         * xterm.c (x_draw_composite_glyph_string_foreground):
10916         * w32term.c (x_draw_composite_glyph_string_foreground):
10917         * term.c (encode_terminal_code):
10918         * composite.c (composition_update_it, get_composition_id):
10919         * xdisp.c (get_next_display_element)
10920         (fill_composite_glyph_string): Add comments about special meaning
10921         of TAB characters in a composition.
10923 2011-09-15  Paul Eggert  <eggert@cs.ucla.edu>
10925         * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
10926         This occurs when processing a multibyte format.
10927         Problem reported by Wolfgang Jenker.
10929 2011-09-15  Johan Bockgård  <bojohan@gnu.org>
10931         * xdisp.c (try_cursor_movement): Only check for exact match if
10932         cursor hpos found by set_cursor_from_row is valid.  (Bug#9495)
10934 2011-09-14  Paul Eggert  <eggert@cs.ucla.edu>
10936         Remove unused external symbols.
10937         * dispextern.h (calc_pixel_width_or_height): Remove decl.
10938         * xdisp.c (calc_pixel_width_or_height): Now static.
10939         * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10940         * indent.c (check_display_width):
10941         * w32term.c: Fix comment to match code.
10942         * xterm.c, xterm.h (x_catching_errors): Remove.
10944 2011-09-14  Paul Eggert  <eggert@cs.ucla.edu>
10946         * xselect.c: Use signed conversions more consistently (Bug#9498).
10947         (selection_data_to_lisp_data): Assume incoming selection data are
10948         signed integers, not unsigned.  This is to be consistent with
10949         outgoing selection data, which was modified to use signed integers
10950         in as part of the fix to Bug#9196 in response to Jan D.'s comment
10951         in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10952         expects long, not unsigned long.
10954 2011-09-14  Eli Zaretskii  <eliz@gnu.org>
10956         * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10957         computation of loop end.  Reported by Johan Bockgård
10958         <bojohan@gnu.org>.
10960 2011-09-13  Chong Yidong  <cyd@stupidchicken.com>
10962         * frame.c (Fother_visible_frames_p): Function deleted.
10964 2011-09-12  Eli Zaretskii  <eliz@gnu.org>
10966         * indent.c (compute_motion): Process display vector front to back
10967         rather than the other way around.  (Bug#2496)
10969 2011-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
10971         * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10973 2011-09-11  Chong Yidong  <cyd@stupidchicken.com>
10975         * minibuf.c (Fread_from_minibuffer): Doc fix.
10977 2011-09-11  Eli Zaretskii  <eliz@gnu.org>
10979         * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10980         2011-08-30T17:32:44Z!eliz@gnu.org.  (Bug#9475)
10982 2011-09-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10984         * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10985         value for non-existent files.
10987 2011-09-11  Eli Zaretskii  <eliz@gnu.org>
10989         * fileio.c (Finsert_file_contents): If the file cannot be opened,
10990         set its "size" to -1.  This will set the modtime_size field of
10991         the corresponding buffer to -1, which is what
10992         verify-visited-file-modtime expects for files that do not exist.
10993         (Bug#9139)
10995 2011-09-11  Paul Eggert  <eggert@cs.ucla.edu>
10997         * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10998         here ...
10999         * lisp.h: ... from here.  push_key_description is no longer
11000         defined in keyboard.c, so its declaration should not be in
11001         lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
11002         logically belongs with push_key_description.
11004 2011-09-10  Paul Eggert  <eggert@cs.ucla.edu>
11006         * buffer.h: Include <sys/types.h> instead of <time.h>.
11007         Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
11008         Problem reported by Herbert J. Skuhra.
11010 2011-09-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
11012         * xml.c (parse_region): Make the parsing work for
11013         non-comment-starting XML files again (bug#9144).
11015 2011-09-10  Andreas Schwab  <schwab@linux-m68k.org>
11017         * image.c (gif_load): Fix calculation of bottom and right corner.
11018         (Bug#9468)
11020 2011-09-10  Eli Zaretskii  <eliz@gnu.org>
11022         * xdisp.c (MAX_DISP_SCAN): Decrease to 250.  Prevents sluggish
11023         redisplay in small windows.
11025 2011-09-09  Eli Zaretskii  <eliz@gnu.org>
11027         * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11029 2011-09-08  Martin Rudalics  <rudalics@gmx.at>
11031         * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11032         Operate on live windows only.
11034 2011-09-08  Juanma Barranquero  <lekktu@gmail.com>
11036         * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
11038 2011-09-07  Eli Zaretskii  <eliz@gnu.org>
11040         * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
11041         only under bidi iteration.
11043 2011-09-07  Jan Djärv  <jan.h.d@swipnet.se>
11045         * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11047 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
11049         isnan: Fix porting problem to Solaris 10 with bundled gcc.
11050         Without this fix, the command to link temacs failed due to an
11051         undefined symbol __builtin_isnan.  This is because
11052         /usr/include/iso/math_c99.h #defines isnan(x) to
11053         __builtin_isnan(x), but the bundled gcc, which identifies itself
11054         as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11055         a __builtin_isnan.
11056         * floatfns.c (isnan): #undef, and then #define to a clone of
11057         what's in data.c.
11058         (Fisnan): Always define, since it's always available now.
11059         (syms_of_floatfns): Always define isnan at the Lisp level.
11061 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
11063         * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11065 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
11067         * fileio.c: Fix bugs with large file offsets (Bug#9428).
11068         The previous code assumed that file offsets (off_t values) fit in
11069         EMACS_INT variables, which is not true on typical 32-bit hosts.
11070         The code messed up by falsely reporting buffer overflow in cases
11071         such as (insert-file-contents "big" nil 1 2) into an empty buffer
11072         when "big" contains more than 2**29 bytes, even though this
11073         inserts just one byte and does not overflow the buffer.
11074         (Finsert_file_contents): Store file offsets as off_t
11075         values, not as EMACS_INT values.  Check for overflow when
11076         converting between EMACS_INT and off_t.  When checking for
11077         buffer overflow or for overlap, take the offsets into account.
11078         Don't use EMACS_INT for small values where int suffices.
11079         When checking for overlap, fix a typo: ZV was used where
11080         ZV_BYTE was intended.
11081         (Fwrite_region): Don't assume off_t fits into 'long'.
11082         * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11084 2011-09-05  Michael Albinus  <michael.albinus@gmx.de>
11086         * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11088 2011-09-04  Paul Eggert  <eggert@cs.ucla.edu>
11090         sprintf-related integer and memory overflow issues (Bug#9412).
11092         * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
11093         (esprintf, exprintf, evxprintf): New functions.
11094         * keyboard.c (command_loop_level): Now EMACS_INT, not int.
11095         (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
11096         (modify_event_symbol): Do not assume that the length of
11097         name_alist_or_stem is safe to alloca and fits in int.
11098         (Fexecute_extended_command): Likewise for function name and binding.
11099         (Frecursion_depth): Wrap around reliably on integer overflow.
11100         * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11101         since some callers pass EMACS_INT values.
11102         (Fsingle_key_description): Don't crash if symbol name contains more
11103         than MAX_ALLOCA bytes.
11104         * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11105         (get_minibuffer): Arg is now EMACS_INT, not int.
11106         * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
11107         (esprintf, exprintf, evxprintf): New decls.
11108         * window.h (command_loop_level, minibuf_level): Reflect API changes.
11110         * dbusbind.c (signature_cat): New function.
11111         (xd_signature, Fdbus_register_signal):
11112         Do not overrun buffer; instead, report string overflow.
11114         * dispnew.c (add_window_display_history): Don't overrun buffer.
11115         Truncate instead; this is OK since it's just a log.
11117         * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11118         even if the time zone offset is outlandishly large.
11119         Don't mishandle offset == INT_MIN.
11121         * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11122         when creating daemon; the previous buffer-overflow check was incorrect.
11124         * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11125         which has the guts of the old verror function.
11127         * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11128         use SAFE_ALLOCA instead.  Use esprintf to avoid int-overflow issues.
11130         * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11131         (font_unparse_xlfd): Don't blindly alloca long strings.
11132         Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
11133         fits in int, when using sprintf.  Use single snprintf to count
11134         length of string rather than counting it via multiple sprintfs;
11135         that's simpler and more reliable.
11136         (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11137         (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11138         sprintf, in case result does not fit in int.
11140         * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11141         (fontset_from_font): Print it.
11143         * frame.c (tty_frame_count): Now printmax_t, not int.
11144         (make_terminal_frame, set_term_frame_name): Print it.
11145         (x_report_frame_params): In X, window IDs are unsigned long,
11146         not signed long, so print them as unsigned.
11147         (validate_x_resource_name): Check for implausibly long names,
11148         and don't assume name length fits in 'int'.
11149         (x_get_resource_string): Don't blindly alloca invocation name;
11150         use SAFE_ALLOCA.  Use esprintf, not sprintf, in case result does
11151         not fit in int.
11153         * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11154         (xg_check_special_colors, xg_set_geometry):
11155         Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11157         * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11158         Use esprintf, not sprintf, in case result does not fit in int.
11160         * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11161         (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11162         it as a large positive number.
11163         (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11164         * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11166         * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11167         in case result does not fit in int.
11169         * print.c (float_to_string): Detect width overflow more reliably.
11170         (print_object): Make sprintf buffer a bit bigger, to avoid potential
11171         buffer overrun.  Don't assume list length fits in 'int'.  Treat
11172         print length of 0 as 0, not as infinity; to be consistent with other
11173         uses of print length in this function.  Don't overflow print length
11174         index.  Don't assume hash table size fits in 'long', or that
11175         vectorlike size fits in 'unsigned long'.
11177         * process.c (make_process): Use printmax_t, not int, to format
11178         process-name gensyms.
11180         * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11182         * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11183         to avoid potential buffer overrun.
11185         * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11186         if X resource line is longer than 512 bytes.
11188         * xfns.c (x_window): Make sprintf buffer a bit bigger
11189         to avoid potential buffer overrun.
11191         * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11193         * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11195 2011-09-04  Paul Eggert  <eggert@cs.ucla.edu>
11197         Integer overflow fixes for scrolling, etc.
11198         Without these, Emacs silently mishandles large integers sometimes.
11199         For example, "C-u 4294967297 M-x recenter" was treated as if
11200         it were "C-u 1 M-x recenter" on a typical 64-bit host.
11202         * xdisp.c (try_window_id): Check Emacs fixnum range before
11203         converting to 'int'.
11205         * window.c (window_scroll_line_based, Frecenter):
11206         Check that an Emacs fixnum is in range before assigning it to 'int'.
11207         (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11208         values converted from Emacs fixnums.
11209         (Frecenter): Don't wrap around a line count if it is out of 'int'
11210         range; instead, treat it as an extreme value.
11211         (Fset_window_configuration, compare_window_configurations):
11212         Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11214         * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11215         that can exceed INT_MAX.  Check that EMACS_INT value is in range
11216         before assigning it to the (possibly-narrower) index.
11217         (match_limit): Don't assume that a fixnum can fit in 'int'.
11219         * print.c (print_object): Use ptrdiff_t, not int, for index that can
11220         exceed INT_MAX.
11222         * indent.c (position_indentation): Now takes ptrdiff_t, not int.
11223         (Fvertical_motion): Don't wrap around LINES values that don't fit
11224         in 'int'.  Instead, treat them as extreme values.  This is good
11225         enough for windows, which can't have more than INT_MAX lines anyway.
11227 2011-09-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
11229         * Require libxml/parser.h to avoid compilation warning.
11231         * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11233         * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11234         since this reportedly can destroy thread storage.
11236 2011-08-30  Chong Yidong  <cyd@stupidchicken.com>
11238         * syntax.c (find_defun_start): Update all cache variables if
11239         exiting early (Bug#9401).
11241 2011-08-30  Eli Zaretskii  <eliz@gnu.org>
11243         * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11245         * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11246         when HAVE_WINDOW_SYSTEM is not defined.  Support both GUI and TTY
11247         frames.  Call tty_append_glyph in the TTY case.  (Bug#9402)
11249         * term.c (tty_append_glyph): New function.
11250         (produce_stretch_glyph): Static function and its prototype deleted.
11252         * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11253         Add prototypes.
11255 2011-08-29  Paul Eggert  <eggert@cs.ucla.edu>
11257         * image.c (parse_image_spec): Check for nonnegative, not for positive,
11258         when checking :margin (Bug#9390).
11259         (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
11260         Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
11261         so that the name doesn't mislead.  All uses changed.
11263 2011-08-28  Johan Bockgård  <bojohan@gnu.org>
11265         * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11266         set_tty_hooks.
11268 2011-08-27  Eli Zaretskii  <eliz@gnu.org>
11270         * xdisp.c (move_it_to): Don't bail out early when reaching
11271         position beyond to_charpos, if we are scanning backwards.
11272         (move_it_vertically_backward): When DY == 0, make sure we get to
11273         the first character in the line after the newline.
11275 2011-08-27  Paul Eggert  <eggert@cs.ucla.edu>
11277         * ccl.c: Improve and simplify overflow checking (Bug#9196).
11278         (ccl_driver): Do not generate an out-of-range pointer.
11279         (Fccl_execute_on_string): Remove unnecessary check for
11280         integer overflow, noted by Stefan Monnier in
11281         <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11282         Remove a FIXME that didn't need fixing.
11283         Simplify the newly-introduced buffer reallocation code.
11285 2011-08-27  Juanma Barranquero  <lekktu@gmail.com>
11287         * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11289 2011-08-26  Paul Eggert  <eggert@cs.ucla.edu>
11291         Integer and memory overflow issues (Bug#9196).
11293         * doc.c (get_doc_string): Rework so that
11294         get_doc_string_buffer_size is the actual buffer size, rather than
11295         being 1 less than the actual buffer size; this makes xpalloc more
11296         convenient.
11298         * image.c (x_allocate_bitmap_record, cache_image):
11299         * xselect.c (Fx_register_dnd_atom):
11300         Simplify previous changes by using xpalloc.
11302         * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11303         since either will do and ptrdiff_t is convenient with xpalloc.
11305         * charset.c (charset_table_size)
11306         (struct charset_sort_data.priority): Now ptrdiff_t.
11307         (charset_compare): Don't overflow if priorities differ greatly.
11308         (Fsort_charsets): Don't assume list length fits in int.
11309         Check for size-calculation overflow when allocating sort data.
11310         (syms_of_charset): Allocate an initial charset table that is
11311         just under 64 KiB, to avoid problems with glibc malloc and mmap.
11313         * cmds.c (internal_self_insert): Check for size-calculation overflow.
11315         * composite.h (struct composition.glyph_len): Now int, not unsigned.
11316         The actual value is always <= INT_MAX, and leaving it unsigned made
11317         overflow checking harder.
11319         * dispextern.h (struct glyph_matrix.rows_allocated)
11320         (struct face_cache.size): Now ptrdiff_t, for convenience in use
11321         with xpalloc.  The values are still always <= INT_MAX.
11323         * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11325         * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11326         (SAFE_NALLOCA): New macro.
11328         * region-cache.c (struct boundary.pos, find_cache_boundary)
11329         (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11330         (set_cache_region, invalidate_region_cache)
11331         (revalidate_region_cache, know_region_cache, region_cache_forward)
11332         (region_cache_backward, pp_cache):
11333         Use ptrdiff_t, not EMACS_INT, since either will do.  This is needed
11334         so that ptrdiff_t * can be passed to xpalloc.
11335         (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11336         beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11337         (pp_cache): Don't assume cache_len fits in int.
11338         * region-cache.h: Adjust extern decls to match.
11340         * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11341         EMACS_INT, since either will do, for xpalloc.
11343         * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11344         (xnmalloc, xnrealloc, xpalloc): New functions.
11346         * bidi.c (bidi_shelve_header_size): New constant.
11347         (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11348         (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11350         * bidi.c (bidi_cache_shrink):
11351         * buffer.c (overlays_at, overlays_in, record_overlay_string)
11352         (overlay_strings):
11353         Don't update size of array until after memory allocation succeeds,
11354         because xmalloc/xrealloc may not return.
11355         (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11356         now that we have proper integer overflow checking.
11357         (record_overlay_string, overlay_strings): Catch overflows when
11358         calculating size of overlay_str_buf.
11360         * callproc.c (Fcall_process): Check for size overflow when
11361         calculating size of args2.
11362         (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11363         Normally we prefer signed values, but sticking with ptrdiff_t would
11364         require adding more-complicated checks.
11366         * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11367         Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11368         Redo buffer-overflow calculations to avoid integer overflow.
11369         Add a FIXME comment where memory seems to be over-allocated.
11371         * character.c (Fstring): Check for size-calculation overflow.
11373         * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11374         unnecessary integer overflow.  Check for size overflow.
11375         (encode_coding_object): Don't update size until xmalloc succeeds.
11377         * composite.c (get_composition_id): Check for overflow in glyph
11378         length calculations.
11380         Integer and memory overflow fixes for display code.
11381         * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11382         * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11383         (scrolling_window): Check for overflow in size calculations.
11384         (line_draw_cost, realloc_glyph_pool, add_row_entry):
11385         Don't assume glyph table len fits in int.
11386         (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11387         (row_table_size): Now ptrdiff_t, not int.
11388         (scrolling_window): Avoid overflow in size calculations.
11389         Don't update size until allocation succeeds.
11390         * fns.c (concat): Check for overflow in size calculations.
11391         (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11392         * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11393         (NEXT_ALMOST_PRIME_LIMIT): New constant.
11395         * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11396         (get_doc_string): Check for size calculation overflow.
11397         Don't update size until allocation succeeds.
11398         (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11399         EMACS_INT, where ptrdiff_t will do.
11400         (Fsubstitute_command_keys): Check for string overflow.
11402         * editfns.c (set_time_zone_rule): Don't assume environment length
11403         fits in int.
11404         (message_length): Now ptrdiff_t, not int.
11405         (Fmessage_box): Don't update size until allocation succeeds.
11406         Don't assume message length fits in int.
11407         (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11409         * emacs.c (main): Do not reallocate argv, since there is a null at
11410         the end that can be overwritten, and this way there's no need to
11411         worry about size-calculation overflow.
11412         (sort_args): Check for size-calculation overflow.
11414         * eval.c (init_eval_once, grow_specpdl): Don't update size until
11415         alloc succeeds.
11416         (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11418         * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11419         (x_set_scroll_bar_width, x_figure_window_size):
11420         Check for integer overflow.
11421         (x_set_alpha): Do not assume XINT fits in int.
11423         * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11424         This is for the members text_lines, text_cols, total_lines, total_cols,
11425         where the system imposes an 'int' limit.
11427         * fringe.c (Fdefine_fringe_bitmap):
11428         Don't update size until alloc works.
11430         * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11431         (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11433         * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11434         Check for size-calculation overflow.
11435         (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11436         do, as we prefer signed integers.
11437         (id_to_widget.max_size, id_to_widget.used)
11438         (xg_store_widget_in_map, xg_remove_widget_from_map)
11439         (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11440         (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11441         Use and return ptrdiff_t, not int.
11442         (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11443         * gtkutil.h: Change prototypes to match the above.
11445         * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11446         are duplicate now that they've been promoted to lisp.h.
11447         (x_allocate_bitmap_record, x_alloc_image_color)
11448         (make_image_cache, cache_image, xpm_load):
11449         Don't update size until alloc is done.
11450         (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11451         (x_detect_edges):
11452         Check for size calculation overflow.
11453         (ct_colors_allocated_max): New constant.
11454         (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11455         overflow.
11457         * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11458         (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11459         (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11460         Use ptrdiff_t, not int, to count maps.
11461         (read_char_minibuf_menu_prompt): Check for overflow in size
11462         calculations.  Don't update size until allocation succeeds.
11463         Redo calculations to avoid overflow.
11464         * keyboard.h: Change prototypes to match the above.
11466         * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11467         to count maps.
11468         (current_minor_maps): Check for size calculation overflow.
11469         * keymap.h: Change prototypes to match the above.
11471         * lread.c (read1, init_obarray): Don't update size until alloc done.
11473         * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11474         (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11476         * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11477         Now ptrdiff_t, not int.
11478         * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11479         (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11481         * process.c (Fnetwork_interface_list): Check for overflow
11482         in size calculation.
11484         * region-cache.c (move_cache_gap): Check for size calculation overflow.
11486         * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11487         overflow.  Don't bother calling xmalloc when xrealloc will do.
11489         * search.c (Freplace_match): Check for size calculation overflow.
11490         (Fset_match_data): Don't assume list lengths fit in 'int'.
11492         * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11493         for command line length.  Do not attempt to address one before the
11494         beginning of an array, as that's not portable.
11496         * term.c (max_frame_lines): Remove; unused.
11497         (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11498         not int.
11499         (encode_terminal_code, calculate_costs): Check for size
11500         calculation overflow.
11501         (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11502         table lengths and related sizes.  Don't update size until alloc
11503         done.  Redo calculations to avoid overflow.
11504         (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11506         * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11507         subtracting pointers.
11508         (gobble_line): Check for overflow more carefully.  Don't update size
11509         until alloc done.
11511         * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11512         Don't update size until alloc done.
11513         Redo size calculations to avoid overflow.
11514         Check for size calculation overflow.
11515         (main) [DEBUG]: Fix typo in invoking tparam1.
11517         * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11518         Use ptrdiff_t, not int, for sizes.
11519         (store_mode_line_noprop_char): Don't update size until alloc done.
11521         * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11522         Use ptrdiff_t, not int, for sizes.
11523         (Finternal_make_lisp_face, cache_face):
11524         Check for size calculation overflow.
11525         (cache_face): Treat size calculation overflows as if they were
11526         memory exhaustion (the usual treatment), rather than aborting.
11528         * xfns.c (x_encode_text, x_set_name_internal)
11529         (Fx_change_window_property): Use ptrdiff_t, not int, to count
11530         sizes, since they can exceed INT_MAX in size.  Check for size
11531         calculation overflow.
11533         * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11534         (xg_select): Check for size calculation overflow.
11535         Don't update size until alloc done.
11537         * xrdb.c (get_environ_db): Don't assume path length fits in int,
11538         as sprintf is limited to int lengths.
11540         * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11541         (X_LONG_MIN): New macros.
11542         Use them to make the following changes clearer.
11543         (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11544         This change doesn't affect the value now, but it may help remind
11545         future maintainers not to raise the value too much later.
11546         (SELECTION_QUANTUM): Remove, replacing with ...
11547         (selection_quantum): ... new function, which avoids overflow.
11548         All uses changed.
11549         (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11550         assumption that selection length fits in 'int'.
11551         (x_reply_selection_request, x_handle_selection_request)
11552         (x_get_window_property, receive_incremental_selection)
11553         (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11554         (lisp_data_to_selection_data, clean_local_selection_data):
11555         Use ptrdiff_t, not int, to record length of selection.
11556         (x_reply_selection_request, x_get_window_property)
11557         (receive_incremental_selection, x_property_data_to_lisp):
11558         Redo calculations to avoid overflow.
11559         (x_reply_selection_request): When sending hint, ceiling it at
11560         X_LONG_MAX rather than relying on wraparound overflow to send
11561         something.
11562         (x_get_window_property, receive_incremental_selection)
11563         (lisp_data_to_selection_data, x_property_data_to_lisp):
11564         Check for size-calculation overflow.
11565         (x_get_window_property, receive_incremental_selection)
11566         (lisp_data_to_selection_data, Fx_register_dnd_atom):
11567         Don't store size until memory allocation succeeds.
11568         (x_get_window_property): Plug memory leak on memory exhaustion.
11569         Don't double-block input; malloc is safe here.  Don't assume 2**34
11570         - 4 fits in unsigned long.  Add an xassert to check
11571         XGetWindowProperty overflow.  Be more careful about overflow
11572         calculations, and distinguish size from memory overflow better.
11573         (receive_incremental_selection): When tracing, don't assume
11574         unsigned int is less than INT_MAX.
11575         (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11576         harmful) conversions of unsigned short to int.
11577         (lisp_data_to_selection_data): Don't assume that integers
11578         in the range -65535 through -1 fit in an X unsigned short.
11579         Don't assume that ULONG_MAX == X_ULONG_MAX.  Don't store into
11580         result parameters unless successful.  Rely on cons_to_unsigned
11581         to report problems with elements; the old code wasn't right anyway.
11582         (x_check_property_data): Check for int overflow; we cannot use
11583         a wider type due to X limits.
11584         (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11586         * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
11588         * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11589         (x_term_init): Check for size calculation overflow.
11590         (x_color_cells): Don't store size until memory allocation succeeds.
11591         (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
11592         Don't assume alloca size is less than MAX_ALLOCA.
11593         (x_term_init): Don't assume length fits in int (sprintf is limited
11594         to int size).
11596         Use ptrdiff_t for composition IDs.
11597         * character.c (lisp_string_width):
11598         * composite.c (composition_table_size, n_compositions)
11599         (get_composition_id, composition_gstring_from_id):
11600         * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11601         * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11602         * window.c (Frecenter):
11603         Use ptrdiff_t, not int, for composition IDs.
11604         * composite.c (get_composition_id): Check for integer overflow.
11605         * composite.h: Adjust prototypes to match the above changes.
11607         Use ptrdiff_t for hash table indexes.
11608         * category.c (hash_get_category_set):
11609         * ccl.c (ccl_driver):
11610         * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11611         * coding.c (coding_system_charset_list, detect_coding_system):
11612         * coding.h (struct coding_system.id):
11613         * composite.c (get_composition_id, gstring_lookup_cache):
11614         * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11615         * image.c (xpm_get_color_table_h):
11616         * lisp.h (hash_lookup, hash_put):
11617         * minibuf.c (Ftest_completion):
11618         Use ptrdiff_t for hash table indexes, not int (which is too
11619         narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11620         32-bit --with-wide-int hosts).
11622         * charset.c (Fdefine_charset_internal): Check for integer overflow.
11623         Add a FIXME comment about memory leaks.
11624         (syms_of_charset): Don't assume xmalloc returns.
11626         Don't assume that stated character widths fit in int.
11627         * character.c (Fchar_width, c_string_width, lisp_string_width):
11628         * character.h (CHAR_WIDTH):
11629         * indent.c (MULTIBYTE_BYTES_WIDTH):
11630         Use sanitize_char_width to avoid undefined and/or bad behavior
11631         with outlandish widths.
11632         * character.h (sanitize_tab_width): Rename from sanitize_width,
11633         now that we have two such functions.  All uses changed.
11634         (sanitize_char_width): New inline function.
11636         Don't assume that tab-width fits in int.
11637         * character.h (sanitize_width): New inline function.
11638         (SANE_TAB_WIDTH): New macro.
11639         (ASCII_CHAR_WIDTH): Use it.
11640         * indent.c (sane_tab_width): Remove.  All uses replaced by
11641         SANE_TAB_WIDTH (current_buffer).
11642         * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11644         * fileio.c: Integer overflow issues with file modes.
11645         (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11647         * charset.c (read_hex): New arg OVERFLOW.  All uses changed.
11648         Remove unreachable code.
11649         (read_hex, load_charset_map_from_file): Check for integer overflow.
11651         * xterm.c: Don't go over XClientMessageEvent limit.
11652         (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11653         (x_send_scroll_bar_event): Likewise.  Check that the size does not
11654         exceed limits imposed by XClientMessageEvent, as well as the usual
11655         ptrdiff_t and size_t limits.
11657         * keyboard.c: Overflow, signedness and related fixes.
11658         (make_lispy_movement): Use same integer type in forward decl
11659         that is used in the definition.
11660         (read_key_sequence, keyremap_step):
11661         Change bufsize argument back to int, undoing my 2011-03-30 change.
11662         We prefer signed types, and int is wide enough here.
11663         (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11664         than TYPE_MAXIMUM (EMACS_INT) / 2.  Don't let the label size grow
11665         larger than STRING_BYTES_BOUND.  Use ptrdiff_t for Emacs string
11666         length, not size_t.  Use ptrdiff_t for index, not int.
11667         (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11668         possibility of integer overflow.
11670         Overflow, signedness and related fixes for images.
11672         * dispextern.h (struct it.stack[0].u.image.image_id)
11673         (struct_it.image_id, struct image.id, struct image_cache.size)
11674         (struct image_cache.used, struct image_cache.ref_count):
11675         * gtkutil.c (update_frame_tool_bar):
11676         * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11677         (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11678         (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11679         * nsmenu.m (update_frame_tool_bar):
11680         * xdisp.c (calc_pixel_width_or_height):
11681         * xfns.c (image_cache_refcount):
11682         Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11683         on typical 64-bit hosts.
11685         * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11686         (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11687         Omit unnecessary casts to int.
11688         (parse_image_spec): Check that integers fall into 'int' range
11689         when the callers expect that.
11690         (image_ascent): Redo ascent calculation to avoid int overflow.
11691         (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11692         (lookup_image): Remove unnecessary tests.
11693         (xbm_image_p): Locals are now of int, not EMACS_INT,
11694         since parse_image_check makes sure they fit into int.
11695         (png_load, gif_load, svg_load_image):
11696         Prefer int to unsigned where either will do.
11697         (tiff_handler): New function, combining the cores of the
11698         old tiff_error_handler and tiff_warning_handler.
11699         This function is rewritten to use vsnprintf and thereby avoid
11700         stack buffer overflows.  It uses only the features of vsnprintf
11701         that are common to both POSIX and native Microsoft.
11702         (tiff_error_handler, tiff_warning_handler): Use it.
11703         (tiff_load, gif_load, imagemagick_load_image):
11704         Don't assume :index value fits in 'int'.
11705         (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11706         (imagemagick_load_image): Check that crop parameters fit into
11707         the integer types that MagickCropImage accepts.  Don't assume
11708         Vimagemagick_render_type has a nonnegative value.  Don't assume
11709         size_t fits in 'long'.
11710         (gs_load): Use printmax_t to print the widest integers possible.
11711         Check for integer overflow when computing image height and width.
11713 2011-08-26  Eli Zaretskii  <eliz@gnu.org>
11715         * xdisp.c (redisplay_window): Don't force window start if point
11716         will be invisible in the resulting window.  (Bug#9324)
11718 2011-08-25  Eli Zaretskii  <eliz@gnu.org>
11720         * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11721         the display spec is of the form `(space ...)'.
11722         (handle_display_spec): Return the value returned by
11723         handle_single_display_spec, not just 1 or zero.
11724         (handle_single_display_spec): If the display spec is of the form
11725         `(space ...)', and specifies display in the text area, return 2
11726         rather than 1.
11727         (try_cursor_movement): Check for the need to scroll more
11728         accurately, and prefer exact match for point under bidi.
11729         Don't advance `row' beyond the last row of the window.
11731         * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11732         into disp_prop; all users changed.
11734         * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11735         DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11736         for the text covered by the display property.
11738 2011-08-25  Chong Yidong  <cyd@stupidchicken.com>
11740         * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11741         Change return value to nil.
11742         (Frecord_buffer): Delete unused function.
11744 2011-08-24  Eli Zaretskii  <eliz@gnu.org>
11746         * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11747         buffers, return left-to-right.
11748         (set_cursor_from_row): Consider candidate row a win if its glyph
11749         represents a newline and point is on that newline.  Fixes cursor
11750         positioning on the newline at EOL of R2L text within L2R
11751         paragraph, and vice versa.
11752         (try_cursor_movement): Check continued rows, in addition to
11753         continuation rows.  Fixes unwarranted scroll when point enters a
11754         continued line of R2L text within an L2R paragraph, or vice versa.
11755         (cursor_row_p): Consider the case of point being equal to
11756         MATRIX_ROW_END_CHARPOS.  Prevents cursor being stuck when moving
11757         from the end of a short line to the beginning of a continued line
11758         of R2L text within L2R paragraph.
11759         (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11760         composed characters.
11762         * bidi.c (bidi_check_type): Use xassert.
11763         (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11764         members.
11766 2011-08-23  Eli Zaretskii  <eliz@gnu.org>
11768         * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11769         a character.
11771 2011-08-23  Chong Yidong  <cyd@stupidchicken.com>
11773         * nsfont.m (ns_otf_to_script): Fix typo.
11775 2011-08-22  Kenichi Handa  <handa@m17n.org>
11777         * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11778         extra slot even if the purpose is char-code-property-table.
11780 2011-08-23  Eli Zaretskii  <eliz@gnu.org>
11782         * xdisp.c (redisplay_window): When computing centering_position,
11783         account for the height of the header line.  (Bug#8874)
11785         * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11786         instead of CHAR_TO_BYTE.  Fixes a crash when a completion
11787         candidate is selected by the mouse, and that candidate has a
11788         composed character under the mouse.
11790         * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1.  Fixes pixel
11791         coordinates reported by pos-visible-in-window-p for a composed
11792         character in column zero.
11794 2011-08-23  Stefan Monnier  <monnier@iro.umontreal.ca>
11796         * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11798 2011-08-22  Eli Zaretskii  <eliz@gnu.org>
11800         * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11801         consider it a hit if to_charpos is anywhere in the range of the
11802         composed buffer positions.
11804 2011-08-22  Chong Yidong  <cyd@stupidchicken.com>
11806         * image.c (gif_load): Don't assume that each subimage has the same
11807         dimensions as the base image.  Handle disposal method that is
11808         "undefined" by the gif spec (Bug#9335).
11810 2011-08-20  Chong Yidong  <cyd@stupidchicken.com>
11812         * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
11813         (Fcondition_case): Document `debug' symbol in error handler.
11815 2011-08-19  Eli Zaretskii  <eliz@gnu.org>
11817         * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11818         face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11819         from an Org mode buffer to a Speedbar frame.
11821         * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11822         a composition, take its buffer position from IT->cmp_it.charpos.
11823         Fixes cursor positioning at the beginning of a line that begins
11824         with a composed character.
11826 2011-08-18  Eli Zaretskii  <eliz@gnu.org>
11828         * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11829         character bidirectional type, use STRONG_L instead.  Fixes crashes
11830         in a buffer produced by `describe-categories'.
11832         * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11833         members before the level stack, so they would be saved and
11834         restored when copying iterator state.  Fixes incorrect reordering
11835         around TABs covered by display properties.
11837 2011-08-18  Andreas Schwab  <schwab@linux-m68k.org>
11839         * process.c (Fnetwork_interface_list): Correctly determine buffer size.
11841 2011-08-17  Chong Yidong  <cyd@stupidchicken.com>
11843         * eval.c (internal_condition_case, internal_condition_case_1)
11844         (internal_condition_case_2, internal_condition_case_n):
11845         Remove unnecessary aborts (Bug#9081).
11847 2011-08-17  Eli Zaretskii  <eliz@gnu.org>
11849         * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11850         has no `load' handler, try opening the file locally.  (Bug#9311)
11852 2011-08-16  Ken Brown  <kbrown@cornell.edu>
11854         * gmalloc.c: Expand comment.
11856 2011-08-16  Eli Zaretskii  <eliz@gnu.org>
11858         * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11859         if it fails the cursor_row_p test.  Fixes cursor positioning at ZV.
11861 2011-08-16  Ken Brown  <kbrown@cornell.edu>
11863         Fix memory allocation problems in Cygwin build (Bug#9273).
11865         * unexcw.c ( __malloc_initialized): Declare external variable.
11866         (fixup_executable): Force the dumped emacs to reinitialize malloc.
11868         * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11869         New variables.
11870         (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11871         dumped emacs.
11872         (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11873         in the static heap.
11874         [CYGWIN] (special_realloc): New function.
11875         (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11876         requests to realloc storage in the static heap.
11878 2011-08-15  Paul Eggert  <eggert@cs.ucla.edu>
11880         * bidi.c (bidi_initialize): Remove unused local.
11882 2011-08-15  Eli Zaretskii  <eliz@gnu.org>
11884         * bidimirror.h:
11885         * biditype.h: Remove file.
11886         * makefile.w32-in ($(BLD)/bidi.$(O)):
11887         * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
11889         * dispextern.h: Fix a typo in the comment to bidi_type_t.
11891         * chartab.c: Improve commentary for the uniprop_table API.
11893         * bidi.c (bidi_paragraph_init): Support zero value of
11894         bidi_ignore_explicit_marks_for_paragraph_level.
11895         (bidi_initialize): Use uniprop_table instead of including
11896         biditype.h and bidimirror.h.
11898         * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11899         coordinates of the iterator when restoring from ppos_it.
11900         (Bug#9296)
11902 2011-08-14  Kenichi Handa  <handa@m17n.org>
11904         * process.c (create_process): Call setup_process_coding_systems
11905         after the pid of the process is set to -1 (Bug#8162).
11907 2011-08-14  Eli Zaretskii  <eliz@gnu.org>
11909         * xdisp.c (move_it_in_display_line_to): Don't invoke
11910         IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11911         ppos_it.  Fixes vertical cursor motion when line beginning is
11912         covered by an image.  (Bug#9296)
11914 2011-08-14  Jan Djärv  <jan.h.d@swipnet.se>
11916         * nsterm.h (ns_run_ascript): Declare.
11917         (NSAPP_DATA2_RUNASSCRIPT): Define.
11919         * nsfns.m (as_script, as_result, as_status): New static variables.
11920         (ns_run_ascript): New function.
11921         (Fns_do_applescript): Set variables as_*.  Make an NSApplicationDefined
11922         event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11923         the event loop.  Get status from as_status (Bug#7276).
11925         * nsterm.m (sendEvent): If event is NSApplicationDefined and
11926         data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11927         the event loop (Bug#7276).
11929 2011-08-14  Andreas Schwab  <schwab@linux-m68k.org>
11931         * gnutls.c (QCgnutls_bootprop_priority)
11932         (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11933         (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11934         (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11935         (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11936         (QCgnutls_bootprop_verify_hostname_error)
11937         (QCgnutls_bootprop_callbacks_verify): Rename from
11938         Qgnutls_bootprop_..., all uses changed.
11940         * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11941         uses changed.
11943 2011-08-14  Paul Eggert  <eggert@cs.ucla.edu>
11945         * xfaces.c (Qframe_set_background_mode): Now static.
11946         * dispextern.h (Qframe_set_background_mode): Remove decl.
11948         * process.c (Fnetwork_interface_info): Declare local only if needed.
11950 2011-08-13  Jan Djärv  <jan.h.d@swipnet.se>
11952         * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11953         (Fnetwork_interface_list): Allocate in increments of bytes instead
11954         of sizeof (struct ifreq).  Iterate over ifconf.ifc_req by counting
11955         bytes (Bug#8477).  Count bytes correctly when ifr_addr is a struct
11956         sockaddr.
11957         (struct ifflag_def): notrailers is smart on OSX.
11958         (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11959         Get hardware address with getifaddrs if available.
11961 2011-08-12  Eli Zaretskii  <eliz@gnu.org>
11963         * xdisp.c (iterate_out_of_display_property): xassert that
11964         IT->position is set to within IT->object's boundaries.  Break from
11965         the loop as soon as EOB is reached; avoids infloops in redisplay
11966         when IT->position is set up wrongly due to some bug.
11967         Set IT->current to match the bidi iterator unconditionally.
11968         (push_display_prop): Allow GET_FROM_STRING as IT->method on
11969         entry.  Force push_it to save on the stack the current
11970         buffer/string position, to be restored by pop_it.  Fix flags in
11971         the iterator structure wrt the object coming from a display
11972         property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11973         properties.  (Bug#9284)
11975 2011-08-09  Andreas Schwab  <schwab@linux-m68k.org>
11977         * fontset.c (fontset_get_font_group): Add proper type checks.
11978         (Bug#9172)
11980 2011-08-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
11982         * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11983         and LC_VERSION_MIN_MACOSX.
11984         (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11985         (dump_it) [LC_FUNCTION_STARTS]: Use it.
11987 2011-08-08  Eli Zaretskii  <eliz@gnu.org>
11989         * xdisp.c (forward_to_next_line_start): Allow to use the
11990         no-display-properties-and-no-overlays under bidi display.
11991         Set disp_pos in the bidi iterator to avoid searches for display
11992         properties and overlays.
11994 2011-08-08  Chong Yidong  <cyd@stupidchicken.com>
11996         * editfns.c (Fset_time_zone_rule): Document relationship with the
11997         setenv function.
11999         * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
12000         the font entity extracted from the cache (Bug#8109).
12002 2011-08-07  Chong Yidong  <cyd@stupidchicken.com>
12004         * composite.c (autocmp_chars): Don't reset point.  That is done by
12005         restore_point_unwind (Bug#5984).
12007 2011-08-07  Juri Linkov  <juri@jurta.org>
12009         * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
12010         to show the arg `TIME' instead of `TIMEVAL'.
12012 2011-08-06  Eli Zaretskii  <eliz@gnu.org>
12014         * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12015         display property strides EOL and includes a newline, as in
12016         longlines-mode.  (Bug#9254)
12017         (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12018         word-wrap under bidirectional display.  (Bug#9224)
12020         * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12021         is non-zero, even if the data buffer is NULL.  Fixes a crash in
12022         vertical-motion with longlines-mode.  (Bug#9254)
12024 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
12026         * bidi.c <bidi_cache_total_alloc>: Now static.
12027         (bidi_initialize): Initialize bidi_cache_total_alloc.
12029         * xdisp.c (display_line): Release buffer allocated for shelved bidi
12030         cache.  (Bug#9221)
12032         * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12033         amount allocated this far in `bidi_cache_total_alloc'.
12034         (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
12035         non-zero, only free the data buffer without restoring the cache
12036         contents.  All callers changed.
12038         * dispextern.h (bidi_unshelve_cache): Update prototype.
12040         * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
12041         (move_it_in_display_line, move_it_to)
12042         (move_it_vertically_backward, move_it_by_lines): Replace the call
12043         to xfree to an equivalent call to bidi_unshelve_cache.
12044         (move_it_in_display_line_to): Fix logic of returning
12045         MOVE_POS_MATCH_OR_ZV in the bidi case.  (Bug#9224)
12047 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
12049         * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12050         came from a string character with a `cursor' property.  (Bug#9229)
12052 2011-08-04  Jan Djärv  <jan.h.d@swipnet.se>
12054         * Makefile.in (LIB_PTHREAD): New variable.
12055         (LIBES): Add LIB_PTHREAD (Bug#9216).
12057         * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12058         Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12060 2011-08-04  Andreas Schwab  <schwab@linux-m68k.org>
12062         * regex.c (re_iswctype): Remove some redundant boolean conversions.
12064 2011-08-04  Jan Djärv  <jan.h.d@swipnet.se>
12066         * xterm.c (x_find_topmost_parent): New function.
12067         (x_set_frame_alpha): Find topmost parent window with
12068         x_find_topmost_parent and set the property there also (bug#9181).
12069         (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12071 2011-08-04  Paul Eggert  <eggert@cs.ucla.edu>
12073         * callproc.c (Fcall_process): Avoid vfork clobbering
12074         the local vars buffer, coding_systems, current_dir.
12076 2011-08-03  Stefan Monnier  <monnier@iro.umontreal.ca>
12078         * keymap.c (Fmake_composed_keymap): Move to subr.el.
12080 2011-08-03  Paul Eggert  <eggert@cs.ucla.edu>
12082         * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12083         so that it is not optimized away.
12085         * xdisp.c (compute_display_string_pos): Remove unused local.
12087 2011-08-02  Eli Zaretskii  <eliz@gnu.org>
12089         Fix slow cursor motion and scrolling in large buffers with
12090         selective display, like Org Mode buffers.  (Bug#9218)
12092         * dispextern.h (struct bidi_it): New member disp_prop_p.
12094         * xdisp.c: Remove one-slot cache of display string positions.
12095         (compute_display_string_pos): Accept an additional argument
12096         DISP_PROP_P; callers changed.  Scan at most 5K characters forward
12097         for a display string or property.  If found, set DISP_PROP_P
12098         non-zero.
12100         * bidi.c (bidi_fetch_char): Accept an additional argument
12101         DISP_PROP_P, and pass it to compute_display_string_pos.
12102         Only handle text covered by a display string if DISP_PROP_P is returned
12103         non-zero.  All callers of bidi_fetch_char changed.
12105 2011-08-02  Stefan Monnier  <monnier@iro.umontreal.ca>
12107         * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12109 2010-12-03  Don March  <don@ohspite.net>
12111         * keymap.c (Fdefine_key): Fix non-prefix key error message when
12112         last character M-[char] is translated to ESC [char] (bug#7541).
12114 2011-08-02  Kenichi Handa  <handa@m17n.org>
12116         * lisp.h (uniprop_table): Extern it.
12118         * chartab.c (uniprop_table): Make it non-static.
12120 2011-08-01  Eli Zaretskii  <eliz@gnu.org>
12122         * xdisp.c (forward_to_next_line_start): Accept additional argument
12123         BIDI_IT_PREV, and store into it the state of the bidi iterator had
12124         on the newline.
12125         (reseat_at_next_visible_line_start): Use the bidi iterator state
12126         returned by forward_to_next_line_start to restore the state of
12127         it->bidi_it after backing up to previous newline.  (Bug#9212)
12129 2011-07-30  Andreas Schwab  <schwab@linux-m68k.org>
12131         * regex.c (re_comp): Protoize.
12132         (re_exec): Fix return type.
12133         (regexec): Fix type of `ret'.  (Bug#9203)
12135 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
12137         * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12138         This is needed if max-image-size is a floating-point number.
12140 2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
12142         * print.c (print_object): Print empty symbol as ##.
12144         * lread.c (read1): Read ## as empty symbol.
12146 2011-07-28  Alp Aker  <alp.tekin.aker@gmail.com>
12148         * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12149         setting frame foreground color (Bug#9175).
12150         (x_set_background_color): Likewise.
12152         * nsmenu.m (-setText): Size tooltip dimensions precisely to
12153         contents (Bug#9176).
12154         (EmacsTooltip -init): Remove bezels and add shadows to
12155         tooltip windows.
12157         * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12158         or scroll bar (Bug#8470).
12160         * nsfont.m (nsfont_open): Remove assignment to voffset and
12161         unnecessary vars hshink, expand, hd, full_height, min_height.
12162         (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12164         * nsterm.h (nsfont_info): Remove voffset field.
12166 2011-07-28  Alp Aker  <alp.tekin.aker@gmail.com>
12168         Implement strike-through and overline on NextStep (Bug#8863).
12170         * nsfont.m (nsfont_open): Use underline position provided by font,
12171         instead of hard-coded value of 2.
12172         (nsfont_draw): Call ns_draw_text_decoration instead.
12174         * nsterm.h: Add declaration for ns_draw_text_decoration.
12176         * nsterm.m (ns_draw_text_decoration): New function for drawing
12177         underline, overline, and strike-through.
12178         (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12179         ns_draw_text_decoration.  Change treatment of cursor drawing to
12180         accommodate underlining, etc.
12182 2011-07-28  Eli Zaretskii  <eliz@gnu.org>
12184         * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12185         default.
12187 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
12189         * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12190         Without this fix, if a signal arrives just after memory fills up,
12191         'malloc' might be invoked reentrantly.
12193         * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12194         In other words, assume that every image size is allowed, on non-X
12195         hosts.  This assumption is probably wrong, but it lets Emacs compile.
12197 2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
12199         * regex.c (re_iswctype): Convert return values to boolean.
12201 2011-07-28  Eli Zaretskii  <eliz@fencepost.gnu.org>
12203         * xdisp.c (compute_display_string_pos): Don't use cached display
12204         string position if the buffer had its restriction changed.
12205         (Bug#9184)
12207 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
12209         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12211 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
12213         Integer signedness and overflow and related fixes.  (Bug#9079)
12215         * bidi.c: Integer size and overflow fixes.
12216         (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12217         (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12218         (bidi_cache_find_level_change, bidi_cache_ensure_space)
12219         (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12220         (bidi_find_other_level_edge):
12221         Use ptrdiff_t instead of EMACS_INT where either will do.
12222         This works better on 32-bit hosts configured --with-wide-int.
12223         (bidi_cache_ensure_space): Check for size-calculation overflow.
12224         Use % rather than repeated addition, for better worst-case speed.
12225         Don't set bidi_cache_size until after xrealloc returns, because it
12226         might not return.
12227         (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
12228         (bidi_cache_ensure_space): Also check that the bidi cache size
12229         does not exceed that of the largest Lisp string or buffer.  See Eli
12230         Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
12232         * alloc.c (__malloc_size_t): Remove.
12233         All uses replaced by size_t.  See Andreas Schwab's note
12234         <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12236         * image.c: Improve checking for integer overflow.
12237         (check_image_size): Assume that f is nonnull, since
12238         it is always nonnull in practice.  This is one less thing to
12239         worry about when checking for integer overflow later.
12240         (x_check_image_size): New function, which checks for integer
12241         overflow issues inside X.
12242         (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12243         This removes the need for a memory_full check.
12244         (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12245         (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12246         (xbm_read_bitmap_data): Change locals back to 'int', since
12247         their values must fit in 'int'.
12248         (xpm_load_image, png_load, tiff_load):
12249         Invoke x_create_x_image_and_pixmap earlier,
12250         to avoid much needless work if the image is too large.
12251         (tiff_load): Treat overly large images as if
12252         x_create_x_image_and_pixmap failed, not as malloc failures.
12253         (gs_load): Use x_check_image_size.
12255         * gtkutil.c: Omit integer casts.
12256         (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12257         (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12259         * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12261         * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12262         Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12263         would wrongly return t on a 64-bit host.
12265         * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12266         The plain *_OVERFLOW macros run afoul of GCC bug 49705
12267         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12268         and therefore cause GCC to emit a bogus diagnostic in some cases.
12270         * image.c: Integer signedness and overflow and related fixes.
12271         This is not an exhaustive set of fixes, but it's time to
12272         record what I've got.
12273         (lookup_pixel_color, check_image_size): Remove redundant decls.
12274         (check_image_size): Don't assume that arbitrary EMACS_INT values
12275         fit in 'int', or that arbitrary 'double' values fit in 'int'.
12276         (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12277         (tiff_load, imagemagick_load_image):
12278         Check for overflow in size calculations.
12279         (x_create_x_image_and_pixmap): Remove unnecessary test for
12280         xmalloc returning NULL; that can't happen.
12281         (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12282         (xpm_color_bucket): Use better integer hashing function.
12283         (xpm_cache_color): Don't possibly over-allocate memory.
12284         (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12285         (gif_memory_source):
12286         Use ptrdiff_t, not int or size_t, to record sizes.
12287         (png_load): Don't assume values greater than 2**31 fit in 'int'.
12288         (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12289         either works, as we prefer signed integers.
12290         (tiff_read_from_memory, tiff_write_from_memory):
12291         Return tsize_t, not size_t, since that's what the TIFF API wants.
12292         (tiff_read_from_memory): Don't fail simply because the read would
12293         go past EOF; instead, return a short read.
12294         (tiff_load): Omit no-longer-needed casts.
12295         (Fimagemagick_types): Don't assume size fits into 'int'.
12297         Improve hashing quality when configured --with-wide-int.
12298         * fns.c (hash_string): New function, taken from sxhash_string.
12299         Do not discard information about ASCII character case; this
12300         discarding is no longer needed.
12301         (sxhash-string): Use it.  Change sig to match it.  Caller changed.
12302         * lisp.h: Declare it.
12303         * lread.c (hash_string): Remove, since we now use fns.c's version.
12304         The fns.c version returns a wider integer if --with-wide-int is
12305         specified, so this should help the quality of the hashing a bit.
12307         * emacs.c: Integer overflow minor fix.
12308         (heap_bss_diff): Now uprintmax_t, not unsigned long.  All used changed.
12309         Define only if GNU_LINUX.
12310         (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12312         * dispnew.c: Integer signedness and overflow fixes.
12313         Remove unnecessary forward decls, that were a maintenance hassle.
12314         (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12315         All uses changed.
12316         (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12317         (scrolling_window): Use ptrdiff_t, not int, for byte count.
12318         (prepare_desired_row, line_draw_cost):
12319         Use int, not unsigned, where either works.
12320         (save_current_matrix, restore_current_matrix):
12321         Use ptrdiff_t, not size_t, where either works.
12322         (init_display): Check for overflow more accurately, and without
12323         relying on undefined behavior.
12325         * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12326         Remove, replacing with the new symbols in lisp.h.  All uses changed.
12327         * fileio.c (make_temp_name):
12328         * filelock.c (lock_file_1, lock_file):
12329         * xdisp.c (message_dolog):
12330         Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12331         Use pMd etc. instead.
12332         * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12333         replacing the pWIDE etc. symbols removed from editfns.c.
12335         * keyboard.h (num_input_events): Now uintmax_t.
12336         This is (very slightly) less likely to mess up due to wraparound.
12337         All uses changed.
12339         * buffer.c: Integer signedness fixes.
12340         (alloc_buffer_text, enlarge_buffer_text):
12341         Use ptrdiff_t rather than size_t when either will do, as we prefer
12342         signed integers.
12344         * alloc.c: Integer signedness and overflow fixes.
12345         Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12346         (__malloc_size_t): Default to size_t, not to int.
12347         (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12348         (Fgarbage_collect, mark_object_loop_halt, mark_object):
12349         Prefer ptrdiff_t to size_t when either would do, as we prefer
12350         signed integers.
12351         (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12352         (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12353         Now const.  Initialize with values that are in range even if char
12354         is signed.
12355         (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12356         (xmalloc_put_size, xmalloc_get_size): New functions.  All uses changed.
12357         These functions do the right thing with sizes > 2**32.
12358         (check_depth): Now ptrdiff_t, not int.
12359         (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12360         Adjust to new way of storing sizes.  Check for size overflow bugs
12361         in rest of code.
12362         (STRING_BYTES_MAX): Adjust to new overheads.  The old code was
12363         slightly wrong anyway, as it missed one instance of
12364         XMALLOC_OVERRUN_CHECK_OVERHEAD.
12365         (refill_memory_reserve): Omit needless cast to size_t.
12366         (mark_object_loop_halt): Mark as externally visible.
12368         * xselect.c: Integer signedness and overflow fixes.
12369         (Fx_register_dnd_atom, x_handle_dnd_message):
12370         Use ptrdiff_t, not size_t, since we prefer signed.
12371         (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12372         * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12373         x_dnd_atoms_size and x_dnd_atoms_length.
12375         * doprnt.c: Prefer signed to unsigned when either works.
12376         * eval.c (verror):
12377         * doprnt.c (doprnt):
12378         * lisp.h (doprnt):
12379         * xdisp.c (vmessage):
12380         Use ptrdiff_t, not size_t, when using or implementing doprnt,
12381         since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12382         prefer signed arithmetic to avoid comparison confusion.
12383         * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12384         but is a bit tricky.
12386         Assume freestanding C89 headers, string.h, stdlib.h.
12387         * data.c, doprnt.c, floatfns.c, print.c:
12388         Include float.h unconditionally.
12389         * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12390         limits.h, stddef.h, string.h.  Use memset instead of 'flood'.
12391         * regex.c: Likewise for stddef.h, string.h.
12392         (ISASCII): Remove; can assume it returns 1 now.  All uses removed.
12393         * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12394         * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12395         (STDC_HEADERS): Remove obsolete defines.
12396         * sysdep.c: Include limits.h unconditionally.
12398         Assume support for memcmp, memcpy, memmove, memset.
12399         * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12400         * regex.c (memcmp, memcpy):
12401         Remove; we assume C89 now.
12403         * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12404         (__malloc_safe_bcopy): Remove; no longer needed.
12406         * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
12407         Use EMACS_INT, not EMACS_UINT, for sizes.  The code works equally
12408         well either way, and we prefer signed to unsigned.
12410 2011-07-27  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12412         * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12413         closes the connection while we're reading (bug#9182).
12415 2011-07-25  Jan Djärv  <jan.h.d@swipnet.se>
12417         * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12418         are specified (Bug#9168).
12420 2011-07-25  Paul Eggert  <eggert@cs.ucla.edu>
12422         * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12423         Found by GCC static checking and --with-wide-int on a 32-bit host.
12425 2011-07-25  Eli Zaretskii  <eliz@gnu.org>
12427         * xdisp.c (compute_display_string_pos): Fix logic of caching
12428         previous display string position.  Initialize cached_prev_pos to
12429         -1.  Fixes slow-down at the beginning of a buffer.
12431 2011-07-24  Eli Zaretskii  <eliz@gnu.org>
12433         * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12434         for attrs[LFACE_FONTSET_INDEX].
12436 2011-07-23  Paul Eggert  <eggert@cs.ucla.edu>
12438         * xml.c (parse_region): Remove unused local
12439         that was recently introduced.
12441 2011-07-23  Eli Zaretskii  <eliz@gnu.org>
12443         * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12444         2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12446         * xdisp.c (move_it_in_display_line_to): Record the best matching
12447         position for TO_CHARPOS while scanning the line, and restore it on
12448         exit if none of the characters scanned was an exact match.
12449         Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
12450         when exact match is impossible due to invisible text, and the
12451         lines are truncated.
12453 2011-07-23  Jan Djärv  <jan.h.d@swipnet.se>
12455         * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12456         for OSX >= 10.7.
12458 2011-07-22  Eli Zaretskii  <eliz@gnu.org>
12460         Fix a significant slow-down of cursor motion with C-n, C-p,
12461         C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12462         auto-repeat under bidi redisplay in fontified buffers.
12463         * xdisp.c (compute_stop_pos_backwards): New function.
12464         (next_element_from_buffer): Call compute_stop_pos_backwards to
12465         find a suitable prev_stop when we find ourselves before
12466         base_level_stop.
12467         (reseat): Don't look for prev_stop, as that could mean a very long
12468         run.
12469         <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12470         <cached_disp_overlay_modiff>: Cache for last found display string
12471         position.
12472         (compute_display_string_pos): Return the cached position if asked
12473         about the same buffer in the same area of character positions, and
12474         the buffer wasn't changed since the time the display string
12475         position was cached.
12477 2011-07-22  Eli Zaretskii  <eliz@gnu.org>
12479         * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12480         is an integer, which is important for empty lines.  (Bug#9149)
12482 2011-07-22  Chong Yidong  <cyd@stupidchicken.com>
12484         * frame.c (Fmodify_frame_parameters): In tty case, update the
12485         default face if necessary (Bug#4238).
12487 2011-07-21  Chong Yidong  <cyd@stupidchicken.com>
12489         * editfns.c (Fstring_to_char): No need to explain what a character
12490         is in the docstring (Bug#6576).
12492 2011-07-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12494         * xml.c (parse_region): Make sure we always return a tree.
12496 2011-07-20  HAMANO Kiyoto  <khiker.mail@gmail.com>
12498         * xml.c (parse_region): If a document contains only comments,
12499         return that, too.
12501 2011-07-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12503         * xml.c (make_dom): Return comments, too.
12505 2011-07-19  Paul Eggert  <eggert@cs.ucla.edu>
12507         Port to OpenBSD.
12508         See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12509         and the surrounding thread.
12510         * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12511         rather than fgets, and retry after EINTR.  Otherwise, 'emacs
12512         --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12513         timer goes off.
12514         * s/openbsd.h (BROKEN_SIGIO): Define.
12515         * unexelf.c (unexec) [__OpenBSD__]:
12516         Don't update the .mdebug section of the Alpha COFF symbol table.
12518 2011-07-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12520         * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12521         (bug#8460).
12523 2011-07-18  Paul Eggert  <eggert@cs.ucla.edu>
12525         * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12526         This fixes some race conditions on the permissions of any newly
12527         created file.
12529         * alloc.c (valid_pointer_p): Use pipe, not open.
12530         This fixes some permissions issues when debugging.
12532         * fileio.c (Fcopy_file): Adjust mode if fchown fails.  (Bug#9002)
12533         If fchown fails to set both uid and gid, try to set just gid,
12534         as that is sometimes allowed.  Adjust the file's mode to eliminate
12535         setuid or setgid bits that are inappropriate if fchown fails.
12537 2011-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
12539         * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12540         to compare Lisp_Objects.
12541         * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12542         global_gnutls_log_level, don't mistake it for a Lisp_Object.
12543         (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12545 2011-07-17  Andreas Schwab  <schwab@linux-m68k.org>
12547         * lread.c (read_integer): Unread even EOF character.
12548         (read1): Likewise.  Properly record start position of symbol.
12550         * lread.c (read1): Read `#:' as empty uninterned symbol if no
12551         symbol character follows.
12553 2011-07-17  Paul Eggert  <eggert@cs.ucla.edu>
12555         * fileio.c (Fcopy_file): Pacify gcc re fchown.  (Bug#9002)
12556         This works around a problem with the previous change to Fcopy_file.
12557         Recent glibc declares fchown with __attribute__((warn_unused_result)),
12558         and without this change, GCC might complain about discarding
12559         fchown's return value.
12561 2011-07-16  Juanma Barranquero  <lekktu@gmail.com>
12563         * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12565 2011-07-16  Paul Eggert  <eggert@cs.ucla.edu>
12567         * fileio.c (Fcopy_file): Don't diagnose fchown failures.  (Bug#9002)
12569 2011-07-16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12571         * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12572         it's used from the C level.
12574         * process.c: Use the same condition for POLL_FOR_INPUT in both
12575         keyboard.c and process.c (bug#1858).
12577 2011-07-09  Lawrence Mitchell  <wence@gmx.li>
12579         * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12580         (Fgnutls_boot): Use it.
12582 2011-07-15  Andreas Schwab  <schwab@linux-m68k.org>
12584         * doc.c (Fsubstitute_command_keys): Revert last change.
12586 2011-07-15  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12588         * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12589         quotes the next character, and doesn't affect other longer
12590         sequences (bug#8935).
12592         * lread.c (syms_of_lread): Clarify that is isn't only
12593         `eval-buffer' and `eval-defun' that's affected by
12594         `lexical-binding' (bug#8460).
12596 2011-07-15  Eli Zaretskii  <eliz@gnu.org>
12598         * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
12599         bidi redisplay when a line includes both an image and is truncated.
12601 2011-07-14  Paul Eggert  <eggert@cs.ucla.edu>
12603         Fix minor problems found by static checking.
12604         * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12605         (elsz): Now a signed constant, not a size_t var.  We prefer signed
12606         types to unsigned, to avoid integer comparison confusion.  Without
12607         this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12608         "cannot optimize loop, the loop counter may overflow", a symptom
12609         of the confusion.
12610         * indent.c (Fvertical_motion): Mark locals as initialized.
12611         * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12613 2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12615         * search.c (Fre_search_backward): Mention `case-fold-search' in
12616         all the re_search_* functions (bug#8138).
12618         * keyboard.c (Fopen_dribble_file): Document when the file is
12619         closed (bug#8056).
12621 2011-07-14  Eli Zaretskii  <eliz@gnu.org>
12623         * bidi.c (bidi_dump_cached_states): Fix format of displaying
12624         bidi_cache_idx.
12626         Support bidi reordering of display and overlay strings.
12627         * xdisp.c (compute_display_string_pos)
12628         (compute_display_string_end): Accept additional argument STRING.
12629         (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12630         (reseat_to_string): Initialize bidi_it->string.s and
12631         bidi_it->string.schars.
12632         (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
12633         NULL (avoids a crash in bidi_paragraph_init).
12634         Initialize itb.string.lstring.
12635         (init_iterator): Call bidi_init_it only of a valid
12636         buffer position was specified.  Initialize paragraph_embedding to
12637         L2R.
12638         (reseat_to_string): Initialize the bidi iterator.
12639         (display_string): If we need to ignore text properties of
12640         LISP_STRING, set IT->stop_charpos to IT->end_charpos.  (The
12641         original value of -1 will not work with bidi.)
12642         (compute_display_string_pos): First arg is now struct
12643         `text_pos *'; all callers changed.  Support display properties on
12644         Lisp strings.
12645         (compute_display_string_end): Support display properties on Lisp
12646         strings.
12647         (init_iterator, reseat_1, reseat_to_string): Initialize the
12648         string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12649         when iterating on a string not from display properties).
12650         (compute_display_string_pos, compute_display_string_end):
12651         Fix calculation of the object to scan.  Fixes an error when using
12652         arrow keys.
12653         (next_element_from_buffer): Don't abort when IT_CHARPOS is before
12654         base_level_stop; instead, set base_level_stop to BEGV.
12655         Fixes crashes in vertical-motion.
12656         (next_element_from_buffer): Improve commentary for when
12657         the iterator is before prev_stop.
12658         (init_iterator): Initialize bidi_p from the default value of
12659         bidi-display-reordering, not from buffer-local value.  Use the
12660         buffer-local value only if initializing for buffer iteration.
12661         (handle_invisible_prop): Support invisible properties on strings
12662         that are being bidi-reordered.
12663         (set_iterator_to_next): Support bidi reordering of C strings and
12664         Lisp strings.
12665         (next_element_from_string): Support bidi reordering of Lisp
12666         strings.
12667         (handle_stop_backwards): Support Lisp strings as well.
12668         (display_string): Support display of R2L glyph rows.
12669         Use IT_STRING_CHARPOS when displaying from a Lisp string.
12670         (init_iterator): Don't initialize it->bidi_p for strings
12671         here.
12672         (reseat_to_string): Initialize it->bidi_p for strings here.
12673         (next_element_from_string, next_element_from_c_string)
12674         (next_element_from_buffer): Add xassert's for correspondence
12675         between IT's object being iterated and it->bidi_it.string
12676         structure.
12677         (face_before_or_after_it_pos): Support bidi iteration.
12678         (next_element_from_c_string): Handle the case of the first string
12679         character that is not the first one in the visual order.
12680         (get_visually_first_element): New function, refactored from common
12681         parts of next_element_from_buffer, next_element_from_string, and
12682         next_element_from_c_string.
12683         (tool_bar_lines_needed, redisplay_tool_bar)
12684         (display_menu_bar): Force left-to-right direction.  Add a FIXME
12685         comment for making that be controlled by a user option.
12686         (push_it, pop_it): Save and restore the state of the
12687         bidi iterator.  Save and restore the bidi_p flag.
12688         (pop_it): Iterate out of display property for string iteration as
12689         well.
12690         (iterate_out_of_display_property): Support iteration over strings.
12691         (handle_single_display_spec): Set up it->bidi_it for iteration
12692         over a display string, and call bidi_init_it.
12693         (handle_single_display_spec, next_overlay_string)
12694         (get_overlay_strings_1, push_display_prop): Set up the bidi
12695         iterator for displaying display or overlay strings.
12696         (forward_to_next_line_start): Don't use the shortcut if
12697         bidi-iterating.
12698         (back_to_previous_visible_line_start): If handle_display_prop
12699         pushed the iterator stack, restore the internal state of the bidi
12700         iterator by calling bidi_pop_it same number of times.
12701         (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12702         and we are bidi-iterating, don't decrement the iterator position;
12703         instead, set the first_elt flag in the bidi iterator, to produce
12704         the same effect.
12705         (reseat_1): Remove redundant setting of string_from_display_prop_p.
12706         (push_display_prop): xassert that we are iterating a buffer.
12707         (push_it, pop_it): Save and restore paragraph_embedding member.
12708         (handle_single_display_spec, next_overlay_string)
12709         (get_overlay_strings_1, reseat_1, reseat_to_string)
12710         (push_display_prop): Set up the `unibyte' member of bidi_it.string
12711         correctly.  Don't assume unibyte strings are not bidi-reordered.
12712         (compute_display_string_pos)
12713         (compute_display_string_end): Fix handling the case of C string.
12714         (push_it, pop_it): Save and restore from_disp_prop_p.
12715         (handle_single_display_spec, push_display_prop): Set the
12716         from_disp_prop_p flag.
12717         (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12718         (pop_it): Call iterate_out_of_display_property only if we are
12719         popping after iteration over a string that came from a display
12720         property.  Fix a typo in popping stretch info.  Add an assertion
12721         for verifying that the iterator position is in sync with the bidi
12722         iterator.
12723         (handle_single_display_spec, get_overlay_strings_1)
12724         (push_display_prop): Fix initialization of paragraph direction for
12725         string when that of the parent object is not yet determined.
12726         (reseat_1): Call bidi_init_it to resync the bidi
12727         iterator with IT's position.  (Bug#7616)
12728         (find_row_edges): If ROW->start.pos gives position
12729         smaller than min_pos, use it as ROW->minpos.  (Bug#7616)
12730         (handle_stop, back_to_previous_visible_line_start, reseat_1):
12731         Reset the from_disp_prop_p flag.
12732         (SAVE_IT, RESTORE_IT): New macros.
12733         (pos_visible_p, face_before_or_after_it_pos)
12734         (back_to_previous_visible_line_start)
12735         (move_it_in_display_line_to, move_it_in_display_line)
12736         (move_it_to, move_it_vertically_backward, move_it_by_lines)
12737         (try_scrolling, redisplay_window, display_line): Use them when
12738         saving a temporary copy of the iterator and restoring it back.
12739         (back_to_previous_visible_line_start, reseat_1)
12740         (init_iterator): Empty the bidi cache "stack".
12741         (move_it_in_display_line_to): If iterator ended up at
12742         EOL, but we never saw any buffer positions smaller than
12743         to_charpos, return MOVE_POS_MATCH_OR_ZV.  Fixes vertical cursor
12744         motion in bidi-reordered lines.
12745         (move_it_in_display_line_to): Record prev_method and prev_pos
12746         immediately before the call to set_iterator_to_next.  Fixes cursor
12747         motion in bidi-reordered lines with stretch glyphs and strings
12748         displayed in margins.  (Bug#8133) (Bug#8867)
12749         Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12750         TO_CHARPOS.
12751         (pos_visible_p): Support positions in bidi-reordered lines.
12752         Save and restore bidi cache.
12754         * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12755         (bidi_paragraph_info): Delete unused struct.
12756         (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12757         (bidi_cache_start): New variable.
12758         (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12759         to zero.
12760         (bidi_cache_fetch_state, bidi_cache_search)
12761         (bidi_cache_find_level_change, bidi_cache_iterator_state)
12762         (bidi_cache_find, bidi_peek_at_next_level)
12763         (bidi_level_of_next_char, bidi_find_other_level_edge)
12764         (bidi_move_to_visually_next): Compare cache index with
12765         bidi_cache_start rather than with zero.
12766         (bidi_fetch_char): Accept new argument STRING; all callers
12767         changed.  Support iteration over a string.  Support strings with
12768         display properties.  Support unibyte strings.  Fix the type of
12769         `len' according to what STRING_CHAR_AND_LENGTH expects.
12770         (bidi_paragraph_init, bidi_resolve_explicit_1)
12771         (bidi_resolve_explicit, bidi_resolve_weak)
12772         (bidi_level_of_next_char, bidi_move_to_visually_next):
12773         Support iteration over a string.
12774         (bidi_set_sor_type, bidi_resolve_explicit_1)
12775         (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12776         can now be zero (for strings); special values 0 and -1 were
12777         changed to -1 and -2, respectively.
12778         (bidi_char_at_pos): New function.
12779         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12780         Call it instead of FETCH_MULTIBYTE_CHAR.
12781         (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12782         initialized to valid values.
12783         (bidi_init_it): Don't initialize charpos and bytepos with invalid
12784         values.
12785         (bidi_level_of_next_char): Allow the sentinel "position" to pass
12786         the test for valid cached positions.  Fix the logic for looking up
12787         the sentinel state in the cache.  GCPRO the Lisp string we are
12788         iterating.
12789         (bidi_push_it, bidi_pop_it): New functions.
12790         (bidi_initialize): Initialize the bidi cache start stack pointer.
12791         (bidi_cache_ensure_space): New function, refactored from part of
12792         bidi_cache_iterator_state.  Don't assume the required size is just
12793         one BIDI_CACHE_CHUNK away.
12794         (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12795         (bidi_count_bytes, bidi_char_at_pos): New functions.
12796         (bidi_cache_search): Don't assume bidi_cache_last_idx is
12797         always valid if bidi_cache_idx is valid.
12798         (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12799         is valid if it's going to be used.
12800         (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12801         (bidi_cache_fetch_state, bidi_cache_search)
12802         (bidi_cache_find_level_change, bidi_cache_ensure_space)
12803         (bidi_cache_iterator_state, bidi_cache_find)
12804         (bidi_find_other_level_edge, bidi_cache_start_stack):
12805         All variables related to cache indices are now EMACS_INT.
12807         * dispextern.h (struct bidi_string_data): New structure.
12808         (struct bidi_it): New member `string'.  Make flag members be 1-bit
12809         fields, and put them last in the struct.
12810         (compute_display_string_pos, compute_display_string_end):
12811         Update prototypes.
12812         (bidi_push_it, bidi_pop_it): Add prototypes.
12813         (struct iterator_stack_entry): New members bidi_p,
12814         paragraph_embedding, and from_disp_prop_p.
12815         (struct it): Member bidi_p is now a bit field 1 bit wide.
12816         (bidi_shelve_cache, bidi_unshelve_cache):
12817         Declare prototypes.
12819         * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12820         (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12821         and vector-like objects.
12823         * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12824         cache around display iteration.
12826         * window.c (Fwindow_end, window_scroll_pixel_based)
12827         (displayed_window_lines, Frecenter): Save and restore the bidi
12828         cache around display iteration.
12830 2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12832         * editfns.c (Fdelete_region): Clarify the use of the named
12833         parameters (bug#6788).
12835 2011-07-14  Martin Rudalics  <rudalics@gmx.at>
12837         * indent.c (Fvertical_motion): Set and restore w->pointm when
12838         saving and restoring the window's buffer (Bug#9006).
12840 2011-07-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12842         * editfns.c (Fstring_to_char): Clarify just what is returned
12843         (bug#6576).  Text by Eli Zaretskii.
12845 2011-07-13  Juanma Barranquero  <lekktu@gmail.com>
12847         * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12849 2011-07-13  Eli Zaretskii  <eliz@gnu.org>
12851         * buffer.c (mmap_find): Fix a typo.
12853 2011-07-13  Johan Bockgård  <bojohan@gnu.org>
12855         Fix execution of x selection hooks.
12856         * xselect.c (Qx_lost_selection_functions)
12857         (Qx_sent_selection_functions): New vars.
12858         (syms_of_xselect): DEFSYM them.
12859         (x_handle_selection_request): Pass Qx_sent_selection_functions
12860         rather than Vx_sent_selection_functions to Frun_hook_with_args.
12861         (x_handle_selection_clear,x_clear_frame_selections):
12862         Pass Qx_lost_selection_functions rather than
12863         Vx_lost_selection_functions to Frun_hook_with_args.
12865 2011-07-13  Paul Eggert  <eggert@cs.ucla.edu>
12867         * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
12868         The old code sometimes used this field without initializing it.
12870         * alloc.c (gc_sweep): Don't read past end of array.
12871         In theory, the old code could also have corrupted Emacs internals,
12872         though it'd be very unlikely.
12874 2011-07-12  Andreas Schwab  <schwab@linux-m68k.org>
12876         * character.c (Fcharacterp): Don't advertise optional ignored
12877         argument.  (Bug#4026)
12879 2011-07-12  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12881         * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12882         key" (bug#4257).
12884         * window.c (Fset_window_start): Doc fix (bug#4199).
12885         (Fset_window_hscroll): Ditto.
12887 2011-07-12  Paul Eggert  <eggert@cs.ucla.edu>
12889         Fix minor new problems caught by GCC 4.6.1.
12890         * term.c (init_tty): Remove unused local.
12891         * xsettings.c (store_monospaced_changed): Define this function only
12892         if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
12893         not used otherwise.
12895 2011-07-12  Chong Yidong  <cyd@stupidchicken.com>
12897         * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12899 2011-07-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12901         * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12902         are the mini-buffer and the echo area (bug#3320).
12904         * term.c (init_tty): Remove support for supdup, c10 and perq
12905         terminals, which are no longer supported (bug#1482).
12907 2011-07-10  Johan Bockgård  <bojohan@gnu.org>
12909         * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12911 2011-07-10  Jan Djärv  <jan.h.d@swipnet.se>
12913         * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12914         for non-popups (Bug#3642).
12916 2011-07-10  Andreas Schwab  <schwab@linux-m68k.org>
12918         * alloc.c (reset_malloc_hooks): Protoize.
12919         * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
12920         (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12921         * cm.c (losecursor): Likewise.
12922         * data.c (fmod): Likewise.
12923         * dispnew.c (swap_glyphs_in_rows): Likewise.
12924         * emacs.c (memory_warning_signal): Likewise.
12925         * floatfns.c (float_error): Likewise.
12926         * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12927         (otf_open, font_otf_capability, generate_otf_features)
12928         (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12929         Likewise.
12930         * image.c (pbm_read_file): Likewise.
12931         * indent.c (string_display_width): Likewise.
12932         * intervals.c (check_for_interval, search_for_interval)
12933         (inc_interval_count, count_intervals, root_interval)
12934         (adjust_intervals_for_insertion, make_new_interval): Likewise.
12935         * lread.c (defalias): Likewise.
12936         * ralloc.c (r_alloc_check): Likewise.
12937         * regex.c (set_image_of_range_1, set_image_of_range)
12938         (regex_grow_registers): Likewise.
12939         * sysdep.c (strerror): Likewise.
12940         * termcap.c (valid_filename_p, tprint, main): Likewise.
12941         * tparam.c (main): Likewise.
12942         * unexhp9k800.c (run_time_remap, save_data_space)
12943         (update_file_ptrs, read_header, write_header, calculate_checksum)
12944         (copy_file, copy_rest, display_header): Likewise.
12945         * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12946         Likewise.
12947         * xdisp.c (check_it): Likewise.
12948         * xfaces.c (register_color, unregister_color, unregister_colors):
12949         Likewise.
12950         * xfns.c (print_fontset_result): Likewise.
12951         * xrdb.c (member, fatal, main): Likewise.
12953 2011-07-10  Paul Eggert  <eggert@cs.ucla.edu>
12955         Fix minor problems found by static checking (Bug#9031).
12956         * chartab.c (char_table_set_range, map_sub_char_table):
12957         Remove unused locals.
12958         (uniprop_table): Now static.
12959         * composite.c (_work_char): Remove unused static var.
12961 2011-07-09  Juanma Barranquero  <lekktu@gmail.com>
12963         * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12965 2011-07-09  Jan Djärv  <jan.h.d@swipnet.se>
12967         * gtkutil.c (qttip_cb): Remove code without function.
12969 2011-07-09  Eli Zaretskii  <eliz@gnu.org>
12971         * w32.c (pthread_sigmask): New stub.
12973 2011-07-08  Paul Eggert  <eggert@cs.ucla.edu>
12975         Use pthread_sigmask, not sigprocmask (Bug#9010).
12976         sigprocmask is portable only for single-threaded applications, and
12977         Emacs can be multi-threaded when it uses GTK.
12978         * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12979         (LIBES): Use it.
12980         * callproc.c (Fcall_process):
12981         * process.c (create_process):
12982         * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12983         Use pthread_sigmask, not sigprocmask.
12985 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
12987         * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12988         (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12989         wrong (Bug#8591).
12991 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
12993         * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12994         Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12995         (xg_hide_tooltip): Fix comment.
12997         * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12998         in registerServicesMenuSendTypes.
12999         (validRequestorForSendType): Don't check ns_return_types.
13001         * nsfns.m (Fx_open_connection): Put NSStringPboardType into
13002         ns_return_type.
13004 2011-07-08  Jason Rumney  <jasonr@gnu.org>
13006         * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
13007         SH_SHOW for hidden windows (Bug#5482).
13009         * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
13010         frame struct members of non-existent frames (Bug#6284).
13012 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
13014         * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13015         variable firstTime not needed on OSX >= 10.6.
13016         (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13017         >= 10.5.  Use setKnobProportion, setDoubleValue.
13019         * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13020         (MAC_OS_X_VERSION_10_5): Define if not defined.
13021         (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13022         (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13023         (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13025         * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
13026         cString and lossyCString on OSX >= 10.4.
13028         * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
13029         sizeToFit on OSX >= 10.2.
13031         * nsimage.m (allocInitFromFile): Don't use deprecated method
13032         bestRepresentationForDevice on OSX >= 10.6.
13034         * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
13035         to avoid warning.
13037         * emacs.c: Declare unexec_init_emacs_zone.
13039         * nsgui.h: Fix compiler warning about gnulib redefining verify.
13041         * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
13043         * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13044         on svcsMenu (Bug#8842).
13046         * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13047         ns_return_types.
13048         (Fns_list_services): Just return Qnil on 10.6, code not working there.
13050         * nsterm.m (QUTF8_STRING): Declare.
13051         (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13052         (validRequestorForSendType): Return type is (id).
13053         Change indexOfObjectIdenticalTo to indexOfObject.
13054         Check if we have local selection before returning self (Bug#8842).
13055         (writeSelectionToPasteboard): Put local selection into paste board
13056         if we have a local selection (Bug#8842).
13057         (syms_of_nsterm): DEFSYM QUTF8_STRING.
13059         * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13060         (ns_get_local_selection): Declare.
13062 2011-07-07  Lars Magne Ingebrigtsen  <larsi@gnus.org>
13064         * keymap.c (describe_map_tree): Don't insert a double newline at
13065         the end of the buffer (bug#1169) and return whether we inserted
13066         something.
13068         * callint.c (Fcall_interactively): Change "reading args" to
13069         "providing args" to try to clarify what it does (bug#1010).
13071 2011-07-07  Kenichi Handa  <handa@m17n.org>
13073         * composite.c (composition_compute_stop_pos): Ignore a static
13074         composition starting before CHARPOS (Bug#8915).
13076         * xdisp.c (handle_composition_prop): Likewise.
13078 2011-07-07  Eli Zaretskii  <eliz@gnu.org>
13080         * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13081         (Bug#9015)
13083 2011-07-07  Kenichi Handa  <handa@m17n.org>
13085         * character.h (unicode_category_t): New enum type.
13087         * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13088         (Qchar_code_property_table): New variable.
13089         (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13090         (UNIPROP_COMPRESSED_FORM_P): New macros.
13091         (char_table_ascii): Uncompress the compressed values.
13092         (sub_char_table_ref): New arg is_uniprop.  Callers changed.
13093         Uncompress the compressed values.
13094         (sub_char_table_ref_and_range): Likewise.
13095         (char_table_ref_and_range): Uncompress the compressed values.
13096         (sub_char_table_set): New arg is_uniprop.  Callers changed.
13097         Uncompress the compressed values.
13098         (sub_char_table_set_range): Args changed.  Callers changed.
13099         (char_table_set_range): Adjuted for the above change.
13100         (map_sub_char_table): Delete args default_val and parent.  Add arg
13101         top.  Give decoded values to a Lisp function.
13102         (map_char_table): Adjust for the above change.  Give decoded
13103         values to a Lisp function.  Gcpro more variables.
13104         (uniprop_table_uncompress)
13105         (uniprop_decode_value_run_length): New functions.
13106         (uniprop_decoder, uniprop_decoder_count): New variables.
13107         (uniprop_get_decoder, uniprop_encode_value_character)
13108         (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13109         New functions.
13110         (uniprop_encoder, uniprop_encoder_count): New variables.
13111         (uniprop_get_encoder, uniprop_table)
13112         (Funicode_property_table_internal, Fget_unicode_property_internal)
13113         (Fput_unicode_property_internal): New functions.
13114         (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13115         Sunicode_property_table_internal, Sget_unicode_property_internal,
13116         and Sput_unicode_property_internal.  Defvar_lisp
13117         char-code-property-alist.
13119         * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
13120         Vunicode_category_table.
13122         * font.c (font_range): Adjust for the change of
13123         Vunicode_category_table.
13125 2011-07-07  Dan Nicolaescu  <dann@ics.uci.edu>
13127         * m/iris4d.h: Remove file, move contents ...
13128         * s/irix6-5.h: ... here.
13130 2011-07-06  Paul Eggert  <eggert@cs.ucla.edu>
13132         Remove unportable assumption about struct layout (Bug#8884).
13133         * alloc.c (mark_buffer):
13134         * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13135         (clone_per_buffer_values): Don't assume that
13136         sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13137         This isn't true in general, and it's particularly not true
13138         if Emacs is configured with --with-wide-int.
13139         * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13140         New macros, used in the buffer.c change.
13142 2011-07-05  Jan Djärv  <jan.h.d@swipnet.se>
13144         * xsettings.c: Use both GConf and GSettings if both are available.
13145         (store_config_changed_event): Add comment.
13146         (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13147         (store_tool_bar_style_changed): New functions.
13148         (store_monospaced_changed): Add comment.  Call dpyinfo_valid.
13149         (struct xsettings): Move font inside HAVE_XFT.
13150         (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
13151         (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
13152         Move inside HAVE_XFT.
13153         (something_changed_gsettingsCB): Rename from something_changedCB.
13154         Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13155         also.
13156         (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
13157         (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT.  Move inside HAVE_XFT.
13158         (something_changed_gconfCB): Rename from something_changedCB.
13159         Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13160         (parse_settings): Move check for font inside HAVE_XFT.
13161         (read_settings, apply_xft_settings): Add comment.
13162         (read_and_apply_settings): Add comment.  Call map_tool_bar_style and
13163         store_tool_bar_style_changed.  Move check for font inside HAVE_XFT and
13164         call store_font_name_changed.
13165         (xft_settings_event): Add comment.
13166         (init_gsettings): Add comment.  Get values for GSETTINGS_TOOL_BAR_STYLE
13167         and GSETTINGS_FONT_NAME.  Move check for fonts within HAVE_XFT.
13168         (init_gconf): Add comment.  Get values for GCONF_TOOL_BAR_STYLE
13169         and GCONF_FONT_NAME.  Move check for fonts within HAVE_XFT.
13170         (xsettings_initialize): Call init_gsettings last.
13171         (xsettings_get_system_font, xsettings_get_system_normal_font):
13172         Add comment.
13174 2011-07-05  Paul Eggert  <eggert@cs.ucla.edu>
13176         Random fixes.  E.g., (random) never returned negative values.
13177         * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13178         subseconds part to the entropy, as that's a bit more random.
13179         Prefer signed to unsigned, since the signedness doesn't matter and
13180         in general we prefer signed.  When given a limit, use a
13181         denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13182         latter isn't right if USE_2_TAGS_FOR_INTS.
13183         * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13184         not 0..VALMASK.  Don't discard "excess" bits that random () returns.
13186 2011-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
13188         * textprop.c (text_property_stickiness):
13189         Obey Vtext_property_default_nonsticky.
13190         (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13191         * w32fns.c (syms_of_w32fns):
13192         * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13194 2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
13196         * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13197         This is more efficient than Ffile_directory_p and avoids a minor race.
13199 2011-07-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
13201         * buffer.c (Foverlay_put): Say what the return value is
13202         (bug#7835).
13204         * fileio.c (barf_or_query_if_file_exists): Check first if the file
13205         is a directory before asking whether to use the file name
13206         (bug#7564).
13207         (barf_or_query_if_file_exists): Make the "File is a directory"
13208         error be more correct.
13210         * fns.c (Frequire): Remove the mention of the .gz files, since
13211         that's installation-specific, but keep the mention of
13212         `get-load-suffixes'.
13214 2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
13216         * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13217         Report string overflow if the output is too long.
13219 2011-07-04  Juanma Barranquero  <lekktu@gmail.com>
13221         * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13222         (syms_of_gnutls): Remove duplicate DEFSYM for
13223         Qgnutls_bootprop_verify_hostname_error, an error for
13224         Qgnutls_bootprop_verify_error (which is no longer used).
13226         * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13227         unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca.  All callers changed.
13228         Also (re)move comments that are misplaced or no longer relevant.
13230 2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
13232         * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13234 2011-07-03  Chong Yidong  <cyd@stupidchicken.com>
13236         * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13237         and background color parameters if they have been changed.
13239 2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
13241         * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13243 2011-07-03  Paul Eggert  <eggert@cs.ucla.edu>
13245         * xsettings.c (SYSTEM_FONT): Define only when used.
13246         No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13248         * keymap.c (access_keymap_1): Now static.
13250 2011-07-02  Chong Yidong  <cyd@stupidchicken.com>
13252         * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13253         leave any prefix arg for the up event (Bug#1586).
13255 2011-07-02  Lars Magne Ingebrigtsen  <larsi@gnus.org>
13257         * lread.c (syms_of_lread): Mention single symbols defined by
13258         `defvar' or `defconst' (bug#7154).
13260         * fns.c (Frequire): Mention .el.gz files (bug#7314).
13261         (Frequire): Mention get-load-suffixes.
13263 2011-07-02  Martin Rudalics  <rudalics@gmx.at>
13265         * window.h (window): Remove clone_number slot.
13266         * window.c (Fwindow_clone_number, Fset_window_clone_number):
13267         Remove.
13268         (make_parent_window, make_window, saved_window)
13269         (Fset_window_configuration, save_window_save): Don't deal with
13270         clone numbers.
13271         * buffer.c (Qclone_number): Remove declaration.
13272         (sort_overlays, overlay_strings): Don't deal with clone numbers.
13274 2011-07-02  Stefan Monnier  <monnier@iro.umontreal.ca>
13276         Add multiple inheritance to keymaps.
13277         * keymap.c (Fmake_composed_keymap): New function.
13278         (Fset_keymap_parent): Simplify.
13279         (fix_submap_inheritance): Remove.
13280         (access_keymap_1): New function extracted from access_keymap to handle
13281         embedded parents and handle lists of maps.
13282         (access_keymap): Use it.
13283         (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13284         (Fcopy_keymap): Handle embedded parents.
13285         (Fcommand_remapping, define_as_prefix): Simplify.
13286         (Fkey_binding): Simplify.
13287         (syms_of_keymap): Move minibuffer-local-completion-map,
13288         minibuffer-local-filename-completion-map,
13289         minibuffer-local-must-match-map, and
13290         minibuffer-local-filename-must-match-map to Elisp.
13291         (syms_of_keymap): Defsubr make-composed-keymap.
13292         * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13293         (parse_menu_item): Trivial simplification.
13295 2011-07-01  Glenn Morris  <rgm@gnu.org>
13297         * Makefile.in (SETTINGS_LIBS): Fix typo.
13299 2011-07-01  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
13301         * coding.c (Fencode_coding_string): Record the last coding system
13302         used, as the function doc string says (bug#8738).
13304 2011-07-01  Jan Djärv  <jan.h.d@swipnet.se>
13306         * xsettings.c (store_monospaced_changed): Take new font as arg and
13307         check for change against current_mono_font.
13308         (EMACS_TYPE_SETTINGS): Remove this and related defines.
13309         (emacs_settings_constructor, emacs_settings_get_property)
13310         (emacs_settings_set_property, emacs_settings_class_init)
13311         (emacs_settings_init, gsettings_obj): Remove.
13312         (something_changedCB): New function for HAVE_GSETTINGS.
13313         (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13314         with value as argument.
13315         (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13316         g_settings_new (Bug#8967).  Do not create gsettings_obj.
13317         Remove calls to g_settings_bind.  Connect something_changedCB to
13318         "changed".
13320         * xgselect.c: Add defined (HAVE_GSETTINGS).
13321         (xgselect_initialize): Ditto.
13323         * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13324         (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13325         xg_select.
13327 2011-07-01  Paul Eggert  <eggert@cs.ucla.edu>
13329         * eval.c (struct backtrace): Simplify and port the data structure.
13330         Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13331         signed bit field, as this assumption is not portable and it makes
13332         Emacs crash when compiled with Sun C 5.8 on sparc.  Do not use
13333         "char debug_on_exit : 1" as this is not portable either; instead,
13334         use the portable "unsigned int debug_on_exit : 1".  Remove unused
13335         member evalargs.  Remove obsolete comments about cc bombing out.
13337 2011-06-30  Jan Djärv  <jan.h.d@swipnet.se>
13339         * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
13340         Let HAVE_GSETTINGS override HAVE_GCONF.
13341         (store_monospaced_changed): New function.
13342         (EMACS_SETTINGS): A new type derived from GObject to handle
13343         GSettings notifications.
13344         (emacs_settings_constructor, emacs_settings_get_property)
13345         (emacs_settings_set_property, emacs_settings_class_init):
13346         New functions.
13347         (gsettings_client, gsettings_obj): New variables.
13348         (GSETTINGS_SCHEMA): New define.
13349         (something_changedCB): Call store_monospaced_changed.
13350         (init_gsettings): New function.
13351         (xsettings_initialize): Call init_gsettings.
13352         (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13353         to NULL.
13355         * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
13356         GCONF_CFLAGS/LIBS.
13358 2011-06-29  Martin Rudalics  <rudalics@gmx.at>
13360         * window.c (resize_root_window, grow_mini_window)
13361         (shrink_mini_window): Rename Qresize_root_window to
13362         Qwindow_resize_root_window and Qresize_root_window_vertically to
13363         Qwindow_resize_root_window_vertically.
13365 2011-06-28  Paul Eggert  <eggert@cs.ucla.edu>
13367         * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13369 2011-06-27  Juanma Barranquero  <lekktu@gmail.com>
13371         * makefile.w32-in: Redesign dependencies so they reflect more
13372         clearly which files are directly included by each source file,
13373         and not through other includes.
13375 2011-06-27  Martin Rudalics  <rudalics@gmx.at>
13377         * buffer.c (Qclone_number): Declare static and DEFSYM it.
13378         (sort_overlays, overlay_strings): When an overlay's clone number
13379         matches the window's clone number process the overlay even if
13380         the overlay's window property doesn't match the current window.
13382         * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13383         (Fwindow_hchild): Rename to Fwindow_left_child.
13384         (Fwindow_next): Rename to Fwindow_next_sibling.
13385         (Fwindow_prev): Rename to Fwindow_prev_sibling.
13386         (resize_window_check): Rename to window_resize_check.
13387         (resize_window_apply): Rename to window_resize_apply.
13388         (Fresize_window_apply): Rename to Fwindow_resize_apply.
13389         (Fdelete_other_windows_internal, resize_frame_windows)
13390         (Fsplit_window_internal, Fdelete_window_internal)
13391         (grow_mini_window, shrink_mini_window)
13392         (Fresize_mini_window_internal): Fix callers accordingly.
13394 2011-06-26  Jan Djärv  <jan.h.d@swipnet.se>
13396         * emacsgtkfixed.h: State that this is only used with Gtk+3.
13397         (emacs_fixed_set_min_size): Remove.
13398         (emacs_fixed_new): Take frame as argument.
13400         * emacsgtkfixed.c: State that this is only used with Gtk+3.
13401         (_EmacsFixedPrivate): Remove minwidth/height.
13402         Add struct frame *f.
13403         (emacs_fixed_init): Initialize priv->f.
13404         (get_parent_class, emacs_fixed_set_min_size): Remove.
13405         (emacs_fixed_new): Set priv->f to argument.
13406         (emacs_fixed_get_preferred_width)
13407         (emacs_fixed_get_preferred_height): Use min_width/height from
13408         frames size_hint to set minimum and natural (Bug#8919).
13409         (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13410         and use min_width/height from frames size_hint to set
13411         min_width/height (Bug#8919).
13413         * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
13414         (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13415         Fix indentation.
13417 2011-06-26  Eli Zaretskii  <eliz@gnu.org>
13419         * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13420         bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13421         called at ZV.
13423 2011-06-26  Chong Yidong  <cyd@stupidchicken.com>
13425         * process.c (wait_reading_process_output): Bypass select if
13426         waiting for a cell while ignoring keyboard input, and input is
13427         pending.  Suggested by Jan Djärv (Bug#8869).
13429 2011-06-25  Paul Eggert  <eggert@cs.ucla.edu>
13431         Use gnulib's dup2 module instead of rolling our own.
13432         * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13434 2011-06-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
13436         * dispnew.c (scrolling_window): Before scrolling, turn off a
13437         mouse-highlight in the window being scrolled.
13439 2011-06-24  Juanma Barranquero  <lekktu@gmail.com>
13441         Move DEFSYM to lisp.h and use everywhere.
13443         * character.h (DEFSYM): Move declaration...
13444         * lisp.h (DEFSYM): ...here.
13446         * gnutls.c:
13447         * minibuf.c:
13448         * w32menu.c:
13449         * w32proc.c:
13450         * w32select.c: Don't include character.h.
13452         * alloc.c (syms_of_alloc):
13453         * buffer.c (syms_of_buffer):
13454         * bytecode.c (syms_of_bytecode):
13455         * callint.c (syms_of_callint):
13456         * casefiddle.c (syms_of_casefiddle):
13457         * casetab.c (init_casetab_once):
13458         * category.c (init_category_once, syms_of_category):
13459         * ccl.c (syms_of_ccl):
13460         * cmds.c (syms_of_cmds):
13461         * composite.c (syms_of_composite):
13462         * dbusbind.c (syms_of_dbusbind):
13463         * dired.c (syms_of_dired):
13464         * dispnew.c (syms_of_display):
13465         * doc.c (syms_of_doc):
13466         * editfns.c (syms_of_editfns):
13467         * emacs.c (syms_of_emacs):
13468         * eval.c (syms_of_eval):
13469         * fileio.c (syms_of_fileio):
13470         * fns.c (syms_of_fns):
13471         * frame.c (syms_of_frame):
13472         * fringe.c (syms_of_fringe):
13473         * insdel.c (syms_of_insdel):
13474         * keymap.c (syms_of_keymap):
13475         * lread.c (init_obarray, syms_of_lread):
13476         * macros.c (syms_of_macros):
13477         * msdos.c (syms_of_msdos):
13478         * print.c (syms_of_print):
13479         * process.c (syms_of_process):
13480         * search.c (syms_of_search):
13481         * sound.c (syms_of_sound):
13482         * syntax.c (init_syntax_once, syms_of_syntax):
13483         * terminal.c (syms_of_terminal):
13484         * textprop.c (syms_of_textprop):
13485         * undo.c (syms_of_undo):
13486         * w32.c (globals_of_w32):
13487         * window.c (syms_of_window):
13488         * xdisp.c (syms_of_xdisp):
13489         * xfaces.c (syms_of_xfaces):
13490         * xfns.c (syms_of_xfns):
13491         * xmenu.c (syms_of_xmenu):
13492         * xsettings.c (syms_of_xsettings):
13493         * xterm.c (syms_of_xterm): Use DEFSYM.
13495 2011-06-24  Teodor Zlatanov  <tzz@lifelogs.com>
13497         * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
13499 2011-06-23  Paul Eggert  <eggert@cs.ucla.edu>
13501         Integer and buffer overflow fixes (Bug#8873).
13503         * print.c (printchar, strout): Check for string overflow.
13504         (PRINTPREPARE, printchar, strout):
13505         Don't set size unless allocation succeeds.
13507         * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13508         for sizes.  Check for string overflow more accurately.
13509         Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13511         * macros.c: Integer and buffer overflow fixes.
13512         * keyboard.h (struct keyboard.kbd_macro_bufsize):
13513         * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13514         Use ptrdiff_t, not int, for sizes.
13515         Don't increment bufsize until after realloc succeeds.
13516         Check for size-calculation overflow.
13517         (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13519         * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13521         * lread.c: Integer overflow fixes.
13522         (read_integer): Radix is now EMACS_INT, not int,
13523         to improve quality of diagnostics for out-of-range radices.
13524         Calculate buffer size correctly for out-of-range radices.
13525         (read1): Check for integer overflow in radices, and in
13526         read-circle numbers.
13527         (read_escape): Avoid int overflow.
13528         (Fload, openp, read_buffer_size, read1)
13529         (substitute_object_recurse, read_vector, read_list, map_obarray):
13530         Use ptrdiff_t, not int, for sizes.
13531         (read1): Use EMACS_INT, not int, for sizes.
13532         Check for size overflow.
13534         * image.c (cache_image): Check for size arithmetic overflow.
13536         * lread.c: Integer overflow issues.
13537         (saved_doc_string_size, saved_doc_string_length)
13538         (prev_saved_doc_string_size, prev_saved_doc_string_length):
13539         Now ptrdiff_t, not int.
13540         (read1): Don't assume doc string length fits in int.  Check for
13541         out-of-range doc string lengths.
13542         (read_list): Don't assume file position fits in int.
13543         (read_escape): Check for hex character overflow.
13545 2011-06-22  Leo Liu  <sdl.web@gmail.com>
13547         * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13548         Move to minibuffer.el.
13550 2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
13552         Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
13553         The following patches are for when GLYPH_DEBUG && !XASSERT.
13554         * dispextern.h (trace_redisplay_p, dump_glyph_string):
13555         * dispnew.c (flush_stdout):
13556         * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13557         Mark as externally visible.
13558         * dispnew.c (check_window_matrix_pointers): Now static.
13559         * dispnew.c (window_to_frame_vpos):
13560         * xfns.c (unwind_create_frame):
13561         * xterm.c (x_check_font): Remove unused local.
13562         * scroll.c (CHECK_BOUNDS):
13563         * xfaces.c (cache_fache): Rename local to avoid shadowing.
13564         * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13565         * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13566         (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13567         (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13568         Now static.
13569         (debug_method_add): Use va_list and vsprintf rather than relying
13570         on undefined behavior with wrong number of arguments.
13571         (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13572         Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13573         In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13574         since we're not interested in debugging glyphs with old libraries.
13575         * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13576         GCC 4.6.0's static checking.
13578 2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
13580         Integer overflow and signedness fixes (Bug#8873).
13581         A few related buffer overrun fixes, too.
13583         * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13585         * dispextern.h (struct face.stipple):
13586         * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13587         (x_bitmap_mask, x_allocate_bitmap_record)
13588         (x_create_bitmap_from_data, x_create_bitmap_from_file)
13589         (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13590         (x_create_bitmap_from_xpm_data):
13591         * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13592         * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13593         (.bitmaps_last):
13594         * xfaces.c (load_pixmap):
13595         * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13596         * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13597         (.bitmaps_last, struct x_output.icon_bitmap):
13598         Use ptrdiff_t, not int, for bitmap indexes.
13599         (x_allocate_bitmap_record): Check for size overflow.
13600         * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13602         Use ptrdiff_t, not int, for overlay counts.
13603         * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13604         * editfns.c (overlays_around, get_pos_property):
13605         * textprop.c (get_char_property_and_overlay):
13606         * xdisp.c (next_overlay_change, note_mouse_highlight):
13607         * xfaces.c (face_at_buffer_position):
13608         * buffer.c (OVERLAY_COUNT_MAX): New macro.
13609         (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13610         (Fnext_overlay_change, Fprevious_overlay_change)
13611         (mouse_face_overlay_overlaps, Foverlays_in):
13612         Use ptrdiff_t, not int, for sizes.
13613         (overlays_at, overlays_in): Check for size-calculation overflow.
13615         * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13617         * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13618         (x_session_initialize): Do not assume string length fits in int.
13620         * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13621         This is unlikely, but can occur if DPI is outlandish.
13623         * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
13624         * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13626         * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13627         * xrdb.c (magic_file_p, search_magic_path):
13628         Omit last arg SUFFIX; it was always 0.  All callers changed.
13629         (magic_file_p): Use ptrdiff_t, not int.  Check for size overflow.
13631         * xfont.c (xfont_match): Avoid need for strlen.
13633         * xfns.c: Don't assume strlen fits in int.
13634         (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13636         * xdisp.c (message_log_check_duplicate): Return intmax_t,
13637         not unsigned long, as we prefer signed integers.  All callers changed.
13638         Detect integer overflow in repeat count.
13639         (message_dolog): Don't assume print length fits in 39 bytes.
13640         (display_mode_element): Don't assume strlen fits in int.
13642         * termcap.c: Don't assume sizes fit in int and never overflow.
13643         (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13644         (gobble_line): Check for size-calculation overflow.
13646         * minibuf.c (Fread_buffer):
13647         * lread.c (intern, intern_c_string):
13648         * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13649         Don't assume string length fits in int.
13651         * keyboard.c (parse_tool_bar_item):
13652         * gtkutil.c (style_changed_cb): Avoid need for strlen.
13654         * font.c: Don't assume string length fits in int.
13655         (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13656         Use ptrdiff_t, not int.
13657         (font_intern_prop): Don't assume string length fits in int.
13658         Don't assume integer property fits in fixnum.
13659         * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
13661         * filelock.c: Fix some buffer overrun and integer overflow issues.
13662         (get_boot_time): Don't assume gzip command string fits in 100 bytes.
13663         Reformulate so as not to need the command string.
13664         Invoke gzip -cd rather than gunzip, as it's more portable.
13665         (lock_info_type, lock_file_1, lock_file):
13666         Don't assume pid_t and time_t fit in unsigned long.
13667         (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13668         (current_lock_owner): Prefer signed type for sizes.
13669         Use memcpy, not strncpy, where memcpy is what is really wanted.
13670         Don't assume (via atoi) that time_t and pid_t fit in int.
13671         Check for time_t and/or pid_t out of range, e.g., via a network share.
13672         Don't alloca where an auto var works fine.
13674         * fileio.c: Fix some integer overflow issues.
13675         (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13676         Don't assume string length fits in int.
13677         (directory_file_name): Don't assume string length fits in long.
13678         (make_temp_name): Don't assume pid fits in int, or that its print
13679         length is less than 20.
13681         * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13683         * coding.c (make_subsidiaries): Don't assume string length fits in int.
13685         * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13687         * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13688         We prefer signed integers, even for size calculations.
13690         * emacs.c: Don't assume string length fits in 'int'.
13691         (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13692         (main): Don't invoke strlen when not needed.
13694         * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13695         (XD_DEBUG_MESSAGE): Don't waste a byte.
13697         * callproc.c (getenv_internal_1, getenv_internal)
13698         (Fgetenv_internal):
13699         * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13701         * lread.c (invalid_syntax): Omit length argument.
13702         All uses changed.  This doesn't fix a bug, but it simplifies the
13703         code away from its former Hollerith-constant appearance, and it's
13704         one less 'int' to worry about when looking at integer-overflow issues.
13705         (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
13707         * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13708         This didn't break anything, but it didn't help either.
13709         It's confusing to put a bogus integer in a place where the actual
13710         value does not matter.
13711         (LIST_END_P): Remove unused macro and its bogus comment.
13712         (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
13714         * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13715         This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13716         implementation.
13717         (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13718         We prefer signed types, and the value cannot exceed the EMACS_INT
13719         range anyway (because otherwise the length would not be representable).
13720         (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13721         not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13722         This avoids a GCC warning when WIDE_EMACS_INT.
13724         * indent.c (sane_tab_width): New function.
13725         (current_column, scan_for_column, Findent_to, position_indentation)
13726         (compute_motion): Use it.  This is just for clarity.
13727         (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
13729         * image.c (xbm_image_p): Don't assume stated width, height fit in int.
13731         * lisp.h (lint_assume): New macro.
13732         * composite.c (composition_gstring_put_cache):
13733         * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13735         * editfns.c, insdel.c:
13736         Omit unnecessary forward decls, to simplify future changes.
13738         * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13740         * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13742         * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
13743         Use much-faster test for byte-length change.
13744         Don't assume string byte-length fits in 'int'.
13745         Check that character arg fits in 'int'.
13746         (mapcar1): Declare byte as byte, for clarity.
13748         * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13750         * fns.c (concat): Catch string overflow earlier.
13751         Do not rely on integer wraparound.
13753         * dispextern.h (struct it.overlay_strings_charpos)
13754         (struct it.selective): Now EMACS_INT, not int.
13755         * xdisp.c (forward_to_next_line_start)
13756         (back_to_previous_visible_line_start)
13757         (reseat_at_next_visible_line_start, next_element_from_buffer):
13758         Don't arbitrarily truncate the value of 'selective' to int.
13760         * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13762         * composite.c: Don't truncate sizes to 'int'.
13763         (composition_gstring_p, composition_reseat_it)
13764         (composition_adjust_point): Use EMACS_INT, not int.
13765         (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13766         not EMACS_UINT, for indexes.
13768         * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13770         * buffer.c: Include <verify.h>.
13771         (struct sortvec.priority, struct sortstr.priority):
13772         Now EMACS_INT, not int.
13773         (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
13774         (struct sortstr.size, record_overlay_string)
13775         (struct sortstrlist.size, struct sortlist.used):
13776         Don't truncate size to int.
13777         (record_overlay_string): Check for size-calculation overflow.
13778         (init_buffer_once): Check at compile-time, not run-time.
13780 2011-06-22  Jim Meyering  <meyering@redhat.com>
13782         Don't leak an XBM-image-sized buffer
13783         * image.c (xbm_load): Free the image buffer after using it.
13785 2011-06-21  Paul Eggert  <eggert@cs.ucla.edu>
13787         Port to Sun C.
13788         * composite.c (find_automatic_composition): Omit needless 'return 0;'
13789         that Sun C diagnosed.
13790         * fns.c (secure_hash): Fix pointer signedness issue.
13791         * intervals.c (static_offset_intervals): New function.
13792         (offset_intervals): Use it.
13794 2011-06-21  Leo Liu  <sdl.web@gmail.com>
13796         * deps.mk (fns.o):
13797         * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13798         sha512.h.
13800         * fns.c (secure_hash): Rename from crypto_hash_function and change
13801         the first arg to accept symbols.
13802         (Fsecure_hash): New primitive.
13803         (syms_of_fns): New symbols.
13805 2011-06-20  Deniz Dogan  <deniz@dogan.se>
13807         * process.c (Fset_process_buffer): Clarify return value in
13808         docstring.
13810 2011-06-18  Chong Yidong  <cyd@stupidchicken.com>
13812         * dispnew.c (add_window_display_history): Use BVAR.
13814         * xdisp.c (debug_method_add): Use BVAR.
13815         (check_window_end, dump_glyph_matrix, dump_glyph)
13816         (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13818         * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13819         Likewise.
13821         * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13822         check till after the cache is created in init_frame_faces.
13824 2011-06-17  Stefan Monnier  <monnier@iro.umontreal.ca>
13826         * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13828 2011-06-16  Paul Eggert  <eggert@cs.ucla.edu>
13830         * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13831         Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13832         hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13834         Improve buffer-overflow checking (Bug#8873).
13835         * fileio.c (Finsert_file_contents):
13836         * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13837         Remove the old (too-loose) buffer overflow checks.
13838         They weren't needed, since make_gap checks for buffer overflow.
13839         * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13840         The old code merely checked for Emacs fixnum overflow, and relied
13841         on undefined (wraparound) behavior.  The new code avoids undefined
13842         behavior, and also checks for ptrdiff_t and/or size_t overflow.
13844         * editfns.c (Finsert_char): Don't dump core with very negative counts.
13845         Tune.  Don't use wider integers than needed.  Don't use alloca.
13846         Use a bigger 'string' buffer.  Rewrite to avoid 'n > 0' test.
13848         * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13850         * insdel.c, lisp.h (buffer_overflow): New function.
13851         (insert_from_buffer_1, replace_range, replace_range_2):
13852         * insdel.c (make_gap_larger):
13853         * editfns.c (Finsert_char):
13854         * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13856         * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13858 2011-06-15  Paul Eggert  <eggert@cs.ucla.edu>
13860         Integer overflow and signedness fixes (Bug#8873, Bug#8828).
13862         * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13863         (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13865         * fileio.c: Don't assume EMACS_INT fits in off_t.
13866         (emacs_lseek): New static function.
13867         (Finsert_file_contents, Fwrite_region): Use it.
13868         Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13870         * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13872         * fns.c: Don't overflow int when computing a list length.
13873         * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13874         (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13875         truncation on 64-bit hosts.  Check for QUIT every
13876         QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13877         faster and is responsive enough.
13878         (Flength): Report an error instead of overflowing an integer.
13879         (Fsafe_length): Return a float if the value is not representable
13880         as a fixnum.  This shouldn't happen except in contrived situations.
13881         (Fnthcdr, Fsort): Don't assume list length fits in int.
13882         (Fcopy_sequence): Don't assume vector length fits in int.
13884         * alloc.c: Check that resized vectors' lengths fit in fixnums.
13885         (header_size, word_size): New constants.
13886         (allocate_vectorlike): Don't check size overflow here.
13887         (allocate_vector): Check it here instead, since this is the only
13888         caller of allocate_vectorlike that could cause overflow.
13889         Check that the new vector's length is representable as a fixnum.
13891         * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13892         The previous code was bogus.  For example, next_almost_prime (32)
13893         returned 39, which is undesirable as it is a multiple of 3; and
13894         next_almost_prime (24) returned 25, which is a multiple of 5 so
13895         why was the code bothering to check for multiples of 7?
13897         * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13899         * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13901         Variadic C functions now count arguments with ptrdiff_t.
13902         This partly undoes my 2011-03-30 change, which replaced int with size_t.
13903         Back then I didn't know that the Emacs coding style prefers signed int.
13904         Also, in the meantime I found a few more instances where arguments
13905         were being counted with int, which may truncate counts on 64-bit
13906         machines, or EMACS_INT, which may be unnecessarily wide.
13907         * lisp.h (struct Lisp_Subr.function.aMANY)
13908         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13909         Arg counts are now ptrdiff_t, not size_t.
13910         All variadic functions and their callers changed accordingly.
13911         (struct gcpro.nvars): Now size_t, not size_t.  All uses changed.
13912         * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13913         to avoid potential buffer overrun.  Don't assume arg counts fit in 'int'.
13914         * callint.c (Fcall_interactively): Check arg count for overflow,
13915         to avoid potential buffer overrun.  Use signed char, not 'int',
13916         for 'varies' array, so that we needn't bother to check its size
13917         calculation for overflow.
13918         * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13919         * eval.c (apply_lambda):
13920         * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13921         (struct textprop_rec.argnum): Now ptrdiff_t, not int.  All uses changed.
13922         (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13924         * callint.c (Fcall_interactively): Don't use index var as event count.
13926         * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13927         * mem-limits.h (SIZE): Remove; no longer used.
13929         * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
13931         Remove unnecessary casts.
13932         * xterm.c (x_term_init):
13933         * xfns.c (x_set_border_pixel):
13934         * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13935         These aren't needed now that we assume ANSI C.
13937         * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13938         It's more likely to cause problems (due to unsigned overflow)
13939         than to cure them.
13941         * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13943         * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13945         * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13947         * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13949         * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13951         * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13953         GLYPH_CODE_FACE returns EMACS_INT, not int.
13954         * dispextern.h (merge_faces):
13955         * xfaces.c (merge_faces):
13956         * xdisp.c (get_next_display_element, next_element_from_display_vector):
13957         Don't assume EMACS_INT fits in int.
13959         * character.h (CHAR_VALID_P): Remove unused parameter.
13960         * fontset.c, lisp.h, xdisp.c: All uses changed.
13962         * editfns.c (Ftranslate_region_internal): Omit redundant test.
13964         * fns.c (concat): Minor tuning based on overflow analysis.
13965         This doesn't fix any bugs.  Use int to hold character, instead
13966         of constantly refetching from Emacs object.  Use XFASTINT, not
13967         XINT, for value known to be a character.  Don't bother comparing
13968         a single byte to 0400, as it's always less.
13970         * floatfns.c (Fexpt):
13971         * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13973         * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13974         for characters.
13976         * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13978         * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13979         Without this fix, on a 64-bit host (aset S 0 4294967386) would
13980         incorrectly succeed when S was a string, because 4294967386 was
13981         truncated before it was used.
13983         * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13984         Otherwise, an out-of-range integer could cause undefined behavior
13985         on a 64-bit host.
13987         * composite.c: Use int, not EMACS_INT, for characters.
13988         (fill_gstring_body, composition_compute_stop_pos): Use int, not
13989         EMACS_INT, for values that are known to be in character range.
13990         This doesn't fix any bugs but is the usual style inside Emacs and
13991         may generate better code on 32-bit machines.
13993         Make sure a 64-bit char is never passed to ENCODE_CHAR.
13994         This is for reasons similar to the recent CHAR_STRING fix.
13995         * charset.c (Fencode_char): Check that character arg is actually
13996         a character.  Pass an int to ENCODE_CHAR.
13997         * charset.h (ENCODE_CHAR): Verify that the character argument is no
13998         wider than 'int', as a compile-time check to prevent future regressions
13999         in this area.
14001         * character.c (char_string): Remove unnecessary casts.
14003         Make sure a 64-bit char is never passed to CHAR_STRING.
14004         Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
14005         by silently ignoring the top 32 bits, allowing some values
14006         that were far too large to be valid characters.
14007         * character.h: Include <verify.h>.
14008         (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
14009         arguments are no wider than unsigned, as a compile-time check
14010         to prevent future regressions in this area.
14011         * data.c (Faset):
14012         * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
14013         (Fsubst_char_in_region):
14014         * fns.c (concat):
14015         * xdisp.c (decode_mode_spec_coding):
14016         Adjust to CHAR_STRING's new requirement.
14017         * editfns.c (Finsert_char, Fsubst_char_in_region):
14018         * fns.c (concat): Check that character args are actually
14019         characters.  Without this test, these functions did the wrong
14020         thing with wildly out-of-range values on 64-bit hosts.
14022         Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14023         These casts should not be needed on 32-bit hosts, either.
14024         * keyboard.c (read_char):
14025         * lread.c (Fload): Remove casts to unsigned.
14027         * lisp.h (UNSIGNED_CMP): New macro.
14028         This fixes comparison bugs on 64-bit hosts.
14029         (ASCII_CHAR_P): Use it.
14030         * casefiddle.c (casify_object):
14031         * character.h (ASCII_BYTE_P, CHAR_VALID_P)
14032         (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14033         * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14034         * dispextern.h (FACE_FROM_ID):
14035         * keyboard.c (read_char): Use UNSIGNED_CMP.
14037         * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
14038         not to EMACS_INT, to avoid GCC warning.
14040         * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
14042         * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14043         The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14044         isn't needed on 32-bit machines.
14046         * buffer.c (Fgenerate_new_buffer_name):
14047         Use EMACS_INT for count, not int.
14048         (advance_to_char_boundary): Return EMACS_INT, not int.
14050         * data.c (Qcompiled_function): Now static.
14052         * window.c (window_body_lines): Now static.
14054         * image.c (gif_load): Rename local to avoid shadowing.
14056         * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14057         (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14058         * alloc.c (make_save_value): Integer argument is now of type
14059         ptrdiff_t, not int.
14060         (mark_object): Use ptrdiff_t, not int.
14061         * lisp.h (pD): New macro.
14062         * print.c (print_object): Use it.
14064         * alloc.c: Use EMACS_INT, not int, to count objects.
14065         (total_conses, total_markers, total_symbols, total_vector_size)
14066         (total_free_conses, total_free_markers, total_free_symbols)
14067         (total_free_floats, total_floats, total_free_intervals)
14068         (total_intervals, total_strings, total_free_strings):
14069         Now EMACS_INT, not int.  All uses changed.
14070         (Fgarbage_collect): Compute overall total using a double, so that
14071         integer overflow is less likely to be a problem.  Check for overflow
14072         when converting back to an integer.
14073         (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14074         (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14075         These were 'int' variables that could overflow on 64-bit hosts;
14076         they were never used, so remove them instead of repairing them.
14077         (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
14078         (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14079         Previously, this ceilinged at INT_MAX, but that doesn't work on
14080         64-bit machines.
14081         (allocate_pseudovector): Don't use EMACS_INT when int would do.
14083         * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
14084         (allocate_vectorlike): Check for ptrdiff_t overflow.
14085         (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14086         when a (possibly-narrower) signed value would do just as well.
14087         We prefer using signed arithmetic, to avoid comparison confusion.
14089         * alloc.c: Catch some string size overflows that we were missing.
14090         (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14091         for convenience in STRING_BYTES_MAX.
14092         (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14093         The definition here is exact; the one in lisp.h was approximate.
14094         (allocate_string_data): Check for string overflow.  This catches
14095         some instances we weren't catching before.  Also, it catches
14096         size_t overflow on (unusual) hosts where SIZE_MAX <= min
14097         (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14098         and ptrdiff_t and EMACS_INT are both 64 bits.
14100         * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14101         All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
14102         * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
14104         * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14106         * alloc.c (Fmake_string): Check for out-of-range init.
14108 2011-06-15  Stefan Monnier  <monnier@iro.umontreal.ca>
14110         * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14112 2011-06-14  Jan Djärv  <jan.h.d@swipnet.se>
14114         * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14115         xg_get_default_scrollbar_width.
14117         * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14118         (int_gtk_range_get_value): Move to the scroll bar part of the file.
14119         (style_changed_cb): Call update_theme_scrollbar_width and call
14120         x_set_scroll_bar_default_width and xg_frame_set_char_size for
14121         all frames (Bug#8505).
14122         (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14123         Call gtk_window_set_resizable if HAVE_GTK3.
14124         (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14125         and height if HAVE_GTK3 (Bug#8505).
14126         (scroll_bar_width_for_theme): New variable.
14127         (update_theme_scrollbar_width): New function.
14128         (xg_get_default_scrollbar_width): Move code to
14129         update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14130         (xg_initialize): Call update_theme_scrollbar_width.
14132         * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14134         * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14136 2011-06-12  Martin Rudalics  <rudalics@gmx.at>
14138         * frame.c (make_frame): Call other_buffer_safely instead of
14139         other_buffer.
14141         * window.c (temp_output_buffer_show): Call display_buffer with
14142         second argument Vtemp_buffer_show_specifiers and reset latter
14143         immediately after the call.
14144         (Vtemp_buffer_show_specifiers): New variable.
14145         (auto_window_vscroll_p, next_screen_context_lines)
14146         (Vscroll_preserve_screen_position): Remove leading asterisks from
14147         doc-strings.
14149 2011-06-12  Paul Eggert  <eggert@cs.ucla.edu>
14151         Fix minor problems found by GCC 4.6.0 static checking.
14152         * buffer.c (Qclone_number): Remove for now, as it's unused.
14153         (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14154         (record_buffer): Remove unused local.
14155         * frame.c (other_visible_frames, frame_buffer_list): Now static.
14156         (set_frame_buffer_list): Remove; unused.
14157         * frame.h (other_visible_frames): Remove decl.
14158         * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14159         * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14160         (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14161         if HAVE_GPM.
14162         * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14163         * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14164         Define only if HAVE_GPM.
14165         * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14166         (update_hints_inhibit): Remove; never set.  All uses removed.
14167         * widgetprv.h (emacsFrameClassRec): Remove decl.
14168         * window.c (delete_deletable_window): Now returns void, since it
14169         wasn't returning anything.
14170         (compare_window_configurations): Remove unused locals.
14171         * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14172         * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
14173         (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14174         the same widths as pointers.  This follows up on the 2011-05-06 patch.
14175         * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14176         * xterm.h: Likewise.
14177         (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14179 2011-06-12  Juanma Barranquero  <lekktu@gmail.com>
14181         * makefile.w32-in: Update dependencies.
14182         (LISP_H): Add lib/intprops.h.
14184 2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
14186         * image.c (gif_load): Add animation frame delay to the metadata.
14187         (syms_of_image): Use DEFSYM.  New symbol `delay'.
14189 2011-06-11  Martin Rudalics  <rudalics@gmx.at>
14191         * window.c (delete_deletable_window): Re-add.
14192         (Fset_window_configuration): Rewrite to handle dead buffers and
14193         consequently deletable windows.
14194         (window_tree, Fwindow_tree): Remove.  Supply functionality in
14195         window.el.
14196         (compare_window_configurations): Simplify code.
14198 2011-06-11  Andreas Schwab  <schwab@linux-m68k.org>
14200         * image.c (imagemagick_load_image): Fix type mismatch.
14201         (Fimagemagick_types): Likewise.
14203         * window.h (replace_buffer_in_windows): Declare.
14205 2011-06-11  Martin Rudalics  <rudalics@gmx.at>
14207         * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14208         Qclone_number.  Remove external declaration of Qdelete_window.
14209         (Fbuffer_list): Rewrite doc-string.  Minor restructuring of
14210         code.
14211         (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14212         Run Qbuffer_list_update_hook if allowed.
14213         (Fother_buffer): Rewrite doc-string.  Major rewrite for new
14214         buffer list implementation.
14215         (other_buffer_safely): New function.
14216         (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14217         calls to replace_buffer_in_windows and
14218         replace_buffer_in_windows_safely.  Run Qbuffer_list_update_hook
14219         if allowed.
14220         (record_buffer): Inhibit quitting and rewrite using quittable
14221         functions.  Run Qbuffer_list_update_hook if allowed.
14222         (Frecord_buffer, Funrecord_buffer): New functions.
14223         (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14224         Move switch-to-buffer to window.el.
14225         (bury-buffer): Move to window.el.
14226         (Vbuffer_list_update_hook): New variable.
14228         * lisp.h (other_buffer_safely): Add prototype in buffer.c
14229         section.
14231         * window.h (resize_frame_windows): Move up in code.
14232         (Fwindow_frame): Remove EXFUN.
14233         (replace_buffer_in_all_windows): Remove prototype.
14234         (replace_buffer_in_windows_safely): Add prototype.
14236         * window.c: Declare Qdelete_window static again.  Move down
14237         declaration of select_count.
14238         (Fnext_window, Fprevious_window): Rewrite doc-strings.
14239         (Fother_window): Move to window.el.
14240         (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14241         cases.  Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14242         (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14243         window.el.
14244         (replace_buffer_in_windows): Implement by calling
14245         Qreplace_buffer_in_windows.
14246         (replace_buffer_in_all_windows): Remove with some functionality
14247         moved into replace_buffer_in_windows_safely.
14248         (replace_buffer_in_windows_safely): New function.
14249         (select_window_norecord, select_frame_norecord): Move in front
14250         of run_window_configuration_change_hook.  Remove now obsolete
14251         declarations.
14252         (Fset_window_buffer): Rewrite doc-string.
14253         Call Qrecord_window_buffer.
14254         (keys_of_window): Move binding for other-window to window.el.
14256 2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
14258         * dispextern.h (struct image): Replace data member, whose int_val
14259         and ptr_val fields were not used by anything, with a single
14260         lisp_val object.
14262         * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14263         (gif_clear_image, gif_load, imagemagick_load_image)
14264         (gs_clear_image, gs_load): Callers changed.
14266 2011-06-10  Paul Eggert  <eggert@cs.ucla.edu>
14268         * buffer.h: Include <time.h>, for time_t.
14269         Needed to build on FreeBSD 8.2.  Problem reported by Herbert J. Skuhra.
14271         Fix minor problems found by static checking.
14273         * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14275         Make identifiers static if they are not used in other modules.
14276         * data.c (Qcompiled_function, Qframe, Qvector):
14277         * image.c (QimageMagick, Qsvg):
14278         * minibuf.c (Qmetadata):
14279         * window.c (resize_window_check, resize_root_window): Now static.
14280         * window.h (resize_window_check, resize_root_window): Remove decls.
14282         * window.c (window_deletion_count, delete_deletable_window):
14283         Remove; unused.
14284         (window_body_lines): Now static.
14285         (Fdelete_other_windows_internal): Mark vars as initialized.
14286         Make sure 'resize_failed' is initialized.
14287         (run_window_configuration_change_hook): Rename local to avoid shadowing.
14288         (resize_window_apply): Remove unused local.
14289         * window.h (delete_deletable_window): Remove decl.
14291         * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
14292         (imagemagick_load_image): Fix pointer signedness problem by changing
14293         last arg from unsigned char * to char *.  All uses changed.
14294         Also, fix a local for similar reasons.
14295         Remove unused locals.  Remove locals to avoid shadowing.
14296         (fn_rsvg_handle_free): Remove; unused.
14297         (svg_load, svg_load_image): Fix pointer signedness problem.
14298         (imagemagick_load_image): Don't use garbage pointer image_wand.
14300         * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14302 2011-06-10  Chong Yidong  <cyd@stupidchicken.com>
14304         * image.c (gif_load): Fix omitted cast error introduced by
14305         2011-06-06 change.
14307 2011-06-10  Martin Rudalics  <rudalics@gmx.at>
14309         * window.h (resize_proportionally, orig_total_lines)
14310         (orig_top_line): Remove from window structure.
14311         (set_window_height, set_window_width, change_window_heights)
14312         (Fdelete_window): Remove prototypes.
14313         (resize_frame_windows): Remove duplicate declaration.
14315 2011-06-10  Eli Zaretskii  <eliz@gnu.org>
14317         * window.h (resize_frame_windows, resize_window_check)
14318         (delete_deletable_window, resize_root_window)
14319         (resize_frame_windows): Declare prototypes.
14321         * window.c (resize_window_apply): Make definition be "static" to
14322         match the prototype.
14324 2011-06-10  Martin Rudalics  <rudalics@gmx.at>
14326         * window.c: Remove declarations of Qwindow_size_fixed,
14327         window_min_size_1, window_min_size_2, window_min_size,
14328         size_window, window_fixed_size_p, enlarge_window, delete_window.
14329         Remove static from declaration of Qdelete_window, it's
14330         temporarily needed by Fbury_buffer.
14331         (replace_window): Don't assign orig_top_line and
14332         orig_total_lines.
14333         (Fdelete_window, delete_window): Remove.  Window deletion is
14334         handled by window.el.
14335         (window_loop): Remove DELETE_OTHER_WINDOWS case.
14336         Replace Fdelete_window calls with calls to Qdelete_window.
14337         (Fdelete_other_windows): Remove.  Deleting other windows is
14338         handled by window.el.
14339         (window_fixed_size_p): Remove.  Fixed-sizeness of windows is
14340         handled in window.el.
14341         (window_min_size_2, window_min_size_1, window_min_size): Remove.
14342         Window minimum sizes are handled in window.el.
14343         (shrink_windows, size_window, set_window_height)
14344         (set_window_width, change_window_heights, window_height)
14345         (window_width, CURBEG, CURSIZE, enlarge_window)
14346         (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14347         (Fenlarge_window, Fshrink_window): Remove.  Window resizing is
14348         handled in window.el.
14349         (make_dummy_parent): Rename to make_parent_window and give it a
14350         second argument horflag.
14351         (make_window): Don't set resize_proportionally any more.
14352         (Fsplit_window): Remove.  Windows are split in window.el.
14353         (save_restore_action, save_restore_orig_size)
14354         (shrink_window_lowest_first, save_restore_orig_size): Remove.
14355         Resize mini windows in window.el.
14356         (grow_mini_window, shrink_mini_window): Implement by calling
14357         Qresize_root_window_vertically, resize_window_check and
14358         resize_window_apply.
14359         (saved_window, Fset_window_configuration, save_window_save):
14360         Do not handle orig_top_line, orig_total_lines, and
14361         resize_proportionally.
14362         (window_min_height, window_min_width): Move to window.el.
14363         (keys_of_window): Move bindings for delete-other-windows,
14364         split-window, delete-window and enlarge-window to window.el.
14366         * buffer.c: Temporarily extern Qdelete_window.
14367         (Fbury_buffer): Temporarily call Qdelete_window instead of
14368         Fdelete_window (Fbury_buffer will move to window.el soon).
14370         * frame.c (set_menu_bar_lines_1): Remove code handling
14371         orig_top_line and orig_total_lines.
14373         * dispnew.c (adjust_frame_glyphs_initially): Don't use
14374         set_window_height but set heights directly.
14375         (change_frame_size_1): Use resize_frame_windows.
14377         * xdisp.c (init_xdisp): Don't use set_window_height but set
14378         heights directly.
14380         * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14381         Use resize_frame_windows instead of change_window_heights and run
14382         run_window_configuration_change_hook.
14384         * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14385         instead of change_window_heights and run
14386         run_window_configuration_change_hook.
14388 2011-06-09  Martin Rudalics  <rudalics@gmx.at>
14390         * window.c (replace_window): Rename second argument REPLACEMENT to
14391         NEW.  New third argument SETFLAG.  Rewrite.
14392         (delete_window, make_dummy_parent): Call replace_window with
14393         third argument 1.
14394         (window_list_1): Move down in code.
14395         (run_window_configuration_change_hook): Move set_buffer part
14396         before select_frame_norecord part in order to unwind correctly.
14397         Rename count1 to count.
14398         (recombine_windows, delete_deletable_window, resize_root_window)
14399         (Fdelete_other_windows_internal)
14400         (Frun_window_configuration_change_hook, make_parent_window)
14401         (resize_window_check, resize_window_apply, Fresize_window_apply)
14402         (resize_frame_windows, Fsplit_window_internal)
14403         (Fdelete_window_internal, Fresize_mini_window_internal):
14404         New functions.
14405         (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14407 2011-06-08  Martin Rudalics  <rudalics@gmx.at>
14409         * window.h (window): Add some new members to window structure -
14410         normal_lines, normal_cols, new_total, new_normal, clone_number,
14411         splits, nest, prev_buffers, next_buffers.
14412         (WINDOW_TOTAL_SIZE): Move here from window.c.
14413         (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
14415         * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14416         Remove.
14417         (make_dummy_parent): Set new members of windows structure.
14418         (make_window): Move down in code.  Handle new members of window
14419         structure.
14420         (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14421         (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14422         (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14423         (Fset_window_prev_buffers, Fwindow_next_buffers)
14424         (Fset_window_next_buffers, Fset_window_clone_number):
14425         New functions.
14426         (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14427         (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14428         Doc-string fixes.
14429         (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14430         Argument WINDOW can be now internal window too.
14431         (Fwindow_use_time): Move up in code.
14432         (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14433         Rewrite doc-string.
14434         (Fset_window_configuration, saved_window)
14435         (Fcurrent_window_configuration, save_window_save): Handle new
14436         members of window structure.
14437         (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14438         (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14439         (syms_of_window): New Lisp objects Qrecord_window_buffer,
14440         Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14441         Qget_mru_window, Qresize_root_window,
14442         Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14443         Qauto_buffer_name; staticpro them.
14445 2011-06-07  Martin Rudalics  <rudalics@gmx.at>
14447         * window.c (Fwindow_total_size, Fwindow_left_column)
14448         (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14449         (Fwindow_list_1): New functions.
14450         (window_box_text_cols): Replace with window_body_cols.
14451         (Fwindow_width, Fscroll_left, Fscroll_right):
14452         Use window_body_cols instead of window_box_text_cols.
14453         (delete_window, Fset_window_configuration):
14454         Call delete_all_subwindows with window as argument.
14455         (delete_all_subwindows): Take a window as argument and not a
14456         structure.  Rewrite.
14457         (window_loop): Remove handling of GET_LRU_WINDOW and
14458         GET_LARGEST_WINDOW.
14459         (Fget_lru_window, Fget_largest_window): Move to window.el.
14461         * window.h: Extern window_body_cols instead of
14462         window_box_text_cols.  delete_all_subwindows now takes a
14463         Lisp_Object as argument.
14465         * indent.c (compute_motion, Fcompute_motion):
14466         Use window_body_cols instead of window_box_text_cols.
14468         * frame.c (delete_frame): Call delete_all_subwindows with root
14469         window as argument.
14471 2011-06-07  Daniel Colascione  <dan.colascione@gmail.com>
14473         * fns.c (Fputhash): Document return value.
14475 2011-06-06  Chong Yidong  <cyd@stupidchicken.com>
14477         * image.c (gif_load): Implement gif89a spec "no disposal" method.
14479 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
14481         Cons<->int and similar integer overflow fixes (Bug#8794).
14483         Check for overflow when converting integer to cons and back.
14484         * charset.c (Fdefine_charset_internal, Fdecode_char):
14485         Use cons_to_unsigned to catch overflow.
14486         (Fencode_char): Use INTEGER_TO_CONS.
14487         * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14488         (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14489         * data.c (long_to_cons, cons_to_long): Remove.
14490         (cons_to_unsigned, cons_to_signed): New functions.
14491         These signal an error for invalid or out-of-range values.
14492         * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14493         * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14494         * font.c (Ffont_variation_glyphs):
14495         * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14496         * lisp.h: Include <intprops.h>.
14497         (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14498         (cons_to_signed, cons_to_unsigned): New decls.
14499         (long_to_cons, cons_to_long): Remove decls.
14500         * undo.c (record_first_change): Use INTEGER_TO_CONS.
14501         (Fprimitive_undo): Use CONS_TO_INTEGER.
14502         * xfns.c (Fx_window_property): Likewise.
14503         * xselect.c: Include <limits.h>.
14504         (x_own_selection, selection_data_to_lisp_data):
14505         Use INTEGER_TO_CONS.
14506         (x_handle_selection_request, x_handle_selection_clear)
14507         (x_get_foreign_selection, Fx_disown_selection_internal)
14508         (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14509         (lisp_data_to_selection_data): Use cons_to_unsigned.
14510         (x_fill_property_data): Use cons_to_signed.
14511         Report values out of range.
14513         Check for buffer and string overflow more precisely.
14514         * buffer.h (BUF_BYTES_MAX): New macro.
14515         * lisp.h (STRING_BYTES_MAX): New macro.
14516         * alloc.c (Fmake_string):
14517         * character.c (string_escape_byte8):
14518         * coding.c (coding_alloc_by_realloc):
14519         * doprnt.c (doprnt):
14520         * editfns.c (Fformat):
14521         * eval.c (verror):
14522         Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14523         since they may not be the same number.
14524         * editfns.c (Finsert_char):
14525         * fileio.c (Finsert_file_contents):
14526         Likewise for BUF_BYTES_MAX.
14528         * image.c: Use ptrdiff_t, not int, for sizes.
14529         (slurp_file): Switch from int to ptrdiff_t.
14530         All uses changed.
14531         (slurp_file): Check that file size fits in both size_t (for
14532         malloc) and ptrdiff_t (for sanity and safety).
14534         * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14535         if b->modtime has its maximal value.
14537         * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14539         Don't assume time_t can fit into int.
14540         * buffer.h (struct buffer.modtime): Now time_t, not int.
14541         * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14542         * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14544         Minor fixes for signed vs unsigned integers.
14545         * character.h (MAYBE_UNIFY_CHAR):
14546         * charset.c (maybe_unify_char):
14547         * keyboard.c (read_char, reorder_modifiers):
14548         XINT -> XFASTINT, since the integer must be nonnegative.
14549         * ftfont.c (ftfont_spec_pattern):
14550         * keymap.c (access_keymap, silly_event_symbol_error):
14551         XUINT -> XFASTINT, since the integer must be nonnegative.
14552         (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14553         since it makes no difference and we prefer signed.
14554         * keyboard.c (record_char): Use XUINT when all the neighbors do.
14555         (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14556         nonnegative.
14558 2011-06-06  Stefan Monnier  <monnier@iro.umontreal.ca>
14560         * window.h (Fwindow_frame): Declare.
14562 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
14564         * alloc.c: Simplify handling of large-request failures (Bug#8800).
14565         (SPARE_MEMORY): Always define.
14566         (LARGE_REQUEST): Remove.
14567         (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14569 2011-06-06  Martin Rudalics  <rudalics@gmx.at>
14571         * lisp.h: Move EXFUNS for Fframe_root_window,
14572         Fframe_first_window and Fset_frame_selected_window to window.h.
14574         * window.h: Move EXFUNS for Fframe_root_window,
14575         Fframe_first_window and Fset_frame_selected_window here from
14576         lisp.h.
14578         * frame.c (Fwindow_frame, Fframe_first_window)
14579         (Fframe_root_window, Fframe_selected_window)
14580         (Fset_frame_selected_window): Move to window.c.
14581         (Factive_minibuffer_window): Move to minibuf.c.
14582         (Fother_visible_frames_p): New function.
14584         * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14586         * window.c (decode_window, decode_any_window): Move up in code.
14587         (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14588         (inhibit_frame_unsplittable): Remove unused variable.
14589         (Fwindow_buffer): Move up and rewrite doc-string.
14590         (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14591         (Fwindow_prev): New functions.
14592         (Fwindow_frame): Move here from frame.c.  Accept any window as
14593         argument.
14594         (Fframe_root_window, Fframe_first_window)
14595         (Fframe_selected_window): Move here from frame.c.  Accept frame
14596         or arbitrary window as argument.  Update doc-strings.
14597         (Fminibuffer_window): Move up in code.
14598         (Fwindow_minibuffer_p): Move up in code and simplify.
14599         (Fset_frame_selected_window): Move here from frame.c.
14600         Marginal rewrite.
14601         (Fselected_window, select_window, Fselect_window): Move up in
14602         code.  Minor doc-string fixes.
14604 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
14606         * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14607         Do not assume that spare memory exists; that assumption is valid
14608         only if SYSTEM_MALLOC.
14609         (LARGE_REQUEST): New macro, so that the issue of large requests
14610         is separated from the issue of spare memory.
14612 2011-06-05  Andreas Schwab  <schwab@linux-m68k.org>
14614         * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14615         format.  (Bug#8806)
14617         * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14619         * xfns.c (x_set_scroll_bar_default_width): Move declarations
14620         before statements.
14622 2011-06-05  Jan Djärv  <jan.h.d@swipnet.se>
14624         * gtkutil.c (xg_get_default_scrollbar_width): New function.
14626         * gtkutil.h: Declare xg_get_default_scrollbar_width.
14628         * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14629         min width by calling x_set_scroll_bar_default_width (Bug#8505).
14631 2011-06-05  Juanma Barranquero  <lekktu@gmail.com>
14633         * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14635 2011-06-04  Chong Yidong  <cyd@stupidchicken.com>
14637         * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14638         (x_clipboard_manager_save): Add return value.
14639         (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14640         New error handlers.
14641         (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14642         Obey Vx_select_enable_clipboard_manager.  Catch errors in
14643         x_clipboard_manager_save (Bug#8779).
14644         (Vx_select_enable_clipboard_manager): New variable.
14645         (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
14647 2011-06-04  Dan Nicolaescu  <dann@ics.uci.edu>
14649         * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14651 2011-06-04  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
14653         * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14654         in the current matrix if keep_current_p is non-zero.
14656 2011-06-04  Eli Zaretskii  <eliz@gnu.org>
14658         * bidi.c (bidi_level_of_next_char): Fix last change.
14660 2011-06-03  Eli Zaretskii  <eliz@gnu.org>
14662         Support bidi reordering of text covered by display properties.
14664         * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14665         (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14666         (bidi_cache_search, bidi_cache_iterator_state)
14667         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
14668         (bidi_level_of_next_char, bidi_move_to_visually_next):
14669         Support character positions inside a run of characters covered by a
14670         display string.
14671         (bidi_paragraph_init, bidi_resolve_explicit_1)
14672         (bidi_level_of_next_char): Call bidi_fetch_char and
14673         bidi_fetch_char_advance instead of FETCH_CHAR and
14674         FETCH_CHAR_ADVANCE.
14675         (bidi_init_it): Initialize new members.
14676         (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14677         definitions.
14678         (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14679         instead of using explicit *_CHAR codes.
14680         (bidi_resolve_explicit, bidi_resolve_weak):
14681         Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
14682         bidirectional text is supported only in multibyte buffers.
14683         (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14684         it to initialize the frame_window_p member of struct bidi_it.
14685         (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14686         (bidi_resolve_explicit, bidi_resolve_weak)
14687         (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14688         bidi_it->nchars is non-positive.
14689         (bidi_level_of_next_char): Don't try to lookup the cache for the
14690         next/previous character if nothing is cached there yet, or if we
14691         were just reseat()'ed to a new position.
14693         * xdisp.c (set_cursor_from_row): Set start and stop points
14694         according to the row's direction when priming the loop that looks
14695         for the glyph on which to display cursor.
14696         (single_display_spec_intangible_p): Function deleted.
14697         (display_prop_intangible_p): Reimplement to call
14698         handle_display_spec instead of single_display_spec_intangible_p.
14699         Accept 3 additional arguments needed by handle_display_spec.
14700         This fixes incorrect cursor motion across display property with complex
14701         values: lists, `(when COND...)' forms, etc.
14702         (single_display_spec_string_p): Support property values that are
14703         lists with the argument STRING its top-level element.
14704         (display_prop_string_p): Fix the condition for processing a
14705         property that is a list to be consistent with handle_display_spec.
14706         (handle_display_spec): New function, refactored from the
14707         last portion of handle_display_prop.
14708         (compute_display_string_pos): Accept additional argument
14709         FRAME_WINDOW_P.  Call handle_display_spec to determine whether the
14710         value of a `display' property is a "replacing spec".
14711         (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14712         and FRAME_WINDOW_P.  If IT is NULL, don't set up the iterator from
14713         the display property, but just return a value indicating whether
14714         the display property will replace the characters it covers.
14715         (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14716         frame_window_p members of struct bidi_it.
14717         (compute_display_string_pos, compute_display_string_end):
14718         New functions.
14719         (push_it): Accept second argument POSITION, where pop_it should
14720         jump to continue iteration.
14721         (reseat_1): Initialize bidi_it.disp_pos.
14723         * keyboard.c (adjust_point_for_property): Adjust the call to
14724         display_prop_intangible_p to its new signature.
14726         * dispextern.h (struct bidi_it): New member frame_window_p.
14727         (bidi_init_it): Update prototypes.
14728         (display_prop_intangible_p): Update prototype.
14729         (compute_display_string_pos, compute_display_string_end):
14730         Declare prototypes.
14731         (struct bidi_it): New members nchars and disp_pos.  ch_len is now
14732         EMACS_INT.
14734 2011-06-02  Paul Eggert  <eggert@cs.ucla.edu>
14736         Malloc failure behavior now depends on size of allocation.
14737         * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14738         * lisp.h: Change signatures accordingly.
14739         * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14740         All callers changed.  (Bug#8762)
14742         * gnutls.c: Use Emacs's memory allocators.
14743         Without this change, the gnutls library would invoke malloc etc.
14744         directly, which causes problems on non-SYNC_INPUT hosts, and which
14745         runs afoul of improving memory_full behavior.  (Bug#8761)
14746         (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14747         (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14748         xfree instead of the default malloc, realloc, free.
14749         (Fgnutls_boot): No need to check for memory allocation failure,
14750         since xmalloc does that for us.
14752         Remove arbitrary limit of 2**31 entries in hash tables.  (Bug#8771)
14753         * category.c (hash_get_category_set):
14754         * ccl.c (ccl_driver):
14755         * charset.c (Fdefine_charset_internal):
14756         * charset.h (struct charset.hash_index):
14757         * composite.c (get_composition_id, gstring_lookup_cache)
14758         (composition_gstring_put_cache):
14759         * composite.h (struct composition.hash_index):
14760         * dispextern.h (struct image.hash):
14761         * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14762         (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14763         (hashfn_equal, hashfn_user_defined, make_hash_table)
14764         (maybe_resize_hash_table, hash_lookup, hash_put)
14765         (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14766         (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14767         (Fsxhash, Fgethash, Fputhash, Fmaphash):
14768         * image.c (make_image, search_image_cache, lookup_image)
14769         (xpm_put_color_table_h):
14770         * lisp.h (struct Lisp_Hash_Table):
14771         * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
14772         * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
14773         for hashes and hash indexes, instead of 'unsigned' and 'int'.
14774         * alloc.c (allocate_vectorlike):
14775         Check for overflow in vector size calculations.
14776         * ccl.c (ccl_driver):
14777         Check for overflow when converting EMACS_INT to int.
14778         * fns.c, image.c: Remove unnecessary static decls that would otherwise
14779         need to be updated by these changes.
14780         * fns.c (make_hash_table, maybe_resize_hash_table):
14781         Check for integer overflow with large hash tables.
14782         (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14783         Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14784         (SXHASH_REDUCE): New macro.
14785         (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14786         Use it instead of discarding useful hash info with large hash values.
14787         (sxhash_float): New function.
14788         (sxhash): Use it.  No more need for "& INTMASK" due to above changes.
14789         * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
14790         (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14791         Rewrite to use FIXNUM_BITS, as this simplifies things.
14792         (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14793         Adjust signatures to match updated version of code.
14794         (consing_since_gc): Now EMACS_INT, since a single hash table can
14795         use more than INT_MAX bytes.
14797 2011-06-01  Dan Nicolaescu  <dann@ics.uci.edu>
14799         Make it possible to build with GCC-4.6+ -O2 -flto.
14801         * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14803 2011-06-01  Stefan Monnier  <monnier@iro.umontreal.ca>
14805         * minibuf.c (get_minibuffer, read_minibuf_unwind):
14806         Call minibuffer-inactive-mode.
14808 2011-05-31  Juanma Barranquero  <lekktu@gmail.com>
14810         * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14811         Update dependencies.
14813 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
14815         * data.c (init_data): Remove code for UTS, this system is not
14816         supported anymore.
14818 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
14820         Don't force ./temacs to start in terminal mode.
14822         * frame.c (make_initial_frame): Initialize faces in all cases, not
14823         only when CANNOT_DUMP is defined.
14824         * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14826 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
14828         * dispnew.c (add_window_display_history): Use const for the string
14829         pointer.  Remove declaration, not needed.
14831 2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
14833         Use 'inline', not 'INLINE'.
14834         <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
14835         * alloc.c, fontset.c (INLINE): Remove.
14836         * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14837         * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14838         * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14839         * gmalloc.c (register_heapinfo): Use inline unconditionally.
14840         * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14842 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
14844         Make it possible to run ./temacs.
14846         * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14847         syms_of_callproc does the same thing.  Remove test for
14848         "initialized", do it in the caller.
14849         * emacs.c (main): Avoid calling set_initial_environment when dumping.
14851 2011-05-31  Stefan Monnier  <monnier@iro.umontreal.ca>
14853         * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14854         (read_minibuf): Use get_minibuffer.
14855         (syms_of_minibuf): Use DEFSYM.
14856         (Qmetadata): New var.
14857         * data.c (Qbuffer): Don't make it static.
14858         (syms_of_data): Use DEFSYM.
14860 2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
14862         * ccl.c (CCL_CODE_RANGE): Allow negative numbers.  (Bug#8751)
14863         (CCL_CODE_MIN): New macro.
14865 2011-05-30  Paul Eggert  <eggert@cs.ucla.edu>
14867         * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14869         * eval.c (Qdebug): Now static.
14870         * lisp.h (Qdebug): Remove decl.  This reverts a part of the
14871         2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14872         2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14874 2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
14876         * image.c: Various fixes to ImageMagick code comments.
14877         (Fimagemagick_types): Doc fix.
14879 2011-05-29  Paul Eggert  <eggert@cs.ucla.edu>
14881         Minor fixes prompted by GCC 4.6.0 warnings.
14883         * xselect.c (converted_selections, conversion_fail_tag): Now static.
14885         * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14886         (x_clipboard_manager_save_all): Move extern decl to ...
14887         * xterm.h: ... here, so that it can be checked for consistency.
14889 2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
14891         * xselect.c (x_clipboard_manager_save_frame)
14892         (x_clipboard_manager_save_all): New functions.
14893         (Fx_clipboard_manager_save): Lisp function deleted.
14895         * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14896         * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14898         * xterm.h: Update prototype.
14900 2011-05-28  William Xu  <william.xwl@gmail.com>
14902         * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14903         exiting (Bug#8239).
14905 2011-05-28  Jim Meyering  <meyering@redhat.com>
14907         Avoid a sign-extension bug in crypto_hash_function.
14908         * fns.c (to_uchar): Define.
14909         (crypto_hash_function): Use it to convert some newly-signed
14910         variables to unsigned, to avoid sign-extension bugs.  For example,
14911         without this change, (md5 "truc") would evaluate to
14912         45723a2aff78ff4fff7fff1114760e62 rather than the expected
14913         45723a2af3788c4ff17f8d1114760e62.  Reported by Antoine Levitt in
14914         https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
14916 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
14918         Integer overflow fixes.
14920         * dbusbind.c: Serial number integer overflow fixes.
14921         (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
14922         (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14923         to hold a serial number that is too large for a fixnum.
14924         (Fdbus_method_return_internal, Fdbus_method_error_internal):
14925         Check for serial numbers out of range.  Decode any serial number
14926         that was so large that it became a float.  (Bug#8722)
14928         * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14929         (Fdbus_call_method, Fdbus_call_method_asynchronously):
14930         Use XFASTINT rather than XUINT when numbers are nonnegative.
14931         (xd_append_arg, Fdbus_method_return_internal):
14932         (Fdbus_method_error_internal): Likewise.  Also, for unsigned
14933         arguments, check that Lisp number is nonnegative, rather than
14934         silently wrapping negative numbers around.  (Bug#8722)
14935         (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
14936         (Bug#8722)
14938         * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14940         * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14942         ccl: Add integer overflow checks.
14943         * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14944         (IN_INT_RANGE): New macros.
14945         (ccl_driver): Use them to check for integer overflow when
14946         decoding a CCL program.  Many of the new checks are whether XINT (x)
14947         fits in int; it doesn't always, on 64-bit hosts.  The new version
14948         doesn't catch all possible integer overflows, but it's an
14949         improvement.  (Bug#8719)
14951         * alloc.c (make_event_array): Use XINT, not XUINT.
14952         There's no need for unsigned here.
14954         * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14955         This follows up to the 2011-05-06 change that substituted uintptr_t
14956         for EMACS_INT.  This case wasn't caught back then.
14958         Rework Fformat to avoid integer overflow issues.
14959         * editfns.c: Include <float.h> unconditionally, as it's everywhere
14960         now (part of C89).  Include <verify.h>.
14961         (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14962         (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14963         (Fformat): Avoid the prepass trying to compute sizes; it was only
14964         approximate and thus did not catch overflow reliably.  Instead, walk
14965         through the format just once, formatting and computing sizes as we go,
14966         checking for integer overflow at every step, and allocating a larger
14967         buffer as needed.  Keep track separately whether the format is
14968         multibyte.  Keep only the most-recently calculated precision, rather
14969         than them all.  Record whether each argument has been converted to
14970         string.  Use EMACS_INT, not int, for byte and char and arg counts.
14971         Support field widths and precisions larger than INT_MAX.  Avoid
14972         sprintf's undefined behavior with conversion specifications such as %#d
14973         and %.0c.  Fix bug with strchr succeeding on '\0' when looking for
14974         flags.  Fix bug with (format "%c" 256.0).  Avoid integer overflow when
14975         formatting out-of-range floating point numbers with int
14976         formats.  (Bug#8668)
14978         * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14980         * data.c: Avoid integer truncation in expressions involving floats.
14981         * data.c: Include <intprops.h>.
14982         (arith_driver): When there's an integer overflow in an expression
14983         involving floating point, convert the integers to floating point
14984         so that the resulting value does not suffer from catastrophic
14985         integer truncation.  For example, on a 64-bit host (* 4
14986         most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14987         Do not rely on undefined behavior after integer overflow.
14989         merge count_size_as_multibyte, parse_str_to_multibyte
14990         * character.c, character.h (count_size_as_multibyte):
14991         Rename from parse_str_to_multibyte; all uses changed.
14992         Check for integer overflow.
14993         * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14994         since it's now a duplicate of the other.  This is more of
14995         a character than a buffer op, so better that it's in character.c.
14996         * fns.c, print.c: Adjust to above changes.
14998 2011-05-27  Stefan Monnier  <monnier@iro.umontreal.ca>
15000         * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
15002 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
15004         * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15005         (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
15006         (x_clipboard_manager_save): Now static.
15007         (Fx_clipboard_manager_save): Rename local to avoid shadowing.
15009         * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15010         (crypto_hash_function): Now static.
15011         Fix pointer signedness problems.  Avoid unnecessary initializations.
15013 2011-05-27  Chong Yidong  <cyd@stupidchicken.com>
15015         * termhooks.h (Vselection_alist): Make it terminal-local.
15017         * terminal.c (create_terminal): Initialize it.
15019         * xselect.c: Support for clipboard managers.
15020         (Vselection_alist): Move to termhooks.h as terminal-local var.
15021         (LOCAL_SELECTION): New macro.
15022         (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15023         (symbol_to_x_atom): Remove gratuitous arg.
15024         (x_handle_selection_request, lisp_data_to_selection_data)
15025         (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
15026         (x_own_selection, x_get_local_selection, x_convert_selection):
15027         New arg, specifying work frame.  Use terminal-local Vselection_alist.
15028         (some_frame_on_display): Delete unused function.
15029         (Fx_own_selection_internal, Fx_get_selection_internal)
15030         (Fx_disown_selection_internal, Fx_selection_owner_p)
15031         (Fx_selection_exists_p): New optional frame arg.
15032         (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15033         (x_handle_selection_clear): Don't treat other terminals with the
15034         same keyboard specially.  Use the terminal-local Vselection_alist.
15035         (x_clear_frame_selections): Use Frun_hook_with_args.
15037         * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
15039         * xterm.h: Add support for those atoms.
15041 2011-05-26  Chong Yidong  <cyd@stupidchicken.com>
15043         * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15044         (converted_selections, conversion_fail_tag): New global variables.
15045         (x_selection_request_lisp_error): Free the above.
15046         (x_get_local_selection): Remove unnecessary code.
15047         (x_reply_selection_request): Args changed; handle arbitrary array
15048         of converted selections stored in converted_selections.
15049         Separate the XChangeProperty and SelectionNotify steps.
15050         (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15051         (x_convert_selection): New function.
15052         (x_handle_selection_event): Simplify.
15053         (x_get_foreign_selection): Don't ignore incoming requests while
15054         waiting for an answer; this will fail when we implement
15055         SAVE_TARGETS, and seems unnecessary anyway.
15056         (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15057         (Vx_sent_selection_functions): Doc fix.
15059 2011-05-26  Leo Liu  <sdl.web@gmail.com>
15061         * editfns.c (Ftranspose_regions): Allow empty regions.  (Bug#8699)
15063 2011-05-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
15065         * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15067         * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15068         for fringe update if it has periodic bitmap.
15069         (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
15070         and fringe_bitmap_periodic_p.
15072         * fringe.c (get_fringe_bitmap_data): New function.
15073         (draw_fringe_bitmap_1, update_window_fringes): Use it.
15074         (update_window_fringes): Record periodicity of fringe bitmap in glyph
15075         row.  Mark glyph row for fringe update if periodicity changed.
15077         * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15078         for fringe update unless it has periodic bitmap.
15080 2011-05-25  Kenichi Handa  <handa@m17n.org>
15082         * xdisp.c (get_next_display_element): Set correct it->face_id for
15083         a static composition.
15085 2011-05-24  Leo Liu  <sdl.web@gmail.com>
15087         * deps.mk (fns.o):
15088         * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15090         * fns.c (crypto_hash_function, Fsha1): New function.
15091         (Fmd5): Use crypto_hash_function.
15092         (syms_of_fns): Add Ssha1.
15094 2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
15096         * gnutls.c: Remove unused macros.
15097         (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15098         (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15099         Remove macros that are defined and never used.
15100         Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15102 2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
15104         * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15105         (Fx_get_selection_internal): Minor cleanup.
15106         (Fx_own_selection_internal): Rename arguments for consistency with
15107         select.el.
15109 2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
15111         * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15113 2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
15115         * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15117 2011-05-21  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
15119         * dispnew.c (scrolling_window): Don't exclude the case that the
15120         last enabled row in the desired matrix touches the bottom boundary.
15122 2011-05-21  Glenn Morris  <rgm@gnu.org>
15124         * Makefile.in ($(etc)/DOC): Make second command line even shorter.
15125         (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15126         and add some more files.
15128 2011-05-20  Eli Zaretskii  <eliz@gnu.org>
15130         * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15131         report_file_error introduced by the change from 2011-05-07.
15133 2011-05-20  Paul Eggert  <eggert@cs.ucla.edu>
15135         * systime.h (Time): Define only if emacs is defined.
15136         This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15137         where the include path doesn't have X11/X.h by default.  See
15138         <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15140 2011-05-20  Kenichi Handa  <handa@m17n.org>
15142         * composite.c (find_automatic_composition): Fix previous change.
15144 2011-05-20  Glenn Morris  <rgm@gnu.org>
15146         * lisp.mk: New file, split from Makefile.in.
15147         * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15148         (shortlisp): Remove.
15149         ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15151 2011-05-19  Glenn Morris  <rgm@gnu.org>
15153         * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15154         (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15155         (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15156         (lisp): Set the order to that of loadup.el.
15157         (shortlisp): Make it a copy of $lisp.
15158         (SOME_MACHINE_LISP): Remove.
15159         ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15160         Use just $shortlisp, not $SOME_MACHINE_LISP too.
15162 2011-05-18  Kenichi Handa  <handa@m17n.org>
15164         * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15165         (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15166         (find_automatic_composition): Mostly rewrite for efficiency.
15168 2011-05-18  Juanma Barranquero  <lekktu@gmail.com>
15170         * makefile.w32-in: Update dependencies.
15172 2011-05-18  Christoph Scholtes  <cschol2112@googlemail.com>
15174         * menu.c: Include limits.h (fixes the MS-Windows build broken by
15175         2011-06-18T18:49:19Z!cyd@stupidchicken.com).
15177 2011-05-18  Paul Eggert  <eggert@cs.ucla.edu>
15179         Fix some integer overflow issues, such as string length overflow.
15181         * insdel.c (count_size_as_multibyte): Check for string overflow.
15183         * character.c (lisp_string_width): Check for string overflow.
15184         Use EMACS_INT, not int, for string indexes and lengths; in
15185         particular, 2nd arg is now EMACS_INT, not int.  Do not crash if
15186         the resulting string length overflows an EMACS_INT; instead,
15187         report a string overflow if no precision given.  When checking for
15188         precision exhaustion, use a check that cannot possibly have
15189         integer overflow.  (Bug#8675)
15190         * character.h (lisp_string_width): Adjust to new signature.
15192         * alloc.c (string_overflow): New function.
15193         (Fmake_string): Use it.  This doesn't change behavior, but saves
15194         a few bytes and will simplify future changes.
15195         * character.c (string_escape_byte8): Likewise.
15196         * lisp.h (string_overflow): New decl.
15198         Fixups, following up to the user-interface timestamp change.
15199         * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15200         for UI timestamps, instead of unsigned long.
15201         * msdos.c (mouse_get_pos): Likewise.
15202         * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
15203         * w32gui.h (Time): Define by including "systime.h" rather than by
15204         declaring it ourselves.  (Bug#8664)
15206         * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15207         * image.c (clear_image_cache): Likewise.
15209         * term.c (term_mouse_position): Don't assume time_t wraparound.
15211         Be more systematic about user-interface timestamps.
15212         Before, the code sometimes used 'Time', sometimes 'unsigned long',
15213         and sometimes 'EMACS_UINT', to represent these timestamps.
15214         This change causes it to use 'Time' uniformly, as that's what X uses.
15215         This makes the code easier to follow, and makes it easier to catch
15216         integer overflow bugs such as Bug#8664.
15217         * frame.c (Fmouse_position, Fmouse_pixel_position):
15218         Use Time, not unsigned long, for user-interface timestamps.
15219         * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15220         (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15221         * keyboard.h (last_event_timestamp): Likewise.
15222         * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15223         * menu.h (xmenu_show): Likewise.
15224         * term.c (term_mouse_position): Likewise.
15225         * termhooks.h (struct input_event.timestamp): Likewise.
15226         (struct terminal.mouse_position_hook): Likewise.
15227         * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15228         * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15229         * systime.h (Time): New decl.  Pull it in from <X11/X.h> if
15230         HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15231         what it was before.
15232         * menu.h, termhooks.h: Include "systime.h", for Time.
15234         * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15235         Don't assume that the difference between two unsigned long values
15236         can fit into an integer.  At this point, we know button_down_time
15237         <= event->timestamp, so the difference must be nonnegative, so
15238         there's no need to cast the result if double-click-time is
15239         nonnegative, as it should be; check that it's nonnegative, just in
15240         case.  This bug is triggered when events are more than 2**31 ms
15241         apart (about 25 days).  (Bug#8664)
15243         * xselect.c (last_event_timestamp): Remove duplicate decl.
15244         (x_own_selection): Remove needless cast to unsigned long.
15246         * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15247         that always fit in int.  Use a sentinel instead of a counter, to
15248         avoid a temp and to allay GCC's concerns about possible int overflow.
15249         * frame.h (struct frame): Use int for menu_bar_items_used
15250         instead of EMACS_INT, since it always fits in int.
15252         * menu.c (grow_menu_items): Check for int overflow.
15254         * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15256         * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15257         Before, the code was not consistent.  These values cannot exceed
15258         2**31 - 1 so there's no need to make them unsigned.
15259         (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15260         (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15261         (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15262         as modifiers.
15263         * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15265         * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15266         (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15267         Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15268         presumably because the widths might not match.
15270         * window.c (size_window): Avoid needless test at loop start.
15272 2011-05-18  Courtney Bane  <emacs-bugs-7626@cbane.org>  (tiny change)
15274         * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15276 2011-05-12  Drew Adams  <drew.adams@oracle.com>
15278         * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15280 2011-05-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
15282         * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15283         `width' to `bar_area_x' and `bar_area_width', respectively.
15284         (x_scroll_run): Take account of fringe background extension.
15286         * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15287         Rename local vars `left' and `width' to `bar_area_x' and
15288         `bar_area_width', respectively.
15289         (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15290         background extension.
15292 2011-05-10  Jim Meyering  <meyering@redhat.com>
15294         * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15296 2011-05-10  Juanma Barranquero  <lekktu@gmail.com>
15298         * image.c (Finit_image_library): Return t for built-in image types,
15299         like pbm and xbm.  (Bug#8640)
15301 2011-05-09  Andreas Schwab  <schwab@linux-m68k.org>
15303         * w32menu.c (set_frame_menubar): Fix submenu allocation.
15305 2011-05-07  Eli Zaretskii  <eliz@gnu.org>
15307         * w32console.c (Fset_screen_color): Doc fix.
15308         (Fget_screen_color): New function.
15309         (syms_of_ntterm): Defsubr it.
15311         * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15312         unlink the temporary file if Fcall_process didn't create it in the
15313         first place.
15314         (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15315         child process will be redirected to a file specified with `:file'.
15316         Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15317         cue to call_process_cleanup not to close that handle.
15319 2011-05-07  Ben Key  <bkey76@gmail.com>
15321         * makefile.w32-in: The bootstrap-temacs rule now makes use of
15322         one of two shell specific rules, either bootstrap-temacs-CMD or
15323         bootstrap-temacs-SH.  The bootstrap-temacs-SH rule is identical
15324         to the previous implementation of the bootstrap-temacs rule.
15325         The bootstrap-temacs-CMD rule is similar to the previous
15326         implementation of the bootstrap-temacs rule except that it
15327         makes use of the ESC_CFLAGS variable instead of the CFLAGS
15328         variable.
15330         These changes, along with some changes to nt/configure.bat,
15331         nt/gmake.defs, and nt/nmake.defs, are required to extend my
15332         earlier fix to add support for --cflags and --ldflags options
15333         that include quotes so that it works whether make uses cmd or
15334         sh as the shell.
15336 2011-05-06  Michael Albinus  <michael.albinus@gmx.de>
15338         * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15339         (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15340         is a constant.
15341         (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15342         a string.  Handle both cases.
15343         (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15344         (Fdbus_register_method): Use Qinvalid_function.
15346 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
15348         * makefile.w32-in: Update dependencies.
15349         (LISP_H): Add inttypes.h and stdin.h.
15350         (PROCESS_H): Add unistd.h.
15352 2011-05-06  Eli Zaretskii  <eliz@gnu.org>
15354         * lread.c: Include limits.h (fixes the MS-Windows build broken by
15355         2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15357 2011-05-06  Paul Eggert  <eggert@cs.ucla.edu>
15359         * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15361         * term.c (vfatal): Remove stray call to va_end.
15362         It's not needed and the C Standard doesn't allow it here anyway.
15364         Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15365         * eval.c (verror): doprnt a copy of ap, not the original.  (Bug#8545)
15367         * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15368         bytes.
15370         * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15372         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15374         * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15376         * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15378         * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15380         * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15381         * charset.c (Fdefine_charset_internal): Don't initialize
15382         charset.code_space[15].  The value was garbage, on hosts with
15383         32-bit int (Bug#8600).
15385         * lread.c (read_integer): Be more consistent with string-to-number.
15386         Use string_to_number to do the actual conversion; this avoids
15387         rounding errors and fixes some other screwups.  Without this fix,
15388         for example, #x1fffffffffffffff was misread as -2305843009213693952.
15389         (digit_to_number): Move earlier, for benefit of read_integer.
15390         Return -1 if the digit is out of range for the base, -2 if it is
15391         not a digit in any supported base.  (Bug#8602)
15393         * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15395         * dispnew.c (scrolling_window): Return 1 if we scrolled,
15396         to match comment at start of function.  This also removes a
15397         GCC warning about overflow in a 32+64-bit port.
15399         * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15401         * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15402         Reported by Stefan Monnier in
15403         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
15404         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15405         Use SYMBOLP-guarded XSYMBOL, not XPNTR.
15407         * lisp.h (EMACS_INTPTR): Remove.  All uses changed to intptr_t.
15408         (EMACS_UINTPTR): Likewise, with uintptr_t.
15410         * lisp.h: Prefer 64-bit EMACS_INT if available.
15411         (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15412         on 32-bit hosts that have 64-bit int, so that they can access
15413         large files.
15414         However, temporarily disable this change unless the temporary
15415         symbol WIDE_EMACS_INT is defined.
15417         * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15419         Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15420         This removes an assumption that EMACS_INT and long are the same
15421         width as pointers.  The assumption is true for Emacs porting targets
15422         now, but we want to make other targets possible.
15423         * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15424         (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15425         In the rest of the code, change types of integers that hold casted
15426         pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15427         replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15428         (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15429         (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15430         No need to cast type when ORing.
15431         (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15432         * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15433         * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15434         assume EMACS_INT is the same width as char *.
15435         * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15436         (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15437         Remove no-longer-needed casts.
15438         (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15439         (xg_tool_bar_help_callback, xg_make_tool_item):
15440         Use EMACS_INTPTR to hold an integer
15441         that will be cast to void *; this can avoid a GCC warning
15442         if EMACS_INT is not the same width as void *.
15443         * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15444         * xdisp.c (display_echo_area_1, resize_mini_window_1):
15445         (current_message_1, set_message_1):
15446         Use a local to convert to proper width without a cast.
15447         * xmenu.c (dialog_selection_callback): Likewise.
15449         * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15450         Also, don't assume VALBITS / RAND_BITS is less than 5,
15451         and don't rely on undefined behavior when shifting a 1 left into
15452         the sign bit.
15453         * lisp.h (get_random): Change signature to match.
15455         * lread.c (hash_string): Use size_t, not int, for hash computation.
15456         Normally we prefer signed values; but hashing is special, because
15457         it's better to use unsigned division on hash table sizes so that
15458         the remainder is nonnegative.  Also, size_t is the natural width
15459         for hashing into memory.  The previous code used 'int', which doesn't
15460         retain enough info to hash well into very large tables.
15461         (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15463         * dbusbind.c: Don't possibly lose pointer info when converting.
15464         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15465         Use XPNTR rather than XHASH, so that the high-order bits of
15466         the pointer aren't lost when converting through void *.
15468         * eval.c (Fautoload): Don't double-shift a pointer.
15470         * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15472 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
15474         * gnutls.c (DEF_GNUTLS_FN):
15475         * image.c (DEF_IMGLIB_FN): Make function pointers static.
15477 2011-05-05  Andreas Schwab  <schwab@linux-m68k.org>
15479         * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15480         marker.  (Bug#8610)
15482 2011-05-05  Eli Zaretskii  <eliz@gnu.org>
15484         * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15485         New version that can reserve upto 2GB of heap space.
15487 2011-05-05  Chong Yidong  <cyd@stupidchicken.com>
15489         * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15491 2011-05-05  Teodor Zlatanov  <tzz@lifelogs.com>
15493         * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15494         `gnutls_certificate_set_x509_key_file'.
15496 2011-05-05  Juanma Barranquero  <lekktu@gmail.com>
15498         * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15499         Update dependencies.
15501 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
15503         * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15504         * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15505         Remove unused parameter `fildes'.
15506         * process.c (read_process_output, send_process): Don't pass it.
15508 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
15510         Fix previous change: the library cache is defined in w32.c.
15511         * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15512         (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15514 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
15516         Implement dynamic loading of GnuTLS on Windows.
15518         * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15519         (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15520         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15521         Declare.
15523         * gnutls.c (Qgnutls_dll): Define.
15524         (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15525         (gnutls_*): Declare function pointers.
15526         (init_gnutls_functions): New function to initialize function pointers.
15527         (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15528         (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15529         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15530         Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15531         (emacs_gnutls_write, emacs_gnutls_read)
15532         (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15533         (Fgnutls_available_p): New function.
15534         (Fgnutls_boot): Call Fgnutls_available_p.  Use function pointers.
15535         (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15536         (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15538         * image.c: Include w32.h.
15539         (Vimage_type_cache): Delete.
15540         (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15541         (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15542         (w32_delayed_load): Move to w32.c.
15544         * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15546         * w32.c (QCloaded_from, Vlibrary_cache): Define.
15547         (w32_delayed_load): Move from image.c.  When loading a library, record
15548         its filename in the :loaded-from property of the library id.
15549         (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15550         Initialize and staticpro them.
15551         (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15553         * process.c: Include lisp.h before w32.h, not after.
15554         (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15555         instead of gnutls_record_check_pending.
15557         * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15559 2011-05-04  Teodor Zlatanov  <tzz@lifelogs.com>
15561         * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15562         instead of :keyfiles.  Give GnuTLS the keylist and the CRL lists
15563         as passed in.
15565 2011-05-03  Jan Djärv  <jan.h.d@swipnet.se>
15567         * xterm.c (x_set_frame_alpha): Do not set property on anything
15568         else than FRAME_X_OUTER_WINDOW (Bug#8608).
15570 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
15572         * sysdep.c (get_tty_size) [WINDOWSNT]: Implement.  (Bug#8596)
15574 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
15576         * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15577         (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15578         (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15579         (gnutls_global_initialized, Qgnutls_bootprop_priority)
15580         (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15581         (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15582         (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15583         (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15584         (Qgnutls_bootprop_callbacks_verify): Make static.
15586 2011-05-01  Andreas Schwab  <schwab@linux-m68k.org>
15588         * callproc.c: Indentation fixup.
15590         * sysdep.c (wait_for_termination_1): Make static.
15591         (wait_for_termination, interruptible_wait_for_termination):
15592         Move after wait_for_termination_1.
15594 2011-05-01  Lars Magne Ingebrigtsen  <larsi@gnus.org>
15596         * sysdep.c (interruptible_wait_for_termination): New function
15597         which is like wait_for_termination, but allows keyboard
15598         interruptions.
15600         * callproc.c (Fcall_process): Add (:file "file") as an option for
15601         the STDOUT buffer.
15602         (Fcall_process_region): Ditto.
15604 2011-04-30  Eli Zaretskii  <eliz@gnu.org>
15606         * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15607         rather than `XVECTOR (FOO)->size'.
15609         * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15610         inttypes.h, as a gnulib replacement is used if it not available in
15611         system headers.
15613 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
15615         Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15616         * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15617         of MOST_POSITIVE_FIXNUM.  (Bug#8528)
15619         * coding.c (coding_alloc_by_realloc): Error out if destination
15620         will grow beyond MOST_POSITIVE_FIXNUM.
15621         (decode_coding_emacs_mule): Abort if there isn't enough place in
15622         charbuf for the composition carryover bytes.  Reserve an extra
15623         space for up to 2 characters produced in a loop.
15624         (decode_coding_iso_2022): Abort if there isn't enough place in
15625         charbuf for the composition carryover bytes.
15627 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
15629         * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15630         aborting when %lld or %lll format is passed.
15631         [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15632         %llo or %llx format is passed.  (Bug#8545)
15634         * window.c (window_scroll_line_based): Use a marker instead of
15635         simple variables to record original value of point.  (Bug#7952)
15637         * doprnt.c (doprnt): Fix the case where a multibyte sequence
15638         produced by %s or %c overflows available buffer space.  (Bug#8545)
15640 2011-04-28  Paul Eggert  <eggert@cs.ucla.edu>
15642         * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
15643         (SIZE_MAX): Move defn after all includes, as they might #define it.
15645 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
15647         * w32.c (init_environment): Warn about defaulting HOME to C:\.
15649 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
15651         * keyboard.c (Qdelayed_warnings_hook): Define.
15652         (command_loop_1): Run `delayed-warnings-hook'
15653         if Vdelayed_warnings_list is non-nil.
15654         (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15655         (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15657 2011-04-28  Eli Zaretskii  <eliz@gnu.org>
15659         * doprnt.c (doprnt): Don't return value smaller than the buffer
15660         size if the message was truncated.  (Bug#8545).
15662 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
15664         * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15665         (Fx_window_property): #if-0 the whole functions, not just the bodies.
15667 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
15669         * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15671 2011-04-27  Juanma Barranquero  <lekktu@gmail.com>
15673         * makefile.w32-in: Update dependencies.
15675 2011-04-27  Eli Zaretskii  <eliz@gnu.org>
15677         Improve `doprnt' and its usage.  (Bug#8545)
15678         * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15679         `format_end'.  Remove support for %l as a conversion specifier.
15680         Don't use xrealloc.  Improve diagnostics when the %l size modifier
15681         is used.  Update the commentary.
15683         * eval.c (verror): Simplify calculation of size_t.
15685         * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15686         messages.
15688 2011-04-27  Yoshiaki Kasahara  <kasahara@nc.kyushu-u.ac.jp>  (tiny change)
15690         * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15691         change.
15693 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
15695         * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15696         This makes this file independent of the recent pseudovector change.
15698 2011-04-26  Paul Eggert  <eggert@cs.ucla.edu>
15700         * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15702         * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
15703         (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
15704         Remove unused local.
15705         (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
15707         * lisp.h: Fix a problem with aliasing and vector headers.  (Bug#8546)
15708         GCC 4.6.0 optimizes based on type-based alias analysis.
15709         For example, if b is of type struct buffer * and v of type struct
15710         Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15711         != &v->size, and therefore "v->size = 1; b->size = 2; return
15712         v->size;" must therefore return 1.  This assumption is incorrect
15713         for Emacs, since it type-puns struct Lisp_Vector * with many other
15714         types.  To fix this problem, this patch adds a new type struct
15715         vectorlike_header that documents the constraints on layout of vectors
15716         and pseudovectors, and helps optimizing compilers not get fooled
15717         by Emacs's type punning.  It also adds the macros XSETTYPED_PVECTYPE
15718         XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
15719         * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15720         the size member.
15721         (XSETPVECTYPE): Rewrite in terms of new macro.
15722         (XSETPVECTYPESIZE): New macro, specifying both type and size.
15723         This is a bit clearer, and further avoids the possibility of
15724         undesirable aliasing.
15725         (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
15726         (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
15727         (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15728         since Lisp_Subr is a special case (no "next" field).
15729         (ASIZE): Now uses header.size rather than size.
15730         All previous uses of XVECTOR (foo)->size replaced to use this macro,
15731         to avoid the hassle of writing XVECTOR (foo)->header.size.
15732         (struct vectorlike_header): New type.
15733         (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15734         object, to help avoid aliasing.
15735         (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15736         (SUBRP): Likewise, since Lisp_Subr is a special case.
15737         * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15738         (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15739         (struct Lisp_Hash_Table): Combine first two members into a single
15740         struct vectorlike_header member.  All uses of "size" and "next" members
15741         changed to be "header.size" and "header.next".
15742         * buffer.h (struct buffer): Likewise.
15743         * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15744         * frame.h (struct frame): Likewise.
15745         * process.h (struct Lisp_Process): Likewise.
15746         * termhooks.h (struct terminal): Likewise.
15747         * window.c (struct save_window_data, struct saved_window): Likewise.
15748         * window.h (struct window): Likewise.
15749         * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15750         Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15751         * buffer.c (init_buffer_once): Likewise.
15752         * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15753         special case.
15754         * process.c (Fformat_network_address): Use local var for size,
15755         for brevity.
15757         * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15759         Make the Lisp reader and string-to-float more consistent (Bug#8525)
15760         * data.c (atof): Remove decl; no longer used or needed.
15761         (digit_to_number): Move to lread.c.
15762         (Fstring_to_number): Use new string_to_number function, to be
15763         consistent with how the Lisp reader treats infinities and NaNs.
15764         Do not assume that floating-point numbers represent EMACS_INT
15765         without losing information; this is not true on most 64-bit hosts.
15766         Avoid double-rounding errors, by insisting on integers when
15767         parsing non-base-10 numbers, as the documentation specifies.
15768         * lisp.h (string_to_number): New decl, replacing ...
15769         (isfloat_string): Remove.
15770         * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
15771         (read1): Do not accept +. and -. as integers; this
15772         appears to have been a coding error.  Similarly, do not accept
15773         strings like +-1e0 as floating point numbers.  Do not report
15774         overflow for integer overflows unless the base is not 10 which
15775         means we have no simple and reliable way to continue.
15776         Break out the floating-point parsing into a new
15777         function string_to_number, so that Fstring_to_number parses
15778         floating point numbers consistently with the Lisp reader.
15779         (digit_to_number): Move here from data.c.  Make it static inline.
15780         (E_CHAR, EXP_INT): Remove, replacing with ...
15781         (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15782         (string_to_number): New function, replacing isfloat_string.
15783         This function checks for valid syntax and produces the resulting
15784         Lisp float number too.  Rework it so that string-to-number
15785         no longer mishandles examples like "1.0e+".  Use strtoumax,
15786         so that overflow for non-base-10 numbers is reported only when
15787         there's no portable and simple way to convert to floating point.
15789         * textprop.c (set_text_properties_1): Rewrite for clarity,
15790         and to avoid GCC warning about integer overflow.
15792         * intervals.h (struct interval): Use EMACS_INT for members
15793         where EMACS_UINT might cause problems.  See
15794         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15795         (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15796         * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15797         All uses changed.
15798         (offset_intervals): Tell GCC not to worry about length overflow
15799         when negating a negative length.
15801         * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15802         (overrun_check_free): Likewise.
15804         * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15805         in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15806         word size.
15808         * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15809         (gnutls_make_error): Rename local to avoid shadowing.
15810         (gnutls_emacs_global_deinit): ifdef out; not used.
15811         (Fgnutls_boot): Use const for pointer to readonly storage.
15812         Comment out unused local.  Fix pointer signedness problems.
15814         * lread.c (openp): Don't stuff size_t into an 'int'.
15815         Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15816         about possible signed overflow.
15818         * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15819         (GDK_KEY_g): Don't define if already defined.
15820         (xg_prepare_tooltip): Avoid pointer signedness problem.
15821         (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15823         * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15824         behavior with 1 << 31.  GCC 4.6.0 warns about this on 32-bit hosts.
15826         * xfns.c (Fx_window_property): Simplify a bit,
15827         to make a bit faster and to avoid GCC 4.6.0 warning.
15828         * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15830         * fns.c (internal_equal): Don't assume size_t fits in int.
15832         * alloc.c (compact_small_strings): Tighten assertion a little.
15834         Replace pEd with more-general pI, and fix some printf arg casts.
15835         * lisp.h (pI): New macro, generalizing old pEd macro to other
15836         conversion specifiers.  For example, use "...%"pI"d..." rather
15837         than "...%"pEd"...".
15838         (pEd): Remove.  All uses replaced with similar uses of pI.
15839         * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
15840         * alloc.c (check_pure_size): Don't overflow by converting size to int.
15841         * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15842         * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15843         * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15844         (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15845         * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15846         64-bit hosts.
15847         (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15848         * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15849         * print.c (safe_debug_print, print_object): Likewise.
15850         (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15851         to int.
15852         Use pI instead of if-then-else-abort.  Use %p to avoid casts,
15853         avoiding the 0 flag, which is not portable.
15854         * process.c (Fmake_network_process): Use pI to avoid cast.
15855         * region-cache.c (pp_cache): Likewise.
15856         * xdisp.c (decode_mode_spec): Likewise.
15857         * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15858         behavior on 64-bit hosts with printf arg.
15859         * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
15860         (x_stop_queuing_selection_requests): Likewise.
15861         (x_get_window_property): Don't truncate byte count to an 'int'
15862         when tracing.
15864         * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15865         here, since it parses constructs like leading '-' and spaces,
15866         which are not wanted; and it overflows with large numbers.
15867         Instead, simply match F[0-9]+, which is what is wanted anyway.
15869         * alloc.c: Remove unportable assumptions about struct layout.
15870         (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15871         (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15872         (allocate_vectorlike, make_pure_vector): Use the new macros,
15873         plus offsetof, to remove unportable assumptions about struct layout.
15874         These assumptions hold on all porting targets that I know of, but
15875         they are not guaranteed, they're easy to remove, and removing them
15876         makes further changes easier.
15878         * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15879         This doesn't fix a bug but makes the code clearer.
15880         (string_overrun_cookie): Now const.  Use initializers that
15881         don't formally overflow signed char, to avoid warnings.
15882         (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15883         can cause Emacs to crash when string overrun checking is enabled.
15884         (allocate_buffer): Don't assume sizeof (struct buffer) is a
15885         multiple of sizeof (EMACS_INT); it need not be, if
15886         alignof(EMACS_INT) < sizeof (EMACS_INT).
15887         (check_sblock, check_string_bytes, check_string_free_list): Protoize.
15889 2011-04-26  Juanma Barranquero  <lekktu@gmail.com>
15891         * keyboard.c (QCrtl): Rename from Qrtl.  All uses changed.
15893 2011-04-26  Teodor Zlatanov  <tzz@lifelogs.com>
15895         * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
15896         supposed to be handshaking.  (Bug#8556)
15897         Reported by Paul Eggert <eggert@cs.ucla.edu>.
15899 2011-04-26  Daniel Colascione  <dan.colascione@gmail.com>
15901         * lisp.h (Qdebug): List symbol.
15902         * eval.c (Qdebug): Restore global linkage.
15903         * keyboard.c (debug-on-event): New variable.
15904         (handle_user_signal): Break into debugger when debug-on-event
15905         matches the current signal symbol.
15907 2011-04-25  Dan Nicolaescu  <dann@ics.uci.edu>
15909         * alloc.c (check_sblock, check_string_bytes)
15910         (check_string_free_list): Convert to standard C.
15912 2011-04-25  Teodor Zlatanov  <tzz@lifelogs.com>
15914         * w32.c (emacs_gnutls_push): Fix typo.
15916 2011-04-25  Eli Zaretskii  <eliz@gnu.org>
15918         * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15919         "cast to pointer from integer of different size".
15921         Improve doprnt and its use in verror.  (Bug#8545)
15922         * doprnt.c (doprnt): Document the set of format control sequences
15923         supported by the function.  Use SAFE_ALLOCA instead of always
15924         using `alloca'.
15926         * eval.c (verror): Don't limit the buffer size at size_max-1, that
15927         is one byte too soon.  Don't use xrealloc; instead xfree and
15928         xmalloc anew.
15930 2011-04-24  Teodor Zlatanov  <tzz@lifelogs.com>
15932         * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15933         callbacks stage.
15935         * gnutls.c: Renamed global_initialized to
15936         gnutls_global_initialized.  Added internals for the
15937         :verify-hostname-error, :verify-error, and :verify-flags
15938         parameters of `gnutls-boot' and documented those parameters in the
15939         docstring.  Start callback support.
15940         (emacs_gnutls_handshake): Add Woe32 support.  Retry handshake
15941         unless a fatal error occurred.  Call gnutls_alert_send_appropriate
15942         on error.  Return error code.
15943         (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15944         (emacs_gnutls_read): Likewise.
15945         (Fgnutls_boot): Return handshake error code.
15946         (emacs_gnutls_handle_error): New function.
15947         (wsaerror_to_errno): Likewise.
15949         * w32.h (emacs_gnutls_pull): Add prototype.
15950         (emacs_gnutls_push): Likewise.
15952         * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15953         (emacs_gnutls_push): Likewise.
15955 2011-04-24  Claudio Bley  <claudio.bley@gmail.com>  (tiny change)
15957         * process.c (wait_reading_process_output): Check if GnuTLS
15958         buffered some data internally if no FDs are set for TLS
15959         connections.
15961         * makefile.w32-in (OBJ2): Add gnutls.$(O).
15962         (LIBS): Link to USER_LIBS.
15963         ($(BLD)/gnutls.$(0)): New target.
15965 2011-04-24  Eli Zaretskii  <eliz@gnu.org>
15967         * xdisp.c (handle_single_display_spec): Rename the
15968         display_replaced_before_p argument into display_replaced_p, to
15969         make it consistent with the commentary.  Fix typos in the
15970         commentary.
15972         * textprop.c (syms_of_textprop): Remove dead code.
15973         (copy_text_properties): Delete obsolete commentary about an
15974         interface that was deleted long ago.  Fix typos in the description
15975         of arguments.
15977         * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15978         to changes in oldXMenu/XMenu.h from 2011-04-16.
15979         <menu_help_message, prev_menu_help_message>: Constify.
15980         (IT_menu_make_room): menu->help_text is now `const char **';
15981         adjust.
15983         * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15984         to changes in oldXMenu/XMenu.h from 2011-04-16.
15985         (struct XMenu): Declare `help_text' `const char **'.
15987         * xfaces.c <Qunspecified>: Make extern again.
15989         * syntax.c: Include sys/types.h before including regex.h, as
15990         required by POSIX.
15992         * doc.c (get_doc_string): Improve the format passed to `error'.
15994         * doprnt.c (doprnt): Improve commentary.
15996         * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15998         * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15999         them with etags.
16001         * makefile.w32-in (globals.h): Add a dummy recipe, to make any
16002         changes in globals.h immediately force recompilation.
16003         (TAGS): Depend on $(CURDIR)/m/intel386.h and
16004         $(CURDIR)/s/ms-w32.h.
16005         (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
16007         * character.c (Fchar_direction): Function deleted.
16008         (syms_of_character): Don't defsubr it.
16009         <char-direction-table>: Deleted.
16011 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
16013         Fix doprnt so it could be used again safely in `verror'.  (Bug#8435)
16014         * doprnt.c: Include limits.h.
16015         (SIZE_MAX): New macro.
16016         (doprnt): Return a size_t value.  2nd arg is now size_t.
16017         Many local variables are now size_t instead of int or unsigned.
16018         Improve overflow protection.  Support `l' modifier for integer
16019         conversions.  Support %l conversion.  Don't assume an EMACS_INT
16020         argument for integer conversions and for %c.
16022         * lisp.h (doprnt): Restore prototype.
16024         * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16025         $(SRC)/character.h.
16027         * Makefile.in (base_obj): Add back doprnt.o.
16029         * deps.mk (doprnt.o): Add back prerequisites.
16030         (callint.o): Depend on character.h.
16032         * eval.c (internal_lisp_condition_case): Include the handler
16033         representation in the error message.
16034         (verror): Call doprnt instead of vsnprintf.  Fix an off-by-one bug
16035         when breaking from the loop.
16037         * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
16039         * callint.c (Fcall_interactively): When displaying error message
16040         about invalid control letter, pass the character's codepoint, not
16041         a pointer to its multibyte form.  Improve display of the character
16042         in octal and display also its hex code.
16044         * character.c (char_string): Use %x to display the (unsigned)
16045         codepoint of an invalid character, to avoid displaying a bogus
16046         negative value.
16048         * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16049         `error', not SYMBOL_NAME itself.
16051         * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16052         character arguments to `error'.
16054         * charset.c (check_iso_charset_parameter): Fix incorrect argument
16055         to `error' in error message about FINAL_CHAR argument.  Make sure
16056         FINAL_CHAR is a character, and use %c when it is passed as
16057         argument to `error'.
16059 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
16061         * s/ms-w32.h (localtime): Redirect to sys_localtime.
16063         * w32.c: Include <time.h>.
16064         (sys_localtime): New function.
16066 2011-04-23  Chong Yidong  <cyd@stupidchicken.com>
16068         * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16070         * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
16072 2011-04-23  Samuel Thibault  <sthibault@debian.org>  (tiny change)
16074         * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16075         zombies (Bug#8467).
16077 2011-04-19  Eli Zaretskii  <eliz@gnu.org>
16079         * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16080         gl_state.e_property when gl_state.object is Qt.
16082         * insdel.c (make_gap_larger): Remove limitation of buffer size
16083         to <= INT_MAX.
16085 2011-04-18  Chong Yidong  <cyd@stupidchicken.com>
16087         * xdisp.c (lookup_glyphless_char_display)
16088         (produce_glyphless_glyph): Handle cons cell entry in
16089         glyphless-char-display.
16090         (Vglyphless_char_display): Document it.
16092         * term.c (produce_glyphless_glyph): Handle cons cell entry in
16093         glyphless-char-display.
16095 2011-04-17  Chong Yidong  <cyd@stupidchicken.com>
16097         * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16099         * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16101         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16102         definition for no-X builds.
16104 2011-04-16  Paul Eggert  <eggert@cs.ucla.edu>
16106         Static checks with GCC 4.6.0 and non-default toolkits.
16108         * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16110         * process.c (keyboard_bit_set): Define only if SIGIO.
16111         (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16112         (send_process): Repair possible setjmp clobbering.
16114         * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16116         * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16118         * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16120         * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16121         Define only if needed.
16123         * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16124         by pacifying GCC about it.  Maybe it's time to retire it?
16125         * xfaces.c (USG, __TIMEVAL__): Likewise.
16127         * dispextern.h (struct redisplay_interface): Rename param
16128         to avoid shadowing.
16129         * termhooks.h (struct terminal): Likewise.
16130         * xterm.c (xembed_send_message): Likewise.
16132         * insdel.c (make_gap_smaller): Define only if
16133         USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16135         * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16136         it.
16138         * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16139         so that we aren't warned about unused symbols.
16141         * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16143         * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
16145         * xfns.c (x_real_positions): Mark locals as initialized.
16147         * xmenu.c (xmenu_show): Don't use uninitialized vars.
16149         * xterm.c: Fix problems found by static analysis with other toolkits.
16150         (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
16151         (x_dispatch_event): Declare static if USE_GTK, and
16152         define if USE_GTK || USE_X_TOOLKIT.
16153         (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
16154         * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
16155         * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16156         if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
16158         * xmenu.c (menu_help_callback): Pointer type fixes.
16159         Use const pointers when pointing at readonly data.  Avoid pointer
16160         signedness clashes.
16161         (FALSE): Remove unused macro.
16162         (update_frame_menubar): Remove unused decl.
16164         * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16166         * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16167         USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16168         (single_menu_item): Rename local to avoid shadowing.
16170         * keyboard.c (make_lispy_event): Remove unused local var.
16172         * frame.c, frame.h (x_get_resource_string): Bring this back, but
16173         only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16175         * bitmaps: Change bitmaps from unsigned char back to the X11
16176         compatible char.  Avoid the old compiler warnings about
16177         out-of-range initializers by using, for example, '\xab' rather
16178         than 0xab.
16180         * xgselect.c (xgselect_initialize): Check vs interface
16181         even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16183         * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16185         * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16186         to read-only memory.
16188         * fns.c (vector): Remove; this old hack is no longer needed.
16190         * xsmfns.c (create_client_leader_window): Rename shadowing arg.
16191         Remove unused var.
16192         (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
16194         * xrdb.c (x_load_resources): Omit unused local.
16196         * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
16197         (x_window): Rename locals to avoid shadowing.
16198         (USG): Use the kludged USG macro, to pacify gcc.
16200         * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
16201         (x_term_init): Remove local to avoid shadowing.
16203         * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
16205         * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16206         USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16208 2011-04-16  Eli Zaretskii  <eliz@gnu.org>
16210         * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16212         Fix regex.c, syntax.c and friends for buffers > 2GB.
16213         * syntax.h (struct gl_state_s): Declare character position members
16214         EMACS_INT.
16216         * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16218         * textprop.c (verify_interval_modification, interval_of):
16219         Declare arguments EMACS_INT.
16221         * intervals.c (adjust_intervals_for_insertion): Declare arguments
16222         EMACS_INT.
16224         * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16226         * indent.c (Fvertical_motion): Local variable it_start is now
16227         EMACS_INT.
16229         * regex.c (re_match, re_match_2, re_match_2_internal)
16230         (bcmp_translate, regcomp, regexec, print_double_string)
16231         (group_in_compile_stack, re_search, re_search_2, regex_compile)
16232         (re_compile_pattern, re_exec): Declare arguments and local
16233         variables `size_t' and `ssize_t' and return values `regoff_t', as
16234         appropriate.
16235         (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16236         (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16237         <compile_stack_type>: `size' and `avail' are now `size_t'.
16239         * regex.h <regoff_t>: Use ssize_t, not int.
16240         (re_search, re_search_2, re_match, re_match_2): Arguments that
16241         specify buffer/string position and length are now ssize_t and
16242         size_t.  Return type is regoff_t.
16244 2011-04-16  Ben Key  <bkey76@gmail.com>
16246         * nsfont.m: Fixed bugs in ns_get_family and
16247         ns_descriptor_to_entity that were caused by using free to
16248         deallocate memory blocks that were allocated by xmalloc (via
16249         xstrdup).  This caused Emacs to crash when compiled with
16250         XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16251         --enable-checking=xmallocoverrun).  xfree is now used to
16252         deallocate these memory blocks.
16254 2011-04-15  Paul Eggert  <eggert@cs.ucla.edu>
16256         * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16258         emacs_write: Accept and return EMACS_INT for sizes.
16259         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16260         et seq.
16261         * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16262         Accept and return EMACS_INT.
16263         (emacs_gnutls_write): Return the number of bytes written on
16264         partial writes.
16265         * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
16266         (emacs_read, emacs_write): Remove check for negative size, as the
16267         Emacs source code has been audited now.
16268         * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16269         (emacs_read, emacs_write): Use it.
16270         * process.c (send_process): Adjust to the new signatures of
16271         emacs_write and emacs_gnutls_write.  Do not attempt to store
16272         a byte offset into an 'int'; it might overflow.
16273         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
16275         * sound.c: Don't assume sizes fit in 'int'.
16276         (struct sound_device.period_size, alsa_period_size):
16277         Return EMACS_INT, not int.
16278         (struct sound_device.write, vox_write, alsa_write):
16279         Accept EMACS_INT, not int.
16280         (wav_play, au_play): Use EMACS_INT to store sizes and to
16281         record read return values.
16283 2011-04-15  Ben Key  <bkey76@gmail.com>
16285         * keyboard.c (Qundefined): Don't declare static since it is used
16286         in nsfns.m.
16287         * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16288         static since they are used in nsfont.m.
16290 2011-04-15  Stefan Monnier  <monnier@iro.umontreal.ca>
16292         * process.c (Qprocessp): Don't declare static.
16293         * lisp.h (Qprocessp): Declare again.
16295 2011-04-15  Juanma Barranquero  <lekktu@gmail.com>
16297         * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16299 2011-04-14  Paul Eggert  <eggert@cs.ucla.edu>
16301         Improve C-level modularity by making more things 'static'.
16303         Don't publish debugger-only interfaces to other modules.
16304         * lisp.h (safe_debug_print, debug_output_compilation_hack):
16305         (verify_bytepos, count_markers): Move decls to the only modules
16306         that need them.
16307         * region-cache.h (pp_cache): Likewise.
16308         * window.h (check_all_windows): Likewise.
16309         * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16311         * sysdep.c (croak): Now static, if
16312         defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16313         * syssignal.h (croak): Declare only if not static.
16315         * alloc.c (refill_memory_reserve): Now static if
16316         !defined REL_ALLOC || defined SYSTEM_MALLOC.
16317         * lisp.h (refill_memory_reserve): Declare only if not static.
16319         * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16320         Define only if USE_LUCID.
16322         * xrdb.c (x_customization_string, x_rm_string): Now static.
16324         * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16325         * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16327         * xdisp.c (draw_row_with_mouse_face): Now static.
16328         * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16330         * window.h (check_all_windows): Mark externally visible.
16332         * window.c (window_deletion_count): Now static.
16334         * undo.c: Make symbols static if they're not exported.
16335         (last_undo_buffer, last_boundary_position, pending_boundary):
16336         Now static.
16338         * textprop.c (interval_insert_behind_hooks): Now static.
16339         (interval_insert_in_front_hooks): Likewise.
16341         * term.c: Make symbols static if they're not exported.
16342         (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16343         (max_frame_lines, tty_set_terminal_modes):
16344         (tty_reset_terminal_modes, tty_turn_off_highlight):
16345         (get_tty_terminal): Now static.
16346         (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16347         * termhooks.h (term_mouse_moveto): Do not declare if
16348         HAVE_WINDOW_SYSTEM.
16349         * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16350         (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16352         * sysdep.c: Make symbols static if they're not exported.
16353         (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16354         Now static.
16355         (sigprocmask_set, full_mask): Remove; unused.
16356         (wait_debugging): Mark as visible.
16357         * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16358         * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16360         * syntax.c (syntax_temp): Define only if !__GNUC__.
16362         * sound.c (current_sound_device, current_sound): Now static.
16364         * search.c (searchbufs, searchbuf_head): Now static.
16366         * scroll.c (scroll_cost): Remove; unused.
16367         * dispextern.h (scroll_cost): Remove decl.
16369         * region-cache.h (pp_cache): Mark as externally visible.
16371         * process.c: Make symbols static if they're not exported.
16372         (process_tick, update_tick, create_process, chan_process):
16373         (Vprocess_alist, proc_buffered_char, datagram_access):
16374         (fd_callback_data, send_process_frame, process_sent_to): Now static.
16375         (deactivate_process): Mark defn as static, as well as decl.
16376         * lisp.h (create_process): Remove decl.
16377         * process.h (chan_process, Vprocess_alist): Remove decls.
16379         * print.c: Make symbols static if they're not exported.
16380         (print_depth, new_backquote_output, being_printed, print_buffer):
16381         (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16382         (print_interval, print_number_index, initial_stderr_stream):
16383         Now static.
16384         * lisp.h (Fprinc): Remove decl.
16385         (debug_output_compilation_hack): Mark as externally visible.
16387         * sysdep.c (croak): Move decl from here to syssignal.h.
16388         * syssignal.h (croak): Put it here, so the API can be checked when
16389         'croak' is called from dissociate_if_controlling_tty.
16391         * minibuf.c: Make symbols static if they're not exported.
16392         (minibuf_save_list, choose_minibuf_frame): Now static.
16393         * lisp.h (choose_minibuf_frame): Remove decl.
16395         * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16397         * lread.c: Make symbols static if they're not exported.
16398         (read_objects, initial_obarray, oblookup_last_bucket_number):
16399         Now static.
16400         (make_symbol): Remove; unused.
16401         * lisp.h (initial_obarray, make_symbol): Remove decls.
16403         * keyboard.c: Make symbols static if they're not exported.
16404         (single_kboard, recent_keys_index, total_keys, recent_keys):
16405         (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16406         (this_single_command_key_start, echoing, last_auto_save):
16407         (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16408         (command_loop, echo_now, keyboard_init_hook, help_char_p):
16409         (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16410         (Vlispy_mouse_stem, double_click_count):
16411         Now static.
16412         (force_auto_save_soon): Define only if SIGDANGER.
16413         (ignore_mouse_drag_p): Now static if
16414         !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16415         (print_help): Remove; unused.
16416         (stop_character, last_timer_event): Mark as externally visible.
16417         * keyboard.h (ignore_mouse_drag_p): Declare only if
16418         defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16419         (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16420         * lisp.h (echoing): Remove decl.
16421         (force_auto_save_soon): Declare only if SIGDANGER.
16422         * xdisp.c (redisplay_window): Simplify code, to make it more
16423         obvious that ignore_mouse_drag_p is not accessed if !defined
16424         USE_GTK && !defined HAVE_NS.
16426         * intervals.c: Make symbols static if they're not exported.
16427         (merge_properties_sticky, merge_interval_right, delete_interval):
16428         Now static.
16429         * intervals.h (merge_interval_right, delete_interval): Remove decls.
16431         * insdel.c: Make symbols static if they're not exported.
16432         However, leave prepare_to_modify_buffer alone.  It's never
16433         called from outside this function, but that appears to be a bug.
16434         (combine_after_change_list, combine_after_change_buffer):
16435         (adjust_after_replace, signal_before_change): Now static.
16436         (adjust_after_replace_noundo): Remove; unused.
16437         * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
16438         (signal_before_change): Remove decls.
16440         * indent.c (val_compute_motion, val_vmotion): Now static.
16442         * image.c: Make symbols static if they're not exported.
16443         * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16444         if USE_GTK.
16445         * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16446         (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16448         * fringe.c (standard_bitmaps): Now static.
16449         (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16451         * frame.c: Make symbols static if they're not exported.
16452         (x_report_frame_params, make_terminal_frame): Now static.
16453         (get_frame_param): Now static, unless HAVE_NS.
16454         (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16455         (x_get_resource_string): Remove; not used.
16456         * frame.h (make_terminal_frame, x_report_frame_params):
16457         (x_get_resource_string); Remove decls.
16458         (x_fullscreen_adjust): Declare only if WINDOWSNT.
16459         * lisp.h (get_frame_param): Declare only if HAVE_NS.
16461         * font.c, fontset.c: Make symbols static if they're not exported.
16462         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16463         (FACE_SUITABLE_FOR_CHAR_P): Use it.
16464         * font.c (font_close_object): Now static.
16465         * font.h (font_close_object): Remove.
16466         * fontset.c (FONTSET_OBJLIST): Remove.
16467         (free_realized_fontset) #if-0 the body, which does nothing.
16468         (face_suitable_for_char_p): #if-0, as it's never called.
16469         * fontset.h (face_suitable_for_char_p): Remove decl.
16470         * xfaces.c (face_at_string_position):
16471         Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
16472         since 0 is always ASCII.
16474         * fns.c (weak_hash_tables): Now static.
16476         * fileio.c: Make symbols static if they're not exported.
16477         (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16478         (Vwrite_region_annotation_buffers): Now static.
16480         * eval.c: Make symbols static if they're not exported.
16481         (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16482         * lisp.h (backtrace_list): Remove decl.
16484         * emacs.c: Make symbols static if they're not exported.
16485         (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16486         (fatal_error_code, fatal_error_signal_hook, standard_args):
16487         Now static.
16488         (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16489         (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16490         (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16491         * lisp.h (fatal_error_signal_hook): Remove decl.
16492         (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16494         * editfns.c: Move a (normally-unused) function to its only use.
16495         * editfns.c, lisp.h (get_operating_system_release): Remove.
16496         * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16497         worth the hassle of breaking this out.
16499         * xterm.c: Make symbols static if they're not exported.
16500         (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16501         (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16502         (x_destroy_window, x_delete_display):
16503         Now static.
16504         (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16505         (x_mouse_leave): Remove; unused.
16506         * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16507         (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16508         (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16509         Remove decls.
16510         (x_mouse_leave): Declare only if WINDOWSNT.
16511         (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16512         (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16513         USE_X_TOOLKIT.
16515         * ftxfont.c: Make symbols static if they're not exported.
16516         (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16517         HAVE_FREETYPE.
16518         * font.h (ftxfont_driver): Likewise.
16520         * xfns.c: Make symbols static if they're not exported.
16521         (x_last_font_name, x_display_info_for_name):
16522         (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16523         (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16524         (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16525         (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16526         (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16527         (last_show_tip_args): Now static.
16528         (xic_defaut_fontset, xic_create_fontsetname): Define only if
16529         defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16530         (x_screen_planes): Remove; unused.
16531         * dispextern.h (x_screen_planes): Remove decl.
16533         * dispnew.c: Make symbols static if they're not exported.
16534         * dispextern.h (redraw_garbaged_frames, scrolling):
16535         (increment_row_positions): Remove.
16536         * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16537         (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16538         Now static.
16539         (redraw_garbaged_frames): Remove; unused.
16541         * xfaces.c: Make symbols static if they're not exported.
16542         * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16543         Remove decls.
16544         * xterm.h (defined_color): Remove decls.
16545         (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16546         * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16547         (menu_face_changed_default, defined_color, free_realized_face):
16548         (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16549         (ascii_face_of_lisp_face): Remove; unused.
16551         * xdisp.c: Make symbols static if they're not exported.
16552         * dispextern.h (scratch_glyph_row, window_box_edges):
16553         (glyph_to_pixel_coords, set_cursor_from_row):
16554         (get_next_display_element, set_iterator_to_next):
16555         (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16556         (show_mouse_face): Remove decls
16557         * frame.h (message_buf_print): Likewise.
16558         * lisp.h (pop_message, set_message, check_point_in_composition):
16559         Likewise.
16560         * xterm.h (set_vertical_scroll_bar): Likewise.
16561         * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16562         (message_buf_print, scratch_glyph_row, displayed_buffer):
16563         (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16564         (get_next_display_element, show_mouse_face, window_box_edges):
16565         (frame_to_window_pixel_xy, check_point_in_composition):
16566         (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16567         (glyph_to_pixel_coords): Remove; unused.
16569         * dired.c (file_name_completion): Now static.
16571         * dbusbind.c (xd_in_read_queued_messages): Now static.
16573         * lisp.h (circular_list_error, FOREACH): Remove; unused.
16574         * data.c (circular_list_error): Remove.
16576         * commands.h (last_point_position, last_point_position_buffer):
16577         (last_point_position_window): Remove decls.
16578         * keyboard.c: Make these variables static.
16580         * coding.h (coding, code_convert_region, encode_coding_gap):
16581         Remove decls.
16582         * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16583         (iso_code_class, detect_coding, code_convert_region): Now static.
16584         (encode_coding_gap): Remove; unused.
16586         * chartab.c (chartab_chars, chartab_bits): Now static.
16588         * charset.h (charset_iso_8859_1): Remove decl.
16589         * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16590         Now static.
16592         * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16593         * ccl.c (Vccl_program_table): Now static.
16594         (check_ccl_update): Remove; unused.
16596         * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16597         * category.h: ... from here.
16598         * category.c (check_category_table, set_category_set): Now static.
16600         * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16601         * lisp.h: Remove these decls.
16603         * buffer.c (buffer_count): Remove unused var.
16605         * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16606         so that it's not optimized away.
16607         (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16608         * dispextern.h (bidi_dump_cached_states): Remove, since it's
16609         exported only to the debugger.
16611         * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
16612         * atimer.h (run_all_atimers): Remove; not exported.
16614         font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16615         * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16616         was inaccessible from Lisp.
16617         (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16618         * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16620         alloc.c: Import and export fewer symbols, and remove unused items.
16621         * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16622         is defined.
16623         (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16624         it's not optimized away by whole-program optimization.
16625         (message_enable_multibyte, free_misc): Remove.
16626         (catchlist, handlerlist, mark_backtrace):
16627         Declare only if BYTE_MARK_STACK.
16628         (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16629         * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16630         (message_enable_multibyte): Remove decl.
16631         (free_misc, interval_free_list, float_block, float_block_index):
16632         (n_float_blocks, float_free_list, cons_block, cons_block_index):
16633         (cons_free_list, last_marked_index):
16634         Now static.
16635         (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16636         * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16637         (mark_backtrace): Define only if BYTE_MARK_STACK.
16638         * xdisp.c (message_enable_multibyte): Now static.
16640         Declare Lisp_Object Q* variables to be 'static' if not exported.
16641         This makes it easier for human readers (and static analyzers)
16642         to see whether these variables are used from other modules.
16643         * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16644         * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16645         * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16646         * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16647         * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16648         * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16649         * xmenu.c, xselect.c:
16650         Declare Q* vars static if they are not used in other modules.
16651         * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16652         * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16653         Remove decls of unexported vars.
16654         * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16656         * lisp.h (DEFINE_FUNC): Make sname 'static'.
16658         Make Emacs functions such as Fatom 'static' by default.
16659         This makes it easier for human readers (and static analyzers)
16660         to see whether these functions can be called from other modules.
16661         DEFUN now defines a static function.  To make the function external
16662         so that it can be used in other C modules, use the new macro DEFUE.
16663         * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16664         (Finit_image_library):
16665         (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16666         (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16667         (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16668         Remove decls, since these functions are now static.
16669         (Funintern, Fget_internal_run_time): New decls, since these functions
16670         were already external.
16672         * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16673         * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16674         * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16675         * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16676         * keyboard.c, keymap.c, lread.c:
16677         * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16678         * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16679         * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16680         Mark functions with DEFUE instead of DEFUN,
16681         if they are used in other modules.
16682         * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16683         decls for now-static functions.
16684         * buffer.h (Fdelete_overlay): Remove decl.
16685         * callproc.c (Fgetenv_internal): Mark as internal.
16686         * composite.c (Fremove_list_of_text_properties): Remove decl.
16687         (Fcomposition_get_gstring): New forward static decl.
16688         * composite.h (Fcomposite_get_gstring): Remove decl.
16689         * dired.c (Ffile_attributes): New forward static decl.
16690         * doc.c (Fdocumntation_property): New forward static decl.
16691         * eval.c (Ffetch_bytecode): New forward static decl.
16692         (Funintern): Remove extern decl; now in .h file where it belongs.
16693         * fileio.c (Fmake_symbolic_link): New forward static decl.
16694         * image.c (Finit_image_library): New forward static decl.
16695         * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16696         * intervals.h (Fprevious_property_change):
16697         (Fremove_list_of_text_properties): Remove decls.
16698         * keyboard.c (Fthis_command_keys): Remove decl.
16699         (Fcommand_execute): New forward static decl.
16700         * keymap.c (Flookup_key): New forward static decl.
16701         (Fcopy_keymap): Now static.
16702         * keymap.h (Flookup_key): Remove decl.
16703         * process.c (Fget_process): New forward static decl.
16704         (Fprocess_datagram_address): Mark as internal.
16705         * syntax.c (Fsyntax_table_p): New forward static decl.
16706         (skip_chars): Remove duplicate decl.
16707         * textprop.c (Fprevious_property_change): New forward static decl.
16708         * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16709         Now internal.
16710         (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16711         * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16713         * editfns.c (Fformat): Remove unreachable code.
16715 2011-04-14  Andreas Schwab  <schwab@linux-m68k.org>
16717         * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16718         change.  (Bug#8496)
16720 2011-04-13  Eli Zaretskii  <eliz@gnu.org>
16722         * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16723         when at ZV.  (Bug#8487)
16725 2011-04-12  Andreas Schwab  <schwab@linux-m68k.org>
16727         * charset.c (Fclear_charset_maps): Use xfree instead of free.
16728         (Bug#8437)
16729         * keyboard.c (parse_tool_bar_item): Likewise.
16730         * sound.c (sound_cleanup, alsa_close): Likewise.
16731         * termcap.c (tgetent): Likewise.
16732         * xfns.c (x_default_font_parameter): Likewise.
16733         * xsettings.c (read_and_apply_settings): Likewise.
16735         * alloc.c (overrun_check_malloc, overrun_check_realloc)
16736         (overrun_check_free): Protoize.
16738 2011-04-12  Paul Eggert  <eggert@cs.ucla.edu>
16740         * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16741         since callers should never pass a negative size.
16742         Change the signature to match that of plain 'read' and 'write'; see
16743         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16744         * lisp.h: Update prototypes of emacs_write and emacs_read.
16746 2011-04-11  Eli Zaretskii  <eliz@gnu.org>
16748         * xdisp.c (redisplay_window): Don't try to determine the character
16749         position of the scroll margin if the window start point w->startp
16750         is outside the buffer's accessible region.  (Bug#8468)
16752 2011-04-10  Eli Zaretskii  <eliz@gnu.org>
16754         Fix write-region and its subroutines for buffers > 2GB.
16755         * fileio.c (a_write, e_write): Modify declaration of arguments and
16756         local variables to support buffers larger than 2GB.
16757         (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16759         * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16760         argument, local variables, and return value.
16762         * lisp.h: Update prototypes of emacs_write and emacs_read.
16764         * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16766 2011-04-10  Paul Eggert  <eggert@cs.ucla.edu>
16768         * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16770         Fix more problems found by GCC 4.6.0's static checks.
16772         * xdisp.c (vmessage): Use a better test for character truncation.
16774         * charset.c (load_charset_map): <, not <=, for optimization,
16775         and to avoid potential problems with integer overflow.
16776         * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
16777         * casetab.c (set_identity, shuffle): Likewise.
16778         * editfns.c (Fformat): Likewise.
16779         * syntax.c (skip_chars): Likewise.
16781         * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16782         This also lets GCC 4.6.0 generate slightly better loop code.
16784         * callint.c (Fcall_interactively): <, not <=, for optimization.
16785         (Fcall_interactively): Count the number of arguments produced,
16786         not the number of arguments given.  This is simpler and lets GCC
16787         4.6.0 generate slightly better code.
16789         * ftfont.c: Distingish more carefully between FcChar8 and char.
16790         The previous code passed unsigned char * to a functions like
16791         strlen and xstrcasecmp that expect char *, which does not
16792         conform to the C standard.
16793         (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16794         arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16795         char * when the C standard requires it.
16797         * keyboard.c (read_char): Remove unused var.
16799         * eval.c: Port to Windows vsnprintf (Bug#8435).
16800         Include <limits.h>.
16801         (SIZE_MAX): Define if the headers do not.
16802         (verror): Do not give up if vsnprintf returns a negative count.
16803         Instead, grow the buffer.  This ports to Windows vsnprintf, which
16804         does not conform to C99.  Problem reported by Eli Zaretskii.
16805         Also, simplify the allocation scheme, by avoiding the need for
16806         calling realloc, and removing the ALLOCATED variable.
16808         * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16810         Remove invocations of doprnt, as Emacs now uses vsnprintf.
16811         But keep the doprint source code for now, as we might revamp it
16812         and use it again (Bug#8435).
16813         * lisp.h (doprnt): Remove.
16814         * Makefile.in (base_obj): Remove doprnt.o.
16815         * deps.mk (doprnt.o): Remove.
16817         error: Print 32- and 64-bit integers portably (Bug#8435).
16818         Without this change, on typical 64-bit hosts error ("...%d...", N)
16819         was used to print both 32- and 64-bit integers N, which relied on
16820         undefined behavior.
16821         * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
16822         * lisp.h (error, verror): Mark as printf-like functions.
16823         * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16824         Report overflow in size calculations when allocating printf buffer.
16825         Do not truncate output string at its first null byte.
16826         * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16827         Truncate the output at a character boundary, since vsnprintf does not
16828         do that.
16829         * charset.c (check_iso_charset_parameter): Convert internal
16830         character to string before calling 'error', since %c now has the
16831         printf meaning.
16832         * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16833         overflow when computing char to be passed to 'error'.  Do not
16834         pass Lisp_Object to 'error'; pass the integer instead.
16835         * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16836         formatted with plain %d.
16838         * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16840         * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16842         * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16844         * xterm.c (x_catch_errors): Remove duplicate declaration.
16846         * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16848         * xdisp.c, lisp.h (message_nolog): Remove; unused.
16850 2011-04-10  Jim Meyering  <meyering@redhat.com>
16852         use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16853         * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16854         return ssize_t not "int", and use size_t as the buffer length.
16855         (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16856         * gnutls.h: Update declarations.
16857         * process.c (read_process_output): Use ssize_t, to match.
16858         (send_process): Likewise.
16860 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
16862         * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16864 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
16866         * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16867         Use unsigned char, to match FcChar8 type definition.
16869         * xterm.c (handle_one_xevent):
16870         * xmenu.c (create_and_show_popup_menu):
16871         * xselect.c (x_decline_selection_request)
16872         (x_reply_selection_request): Avoid type-punned deref of X events.
16874 2011-04-09  Eli Zaretskii  <eliz@gnu.org>
16876         Fix some uses of `int' instead of EMACS_INT.
16877         * search.c (string_match_1, fast_string_match)
16878         (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16879         (scan_buffer, find_next_newline_no_quit)
16880         (find_before_next_newline, search_command, Freplace_match)
16881         (Fmatch_data): Make some `int' variables be EMACS_INT.
16883         * xdisp.c (display_count_lines): 3rd argument and return value now
16884         EMACS_INT.  All callers changed.
16885         (pint2hrstr): Last argument is now EMACS_INT.
16887         * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16888         (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16889         (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16890         (decode_coding_utf_16, decode_coding_emacs_mule)
16891         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16892         (decode_coding_ccl, decode_coding_charset)
16893         <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16894         (decode_coding_iso_2022, decode_coding_emacs_mule)
16895         (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16896         <char_offset, last_offset>: Declare EMACS_INT.
16897         (encode_coding_utf_8, encode_coding_utf_16)
16898         (encode_coding_emacs_mule, encode_invocation_designation)
16899         (encode_designation_at_bol, encode_coding_iso_2022)
16900         (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16901         (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16902         Declare EMACS_INT.
16903         (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16904         (encode_invocation_designation): Last argument P_NCHARS is now
16905         EMACS_INT.
16906         (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16907         (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16909         * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16910         All users changed.
16912         * ccl.c (Fccl_execute_on_string): Declare some variables
16913         EMACS_INT.
16915 2011-04-08  Samuel Thibault  <sthibault@debian.org>  (tiny change)
16917         * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16919 2011-03-19  Christoph Scholtes  <cschol2112@googlemail.com>
16921         * process.c (Fformat_network_address): Doc fix.
16923 2011-04-08  T.V. Raman  <tv.raman.tv@gmail.com>  (tiny change)
16925         * xml.c (parse_region): Avoid creating spurious whitespace nodes.
16927 2011-04-08  Chong Yidong  <cyd@stupidchicken.com>
16929         * keyboard.c (read_char): Call Lisp function help-form-show,
16930         instead of using internal_with_output_to_temp_buffer.
16931         (Qhelp_form_show): New var.
16932         (syms_of_keyboard): Use DEFSYM macro.
16934         * print.c (internal_with_output_to_temp_buffer): Function deleted.
16936         * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16938 2011-04-06  Chong Yidong  <cyd@stupidchicken.com>
16940         * process.c (Flist_processes): Remove to Lisp.
16941         (list_processes_1): Delete.
16943 2011-04-06  Eli Zaretskii  <eliz@gnu.org>
16945         * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16947         * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16949 2011-04-06  Paul Eggert  <eggert@cs.ucla.edu>
16951         Fix more problems found by GCC 4.6.0's static checks.
16953         * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16955         * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16957         * lisp.h (message, message_nolog, fatal): Mark as printf-like.
16959         * xdisp.c (vmessage): Mark as a printf-like function.
16961         * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16963         * sound.c (sound_warning): Don't crash if arg contains a printf format.
16965         * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16966         printf-like functions.
16967         (tiff_load): Add casts to remove these marks before passing them
16968         to system-supplied API.
16970         * eval.c (Fsignal): Remove excess argument to 'fatal'.
16972         * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16973         This avoids several warnings with gcc -Wstrict-overflow.
16974         (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16975         directly, rather than having caller test rule sign.  This avoids
16976         some unnecessary tests.
16977         * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16978         (COMPOSITION_ENCODE_RULE): Arguments now must be valid.  This
16979         affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
16981         * xfont.c (xfont_text_extents): Remove var that was set but not used.
16982         (xfont_open): Avoid unnecessary tests.
16984         * composite.c (composition_gstring_put_cache): Use unsigned integer.
16986         * composite.h, composite.c (composition_gstring_put_cache):
16987         Use EMACS_INT, not int, for length.
16989         * composite.h (COMPOSITION_DECODE_REFS): New macro,
16990         breaking out part of COMPOSITION_DECODE_RULE.
16991         (COMPOSITION_DECODE_RULE): Use it.
16992         * composite.c (get_composition_id): Remove unused local vars,
16993         by using the new macro.
16995         * textprop.c (set_text_properties_1): Change while to do-while,
16996         since the condition is always true at first.
16998         * intervals.c (graft_intervals_into_buffer): Mark var as used.
16999         (interval_deletion_adjustment): Return unsigned value.
17000         All uses changed.
17002         * process.c (list_processes_1, create_pty, read_process_output):
17003         (exec_sentinel): Remove vars that were set but not used.
17004         (create_pty): Remove unnecessary "volatile"s.
17005         (Fnetwork_interface_info): Avoid possibility of int overflow.
17006         (read_process_output): Do adaptive read buffering even if carryover.
17007         (read_process_output): Simplify nbytes computation if buffered.
17009         * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
17011         * syntax.c (scan_words): Remove var that was set but not used.
17012         (update_syntax_table): Use unsigned instead of int.
17014         * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
17015         (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
17016         (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
17018         * print.c (print_error_message): Avoid int overflow.
17020         * font.c (font_list_entities): Redo for clarity,
17021         so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17023         * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
17024         (font_score): Avoid potential overflow in diff calculation.
17026         * fns.c (substring_both): Remove var that is set but not used.
17027         (sxhash): Redo loop for clarity and to avoid wraparound warning.
17029         * eval.c (funcall_lambda): Rename local to avoid shadowing.
17031         * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17032         Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17033         can always succeed if overflow has undefined behavior.
17035         * search.c (boyer_moore, wordify): Remove vars set but not used.
17036         (wordify): Omit three unnecessary tests.
17038         * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
17039         All callers changed.  This avoids the need for an unused var.
17041         * casefiddle.c (casify_region): Remove var that is set but not used.
17043         * dired.c (file_name_completion): Remove var that is set but not used.
17045         * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17047         * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
17048         (Finsert_file_contents): Remove unnecessary code checking fd.
17050         * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17051         Check for integer overflow on size calculations.
17053         * buffer.c (Fprevious_overlay_change): Remove var that is set
17054         but not used.
17056         * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17057         Remove vars that are set but not used.
17058         (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
17059         (timer_check_2): Mark vars as initialized.
17061         * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17063         * image.c (lookup_image): Remove var that is set but not used.
17064         (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
17066         * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17067         that are set but not used.
17069         * xfns.c (make_invisible_cursor): Don't return garbage
17070         if XCreateBitmapFromData fails (Bug#8410).
17072         * xselect.c (x_get_local_selection, x_handle_property_notify):
17073         Remove vars that are set but not used.
17075         * xfns.c (x_create_tip_frame): Remove var that is set but not used.
17076         (make_invisible_cursor): Initialize a possibly-uninitialized variable.
17078         * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17079         Remove var that is set but not used.
17080         (scroll_bar_windows_size): Now size_t, not int.
17081         (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17082         Check for overflow.
17084         * xfaces.c (realize_named_face): Remove vars that are set but not used.
17085         (map_tty_color) [!defined MSDOS]: Likewise.
17087         * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17089         * coding.c: Remove vars that are set but not used.
17090         (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17091         All callers changed.
17092         (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17093         (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17094         (decode_coding_charset): Remove vars that are set but not used.
17096         * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17097         that is set but not used.
17099         * print.c (print_object): Remove var that is set but not used.
17101         Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
17102         The gnulib version avoids calling malloc in the usual case,
17103         and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17104         * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17105         * filelock.c (current_lock_owner): Likewise.
17106         * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17107         * sysdep.c: Include allocator.h, careadlinkat.h.
17108         (emacs_no_realloc_allocator): New static constant.
17109         (emacs_readlink): New function.
17110         * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17111         ../lib/careadlinkat.h.
17113 2011-04-04  Stefan Monnier  <monnier@iro.umontreal.ca>
17115         * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17116         first non-nil return value).
17118 2011-04-03  Jan Djärv  <jan.h.d@swipnet.se>
17120         * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17121         if not defined (Bug#8403).
17123 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
17125         * xdisp.c (display_count_lines): Remove parameter `start',
17126         unused since 1998-01-01T02:27:27Z!rms@gnu.org.  All callers changed.
17127         (get_char_face_and_encoding): Remove parameter `multibyte_p',
17128         unused since 2008-05-14T01:40:23Z!handa@m17n.org.  All callers changed.
17129         (fill_stretch_glyph_string): Remove parameters `row' and `area',
17130         unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17131         and thereabouts.  All callers changed.
17132         (get_per_char_metric): Remove parameter `f', unused since
17133         2008-05-14T01:40:23Z!handa@m17n.org.  All callers changed.
17135 2011-04-02  Jim Meyering  <meyering@redhat.com>
17137         do not dereference NULL upon failed strdup
17138         * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17139         (ns_get_family): Likewise.
17141 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
17143         * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17145 2011-04-02  Jan Djärv  <jan.h.d@swipnet.se>
17147         * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17148         later (Bug#8403).
17150 2011-04-01  Stefan Monnier  <monnier@iro.umontreal.ca>
17152         Add lexical binding.
17154         * window.c (Ftemp_output_buffer_show): New fun.
17155         (Fsave_window_excursion):
17156         * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17158         * lread.c (lisp_file_lexically_bound_p): New function.
17159         (Fload): Bind Qlexical_binding.
17160         (readevalloop): Remove `evalfun' arg.
17161         Bind Qinternal_interpreter_environment.
17162         (Feval_buffer): Bind Qlexical_binding.
17163         (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17164         Mark as dynamic.
17165         (syms_of_lread): Declare `lexical-binding'.
17167         * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17169         * keyboard.c (eval_dyn): New fun.
17170         (menu_item_eval_property): Use it.
17172         * image.c (parse_image_spec): Use Ffunctionp.
17174         * fns.c (concat, mapcar1): Accept byte-code-functions.
17176         * eval.c (Fsetq): Handle lexical vars.
17177         (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17178         (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17179         (FletX, Flet): Obey lexical binding.
17180         (Fcommandp): Handle closures.
17181         (Feval): New `lexical' arg.
17182         (eval_sub): New function extracted from Feval.  Use it almost
17183         everywhere where Feval was used.  Look up vars in lexical env.
17184         Handle closures.
17185         (Ffunctionp): Move from subr.el.
17186         (Ffuncall): Handle closures.
17187         (apply_lambda): Remove `eval_flags'.
17188         (funcall_lambda): Handle closures and new byte-code-functions.
17189         (Fspecial_variable_p): New function.
17190         (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17191         but without exporting it to Lisp.
17193         * doc.c (Fdocumentation, store_function_docstring):
17194         * data.c (Finteractive_form): Handle closures.
17196         * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17197         interactive spec.
17199         * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17200         New byte-codes.
17201         (exec_byte_code): New function extracted from Fbyte_code to handle new
17202         calling convention for byte-code-functions.  Add new byte-codes.
17204         * buffer.c (defvar_per_buffer): Set new `declared_special' field.
17206         * alloc.c (Fmake_symbol): Init new `declared_special' field.
17208 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
17210         * xdisp.c (redisplay_internal): Fix prototype.
17212 2011-03-31  Eli Zaretskii  <eliz@gnu.org>
17214         * xdisp.c (SCROLL_LIMIT): New macro.
17215         (try_scrolling): Use it when setting scroll_limit.
17216         Limit scrolling to 100 screen lines.
17217         (redisplay_window): Even when falling back on "recentering",
17218         position point in the window according to scroll-conservatively,
17219         scroll-margin, and scroll-*-aggressively variables.  (Bug#6671)
17221         (try_scrolling): When point is above the window, allow searching
17222         as far as scroll_max, or one screenful, to compute vertical
17223         distance from PT to the scroll margin position.  This prevents
17224         try_scrolling from unnecessarily failing when
17225         scroll-conservatively is set to a value slightly larger than the
17226         window height.  Clean up the case of PT below the margin at bottom
17227         of window: scroll_max can no longer be INT_MAX.  When aggressive
17228         scrolling is in use, don't let point enter the opposite scroll
17229         margin as result of the scroll.
17230         (syms_of_xdisp) <scroll-conservatively>: Document the
17231         threshold of 100 lines for never-recentering scrolling.
17233 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
17235         * dispextern.h (move_it_by_lines):
17236         * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17237         since 2000-12-29T14:24:09Z!gerd@gnu.org.  All callers changed.
17238         (message_log_check_duplicate): Remove parameters `prev_bol' and
17239         `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org.  All callers changed.
17240         (redisplay_internal): Remove parameter `preserve_echo_area',
17241         unused since 1999-07-21T21:43:52Z!gerd@gnu.org.  All callers changed.
17243         * indent.c (Fvertical_motion):
17244         * window.c (window_scroll_pixel_based, Frecenter):
17245         Don't pass `need_y_p' to `move_it_by_lines'.
17247 2011-03-30  Stefan Monnier  <monnier@iro.umontreal.ca>
17249         * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17250         steal a few bits to be more compact.
17251         (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17252         Remove unneeded casts.
17254         * bytecode.c (Fbyte_code): CAR and CDR can GC.
17256 2011-03-30  Zachary Kanfer  <zkanfer@gmail.com>  (tiny change)
17258         * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17259         binding" message (bug#7967).
17261 2011-03-30  Paul Eggert  <eggert@cs.ucla.edu>
17263         Fix more problems found by GCC 4.6.0's static checks.
17265         * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17266         Remove unused local var.
17268         * editfns.c (Fmessage_box): Remove unused local var.
17270         * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17271         (note_mode_line_or_margin_highlight, note_mouse_highlight):
17272         Omit unused local vars.
17273         * window.c (shrink_windows): Omit unused local var.
17274         * menu.c (digest_single_submenu): Omit unused local var.
17275         * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17276         Omit unused local var.
17278         * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17279         Don't assume string length fits in int.
17280         (keyremap_step, read_key_sequence): Use size_t for sizes.
17281         (read_key_sequence): Don't check last_real_key_start redundantly.
17283         * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17284         instead of alloca (Bug#8344).
17286         * eval.c (Fbacktrace): Don't assume nargs fits in int.
17287         (Fbacktrace_frame): Don't assume nframes fits in int.
17289         * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17291         * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17292         concerns.
17294         * term.c (produce_glyphless_glyph): Remove unnecessary test.
17296         * cm.c (calccost): Turn while-do into do-while, for clarity.
17298         * keyboard.c (syms_of_keyboard): Use the same style as later
17299         in this function when indexing through an array.  This also
17300         works around GCC bug 48267.
17302         * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17304         * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17306         * chartab.c (sub_char_table_ref_and_range): Redo for slight
17307         efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17309         * keyboard.c, keyboard.h (num_input_events): Now size_t.
17310         This avoids undefined behavior on integer overflow, and is a bit
17311         more convenient anyway since it is compared to a size_t variable.
17313         Variadic C functions now count arguments with size_t, not int.
17314         This avoids an unnecessary limitation on 64-bit machines, which
17315         caused (substring ...) to crash on large vectors (Bug#8344).
17316         * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17317         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
17318         All variadic functions and their callers changed accordingly.
17319         (struct gcpro.nvars): Now size_t, not int.  All uses changed.
17320         * data.c (arith_driver, float_arith_driver): Likewise.
17321         * editfns.c (general_insert_function): Likewise.
17322         * eval.c (struct backtrace.nargs, interactive_p)
17323         (internal_condition_case_n, run_hook_with_args, apply_lambda)
17324         (funcall_lambda, mark_backtrace): Likewise.
17325         * fns.c (concat): Likewise.
17326         * frame.c (x_set_frame_parameters): Likewise.
17327         * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17328         0 if not found, not -1.  All callers changed.
17330         * alloc.c (garbage_collect): Don't assume stack size fits in int.
17331         (stack_copy_size): Now size_t, not int.
17332         (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17334 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
17336         * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17337         unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17338         All callers changed.
17340         * lisp.h (multibyte_char_to_unibyte):
17341         * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17342         unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17343         * character.h (CHAR_TO_BYTE8):
17344         * cmds.c (internal_self_insert):
17345         * editfns.c (general_insert_function):
17346         * keymap.c (push_key_description):
17347         * search.c (Freplace_match):
17348         * xdisp.c (message_dolog, set_message_1): All callers changed.
17350 2011-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
17352         * keyboard.c (safe_run_hook_funcall): New function.
17353         (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17354         don't set the hook to nil, but remove the offending function instead.
17355         (Qcommand_hook_internal): Remove, unused.
17356         (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17357         Vcommand_hook_internal.
17359         * eval.c (enum run_hooks_condition): Remove.
17360         (funcall_nil, funcall_not): New functions.
17361         (run_hook_with_args): Call each function through a `funcall' argument.
17362         Remove `cond' argument, now redundant.
17363         (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17364         (Frun_hook_with_args_until_failure): Adjust accordingly.
17365         (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17367 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
17369         * dispextern.h (string_buffer_position): Remove declaration.
17371         * print.c (strout): Remove parameter `multibyte', unused since
17372         1999-08-21T19:30:21Z!gerd@gnu.org.  All callers changed.
17374         * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17375         never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17376         All callers changed.
17378         * w32.c (_wsa_errlist): Use braces for struct initializers.
17380         * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17381         never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17382         All callers changed.
17383         (string_buffer_position): Likewise.  Also, make static (it's never
17384         used outside xdisp.c).
17385         (cursor_row_p): Remove parameter `w', unused since
17386         2000-10-17T16:08:57Z!gerd@gnu.org.  All callers changed.
17387         (decode_mode_spec): Remove parameter `precision', introduced during
17388         Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17389         All callers changed.
17391 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
17393         * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17395 2011-03-27  Anders Lindgren  <andlind@gmail.com>
17397         * nsterm.m (ns_menu_bar_is_hidden): New variable.
17398         (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17399         (ns_update_auto_hide_menu_bar): New functions.
17400         (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17401         (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17402         ns_constrain_all_frames.
17403         (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17404         (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17406 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
17408         * nsmenu.m (runDialogAt): Remove argument to timer_check.
17410 2011-03-27  Glenn Morris  <rgm@gnu.org>
17412         * syssignal.h: Replace RETSIGTYPE with void.
17413         * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17414         * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17415         Replace SIGTYPE with void everywhere.
17416         * s/usg5-4-common.h (SIGTYPE): Remove definition.
17417         * s/template.h (SIGTYPE): Remove commented out definition.
17419 2011-03-26  Eli Zaretskii  <eliz@gnu.org>
17421         * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17422         flag as a prerequisite for invoking try_scrolling.  (Bug#6671)
17424 2011-03-26  Juanma Barranquero  <lekktu@gmail.com>
17426         * w32.c (read_unc_volume): Use parameter `henum', instead of
17427         global variable `wget_enum_handle'.
17429         * keymap.c (describe_vector): Remove parameters `indices' and
17430         `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17431         (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17433         * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17435         * keyboard.c (timer_check): Remove parameter `do_it_now',
17436         unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17437         (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17438         unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17440         * keyboard.c (read_char):
17441         * w32menu.c (w32_menu_display_help):
17442         * xmenu.c (show_help_event, menu_help_callback):
17443         Adjust calls to `show_help_echo'.
17445         * gtkutil.c (xg_maybe_add_timer):
17446         * keyboard.c (readable_events):
17447         * process.c (wait_reading_process_output):
17448         * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17450         * insdel.c (adjust_markers_gap_motion):
17451         Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17452         (gap_left, gap_right): Don't call it.
17454 2011-03-25  Chong Yidong  <cyd@stupidchicken.com>
17456         * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17457         incurred during fontification.
17459 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
17461         * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17462         (DEFVAR_PER_BUFFER): Don't pass it.
17464         * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17465         (scrolling_window): Don't pass it.
17467 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
17469         * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17471         * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17472         and `suffix'.
17473         (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17474         of variables specific to SELinux and computation of `encoded_absname'.
17476         * image.c (XPutPixel): Remove unused variable `height'.
17478         * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17480         * unexw32.c (get_section_info): Remove unused variable `section'.
17482         * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17483         (system_process_attributes): Remove unused variable `sess'.
17484         (sys_read): Remove unused variable `err'.
17486         * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17487         (w32_wnd_proc): Remove unused variable `isdead'.
17488         (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17489         (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17490         (x_create_tip_frame): Remove unused variable `tem'.
17492         * w32inevt.c (w32_console_read_socket):
17493         Remove unused variable `no_events'.
17495         * w32term.c (x_draw_composite_glyph_string_foreground):
17496         Remove unused variable `width'.
17498 2011-03-24  Juanma Barranquero  <lekktu@gmail.com>
17500         * w32term.c (x_set_glyph_string_clipping):
17501         Don't pass uninitialized region to CombineRgn.
17503 2011-03-23  Juanma Barranquero  <lekktu@gmail.com>
17505         * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17506         (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17507         (Fx_close_connection): Remove unused variable `i'.
17509         * w32font.c (w32font_draw): Return number of glyphs.
17510         (w32font_open_internal): Remove unused variable `i'.
17511         (w32font_driver): Add missing initializer.
17513         * w32menu.c (utf8to16): Remove unused variable `utf16'.
17514         (fill_in_menu): Remove unused variable `items_added'.
17516         * w32term.c (last_mouse_press_frame): Remove static global variable.
17517         (w32_clip_to_row): Remove unused variable `f'.
17518         (x_delete_terminal): Remove unused variable `i'.
17520         * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17521         (NOTHING): Remove unused static global variable.
17522         (uniscribe_check_otf): Remove unused variable `table'.
17523         (uniscribe_font_driver): Add missing initializers.
17525 2011-03-23  Julien Danjou  <julien@danjou.info>
17527         * term.c (Fsuspend_tty, Fresume_tty):
17528         * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17529         * window.c (temp_output_buffer_show):
17530         * insdel.c (signal_before_change):
17531         * frame.c (Fhandle_switch_frame):
17532         * fileio.c (Fdo_auto_save):
17533         * emacs.c (Fkill_emacs):
17534         * editfns.c (save_excursion_restore):
17535         * cmds.c (internal_self_insert):
17536         * callint.c (Fcall_interactively):
17537         * buffer.c (Fkill_all_local_variables):
17538         * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17539         Use Frun_hooks.
17540         (command_loop_1): Use Frun_hooks.  Call safe_run_hooks
17541         unconditionally since it does the check itself.
17543 2011-03-23  Paul Eggert  <eggert@cs.ucla.edu>
17545         Fix more problems found by GCC 4.5.2's static checks.
17547         * coding.c (encode_coding_raw_text): Avoid unnecessary test
17548         the first time through the loop, since we know p0 < p1 then.
17549         This also avoids a gcc -Wstrict-overflow warning.
17551         * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17552         leading to a memory leak, possible in functions like
17553         load_charset_map_from_file that can allocate an unbounded number
17554         of objects (Bug#8318).
17556         * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17557         that could (at least in theory) be that large.
17559         * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17560         This is less likely to overflow, and avoids undefined behavior if
17561         overflow does occur.  All callers changed.  Use strtoul to scan
17562         for the unsigned long integer.
17563         (pint2hrstr): Simplify and tune code slightly.
17564         This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
17566         * scroll.c (do_scrolling): Work around GCC bug 48228.
17567         See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17569         * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17570         This also avoids a warning with gcc -Wstrict-overflow.
17571         (validate_x_resource_name): Simplify count usage.
17572         This also avoids a warning with gcc -Wstrict-overflow.
17574         * fileio.c (Fcopy_file): Report error if fchown or fchmod
17575         fail (Bug#8306).
17577         * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
17579         * process.c (Fmake_network_process): Use socklen_t, not int,
17580         where POSIX says socklen_t is required in portable programs.
17581         This fixes a porting bug on hosts like 64-bit HP-UX, where
17582         socklen_t is wider than int (Bug#8277).
17583         (Fmake_network_process, server_accept_connection):
17584         (wait_reading_process_output, read_process_output):
17585         Likewise.
17587         * process.c: Rename or move locals to avoid shadowing.
17588         (list_processes_1, Fmake_network_process):
17589         (read_process_output_error_handler, exec_sentinel_error_handler):
17590         Rename or move locals.
17591         (Fmake_network_process): Define label "retry_connect" only if needed.
17592         (Fnetwork_interface_info): Fix pointer signedness.
17593         (process_send_signal): Add cast to avoid pointer signedness problem.
17594         (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
17595         (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
17597         Make tparam.h and terminfo.c consistent.
17598         * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17599         Include tparam.h instead, since it declares them.
17600         * cm.h (PC): Remove extern decl; tparam.h now does this.
17601         * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17602         * terminfo.c: Include tparam.h, to check interfaces.
17603         (tparm): Make 1st arg a const pointer in decl.  Put it at top level.
17604         (tparam): Adjust signature to match interface in tparam.h;
17605         this removes some undefined behavior.  Check that outstring and len
17606         are zero, which they always are with Emacs.
17607         * tparam.h (PC, BC, UP): New extern decls.
17609         * xftfont.c (xftfont_shape): Now static, and defined only if needed.
17610         (xftfont_open): Rename locals to avoid shadowing.
17612         * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
17613         (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17614         (OTF_TAG_SYM): Omit macro if not needed.
17615         (ftfont_list): Remove unused local.
17616         (get_adstyle_property, ftfont_pattern_entity):
17617         (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17618         Rename locals to avoid shadowing.
17620         * xfont.c (xfont_list_family): Mark var as initialized.
17622         * xml.c (make_dom): Now static.
17624         * composite.c (composition_compute_stop_pos): Rename local to
17625         avoid shadowing.
17626         (composition_reseat_it): Remove unused locals.
17627         (find_automatic_composition, composition_adjust_point): Likewise.
17628         (composition_update_it): Mark var as initialized.
17629         (find_automatic_composition): Mark vars as initialized,
17630         with a FIXME (Bug#8290).
17632         character.h: Rename locals to avoid shadowing.
17633         * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17634         (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17635         (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17636         (BUF_DEC_POS): Be more systematic about renaming local temporaries
17637         to avoid shadowing.
17639         * textprop.c (property_change_between_p): Remove; unused.
17641         * intervals.c (interval_start_pos): Now static.
17643         * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17645         * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17646         Rename locals to avoid shadowing.
17648         * sound.c (wav_play, au_play, Fplay_sound_internal):
17649         Fix pointer signedness.
17650         (alsa_choose_format): Remove unused local var.
17651         (wav_play): Initialize a variable to 0, to prevent undefined
17652         behavior (Bug#8278).
17654         * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17656         * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17658         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17659         clobbering (Bug#8298).
17660         * sysdep.c (sys_subshell): Likewise.
17661         Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
17663         * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17664         This should get cleaned up, so that child_setup has the
17665         same signature on all platforms.
17667         * callproc.c (call_process_cleanup): Now static.
17668         (relocate_fd): Rename locals to avoid shadowing.
17670 2011-03-22  Chong Yidong  <cyd@stupidchicken.com>
17672         * xterm.c (x_clear_frame): Remove XClearWindow call.  This appears
17673         not to be necessary, and produces flickering.
17675 2011-03-20  Glenn Morris  <rgm@gnu.org>
17677         * config.in: Remove file.
17679 2011-03-20  Juanma Barranquero  <lekktu@gmail.com>
17681         * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17682         are now in src/globals.h.
17683         (syms_of_minibuf): Remove spurious & from previous change.
17685 2011-03-20  Leo Liu  <sdl.web@gmail.com>
17687         * minibuf.c (completing-read-function): New variable.
17688         (completing-read-default): Rename from completing-read.
17689         (completing-read): Call completing-read-function.
17691 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
17693         * xfaces.c (Fx_load_color_file):
17694         Read color file from absolute filename (bug#8250).
17696 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
17698         * makefile.w32-in: Update dependencies.
17700 2011-03-17  Eli Zaretskii  <eliz@gnu.org>
17702         * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17704 2011-03-17  Paul Eggert  <eggert@cs.ucla.edu>
17706         Fix more problems found by GCC 4.5.2's static checks.
17708         * process.c (make_serial_process_unwind, send_process_trap):
17709         (sigchld_handler): Now static.
17711         * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17712         That way, the code declares only the vars that it needs.
17713         * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17714         * s/cygwin.h (PTY_ITERATION): Likewise.
17715         * s/darwin.h (PTY_ITERATION): Likewise.
17716         * s/gnu-linux.h (PTY_ITERATION): Likewise.
17718         * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17719         * process.c (allocate_pty): Don't declare stb unless it's needed.
17721         * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
17722         (CONSTANTLIM): Remove; unused.
17723         (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17724         Define only if needed.
17726         * unexelf.c (unexec): Name an expression,
17727         to avoid gcc -Wbad-function-cast warning.
17728         Use a different way to cause a compilation error if anyone uses
17729         n rather than nn, a way that does not involve shadowing.
17730         (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
17732         * deps.mk (unexalpha.o): Remove; unused.
17734         New file unexec.h, the (simple) interface for unexec (Bug#8267).
17735         * unexec.h: New file.
17736         * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17737         (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17738         Depend on unexec.h.
17739         * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17740         * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17741         * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
17742         Change as necessary to match prototype in unexec.h.
17744         * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17745         shadowing.
17746         (back_comment, skip_chars): Mark vars as initialized.
17748         * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17749         Rename locals to avoid shadowing.
17751         * lread.c (read1): Rewrite so as not to use empty "else".
17752         (Fload, readevalloop, read1): Rename locals to avoid shadowing.
17754         * print.c (Fredirect_debugging_output): Fix pointer signedess.
17756         * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17757         warning when compiling print.c.
17759         * font.c (font_unparse_fcname): Abort in an "impossible" situation
17760         instead of using an uninitialized var.
17761         (font_sort_entities): Mark var as initialized.
17763         * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17765         * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17766         pointers to constants.
17767         (font_parse_fcname): Remove unused vars.
17768         (font_delete_unmatched): Now static.
17769         (font_get_spec): Remove; unused.
17770         (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17771         (font_update_drivers, Ffont_get_glyphs, font_add_log):
17772         Rename or move locals to avoid shadowing.
17774         * fns.c (require_nesting_list, require_unwind): Now static.
17775         (Ffillarray): Rename locals to avoid shadowing.
17777         * floatfns.c (domain_error2): Define only if needed.
17778         (Ffrexp, Fldexp): Rename locals to avoid shadowing.
17780         * alloc.c (mark_backtrace): Move decl from here ...
17781         * lisp.h: ... to here, so that it can be checked.
17783         * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
17784         (Fdefvar): Rewrite so as not to use empty "else".
17785         (lisp_indirect_variable): Name an expression,
17786         to avoid gcc -Wbad-function-cast warning.
17787         (Fdefvar): Rename locals to avoid shadowing.
17789         * callint.c (quotify_arg, quotify_args): Now static.
17790         (Fcall_interactively): Rename locals to avoid shadowing.
17791         Use const pointer when appropriate.
17793         * lisp.h (get_system_name, get_operating_system_release):
17794         Move decls here, to check interfaces.
17795         * process.c (get_operating_system_release): Move decl to lisp.h.
17796         * xrdb.c (get_system_name): Likewise.
17797         * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17798         (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17799         some of which prompt warnings from gcc -Wbad-function-cast.
17800         (Fformat_time_string, Fencode_time, Finsert_char):
17801         (Ftranslate_region_internal, Fformat):
17802         Rename or remove local vars to avoid shadowing.
17803         (Ftranslate_region_internal): Mark var as initialized.
17805         * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17806         avoid shadowing.
17808         * lisp.h (eassert): Check that the argument compiles, even if
17809         ENABLE_CHECKING is not defined.
17811         * data.c (Findirect_variable): Name an expression, to avoid
17812         gcc -Wbad-function-cast warning.
17813         (default_value, arithcompare, arith_driver, arith_error): Now static.
17814         (store_symval_forwarding): Rename local to avoid shadowing.
17815         (Fmake_variable_buffer_local, Fmake_local_variable):
17816         Mark variables as initialized.
17817         (do_blv_forwarding, do_symval_forwarding): Remove; unused.
17819         * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
17820         (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17821         Rename locals to avoid shadowing.
17822         (mark_stack): Move local variables into the #ifdef region where
17823         they're used.
17824         (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17825         ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17826         needed otherwise.
17827         (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17828         (GC_STRING_CHARS): Remove; not used.
17829         (Fmemory_limit): Cast sbrk's returned value to char *.
17831         * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17832         avoids undefined behavior in theory.
17834         * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17836         Use functions, not macros, for up- and down-casing (Bug#8254).
17837         * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17838         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove.  All callers changed
17839         to use the following functions instead of these macros.
17840         (downcase): Adjust to lack of DOWNCASE_TABLE.  Return int, not
17841         EMACS_INT, since callers assume the returned value fits in int.
17842         (upcase1): Likewise, for UPCASE_TABLE.
17843         (uppercasep, lowercasep, upcase): New static inline functions.
17844         * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
17845         the race-condition problem in the old DOWNCASE.
17847         * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17848         Rename locals to avoid shadowing.
17849         (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
17850         (regex_compile, re_search_2, re_match_2_internal):
17851         Remove unused local vars.
17852         (FREE_VAR): Rewrite so as not to use empty "else",
17853         which gcc can warn about.
17854         (regex_compile, re_match_2_internal): Mark locals as initialized.
17855         (RETALLOC_IF): Define only if needed.
17856         (WORDCHAR_P): Likewise.  This one is never needed, but is used
17857         only in a comment talking about a compiler bug, so put inside
17858         the #if 0 of that comment.
17859         (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17860         (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17861         Remove; unused.
17863         * search.c (boyer_moore): Rename locals to avoid shadowing.
17864         * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17865         (PREV_CHAR_BOUNDARY): Likewise.
17867         * search.c (simple_search): Remove unused var.
17869         * dired.c (compile_pattern): Move decl from here ...
17870         * lisp.h: ... to here, so that it can be checked.
17871         (struct re_registers): New forward decl.
17873         * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17875         * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17876         All uses changed.
17877         (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17878         Rename locals to avoid shadowing.
17879         (Fvertical_motion): Mark locals as initialized.
17881         * casefiddle.c (casify_object, casify_region): Now static.
17882         (casify_region): Mark local as initialized.
17884         * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17886         * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17887         New macros, so that the caller can use some names other than
17888         gcpro1, gcpro2, etc.
17889         (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17890         of the new macros.
17891         (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17892         argument, for consistency with GCPRO2_VAR, etc: it is now the
17893         prefix of the variable, not the variable itself.  All uses
17894         changed.
17895         * dired.c (directory_files_internal, file_name_completion):
17896         Rename locals to avoid shadowing.
17898         Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17899         An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17900         dired.c's scmp function, had undefined behavior.
17901         * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17902         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17903         * buffer.h: ... to here, because these macros use current_buffer,
17904         and the new implementation with inline functions needs to have
17905         current_buffer in scope now, rather than later when the macros
17906         are used.
17907         (downcase, upcase1): New static inline functions.
17908         (DOWNCASE, UPCASE1): Reimplement using these functions.
17909         This avoids undefined behavior in expressions like
17910         DOWNCASE (x) == DOWNCASE (y), which previously suffered
17911         from race conditions in accessing the global variables
17912         case_temp1 and case_temp2.
17913         * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17914         * lisp.h (case_temp1, case_temp2): Remove their decls.
17915         * character.h (ASCII_CHAR_P): Move from here ...
17916         * lisp.h: ... to here, so that the inline functions mentioned
17917         above can use them.
17919         * dired.c (directory_files_internal_unwind): Now static.
17921         * fileio.c (file_name_as_directory, directory_file_name):
17922         (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17923         Now static.
17924         (file_name_as_directory): Use const pointers when appropriate.
17925         (Fexpand_file_name): Likewise.  In particular, newdir might
17926         point at constant storage, so make it a const pointer.
17927         (Fmake_directory_internal, Fread_file_name): Remove unused vars.
17928         (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17929         signedness issues.
17930         (Fset_file_times, Finsert_file_contents, auto_save_error):
17931         Rename locals to avoid shadowing.
17933         * minibuf.c (choose_minibuf_frame_1): Now static.
17934         (Ftry_completion, Fall_completions): Rename or remove locals
17935         to avoid shadowing.
17937         * marker.c (bytepos_to_charpos): Remove; unused.
17939         * lisp.h (verify_bytepos, count_markers): New decls,
17940         so that gcc does not warn that these functions aren't declared.
17942         * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17943         (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
17944         (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
17945         (copy_text): Remove unused local var.
17947         * filelock.c (within_one_second): Now static.
17948         (lock_file_1): Rename local to avoid shadowing.
17950         * buffer.c (fix_overlays_before): Mark locals as initialized.
17951         (fix_start_end_in_overlays): Likewise.  This function should be
17952         simplified by using pointers-to-pointers, but that's a different
17953         matter.
17954         (switch_to_buffer_1): Now static.
17955         (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17956         (report_overlay_modification): Rename locals to avoid shadowing.
17958         * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
17959         Fix pointer signedness issue.
17960         (sys_subshell): Mark local as volatile if checking for lint,
17961         to suppress a gcc -Wclobbered warning that does not seem to be right.
17962         (MAXPATHLEN): Define only if needed.
17964         * process.c (serial_open, serial_configure): Move decls from here ...
17965         * systty.h: ... to here, so that they can be checked.
17967         * fns.c (get_random, seed_random): Move extern decls from here ...
17968         * lisp.h: ... to here, so that they can be checked.
17970         * sysdep.c (reset_io): Now static.
17971         (wait_for_termination_signal): Remove; unused.
17973         * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17974         (copy_keymap_item, append_key, push_text_char_description):
17975         Now static.
17976         (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
17977         (DENSE_TABLE_SIZE): Remove; unused.
17978         (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17979         (describe_map_tree):
17980         Rename locals to avoid shadowing.
17982         * keyboard.c: Declare functions static if they are not used elsewhere.
17983         (echo_char, echo_dash, cmd_error, top_level_2):
17984         (poll_for_input, handle_async_input): Now static.
17985         (read_char, kbd_buffer_get_event, make_lispy_position):
17986         (make_lispy_event, make_lispy_movement, apply_modifiers):
17987         (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17988         (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17989         (Fread_key_sequence_vector): Rename locals to avoid shadowing.
17990         (read_key_sequence, read_char): Mark locals as initialized.
17991         (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
17993         * keyboard.h (make_ctrl_char): New decl.
17994         (mark_kboards): Move decl here ...
17995         * alloc.c (mark_kboards): ... from here.
17997         * lisp.h (force_auto_save_soon): New decl.
17999         * emacs.c (init_cmdargs): Rename local to avoid shadowing.
18000         (DEFINE_DUMMY_FUNCTION): New macro.
18001         (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
18002         Use it.
18003         (main): Add casts to avoid warnings
18004         if GCC considers string literals to be constants.
18006         * lisp.h (fatal_error_signal): Add decl, since it's exported.
18008         * dbusbind.c: Pointer signedness fixes.
18009         (xd_signature, xd_append_arg, xd_initialize):
18010         (Fdbus_call_method, Fdbus_call_method_asynchronously):
18011         (Fdbus_method_return_internal, Fdbus_method_error_internal):
18012         (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18013         (Fdbus_register_signal): Use SSDATA when the context wants char *.
18015         * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18016         if GCC considers string literals to be constants.
18017         (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
18019 2011-03-16  Stefan Monnier  <monnier@iro.umontreal.ca>
18021         * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18022         (print_preprocess, print_object): New macro to fix last change.
18024         * print.c (print_preprocess): Don't forget font objects.
18026 2011-03-16  Juanma Barranquero  <lekktu@gmail.com>
18028         * emacs.c (USAGE3): Doc fixes.
18030 2011-03-15  Andreas Schwab  <schwab@linux-m68k.org>
18032         * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18033         structure.
18035 2011-03-14  Juanma Barranquero  <lekktu@gmail.com>
18037         * lisp.h (VWindow_system, Qfile_name_history):
18038         * keyboard.h (lispy_function_keys) [WINDOWSNT]:
18039         * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
18040         (w32_system_caret_x, w32_system_caret_y): Declare extern.
18042         * w32select.c: Don't #include "keyboard.h".
18043         (run_protected): Add extern declaration for waiting_for_input.
18045         * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18046         * w32console.c (detect_input_pending, read_input_pending)
18047         (encode_terminal_code):
18048         * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18049         (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18050         (w32_system_caret_y, Qfile_name_history):
18051         * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18052         * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18053         * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18054         (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18055         * w32proc.c (Qlocal, report_file_error):
18056         * w32term.c (Vwindow_system, updating_frame):
18057         * w32uniscribe.c (initialized, uniscribe_font_driver):
18058         Remove unneeded extern declarations.
18060 2011-03-14  Chong Yidong  <cyd@stupidchicken.com>
18062         * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
18064 2011-03-13  Chong Yidong  <cyd@stupidchicken.com>
18066         * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18067         (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18068         These macros can no longer be used for assignment.
18070         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18071         Assign struct members directly, instead of using BUF_BEGV etc.
18072         (record_buffer_markers, fetch_buffer_markers): New functions for
18073         recording and fetching special buffer markers.
18074         (set_buffer_internal_1, set_buffer_temp): Use them.
18076         * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18078         * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18080         * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18081         (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18083         * xdisp.c (hscroll_window_tree):
18084         (reconsider_clip_changes): Use PT instead of BUF_PT.
18086 2011-03-13  Eli Zaretskii  <eliz@gnu.org>
18088         * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18089         $(EMACS_ROOT)/lib/intprops.h.
18091 2011-03-13  Paul Eggert  <eggert@cs.ucla.edu>
18093         Fix more problems found by GCC 4.5.2's static checks.
18095         * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18096         to unsigned char * to avoid compiler diagnostic.
18097         (xg_free_frame_widgets): Make it clear that a local variable is
18098         needed only if USE_GTK_TOOLTIP.
18099         (gdk_window_get_screen): Make it clear that this macro is needed
18100         only if USE_GTK_TOOLTIP.
18101         (int_gtk_range_get_value): New function, which avoids a diagnostic
18102         from gcc -Wbad-function-cast.
18103         (xg_set_toolkit_scroll_bar_thumb): Use it.
18104         (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18105         diagnostic from gcc -Wbad-function-cast.
18106         (get_utf8_string, xg_get_file_with_chooser):
18107         Rename locals to avoid shadowing.
18108         (create_dialog): Move locals to avoid shadowing.
18110         * xgselect.c (xg_select): Remove unused var.
18112         * image.c (four_corners_best): Mark locals as initialized.
18113         (gif_load): Initialize transparent_p to zero (Bug#8238).
18114         Mark another local as initialized.
18115         (my_png_error, my_error_exit): Mark with NO_RETURN.
18117         * image.c (clear_image_cache): Now static.
18118         (DIM, HAVE_STDLIB_H_1): Remove unused macros.
18119         (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
18120         (x_edge_detection): Remove unnecessary cast that
18121         gcc -Wbad-function-cast diagnoses.
18122         (gif_load): Fix pointer signedness.
18123         (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18124         (jpeg_load, gif_load): Rename locals to avoid shadowing.
18126 2011-03-12  Paul Eggert  <eggert@cs.ucla.edu>
18128         Improve quality of tests for time stamp overflow.
18129         For example, without this patch (encode-time 0 0 0 1 1
18130         1152921504606846976) returns the obviously-bogus value (-948597
18131         62170) on my RHEL 5.5 x86-64 host.  With the patch, it correctly
18132         reports time overflow.  See
18133         <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
18134         * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18135         * editfns.c: Include limits.h and intprops.h.
18136         (TIME_T_MIN, TIME_T_MAX): New macros.
18137         (time_overflow): Move earlier, to before first use.
18138         (hi_time, lo_time): New functions, for an accurate test for
18139         out-of-range times.
18140         (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18141         (Fget_internal_run_time): Don't assume time_t fits in int.
18142         (make_time): Use list2 instead of Fcons twice.
18143         (Fdecode_time): More accurate test for out-of-range times.
18144         (check_tm_member): New function.
18145         (Fencode_time): Use it, to test for out-of-range times.
18146         (lisp_time_argument): Don't rely on undefined left-shift and
18147         right-shift behavior when checking for time stamp overflow.
18149         * editfns.c (time_overflow): New function, refactoring common code.
18150         (Fformat_time_string, Fdecode_time, Fencode_time):
18151         (Fcurrent_time_string): Use it.
18153         Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18154         * dired.c (make_time): Move to ...
18155         * editfns.c (make_time): ... here.
18156         * systime.h: Note the move.
18158 2011-03-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
18160         * fringe.c (update_window_fringes): Remove unused variables.
18162         * unexmacosx.c (copy_data_segment): Also copy __got section.
18163         (Bug#8223)
18165 2011-03-12  Eli Zaretskii  <eliz@gnu.org>
18167         * termcap.c [MSDOS]: Include "msdos.h".
18168         (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18169         Constify `char *' arguments and their references according to
18170         prototypes in tparam.h.
18172         * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
18174         * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18175         Adapt all references accordingly.
18177         * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18179 2011-03-11  Tom Tromey  <tromey@redhat.com>
18181         * buffer.c (syms_of_buffer): Remove obsolete comment.
18183 2011-03-11  Eli Zaretskii  <eliz@gnu.org>
18185         * termhooks.h (encode_terminal_code): Declare prototype.
18187         * msdos.c (encode_terminal_code): Don't declare prototype.
18189         * term.c (encode_terminal_code): Now external again, used by
18190         w32console.c and msdos.c.
18192         * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18193         Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
18195 2011-03-11  Paul Eggert  <eggert@cs.ucla.edu>
18197         Fix some minor problems found by GCC 4.5.2's static checks.
18199         * fringe.c (update_window_fringes): Mark locals as initialized
18200         (Bug#8227).
18201         (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
18203         * alloc.c (mark_fringe_data): Move decl from here ...
18204         * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18205         to check its interface.
18206         (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18208         * fontset.c (free_realized_fontset): Now static.
18209         (Fset_fontset_font): Rename local to avoid shadowing.
18210         (fontset_font): Mark local as initialized.
18211         (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
18213         * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18215         * xselect.c (x_disown_buffer_selections): Remove; not used.
18216         (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
18217         (x_own_selection, Fx_disown_selection_internal): Rename locals
18218         to avoid shadowing.
18219         (x_handle_dnd_message): Remove local to avoid shadowing.
18221         * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18222         so that the caller can use some name other than gcpro1.
18223         (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
18224         * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18225         (Fx_backspace_delete_keys_p):
18226         Use them to avoid shadowing, and rename vars to avoid shadowing.
18227         (x_decode_color, x_set_name, x_window): Now static.
18228         (Fx_create_frame): Add braces to silence GCC warning.
18229         (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
18230         (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18231         Remove unused locals.
18232         (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18233         (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18234         Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18235         macros.
18237         * xterm.h (x_mouse_leave): New decl.
18239         * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18240         Remove unused functions.
18241         (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18242         (x_calc_absolute_position): Now static.
18243         (XTread_socket): Don't define label "out" unless it's used.
18244         Don't declare local "event" unless it's used.
18245         (x_iconify_frame, x_free_frame_resources): Don't declare locals
18246         unless they are used.
18247         (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18248         (x_fatal_error_signal): Remove; not used.
18249         (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18250         (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18251         (x_error_catcher, x_connection_closed, x_error_handler):
18252         (x_error_quitter, xembed_send_message, x_iconify_frame):
18253         (my_log_handler): Rename locals to avoid shadowing.
18254         (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
18255         (x_connection_closed): Tell GCC not to suggest NO_RETURN.
18257         * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18258         Rename or move locals to avoid shadowing.
18259         (tty_defined_color, merge_face_heights): Now static.
18260         (free_realized_faces_for_fontset): Remove; not used.
18261         (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18262         does not deduce is never used uninitialized.
18263         (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18264         (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
18266         * terminal.c (store_terminal_param): Now static.
18268         * xmenu.c (menu_highlight_callback): Now static.
18269         (set_frame_menubar): Remove unused local.
18270         (xmenu_show): Rename parameter to avoid shadowing.
18271         (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18272         since they might point to immutable storage.
18273         (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18274         since it's unused otherwise.
18276         * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
18277         Add a FIXME, since the code still doesn't look right.  (Bug#8215)
18278         (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18279         avoids a gcc -Wuninitialized diagnostic.
18280         (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
18281         (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18282         does not deduce are never used uninitialized.
18284         * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18286         * xdisp.c (redisplay_window): Rename local to avoid shadowing.
18287         * window.c (window_loop, size_window):
18288         (run_window_configuration_change_hook, enlarge_window): Likewise.
18290         * window.c (display_buffer): Now static.
18291         (size_window): Mark variables that gcc -Wuninitialized
18292         does not deduce are never used uninitialized.
18293         * window.h (check_all_windows): New decl, to forestall
18294         gcc -Wmissing-prototypes diagnostic.
18295         * dispextern.h (bidi_dump_cached_states): Likewise.
18297         * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18298         shadowing.
18299         * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
18300         Include <limits.h>.
18301         (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18302         and to avoid gcc -Wuninitialized warning.
18303         (load_charset_map): Mark variables that gcc -Wuninitialized
18304         does not deduce are never used uninitialized.
18305         (load_charset): Abort instead of using uninitialized var (Bug#8229).
18307         * coding.c (coding_set_source, coding_set_destination):
18308         Use "else { /* comment */ }" rather than "else /* comment */;"
18309         for clarity, and to avoid gcc -Wempty-body warning.
18310         (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18311         a block, when the outer 'i' will do.
18312         (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18313         (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18314         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18315         (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18316         (Fdecode_sjis_char, Fdefine_coding_system_internal):
18317         Rename locals to avoid shadowing.
18318         * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
18319         * coding.c (emacs_mule_char, encode_invocation_designation):
18320         Now static, since they're not used elsewhere.
18321         (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
18322         (decode_coding_object, encode_coding_object, detect_coding_system):
18323         (decode_coding_emacs_mule): Mark variables that gcc
18324         -Wuninitialized does not deduce are never used uninitialized.
18325         (detect_coding_iso_2022): Initialize a local variable that might
18326         be used uninitialized.  Leave a FIXME because it's not clear that
18327         this initialization is needed.  (Bug#8211)
18328         (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18329         (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18330         (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18331         (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18332         Remove unused macros.
18334         * category.c (hash_get_category_set): Remove unused local var.
18335         (copy_category_table): Now static, since it's not used elsewhere.
18336         * character.c (string_count_byte8): Likewise.
18338         * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18339         (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18341         * chartab.c (copy_sub_char_table): Now static, since it's not used
18342         elsewhere.
18343         (sub_char_table_ref_and_range, char_table_ref_and_range):
18344         Rename locals to avoid shadowing.
18345         (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
18347         * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
18348         (BIDI_BOB): Remove unused macro.
18350         * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18351         deduce are never used uninitialized.
18352         * term.c (encode_terminal_code): Likewise.
18354         * term.c (encode_terminal_code): Now static.  Remove unused local.
18356         * tparam.h: New file.
18357         * term.c, tparam.h: Include it.
18358         * deps.mk (term.o, tparam.o): Depend on tparam.h.
18359         * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18360         Move these decls to tparam.h, and make them agree with what
18361         is actually in tparam.c.  The previous trick of using incompatible
18362         decls in different modules does not conform to the C standard.
18363         All callers of tparam changed to use tparam's actual API.
18364         * tparam.c (tparam1, tparam, tgoto):
18365         Use const pointers where appropriate.
18367         * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18368         * cm.h (struct cm): Likewise.
18369         * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18370         * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18371         * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18372         (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18373         (turn_on_face, init_tty): Likewise.
18374         * termchar.h (struct tty_display_info): Likewise.
18376         * term.c (term_mouse_position): Rename local to avoid shadowing.
18378         * alloc.c (mark_ttys): Move decl from here ...
18379         * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18381 2011-03-11  Andreas Schwab  <schwab@linux-m68k.org>
18383         * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18385 2011-03-09  Juanma Barranquero  <lekktu@gmail.com>
18387         * search.c (compile_pattern_1): Remove argument regp, unused since
18388         revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18389         (compile_pattern): Don't pass it.
18391 2011-03-08  Jan Djärv  <jan.h.d@swipnet.se>
18393         * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18394         (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18395         for ! HAVE_GTK3.
18396         (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18398         * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18400         * gtkutil.c: Include gtkx.h if HAVE_GTK3.  If ! HAVE_GTK3, define
18401         gdk_window_get_screen, gdk_window_get_geometry,
18402         gdk_x11_window_lookup_for_display and GDK_KEY_g.
18403         (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18404         (xg_get_pixbuf_from_pixmap): New function.
18405         (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18406         to Pixmap, take frame as parameter, remove GdkColormap parameter.
18407         Call xg_get_pixbuf_from_pixmap instead of
18408         gdk_pixbuf_get_from_drawable.
18409         (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18410         xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18411         (xg_check_special_colors): Use GtkStyleContext and its functions
18412         for HAVE_GTK3.
18413         (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18414         (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18415         (xg_update_frame_menubar, xg_tool_bar_detach_callback)
18416         (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18417         Call gtk_widget_get_preferred_size.
18418         (xg_frame_resized): gdk_window_get_geometry only takes 5
18419         parameters.
18420         (xg_win_to_widget, xg_event_is_for_menubar):
18421         Call gdk_x11_window_lookup_for_display.
18422         (xg_set_widget_bg): New function.
18423         (delete_cb): New function.
18424         (xg_create_frame_widgets): Connect delete-event to delete_cb.
18425         Call xg_set_widget_bg.  Only set background pixmap for ! HAVE_GTK3
18426         (xg_set_background_color): Call xg_set_widget_bg.
18427         (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18428         (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18429         Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18430         (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18431         if ! HAVE_GTK3.
18432         (update_frame_tool_bar): Call gtk_widget_hide.
18433         (xg_initialize): Use GDK_KEY_g.
18435         * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18436         if ! HAVE_GTK3
18437         (x_session_initialize): Call gdk_x11_set_sm_client_id.
18439         * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18440         (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18441         Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18443 2011-03-08  Juanma Barranquero  <lekktu@gmail.com>
18445         * w32xfns.c (select_palette): Check success of RealizePalette against
18446         GDI_ERROR, not zero.
18448 See ChangeLog.11 for earlier changes.
18450 ;; Local Variables:
18451 ;; coding: utf-8
18452 ;; End:
18454   Copyright (C) 2011-2012 Free Software Foundation, Inc.
18456   This file is part of GNU Emacs.
18458   GNU Emacs is free software: you can redistribute it and/or modify
18459   it under the terms of the GNU General Public License as published by
18460   the Free Software Foundation, either version 3 of the License, or
18461   (at your option) any later version.
18463   GNU Emacs is distributed in the hope that it will be useful,
18464   but WITHOUT ANY WARRANTY; without even the implied warranty of
18465   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18466   GNU General Public License for more details.
18468   You should have received a copy of the GNU General Public License
18469   along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.