* semantic.el (semantic-new-buffer-setup-functions): Remove setup
[emacs.git] / src / ChangeLog
blob492b966a256e3cae2471d7472206f52d2bf3e9fb
1 2012-10-07  Jan Djärv  <jan.h.d@swipnet.se>
3         * nsterm.m (ns_dumpglyphs_image): Only draw slize of image (Bug#12506).
5         * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
6         MAC_OS_X_VERSION_10_6.
7         (syms_of_nsterm): Remove comment about Panther and above for ns-antialias-text.
8         * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
9         (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
10         (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
12         * nsselect.m (ns_string_from_pasteboard): Remove check for >=
13         MAC_OS_X_VERSION_10_4.
15         * nsmenu.m (fillWithWidgetValue:): Remove code for < MAC_OS_X_VERSION_10_2.
17         * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
19         * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
20         (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
22         * nsterm.m (ns_in_resize): Remove (Bug#12479).
23         (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
24         (ns_clear_frame, sendEvent, windowDidResize, drawRect:): Remove ns_in_resize
25         check.
26         (ns_clear_frame_area): Remove resize handle code.
28         * nsfns.m (ns_in_resize): Remove.
29         (x_set_icon_name, ns_set_name, ns_set_name_as_filename):  Remove ns_in_resize
30         check.
32 2012-10-07  Paul Eggert  <eggert@cs.ucla.edu>
34         Improve sys_siglist detection.
35         * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
36         defined as a macro, as is done in Solaris.
37         (sys_siglist_entries): New macro.
38         (save_strsignal): Use it.
39         * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
40         GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
42 2012-10-06  Jan Djärv  <jan.h.d@swipnet.se>
44         * nsfns.m (Fx_create_frame): Call x_default_parameter with
45         fullscreen/Fullscreen.
47         * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
48         tobar_height is new.
50         * nsterm.m (x_make_frame_visible): Check for fullscreen.
51         (ns_fullscreen_hook): Activate old style fullscreen with a timer.
52         (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
53         (windowDidResize:): Check for correct window if old style fullscreen.
54         Capitalize word in comment.  Remove incorrect comment.
55         (initFrameFromEmacs:): tbar_height renamed tibar_height.
56         (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
57         error in drawing background.
58         (toggleFullScreen:): Remove comment. Rearrange calls.
59         Set toolbar values to zero, save old height in tobar_height.
60         Restore tool bar height when leaving fullscreen.
61         (canBecomeMainWindow): New function.
63 2012-10-06  Paul Eggert  <eggert@cs.ucla.edu>
65         * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
67 2012-10-05  Eli Zaretskii  <eliz@gnu.org>
69         * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
71         * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
72         that time stamps of directories could also be changed.  Don't
73         request the too broad GENERIC_WRITE, only the more restrictive
74         FILE_WRITE_ATTRIBUTES access rights.
76         * fileio.c (Fset_file_times): Special-case ignoring errors for
77         directories only on MSDOS, not on MS-Windows.
79 2012-10-05  Ikumi Keita  <ikumi@ikumi.que.jp>  (tiny change)
81         * minibuf.c (Fcompleting_read): Doc fix.  (Bug#12555)
83 2012-10-04  Eli Zaretskii  <eliz@gnu.org>
85         * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
86         see whether CreateFile failed.
88 2012-10-04  Paul Eggert  <eggert@cs.ucla.edu>
90         * profiler.c (handle_profiler_signal): Inhibit pending signals too,
91         to avoid similar races.
92         * keyboard.c (pending_signals): Now bool, not int.
94         Port timers to OpenBSD, plus check for timer failures.
95         OpenBSD problem reported by Han Boetes.
96         * profiler.c (setup_cpu_timer): Check for failure of timer_settime
97         and/or setitimer.
98         (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
99         * syssignal.h (HAVE_ITIMERSPEC): New macro.  This is for platforms
100         like OpenBSD, which has timer_settime but does not declare it.
101         OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
102         whether to use itimerspec-related primitives.  All uses of
103         HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
105 2012-10-02  Paul Eggert  <eggert@cs.ucla.edu>
107         * profiler.c (handle_profiler_signal): Fix a malloc race
108         that caused Emacs to hang on Fedora 17 when profiling Lisp.
110 2012-10-02  Jan Djärv  <jan.h.d@swipnet.se>
112         * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
114 2012-10-02  Eli Zaretskii  <eliz@gnu.org>
116         * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
117         consistent with the change in return value of 'safe_strsignal'.
119 2012-10-02  Paul Eggert  <eggert@cs.ucla.edu>
121         Prefer plain 'static' to 'static inline' (Bug#12541).
122         * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
123         (bidi_set_sor_type, bidi_push_embedding_level)
124         (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
125         (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
126         (bidi_cache_search, bidi_cache_ensure_space)
127         (bidi_cache_iterator_state, bidi_cache_find)
128         (bidi_peek_at_next_level, bidi_set_paragraph_end)
129         (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
130         (bidi_explicit_dir_char, bidi_resolve_neutral_1):
131         Now 'static', not 'static inline'.
133         Count overruns when profiling; change units to ns.
134         * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
135         Give extra weight to samples after overruns, to attempt to count
136         the time more accurately.
137         (setup_cpu_timer): Change sampling interval units from ms to ns, since
138         the underlying primitives nominally do ns.
139         (Fprofiler_cpu_start): Document the change.  Mention that
140         the sampling intervals are only approximate.
142 2012-10-02  Stefan Monnier  <monnier@iro.umontreal.ca>
144         * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
146         * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
147         case for the special 0 coding-system.
149         * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
150         (Fmake_overlay): Remove redundant tests.
151         (fix_start_end_in_overlays): Remove redundant recentering.
153 2012-10-02  Juanma Barranquero  <lekktu@gmail.com>
155         * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
156         Update dependencies.
158 2012-10-01  Paul Eggert  <eggert@cs.ucla.edu>
160         Fix a malloc race condition involving strsignal.
161         A signal can arrive in the middle of a malloc, and Emacs's signal
162         handler can invoke strsignal, which can invoke malloc, which is
163         not portable.  This race condition bug makes Emacs hang on GNU/Linux.
164         Fix it by altering the signal handler so that it does not invoke
165         strsignal.
166         * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
167         * process.c (status_message): Use const pointer, in case strsignal
168         is #defined to safe_strsignal.
169         * sysdep.c (sys_siglist, init_signals): Always define and
170         initialize a substitute sys_siglist if the system does not define
171         one, even if HAVE_STRSIGNAL.
172         (safe_strsignal): Rename from strsignal.  Always define,
173         using sys_siglist.  Return a const pointer.
174         * syssignal.h (safe_strsignal): New decl.
175         (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
177 2012-10-01  Eli Zaretskii  <eliz@gnu.org>
179         * w32proc.c (timer_loop): Fix code that waits for timer
180         expiration, to avoid high CPU usage.
182 2012-10-01  Stefan Monnier  <monnier@iro.umontreal.ca>
184         * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
185         (sweep_weak_table): Remove redundant prototypes.
187 2012-10-01  Fabrice Popineau  <fabrice.popineau@gmail.com>
189         * emacs.c: Move the inclusion of TERM_HEADER after including
190         windows.h on WINDOWSNT.  This avoids compilation problems with
191         MSVC.
193 2012-10-01  Eli Zaretskii  <eliz@gnu.org>
195         * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
196         (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
197         (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
198         as the previous version used 'void *'.
200         * ralloc.c (ROUNDUP): Fix last change.
201         (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
202         'size_t'.
204         * w32proc.c <disable_itimers>: New static flag.
205         (init_timers): Initialize it to zero, after creating the critical
206         sections used by the timer threads.
207         (term_timers): Set to 1 before deleting the critical sections.
208         (getitimer, setitimer): If disable_itimers is non-zero, return an
209         error indication without doing anything.  Reported by Fabrice
210         Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
211         (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
212         return results.
213         [!HAVE_SETITIMER]: Behave as the previous version that didn't
214         support timers.
216         * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
217         term_ntproc after all the other bookkeeping, to get timers working
218         as long as possible.
220 2012-10-01  Paul Eggert  <eggert@cs.ucla.edu>
222         * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
223         Suggested by Juri Linkov in
224         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
226         Prefer plain 'static' to 'static inline' (Bug#12541).
227         With static functions, modern compilers inline pretty well by
228         themselves; advice from programmers often hurts as much as it helps.
229         On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
230         this change shrinks the text size of the Emacs executable by 1.1%
231         without affecting CPU significantly in my benchmark.
232         * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
233         (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
234         (mark_maybe_object, mark_maybe_pointer, bounded_number):
235         * buffer.c (bset_abbrev_mode, bset_abbrev_table)
236         (bset_auto_fill_function, bset_auto_save_file_format)
237         (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
238         (bset_bidi_display_reordering, bset_buffer_file_coding_system)
239         (bset_cache_long_line_scans, bset_case_fold_search)
240         (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
241         (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
242         (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
243         (bset_fringe_indicator_alist, bset_fringes_outside_margins)
244         (bset_header_line_format, bset_indicate_buffer_boundaries)
245         (bset_indicate_empty_lines, bset_invisibility_spec)
246         (bset_left_fringe_width, bset_major_mode, bset_mark)
247         (bset_minor_modes, bset_mode_line_format, bset_mode_name)
248         (bset_name, bset_overwrite_mode, bset_pt_marker)
249         (bset_right_fringe_width, bset_save_length)
250         (bset_scroll_bar_width, bset_scroll_down_aggressively)
251         (bset_scroll_up_aggressively, bset_selective_display)
252         (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
253         (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
254         (set_buffer_overlays_after):
255         * category.c (bset_category_table):
256         * charset.c (read_hex):
257         * coding.c (produce_composition, produce_charset)
258         (handle_composition_annotation, handle_charset_annotation)
259         (char_encodable_p):
260         * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
261         (assign_row, set_frame_matrix_frame, make_current)
262         (add_row_entry):
263         * eval.c (set_specpdl_symbol, set_specpdl_old_value):
264         * fns.c (maybe_resize_hash_table):
265         * frame.c (fset_buffer_predicate, fset_minibuffer_window):
266         * gmalloc.c (register_heapinfo):
267         * image.c (lookup_image_type):
268         * intervals.c (set_interval_object, set_interval_left)
269         (set_interval_right, copy_interval_parent, rotate_right)
270         (rotate_left, balance_possible_root_interval):
271         * keyboard.c (kset_echo_string, kset_kbd_queue)
272         (kset_keyboard_translate_table, kset_last_prefix_arg)
273         (kset_last_repeatable_command, kset_local_function_key_map)
274         (kset_overriding_terminal_local_map, kset_real_last_command)
275         (kset_system_key_syms, clear_event, set_prop):
276         * lread.c (digit_to_number):
277         * marker.c (attach_marker, live_buffer, set_marker_internal):
278         * nsterm.m (ns_compute_glyph_string_overhangs):
279         * process.c (pset_buffer, pset_command)
280         (pset_decode_coding_system, pset_decoding_buf)
281         (pset_encode_coding_system, pset_encoding_buf, pset_filter)
282         (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
283         (pset_status, pset_tty_name, pset_type, pset_write_queue):
284         * syntax.c (bset_syntax_table, dec_bytepos):
285         * terminal.c (tset_param_alist):
286         * textprop.c (interval_has_some_properties)
287         (interval_has_some_properties_list):
288         * window.c (wset_combination_limit, wset_dedicated)
289         (wset_display_table, wset_hchild, wset_left_fringe_width)
290         (wset_left_margin_cols, wset_new_normal, wset_new_total)
291         (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
292         (wset_right_fringe_width, wset_right_margin_cols)
293         (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
294         (wset_vertical_scroll_bar_type, wset_window_parameters):
295         * xdisp.c (wset_base_line_number, wset_base_line_pos)
296         (wset_column_number_displayed, wset_region_showing)
297         (window_box_edges, run_window_scroll_functions)
298         (append_glyph_string_lists, prepend_glyph_string_lists)
299         (append_glyph_string, set_glyph_string_background_width)
300         (append_glyph, append_composite_glyph)
301         (take_vertical_position_into_account):
302         * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
303         (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
304         (lface_hash, lface_same_font_attributes_p, lookup_face):
305         * xml.c (libxml2_loaded_p):
306         * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
307         (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
308         Now 'static', not 'static inline'.
310         * bidi.c: Tune.
311         (bidi_copy_it): Do the whole copy with a single memcpy.
312         (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
314         Revert the FOLLOW-SYMLINKS change for file-attributes.
315         Doing it right would require several changes to Tramp, and there's
316         not enough time to get that tested before the freeze today.
317         * dired.c (directory_files_internal, Ffile_attributes):
318         Undo last change.
320         * frame.c (x_report_frame_params): Port better to wider ints.
321         Do not assume that EMACS_UINT is the same width as uprintmax_t,
322         or that pointers can be printed in 15 decimal digits.
323         Avoid GCC warnings if EMACS_UINT is wider than a pointer.
325 2012-09-30  Fabrice Popineau  <fabrice.popineau@supelec.fr>
327         Support x64 build on MS-Windows.
328         * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
329         (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
330         compatibility with x64.
331         (x_get_focus_frame): Add prototype.
333         * w32term.c (w32_draw_underwave): Don't use GCC extensions for
334         defining an XRectangle structure.
336         * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
337         arithmetics for compatibility with x64.
339         * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
340         compatibility with x64.
342         * w32heap.h: Adjust prototypes and declarations.
344         * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
345         (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
346         DWORD, long, and unsigned long, for compatibility with x64.
347         (allocate_heap) [_WIN64]: Reserve 32GB of memory.
348         (sbrk): Argument is now of type ptrdiff_t.
350         * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
351         less than 0x0500.
352         (w32_msg_pump): Use WPARAM type for 'result'.
354         * w32.c (init_environment, get_emacs_configuration): Support AMD64
355         architecture.
356         (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
357         compatibility with x64.
359         * vm-limit.c (lim_data): Now size_t.
360         (check_memory_limits): Adjust prototypes of real_morecore and
361         __morecore to receive argument of type ptrdiff_t.  Use size_t for
362         five_percent and data_size.
364         * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
365         variables, for compatibility with x64.
366         (rva_to_section, offset_to_section, relocate_offset)
367         (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
368         (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
369         (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
370         for compatibility with x64.
372         * sysdep.c (STDERR_FILENO): Define if not already defined.
374         * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
375         (__morecore): Argument type is now ptrdiff_t.
376         (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
377         (relinquish): Use ptrdiff_t type for 'excess'.
378         (r_alloc_sbrk): Argument type is now ptrdiff_t.
380         * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
381         (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
382         instead of a literal number.
384         * gmalloc.c [WINDOWSNT]: Include w32heap.h.
385         (min): Define only if not already defined.
387         * frame.c (x_report_frame_params): Use EMACS_UINT for the return
388         value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
389         hosts.
391         * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
392         'bitmaps' is a pointer.
394         * dispextern.h (x_bitmap_pixmap): Adjust prototype.
396         * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
398 2012-09-30  Paul Eggert  <eggert@cs.ucla.edu>
400         file-attributes has a new optional arg FOLLOW-SYMLINKS.
401         * dired.c (directory_files_internal, Ffile_attributes):
402         New arg follow_symlinks.  All uses changed.
404 2012-09-30  Stefan Monnier  <monnier@iro.umontreal.ca>
406         * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
408 2012-09-30  Eli Zaretskii  <eliz@gnu.org>
410         Support atimers and CPU profiler via profile.c on MS-Windows.
411         * w32proc.c (sig_mask, crit_sig): New static variables.
412         (sys_signal): Support SIGALRM and SIGPROF.
413         (sigemptyset, sigaddset, sigfillset, sigprocmask)
414         (pthread_sigmask, setpgrp): Move here from w32.c.  sigaddset,
415         sigfillset, and sigprocmask are no longer no-ops.
416         (sigismember): New function.
417         (struct itimer_data): New definition.
418         (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
419         (crit_prof): New static variables.
420         (MAX_SINGLE_SLEEP): New definition.
421         (timer_loop, stop_timer_thread, term_timers, init_timers)
422         (start_timer_thread, getitimer, setitimer): New functions.
423         (alarm): No longer a no-op, calls setitimer.
425         * w32.c (term_ntproc): Call term_timers.
426         (init_ntproc): Make sure all signals are unblocked at startup, to
427         erase any traces of dumping.  Call init_timers.
429         * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
430         Windows-specific code to display the hourglass mouse pointer is no
431         longer used.
432         (w32_wnd_proc): Remove code that handled the WM_TIMER message due
433         to hourglass timer expiration.
434         (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
435         Remove, no longer used.
436         (w32_note_current_window, show_hourglass, hide_hourglass):
437         New functions, in support of hourglass cursor display similar to other
438         window systems.
439         (syms_of_w32fns): Don't initialize hourglass_timer.
441         * xdisp.c (start_hourglass, cancel_hourglass): Now used on
442         WINDOWSNT as well.
443         (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
445         * w32.h (init_timers, term_timers): Add prototypes.
447 2012-09-30  Kenichi Handa  <handa@gnu.org>
449         * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
450         to the buffer relocation which may be caused by ccl_driver.
452 2012-09-30  Jan Djärv  <jan.h.d@swipnet.se>
454         * xfns.c (Fx_file_dialog): Update comment.
456         * w32fns.c (Fx_file_dialog): Update comment.
458         * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
459         Initialize panel name field if OSX >= 10.6.
461         * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
463         * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
465         * nsterm.m (NEW_STYLE_FS): New define.
466         (ns_fullscreen_hook, windowWillEnterFullScreen)
467         (windowDidEnterFullScreen, windowWillExitFullScreen)
468         (windowDidExitFullScreen, toggleFullScreen, handleFS)
469         (setFSValue): New functions.
470         (EmacsFSWindow): New implementation.
471         (canBecomeKeyWindow): New function for EmacsFSWindow.
472         (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
473         (dealloc): Release nonfs_window if in fullscreen.
474         (updateFrameSize:): Call windowDidMove to update top/left.
475         (windowWillResize:toSize:): Check if frame is still maximized.
476         (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
477         next_maximized, maximized_width, maximized_height and nonfs_window.
478         Call setCollectionBehavior if NEW_STYLE_FS.  Initialize bwidth and
479         tbar_height.
480         (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
481         fullscreen. Set maximized_width/height.  Act on next_maximized.
483         * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
484         (EmacsView): Add variables for fullscreen.
485         (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
486         (EmacsFSWindow): New interface for fullscreen.
488 2012-09-30  Juanma Barranquero  <lekktu@gmail.com>
490         * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
492 2012-09-30  Chong Yidong  <cyd@gnu.org>
494         * fns.c (Frandom): Doc fix.
496 2012-09-30  Martin Rudalics  <rudalics@gmx.at>
498         * window.c (Vwindow_combination_limit): New default value.
499         (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
501 2012-09-30  Paul Eggert  <eggert@cs.ucla.edu>
503         * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
504         Suggested by Eli Zaretskii in
505         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
507 2012-09-30  Eli Zaretskii  <eliz@gnu.org>
509         * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
510         HAVE_TIMER_SETTIME is defined.
512 2012-09-30  Paul Eggert  <eggert@cs.ucla.edu>
514         Profiler improvements: more-accurate timers, overflow checks.
515         * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
516         signal.h, setjmp.h.  Include systime.h instead.
517         (saturated_add): New function.
518         (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
519         (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
520         (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
521         New static vars.
522         (enum profiler_cpu_running): New enum.
523         (profiler_cpu_running): Now of that enum type, not bool.
524         All uses changed to store the new value.
525         (handle_profiler_signal): Rename from sigprof_handler_1,
526         for consistency with other handlers.  Do not check whether
527         cpu_log is a hash-table if garbage collecting, since it
528         doesn't matter in that case.
529         (deliver_profiler_signal): Rename from sigprof_handler,
530         for consistency with other handlers.
531         (setup_cpu_timer): New function, with much of what used to be in
532         Fprofiler_cpu_start.  Check for out-of-range argument.
533         Prefer timer_settime if available, and prefer
534         thread cputime clocks, then process cputime clocks, then
535         monotonic clocks, to the old realtime clock.  Use make_timeval
536         to round more-correctly when falling back to setitimer.
537         (Fprofiler_cpu_start): Use it.
538         (Fprofiler_cpu_stop): Prefer timer_settime if available.
539         Don't assume that passing NULL as the 2nd argument of setitimer
540         is the same as passing a pointer to all-zero storage.
541         Ignore SIGPROF afterwards.
542         (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
543         * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
544         non-fatal signal handlers.  Ignore SIGPROF on startup.
545         * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
546         in profiler.c, since sysdep.c now uses it.
548         * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
549         Suggested by Eli Zaretskii in
550         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
552 2012-09-29  Juanma Barranquero  <lekktu@gmail.com>
554         * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
556 2012-09-29  Stefan Monnier  <monnier@iro.umontreal.ca>
558         * lisp.h (struct backtrace): Remove indirection for `function' field.
559         * xdisp.c (redisplay_internal):
560         * profiler.c (record_backtrace, sigprof_handler_1):
561         * alloc.c (Fgarbage_collect):
562         * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
563         (Fbacktrace_frame): Adjust accordingly.
565 2012-09-28  Glenn Morris  <rgm@gnu.org>
567         * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
568         (Frun_hook_with_args_until_failure): Doc fixes.
570 2012-09-28  Eli Zaretskii  <eliz@gnu.org>
572         * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
573         Qautomatic_redisplay and change the symbol name.  All users changed.
575 2012-09-28  Tomohiro Matsuyama  <tomo@cx4a.org>
577         * profiler.c (sigprof_handler): Fix race condition.
579 2012-09-28  Glenn Morris  <rgm@gnu.org>
581         * lread.c (lisp_file_lexically_bound_p): Handle #! lines.  (Bug#12528)
583 2012-09-27  Paul Eggert  <eggert@cs.ucla.edu>
585         Check more robustly for timer_settime.
586         * Makefile.in (LIB_TIMER_TIME): New macro.
587         (LIBES): Add it.
588         * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
589         Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
590         call timer_settime.
592 2012-09-26  Tomohiro Matsuyama  <tomo@cx4a.org>
594         * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
596 2012-09-26  Juanma Barranquero  <lekktu@gmail.com>
598         * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
600 2012-09-26  Paul Eggert  <eggert@cs.ucla.edu>
602         * character.h (MAYBE_UNIFY_CHAR): Remove.
603         * charset.c, charset.h (maybe_unify_char): Now static.
604         * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
605         Since this stuff is now private to charset.c, there's no need for
606         a public macro and no need to inline by hand.
608 2012-09-26  Tomohiro Matsuyama  <tomo@cx4a.org>
609             Stefan Monnier  <monnier@iro.umontreal.ca>
610             Juanma Barranquero  <lekktu@gmail.com>
612         * profiler.c: New file.
613         * Makefile.in (base_obj): Add profiler.o.
614         * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
615         ($(BLD)/profiler.$(O)): New target.
616         * emacs.c (main): Call syms_of_profiler.
617         * alloc.c (Qautomatic_gc): New constant.
618         (MALLOC_PROBE): New macro.
619         (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
620         (total_bytes_of_live_objects): New function.
621         (Fgarbage_collect): Use it.  Record itself in backtrace_list.
622         Call malloc_probe for the memory profiler.
623         (syms_of_alloc): Define Qautomatic_gc.
624         * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
625         race condition.
626         (struct backtrace): Move definition...
627         * lisp.h (struct backtrace): ..here.
628         (Qautomatic_gc, profiler_memory_running): Declare vars.
629         (malloc_probe, syms_of_profiler): Declare functions.
630         * xdisp.c (Qautomatic_redisplay): New constant.
631         (redisplay_internal): Record itself in backtrace_list.
632         (syms_of_xdisp): Define Qautomatic_redisplay.
634 2012-09-25  Eli Zaretskii  <eliz@gnu.org>
635 2012-09-25  Juanma Barranquero  <lekktu@gmail.com>
637         * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
639 2012-09-25  Paul Eggert  <eggert@cs.ucla.edu>
641         Prefer POSIX timers if available.
642         They avoid a race if the timer is too close to the current time.
643         * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
644         (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
645         (init_atimer) [SIGEV_SIGNAL]: Initialize them.
647 2012-09-25  Eli Zaretskii  <eliz@gnu.org>
649         * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
650         CHAR_STRING_ADVANCE.
651         (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
652         STRING_CHAR_ADVANCE.
654 2012-09-25  Juanma Barranquero  <lekktu@gmail.com>
656         Move Vlibrary_cache to emacs.c and reset before dumping.
658         * lisp.h (reset_image_types): Declare.
659         [WINDOWSNT] (Vlibrary_cache): Declare.
661         * image.c (reset_image_types): New function.
663         * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
664         (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
665         (Fdump_emacs): Reset Vlibrary_cache and image_types.
667         * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
668         (globals_of_w32) <Vlibrary_cache>: Do not initialize.
670         * w32.h (Vlibrary_cache): Do not declare.
672 2012-09-25  Eli Zaretskii  <eliz@gnu.org>
674         * w32proc.c (sys_signal): Handle all signals defined by the
675         MS-Windows runtime, not just SIGCHLD.  Actually install the signal
676         handlers for signals supported by Windows.  Don't override
677         term_ntproc as the handler for SIGABRT.
678         (sigaction): Rewrite to call sys_signal instead of duplicating its
679         code.
680         (sys_kill): Improve commentary.
682         * w32.c (term_ntproc): Accept (and ignore) one argument, for
683         consistency with a signature of a signal handler.  All callers
684         changed.
685         (init_ntproc): Accept an argument DUMPING.  If dumping, don't
686         install term_ntproc as a signal handler for SIGABRT, as that
687         should be done by the dumped Emacs.
689         * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
691         * w32select.c (term_w32select): Protect against repeated
692         invocation by setting clipboard_owner to NULL after calling
693         DestroyWindow.
695         * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
696         and term_ntproc to their modified signatures.
698         * character.c (char_string, string_char): Remove calls to
699         MAYBE_UNIFY_CHAR.  See the discussion starting at
700         http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
701         for the details.
703 2012-09-25  Chong Yidong  <cyd@gnu.org>
705         * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
707 2012-09-24  Stefan Monnier  <monnier@iro.umontreal.ca>
709         * bytecode.c (exec_byte_code): Signal an error instead of aborting,
710         when encountering an unknown bytecode.
712 2012-09-24  Paul Eggert  <eggert@cs.ucla.edu>
714         image.c, indent.c: Use bool for booleans.
715         * dispextern.h (struct image_type): Members valid_p, load, init
716         now return bool, not int.  All uses changed.
717         * image.c: Omit unnecessary static decls.
718         (x_create_bitmap_mask, x_build_heuristic_mask):
719         Return void, not int, since callers don't care about the return value.
720         (x_create_bitmap_mask, define_image_type, valid_image_p)
721         (struct image_keyword, parse_image_spec, image_spec_value)
722         (check_image_size, image_background)
723         (image_background_transparent, x_clear_image_1)
724         (postprocess_image, lookup_image, x_check_image_size)
725         (x_create_x_image_and_pixmap, xbm_image_p)
726         (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
727         (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
728         (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
729         (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
730         (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
731         (png_image_p, init_png_functions, png_load_body, png_load)
732         (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
733         (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
734         (init_gif_functions, gif_load, imagemagick_image_p)
735         (imagemagick_load_image, imagemagick_load, svg_image_p)
736         (init_svg_functions, svg_load, svg_load_image, gs_image_p)
737         (gs_load):
738         * nsimage.m (ns_load_image):
739         * nsterm.m (ns_defined_color):
740         * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
741         * xfns.c (x_defined_color):
742         * xterm.c (x_alloc_lighter_color_for_widget)
743         (x_alloc_nearest_color_1, x_alloc_nearest_color)
744         (x_alloc_lighter_color):
745         * indent.c (disptab_matches_widthtab, current_column)
746         (scan_for_column, string_display_width, indented_beyond_p)
747         (compute_motion, vmotion, Fvertical_motion):
748         Use bool for booleans.
750 2012-09-24  Chong Yidong  <cyd@gnu.org>
752         * chartab.c (Fset_char_table_default): Obsolete function removed.
754 2012-09-23  Paul Eggert  <eggert@cs.ucla.edu>
756         Move pid_t related decls out of lisp.h.
757         * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
758         (interruptible_wait_for_termination):
759         Move these decls from lisp.h to syswait.h, since they use pid_t.
760         Needed on FreeBSD; see Herbert J. Skuhra in
761         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
762         * callproc.c: Include syswait.h.
764         gnutls.c, gtkutil.c: Use bool for boolean.
765         * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
766         (emacs_gnutls_handle_error):
767         * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
768         (xg_hide_tooltip, xg_create_frame_widgets)
769         (create_dialog, xg_uses_old_file_dialog)
770         (xg_get_file_with_chooser, xg_get_file_with_selection)
771         (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
772         (xg_item_label_same_p, xg_update_menubar)
773         (xg_modify_menubar_widgets, xg_event_is_for_menubar)
774         (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
775         (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
776         (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
777         (update_frame_tool_bar, free_frame_tool_bar):
778         * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
779         * nsmenu.m (ns_update_menubar):
780         * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
781         * xfns.c (Fx_show_tip) [USE_GTK]:
782         Use bool for boolean.
783         * gtkutil.c (xg_update_frame_menubar):
784         * xmenu.c (update_frame_menubar):
785         Return void, not int, since caller ignores return value.
786         * gtkutil.c (xg_change_toolbar_position):
787         Return void, not 1.
789 2012-09-23  Juanma Barranquero  <lekktu@gmail.com>
791         * makefile.w32-in (BLOCKINPUT_H): Remove.
792         (SYSSIGNAL_H): New macro.
793         ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
794         ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
795         ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
796         ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
797         ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
798         ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
799         ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
800         ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
801         ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
802         ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
803         ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
804         ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
805         ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
806         ($(BLD)/w32xfns.$(O)): Update dependencies.
808 2012-09-23  Eli Zaretskii  <eliz@gnu.org>
810         * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
811         fatal_error_backtrace.
813         * w32proc.c (sys_kill): Undo last change: don't do anything when
814         invoked to deliver SIGABRT to our own process.  This is now
815         handled by emacs_raise.
817 2012-09-23  Juanma Barranquero  <lekktu@gmail.com>
819         * w32term.c (w32_read_socket): Remove leftover reference to
820         interrupt_input_pending.
822 2012-09-23  Paul Eggert  <eggert@cs.ucla.edu>
824         Do not use SA_NODEFER.
825         Problem reported by Dani Moncayo in
826         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
827         * alloc.c (die):
828         * sysdep.c (emacs_abort): Do not reset signal handler.
829         * emacs.c (terminate_due_to_signal): Reset signal handler here.
830         * sysdep.c (init_signals): Do not use SA_NODEFER.  It wasn't
831         wanted even on POSIXish hosts, and it doesn't work on Windows.
833 2012-09-23  Jan Djärv  <jan.h.d@swipnet.se>
835         * xterm.c (x_term_init): Call fixup_locale before and after calling
836         gtk_init (Bug#12392).
838 2012-09-23  Chong Yidong  <cyd@gnu.org>
840         * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
841         Vdynamic_library_alist.
843         * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
844         (Fgnutls_available_p): Caller changed.
846         * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
847         (Flibxml_parse_xml_region): Likewise.
849         * dispextern.h (struct image_type): Remove arg from init function.
851         * image.c (Finit_image_library, lookup_image_type)
852         (define_image_type): Remove now-unneeded second arg.
853         (init_xpm_functions, init_png_functions, init_jpeg_functions)
854         (init_tiff_functions, init_gif_functions, init_svg_functions):
855         Arglist and w32_delayed_load calling convention changed.
856         (gs_type): Remove init_gs_functions; there is no such function.
857         (valid_image_p, make_image): Fix caller to lookup_image_type.
859 2012-09-23  Paul Eggert  <eggert@cs.ucla.edu>
861         Simplify and avoid signal-handling races (Bug#12471).
862         * alloc.c (die):
863         * sysdep.c (emacs_abort) [HAVE_NTGUI]:
864         Avoid recursive loop if there's a fatal error in the function itself.
865         * atimer.c (pending_atimers):
866         * blockinput.h: Don't include "atimer.h"; no longer needed.
867         (interrupt_input_pending): Remove.  All uses removed.
868         pending_signals now counts both atimers and ordinary interrupts.
869         This is less racy than having three separate pending-signal flags.
870         (block_input, unblock_input, totally_unblock_input, unblock_input_to)
871         (input_blocked_p):
872         Rename from their upper-case counterparts BLOCK_INPUT,
873         UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
874         INPUT_BLOCKED_P, and turn into functions.  All uses changed.
875         This makes it easier to access volatile variables more accurately.
876         (BLOCK_INPUT_RESIGNAL): Remove.  All uses replaced by unblock_input ().
877         (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
878         that's more reliable if the code is buggy and sets
879         interrupt_input_blocked to a negative value.  All uses changed.
880         * atimer.c (deliver_alarm_signal):
881         Remove.  No need to deliver this to the parent; any thread can
882         handle this signal now.  All uses replaced by underlying handler.
883         * atimer.c (turn_on_atimers):
884         * dispnew.c (handle_window_change_signal):
885         * emacs.c (handle_danger_signal):
886         * keyboard.c (kbd_buffer_get_event):
887         Don't reestablish signal handler; not needed with sigaction.
888         * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
889         (UNBLOCK_INPUT_TO):
890         Rework to avoid unnecessary accesses to volatile variables.
891         (UNBLOCK_INPUT_TO): Now a function.
892         (totally_unblock_input, unblock_input): New decls.
893         * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
894         (init_data): Remove.  Necessary stuff now done in init_signal.
895         * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
896         * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
897         (fatal_error_code): Remove; no longer needed.
898         (terminate_due_to_signal): Rename from fatal_error_backtrace, since
899         it doesn't always backtrace.  All uses changed.  No need to reset
900         signal to default, since sigaction and/or die does that for us now.
901         Use emacs_raise (FOO), not kill (getpid (), FOO).
902         (main): Check more-accurately whether we're dumping.
903         Move fatal-error setup to sysdep.c
904         * floatfns.c: Do not include "syssignal.h"; no longer needed.
905         * gtkutil.c (xg_get_file_name, xg_get_font):
906         Remove no-longer-needed signal-mask manipulation.
907         * keyboard.c, process.c (POLL_FOR_INPUT):
908         Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
909         * keyboard.c (read_avail_input): Remove.
910         All uses replaced by gobble_input.
911         (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
912         (kbd_buffer_store_event_hold, gobble_input):
913         (record_asynch_buffer_change) [USABLE_SIGIO]:
914         (store_user_signal_events):
915         No need to mess with signal mask.
916         (gobble_input): If blocking input and there are terminals, simply
917         set pending_signals to 1 and return.  All hooks changed to not
918         worry about whether input is blocked.
919         (process_pending_signals): Clear pending_signals before processing
920         them, in case a signal comes in while we're processing.
921         By convention callers now test pending_signals before calling us.
922         (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
923         New functions, to support changes to blockinput.h.
924         (handle_input_available_signal): Now extern.
925         (reinvoke_input_signal): Remove.  All uses replaced by
926         handle_async_input.
927         (quit_count): Now volatile, since a signal handler uses it.
928         (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
929         All callers changed.  Block SIGINT only if not already blocked.
930         Clear sigmask reliably, even if Fsignal returns, which it can.
931         Omit unnecessary accesses to volatile var.
932         (quit_throw_to_read_char): No need to restore sigmask.
933         * keyboard.c (gobble_input, handle_user_signal):
934         * process.c (wait_reading_process_output):
935         Call signal-handling code rather than killing ourselves.
936         * lisp.h: Include <float.h>, for...
937         (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
938         (pending_signals): Now volatile.
939         (syms_of_data): Now const if IEEE floating point.
940         (handle_input_available_signal) [USABLE_SIGIO]:
941         (terminate_due_to_signal, record_child_status_change): New decls.
942         * process.c (create_process): Avoid disaster if memory is exhausted
943         while we're processing a vfork, by tightening the critical section
944         around the vfork.
945         (send_process_frame, process_sent_to, handle_pipe_signal)
946         (deliver_pipe_signal): Remove.  No longer needed, as Emacs now
947         ignores SIGPIPE.
948         (send_process): No need for setjmp/longjmp any more, since the
949         SIGPIPE stuff is now gone.  Instead, report an error if errno
950         is EPIPE.
951         (record_child_status_change): Now extern.  PID and W are now args.
952         Return void, not bool.  All callers changed.
953         * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
954         Remove.  All uses removed.  This bug should be fixed now in a
955         different way.
956         (wait_for_termination_1): Use waitpid rather than sigsuspend,
957         and record the child status change directly.  This avoids the
958         need to futz with the signal mask.
959         (process_fatal_action): Move here from emacs.c.
960         (emacs_sigaction_flags): New function, containing
961         much of what used to be in emacs_sigaction_init.
962         (emacs_sigaction_init): Use it.  Block nonfatal system signals that are
963         caught by emacs, to make races less likely.
964         (deliver_process_signal): Rename from handle_on_main_thread.
965         All uses changed.
966         (BACKTRACE_LIMIT_MAX): Now at top level.
967         (thread_backtrace_buffer, threadback_backtrace_pointers):
968         New static vars.
969         (deliver_thread_signal, deliver_fatal_thread_signal):
970         New functions, for more-accurate delivery of thread-specific signals.
971         (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
972         (deliver_arith_signal): Handle in this thread, not
973         in the main thread, since it's triggered by this thread.
974         (maybe_fatal_sig): New function.
975         (init_signals): New arg DUMPING so that we can be more accurate
976         about whether we're dumping.  Caller changed.
977         Treat thread-specific signals differently from process-general signals.
978         Block all signals while handling fatal error; that's safer.
979         xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
980         on IEEE hosts.
981         When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
982         Ignore SIGPIPE unless batch.
983         (emacs_backtrace): Output backtrace for the appropriate thread,
984         which is not necessarily the main thread.
985         * syssignal.h: Include <stdbool.h>.
986         (emacs_raise): New macro.
987         * xterm.c (x_connection_signal): Remove; no longer needed
988         now that we use sigaction.
989         (x_connection_closed): No need to mess with sigmask now.
990         (x_initialize): No need to reset SIGPIPE handler here, since
991         init_signals does this for us now.
993 2012-09-23  Jan Djärv  <jan.h.d@swipnet.se>
995         * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
996         background rect may be larger (Bug#12245).
998 2012-09-23  Chong Yidong  <cyd@gnu.org>
1000         * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
1002 2012-09-22  Paul Eggert  <eggert@cs.ucla.edu>
1004         * .gdbinit: Just stop at fatal_error_backtrace.
1005         See Stefan Monnier's request in
1006         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
1007         Remove no-longer-used query of system type.
1009 2012-09-22  Chong Yidong  <cyd@gnu.org>
1011         * search.c (Freplace_match): Doc fix (Bug#12325).
1013         * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
1015         * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
1016         (Fline_end_position): Doc fix.
1018         * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
1020 2012-09-22  Chong Yidong  <cyd@gnu.org>
1022         * dispextern.h (struct image_type): Add new slot, storing a type
1023         initialization function.
1025         * image.c (define_image_type): Call the image initializer function
1026         if it is defined.  Arguments and return value changed.
1027         (valid_image_p, make_image): Callers changed.
1028         (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
1029         (gif_type, imagemagick_type, svg_type, gs_type):
1030         Add initialization functions.
1031         (Finit_image_library): Call lookup_image_type.
1032         (CHECK_LIB_AVAILABLE): Macro deleted.
1033         (lookup_image_type): Call define_image_type here, rather than via
1034         Finit_image_library, and without using CHECK_LIB_AVAILABLE.
1035         (syms_of_image): Move define_image_type calls for xbm_type and
1036         pbm_type to lookup_image_type.
1038 2012-09-22  Eli Zaretskii  <eliz@gnu.org>
1040         * keyboard.c (timer_check_2): Move calculation of 'timers' and
1041         'idle_timers' from here ...
1042         (timer_check): ... to here.  Use Fcopy_sequence to copy the timer
1043         lists, to avoid infloops when the timer does something stupid,
1044         like reinvoke itself with the same or smaller time-out.
1045         (Bug#12447)
1047 2012-09-22  Martin Rudalics  <rudalics@gmx.at>
1049         * window.c (Fsplit_window_internal): Handle only Qt value of
1050         Vwindow_combination_limit separately.
1051         (Qtemp_buffer_resize): New symbol.
1052         (Vwindow_combination_limit): New default value.
1053         Rewrite doc-string.
1055 2012-09-22  Eli Zaretskii  <eliz@gnu.org>
1057         * xdisp.c (next_overlay_string): Initialize it->end_charpos for
1058         the new overlay string.  (Bug#10159)
1060 2012-09-22  Paul Eggert  <eggert@cs.ucla.edu>
1062         * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
1063         or that fprintf is async-signal-safe.  POSIX doesn't require
1064         either assumption.
1066 2012-09-22  Chong Yidong  <cyd@gnu.org>
1068         * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
1069         (Bug#8207).
1071 2012-09-22  Kenichi Handa  <handa@gnu.org>
1073         * composite.c (composition_reseat_it): Handle the case that a
1074         grapheme cluster is not covered by a single font (Bug#12352).
1076 2012-09-21  Chong Yidong  <cyd@gnu.org>
1078         * image.c (define_image_type): Avoid adding duplicate types to
1079         image_types (Bug#12463).  Suggested by Jörg Walter.
1081 2012-09-21  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
1083         * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
1084         (print_load_command_name): Add case LC_DATA_IN_CODE.
1085         (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
1087 2012-09-21  Glenn Morris  <rgm@gnu.org>
1089         * eval.c (Frun_hook_with_args_until_success)
1090         (Frun_hook_with_args_until_failure): Doc fixes.  (Bug#12393)
1092 2012-09-21  Andreas Schwab  <schwab@linux-m68k.org>
1094         * fileio.c (Ffile_selinux_context): Only call freecon when
1095         lgetfilecon succeeded.
1096         (Fset_file_selinux_context): Likewise.  (Bug#12444)
1098 2012-09-21  Eli Zaretskii  <eliz@gnu.org>
1100         * xdisp.c (try_window_reusing_current_matrix): Under bidi
1101         reordering, locate the cursor by calling set_cursor_from_row; if
1102         that fails, clear the desired glyph matrix before returning a
1103         failure indication to the caller.  Fixes leaving garbled display
1104         when fast scrolling with a down-key.  (Bug#12403)
1105         (compute_stop_pos_backwards): Fix a typo that caused crashes while
1106         scrolling through multibyte text.
1108 2012-09-20  Stefan Monnier  <monnier@iro.umontreal.ca>
1110         * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1111         calling mark_vectorlike since that's the one that marks the window.
1112         (mark_discard_killed_buffers): Mark the final cdr.
1113         * window.h (struct window): Move prev/next_buffers to the
1114         non-standard fields.
1115         * window.c (make_window): Initialize prev/next_buffers manually.
1117 2012-09-20  Paul Eggert  <eggert@cs.ucla.edu>
1119         Omit unused arg EXPECTED from socket hooks.
1120         * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1121         * nsterm.m (ns_term_init):
1122         * termhooks.h (struct terminal.read_socket_hook):
1123         * w32inevt.c (w32_console_read_socket):
1124         * w32term.c (w32_read_socket):
1125         * xterm.c (XTread_socket):
1126         Omit unused arg EXPECTED.  All callers changed.
1127         (store_user_signal_events): Return void, not int, since callers no
1128         longer care about the return value.  All uses changed.
1130 2012-09-20  Juanma Barranquero  <lekktu@gmail.com>
1132         * w32gui.h (XParseGeometry): Do not declare.
1134 2012-09-19  Paul Eggert  <eggert@cs.ucla.edu>
1136         * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1137         Ignore 'expected'. See Eli Zaretskii in
1138         <http://bugs.gnu.org/12471#8> (last line).
1140         * frame.c (read_integer): Remove.  All uses replaced by strtol/strtoul.
1141         (XParseGeometry): Now static.  Substitute extremal values for
1142         values that are out of range.
1144 2012-09-19  Jan Djärv  <jan.h.d@swipnet.se>
1146         * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1148         * nsfns.m (XParseGeometry): Remove.
1149         (Fx_create_frame): Call x_set_offset to correctly interpret
1150         top_pos in geometry.
1152         * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
1153         (Fx_parse_geometry): If there is a space in string, call
1154         Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1156 2012-09-17  Eli Zaretskii  <eliz@gnu.org>
1158         * search.c (scan_buffer): Use character positions in calls to
1159         region_cache_forward and region_cache_backward, not byte
1160         positions.  (Bug#12196)
1162         * w32term.c (w32_read_socket): Set pending_signals to 1, like
1163         xterm.c does.  Reported by Daniel Colascione <dancol@dancol.org>.
1165         * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1166         __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1167         emacs_blocked_malloc, now deleted.
1169 2012-09-17  Paul Eggert  <eggert@cs.ucla.edu>
1171         Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1172         The workaround was for improving performance on Solaris 2.4, but
1173         is getting in the way now.  Emacs will still work if someone is
1174         still running Solaris 2.4 in a museum somewhere; Sun dropped
1175         support for Solaris 2.4 in 2003.
1176         * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1177         * process.c (create_process) [HAVE_WORKING_VFORK]:
1178         Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1179         since Emacs no longer uses vfork on that platform.
1181 2012-09-17  Glenn Morris  <rgm@gnu.org>
1183         * emacs.c: Use COPYRIGHT.
1185 2012-09-16  Paul Eggert  <eggert@cs.ucla.edu>
1187         Remove configure's --without-sync-input option (Bug#12450).
1188         When auditing signal-handling in preparation for cleaning it up,
1189         I found that SYNC_INPUT has race conditions and would be a real
1190         pain to fix.  Since it's an undocumented and deprecated
1191         configure-time option, now seems like a good time to remove it.
1192         Also see <http://bugs.gnu.org/11080#16>.
1193         * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1194         (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1195         (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1196         (malloc_hysteresis):
1197         (check_depth) [XMALLOC_OVERRUN_CHECK]:
1198         (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1199         (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1200         (dont_register_blocks, bytes_used_when_reconsidered)
1201         (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1202         (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1203         [!SYSTEM_MALLOC && !SYNC_INPUT]:
1204         Remove. All uses removed.
1205         (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1206         implementation, one that depends on whether the new macro
1207         XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1208         is defined.
1209         * atimer.c (run_timers, handle_alarm_signal):
1210         * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1211         (handle_async_input, process_pending_signals)
1212         (handle_input_available_signal, init_keyboard):
1213         * nsterm.m (ns_read_socket):
1214         * process.c (wait_reading_process_output):
1215         * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1216         * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1217         (emacs_write):
1218         * xterm.c (XTread_socket):
1219         Assume SYNC_INPUT.
1220         * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1221         * eval.c (handling_signal): Remove.  All uses removed.
1222         * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1223         All uses replaced with the SYNC_INPUT version.
1224         (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1225         Remove decls.
1226         * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1227         Now static.
1229         * font.c (Ffont_shape_gstring): Remove unused local.
1231 2012-09-16  Glenn Morris  <rgm@gnu.org>
1233         * Makefile.in (clean): No longer run nextstep's clean.
1235         * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1236         (ns_frag): Remove.
1237         (ns-app): Move here from ns.mk, and simplify.
1238         (clean): Simplify nextstep entry.
1239         * ns.mk: Remove file.
1241 2012-09-17  Kenichi Handa  <handa@gnu.org>
1243         * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1244         not covert the last few charactes.
1246 2012-09-16  Kenichi Handa  <handa@gnu.org>
1248         * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1249         here, but just check the validity of glyphs in the glyph-string.
1251 2012-09-16  Martin Rudalics  <rudalics@gmx.at>
1253         * window.c (Fwindow_parameter, Fset_window_parameter):
1254         Accept any window as argument (Bug#12452).
1256 2012-09-16  Jan Djärv  <jan.h.d@swipnet.se>
1258         * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1259         to ns_term_init to avoid memory leak.
1261         * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1262         explicit retain/release.
1263         (ns_term_init): Only allow one display.  Initialize outerpool and
1264         ns_*_types.
1266 2012-09-15  Paul Eggert  <eggert@cs.ucla.edu>
1268         Port _setjmp fix to POSIXish hosts as well as Microsoft.
1269         * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1270         it's needed on POSIXish hosts that lack _setjmp.  Attempt to solve
1271         the Microsoft problem in a different way, by altering ../nt/config.nt.
1273 2012-09-15  Eli Zaretskii  <eliz@gnu.org>
1275         * w32xfns.c:
1276         * w32uniscribe.c:
1277         * w32term.c:
1278         * w32select.c:
1279         * w32reg.c:
1280         * w32proc.c:
1281         * w32menu.c:
1282         * w32inevt.c:
1283         * w32heap.c:
1284         * w32font.c:
1285         * w32fns.c:
1286         * w32console.c:
1287         * w32.c:
1288         * w16select.c: Remove inclusion of setjmp.h, as it is now included
1289         by lisp.h.  This completes removal of setjmp.h inclusion
1290         erroneously announced in the previous commit.  (Bug#12446)
1292         * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1293         more accurate.
1295         * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1296         not defined as a macro.  The latter happens on MS-Windows.
1297         (Bug#12446)
1299 2012-09-15  Paul Eggert  <eggert@cs.ucla.edu>
1301         Port better to POSIX hosts lacking _setjmp (Bug#12446).
1302         * lisp.h: Include <setjmp.h> here, since we use its symbols here.
1303         Some instances of '#include <setjmp.h>' removed, if the
1304         only reason for the instance was because "lisp.h" was included.
1305         (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1306         Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1307         and _longjmp with the new symbols.  Emacs already uses _setjmp if
1308         available, so this change affects only POSIXish hosts that have
1309         sigsetjmp but not _setjmp, such as some versions of Solaris and
1310         Unixware.  (Also, POSIX-2008 marks _setjmp as obsolescent.)
1311         * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1312         (png_load_body) [HAVE_PNG]:
1313         (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1314         (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1315         Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1316         since PNG requires jmp_buf.  This is the only exception to the
1317         general rule that we now use sys_setjmp and sys_longjmp.
1318         This exception is OK since this code does not change the signal
1319         mask or longjmp out of a signal handler.
1321 2012-09-14  Paul Eggert  <eggert@cs.ucla.edu>
1323         * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1324         Include "syssignal.h", for 'main_thread'.
1326 2012-09-14  Dmitry Antipov  <dmantipov@yandex.ru>
1328         Avoid out-of-range marker position (Bug#12426).
1329         * insdel.c (replace_range, replace_range_2):
1330         Adjust markers before overlays, as suggested by comments.
1331         (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1332         Remove redundant check before calling offset_intervals.
1334 2012-09-14  Martin Rudalics  <rudalics@gmx.at>
1336         * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1337         current buffer (Bug#12387).
1339 2012-09-14  Juanma Barranquero  <lekktu@gmail.com>
1341         * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1343 2012-09-13  Paul Eggert  <eggert@cs.ucla.edu>
1345         Use a more backwards-compatible timer format (Bug#12430).
1346         * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1347         vector element, not from the 4th, since PSECS is now at the end.
1348         (Fcurrent_idle_time): Doc fix.
1350 2012-09-13  Dmitry Antipov  <dmantipov@yandex.ru>
1352         Function to mark objects and remove killed buffers at once.
1353         * alloc.c (discard_killed_buffers): Rename to ...
1354         (mark_discard_killed buffers) ... new name.  Add marking
1355         of remaining objects.  Fix comment.  Adjust users.
1356         (mark_object): Do not touch frame buffer lists here.
1357         * frame.c (delete_frame): Reset frame buffer lists here.
1359 2012-09-13  Paul Eggert  <eggert@cs.ucla.edu>
1361         Better workaround for GNOME bug when --enable-gcc-warnings.
1362         * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1363         Instead, disable -Wunused-local-typedefs.  See Dmitry Antipov in
1364         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1366         Simplify SIGIO usage (Bug#12408).
1367         The code that dealt with SIGIO was crufty and confusing, e.g., it
1368         played tricks like "#undef SIGIO" but these tricks were not used
1369         consistently.  Simplify mostly by not #undeffing standard symbols,
1370         e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1371         or not as we please) rather than "defined SIGIO" (standard symbol
1372         that we probably shouldn't #undef).
1373         * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1374         Modules that need it can include it.
1375         [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1376         * dispextern.h (ignore_sigio): New decl.
1377         * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1378         unconditionally, since it's now a no-op if !USABLE_SIGIO.
1379         * emacs.c (shut_down_emacs):
1380         * keyboard.c (kbd_buffer_store_event_hold):
1381         Use ignore_sigio rather than invoking 'signal' directly.
1382         * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1383         for FIONREAD.
1384         (FIONREAD, SIGIO): Do not #undef.
1385         (tty_read_avail_input): Use #error rather than a syntax error.
1386         * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1387         for I_PIPE, used by SETUP_SLAVE_PTY.
1388         (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1389         * sysdep.c (croak): Remove; no longer needed.  This bit of
1390         temporary code, with Fred N. Fish's comment that it's temporary,
1391         has been in Emacs since at least 1992!
1392         (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1393         Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1394         * syssignal.h (croak): Remove decl.
1395         (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1396         * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1397         now that we're termios-only.
1398         (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1399         * term.c (dissociate_if_controlling_tty): Use #error rather than
1400         a run-time error.
1402         Work around GCC and GNOME bugs when --enable-gcc-warnings.
1403         * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1404         to work around GNOME bug 683906.
1405         * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1406         (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1407         This works around GCC bug 54561.
1409 2012-09-12  Paul Eggert  <eggert@cs.ucla.edu>
1411         More fixes for 'volatile' and setjmp/longjmp.
1412         * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1413         * image.c (struct png_load_context) [HAVE_PNG]: New type.
1414         (png_load_body) [HAVE_PNG]:
1415         (jpeg_load_body) [HAVE_JPEG]:
1416         New function, with most of the old parent function's body.
1417         (png_load) [HAVE_PNG]:
1418         (jpeg_load) [HAVE_JPEG]:
1419         Invoke the new function, to avoid longjmp munging our locals.
1420         (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1421         (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1422         longjmp is passed 2, as the C standard doesn't guarantee this.
1423         Instead, store the failure code into mgr->failure_code.
1425 2012-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
1427         * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1428         (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1429         (syms_of_keyboard): Remove support for unread-command-char.
1431 2012-09-12  Eli Zaretskii  <eliz@gnu.org>
1433         * w32proc.c (sys_kill): If PID is our process ID and the signal is
1434         SIGABRT, call emacs_abort.  Avoids silently exiting upon assertion
1435         violation.  (Bug#12426)
1437 2012-09-12  Paul Eggert  <eggert@cs.ucla.edu>
1439         * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1441 2012-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
1443         * eval.c: Add `inhibit-debugger'.
1444         (Qinhibit_debugger): New symbol.
1445         (call_debugger): Bind it instead of Qdebug_on_error.
1446         (maybe_call_debugger): Test Vinhibit_debugger.
1447         (syms_of_eval): Define inhibit-debugger.
1448         * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1449         (syms_of_xdisp): Remove inhibit-debug-on-message.
1451 2012-09-11  Paul Eggert  <eggert@cs.ucla.edu>
1453         Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1454         If a nonvolatile local variable is written before a _longjmp to
1455         the frame containing the variable, and is read after the _longjmp,
1456         the value read is indeterminate.  Some local variables of type
1457         'struct handler' and 'struct catchtag' are used in this way, so
1458         mark each of their slots as volatile if the slot can be set before
1459         _longjmp and read afterwards.
1460         * lisp.h (struct handler): var and chosen_clause are now volatile.
1461         (struct catchtag): val, next, and pdlcount are now volatile.
1463         * bidi.c (bidi_push_it, bidi_pop_it):
1464         * fns.c (copy_hash_table):
1465         * image.c (define_image_type):
1466         * keyboard.c (kbd_buffer_store_event_hold):
1467         * process.c (Fprocess_send_eof):
1468         * xfaces.c (x_create_gc) [HAVE_NS]:
1469         * xgselect.c (xg_select):
1470         Prefer assignment to memcpy when either will do.
1472         * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1473         Use pointer-to-a-pointer to simplify and avoid a NILP check each
1474         time an item is removed.  No need to mark this function 'inline';
1475         the compiler knows better than we do.
1477 2012-09-11  Jan Djärv  <jan.h.d@swipnet.se>
1479         * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1480         (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1481         to change_frame_size (Bug#12388).
1482         (windowDidResize:): Pass YES to updateFrameSize.
1484         * nsterm.h: Add delay parameter to updateFrameSize.
1486 2012-09-11  Dmitry Antipov  <dmantipov@yandex.ru>
1488         Discard killed buffers from deleted window and frame objects.
1489         This reduces an amount of references to killed buffers and
1490         helps GC to reclaim them faster.
1491         * alloc.c (discard_killed_buffers): New function.
1492         (mark_object): Use it for deleted windows and frames.
1493         (mark_object): If symbol's value is set up for a killed buffer
1494         or deleted frame, restore it's global binding.
1495         * data.c (swap_in_global_binding): Add GC notice.
1496         (swap_in_symval_forwarding): Use convenient set_blv_where.
1497         * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1498         * window.h: ... to here.
1500 2012-09-11  Dmitry Antipov  <dmantipov@yandex.ru>
1502         Convenient macro to check whether the buffer is live.
1503         * buffer.h (BUFFER_LIVE_P): New macro.
1504         * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1505         * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1507 2012-09-11  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
1509         * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1510         composition cases (Bug#12364).
1512         * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1513         overhang of succeeding glyphs overlapping box cursor.
1515         * w32term.c (x_draw_glyph_string): Likewise.
1517 2012-09-11  Paul Eggert  <eggert@cs.ucla.edu>
1519         Simplify, document, and port floating-point (Bug#12381).
1520         The porting part of this patch fixes bugs on non-IEEE platforms
1521         with frexp, ldexp, logb.
1522         * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1523         Now static.
1524         * floatfns.c: Simplify discussion of functions that Emacs doesn't
1525         support, by removing commented-out code and briefly listing the
1526         C89 functions excluded.  The commented-out stuff was confusing
1527         maintenance, e.g., we thought we needed cbrt but it was commented out.
1528         (logb): Remove decl; no longer needed.
1529         (isfinite): New macro, if not already supplied.
1530         (isnan): Don't replace any existing macro.
1531         (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1532         are present on all C89 platforms.
1533         (Ffrexp): Do not special-case zero, as frexp does the right thing
1534         for that case.
1535         (Flogb): Do not use logb, as it doesn't have the desired meaning
1536         on hosts that use non-base-2 floating point.  Instead, stick with
1537         frexp, which is C89 anyway.  Do not pass an infinity or a NaN to
1538         frexp, to avoid getting an unspecified result.
1540         * xdisp.c (Qinhibit_debug_on_message): Now static.
1542 2012-09-10  Jan Djärv  <jan.h.d@swipnet.se>
1544         * nsterm.m (ns_update_begin): Set clip path to whole view by using
1545         NSBezierPath (Bug#12131).
1547 2012-09-10  Chong Yidong  <cyd@gnu.org>
1549         * fns.c (Fdelq, Fdelete): Doc fix.
1551 2012-09-10  Paul Eggert  <eggert@cs.ucla.edu>
1553         * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1554         (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1556 2012-09-09  Stefan Monnier  <monnier@iro.umontreal.ca>
1558         * lisp.h (make_lisp_ptr): New macro to replace XSET.
1559         (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1560         Use it.
1562 2012-09-09  Eli Zaretskii  <eliz@gnu.org>
1564         * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1565         left fringe if the window has a left margin.  This avoids leaving
1566         traces of the cursor because its leftmost pixel is not drawn over.
1568         * dispnew.c (update_window_line): When the left margin area of a
1569         screen line is updated, set the redraw_fringe_bitmaps_p flag of
1570         that screen line.  (Bug#12277)
1572 2012-09-09  Paul Eggert  <eggert@cs.ucla.edu>
1574         Assume C89 or later for math functions (Bug#12381).
1575         This simplifies the code, and makes it a bit smaller and faster,
1576         and (most important) makes it easier to clean up signal handling
1577         since we can stop worring about floating-point exceptions in
1578         library code.  That was a problem before C89, but the problem
1579         went away many years ago on all practical Emacs targets.
1580         * data.c, image.c, lread.c, print.c:
1581         Don't include <math.h>; no longer needed.
1582         * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1583         might be autoconfigured, as that never happens.
1584         * data.c (fmod):
1585         * doprnt.c (DBL_MAX_10_EXP):
1586         * print.c (DBL_DIG):
1587         Remove.  C89 or later always defines these.
1588         * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1589         (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1590         (arith_error, domain_error, domain_error2):
1591         Remove all this pre-C89 cruft.  Do not include <errno.h> as that's
1592         no longer needed -- we simply return what C returns.  All uses removed.
1593         (IN_FLOAT, IN_FLOAT2): Remove.  All uses replaced with
1594         the wrapped code.
1595         (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1596         Remove.  All uses expanded, as these macros are no longer used
1597         more than once and are now more trouble than they're worth.
1598         (Ftan): Use tan, not sin / cos.
1599         (Flogb): Assume C89 frexp.
1600         (fmod_float): Assume C89 fmod.
1601         (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1602         (init_floatfns): Remove.  All uses removed.
1604 2012-09-08  Jan Djärv  <jan.h.d@swipnet.se>
1606         * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1607         compositeToPoint for OSX < 10.6 (Bug#12390).
1609 2012-09-08  Paul Eggert  <eggert@cs.ucla.edu>
1611         * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1612         This produces more-accurate results.
1614 2012-09-08  Jan Djärv  <jan.h.d@swipnet.se>
1616         * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1617         changes (Bug#12088).
1619 2012-09-08  Chong Yidong  <cyd@gnu.org>
1621         * syntax.c (Fstring_to_syntax): Doc fix.
1623 2012-09-08  Jan Djärv  <jan.h.d@swipnet.se>
1625         * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1626         in the internal border.
1627         (x_set_window_size): Remove static variables and their usage.
1628         (ns_redraw_scroll_bars): Fix NSTRACE arg.
1629         (ns_after_update_window_line, ns_draw_fringe_bitmap):
1630         Remove fringe/internal border adjustment (Bug#11052).
1631         (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1632         (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1633         (ns_fix_rect_ibw): Remove.
1634         (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1635         (ns_dumpglyphs_box_or_relief): Ditto.
1636         (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1637         adjustment.
1638         (ns_dumpglyphs_image): Ditto.
1639         (ns_dumpglyphs_stretch): Fix coding style.  Remove fringe/internal
1640         border adjustment.
1641         (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1642         their usage.  Add fringe_extended_p and its use as in other terms.
1643         (ns_judge_scroll_bars): Code style fix.  Call updateFrameSize if
1644         scroll bar was removed.
1645         (updateFrameSize): New function.
1646         (windowDidResize): Move code to updateFrameSize and call it.
1648         * nsterm.h (EmacsView): Add updateFrameSize.
1650 2012-09-07  Chong Yidong  <cyd@gnu.org>
1652         * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1654         * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1656 2012-09-07  Paul Eggert  <eggert@cs.ucla.edu>
1658         More signal-handler cleanup (Bug#12327).
1659         * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1660         Problem introduced when merging patches.  Noted by Eli Zaretskii in
1661         <http://bugs.gnu.org/12327#67>.
1662         * floatfns.c: Comment fix.
1663         * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1664         SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1665         and anyway the declaration is harmless even if SIGDANGER is not defined.
1666         * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1667         defined BROKEN_FIONREAD).  systty.h formerly did this, but other
1668         source files not surprisingly expected syssignal.h to define, or
1669         not define, SIGIO, and it's cleaner to do it that way, for consistency.
1670         Include <sys/ioctl.h>, for FIONREAD.
1671         * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1672         This eliminates a problem whereby other files mysteriously had
1673         to include "syssignal.h" before including "systty.h" if they
1674         wanted to use "#ifdef SIGIO".
1676 2012-09-07  Eli Zaretskii  <eliz@gnu.org>
1678         * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1680         * w32.c (sigemptyset): Empty the set.
1681         (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1683         * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1685 2012-09-07  Dmitry Antipov  <dmantipov@yandex.ru>
1687         * alloc.c (mark_buffer): Revert unsafe marking optimization.
1688         (mark_object): Likewise for frame objects.
1690 2012-09-07  Paul Eggert  <eggert@cs.ucla.edu>
1692         * syssignal.h (handle_on_main_thread): Always declare,
1693         even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1694         This ports to platforms without HAVE_PTHREAD.
1696 2012-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1698         Signal-handler cleanup (Bug#12327).
1699         Emacs's signal handlers were written in the old 4.2BSD style with
1700         sigblock and sigmask and so forth, and this led to some
1701         inefficiencies and confusion.  Rewrite these to use
1702         pthread_sigmask etc. without copying signal sets around.  Also,
1703         get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1704         'signal', and instead use functions that do not attempt to take
1705         over the system name space.  This patch causes Emacs's text
1706         segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1707         * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1708         Do not include <signal.h> or "syssignal.h", as these
1709         modules do not use signals.
1710         * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1711         * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1712         Do not include <signal.h>, as "syssignal.h" does that for us now.
1713         * atimer.c (sigmask_atimers): New function.
1714         (block_atimers, unblock_atimers): New functions,
1715         replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1716         All uses replaced.
1717         * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1718         no longer needed here.
1719         * emacs.c (main): Inspect existing signal handler with sigaction,
1720         so that there's no need to block and unblock SIGHUP.
1721         * sysdep.c (struct save_signal): New member 'action', replacing
1722         old member 'handler'.
1723         (save_signal_handlers, restore_signal_handlers):
1724         Use sigaction instead of 'signal' to save and restore.
1725         (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1726         New function.  All users of 'signal' modified to use set_sighandler
1727         if they're writeonly, and to use sys_signal if they're read+write.
1728         (emacs_sigaction_init, forwarded_signal): New functions.
1729         (sys_signal): Remove.  All uses replaced by calls to sigaction
1730         and emacs_sigaction_init, or by direct calls to 'signal'.
1731         (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1732         (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1733         all uses replaced by pthread_sigmask etc. calls.
1734         * syssignal.h: Include <signal.h>.
1735         (emacs_sigaction_init, forwarded_signal): New decls.
1736         (SIGMASKTYPE): Remove.  All uses replaced by its definiens, sigset_t.
1737         (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1738         (sigmask, sys_sigmask): Remove; no longer needed.
1739         (sigpause): Remove.  All uses replaced by its definiens, sigsuspend.
1740         (sigblock, sigunblock, sigfree):
1741         (sigsetmask) [!defined sigsetmask]:
1742         Remove.  All uses replaced by pthread_sigmask.
1743         (signal): Remove.  Its remaining uses (with SIG_DFL and SIG_IGN)
1744         no longer need to be replaced, and its typical old uses
1745         are now done via emacs_sigaction_init and sigaction.
1746         (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1747         (sys_sigdel): Remove; unused.
1748         (NSIG): Remove a FIXME; the code's fine.  Remove an unnecessary ifdef.
1750 2012-09-06  Eli Zaretskii  <eliz@gnu.org>
1752         * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1753         SIGCHLD handling on systems that don't have WNOHANG.  (Bug#12327)
1755 2012-09-06  Dmitry Antipov  <dmantipov@yandex.ru>
1757         Explicitly mark buffer_defaults and buffer_local_symbols.
1758         * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1759         mark_local_symbols here.
1760         (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1761         since special buffers aren't marked here any more.
1762         (allocate_buffer): Chain new buffer with all_buffers here...
1763         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1764         not here.
1765         (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1766         (syms_of_buffer): Remove staticpro of the above.
1767         (init_buffer_once): Set names for buffer_defaults and
1768         buffer_local_symbols.
1770 2012-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1772         Use bool for booleans in font-related modules.
1773         * font.c (font_intern_prop, font_style_to_value)
1774         (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1775         (generate_otf_features, font_check_otf_features, font_check_otf)
1776         (font_match_p, font_list_entities, font_at):
1777         * fontset.c (fontset_id_valid_p, reorder_font_vector
1778         (fontset_find_font, Fset_fontset_font)
1779         (face_suitable_for_char_p) [0]:
1780         * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1781         (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1782         (m17n_flt_initialized, ftfont_shape_by_flt):
1783         * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1784         * nsfont.m (nsfont_draw):
1785         * w32font.c (w32font_draw):
1786         * w32term.c (x_draw_glyphless_glyph_string_foreground):
1787         Use bool for booleans.
1788         * font.h: Adjust to above API changes.
1789         (struct font, struct font_driver, struct font_driver_list):
1790         Use bool for booleans.
1791         (struct font): Remove useless member encoding_type.
1792         All users removed.
1793         * fontset.c, xftfont.c: Omit unnecessary static decls.
1795 2012-09-06  Dmitry Antipov  <dmantipov@yandex.ru>
1797         * alloc.c (mark_object): Revert window marking code
1798         since it's unsafe for the Fset_window_configuration.
1800 2012-09-05  Paul Eggert  <eggert@cs.ucla.edu>
1802         Fix race conditions with signal handlers and errno (Bug#12327).
1803         Be more systematic about preserving errno whenever a signal
1804         handler returns, even if it's not in the main thread.  Do this by
1805         renaming signal handlers to distinguish between signal delivery
1806         and signal handling.  All uses changed.
1807         * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1808         * data.c (deliver_arith_signal): Rename from arith_error.
1809         * dispnew.c (deliver_window_change_signal): Rename from
1810         window_change_signal.
1811         * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1812         (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1813         * keyboard.c (deliver_input_available_signal): Rename from
1814         input_available_signal.
1815         (deliver_user_signal): Rename from handle_user_signal.
1816         (deliver_interrupt_signal): Rename from interrupt_signal.
1817         * process.c (deliver_pipe_signal): Rename from send_process_trap.
1818         (deliver_child_signal): Rename from sigchld_handler.
1819         * atimer.c (handle_alarm_signal):
1820         * data.c (handle_arith_signal):
1821         * dispnew.c (handle_window_change_signal):
1822         * emacs.c (handle_fatal_signal, handle_danger_signal):
1823         * keyboard.c (handle_input_available_signal):
1824         * keyboard.c (handle_user_signal, handle_interrupt_signal):
1825         * process.c (handle_pipe_signal, handle_child_signal):
1826         New functions, with the actual signal-handling code taken from the
1827         original respective signal handlers, sans the sporadic attempts to
1828         preserve errno, since that's now done by handle_on_main_thread.
1829         * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1830         * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1831         * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1832         Move to sysdep.c.
1833         (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1834         Move initialization of main_thread to sysdep.c's init_signals.
1835         * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1836         our usage, and simplifies the mainline code.
1837         (record_child_status_change): New static function, as a helper
1838         for handle_child_signal, and with most of the old child handler's
1839         contents.
1840         (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1841         (handle_child_signal): Use the above.
1842         * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1843         Moved here from emacs.c.
1844         (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1845         code moved here from emacs.c's main function.
1846         * sysdep.c, syssignal.h (handle_on_main_thread): New function,
1847         replacing the old SIGNAL_THREAD_CHECK.  All uses changed.
1848         This lets callers save and restore errno properly.
1850 2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
1852         Remove redundant or unused things here and there.
1853         * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1854         * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1855         * editfns.c (Fcompare_buffer_substrings): Likewise.
1856         * frame.h (struct terminal, struct font_driver_list):
1857         Remove redundant declarations.
1858         * window.h (Qleft, Qright): Likewise.
1860 2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
1862         Do not mark objects from deleted buffers, windows and frames.
1863         * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1864         (mark_object): Likewise for windows and frames.
1866 2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
1868         * alloc.c (valid_lisp_object_p): Treat killed buffers,
1869         buffer_defaults and buffer_local_symbols as valid objects.
1870         Return special value to denote them.
1872 2012-09-05  Paul Eggert  <eggert@cs.ucla.edu>
1874         * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1875         * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1876         (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1877         (file_name_absolute_p, Fsubstitute_in_file_name):
1878         (check_executable, check_writable, Ffile_accessible_directory_p)
1879         (Fset_file_selinux_context, Fdefault_file_modes)
1880         (Finsert_file_contents, choose_write_coding_system)
1881         (Fwrite_region, build_annotations, a_write, e_write)
1882         (Fdo_auto_save):
1883         * filelock.c (boot_time_initialized, get_boot_time)
1884         (get_boot_time_1, lock_file_1, within_one_second):
1885         * floatfns.c (in_float):
1886         * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1887         (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1888         (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1889         * lisp.h (struct Lisp_Hash_Table.cmpfn):
1890         * window.c (compare_window_configurations):
1891         Use bool for booleans.
1892         * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1893         (Fdefault_file_modes): Now mode_t, not int, for modes.
1894         (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1895         (internal_delete_file): Now returns void, not a (boolean) int,
1896         since nobody was looking at the return value.
1897         * lisp.h, window.h: Adjust to above API changes.
1899         * xdisp.c (set_message): Simplify and reindent last change.
1901 2012-09-05  Juanma Barranquero  <lekktu@gmail.com>
1903         * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1905 2012-09-04  Lars Ingebrigtsen  <larsi@gnus.org>
1907         * eval.c (call_debugger): Make the function non-static so that we
1908         can call it from set_message.
1910         * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1911         (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1913 2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
1915         Give more-useful info on a fatal error (Bug#12328).
1916         * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1917         (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1918         of doing the work ourselves.
1919         * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1920         do most of the work.
1921         (fatal_error_backtrace): New function, taken from the guts
1922         of the old fatal_error_signal, but with a new option to output
1923         a backtrace.
1924         (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1925         info about the signal than just its number.
1926         * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1927         * sysdep.c: Include <execinfo.h>
1928         (emacs_backtrace): New function, taken partly from the previous
1929         code of the 'die' function.
1930         (emacs_abort): Call fatal_error_backtrace rather than abort.
1932 2012-09-04  Stefan Monnier  <monnier@iro.umontreal.ca>
1934         * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1935         eager (load-time) macro-expansion.
1936         * lisp.mk (lisp): Add macroexp.
1938 2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
1940         Simplify redefinition of 'abort' (Bug#12316).
1941         Do not try to redefine the 'abort' function.  Instead, redo
1942         the code so that it calls 'emacs_abort' rather than 'abort'.
1943         This removes the need for the NO_ABORT configure-time macro
1944         and makes it easier to change the abort code to do a backtrace.
1945         * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1946         * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1947         Remove; sysdep.c's emacs_abort now takes its place.
1948         * lisp.h (emacs_abort): New decl.  All calls from Emacs code to
1949         'abort' changed to use 'emacs_abort'.
1950         * msdos.c (dos_abort) [defined abort]: Remove; not used.
1951         (abort) [!defined abort]: Rename to ...
1952         (emacs_abort): ... new name.
1953         * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1954         the place of the old 'abort' in emacs.c.
1955         * w32.c, w32fns.c (abort): Do not #undef.
1956         * w32.c (emacs_abort): Rename from w32_abort.
1958 2012-09-04  Eli Zaretskii  <eliz@gnu.org>
1960         * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1961         offsets[j].dv, since the y axis of the screen coordinates points
1962         down, while the y axis of the font definition coordinates points
1963         up.  This fixes display of Arabic diacritics such as KASRA and
1964         KASRATAN.  (Bug#11860)
1966 2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
1968         Be more systematic about _setjmp vs setjmp.
1969         * alloc.c (test_setjmp, mark_stack):
1970         * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1971         (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1972         (png_load, my_error_exit, jpeg_load):
1973         * process.c (send_process_trap, send_process):
1974         Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1975         The underscored versions are up to 30x faster on some hosts.
1976         Formerly, the code used setjmp+longjmp sometimes and
1977         _setjmp+_longjmp at other times, with no particular reason to
1978         prefer setjmp+longjmp.
1980 2012-09-03  Paul Eggert  <eggert@cs.ucla.edu>
1982         Fix minor problem found by static checking.
1983         * buffer.c (Fdelete_all_overlays): Return nil.
1985 2012-09-03  Martin Rudalics  <rudalics@gmx.at>
1987         * buffer.c (Fdelete_all_overlays): New function.
1989 2012-09-03  Chong Yidong  <cyd@gnu.org>
1991         * gtkutil.c: Add extern decl for Qxft.
1993 2012-09-02  Paul Eggert  <eggert@cs.ucla.edu>
1995         * emacs.c, eval.c: Use bool for boolean.
1996         * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1997         (malloc_using_checking) [DOUG_LEA_MALLOC]:
1998         (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1999         (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
2000         (main, decode_env_path, Fdaemon_initialized):
2001         * eval.c (call_debugger, Finteractive_p, interactive_p):
2002         (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
2003         (maybe_call_debugger, Fbacktrace):
2004         * process.c (read_process_output, exec_sentinel):
2005         Use bool for booleans.
2006         * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
2007         All callers changed.
2008         * eval.c (interactive_p): Omit always-true boolean argument
2009         EXCLUDE_SUBRS_P.  All callers changed.
2010         * dispextern.h, lisp.h: Reflect above API changes.
2011         * firstfile.c (dummy): Use the address of 'main', whose signature
2012         won't change, instead of the address of 'initialize', whose
2013         signature just changed from int to bool.
2014         * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
2015         * msdos.c (fatal_error_in_progress): ... from here.
2016         * xdisp.c (redisplaying_p): Now a boolean.  Set it to 1 instead
2017         of incrementing it.
2018         (redisplay_internal, unwind_redisplay): Simply clear
2019         REDISPLAYING_P when unwinding, instead of saving its previous,
2020         always-false value and then restoring it.
2022         Clean up some extern decls.
2023         Mostly, this hoists extern decls out of .c files and into .h files.
2024         That way, we're more likely to catch errors if the interfaces change.
2025         * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
2026         declare xg_mark_data.
2027         * dispextern.h (x_frame_parm_handlers):
2028         * font.h (Qxft):
2029         * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
2030         (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
2031         (Qultra_bold, Qoblique, Qitalic):
2032         Move extern decl here from .c file.
2033         * alloc.c (xg_mark_data) [USE_GTK]:
2034         * doc.c (Qclosure):
2035         * eval.c (Qlexical_binding):
2036         * fns.c (time) [!HAVE_UNISTD_H]:
2037         * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
2038         (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
2039         * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
2040         * lread.c (Qinternal_interpreter_environment):
2041         * minibuf.c (Qbuffer):
2042         * process.c (QCfamily, QCfilter):
2043         * widget.c (free_frame_faces):
2044         * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
2045         * xfont.c (x_clear_errors):
2046         * xterm.c (x_frame_parm_handlers):
2047         Remove now-redundant extern decls.
2048         * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
2049         * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
2050         Now static.
2051         * xfaces.c: Remove unnecessary static decls.
2052         * xterm.c (updating_frame): Remove decl of nonexistent object.
2054         * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
2055         when building globals.h, as the objects that are not built on
2056         this host are not needed to compile C files on this host.
2058 2012-09-02  Jan Djärv  <jan.h.d@swipnet.se>
2060         * gtkutil.h: Remove prototype for x_wm_set_size_hint.
2062         * frame.h: Add missing prototype for x_wm_set_size_hint.
2064 2012-09-02  Paul Eggert  <eggert@cs.ucla.edu>
2066         * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
2067         * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
2068         (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
2069         (Fsubstitute_command_keys):
2070         * editfns.c (region_limit, find_field, Fconstrain_to_field)
2071         (save_excursion_save, save_excursion_restore)
2072         (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
2073         (format_time_string, general_insert_function)
2074         (make_buffer_string, make_buffer_string_both)
2075         (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
2076         * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
2077         (copy_text, insert_1, insert_1_both, insert_from_string)
2078         (insert_from_string_before_markers, insert_from_string_1)
2079         (insert_from_buffer, insert_from_buffer_1, replace_range)
2080         (replace_range_2, del_range_1, del_range_byte, del_range_both)
2081         (del_range_2, modify_region):
2082         * intervals.c (intervals_equal, balance_possible_root_interval)
2083         (adjust_intervals_for_insertion, merge_properties_sticky)
2084         (graft_intervals_into_buffer, lookup_char_property)
2085         (adjust_for_invis_intang, set_point_both)
2086         (get_property_and_range, compare_string_intervals)
2087         (set_intervals_multibyte_1, set_intervals_multibyte):
2088         * keyboard.c (decode_timer):
2089         Use bool for boolean.
2090         * intervals.h, lisp.h, systime.h: Reflect above API changes.
2091         * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2093 2012-09-02  Chong Yidong  <cyd@gnu.org>
2095         * keymap.c (push_key_description): Print M-TAB as C-M-i
2096         (Bug#11758).
2098 2012-09-02  Juanma Barranquero  <lekktu@gmail.com>
2100         * makefile.w32-in (CCL_H, W32FONT_H): New macros.
2101         (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
2102         ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
2103         ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
2104         ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
2105         ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
2106         ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2108 2012-09-01  Eli Zaretskii  <eliz@gnu.org>
2110         * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2111         more than one grapheme cluster passed to the shaper: compute the
2112         offset adjustment values separately for each cluster.  (Bug#11860)
2114         * image.c: Restore mistakenly removed inclusion of w32.h.  Without
2115         it, GCC doesn't see prototypes of w32_delayed_load, and complains
2116         about implicit conversions from integer to pointer.
2118 2012-09-01  Daniel Colascione  <dancol@dancol.org>
2120         * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2121         system used too early.
2123 2012-09-01  Paul Eggert  <eggert@cs.ucla.edu>
2125         Better seed support for (random).
2126         * emacs.c (main): Call init_random.
2127         * fns.c (Frandom): Set the seed from a string argument, if given.
2128         Remove long-obsolete Gentzel cruft.
2129         * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2130         (init_random): New function.
2132 2012-09-01  Daniel Colascione  <dancol@dancol.org>
2134         * xterm.h: Add header guards.  Declare x_menubar_window_to_frame.
2135         Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
2136         x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
2137         x_wm_set_size_hint, x_query_colors, x_real_positions,
2138         x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
2139         x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
2140         all of which have been moved to common code.
2142         * xfaces.c: Include TERM_HEADER instead of listing all possible
2143         window-system headers.
2145         * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2146         to match header.
2148         * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2149         directly accessing frame internals.
2151         * w32font.h: Include font.h.  Define syms_of_w32font and
2152         globals_of_w32font.
2154         * process.c: Include TERM_HEADER instead of listing all possible
2155         window-system headers.
2157         * nsterm.h: Remove declarations now in frame.h.
2158         Define FRAME_X_SCREEN, FRAME_X_VISUAL.
2160         * menu.c: Include TERM_HEADER instead of listing all possible
2161         window-system headers.
2163         * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2164         window system.
2166         * keyboard.c: Include TERM_HEADER instead of listing all possible
2167         window-system headers.
2169         * image.c: Include TERM_HEADER instead of listing all possible
2170         window-system headers.  Declare Vlibrary_cache when compiling for
2171         Windows.
2173         * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2174         window system declarations.
2176         * frame.h: Move common functions here: set_frame_menubar,
2177         x_set_window_size, x_sync, x_get_focus_frame,
2178         x_set_mouse_position, x_set_mouse_pixel_position,
2179         x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2180         x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2181         x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2182         x_activate_menubar, x_real_positions, x_bitmap_icon,
2183         x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2184         and x_query_colors.
2186         * frame.c: Include TERM_HEADER instead of listing all possible
2187         window-system headers.
2189         * font.c: Include TERM_HEADER instead of listing all possible
2190         window-system headers.
2192         * emacs.c: Include TERM_HEADER.
2194         * dispnew.c: Include TERM_HEADER instead of listing all possible
2195         window-system headers.
2197         * ccl.h: Include character.h.
2199         * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2200         the current window system; include in list of objects to link into
2201         Emacs.
2203 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
2205         Remove mark_ttys function and fix tty_display_info initialization.
2206         * lisp.h (mark_ttys): Remove prototype.
2207         * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2208         to mark_ttys because all possible values of 'top_frame' slot are
2209         the frames which are reachable from Vframe_list.
2210         * term.c (mark_ttys): Remove.
2211         (init_tty): Safely initialize 'top_frame' slot with Qnil.
2213 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
2215         Change struct frame bitfields from unsigned char to unsigned.
2216         * frame.h (struct frame): Change type of 'display_preempted',
2217         'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2218         'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2219         'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2220         bitfields from unsigned char to unsigned.
2222 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
2224         Remove unused member of struct x_output and struct w32_output.
2225         * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2226         * w32term.h (struct w32_output): Likewise.
2228 2012-08-30  Jan Djärv  <jan.h.d@swipnet.se>
2230         * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2231         does not become zero (Bug#12234).
2233 2012-08-30  Paul Eggert  <eggert@cs.ucla.edu>
2235         * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2236         for GCC 4.7.1 x86-64.
2238 2012-08-30  Glenn Morris  <rgm@gnu.org>
2240         * lread.c (init_lread): For out-of-tree builds, only add the
2241         source directory's site-lisp dir to the load-path if it exists,
2242         consistent with in-tree builds.  (Bug#12302)
2244 2012-08-28  Jan Djärv  <jan.h.d@swipnet.se>
2246         * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
2247         button_values to NULL.  Call setStykeMask so dialogs get a close button.
2248         (windowShouldClose:): Set window_closed.
2249         (dealloc): New member, free button_values.
2250         (process_dialog:): Make member function.  Remove window argument,
2251         replace window with self.  Count buttons and allocate and store values
2252         in button_values.
2253         (addButton:value:row:): value is int with the name tag.  Call setTag
2254         with tag.  Remove return self, declare return value as void.
2255         (addString:row:): Remove return self, declare return value as void.
2256         (addSplit): Remove return self, declare return value as void.
2257         (clicked:): Remove return self, declare return value as void.
2258         Set dialog_return to button_values[seltag].  Code formatting change.
2259         (initFromContents:isQuestion:): Adjust call to process_dialog.
2260         Code formatting change.
2261         (timeout_handler:): Set timer_fired to YES.
2262         (runDialogAt:): Set timer_fired to NO.
2263         Handle click on close button as quit.
2265         * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2266         Add window_closed and button_values.  Add void as return value for
2267         add(Button|String|Split).  addButton takes int instead of Lisp_Object.
2268         Add process_dialog as new member.
2270 2012-08-28  Eli Zaretskii  <eliz@gnu.org>
2272         * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2273         is not one of the heaps we manage.  (Bug#12242)
2275 2012-08-28  Glenn Morris  <rgm@gnu.org>
2277         * eval.c (Fcalled_interactively_p): Doc fix.  (Bug#11747)
2279 2012-08-28  Martin Rudalics  <rudalics@gmx.at>
2281         * window.c (Fset_window_configuration): Remove handling of
2282         auto-buffer-name window parameter.  Install revision of reverted
2283         fix.
2285 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
2287         Do not allow to set major mode for a dead buffer.
2288         * buffer.c (Fset_buffer_major_mode): Signal an error
2289         if the buffer is dead.
2290         (Fother_buffer, other_buffer_safely): Remove redundant
2291         nested declaration.
2293 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
2295         Always use set_buffer_if_live to restore original buffer at unwind.
2296         * buffer.h (record_unwind_current_buffer): New function.
2297         * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2298         * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2299         * undo.c, window.c: Adjust users.
2300         * buffer.c (set_buffer_if_live): Fix comment.
2302 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
2304         Fix usage of set_buffer_internal.
2305         * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2306         * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2307         * coding.c (decode_coding): Omit redundant test.
2308         * fileio.c (decide_coding_unwind): Likewise.
2309         * fns.c (secure_hash): Likewise.
2310         * insdel.c (modify_region): Likewise.
2311         * keyboard.c (command_loop_1): Likewise.
2312         * print.c (PRINTFINISH): Likewise.
2313         * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2315 2012-08-27  Paul Eggert  <eggert@cs.ucla.edu>
2317         * dispnew.c: Use bool for boolean.
2318         (frame_garbaged, display_completed, delayed_size_change)
2319         (fonts_changed_p, add_window_display_history)
2320         (add_frame_display_history, verify_row_hash)
2321         (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2322         (row_equal_p, realloc_glyph_pool)
2323         (allocate_matrices_for_frame_redisplay)
2324         (showing_window_margins_p)
2325         (adjust_frame_glyphs_for_frame_redisplay)
2326         (build_frame_matrix_from_leaf_window, make_current)
2327         (mirrored_line_dance, mirror_line_dance, update_frame)
2328         (update_window_tree, update_single_window)
2329         (check_current_matrix_flags, update_window, update_text_area)
2330         (update_window_line, set_window_update_flags, scrolling_window)
2331         (update_frame_1, scrolling, buffer_posn_from_coords)
2332         (do_pending_window_change, change_frame_size)
2333         (change_frame_size_1, sit_for):
2334         Use bool for boolean.
2335         (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2336         and remove last int (actually boolean) argument, which was always 0.
2337         All callers changed.
2338         * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2339         * dispextern.h (struct composition_it): Use bool for boolean.
2340         (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2341         (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2342         * dired.c (file_name_completion):
2343         Use bool for boolean.  (This was missed in an earlier change.)
2345 2012-08-27  Martin Rudalics  <rudalics@gmx.at>
2347         * window.c (Fset_window_configuration): Revert first part of
2348         last change.
2350 2012-08-27  Jan Djärv  <jan.h.d@swipnet.se>
2352         * nsterm.h (NSPanel): New class variable dialog_return.
2354         * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2355         Initialize dialog_return.
2356         (windowShouldClose:): Use stop instead of stopModalWithCode.
2357         (clicked:): Ditto, and also set dialog_return (Bug#12258).
2358         (timeout_handler:): Use stop instead of abortModal.  Send a dummy
2359         event.
2360         (runDialogAt:): Make ret Lisp_Object.  Set it from dialog_return when
2361         modal loop returns.
2363 2012-08-27  Paul Eggert  <eggert@cs.ucla.edu>
2365         * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2366         * composite.c (find_composition, composition_gstring_p)
2367         (composition_reseat_it, find_automatic_composition):
2368         * data.c (let_shadows_buffer_binding_p)
2369         (let_shadows_global_binding_p, set_internal, make_blv)
2370         (Fmake_variable_buffer_local, Fmake_local_variable)
2371         (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2372         (cons_to_signed, arith_driver):
2373         * dbusbind.c (xd_in_read_queued_messages):
2374         * dired.c (directory_files_internal, file_name_completion):
2375         Use bool for booleans.
2376         * dired.c (file_name_completion):
2377         * process.h (fd_callback):
2378         Omit int (actually boolean) argument.  It wasn't being used.
2379         All uses changed.
2380         * composite.h, lisp.h: Reflect above API changes.
2382         * cmds.c, coding.c: Use bool for booleans.
2383         * cmds.c (move_point, Fself_insert_command):
2384         * coding.h (struct composition status, struct coding_system):
2385         * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2386         (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2387         (emacs_mule_char, decode_coding_emacs_mule)
2388         (encode_coding_emacs_mule, detect_coding_iso_2022)
2389         (decode_coding_iso_2022, encode_invocation_designation)
2390         (encode_designation_at_bol, encode_coding_iso_2022)
2391         (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2392         (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2393         (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2394         (encode_coding_raw_text, detect_coding_charset)
2395         (decode_coding_charset, encode_coding_charset, detect_eol)
2396         (detect_coding, get_translation_table, produce_chars)
2397         (consume_chars, reused_workbuf_in_use)
2398         (make_conversion_work_buffer, code_conversion_save)
2399         (decode_coding_object, encode_coding_object)
2400         (detect_coding_system, char_encodable_p)
2401         (Funencodable_char_position, code_convert_region)
2402         (code_convert_string, code_convert_string_norecord)
2403         (Fset_coding_system_priority):
2404         * fileio.c (Finsert_file_contents):
2405         Use bool for booleans.
2406         * coding.h, lisp.h: Reflect above API changes.
2407         * coding.c: Remove unnecessary static function decls.
2408         (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2409         (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2410         not a boolean 'int', since callers never look at the return value.
2411         (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2412         * coding.h (decoding_buffer_size, encoding_buffer_size)
2413         (emacs_mule_string_char): Remove unused extern decls.
2414         (struct iso_2022_spec, struct coding_system):
2415         Use 'unsigned int : 1' for boolean fields, since there's more than one.
2416         (struct emacs_mule_spec): Remove unused field 'full_support'.
2417         All initializations removed.
2418         * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2420 2012-08-27  Dmitry Antipov  <dmantipov@yandex.ru>
2422         Fix spare memory change (Bug#12286).
2423         * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2424         (valid_lisp_object_p): Likewise.
2426 2012-08-27  Martin Rudalics  <rudalics@gmx.at>
2428         * window.c (Fset_window_configuration): Record any window's old
2429         buffer if it's replaced (see Bug#8789).  If the new current
2430         buffer doesn't appear in the selected window, go to its old
2431         point (Bug#12208).
2433 2012-08-27  Dmitry Antipov  <dmantipov@yandex.ru>
2435         Special MEM_TYPE_SPARE to denote reserved memory.
2436         * alloc.c (enum mem_type): New memory type.
2437         (refill_memory_reserve): Use new type for spare memory.
2438         This prevents live_cons_p and live_string_p from incorrect
2439         detection of uninitialized objects from spare memory as live.
2441 2012-08-26  Paul Eggert  <eggert@cs.ucla.edu>
2443         Spelling fixes.
2444         * Makefile.in (.PHONY): versioclean -> versionclean.
2446         Remove unused external symbols.
2447         * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2448         * window.c (Qwindow_valid_p, decode_valid_window):
2449         Now static, not extern.
2450         * data.c (Qinterval): Remove; unused.
2451         (syms_of_data): Do not define 'interval'.
2452         * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2453         * window.h (decode_valid_window):
2454         Remove decls.
2456         * character.c, charset.c, chartab.c: Use bool for booleans.
2457         * character.c (lisp_string_width, string_count_byte8)
2458         (string_escape_byte8):
2459         * charset.c (charset_map_loaded, load_charset_map, read_hex):
2460         (load_charset_map_from_file, map_charset_chars)
2461         (Fdefine_charset_internal, define_charset_internal)
2462         (Fdeclare_equiv_charset, find_charsets_in_text)
2463         (Ffind_charset_region, char_charset, Fiso_charset):
2464         * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2465         (sub_char_table_set, sub_char_table_set_range)
2466         (char_table_set_range, optimize_sub_char_table)
2467         (map_sub_char_table):
2468         Use bool for boolean.
2469         * character.c (str_to_unibyte): Omit last boolean argument; it was
2470         always 0.  All callers changed.
2471         * character.h, charset.h: Adjust to match previous changes.
2472         * character.h (char_printable_p): Remove decl of nonexistent function.
2473         * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2474         ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2475         are all boolean, so make them single-bit bitfields.
2477         * lisp.h (ASET): Remove attempt to detect side effects.
2478         It was meant to be temporary and it often doesn't work,
2479         because when IDX has side effects the behavior of IDX==IDX
2480         is undefined.  See Stefan Monnier in
2481         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2483 2012-08-26  Barry OReilly  <gundaetiapo@gmail.com>  (tiny change)
2485         * lisp.h (functionp): New function (extracted from Ffunctionp).
2486         (FUNCTIONP): Use it.
2487         * eval.c (Ffunctionp): Use it.
2489 2012-08-25  Paul Eggert  <eggert@cs.ucla.edu>
2491         * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2492         as that's faster and simpler than static storage.  Don't bother
2493         with the g_main_context_query overhead if g_main_context_pending
2494         says no events are pending.
2495         (gfds, gfds_size): Remove these static vars.
2496         (xgselect_initialize): Remove; no longer needed.
2497         All uses and decls removed.
2499         * emacs.c (fatal_error_signal_hook): Remove.
2500         All uses removed.  This leftover from old code was always 0.
2502         * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2503         * casefiddle.c (casify_object, casify_region):
2504         * casetab.c (set_case_table):
2505         * category.c, category.h (word_boundary_p):
2506         * category.h (CHAR_HAS_CATEGORY):
2507         Use bool for booleans, instead of int.
2509 2012-08-25  Eli Zaretskii  <eliz@gnu.org>
2511         * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2513 2012-08-25  Paul Eggert  <eggert@cs.ucla.edu>
2515         On assertion failure, print backtrace if available.
2516         * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2517         (die) [ENABLE_CHECKING]: Print a backtrace if available.
2518         * Makefile.in (LIB_EXECINFO): New macro.
2519         (LIBES): Use it.
2521         * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2522         * bytecode.c (exec_byte_code):
2523         * callint.c (check_mark, Fcall_interactively):
2524         * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2525         (getenv_internal, sync_process_alive, call_process_exited):
2526         * lisp.h (USE_SAFE_ALLOCA):
2527         Use bool for booleans, instead of int.
2528         * lisp.h, process.h: Adjust prototypes to match above changes.
2529         * callint.c (Fcall_interactively): Don't assume the mark's
2530         offset fits in 'int'.
2532 2012-08-24  Paul Eggert  <eggert@cs.ucla.edu>
2534         * buffer.c, buffer.h: Use bool for boolean.
2535         * buffer.c (reset_buffer_local_variables)
2536         (buffer_lisp_local_variables, Fset_buffer_modified_p)
2537         (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2538         (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2539         (overlay_touches_p, overlay_strings, Foverlay_put)
2540         (report_overlay_modification, call_overlay_mod_hooks):
2541         (mmap_enlarge, mmap_set_vars):
2542         * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2543         Use bool for booleans, instead of int.
2544         * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2545         since the 1-or-0 return value is always ignored anyway.
2546         (mmap_initialized_p):
2547         * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2548         * buffer.h, lisp.h: Adjust prototypes to match above changes.
2550 2012-08-23  Paul Eggert  <eggert@cs.ucla.edu>
2552         * bidi.c: Use bool for boolean.
2553         This is a bit more readable, and makes the text segment of bidi.o
2554         0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2555         Presumably it's faster too.
2556         (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2557         Now bool.
2558         (bidi_cache_find_level_change, bidi_cache_iterator_state)
2559         (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2560         (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2561         (bidi_explicit_dir_char, bidi_level_of_next_char)
2562         (bidi_find_other_level_edge, bidi_move_to_visually_next):
2563         Use bool for booleans, instead of int.
2564         * dispextern.h (bidi_init_it, bidi_paragraph_init)
2565         (bidi_unshelve_cache): Adjust decls to match code.
2567 2012-08-23  Martin Rudalics  <rudalics@gmx.at>
2569         * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2570         argument.
2572 2012-08-23  Paul Eggert  <eggert@cs.ucla.edu>
2574         * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2575         * atimer.h: Include <stdbool.h>.
2577 2012-08-22  Dan Nicolaescu  <dann@gnu.org>
2579         * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2580         compile time tests instead of run time tests on systems that do
2581         not use them.
2582         (FRAME_MAC_P): Remove leftover from deleted code.
2583         * frame.c (syms_of_frame): Remove leftover from deleted code.
2585 2012-08-22  Jan Djärv  <jan.h.d@swipnet.se>
2587         * nsterm.m (insertText:): Don't clear modifiers if code is space.
2589 2012-08-22  Paul Eggert  <eggert@cs.ucla.edu>
2591         * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2592         Otherwise, the compiler complains about (A?B:C) where B is void
2593         and C is Lisp_Object.  This fixes an incompatibility with Sun C 5.12.
2594         (fontset_add): Return void, for FONTSET_ADD.
2596 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
2598         * alloc.c: Use bool for booleans.
2599         (gc_in_progress, abort_on_gc)
2600         (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2601         (dont_register_blocks) [GC_MALLOC_CHECK]:
2602         (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2603         (check_string_bytes, make_specified_string, memory_full)
2604         (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2605         (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2606         (mark_stack, valid_pointer_p, make_pure_string)
2607         (Fgarbage_collect, survives_gc_p, gc_sweep):
2608         Use bool for booleans, instead of int.
2609         (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2610         Remove unused local.
2611         * alloc.c (PURE_POINTER_P):
2612         * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2613         * editfns.c (Fformat):
2614         * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2615         (Fdo_auto_save):
2616         * fns.c (sweep_weak_table):
2617         * lisp.h (suppress_checking, push_message, survives_gc_p)
2618         (make_pure_string, gc_in_progress, abort_on_gc):
2619         * lread.c (readchar, read1):
2620         * print.c (Fprin1_to_string):
2621         * xdisp.c (push_message):
2622         Use bool for booleans affected directly or indirectly by
2623         alloc.c's changes.
2625         Make recently-introduced setters macros.
2626         * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2627         (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2628         (set_fontset_default, set_fontset_fallback): Rename from their
2629         upper-case counterparts, and make them functions rather than macros.
2630         This is more consistent with the other recently-introduced setters.
2631         These don't need to be inline, since they're local.
2633 2012-08-21  Jan Djärv  <jan.h.d@swipnet.se>
2635         * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2636         the loop (Bug#12247).
2638 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
2640         * lisp.h (vcopy): Use memcpy rather than our own loop.
2641         This fixes a performance regression introduced by the recent
2642         addition of vcopy.  This means 'vcopy' will need to be modified
2643         for a copying collector, but that's OK.  Also, tighten the
2644         checking in the assertion.
2646 2012-08-21  Eli Zaretskii  <eliz@gnu.org>
2648         * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2649         components for RTL text (Bug#11860).  Adjust X-OFFSET of each
2650         non-base glyph for the width of the base character, according to
2651         what x_draw_composite_glyph_string_foreground expects.
2652         Generate WADJUST value according to composition_gstring_width's
2653         expectations, to produce correct width of the composed character.
2654         Reverse the sign of the DU offset produced by ScriptPlace.
2656 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
2658         * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2660 2012-08-21  Dmitry Antipov  <dmantipov@yandex.ru>
2662         Avoid direct writes to contents member of struct Lisp_Vector.
2663         * lisp.h (vcopy): New function to copy data into vector.
2664         * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2665         * fns.c (Ffillarray): Use ASET.
2666         * keyboard.c (timer_check_2): Use AREF and ASET.
2667         (append_tool_bar_item, Frecent_keys): Use vcopy.
2668         * lread.c (read_vector): Use ASET.
2669         * msdos.c (Frecent_doskeys): Use vcopy.
2670         * xface.c (Finternal_copy_lisp_face): Use vcopy.
2671         (Finternal_merge_in_global_face): Use ASET and vcopy.
2672         * xfont.c (xfont_list_pattern): Likewise.
2674 2012-08-21  Martin Rudalics  <rudalics@gmx.at>
2676         * window.c (Fwindow_point): For the selected window always return
2677         the position of its buffer's point.
2678         (Fset_window_point): For the selected window always go in its
2679         buffer to the specified position.
2681 2012-08-21  Dmitry Antipov  <dmantipov@yandex.ru>
2683         Setter macros for fontsets.
2684         * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2685         (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2686         (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2687         Adjust users.
2689 2012-08-20  Glenn Morris  <rgm@gnu.org>
2691         * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2692         Don't assume that `ln -f' works.
2694 2012-08-20  Eli Zaretskii  <eliz@gnu.org>
2696         * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2697         and later about non-assignments with no effect.  See discussion at
2698         http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2699         details.
2701 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
2703         Inline setter functions for Lisp_Objects slots of struct specbinding.
2704         * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2705         Adjust users.
2707 2012-08-20  Martin Rudalics  <rudalics@gmx.at>
2709         * window.c (select_window): Always make selected window's buffer
2710         current.
2712 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
2714         Use AREF and ASET for docstrings of category tables.
2715         * category.h (CATEGORY_DOCSTRING): Use AREF.
2716         (SET_CATEGORY_DOCSTRING): Use ASET.
2717         * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2719 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
2721         Inline setter functions for hash table members.
2722         * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2723         (set_hash_hash, set_hash_index): Rename with _slot suffix.
2724         (set_hash_key_and_value, set_hash_index, set_hash_next)
2725         (set_hash_hash): New functions.
2726         * charset.c, fns.c: Adjust users.
2728 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
2730         Inline getter and setter functions for per-buffer values.
2731         * buffer.h (per_buffer_default, set_per_buffer_default)
2732         (per_buffer_value, set_per_buffer_value): New functions.
2733         (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2734         * buffer.c, data.c: Adjust users.
2736 2012-08-20  Juanma Barranquero  <lekktu@gmail.com>
2738         * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2740 2012-08-19  Paul Eggert  <eggert@cs.ucla.edu>
2742         Rely on <config.h> + <unistd.h> to declare 'environ',
2743         as gnulib does this if the system doesn't.
2744         * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
2745         Remove declaration.  MS-Windows declares it on stdlib.h which is
2746         included by conf_post.h.
2747         * emacs.c (environ) [DOUG_LEA_MALLOC]:
2748         * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2749         * vm-limit.c: Include <unistd.h>, for 'environ'.
2751         * unexaix.c, unexcoff.c: Include "mem-limits.h".
2752         (start_of_data): Remove decl; mem-limits.h provides it.
2754         * xdisp.c (handle_invisible_prop): Make it a bit faster
2755         and avoid a gcc -Wmaybe-uninitialized diagnostic.
2757 2012-08-19  Chong Yidong  <cyd@gnu.org>
2759         * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2760         ends (Bug#3874).
2762 2012-08-19  Andreas Schwab  <schwab@linux-m68k.org>
2764         * .gdbinit: Use call instead of set when calling a function in the
2765         inferior.
2767         * data.c (set_internal): Don't use set_blv_found.
2768         (Fkill_local_variable): Likewise.
2770 2012-08-18  Alp Aker  <alp.tekin.aker@gmail.com>
2772         * nsfont.m (ns_ascii_average_width): Ensure the string
2773         ascii_printable is initialized with a null-terminated character
2774         array.  Otherwise, it can contain undesired extra characters.
2776 2012-08-18  Paul Eggert  <eggert@cs.ucla.edu>
2778         port new setting code to Sun C 5.8 2005/10/13
2779         * chartab.c, lisp.h (char_table_set, char_table_set_range):
2780         Return void, not Lisp_Object.  Otherwise, the compiler
2781         complains about (A?B:C) where B is void and C is Lisp_Object
2782         when compiling CHAR_TABLE_SET, due to the recent change to
2783         the API of sub_char_table_set_contents.
2785 2012-08-18  Chong Yidong  <cyd@gnu.org>
2787         * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2788         for the string case (Bug#3874).
2790 2012-08-18  Paul Eggert  <eggert@cs.ucla.edu>
2792         * buffer.h (BSET): Remove (Bug#12215).
2793         Replace all uses with calls to new setter functions.
2794         (bset_bidi_paragraph_direction, bset_case_canon_table)
2795         (bset_case_eqv_table, bset_directory, bset_display_count)
2796         (bset_display_time, bset_downcase_table)
2797         (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2798         (bset_last_selected_window, bset_local_var_alist)
2799         (bset_mark_active, bset_point_before_scroll, bset_read_only)
2800         (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2801         (bset_width_table):
2802         * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2803         (bset_auto_fill_function, bset_auto_save_file_format)
2804         (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2805         (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2806         (bset_cache_long_line_scans, bset_case_fold_search)
2807         (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2808         (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2809         (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2810         (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2811         (bset_header_line_format, bset_indicate_buffer_boundaries)
2812         (bset_indicate_empty_lines, bset_invisibility_spec)
2813         (bset_left_fringe_width, bset_major_mode, bset_mark)
2814         (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2815         (bset_name, bset_overwrite_mode, bset_pt_marker)
2816         (bset_right_fringe_width, bset_save_length)
2817         (bset_scroll_bar_width, bset_scroll_down_aggressively)
2818         (bset_scroll_up_aggressively, bset_selective_display)
2819         (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2820         (bset_word_wrap, bset_zv_marker):
2821         * category.c (bset_category_table):
2822         * syntax.c (bset_syntax_table):
2823         New setter functions.
2825         * process.h (PSET): Remove (Bug#12215).
2826         Replace all uses with calls to new setter functions.
2827         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2828         (PROCESS_INLINE): New macro.
2829         (pset_childp): New setter function.
2830         (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2831         * process.c (PROCESS_INLINE):
2832         Define to EXTERN_INLINE, so that the corresponding functions
2833         are compiled into code.
2834         (pset_buffer, pset_command, pset_decode_coding_system)
2835         (pset_decoding_buf, pset_encode_coding_system)
2836         (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2837         (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2838         (pset_type, pset_write_queue): New setter functions.
2840         * window.h (WSET): Remove (Bug#12215).
2841         Replace all uses with calls to new setter functions.
2842         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2843         (WINDOW_INLINE): New macro.
2844         (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2845         (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2846         (wset_total_lines, wset_vertical_scroll_bar)
2847         (wset_window_end_pos, wset_window_end_valid)
2848         (wset_window_end_vpos): New setter functions.
2849         * window.c (WINDOW_INLINE):
2850         Define to EXTERN_INLINE, so that the corresponding functions
2851         are compiled into code.
2852         (wset_combination_limit, wset_dedicated, wset_display_table)
2853         (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2854         (wset_new_normal, wset_new_total, wset_next_buffers)
2855         (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2856         (wset_prev_buffers, wset_right_fringe_width)
2857         (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2858         (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2859         (wset_window_parameters):
2860         * xdisp.c (wset_base_line_number, wset_base_line_pos)
2861         (wset_column_number_displayed, wset_region_showing):
2862         New setter functions.
2864         * termhooks.h (TSET): Remove (Bug#12215).
2865         Replace all uses with calls to new setter functions.
2866         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2867         (TERMHOOKS_INLINE): New macro.
2868         (tset_charset_list, tset_selection_alist): New setter functions.
2869         * terminal.c (TERMHOOKS_INLINE):
2870         Define to EXTERN_INLINE, so that the corresponding functions
2871         are compiled into code.
2872         (tset_param_alist): New setter function.
2874 2012-08-17  Paul Eggert  <eggert@cs.ucla.edu>
2876         * keyboard.h (KSET): Remove (Bug#12215).
2877         Replace all uses with calls to new setter functions.
2878         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2879         (KEYBOARD_INLINE): New macro.
2880         (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2881         (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2882         (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2883         New setter functions.
2884         * keyboard.c (KEYBOARD_INLINE):
2885         Define to EXTERN_INLINE, so that the corresponding functions
2886         are compiled into code.
2887         (kset_echo_string, kset_kbd_queue)
2888         (kset_keyboard_translate_table, kset_last_prefix_arg)
2889         (kset_last_repeatable_command, kset_local_function_key_map)
2890         (kset_overriding_terminal_local_map, kset_real_last_command)
2891         (kset_system_key_syms): New setter functions.
2893         * frame.h (FSET): Remove (Bug#12215).
2894         Replace all uses with calls to new setter functions.
2895         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2896         (FRAME_INLINE): New macro.
2897         (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2898         (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2899         (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2900         (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2901         (fset_param_alist, fset_root_window, fset_scroll_bars)
2902         (fset_selected_window, fset_title, fset_tool_bar_items)
2903         (fset_tool_bar_position, fset_tool_bar_window): New functions.
2904         * frame.c (FRAME_INLINE):
2905         Define to EXTERN_INLINE, so that the corresponding functions
2906         are compiled into code.
2907         (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2909         A few more naming-convention fixes for getters and setters.
2910         * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2911         and rename from buffer_overlays_set_before.
2912         (set_buffer_overlays_after): Move here from buffer.h, and rename
2913         from buffer_overlays_set_after.
2914         * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2915         All uses changed.
2916         (set_buffer_intervals): Rename from buffer_set_intervals.
2917         * intervals.c (set_interval_object): Move here from intervals.h,
2918         and rename from interval_set_object.
2919         (set_interval_left): Move here from intervals.h, and rename from
2920         interval_set_left.
2921         (set_interval_right): Move here from intervals.h, and rename from
2922         interval_set_right.
2923         (copy_interval_parent): Move here from intervals.h, and rename from
2924         interval_copy_parent.
2925         * intervals.h (set_interval_parent): Rename from interval_set_parent.
2926         (set_interval_plist): Rename from interval_set_plist.
2927         Return void, not Lisp_Object, since no caller uses the result.
2928         * lisp.h (string_intervals): Rename from string_get_intervals.
2929         (set_string_intervals): Rename from string_set_intervals.
2931         * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2932         (set_char_table_contents): Rename from char_table_set_contents.
2933         (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
2934         All uses changed.  See the end of
2935         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2937         * lisp.h (CSET): Remove (Bug#12215).
2938         (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2939         (set_char_table_purpose): New functions,
2940         replacing CSET.  All uses changed.  For example, replace
2941         "CSET (XCHAR_TABLE (char_table), parent, parent);" with
2942         "set_char_table_parent (char_table, parent);".
2943         The old version was confusing because it used the same name
2944         'parent' for two different things.
2946 2012-08-17  Dmitry Antipov  <dmantipov@yandex.ru>
2948         Functions to get and set Lisp_Object fields of buffer-local variables.
2949         * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2950         (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2951         (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2952         * data.c, eval.c, frame.c: Adjust users.
2954 2012-08-17  Chong Yidong  <cyd@gnu.org>
2956         * xfaces.c (merge_face_vectors): If the target font specfies a
2957         font spec, make the font's attributes take precedence over
2958         directly-specified attributes.
2959         (merge_face_ref): Recognize :font.
2961 2012-08-17  Dmitry Antipov  <dmantipov@yandex.ru>
2963         Do not use memcpy for copying intervals.
2964         * intervals.c (reproduce_interval): New function.
2965         (reproduce_tree, reproduce_tree_obj): Use it.
2966         (reproduce_tree_obj): Remove prototype.
2968 2012-08-17  Paul Eggert  <eggert@cs.ucla.edu>
2970         * lisp.h (duration_to_sec_usec): Remove unused decl.
2972 2012-08-17  Alp Aker  <alp.tekin.aker@gmail.com>
2974         * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2975         to an allocated instance of NSString, not to the class itself.
2977 2012-08-17  Juanma Barranquero  <lekktu@gmail.com>
2979         * makefile.w32-in (C_CTYPE_H): New macro.
2980         (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2981         ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2982         ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2984 2012-08-16  Paul Eggert  <eggert@cs.ucla.edu>
2986         Use ASCII tests for character types.
2987         * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2988         * xfns.c, xterm.c:
2989         Don't include <ctype.h>; was not needed.
2990         * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2991         * sysdep.c, xfaces.c:
2992         Include <c-ctype.h> instead of <ctype.h>.
2993         * nsterm.m: Include <c-ctype.h>.
2994         * charset.c (read_hex):
2995         * doc.c (Fsnarf_documentation):
2996         * fileio.c (IS_DRIVE) [WINDOWSNT]:
2997         (DRIVE_LETTER) [DOS_NT]:
2998         (Ffile_name_directory, Fexpand_file_name)
2999         (Fsubstitute_in_file_name):
3000         * font.c (font_parse_xlfd, font_parse_fcname):
3001         * frame.c (x_set_font_backend):
3002         * gtkutil.c (xg_get_font):
3003         * image.c (xbm_scan, xpm_scan, pbm_scan_number):
3004         * nsimage.m (hexchar):
3005         * nsterm.m (ns_xlfd_to_fontname):
3006         * sysdep.c (system_process_attributes):
3007         * xfaces.c (hash_string_case_insensitive):
3008         Use C-locale tests instead of locale-specific tests for character
3009         types, since we want the ASCII interpretation here, not the
3010         interpretation suitable for whatever happens to be the current locale.
3012 2012-08-16  Martin Rudalics  <rudalics@gmx.at>
3014         Consistently check windows for validity/liveness
3015         (Bug#11984, Bug#12025, Bug#12026).
3016         * lisp.h (CHECK_VALID_WINDOW): New macro.
3017         * window.c (decode_window): Rename to decode_live_window.
3018         (decode_valid_window, Fwindow_valid_p): New functions.
3019         (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
3020         (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
3021         (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
3022         (Fwindow_prev_sibling, Fwindow_combination_limit)
3023         (Fset_window_combination_limit, Fwindow_use_time)
3024         (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
3025         (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
3026         (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
3027         (Fwindow_hscroll, Fset_window_hscroll)
3028         (Fwindow_redisplay_end_trigger)
3029         (Fset_window_redisplay_end_trigger, Fwindow_edges)
3030         (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
3031         (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
3032         (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
3033         (Fwindow_end, Fset_window_point, Fset_window_start)
3034         (Fpos_visible_in_window_p, Fwindow_line_height)
3035         (Fwindow_dedicated_p, Fset_window_dedicated_p)
3036         (Fwindow_prev_buffers, Fset_window_prev_buffers)
3037         (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
3038         (Fset_window_parameter, Fwindow_display_table)
3039         (Fset_window_display_table, Fdelete_other_windows_internal)
3040         (Fset_window_buffer, Fset_window_new_total)
3041         (Fset_window_new_normal, Fdelete_window_internal)
3042         (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
3043         (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
3044         (Fwindow_scroll_bars): Check whether argument window is a valid or
3045         live window.  Update doc-strings.
3046         (syms_of_window): New symbol Qwindow_valid_p.
3047         * keyboard.c (Fposn_at_x_y): Check whether argument
3048         frame_or_window denotes a valid window.
3050 2012-08-16  Dmitry Antipov  <dmantipov@yandex.ru>
3052         Fix previous char table change.
3053         * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
3054         * chartab.c (optimize_sub_char_table): Likewise.
3056 2012-08-16  Chong Yidong  <cyd@gnu.org>
3058         * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
3060         * xfont.c (xfont_open):
3061         * xftfont.c (xftfont_open): Set the font's max_width field.
3063         * nsfont.m (nsfont_open): Similar to the Xft backend, set
3064         min_width to space_width and average_width to the average over
3065         printable ASCII characters.
3066         (ns_char_width): Code cleanup.
3067         (ns_ascii_average_width): New utility function.
3069         * font.h (struct font): Update comments.
3071 2012-08-16  Dmitry Antipov  <dmantipov@yandex.ru>
3073         Simple interface to set Lisp_Object fields of character tables.
3074         * lisp.h (CSET): New macro.
3075         (char_table_set_extras, char_table_set_contents)
3076         (sub_char_table_set_contents): New function.
3077         * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
3078         * syntax.c: Adjust users.
3080 2012-08-16  Stefan Monnier  <monnier@iro.umontreal.ca>
3082         * eval.c (eval_sub): Bind lexical-binding.
3083         * lread.c (Qlexical_binding): Make non-static.
3085 2012-08-15  Jan Djärv  <jan.h.d@swipnet.se>
3087         * nsmenu.m (popupSession): Remove.
3088         (pop_down_menu): Remove endModalSession.
3089         (timeout_handler:): New method.
3090         (runDialogAt:): Get next timeout.  Start a NSTimer with that timeout.
3091         Call runModalForWindow.  Check timer_fired when it returns.
3092         If not set, cancel timer and break out of loop.
3093         Otherwise loop again, with a new timeout.
3095         * nsterm.m: Include fcntl.h if present.
3096         (fd_entry, t_readfds, inNsSelect): Remove.
3097         (select_writefds, select_valid, select_timeout, selfds)
3098         (select_mutex, apploopnr): Add.
3099         (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
3100         Otherwise call kbd_buffer_store_event.
3101         (ns_send_appdefined): Remove release of fd_entry.
3102         (ns_read_socket): Always send appdefined.  Remove inNsSelect check.
3103         Increment and decrement apploopnr.
3104         (ns_select): If no file descriptors, just do a NSTimer.
3105         Otherwise copy read/write masks and start select thread (fd_handler).
3106         Start main loop and wait for application defined event.
3107         Inform select thread to stop selecting after main loop is exited.
3108         (ns_term_init): Create selfds pipe and set non-blocking.
3109         Initialize select_mutex.  Start the select thread (fd_handler).
3110         (fd_handler:): Loop forever, wait for info from the main thread
3111         to either start or stop selecting.  When select returns, send
3112         and appdefined event.
3113         (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3114         If not call kbd_buffer_store_event.
3116         * nsterm.h (EmacsApp): fd_handler takes id argument.
3117         (EmacsDialogPanel): Add timer_fired and timeout_handler.
3119         * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3121 2012-08-15  Eli Zaretskii  <eliz@gnu.org>
3123         * region-cache.c (move_cache_gap): Update gap_len using the actual
3124         growth of the boundaries array.  Do not change cache_len.
3125         (Bug#12196)
3127 2012-08-15  Dmitry Antipov  <dmantipov@yandex.ru>
3129         Generalize and cleanup font subsystem checks.
3130         * font.h (FONT_DEBUG, font_assert): Remove.
3131         * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3132         Change font_assert to eassert.  Use eassert where appropriate.
3134 2012-08-15  Dmitry Antipov  <dmantipov@yandex.ru>
3136         * gtkutil.c (xg_get_font): Use pango_units_to_double.
3138 2012-08-15  Chong Yidong  <cyd@gnu.org>
3140         * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3141         When using the new font chooser, use gtk_font_chooser_get_font_desc to
3142         extract the font descriptor instead of just the font name.
3143         In that case, return a font spec instead of a string.
3144         (x_last_font_name): Move to this file from xfns.c.
3146         * xfns.c (Fx_select_font): The return value can also be a font
3147         spec.  Move x_last_font_name management to gtkutil.c.
3149         * xfaces.c: Make font weight and style symbols non-static.
3151 2012-08-15  Stefan Monnier  <monnier@iro.umontreal.ca>
3153         * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3154         (bug#12117).
3156 2012-08-14  Stefan Monnier  <monnier@iro.umontreal.ca>
3158         * alloc.c (Fgarbage_collect): Use plural form consistently.
3160 2012-08-14  Eli Zaretskii  <eliz@gnu.org>
3162         * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3163         iteration through the command loop.  Fixes a problem whereby mouse
3164         movements are ignored until the first mouse click.
3166 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
3168         Use bool, not int, for Lisp booleans.
3169         This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3170         makes Emacs a bit smaller and presumably a bit faster.
3171         * lisp.h: Include <stdbool.h>.
3172         (struct Lisp_Boolfwd, defvar_bool):
3173         * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3174         * regex.c [!emacs]: Include <stdbool.h>.
3175         (false, true): Remove; <stdbool.h> does this for us now.
3177 2012-08-14  Chong Yidong  <cyd@gnu.org>
3179         * character.c (Fcharacterp): Doc fix (Bug#12076).
3181         * data.c (Findirect_variable): Doc fix (Bug#11040).
3183         * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3185         * editfns.c (Fformat): Doc fix (Bug#12059).
3186         (Fsave_current_buffer): Doc fix (Bug#11542).
3188 2012-08-14  Barry OReilly  <gundaetiapo@gmail.com>  (tiny change)
3190         * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3191         (bug#12022).
3193 2012-08-14  Martin Rudalics  <rudalics@gmx.at>
3195         * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3196         (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3197         * minibuf.c (choose_minibuf_frame, read_minibuf):
3198         * w32fns.c (x_create_tip_frame):
3199         * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3200         Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3202 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
3204         * intervals.c (offset_intervals): Remove obsolete comment.
3206 2012-08-14  Andreas Schwab  <schwab@linux-m68k.org>
3208         * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3210 2012-08-14  Gergely Risko  <gergely@risko.hu>
3212         * coding.c (decode_coding): Record buffer modification before
3213         disabling undo_list (Bug#11773).
3215 2012-08-14  Dmitry Antipov  <dmantipov@yandex.ru>
3217         Revert and cleanup some recent overlay changes.
3218         * buffer.h (enum overlay_type): Remove.
3219         (buffer_get_overlays, buffer_set_overlays): Likewise.
3220         (buffer_set_overlays_before, buffer_set_overlays_after):
3221         New function.  Adjust users.
3222         (unchain_both): Add eassert.
3224 2012-08-14  Dmitry Antipov  <dmantipov@yandex.ru>
3226         * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3228 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
3230         * gtkutil.c (xg_mark_data): Don't assume C99.
3232 2012-08-13  Jan Djärv  <jan.h.d@swipnet.se>
3234         * gtkutil.c (xg_frame_tb_info): New struct.
3235         (TB_INFO_KEY): New define.
3236         (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3237         (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3238         (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3239         if not present.
3240         (update_frame_tool_bar): Return early if data in xg_frame_tb_info
3241         is up to date.  Otherwise store new data.
3242         (free_frame_tool_bar): Free xg_frame_tb_info if present.
3244 2012-08-13  Dmitry Antipov  <dmantipov@yandex.ru>
3246         Use KSET for write access to Lisp_Object members of struct kboard.
3247         * keyboard.h (KSET): New macro.
3248         * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3249         * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3250         * xterm.c: Adjust users.
3252 2012-08-13  Dmitry Antipov  <dmantipov@yandex.ru>
3254         Use BSET for write access to Lisp_Object members of struct buffer.
3255         * buffer.h (BSET): New macro.
3256         * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3257         * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3258         * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3259         * window.c, xdisp.c, xfns.c: Adjust users.
3261 2012-08-11  BT Templeton  <bpt@hcoop.net>  (tiny change)
3263         * lread.c (syms_of_lread): Initialize Vlexical_binding.
3265 2012-08-11  Jan Djärv  <jan.h.d@swipnet.se>
3267         * nsterm.m (not_in_argv): New function.
3268         (application:openFile, application:openTempFile:):
3269         (application:openFileWithoutUI:, application:openFiles:): Open file
3270         if not_in_argv returns non-zero (bug#12171).
3272         * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
3273         (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3274         Define for Gtk+ versions less than 3.2.
3275         (xg_get_font_name): Use those functions/macros here.
3276         Reported by Frans Oilinki <moilinki@gmail.com>.
3278 2012-08-11  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
3280         * unexmacosx.c (copy_data_segment): Copy initialized data in
3281         statically linked libraries from input file rather than memory.
3283         * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3284         LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3285         (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3287 2012-08-10  Glenn Morris  <rgm@gnu.org>
3289         * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3290         * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3292 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
3294         Fix last change to allow compilation with low optimization levels.
3295         * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3296         Reported by Jan Djärv <jan.h.d@swipnet.se>.
3298 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
3300         Use common inline syntax in intervals.h.
3301         * intervals.h (INTERVALS_INLINE): New macro.
3302         Change all users from LISP_INLINE.
3304 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
3306         Define Qnone once for all platforms.
3307         * frame.c (Qnone): Define here.
3308         (syms_of_frame): DEFSYM it.
3309         * lisp.h (Qnone): New declaration.
3310         * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3311         * xfns.c: Remove duplication.  Adjust users.
3313 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
3315         Remove unused macros from intervals.h.
3316         * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3317         * intervals.c: Adjust comment.
3319 2012-08-10  Eli Zaretskii  <eliz@gnu.org>
3321         * w32fns.c <w32_unicode_gui>: New static variable.
3322         (globals_of_w32fns): Initialize it according to os_subtype.
3323         (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3324         testing os_subtype.
3326 2012-08-10  Joakim Hårsman  <joakim.harsman@gmail.com>  (tiny change)
3327             Eli Zaretskii  <eliz@gnu.org>
3329         Fix bug #10299 with Unicode characters sent by customized
3330         keyboards created by MSKLC.
3331         * w32fns.c (INIT_WINDOW_CLASS): New macro.
3332         (w32_init_class): Use it to initialize the Emacs class with either
3333         ANSI or Unicode API calls.
3334         (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3335         later.
3336         (w32_wnd_proc): If the character code sent by WM_CHAR or
3337         WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3338         original message.  Call DefWindowProcW on NT and later.
3340 2012-08-10  Glenn Morris  <rgm@gnu.org>
3342         * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3344         * lisp.h (DIRECTORY_SEP): Let configure set it.
3346 2012-08-09  Dmitry Antipov  <dmantipov@yandex.ru>
3348         Use TSET for write access to Lisp_Object slots of struct terminal.
3349         * termhooks.h (TSET): New macro.
3350         * coding.c, terminal.c, xselect.c: Adjust users.
3352 2012-08-08  Stefan Monnier  <monnier@iro.umontreal.ca>
3354         * xdisp.c (safe_eval_handler): Remove prototype.  Receive args describing
3355         the failing expression, include them in the error message.
3356         * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3357         * lisp.h (internal_condition_case_n): Update declaration.
3359 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
3361         Inline functions to examine and change buffer overlays.
3362         * buffer.c (unchain_both): New function.
3363         * buffer.h (buffer_get_overlays, buffer_set_overlays):
3364         (buffer_has_overlays): New function.
3365         (enum overlay_type): New enum.
3366         * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3367         * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3369 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
3371         Inline functions to examine and change buffer intervals.
3372         * alloc.c (mark_interval_tree): Remove.
3373         (MARK_INTERVAL_TREE): Simplify.
3374         (UNMARK_BALANCE_INTERVALS): Remove.  Adjust users.
3375         * intervals.c (buffer_balance_intervals): New function.
3376         (graft_intervals_into_buffer): Adjust indentation.
3377         (set_intervals_multibyte): Simplify.
3378         * buffer.h (BUF_INTERVALS): Remove.
3379         (buffer_get_intervals, buffer_set_intervals): New function.
3380         * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3381         * intervals.c, textprop.c: Adjust users.
3383 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
3385         Inline functions to examine and change string intervals.
3386         * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3387         (string_get_intervals, string_set_intervals): New function.
3388         * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3389         * lread.c, print.c, textprop.c: Adjust users.
3391 2012-08-08  Glenn Morris  <rgm@gnu.org>
3393         * lisp.mk (lisp): Remove language/persian.elc.
3395 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
3397         Cleanup intervals.
3398         * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3399         (NULL_INTERVAL_P): Likewise.  Adjust users.
3400         (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3401         Adjust comment.  Move under #if 0.
3402         * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3403         * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3405 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
3407         Check total length of intervals with eassert.
3408         * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3409         * intervals.c: Change all users to eassert.
3411 2012-08-07  Eli Zaretskii  <eliz@gnu.org>
3413         * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3414         Rename fields to match removal of FGET and WGET and disuse of
3415         INTERNAL_FIELD in Lisp_Cons.
3417 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
3419         Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3420         * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3421         name since all xname users are fixed long time ago.  Do not
3422         use INTERNAL_FIELD.
3423         (set_symbol_name, set_symbol_function, set_symbol_plist):
3424         (set_symbol_next, set_overlay_plist): New function.
3425         (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3426         (struct Lisp_Overlay): Likewise.
3427         (CVAR, MVAR, SVAR): Remove.
3428         * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3429         * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3430         * xterm.c: Adjust users.
3431         * .gdbinit: Change to use name field of struct Lisp_Symbol
3432         where appropriate.
3434 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
3436         Basic functions to set Lisp_Object and pointer slots of intervals.
3437         * intervals.h (interval_set_parent, interval_set_object):
3438         (interval_set_left, interval_set_right, interval_set_plist):
3439         (interval_copy_parent): New function.
3440         (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
3441         (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3442         Adjust indentation.
3443         (INTERVAL_SIZE): Remove.  Adjust users.
3444         * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3446 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
3448         Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3449         * process.h (PGET): Remove.
3450         (struct Lisp_Process): Do not use INTERNAL_FIELD.
3451         * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3453 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
3455         Drop WGET and revert read access to Lisp_Objects slots of struct window.
3456         * window.h (WGET): Remove.
3457         (struct window): Do not use INTERNAL_FIELD.
3458         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3459         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3460         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3461         * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3462         * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3463         Adjust users.
3465 2012-08-07  Chong Yidong  <cyd@gnu.org>
3467         * window.c (Fwindow_edges, Fwindow_pixel_edges)
3468         (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3469         (Fdelete_window_internal): Signal an error if the window is not on
3470         a live frame (Bug#12025).
3472 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
3474         Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3475         * frame.h (FGET): Remove.
3476         (struct frame): Do not use INTERNAL_FIELD.
3477         * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3478         * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3479         * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3480         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3482 2012-08-06  Juanma Barranquero  <lekktu@gmail.com>
3484         * w32.c: Silence compiler warnings.
3485         (map_w32_filename): Remove unused variable `is_fat'.
3486         (chase_symlinks): Add parentheses around expression.
3488 2012-08-06  Glenn Morris  <rgm@gnu.org>
3490         * sysdep.c: Respect BROKEN_GETWD.
3492         * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3493         Let configure handle it.
3494         (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3496 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
3498         Use GCALIGNMENT where appropriate.
3499         * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3500         (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3501         (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3503 2012-08-06  Eli Zaretskii  <eliz@gnu.org>
3505         * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3506         Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
3508 2012-08-06  Stefan Monnier  <monnier@iro.umontreal.ca>
3510         * buffer.h (struct buffer): Revert `indirections' to a simple int;
3511         that should be sufficient for everyone.
3513 2012-08-06  Jan Djärv  <jan.h.d@swipnet.se>
3515         * keyboard.c (timer_check_2): Add break so timer_check returns next
3516         timeout.
3518 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
3520         Fix Windows build errors introduced after converting to WGET and WSET.
3521         * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3522         Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3524 2012-08-06  Jan Djärv  <jan.h.d@swipnet.se>
3526         * nsterm.m (ns_frame_rehighlight): Use FSET.
3528         * nsmenu.m (ns_update_menubar): Use FSET.
3530 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
3532         Separate read and write access to Lisp_Object slots of Lisp_Process.
3533         * process.h (PGET, PSET): New macros similar to AREF and ASET.
3534         * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3536 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
3538         Separate read and write access to Lisp_Object slots of struct window.
3539         * window.h (WGET, WSET): New macros similar to AREF and ASET.
3540         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3541         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3542         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3543         * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3544         * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3545         Adjust users.
3547 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
3549         Fix Windows build errors introduced after converting to FGET and FSET.
3550         * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3551         (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3552         (w32_judge_scroll_bars): Change to use FSET.
3553         Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3555 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
3557         Fix replacement typo.
3558         * window.c (replace_window): Set root_window instead of
3559         selected_window.  This fixes a total window subsystem
3560         malfunction reported by Bastien Guerry <bzg@gnu.org>.
3562 2012-08-06  Glenn Morris  <rgm@gnu.org>
3564         * lisp.mk (lisp): Add language/persian.elc.
3566 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
3568         Separate read and write access to Lisp_Object slots of struct frame.
3569         * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3570         * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3571         * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3572         * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3573         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3575 2012-08-05  Andreas Schwab  <schwab@linux-m68k.org>
3577         * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3579 2012-08-05  Dmitry Antipov  <dmantipov@yandex.ru>
3581         Generalize common compile-time constants.
3582         * lisp.h (header_size, bool_header_size, word_size): Now here.
3583         (struct Lisp_Vector): Add comment.
3584         (struct Lisp_Bool_Vector): Move up to define handy constants.
3585         (VECSIZE, PSEUDOVECSIZE): Simplify.
3586         (SAFE_ALLOCA_LISP): Use new constant.  Adjust indentation.
3587         * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3588         * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3589         * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3590         * xfont.c, xmenu.c: Use word_size where appropriate.
3592 2012-08-05  Lawrence Mitchell  <wence@gmx.li>
3594         * search.c (Freplace_match): Treat \? in the replacement text
3595         literally (Bug#8161).
3597 2012-08-05  Chong Yidong  <cyd@gnu.org>
3599         * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3600         * frame.c (Vdelete_frame_functions):
3601         * emacs.c (Vkill_emacs_hook): Doc fix.
3603 2012-08-04  Eli Zaretskii  <eliz@gnu.org>
3605         * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3606         --with-x-toolkit=no builds.
3607         Reported by Carsten Mattner <carstenmattner@gmail.com>.
3609 2012-08-04  Chong Yidong  <cyd@gnu.org>
3611         * syntax.c (Fmodify_syntax_entry): Doc fix.
3613 2012-08-04  Eli Zaretskii  <eliz@gnu.org>
3615         Fix startup warnings about ../site-lisp on MS-Windows.  (Bug#11959)
3616         * w32.c (init_environment): Change the default values of many
3617         environment variables in dflt_envvars[] to NULL, to avoid pushing
3618         them into environment when they were not already defined.
3619         Remove the code that deletes site-lisp subdirectories from the default
3620         value of EMACSLOADPATH, as it is no longer needed.
3621         (check_windows_init_file): Now external, not static.
3622         Use Vload_path as is, without adding anything, as this function is now
3623         called when Vload_path is already set up.
3625         * w32.h (check_windows_init_file): Add prototype.
3627         * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3628         directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3629         compatibility with Posix platforms.
3630         (main): Move the call to check_windows_init_file to here from
3631         w32.c.
3632         (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3633         any, in the DEFALT argument into the root of the Emacs build or
3634         installation tree, as appropriate.
3636         * callproc.c (init_callproc_1): Call decode_env_path instead of
3637         doing its equivalent by hand.
3638         (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3639         the code that sets Vexec_path run on MS-Windows.
3641         * lread.c (init_lread): Add comments to #ifdef's.
3643         * msdos.c (dos_set_window_size, IT_update_begin)
3644         (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3645         instead of direct references.
3647 2012-08-04  Paul Eggert  <eggert@cs.ucla.edu>
3649         Export DEFAULT_REHASH_* to GDB.
3650         * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3651         Now constants, not macros.
3653 2012-08-03  Paul Eggert  <eggert@cs.ucla.edu>
3655         Remove unnecessary casts involving pointers.
3656         These casts are no longer needed now that we assume C89 or later,
3657         since they involve casting to or from void *.
3658         * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3659         (make_pure_float, make_pure_vector):
3660         * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3661         * macros.c (Fstart_kbd_macro):
3662         * menu.c (find_and_return_menu_selection):
3663         * minibuf.c (read_minibuf_noninteractive):
3664         * sysdep.c (closedir):
3665         * xdisp.c (x_produce_glyphs):
3666         * xfaces.c (compare_fonts_by_sort_order):
3667         * xfns.c (x_real_positions, select_visual):
3668         * xselect.c (x_stop_queuing_selection_requests)
3669         (x_get_window_property, x_get_window_property_as_lisp_data):
3670         * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3671         Remove unnecessary pointer casts.
3672         * alloc.c (record_xmalloc): New function.
3673         * lisp.h (record_xmalloc): New decl.
3674         (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3675         more like a function.  This is because the pointer cast is not
3676         needed.  All uses changed.
3677         * print.c (print_string, print_error_message): Avoid length recalc.
3679         Improve fix for macroexp crash with debugging (Bug#12118).
3680         * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3681         ARRAY_MARK_FLAG when checking subscripts, because ASET is
3682         not supposed to be invoked from the garbage collector.
3683         See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3684         (gc_aset): New function, which is like ASET but can be
3685         used in the garbage collector.
3686         (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3687         (set_hash_index): Use it instead of ASET.
3689 2012-08-03  Eli Zaretskii  <eliz@gnu.org>
3691         Support symlinks on latest versions of MS-Windows.
3692         * w32.c: Include winioctl.h and aclapi.h.
3693         (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3694         (revert_to_self): Forward declarations of static functions.
3695         <static BOOL g_b_init_get_security_info>:
3696         <g_b_init_create_symbolic_link>: New static flags.
3697         (globals_of_w32): Initialize them to zero.
3698         (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3699         (map_w32_filename): Improve commentary.  Simplify switch.
3700         (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3701         headers (most versions of MinGW w32api don't).
3702         (get_security_info, create_symbolic_link)
3703         (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3704         New functions.
3705         (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3706         in the argument file name.
3707         (sys_access): Call unc_volume_file_attributes only if
3708         GetFileAttributes fails with network-related error codes.
3709         (sys_rename): Diagnose renaming of a symlink when the user doesn't
3710         have the required privileges.
3711         (get_file_security_desc_by_name): Rename from
3712         get_file_security_desc.
3713         (stat_worker): New function, with most of the guts of 'stat', and
3714         with addition of handling of symlinks and support for 'lstat'.
3715         If possible, get file's attributes and security information by
3716         handle, not by name.  Produce S_IFLNK bit for symlinks, when
3717         called from 'lstat'.
3718         (stat, lstat): New functions, call 'stat_worker'.
3719         (symlink, readlink, careadlinkat): Rewritten to create and resolve
3720         symlinks when the underlying filesystem supports them.
3722 2012-08-02  Paul Eggert  <eggert@cs.ucla.edu>
3724         Fix macroexp crash on Windows with debugging (Bug#12118).
3725         * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3726         checking subscripts; problem introduced with the recent
3727         "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3728         (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3729         since it's used in non-static inline functions now.
3731         * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3732         Don't assume buffer size fits in 'int'.  Remove unused local.
3734         Use C99-style 'extern inline' if available.
3735         * buffer.h (BUFFER_INLINE):
3736         * category.h (CATEGORY_INLINE):
3737         * character.h (CHARACTER_INLINE):
3738         * charset.h (CHARSET_INLINE):
3739         * composite.h (COMPOSITE_INLINE):
3740         * dispextern.h (DISPEXTERN_INLINE):
3741         * lisp.h (LISP_INLINE):
3742         * systime.h (SYSTIME_INLINE):
3743         New macro, replacing 'static inline' in this header.
3744         * buffer.h, category.h, character.h, charset.h, composite.h:
3745         * dispextern.h, lisp.h, systime.h:
3746         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3747         * alloc.c (LISP_INLINE):
3748         * buffer.c (BUFFER_INLINE):
3749         * category.c (CATEGORY_INLINE):
3750         * character.c (CHARACTER_INLINE):
3751         * charset.c (CHARSET_INLINE):
3752         * composite.c (COMPOSITE_INLINE):
3753         * dispnew.c (DISPEXTERN_INLINE):
3754         * sysdep.c (SYSTIME_INLINE):
3755         Define to EXTERN_INLINE, so that the corresponding functions
3756         are compiled into code.
3757         * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3758         (INLINE_HEADER_END): New macros.
3759         * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3760         since it's used in non-static inline functions now.
3761         (VALMASK) [!USE_LSB_TAG]: Likewise.
3763 2012-08-02  Glenn Morris  <rgm@gnu.org>
3765         * s/: Remove empty directory.
3767         * s/ms-w32.h: Move to ../nt/inc.
3768         * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3769         Update for new ms-w32.h location.
3771 2012-08-02  Paul Eggert  <eggert@cs.ucla.edu>
3773         Port to Solaris 8.
3774         * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3776 2012-08-02  Glenn Morris  <rgm@gnu.org>
3778         * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3779         hard-coding the path separator.
3781 2012-08-01  Paul Eggert  <eggert@cs.ucla.edu>
3783         Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3784         This how ASET and AREF are supposed to work, and makes
3785         it easier to think about future improvements.  See
3786         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3787         * charset.h (set_charset_attr): New function.
3788         All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3789         * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3790         (aref_addr): New function.  All uses of &AREF(...) changed.
3791         (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3792         (set_hash_index): New functions.  All lvalue-style uses of
3793         HASH_KEY etc. changed.
3794         * keyboard.c (set_prop): New function.  All lvalue-style uses
3795         of PROP changed.
3797 2012-08-01  Alp Aker  <alp.tekin.aker@gmail.com>
3799         * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3800         (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3801         (EmacsScroller-dealloc):  Adjust to use WVAR.  (Bug#12114)
3802         * nsfns.m (ns_set_name_as_filename): Likewise.
3803         * nsmenu.m (ns_update_menubar): Likewise.
3804         * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3806 2012-08-01  Eli Zaretskii  <eliz@gnu.org>
3808         * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3809         Adapt to latest changes in field names of the corresponding Lisp
3810         objects.
3812         * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3814 2012-08-01  Glenn Morris  <rgm@gnu.org>
3816         * s/msdos.h: Remove file.
3817         * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3818         * Makefile.in (S_FILE): Remove.
3819         (config_h): Remove S_FILE.
3821 2012-08-01  Juanma Barranquero  <lekktu@gmail.com>
3823         * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3824         Remove; moved to nt/config.nt.
3826 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
3828         Use INTERNAL_FIELD for conses and overlays.
3829         * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3830         Remove obsolete comment.
3831         (MVAR): New macro.
3832         (struct Lisp_Overlay): Use INTERNAL_FIELD.
3833         * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3835 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
3837         Use INTERNAL_FIELD for symbols.
3838         * lisp.h (SVAR): New macro.  Adjust users.
3839         * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3840         * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3842 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
3844         Use INTERNAL_FIELD for processes.
3845         * process.h (PVAR): New macro.  Adjust style.
3846         (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3847         * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3849 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
3851         Use INTERNAL_FIELD for windows.
3852         * window.h (WVAR): New macro.
3853         (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3854         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3855         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3856         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3857         * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3858         * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3860 2012-08-01  Paul Eggert  <eggert@cs.ucla.edu>
3862         * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3864 2012-08-01  Glenn Morris  <rgm@gnu.org>
3866         * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3867         Move to configure.ac.
3869 2012-08-01  Juanma Barranquero  <lekktu@gmail.com>
3871         * makefile.w32-in (CONFIG_H): Update dependencies.
3872         (CONF_POST_H): New macro.
3874         * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3876 2012-07-31  Glenn Morris  <rgm@gnu.org>
3878         * Makefile.in (S_FILE): No longer set by configure.
3880         * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3881         is available.
3882         (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3884         * process.h (NULL_DEVICE):
3885         * emacs.c (SEPCHAR):
3886         * editfns.c (USER_FULL_NAME): Let configure set them.
3888         * s/README, s/template.h: Remove files.
3890         * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3892         * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3893         Move to configure.ac.
3895 2012-07-31  Eli Zaretskii  <eliz@gnu.org>
3897         * .gdbinit (xframe): Adapt to introduction of FVAR and the
3898         resulting renaming of 'struct frame' members.
3900         * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3902         * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3903         after introduction of FVAR.
3905 2012-07-31  Jan Djärv  <jan.h.d@swipnet.se>
3907         * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3909         * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3910         instead of compositeToPoint.
3911         (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3913         * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
3915 2012-07-31  Dmitry Antipov  <dmantipov@yandex.ru>
3917         Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3918         * lisp.h (INTERNAL_FIELD): New macro.
3919         * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
3920         (BVAR): Change to use INTERNAL_FIELD.
3921         * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3922         (KVAR): Change to use INTERNAL_FIELD.
3923         * frame.h (FVAR): New macro.
3924         (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3925         * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3926         * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3927         * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3928         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3930 2012-07-31  Dmitry Antipov  <dmantipov@yandex.ru>
3932         Miscellaneous fixes for non-default X toolkits.
3933         * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3934         * xterm.c (x_frame_of_widget): Remove redundant prototype.
3935         Move under #ifdef USE_LUCID.
3936         (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3937         definition and usage to avoid warnings.
3939 2012-07-31  Jan Djärv  <jan.h.d@swipnet.se>
3941         * nsterm.m (openFiles): Fix previous checkin.
3943 2012-07-31  Paul Eggert  <eggert@cs.ucla.edu>
3945         * indent.c (compute_motion): Remove unused local.
3947 2012-07-31  Glenn Morris  <rgm@gnu.org>
3949         * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3951         * conf_post.h [USG5_4]:
3952         Move remaining contents of s/usg5-4-common.h here.
3953         * s/usg5-4-common.h: Remove file.
3955         * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3956         * s/irix6-5.h: Remove file.
3958         * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3959         * s/darwin.h: Remove file.
3961         * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3962         * s/hpux10-20.h: Remove file, which is now empty.
3964 2012-07-30  Glenn Morris  <rgm@gnu.org>
3966         * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3967         * Makefile.in (config_h): Add conf_post.h.
3968         * makefile.w32-in (CONFIG_H): Add conf_post.h.
3970 2012-07-30  Jan Djärv  <jan.h.d@swipnet.se>
3972         * nsterm.m (ns_do_open_file): New variable.
3973         (ns_term_init): Set ns_do_open_file to YES after run returns.
3974         (openFile, openTempFile, openFileWithoutUI, openFiles):
3975         Open files only if ns_do_open_file.
3977 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
3979         * lisp.h (SWITCH_ENUM_CAST): Remove.  All uses removed.
3980         This no-op macro hasn't been needed for many years.
3981         * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3983         Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3984         * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3985         * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3986         gdb_make_enums_visible.
3987         (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3988         (DIRECTORY_SEP): Now a constant, not a macro.
3990 2012-07-30  Eli Zaretskii  <eliz@gnu.org>
3992         * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3993         w32_kbd_patch_key as the 2nd arg.  (Bug#12082)
3995         * w32term.c <w32_keyboard_codepage>: Renamed from
3996         keyboard_codepage and now external.  All users changed.
3998         * w32term.h: Add declaration of w32_keyboard_codepage.
4000         * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
4001         the codepage to translate keys to Unicode.  If this argument is
4002         -1, use the value returned by GetConsoleCP.  All callers changed.
4004 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
4006         Update .PHONY listings in makefiles.
4007         * Makefile.in (.PHONY): Add all, mostlyclean, clean,
4008         bootstrap-clean, distclean, maintainer-clean, versioclean,
4009         extraclean, frc.
4011         * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
4012         This is a bit clearer.  Fix some commentary typos.
4014 2012-07-30  Glenn Morris  <rgm@gnu.org>
4016         * s/netbsd.h: Let configure include signal.h if needed.
4017         Remove file, which is now empty.
4019         * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
4020         Let configure set them.
4021         * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
4022         No more need to undefine.
4024 2012-07-30  Andreas Schwab  <schwab@linux-m68k.org>
4026         * keymap.c (Fkey_description): Don't remove 0x80 bit from
4027         non-single-byte char when adding meta modifier.  (Bug#12090)
4029 2012-07-30  Dmitry Antipov  <dmantipov@yandex.ru>
4031         Convert safe_call to use variable number of arguments.
4032         * xdisp.c (safe_call): Convert to use varargs.  Adjust users.
4033         (safe_call2): Fix comment.
4034         * lisp.h (safe_call): Adjust prototype.
4035         * coding.c (encode_coding_object): Change to use safe_call2.
4036         * xfaces.c (merge_face_heights): Change to use safe_call1.
4038 2012-07-30  Glenn Morris  <rgm@gnu.org>
4040         * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
4041         does that unconditionally.  Remove file, which is now empty.
4043         * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
4044         Remove empty files.
4046 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
4048         Export to GDB most of lisp.h's remaining object-like macros.
4049         * lisp.h (min, max): Move earlier, because they're used earlier now.
4050         (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
4051         (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
4052         (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
4053         (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
4054         (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
4055         (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
4056         (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
4057         (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
4058         Now constants, for GDB.  They need not be macros.
4059         (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
4060         Now constants, for GDB, as well as macros, for static initializers.
4061         (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
4062         Move to after the definition of struct Lisp_Char_Table,
4063         since the former now needs that type defined.
4064         (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
4065         (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
4066         (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
4067         New enums, for gdb_make_enums_visible.
4068         (GLYPH_MODE_LINE_FACE): Remove; unused.
4069         * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
4070         (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
4071         CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
4072         enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
4073         enum maxargs, enum MAX_ALLOCA.
4074         (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
4075         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
4076         no longer needed, now that they are done in lisp.h.
4078 2012-07-30  Dmitry Antipov  <dmantipov@yandex.ru>
4080         Cleanup string bytes checking.
4081         * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove.  Convert
4082         all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
4083         (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
4084         (check_sblock, compact_small_strings): Simplify.
4086 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
4088         * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
4089         These macros are confusing and no longer need to be defined, as
4090         the enum values now suffice.  All uses replaced with definiens.
4091         (Lisp_Int1, Lisp_String): Define directly; this is clearer.
4093 2012-07-29  Juanma Barranquero  <lekktu@gmail.com>
4095         * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
4096         ($(BLD)/w32console.$(O)): Update dependencies.
4098 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
4100         Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
4101         * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
4102         time.  Adjust users.
4103         (CHECK_CONS_LIST): Remove.  Convert all users to check_cons_list.
4105 2012-07-29  Jan Djärv  <jan.h.d@swipnet.se>
4107         * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
4108         setting sitelisp (Bug#12010).
4110 2012-07-29  Eli Zaretskii  <eliz@gnu.org>
4112         * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
4114         * w32heap.c (cache_system_info):
4115         * w32.c (sys_rename):
4116         * w32proc.c (find_child_console, sys_kill): All users changed.
4118 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
4120         * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4122 2012-07-29  Eli Zaretskii  <eliz@gnu.org>
4124         * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4126 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
4128         Cleanup statistics calculation in Fgarbage_collect.
4129         * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4130         Fix zombies percentage calculation.  Simplify elapsed time calculation.
4132 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
4134         Generalize marker debugging code under MARKER_DEBUG and use eassert.
4135         * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
4136         (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
4137         (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
4138         (replace_range, replace_range_2, del_range_2): Change to eassert.
4139         * marker.c (byte_char_debug_check): Adjust style.
4141 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
4143         Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4144         * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4145         long-ago-commented-out code that talks about "WIN32".
4146         * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4147         All uses changed.
4149 2012-07-28  Paul Eggert  <eggert@cs.ucla.edu>
4151         Use Gnulib stdalign module (Bug#9772, Bug#9960).
4152         * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4153         Simplify by using alignof.
4154         (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4155         * lisp.h: Include <stdalign.h>.
4156         (GCALIGNMENT): New macro and constant.
4157         (DECL_ALIGN): Remove.  All uses replaced by alignas (GCALIGNMENT).
4158         (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4159         (stdalign): New macro, if not already defined.
4161 2012-07-28  Eli Zaretskii  <eliz@gnu.org>
4163         Fix non-ASCII input in non-GUI frames on MS-Windows.  (Bug#12055)
4164         * w32inevt.c: Include w32inevt.h.
4165         (w32_read_console_input): New inline function, calls either
4166         ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4167         w32_console_unicode_input.
4168         (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4169         (w32_kbd_patch_key, key_event): Use the codepage returned by
4170         GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4171         (key_event): use uChar.UnicodeChar only if
4172         w32_console_unicode_input is non-zero.
4174         * w32console.c: Include w32heap.h.
4175         <w32_console_unicode_input>: New global variable.
4176         (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4177         family of Windows, zero otherwise.
4179         * w32inevt.h: Declare w32_console_unicode_input.
4181         * xdisp.c (init_iterator): Don't reference tip_frame in a build
4182         --without-x.  (Bug#11742)
4184 2012-07-27  Paul Eggert  <eggert@cs.ucla.edu>
4186         Adjust GDB to reflect pvec_type changes (Bug#12036).
4187         * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
4188         2012-07-04 changes to pseudovector representation.
4189         Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
4191 2012-07-27  Michael Albinus  <michael.albinus@gmx.de>
4193         * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4194         bus address.
4195         (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4197 2012-07-27  Eli Zaretskii  <eliz@gnu.org>
4199         * alloc.c (listn): Fix the order the arguments are consed onto the
4200         list.
4202         * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4203         enumeration constants, as PURE and HEAP are too general, and clash
4204         with other headers and sources, such as gmalloc.c and the
4205         MS-Windows system headers.  All users changed.
4207 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
4209         Revert last save_excursion_save and save_excursion_restore changes.
4210         * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4211         Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4213 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
4215         Fix recently-introduced typos in Windows port.
4216         Reported by Martin Rudalics <rudalics@gmx.at>.
4217         * w32.c (init_environment): Replace comma with semicolon.
4218         * w32fns.c (syms_of_w32fns): Add missing parenthesis.
4220 2012-07-27  Paul Eggert  <eggert@cs.ucla.edu>
4222         Improve GDB symbol export (Bug#12036).
4223         * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4224         arms of an 'if', not using conditional expressions; otherwise GDB
4225         complains about the types in the unevaluated arm when the argument
4226         is an integer literal.
4227         (xgetint): Simplify expression.
4228         * alloc.c (gdb_make_enums_visible): New constant.  This ports to
4229         GCC 3.4.2 the export of symbols to GDB.  Problem reported by Eli
4230         Zaretskii in <http://bugs.gnu.org/12036#13>.
4231         * lisp.h (PUBLISH_TO_GDB): Remove.  All uses removed.  No longer
4232         needed now that we have gdb_make_enums_visible.
4233         (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4234         (enum enum_USE_LSB_TAG):
4235         New enum types, packaging up enums that need to be exported to GDB.
4237 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
4239         Utility function to make a list from specified amount of objects.
4240         * lisp.h (enum constype): New datatype.
4241         (listn): New prototype.
4242         * alloc.c (listn): New function.
4243         (Fmemory_use_count, syms_of_alloc): Use it.
4244         * buffer.c (syms_of_buffer): Likewise.
4245         * callint.c (syms_of_callint): Likewise.
4246         * charset.c (define_charset_internal): Likewise.
4247         * coding.c (syms_of_coding): Likewise.
4248         * keymap.c (syms_of_keymap): Likewise.
4249         * search.c (syms_of_search): Likewise.
4250         * syntax.c (syms_of_syntax): Likewise.
4251         * w32.c (init_environment): Likewise.
4252         * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4253         * xdisp.c (syms_of_xdisp): Likewise.
4254         * xfns.c (syms_of_xfns): Likewise.
4256 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
4258         Fast save_excursion_save and save_excursion_restore.
4259         * lisp.h (struct Lisp_Excursion): New data type.
4260         (PVEC_EXCURSION): New pseudovector type.
4261         (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4262         to deal with it.  Adjust comments.
4263         (init_marker, attach_marker): New prototype.
4264         (unchain_marker): Adjust prototype.
4265         * marker.c (attach_marker): Change to global.
4266         (init_marker): New function.
4267         * alloc.c (Fmake_marker, build_marker): Use it.
4268         (build_marker): More easserts.
4269         (mark_object): Handle struct Lisp_Excursion.
4270         * editfns.c (save_excursion_save, save_excursion_restore):
4271         Reimplement to use struct Lisp_Excursion.  Add comments.
4273 2012-07-26  Paul Eggert  <eggert@cs.ucla.edu>
4275         Fix export of symbols to GDB (Bug#12036).
4276         * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4277         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4278         emacs.c, as this is a more-suitable home.  Had this been done earlier
4279         the fix for 12036 would have avoided some of the problems noted in
4280         <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4281         would have been more obvious.
4282         * emacs.c: Do not include <verify.h>; no longer needed.
4283         (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
4284         (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4285         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4286         Remove; now done in lisp.h.
4287         * lisp.h (PUBLISH_TO_GDB): New macro.
4288         (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4289         (DATA_SEG_BITS): Use it.
4290         (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4291         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4292         * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4293         not be usable in #if.  This simplifies things.
4295 2012-07-26  Juanma Barranquero  <lekktu@gmail.com>
4297         * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4299 2012-07-26  Paul Eggert  <eggert@cs.ucla.edu>
4301         Simplify export of symbols to GDB (Bug#12036).
4302         * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4303         $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4304         (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4305         Adjust to changes in lisp.h and emacs.c, by using
4306         CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4307         of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4308         INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4309         gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4310         instead of gdb_valbits.
4311         (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4312         PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4313         instead of gdb_array_mark_flag.
4314         (xboolvector): Get size from $->size, not $->header.size.
4315         Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4316         (xreload, hook-run, hookpost-run): Remove.
4317         * emacs.c: Include <verify.h>.
4318         (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4319         (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4320         Remove.
4321         (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4322         (gdb_USE_LSB_TAG): New enum constants.
4323         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4324         Also define these as enum constants, so they're visible to GDB.
4325         (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4326         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4327         as constants, so they're visible to GDB.
4328         * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4329         (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4330         Now enum constants, not macros, so they're visible to GDB.
4331         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4332         more convenient now.  All uses changed.
4333         (VALMASK) [USE_LSB_TAG]: Also define in this case.
4334         * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4336 2012-07-26  Dmitry Antipov  <dmantipov@yandex.ru>
4338         Explicitly free restriction data that are not needed anymore.
4339         * editfns.c (save_restriction_restore): Free restriction data.
4341 2012-07-26  Stefan Monnier  <monnier@iro.umontreal.ca>
4343         * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4344         add argument, tune behavior, and adjust all callers.
4346 2012-07-25  Paul Eggert  <eggert@cs.ucla.edu>
4348         Use typedef for EMACS_INT, EMACS_UINT.
4349         * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4350         than macros.  This simplifies debugging in the usual case, since
4351         it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4352         and it allows expressions involving EMACS_INT casts.
4353         * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4355 2012-07-25  Jan Djärv  <jan.h.d@swipnet.se>
4357         * nsterm.m (ns_read_socket): Return early if there is a modal
4358         window (Bug#12043).
4360 2012-07-25  Martin Rudalics  <rudalics@gmx.at>
4362         * frame.c (Fredirect_frame_focus): In doc-string don't mention
4363         that FOCUS-FRAME can be omitted.
4365 2012-07-25  Dmitry Antipov  <dmantipov@yandex.ru>
4367         Adjust buffer text indirection counters at the end of Fkill_buffer.
4368         * buffer.c (Fkill_buffer): Adjust indirection counters when the
4369         buffer is definitely dead.  This should really fix an issue reported
4370         by Christoph Scholtes again.  (Bug#12007).
4371         (init_buffer_once): Initialize indirection counters of
4372         buffer_defaults and buffer_local_symbols (for sanity and safety).
4374 2012-07-24  Eli Zaretskii  <eliz@gnu.org>
4376         * xdisp.c (init_iterator): Don't compute dimensions of truncation
4377         and continuation glyphs on tooltip frames, leave them at zero.
4378         Avoids continued lines in tooltips.  (Bug#11832)
4380 2012-07-24  Dmitry Antipov  <dmantipov@yandex.ru>
4382         Simplify copy_overlay.
4383         * buffer.c (copy_overlay): Simplify.  Use build_marker.
4384         * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4386 2012-07-23  Eli Zaretskii  <eliz@gnu.org>
4388         * print.c (print_object): Don't crash when a frame's name is nil
4389         or invalid.  (Bug#12025)
4391         * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4392         it signals an error when a tooltip frame is being created.
4394 2012-07-23  Dmitry Antipov  <dmantipov@yandex.ru>
4396         Cleanup miscellaneous objects allocation and initialization.
4397         * alloc.c (allocate_misc): Change to static.  Add argument to
4398         specify the subtype.  Adjust comment and users.
4399         (build_overlay): New function.
4400         * buffer.c (copy_overlays, Fmake_overlay): Use it.
4401         * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4402         (allocate_misc): Remove prototype.
4403         (build_overlay): Add prototype.
4405 2012-07-23  Dmitry Antipov  <dmantipov@yandex.ru>
4407         Swap buffer text indirection counters in Fbuffer_swap_text.
4408         * buffer.c (Fbuffer_swap_text): Swap indirections too.
4409         This avoids crash reported by Christoph Scholtes at
4410         http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4412 2012-07-22  Jan Djärv  <jan.h.d@swipnet.se>
4414         * nsmenu.m (Popdown_data): New struct.
4415         (pop_down_menu): p->pointer is Popdown_data.  Release the pool and
4416         free Popdown_data.
4417         (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4418         (initWithContentRect): Make imgView and contentView non-static
4419         and autorelease them.  Also autorelease img and matrix (Bug#12005).
4420         (dealloc): Remove (Bug#12005).
4422 2012-07-22  Dmitry Antipov  <dmantipov@yandex.ru>
4424         Adjust consing_since_gc when objects are explicitly freed.
4425         * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4426         (Fgarbage_collect): Use it.  Change minimum to 1/10 of default.
4427         (free_cons, free_misc): Subtract object size from consing_since_gc.
4429 2012-07-22  Dmitry Antipov  <dmantipov@yandex.ru>
4431         Simplify and cleanup markers positioning code.
4432         * marker.c (attach_marker): More useful eassert.
4433         (live_buffer, set_marker_internal): New function.
4434         (Fset_marker, set_marker_restricted): Use set_marker_internal.
4435         (set_marker_both, set_marker_restricted_both): Use live_buffer.
4437 2012-07-22  Paul Eggert  <eggert@cs.ucla.edu>
4439         * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4440         as it's limited by the amount of memory, not by INT_MAX.
4442 2012-07-21  Eli Zaretskii  <eliz@gnu.org>
4444         * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4445         in special-event-map.  See the discussion at
4446         http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4447         for the reasons.
4449         * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
4450         info.dwItemData.  Fixes crashes on 64-bit Windows.
4451         Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
4453 2012-07-21  Jan Djärv  <jan.h.d@swipnet.se>
4455         * nsterm.m (accessibilityAttributeValue): New function.  (Bug#11134).
4456         (conversationIdentifier): Return value is NSInteger.
4457         * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
4459 2012-07-21  Chong Yidong  <cyd@gnu.org>
4461         * window.c (decode_any_window): Signal an error if the window is
4462         on a dead frame (Bug#11984).
4464 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
4466         Add indirection counting to speed up Fkill_buffer.
4467         * buffer.h (struct buffer): New member.
4468         * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4469         (Fmake_indirect_buffer): Set indirection counter to -1, increment
4470         base buffer indirection counter.
4471         (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4472         (Fkill_buffer): Adjust indirection counters as needed, don't walk
4473         through buffer list if indirection counter is 0.
4475 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
4477         Extend the value returned by Fgarbage_collect with heap statistics.
4478         * alloc.c (Qheap): New symbol.
4479         (syms_of_alloc): DEFSYM it.
4480         (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4481         (Fmemory_free): Remove.
4482         (syms_of_alloc): Don't defsubr it.
4483         * buffer.c (Fcompact_buffer): Remove.
4484         (syms_of_buffer): Don't defsubr it.
4486 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
4488         Make maybe_gc inline.
4489         Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4490         * lisp.h (consing_since_gc, gc_relative_threshold)
4491         (memory_full_cons_threshold): Revert declaration.
4492         (maybe_gc): Remove prototype, define as inline.
4493         * alloc.c: Remove old commented-out code.
4494         (consing_since_gc, gc_relative_threshold)
4495         (memory_full_cons_threshold): Revert to global.
4496         (maybe_gc): Remove.
4498 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
4500         Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4501         * lisp.h (build_unibyte_string): New function.
4502         * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4503         * sysdep.c, w32fns.c, xfns.c: Use it.
4504         * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4505         of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4506         Adjust users accordingly.
4507         * font.h (font_open_by_name): Adjust prototype.
4509 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
4511         Cleanup calls to Fgarbage_collect.
4512         * lisp.h (maybe_gc): New prototype.
4513         (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4514         Remove declarations.
4515         * alloc.c (maybe_gc): New function.
4516         (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4517         Make them static.
4518         * bytecode.c (MAYBE_GC): Use maybe_gc.
4519         * eval.c (eval_sub, Ffuncall): Likewise.
4520         * keyboard.c (read_char): Likewise.  Adjust call to maybe_gc
4521         to avoid dependency from auto-save feature.
4523 2012-07-19  Paul Eggert  <eggert@cs.ucla.edu>
4525         * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4526         (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4527         'for_each_per_buffer_object_at'.
4528         All uses changed.  It's better to use upper-case for macros that
4529         cannot be implemented as functions, to give the reader a clue
4530         that they're special.
4532 2012-07-19  Stefan Monnier  <monnier@iro.umontreal.ca>
4534         * alloc.c (Fgarbage_collect): Tweak docstring.
4536 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
4538         Tweak the value returned from Fgarbage_collect again.
4539         * alloc.c (Fgarbage_collect): New return value, as confirmed in
4540         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4541         Adjust documentation.
4542         (total_vector_bytes): Rename to total_vector_slots, adjust
4543         accounting.
4544         (total_free_vector_bytes): Rename to total_free_vector_slots,
4545         adjust accounting.
4546         (Qstring_bytes, Qvector_slots): New symbols.
4547         (syms_of_alloc): DEFSYM them.
4549 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
4551         Buffer compaction primitive which may be used from Lisp.
4552         * buffer.c (compact_buffer, Fcompact_buffer): New function.
4553         (syms_of_buffer): Register Fcompact_buffer.
4554         * alloc.c (Fgarbage_collect): Use compact_buffer.
4555         * buffer.h (compact_buffer): New prototype.
4556         (struct buffer_text): New member.
4558 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
4560         New macro to iterate over all buffers, miscellaneous cleanups.
4561         * lisp.h (all_buffers): Remove declaration.
4562         * buffer.h (all_buffers): Add declaration, with comment.
4563         (for_each_buffer): New macro.
4564         * alloc.c (Fgarbage_collect, mark_object): Use it.
4565         * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4566         (init_buffer): Likewise.
4567         * data.c (Fset_default): Likewise.
4568         * coding.c (code_conversion_restore): Remove redundant check
4569         for dead buffer.
4570         * buffer.c (Fkill_buffer): Likewise.  Remove obsolete comment.
4572 2012-07-18  Andreas Schwab  <schwab@linux-m68k.org>
4574         Fix bug that created negative-length intervals.
4575         * intervals.c (merge_interval_right, merge_interval_left):
4576         Do not zero out this interval if it is absorbed by its children,
4577         as this interval's total length doesn't change in that case.  See
4578         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4580 2012-07-18  Paul Eggert  <eggert@cs.ucla.edu>
4582         * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4583         when invoking (make-bool-vector N t) and N is a positive
4584         multiple of 8 -- the last 8 bits were mistakenly cleared.
4586         Remove some struct layout assumptions in bool vectors.
4587         * alloc.c (bool_header_size): New constant.
4588         (header_size, word_size): Move earlier, as they're now used earlier.
4589         Use 'word_size' in a few more places, where it's appropriate.
4590         (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4591         padding before the data member of a bool vector.
4592         (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4593         than doing the check by hand with an abort ().
4595 2012-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
4597         * eval.c (Fdefvar): Don't check constants since we only set the var if
4598         it's not yet defined anyway (bug#11904).
4600         * lisp.h (last_undo_boundary): Declare new var.
4601         * keyboard.c (command_loop_1): Set it.
4602         * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4603         were auto-added by the command loop (bug#11774).
4605 2012-07-18  Andreas Schwab  <schwab@linux-m68k.org>
4607         * w32font.c (Qsymbol): Remove local definition.
4608         (syms_of_w32font): Don't DEFSYM it.
4610 2012-07-18  Dmitry Antipov  <dmantipov@yandex.ru>
4612         Fix sweep_vectors to handle large bool vectors correctly.
4613         * alloc.c (sweep_vectors): Account total_vector_bytes for
4614         bool vectors larger than VBLOCK_BYTES_MAX.
4616 2012-07-18  Chong Yidong  <cyd@gnu.org>
4618         * frame.c (x_set_frame_parameters): Revert bogus change introduced
4619         in 2012-05-25 commit by Paul Eggert (Bug#11738).
4621 2012-07-18  Dmitry Antipov  <dmantipov@yandex.ru>
4623         Return more descriptive data from Fgarbage_collect.
4624         Suggested by Stefan Monnier in
4625         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4626         * alloc.c (bounded_number): New function.
4627         (total_buffers, total_vectors): New variable.
4628         (total_string_size): Rename to total_string_bytes, adjust users.
4629         (total_vector_size): Rename to total_vector_bytes, adjust users.
4630         (sweep_vectors): Account total_vectors and total_vector_bytes.
4631         (Fgarbage_collect): New return value.  Adjust documentation.
4632         (gc_sweep): Account total_buffers.
4633         (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4634         (VECTOR_SIZE): Remove.
4635         * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4636         (Qinterval, Qmisc): New symbols.
4637         (syms_of_data): Initialize them.
4638         * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4639         (Qcons, Qbuffer): New declarations.
4641 2012-07-17  Paul Eggert  <eggert@cs.ucla.edu>
4643         * alloc.c (Fmemory_free): Account for memory-free's own storage.
4644         Round up, not down.  Improve doc.
4646 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
4648         Restore old code in allocate_string_data to avoid Faset breakage.
4649         Reported by Julien Danjou <julien@danjou.info> in
4650         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4651         * alloc.c (allocate_string_data): Restore old code with minor
4652         adjustments, fix comment to explain this subtle issue.
4654 2012-07-17  Eli Zaretskii  <eliz@gnu.org>
4656         Remove FILE_SYSTEM_CASE.
4657         * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4659         * fileio.c (FILE_SYSTEM_CASE): Don't define.
4660         (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4661         Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4662         call-process-region passes it through expand-file-name.
4664         * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4666 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
4668         Fix crash when creating indirect buffer (Bug#11917)
4669         * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4670         Don't handle unbound variables specially if non-zero.
4671         (Fbuffer_local_variables): Pass zero.
4672         (clone_per_buffer_values): Pass non-zero.
4674 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
4676         * gnutls.c (emacs_gnutls_handshake): Revert last change.  Add QUIT
4677         to make the loop interruptible.
4679 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
4681         * gnutls.c (emacs_gnutls_handshake): Only retry if
4682         GNUTLS_E_INTERRUPTED.
4684 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
4686         Cleanup and convert miscellaneous checks to eassert.
4687         * alloc.c (mark_interval): Fix comment, partially rephrase
4688         old comment from intervals.h (see below).
4689         * intervals.c (find_interval, adjust_intervals_for_insertion)
4690         (delete_interval, adjust_intervals_for_deletion)
4691         (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4692         Convert to eassert.
4693         (adjust_intervals_for_insertion, make_new_interval):
4694         Remove obsolete and unused code.
4695         * intervals.h (struct interval): Remove obsolete comment.
4696         * textprotp.c (erase_properties): Remove unused code.
4697         (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4698         (Fremove_list_of_text_properties): Convert to eassert.
4700 2012-07-17  Chong Yidong  <cyd@gnu.org>
4702         * editfns.c (Finsert_char): Doc fix.
4704 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
4706         Fix previous change to make Fmemory_free always accurate.
4707         * alloc.c (make_interval): Update total_free_intervals.
4708         (make_float): Likewise for total_free_floats.
4709         (free_cons, Fcons): Likewise for total_free_conses.
4710         (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4711         Likewise for total_free_vector_bytes.
4712         (Fmake_symbol): Likewise for total_free_symbols.
4713         (bytes_free): Remove.
4715 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
4717         Simple free memory accounting feature.
4718         * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4719         (sweep_vectors): Accumulate size of free vectors.
4720         (Fgarbage_collect): Setup bytes_free.
4721         (Fmemory_free): New function.
4722         (syms_of_alloc): Register it.
4724 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
4726         Cleanup overlays checking.
4727         * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4728         * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4729         eassert and OVERLAYP.
4730         (sort_overlays): Change to use OVERLAYP.
4732 2012-07-16  René Kyllingstad  <Rene@Kyllingstad.com>  (tiny change)
4734         * editfns.c (Finsert_char): Make it interactive, and make the
4735         second arg optional.  Copy interactive spec and docstring from
4736         ucs-insert.
4738 2012-07-17  Paul Eggert  <eggert@cs.ucla.edu>
4740         * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4741         Unlike the other wrapped functions, fabs has an unspecified
4742         effect on errno.
4744 2012-07-16  Jan Djärv  <jan.h.d@swipnet.se>
4746         * nsterm.m (keyDown): Interpret flags without left/right bits
4747         as the left key (Bug#11670).
4749 2012-07-16  Dmitry Antipov  <dmantipov@yandex.ru>
4751         Remove empty and useless init functions.
4752         * lisp.h (init_character_once, init_fns, init_image)
4753         (init_filelock, init_sound): Remove prototype.
4754         * character.c (init_character_once): Remove.
4755         * filelock.c (init_filelock): Likewise.
4756         * fns.c (init_fns): Likewise.
4757         * image.c (init_image): Likewise.
4758         * sound.c (init_sound): Likewise.
4759         * emacs.c (main): Adjust accordingly.
4761 2012-07-16  Dmitry Antipov  <dmantipov@yandex.ru>
4763         * gtkutil.h: Tiny cleanups.
4764         (use_old_gtk_file_dialog): Remove useless declaration.
4765         (xg_uses_old_file_dialog): Add suggested const attribute.
4767 2012-07-15  Eli Zaretskii  <eliz@gnu.org>
4769         * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4770         (bidi_paragraph_init): Use it to limit search forward for a strong
4771         directional character in abnormally large paragraphs full of
4772         neutral or weak characters.  (Bug#11943)
4774 2012-07-15  Stefano Facchini  <stefano.facchini@gmail.com>  (tiny change)
4776         * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4777         the toolbar (Bug#9451).
4778         (xg_make_tool_item): Give the widget event box a transparent
4779         background.
4781 2012-07-15  Dmitry Antipov  <dmantipov@yandex.ru>
4783         Cleanup basic allocation variables and functions.
4784         * alloc.c (ignore_warnings, init_intervals, init_float)
4785         (init_cons, init_symbol, init_marker): Remove.
4786         (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4787         (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4788         (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4789         (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4790         (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4791         (staticidx, init_alloc_once, init_strings, free_ablock):
4792         Remove redundant initialization.
4793         * fns.c (init_weak_hash_tables): Remove.
4794         * lisp.h (init_weak_hash_tables): Remove prototype.
4796 2012-07-15  Dmitry Antipov  <dmantipov@yandex.ru>
4798         Use zero_vector where appropriate.
4799         * alloc.c (zero_vector): Define as Lisp_Object.  Adjust users
4800         accordingly.
4801         * lisp.h (zero_vector): New declaration.
4802         * font.c (null_vector): Remove.
4803         (syms_of_font): Remove initialization and staticpro.
4804         (font_list_entities, font_find_for_lface): Change to use zero_vector.
4805         * keymap.c (Faccessible_keymaps): Likewise.
4807 2012-07-15  Leo Liu  <sdl.web@gmail.com>
4809         * fringe.c: Fix typo in comments.
4811 2012-07-14  Leo Liu  <sdl.web@gmail.com>
4813         * fringe.c: Add a new bitmap exclamation-mark.
4815 2012-07-14  Eli Zaretskii  <eliz@gnu.org>
4817         * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4819         * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4820         (HAVE_MENUS): Don't define, defined by editing config.in with
4821         msdos/sed2v2.inp.
4822         (GMALLOC_INHIBIT_VALLOC): Don't define.
4823         (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4825 2012-07-14  Juanma Barranquero  <lekktu@gmail.com>
4827         * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4829 2012-07-14  Glenn Morris  <rgm@gnu.org>
4831         * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4832         * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4833         Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4835 2012-07-13  Glenn Morris  <rgm@gnu.org>
4837         * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4839         * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4840         * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4842 2012-07-13  Jan Djärv  <jan.h.d@swipnet.se>
4844         * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4845         (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4846         (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4847         (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4848         where appropriate.
4849         (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4850         as boolean expression.
4851         (x_set_window_size): Remove unused variable toolbar.
4852         (ns_get_color_default, ns_mod_to_lisp): Remove.
4853         (ns_mouse_position): Remove unused variables xchar and ychar.
4854         (ns_compute_glyph_string_overhangs): Remove unused variable face.
4855         (ns_set_vertical_scroll_bar): Remove unused variable count.
4856         (ns_delete_terminal): Remove unused variable i.
4857         (ns_term_init): Remove unused variables r, g and b.
4858         (mouseDown): Remove unused variable window.
4859         (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4860         (initFrameFromEmacs): Remove unused variable vbextra.
4861         (mouseEntered): Remove unused variables p and dpyinfo.
4862         (mouseExited): Remove unused variables p and r.
4863         (ns_define_frame_cursor, ns_clear_frame_area)
4864         (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4865         (menuDown): Assign [sender tag] to variable and cast the variable.
4867         * nsterm.h (menuDown): Add id as type to argument sender.
4868         (ns_display_info_for_name): Add Lisp_Object argument.
4869         (ns_term_init): Add Lisp_Object argument.
4870         (ns_map_event_to_object): Add void argument.
4871         (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4872         prototype with arguments and only declare if __OBJC__.
4873         (nxatoms_of_nsselect): Add void argument.
4874         (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4875         (ns_alloc_autorelease_pool): Add void argument.
4876         (ns_release_autorelease_pool): Add void* argument.
4877         (ns_get_defaults_value): Add const char* argument.
4879         * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4880         (initFromContents): Use SSDATA where appropriate.
4881         (ns_update_menubar): Add braces to ambigous if-else.
4882         (initWithTitle): Put () around assignment in if statement.
4883         (ns_menu_show): Remove unused variables window and keymap.
4884         (update_frame_tool_bar): Remove unused variable selected_p.
4885         (initWithContentRect): Remove unused variable this_cmd_name.
4887         * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4888         appropriate.
4889         (setXBMColor): Remove unused variable len.
4890         (setPixmapData): Put () around assignment in loop statement.
4892         * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4893         (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4894         where appropriate.
4895         (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4896         around assignment in loop statement.
4897         (nsfont_open): Remove unused variable i.
4898         (nsfont_open): Remove unused variable len.
4899         (nsfont_draw): Remove unused variable cs.
4901         * nsfns.m (x_set_icon_name, ns_set_name_internal)
4902         (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4903         (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4904         (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4905         (Fns_font_name, Fns_perform_service)
4906         (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4907         (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4908         (ns_set_name): Remove unused variable view.
4909         (x_set_menu_bar_lines): Remove unused variable olines.
4910         (x_set_tool_bar_lines): Remove unused variable root_window.
4911         (Fns_list_colors): Put () around assignment in while statement.
4912         (Fns_perform_service): Remove unused variable len.
4913         (Fns_display_usable_bounds): Remove unused variable top.
4914         (syms_of_nsfns): Remove unused variable i.
4916         * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4917         memcpy (Bug#11907).
4919 2012-07-13  Kalle Kankare  <kalle.kankare@iki.fi>  (tiny change)
4921         * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4922         and free it with DestroyExceptionInfo (Bug#11558).
4924 2012-07-13  Juanma Barranquero  <lekktu@gmail.com>
4926         * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4927         (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4928         Set here, not in nt/config.nt.
4930 2012-07-13  Eli Zaretskii  <eliz@gnu.org>
4932         * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4933         cursor overflow into the last glyph on display line when the right
4934         fringe is off.  (Bug#11832)
4936 2012-07-13  Paul Eggert  <eggert@cs.ucla.edu>
4938         * xdisp.c (produce_special_glyphs): Now static.
4939         * dispextern.h (produce_special_glyphs): Remove decl.
4941 2012-07-13  Glenn Morris  <rgm@gnu.org>
4943         * s/bsd-common.h, s/cygwin.h: Remove empty files.
4944         * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4946         * s/usg5-4-common.h (USG, USG5):
4947         * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4948         * s/sol2-6.h (SOLARIS2):
4949         * s/irix6-5.h (IRIX6_5):
4950         * s/hpux10-20.h (USG, USG5, HPUX):
4951         * s/gnu-linux.h (USG, GNU_LINUX):
4952         * s/freebsd.h (BSD_SYSTEM):
4953         * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4954         * s/cygwin.h (CYGWIN):
4955         * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4956         * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4958 2012-07-13  BT Templeton  <bpt@hcoop.net>  (tiny change)
4960         * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
4962 2012-07-13  Glenn Morris  <rgm@gnu.org>
4964         * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4966         * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4968         * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4969         * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4971 2012-07-12  Glenn Morris  <rgm@gnu.org>
4973         * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
4975         * process.c (init_process_emacs): Rename from init_process.
4976         The old name is also the name of a Mach system call.
4977         * lisp.h, emacs.c: Update for this name change.
4978         * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4979         longer needed.
4981 2012-07-12  Eli Zaretskii  <eliz@gnu.org>
4983         * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4984         memmove call that removes glyphs covered by the left truncation
4985         glyph.  Improve commentary.
4986         (display_line): Fix display of continuation glyphs on GUI frames
4987         when the right fringe is turned off and variable-size fonts are
4988         used in the window.  Move the code that appends a stretch glyph to
4989         produce_special_glyphs, so that it could be used for truncation
4990         and continuation glyphs alike.
4991         (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4992         glyph of a suitably computed width, to align the special glyphs at
4993         the window margin.  Code moved from display_line.  (Bug#11832)
4995 2012-07-12  Glenn Morris  <rgm@gnu.org>
4997         * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4999         * s/gnu-linux.h, s/hpux10-20.h:
5000         Do not unconditionally define HAVE_XRMSETDATABASE.
5002         * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
5004 2012-07-12  Paul Eggert  <eggert@cs.ucla.edu>
5006         Fix typos that broke OS X build.
5007         Reported by Randal L. Schwartz in
5008         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
5009         * nsterm.m (ns_timeout): Add missing local decl.
5010         (ns_get_color): snprintf -> sprintf, to fix typo.
5012 2012-07-12  Glenn Morris  <rgm@gnu.org>
5014         * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
5015         * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
5016         * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
5017         Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
5019         * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
5020         Move PTY_OPEN to configure.
5022         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5023         * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
5024         * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
5026 2012-07-12  Dmitry Antipov  <dmantipov@yandex.ru>
5028         Use empty_unibyte_string where applicable.
5029         * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
5030         * lread.c (read1): Likewise.
5031         * xsettings.c (syms_of_xsettings): Likewise.
5033 2012-07-12  Glenn Morris  <rgm@gnu.org>
5035         * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
5036         * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
5037         * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
5038         * s/hpux10-20.h (RUN_TIME_REMAP):
5039         * s/bsd-common.h (TABDLY): Move to configure.
5041         * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
5043         * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
5045         * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
5046         (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
5048         * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
5050         * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
5051         * s/template.h: Move NARROWPROTO to configure.
5053 2012-07-11  Glenn Morris  <rgm@gnu.org>
5055         * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
5056         unused since 2011-01-17 change to systty.h.
5058         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
5059         * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5060         Move HAVE_PTYS and HAVE_SOCKETS to configure.
5062 2012-07-11  Paul Eggert  <eggert@cs.ucla.edu>
5064         * s/sol2-6.h (HAVE_LIBKSTAT): Remove.  (Bug#11914)
5066 2012-07-11  Glenn Morris  <rgm@gnu.org>
5068         * s/darwin.h, s/gnu-linux.h, s/template.h:
5069         Move INTERRUPT_INPUT to configure.
5071 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
5073         Minor adjustments to interning code.
5074         * lisp.h (intern, intern_c_string): Redefine as static inline
5075         wrappers for intern_1 and intern_c_string_1, respectively.
5076         (intern_1, intern_c_string_1): Rename prototypes.
5077         * lread.c (intern_1, intern_c_string_1, oblookup):
5078         Simplify Vobarray checking.
5079         * font.c (font_intern_prop): Likewise.  Adjust comment.
5080         * w32font.c (intern_font_name): Likewise.
5082 2012-07-11  Andreas Schwab  <schwab@linux-m68k.org>
5084         * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
5086         * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
5087         of Fcar/Fcdr if possible.
5088         * font.c (check_otf_features): Likewise.
5089         * fontset.c (Fnew_fontset): Likewise.
5090         * gnutls.c (Fgnutls_boot): Likewise.
5091         * minibuf.c (read_minibuf): Likewise.
5092         * msdos.c (IT_set_frame_parameters): Likewise.
5093         * xmenu.c (Fx_popup_dialog): Likewise.
5094         * w32menu.c (Fx_popup_dialog): Likewise.
5096 2012-07-11  Glenn Morris  <rgm@gnu.org>
5098         * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
5099         since nothing has defined it on these platforms.
5101         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
5102         * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
5104         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5105         * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5106         Move CLASH_DETECTION to configure.
5108         * s/gnu.h: Remove file, which is now empty.
5110         * s/gnu.h, s/gnu-linux.h:
5111         Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5113 2012-07-11  John Wiegley  <johnw@newartisans.com>
5115         * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5116         function attribute, so we only use it if it exists in the
5117         compiler.
5119 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
5121         Avoid call to strlen in fast_c_string_match_ignore_case.
5122         * search.c (fast_c_string_match_ignore_case): Change to use
5123         length argument.  Adjust users accordingly.
5124         * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5126 2012-07-11  Paul Eggert  <eggert@cs.ucla.edu>
5128         Assume mkdir, rmdir.
5129         * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5130         * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5132         Assume rename.
5133         * sysdep.c (rename) [!HAVE_RENAME]: Remove.
5135         Assume perror.
5136         * s/hpux10-20.h (HAVE_PERROR): Remove.
5137         * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
5138         Remove dummy definition, as this problem was obsolete long ago.
5140         Assume strerror.
5141         * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5143 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
5145         Avoid calls to strlen in font processing functions.
5146         * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
5147         (font_open_by_name): Change to use length argument.
5148         Adjust users accordingly.
5149         * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5150         Adjust prototypes.
5151         * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5152         Change to return ptrdiff_t.
5153         (xfont_list_pattern, xfont_match): Use length returned by
5154         xfont_decode_coding_xlfd.
5155         * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5157 2012-07-11  Glenn Morris  <rgm@gnu.org>
5159         * s/darwin.h, s/freebsd.h, s/netbsd.h:
5160         Move DONT_REOPEN_PTY to configure.
5162         * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5163         * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5165 2012-07-10  Paul Eggert  <eggert@cs.ucla.edu>
5167         Remove "#define unix" that is no longer needed (Bug#11905).
5168         * s/aix4-2.h (unix): Remove; no longer needed.
5170         EMACS_TIME simplification (Bug#11875).
5171         This replaces macros (which typically do not work in GDB)
5172         with functions, typedefs and enums, making the code easier to debug.
5173         The functional style also makes code easier to read and maintain.
5174         * systime.h: Include <sys/time.h> on all hosts, not just if
5175         WINDOWSNT, since 'struct timeval' is needed in general.
5176         (EMACS_TIME): Now a typedef, not a macro.
5177         (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5178         not macros.
5179         (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5180         (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5181         (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5182         (EMACS_TIME_LE): Now functions, not macros.
5183         (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5184         (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5185         which are not functions.  All uses rewritten to use:
5186         (make_emacs_time): New function.
5187         (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5188         (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5189         not functions.  All uses rewritten to use the following, respectively:
5190         (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5191         (add_emacs_time, sub_emacs_time): New functions.
5192         * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
5193         * fileio.c (Fcopy_file):
5194         * xterm.c (XTflash): Get the current time closer to when it's used.
5195         * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5197         * bytecode.c (targets): Suppress -Woverride-init warnings.
5199         Simplify by avoiding confusing use of strncpy etc.
5200         * doc.c (Fsnarf_documentation):
5201         * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5202         * frame.c (Fmake_terminal_frame):
5203         * gtkutil.c (get_utf8_string):
5204         * lread.c (openp):
5205         * nsmenu.m (ns_update_menubar):
5206         * regex.c (regerror):
5207         Prefer memcpy to strncpy and strncat when either will do.
5208         * fileio.c (Fsubstitute_in_file_name):
5209         * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5210         (menu_separator_name_p):
5211         * nsmenu.m (ns_update_menubar):
5212         Prefer memcmp to strncmp when either will do.
5213         * nsterm.m: Include <ftoastr.h>.
5214         (ns_get_color):
5215         * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5216         Prefer snprintf to strncpy.
5217         * nsterm.m (ns_term_init):
5218         * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5219         * nsterm.m (ns_term_init):
5220         Avoid the need for strncpy, by using build_string or
5221         make_unibyte_string directly.  Use dtoastr, not snprintf.
5222         * process.c (Fmake_network_process): Diagnose service names that
5223         are too long, rather than silently truncating them or creating
5224         non-null-terminated names.
5225         (Fnetwork_interface_info): Likewise, for interface names.
5226         * sysdep.c (system_process_attributes) [GNU_LINUX]:
5227         Prefer sprintf to strncat.
5228         * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5229         Prefer vsnprintf to vsprintf + strncpy.
5231 2012-07-10  Glenn Morris  <rgm@gnu.org>
5233         * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5234         Clarify fallback case.
5236 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
5238         Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5239         * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5240         * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
5241         * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
5242         where argument type is known to be a Lisp_Cons.
5244 2012-07-10  Tom Tromey  <tromey@redhat.com>
5246         * bytecode.c (BYTE_CODE_THREADED): New macro.
5247         (BYTE_CODES): New macro.  Replaces all old byte-code defines.
5248         (enum byte_code_op): New type.
5249         (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5250         (exec_byte_code): Use them.  Use token threading when applicable.
5252 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
5254         Optimize pure C strings initialization.
5255         * lisp.h (make_pure_string): Fix prototype.
5256         (build_pure_c_string): New function, defined as static inline.  This
5257         provides a better opportunity to optimize away calls to strlen when
5258         the function is called with compile-time constant argument.
5259         * alloc.c (make_pure_c_string): Fix comment.  Change to add nchars
5260         argument, adjust users accordingly.  Use build_pure_c_string where
5261         appropriate.
5262         * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5263         * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5264         * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5266 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
5268         Avoid calls to strlen in miscellaneous functions.
5269         * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5270         * font.c (Ffont_xlfd_name): Likewise.  Change to call make_string.
5271         * lread.c (openp): Likewise.
5273 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
5275         Avoid calls to strlen in path processing functions.
5276         * fileio.c (file_name_as_directory): Add comment.  Change to add
5277         srclen argument and return the length of result.  Adjust users
5278         accordingly.
5279         (directory_file_name): Fix comment.  Change to add srclen argument,
5280         swap 1st and 2nd arguments to obey the common convention.
5281         Adjust users accordingly.
5282         * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5284 2012-07-10  Glenn Morris  <rgm@gnu.org>
5286         * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5287         Move PENDING_OUTPUT_COUNT definition to configure.
5289         * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5290         * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5291         * s/gnu.h (DATA_START): Move definitions to configure.
5293         * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5294         We include usg5-4-common.h, which defines them both.
5296         * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5297         O_RDONLY already includes it).
5299         Stop ns builds setting the EMACSLOADPATH environment variable.
5300         * nsterm.m (ns_load_path): Rename from ns_init_paths.
5301         Now it does not set EMACSLOADPATH, just returns the load-path string.
5302         * nsterm.h: Update accordingly.
5303         * lread.c [HAVE_NS]: Include nsterm.h.
5304         (init_lread) [HAVE_NS]: Use ns_load_path.
5305         * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5307 2012-07-09  Glenn Morris  <rgm@gnu.org>
5309         * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5310         since the included bsd-common.h does so.
5312         Stop ns builds setting the EMACSPATH environment variable.
5313         * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5314         (ns_init_paths): Do not set EMACSPATH.
5315         * nsterm.h (ns_exec_path): Add it.
5316         * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5317         Use ns_exec_path.
5319         * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5321 2012-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5323         * process.c (wait_reading_process_output): 'waitchannels' was unset
5324         when read_kbd || !NILP (wait_for_cell); fix this.
5326         Add GCC-style 'const' attribute to functions that can use it.
5327         * character.h (char_resolve_modifier_mask):
5328         * keyboard.h (make_ctrl_char):
5329         * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5330         (init_character_once, next_almost_prime, init_fns, init_image)
5331         (flush_pending_output, init_sound):
5332         * mem-limits.h (start_of_data):
5333         * menu.h (finish_menu_items):
5334         Add ATTRIBUTE_CONST.
5335         * emacs.c (DEFINE_DUMMY_FUNCTION):
5336         Declare the dummy function with ATTRIBUTE_CONST.
5337         * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5338         Add decls with ATTRIBUTE_CONST.
5340         Minor improvements to make_formatted_string.
5341         * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5342         where int is good enough, as vsprintf returns an int.
5343         * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5345 2012-07-09  Dmitry Antipov  <dmantipov@yandex.ru>
5347         Use make_formatted_string to avoid double length calculation.
5348         * lisp.h (make_formatted_string): New prototype.
5349         * alloc.c (make_formatted_string): New function.
5350         * buffer.c (Fgenerate_new_buffer_name): Use it.
5351         * dbus.c (syms_of_dbusbind): Likewise.
5352         * editfns.c (Fcurrent_time_zone): Likewise.
5353         * filelock.c (get_boot_time): Likewise.
5354         * frame.c (make_terminal_frame, set_term_frame_name)
5355         (x_report_frame_params): Likewise.
5356         * image.c (gs_load): Likewise.
5357         * minibuf.c (get_minibuffer): Likewise.
5358         * msdos.c (dos_set_window_size): Likewise.
5359         * process.c (make_process): Likewise.
5360         * xdisp.c (ensure_echo_area_buffers): Likewise.
5361         * xsettings.c (apply_xft_settings): Likewise.
5363 2012-07-09  Glenn Morris  <rgm@gnu.org>
5365         Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5366         * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5367         (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5368         * nsterm.h (ns_etc_directory): Add it.
5369         * callproc.c [HAVE_NS]: Include nsterm.h.
5370         (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5372 2012-07-09  Dmitry Antipov  <dmantipov@yandex.ru>
5374         Move marker debugging code under MARKER_DEBUG.
5375         * marker.c (MARKER_DEBUG): Move marker debugging code under
5376         #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5377         for bootstrap with --enable-checking (~3x slowdown reported
5378         by Juanma Barranquero <lekktu@gmail.com>).
5379         (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5381 2012-07-08  Paul Eggert  <eggert@cs.ucla.edu>
5383         * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5384         See <http://bugs.gnu.org/11825#29>.
5386 2012-07-08  Eli Zaretskii  <eliz@gnu.org>
5388         * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5389         has no font, use the frame's font.  (Bug#11813)
5390         (display_line): Add commentary about displaying truncation glyphs
5391         on GUI frames.
5392         (produce_special_glyphs): Move here from term.c.
5394         * term.c (produce_special_glyphs): Move to xdisp.c.
5396         * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5397         section.
5399 2012-07-07  Andreas Schwab  <schwab@linux-m68k.org>
5401         * xdisp.c (display_line): Avoid warning about implicit declaration
5402         of FRAME_FONT.
5404         * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5406         * lisp.h: Remove empty conditional.
5408 2012-07-07  Paul Eggert  <eggert@cs.ucla.edu>
5410         * lread.c (load_path_check): Now static.
5412         Fix some minor --with-ns problems found by static checking.
5413         * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5414         (x_set_font) [!HAVE_X_WINDOWS]:
5415         * image.c (xpm_load_image) [HAVE_NS]:
5416         (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5417         (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5418         Remove unused local.
5419         (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5420         (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5421         * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5422         (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5423         * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5424         * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5425         Fix pointer signedness problem.
5426         * xfaces.c (FRAME_X_FONT_TABLE):
5427         * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5429 2012-07-07  Glenn Morris  <rgm@gnu.org>
5431         * lread.c (load_path_check): New function, split from init_lread.
5432         (init_lread): Reorganize.  Motivation:
5433         If EMACSLOADPATH is set, check/warn about that rather than the
5434         defaults, which we are not going to use.  Hence we can remove
5435         the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5436         Don't warn if site-lisp directories are missing.
5437         If not installed, start from a blank load-path, since
5438         PATH_LOADSEARCH refers to the eventual installation directories.
5440 2012-07-07  Eli Zaretskii  <eliz@gnu.org>
5442         Support truncation and continuation glyphs on GUI frames, when
5443         fringes are disabled.  (Bug#11832)
5444         * xdisp.c (init_iterator): Get dimensions of truncation and
5445         continuation glyphs even if on GUI frames.
5446         Adjust it->last_visible_x on GUI frames when the left or right fringes,
5447         or both, are absent.
5448         (start_display, move_it_in_display_line_to): Handle the case of a
5449         GUI frame without a fringe to display continuation or truncation
5450         glyphs.
5451         (insert_left_trunc_glyphs): Support GUI frames: make sure
5452         truncation glyphs overwrite enough glyphs from the current line to
5453         have sufficient space in pixels.
5454         (display_line): Support truncation and continuation glyphs on GUI
5455         frames.  If some spare pixels are left on the line after inserting
5456         the truncation glyphs, fill that space with a stretch glyph of a
5457         suitably computed width.
5459         * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5460         produce_glyphs, to support GUI sessions.
5462 2012-07-07  Paul Eggert  <eggert@cs.ucla.edu>
5464         * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5466         * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5468         Do not require float-time's arg to fit in time_t (Bug#11825).
5469         This works better on hosts where time_t is unsigned, and where
5470         float-time is applied to the (negative) difference between two times.
5471         * editfns.c (decode_time_components): Last arg is now double *,
5472         not int *, and means to store all the result as a double, without
5473         worrying about whether the seconds part fits in time_t.
5474         All callers changed.
5475         (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5476         All callers changed.
5477         (Ffloat_time): Do not fail merely because the specified time falls
5478         outside of time_t range.
5480 2012-07-07  Glenn Morris  <rgm@gnu.org>
5482         * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5483         * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5484         * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5486 2012-07-07  Juanma Barranquero  <lekktu@gmail.com>
5488         * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5489         Update dependencies.
5491         * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5493 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
5495         Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5496         * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5497         * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5498         * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5499         * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5500         * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5502         * xfont.c (compare_font_names): Redo to omit the need for casts.
5504 2012-07-06  Andreas Schwab  <schwab@linux-m68k.org>
5506         * xfns.c (Fx_change_window_property): Doc fix.
5507         * w32fns.c (Fx_change_window_property): Doc fix.
5509         * w32fns.c (Fx_window_property): Accept the same arguments as the
5510         X Windows version.  Doc fix.
5511         * xfns.c (Fx_window_property): Doc fix.  (Bug#11870)
5513 2012-07-06  Juanma Barranquero  <lekktu@gmail.com>
5514             Eli Zaretskii  <eliz@gnu.org>
5516         * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5517         Windows-specific code from nt/config.nt moved here.
5518         Obsolete settings removed.
5520 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
5522         * process.c: Avoid unnecessary calls to gettime.
5523         (wait_reading_process_output): Don't get the time of day
5524         when gobbling data immediately and not waiting, as there's no need
5525         for it in that case.  This removes a FIXME.
5527 2012-07-06  Jan Djärv  <jan.h.d@swipnet.se>
5529         * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5530         is defined (Bug#11768).
5532 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
5534         Fix marker debugging code.
5535         * marker.c (byte_char_debug_check): Do not perform the check
5536         if buffer is not multibyte.
5537         (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5538         Call byte_char_debug_check with correct arguments.
5540 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
5542         Compile marker debugging code only if ENABLE_CHECKING is defined.
5543         * marker.c (byte_char_debug_check, count_markers):
5544         Use only if ENABLE_CHECKING is defined.
5545         (byte_debug_flag): Remove.
5546         (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5547         Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5549 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
5551         Avoid code repetition in marker-related functions.
5552         * marker.c (attach_marker): New function.
5553         (Fset_marker, set_marker_restricted, set_marker_both)
5554         (set_marker_restricted_both): Use it.
5555         (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5556         Consistently rename charno to charpos.
5557         (marker_position): Add eassert.
5558         (marker_byte_position): Convert to eassert.
5560 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
5562         Simplify list operations in unchain_overlay and unchain_marker.
5563         * buffer.c (unchain_overlay): Simplify.  Add comment.
5564         * marker.c (unchain_marker): Simplify.  Fix comments.
5566 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
5568         Introduce fast path for the widely used marker operation.
5569         * alloc.c (build_marker): New function.
5570         * lisp.h (build_marker): New prototype.
5571         * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5572         * composite.c (autocmp_chars): Likewise.
5573         * editfns.c (buildmark): Remove.
5574         (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5575         (save_restriction_save): Use build_marker.
5576         * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5577         * window.c (save_window_save): Likewise.
5579 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
5581         Do not use Fdelete_overlay in delete_all_overlays
5582         to avoid redundant calls to unchain_overlay.
5583         * buffer.c (drop_overlay): New function.
5584         (delete_all_overlays, Fdelete_overlay): Use it.
5585         * minibuf.c (get_minibuffer): Fix comment.
5587 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
5589         Port to OpenBSD 5.1 amd64.
5590         * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5591         This is needed for OpenBSD, and should be harmless on all BSD systems.
5592         Also, include <sys/sysctl.h>, as it should be available on all
5593         BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5594         (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5595         use p_pid member, not kp_proc.pid.
5597 2012-07-06  Glenn Morris  <rgm@gnu.org>
5599         * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5601 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
5603         More xmalloc and related cleanup.
5604         * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5605         * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5606         * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5607         * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5608         * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5609         * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5610         * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5611         * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5612         * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5613         * xterm.c:
5614         Omit needless casts involving void * pointers and allocation.
5615         Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5616         as the former is more robust if P's type is changed.
5617         Prefer xzalloc to xmalloc + memset 0.
5618         Simplify malloc-or-realloc to realloc.
5619         Don't worry about xmalloc returning a null pointer.
5620         Prefer xstrdup to xmalloc + strcpy.
5621         * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5622         growing it.
5623         * keyboard.c (apply_modifiers_uncached): Prefer local array to
5624         alloca of a constant.
5626 2012-07-05  Eli Zaretskii  <eliz@gnu.org>
5628         * xdisp.c (display_line): Fix horizontal pixel coordinates when
5629         hscroll is larger than the line width.  Fixes long and futile
5630         looping inside extend_face_to_end_of_line (on a TTY) producing
5631         glyphs that are not needed and thrown away.
5633 2012-07-05  Dmitry Antipov  <dmantipov@yandex.ru>
5635         * marker.c (set_marker_restricted_both): Simplify by using
5636         clip_to_bounds.
5638 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
5640         * editfns.c (region_limit): Simplify by using clip_to_bounds.
5642 2012-07-05  Jan Djärv  <jan.h.d@swipnet.se>
5644         * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5645         not defined (Bug#11768).
5646         (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5647         (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5648         (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5649         followed by gtk_box_set_homogeneous (Bug#11768).
5650         (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
5651         (update_theme_scrollbar_width, xg_create_scroll_bar):
5652         Use gtk_scrollbar_new (Bug#11768).
5653         (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5654         (is_box_type): New function (Bug#11768).
5655         (xg_tool_item_stale_p): Call is_box_type.
5656         (xg_initialize): Get settings by calling gtk_settings_get_for_screen
5657         with default display (Bug#11768).
5659 2012-07-05  Eli Zaretskii  <eliz@gnu.org>
5661         * xdisp.c (window_hscroll_limited): New function.
5662         (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5663         coordinates when window's hscroll is set to insanely large
5664         values.  (Bug#11857)
5666 2012-07-05  Juanma Barranquero  <lekktu@gmail.com>
5668         * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5669         ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5671 2012-07-05  Dmitry Antipov  <dmantipov@yandex.ru>
5673         Cleanup xmalloc.
5674         * lisp.h (xzalloc): New prototype.  Omit needless casts.
5675         * alloc.c (xzalloc): New function.  Omit needless casts.
5676         * charset.c: Omit needless casts.  Convert all calls to
5677         xmalloc with following memset to xzalloc.
5678         * dispnew.c: Likewise.
5679         * fringe.c: Likewise.
5680         * image.c: Likewise.
5681         * sound.c: Likewise.
5682         * term.c: Likewise.
5683         * w32fns.c: Likewise.
5684         * w32font.c: Likewise.
5685         * w32term.c: Likewise.
5686         * xfaces.c: Likewise.
5687         * xfns.c: Likewise.
5688         * xterm.c: Likewise.
5689         * atimer.c: Omit needless casts.
5690         * buffer.c: Likewise.
5691         * callproc.c: Likewise.
5692         * ccl.c: Likewise.
5693         * coding.c: Likewise.
5694         * composite.c: Likewise.
5695         * doc.c: Likewise.
5696         * doprnt.c: Likewise.
5697         * editfns.c: Likewise.
5698         * emacs.c: Likewise.
5699         * eval.c: Likewise.
5700         * filelock.c: Likewise.
5701         * fns.c: Likewise.
5702         * gtkutil.c: Likewise.
5703         * keyboard.c: Likewise.
5704         * lisp.h: Likewise.
5705         * lread.c: Likewise.
5706         * minibuf.c: Likewise.
5707         * msdos.c: Likewise.
5708         * print.c: Likewise.
5709         * process.c: Likewise.
5710         * region-cache.c: Likewise.
5711         * search.c: Likewise.
5712         * sysdep.c: Likewise.
5713         * termcap.c: Likewise.
5714         * terminal.c: Likewise.
5715         * tparam.c: Likewise.
5716         * w16select.c: Likewise.
5717         * w32.c: Likewise.
5718         * w32reg.c: Likewise.
5719         * w32select.c: Likewise.
5720         * w32uniscribe.c: Likewise.
5721         * widget.c: Likewise.
5722         * xdisp.c: Likewise.
5723         * xmenu.c: Likewise.
5724         * xrdb.c: Likewise.
5725         * xselect.c: Likewise.
5727 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
5729         * fileio.c (time_error_value): Check the right error number.
5730         Problem reported by Troels Nielsen in
5731         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5733 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
5735         * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5736         This should be fixed in a better way; see Eli Zaretskii in
5737         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5738         (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5740         * fileio.c (time_error_value): Rename from special_mtime.
5741         The old name's problems were noted by Eli Zaretskii in
5742         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5744         * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5745         This variable's comment says Emacs needs at least one GDB-visible
5746         symbol of type enum pvec_type, to work around GDB problems.
5747         The symbol's value doesn't matter.
5749         * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5750         that causes compilation to fail on pre-C99 compilers.
5752 2012-07-04  Juanma Barranquero  <lekktu@gmail.com>
5754         * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5755         (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5757 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
5759         * buffer.c (init_buffer_once): Fix initialization of
5760         headers for buffer_defaults and buffer_local_symbols.
5761         Reported by Juanma Barranquero <lekktu@gmail.com>.
5763 2012-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
5765         Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5766         * lisp.h (enum pvec_type): Use fewer bits.
5767         (PSEUDOVECTOR_SIZE_BITS): New constant.
5768         (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5769         (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5770         change in pvec_type.
5771         (PSEUDOVECTOR_TYPEP): New macro.
5772         (TYPED_PSEUDOVECTORP): Use it.
5773         * fns.c (internal_equal): Adapt code to extract pvectype.
5774         * emacs.c (gdb_pvec_type): Update type.
5775         * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5776         (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5777         (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5778         (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5779         (sweep_vectors): Use it.  Use local var `total_bytes' instead of
5780         abusing vector->header.next.nbytes.
5781         (live_vector_p): Use PVEC_TYPE.
5782         (mark_object): Adapt code to extract pvectype.  Use switch.
5784 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
5786         * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5787         Tighten new eassert a bit.
5789 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
5791         Fix compilation with --enable-gcc-warnings and -O1
5792         optimization level.
5793         * doprnt.c (doprnt): Change type of tem to int, initialize
5794         to avoid compiler warning.  Add eassert.
5795         * search.c (simple_search): Initialize match_byte to avoid
5796         compiler warning.  Add eassert.
5798 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
5800         Avoid weird behavior with large horizontal scrolls.
5801         Without this change, for example, large hscroll values would
5802         mess up Emacs's display on Fedora 15 x86, presumably due to
5803         overflows in int calculations in the display code.
5804         Also, if buffers had long lines, Emacs would freeze.
5805         * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5806         (set_window_hscroll): New function, containing the old guts of
5807         Fset_window_hscroll.  Return the clipped value.
5808         (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5809         This avoids the need to check against PTRDIFF_MAX.
5811         * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5813 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
5815         * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5817 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
5819         * regex.c: Suppress GCC warning on RHEL 6.  (Bug#11207)
5820         Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5821         since GCC 4.4.6 issues a bogus warning for them.
5823         Fix bugs in file timestamp newness comparisons.
5824         * fileio.c (Ffile_newer_than_file_p):
5825         * lread.c (Fload): Use full timestamp resolution of files,
5826         not just the 1-second resolution, so that files that are only
5827         slightly newer still count as newer.
5828         * fileio.c (Ffile_newer_than_file_p): Don't assume file
5829         timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5831 2012-07-03  Paul Eggert  <eggert@cs.ucla.edu>
5833         * fileio.c: Improve handling of file time marker.  (Bug#11852)
5834         (special_mtime): New function.
5835         (Finsert_file_contents, Fverify_visited_file_modtime):
5836         Use it to set special mtime values consistently.
5838 2012-07-03  Andreas Schwab  <schwab@linux-m68k.org>
5840         * fileio.c (Finsert_file_contents): Properly handle st_mtime
5841         marker for non-existing file.  (Bug#11852)
5843 2012-07-03  Glenn Morris  <rgm@gnu.org>
5845         * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5846         and did not make it into globals.h).
5848 2012-07-03  Tom Tromey  <tromey@redhat.com>
5850         * window.c (Fset_window_margins, Fset_window_fringes)
5851         (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5852         * textprop.c (Fprevious_property_change): No longer static.
5853         * syntax.c (Fsyntax_table_p): No longer static.
5854         * process.c (Fget_process, Fprocess_datagram_address): No longer
5855         static.
5856         * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5857         * keyboard.c (Fcommand_execute): No longer static.
5858         Remove EXFUN.
5859         * insdel.c (Fcombine_after_change_execute): No longer static.
5860         * image.c (Finit_image_library): No longer static.
5861         * fileio.c (Fmake_symbolic_link): No longer static.
5862         * eval.c (Ffetch_bytecode): No longer static.
5863         * editfns.c (Fuser_full_name): No longer static.
5864         * doc.c (Fdocumentation_property, Fsnarf_documentation):
5865         No longer static.
5866         * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5867         static.
5868         * dired.c (Ffile_attributes): No longer static.
5869         * composite.c (Fcomposition_get_gstring): No longer static.
5870         * callproc.c (Fgetenv_internal): No longer static.
5872         * ccl.h: Remove EXFUNs.
5873         * buffer.h: Remove EXFUNs.
5874         * dispextern.h: Remove EXFUNs.
5875         * intervals.h: Remove EXFUNs.
5876         * fontset.h: Remove EXFUN.
5877         * font.h: Remove EXFUNs.
5878         * dosfns.c (system_process_attributes): Remove EXFUN.
5879         * keymap.h: Remove EXFUNs.
5880         * lisp.h: Remove EXFUNs.
5881         * w32term.h: Remove EXFUNs.
5882         * window.h: Remove EXFUNs.
5883         * xsettings.h: Remove EXFUN.
5884         * xterm.h: Remove EXFUN.
5886 2012-07-03  Glenn Morris  <rgm@gnu.org>
5888         * lisp.h (Frandom): Make it visible to C.
5889         * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5890         buffer for invisible buffers.  (Bug#1229)
5892 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
5894         Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5895         values which aren't power of 2.
5896         * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5897         Verify it's value and the value of VECTOR_BLOCK_SIZE.  Adjust users
5898         accordingly.
5900 2012-07-03  Stefan Monnier  <monnier@iro.umontreal.ca>
5902         * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5904         * alloc.c (mark_object): Revert part of last patch to use `switch'.
5906 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
5908         * alloc.c (allocate_vector_block): Remove redundant
5909         calls to mallopt if DOUG_LEA_MALLOC is defined.
5910         (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5911         avoid calls to mallopt if zero_vector is returned.
5913 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
5915         * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5916         is enabled, avoid dereferencing NULL current_sblock if
5917         running undumped.
5919 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
5921         Cleanup basic buffer management.
5922         * buffer.h (struct buffer): Change layout to use generic vector
5923         marking code.  Fix some comments.  Change type of 'clip_changed'
5924         to bitfield.  Remove unused #ifndef old.
5925         (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5926         (GET_OVERLAYS_AT): Fix indentation.
5927         (for_each_per_buffer_object_at): New macro.
5928         * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5929         (Fbuffer_local_variables): Use it.
5930         (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5931         * alloc.c (allocate_buffer): Adjust to match new layout of
5932         struct buffer.  Fix comment.
5933         (mark_overlay): New function.
5934         (mark_buffer): Use it.  Use mark_vectorlike to mark normal
5935         Lisp area of struct buffer.
5936         (mark_object): Use it.  Adjust marking of misc objects
5937         and related comments.
5939 2012-07-02  Paul Eggert  <eggert@cs.ucla.edu>
5941         * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5942         wrapper that is not needed because the wrapped code is a no-op (zero
5943         machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5944         This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5946 2012-07-02  Dmitry Antipov  <dmantipov@yandex.ru>
5948         * alloc.c (mark_buffer): Simplify.  Remove prototype.
5949         (mark_object): Add comment.  Reorganize marking of vector-like
5950         objects.  Use CHECK_LIVE for all vector-like objects except buffers
5951         and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5952         Avoid redundant calls to mark_vectorlike for bool vectors.
5954 2012-06-30  Glenn Morris  <rgm@gnu.org>
5956         * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5958         * epaths.in (PATH_SITELOADSEARCH): New.
5959         * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5960         This is rather than relying on --enable-locallisppath elements
5961         having "site-lisp" in their names.  (Bug#10208#25, 11658)
5963 2012-06-30  Eli Zaretskii  <eliz@gnu.org>
5965         * w32proc.c (sys_select): Accept and ignore one more argument.
5967         * w32.c (emacs_gnutls_pull): Call select with one more argument.
5969         * sysselect.h [DOS_NT]: Don't include sys/select.h.
5970         (pselect) [!MS_DOS]: Redirect to sys_select.
5972         * sysdep.c: Don't include dos.h and dosfns.h.
5974         * process.c (sys_select):
5975         * msdos.c (sys_select): Accept one more argument and ignore it.
5977         * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5978         adapt data types and code to that.
5980         * dosfns.c:
5981         * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5982         which clashes with the gnulib function of the same name.
5984 2012-06-30  Andreas Schwab  <schwab@linux-m68k.org>
5986         * font.c (font_style_to_value, font_style_symbolic)
5987         (font_prop_validate_style): Add type checks for values in
5988         font_style_table.
5990         * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5991         argument.
5992         * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5993         uses.
5995 2012-06-29  Eli Zaretskii  <eliz@gnu.org>
5997         * xdisp.c (try_window_id): Undo last change.
5999         * w32.c (getwd): Adjust commentary about startup_dir.
6000         (init_environment): Always call sys_access, even in non-MSVC
6001         builds.  Don't chdir to the directory of the Emacs executable.
6002         This undoes code from 1997 which was justified by the need to
6003         "avoid conflicts when removing and renaming directories".  But its
6004         downside was that every relative file name was being interpreted
6005         relative to the directory of the Emacs executable, which can never
6006         be TRT.  In particular, it broke sys_access when called with
6007         relative file names.
6008         (sys_access): Map GetLastError to errno.
6010 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
6012         * window.h (struct window): Change type of 'fringes_outside_margins'
6013         to bitfield.  Fix comment.  Adjust users accordingly.
6014         (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
6015         Adjust comment.
6016         * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
6017         to ptrdiff_t.
6019 2012-06-29  Andreas Schwab  <schwab@linux-m68k.org>
6021         * gnutls.c (emacs_gnutls_handshake):
6022         Add QUIT to make the loop interruptible.
6024 2012-06-29  Glenn Morris  <rgm@gnu.org>
6026         * charset.c (init_charset): Make lack of etc/charsets fatal.
6028 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
6030         * editfns.c (region_limit): Fix type mismatch.
6032 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
6034         * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
6035         undefined.  Convert from xassert to eassert.
6036         * nsmenu.m: Convert from xassert to eassert.
6037         * nsterm.m: Likewise.
6039 2012-06-28  Stefan Monnier  <monnier@iro.umontreal.ca>
6041         * editfns.c (region_limit): Clip to narrowing (bug#11770).
6043 2012-06-28  Paul Eggert  <eggert@cs.ucla.edu>
6045         Avoid integer overflow on scroll-left and scroll-right.
6046         * window.c (HSCROLL_MAX): New macro.
6047         (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
6048         overflow when requested scroll falls outside ptrdiff_t range.
6050 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
6052         * window.h (struct window): Change type of 'hscroll',
6053         'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
6054         'last_modified' and 'last_overlay_modified' to EMACS_INT.
6055         Adjust users accordingly.
6056         * xdisp.c (try_cursor_movement): Replace type check with eassert.
6057         * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
6058         from EMACS_INT to ptrdiff_t.
6059         (make_window): Omit redundant initialization.
6061 2012-06-28  Juanma Barranquero  <lekktu@gmail.com>
6063         * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
6065 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
6067         * window.h (struct window): Change type of 'use_time' and
6068         'sequence_number' from Lisp_Object to int.
6069         * frame.c (make_frame): Adjust users accordingly.
6070         * print.c (print_object): Likewise.
6071         * window.c (select_window, Fwindow_use_time, make_parent_window)
6072         (make_window): Likewise.
6074 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
6076         * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
6077         enabled with --enable-checking=[all,glyphs] configure option.
6078         Fix GLYPH_DEBUG usage assuming that it may be undefined,
6079         adjust comments accordingly.
6080         * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
6081         undefined, adjust comments accordingly.
6082         * image.c: Likewise.
6083         * scroll.c: Likewise.
6084         * w32fns.c: Likewise.
6085         * w32term.c: Likewise.
6086         * xdisp.c: Likewise.
6087         * xfaces.c: Likewise.
6088         * xfns.c: Likewise.
6089         * xterm.c: Likewise.
6091 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
6093         Generalize run-time debugging checks.
6094         * dispextern.h (XASSERTS): Remove.
6095         * fontset.c (xassert): Remove.
6096         Convert from xassert to eassert.
6097         * alloc.c: Convert from xassert to eassert.
6098         * bidi.c: Likewise.
6099         * dispnew.c: Likewise.
6100         * fns.c: Likewise.
6101         * fringe.c: Likewise.
6102         * ftfont.c: Likewise.
6103         * gtkutil.c: Likewise.
6104         * image.c: Likewise.
6105         * keyboard.c: Likewise.
6106         * menu.c: Likewise.
6107         * process.c: Likewise.
6108         * scroll.c: Likewise.
6109         * sound.c: Likewise.
6110         * term.c: Likewise.
6111         * w32console.c: Likewise.
6112         * w32fns.c: Likewise.
6113         * w32term.c: Likewise.
6114         * window.c: Likewise.
6115         * xdisp.c: Likewise.
6116         * xfaces.c: Likewise.
6117         * xfns.c: Likewise.
6118         * xselect.c: Likewise.
6119         * xterm.c: Likewise.
6121 2012-06-27  Stefan Monnier  <monnier@iro.umontreal.ca>
6123         * fns.c (maybe_resize_hash_table): Output message when growing the
6124         purify-hashtable.
6126 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
6128         * alloc.c (allocate_string_data): Remove dead code.
6129         * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6130         avoid GCC warning about unused macro.
6132 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
6134         * alloc.c (allocate_string): Omit intervals initialization.
6135         * alloc.c (make_uninit_multibyte_string): Initialize intervals
6136         as in make_pure_string and make_pure_c_string.
6138 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
6140         * alloc.c (allocate_string): Fix last change.
6142 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
6144         * alloc.c (allocate_string): Remove two redundant calls
6145         to memset, add explicit initialization where appropriate.
6147 2012-06-27  Glenn Morris  <rgm@gnu.org>
6149         * lisp.mk (lisp): Remove paths.elc.
6151 2012-06-27  Chong Yidong  <cyd@gnu.org>
6153         * doc.c (Fsubstitute_command_keys): Fix punctuation.
6155 2012-06-26  John Wiegley  <johnw@newartisans.com>
6157         * unexmacosx.c (copy_data_segment): Add two section names used
6158         on Mac OS X Lion: __mod_init_func and __mod_term_func.
6160         * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6161         when building with Clang.
6163 2012-06-26  Stefan Monnier  <monnier@iro.umontreal.ca>
6165         * eval.c (Fapply): Allow calling it with a single argument.
6167 2012-06-26  Eli Zaretskii  <eliz@gnu.org>
6169         * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6170         _stricmp and _strnicmp.
6171         (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6173 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
6175         * alloc.c (allocate_window): Zero out non-Lisp part of newly
6176         allocated window.
6177         (allocate_process): Likewise for new process.
6178         (allocate_terminal): Change to use offsetof.
6179         (allocate_frame): Likewise.
6180         * frame.c (make_frame): Omit redundant initialization.
6181         * window.c (make_parent_window): Use memset.
6182         (make_window): Omit redundant initialization.
6183         * process.c (make_process): Omit redundant initialization.
6184         * terminal.c (create_terminal): Likewise.
6186 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
6188         * term.c (delete_tty): Remove redundant call to memset.
6190 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
6192         * alloc.c: Remove build_string.
6193         * lisp.h: Define build_string as static inline.  This provides
6194         a better opportunity to optimize away calls to strlen when the
6195         function is called with compile-time constant argument.
6196         * image.c (imagemagick_error): Convert to build_string.
6197         * w32proc.c (sys_spawnve): Likewise.
6198         * xterm.c (x_term_init): Likewise.
6200 2012-06-26  Paul Eggert  <eggert@cs.ucla.edu>
6202         Use sprintf return value instead of invoking strlen on result.
6203         In the old days this wasn't portable, since some sprintf
6204         implementations returned char *.  But they died out years ago and
6205         Emacs already assumes sprintf returns int.
6206         Similarly for float_to_string.
6207         This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6208         * ccl.c (ccl_driver):
6209         * character.c (string_escape_byte8):
6210         * data.c (Fnumber_to_string):
6211         * doprnt.c (doprnt):
6212         * print.c (print_object):
6213         * xdisp.c (message_dolog):
6214         * xfns.c (syms_of_xfns):
6215         Use sprintf or float_to_string result to avoid need to call strlen.
6216         * data.c (Fnumber_to_string):
6217         Use make_unibyte_string, since the string must be ASCII.
6218         * lisp.h, print.c (float_to_string): Now returns int length.
6219         * term.c (produce_glyphless_glyph):
6220         Use sprintf result rather than recomputing it.
6222         Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6223         * Makefile.in (ALL_CFLAGS):
6224         * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6225         * gmalloc.c, regex.c: Include <config.h> unconditionally.
6227 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
6229         * dispextern.h (xstrcasecmp): Define to library function
6230         strcasecmp if available.
6231         * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6233 2012-06-25  Andreas Schwab  <schwab@linux-m68k.org>
6235         * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6236         Avoid comma operator.
6237         * menu.c (push_submenu_start, push_submenu_end)
6238         (push_left_right_boundary, push_menu_pane): Likewise.
6239         * msdos.c (dos_rawgetc): Likewise.
6241 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
6243         * xfns.c (xic_create_fontsetname): Remove redundant calls
6244         to memset.
6246 2012-06-25  Paul Eggert  <eggert@cs.ucla.edu>
6248         * gtkutil.c (get_utf8_string): Remove redundant assignment.
6249         sprintf already null-terminates its output.
6251         * xfns.c (x_window): Remove redundant cast.
6253 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
6255         * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6256         `const char *' to `char *' to avoid compiler warning.
6258 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
6260         * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6261         instead of truncating it to 63 (admittedly a generous limit).
6263         * process.c: Fix spelling and caps in comments.
6265 2012-06-24  Dan Nicolaescu  <dann@ics.uci.edu>
6267         * emacs.c (setpgrp): Remove definition, unused.
6268         * sysdep.c (setpgrp): Remove definition, not used in this file.
6270 2012-06-24  Juanma Barranquero  <lekktu@gmail.com>
6272         * makefile.w32-in: Update dependencies.
6274 2012-06-24  Eli Zaretskii  <eliz@gnu.org>
6276         * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6277         (SYSTIME_H): Add nt/inc/sys/time.h.
6279         * systime.h [WINDOWSNT]: Include sys/time.h.
6281         * s/ms-w32.h (struct timespec): Definition moved from
6282         nt/inc/sys/time.h.  Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6284 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
6286         Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6287         * buffer.h (buffer_slot_type_mismatch):
6288         * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6289         * eval.c (unwind_to_catch):
6290         * image.c (my_png_error, my_error_exit):
6291         * keyboard.c (quit_throw_to_read_char, user_error)
6292         (Fexit_recursive_edit, Fabort_recursive_edit):
6293         * lisp.h (die, args_out_of_range, args_out_of_range_3)
6294         (wrong_type_argument, buffer_overflow, __executable_start)
6295         (memory_full, buffer_memory_full, string_overflow, Fthrow)
6296         (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6297         (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6298         (fatal):
6299         (child_setup) [!DOS_NT]:
6300         * lread.c (end_of_file_error, invalid_syntax):
6301         * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6302         * puresize.h (pure_write_error):
6303         * search.c (matcher_overflow):
6304         * sound.c (sound_perror, alsa_sound_perror):
6305         * sysdep.c, syssignal.h (croak):
6306         * term.c (maybe_fatal, vfatal):
6307         * textprop.c (text_read_only):
6308         * undo.c (user_error):
6309         * unexmacosx.c (unexec_error):
6310         * xterm.c (x_ins_del_lines, x_delete_glyphs):
6311         Use _Noreturn rather than NO_RETURN.
6312         No need for separate decl merely because of _Noreturn.
6313         * sound.c (sound_warning, parse_sound):
6314         Remove unnecessary forward decls.
6316 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
6318         Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6319         * lisp.h (WAIT_READING_MAX): New macro.
6320         * dispnew.c (Fsleep_for, sit_for):
6321         * keyboard.c (kbd_buffer_get_event):
6322         * process.c (Faccept_process_output):
6323         Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6324         This improves on the previous patch, which introduced a bug
6325         when time_t is unsigned and as wide as intmax_t.
6326         See <http://bugs.gnu.org/9000#51>.
6328 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
6330         * dispnew.c (sit_for, Fsleep_for):
6331         * keyboard.c (kbd_buffer_get_event):
6332         * process.c (Faccept_process_output): Avoid compiler warnings when
6333         comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6335 2012-06-23  Juanma Barranquero  <lekktu@gmail.com>
6337         * makefile.w32-in: Update dependencies.
6339         * w32.c (ltime): Add return type and declare static.
6340         (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6342 2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
6344         * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6345         Privately reported by Herbert J. Skuhra.
6346         (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6347         All uses changed.
6348         (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6349         not make_lisp_timeval, when the argument is of type EMACS_TIME.
6351 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
6353         * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6354         last argument of make_unibyte_string.
6356         * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6357         language ID in the event parameters.
6359         * w32term.c (w32_read_socket): Put the new keyboard codepage into
6360         event.code, not the obscure "character set ID".
6362 2012-06-23  Chong Yidong  <cyd@gnu.org>
6364         * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6366 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
6368         Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6369         * w32.c (fdutimens): New function.
6371         * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6373         * s/ms-w32.h (pselect): Redirect to sys_select.
6375         * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6377         * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6378         in the logic of incrementing and decrementing the value of
6379         use_relocatable_buffers.
6381 2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
6383         * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6384         Privately reported by Herbert J. Skuhra.
6385         [__FreeBSD__]: Remove "*/" typo after "#include".
6386         (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6387         (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6388         (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6389         Don't assume EMACS_TIME and struct timeval are the same type.
6391 2012-06-22  Paul Eggert  <eggert@cs.ucla.edu>
6393         Support higher-resolution time stamps (Bug#9000).
6394         The time stamps are only nanosecond-resolution at the C level,
6395         since that's the best that any real-world system supports now.
6396         But they are picosecond-resolution at the Lisp level, as that's
6397         easy, and leaves room for future OS improvements.
6399         * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6400         (LIBES): Use it.
6402         * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6403         Don't get current time unless it's needed.
6405         * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6406         now provides it if it's absent.
6407         (start_atimer): Port to higher-res time stamps.
6408         Check for time stamp overflow.  Don't get current time more
6409         often than is needed.
6411         * buffer.h (struct buffer): Buffer modtime now has high resolution.
6412         Include systime.h, not time.h.
6413         (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6415         * dired.c: Include stat-time.h.
6416         (Ffile-attributes): File times now have higher resolution.
6418         * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6419         (struct image): Timestamp now has higher resolution.
6421         * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6422         has at least microseconds now.  All uses removed.
6423         (update_frame, update_single_window, update_window, update_frame_1)
6424         (Fsleep_for, sit_for): Port to higher-resolution time stamps.
6425         (duration_to_sec_usec): Remove; no longer needed.
6427         * editfns.c (time_overflow): Now extern.
6428         (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6429         (float-time, Fformat_time_string, Fcurrent_time_string)
6430         (Fcurrent_time_zone): Accept and generate higher-resolution
6431         time stamps.
6432         (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6433         (decode_time_components, lisp_seconds_argument): New functions.
6434         (make_time): Now static.
6435         (lisp_time_argument): Now returns EMACS_TIME.  New arg ppsec.
6436         Report an error if the time is invalid, rather than having the caller
6437         do that.
6439         * fileio.c: Include <stat-time.h>
6440         (Fcopy_file): Copy higher-resolution time stamps.
6441         Prefer to set the time stamp via a file descriptor if that works.
6442         (Fset_file_times, Finsert_file_contents, Fwrite_region)
6443         (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6444         (Fvisited_file_modtime, Fset_visited_file_modtime):
6445         Support higher-resolution time stamps.
6447         * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6449         * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6451         * image.c (prepare_image_for_display, clear_image_cache)
6452         (lookup_image): Port to higer-resolution time stamps.
6454         * keyboard.c (start_polling, bind_polling_period):
6455         Check for time stamp overflow.
6456         (read_char, kbd_buffer_get_event, timer_start_idle)
6457         (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6458         (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6459         Port to higher-resolution time stamps.  Do not assume time_t is signed.
6460         (decode_timer): New function.  Timers are now vectors of length 9,
6461         not 8, to accommodate the picosecond component.
6462         (timer_check_2): Use it.
6464         * nsterm.m (select_timeout, timeval_subtract): Remove.
6465         (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6466         as they're a bit more accurate and handle overflow better.
6467         (ns_select): Change prototype to be compatible with pselect.
6468         (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6469         * nsterm.h (ns_select): Adjust prototype.
6471         * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6472         us-resolution time stamps.
6473         (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6475         * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6477         * lisp.h (time_overflow): New decl.
6478         (wait_reading_process_output): First arg is now intmax_t, not int,
6479         to accommodate larger waits.
6481         * process.h (struct Lisp_Process.read_output_delay):
6482         Now counts nanoseconds, not microseconds.
6483         * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6484         EMACS_HAS_USECS.
6485         (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6486         (wait_reading_process_output):
6487         Port to ns-resolution time stamps.
6488         (Faccept_process_output, wait_reading_process_output):
6489         Check for time stamp overflow.  Do not assume time_t is signed.
6490         (select_wrapper): Remove; we now use pselect.
6491         (Fprocess_attributes): Now generates ns-resolution time stamps.
6493         * sysdep.c: Include utimens.h.  Don't include utime.h
6494         or worry about struct utimbuf; gnulib does that for us now.
6495         (gettimeofday): Remove; gnulib provides a substitute.
6496         (make_timeval): New function.
6497         (set_file_times): Now sets ns-resolution time stamps.
6498         New arg FD; all uses changed.
6499         (time_from_jiffies, ltime_from_jiffies, get_up_time)
6500         (system_process_attributes):
6501         Now returns ns-resolution time stamp.  All uses changed.
6502         Check for time stamp overflow.
6504         * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6505         provides a substitute now.
6507         * systime.h: Include timespec.h rather than sys/time.h and time.h,
6508         since it guarantees struct timespec.
6509         (EMACS_TIME): Now struct timespec, so that we can support
6510         ns-resolution time stamps.
6511         (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6512         (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6513         (EMACS_USECS): Remove.
6514         (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6515         so multiply the arg by 1000 before storing it.
6516         (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6517         New macros.
6518         (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6519         Port to ns-resolution time stamps.
6520         (EMACS_TIME_NEG_P): Remove; replaced by....
6521         (EMACS_TIME_SIGN): New macro.
6522         (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6523         (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6524         (set_file_times, make_time, lisp_time_argument): Adjust signature.
6525         (make_timeval, make_lisp_time, decode_time_components): New decls.
6526         (EMACS_TIME_CMP): Remove; no longer used.  Plus, it was buggy, in
6527         that it mishandled time_t overflow.  You can't compare by subtracting!
6528         (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6529         (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6531         * term.c: Include <sys/time.h>.
6532         (timeval_to_Time): New function, for proper overflow wraparound.
6533         (term_mouse_position, term_mouse_click): Use it.
6535         * undo.c (record_first_change): Support higher-resolution time stamps
6536         in the undo buffer.
6537         (Fprimitive_undo): Use them when restoring time stamps.
6539         * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6540         (w32_get_internal_run_time):
6541         Port to higher-resolution Emacs time stamps.
6542         (ltime): Now accepts single 64-bit integer, as that's more convenient
6543         for callers.
6545         * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6547         * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6548         for compatibility with pselect.  Support ns-resolution time stamps.
6550         * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6552         * xselect.c (wait_for_property_change, x_get_foreign_selection):
6553         Check for time stamp overflow, and support ns-resolution time stamps.
6555         * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6556         Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6557         (timeval_subtract): Remove; no longer needed.
6558         (XTflash, XTring_bell, x_wait_for_event):
6559         Port to ns-resolution time stamps.  Don't assume time_t is signed.
6561 2012-06-22  Chong Yidong  <cyd@gnu.org>
6563         * xdisp.c (x_consider_frame_title): Revert last change.
6565 2012-06-22  Eli Zaretskii  <eliz@gnu.org>
6567         * alloc.c (NSTATICS): Enlarge to 0x650.  Otherwise, Emacs compiled
6568         with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6569         aborts in staticpro during startup.  (Without -DBYTE_CODE_METER,
6570         staticidx goes up to 1597 out of 1600 = 0x640.)
6572 2012-06-20  Paul Eggert  <eggert@cs.ucla.edu>
6574         * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6575         Otherwise, the umask might be mistakenly 0 while handling input signals.
6577 2012-06-19  Stefan Monnier  <monnier@iro.umontreal.ca>
6579         * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6581 2012-06-19  Dmitry Antipov  <dmantipov@yandex.ru>
6583         * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6584         * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6585         * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6586         access to `contents' member of Lisp_Vector objects with AREF and ASET
6587         where appropriate.
6589 2012-06-19  Chong Yidong  <cyd@gnu.org>
6591         * frame.c (delete_frame): When selecting a frame on a different
6592         text terminal, do not alter the terminal's top-frame.
6594         * xdisp.c (format_mode_line_unwind_data): Record the target
6595         frame's selected window and its terminal's top-frame.
6596         (unwind_format_mode_line): Restore them.
6597         (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6598         Callers changed.
6599         (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6600         since tty frames can be explicitly named.
6601         (prepare_menu_bars): Likewise.
6603         * term.c (Ftty_top_frame): New function.
6605 2012-06-18  Paul Eggert  <eggert@cs.ucla.edu>
6607         Port byte-code-meter to modern targets.
6608         * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6609         !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG.  Problem with
6610         CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
6611         <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6612         (METER_1, METER_2): Simplify.
6614 2012-06-18  Stefan Monnier  <monnier@iro.umontreal.ca>
6616         * data.c (Fdefalias): Return `symbol' (bug#11686).
6618 2012-06-18  Martin Rudalics  <rudalics@gmx.at>
6620         * buffer.c (Fkill_buffer): Don't throw an error when the buffer
6621         gets killed during executing of this function (Bug#11665).
6622         Try to always return Qt when the buffer has been actually killed.
6623         (Vkill_buffer_query_functions): In doc-string say that functions
6624         run by this hook should not change the current buffer.
6626 2012-06-18  Paul Eggert  <eggert@cs.ucla.edu>
6628         Fix recently-introduced process.c problems found by static checking.
6629         * process.c (write_queue_push, write_queue_pop, send_process):
6630         Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6631         (write_queue_pop): Fix pointer signedness problem.
6632         (send_process): Remove unused local.
6634 2012-06-17  Chong Yidong  <cyd@gnu.org>
6636         * xdisp.c (redisplay_internal): No need to redisplay terminal
6637         frames that are not on top.
6639 2012-06-17  Troels Nielsen  <bn.troels@gmail.com>
6641         * process.c (make_process): Initialize write_queue.
6642         (write_queue_push, write_queue_pop): New functions.
6643         (send_process): Use them to maintain correct ordering of process
6644         writes (Bug#10815).
6646 2012-06-17  Paul Eggert  <eggert@cs.ucla.edu>
6648         * lisp.h (eassert): Assume C89 or later.
6649         This removes the need for CHECK.
6650         (CHECK): Remove.  Its comments about always evaluating its
6651         argument were confusing, as 'eassert' typically does not evaluate
6652         its argument.
6654         * coding.c (produce_chars): Use ptrdiff_t, not int.
6656         * xterm.c (x_draw_underwave): Check for integer overflow.
6657         This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6659 2012-06-17  Jan Djärv  <jan.h.d@swipnet.se>
6661         * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6662         referenced (Bug#11583).
6664 2012-06-16  Aurelien Aptel  <aurelien.aptel@gmail.com>
6666         Implement wave-style variant of underlining.
6667         * dispextern.h (face_underline_type): New enum.
6668         (face): Add field for underline type.
6669         * nsterm.m (ns_draw_underwave): New function.
6670         (ns_draw_text_decoration): Use it.
6671         * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6672         New functions.
6673         (x_draw_glyph_string): Use them.
6674         * xfaces.c (Qline, Qwave): New Lisp objects.
6675         (check_lface_attrs, merge_face_ref)
6676         (Finternal_set_lisp_face_attribute, realize_x_face):
6677         Handle wave-style underline face attributes.
6678         * xterm.c (x_draw_underwave): New function.
6679         (x_draw_glyph_string): Use it.
6681 2012-06-16  Juanma Barranquero  <lekktu@gmail.com>
6683         * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6684         ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6685         ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6686         ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6687         ($(BLD)/w32select.$(O)): Update dependencies.
6689 2012-06-16  Andreas Schwab  <schwab@linux-m68k.org>
6691         * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6692         (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6693         * character.c (_fetch_multibyte_char_p): Remove.
6694         * alloc.c: Include "character.h" before "buffer.h".
6695         * bidi.c: Likewise.
6696         * buffer.c: Likewise.
6697         * bytecode.c: Likewise.
6698         * callint.c: Likewise.
6699         * callproc.c: Likewise.
6700         * casefiddle.c: Likewise.
6701         * casetab.c: Likewise.
6702         * category.c: Likewise.
6703         * cmds.c: Likewise.
6704         * coding.c: Likewise.
6705         * composite.c: Likewise.
6706         * dired.c: Likewise.
6707         * dispnew.c: Likewise.
6708         * doc.c: Likewise.
6709         * dosfns.c: Likewise.
6710         * editfns.c: Likewise.
6711         * emacs.c: Likewise.
6712         * fileio.c: Likewise.
6713         * filelock.c: Likewise.
6714         * font.c: Likewise.
6715         * fontset.c: Likewise.
6716         * fringe.c: Likewise.
6717         * indent.c: Likewise.
6718         * insdel.c: Likewise.
6719         * intervals.c: Likewise.
6720         * keyboard.c: Likewise.
6721         * keymap.c: Likewise.
6722         * lread.c: Likewise.
6723         * macros.c: Likewise.
6724         * marker.c: Likewise.
6725         * minibuf.c: Likewise.
6726         * nsfns.m: Likewise.
6727         * nsmenu.m: Likewise.
6728         * print.c: Likewise.
6729         * process.c: Likewise.
6730         * regex.c: Likewise.
6731         * region-cache.c: Likewise.
6732         * search.c: Likewise.
6733         * syntax.c: Likewise.
6734         * term.c: Likewise.
6735         * textprop.c: Likewise.
6736         * undo.c: Likewise.
6737         * unexsol.c: Likewise.
6738         * w16select.c: Likewise.
6739         * w32fns.c: Likewise.
6740         * w32menu.c: Likewise.
6741         * window.c: Likewise.
6742         * xdisp.c: Likewise.
6743         * xfns.c: Likewise.
6744         * xmenu.c: Likewise.
6745         * xml.c: Likewise.
6746         * xselect.c: Likewise.
6748 2012-06-16  Eli Zaretskii  <eliz@gnu.org>
6750         * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6751         If all the glyphs of the glyph row came from strings, and we have no
6752         cursor positioning clues, put the cursor on the first glyph of the
6753         row.
6754         (handle_face_prop): Use chunk-relative overlay string index when
6755         indexing into it->string_overlays array.  (Bug#11653)
6756         (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6757         the rightmost.  (Bug#11720)
6759 2012-06-16  Andreas Schwab  <schwab@linux-m68k.org>
6761         * category.h (CHAR_HAS_CATEGORY): Define as inline.
6762         (CATEGORY_MEMBER): Enforce 1/0 value.
6763         * category.c (_temp_category_set): Remove.
6765 2012-06-16  Eli Zaretskii  <eliz@gnu.org>
6767         * window.c (Fdelete_other_windows_internal)
6768         (Fdelete_window_internal): Don't access frame's mouse highlight
6769         info of the initial frame.  (Bug#11677)
6771 2012-06-14  Paul Eggert  <eggert@cs.ucla.edu>
6773         * .gdbinit (xgetint): Fix recently-introduced paren typo.
6774         Assume USE_2_TAGS_FOR_INTS.
6775         (xreload): Adjust $tagmask width to match recent lisp.h change.
6777         Simplify lisp.h in minor ways that should not affect code.
6778         * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6779         (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6780         (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6781         Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6782         (INTTYPEBITS): New macro, for clarity.
6783         (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
6784         (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6785         Simplify now that USE_LSB_TAG is always defined.
6786         (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6787         (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6789 2012-06-13  Juanma Barranquero  <lekktu@gmail.com>
6791         * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6793 2012-06-13  Glenn Morris  <rgm@gnu.org>
6795         * s/bsd-common.h (BSD4_3):
6796         * s/usg5-4-common.h (USG5_4): No longer define; unused.
6798 2012-06-13  Andreas Schwab  <schwab@linux-m68k.org>
6800         * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6801         instead of union.
6802         (XLI, XIL): Define.
6803         (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6804         Use them.
6805         * emacs.c (gdb_use_struct): Rename from gdb_use_union.
6806         * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
6807         * alloc.c (widen_to_Lisp_Object): Remove.
6808         (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6809         * frame.c (delete_frame): Remove outdated comment.
6810         * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6811         USE_LISP_UNION_TYPE.
6812         (Fw32_unregister_hot_key): Likewise.
6813         (Fw32_toggle_lock_key): Likewise.
6814         * w32menu.c (add_menu_item): Likewise.
6815         (w32_menu_display_help): Use XIL instead of checking
6816         USE_LISP_UNION_TYPE.
6817         * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6818         (init_heap): Likewise.
6819         * w32term.c (w32_read_socket): Update comment.
6821 2012-06-13  Glenn Morris  <rgm@gnu.org>
6823         * s/usg5-4-common.h, src/s/unixware.h:
6824         Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6826         * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6828 2012-06-13  Paul Eggert  <eggert@cs.ucla.edu>
6830         USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6831         * alloc.c (make_number) [!defined make_number]:
6832         Remove, as lisp.h always defines this now.
6833         (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6834         (roundup_size): Verify that it is a power of 2.
6835         * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6836         * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6837         * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6838         -DUSE_LSB_TAG=0, to override the automatically-selected default.
6839         USE_LSB_TAG now is always defined to be either 0 or 1.
6840         All uses changed.
6841         (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6842         code works fine either way, and efficiency is not a concern here,
6843         as the union type is for debugging, not for production.
6844         (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6845         Use an inline function on all platforms when using the union type,
6846         since this is simpler and 'static inline' can be used portably
6847         within Emacs now.
6848         (LISP_INITIALLY_ZERO): New macro.
6849         (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6850         (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6852 2012-06-12  Glenn Morris  <rgm@gnu.org>
6854         * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6856         * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
6858         * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6859         Move BROKEN_SIGIO to configure.
6861         * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6862         Move NO_TERMIO to configure.
6864 2012-06-12  Chong Yidong  <cyd@gnu.org>
6866         * image.c (imagemagick_load_image): Use MagickFlattenImage if
6867         MagickMergeImageLayers is undefined.  Use pixel pusher loop if
6868         MagickExportImagePixels is undefined.
6870 2012-06-12  Paul Eggert  <eggert@cs.ucla.edu>
6872         * image.c (imagemagick_load_image): Remove unused label.
6874 2012-06-11  Glenn Morris  <rgm@gnu.org>
6876         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6877         * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6878         * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6879         * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6881 2012-06-11  Stefan Monnier  <monnier@iro.umontreal.ca>
6883         * alloc.c (make_byte_code): New function.
6884         (Fmake_byte_code): Use it.  Don't purify here.
6885         * lread.c (read1): Use it as well to avoid extra allocation.
6887 2012-06-11  Chong Yidong  <cyd@gnu.org>
6889         * image.c (imagemagick_load_image): Implement transparency.
6891 2012-06-10  Andreas Schwab  <schwab@linux-m68k.org>
6893         * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6894         account for preceding backslashes.  (Bug#11663)
6896 2012-06-09  Chong Yidong  <cyd@gnu.org>
6898         * term.c: Support italics in capable terminals (Bug#9652).
6899         (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6900         (turn_on_face): Output using TS_enter_italic_mode if available.
6901         Don't handle unused blinking and alt-charset cases.
6902         (turn_off_face): Handle italic case; discard unused tty_blinking_p
6903         and tty_alt_charset_p cases.
6904         (tty_capable_p, init_tty): Support italics.
6906         * termchar.h (struct tty_display_info): Add field for italics.
6907         Remove unused blink field.
6909         * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6910         Handle slant.
6912         * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6913         (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6914         tty_alt_charset_p.  Add tty_italic_p.
6916 2012-06-09  Michael Albinus  <michael.albinus@gmx.de>
6918         * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6919         dbus_type_is_basic if available.
6920         (xd_extract_signed, xd_extract_unsigned): Rename from
6921         extract_signed and extract_unsigned, respectively.  Adapt callers.
6923 2012-06-09  Chong Yidong  <cyd@gnu.org>
6925         * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6927         * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6928         case (Bug#9752).
6930 2012-06-08  Paul Eggert  <eggert@cs.ucla.edu>
6932         * xdisp.c (vmessage): Treat frame message as multibyte.
6933         Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6934         would generate the diagnostic "Making \302\247 buffer-local while
6935         let-bound!".
6937 2012-06-08  Eli Zaretskii  <eliz@gnu.org>
6939         * dispnew.c (showing_window_margins_p): Undo last change, which
6940         was done due to an inadvertent commit.
6941         (adjust_frame_glyphs_for_frame_redisplay): Do call
6942         showing_window_margins_p.
6944 2012-06-08  Stefan Monnier  <monnier@iro.umontreal.ca>
6946         * eval.c (Fmake_var_non_special): New primitive.
6947         (syms_of_eval): Defsubr it.
6948         * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6950 2012-06-08  Juanma Barranquero  <lekktu@gmail.com>
6952         * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6953         function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6955 2012-06-08  Eli Zaretskii  <eliz@gnu.org>
6957         * alloc.c (allocate_vectorlike): Fix last change.
6959 2012-06-08  Dmitry Antipov  <dmantipov@yandex.ru>
6961         Block-based vector allocation of small vectors.
6962         * lisp.h (struct vectorlike_header): New field `nbytes',
6963         adjust comment accordingly.
6964         * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
6965         to denote vector blocks.  Adjust users (live_vector_p,
6966         mark_maybe_pointer, valid_lisp_object_p) accordingly.
6967         (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6968         (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6969         (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6970         (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6971         (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6972         (roundup_size): New constant.
6973         (struct vector_block): New data type.
6974         (vector_blocks, vector_free_lists, zero_vector): New variables.
6975         (all_vectors): Rename to `large_vectors'.
6976         (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6977         (sweep_vectors): New functions.
6978         (allocate_vectorlike): Return `zero_vector' as the only vector of
6979         0 items.  Allocate new vector from block if vector size is less than
6980         or equal to VBLOCK_BYTES_MAX.
6981         (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6982         (init_alloc_once): Add call to init_vectors.
6984 2012-06-08  Stefan Monnier  <monnier@iro.umontreal.ca>
6986         * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6988 2012-06-07  Paul Eggert  <eggert@cs.ucla.edu>
6990         * doprnt.c (doprnt): Truncate multibyte char correctly.
6991         Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6992         would mishandle a string argument "Xc" if X was a multibyte
6993         character of length 2: it would truncate after X's first byte
6994         rather than including all of X.
6996 2012-06-06  Chong Yidong  <cyd@gnu.org>
6998         * buffer.c (word_wrap): Doc fix.
7000 2012-06-04  Paul Eggert  <eggert@cs.ucla.edu>
7002         * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
7004 2012-06-03  Glenn Morris  <rgm@gnu.org>
7006         * xdisp.c (tool-bar-style): Doc fix.
7008 2012-06-03  Ulrich Müller  <ulm@gentoo.org>
7010         * Makefile.in (PAXCTL): Define.
7011         (temacs$(EXEEXT)): Disable memory randomization for the temacs
7012         binary via PaX flags if the paxctl utility is available.
7013         (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7014         Restore PaX flags to their default.  (Bug#11398)
7016 2012-06-03  Chong Yidong  <cyd@gnu.org>
7018         * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
7019         buffer (Bug#11226).
7021 2012-06-03  Chong Yidong  <cyd@gnu.org>
7023         * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
7024         (note_mode_line_or_margin_highlight): If there is no help echo,
7025         use mode-line-default-help-echo.  Handle the case where the mouse
7026         position is past the end of the mode line string.
7028         * buffer.c (buffer_local_value_1): New function, split from
7029         Fbuffer_local_value; can return Qunbound.
7030         (Fbuffer_local_value): Use it.
7031         (Vmode_line_format): Docstring tweaks.
7033 2012-06-02  Paul Eggert  <eggert@cs.ucla.edu>
7035         * sysdep.c (system_process_attributes): Improve comment.
7037 2012-06-02  Stefan Monnier  <monnier@iro.umontreal.ca>
7039         * keyboard.c: Export real-this-command to Elisp.
7040         (syms_of_keyboard): Rename real_this_command to Vreal_this_command
7041         and DEFVAR it.  Update all users.
7043 2012-06-02  Paul Eggert  <eggert@cs.ucla.edu>
7045         * minibuf.c (Fassoc_string): Remove duplicate declaration.
7047         * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
7048         Convert pctcpu and pctmem to Lisp float properly.
7049         Let the compiler fold better, as 100.0/0x8000 is exact.
7051 2012-06-02  Andreas Schwab  <schwab@linux-m68k.org>
7053         * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
7054         cons_block.
7056 2012-06-01  Paul Eggert  <eggert@cs.ucla.edu>
7058         * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
7060 2012-06-01  Dmitry Antipov  <dmantipov@yandex.ru>
7062         For a 'struct window', replace some Lisp_Object fields to
7063         bitfields where appropriate, remove unused fields.
7064         * window.h (struct window): Remove unused 'last_mark_x' and
7065         'last_mark_y' fields.  Rename 'mini_p' field to 'mini',
7066         change it's type from Lisp_Object to bitfield.
7067         Change type of 'force_start', 'optional_new_start',
7068         'last_had_star', 'update_mode_line' and 'start_at_line_beg'
7069         fields from Lisp_Object to bitfield.  Adjust users accordingly.
7071 2012-05-31  Paul Eggert  <eggert@cs.ucla.edu>
7073         Pacify gcc -Wdouble-precision when using Xaw.
7074         * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
7075         [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
7076         Use 'float' consistently, rather than 'float' in most places
7077         and 'double' in a couple of places.
7079 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
7081         * xdisp.c (handle_stop): Detect whether we have overlay strings
7082         loaded by testing it->current.overlay_string_index to be
7083         non-negative, instead of checking whether n_overlay_strings is
7084         positive.  (Bug#11587)
7086 2012-05-31  Chong Yidong  <cyd@gnu.org>
7088         * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
7090         * doc.c (Fsubstitute_command_keys): Doc fix.
7092 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
7094         * search.c (search_buffer): Remove calls to
7095         r_alloc_inhibit_buffer_relocation, as it is now called by
7096         maybe_unify_char, which was the cause of relocation of buffer text
7097         in bug#11519.
7099 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
7101         * charset.c (maybe_unify_char): Inhibit relocation of buffer text
7102         for the duration of call to load_charset, to avoid problems with
7103         callers of maybe_unify_char that access buffer text through C
7104         pointers.
7106         * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
7107         decrement the inhibition flag, instead of just setting or
7108         resetting it.
7110 2012-05-31  Paul Eggert  <eggert@cs.ucla.edu>
7112         Remove obsolete '#define static' cruft.
7113         * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7114         This #undef was "temporary" in 2000; it is no longer needed
7115         now that '#define static' has gone away.
7116         * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7117         (gray_bitmap_bits): Remove; no longer needed.
7118         All uses replaced with definiens.
7119         * xterm.c: Include "bitmaps/gray.xbm".
7121 2012-05-30  Paul Eggert  <eggert@cs.ucla.edu>
7123         Clean up __executable_start, monstartup when --enable-profiling.
7124         The following changes affect the code only when profiling.
7125         * dispnew.c (__executable_start): Rename from safe_bcopy.
7126         Define only on platforms that need it.
7127         * emacs.c: Include <sys/gmon.h> when profiling.
7128         (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7129         (__executable_start): Remove decl, since lisp.h does it now.
7130         (safe_bcopy): Remove decl; no longer has that name.
7131         (main): Coalesce #if into single bit of code, for simplicity.
7132         Cast pointers to uintptr_t, since standard libraries want integers
7133         and not pointers.
7134         * lisp.h (__executable_start): New decl.
7136 2012-05-31  Glenn Morris  <rgm@gnu.org>
7138         * image.c (Fimagemagick_types): Doc fix.
7140 2012-05-30  Jim Meyering  <meyering@redhat.com>
7142         * callproc.c (Fcall_process_region): Include directory component
7143         in mkstemp error message (Bug#11586).
7145 2012-05-30  Paul Eggert  <eggert@cs.ucla.edu>
7147         * alloc.c, lisp.h (make_pure_vector): Now static.
7149 2012-05-30  Stefan Monnier  <monnier@iro.umontreal.ca>
7151         * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7152         Move to byte-run.el.
7153         (Fautoload): Do the hash-doc more carefully.
7154         * data.c (Fdefalias): Purify definition, except for keymaps.
7155         (Qdefun): Move from eval.c.
7156         * lisp.h (Qdefun): Remove.
7157         * lread.c (read1): Tiny simplification.
7159 2012-05-29  Troels Nielsen  <bn.troels@gmail.com>
7161         Do not create empty overlays with the evaporate property (Bug#9642).
7162         * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7163         Bug#9642, but explicitly check that the buffer the overlay would
7164         be moved to is live and rearrange lines to make sure that errors
7165         will not put the overlay in an inconsistent state.
7166         (Fdelete_overlay): Cosmetics.
7168 2012-05-28  Eli Zaretskii  <eliz@gnu.org>
7170         * w32term.c (my_bring_window_to_top): New function.
7171         (x_raise_frame): Use handle returned by DeferWindowPos, which
7172         could be different from the original one.
7173         Call my_bring_window_to_top instead of my_set_foreground_window.
7174         (Bug#11513)
7176         * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7177         by calling BringWindowToTop.
7179         * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7180         (WM_EMACS_END): Increase by one.
7182 2012-05-28  Paul Eggert  <eggert@cs.ucla.edu>
7184         * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7185         This avoids undefined behavior that might cause the eassert
7186         to not catch an out-of-range value.
7188 2012-05-28  Juanma Barranquero  <lekktu@gmail.com>
7190         * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7191         Update dependencies.
7193 2012-05-27  Eli Zaretskii  <eliz@gnu.org>
7195         * bidi.c (bidi_mirror_char): Fix last change.
7197 2012-05-27  Andreas Schwab  <schwab@linux-m68k.org>
7199         * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7200         when referring to sectname field in printf format.
7202 2012-05-27  Paul Eggert  <eggert@cs.ucla.edu>
7204         * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7205         Only r_alloc_inhibit_buffer_relocation needed to be added;
7206         the others were already declared.
7208         * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7209         before checking whether it's out of range.  Put the check inside
7210         eassert.  See
7211         <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7213 2012-05-27  Ken Brown  <kbrown@cornell.edu>
7215         * callproc.c (Fcall_process): Restore a line that was accidentally
7216         commented out in the 2011-02-13 change (bug#11547).
7218 2012-05-27  Eli Zaretskii  <eliz@gnu.org>
7220         * lisp.h [REL_ALLOC]: Add prototypes for external functions
7221         defined on ralloc.c.
7223         * buffer.c [REL_ALLOC]: Remove prototypes of
7224         r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7225         they are now on lisp.h.
7227         * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7229         * search.c (search_buffer): Use it to inhibit relocation of buffer
7230         text while re_search_2 is doing its job, because re_search_2 is
7231         passed C pointers to buffer text.  (Bug#11519)
7233         * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7234         Update value to 24.
7236         * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7237         state after an additional call to move_it_in_display_line_to, keep
7238         the values of it->max_ascent and it->max_descent found for the
7239         entire line.
7240         (pos_visible_p): Revert the comparison against bottom_y to what it
7241         was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7242         (Bug#11464)
7244 2012-05-26  Paul Eggert  <eggert@cs.ucla.edu>
7246         Fix coding-related core dumps with gcc -ftrapv.
7247         The code was computing A - B, where A and B are pointers, and B is
7248         random garbage.  This can lead to core dumps on platforms that
7249         have special pointer registers, and it also leads to core dumps on
7250         x86-64 when compiled with gcc -ftrapv.  The fix is to compute
7251         A - B only when B is initialized properly.
7252         * coding.c (coding_set_source, coding_set_destination): Return void.
7253         (coding_change_source, coding_change_destinations): New functions,
7254         with the old behaviors of coding_set_source and coding_set_destination.
7255         All callers that need an offset changed to use these new functions.
7257 2012-05-26  Glenn Morris  <rgm@gnu.org>
7259         * nsterm.m (ns_init_paths): Don't mess with INFOPATH.  (Bug#2791)
7261 2012-05-26  Eli Zaretskii  <eliz@gnu.org>
7263         Extend mouse support on W32 text-mode console.
7264         * xdisp.c (draw_row_with_mouse_face):
7265         Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
7267         * w32console.c: Include window.h.
7268         (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7269         New functions.
7270         (initialize_w32_display): Initialize mouse-highlight data.
7272         * w32inevt.c: Include termchar.h and window.h.
7273         (do_mouse_event): Support mouse-autoselect-window.  When the mouse
7274         moves, call note_mouse_highlight.  If help_echo changed, call
7275         gen_help_event to produce help-echo message in the echo area.
7276         Call clear_mouse_face if mouse_face_hidden is set in the mouse
7277         highlight info.
7279 2012-05-26  Paul Eggert  <eggert@cs.ucla.edu>
7281         * lread.c (read1): Simplify slightly to avoid an overflow warning
7282         with GCC 4.7.0 on x86-64.
7284 2012-05-26  Eli Zaretskii  <eliz@gnu.org>
7286         * bidi.c (bidi_mirror_char): Revert last change: an int is
7287         definitely wide enough here.
7289 2012-05-25  Paul Eggert  <eggert@cs.ucla.edu>
7291         Fix integer width and related bugs (Bug#9874).
7292         * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
7293         (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7294         (string_bytes, check_sblock, allocate_string_data):
7295         (compact_small_strings, Fmake_bool_vector, make_string)
7296         (make_unibyte_string, make_multibyte_string)
7297         (make_string_from_bytes, make_specified_string)
7298         (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7299         (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7300         (mark_vectorlike):
7301         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7302         (allocate_pseudovector):
7303         Use int, not EMACS_INT, where int is wide enough.
7304         (inhibit_garbage_collection, Fgarbage_collect):
7305         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7306         * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7307         int might not be wide enough.
7308         (bidi_cache_search, bidi_cache_find, bidi_init_it)
7309         (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7310         (bidi_at_paragraph_end, bidi_find_paragraph_start)
7311         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7312         (bidi_level_of_next_char, bidi_move_to_visually_next):
7313         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7314         * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7315         (Fkill_buffer, Fset_buffer_major_mode)
7316         (advance_to_char_boundary, Fbuffer_swap_text)
7317         (Fset_buffer_multibyte, overlays_at, overlays_in)
7318         (overlay_touches_p, struct sortvec, record_overlay_string)
7319         (overlay_strings, recenter_overlay_lists)
7320         (adjust_overlays_for_insert, adjust_overlays_for_delete)
7321         (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7322         (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7323         (Foverlay_recenter, last_overlay_modification_hooks_used)
7324         (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7325         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7326         (validate_region): Omit unnecessary test for b <= e,
7327         since that's guaranteed by the previous test.
7328         (adjust_overlays_for_delete): Avoid pos + length overflow.
7329         (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7330         (report_overlay_modification):
7331         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7332         (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7333         Omit pointer cast, which isn't needed anyway, and doesn't work
7334         after the EMACS_INT -> ptrdiff_t change.
7335         (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
7336         * buffer.h: Adjust decls to match defn changes elsewhere.
7337         (struct buffer_text, struct buffer):
7338         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7339         Use EMACS_INT, not int, where int might not be wide enough.
7340         * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7341         not int, to avoid needless 32-bit limit on 64-bit hosts.
7342         (exec_byte_code): Use tighter memory-full test, one that checks
7343         for alloca overflow.  Don't compute the address of the object just
7344         before an array, as that's not portable.  Use EMACS_INT, not
7345         ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
7346         * callint.c (Fcall_interactively):
7347         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7348         * callproc.c (call_process_kill, Fcall_process):
7349         Don't assume pid_t fits into an Emacs fixnum.
7350         (call_process_cleanup, Fcall_process, child_setup):
7351         Don't assume pid_t fits into int.
7352         (call_process_cleanup, Fcall_process, delete_temp_file)
7353         (Fcall_process_region):
7354         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7355         (Fcall_process): Simplify handling of volatile integers.
7356         Use int, not EMACS_INT, where int will do.
7357         * casefiddle.c (casify_object, casify_region, operate_on_word)
7358         (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7359         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7360         (casify_object): Avoid integer overflow when overallocating buffer.
7361         * casetab.c (set_identity, shuffle): Prefer int to unsigned when
7362         either works.  Use lint_assume to convince GCC 4.6.1 that it's OK.
7363         * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7364         * category.h (CATEGORYP): Don't assume arg is nonnegative.
7365         * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7366         integers are now checked earlier.  All uses replaced with XINT.
7367         (ccl_driver):
7368         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7369         For CCL_MapSingle, check that content and value are in int range.
7370         (ccl_driver, Fregister_code_conversion_map):
7371         Check that Vcode_version_map_vector is a vector.
7372         (resolve_symbol_ccl_program): Check that vector header is in range.
7373         Always copy the vector, so that we can check its contents reliably
7374         now rather than having to recheck each instruction as it's being
7375         executed.  Check that vector words fit in 'int'.
7376         (ccl_get_compiled_code, Fregister_ccl_program)
7377         (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7378         program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7379         (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7380         contents are in range.
7381         (Fccl_execute_on_string): Check that status is in range.
7382         * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7383         * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7384         Accept and return EMACS_INT, not int, because callers can pass values
7385         out of 'int' range.
7386         (c_string_width, strwidth, lisp_string_width, chars_in_text)
7387         (multibyte_chars_in_text, parse_str_as_multibyte)
7388         (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7389         (str_as_unibyte, str_to_unibyte, string_count_byte8)
7390         (string_escape_byte8, Fget_byte):
7391         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7392         (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
7393         avoid mishandling large integers.
7394         * character.h: Adjust decls to match defn changes elsewhere.
7395         * charset.c (load_charset_map_from_file, find_charsets_in_text)
7396         (Ffind_charset_region):
7397         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7398         (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7399         (load_charset_map_from_vector, Fdefine_charset_internal):
7400         Don't assume fixnum fits in int.
7401         (load_charset_map_from_vector, Fmap_charset_chars):
7402         Remove now-unnecessary CHECK_NATNUMs.
7403         (Fdefine_charset_internal): Check ranges here, more carefully.
7404         Don't rely on undefined behavior with signed left shift overflow.
7405         Don't assume unsigned int fits into fixnum, or that fixnum fits
7406         into unsigned int.  Don't require max_code to be a valid fixnum;
7407         that's not true for gb10830 4-byte on a 32-bit host.  Allow
7408         invalid_code to be a cons, for the same reason.  Require code_offset
7409         to be a character.  Avoid int overflow if max_char is close
7410         to INT_MAX.
7411         (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7412         this is intended anyway and avoids some undefined behavior.
7413         (load_charset_map): Pass unsigned, not int, as 2nd arg of
7414         INDEX_TO_CODE_POINT, as that's what it expects.
7415         (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
7416         * charset.h (DECODE_CHAR): Return int, not unsigned;
7417         this is what was intended anyway, and it avoids undefined behavior.
7418         (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7419         integer-overflow issues.
7420         (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7421         Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7422         where the argument is EMACS_INT, and this behavior is not intended.
7423         * chartab.c (Fmake_char_table, Fset_char_table_range)
7424         (uniprop_get_decoder, uniprop_get_encoder):
7425         Don't assume fixnum fits in int.
7426         * cmds.c (move_point): New function, that does the gist of
7427         Fforward_char and Fbackward_char, but does so while checking
7428         for integer overflow more accurately.
7429         (Fforward_char, Fbackward_char): Use it.
7430         (Fforward_line, Fend_of_line, internal_self_insert)
7431         (internal_self_insert):
7432         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7433         Fix a FIXME, by checking for integer overflow when calculating
7434         target_clm and actual_clm.
7435         * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
7436         (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
7437         (ASSURE_DESTINATION, coding_alloc_by_realloc)
7438         (coding_alloc_by_making_gap, alloc_destination)
7439         (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7440         (encode_coding_utf_16, detect_coding_emacs_mule)
7441         (decode_coding_emacs_mule, encode_coding_emacs_mule)
7442         (detect_coding_iso_2022, decode_coding_iso_2022)
7443         (encode_invocation_designation, encode_designation_at_bol)
7444         (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7445         (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7446         (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7447         (encode_coding_ccl, encode_coding_raw_text)
7448         (detect_coding_charset, decode_coding_charset)
7449         (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7450         (produce_composition, produce_charset, produce_annotation)
7451         (decode_coding, handle_composition_annotation)
7452         (handle_charset_annotation, consume_chars, decode_coding_gap)
7453         (decode_coding_object, encode_coding_object, detect_coding_system)
7454         (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7455         (code_convert_region, code_convert_string)
7456         (Fdefine_coding_system_internal)
7457         (coding_set_source, coding_set_destination):
7458         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7459         (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7460         (Fdefine_coding_system_internal):
7461         Don't assume fixnums fit in int.
7462         (decode_coding_gap, decode_coding_object, encode_coding_object)
7463         (Fread_coding_system, Fdetect_coding_region)
7464         (Funencodable_char_position, Fcheck_coding_systems_region)
7465         (get_translation, handle_composition_annotation, consume_chars):
7466         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7467         (consume_chars): Rewrite to not calculate an address outside buffer.
7468         (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7469         Don't access memory outside of the args array.
7470         (Fdefine_coding_system_internal): Check for charset-id overflow.
7471         (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7472         result of ENCODE_CHAR.
7473         * coding.h: Adjust decls to match defn changes elsewhere.
7474         (struct coding_system):
7475         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7476         * composite.c (get_composition_id, find_composition)
7477         (run_composition_function, update_compositions)
7478         (compose_text, composition_gstring_put_cache)
7479         (composition_gstring_p, composition_gstring_width)
7480         (fill_gstring_header, fill_gstring_body, autocmp_chars)
7481         (composition_compute_stop_pos, composition_reseat_it)
7482         (composition_update_it, struct position_record)
7483         (find_automatic_composition, composition_adjust_point)
7484         (Fcomposition_get_gstring, Ffind_composition_internal):
7485         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7486         (update_compositions):
7487         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7488         * composite.h: Adjust decls to match defn changes elsewhere.
7489         (struct composition):
7490         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7491         * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7492         Do not attempt to compute the address of the object just before a
7493         buffer; this is not portable.
7494         (Faref, Faset):
7495         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7496         (Faset): Use int, not EMACS_INT, where int is wide enough.
7497         (Fstring_to_number): Don't assume fixnums fit in int.
7498         (Frem): Don't assume arg is nonnegative.
7499         * dbusbind.c (xd_append_arg): Check for integers out of range.
7500         (Fdbus_call_method): Don't overflow the timeout int.
7501         (extract_signed, extract_unsigned): New functions.
7502         (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7503         (xd_get_connection_references): Return ptrdiff_t, not int.
7504         All uses changed.
7505         (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7506         (xd_read_message_1):
7507         Use int, not unsigned, where the dbus API uses int.
7508         (Fdbus_message_internal): Don't overflow mtype.
7509         (syms_of_dbusbind): Allocate right-sized buffer for integers.
7510         * dired.c (directory_files_internal, file_name_completion, scmp)
7511         (file_name_completion_stat):
7512         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7513         (file_name_completion): Don't overflow matchcount.
7514         (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7515         * dispextern.h: Adjust decls to match defn changes elsewhere.
7516         (struct text_pos, struct glyph, struct bidi_saved_info)
7517         (struct bidi_string_data, struct bidi_it, struct composition_it)
7518         (struct it):
7519         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7520         (struct display_pos, struct composition_it, struct it):
7521         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7522         * dispnew.c (increment_matrix_positions)
7523         (increment_row_positions, mode_line_string)
7524         (marginal_area_string):
7525         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7526         (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
7527         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7528         (duration_to_sec_usec): New function, to check for overflow better.
7529         (Fsleep_for, sit_for): Use it.
7530         * doc.c (get_doc_string, store_function_docstring):
7531         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7532         (get_doc_string, Fsnarf_documentation):
7533         Use int, not EMACS_INT, where int is wide enough.
7534         (get_doc_string):
7535         Use SAFE_ALLOCA, not alloca.
7536         Check for overflow when converting EMACS_INT to off_t.
7537         * doprnt.c (doprnt):
7538         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7539         * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7540         Don't assume uid_t fits into fixnum.
7541         (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7542         (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7543         (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7544         (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7545         (general_insert_function)
7546         (Finsert_char, make_buffer_string, make_buffer_string_both)
7547         (update_buffer_properties, Fbuffer_substring)
7548         (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7549         (Fsubst_char_in_region, check_translation)
7550         (Ftranslate_region_internal, save_restriction_restore, Fformat)
7551         (transpose_markers, Ftranspose_regions):
7552         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7553         (clip_to_bounds): Move to lisp.h as an inline function).
7554         (Fconstrain_to_field): Don't assume integers are nonnegative.
7555         (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7556         (Fsubst_char_in_region, Fsave_restriction):
7557         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7558         (Femacs_pid): Don't assume pid_t fits into fixnum.
7559         (lo_time): Use int, not EMACS_INT, when int suffices.
7560         (lisp_time_argument): Check for usec out of range.
7561         (Fencode_time): Don't assume fixnum fits in int.
7562         (Fuser_login_name, Fuser_full_name): Signal an error
7563         if a uid argument is out of range, rather than relying on
7564         undefined behavior.
7565         (Fformat_time_string): Remove now-unnecessary check.
7566         lisp_time_argument checks for out-of-range usec now.
7567         Use ptrdiff_t, not size_t, where ptrdiff_t will do.
7568         * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7569         (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7570         (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7571         (init_cmdargs, Fdump_emacs):
7572         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7573         (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7574         the bottom (typically) 32 bits of the fixnum.
7575         * eval.c (specpdl_size, call_debugger):
7576         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7577         (when_entered_debugger, Fbacktrace_debug):
7578         Don't assume fixnum can fit in int.
7579         (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7580         the object just before a buffer; this is not portable.
7581         (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7582         (grow_specpdl, unbind_to):
7583         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7584         (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7585         (grow_specpdl): Simplify allocation by using xpalloc.
7586         (Fprog1, Fprog2): Don't assume list length fits in int.  Simplify.
7587         * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7588         (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7589         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7590         (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7591         (a_write, e_write):
7592         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7593         (Fcopy_file, non_regular_nbytes, read_non_regular)
7594         (Finsert_file_contents):
7595         Use int, not EMACS_INT, where int is wide enough.
7596         (READ_BUF_SIZE): Verify that it fits in int.
7597         (Finsert_file_contents): Check that counts are in proper range,
7598         rather than assuming fixnums fit into ptrdiff_t etc.
7599         Don't assume fixnums fit into int.
7600         * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
7601         * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7602         (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
7603         (string_char_to_byte, string_byte_to_char)
7604         (string_make_multibyte, string_to_multibyte)
7605         (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7606         (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7607         (substring_both, Fdelete, internal_equal, Ffillarray)
7608         (Fclear_string, mapcar1)
7609         (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7610         (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7611         (larger_vector, make_hash_table, maybe_resize_hash_table)
7612         (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7613         (Fmaphash, secure_hash):
7614         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7615         (concat): Check for string index and length overflow.
7616         (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7617         (Frequire):
7618         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7619         (larger_vector): New API (vec, incr_min, size_max) replaces old
7620         one (vec, new_size, init).  This catches size overflow.
7621         INIT was removed because it was always Qnil.
7622         All callers changed.
7623         (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7624         the upper bound on a hash table index size.
7625         (make_hash_table, maybe_resize_hash_table): Use it.
7626         (secure_hash): Computer start_byte and end_byte only after
7627         they're known to be in ptrdiff_t range.
7628         * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7629         (Ffont_get_glyphs, Ffont_at):
7630         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7631         (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7632         (Flist_fonts, Fopen_font):
7633         Don't assume fixnum can fit in int.
7634         (check_gstring): Don't assume index can fit in int.
7635         (font_match_p): Check that fixnum is a character, not a nonnegative
7636         fixnum, since the later code needs to stuff it into an int.
7637         (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7638         (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7639         conversion overflow issues.
7640         (Fopen_font): Check for integer out of  range.
7641         (Ffont_get_glyphs): Don't assume index can fit in int.
7642         * font.h: Adjust decls to match defn changes elsewhere.
7643         * fontset.c (reorder_font_vector): Redo score calculation to avoid
7644         integer overflow.
7645         (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7646         printmax_t, where ptrdiff_t is wide enough.
7647         (Finternal_char_font):
7648         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7649         * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7650         (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7651         (Fset_frame_position, x_set_frame_parameters)
7652         (x_set_line_spacing, x_set_border_width)
7653         (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7654         Check that fixnums are in proper range for system types.
7655         (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7656         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7657         (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7658         Use SAFE_ALLOCA_LISP, not alloca.
7659         * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7660         intptr_t is wide enough.
7661         * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7662         (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7663         (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7664         Check for fixnum out of range.
7665         * ftfont.c (ftfont_list): Don't assume index fits in int.
7666         Check that fixnums are in proper range for system types.
7667         (ftfont_shape_by_flt):
7668         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7669         * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7670         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7671         (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7672         Check that fixnums are in proper range for system types.
7673         * gnutls.h: Adjust decls to match defn changes elsewhere.
7674         * gtkutil.c (xg_dialog_run):
7675         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7676         (update_frame_tool_bar):
7677         Check that fixnums are in proper range for system types.
7678         * image.c (parse_image_spec): Redo count calculation to avoid overflow.
7679         (lookup_image): Check that fixnums are in range for system types.
7680         * indent.c (last_known_column, last_known_column_point):
7681         (current_column_bol_cache):
7682         (skip_invisible, current_column, check_display_width):
7683         (check_display_width, scan_for_column, current_column_1)
7684         (Findent_to, Fcurrent_indentation, position_indentation)
7685         (indented_beyond_p, Fmove_to_column, compute_motion):
7686         (Fcompute_motion, Fvertical_motion):
7687         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7688         (last_known_column_modified): Use EMACS_INT, not int.
7689         (check_display_width):
7690         (Fcompute_motion):
7691         Check that fixnums and floats are in proper range for system types.
7692         (compute_motion): Don't assume index or fixnum fits in int.
7693         (compute_motion, Fcompute_motion):
7694         Use int, not EMACS_INT, when it is wide enough.
7695         (vmotion): Omit local var start_hpos that is always 0; that way
7696         we don't need to worry about overflow in expressions involving it.
7697         * indent.h: Adjust decls to match defn changes elsewhere.
7698         (struct position):
7699         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7700         Use int, not EMACS_INT, where int is wide enough.
7701         Remove unused members ovstring_chars_done and tab_offset;
7702         all uses removed.
7703         * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7704         (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7705         (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7706         (make_gap, copy_text, insert, insert_and_inherit)
7707         (insert_before_markers, insert_before_markers_and_inherit)
7708         (insert_1, count_combining_before, count_combining_after)
7709         (insert_1_both, insert_from_string)
7710         (insert_from_string_before_markers, insert_from_string_1)
7711         (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7712         (adjust_after_replace, adjust_after_insert, replace_range)
7713         (replace_range_2, del_range, del_range_1, del_range_byte)
7714         (del_range_both, del_range_2, modify_region)
7715         (prepare_to_modify_buffer, signal_before_change)
7716         (signal_after_change, Fcombine_after_change_execute):
7717         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7718         * intervals.c (traverse_intervals, rotate_right, rotate_left)
7719         (balance_an_interval, split_interval_right, split_interval_left)
7720         (find_interval, next_interval, update_interval)
7721         (adjust_intervals_for_insertion, delete_node, delete_interval)
7722         (interval_deletion_adjustment, adjust_intervals_for_deletion)
7723         (static_offset_intervals, offset_intervals)
7724         (merge_interval_right, merge_interval_left, make_new_interval)
7725         (graft_intervals_into_buffer, temp_set_point_both)
7726         (temp_set_point, set_point, adjust_for_invis_intang)
7727         (set_point_both, move_if_not_intangible, get_property_and_range)
7728         (get_local_map, copy_intervals, copy_intervals_to_string)
7729         (compare_string_intervals, set_intervals_multibyte_1):
7730         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7731         * intervals.h: Adjust decls to match defn changes elsewhere.
7732         (struct interval):
7733         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7734         * keyboard.c (this_command_key_count, this_single_command_key_start)
7735         (before_command_key_count, before_command_echo_length, echo_now)
7736         (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7737         (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7738         (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7739         (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7740         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7741         (last_non_minibuf_size, last_point_position, echo_truncate)
7742         (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7743         (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7744         (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7745         (stuff_buffered_input):
7746         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7747         (last_auto_save, command_loop_1, read_char):
7748         Use EMACS_INT, not int, to avoid integer overflow.
7749         (record_char): Avoid overflow in total_keys computation.
7750         (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7751         * keyboard.h: Adjust decls to match defn changes elsewhere.
7752         * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7753         (Fkey_description, Fdescribe_vector, Flookup_key):
7754         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7755         (click_position): New function, to check that positions are in range.
7756         (Fcurrent_active_maps):
7757         (describe_command):
7758         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7759         (Faccessible_keymaps, Fkey_description):
7760         (preferred_sequence_p):
7761         Don't assume fixnum can fit into int.
7762         (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7763         Check for integer overflow in size calculations.
7764         (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7765         avoid mishandling large integers.
7766         * lisp.h: Adjust decls to match defn changes elsewhere.
7767         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7768         (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7769         (struct Lisp_Marker):
7770         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7771         (clip_to_bounds): Now an inline function, moved here from editfns.c.
7772         (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7773         need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7774         All callers changed.
7775         (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7776         Assume the arg has valid form, since it always does.
7777         (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7778         unsigned integer system type.
7779         (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7780         (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7781         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7782         (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7783         (duration_to_sec_usec): New decl.
7784         * lread.c (read_from_string_index, read_from_string_index_byte)
7785         (read_from_string_limit, readchar, unreadchar, openp)
7786         (read_internal_start, read1, oblookup):
7787         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7788         (Fload, readevalloop, Feval_buffer, Feval_region):
7789         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7790         (openp): Check for out-of-range argument to 'access'.
7791         (read1): Use int, not EMACS_INT, where int is wide enough.
7792         Don't assume fixnum fits into int.
7793         Fix off-by-one error that can read outside a buffer.
7794         (read_filtered_event): Use duration_to_sec_usec
7795         to do proper overflow checking on durations.
7796         * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7797         in size calculation.
7798         (Fexecute_kbd_macro):
7799         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7800         * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7801         (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7802         (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7803         (set_marker_both, set_marker_restricted_both, marker_position)
7804         (marker_byte_position, Fbuffer_has_markers_at):
7805         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7806         (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
7807         * menu.c (ensure_menu_items): Rename from grow_menu_items.
7808         It now merely ensures that the menu is large enough, without
7809         necessarily growing it, as this avoids some integer overflow issues.
7810         All callers changed.
7811         (keymap_panes, parse_single_submenu, Fx_popup_menu):
7812         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7813         (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7814         Use SAFE_ALLOCA_LISP, not alloca.
7815         (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7816         to EMACS_INT.  Check that fixnums are in proper range for system types.
7817         * minibuf.c (minibuf_prompt_width, string_to_object)
7818         (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7819         (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7820         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7821         (get_minibuffer, read_minibuf_unwind):
7822         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7823         (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7824         this simplifies overflow checking.  All callers changed.
7825         (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7826         (Ftest_completion):
7827         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7828         * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7829         (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7830         Check that fixnums are in proper range for system types.
7831         (Fx_create_frame, Fx_show_tip):
7832         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7833         * nsfont.m (ns_findfonts, nsfont_list_family):
7834         Don't assume fixnum fits in long.
7835         * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7836         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7837         (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7838         wide enough.
7839         * nsselect.m (ns_get_local_selection, clean_local_selection_data):
7840         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7841         * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7842         (PRINTDECLARE, PRINTPREPARE):
7843         (strout, print_string):
7844         (print, print_preprocess, print_check_string_charset_prop)
7845         (print_object):
7846         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7847         (PRINTDECLARE):
7848         (temp_output_buffer_setup, Fprin1_to_string, print_object):
7849         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7850         (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
7851         (printchar, strout): Use xpalloc to catch size calculation overflow.
7852         (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
7853         (print_error_message): Use SAFE_ALLOCA, not alloca.
7854         (print_object): Use int, not EMACS_INT, where int is wide enough.
7855         (print_depth, new_backquote_output, print_number_index):
7856         Use ptrdiff_t, not int, where int might not be wide enough.
7857         * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7858         (Fset_process_window_size, Fformat_network_address)
7859         (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
7860         (sigchld_handler):
7861         Check that fixnums are in proper range for system types.
7862         (Fsignal_process): Simplify by avoiding a goto.
7863         Check for process-ids out of pid_t range rather than relying on
7864         undefined behavior.
7865         (process_tick, update_tick): Use EMACS_INT, not int.
7866         (Fformat_network_address, read_process_output, send_process)
7867         (Fprocess_send_region, status_notify):
7868         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7869         (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7870         (wait_reading_process_output, read_process_output, exec_sentinel):
7871         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7872         (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7873         (Faccept_process_output): Use duration_to_sec_usec to do proper
7874         overflow checking on durations.
7875         (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7876         Don't assume pid_t fits in int.
7877         * process.h (struct Lisp_Process): Members tick and update_tick
7878         are now of type EMACS_INT, not int.
7879         * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7880         configured --with-wide-int.
7881         * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7882         (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7883         * search.c (looking_at_1, string_match_1):
7884         (fast_string_match, fast_c_string_match_ignore_case)
7885         (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7886         (scan_newline, find_before_next_newline, search_command)
7887         (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7888         (set_search_regs, wordify):
7889         (Freplace_match):
7890         (Fmatch_data):
7891         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7892         (string_match_1, search_buffer, set_search_regs):
7893         (Fmatch_data):
7894         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7895         (wordify): Check for overflow in size calculation.
7896         (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7897         (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7898         Check that fixnums are in proper range for system types.
7899         * sound.c (struct sound_device)
7900         (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7901         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7902         (Fplay_sound_internal):
7903         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7904         * syntax.c (struct lisp_parse_state, find_start_modiff)
7905         (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7906         (Fparse_partial_sexp):
7907         Don't assume fixnums can fit in int.
7908         (struct lisp_parse_state, find_start_pos, find_start_value)
7909         (find_start_value_byte, find_start_begv)
7910         (update_syntax_table, char_quoted, dec_bytepos)
7911         (find_defun_start, prev_char_comend_first, back_comment):
7912         (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7913         (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7914         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7915         (Finternal_describe_syntax_value): Check that match_lisp is a
7916         character, not an integer, since the code stuffs it into int.
7917         (scan_words, scan_sexps_forward):
7918         Check that fixnums are in proper range for system types.
7919         (Fforward_word):
7920         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7921         (scan_sexps_forward):
7922         Use CHARACTERP, not INTEGERP, since the value must fit into int.
7923         (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7924         * syntax.h: Adjust decls to match defn changes elsewhere.
7925         (struct gl_state_s):
7926         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7927         (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7928         MOST_POSITIVE_FIXNUM.
7929         * sysdep.c (wait_for_termination_1, wait_for_termination)
7930         (interruptible_wait_for_termination, mkdir):
7931         Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7932         (emacs_read, emacs_write):
7933         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7934         (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7935         and double all fit in int.
7936         * term.c (set_tty_color_mode):
7937         Check that fixnums are in proper range for system types.
7938         * termhooks.h (struct input_event):
7939         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7940         * textprop.c (validate_interval_range, interval_of)
7941         (Fadd_text_properties, set_text_properties_1)
7942         (Fremove_text_properties, Fremove_list_of_text_properties)
7943         (Ftext_property_any, Ftext_property_not_all)
7944         (copy_text_properties, text_property_list, extend_property_ranges)
7945         (verify_interval_modification):
7946         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7947         (Fnext_single_char_property_change)
7948         (Fprevious_single_char_property_change):
7949         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7950         (copy_text_properties):
7951         Check for integer overflow in index calculation.
7952         * undo.c (last_boundary_position, record_point, record_insert)
7953         (record_delete, record_marker_adjustment, record_change)
7954         (record_property_change):
7955         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7956         (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7957         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7958         * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7959         (Fx_hide_tip, Fx_file_dialog):
7960         * w32menu.c (set_frame_menubar):
7961         Use ptrdiff_t, not int, for consistency with rest of code.
7962         * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7963         (select_window, Fdelete_other_windows_internal)
7964         (window_scroll_pixel_based, window_scroll_line_based)
7965         (Frecenter, Fset_window_configuration):
7966         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7967         (Fset_window_hscroll, run_window_configuration_change_hook)
7968         (set_window_buffer, temp_output_buffer_show, scroll_command)
7969         (Fscroll_other_window, Frecenter):
7970         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7971         (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7972         Don't assume fixnum fits in int.
7973         (Fset_window_scroll_bars):
7974         Check that fixnums are in proper range for system types.
7975         * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7976         (string_pos, c_string_pos, number_of_chars, init_iterator)
7977         (in_ellipses_for_invisible_text_p, init_from_display_pos)
7978         (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7979         (compute_display_string_end, handle_face_prop)
7980         (face_before_or_after_it_pos, handle_invisible_prop)
7981         (handle_display_prop, handle_display_spec, handle_single_display_spec)
7982         (display_prop_intangible_p, string_buffer_position_lim)
7983         (string_buffer_position, handle_composition_prop, load_overlay_strings)
7984         (get_overlay_strings_1, get_overlay_strings)
7985         (iterate_out_of_display_property, forward_to_next_line_start)
7986         (back_to_previous_visible_line_start, reseat, reseat_to_string)
7987         (get_next_display_element, set_iterator_to_next)
7988         (get_visually_first_element, compute_stop_pos_backwards)
7989         (handle_stop_backwards, next_element_from_buffer)
7990         (move_it_in_display_line_to, move_it_in_display_line)
7991         (move_it_to, move_it_vertically_backward, move_it_by_lines)
7992         (add_to_log, message_dolog, message_log_check_duplicate)
7993         (message2, message2_nolog, message3, message3_nolog
7994         (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7995         (current_message_1, truncate_echo_area, truncate_message_1)
7996         (set_message, set_message_1, store_mode_line_noprop)
7997         (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7998         (text_outside_line_unchanged_p, check_point_in_composition)
7999         (reconsider_clip_changes)
8000         (redisplay_internal, set_cursor_from_row, try_scrolling)
8001         (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
8002         (redisplay_window, find_last_unchanged_at_beg_row)
8003         (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
8004         (trailing_whitespace_p, find_row_edges, display_line)
8005         (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
8006         (display_mode_element, store_mode_line_string)
8007         (pint2str, pint2hrstr, decode_mode_spec)
8008         (display_count_lines, display_string, draw_glyphs)
8009         (x_produce_glyphs, x_insert_glyphs)
8010         (rows_from_pos_range, mouse_face_from_buffer_pos)
8011         (fast_find_string_pos, mouse_face_from_string_pos)
8012         (note_mode_line_or_margin_highlight, note_mouse_highlight):
8013         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8014         (safe_call, init_from_display_pos, handle_fontified_prop)
8015         (handle_single_display_spec, load_overlay_strings)
8016         (with_echo_area_buffer, setup_echo_area_for_printing)
8017         (display_echo_area, echo_area_display)
8018         (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
8019         (update_tool_bar, hscroll_window_tree, redisplay_internal)
8020         (redisplay_window, dump_glyph_row, display_mode_line)
8021         (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
8022         (handle_display_spec, display_prop_string_p):
8023         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8024         (handle_single_display_spec, build_desired_tool_bar_string)
8025         (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
8026         (get_specified_cursor_type):
8027         Check that fixnums are in proper range for system types.
8028         (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
8029         (Flookup_image_map):
8030         Don't assume fixnums fit in int.
8031         (compare_overlay_entries):
8032         Avoid mishandling comparisons due to subtraction overflow.
8033         (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
8034         (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
8035         (handle_tool_bar_click):
8036         Use int, not unsigned, since we prefer signed and the signedness
8037         doesn't matter here.
8038         (get_next_display_element, next_element_from_display_vector):
8039         Use int, not EMACS_INT, when int is wide enough.
8040         (start_hourglass): Use duration_to_sec_usec to do proper
8041         overflow checking on durations.
8042         * xfaces.c (Fbitmap_spec_p):
8043         Check that fixnums are in proper range for system types.
8044         (compare_fonts_by_sort_order):
8045         Avoid mishandling comparisons due to subtraction overflow.
8046         (Fx_family_fonts, realize_basic_faces):
8047         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8048         (Fx_family_fonts):
8049         Don't assume fixnum fits in int.
8050         Use SAFE_ALLOCA_LISP, not alloca.
8051         (merge_face_heights): Remove unnecessary cast to EMACS_INT.
8052         (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
8053         (face_at_buffer_position, face_for_overlay_string)
8054         (face_at_string_position):
8055         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8056         (merge_faces): Use int, not EMACS_INT, where int is wide enough.
8057         * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
8058         (Fx_show_tip):
8059         Check that fixnums are in proper range for system types.
8060         (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8061         (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
8062         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8063         (Fx_change_window_property): Don't assume fixnums fit in int.
8064         * xfont.c (xfont_chars_supported):
8065         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8066         * xmenu.c (Fx_popup_dialog, set_frame_menubar)
8067         (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
8068         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8069         * xml.c (parse_region):
8070         * xrdb.c (magic_file_p):
8071         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8072         * xselect.c (TRACE1): Don't assume pid_t promotes to int.
8073         (x_get_local_selection, x_reply_selection_request)
8074         (x_handle_selection_request, wait_for_property_change):
8075         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8076         (selection_data_to_lisp_data): Use short, not EMACS_INT, where
8077         short is wide enough.
8078         (x_send_client_event): Don't assume fixnum fits in int.
8079         * xterm.c (x_x_to_emacs_modifiers):
8080         Don't assume EMACS_INT overflows nicely into int.
8081         (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
8082         may come from Lisp.
8083         (handle_one_xevent): NATNUMP can eval its arg twice.
8084         (x_connection_closed):
8085         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8086         * xterm.h: Adjust decls to match defn changes elsewhere.
8087         (struct scroll_bar): Use struct vectorlike_header
8088         rather than rolling our own approximation.
8089         (SCROLL_BAR_VEC_SIZE): Remove; not used.
8091 2012-05-25  Glenn Morris  <rgm@gnu.org>
8093         * lisp.mk (lisp): Update for more files being compiled now.
8095 2012-05-25  Stefan Monnier  <monnier@iro.umontreal.ca>
8097         * lread.c: Remove `read_pure' which makes no difference.
8098         (read_pure): Remove var.
8099         (unreadpure): Remove function.
8100         (readevalloop): Don't call read_list with -1 flag.
8101         (read1, read_vector): Don't test read_pure any more.
8102         (read_list): Simplify.
8104         * fileio.c, character.h: Minor style tweaks.
8106 2012-05-24  Dmitry Antipov  <dmantipov@yandex.ru>
8108         * window.h (clip_changed): Remove useless declaration.
8110 2012-05-22  Juanma Barranquero  <lekktu@gmail.com>
8112         * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8113         (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8115 2012-05-22  Paul Eggert  <eggert@cs.ucla.edu>
8117         Remove src/m/*.
8118         This directory predates autoconf and is no longer needed nowadays.
8119         Move its few remaining bits of functionality to where they're needed.
8120         * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8121         * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8122         * m/template.h: Remove.
8123         * Makefile.in (M_FILE): Remove.  All uses removed.
8124         * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8125         * lisp.h (USE_LSB_TAG):
8126         * mem-limits.h (EXCEEDS_LISP_PTR):
8127         Use VAL_MAX, not VALBITS, in #if.
8128         * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8129         (EMACS_UINT): Define unconditionally now.
8130         (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8131         (BITS_PER_EMACS_INT): New constants, replacing
8132         what used to be in config.h, but not useful in #if.
8133         (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
8134         define them any more.
8135         (VAL_MAX): New macro.
8136         (VALMASK): Use it.
8137         * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
8138         BITS_PER_EMACS_INT, in #if.
8139         * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8140         (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8141         * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8142         * s/ms-w32.h (DATA_START):
8143         Move here from removed file m/intel386.h.
8144         * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8145         * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8147 2012-05-21  Paul Eggert  <eggert@cs.ucla.edu>
8149         Assume C89 or later.
8150         * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8151         * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8152         (xrealloc):
8153         * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8154         * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8155         * textprop.c, tparam.c (NULL): Remove.
8156         * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8157         * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8158         * regex.h (_RE_ARGS): Remove.  All uses rewritten to use prototypes.
8159         * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8160         * xterm.c (input_signal_count): Assume volatile works.
8162 2012-05-21  Ken Brown  <kbrown@cornell.edu>
8164         * xgselect.c (xg_select): Fix first argument in call to 'select'
8165         (bug#11508).
8167 2012-05-20  Ken Brown  <kbrown@cornell.edu>
8169         * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
8170         [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
8172 2012-05-19  Ken Brown  <kbrown@cornell.edu>
8174         * xfns.c (x_in_use): Remove `static' qualifier.
8175         * xterm.h (x_in_use): Declare.
8176         * xgselect.c: Include xterm.h.
8177         (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8178         and `display_arg' (bug#9754).
8180 2012-05-19  Paul Eggert  <eggert@cs.ucla.edu>
8182         * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8184         * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8185         * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8187 2012-05-18  Eli Zaretskii  <eliz@gnu.org>
8189         Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8191         * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
8192         (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
8194         * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8195         reference to image_cache->refcount.
8196         (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8198 2012-05-17  Juri Linkov  <juri@jurta.org>
8200         * search.c (Fword_search_regexp, Fword_search_backward)
8201         (Fword_search_forward, Fword_search_backward_lax)
8202         (Fword_search_forward_lax): Move functions to isearch.el
8203         (bug#10145, bug#11381).
8205 2012-05-16  Paul Eggert  <eggert@cs.ucla.edu>
8207         * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8209 2012-05-15  Stefan Monnier  <monnier@iro.umontreal.ca>
8211         * lread.c (init_obarray): Declare Qt and Qnil as special.
8213 2012-05-14  Glenn Morris  <rgm@gnu.org>
8215         * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
8216         Put "libexec" before "bin", for the sake of init_callproc_1.
8218 2012-05-14  Paul Eggert  <eggert@cs.ucla.edu>
8220         * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8222         * unexaix.c: Port to more-recent AIX compilers.
8223         (report_error, report_error_1, make_hdr, copy_sym)
8224         (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8225         Make arguments const char *, not char *, to avoid violations of C
8226         standard and to fix some AIX warnings reported by Gilles Pion.
8228 2012-05-14  Eli Zaretskii  <eliz@gnu.org>
8230         * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8231         already have overlays loaded.
8232         (handle_single_display_spec): Before returning without displaying
8233         fringe bitmap, synchronize the bidi iterator with the main display
8234         iterator, by calling iterate_out_of_display_property.
8235         (iterate_out_of_display_property): Detect buffer iteration by
8236         testing that it->string is a Lisp string.
8237         (get_next_display_element): When the current object is exhausted,
8238         and there's something on it->stack, call set_iterator_to_next to
8239         proceed with what's on the stack, instead of returning zero.
8240         (set_iterator_to_next): If called at the end of a Lisp string,
8241         proceed to consider_string_end without incrementing string
8242         position.  Don't increment display vector index past the end of
8243         the display vector.  (Bug#11417)
8244         (pos_visible_p): Don't report a position visible when move_it_to
8245         stopped at the last line of window, which happens to be scanned
8246         backwards by the bidi iteration.  (Bug#11464)
8248 2012-05-14  Eli Zaretskii  <eliz@gnu.org>
8250         * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8251         and right-margin display specs even if the spec is invalid or we
8252         are on a TTY, and thus unable to display on the fringes.
8253         That's because the text with the property will not be displayed anyway,
8254         so we need to signal to the caller that this is a "replacing"
8255         display spec.  This fixes display when the spec is invalid or we
8256         are on a TTY.
8258 2012-05-14  Paul Eggert  <eggert@cs.ucla.edu>
8260         * unexaix.c (make_hdr): Fix typo in prototype.
8261         This bug broke the build on AIX.  Problem reported by Gilles Pion.
8263 2012-05-14  Michael Albinus  <michael.albinus@gmx.de>
8265         * keyboard.c (kbd_buffer_get_event): Read special events also in
8266         batch mode.  (Bug#11415)
8268 2012-05-12  Glenn Morris  <rgm@gnu.org>
8270         * ns.mk: Update for ns_appbindir no longer having trailing "/".
8272 2012-05-12  Eli Zaretskii  <eliz@gnu.org>
8274         * lisp.mk (lisp): Add newcomment.elc.
8276 2012-05-12  Glenn Morris  <rgm@gnu.org>
8278         * Makefile.in (MKDIR_P): New, set by configure.
8279         * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8281 2012-05-11  Paul Eggert  <eggert@cs.ucla.edu>
8283         Remove unused function hourglass_started.
8284         * dispextern.h (hourglass_started):
8285         * w32fns.c (hourglass_started):
8286         * xdisp.c (hourglass_started): Remove.
8288 2012-05-10  Juanma Barranquero  <lekktu@gmail.com>
8290         * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8291         Update dependencies.
8293 2012-05-10  Paul Eggert  <eggert@cs.ucla.edu>
8295         * xgselect.c (xg_select): Put maxfds+1 into a var.
8296         This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8298         * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8300 2012-05-10  Dave Abrahams  <dave@boostpro.com>
8302         * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8303         (lock_file): If create_lockfiles is 0, do nothing.  (Bug#11227)
8305 2012-05-09  Michael Albinus  <michael.albinus@gmx.de>
8307         * dbusbind.c (xd_registered_buses): New internal Lisp object.
8308         Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8309         (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8310         Initialize xd_registered_buses.
8312 2012-05-09  Paul Eggert  <eggert@cs.ucla.edu>
8314         Untag more efficiently if USE_LSB_TAG.
8315         This is based on a proposal by YAMAMOTO Mitsuharu in
8316         <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8317         For an admittedly artificial (nth 8000 longlist) benchmark on
8318         Fedora 15 x86-64, this yields a 25% CPU speedup.  Also, it shrinks
8319         Emacs's overall text size by 1%.
8320         * lisp.h (XUNTAG): New macro.
8321         (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8322         (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8323         (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8324         * eval.c (Fautoload):
8325         * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8326         * frame.h (XFRAME): Use XUNTAG.
8328         Port recent dbusbind.c changes to 32-bit --with-wide-int.
8329         * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8330         Remove unportable assumptions about print widths of types like
8331         dbus_uint32_t.
8332         (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8333         intptr_t when converting between pointer and integer, to avoid GCC
8334         warnings about wrong width.
8336 2012-05-09  Eli Zaretskii  <eliz@gnu.org>
8338         * w32proc.c (new_child): Force Windows to reserve only 64KB of
8339         stack for each reader_thread, instead of defaulting to 8MB
8340         determined by the linker.  This avoids failures in creating
8341         subprocesses on Windows 7, see the discussion in this thread:
8342         http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8344 2012-05-07  Jérémy Compostella  <jeremy.compostella@gmail.com>
8346         Fix up display of the *Minibuf-0* buffer in the mini window.
8347         * keyboard.c (read_char): Don't clear the echo area if there's no
8348         message to clear.
8349         * xdisp.c (redisplay_internal): Redisplay the mini window (with the
8350         contents of *Minibuf-0*) if there's no message displayed in its stead.
8352 2012-05-07  Michael Albinus  <michael.albinus@gmx.de>
8354         * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8355         batch mode.
8357 2012-05-06  Chong Yidong  <cyd@gnu.org>
8359         * lisp.mk (lisp): Update.
8361 2012-05-05  Jim Meyering  <meyering@redhat.com>
8363         * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8365 2012-05-04  Stefan Monnier  <monnier@iro.umontreal.ca>
8367         * data.c (PUT_ERROR): New macro.
8368         (syms_of_data): Use it.  Add new error type `user-error'.
8369         * undo.c (user_error): New function.
8370         (Fprimitive_undo): Use it.
8371         * print.c (print_error_message): Adjust print style for `user-error'.
8372         * keyboard.c (user_error): New function.
8373         (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8375 2012-05-03  Paul Eggert  <eggert@cs.ucla.edu>
8377         Do not limit current-time-string to years 1000..9999.
8378         * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8379         (Fcurrent_time_string): Support any year that is supported by the
8380         underlying localtime representation.  Don't use asctime, as it
8381         has undefined behavior for years outside the range -999..9999.
8383 2012-05-02  Paul Eggert  <eggert@cs.ucla.edu>
8385         Fix race conditions involving setenv, gmtime, localtime, asctime.
8386         Without this fix, interrupts could mess up code that uses these
8387         nonreentrant functions, since setting TZ invalidates existing
8388         tm_zone or tzname values, and since most of these functions return
8389         pointers to static storage.
8390         * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8391         (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8392         Grow the critical sections to include not just invoking
8393         localtime/gmtime, but also accessing these functions' results
8394         including their tm_zone values if any, and any related TZ setting.
8395         (format_time_string): Last arg is now struct tm *, not struct tm **,
8396         so that the struct tm is saved in the critical section.
8397         All callers changed.  Simplify allocation of initial buffer, partly
8398         motivated by the fact that memory allocation needs to be outside
8399         the critical section.
8401 2012-05-02  Dmitry Antipov  <dmantipov@yandex.ru>
8403         * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8404         with RESET_INTERVAL.
8406         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8407         Remove duplicated buffer name initialization.
8409 2012-05-02  Jim Meyering  <jim@meyering.net>
8411         * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8413         * xfns.c (x_window): Use xstrdup (Bug#11375).
8415 2012-05-02  Eli Zaretskii  <eliz@gnu.org>
8417         * xdisp.c (pos_visible_p): If already at a newline from the
8418         display string before the 'while' loop, don't walk back the glyphs
8419         from it3.glyph_row.  Solves assertion violation when the display
8420         string begins with a newline (egg.el).  (Bug#11367)
8422 2012-05-01  Stefan Monnier  <monnier@iro.umontreal.ca>
8424         * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8425         Move to simple.el.
8427 2012-05-01  Glenn Morris  <rgm@gnu.org>
8429         * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8430         s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8431         and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8432         All were removed before 23.1.
8434         * dispnew.c: Remove HAVE_LIBNCURSES test;
8435         it is always true on relevant platforms.
8437         * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8438         Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8440         * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8442 2012-04-30  Andreas Schwab  <schwab@linux-m68k.org>
8444         * .gdbinit (xpr): Remove checks for no longer existing misc types.
8445         (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8446         Remove.
8448 2012-04-28  Paul Eggert  <eggert@cs.ucla.edu>
8450         Do not avoid creating empty evaporating overlays (Bug#9642).
8451         * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8452         That is, do not delete an evaporating overlay if it becomes
8453         empty after its bounds are adjusted to fit within its buffer.
8454         This fix caused other problems, and I'm reverting it until we get
8455         to the bottom of them.
8457 2012-04-27  Chong Yidong  <cyd@gnu.org>
8459         * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8461 2012-04-27  Eli Zaretskii  <eliz@gnu.org>
8463         * xdisp.c (pos_visible_p): If the window start position is beyond
8464         ZV, start the display from buffer beginning.  Prevents assertion
8465         violation in init_iterator when the minibuffer window is scrolled
8466         via the scroll bar.
8468         * window.c (window_scroll_pixel_based): Likewise.
8470 2012-04-27  Chong Yidong  <cyd@gnu.org>
8472         * keymap.c (where_is_internal): Doc fix (Bug#10872).
8474 2012-04-27  Glenn Morris  <rgm@gnu.org>
8476         * fileio.c (Fcopy_file, Fset_file_selinux_context):
8477         Ignore ENOTSUP failures from setfilecon functions.  (Bug#11245)
8479 2012-04-27  Eli Zaretskii  <eliz@gnu.org>
8481         * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8482         Don't overrun array limits of glyph row's used[] array.  (Bug#11288)
8484 2012-04-26  Eli Zaretskii  <eliz@gnu.org>
8486         * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8487         display element, check also the underlying string or buffer
8488         character.  (Bug#11341)
8490         * w32menu.c: Include w32heap.h.
8491         (add_menu_item): If the call to AppendMenuW (via
8492         unicode_append_menu) fails, disable Unicode menus only if we are
8493         running on Windows 9X/Me.
8495 2012-04-24  Andreas Schwab  <schwab@linux-m68k.org>
8497         * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8498         (xgetint): Add missing shift for LSB tags.
8500 2012-04-24  Martin Rudalics  <rudalics@gmx.at>
8502         * keyboard.c (read_char): Don't wipe echo area for select window
8503         events: These might get delayed via `mouse-autoselect-window'
8504         (Bug#11304).
8506 2012-04-24  Juanma Barranquero  <lekktu@gmail.com>
8508         * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8509         manipulation of :loaded-from data.
8511 2012-04-23  Juanma Barranquero  <lekktu@gmail.com>
8513         * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8514         now a cons (bug#11311).
8516 2012-04-23  Paul Eggert  <eggert@cs.ucla.edu>
8518         Do not create empty overlays with the evaporate property (Bug#9642).
8519         * buffer.c (Fmove_overlay): Delete an evaporating overlay
8520         if it becomes empty after its bounds are adjusted to fit within
8521         its buffer.  Without this fix, in a nonempty buffer (let ((o
8522         (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8523         yields an empty overlay that has the evaporate property, which is
8524         not supposed to happen.
8526         Fix minor GTK3 problems found by static checking.
8527         * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8528         (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8529         (struct _EmacsFixedClass, emacs_fixed_get_type):
8530         Move decls here from emacsgtkfixed.h, since they needn't be public.
8531         (emacs_fixed_get_type): Now static.
8532         (emacs_fixed_class_init): Omit unused local.
8533         (emacs_fixed_child_type): Remove; unused.
8534         * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8535         (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8536         (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8537         (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8538         (EMACS_FIXED_GET_CLASS): Remove; unused.
8539         * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8541         * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8542         Problem reported by Juanma Barranquero for Windows -Wunused-function.
8544 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
8546         Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
8547         * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
8548         (__malloc_size_t, __malloc_ptrdiff_t):
8549         Remove.  All uses removed, replaced by the definiens if needed,
8550         since we can assume C89 or better now.
8551         Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8552         (protect_malloc_state, align, get_contiguous_space)
8553         (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8554         (malloc_atfork_handler_child, malloc_enable_thread)
8555         (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8556         (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8557         (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8558         (special_realloc, _realloc_internal_nolock, _realloc_internal)
8559         (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8560         (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8561         Define using prototypes, not old style.
8562         (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8563         Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8564         (align): Don't assume that signed integer overflow wraps around.
8565         Omit unused local var.
8566         (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8567         (_free_internal_nolock, memalign, mallochook, reallochook):
8568         Omit no-longer-needed casts.
8569         (valloc): Use getpagesize, not __getpagesize.
8570         (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8571         (struct hdr): The 'magic' member is now size_t, not unsigned long.
8573         * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8575 2012-04-22  Michael Albinus  <michael.albinus@gmx.de>
8577         Move functions from C to Lisp.  Make non-blocking method calls
8578         the default.  Implement further D-Bus standard interfaces.
8580         * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8581         (QCdbus_request_name_allow_replacement)
8582         (QCdbus_request_name_replace_existing)
8583         (QCdbus_request_name_do_not_queue)
8584         (QCdbus_request_name_reply_primary_owner)
8585         (QCdbus_request_name_reply_in_queue)
8586         (QCdbus_request_name_reply_exists)
8587         (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8588         (QCdbus_registered_serial, QCdbus_registered_method)
8589         (QCdbus_registered_signal): New Lisp objects.
8590         (XD_DEBUG_MESSAGE): Use sizeof.
8591         (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8592         (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8593         (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8594         (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8595         (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8596         (xd_signature, xd_append_arg): Allow float for integer types.
8597         (xd_get_connection_references): New function.
8598         (xd_get_connection_address): Rename from xd_initialize.
8599         Return cached address.
8600         (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8601         (xd_close_bus): Rename from Fdbus_close_bus.  Not needed on Lisp
8602         level.
8603         (Fdbus_init_bus): New optional arg PRIVATE.  Cache address.
8604         Return number of refcounts.
8605         (Fdbus_get_unique_name): Make stronger parameter check.
8606         (Fdbus_message_internal): New defun.
8607         (Fdbus_call_method, Fdbus_call_method_asynchronously)
8608         (Fdbus_method_return_internal, Fdbus_method_error_internal)
8609         (Fdbus_send_signal, Fdbus_register_service)
8610         (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8611         (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8612         (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8613         (Vdbus_compiled_version, Vdbus_runtime_version)
8614         (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8615         (Vdbus_message_type_method_return, Vdbus_message_type_error)
8616         (Vdbus_message_type_signal): New defvars.
8617         (Vdbus_registered_buses, Vdbus_registered_objects_table):
8618         Adapt docstring.
8620 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
8622         Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8623         * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8624         Do not assume ptrdiff_t is the same width as 'int'.
8626         * alloc.c: Handle unusual debugging option combinations.
8627         (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8628         since the two debugging options are incompatible.
8629         (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8630         is defined.
8631         (mem_init, mem_insert, mem_insert_fixup):
8632         Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8633         (NEED_MEM_INSERT): Remove; no longer needed.
8635 2012-04-22  Leo Liu  <sdl.web@gmail.com>
8637         * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8639 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
8641         * sysdep.c [__FreeBSD__]: Minor cleanups.
8642         (list_system_processes, system_process_attributes) [__FreeBSD__]:
8643         Use Emacs indenting style more consistently.  Avoid some casts.
8644         Use 'double' consistently rather than mixing 'float' and 'double'.
8646 2012-04-21  Eduard Wiebe  <usenet@pusto.de>
8648         * sysdep.c (list_system_processes, system_process_attributes):
8649         Add implementation for FreeBSD (Bug#5243).
8651 2012-04-21  Andreas Schwab  <schwab@linux-m68k.org>
8653         * lisp.mk (lisp): Update.
8655 2012-04-20  Paul Eggert  <eggert@cs.ucla.edu>
8657         * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8658         It is never used otherwise.
8660 2012-04-20  Stefan Monnier  <monnier@iro.umontreal.ca>
8662         * print.c (print_preprocess): Only check print_depth if print-circle
8663         is nil.
8664         (print_object): Check for cycles even when print-circle is nil and
8665         print-gensym is t, but only check print_depth if print-circle is nil.
8667 2012-04-20  Chong Yidong  <cyd@gnu.org>
8669         * process.c (wait_reading_process_output): If EIO occurs on a pty,
8670         set the status to "failed" and ensure that sentinel is run.
8672 2012-04-20  Glenn Morris  <rgm@gnu.org>
8674         * process.c (Fset_process_inherit_coding_system_flag)
8675         (Fset_process_query_on_exit_flag): Doc fix (mention return value).
8676         (Fmake_network_process, Fmake_serial_process): Doc fix.
8678 2012-04-20  Eli Zaretskii  <eliz@gnu.org>
8680         * xdisp.c (string_buffer_position_lim): Limit starting position to
8681         BEGV.
8682         (set_cursor_from_row): If called for a mode-line or header-line
8683         row, return zero immediately.
8684         (try_cursor_movement): If inside continuation line, don't back up
8685         farther than the first row after the header line, if any.
8686         Don't consider the header-line row as "partially visible", even if
8687         MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero.  (Bug#11261)
8689 2012-04-20  Atsuo Ohki  <ohki@gssm.otsuka.tsukuba.ac.jp>  (tiny change)
8691         * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8692         (bug#11238).
8694 2012-04-20  Teodor Zlatanov  <tzz@lifelogs.com>
8695 2012-04-18  Paul Eggert  <eggert@cs.ucla.edu>
8697         configure: new option --enable-gcc-warnings (Bug#11207)
8698         * Makefile.in (C_WARNINGS_SWITCH): Remove.
8699         (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8700         (ALL_CFLAGS): Use new macros rather than old.
8701         * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8702         * regex.c: Ignore -Wstrict-overflow.  If !emacs, also ignore
8703         -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8704         -Wunused-result, -Wunused-variable.  This should go away once
8705         the Emacs and Gnulib regex code is merged.
8706         (xmalloc, xrealloc): Now static.
8708 2012-04-17  Paul Eggert  <eggert@cs.ucla.edu>
8710         * dired.c (Fsystem_groups): Remove unused local.
8712 2012-04-17  Glenn Morris  <rgm@gnu.org>
8714         * dired.c (Fsystem_users): Doc fix.
8716 2012-04-17  Dmitry Antipov  <dmantipov@yandex.ru>
8718         * dired.c (Fsystem_users, Fsystem_groups): New functions.  (Bug#7900)
8719         (syms_of_dired): Add them.
8721 2012-04-16  Paul Eggert  <eggert@cs.ucla.edu>
8723         Fix minor alloc.c problems found by static checking.
8724         * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8725         New extern decls, to avoid calling undeclared functions.
8726         (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8727         && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8728         GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8729         (NEED_MEM_INSERT): New macro.
8730         (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
8731         Remove one incorrect comment and fix another.
8733         Fix minor ralloc.c problems found by static checking.
8734         See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8735         * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8736         (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8737         (r_alloc_sbrk): Now static.
8739         Improve ralloc.c interface checking.
8740         See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8741         * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8742         (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8743         * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8744         [REL_ALLOC]: ... to here, to check interface.
8745         * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8746         Remove decls.  This fixes an "It stinks!".
8748         * alloc.c (which_symbols): Fix alignment issue / type clash.
8750 2012-04-15  Andreas Schwab  <schwab@linux-m68k.org>
8752         * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8753         (struct Lisp_Misc_Any): Likewise.
8754         (struct Lisp_Free): Likewise.
8755         * alloc.c (union aligned_Lisp_Symbol): Define.
8756         (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8757         aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8758         (union aligned_Lisp_Misc): Define.
8759         (MARKER_BLOCK_SIZE, struct marker_block): Use union
8760         aligned_Lisp_Misc instead of union Lisp_Misc.
8761         (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
8763 2012-04-14  Paul Eggert  <eggert@cs.ucla.edu>
8765         Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8766         * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8767         * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8768         * s/netbsd.h, s/sol2-6.h:
8769         Remove definition of GC_MARK_STACK, since the default now works.
8770         * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8771         Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8772         no longer the default.
8773         * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8775 2012-04-14  Atsuo Ohki  <ohki@gssm.otsuka.tsukuba.ac.jp>  (tiny change)
8777         * lread.c (lisp_file_lexically_bound_p):
8778         Fix hang at ";-*-\n" (bug#11238).
8780 2012-04-14  Eli Zaretskii  <eliz@gnu.org>
8782         * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8783         "unchanged" if its end.pos is beyond ZV.  (Bug#11199)
8785 2012-04-14  Jan Djärv  <jan.h.d@swipnet.se>
8787         * nsterm.m (constrainFrameRect): Always constrain when there is only
8788         one screen (Bug#10962).
8790 2012-04-13  Ken Brown  <kbrown@cornell.edu>
8792         * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8794 2012-04-13  Reuben Thomas  <rrt@sc3d.org>
8796         * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8798 2012-04-11  Daniel Colascione  <dancol@dancol.org>
8800         * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8801         against is gone.  It's better to use vfork now so that when Cygwin
8802         gains a new, working vfork, we use it automatically (bug#10398).
8804 2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
8806         * window.c (save_window_save): Obey window-point-insertion-type.
8808 2012-04-11  Glenn Morris  <rgm@gnu.org>
8810         * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8812 2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
8814         * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8816 2012-04-10  Jason S. Cornez  <jcornez@ravenpack.com>  (tiny change)
8818         * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8819         (force_quit_count): New var.
8820         (handle_interrupt): Use it.
8822 2012-04-10  Juanma Barranquero  <lekktu@gmail.com>
8824         * w32.c (w32_delayed_load): Record the full path of the library
8825         being loaded (bug#10424).
8827 2012-04-09  Glenn Morris  <rgm@gnu.org>
8829         * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8830         not just in the obarray, before snarfing them.  (Bug#11036)
8832         * Makefile.in ($(leimdir)/leim-list.el):
8833         Pass EMACS rather than BUILT_EMACS.
8835 2012-04-09  Teodor Zlatanov  <tzz@lifelogs.com>
8837         * process.c (make_process):
8838         * process.h: Add integer `gnutls_handshakes_tried' member to
8839         process struct.
8841         * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8842         Add convenience `GNUTLS_LOG2i' macro.
8844         * gnutls.c (gnutls_log_function2i): Convenience log function.
8845         (emacs_gnutls_read): Use new log functions,
8846         `gnutls_handshakes_tried' process member, and
8847         `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8848         attempts per process (connection).
8850 2012-04-09  Chong Yidong  <cyd@gnu.org>
8852         * eval.c (Fuser_variable_p, user_variable_p_eh)
8853         (lisp_indirect_variable): Functions deleted.
8854         (Fdefvar): Caller changed.
8856         * callint.c (Finteractive, Fcall_interactively):
8857         * minibuf.c (Fread_variable): Callers changed.
8859 2012-04-09  Eli Zaretskii  <eliz@gnu.org>
8861         * xdisp.c (set_cursor_from_row): If the display string appears in
8862         the buffer at position that is closer to point than the position
8863         after the display string, display the cursor on the first glyph of
8864         the display string.  Fixes cursor display when a 'display' text
8865         property immediately follows invisible text.  (Bug#11094)
8867 2012-04-09  Paul Eggert  <eggert@cs.ucla.edu>
8869         composite.c: use 'double' consistently
8870         * composite.c (get_composition_id): Use 'double' consistently
8871         instead of converting 'float' to 'double' and vice versa; this is
8872         easier to understand and avoids a GCC warning.
8874 2012-04-09  Glenn Morris  <rgm@gnu.org>
8876         * Makefile.in: Generate leim-list with bootstrap-emacs, in
8877         preparation for dumping it with emacs.  (Bug#4789)
8878         (leimdir): New variable.
8879         ($(leimdir)/leim-list.el): New rule.
8880         (emacs$(EXEEXT)): Depend on leim-list.el.
8882         * buffer.c (Qucs_set_table_for_input): Remove.  (Bug#9821)
8883         (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8884         (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8886 2012-04-08  Andreas Schwab  <schwab@linux-m68k.org>
8888         * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8889         proper alignment.
8891 2012-04-07  Juanma Barranquero  <lekktu@gmail.com>
8893         * xml.c (init_libxml2_functions) [WINDOWSNT]:
8894         Remove unused local variable.
8896 2012-04-07  Paul Eggert  <eggert@cs.ucla.edu>
8898         Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8899         * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8900         (mark_memory): Mark Lisp_Objects only if pointers might hide in
8901         objects, as mark_maybe_pointer will catch them otherwise.
8902         (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8903         * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8905 2012-04-07  Paul Eggert  <eggert@cs.ucla.edu>
8907         Fix typo that broke non-Windows builds.
8908         * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8910 2012-04-07  Eli Zaretskii  <eliz@gnu.org>
8912         Support building on MS-Windows with libxml2.
8914         * makefile.w32-in (OBJ2): Add xml.$(O).
8915         (GLOBAL_SOURCES): Add xml.c.
8916         ($(BLD)/xml.$(O)): New dependency list.
8918         * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8919         (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8920         (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8921         [!WINDOWSNT]: New macros.
8922         (init_libxml2_functions, libxml2_loaded_p): New functions.
8923         (parse_region): Call fn_xmlCheckVersion instead of using the macro
8924         LIBXML_TEST_VERSION.  Call libxml2 functions via the fn_* macros.
8925         (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8926         Calls xmlCleanupParser only if libxml2 was loaded (or statically
8927         linked in).
8928         (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8929         Call init_libxml2_functions before calling libxml2 functions.
8930         (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8932         * emacs.c: Don't include libxml/parser.h.
8933         (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8934         xmlCleanupParser directly.
8936         * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8938 2012-04-07  Eli Zaretskii  <eliz@gnu.org>
8940         * indent.c (Fvertical_motion): If there is a display string at
8941         point, use it.vpos to compute how many lines to backtrack after
8942         move_it_to point.  (Bug#11133)
8944 2012-04-06  Eli Zaretskii  <eliz@gnu.org>
8946         * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8947         * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8948         about subtle differences between FETCH_CHAR* and STRING_CHAR*
8949         macros related to unification of CJK characters.  For the details,
8950         see the discussion following the message here:
8951         http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8953 2012-04-04  Chong Yidong  <cyd@gnu.org>
8955         * keyboard.c (Vdelayed_warnings_list): Doc fix.
8957 2012-04-01  Eli Zaretskii  <eliz@gnu.org>
8959         * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8960         instead of alloca.  (Bug#11138)
8962 2012-04-01  Andreas Schwab  <schwab@linux-m68k.org>
8964         * w32menu.c (is_simple_dialog): Properly check lisp types.
8965         (Bug#11141)
8967 2012-03-31  Eli Zaretskii  <eliz@gnu.org>
8969         * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8970         position we get to after a call to move_it_to fails the
8971         IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8972         only if we wind up in a string from display property.  (Bug#11063)
8974         * window.c (Fdelete_other_windows_internal): Invalidate the row
8975         and column information about mouse highlight, so that redisplay
8976         restores it after reallocating the glyph matrices.  (Bug#7464)
8978         * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8979         string comes from a `display' text property, use the buffer
8980         position of that property as if we actually saw that position in
8981         the row's glyphs.
8982         (move_it_by_lines): Remove the assertion that
8983         "it->current_x == 0 && it->hpos == 0" which can be legitimately
8984         violated when there's a before-string at the beginning of a line.
8985         (Bug#11063)
8987 2012-03-30  Eli Zaretskii  <eliz@gnu.org>
8989         * xdisp.c (append_space_for_newline): If the default face was
8990         remapped, use the remapped face for the appended newline.
8991         (extend_face_to_end_of_line): Use the remapped default face for
8992         extending the face to the end of the line.
8993         (display_line): Call extend_face_to_end_of_line when the default
8994         face was remapped.  (Bug#11068)
8996 2012-03-29  Eli Zaretskii  <eliz@gnu.org>
8998         * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
9000 2012-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
9002         * keyboard.c (safe_run_hooks_error): Don't unquote strings.
9004 2012-03-27  Glenn Morris  <rgm@gnu.org>
9006         * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
9007         Doc fixes.
9009 2012-03-26  Kenichi Handa  <handa@m17n.org>
9011         * dispextern.h (struct glyph): Fix previous change.  Change the
9012         bit length of glyphless.ch to 25 (Bug#11082).
9014 2012-03-26  Chong Yidong  <cyd@gnu.org>
9016         * keyboard.c (Vselection_inhibit_update_commands): New variable.
9017         (command_loop_1): Use it; inhibit selection update for
9018         handle-select-window too (Bug#8996).
9020 2012-03-25  Fabrice Popineau  <fabrice.popineau@supelec.fr>
9022         * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
9024 2012-03-25  Kenichi Handa  <handa@m17n.org>
9026         * dispextern.h (struct glyph): Change the bit length of
9027         glyphless.ch to 22 to make the member glyphless fit in 32 bits.
9029 2012-03-24  Eli Zaretskii  <eliz@gnu.org>
9031         * s/ms-w32.h (tzname): Include time.h before redirecting to
9032         _tzname.  Fixes the MSVC build.  (Bug#9960)
9034 2012-03-24  Andreas Schwab  <schwab@linux-m68k.org>
9036         * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
9037         characters.
9039         * xterm.c (XTread_socket): Only modify handling_signal if
9040         !SYNC_INPUT.  (Bug#11080)
9042 2012-03-23  Eli Zaretskii  <eliz@gnu.org>
9044         * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
9045         FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES.  Prevents crashes
9046         when fetching a multibyte character consumes more bytes than
9047         CHAR_BYTES returns, due to unification of CJK characters in
9048         string_char.  (Bug#11073)
9050 2012-03-23  Troels Nielsen  <bn.troels@gmail.com>  (tiny change)
9052         * process.c (wait_reading_process_output): Handle pty disconnect
9053         by refraining from sending oneself a SIGCHLD (bug#10933).
9055 2012-03-22  Chong Yidong  <cyd@gnu.org>
9057         * dispextern.h (struct it): New member string_from_prefix_prop_p.
9059         * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9060         Mark string as coming from a prefix property.
9061         (handle_face_prop): Use default face for prefix strings (Bug#4281).
9062         (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
9064 2012-03-21  Chong Yidong  <cyd@gnu.org>
9066         * xfaces.c (Vface_remapping_alist): Doc fix.
9068 2012-03-20  Eli Zaretskii  <eliz@gnu.org>
9070         * w32proc.c (Fw32_set_console_codepage)
9071         (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
9072         Doc fixes.
9074 2012-03-20  Chong Yidong  <cyd@gnu.org>
9076         * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
9077         to reflect default non-nil value of redisplay-dont-pause.
9079 2012-03-19  Kenichi Handa  <handa@m17n.org>
9081         * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9082         it fit in a valid range (Bug#11003).
9084 2012-03-18  Eli Zaretskii  <eliz@gnu.org>
9086         * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
9087         that is not from display property, accept the row as a "cursor
9088         row" if one of the string's character has a non-nil `cursor'
9089         property.  Fixes cursor positioning when there are newlines in
9090         overlay strings, e.g. in icomplete.el.  (Bug#11035)
9092 2012-03-12  Paul Eggert  <eggert@cs.ucla.edu>
9094         * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
9096 2012-03-12  Chong Yidong  <cyd@gnu.org>
9098         * eval.c (inhibit_lisp_code): Rename from
9099         inhibit_window_configuration_change_hook; move from window.c.
9101         * xfns.c (unwind_create_frame_1, Fx_create_frame):
9102         * window.c (run_window_configuration_change_hook)
9103         (syms_of_window): Callers changed.
9105 2012-03-11  Chong Yidong  <cyd@gnu.org>
9107         * keymap.c (Fkey_description): Doc fix (Bug#9700).
9109         * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9111 2012-03-10  Chong Yidong  <cyd@gnu.org>
9113         * frame.c (other_visible_frames): Don't assume the selected frame
9114         is visible (Bug#10955).
9116 2012-03-09  Stefan Monnier  <monnier@iro.umontreal.ca>
9118         * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9120 2012-03-08  Jan Djärv  <jan.h.d@swipnet.se>
9122         * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9123         FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9124         zero (Bug#10954).
9126 2012-03-03  Glenn Morris  <rgm@gnu.org>
9128         * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
9130 2012-03-02  Eli Zaretskii  <eliz@gnu.org>
9132         * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
9133         position past the first glyph_row that ends at ZV.  (Bug#10902)
9134         (redisplay_window, next_element_from_string): Fix typos in
9135         comments.
9136         (redisplay_window): Pass to move_it_vertically the margin in
9137         pixels, not in screen lines.
9139 2012-03-02  Glenn Morris  <rgm@gnu.org>
9141         * buffer.c (buffer-list-update-hook): Doc fix.
9143 2012-02-29  Eli Zaretskii  <eliz@gnu.org>
9145         * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9146         push_it before setting up the iterator for the first overlay
9147         string, even if we have an empty string loaded.
9148         (next_overlay_string): If there's an empty string on the iterator
9149         stack, pop the stack.  (Bug#10903)
9151 2012-02-25  Paul Eggert  <eggert@cs.ucla.edu>
9153         Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9154         Suggested by Stefan Monnier in
9155         <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9156         * alloc.c (widen_to_Lisp_Object): New static function.
9157         (mark_memory): Also mark Lisp_Objects by fetching pointer words
9158         and widening them to Lisp_Objects.  This would work even if
9159         USE_LSB_TAG is defined and wide integers are used, which might
9160         happen in a future version of Emacs.
9162 2012-02-25  Chong Yidong  <cyd@gnu.org>
9164         * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9165         Doc fix.
9167         * xselect.c (Fx_selection_exists_p): Doc fix.
9168         (x_clipboard_manager_save_all): Print an informative message
9169         before saving to clipboard manager.
9171 2012-02-24  Chong Yidong  <cyd@gnu.org>
9173         * keyboard.c (process_special_events): Handle all X selection
9174         requests in kbd_buffer, not just the next one (Bug#8869).
9176 2012-02-23  Chong Yidong  <cyd@gnu.org>
9178         * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9179         call when setting menu-bar-lines and tool-bar-lines parameters.
9180         (unwind_create_frame_1): New helper function.
9182         * window.c (inhibit_window_configuration_change_hook): New var.
9183         (run_window_configuration_change_hook): Obey it.
9184         (syms_of_window): Initialize it.
9186 2012-02-22  Chong Yidong  <cyd@gnu.org>
9188         * xterm.c (x_draw_image_relief): Add missing type check for
9189         Vtool_bar_button_margin (Bug#10743).
9191 2012-02-21  Chong Yidong  <cyd@gnu.org>
9193         * fileio.c (Vfile_name_handler_alist): Doc fix.
9195         * buffer.c (Fget_file_buffer): Protect against invalid file
9196         handler return value.
9198 2012-02-20  Paul Eggert  <eggert@cs.ucla.edu>
9200         * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9201         when computing $valmask.
9203         Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9204         * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9205         (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9206         It's useless in that case, and it can cause problems on hosts
9207         that allocate halves of EMACS_INT values separately.
9208         Reported by Dan Horák.  Diagnosed by Andreas Schwab in
9209         <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9210         * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9211         UINTPTR_MAX >> VALBITS == 0.  This is required by the above change;
9212         it avoids undefined behavior on hosts where shifting right by more
9213         than the word width has undefined behavior.
9215 2012-02-19  Chong Yidong  <cyd@gnu.org>
9217         * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9218         (Funhandled_file_name_directory, Ffile_name_as_directory)
9219         (Fdirectory_file_name, Fexpand_file_name)
9220         (Fsubstitute_in_file_name): Protect against invalid file handler
9221         return values (Bug#10845).
9223 2012-02-18  Eli Zaretskii  <eliz@gnu.org>
9225         * .gdbinit (pitx): Fix incorrect references to fields of the
9226         iterator stack.
9228 2012-02-17  Chong Yidong  <cyd@gnu.org>
9230         * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9232 2012-02-15  Paul Eggert  <eggert@cs.ucla.edu>
9234         * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9235         <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9237 2012-02-15  Chong Yidong  <cyd@gnu.org>
9239         * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9240         marked as special.  Also, starting docstrings with * is obsolete.
9242 2012-02-13  Andreas Schwab  <schwab@linux-m68k.org>
9244         * gnutls.c (emacs_gnutls_write): Fix last change.
9246 2012-02-13  Lars Ingebrigtsen  <larsi@gnus.org>
9248         * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9249         send_process.
9251 2012-02-13  Stefan Monnier  <monnier@iro.umontreal.ca>
9253         * keymap.c (Fsingle_key_description): Handle char ranges.
9255 2012-02-12  Chong Yidong  <cyd@gnu.org>
9257         * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9258         as that creates a dangerous corner case.
9260         * window.c (Fdelete_window_internal): Invalidate the mouse
9261         highlight (Bug#9904).
9263 2012-02-12  Glenn Morris  <rgm@gnu.org>
9265         * xselect.c (Fx_own_selection_internal)
9266         (Fx_get_selection_internal, Fx_disown_selection_internal)
9267         (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9268         * nsselect.m (Fx_own_selection_internal)
9269         (Fx_disown_selection_internal, Fx_selection_exists_p)
9270         (Fx_selection_owner_p, Fx_get_selection_internal):
9271         Sync docs and argument specs with the xselect.c versions.
9273 2012-02-11  Lars Ingebrigtsen  <larsi@gnus.org>
9275         * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9277 2012-02-11  Eli Zaretskii  <eliz@gnu.org>
9279         * w32select.c (Fx_selection_exists_p): Sync doc string and
9280         argument list with xselect.c.  (Bug#10783)
9282         * w16select.c (Fx_selection_exists_p): Sync doc string and
9283         argument list with xselect.c.  (Bug#10783)
9285 2012-02-10  Glenn Morris  <rgm@gnu.org>
9287         * fns.c (Fsecure_hash): Doc fix.
9289 2012-02-09  Kenichi Handa  <handa@m17n.org>
9291         * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9293 2012-02-07  Chong Yidong  <cyd@gnu.org>
9295         * buffer.c (Fbuffer_local_variables)
9296         (buffer_lisp_local_variables): Handle unbound vars correctly;
9297         don't let Qunbound leak into Lisp.
9299 2012-02-07  Glenn Morris  <rgm@gnu.org>
9301         * image.c (Fimagemagick_types): Doc fix.
9303         * image.c (imagemagick-render-type): Change it from a lisp object
9304         to an integer.  Move the doc here from the lisp manual.
9305         Treat all values not equal to 0 the same.
9307 2012-02-06  Chong Yidong  <cyd@gnu.org>
9309         * doc.c (store_function_docstring): Avoid applying docstring of
9310         alias to base function (Bug#2603).
9312 2012-02-04  Andreas Schwab  <schwab@linux-m68k.org>
9314         * .gdbinit (pp1, pv1): Remove redundant defines.
9315         (pr): Use pp.
9317 2012-02-04  Chong Yidong  <cyd@gnu.org>
9319         * nsterm.m: Declare a global (Bug#10694).
9321 2012-02-04  Eli Zaretskii  <eliz@gnu.org>
9323         * w32.c (get_emacs_configuration_options):
9324         Include --enable-checking, if specified, in the return value.
9326 2012-02-04  Martin Rudalics  <rudalics@gmx.at>
9328         * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9329         after rounding frame sizes.  (Bug#9723)
9331 2012-02-04  Eli Zaretskii  <eliz@gnu.org>
9333         * keyboard.c (adjust_point_for_property): Don't position point
9334         before BEGV.  (Bug#10696)
9336 2012-02-03  Paul Eggert  <eggert@cs.ucla.edu>
9338         Handle overflow when computing char display width (Bug#9496).
9339         * character.c (char_width): Return EMACS_INT, not int.
9340         (char_width, c_string_width): Check for overflow when
9341         computing the width; this is possible now that individual
9342         characters can have unbounded width.  Problem introduced
9343         by merge from Emacs 23 on 2012-01-19.
9345 2012-02-02  Michael Albinus  <michael.albinus@gmx.de>
9347         * dbusbind.c (Fdbus_register_method): Mention the return value
9348         :ignore in the docstring.
9350 2012-02-02  Glenn Morris  <rgm@gnu.org>
9352         * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9354         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9355         Unconditionally set to t.  (Bug#10673)
9356         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9357         * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9358         * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9360 2012-02-02  Kenichi Handa  <handa@m17n.org>
9362         (x_produce_glyphs): Cancel previous change.  If cmp->glyph_len is
9363         0, do not call append_composite_glyph.
9365 2012-02-02  Kenichi Handa  <handa@m17n.org>
9367         * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9368         NULL (Bug#6988).
9369         (x_produce_glyphs): If the component of a composition is a null
9370         string, set it->pixel_width to 1 to avoid zero-width glyph.
9372 2012-02-01  Eli Zaretskii  <eliz@gnu.org>
9374         * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9375         first 2 arguments are identical.  This makes inserting large
9376         output from a subprocess an order of magnitude faster on
9377         MS-Windows, where all sbrk'ed memory is always contiguous.
9379 2012-01-31  Glenn Morris  <rgm@gnu.org>
9381         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9382         * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9383         * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9385 2012-01-29  Glenn Morris  <rgm@gnu.org>
9387         * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9389 2012-01-28  Samuel Thibault  <sthibault@debian.org>  (tiny change)
9391         * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9393 2012-01-28  Chong Yidong  <cyd@gnu.org>
9395         * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9397 2012-01-26  Chong Yidong  <cyd@gnu.org>
9399         * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9401         * search.c (Fsearch_forward, Fsearch_backward): Document negative
9402         repeat counts (Bug#10507).
9404 2012-01-26  Glenn Morris  <rgm@gnu.org>
9406         * lread.c (syms_of_lread): Doc fix.
9408 2012-01-25  HIROSHI OOTA  <nil@mad.dog.cx>  (tiny change)
9410         * coding.c (encode_designation_at_bol): Change return value to
9411         EMACS_INT.
9413 2012-01-25  Chong Yidong  <cyd@gnu.org>
9415         * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9417 2012-01-21  Chong Yidong  <cyd@gnu.org>
9419         * floatfns.c (Fcopysign): Make the second argument non-optional,
9420         since nil is not allowed anyway.
9422 2012-01-21  Andreas Schwab  <schwab@linux-m68k.org>
9424         * process.c (read_process_output): Use p instead of XPROCESS (proc).
9425         (send_process): Likewise.
9427 2012-01-19  Martin Rudalics  <rudalics@gmx.at>
9429         * window.c (save_window_save, Fcurrent_window_configuration)
9430         (Vwindow_persistent_parameters): Do not use Qstate.
9431         Rewrite doc-strings.
9433 2012-01-19  Kenichi Handa  <handa@m17n.org>
9435         * character.c (char_width): New function.
9436         (Fchar_width, c_string_width, lisp_string_width):
9437         Use char_width (Bug#9496).
9439 2012-01-16  Martin Rudalics  <rudalics@gmx.at>
9441         * window.c (Vwindow_persistent_parameters): New variable.
9442         (Fset_window_configuration, save_window_save): Handle persistent
9443         window parameters.
9445 2012-01-14  Eli Zaretskii  <eliz@gnu.org>
9447         * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9448         thrashing the stack of the thread.  (Bug#9087)
9450 2012-01-12  Paul Eggert  <eggert@cs.ucla.edu>
9452         * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9454 2012-01-11  Eli Zaretskii  <eliz@gnu.org>
9456         * xdisp.c (rows_from_pos_range): Handle the case where the
9457         highlight ends on a newline.  (Bug#10464)
9458         (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9459         he end column for display of highlight that ends on a newline
9460         before a R2L line.
9462 2012-01-11  Glenn Morris  <rgm@gnu.org>
9464         * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9465         from load-path also when installation-directory is nil.  (Bug#10208)
9467 2012-01-10  Glenn Morris  <rgm@gnu.org>
9469         * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9471         * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9472         Update template values to be closer to their typical values these days.
9474 2012-01-09  Eli Zaretskii  <eliz@gnu.org>
9476         * xdisp.c (rows_from_pos_range): Accept additional argument
9477         DISP_STRING, and accept any glyph in a row whose object is that
9478         string as eligible for mouse highlight.  Fixes mouse highlight of
9479         display strings from overlays.  (Bug#10464)
9481 2012-01-07  Paul Eggert  <eggert@cs.ucla.edu>
9483         emacs: fix an auto-save permissions race condition (Bug#10400)
9484         * fileio.c (auto_saving_dir_umask): New static var.
9485         (Fmake_directory_internal): Use it.
9486         (do_auto_save_make_dir): Set it, instead of invoking chmod after
9487         creating the directory.  The old code temporarily assigns
9488         too-generous permissions to the directory.
9489         (do_auto_save_eh): Clear it.
9490         (Fdo_auto_save): Catch all errors, not just file errors, so
9491         that the var is always cleared.
9493 2012-01-07  Eli Zaretskii  <eliz@gnu.org>
9495         * search.c (scan_buffer): Pass character positions to
9496         know_region_cache, not byte positions.  (Bug#6540)
9498 2012-01-07  LynX  <_LynX@bk.ru>  (tiny change)
9500         * w32.c (sys_rename): Report EXDEV when rename of a directory
9501         fails because the target is on another logical disk.  (Bug#10284)
9503 2012-01-07  David Benjamin  <davidben@mit.edu>  (tiny change)
9505         * xterm.c (x_embed_request_focus): New function.
9507         * xterm.h: Add prototype.
9509         * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9511 2012-01-05  Glenn Morris  <rgm@gnu.org>
9513         * emacs.c (emacs_copyright): Update short copyright year to 2012.
9515 2012-01-01  Eli Zaretskii  <eliz@gnu.org>
9517         * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9518         Load gnutls_transport_set_lowat only if GnuTLS version is below
9519         2.11.1.
9520         (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9521         GnuTLS versions below 2.11.1.
9523 2011-12-31  Antoine Levitt  <antoine.levitt@gmail.com>
9525         * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9526         to the doc string advising against its use for altering the way
9527         windows are scrolled.
9529 2011-12-28  Kenichi Handa  <handa@m17n.org>
9531         * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9532         coding-system ASCII compatible only when it does not produce BOM
9533         on encoding (Bug#10383).
9535 2011-12-26  Jan Djärv  <jan.h.d@swipnet.se>
9537         * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9538         can scroll.
9539         (create_and_show_popup_menu): Always use menu_position_func for
9540         Gtk3 (Bug#10361).
9542 2011-12-24  Andreas Schwab  <schwab@linux-m68k.org>
9544         * callint.c (Fcall_interactively): Don't truncate prompt string.
9546 2011-12-23  Eli Zaretskii  <eliz@gnu.org>
9548         * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9549         property that ends at ZV, so that the bidi iteration could be
9550         resumed from there (after widening).  (Bug#10360)
9552 2011-12-22  Jan Djärv  <jan.h.d@swipnet.se>
9554         * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9556 2011-12-21  Jan Djärv  <jan.h.d@swipnet.se>
9558         * nsterm.m (x_free_frame_resources):
9559         Release f->output_data.ns->miniimage.
9560         (ns_index_color): Fix indentation.  Do not retain
9561         color_table->colors[i].
9563         * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9564         before returning.
9566         * nsfns.m (x_set_background_color): Assign return value from
9567         ns_index_color to face-background instead of NSColor*.
9568         (ns_implicitly_set_icon_type): Fix indentation.
9569         Change assignment in for loop to comparison.
9571         * emacs.c (ns_pool): New variable.
9572         (main): Assign ns_pool.
9573         (Fkill_emacs): Call ns_release_autorelease_pool.
9575         * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9576         autorelease fdesc, release fdAttrs and tdict.
9577         (ns_get_covering_families): Release charset.
9578         (ns_findfonts): Release NSFontDescriptor created with new.
9579         (ns_uni_to_glyphs): Fix indentation.
9580         (setString): Release attrStr before assigning new value.
9582 2011-12-18  Jan Djärv  <jan.h.d@swipnet.se>
9584         * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9585         and NS_IMPL_COCOA.
9586         (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9587         (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9589 2011-12-18  David Reitter  <reitter@cmu.edu>
9591         * nsterm.m (ns_term_init): Subscribe for notifications
9592         NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9593         to method trackingNotification in EmacsMenu.
9595         * nsmenu.m (trackingMenu): New variable.
9596         (trackingNotification): New method (from Aquamacs).
9597         (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
9598         from Aquamacs (Bug#7030).
9600 2011-12-18  Jan Djärv  <jan.h.d@swipnet.se>
9602         * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9603         (symbol_to_nsstring): Fix indentation.
9604         (ns_symbol_to_pb): New function.
9605         (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9606         (Fns_rotate_cut_buffers_internal): Remove.
9607         (Fns_store_selection_internal): Rename from
9608         Fns_store_cut_buffer_internal.
9609         (ns_get_foreign_selection, Fx_own_selection_internal)
9610         (Fx_disown_selection_internal, Fx_selection_exists_p)
9611         (Fns_get_selection_internal, Fns_store_selection_internal):
9612         Use ns_symbol_to_pb and check if return value is nil.
9613         (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT.  Remove defsubr
9614         Sns_rotate_cut_buffers_internal.  Sns_get_cut_buffer_internal
9615         renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9616         renamed to Sns_store_selection_internal.
9617         (ns_handle_selection_request): Move code to Fx_own_selection_internal
9618         and remove this function.
9619         (ns_handle_selection_clear): Remove, never used.
9620         (Fx_own_selection_internal): Move code from ns_handle_selection_request
9621         here.
9623 2011-12-17  Ken Brown  <kbrown@cornell.edu>
9625         * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9626         GID is unknown (Bug#10257).
9628 2011-12-17  Paul Eggert  <eggert@cs.ucla.edu>
9630         * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9631         (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9632         which caused a build failure on GNU/Linux IA-64.  This problem was
9633         introduced by my 2011-10-07 patch.
9635 2011-12-15  Juri Linkov  <juri@jurta.org>
9637         * image.c (imagemagick_error): New function.  (Bug#10112)
9638         (imagemagick_load_image): Comment out `MagickSetResolution' call.
9639         Use `imagemagick_error' where ImageMagick functions return
9640         `MagickFalse'.
9641         (Fimagemagick_types): Add `Fnreverse' to return the list in the
9642         proper order.
9644 2011-12-15  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
9646         * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9647         fill background (Bug#8992).
9649 2011-12-13  Martin Rudalics  <rudalics@gmx.at>
9651         * window.c (Vwindow_combination_resize)
9652         (Vwindow_combination_limit): Use t instead of non-nil in
9653         doc-strings.
9654         (Vrecenter_redisplay): Add first sentence of doc-string on
9655         separate line.
9656         (Frecenter): Fix doc-string typo.
9658 2011-12-11  Kenichi Handa  <handa@m17n.org>
9660         * coding.c (Funencodable_char_position): Pay attention to the
9661         buffer text relocation (Bug#9389).
9663 2011-12-10  Jan Djärv  <jan.h.d@swipnet.se>
9665         * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9666         gtk_init (Bug#10100).
9668 2011-12-10  Eli Zaretskii  <eliz@gnu.org>
9670         * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9671         IT->string is nil.  (Bug#10263)
9673 2011-12-10  Jan Djärv  <jan.h.d@swipnet.se>
9675         * nsterm.h (x_free_frame_resources): Declare.
9677         * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9678         (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9680         * nsterm.h (ns_get_defaults_value): Declare.
9682         * nsterm.m (ns_default): Call ns_get_defaults_value.
9684 2011-12-09  Eli Zaretskii  <eliz@gnu.org>
9686         * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9687         (Bug#10170)
9689 2011-12-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
9691         * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9692         that where the value of an _OBJC_* symbol points to is in the .bss
9693         section (Bug#10240).
9695 2011-12-08  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
9697         * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
9698         after the loop to call ccl_driver at least once (Bug#8619).
9700 2011-12-08  Kenichi Handa  <handa@m17n.org>
9702         * ftfont.c (get_adstyle_property): Fix previous change
9703         (Bug#10233).
9705 2011-12-07  Juanma Barranquero  <lekktu@gmail.com>
9707         * w32.c (init_environment): If no_site_lisp, remove site-lisp
9708         dirs from the default value of EMACSLOADPATH (bug#10208).
9710 2011-12-07  Glenn Morris  <rgm@gnu.org>
9712         * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9713         installation and source directories as well.  (Bug#10208)
9715 2011-12-06  Chong Yidong  <cyd@gnu.org>
9717         * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9719 2011-12-06  Glenn Morris  <rgm@gnu.org>
9721         * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9722         as an error, not just -1.  (Bug#10217)
9724 2011-12-05  Chong Yidong  <cyd@gnu.org>
9726         * keyboard.c (process_special_events): New function.
9727         (swallow_events, Finput_pending_p): Use it (Bug#10195).
9729 2011-12-05  Paul Eggert  <eggert@cs.ucla.edu>
9731         * coding.c (encode_designation_at_bol): Don't use uninitialized
9732         local variable (Bug#9318).
9734 2011-12-05  Kenichi Handa  <handa@m17n.org>
9736         * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9737         return Qnil (Bug#8046, Bug#10193).
9739 2011-12-05  Kenichi Handa  <handa@m17n.org>
9741         * coding.c (encode_designation_at_bol): New args charbuf_end and
9742         dst.  Return the number of produced bytes.  Callers changed.
9743         (coding_set_source): Return how many bytes coding->source was
9744         relocated.
9745         (coding_set_destination): Return how many bytes
9746         coding->destination was relocated.
9747         (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
9748         (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
9750 2011-12-05  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
9752         * coding.c (CODING_CHAR_CHARSET_P): New macro.
9753         (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9754         macro (Bug#9318).
9756 2011-12-05  Andreas Schwab  <schwab@linux-m68k.org>
9758         The following changes are to fix Bug#9318.
9760         * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
9761         (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9762         (encode_coding_iso_2022, encode_coding_sjis)
9763         (encode_coding_big5, encode_coding_charset): Use the above macros.
9765 2011-12-05  Juanma Barranquero  <lekktu@gmail.com>
9767         * lisp.h (process_quit_flag): Fix external declaration.
9769 2011-12-04  Stefan Monnier  <monnier@iro.umontreal.ca>
9771         Don't macro-inline non-performance-critical code.
9772         * eval.c (process_quit_flag): New function.
9773         * lisp.h (QUIT): Use it.
9775 2011-12-04  Jan Djärv  <jan.h.d@swipnet.se>
9777         * nsfns.m (get_geometry_from_preferences): New function.
9778         (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9780 2011-12-04  Andreas Schwab  <schwab@linux-m68k.org>
9782         * emacs.c (Qkill_emacs): Define.
9783         (syms_of_emacs): Initialize it.
9784         * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9785         Qquit_flag to `kill-emacs' instead.
9786         (quit_throw_to_read_char): Add parameter `from_signal'.
9787         All callers changed.  Call Fkill_emacs if requested and safe.
9788         * lisp.h (QUIT): Call Fkill_emacs if requested.
9790 2011-12-03  Jan Djärv  <jan.h.d@swipnet.se>
9792         * widget.c (update_wm_hints): Return if wmshell is null.
9793         (widget_update_wm_size_hints): New function.
9795         * widget.h (widget_update_wm_size_hints): Declare.
9797         * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9798         widget_update_wm_size_hints (Bug#10104).
9800 2011-12-03  Eli Zaretskii  <eliz@gnu.org>
9802         * xdisp.c (handle_invisible_prop): If the invisible text ends just
9803         before a newline, prepare the bidi iterator for consuming the
9804         newline, and keep the current paragraph direction.  (Bug#10183)
9805         (redisplay_window): Don't let `margin' become negative.  (Bug#10192)
9807 2011-12-02  Juri Linkov  <juri@jurta.org>
9809         * search.c (Fword_search_regexp): New Lisp function created from
9810         `wordify'.  Change type of arg `lax' from `int' to `Lisp_Object'.
9811         (Fword_search_backward, Fword_search_forward)
9812         (Fword_search_backward_lax, Fword_search_forward_lax):
9813         Use `Fword_search_regexp' instead of `wordify'.  Doc fix.
9814         (syms_of_search): Define `Sword_search_regexp'.  (Bug#10145)
9816 2011-12-01  Stefan Monnier  <monnier@iro.umontreal.ca>
9818         * fileio.c (Finsert_file_contents): Move after-change-function call
9819         to before the "handled:" label, since all "goto handled" appear in
9820         cases where the *-change-functions have already been properly called
9821         (bug#10117).
9823 2011-12-01  Andreas Schwab  <schwab@linux-m68k.org>
9825         * keyboard.c (interrupt_signal): Don't call kill-emacs when
9826         waiting for input.  (Bug#10169)
9828 2011-11-30  Eli Zaretskii  <eliz@gnu.org>
9830         * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9831         verifies glyph row's hash code--we have just reallocated the
9832         glyphs, so their contents can be complete garbage.  (Bug#10164)
9834 2011-11-30  Juanma Barranquero  <lekktu@gmail.com>
9836         * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9838 2011-11-30  Eli Zaretskii  <eliz@gnu.org>
9840         * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9841         attributes are tested _before_ calling verify_row_hash, to protect
9842         against GCC re-ordering of the tests.  (Bug#10164)
9844 2011-11-29  Jan Djärv  <jan.h.d@swipnet.se>
9846         * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9848         * xterm.c (handle_one_xevent): Only set async_visible and friends
9849         if net_wm_state_hidden_seen is non-zero (Bug#10002)
9850         (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
9851         _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9853 2011-11-28  Paul Eggert  <eggert@cs.ucla.edu>
9855         Remove GCPRO-related macros that exist only to avoid shadowing locals.
9856         * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9857         (GCPRO6_VAR, UNGCPRO_VAR): Remove.  See
9858         <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9859         All uses changed to use GCPRO1 etc.
9860         (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9861         Revert to old implementation (i.e., before 2011-03-11).
9863 2011-11-28  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
9865         * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9866         of scroll runs so as to avoid assigning disabled bogus rows and
9867         unnecessary graphics copy operations.
9869 2011-11-27  Eli Zaretskii  <eliz@gnu.org>
9871         * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9872         (snprintf) [_MSC_VER]: Redirect to _snprintf.
9873         (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9874         (malloc, free, realloc, calloc): Redirect to e_* only when
9875         compiling Emacs.
9877         * lisp.h (GCTYPEBITS): Move before first use.
9878         (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9879         (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9880         this macro definition.
9882         * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9883         _MSC_VER.
9885 2011-11-27  Jan Djärv  <jan.h.d@swipnet.se>
9887         * gtkutil.c (xg_create_frame_widgets):
9888         Call gtk_window_set_has_resize_grip (FALSE) if that function is
9889         present with Gtk+ 2.0.
9891 2011-11-26  Paul Eggert  <eggert@cs.ucla.edu>
9893         * fileio.c (Finsert_file_contents): Undo previous change; see
9894         <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9896 2011-11-26  Paul Eggert  <eggert@cs.ucla.edu>
9898         Rename locals to avoid shadowing.
9899         * fileio.c (Finsert_file_contents):
9900         Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9901         * process.c (wait_reading_process_output):
9902         Rename inner 'proc' to 'p' to avoid shadowing.
9903         Indent for consistency with usual Emacs style.
9905 2011-11-25  Eli Zaretskii  <eliz@gnu.org>
9907         * xdisp.c (redisplay_window): If cursor row is not fully visible
9908         after recentering, and scroll-conservatively is set to a large
9909         number, scroll window by a few more lines to make the cursor fully
9910         visible and out of scroll-margin.  (Bug#10105)
9911         (start_display): Don't move to the next line if the display should
9912         start at a newline that is part of a display vector or an overlay
9913         string.  (Bug#10119)
9915 2011-11-24  Juri Linkov  <juri@jurta.org>
9917         * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9918         after the `MagickPingImage' call.  (Bug#10112)
9920 2011-11-23  Chong Yidong  <cyd@gnu.org>
9922         * window.c (Fcoordinates_in_window_p): Accept only live windows.
9924 2011-11-23  Martin Rudalics  <rudalics@gmx.at>
9926         * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9927         making another buffer current.  (Bug#10114)
9929 2011-11-23  Glenn Morris  <rgm@gnu.org>
9931         * font.c (font_find_for_lface) [HAVE_NS]: Ignore case.  (Bug#2526)
9933 2011-11-23  Chong Yidong  <cyd@gnu.org>
9935         * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9936         using it (Bug#5984).
9938 2011-11-22  Eli Zaretskii  <eliz@gnu.org>
9940         * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9941         and header-lines, as they don't have one computed for them.
9942         (Bug#10098)
9944         * .gdbinit (prow): Make displayed values more self-explaining.
9945         Add row's hash code.
9947 2011-11-21  Lars Magne Ingebrigtsen  <larsi@gnus.org>
9949         * process.c (wait_reading_process_output): Fix asynchrounous
9950         GnuTLS socket handling on some versions of the GnuTLS library.
9951         (wait_reading_process_output): Add comment and URL.
9953 2011-11-21  Jan Djärv  <jan.h.d@swipnet.se>
9955         * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9957 2011-11-21  Chong Yidong  <cyd@gnu.org>
9959         * window.c (Fnext_window, Fprevious_window): Doc fix.
9961 2011-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
9963         * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9965 2011-11-20  Juanma Barranquero  <lekktu@gmail.com>
9967         * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9969 2011-11-20  Martin Rudalics  <rudalics@gmx.at>
9971         * window.c (Fset_window_combination_limit): Rename argument
9972         STATUS to LIMIT.
9973         (Vwindow_combination_limit): Remove "status" from doc-string.
9975 2011-11-20  Andreas Schwab  <schwab@linux-m68k.org>
9977         * m/ibms390.h: Remove.
9978         * m/ibms390x.h: Don't include "ibms390.h".
9980 2011-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
9982         * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9983         Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9985 2011-11-20  Juanma Barranquero  <lekktu@gmail.com>
9987         * casetab.c (Fset_case_table):
9988         * charset.c (Fcharset_after): Fix typos.
9990 2011-11-20  Paul Eggert  <eggert@cs.ucla.edu>
9992         Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9993         Otherwise, valgrind does not work on some platforms.
9994         Problem reported by Andreas Schwab in
9995         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9996         * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9997         is set, removing the need for VIRT_ADDRESS_VARIES.
9998         (PURE_P): Use a more-efficient implementation that needs just one
9999         comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
10000         number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
10001         to 4 (xorl, subq, cmpq, setbe).
10002         * alloc.c (pure): Always extern now, since that's the
10003         VIRT_ADDR_VARIES behavior.
10004         (PURE_POINTER_P): Use a single comparison, not two, for
10005         consistency with the new puresize.h.
10006         * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
10007         * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
10008         Remove VIRT_ADDR_VARIES no longer needed.
10010 2011-11-19  Eli Zaretskii  <eliz@gnu.org>
10012         * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
10013         (erase_phys_cursor, update_window_cursor, show_mouse_face)
10014         (cursor_in_mouse_face_p): If the cursor position is out of bounds,
10015         behave as if the cursor position were at the window margin.
10017         * window.c (get_phys_cursor_glyph): If the window is hscrolled,
10018         and the cursor position is out of bounds, behave as if the cursor
10019         position were at the window margin.  (Bug#10075)
10021 2011-11-18  Chong Yidong  <cyd@gnu.org>
10023         * window.c (Fwindow_combination_limit): Make first argument
10024         non-optional, since it is meaningless for live windows like the
10025         selected window.
10027 2011-11-18  Dmitry Antipov  <dmantipov@yandex.ru>
10029         * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
10031 2011-11-18  Stefan Monnier  <monnier@iro.umontreal.ca>
10033         * intervals.c: Fix grafting over the whole buffer (bug#10071).
10034         (graft_intervals_into_buffer): Simplify.
10036 2011-11-18  Eli Zaretskii  <eliz@gnu.org>
10038         * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
10039         hash values of the two rows.
10040         (copy_row_except_pointers): Preserve the used[] arrays and the
10041         hash values of the two rows.  (Bug#10035)
10042         (add_row_entry): Add xassert to verify that ROW's hash code is valid.
10044         * xdisp.c (row_hash): New function, body extracted from
10045         compute_line_metrics.
10046         (compute_line_metrics): Call row_hash, instead of computing the
10047         hash code inline.
10049         * dispnew.c (verify_row_hash): Call row_hash for computing the
10050         hash code of a row, instead of duplicating code from xdisp.c.
10052         * dispextern.h (row_hash): Add prototype.
10054 2011-11-18  Tassilo Horn  <tassilo@member.fsf.org>
10056         * frame.c (delete_frame): Don't delete the terminal when the last
10057         X frame is closed if emacs is built with GTK toolkit.
10059 2011-11-17  Juanma Barranquero  <lekktu@gmail.com>
10061         * window.c (syms_of_window) <window-combination-resize>: Fix typo.
10063 2011-11-17  Martin Rudalics  <rudalics@gmx.at>
10065         * window.c (Vwindow_splits): Rename to
10066         Vwindow_combination_resize.  Suggested by Juri Linkov.
10067         (Fsplit_window_internal): Use Vwindow_combination_resize instead
10068         of Vwindow_splits.
10070 2011-11-16  Juanma Barranquero  <lekktu@gmail.com>
10072         * nsfns.m (Fns_font_name):
10073         * window.c (syms_of_window) <window-combination-limit>: Fix typos.
10075 2011-11-16  Martin Rudalics  <rudalics@gmx.at>
10077         * window.h (window): Rename slot "nest" to "combination_limit".
10078         * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
10079         (Fset_window_nest): Rename to Fset_window_combination_limit.
10080         (Vwindow_nest): Rename to Vwindow_combination_limit.
10081         (recombine_windows, make_parent_window, make_window)
10082         (Fsplit_window_internal, saved_window)
10083         (Fset_window_configuration, save_window_save): Rename all
10084         occurrences of window_nest to window_combination_limit.
10086 2011-11-15  Juanma Barranquero  <lekktu@gmail.com>
10088         * image.c (imagemagick_load_image): Fix typo.
10090 2011-11-14  Eli Zaretskii  <eliz@gnu.org>
10092         * xdisp.c (display_line): Move the call to
10093         highlight_trailing_whitespace before the call to
10094         compute_line_metrics, since the latter needs to see the final
10095         faces of all the glyphs to compute ROW's hash value.
10096         Fixes assertion violations in row_equal_p.  (Bug#10035)
10098 2011-11-14  Juanma Barranquero  <lekktu@gmail.com>
10100         * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
10101         just return (bug#10044).
10103 2011-11-12  Eli Zaretskii  <eliz@gnu.org>
10105         * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
10106         with user-defined heap size.  Bump the default size of the temacs
10107         heap to 27MB, to avoid memory warning when running temacs.
10108         ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10110         * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10111         current_matrix and desired_matrix.  (Bug#9990)
10112         (verify_row_hash) [XASSERTS]: New function.
10113         (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10114         that the hash value of glyph rows is correct.
10116 2011-11-12  Martin Rudalics  <rudalics@gmx.at>
10118         * window.h (window): Remove splits slot.
10119         * window.c (Fwindow_splits, Fset_window_splits): Remove.
10120         (Fdelete_other_windows_internal, make_parent_window)
10121         (make_window, Fsplit_window_internal, Fdelete_window_internal)
10122         (Fset_window_configuration, save_window_save): Don't deal with
10123         split status of windows.
10124         (saved_window): Remove splits slot.
10125         (Vwindow_splits): Rewrite doc-string.
10127 2011-11-11  Jan Djärv  <jan.h.d@swipnet.se>
10129         * xfns.c (unwind_create_frame):
10130         * nsfns.m (unwind_create_frame):
10131         * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10132         Vframe_list (Bug#9999).
10134 2011-11-11  Dmitry Antipov  <dmantipov@yandex.ru>
10136         * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
10138 2011-11-11  Kenichi Handa  <handa@m17n.org>
10140         * callproc.c (Fcall_process): Set the member dst_multibyte of
10141         process_coding.
10143 2011-11-11  Johan Bockgård  <bojohan@gnu.org>
10145         * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10146         avoid a crash (bug#9496).
10148 2011-11-09  Chong Yidong  <cyd@gnu.org>
10150         * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10151         (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10153 2011-11-08  Paul Eggert  <eggert@cs.ucla.edu>
10155         * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10157 2011-11-08  Paul Eggert  <eggert@cs.ucla.edu>
10159         Avoid some portability problems by eschewing 'extern inline' functions.
10160         The trivial performance wins aren't worth the portability hassles; see
10161         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10162         et seq.
10163         * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10164         (window_box_width, window_box_left, window_box_left_offset)
10165         (window_box_right, window_box_right_offset): Undo previous change,
10166         by removing the "extern"s.
10167         * intervals.c (adjust_intervals_for_insertion)
10168         (adjust_intervals_for_deletion): Undo previous change,
10169         making these static again.
10170         (offset_intervals, temp_set_point_both, temp_set_point)
10171         (copy_intervals_to_string): No longer inline.
10172         * xdisp.c (window_text_bottom_y, window_box_width)
10173         (window_box_height, window_box_left_offset)
10174         (window_box_right_offset, window_box_left, window_box_right)
10175         (window_box): No longer inline.
10177 2011-11-08  Chong Yidong  <cyd@gnu.org>
10179         * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
10180         (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10181         Signal an error if not a live window.
10182         (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10183         (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10185 2011-11-07  Juanma Barranquero  <lekktu@gmail.com>
10187         * lisp.h (syms_of_abbrev): Remove declaration.
10188         Reported by CHENG Gao <chenggao@royau.me>.
10190 2011-11-07  Eli Zaretskii  <eliz@gnu.org>
10192         * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10193         if Vpurify_flag is non-nil.  Fixes a crash when running w32 build
10194         of temacs in GUI mode.
10196 2011-11-07  Martin Rudalics  <rudalics@gmx.at>
10198         * window.h: Declare delete_all_child_windows instead of
10199         delete_all_subwindows.
10200         * window.c (Fwindow_nest, Fset_window_nest)
10201         (Fset_window_new_total, Fset_window_new_normal)
10202         (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10203         (delete_all_subwindows): Rename to delete_all_child_windows.
10204         (Fdelete_other_windows_internal, Fset_window_configuration):
10205         Call delete_all_child_windows instead of delete_all_subwindows.
10206         * frame.c (delete_frame): Call delete_all_child_windows instead
10207         of delete_all_subwindows.
10209 2011-11-07  Paul Eggert  <eggert@cs.ucla.edu>
10211         * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10212         This is also needed for porting to any host where GC_MARK_STACK is
10213         not GC_MAKE_GCPROS_NOOPS.
10214         (which_symbols): Use it.
10216 2011-11-07  Kenichi Handa  <handa@m17n.org>
10218         * coding.c (coding_set_destination): Check coding->src_pos only
10219         when coding->src_object is a buffer (bug#9910).
10221         * process.c (send_process): Set the member src_multibyte of coding
10222         to 0 (bug#9911) when sending a unibyte text.
10224         * callproc.c (Fcall_process): Set the member src_multibyte of
10225         process_coding to 0 (bug#9912).
10227 2011-11-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
10229         * xmenu.c (cleanup_widget_value_tree): New function.
10230         (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10231         calling free_menubar_widget_value_tree directly (Bug#9830).
10233 2011-11-06  Paul Eggert  <eggert@cs.ucla.edu>
10235         Fix some portability problems with 'inline'.
10236         * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10237         (window_box_width, window_box_left, window_box_left_offset)
10238         (window_box_right, window_box_right_offset): Declare extern.
10239         Otherwise, these inline functions do not conform to C99 and
10240         are miscompiled by Microsoft compilers.  Reported by Eli Zaretskii in
10241         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10242         * intervals.c (adjust_intervals_for_insertion)
10243         (adjust_intervals_for_deletion): Now extern, because otherwise the
10244         extern inline functions 'offset_intervals' couldn't refer to it.
10245         (static_offset_intervals): Remove.
10246         (offset_intervals): Rewrite using the old contents of
10247         static_offset_intervals.  The old version didn't conform to C99
10248         because an extern inline function contained a reference to an
10249         identifier with static linkage.
10251 2011-11-06  Andreas Schwab  <schwab@linux-m68k.org>
10253         * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10254         GC.
10256 2011-11-06  Eli Zaretskii  <eliz@gnu.org>
10258         * xdisp.c (init_iterator, reseat_to_string): Don't set the
10259         iterator's bidi_p flag if Vpurify_flag is non-nil.  (Bug#9963)
10260         (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10261         return Qleft_to_right.
10263 2011-11-06  Chong Yidong  <cyd@gnu.org>
10265         * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10266         (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10267         (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10268         (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10269         (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10270         (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10271         (Fwindow_vscroll): Doc fix.
10272         (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10273         argument, since it makes no sense to pass a live window and for
10274         consistency with window-child.
10276 2011-11-05  Christoph Scholtes  <cschol2112@googlemail.com>
10278         * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10279         support MSVC.
10281 2011-11-05  Jason Rumney  <jasonr@gnu.org>
10283         * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10284         (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10285         fonts (Bug#6029).
10286         (add_font_entity_to_list): Fix logic errors in mixed boolean and
10287         bitwise arithmetic preventing use of unicode-sip and non-truetype
10288         opentype fonts.
10290 2011-11-05  Eli Zaretskii  <eliz@gnu.org>
10292         * s/ms-w32.h (fstat, stat, utime): Move redirections to
10293         "emacs"-only part.
10295         * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10296         initialization code to keep similarity to xfns.c after changes
10297         from 2011-11-05.
10299 2011-11-05  Jan Djärv  <jan.h.d@swipnet.se>
10301         * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10302         (unwind_create_frame): New function (Bug#9943).
10303         (Fx_create_frame): Restructure code to be more similar to the one in
10304         xfns.c.  Call record_unwind_protect with unwind_create_frame (Bug#9943).
10305         Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10306         Move terminal->reference_count++ just before making the frame official
10307         (Bug#9943).
10309         * nsterm.m (x_free_frame_resources): New function.
10310         (x_destroy_window): Move code to x_free_frame_resources.
10312         * xfns.c (unwind_create_frame): Fix comment.
10313         (Fx_create_frame, x_create_tip_frame):
10314         Move terminal->reference_count++ just before making the frame
10315         official.  Move initialization of image_cache_refcount and
10316         dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10318 2011-11-05  Eli Zaretskii  <eliz@gnu.org>
10320         Support MSVC build with newer versions of Visual Studio.
10321         * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10322         Nmake barfs on that.  Use $(OBJ*_c) variables instead, defined on
10323         nt/gmake.defs.
10325         * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10326         which are not supported by MSVC.
10327         (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10328         (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10329         bitfields.
10330         (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10331         types in bitfields.
10332         (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10334         * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10336 2011-11-05  Fabrice Popineau  <fabrice.popineau@supelec.fr>  (tiny change)
10338         Support MSVC build with newer versions of Visual Studio.
10339         * w32.c: Don't include w32api.h for MSVC.
10340         (init_environment) [_MSC_VER]: Call sys_access, not _access.
10342         * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10343         [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10344         (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10345         (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10346         e_* cousins.
10347         (alloca) [_MSC_VER]: Define to _alloca.
10349         * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10351         * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10353 2011-11-04  Eli Zaretskii  <eliz@gnu.org>
10355         * xdisp.c (note_mouse_highlight): If either of
10356         previous/next-single-property-change returns nil, treat that as
10357         the beginning or the end of the buffer.  (Bug#9955)
10359 2011-11-04  Jan Djärv  <jan.h.d@swipnet.se>
10361         * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
10362         label is not null (Bug#9951).
10363         (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10364         may be NULL.
10366 2011-11-04  Eli Zaretskii  <eliz@gnu.org>
10368         * window.c (Fwindow_body_size): Mention in the doc string that the
10369         return value is in frame's canonical units.  (Bug#9949)
10371 2011-11-03  Eli Zaretskii  <eliz@gnu.org>
10373         * xdisp.c (note_mouse_highlight): Initialize `area'.  (Bug#9947)
10375         * w32fns.c (unwind_create_frame): If needed, free the glyph
10376         matrices of the partially constructed frame.  (Bug#9943)
10377         * xfns.c (unwind_create_frame): Likewise.
10379 2011-11-01  Eli Zaretskii  <eliz@gnu.org>
10381         * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10382         Don't stop backward scan on the continuation glyph, even though
10383         its CHARPOS is positive.
10384         (mouse_face_from_buffer_pos, note_mouse_highlight):
10385         Rename cover_string to disp_string.
10387 2011-11-01  Martin Rudalics  <rudalics@gmx.at>
10389         * window.c (temp_output_buffer_show): Don't use
10390         Vtemp_buffer_show_specifiers.
10391         (Vtemp_buffer_show_specifiers): Remove unused variable.
10393 2011-10-30  Eli Zaretskii  <eliz@gnu.org>
10395         * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10396         past the beginning of the current glyph matrix.
10398 2011-10-30  Adam Sjøgren  <asjo@koldfront.dk>  (tiny change)
10400         * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10401         (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10402         HAVE_GTK3 (Bug#9869).
10404         * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10405         type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10407         * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10409         * xterm.c: Declare x_handle_net_wm_state to return int.
10410         (handle_one_xevent): Check if we are iconified but don't have
10411         _NET_WM_STATE_HIDDEN.  If do, treat as deiconify (Bug#9893).
10412         (get_current_wm_state): Return non-zero if not hidden,
10413         check for _NET_WM_STATE_HIDDEN (Bug#9893).
10414         (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10415         (x_handle_net_wm_state): Return what get_current_wm_state returns.
10416         (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10418 2011-10-29  Paul Eggert  <eggert@cs.ucla.edu>
10420         * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10421         so that this new function doesn't get optimized away by a
10422         whole-program optimizer.  Make the 2nd arg EMACS_INT, not int.
10424 2011-10-29  Andreas Schwab  <schwab@linux-m68k.org>
10426         * frame.h (MOUSE_HL_INFO): Remove excess parens.
10428 2011-10-29  Eli Zaretskii  <eliz@gnu.org>
10430         Fix the `xbytecode' command.
10431         * .gdbinit (xprintbytestr): New command.
10432         (xwhichsymbols): Rename from `which'; all callers changed.
10433         (xbytecode): Print the byte-code string as well.
10435 2011-10-29  Kim Storm  <storm@cua.dk>
10437         * alloc.c (which_symbols): New function.
10439 2011-10-29  Andreas Schwab  <schwab@linux-m68k.org>
10441         * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10442         line.  (Bug#9903)
10444 2011-10-29  Glenn Morris  <rgm@gnu.org>
10446         * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10447         Not clear what it was for, and it causes various bugs.  (Bug#9839)
10449 2011-10-28  Eli Zaretskii  <eliz@gnu.org>
10451         * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10452         possible random value that matches one of those tested as
10453         condition to clear the mouse face.
10455 2011-10-28  Chong Yidong  <cyd@gnu.org>
10457         * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10459 2011-10-28  Dan Nicolaescu  <dann@ics.uci.edu>
10461         * window.c (make_window): Initialize phys_cursor_on_p.
10463 2011-10-28  Stefan Monnier  <monnier@iro.umontreal.ca>
10465         * lisp.h (struct Lisp_Symbol): Update comments.
10467 2011-10-28  Juanma Barranquero  <lekktu@gmail.com>
10469         * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10471 2011-10-28  Eli Zaretskii  <eliz@gnu.org>
10473         Fix Emacs on Windows 9X (bug#8562).  Thanks to oslsachem
10474         <oslsachem@gmail.com> for helping to debug this.
10476         * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10477         (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10478         (g_b_init_get_glyph_outline_w): New static variables.
10479         (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10480         (GetGlyphOutlineW_Proc): New typedefs.
10481         (w32_load_unicows_or_gdi32, get_outline_metrics_w)
10482         (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10483         New functions.
10484         (w32font_open_internal, compute_metrics):
10485         Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
10486         instead of calling the "wide" APIs directly.
10488         * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10490         * w32.h (syms_of_w32font): Add prototype.
10492 2011-10-27  Juanma Barranquero  <lekktu@gmail.com>
10494         * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10495         (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10496         (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10497         (Fmove_to_window_line): Doc fix.
10499 2011-10-27  Chong Yidong  <cyd@gnu.org>
10501         * process.c (make_process): Set gnutls_state to NULL.
10503         * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10504         non-NULL, regardless of GNUTLS_INITSTAGE.
10505         (Fgnutls_boot): Cleanups.  Call emacs_gnutls_deinit if we signal
10506         an error.  Set process slots as soon as we allocate them.
10508         * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10510 2011-10-27  Chong Yidong  <cyd@gnu.org>
10512         * gnutls.c (emacs_gnutls_deinit): New function.
10513         Deallocate credentials structures as well as calling gnutls_deinit.
10514         (Fgnutls_deinit, Fgnutls_boot): Use it.
10516         * process.c (make_process): Initialize GnuTLS credentials to NULL.
10517         (deactivate_process): Call emacs_gnutls_deinit.
10519 2011-10-27  Juanma Barranquero  <lekktu@gmail.com>
10521         * image.c (x_create_x_image_and_pixmap):
10522         * w32.c (sys_rename, w32_delayed_load):
10523         * w32font.c (fill_in_logfont):
10524         * w32reg.c (x_get_string_resource): Silence compiler warnings.
10526 2011-10-26  Juanma Barranquero  <lekktu@gmail.com>
10528         * w32fns.c (w32_default_color_map): New function,
10529         extracted from Fw32_default_color_map.
10530         (Fw32_default_color_map, Fx_open_connection): Use it.  (Bug#9785)
10532 2011-10-25  Paul Eggert  <eggert@cs.ucla.edu>
10534         * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10536 2011-10-25  Stefan Monnier  <monnier@iro.umontreal.ca>
10538         * keyboard.c (test_undefined): New function (bug#9751).
10539         (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10541 2011-10-25  Enami Tsugutomo  <tsugutomo.enami@jp.sony.com>
10543         * sysdep.c (init_sys_modes): Fix the check for the controlling
10544         terminal (Bug#6649).
10546 2011-10-20  Eli Zaretskii  <eliz@gnu.org>
10548         * dispextern.h (struct bidi_it): New member next_en_type.
10550         * bidi.c (bidi_line_init): Initialize the next_en_type member.
10551         (bidi_resolve_explicit_1): When next_en_pos is valid for the
10552         current character, check also for next_en_type being WEAK_EN.
10553         (bidi_resolve_weak): Don't enter the expensive loop if the current
10554         position is before next_en_pos.  Record the bidi type of the first
10555         non-ET, non-BN character we find, in addition to its position.
10556         (bidi_level_of_next_char): Invalidate next_en_type when
10557         next_en_pos is over-stepped.
10559 2011-10-20  Paul Eggert  <eggert@cs.ucla.edu>
10561         Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10562         * editfns.c: Rewrite current-time-zone so that it invokes
10563         the equivalent of (format-time-string "%Z") to get the time zone name.
10564         This fixes a bug when the time zone name contains characters that
10565         need converting from the system time locale to Emacs internal format.
10566         This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10567         that patch fixed format-time-string to do the conversion, but
10568         I forgot to fix current-time-zone.
10569         (format_time_string): New function, containing most of
10570         what Fformat_time_string used to contain.
10571         (Fformat_time_string): Rewrite in terms of format_time_string.
10572         This doesn't change this function's behavior.
10573         (current-time-zone): Rewrite to use format_time_string.
10574         This fixes the bug reported by Michael Schierl in
10575         <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10576         Jason Rumney's 2007-06-07 change worked around this bug, but
10577         didn't fix it.
10578         * systime.h (tzname, timezone): Remove no-longer-used declarations.
10580 2011-10-19  Eli Zaretskii  <eliz@gnu.org>
10582         * xdisp.c (start_display): If the character at POS is displayed
10583         via a display vector, reset IT->current.dpvec_index to zero.
10584         (try_window_reusing_current_matrix): If a line ends in a display
10585         vector or the next line starts in a display vector, continue
10586         redrawing the window even though the character position of
10587         start_row was reached.
10588         (Bug#9771, part 2)
10590 2011-10-18  Chong Yidong  <cyd@gnu.org>
10592         * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10593         with nobreak-char-display too.
10595 2011-10-18  Eli Zaretskii  <eliz@gnu.org>
10597         Fix part 3 of bug#9771.
10598         * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10599         (bidi_resolve_neutral): Don't enter the expensive loop looking for
10600         non-neutral characters if the current character is a paragraph
10601         separator (a.k.a. Newline).  This avoids running the same
10602         expensive loop twice, once when we consume the preceding newline
10603         and the other time when the line actually needs to be displayed.
10604         Avoid the loop when we see neutrals on the base embedding level
10605         following a character whose directionality is the same as the
10606         paragraph's.  This avoids running the expensive loop when a line
10607         ends in a long sequence of neutrals, like control characters.
10608         Add assertion against STRONG_AL type.  Slightly rearrange code
10609         that determines the type of a neutral given the first non-neutral
10610         that follows it.
10611         (bidi_level_of_next_char): Set next_en_pos to zero when
10612         invalidating its info.
10614 2011-10-17  Eli Zaretskii  <eliz@gnu.org>
10616         * xdisp.c (push_display_prop): Determine whether to record string
10617         or buffer position by IT->string, not by IT->method.  Allow
10618         GET_FROM_DISPLAY_VECTOR as IT->method on entry.  (Bug#9771, part 4)
10619         (move_it_vertically_backward): Don't look for character position
10620         immediately after the newline when in a continuation line.
10621         (Bug#9771, part 1)
10623 2011-10-15  Martin Rudalics  <rudalics@gmx.at>
10625         * window.c (coordinates_in_window): Rewrite and delabelize
10626         vertical border check.  (Bug#5357) (Bug#9618)
10628 2011-10-14  Stefan Monnier  <monnier@iro.umontreal.ca>
10630         * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10631         errors in XSetWindowBorder (bug#9310).
10633 2011-10-13  Dmitry Antipov  <dmantipov@yandex.ru>
10635         * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10636         avoid crash when xmalloc overrun checking is enabled.
10638 2011-10-13  Eli Zaretskii  <eliz@gnu.org>
10640         * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10641         itb.paragraph_dir to NEUTRAL_DIR.  Fixes an occasional incorrect
10642         cursor motion with <left> and <right> arrow keys.
10644         * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10645         some callers set that themselves.
10647 2011-10-12  Eli Zaretskii  <eliz@gnu.org>
10649         * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10650         display string and the previous row comes from the same string and
10651         is empty.  (Bug#9739)  (Bug#9738)
10653 2011-10-12  Stefan Monnier  <monnier@iro.umontreal.ca>
10655         * doc.c (get_doc_string): Encode file name (bug#9735).
10657 2011-10-12  Eli Zaretskii  <eliz@gnu.org>
10659         * bidi.c (bidi_level_of_next_char):
10660         * xdisp.c (get_visually_first_element): Remove old incorrect
10661         comments regarding the Unicode Line Separator character.
10663         * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10665 2011-10-12  Dmitry Antipov  <dmantipov@yandex.ru>
10667         * alloc.c (Fgc_status): Do not access beyond zombies array
10668         boundary if nzombies > MAX_ZOMBIES.
10669         * alloc.c (dump_zombies): Add missing format specifier.
10671 2011-10-12  Paul Eggert  <eggert@cs.ucla.edu>
10673         * xdisp.c (set_cursor_from_row): Simplify conditionals,
10674         to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10676         * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10677         Some packages use them to denote characters with modifiers.
10679 2011-10-11  Andreas Schwab  <schwab@linux-m68k.org>
10681         * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10682         (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10683         matching a pp-number.  Rename parameter var to var1.
10685 2011-10-11  Stefan Monnier  <monnier@iro.umontreal.ca>
10687         * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10689 2011-10-08  Glenn Morris  <rgm@gnu.org>
10691         * callint.c (Fcall_interactively): Give a more explicit error for the
10692         'c' case with a non-character input.  (Bug#8479)
10694 2011-10-08  Eli Zaretskii  <eliz@gnu.org>
10696         * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10697         lines.
10698         (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10699         lines that are hscrolled on the left.
10701         * dispnew.c (buffer_posn_from_coords): Account for a possible
10702         presence of header-line.  (Bug#4426)
10704 2011-10-07  Stefan Monnier  <monnier@iro.umontreal.ca>
10706         * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10707         Don't advertise functionality which we discourage or doesn't work.
10709 2011-10-07  Paul Eggert  <eggert@cs.ucla.edu>
10711         * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10712         or sizeof.  __alignof__ gives the wrong answer on Fedora x86-64
10713         with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10714         this makes Emacs dump core during garbage collection on rare
10715         occasions.  sizeof is obviously inferior to offsetof here, so
10716         stick with offsetof.
10717         (GC_POINTER_ALIGNMENT): New macro.
10718         (mark_memory): Omit 3rd (offset) arg; caller changed.
10719         Don't assume EMACS_INT alignment is the same as pointer alignment.
10721 2011-10-03  Stefan Monnier  <monnier@iro.umontreal.ca>
10723         * keyboard.c (read_key_sequence_remapped): New var.
10724         (read_key_sequence): Compute remapping in the right buffer.
10725         (command_loop_1): Use read_key_sequence's remapping directly.
10727 2011-10-02  Stefan Monnier  <monnier@iro.umontreal.ca>
10729         * dired.c (file_name_completion): Don't expand file name.
10730         (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10731         before checking file name handler.
10733         * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10734         they've been requested explicitly (bug#9591).
10736 2011-10-01  Andreas Schwab  <schwab@linux-m68k.org>
10738         * keymap.c (Fsingle_key_description): Use make_specified_string
10739         instead of build_string to build string from push_key_description.
10740         (Bug#5193)
10742 2011-09-30  Paul Eggert  <eggert@cs.ucla.edu>
10744         * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10745         This fixes a Y2038 bug on 64-bit hosts.
10746         * buffer.c (reset_buffer):
10747         * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10748         (Fclear_buffer_auto_save_failure):
10749         Use 0, not -1, to represent an unset failure time, since time_t
10750         might not be signed.
10752         Remove dependency on glibc malloc internals.
10753         * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10754         Move back here from lisp.h, but with their new implementations.
10755         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10756         (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10757         * charset.c (charset_table_init): New static var.
10758         (syms_of_charset): Use it instead of xmalloc.  This removes a
10759         dependency on glibc malloc internals.  See Eli Zaretskii's comment in
10760         <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10761         * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10762         Move back to alloc.c.
10763         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10764         (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10766 2011-09-30  Jan Djärv  <jan.h.d@swipnet.se>
10768         * nsterm.m (windowDidResize): Call x_set_window_size only when
10769         ns_in_resize is true.  Otherwise set pixelwidth/height and
10770         call change_frame_size (Bug#9628).
10772 2011-09-30  Paul Eggert  <eggert@cs.ucla.edu>
10774         Port --enable-checking=all to Fedora 14 x86-64.
10775         * charset.c (syms_of_charset): Also account for glibc malloc's
10776         internal overhead when calculating the initial malloc maximum.
10778         Port --enable-checking=all to Fedora 14 x86.
10779         * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10780         Move to lisp.h.
10781         (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10782         (overrun_check_realloc, overrun_check_free):
10783         Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10784         That way, xmalloc returns a properly-aligned pointer even if
10785         XMALLOC_OVERRUN_CHECK is defined.  The old debugging code happened
10786         to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10787         * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10788         into account when calculating the initial malloc maximum.
10789         * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10790         Move here from alloc.c, so that charset.c can use it too.
10791         Properly align; the old code wasn't right for common 32-bit hosts
10792         when configured with --enable-checking=all.
10793         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10794         (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10796 2011-09-29  Eli Zaretskii  <eliz@gnu.org>
10798         * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
10799         use EDOM.
10801 2011-09-28  Eli Zaretskii  <eliz@gnu.org>
10803         * xdisp.c (compute_display_string_end): If there's no display
10804         string at CHARPOS, return -1.
10806         * bidi.c (bidi_fetch_char): When compute_display_string_end
10807         returns a negative value, treat the character as a normal
10808         character not covered by a display string.  (Bug#9624)
10810 2011-09-28  Juanma Barranquero  <lekktu@gmail.com>
10812         * lread.c (Fread_from_string): Fix typo in docstring.
10814 2011-09-27  Eli Zaretskii  <eliz@gnu.org>
10816         * xdisp.c (handle_invisible_prop): If invisible text ends on a
10817         newline, reseat the iterator instead of bidi-iterating there one
10818         character at a time.  (Bug#9610)
10819         (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10820         TO_CHARPOS if the bidi iterator is at base embedding level.
10822 2011-09-27  Andreas Schwab  <schwab@linux-m68k.org>
10824         * lread.c (readevalloop): Use correct code for NBSP.
10825         (read1): Likewise.  (Bug#9608)
10827 2011-09-25  Michael Albinus  <michael.albinus@gmx.de>
10829         * dbusbind.c (Fdbus_register_signal): When service is not
10830         registered, use nil in Vdbus_registered_objects_table.  (Bug#9581)
10832 2011-09-25  Glenn Morris  <rgm@gnu.org>
10834         * buffer.c (truncate-lines): Doc fix.
10836 2011-09-24  Chong Yidong  <cyd@stupidchicken.com>
10838         * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10839         (Fset_window_next_buffers): Doc fix.
10841 2011-09-24  Glenn Morris  <rgm@gnu.org>
10843         * minibuf.c (read_minibuf): Disable line truncation.  (Bug#5715)
10845 2011-09-24  Paul Eggert  <eggert@cs.ucla.edu>
10847         Fix minor problems found by static checking.
10848         * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
10849         * indent.c (Fvertical_motion): Fix == vs = typo.
10851 2011-09-24  Eli Zaretskii  <eliz@gnu.org>
10853         * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10854         Default value is now t.  Doc fix.
10856         * indent.c (Fvertical_motion): Compute and apply the overshoot
10857         logic when moving up, not only when moving down.  Fix the
10858         confusing name and values of the it_overshoot_expected variable;
10859         logic changes accordingly.  (Bug#9254) (Bug#9549)
10861         * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10862         CHARPOS is covered by a display string which includes newlines.
10863         (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10864         is covered by a display string with embedded newlines.
10866 2011-09-24  Michael Albinus  <michael.albinus@gmx.de>
10868         * dbusbind.c (Fdbus_register_signal): Add match rule to
10869         Vdbus_registered_objects_table.  (Bug#9581)
10870         (Fdbus_register_method, Vdbus_registered_objects_table):
10871         Fix docstring.
10873 2011-09-24  Jim Meyering  <meyering@redhat.com>
10875         do not ignore write error for any output size
10876         The previous change was incomplete.
10877         While it makes emacs --batch detect the vast majority of stdout
10878         write failures, errors were still ignored whenever the output size is
10879         k * (BUFSIZ+1) - 4.  E.g., on a system with BUFSIZ of 4096,
10880           $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10881               && echo FAIL: ignored write error
10882           FAIL: ignored write error
10883           $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10884               && echo FAIL: ignored write error
10885           FAIL: ignored write error
10886         * emacs.c (Fkill_emacs): Also test ferror.  (Bug#9574)
10888 2011-09-23  Andreas Schwab  <schwab@linux-m68k.org>
10890         * emacs.c (Fkill_emacs): In noninteractive mode exit
10891         non-successfully if a write error occurred on stdout.  (Bug#9574)
10893 2011-09-21  Eli Zaretskii  <eliz@gnu.org>
10895         * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10896         the xassert test.
10898         * dispextern.h (struct it): Update the comment documenting what
10899         can it->OBJECT be.
10901 2011-09-20  Eli Zaretskii  <eliz@gnu.org>
10903         * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10904         a display string, extend search for cursor position to end of row.
10905         (find_row_edges): If the row ends in a newline from a display
10906         string, increment its MATRIX_ROW_END_CHARPOS by one.  (Bug#9549)
10907         Handle the case of a display string with multiple newlines.
10908         (Fcurrent_bidi_paragraph_direction): Fix search for previous
10909         non-empty line.  Fixes confusing cursor motion with arrow keys at
10910         the beginning of a line that starts with whitespace.
10912 2011-09-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10914         * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10915         (bug#9493).
10917 2011-09-18  Chong Yidong  <cyd@stupidchicken.com>
10919         * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10920         boolean (Bug#9154).
10922 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
10924         * xdisp.c (display_line): Record maximum and minimum buffer
10925         positions even if no glyphs were produced (e.g., by a zero-width
10926         stretch).  Fixes bug#9530 on a TTY.  Under word-wrap, don't record
10927         buffer positions that will be removed from the glyph row because
10928         they don't fit.
10929         (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10930         column is beyond frame width: don't subtract 1 "pixel" when
10931         computing width of the stretch.
10932         (reseat_at_next_visible_line_start): Undo the change made on
10933         2011-09-17 that saved paragraph information and restored it after
10934         the call to `reseat'.  (Bug#9545)
10936 2011-09-18  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
10938         * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10939         and turn window cursor on if cleared (Bug#9415).
10941 2011-09-18  Andreas Schwab  <schwab@linux-m68k.org>
10943         * search.c (boyer_moore): Take unibyte characters from pattern
10944         literally.  (Bug#9458)
10946 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
10948         * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10950 2011-09-18  Paul Eggert  <eggert@cs.ucla.edu>
10952         Fix minor problem found by static checking.
10953         * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10954         initialized, to pacify gcc -Wuninitialized.
10956         * fileio.c: Report proper errno when syscall falls.
10957         (Finsert_file_contents): Save and restore errno,
10958         so that report_file_error outputs the correct diagnostic.
10959         (Fwrite_region) [CLASH_DETECTION]: Likewise.
10961 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
10963         * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10965 2011-09-17  Eli Zaretskii  <eliz@gnu.org>
10967         * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10968         2011-08-30T17:32:44Z!eliz@gnu.org.  (Bug#9530)
10970 2011-09-17  Eli Zaretskii  <eliz@gnu.org>
10972         * xdisp.c (reseat_at_next_visible_line_start): Keep information
10973         about the current paragraph and restore it after the call to reseat.
10975         * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10976         (bidi_find_paragraph_start): Search back for paragraph beginning
10977         at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10978         (bidi_move_to_visually_next): Only trigger paragraph-related
10979         computations when the last character is a newline or at EOB, not
10980         just any NEUTRAL_B.  (Bug#9470)
10982         * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10983         truncated lines if point is covered by a display string.  (Bug#9524)
10985 2011-09-16  Paul Eggert  <eggert@cs.ucla.edu>
10987         * xselect.c: Relax test for outgoing X longs (Bug#9498).
10988         (cons_to_x_long): New function.
10989         (lisp_data_to_selection_data): Use it.  Correct the test for
10990         short-versus-long data; it was negated.  Break out of vector
10991         loop, for efficiency, when a long datum is discovered.
10993 2011-09-16  Stefan Monnier  <monnier@iro.umontreal.ca>
10995         * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10997 2011-09-16  Eli Zaretskii  <eliz@gnu.org>
10999         * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
11000         GCC PR/17406) by declaring this function with external scope.
11002 2011-09-15  Paul Eggert  <eggert@cs.ucla.edu>
11004         * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
11005         Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
11007 2011-09-15  Andreas Schwab  <schwab@linux-m68k.org>
11009         * editfns.c (Fformat): Correctly handle text properties on "%%".
11011 2011-09-15  Eli Zaretskii  <eliz@gnu.org>
11013         * xterm.c (x_draw_composite_glyph_string_foreground):
11014         * w32term.c (x_draw_composite_glyph_string_foreground):
11015         * term.c (encode_terminal_code):
11016         * composite.c (composition_update_it, get_composition_id):
11017         * xdisp.c (get_next_display_element)
11018         (fill_composite_glyph_string): Add comments about special meaning
11019         of TAB characters in a composition.
11021 2011-09-15  Paul Eggert  <eggert@cs.ucla.edu>
11023         * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
11024         This occurs when processing a multibyte format.
11025         Problem reported by Wolfgang Jenker.
11027 2011-09-15  Johan Bockgård  <bojohan@gnu.org>
11029         * xdisp.c (try_cursor_movement): Only check for exact match if
11030         cursor hpos found by set_cursor_from_row is valid.  (Bug#9495)
11032 2011-09-14  Paul Eggert  <eggert@cs.ucla.edu>
11034         Remove unused external symbols.
11035         * dispextern.h (calc_pixel_width_or_height): Remove decl.
11036         * xdisp.c (calc_pixel_width_or_height): Now static.
11037         * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
11038         * indent.c (check_display_width):
11039         * w32term.c: Fix comment to match code.
11040         * xterm.c, xterm.h (x_catching_errors): Remove.
11042 2011-09-14  Paul Eggert  <eggert@cs.ucla.edu>
11044         * xselect.c: Use signed conversions more consistently (Bug#9498).
11045         (selection_data_to_lisp_data): Assume incoming selection data are
11046         signed integers, not unsigned.  This is to be consistent with
11047         outgoing selection data, which was modified to use signed integers
11048         in as part of the fix to Bug#9196 in response to Jan D.'s comment
11049         in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
11050         expects long, not unsigned long.
11052 2011-09-14  Eli Zaretskii  <eliz@gnu.org>
11054         * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
11055         computation of loop end.  Reported by Johan Bockgård
11056         <bojohan@gnu.org>.
11058 2011-09-13  Chong Yidong  <cyd@stupidchicken.com>
11060         * frame.c (Fother_visible_frames_p): Function deleted.
11062 2011-09-12  Eli Zaretskii  <eliz@gnu.org>
11064         * indent.c (compute_motion): Process display vector front to back
11065         rather than the other way around.  (Bug#2496)
11067 2011-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
11069         * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
11071 2011-09-11  Chong Yidong  <cyd@stupidchicken.com>
11073         * minibuf.c (Fread_from_minibuffer): Doc fix.
11075 2011-09-11  Eli Zaretskii  <eliz@gnu.org>
11077         * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
11078         2011-08-30T17:32:44Z!eliz@gnu.org.  (Bug#9475)
11080 2011-09-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
11082         * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
11083         value for non-existent files.
11085 2011-09-11  Eli Zaretskii  <eliz@gnu.org>
11087         * fileio.c (Finsert_file_contents): If the file cannot be opened,
11088         set its "size" to -1.  This will set the modtime_size field of
11089         the corresponding buffer to -1, which is what
11090         verify-visited-file-modtime expects for files that do not exist.
11091         (Bug#9139)
11093 2011-09-11  Paul Eggert  <eggert@cs.ucla.edu>
11095         * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
11096         here ...
11097         * lisp.h: ... from here.  push_key_description is no longer
11098         defined in keyboard.c, so its declaration should not be in
11099         lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
11100         logically belongs with push_key_description.
11102 2011-09-10  Paul Eggert  <eggert@cs.ucla.edu>
11104         * buffer.h: Include <sys/types.h> instead of <time.h>.
11105         Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
11106         Problem reported by Herbert J. Skuhra.
11108 2011-09-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
11110         * xml.c (parse_region): Make the parsing work for
11111         non-comment-starting XML files again (bug#9144).
11113 2011-09-10  Andreas Schwab  <schwab@linux-m68k.org>
11115         * image.c (gif_load): Fix calculation of bottom and right corner.
11116         (Bug#9468)
11118 2011-09-10  Eli Zaretskii  <eliz@gnu.org>
11120         * xdisp.c (MAX_DISP_SCAN): Decrease to 250.  Prevents sluggish
11121         redisplay in small windows.
11123 2011-09-09  Eli Zaretskii  <eliz@gnu.org>
11125         * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11127 2011-09-08  Martin Rudalics  <rudalics@gmx.at>
11129         * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11130         Operate on live windows only.
11132 2011-09-08  Juanma Barranquero  <lekktu@gmail.com>
11134         * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
11136 2011-09-07  Eli Zaretskii  <eliz@gnu.org>
11138         * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
11139         only under bidi iteration.
11141 2011-09-07  Jan Djärv  <jan.h.d@swipnet.se>
11143         * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11145 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
11147         isnan: Fix porting problem to Solaris 10 with bundled gcc.
11148         Without this fix, the command to link temacs failed due to an
11149         undefined symbol __builtin_isnan.  This is because
11150         /usr/include/iso/math_c99.h #defines isnan(x) to
11151         __builtin_isnan(x), but the bundled gcc, which identifies itself
11152         as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11153         a __builtin_isnan.
11154         * floatfns.c (isnan): #undef, and then #define to a clone of
11155         what's in data.c.
11156         (Fisnan): Always define, since it's always available now.
11157         (syms_of_floatfns): Always define isnan at the Lisp level.
11159 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
11161         * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11163 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
11165         * fileio.c: Fix bugs with large file offsets (Bug#9428).
11166         The previous code assumed that file offsets (off_t values) fit in
11167         EMACS_INT variables, which is not true on typical 32-bit hosts.
11168         The code messed up by falsely reporting buffer overflow in cases
11169         such as (insert-file-contents "big" nil 1 2) into an empty buffer
11170         when "big" contains more than 2**29 bytes, even though this
11171         inserts just one byte and does not overflow the buffer.
11172         (Finsert_file_contents): Store file offsets as off_t
11173         values, not as EMACS_INT values.  Check for overflow when
11174         converting between EMACS_INT and off_t.  When checking for
11175         buffer overflow or for overlap, take the offsets into account.
11176         Don't use EMACS_INT for small values where int suffices.
11177         When checking for overlap, fix a typo: ZV was used where
11178         ZV_BYTE was intended.
11179         (Fwrite_region): Don't assume off_t fits into 'long'.
11180         * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11182 2011-09-05  Michael Albinus  <michael.albinus@gmx.de>
11184         * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11186 2011-09-04  Paul Eggert  <eggert@cs.ucla.edu>
11188         sprintf-related integer and memory overflow issues (Bug#9412).
11190         * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
11191         (esprintf, exprintf, evxprintf): New functions.
11192         * keyboard.c (command_loop_level): Now EMACS_INT, not int.
11193         (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
11194         (modify_event_symbol): Do not assume that the length of
11195         name_alist_or_stem is safe to alloca and fits in int.
11196         (Fexecute_extended_command): Likewise for function name and binding.
11197         (Frecursion_depth): Wrap around reliably on integer overflow.
11198         * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11199         since some callers pass EMACS_INT values.
11200         (Fsingle_key_description): Don't crash if symbol name contains more
11201         than MAX_ALLOCA bytes.
11202         * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11203         (get_minibuffer): Arg is now EMACS_INT, not int.
11204         * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
11205         (esprintf, exprintf, evxprintf): New decls.
11206         * window.h (command_loop_level, minibuf_level): Reflect API changes.
11208         * dbusbind.c (signature_cat): New function.
11209         (xd_signature, Fdbus_register_signal):
11210         Do not overrun buffer; instead, report string overflow.
11212         * dispnew.c (add_window_display_history): Don't overrun buffer.
11213         Truncate instead; this is OK since it's just a log.
11215         * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11216         even if the time zone offset is outlandishly large.
11217         Don't mishandle offset == INT_MIN.
11219         * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11220         when creating daemon; the previous buffer-overflow check was incorrect.
11222         * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11223         which has the guts of the old verror function.
11225         * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11226         use SAFE_ALLOCA instead.  Use esprintf to avoid int-overflow issues.
11228         * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11229         (font_unparse_xlfd): Don't blindly alloca long strings.
11230         Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
11231         fits in int, when using sprintf.  Use single snprintf to count
11232         length of string rather than counting it via multiple sprintfs;
11233         that's simpler and more reliable.
11234         (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11235         (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11236         sprintf, in case result does not fit in int.
11238         * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11239         (fontset_from_font): Print it.
11241         * frame.c (tty_frame_count): Now printmax_t, not int.
11242         (make_terminal_frame, set_term_frame_name): Print it.
11243         (x_report_frame_params): In X, window IDs are unsigned long,
11244         not signed long, so print them as unsigned.
11245         (validate_x_resource_name): Check for implausibly long names,
11246         and don't assume name length fits in 'int'.
11247         (x_get_resource_string): Don't blindly alloca invocation name;
11248         use SAFE_ALLOCA.  Use esprintf, not sprintf, in case result does
11249         not fit in int.
11251         * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11252         (xg_check_special_colors, xg_set_geometry):
11253         Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11255         * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11256         Use esprintf, not sprintf, in case result does not fit in int.
11258         * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11259         (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11260         it as a large positive number.
11261         (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11262         * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11264         * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11265         in case result does not fit in int.
11267         * print.c (float_to_string): Detect width overflow more reliably.
11268         (print_object): Make sprintf buffer a bit bigger, to avoid potential
11269         buffer overrun.  Don't assume list length fits in 'int'.  Treat
11270         print length of 0 as 0, not as infinity; to be consistent with other
11271         uses of print length in this function.  Don't overflow print length
11272         index.  Don't assume hash table size fits in 'long', or that
11273         vectorlike size fits in 'unsigned long'.
11275         * process.c (make_process): Use printmax_t, not int, to format
11276         process-name gensyms.
11278         * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11280         * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11281         to avoid potential buffer overrun.
11283         * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11284         if X resource line is longer than 512 bytes.
11286         * xfns.c (x_window): Make sprintf buffer a bit bigger
11287         to avoid potential buffer overrun.
11289         * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11291         * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11293 2011-09-04  Paul Eggert  <eggert@cs.ucla.edu>
11295         Integer overflow fixes for scrolling, etc.
11296         Without these, Emacs silently mishandles large integers sometimes.
11297         For example, "C-u 4294967297 M-x recenter" was treated as if
11298         it were "C-u 1 M-x recenter" on a typical 64-bit host.
11300         * xdisp.c (try_window_id): Check Emacs fixnum range before
11301         converting to 'int'.
11303         * window.c (window_scroll_line_based, Frecenter):
11304         Check that an Emacs fixnum is in range before assigning it to 'int'.
11305         (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11306         values converted from Emacs fixnums.
11307         (Frecenter): Don't wrap around a line count if it is out of 'int'
11308         range; instead, treat it as an extreme value.
11309         (Fset_window_configuration, compare_window_configurations):
11310         Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11312         * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11313         that can exceed INT_MAX.  Check that EMACS_INT value is in range
11314         before assigning it to the (possibly-narrower) index.
11315         (match_limit): Don't assume that a fixnum can fit in 'int'.
11317         * print.c (print_object): Use ptrdiff_t, not int, for index that can
11318         exceed INT_MAX.
11320         * indent.c (position_indentation): Now takes ptrdiff_t, not int.
11321         (Fvertical_motion): Don't wrap around LINES values that don't fit
11322         in 'int'.  Instead, treat them as extreme values.  This is good
11323         enough for windows, which can't have more than INT_MAX lines anyway.
11325 2011-09-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
11327         * Require libxml/parser.h to avoid compilation warning.
11329         * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11331         * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11332         since this reportedly can destroy thread storage.
11334 2011-08-30  Chong Yidong  <cyd@stupidchicken.com>
11336         * syntax.c (find_defun_start): Update all cache variables if
11337         exiting early (Bug#9401).
11339 2011-08-30  Eli Zaretskii  <eliz@gnu.org>
11341         * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11343         * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11344         when HAVE_WINDOW_SYSTEM is not defined.  Support both GUI and TTY
11345         frames.  Call tty_append_glyph in the TTY case.  (Bug#9402)
11347         * term.c (tty_append_glyph): New function.
11348         (produce_stretch_glyph): Static function and its prototype deleted.
11350         * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11351         Add prototypes.
11353 2011-08-29  Paul Eggert  <eggert@cs.ucla.edu>
11355         * image.c (parse_image_spec): Check for nonnegative, not for positive,
11356         when checking :margin (Bug#9390).
11357         (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
11358         Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
11359         so that the name doesn't mislead.  All uses changed.
11361 2011-08-28  Johan Bockgård  <bojohan@gnu.org>
11363         * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11364         set_tty_hooks.
11366 2011-08-27  Eli Zaretskii  <eliz@gnu.org>
11368         * xdisp.c (move_it_to): Don't bail out early when reaching
11369         position beyond to_charpos, if we are scanning backwards.
11370         (move_it_vertically_backward): When DY == 0, make sure we get to
11371         the first character in the line after the newline.
11373 2011-08-27  Paul Eggert  <eggert@cs.ucla.edu>
11375         * ccl.c: Improve and simplify overflow checking (Bug#9196).
11376         (ccl_driver): Do not generate an out-of-range pointer.
11377         (Fccl_execute_on_string): Remove unnecessary check for
11378         integer overflow, noted by Stefan Monnier in
11379         <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11380         Remove a FIXME that didn't need fixing.
11381         Simplify the newly-introduced buffer reallocation code.
11383 2011-08-27  Juanma Barranquero  <lekktu@gmail.com>
11385         * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11387 2011-08-26  Paul Eggert  <eggert@cs.ucla.edu>
11389         Integer and memory overflow issues (Bug#9196).
11391         * doc.c (get_doc_string): Rework so that
11392         get_doc_string_buffer_size is the actual buffer size, rather than
11393         being 1 less than the actual buffer size; this makes xpalloc more
11394         convenient.
11396         * image.c (x_allocate_bitmap_record, cache_image):
11397         * xselect.c (Fx_register_dnd_atom):
11398         Simplify previous changes by using xpalloc.
11400         * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11401         since either will do and ptrdiff_t is convenient with xpalloc.
11403         * charset.c (charset_table_size)
11404         (struct charset_sort_data.priority): Now ptrdiff_t.
11405         (charset_compare): Don't overflow if priorities differ greatly.
11406         (Fsort_charsets): Don't assume list length fits in int.
11407         Check for size-calculation overflow when allocating sort data.
11408         (syms_of_charset): Allocate an initial charset table that is
11409         just under 64 KiB, to avoid problems with glibc malloc and mmap.
11411         * cmds.c (internal_self_insert): Check for size-calculation overflow.
11413         * composite.h (struct composition.glyph_len): Now int, not unsigned.
11414         The actual value is always <= INT_MAX, and leaving it unsigned made
11415         overflow checking harder.
11417         * dispextern.h (struct glyph_matrix.rows_allocated)
11418         (struct face_cache.size): Now ptrdiff_t, for convenience in use
11419         with xpalloc.  The values are still always <= INT_MAX.
11421         * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11423         * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11424         (SAFE_NALLOCA): New macro.
11426         * region-cache.c (struct boundary.pos, find_cache_boundary)
11427         (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11428         (set_cache_region, invalidate_region_cache)
11429         (revalidate_region_cache, know_region_cache, region_cache_forward)
11430         (region_cache_backward, pp_cache):
11431         Use ptrdiff_t, not EMACS_INT, since either will do.  This is needed
11432         so that ptrdiff_t * can be passed to xpalloc.
11433         (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11434         beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11435         (pp_cache): Don't assume cache_len fits in int.
11436         * region-cache.h: Adjust extern decls to match.
11438         * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11439         EMACS_INT, since either will do, for xpalloc.
11441         * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11442         (xnmalloc, xnrealloc, xpalloc): New functions.
11444         * bidi.c (bidi_shelve_header_size): New constant.
11445         (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11446         (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11448         * bidi.c (bidi_cache_shrink):
11449         * buffer.c (overlays_at, overlays_in, record_overlay_string)
11450         (overlay_strings):
11451         Don't update size of array until after memory allocation succeeds,
11452         because xmalloc/xrealloc may not return.
11453         (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11454         now that we have proper integer overflow checking.
11455         (record_overlay_string, overlay_strings): Catch overflows when
11456         calculating size of overlay_str_buf.
11458         * callproc.c (Fcall_process): Check for size overflow when
11459         calculating size of args2.
11460         (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11461         Normally we prefer signed values, but sticking with ptrdiff_t would
11462         require adding more-complicated checks.
11464         * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11465         Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11466         Redo buffer-overflow calculations to avoid integer overflow.
11467         Add a FIXME comment where memory seems to be over-allocated.
11469         * character.c (Fstring): Check for size-calculation overflow.
11471         * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11472         unnecessary integer overflow.  Check for size overflow.
11473         (encode_coding_object): Don't update size until xmalloc succeeds.
11475         * composite.c (get_composition_id): Check for overflow in glyph
11476         length calculations.
11478         Integer and memory overflow fixes for display code.
11479         * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11480         * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11481         (scrolling_window): Check for overflow in size calculations.
11482         (line_draw_cost, realloc_glyph_pool, add_row_entry):
11483         Don't assume glyph table len fits in int.
11484         (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11485         (row_table_size): Now ptrdiff_t, not int.
11486         (scrolling_window): Avoid overflow in size calculations.
11487         Don't update size until allocation succeeds.
11488         * fns.c (concat): Check for overflow in size calculations.
11489         (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11490         * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11491         (NEXT_ALMOST_PRIME_LIMIT): New constant.
11493         * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11494         (get_doc_string): Check for size calculation overflow.
11495         Don't update size until allocation succeeds.
11496         (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11497         EMACS_INT, where ptrdiff_t will do.
11498         (Fsubstitute_command_keys): Check for string overflow.
11500         * editfns.c (set_time_zone_rule): Don't assume environment length
11501         fits in int.
11502         (message_length): Now ptrdiff_t, not int.
11503         (Fmessage_box): Don't update size until allocation succeeds.
11504         Don't assume message length fits in int.
11505         (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11507         * emacs.c (main): Do not reallocate argv, since there is a null at
11508         the end that can be overwritten, and this way there's no need to
11509         worry about size-calculation overflow.
11510         (sort_args): Check for size-calculation overflow.
11512         * eval.c (init_eval_once, grow_specpdl): Don't update size until
11513         alloc succeeds.
11514         (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11516         * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11517         (x_set_scroll_bar_width, x_figure_window_size):
11518         Check for integer overflow.
11519         (x_set_alpha): Do not assume XINT fits in int.
11521         * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11522         This is for the members text_lines, text_cols, total_lines, total_cols,
11523         where the system imposes an 'int' limit.
11525         * fringe.c (Fdefine_fringe_bitmap):
11526         Don't update size until alloc works.
11528         * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11529         (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11531         * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11532         Check for size-calculation overflow.
11533         (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11534         do, as we prefer signed integers.
11535         (id_to_widget.max_size, id_to_widget.used)
11536         (xg_store_widget_in_map, xg_remove_widget_from_map)
11537         (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11538         (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11539         Use and return ptrdiff_t, not int.
11540         (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11541         * gtkutil.h: Change prototypes to match the above.
11543         * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11544         are duplicate now that they've been promoted to lisp.h.
11545         (x_allocate_bitmap_record, x_alloc_image_color)
11546         (make_image_cache, cache_image, xpm_load):
11547         Don't update size until alloc is done.
11548         (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11549         (x_detect_edges):
11550         Check for size calculation overflow.
11551         (ct_colors_allocated_max): New constant.
11552         (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11553         overflow.
11555         * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11556         (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11557         (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11558         Use ptrdiff_t, not int, to count maps.
11559         (read_char_minibuf_menu_prompt): Check for overflow in size
11560         calculations.  Don't update size until allocation succeeds.
11561         Redo calculations to avoid overflow.
11562         * keyboard.h: Change prototypes to match the above.
11564         * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11565         to count maps.
11566         (current_minor_maps): Check for size calculation overflow.
11567         * keymap.h: Change prototypes to match the above.
11569         * lread.c (read1, init_obarray): Don't update size until alloc done.
11571         * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11572         (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11574         * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11575         Now ptrdiff_t, not int.
11576         * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11577         (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11579         * process.c (Fnetwork_interface_list): Check for overflow
11580         in size calculation.
11582         * region-cache.c (move_cache_gap): Check for size calculation overflow.
11584         * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11585         overflow.  Don't bother calling xmalloc when xrealloc will do.
11587         * search.c (Freplace_match): Check for size calculation overflow.
11588         (Fset_match_data): Don't assume list lengths fit in 'int'.
11590         * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11591         for command line length.  Do not attempt to address one before the
11592         beginning of an array, as that's not portable.
11594         * term.c (max_frame_lines): Remove; unused.
11595         (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11596         not int.
11597         (encode_terminal_code, calculate_costs): Check for size
11598         calculation overflow.
11599         (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11600         table lengths and related sizes.  Don't update size until alloc
11601         done.  Redo calculations to avoid overflow.
11602         (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11604         * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11605         subtracting pointers.
11606         (gobble_line): Check for overflow more carefully.  Don't update size
11607         until alloc done.
11609         * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11610         Don't update size until alloc done.
11611         Redo size calculations to avoid overflow.
11612         Check for size calculation overflow.
11613         (main) [DEBUG]: Fix typo in invoking tparam1.
11615         * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11616         Use ptrdiff_t, not int, for sizes.
11617         (store_mode_line_noprop_char): Don't update size until alloc done.
11619         * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11620         Use ptrdiff_t, not int, for sizes.
11621         (Finternal_make_lisp_face, cache_face):
11622         Check for size calculation overflow.
11623         (cache_face): Treat size calculation overflows as if they were
11624         memory exhaustion (the usual treatment), rather than aborting.
11626         * xfns.c (x_encode_text, x_set_name_internal)
11627         (Fx_change_window_property): Use ptrdiff_t, not int, to count
11628         sizes, since they can exceed INT_MAX in size.  Check for size
11629         calculation overflow.
11631         * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11632         (xg_select): Check for size calculation overflow.
11633         Don't update size until alloc done.
11635         * xrdb.c (get_environ_db): Don't assume path length fits in int,
11636         as sprintf is limited to int lengths.
11638         * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11639         (X_LONG_MIN): New macros.
11640         Use them to make the following changes clearer.
11641         (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11642         This change doesn't affect the value now, but it may help remind
11643         future maintainers not to raise the value too much later.
11644         (SELECTION_QUANTUM): Remove, replacing with ...
11645         (selection_quantum): ... new function, which avoids overflow.
11646         All uses changed.
11647         (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11648         assumption that selection length fits in 'int'.
11649         (x_reply_selection_request, x_handle_selection_request)
11650         (x_get_window_property, receive_incremental_selection)
11651         (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11652         (lisp_data_to_selection_data, clean_local_selection_data):
11653         Use ptrdiff_t, not int, to record length of selection.
11654         (x_reply_selection_request, x_get_window_property)
11655         (receive_incremental_selection, x_property_data_to_lisp):
11656         Redo calculations to avoid overflow.
11657         (x_reply_selection_request): When sending hint, ceiling it at
11658         X_LONG_MAX rather than relying on wraparound overflow to send
11659         something.
11660         (x_get_window_property, receive_incremental_selection)
11661         (lisp_data_to_selection_data, x_property_data_to_lisp):
11662         Check for size-calculation overflow.
11663         (x_get_window_property, receive_incremental_selection)
11664         (lisp_data_to_selection_data, Fx_register_dnd_atom):
11665         Don't store size until memory allocation succeeds.
11666         (x_get_window_property): Plug memory leak on memory exhaustion.
11667         Don't double-block input; malloc is safe here.  Don't assume 2**34
11668         - 4 fits in unsigned long.  Add an xassert to check
11669         XGetWindowProperty overflow.  Be more careful about overflow
11670         calculations, and distinguish size from memory overflow better.
11671         (receive_incremental_selection): When tracing, don't assume
11672         unsigned int is less than INT_MAX.
11673         (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11674         harmful) conversions of unsigned short to int.
11675         (lisp_data_to_selection_data): Don't assume that integers
11676         in the range -65535 through -1 fit in an X unsigned short.
11677         Don't assume that ULONG_MAX == X_ULONG_MAX.  Don't store into
11678         result parameters unless successful.  Rely on cons_to_unsigned
11679         to report problems with elements; the old code wasn't right anyway.
11680         (x_check_property_data): Check for int overflow; we cannot use
11681         a wider type due to X limits.
11682         (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11684         * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
11686         * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11687         (x_term_init): Check for size calculation overflow.
11688         (x_color_cells): Don't store size until memory allocation succeeds.
11689         (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
11690         Don't assume alloca size is less than MAX_ALLOCA.
11691         (x_term_init): Don't assume length fits in int (sprintf is limited
11692         to int size).
11694         Use ptrdiff_t for composition IDs.
11695         * character.c (lisp_string_width):
11696         * composite.c (composition_table_size, n_compositions)
11697         (get_composition_id, composition_gstring_from_id):
11698         * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11699         * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11700         * window.c (Frecenter):
11701         Use ptrdiff_t, not int, for composition IDs.
11702         * composite.c (get_composition_id): Check for integer overflow.
11703         * composite.h: Adjust prototypes to match the above changes.
11705         Use ptrdiff_t for hash table indexes.
11706         * category.c (hash_get_category_set):
11707         * ccl.c (ccl_driver):
11708         * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11709         * coding.c (coding_system_charset_list, detect_coding_system):
11710         * coding.h (struct coding_system.id):
11711         * composite.c (get_composition_id, gstring_lookup_cache):
11712         * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11713         * image.c (xpm_get_color_table_h):
11714         * lisp.h (hash_lookup, hash_put):
11715         * minibuf.c (Ftest_completion):
11716         Use ptrdiff_t for hash table indexes, not int (which is too
11717         narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11718         32-bit --with-wide-int hosts).
11720         * charset.c (Fdefine_charset_internal): Check for integer overflow.
11721         Add a FIXME comment about memory leaks.
11722         (syms_of_charset): Don't assume xmalloc returns.
11724         Don't assume that stated character widths fit in int.
11725         * character.c (Fchar_width, c_string_width, lisp_string_width):
11726         * character.h (CHAR_WIDTH):
11727         * indent.c (MULTIBYTE_BYTES_WIDTH):
11728         Use sanitize_char_width to avoid undefined and/or bad behavior
11729         with outlandish widths.
11730         * character.h (sanitize_tab_width): Rename from sanitize_width,
11731         now that we have two such functions.  All uses changed.
11732         (sanitize_char_width): New inline function.
11734         Don't assume that tab-width fits in int.
11735         * character.h (sanitize_width): New inline function.
11736         (SANE_TAB_WIDTH): New macro.
11737         (ASCII_CHAR_WIDTH): Use it.
11738         * indent.c (sane_tab_width): Remove.  All uses replaced by
11739         SANE_TAB_WIDTH (current_buffer).
11740         * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11742         * fileio.c: Integer overflow issues with file modes.
11743         (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11745         * charset.c (read_hex): New arg OVERFLOW.  All uses changed.
11746         Remove unreachable code.
11747         (read_hex, load_charset_map_from_file): Check for integer overflow.
11749         * xterm.c: Don't go over XClientMessageEvent limit.
11750         (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11751         (x_send_scroll_bar_event): Likewise.  Check that the size does not
11752         exceed limits imposed by XClientMessageEvent, as well as the usual
11753         ptrdiff_t and size_t limits.
11755         * keyboard.c: Overflow, signedness and related fixes.
11756         (make_lispy_movement): Use same integer type in forward decl
11757         that is used in the definition.
11758         (read_key_sequence, keyremap_step):
11759         Change bufsize argument back to int, undoing my 2011-03-30 change.
11760         We prefer signed types, and int is wide enough here.
11761         (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11762         than TYPE_MAXIMUM (EMACS_INT) / 2.  Don't let the label size grow
11763         larger than STRING_BYTES_BOUND.  Use ptrdiff_t for Emacs string
11764         length, not size_t.  Use ptrdiff_t for index, not int.
11765         (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11766         possibility of integer overflow.
11768         Overflow, signedness and related fixes for images.
11770         * dispextern.h (struct it.stack[0].u.image.image_id)
11771         (struct_it.image_id, struct image.id, struct image_cache.size)
11772         (struct image_cache.used, struct image_cache.ref_count):
11773         * gtkutil.c (update_frame_tool_bar):
11774         * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11775         (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11776         (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11777         * nsmenu.m (update_frame_tool_bar):
11778         * xdisp.c (calc_pixel_width_or_height):
11779         * xfns.c (image_cache_refcount):
11780         Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11781         on typical 64-bit hosts.
11783         * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11784         (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11785         Omit unnecessary casts to int.
11786         (parse_image_spec): Check that integers fall into 'int' range
11787         when the callers expect that.
11788         (image_ascent): Redo ascent calculation to avoid int overflow.
11789         (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11790         (lookup_image): Remove unnecessary tests.
11791         (xbm_image_p): Locals are now of int, not EMACS_INT,
11792         since parse_image_check makes sure they fit into int.
11793         (png_load, gif_load, svg_load_image):
11794         Prefer int to unsigned where either will do.
11795         (tiff_handler): New function, combining the cores of the
11796         old tiff_error_handler and tiff_warning_handler.
11797         This function is rewritten to use vsnprintf and thereby avoid
11798         stack buffer overflows.  It uses only the features of vsnprintf
11799         that are common to both POSIX and native Microsoft.
11800         (tiff_error_handler, tiff_warning_handler): Use it.
11801         (tiff_load, gif_load, imagemagick_load_image):
11802         Don't assume :index value fits in 'int'.
11803         (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11804         (imagemagick_load_image): Check that crop parameters fit into
11805         the integer types that MagickCropImage accepts.  Don't assume
11806         Vimagemagick_render_type has a nonnegative value.  Don't assume
11807         size_t fits in 'long'.
11808         (gs_load): Use printmax_t to print the widest integers possible.
11809         Check for integer overflow when computing image height and width.
11811 2011-08-26  Eli Zaretskii  <eliz@gnu.org>
11813         * xdisp.c (redisplay_window): Don't force window start if point
11814         will be invisible in the resulting window.  (Bug#9324)
11816 2011-08-25  Eli Zaretskii  <eliz@gnu.org>
11818         * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11819         the display spec is of the form `(space ...)'.
11820         (handle_display_spec): Return the value returned by
11821         handle_single_display_spec, not just 1 or zero.
11822         (handle_single_display_spec): If the display spec is of the form
11823         `(space ...)', and specifies display in the text area, return 2
11824         rather than 1.
11825         (try_cursor_movement): Check for the need to scroll more
11826         accurately, and prefer exact match for point under bidi.
11827         Don't advance `row' beyond the last row of the window.
11829         * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11830         into disp_prop; all users changed.
11832         * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11833         DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11834         for the text covered by the display property.
11836 2011-08-25  Chong Yidong  <cyd@stupidchicken.com>
11838         * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11839         Change return value to nil.
11840         (Frecord_buffer): Delete unused function.
11842 2011-08-24  Eli Zaretskii  <eliz@gnu.org>
11844         * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11845         buffers, return left-to-right.
11846         (set_cursor_from_row): Consider candidate row a win if its glyph
11847         represents a newline and point is on that newline.  Fixes cursor
11848         positioning on the newline at EOL of R2L text within L2R
11849         paragraph, and vice versa.
11850         (try_cursor_movement): Check continued rows, in addition to
11851         continuation rows.  Fixes unwarranted scroll when point enters a
11852         continued line of R2L text within an L2R paragraph, or vice versa.
11853         (cursor_row_p): Consider the case of point being equal to
11854         MATRIX_ROW_END_CHARPOS.  Prevents cursor being stuck when moving
11855         from the end of a short line to the beginning of a continued line
11856         of R2L text within L2R paragraph.
11857         (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11858         composed characters.
11860         * bidi.c (bidi_check_type): Use xassert.
11861         (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11862         members.
11864 2011-08-23  Eli Zaretskii  <eliz@gnu.org>
11866         * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11867         a character.
11869 2011-08-23  Chong Yidong  <cyd@stupidchicken.com>
11871         * nsfont.m (ns_otf_to_script): Fix typo.
11873 2011-08-22  Kenichi Handa  <handa@m17n.org>
11875         * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11876         extra slot even if the purpose is char-code-property-table.
11878 2011-08-23  Eli Zaretskii  <eliz@gnu.org>
11880         * xdisp.c (redisplay_window): When computing centering_position,
11881         account for the height of the header line.  (Bug#8874)
11883         * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11884         instead of CHAR_TO_BYTE.  Fixes a crash when a completion
11885         candidate is selected by the mouse, and that candidate has a
11886         composed character under the mouse.
11888         * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1.  Fixes pixel
11889         coordinates reported by pos-visible-in-window-p for a composed
11890         character in column zero.
11892 2011-08-23  Stefan Monnier  <monnier@iro.umontreal.ca>
11894         * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11896 2011-08-22  Eli Zaretskii  <eliz@gnu.org>
11898         * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11899         consider it a hit if to_charpos is anywhere in the range of the
11900         composed buffer positions.
11902 2011-08-22  Chong Yidong  <cyd@stupidchicken.com>
11904         * image.c (gif_load): Don't assume that each subimage has the same
11905         dimensions as the base image.  Handle disposal method that is
11906         "undefined" by the gif spec (Bug#9335).
11908 2011-08-20  Chong Yidong  <cyd@stupidchicken.com>
11910         * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
11911         (Fcondition_case): Document `debug' symbol in error handler.
11913 2011-08-19  Eli Zaretskii  <eliz@gnu.org>
11915         * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11916         face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11917         from an Org mode buffer to a Speedbar frame.
11919         * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11920         a composition, take its buffer position from IT->cmp_it.charpos.
11921         Fixes cursor positioning at the beginning of a line that begins
11922         with a composed character.
11924 2011-08-18  Eli Zaretskii  <eliz@gnu.org>
11926         * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11927         character bidirectional type, use STRONG_L instead.  Fixes crashes
11928         in a buffer produced by `describe-categories'.
11930         * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11931         members before the level stack, so they would be saved and
11932         restored when copying iterator state.  Fixes incorrect reordering
11933         around TABs covered by display properties.
11935 2011-08-18  Andreas Schwab  <schwab@linux-m68k.org>
11937         * process.c (Fnetwork_interface_list): Correctly determine buffer size.
11939 2011-08-17  Chong Yidong  <cyd@stupidchicken.com>
11941         * eval.c (internal_condition_case, internal_condition_case_1)
11942         (internal_condition_case_2, internal_condition_case_n):
11943         Remove unnecessary aborts (Bug#9081).
11945 2011-08-17  Eli Zaretskii  <eliz@gnu.org>
11947         * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11948         has no `load' handler, try opening the file locally.  (Bug#9311)
11950 2011-08-16  Ken Brown  <kbrown@cornell.edu>
11952         * gmalloc.c: Expand comment.
11954 2011-08-16  Eli Zaretskii  <eliz@gnu.org>
11956         * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11957         if it fails the cursor_row_p test.  Fixes cursor positioning at ZV.
11959 2011-08-16  Ken Brown  <kbrown@cornell.edu>
11961         Fix memory allocation problems in Cygwin build (Bug#9273).
11963         * unexcw.c ( __malloc_initialized): Declare external variable.
11964         (fixup_executable): Force the dumped emacs to reinitialize malloc.
11966         * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11967         New variables.
11968         (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11969         dumped emacs.
11970         (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11971         in the static heap.
11972         [CYGWIN] (special_realloc): New function.
11973         (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11974         requests to realloc storage in the static heap.
11976 2011-08-15  Paul Eggert  <eggert@cs.ucla.edu>
11978         * bidi.c (bidi_initialize): Remove unused local.
11980 2011-08-15  Eli Zaretskii  <eliz@gnu.org>
11982         * bidimirror.h:
11983         * biditype.h: Remove file.
11984         * makefile.w32-in ($(BLD)/bidi.$(O)):
11985         * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
11987         * dispextern.h: Fix a typo in the comment to bidi_type_t.
11989         * chartab.c: Improve commentary for the uniprop_table API.
11991         * bidi.c (bidi_paragraph_init): Support zero value of
11992         bidi_ignore_explicit_marks_for_paragraph_level.
11993         (bidi_initialize): Use uniprop_table instead of including
11994         biditype.h and bidimirror.h.
11996         * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11997         coordinates of the iterator when restoring from ppos_it.
11998         (Bug#9296)
12000 2011-08-14  Kenichi Handa  <handa@m17n.org>
12002         * process.c (create_process): Call setup_process_coding_systems
12003         after the pid of the process is set to -1 (Bug#8162).
12005 2011-08-14  Eli Zaretskii  <eliz@gnu.org>
12007         * xdisp.c (move_it_in_display_line_to): Don't invoke
12008         IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
12009         ppos_it.  Fixes vertical cursor motion when line beginning is
12010         covered by an image.  (Bug#9296)
12012 2011-08-14  Jan Djärv  <jan.h.d@swipnet.se>
12014         * nsterm.h (ns_run_ascript): Declare.
12015         (NSAPP_DATA2_RUNASSCRIPT): Define.
12017         * nsfns.m (as_script, as_result, as_status): New static variables.
12018         (ns_run_ascript): New function.
12019         (Fns_do_applescript): Set variables as_*.  Make an NSApplicationDefined
12020         event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
12021         the event loop.  Get status from as_status (Bug#7276).
12023         * nsterm.m (sendEvent): If event is NSApplicationDefined and
12024         data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
12025         the event loop (Bug#7276).
12027 2011-08-14  Andreas Schwab  <schwab@linux-m68k.org>
12029         * gnutls.c (QCgnutls_bootprop_priority)
12030         (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
12031         (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
12032         (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
12033         (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
12034         (QCgnutls_bootprop_verify_hostname_error)
12035         (QCgnutls_bootprop_callbacks_verify): Rename from
12036         Qgnutls_bootprop_..., all uses changed.
12038         * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
12039         uses changed.
12041 2011-08-14  Paul Eggert  <eggert@cs.ucla.edu>
12043         * xfaces.c (Qframe_set_background_mode): Now static.
12044         * dispextern.h (Qframe_set_background_mode): Remove decl.
12046         * process.c (Fnetwork_interface_info): Declare local only if needed.
12048 2011-08-13  Jan Djärv  <jan.h.d@swipnet.se>
12050         * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
12051         (Fnetwork_interface_list): Allocate in increments of bytes instead
12052         of sizeof (struct ifreq).  Iterate over ifconf.ifc_req by counting
12053         bytes (Bug#8477).  Count bytes correctly when ifr_addr is a struct
12054         sockaddr.
12055         (struct ifflag_def): notrailers is smart on OSX.
12056         (Fnetwork_interface_info): Handle case when ifr_flags is negative.
12057         Get hardware address with getifaddrs if available.
12059 2011-08-12  Eli Zaretskii  <eliz@gnu.org>
12061         * xdisp.c (iterate_out_of_display_property): xassert that
12062         IT->position is set to within IT->object's boundaries.  Break from
12063         the loop as soon as EOB is reached; avoids infloops in redisplay
12064         when IT->position is set up wrongly due to some bug.
12065         Set IT->current to match the bidi iterator unconditionally.
12066         (push_display_prop): Allow GET_FROM_STRING as IT->method on
12067         entry.  Force push_it to save on the stack the current
12068         buffer/string position, to be restored by pop_it.  Fix flags in
12069         the iterator structure wrt the object coming from a display
12070         property, as `line-prefix' and `wrap-prefix' are not ``replacing''
12071         properties.  (Bug#9284)
12073 2011-08-09  Andreas Schwab  <schwab@linux-m68k.org>
12075         * fontset.c (fontset_get_font_group): Add proper type checks.
12076         (Bug#9172)
12078 2011-08-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
12080         * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
12081         and LC_VERSION_MIN_MACOSX.
12082         (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
12083         (dump_it) [LC_FUNCTION_STARTS]: Use it.
12085 2011-08-08  Eli Zaretskii  <eliz@gnu.org>
12087         * xdisp.c (forward_to_next_line_start): Allow to use the
12088         no-display-properties-and-no-overlays under bidi display.
12089         Set disp_pos in the bidi iterator to avoid searches for display
12090         properties and overlays.
12092 2011-08-08  Chong Yidong  <cyd@stupidchicken.com>
12094         * editfns.c (Fset_time_zone_rule): Document relationship with the
12095         setenv function.
12097         * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
12098         the font entity extracted from the cache (Bug#8109).
12100 2011-08-07  Chong Yidong  <cyd@stupidchicken.com>
12102         * composite.c (autocmp_chars): Don't reset point.  That is done by
12103         restore_point_unwind (Bug#5984).
12105 2011-08-07  Juri Linkov  <juri@jurta.org>
12107         * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
12108         to show the arg `TIME' instead of `TIMEVAL'.
12110 2011-08-06  Eli Zaretskii  <eliz@gnu.org>
12112         * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12113         display property strides EOL and includes a newline, as in
12114         longlines-mode.  (Bug#9254)
12115         (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12116         word-wrap under bidirectional display.  (Bug#9224)
12118         * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12119         is non-zero, even if the data buffer is NULL.  Fixes a crash in
12120         vertical-motion with longlines-mode.  (Bug#9254)
12122 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
12124         * bidi.c <bidi_cache_total_alloc>: Now static.
12125         (bidi_initialize): Initialize bidi_cache_total_alloc.
12127         * xdisp.c (display_line): Release buffer allocated for shelved bidi
12128         cache.  (Bug#9221)
12130         * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12131         amount allocated this far in `bidi_cache_total_alloc'.
12132         (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
12133         non-zero, only free the data buffer without restoring the cache
12134         contents.  All callers changed.
12136         * dispextern.h (bidi_unshelve_cache): Update prototype.
12138         * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
12139         (move_it_in_display_line, move_it_to)
12140         (move_it_vertically_backward, move_it_by_lines): Replace the call
12141         to xfree to an equivalent call to bidi_unshelve_cache.
12142         (move_it_in_display_line_to): Fix logic of returning
12143         MOVE_POS_MATCH_OR_ZV in the bidi case.  (Bug#9224)
12145 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
12147         * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12148         came from a string character with a `cursor' property.  (Bug#9229)
12150 2011-08-04  Jan Djärv  <jan.h.d@swipnet.se>
12152         * Makefile.in (LIB_PTHREAD): New variable.
12153         (LIBES): Add LIB_PTHREAD (Bug#9216).
12155         * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12156         Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12158 2011-08-04  Andreas Schwab  <schwab@linux-m68k.org>
12160         * regex.c (re_iswctype): Remove some redundant boolean conversions.
12162 2011-08-04  Jan Djärv  <jan.h.d@swipnet.se>
12164         * xterm.c (x_find_topmost_parent): New function.
12165         (x_set_frame_alpha): Find topmost parent window with
12166         x_find_topmost_parent and set the property there also (bug#9181).
12167         (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12169 2011-08-04  Paul Eggert  <eggert@cs.ucla.edu>
12171         * callproc.c (Fcall_process): Avoid vfork clobbering
12172         the local vars buffer, coding_systems, current_dir.
12174 2011-08-03  Stefan Monnier  <monnier@iro.umontreal.ca>
12176         * keymap.c (Fmake_composed_keymap): Move to subr.el.
12178 2011-08-03  Paul Eggert  <eggert@cs.ucla.edu>
12180         * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12181         so that it is not optimized away.
12183         * xdisp.c (compute_display_string_pos): Remove unused local.
12185 2011-08-02  Eli Zaretskii  <eliz@gnu.org>
12187         Fix slow cursor motion and scrolling in large buffers with
12188         selective display, like Org Mode buffers.  (Bug#9218)
12190         * dispextern.h (struct bidi_it): New member disp_prop_p.
12192         * xdisp.c: Remove one-slot cache of display string positions.
12193         (compute_display_string_pos): Accept an additional argument
12194         DISP_PROP_P; callers changed.  Scan at most 5K characters forward
12195         for a display string or property.  If found, set DISP_PROP_P
12196         non-zero.
12198         * bidi.c (bidi_fetch_char): Accept an additional argument
12199         DISP_PROP_P, and pass it to compute_display_string_pos.
12200         Only handle text covered by a display string if DISP_PROP_P is returned
12201         non-zero.  All callers of bidi_fetch_char changed.
12203 2011-08-02  Stefan Monnier  <monnier@iro.umontreal.ca>
12205         * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12207 2010-12-03  Don March  <don@ohspite.net>
12209         * keymap.c (Fdefine_key): Fix non-prefix key error message when
12210         last character M-[char] is translated to ESC [char] (bug#7541).
12212 2011-08-02  Kenichi Handa  <handa@m17n.org>
12214         * lisp.h (uniprop_table): Extern it.
12216         * chartab.c (uniprop_table): Make it non-static.
12218 2011-08-01  Eli Zaretskii  <eliz@gnu.org>
12220         * xdisp.c (forward_to_next_line_start): Accept additional argument
12221         BIDI_IT_PREV, and store into it the state of the bidi iterator had
12222         on the newline.
12223         (reseat_at_next_visible_line_start): Use the bidi iterator state
12224         returned by forward_to_next_line_start to restore the state of
12225         it->bidi_it after backing up to previous newline.  (Bug#9212)
12227 2011-07-30  Andreas Schwab  <schwab@linux-m68k.org>
12229         * regex.c (re_comp): Protoize.
12230         (re_exec): Fix return type.
12231         (regexec): Fix type of `ret'.  (Bug#9203)
12233 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
12235         * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12236         This is needed if max-image-size is a floating-point number.
12238 2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
12240         * print.c (print_object): Print empty symbol as ##.
12242         * lread.c (read1): Read ## as empty symbol.
12244 2011-07-28  Alp Aker  <alp.tekin.aker@gmail.com>
12246         * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12247         setting frame foreground color (Bug#9175).
12248         (x_set_background_color): Likewise.
12250         * nsmenu.m (-setText): Size tooltip dimensions precisely to
12251         contents (Bug#9176).
12252         (EmacsTooltip -init): Remove bezels and add shadows to
12253         tooltip windows.
12255         * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12256         or scroll bar (Bug#8470).
12258         * nsfont.m (nsfont_open): Remove assignment to voffset and
12259         unnecessary vars hshink, expand, hd, full_height, min_height.
12260         (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12262         * nsterm.h (nsfont_info): Remove voffset field.
12264 2011-07-28  Alp Aker  <alp.tekin.aker@gmail.com>
12266         Implement strike-through and overline on NextStep (Bug#8863).
12268         * nsfont.m (nsfont_open): Use underline position provided by font,
12269         instead of hard-coded value of 2.
12270         (nsfont_draw): Call ns_draw_text_decoration instead.
12272         * nsterm.h: Add declaration for ns_draw_text_decoration.
12274         * nsterm.m (ns_draw_text_decoration): New function for drawing
12275         underline, overline, and strike-through.
12276         (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12277         ns_draw_text_decoration.  Change treatment of cursor drawing to
12278         accommodate underlining, etc.
12280 2011-07-28  Eli Zaretskii  <eliz@gnu.org>
12282         * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12283         default.
12285 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
12287         * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12288         Without this fix, if a signal arrives just after memory fills up,
12289         'malloc' might be invoked reentrantly.
12291         * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12292         In other words, assume that every image size is allowed, on non-X
12293         hosts.  This assumption is probably wrong, but it lets Emacs compile.
12295 2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
12297         * regex.c (re_iswctype): Convert return values to boolean.
12299 2011-07-28  Eli Zaretskii  <eliz@fencepost.gnu.org>
12301         * xdisp.c (compute_display_string_pos): Don't use cached display
12302         string position if the buffer had its restriction changed.
12303         (Bug#9184)
12305 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
12307         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12309 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
12311         Integer signedness and overflow and related fixes.  (Bug#9079)
12313         * bidi.c: Integer size and overflow fixes.
12314         (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12315         (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12316         (bidi_cache_find_level_change, bidi_cache_ensure_space)
12317         (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12318         (bidi_find_other_level_edge):
12319         Use ptrdiff_t instead of EMACS_INT where either will do.
12320         This works better on 32-bit hosts configured --with-wide-int.
12321         (bidi_cache_ensure_space): Check for size-calculation overflow.
12322         Use % rather than repeated addition, for better worst-case speed.
12323         Don't set bidi_cache_size until after xrealloc returns, because it
12324         might not return.
12325         (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
12326         (bidi_cache_ensure_space): Also check that the bidi cache size
12327         does not exceed that of the largest Lisp string or buffer.  See Eli
12328         Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
12330         * alloc.c (__malloc_size_t): Remove.
12331         All uses replaced by size_t.  See Andreas Schwab's note
12332         <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12334         * image.c: Improve checking for integer overflow.
12335         (check_image_size): Assume that f is nonnull, since
12336         it is always nonnull in practice.  This is one less thing to
12337         worry about when checking for integer overflow later.
12338         (x_check_image_size): New function, which checks for integer
12339         overflow issues inside X.
12340         (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12341         This removes the need for a memory_full check.
12342         (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12343         (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12344         (xbm_read_bitmap_data): Change locals back to 'int', since
12345         their values must fit in 'int'.
12346         (xpm_load_image, png_load, tiff_load):
12347         Invoke x_create_x_image_and_pixmap earlier,
12348         to avoid much needless work if the image is too large.
12349         (tiff_load): Treat overly large images as if
12350         x_create_x_image_and_pixmap failed, not as malloc failures.
12351         (gs_load): Use x_check_image_size.
12353         * gtkutil.c: Omit integer casts.
12354         (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12355         (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12357         * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12359         * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12360         Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12361         would wrongly return t on a 64-bit host.
12363         * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12364         The plain *_OVERFLOW macros run afoul of GCC bug 49705
12365         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12366         and therefore cause GCC to emit a bogus diagnostic in some cases.
12368         * image.c: Integer signedness and overflow and related fixes.
12369         This is not an exhaustive set of fixes, but it's time to
12370         record what I've got.
12371         (lookup_pixel_color, check_image_size): Remove redundant decls.
12372         (check_image_size): Don't assume that arbitrary EMACS_INT values
12373         fit in 'int', or that arbitrary 'double' values fit in 'int'.
12374         (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12375         (tiff_load, imagemagick_load_image):
12376         Check for overflow in size calculations.
12377         (x_create_x_image_and_pixmap): Remove unnecessary test for
12378         xmalloc returning NULL; that can't happen.
12379         (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12380         (xpm_color_bucket): Use better integer hashing function.
12381         (xpm_cache_color): Don't possibly over-allocate memory.
12382         (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12383         (gif_memory_source):
12384         Use ptrdiff_t, not int or size_t, to record sizes.
12385         (png_load): Don't assume values greater than 2**31 fit in 'int'.
12386         (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12387         either works, as we prefer signed integers.
12388         (tiff_read_from_memory, tiff_write_from_memory):
12389         Return tsize_t, not size_t, since that's what the TIFF API wants.
12390         (tiff_read_from_memory): Don't fail simply because the read would
12391         go past EOF; instead, return a short read.
12392         (tiff_load): Omit no-longer-needed casts.
12393         (Fimagemagick_types): Don't assume size fits into 'int'.
12395         Improve hashing quality when configured --with-wide-int.
12396         * fns.c (hash_string): New function, taken from sxhash_string.
12397         Do not discard information about ASCII character case; this
12398         discarding is no longer needed.
12399         (sxhash-string): Use it.  Change sig to match it.  Caller changed.
12400         * lisp.h: Declare it.
12401         * lread.c (hash_string): Remove, since we now use fns.c's version.
12402         The fns.c version returns a wider integer if --with-wide-int is
12403         specified, so this should help the quality of the hashing a bit.
12405         * emacs.c: Integer overflow minor fix.
12406         (heap_bss_diff): Now uprintmax_t, not unsigned long.  All used changed.
12407         Define only if GNU_LINUX.
12408         (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12410         * dispnew.c: Integer signedness and overflow fixes.
12411         Remove unnecessary forward decls, that were a maintenance hassle.
12412         (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12413         All uses changed.
12414         (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12415         (scrolling_window): Use ptrdiff_t, not int, for byte count.
12416         (prepare_desired_row, line_draw_cost):
12417         Use int, not unsigned, where either works.
12418         (save_current_matrix, restore_current_matrix):
12419         Use ptrdiff_t, not size_t, where either works.
12420         (init_display): Check for overflow more accurately, and without
12421         relying on undefined behavior.
12423         * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12424         Remove, replacing with the new symbols in lisp.h.  All uses changed.
12425         * fileio.c (make_temp_name):
12426         * filelock.c (lock_file_1, lock_file):
12427         * xdisp.c (message_dolog):
12428         Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12429         Use pMd etc. instead.
12430         * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12431         replacing the pWIDE etc. symbols removed from editfns.c.
12433         * keyboard.h (num_input_events): Now uintmax_t.
12434         This is (very slightly) less likely to mess up due to wraparound.
12435         All uses changed.
12437         * buffer.c: Integer signedness fixes.
12438         (alloc_buffer_text, enlarge_buffer_text):
12439         Use ptrdiff_t rather than size_t when either will do, as we prefer
12440         signed integers.
12442         * alloc.c: Integer signedness and overflow fixes.
12443         Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12444         (__malloc_size_t): Default to size_t, not to int.
12445         (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12446         (Fgarbage_collect, mark_object_loop_halt, mark_object):
12447         Prefer ptrdiff_t to size_t when either would do, as we prefer
12448         signed integers.
12449         (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12450         (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12451         Now const.  Initialize with values that are in range even if char
12452         is signed.
12453         (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12454         (xmalloc_put_size, xmalloc_get_size): New functions.  All uses changed.
12455         These functions do the right thing with sizes > 2**32.
12456         (check_depth): Now ptrdiff_t, not int.
12457         (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12458         Adjust to new way of storing sizes.  Check for size overflow bugs
12459         in rest of code.
12460         (STRING_BYTES_MAX): Adjust to new overheads.  The old code was
12461         slightly wrong anyway, as it missed one instance of
12462         XMALLOC_OVERRUN_CHECK_OVERHEAD.
12463         (refill_memory_reserve): Omit needless cast to size_t.
12464         (mark_object_loop_halt): Mark as externally visible.
12466         * xselect.c: Integer signedness and overflow fixes.
12467         (Fx_register_dnd_atom, x_handle_dnd_message):
12468         Use ptrdiff_t, not size_t, since we prefer signed.
12469         (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12470         * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12471         x_dnd_atoms_size and x_dnd_atoms_length.
12473         * doprnt.c: Prefer signed to unsigned when either works.
12474         * eval.c (verror):
12475         * doprnt.c (doprnt):
12476         * lisp.h (doprnt):
12477         * xdisp.c (vmessage):
12478         Use ptrdiff_t, not size_t, when using or implementing doprnt,
12479         since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12480         prefer signed arithmetic to avoid comparison confusion.
12481         * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12482         but is a bit tricky.
12484         Assume freestanding C89 headers, string.h, stdlib.h.
12485         * data.c, doprnt.c, floatfns.c, print.c:
12486         Include float.h unconditionally.
12487         * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12488         limits.h, stddef.h, string.h.  Use memset instead of 'flood'.
12489         * regex.c: Likewise for stddef.h, string.h.
12490         (ISASCII): Remove; can assume it returns 1 now.  All uses removed.
12491         * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12492         * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12493         (STDC_HEADERS): Remove obsolete defines.
12494         * sysdep.c: Include limits.h unconditionally.
12496         Assume support for memcmp, memcpy, memmove, memset.
12497         * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12498         * regex.c (memcmp, memcpy):
12499         Remove; we assume C89 now.
12501         * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12502         (__malloc_safe_bcopy): Remove; no longer needed.
12504         * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
12505         Use EMACS_INT, not EMACS_UINT, for sizes.  The code works equally
12506         well either way, and we prefer signed to unsigned.
12508 2011-07-27  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12510         * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12511         closes the connection while we're reading (bug#9182).
12513 2011-07-25  Jan Djärv  <jan.h.d@swipnet.se>
12515         * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12516         are specified (Bug#9168).
12518 2011-07-25  Paul Eggert  <eggert@cs.ucla.edu>
12520         * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12521         Found by GCC static checking and --with-wide-int on a 32-bit host.
12523 2011-07-25  Eli Zaretskii  <eliz@gnu.org>
12525         * xdisp.c (compute_display_string_pos): Fix logic of caching
12526         previous display string position.  Initialize cached_prev_pos to
12527         -1.  Fixes slow-down at the beginning of a buffer.
12529 2011-07-24  Eli Zaretskii  <eliz@gnu.org>
12531         * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12532         for attrs[LFACE_FONTSET_INDEX].
12534 2011-07-23  Paul Eggert  <eggert@cs.ucla.edu>
12536         * xml.c (parse_region): Remove unused local
12537         that was recently introduced.
12539 2011-07-23  Eli Zaretskii  <eliz@gnu.org>
12541         * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12542         2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12544         * xdisp.c (move_it_in_display_line_to): Record the best matching
12545         position for TO_CHARPOS while scanning the line, and restore it on
12546         exit if none of the characters scanned was an exact match.
12547         Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
12548         when exact match is impossible due to invisible text, and the
12549         lines are truncated.
12551 2011-07-23  Jan Djärv  <jan.h.d@swipnet.se>
12553         * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12554         for OSX >= 10.7.
12556 2011-07-22  Eli Zaretskii  <eliz@gnu.org>
12558         Fix a significant slow-down of cursor motion with C-n, C-p,
12559         C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12560         auto-repeat under bidi redisplay in fontified buffers.
12561         * xdisp.c (compute_stop_pos_backwards): New function.
12562         (next_element_from_buffer): Call compute_stop_pos_backwards to
12563         find a suitable prev_stop when we find ourselves before
12564         base_level_stop.
12565         (reseat): Don't look for prev_stop, as that could mean a very long
12566         run.
12567         <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12568         <cached_disp_overlay_modiff>: Cache for last found display string
12569         position.
12570         (compute_display_string_pos): Return the cached position if asked
12571         about the same buffer in the same area of character positions, and
12572         the buffer wasn't changed since the time the display string
12573         position was cached.
12575 2011-07-22  Eli Zaretskii  <eliz@gnu.org>
12577         * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12578         is an integer, which is important for empty lines.  (Bug#9149)
12580 2011-07-22  Chong Yidong  <cyd@stupidchicken.com>
12582         * frame.c (Fmodify_frame_parameters): In tty case, update the
12583         default face if necessary (Bug#4238).
12585 2011-07-21  Chong Yidong  <cyd@stupidchicken.com>
12587         * editfns.c (Fstring_to_char): No need to explain what a character
12588         is in the docstring (Bug#6576).
12590 2011-07-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12592         * xml.c (parse_region): Make sure we always return a tree.
12594 2011-07-20  HAMANO Kiyoto  <khiker.mail@gmail.com>
12596         * xml.c (parse_region): If a document contains only comments,
12597         return that, too.
12599 2011-07-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12601         * xml.c (make_dom): Return comments, too.
12603 2011-07-19  Paul Eggert  <eggert@cs.ucla.edu>
12605         Port to OpenBSD.
12606         See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12607         and the surrounding thread.
12608         * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12609         rather than fgets, and retry after EINTR.  Otherwise, 'emacs
12610         --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12611         timer goes off.
12612         * s/openbsd.h (BROKEN_SIGIO): Define.
12613         * unexelf.c (unexec) [__OpenBSD__]:
12614         Don't update the .mdebug section of the Alpha COFF symbol table.
12616 2011-07-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12618         * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12619         (bug#8460).
12621 2011-07-18  Paul Eggert  <eggert@cs.ucla.edu>
12623         * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12624         This fixes some race conditions on the permissions of any newly
12625         created file.
12627         * alloc.c (valid_pointer_p): Use pipe, not open.
12628         This fixes some permissions issues when debugging.
12630         * fileio.c (Fcopy_file): Adjust mode if fchown fails.  (Bug#9002)
12631         If fchown fails to set both uid and gid, try to set just gid,
12632         as that is sometimes allowed.  Adjust the file's mode to eliminate
12633         setuid or setgid bits that are inappropriate if fchown fails.
12635 2011-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
12637         * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12638         to compare Lisp_Objects.
12639         * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12640         global_gnutls_log_level, don't mistake it for a Lisp_Object.
12641         (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12643 2011-07-17  Andreas Schwab  <schwab@linux-m68k.org>
12645         * lread.c (read_integer): Unread even EOF character.
12646         (read1): Likewise.  Properly record start position of symbol.
12648         * lread.c (read1): Read `#:' as empty uninterned symbol if no
12649         symbol character follows.
12651 2011-07-17  Paul Eggert  <eggert@cs.ucla.edu>
12653         * fileio.c (Fcopy_file): Pacify gcc re fchown.  (Bug#9002)
12654         This works around a problem with the previous change to Fcopy_file.
12655         Recent glibc declares fchown with __attribute__((warn_unused_result)),
12656         and without this change, GCC might complain about discarding
12657         fchown's return value.
12659 2011-07-16  Juanma Barranquero  <lekktu@gmail.com>
12661         * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12663 2011-07-16  Paul Eggert  <eggert@cs.ucla.edu>
12665         * fileio.c (Fcopy_file): Don't diagnose fchown failures.  (Bug#9002)
12667 2011-07-16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12669         * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12670         it's used from the C level.
12672         * process.c: Use the same condition for POLL_FOR_INPUT in both
12673         keyboard.c and process.c (bug#1858).
12675 2011-07-09  Lawrence Mitchell  <wence@gmx.li>
12677         * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12678         (Fgnutls_boot): Use it.
12680 2011-07-15  Andreas Schwab  <schwab@linux-m68k.org>
12682         * doc.c (Fsubstitute_command_keys): Revert last change.
12684 2011-07-15  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12686         * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12687         quotes the next character, and doesn't affect other longer
12688         sequences (bug#8935).
12690         * lread.c (syms_of_lread): Clarify that is isn't only
12691         `eval-buffer' and `eval-defun' that's affected by
12692         `lexical-binding' (bug#8460).
12694 2011-07-15  Eli Zaretskii  <eliz@gnu.org>
12696         * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
12697         bidi redisplay when a line includes both an image and is truncated.
12699 2011-07-14  Paul Eggert  <eggert@cs.ucla.edu>
12701         Fix minor problems found by static checking.
12702         * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12703         (elsz): Now a signed constant, not a size_t var.  We prefer signed
12704         types to unsigned, to avoid integer comparison confusion.  Without
12705         this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12706         "cannot optimize loop, the loop counter may overflow", a symptom
12707         of the confusion.
12708         * indent.c (Fvertical_motion): Mark locals as initialized.
12709         * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12711 2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12713         * search.c (Fre_search_backward): Mention `case-fold-search' in
12714         all the re_search_* functions (bug#8138).
12716         * keyboard.c (Fopen_dribble_file): Document when the file is
12717         closed (bug#8056).
12719 2011-07-14  Eli Zaretskii  <eliz@gnu.org>
12721         * bidi.c (bidi_dump_cached_states): Fix format of displaying
12722         bidi_cache_idx.
12724         Support bidi reordering of display and overlay strings.
12725         * xdisp.c (compute_display_string_pos)
12726         (compute_display_string_end): Accept additional argument STRING.
12727         (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12728         (reseat_to_string): Initialize bidi_it->string.s and
12729         bidi_it->string.schars.
12730         (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
12731         NULL (avoids a crash in bidi_paragraph_init).
12732         Initialize itb.string.lstring.
12733         (init_iterator): Call bidi_init_it only of a valid
12734         buffer position was specified.  Initialize paragraph_embedding to
12735         L2R.
12736         (reseat_to_string): Initialize the bidi iterator.
12737         (display_string): If we need to ignore text properties of
12738         LISP_STRING, set IT->stop_charpos to IT->end_charpos.  (The
12739         original value of -1 will not work with bidi.)
12740         (compute_display_string_pos): First arg is now struct
12741         `text_pos *'; all callers changed.  Support display properties on
12742         Lisp strings.
12743         (compute_display_string_end): Support display properties on Lisp
12744         strings.
12745         (init_iterator, reseat_1, reseat_to_string): Initialize the
12746         string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12747         when iterating on a string not from display properties).
12748         (compute_display_string_pos, compute_display_string_end):
12749         Fix calculation of the object to scan.  Fixes an error when using
12750         arrow keys.
12751         (next_element_from_buffer): Don't abort when IT_CHARPOS is before
12752         base_level_stop; instead, set base_level_stop to BEGV.
12753         Fixes crashes in vertical-motion.
12754         (next_element_from_buffer): Improve commentary for when
12755         the iterator is before prev_stop.
12756         (init_iterator): Initialize bidi_p from the default value of
12757         bidi-display-reordering, not from buffer-local value.  Use the
12758         buffer-local value only if initializing for buffer iteration.
12759         (handle_invisible_prop): Support invisible properties on strings
12760         that are being bidi-reordered.
12761         (set_iterator_to_next): Support bidi reordering of C strings and
12762         Lisp strings.
12763         (next_element_from_string): Support bidi reordering of Lisp
12764         strings.
12765         (handle_stop_backwards): Support Lisp strings as well.
12766         (display_string): Support display of R2L glyph rows.
12767         Use IT_STRING_CHARPOS when displaying from a Lisp string.
12768         (init_iterator): Don't initialize it->bidi_p for strings
12769         here.
12770         (reseat_to_string): Initialize it->bidi_p for strings here.
12771         (next_element_from_string, next_element_from_c_string)
12772         (next_element_from_buffer): Add xassert's for correspondence
12773         between IT's object being iterated and it->bidi_it.string
12774         structure.
12775         (face_before_or_after_it_pos): Support bidi iteration.
12776         (next_element_from_c_string): Handle the case of the first string
12777         character that is not the first one in the visual order.
12778         (get_visually_first_element): New function, refactored from common
12779         parts of next_element_from_buffer, next_element_from_string, and
12780         next_element_from_c_string.
12781         (tool_bar_lines_needed, redisplay_tool_bar)
12782         (display_menu_bar): Force left-to-right direction.  Add a FIXME
12783         comment for making that be controlled by a user option.
12784         (push_it, pop_it): Save and restore the state of the
12785         bidi iterator.  Save and restore the bidi_p flag.
12786         (pop_it): Iterate out of display property for string iteration as
12787         well.
12788         (iterate_out_of_display_property): Support iteration over strings.
12789         (handle_single_display_spec): Set up it->bidi_it for iteration
12790         over a display string, and call bidi_init_it.
12791         (handle_single_display_spec, next_overlay_string)
12792         (get_overlay_strings_1, push_display_prop): Set up the bidi
12793         iterator for displaying display or overlay strings.
12794         (forward_to_next_line_start): Don't use the shortcut if
12795         bidi-iterating.
12796         (back_to_previous_visible_line_start): If handle_display_prop
12797         pushed the iterator stack, restore the internal state of the bidi
12798         iterator by calling bidi_pop_it same number of times.
12799         (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12800         and we are bidi-iterating, don't decrement the iterator position;
12801         instead, set the first_elt flag in the bidi iterator, to produce
12802         the same effect.
12803         (reseat_1): Remove redundant setting of string_from_display_prop_p.
12804         (push_display_prop): xassert that we are iterating a buffer.
12805         (push_it, pop_it): Save and restore paragraph_embedding member.
12806         (handle_single_display_spec, next_overlay_string)
12807         (get_overlay_strings_1, reseat_1, reseat_to_string)
12808         (push_display_prop): Set up the `unibyte' member of bidi_it.string
12809         correctly.  Don't assume unibyte strings are not bidi-reordered.
12810         (compute_display_string_pos)
12811         (compute_display_string_end): Fix handling the case of C string.
12812         (push_it, pop_it): Save and restore from_disp_prop_p.
12813         (handle_single_display_spec, push_display_prop): Set the
12814         from_disp_prop_p flag.
12815         (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12816         (pop_it): Call iterate_out_of_display_property only if we are
12817         popping after iteration over a string that came from a display
12818         property.  Fix a typo in popping stretch info.  Add an assertion
12819         for verifying that the iterator position is in sync with the bidi
12820         iterator.
12821         (handle_single_display_spec, get_overlay_strings_1)
12822         (push_display_prop): Fix initialization of paragraph direction for
12823         string when that of the parent object is not yet determined.
12824         (reseat_1): Call bidi_init_it to resync the bidi
12825         iterator with IT's position.  (Bug#7616)
12826         (find_row_edges): If ROW->start.pos gives position
12827         smaller than min_pos, use it as ROW->minpos.  (Bug#7616)
12828         (handle_stop, back_to_previous_visible_line_start, reseat_1):
12829         Reset the from_disp_prop_p flag.
12830         (SAVE_IT, RESTORE_IT): New macros.
12831         (pos_visible_p, face_before_or_after_it_pos)
12832         (back_to_previous_visible_line_start)
12833         (move_it_in_display_line_to, move_it_in_display_line)
12834         (move_it_to, move_it_vertically_backward, move_it_by_lines)
12835         (try_scrolling, redisplay_window, display_line): Use them when
12836         saving a temporary copy of the iterator and restoring it back.
12837         (back_to_previous_visible_line_start, reseat_1)
12838         (init_iterator): Empty the bidi cache "stack".
12839         (move_it_in_display_line_to): If iterator ended up at
12840         EOL, but we never saw any buffer positions smaller than
12841         to_charpos, return MOVE_POS_MATCH_OR_ZV.  Fixes vertical cursor
12842         motion in bidi-reordered lines.
12843         (move_it_in_display_line_to): Record prev_method and prev_pos
12844         immediately before the call to set_iterator_to_next.  Fixes cursor
12845         motion in bidi-reordered lines with stretch glyphs and strings
12846         displayed in margins.  (Bug#8133) (Bug#8867)
12847         Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12848         TO_CHARPOS.
12849         (pos_visible_p): Support positions in bidi-reordered lines.
12850         Save and restore bidi cache.
12852         * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12853         (bidi_paragraph_info): Delete unused struct.
12854         (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12855         (bidi_cache_start): New variable.
12856         (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12857         to zero.
12858         (bidi_cache_fetch_state, bidi_cache_search)
12859         (bidi_cache_find_level_change, bidi_cache_iterator_state)
12860         (bidi_cache_find, bidi_peek_at_next_level)
12861         (bidi_level_of_next_char, bidi_find_other_level_edge)
12862         (bidi_move_to_visually_next): Compare cache index with
12863         bidi_cache_start rather than with zero.
12864         (bidi_fetch_char): Accept new argument STRING; all callers
12865         changed.  Support iteration over a string.  Support strings with
12866         display properties.  Support unibyte strings.  Fix the type of
12867         `len' according to what STRING_CHAR_AND_LENGTH expects.
12868         (bidi_paragraph_init, bidi_resolve_explicit_1)
12869         (bidi_resolve_explicit, bidi_resolve_weak)
12870         (bidi_level_of_next_char, bidi_move_to_visually_next):
12871         Support iteration over a string.
12872         (bidi_set_sor_type, bidi_resolve_explicit_1)
12873         (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12874         can now be zero (for strings); special values 0 and -1 were
12875         changed to -1 and -2, respectively.
12876         (bidi_char_at_pos): New function.
12877         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12878         Call it instead of FETCH_MULTIBYTE_CHAR.
12879         (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12880         initialized to valid values.
12881         (bidi_init_it): Don't initialize charpos and bytepos with invalid
12882         values.
12883         (bidi_level_of_next_char): Allow the sentinel "position" to pass
12884         the test for valid cached positions.  Fix the logic for looking up
12885         the sentinel state in the cache.  GCPRO the Lisp string we are
12886         iterating.
12887         (bidi_push_it, bidi_pop_it): New functions.
12888         (bidi_initialize): Initialize the bidi cache start stack pointer.
12889         (bidi_cache_ensure_space): New function, refactored from part of
12890         bidi_cache_iterator_state.  Don't assume the required size is just
12891         one BIDI_CACHE_CHUNK away.
12892         (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12893         (bidi_count_bytes, bidi_char_at_pos): New functions.
12894         (bidi_cache_search): Don't assume bidi_cache_last_idx is
12895         always valid if bidi_cache_idx is valid.
12896         (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12897         is valid if it's going to be used.
12898         (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12899         (bidi_cache_fetch_state, bidi_cache_search)
12900         (bidi_cache_find_level_change, bidi_cache_ensure_space)
12901         (bidi_cache_iterator_state, bidi_cache_find)
12902         (bidi_find_other_level_edge, bidi_cache_start_stack):
12903         All variables related to cache indices are now EMACS_INT.
12905         * dispextern.h (struct bidi_string_data): New structure.
12906         (struct bidi_it): New member `string'.  Make flag members be 1-bit
12907         fields, and put them last in the struct.
12908         (compute_display_string_pos, compute_display_string_end):
12909         Update prototypes.
12910         (bidi_push_it, bidi_pop_it): Add prototypes.
12911         (struct iterator_stack_entry): New members bidi_p,
12912         paragraph_embedding, and from_disp_prop_p.
12913         (struct it): Member bidi_p is now a bit field 1 bit wide.
12914         (bidi_shelve_cache, bidi_unshelve_cache):
12915         Declare prototypes.
12917         * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12918         (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12919         and vector-like objects.
12921         * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12922         cache around display iteration.
12924         * window.c (Fwindow_end, window_scroll_pixel_based)
12925         (displayed_window_lines, Frecenter): Save and restore the bidi
12926         cache around display iteration.
12928 2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12930         * editfns.c (Fdelete_region): Clarify the use of the named
12931         parameters (bug#6788).
12933 2011-07-14  Martin Rudalics  <rudalics@gmx.at>
12935         * indent.c (Fvertical_motion): Set and restore w->pointm when
12936         saving and restoring the window's buffer (Bug#9006).
12938 2011-07-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12940         * editfns.c (Fstring_to_char): Clarify just what is returned
12941         (bug#6576).  Text by Eli Zaretskii.
12943 2011-07-13  Juanma Barranquero  <lekktu@gmail.com>
12945         * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12947 2011-07-13  Eli Zaretskii  <eliz@gnu.org>
12949         * buffer.c (mmap_find): Fix a typo.
12951 2011-07-13  Johan Bockgård  <bojohan@gnu.org>
12953         Fix execution of x selection hooks.
12954         * xselect.c (Qx_lost_selection_functions)
12955         (Qx_sent_selection_functions): New vars.
12956         (syms_of_xselect): DEFSYM them.
12957         (x_handle_selection_request): Pass Qx_sent_selection_functions
12958         rather than Vx_sent_selection_functions to Frun_hook_with_args.
12959         (x_handle_selection_clear,x_clear_frame_selections):
12960         Pass Qx_lost_selection_functions rather than
12961         Vx_lost_selection_functions to Frun_hook_with_args.
12963 2011-07-13  Paul Eggert  <eggert@cs.ucla.edu>
12965         * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
12966         The old code sometimes used this field without initializing it.
12968         * alloc.c (gc_sweep): Don't read past end of array.
12969         In theory, the old code could also have corrupted Emacs internals,
12970         though it'd be very unlikely.
12972 2011-07-12  Andreas Schwab  <schwab@linux-m68k.org>
12974         * character.c (Fcharacterp): Don't advertise optional ignored
12975         argument.  (Bug#4026)
12977 2011-07-12  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12979         * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12980         key" (bug#4257).
12982         * window.c (Fset_window_start): Doc fix (bug#4199).
12983         (Fset_window_hscroll): Ditto.
12985 2011-07-12  Paul Eggert  <eggert@cs.ucla.edu>
12987         Fix minor new problems caught by GCC 4.6.1.
12988         * term.c (init_tty): Remove unused local.
12989         * xsettings.c (store_monospaced_changed): Define this function only
12990         if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
12991         not used otherwise.
12993 2011-07-12  Chong Yidong  <cyd@stupidchicken.com>
12995         * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12997 2011-07-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12999         * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
13000         are the mini-buffer and the echo area (bug#3320).
13002         * term.c (init_tty): Remove support for supdup, c10 and perq
13003         terminals, which are no longer supported (bug#1482).
13005 2011-07-10  Johan Bockgård  <bojohan@gnu.org>
13007         * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
13009 2011-07-10  Jan Djärv  <jan.h.d@swipnet.se>
13011         * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
13012         for non-popups (Bug#3642).
13014 2011-07-10  Andreas Schwab  <schwab@linux-m68k.org>
13016         * alloc.c (reset_malloc_hooks): Protoize.
13017         * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
13018         (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
13019         * cm.c (losecursor): Likewise.
13020         * data.c (fmod): Likewise.
13021         * dispnew.c (swap_glyphs_in_rows): Likewise.
13022         * emacs.c (memory_warning_signal): Likewise.
13023         * floatfns.c (float_error): Likewise.
13024         * font.c (check_gstring, check_otf_features, otf_tag_symbol)
13025         (otf_open, font_otf_capability, generate_otf_features)
13026         (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
13027         Likewise.
13028         * image.c (pbm_read_file): Likewise.
13029         * indent.c (string_display_width): Likewise.
13030         * intervals.c (check_for_interval, search_for_interval)
13031         (inc_interval_count, count_intervals, root_interval)
13032         (adjust_intervals_for_insertion, make_new_interval): Likewise.
13033         * lread.c (defalias): Likewise.
13034         * ralloc.c (r_alloc_check): Likewise.
13035         * regex.c (set_image_of_range_1, set_image_of_range)
13036         (regex_grow_registers): Likewise.
13037         * sysdep.c (strerror): Likewise.
13038         * termcap.c (valid_filename_p, tprint, main): Likewise.
13039         * tparam.c (main): Likewise.
13040         * unexhp9k800.c (run_time_remap, save_data_space)
13041         (update_file_ptrs, read_header, write_header, calculate_checksum)
13042         (copy_file, copy_rest, display_header): Likewise.
13043         * widget.c (mark_shell_size_user_specified, create_frame_gcs):
13044         Likewise.
13045         * xdisp.c (check_it): Likewise.
13046         * xfaces.c (register_color, unregister_color, unregister_colors):
13047         Likewise.
13048         * xfns.c (print_fontset_result): Likewise.
13049         * xrdb.c (member, fatal, main): Likewise.
13051 2011-07-10  Paul Eggert  <eggert@cs.ucla.edu>
13053         Fix minor problems found by static checking (Bug#9031).
13054         * chartab.c (char_table_set_range, map_sub_char_table):
13055         Remove unused locals.
13056         (uniprop_table): Now static.
13057         * composite.c (_work_char): Remove unused static var.
13059 2011-07-09  Juanma Barranquero  <lekktu@gmail.com>
13061         * chartab.c (uniprop_table_uncompress): Remove unused local variable.
13063 2011-07-09  Jan Djärv  <jan.h.d@swipnet.se>
13065         * gtkutil.c (qttip_cb): Remove code without function.
13067 2011-07-09  Eli Zaretskii  <eliz@gnu.org>
13069         * w32.c (pthread_sigmask): New stub.
13071 2011-07-08  Paul Eggert  <eggert@cs.ucla.edu>
13073         Use pthread_sigmask, not sigprocmask (Bug#9010).
13074         sigprocmask is portable only for single-threaded applications, and
13075         Emacs can be multi-threaded when it uses GTK.
13076         * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
13077         (LIBES): Use it.
13078         * callproc.c (Fcall_process):
13079         * process.c (create_process):
13080         * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
13081         Use pthread_sigmask, not sigprocmask.
13083 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
13085         * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13086         (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
13087         wrong (Bug#8591).
13089 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
13091         * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
13092         Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
13093         (xg_hide_tooltip): Fix comment.
13095         * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
13096         in registerServicesMenuSendTypes.
13097         (validRequestorForSendType): Don't check ns_return_types.
13099         * nsfns.m (Fx_open_connection): Put NSStringPboardType into
13100         ns_return_type.
13102 2011-07-08  Jason Rumney  <jasonr@gnu.org>
13104         * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
13105         SH_SHOW for hidden windows (Bug#5482).
13107         * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
13108         frame struct members of non-existent frames (Bug#6284).
13110 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
13112         * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13113         variable firstTime not needed on OSX >= 10.6.
13114         (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13115         >= 10.5.  Use setKnobProportion, setDoubleValue.
13117         * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13118         (MAC_OS_X_VERSION_10_5): Define if not defined.
13119         (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13120         (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13121         (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13123         * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
13124         cString and lossyCString on OSX >= 10.4.
13126         * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
13127         sizeToFit on OSX >= 10.2.
13129         * nsimage.m (allocInitFromFile): Don't use deprecated method
13130         bestRepresentationForDevice on OSX >= 10.6.
13132         * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
13133         to avoid warning.
13135         * emacs.c: Declare unexec_init_emacs_zone.
13137         * nsgui.h: Fix compiler warning about gnulib redefining verify.
13139         * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
13141         * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13142         on svcsMenu (Bug#8842).
13144         * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13145         ns_return_types.
13146         (Fns_list_services): Just return Qnil on 10.6, code not working there.
13148         * nsterm.m (QUTF8_STRING): Declare.
13149         (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13150         (validRequestorForSendType): Return type is (id).
13151         Change indexOfObjectIdenticalTo to indexOfObject.
13152         Check if we have local selection before returning self (Bug#8842).
13153         (writeSelectionToPasteboard): Put local selection into paste board
13154         if we have a local selection (Bug#8842).
13155         (syms_of_nsterm): DEFSYM QUTF8_STRING.
13157         * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13158         (ns_get_local_selection): Declare.
13160 2011-07-07  Lars Magne Ingebrigtsen  <larsi@gnus.org>
13162         * keymap.c (describe_map_tree): Don't insert a double newline at
13163         the end of the buffer (bug#1169) and return whether we inserted
13164         something.
13166         * callint.c (Fcall_interactively): Change "reading args" to
13167         "providing args" to try to clarify what it does (bug#1010).
13169 2011-07-07  Kenichi Handa  <handa@m17n.org>
13171         * composite.c (composition_compute_stop_pos): Ignore a static
13172         composition starting before CHARPOS (Bug#8915).
13174         * xdisp.c (handle_composition_prop): Likewise.
13176 2011-07-07  Eli Zaretskii  <eliz@gnu.org>
13178         * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13179         (Bug#9015)
13181 2011-07-07  Kenichi Handa  <handa@m17n.org>
13183         * character.h (unicode_category_t): New enum type.
13185         * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13186         (Qchar_code_property_table): New variable.
13187         (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13188         (UNIPROP_COMPRESSED_FORM_P): New macros.
13189         (char_table_ascii): Uncompress the compressed values.
13190         (sub_char_table_ref): New arg is_uniprop.  Callers changed.
13191         Uncompress the compressed values.
13192         (sub_char_table_ref_and_range): Likewise.
13193         (char_table_ref_and_range): Uncompress the compressed values.
13194         (sub_char_table_set): New arg is_uniprop.  Callers changed.
13195         Uncompress the compressed values.
13196         (sub_char_table_set_range): Args changed.  Callers changed.
13197         (char_table_set_range): Adjuted for the above change.
13198         (map_sub_char_table): Delete args default_val and parent.  Add arg
13199         top.  Give decoded values to a Lisp function.
13200         (map_char_table): Adjust for the above change.  Give decoded
13201         values to a Lisp function.  Gcpro more variables.
13202         (uniprop_table_uncompress)
13203         (uniprop_decode_value_run_length): New functions.
13204         (uniprop_decoder, uniprop_decoder_count): New variables.
13205         (uniprop_get_decoder, uniprop_encode_value_character)
13206         (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13207         New functions.
13208         (uniprop_encoder, uniprop_encoder_count): New variables.
13209         (uniprop_get_encoder, uniprop_table)
13210         (Funicode_property_table_internal, Fget_unicode_property_internal)
13211         (Fput_unicode_property_internal): New functions.
13212         (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13213         Sunicode_property_table_internal, Sget_unicode_property_internal,
13214         and Sput_unicode_property_internal.  Defvar_lisp
13215         char-code-property-alist.
13217         * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
13218         Vunicode_category_table.
13220         * font.c (font_range): Adjust for the change of
13221         Vunicode_category_table.
13223 2011-07-07  Dan Nicolaescu  <dann@ics.uci.edu>
13225         * m/iris4d.h: Remove file, move contents ...
13226         * s/irix6-5.h: ... here.
13228 2011-07-06  Paul Eggert  <eggert@cs.ucla.edu>
13230         Remove unportable assumption about struct layout (Bug#8884).
13231         * alloc.c (mark_buffer):
13232         * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13233         (clone_per_buffer_values): Don't assume that
13234         sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13235         This isn't true in general, and it's particularly not true
13236         if Emacs is configured with --with-wide-int.
13237         * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13238         New macros, used in the buffer.c change.
13240 2011-07-05  Jan Djärv  <jan.h.d@swipnet.se>
13242         * xsettings.c: Use both GConf and GSettings if both are available.
13243         (store_config_changed_event): Add comment.
13244         (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13245         (store_tool_bar_style_changed): New functions.
13246         (store_monospaced_changed): Add comment.  Call dpyinfo_valid.
13247         (struct xsettings): Move font inside HAVE_XFT.
13248         (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
13249         (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
13250         Move inside HAVE_XFT.
13251         (something_changed_gsettingsCB): Rename from something_changedCB.
13252         Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13253         also.
13254         (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
13255         (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT.  Move inside HAVE_XFT.
13256         (something_changed_gconfCB): Rename from something_changedCB.
13257         Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13258         (parse_settings): Move check for font inside HAVE_XFT.
13259         (read_settings, apply_xft_settings): Add comment.
13260         (read_and_apply_settings): Add comment.  Call map_tool_bar_style and
13261         store_tool_bar_style_changed.  Move check for font inside HAVE_XFT and
13262         call store_font_name_changed.
13263         (xft_settings_event): Add comment.
13264         (init_gsettings): Add comment.  Get values for GSETTINGS_TOOL_BAR_STYLE
13265         and GSETTINGS_FONT_NAME.  Move check for fonts within HAVE_XFT.
13266         (init_gconf): Add comment.  Get values for GCONF_TOOL_BAR_STYLE
13267         and GCONF_FONT_NAME.  Move check for fonts within HAVE_XFT.
13268         (xsettings_initialize): Call init_gsettings last.
13269         (xsettings_get_system_font, xsettings_get_system_normal_font):
13270         Add comment.
13272 2011-07-05  Paul Eggert  <eggert@cs.ucla.edu>
13274         Random fixes.  E.g., (random) never returned negative values.
13275         * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13276         subseconds part to the entropy, as that's a bit more random.
13277         Prefer signed to unsigned, since the signedness doesn't matter and
13278         in general we prefer signed.  When given a limit, use a
13279         denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13280         latter isn't right if USE_2_TAGS_FOR_INTS.
13281         * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13282         not 0..VALMASK.  Don't discard "excess" bits that random () returns.
13284 2011-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
13286         * textprop.c (text_property_stickiness):
13287         Obey Vtext_property_default_nonsticky.
13288         (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13289         * w32fns.c (syms_of_w32fns):
13290         * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13292 2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
13294         * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13295         This is more efficient than Ffile_directory_p and avoids a minor race.
13297 2011-07-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
13299         * buffer.c (Foverlay_put): Say what the return value is
13300         (bug#7835).
13302         * fileio.c (barf_or_query_if_file_exists): Check first if the file
13303         is a directory before asking whether to use the file name
13304         (bug#7564).
13305         (barf_or_query_if_file_exists): Make the "File is a directory"
13306         error be more correct.
13308         * fns.c (Frequire): Remove the mention of the .gz files, since
13309         that's installation-specific, but keep the mention of
13310         `get-load-suffixes'.
13312 2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
13314         * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13315         Report string overflow if the output is too long.
13317 2011-07-04  Juanma Barranquero  <lekktu@gmail.com>
13319         * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13320         (syms_of_gnutls): Remove duplicate DEFSYM for
13321         Qgnutls_bootprop_verify_hostname_error, an error for
13322         Qgnutls_bootprop_verify_error (which is no longer used).
13324         * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13325         unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca.  All callers changed.
13326         Also (re)move comments that are misplaced or no longer relevant.
13328 2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
13330         * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13332 2011-07-03  Chong Yidong  <cyd@stupidchicken.com>
13334         * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13335         and background color parameters if they have been changed.
13337 2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
13339         * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13341 2011-07-03  Paul Eggert  <eggert@cs.ucla.edu>
13343         * xsettings.c (SYSTEM_FONT): Define only when used.
13344         No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13346         * keymap.c (access_keymap_1): Now static.
13348 2011-07-02  Chong Yidong  <cyd@stupidchicken.com>
13350         * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13351         leave any prefix arg for the up event (Bug#1586).
13353 2011-07-02  Lars Magne Ingebrigtsen  <larsi@gnus.org>
13355         * lread.c (syms_of_lread): Mention single symbols defined by
13356         `defvar' or `defconst' (bug#7154).
13358         * fns.c (Frequire): Mention .el.gz files (bug#7314).
13359         (Frequire): Mention get-load-suffixes.
13361 2011-07-02  Martin Rudalics  <rudalics@gmx.at>
13363         * window.h (window): Remove clone_number slot.
13364         * window.c (Fwindow_clone_number, Fset_window_clone_number):
13365         Remove.
13366         (make_parent_window, make_window, saved_window)
13367         (Fset_window_configuration, save_window_save): Don't deal with
13368         clone numbers.
13369         * buffer.c (Qclone_number): Remove declaration.
13370         (sort_overlays, overlay_strings): Don't deal with clone numbers.
13372 2011-07-02  Stefan Monnier  <monnier@iro.umontreal.ca>
13374         Add multiple inheritance to keymaps.
13375         * keymap.c (Fmake_composed_keymap): New function.
13376         (Fset_keymap_parent): Simplify.
13377         (fix_submap_inheritance): Remove.
13378         (access_keymap_1): New function extracted from access_keymap to handle
13379         embedded parents and handle lists of maps.
13380         (access_keymap): Use it.
13381         (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13382         (Fcopy_keymap): Handle embedded parents.
13383         (Fcommand_remapping, define_as_prefix): Simplify.
13384         (Fkey_binding): Simplify.
13385         (syms_of_keymap): Move minibuffer-local-completion-map,
13386         minibuffer-local-filename-completion-map,
13387         minibuffer-local-must-match-map, and
13388         minibuffer-local-filename-must-match-map to Elisp.
13389         (syms_of_keymap): Defsubr make-composed-keymap.
13390         * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13391         (parse_menu_item): Trivial simplification.
13393 2011-07-01  Glenn Morris  <rgm@gnu.org>
13395         * Makefile.in (SETTINGS_LIBS): Fix typo.
13397 2011-07-01  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
13399         * coding.c (Fencode_coding_string): Record the last coding system
13400         used, as the function doc string says (bug#8738).
13402 2011-07-01  Jan Djärv  <jan.h.d@swipnet.se>
13404         * xsettings.c (store_monospaced_changed): Take new font as arg and
13405         check for change against current_mono_font.
13406         (EMACS_TYPE_SETTINGS): Remove this and related defines.
13407         (emacs_settings_constructor, emacs_settings_get_property)
13408         (emacs_settings_set_property, emacs_settings_class_init)
13409         (emacs_settings_init, gsettings_obj): Remove.
13410         (something_changedCB): New function for HAVE_GSETTINGS.
13411         (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13412         with value as argument.
13413         (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13414         g_settings_new (Bug#8967).  Do not create gsettings_obj.
13415         Remove calls to g_settings_bind.  Connect something_changedCB to
13416         "changed".
13418         * xgselect.c: Add defined (HAVE_GSETTINGS).
13419         (xgselect_initialize): Ditto.
13421         * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13422         (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13423         xg_select.
13425 2011-07-01  Paul Eggert  <eggert@cs.ucla.edu>
13427         * eval.c (struct backtrace): Simplify and port the data structure.
13428         Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13429         signed bit field, as this assumption is not portable and it makes
13430         Emacs crash when compiled with Sun C 5.8 on sparc.  Do not use
13431         "char debug_on_exit : 1" as this is not portable either; instead,
13432         use the portable "unsigned int debug_on_exit : 1".  Remove unused
13433         member evalargs.  Remove obsolete comments about cc bombing out.
13435 2011-06-30  Jan Djärv  <jan.h.d@swipnet.se>
13437         * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
13438         Let HAVE_GSETTINGS override HAVE_GCONF.
13439         (store_monospaced_changed): New function.
13440         (EMACS_SETTINGS): A new type derived from GObject to handle
13441         GSettings notifications.
13442         (emacs_settings_constructor, emacs_settings_get_property)
13443         (emacs_settings_set_property, emacs_settings_class_init):
13444         New functions.
13445         (gsettings_client, gsettings_obj): New variables.
13446         (GSETTINGS_SCHEMA): New define.
13447         (something_changedCB): Call store_monospaced_changed.
13448         (init_gsettings): New function.
13449         (xsettings_initialize): Call init_gsettings.
13450         (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13451         to NULL.
13453         * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
13454         GCONF_CFLAGS/LIBS.
13456 2011-06-29  Martin Rudalics  <rudalics@gmx.at>
13458         * window.c (resize_root_window, grow_mini_window)
13459         (shrink_mini_window): Rename Qresize_root_window to
13460         Qwindow_resize_root_window and Qresize_root_window_vertically to
13461         Qwindow_resize_root_window_vertically.
13463 2011-06-28  Paul Eggert  <eggert@cs.ucla.edu>
13465         * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13467 2011-06-27  Juanma Barranquero  <lekktu@gmail.com>
13469         * makefile.w32-in: Redesign dependencies so they reflect more
13470         clearly which files are directly included by each source file,
13471         and not through other includes.
13473 2011-06-27  Martin Rudalics  <rudalics@gmx.at>
13475         * buffer.c (Qclone_number): Declare static and DEFSYM it.
13476         (sort_overlays, overlay_strings): When an overlay's clone number
13477         matches the window's clone number process the overlay even if
13478         the overlay's window property doesn't match the current window.
13480         * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13481         (Fwindow_hchild): Rename to Fwindow_left_child.
13482         (Fwindow_next): Rename to Fwindow_next_sibling.
13483         (Fwindow_prev): Rename to Fwindow_prev_sibling.
13484         (resize_window_check): Rename to window_resize_check.
13485         (resize_window_apply): Rename to window_resize_apply.
13486         (Fresize_window_apply): Rename to Fwindow_resize_apply.
13487         (Fdelete_other_windows_internal, resize_frame_windows)
13488         (Fsplit_window_internal, Fdelete_window_internal)
13489         (grow_mini_window, shrink_mini_window)
13490         (Fresize_mini_window_internal): Fix callers accordingly.
13492 2011-06-26  Jan Djärv  <jan.h.d@swipnet.se>
13494         * emacsgtkfixed.h: State that this is only used with Gtk+3.
13495         (emacs_fixed_set_min_size): Remove.
13496         (emacs_fixed_new): Take frame as argument.
13498         * emacsgtkfixed.c: State that this is only used with Gtk+3.
13499         (_EmacsFixedPrivate): Remove minwidth/height.
13500         Add struct frame *f.
13501         (emacs_fixed_init): Initialize priv->f.
13502         (get_parent_class, emacs_fixed_set_min_size): Remove.
13503         (emacs_fixed_new): Set priv->f to argument.
13504         (emacs_fixed_get_preferred_width)
13505         (emacs_fixed_get_preferred_height): Use min_width/height from
13506         frames size_hint to set minimum and natural (Bug#8919).
13507         (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13508         and use min_width/height from frames size_hint to set
13509         min_width/height (Bug#8919).
13511         * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
13512         (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13513         Fix indentation.
13515 2011-06-26  Eli Zaretskii  <eliz@gnu.org>
13517         * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13518         bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13519         called at ZV.
13521 2011-06-26  Chong Yidong  <cyd@stupidchicken.com>
13523         * process.c (wait_reading_process_output): Bypass select if
13524         waiting for a cell while ignoring keyboard input, and input is
13525         pending.  Suggested by Jan Djärv (Bug#8869).
13527 2011-06-25  Paul Eggert  <eggert@cs.ucla.edu>
13529         Use gnulib's dup2 module instead of rolling our own.
13530         * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13532 2011-06-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
13534         * dispnew.c (scrolling_window): Before scrolling, turn off a
13535         mouse-highlight in the window being scrolled.
13537 2011-06-24  Juanma Barranquero  <lekktu@gmail.com>
13539         Move DEFSYM to lisp.h and use everywhere.
13541         * character.h (DEFSYM): Move declaration...
13542         * lisp.h (DEFSYM): ...here.
13544         * gnutls.c:
13545         * minibuf.c:
13546         * w32menu.c:
13547         * w32proc.c:
13548         * w32select.c: Don't include character.h.
13550         * alloc.c (syms_of_alloc):
13551         * buffer.c (syms_of_buffer):
13552         * bytecode.c (syms_of_bytecode):
13553         * callint.c (syms_of_callint):
13554         * casefiddle.c (syms_of_casefiddle):
13555         * casetab.c (init_casetab_once):
13556         * category.c (init_category_once, syms_of_category):
13557         * ccl.c (syms_of_ccl):
13558         * cmds.c (syms_of_cmds):
13559         * composite.c (syms_of_composite):
13560         * dbusbind.c (syms_of_dbusbind):
13561         * dired.c (syms_of_dired):
13562         * dispnew.c (syms_of_display):
13563         * doc.c (syms_of_doc):
13564         * editfns.c (syms_of_editfns):
13565         * emacs.c (syms_of_emacs):
13566         * eval.c (syms_of_eval):
13567         * fileio.c (syms_of_fileio):
13568         * fns.c (syms_of_fns):
13569         * frame.c (syms_of_frame):
13570         * fringe.c (syms_of_fringe):
13571         * insdel.c (syms_of_insdel):
13572         * keymap.c (syms_of_keymap):
13573         * lread.c (init_obarray, syms_of_lread):
13574         * macros.c (syms_of_macros):
13575         * msdos.c (syms_of_msdos):
13576         * print.c (syms_of_print):
13577         * process.c (syms_of_process):
13578         * search.c (syms_of_search):
13579         * sound.c (syms_of_sound):
13580         * syntax.c (init_syntax_once, syms_of_syntax):
13581         * terminal.c (syms_of_terminal):
13582         * textprop.c (syms_of_textprop):
13583         * undo.c (syms_of_undo):
13584         * w32.c (globals_of_w32):
13585         * window.c (syms_of_window):
13586         * xdisp.c (syms_of_xdisp):
13587         * xfaces.c (syms_of_xfaces):
13588         * xfns.c (syms_of_xfns):
13589         * xmenu.c (syms_of_xmenu):
13590         * xsettings.c (syms_of_xsettings):
13591         * xterm.c (syms_of_xterm): Use DEFSYM.
13593 2011-06-24  Teodor Zlatanov  <tzz@lifelogs.com>
13595         * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
13597 2011-06-23  Paul Eggert  <eggert@cs.ucla.edu>
13599         Integer and buffer overflow fixes (Bug#8873).
13601         * print.c (printchar, strout): Check for string overflow.
13602         (PRINTPREPARE, printchar, strout):
13603         Don't set size unless allocation succeeds.
13605         * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13606         for sizes.  Check for string overflow more accurately.
13607         Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13609         * macros.c: Integer and buffer overflow fixes.
13610         * keyboard.h (struct keyboard.kbd_macro_bufsize):
13611         * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13612         Use ptrdiff_t, not int, for sizes.
13613         Don't increment bufsize until after realloc succeeds.
13614         Check for size-calculation overflow.
13615         (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13617         * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13619         * lread.c: Integer overflow fixes.
13620         (read_integer): Radix is now EMACS_INT, not int,
13621         to improve quality of diagnostics for out-of-range radices.
13622         Calculate buffer size correctly for out-of-range radices.
13623         (read1): Check for integer overflow in radices, and in
13624         read-circle numbers.
13625         (read_escape): Avoid int overflow.
13626         (Fload, openp, read_buffer_size, read1)
13627         (substitute_object_recurse, read_vector, read_list, map_obarray):
13628         Use ptrdiff_t, not int, for sizes.
13629         (read1): Use EMACS_INT, not int, for sizes.
13630         Check for size overflow.
13632         * image.c (cache_image): Check for size arithmetic overflow.
13634         * lread.c: Integer overflow issues.
13635         (saved_doc_string_size, saved_doc_string_length)
13636         (prev_saved_doc_string_size, prev_saved_doc_string_length):
13637         Now ptrdiff_t, not int.
13638         (read1): Don't assume doc string length fits in int.  Check for
13639         out-of-range doc string lengths.
13640         (read_list): Don't assume file position fits in int.
13641         (read_escape): Check for hex character overflow.
13643 2011-06-22  Leo Liu  <sdl.web@gmail.com>
13645         * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13646         Move to minibuffer.el.
13648 2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
13650         Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
13651         The following patches are for when GLYPH_DEBUG && !XASSERT.
13652         * dispextern.h (trace_redisplay_p, dump_glyph_string):
13653         * dispnew.c (flush_stdout):
13654         * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13655         Mark as externally visible.
13656         * dispnew.c (check_window_matrix_pointers): Now static.
13657         * dispnew.c (window_to_frame_vpos):
13658         * xfns.c (unwind_create_frame):
13659         * xterm.c (x_check_font): Remove unused local.
13660         * scroll.c (CHECK_BOUNDS):
13661         * xfaces.c (cache_fache): Rename local to avoid shadowing.
13662         * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13663         * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13664         (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13665         (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13666         Now static.
13667         (debug_method_add): Use va_list and vsprintf rather than relying
13668         on undefined behavior with wrong number of arguments.
13669         (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13670         Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13671         In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13672         since we're not interested in debugging glyphs with old libraries.
13673         * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13674         GCC 4.6.0's static checking.
13676 2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
13678         Integer overflow and signedness fixes (Bug#8873).
13679         A few related buffer overrun fixes, too.
13681         * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13683         * dispextern.h (struct face.stipple):
13684         * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13685         (x_bitmap_mask, x_allocate_bitmap_record)
13686         (x_create_bitmap_from_data, x_create_bitmap_from_file)
13687         (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13688         (x_create_bitmap_from_xpm_data):
13689         * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13690         * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13691         (.bitmaps_last):
13692         * xfaces.c (load_pixmap):
13693         * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13694         * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13695         (.bitmaps_last, struct x_output.icon_bitmap):
13696         Use ptrdiff_t, not int, for bitmap indexes.
13697         (x_allocate_bitmap_record): Check for size overflow.
13698         * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13700         Use ptrdiff_t, not int, for overlay counts.
13701         * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13702         * editfns.c (overlays_around, get_pos_property):
13703         * textprop.c (get_char_property_and_overlay):
13704         * xdisp.c (next_overlay_change, note_mouse_highlight):
13705         * xfaces.c (face_at_buffer_position):
13706         * buffer.c (OVERLAY_COUNT_MAX): New macro.
13707         (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13708         (Fnext_overlay_change, Fprevious_overlay_change)
13709         (mouse_face_overlay_overlaps, Foverlays_in):
13710         Use ptrdiff_t, not int, for sizes.
13711         (overlays_at, overlays_in): Check for size-calculation overflow.
13713         * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13715         * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13716         (x_session_initialize): Do not assume string length fits in int.
13718         * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13719         This is unlikely, but can occur if DPI is outlandish.
13721         * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
13722         * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13724         * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13725         * xrdb.c (magic_file_p, search_magic_path):
13726         Omit last arg SUFFIX; it was always 0.  All callers changed.
13727         (magic_file_p): Use ptrdiff_t, not int.  Check for size overflow.
13729         * xfont.c (xfont_match): Avoid need for strlen.
13731         * xfns.c: Don't assume strlen fits in int.
13732         (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13734         * xdisp.c (message_log_check_duplicate): Return intmax_t,
13735         not unsigned long, as we prefer signed integers.  All callers changed.
13736         Detect integer overflow in repeat count.
13737         (message_dolog): Don't assume print length fits in 39 bytes.
13738         (display_mode_element): Don't assume strlen fits in int.
13740         * termcap.c: Don't assume sizes fit in int and never overflow.
13741         (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13742         (gobble_line): Check for size-calculation overflow.
13744         * minibuf.c (Fread_buffer):
13745         * lread.c (intern, intern_c_string):
13746         * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13747         Don't assume string length fits in int.
13749         * keyboard.c (parse_tool_bar_item):
13750         * gtkutil.c (style_changed_cb): Avoid need for strlen.
13752         * font.c: Don't assume string length fits in int.
13753         (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13754         Use ptrdiff_t, not int.
13755         (font_intern_prop): Don't assume string length fits in int.
13756         Don't assume integer property fits in fixnum.
13757         * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
13759         * filelock.c: Fix some buffer overrun and integer overflow issues.
13760         (get_boot_time): Don't assume gzip command string fits in 100 bytes.
13761         Reformulate so as not to need the command string.
13762         Invoke gzip -cd rather than gunzip, as it's more portable.
13763         (lock_info_type, lock_file_1, lock_file):
13764         Don't assume pid_t and time_t fit in unsigned long.
13765         (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13766         (current_lock_owner): Prefer signed type for sizes.
13767         Use memcpy, not strncpy, where memcpy is what is really wanted.
13768         Don't assume (via atoi) that time_t and pid_t fit in int.
13769         Check for time_t and/or pid_t out of range, e.g., via a network share.
13770         Don't alloca where an auto var works fine.
13772         * fileio.c: Fix some integer overflow issues.
13773         (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13774         Don't assume string length fits in int.
13775         (directory_file_name): Don't assume string length fits in long.
13776         (make_temp_name): Don't assume pid fits in int, or that its print
13777         length is less than 20.
13779         * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13781         * coding.c (make_subsidiaries): Don't assume string length fits in int.
13783         * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13785         * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13786         We prefer signed integers, even for size calculations.
13788         * emacs.c: Don't assume string length fits in 'int'.
13789         (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13790         (main): Don't invoke strlen when not needed.
13792         * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13793         (XD_DEBUG_MESSAGE): Don't waste a byte.
13795         * callproc.c (getenv_internal_1, getenv_internal)
13796         (Fgetenv_internal):
13797         * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13799         * lread.c (invalid_syntax): Omit length argument.
13800         All uses changed.  This doesn't fix a bug, but it simplifies the
13801         code away from its former Hollerith-constant appearance, and it's
13802         one less 'int' to worry about when looking at integer-overflow issues.
13803         (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
13805         * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13806         This didn't break anything, but it didn't help either.
13807         It's confusing to put a bogus integer in a place where the actual
13808         value does not matter.
13809         (LIST_END_P): Remove unused macro and its bogus comment.
13810         (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
13812         * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13813         This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13814         implementation.
13815         (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13816         We prefer signed types, and the value cannot exceed the EMACS_INT
13817         range anyway (because otherwise the length would not be representable).
13818         (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13819         not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13820         This avoids a GCC warning when WIDE_EMACS_INT.
13822         * indent.c (sane_tab_width): New function.
13823         (current_column, scan_for_column, Findent_to, position_indentation)
13824         (compute_motion): Use it.  This is just for clarity.
13825         (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
13827         * image.c (xbm_image_p): Don't assume stated width, height fit in int.
13829         * lisp.h (lint_assume): New macro.
13830         * composite.c (composition_gstring_put_cache):
13831         * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13833         * editfns.c, insdel.c:
13834         Omit unnecessary forward decls, to simplify future changes.
13836         * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13838         * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13840         * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
13841         Use much-faster test for byte-length change.
13842         Don't assume string byte-length fits in 'int'.
13843         Check that character arg fits in 'int'.
13844         (mapcar1): Declare byte as byte, for clarity.
13846         * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13848         * fns.c (concat): Catch string overflow earlier.
13849         Do not rely on integer wraparound.
13851         * dispextern.h (struct it.overlay_strings_charpos)
13852         (struct it.selective): Now EMACS_INT, not int.
13853         * xdisp.c (forward_to_next_line_start)
13854         (back_to_previous_visible_line_start)
13855         (reseat_at_next_visible_line_start, next_element_from_buffer):
13856         Don't arbitrarily truncate the value of 'selective' to int.
13858         * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13860         * composite.c: Don't truncate sizes to 'int'.
13861         (composition_gstring_p, composition_reseat_it)
13862         (composition_adjust_point): Use EMACS_INT, not int.
13863         (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13864         not EMACS_UINT, for indexes.
13866         * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13868         * buffer.c: Include <verify.h>.
13869         (struct sortvec.priority, struct sortstr.priority):
13870         Now EMACS_INT, not int.
13871         (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
13872         (struct sortstr.size, record_overlay_string)
13873         (struct sortstrlist.size, struct sortlist.used):
13874         Don't truncate size to int.
13875         (record_overlay_string): Check for size-calculation overflow.
13876         (init_buffer_once): Check at compile-time, not run-time.
13878 2011-06-22  Jim Meyering  <meyering@redhat.com>
13880         Don't leak an XBM-image-sized buffer
13881         * image.c (xbm_load): Free the image buffer after using it.
13883 2011-06-21  Paul Eggert  <eggert@cs.ucla.edu>
13885         Port to Sun C.
13886         * composite.c (find_automatic_composition): Omit needless 'return 0;'
13887         that Sun C diagnosed.
13888         * fns.c (secure_hash): Fix pointer signedness issue.
13889         * intervals.c (static_offset_intervals): New function.
13890         (offset_intervals): Use it.
13892 2011-06-21  Leo Liu  <sdl.web@gmail.com>
13894         * deps.mk (fns.o):
13895         * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13896         sha512.h.
13898         * fns.c (secure_hash): Rename from crypto_hash_function and change
13899         the first arg to accept symbols.
13900         (Fsecure_hash): New primitive.
13901         (syms_of_fns): New symbols.
13903 2011-06-20  Deniz Dogan  <deniz@dogan.se>
13905         * process.c (Fset_process_buffer): Clarify return value in
13906         docstring.
13908 2011-06-18  Chong Yidong  <cyd@stupidchicken.com>
13910         * dispnew.c (add_window_display_history): Use BVAR.
13912         * xdisp.c (debug_method_add): Use BVAR.
13913         (check_window_end, dump_glyph_matrix, dump_glyph)
13914         (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13916         * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13917         Likewise.
13919         * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13920         check till after the cache is created in init_frame_faces.
13922 2011-06-17  Stefan Monnier  <monnier@iro.umontreal.ca>
13924         * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13926 2011-06-16  Paul Eggert  <eggert@cs.ucla.edu>
13928         * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13929         Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13930         hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13932         Improve buffer-overflow checking (Bug#8873).
13933         * fileio.c (Finsert_file_contents):
13934         * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13935         Remove the old (too-loose) buffer overflow checks.
13936         They weren't needed, since make_gap checks for buffer overflow.
13937         * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13938         The old code merely checked for Emacs fixnum overflow, and relied
13939         on undefined (wraparound) behavior.  The new code avoids undefined
13940         behavior, and also checks for ptrdiff_t and/or size_t overflow.
13942         * editfns.c (Finsert_char): Don't dump core with very negative counts.
13943         Tune.  Don't use wider integers than needed.  Don't use alloca.
13944         Use a bigger 'string' buffer.  Rewrite to avoid 'n > 0' test.
13946         * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13948         * insdel.c, lisp.h (buffer_overflow): New function.
13949         (insert_from_buffer_1, replace_range, replace_range_2):
13950         * insdel.c (make_gap_larger):
13951         * editfns.c (Finsert_char):
13952         * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13954         * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13956 2011-06-15  Paul Eggert  <eggert@cs.ucla.edu>
13958         Integer overflow and signedness fixes (Bug#8873, Bug#8828).
13960         * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13961         (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13963         * fileio.c: Don't assume EMACS_INT fits in off_t.
13964         (emacs_lseek): New static function.
13965         (Finsert_file_contents, Fwrite_region): Use it.
13966         Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13968         * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13970         * fns.c: Don't overflow int when computing a list length.
13971         * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13972         (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13973         truncation on 64-bit hosts.  Check for QUIT every
13974         QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13975         faster and is responsive enough.
13976         (Flength): Report an error instead of overflowing an integer.
13977         (Fsafe_length): Return a float if the value is not representable
13978         as a fixnum.  This shouldn't happen except in contrived situations.
13979         (Fnthcdr, Fsort): Don't assume list length fits in int.
13980         (Fcopy_sequence): Don't assume vector length fits in int.
13982         * alloc.c: Check that resized vectors' lengths fit in fixnums.
13983         (header_size, word_size): New constants.
13984         (allocate_vectorlike): Don't check size overflow here.
13985         (allocate_vector): Check it here instead, since this is the only
13986         caller of allocate_vectorlike that could cause overflow.
13987         Check that the new vector's length is representable as a fixnum.
13989         * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13990         The previous code was bogus.  For example, next_almost_prime (32)
13991         returned 39, which is undesirable as it is a multiple of 3; and
13992         next_almost_prime (24) returned 25, which is a multiple of 5 so
13993         why was the code bothering to check for multiples of 7?
13995         * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13997         * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13999         Variadic C functions now count arguments with ptrdiff_t.
14000         This partly undoes my 2011-03-30 change, which replaced int with size_t.
14001         Back then I didn't know that the Emacs coding style prefers signed int.
14002         Also, in the meantime I found a few more instances where arguments
14003         were being counted with int, which may truncate counts on 64-bit
14004         machines, or EMACS_INT, which may be unnecessarily wide.
14005         * lisp.h (struct Lisp_Subr.function.aMANY)
14006         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
14007         Arg counts are now ptrdiff_t, not size_t.
14008         All variadic functions and their callers changed accordingly.
14009         (struct gcpro.nvars): Now size_t, not size_t.  All uses changed.
14010         * bytecode.c (exec_byte_code): Check maxdepth for overflow,
14011         to avoid potential buffer overrun.  Don't assume arg counts fit in 'int'.
14012         * callint.c (Fcall_interactively): Check arg count for overflow,
14013         to avoid potential buffer overrun.  Use signed char, not 'int',
14014         for 'varies' array, so that we needn't bother to check its size
14015         calculation for overflow.
14016         * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
14017         * eval.c (apply_lambda):
14018         * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
14019         (struct textprop_rec.argnum): Now ptrdiff_t, not int.  All uses changed.
14020         (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
14022         * callint.c (Fcall_interactively): Don't use index var as event count.
14024         * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
14025         * mem-limits.h (SIZE): Remove; no longer used.
14027         * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
14029         Remove unnecessary casts.
14030         * xterm.c (x_term_init):
14031         * xfns.c (x_set_border_pixel):
14032         * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
14033         These aren't needed now that we assume ANSI C.
14035         * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
14036         It's more likely to cause problems (due to unsigned overflow)
14037         than to cure them.
14039         * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
14041         * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
14043         * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
14045         * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
14047         * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
14049         * lread.c (Fload): Don't compare a possibly-garbage time_t value.
14051         GLYPH_CODE_FACE returns EMACS_INT, not int.
14052         * dispextern.h (merge_faces):
14053         * xfaces.c (merge_faces):
14054         * xdisp.c (get_next_display_element, next_element_from_display_vector):
14055         Don't assume EMACS_INT fits in int.
14057         * character.h (CHAR_VALID_P): Remove unused parameter.
14058         * fontset.c, lisp.h, xdisp.c: All uses changed.
14060         * editfns.c (Ftranslate_region_internal): Omit redundant test.
14062         * fns.c (concat): Minor tuning based on overflow analysis.
14063         This doesn't fix any bugs.  Use int to hold character, instead
14064         of constantly refetching from Emacs object.  Use XFASTINT, not
14065         XINT, for value known to be a character.  Don't bother comparing
14066         a single byte to 0400, as it's always less.
14068         * floatfns.c (Fexpt):
14069         * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
14071         * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
14072         for characters.
14074         * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
14076         * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
14077         Without this fix, on a 64-bit host (aset S 0 4294967386) would
14078         incorrectly succeed when S was a string, because 4294967386 was
14079         truncated before it was used.
14081         * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
14082         Otherwise, an out-of-range integer could cause undefined behavior
14083         on a 64-bit host.
14085         * composite.c: Use int, not EMACS_INT, for characters.
14086         (fill_gstring_body, composition_compute_stop_pos): Use int, not
14087         EMACS_INT, for values that are known to be in character range.
14088         This doesn't fix any bugs but is the usual style inside Emacs and
14089         may generate better code on 32-bit machines.
14091         Make sure a 64-bit char is never passed to ENCODE_CHAR.
14092         This is for reasons similar to the recent CHAR_STRING fix.
14093         * charset.c (Fencode_char): Check that character arg is actually
14094         a character.  Pass an int to ENCODE_CHAR.
14095         * charset.h (ENCODE_CHAR): Verify that the character argument is no
14096         wider than 'int', as a compile-time check to prevent future regressions
14097         in this area.
14099         * character.c (char_string): Remove unnecessary casts.
14101         Make sure a 64-bit char is never passed to CHAR_STRING.
14102         Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
14103         by silently ignoring the top 32 bits, allowing some values
14104         that were far too large to be valid characters.
14105         * character.h: Include <verify.h>.
14106         (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
14107         arguments are no wider than unsigned, as a compile-time check
14108         to prevent future regressions in this area.
14109         * data.c (Faset):
14110         * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
14111         (Fsubst_char_in_region):
14112         * fns.c (concat):
14113         * xdisp.c (decode_mode_spec_coding):
14114         Adjust to CHAR_STRING's new requirement.
14115         * editfns.c (Finsert_char, Fsubst_char_in_region):
14116         * fns.c (concat): Check that character args are actually
14117         characters.  Without this test, these functions did the wrong
14118         thing with wildly out-of-range values on 64-bit hosts.
14120         Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14121         These casts should not be needed on 32-bit hosts, either.
14122         * keyboard.c (read_char):
14123         * lread.c (Fload): Remove casts to unsigned.
14125         * lisp.h (UNSIGNED_CMP): New macro.
14126         This fixes comparison bugs on 64-bit hosts.
14127         (ASCII_CHAR_P): Use it.
14128         * casefiddle.c (casify_object):
14129         * character.h (ASCII_BYTE_P, CHAR_VALID_P)
14130         (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14131         * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14132         * dispextern.h (FACE_FROM_ID):
14133         * keyboard.c (read_char): Use UNSIGNED_CMP.
14135         * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
14136         not to EMACS_INT, to avoid GCC warning.
14138         * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
14140         * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14141         The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14142         isn't needed on 32-bit machines.
14144         * buffer.c (Fgenerate_new_buffer_name):
14145         Use EMACS_INT for count, not int.
14146         (advance_to_char_boundary): Return EMACS_INT, not int.
14148         * data.c (Qcompiled_function): Now static.
14150         * window.c (window_body_lines): Now static.
14152         * image.c (gif_load): Rename local to avoid shadowing.
14154         * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14155         (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14156         * alloc.c (make_save_value): Integer argument is now of type
14157         ptrdiff_t, not int.
14158         (mark_object): Use ptrdiff_t, not int.
14159         * lisp.h (pD): New macro.
14160         * print.c (print_object): Use it.
14162         * alloc.c: Use EMACS_INT, not int, to count objects.
14163         (total_conses, total_markers, total_symbols, total_vector_size)
14164         (total_free_conses, total_free_markers, total_free_symbols)
14165         (total_free_floats, total_floats, total_free_intervals)
14166         (total_intervals, total_strings, total_free_strings):
14167         Now EMACS_INT, not int.  All uses changed.
14168         (Fgarbage_collect): Compute overall total using a double, so that
14169         integer overflow is less likely to be a problem.  Check for overflow
14170         when converting back to an integer.
14171         (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14172         (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14173         These were 'int' variables that could overflow on 64-bit hosts;
14174         they were never used, so remove them instead of repairing them.
14175         (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
14176         (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14177         Previously, this ceilinged at INT_MAX, but that doesn't work on
14178         64-bit machines.
14179         (allocate_pseudovector): Don't use EMACS_INT when int would do.
14181         * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
14182         (allocate_vectorlike): Check for ptrdiff_t overflow.
14183         (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14184         when a (possibly-narrower) signed value would do just as well.
14185         We prefer using signed arithmetic, to avoid comparison confusion.
14187         * alloc.c: Catch some string size overflows that we were missing.
14188         (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14189         for convenience in STRING_BYTES_MAX.
14190         (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14191         The definition here is exact; the one in lisp.h was approximate.
14192         (allocate_string_data): Check for string overflow.  This catches
14193         some instances we weren't catching before.  Also, it catches
14194         size_t overflow on (unusual) hosts where SIZE_MAX <= min
14195         (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14196         and ptrdiff_t and EMACS_INT are both 64 bits.
14198         * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14199         All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
14200         * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
14202         * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14204         * alloc.c (Fmake_string): Check for out-of-range init.
14206 2011-06-15  Stefan Monnier  <monnier@iro.umontreal.ca>
14208         * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14210 2011-06-14  Jan Djärv  <jan.h.d@swipnet.se>
14212         * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14213         xg_get_default_scrollbar_width.
14215         * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14216         (int_gtk_range_get_value): Move to the scroll bar part of the file.
14217         (style_changed_cb): Call update_theme_scrollbar_width and call
14218         x_set_scroll_bar_default_width and xg_frame_set_char_size for
14219         all frames (Bug#8505).
14220         (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14221         Call gtk_window_set_resizable if HAVE_GTK3.
14222         (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14223         and height if HAVE_GTK3 (Bug#8505).
14224         (scroll_bar_width_for_theme): New variable.
14225         (update_theme_scrollbar_width): New function.
14226         (xg_get_default_scrollbar_width): Move code to
14227         update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14228         (xg_initialize): Call update_theme_scrollbar_width.
14230         * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14232         * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14234 2011-06-12  Martin Rudalics  <rudalics@gmx.at>
14236         * frame.c (make_frame): Call other_buffer_safely instead of
14237         other_buffer.
14239         * window.c (temp_output_buffer_show): Call display_buffer with
14240         second argument Vtemp_buffer_show_specifiers and reset latter
14241         immediately after the call.
14242         (Vtemp_buffer_show_specifiers): New variable.
14243         (auto_window_vscroll_p, next_screen_context_lines)
14244         (Vscroll_preserve_screen_position): Remove leading asterisks from
14245         doc-strings.
14247 2011-06-12  Paul Eggert  <eggert@cs.ucla.edu>
14249         Fix minor problems found by GCC 4.6.0 static checking.
14250         * buffer.c (Qclone_number): Remove for now, as it's unused.
14251         (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14252         (record_buffer): Remove unused local.
14253         * frame.c (other_visible_frames, frame_buffer_list): Now static.
14254         (set_frame_buffer_list): Remove; unused.
14255         * frame.h (other_visible_frames): Remove decl.
14256         * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14257         * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14258         (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14259         if HAVE_GPM.
14260         * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14261         * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14262         Define only if HAVE_GPM.
14263         * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14264         (update_hints_inhibit): Remove; never set.  All uses removed.
14265         * widgetprv.h (emacsFrameClassRec): Remove decl.
14266         * window.c (delete_deletable_window): Now returns void, since it
14267         wasn't returning anything.
14268         (compare_window_configurations): Remove unused locals.
14269         * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14270         * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
14271         (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14272         the same widths as pointers.  This follows up on the 2011-05-06 patch.
14273         * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14274         * xterm.h: Likewise.
14275         (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14277 2011-06-12  Juanma Barranquero  <lekktu@gmail.com>
14279         * makefile.w32-in: Update dependencies.
14280         (LISP_H): Add lib/intprops.h.
14282 2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
14284         * image.c (gif_load): Add animation frame delay to the metadata.
14285         (syms_of_image): Use DEFSYM.  New symbol `delay'.
14287 2011-06-11  Martin Rudalics  <rudalics@gmx.at>
14289         * window.c (delete_deletable_window): Re-add.
14290         (Fset_window_configuration): Rewrite to handle dead buffers and
14291         consequently deletable windows.
14292         (window_tree, Fwindow_tree): Remove.  Supply functionality in
14293         window.el.
14294         (compare_window_configurations): Simplify code.
14296 2011-06-11  Andreas Schwab  <schwab@linux-m68k.org>
14298         * image.c (imagemagick_load_image): Fix type mismatch.
14299         (Fimagemagick_types): Likewise.
14301         * window.h (replace_buffer_in_windows): Declare.
14303 2011-06-11  Martin Rudalics  <rudalics@gmx.at>
14305         * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14306         Qclone_number.  Remove external declaration of Qdelete_window.
14307         (Fbuffer_list): Rewrite doc-string.  Minor restructuring of
14308         code.
14309         (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14310         Run Qbuffer_list_update_hook if allowed.
14311         (Fother_buffer): Rewrite doc-string.  Major rewrite for new
14312         buffer list implementation.
14313         (other_buffer_safely): New function.
14314         (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14315         calls to replace_buffer_in_windows and
14316         replace_buffer_in_windows_safely.  Run Qbuffer_list_update_hook
14317         if allowed.
14318         (record_buffer): Inhibit quitting and rewrite using quittable
14319         functions.  Run Qbuffer_list_update_hook if allowed.
14320         (Frecord_buffer, Funrecord_buffer): New functions.
14321         (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14322         Move switch-to-buffer to window.el.
14323         (bury-buffer): Move to window.el.
14324         (Vbuffer_list_update_hook): New variable.
14326         * lisp.h (other_buffer_safely): Add prototype in buffer.c
14327         section.
14329         * window.h (resize_frame_windows): Move up in code.
14330         (Fwindow_frame): Remove EXFUN.
14331         (replace_buffer_in_all_windows): Remove prototype.
14332         (replace_buffer_in_windows_safely): Add prototype.
14334         * window.c: Declare Qdelete_window static again.  Move down
14335         declaration of select_count.
14336         (Fnext_window, Fprevious_window): Rewrite doc-strings.
14337         (Fother_window): Move to window.el.
14338         (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14339         cases.  Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14340         (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14341         window.el.
14342         (replace_buffer_in_windows): Implement by calling
14343         Qreplace_buffer_in_windows.
14344         (replace_buffer_in_all_windows): Remove with some functionality
14345         moved into replace_buffer_in_windows_safely.
14346         (replace_buffer_in_windows_safely): New function.
14347         (select_window_norecord, select_frame_norecord): Move in front
14348         of run_window_configuration_change_hook.  Remove now obsolete
14349         declarations.
14350         (Fset_window_buffer): Rewrite doc-string.
14351         Call Qrecord_window_buffer.
14352         (keys_of_window): Move binding for other-window to window.el.
14354 2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
14356         * dispextern.h (struct image): Replace data member, whose int_val
14357         and ptr_val fields were not used by anything, with a single
14358         lisp_val object.
14360         * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14361         (gif_clear_image, gif_load, imagemagick_load_image)
14362         (gs_clear_image, gs_load): Callers changed.
14364 2011-06-10  Paul Eggert  <eggert@cs.ucla.edu>
14366         * buffer.h: Include <time.h>, for time_t.
14367         Needed to build on FreeBSD 8.2.  Problem reported by Herbert J. Skuhra.
14369         Fix minor problems found by static checking.
14371         * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14373         Make identifiers static if they are not used in other modules.
14374         * data.c (Qcompiled_function, Qframe, Qvector):
14375         * image.c (QimageMagick, Qsvg):
14376         * minibuf.c (Qmetadata):
14377         * window.c (resize_window_check, resize_root_window): Now static.
14378         * window.h (resize_window_check, resize_root_window): Remove decls.
14380         * window.c (window_deletion_count, delete_deletable_window):
14381         Remove; unused.
14382         (window_body_lines): Now static.
14383         (Fdelete_other_windows_internal): Mark vars as initialized.
14384         Make sure 'resize_failed' is initialized.
14385         (run_window_configuration_change_hook): Rename local to avoid shadowing.
14386         (resize_window_apply): Remove unused local.
14387         * window.h (delete_deletable_window): Remove decl.
14389         * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
14390         (imagemagick_load_image): Fix pointer signedness problem by changing
14391         last arg from unsigned char * to char *.  All uses changed.
14392         Also, fix a local for similar reasons.
14393         Remove unused locals.  Remove locals to avoid shadowing.
14394         (fn_rsvg_handle_free): Remove; unused.
14395         (svg_load, svg_load_image): Fix pointer signedness problem.
14396         (imagemagick_load_image): Don't use garbage pointer image_wand.
14398         * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14400 2011-06-10  Chong Yidong  <cyd@stupidchicken.com>
14402         * image.c (gif_load): Fix omitted cast error introduced by
14403         2011-06-06 change.
14405 2011-06-10  Martin Rudalics  <rudalics@gmx.at>
14407         * window.h (resize_proportionally, orig_total_lines)
14408         (orig_top_line): Remove from window structure.
14409         (set_window_height, set_window_width, change_window_heights)
14410         (Fdelete_window): Remove prototypes.
14411         (resize_frame_windows): Remove duplicate declaration.
14413 2011-06-10  Eli Zaretskii  <eliz@gnu.org>
14415         * window.h (resize_frame_windows, resize_window_check)
14416         (delete_deletable_window, resize_root_window)
14417         (resize_frame_windows): Declare prototypes.
14419         * window.c (resize_window_apply): Make definition be "static" to
14420         match the prototype.
14422 2011-06-10  Martin Rudalics  <rudalics@gmx.at>
14424         * window.c: Remove declarations of Qwindow_size_fixed,
14425         window_min_size_1, window_min_size_2, window_min_size,
14426         size_window, window_fixed_size_p, enlarge_window, delete_window.
14427         Remove static from declaration of Qdelete_window, it's
14428         temporarily needed by Fbury_buffer.
14429         (replace_window): Don't assign orig_top_line and
14430         orig_total_lines.
14431         (Fdelete_window, delete_window): Remove.  Window deletion is
14432         handled by window.el.
14433         (window_loop): Remove DELETE_OTHER_WINDOWS case.
14434         Replace Fdelete_window calls with calls to Qdelete_window.
14435         (Fdelete_other_windows): Remove.  Deleting other windows is
14436         handled by window.el.
14437         (window_fixed_size_p): Remove.  Fixed-sizeness of windows is
14438         handled in window.el.
14439         (window_min_size_2, window_min_size_1, window_min_size): Remove.
14440         Window minimum sizes are handled in window.el.
14441         (shrink_windows, size_window, set_window_height)
14442         (set_window_width, change_window_heights, window_height)
14443         (window_width, CURBEG, CURSIZE, enlarge_window)
14444         (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14445         (Fenlarge_window, Fshrink_window): Remove.  Window resizing is
14446         handled in window.el.
14447         (make_dummy_parent): Rename to make_parent_window and give it a
14448         second argument horflag.
14449         (make_window): Don't set resize_proportionally any more.
14450         (Fsplit_window): Remove.  Windows are split in window.el.
14451         (save_restore_action, save_restore_orig_size)
14452         (shrink_window_lowest_first, save_restore_orig_size): Remove.
14453         Resize mini windows in window.el.
14454         (grow_mini_window, shrink_mini_window): Implement by calling
14455         Qresize_root_window_vertically, resize_window_check and
14456         resize_window_apply.
14457         (saved_window, Fset_window_configuration, save_window_save):
14458         Do not handle orig_top_line, orig_total_lines, and
14459         resize_proportionally.
14460         (window_min_height, window_min_width): Move to window.el.
14461         (keys_of_window): Move bindings for delete-other-windows,
14462         split-window, delete-window and enlarge-window to window.el.
14464         * buffer.c: Temporarily extern Qdelete_window.
14465         (Fbury_buffer): Temporarily call Qdelete_window instead of
14466         Fdelete_window (Fbury_buffer will move to window.el soon).
14468         * frame.c (set_menu_bar_lines_1): Remove code handling
14469         orig_top_line and orig_total_lines.
14471         * dispnew.c (adjust_frame_glyphs_initially): Don't use
14472         set_window_height but set heights directly.
14473         (change_frame_size_1): Use resize_frame_windows.
14475         * xdisp.c (init_xdisp): Don't use set_window_height but set
14476         heights directly.
14478         * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14479         Use resize_frame_windows instead of change_window_heights and run
14480         run_window_configuration_change_hook.
14482         * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14483         instead of change_window_heights and run
14484         run_window_configuration_change_hook.
14486 2011-06-09  Martin Rudalics  <rudalics@gmx.at>
14488         * window.c (replace_window): Rename second argument REPLACEMENT to
14489         NEW.  New third argument SETFLAG.  Rewrite.
14490         (delete_window, make_dummy_parent): Call replace_window with
14491         third argument 1.
14492         (window_list_1): Move down in code.
14493         (run_window_configuration_change_hook): Move set_buffer part
14494         before select_frame_norecord part in order to unwind correctly.
14495         Rename count1 to count.
14496         (recombine_windows, delete_deletable_window, resize_root_window)
14497         (Fdelete_other_windows_internal)
14498         (Frun_window_configuration_change_hook, make_parent_window)
14499         (resize_window_check, resize_window_apply, Fresize_window_apply)
14500         (resize_frame_windows, Fsplit_window_internal)
14501         (Fdelete_window_internal, Fresize_mini_window_internal):
14502         New functions.
14503         (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14505 2011-06-08  Martin Rudalics  <rudalics@gmx.at>
14507         * window.h (window): Add some new members to window structure -
14508         normal_lines, normal_cols, new_total, new_normal, clone_number,
14509         splits, nest, prev_buffers, next_buffers.
14510         (WINDOW_TOTAL_SIZE): Move here from window.c.
14511         (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
14513         * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14514         Remove.
14515         (make_dummy_parent): Set new members of windows structure.
14516         (make_window): Move down in code.  Handle new members of window
14517         structure.
14518         (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14519         (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14520         (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14521         (Fset_window_prev_buffers, Fwindow_next_buffers)
14522         (Fset_window_next_buffers, Fset_window_clone_number):
14523         New functions.
14524         (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14525         (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14526         Doc-string fixes.
14527         (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14528         Argument WINDOW can be now internal window too.
14529         (Fwindow_use_time): Move up in code.
14530         (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14531         Rewrite doc-string.
14532         (Fset_window_configuration, saved_window)
14533         (Fcurrent_window_configuration, save_window_save): Handle new
14534         members of window structure.
14535         (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14536         (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14537         (syms_of_window): New Lisp objects Qrecord_window_buffer,
14538         Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14539         Qget_mru_window, Qresize_root_window,
14540         Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14541         Qauto_buffer_name; staticpro them.
14543 2011-06-07  Martin Rudalics  <rudalics@gmx.at>
14545         * window.c (Fwindow_total_size, Fwindow_left_column)
14546         (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14547         (Fwindow_list_1): New functions.
14548         (window_box_text_cols): Replace with window_body_cols.
14549         (Fwindow_width, Fscroll_left, Fscroll_right):
14550         Use window_body_cols instead of window_box_text_cols.
14551         (delete_window, Fset_window_configuration):
14552         Call delete_all_subwindows with window as argument.
14553         (delete_all_subwindows): Take a window as argument and not a
14554         structure.  Rewrite.
14555         (window_loop): Remove handling of GET_LRU_WINDOW and
14556         GET_LARGEST_WINDOW.
14557         (Fget_lru_window, Fget_largest_window): Move to window.el.
14559         * window.h: Extern window_body_cols instead of
14560         window_box_text_cols.  delete_all_subwindows now takes a
14561         Lisp_Object as argument.
14563         * indent.c (compute_motion, Fcompute_motion):
14564         Use window_body_cols instead of window_box_text_cols.
14566         * frame.c (delete_frame): Call delete_all_subwindows with root
14567         window as argument.
14569 2011-06-07  Daniel Colascione  <dan.colascione@gmail.com>
14571         * fns.c (Fputhash): Document return value.
14573 2011-06-06  Chong Yidong  <cyd@stupidchicken.com>
14575         * image.c (gif_load): Implement gif89a spec "no disposal" method.
14577 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
14579         Cons<->int and similar integer overflow fixes (Bug#8794).
14581         Check for overflow when converting integer to cons and back.
14582         * charset.c (Fdefine_charset_internal, Fdecode_char):
14583         Use cons_to_unsigned to catch overflow.
14584         (Fencode_char): Use INTEGER_TO_CONS.
14585         * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14586         (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14587         * data.c (long_to_cons, cons_to_long): Remove.
14588         (cons_to_unsigned, cons_to_signed): New functions.
14589         These signal an error for invalid or out-of-range values.
14590         * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14591         * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14592         * font.c (Ffont_variation_glyphs):
14593         * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14594         * lisp.h: Include <intprops.h>.
14595         (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14596         (cons_to_signed, cons_to_unsigned): New decls.
14597         (long_to_cons, cons_to_long): Remove decls.
14598         * undo.c (record_first_change): Use INTEGER_TO_CONS.
14599         (Fprimitive_undo): Use CONS_TO_INTEGER.
14600         * xfns.c (Fx_window_property): Likewise.
14601         * xselect.c: Include <limits.h>.
14602         (x_own_selection, selection_data_to_lisp_data):
14603         Use INTEGER_TO_CONS.
14604         (x_handle_selection_request, x_handle_selection_clear)
14605         (x_get_foreign_selection, Fx_disown_selection_internal)
14606         (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14607         (lisp_data_to_selection_data): Use cons_to_unsigned.
14608         (x_fill_property_data): Use cons_to_signed.
14609         Report values out of range.
14611         Check for buffer and string overflow more precisely.
14612         * buffer.h (BUF_BYTES_MAX): New macro.
14613         * lisp.h (STRING_BYTES_MAX): New macro.
14614         * alloc.c (Fmake_string):
14615         * character.c (string_escape_byte8):
14616         * coding.c (coding_alloc_by_realloc):
14617         * doprnt.c (doprnt):
14618         * editfns.c (Fformat):
14619         * eval.c (verror):
14620         Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14621         since they may not be the same number.
14622         * editfns.c (Finsert_char):
14623         * fileio.c (Finsert_file_contents):
14624         Likewise for BUF_BYTES_MAX.
14626         * image.c: Use ptrdiff_t, not int, for sizes.
14627         (slurp_file): Switch from int to ptrdiff_t.
14628         All uses changed.
14629         (slurp_file): Check that file size fits in both size_t (for
14630         malloc) and ptrdiff_t (for sanity and safety).
14632         * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14633         if b->modtime has its maximal value.
14635         * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14637         Don't assume time_t can fit into int.
14638         * buffer.h (struct buffer.modtime): Now time_t, not int.
14639         * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14640         * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14642         Minor fixes for signed vs unsigned integers.
14643         * character.h (MAYBE_UNIFY_CHAR):
14644         * charset.c (maybe_unify_char):
14645         * keyboard.c (read_char, reorder_modifiers):
14646         XINT -> XFASTINT, since the integer must be nonnegative.
14647         * ftfont.c (ftfont_spec_pattern):
14648         * keymap.c (access_keymap, silly_event_symbol_error):
14649         XUINT -> XFASTINT, since the integer must be nonnegative.
14650         (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14651         since it makes no difference and we prefer signed.
14652         * keyboard.c (record_char): Use XUINT when all the neighbors do.
14653         (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14654         nonnegative.
14656 2011-06-06  Stefan Monnier  <monnier@iro.umontreal.ca>
14658         * window.h (Fwindow_frame): Declare.
14660 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
14662         * alloc.c: Simplify handling of large-request failures (Bug#8800).
14663         (SPARE_MEMORY): Always define.
14664         (LARGE_REQUEST): Remove.
14665         (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14667 2011-06-06  Martin Rudalics  <rudalics@gmx.at>
14669         * lisp.h: Move EXFUNS for Fframe_root_window,
14670         Fframe_first_window and Fset_frame_selected_window to window.h.
14672         * window.h: Move EXFUNS for Fframe_root_window,
14673         Fframe_first_window and Fset_frame_selected_window here from
14674         lisp.h.
14676         * frame.c (Fwindow_frame, Fframe_first_window)
14677         (Fframe_root_window, Fframe_selected_window)
14678         (Fset_frame_selected_window): Move to window.c.
14679         (Factive_minibuffer_window): Move to minibuf.c.
14680         (Fother_visible_frames_p): New function.
14682         * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14684         * window.c (decode_window, decode_any_window): Move up in code.
14685         (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14686         (inhibit_frame_unsplittable): Remove unused variable.
14687         (Fwindow_buffer): Move up and rewrite doc-string.
14688         (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14689         (Fwindow_prev): New functions.
14690         (Fwindow_frame): Move here from frame.c.  Accept any window as
14691         argument.
14692         (Fframe_root_window, Fframe_first_window)
14693         (Fframe_selected_window): Move here from frame.c.  Accept frame
14694         or arbitrary window as argument.  Update doc-strings.
14695         (Fminibuffer_window): Move up in code.
14696         (Fwindow_minibuffer_p): Move up in code and simplify.
14697         (Fset_frame_selected_window): Move here from frame.c.
14698         Marginal rewrite.
14699         (Fselected_window, select_window, Fselect_window): Move up in
14700         code.  Minor doc-string fixes.
14702 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
14704         * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14705         Do not assume that spare memory exists; that assumption is valid
14706         only if SYSTEM_MALLOC.
14707         (LARGE_REQUEST): New macro, so that the issue of large requests
14708         is separated from the issue of spare memory.
14710 2011-06-05  Andreas Schwab  <schwab@linux-m68k.org>
14712         * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14713         format.  (Bug#8806)
14715         * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14717         * xfns.c (x_set_scroll_bar_default_width): Move declarations
14718         before statements.
14720 2011-06-05  Jan Djärv  <jan.h.d@swipnet.se>
14722         * gtkutil.c (xg_get_default_scrollbar_width): New function.
14724         * gtkutil.h: Declare xg_get_default_scrollbar_width.
14726         * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14727         min width by calling x_set_scroll_bar_default_width (Bug#8505).
14729 2011-06-05  Juanma Barranquero  <lekktu@gmail.com>
14731         * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14733 2011-06-04  Chong Yidong  <cyd@stupidchicken.com>
14735         * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14736         (x_clipboard_manager_save): Add return value.
14737         (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14738         New error handlers.
14739         (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14740         Obey Vx_select_enable_clipboard_manager.  Catch errors in
14741         x_clipboard_manager_save (Bug#8779).
14742         (Vx_select_enable_clipboard_manager): New variable.
14743         (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
14745 2011-06-04  Dan Nicolaescu  <dann@ics.uci.edu>
14747         * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14749 2011-06-04  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
14751         * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14752         in the current matrix if keep_current_p is non-zero.
14754 2011-06-04  Eli Zaretskii  <eliz@gnu.org>
14756         * bidi.c (bidi_level_of_next_char): Fix last change.
14758 2011-06-03  Eli Zaretskii  <eliz@gnu.org>
14760         Support bidi reordering of text covered by display properties.
14762         * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14763         (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14764         (bidi_cache_search, bidi_cache_iterator_state)
14765         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
14766         (bidi_level_of_next_char, bidi_move_to_visually_next):
14767         Support character positions inside a run of characters covered by a
14768         display string.
14769         (bidi_paragraph_init, bidi_resolve_explicit_1)
14770         (bidi_level_of_next_char): Call bidi_fetch_char and
14771         bidi_fetch_char_advance instead of FETCH_CHAR and
14772         FETCH_CHAR_ADVANCE.
14773         (bidi_init_it): Initialize new members.
14774         (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14775         definitions.
14776         (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14777         instead of using explicit *_CHAR codes.
14778         (bidi_resolve_explicit, bidi_resolve_weak):
14779         Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
14780         bidirectional text is supported only in multibyte buffers.
14781         (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14782         it to initialize the frame_window_p member of struct bidi_it.
14783         (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14784         (bidi_resolve_explicit, bidi_resolve_weak)
14785         (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14786         bidi_it->nchars is non-positive.
14787         (bidi_level_of_next_char): Don't try to lookup the cache for the
14788         next/previous character if nothing is cached there yet, or if we
14789         were just reseat()'ed to a new position.
14791         * xdisp.c (set_cursor_from_row): Set start and stop points
14792         according to the row's direction when priming the loop that looks
14793         for the glyph on which to display cursor.
14794         (single_display_spec_intangible_p): Function deleted.
14795         (display_prop_intangible_p): Reimplement to call
14796         handle_display_spec instead of single_display_spec_intangible_p.
14797         Accept 3 additional arguments needed by handle_display_spec.
14798         This fixes incorrect cursor motion across display property with complex
14799         values: lists, `(when COND...)' forms, etc.
14800         (single_display_spec_string_p): Support property values that are
14801         lists with the argument STRING its top-level element.
14802         (display_prop_string_p): Fix the condition for processing a
14803         property that is a list to be consistent with handle_display_spec.
14804         (handle_display_spec): New function, refactored from the
14805         last portion of handle_display_prop.
14806         (compute_display_string_pos): Accept additional argument
14807         FRAME_WINDOW_P.  Call handle_display_spec to determine whether the
14808         value of a `display' property is a "replacing spec".
14809         (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14810         and FRAME_WINDOW_P.  If IT is NULL, don't set up the iterator from
14811         the display property, but just return a value indicating whether
14812         the display property will replace the characters it covers.
14813         (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14814         frame_window_p members of struct bidi_it.
14815         (compute_display_string_pos, compute_display_string_end):
14816         New functions.
14817         (push_it): Accept second argument POSITION, where pop_it should
14818         jump to continue iteration.
14819         (reseat_1): Initialize bidi_it.disp_pos.
14821         * keyboard.c (adjust_point_for_property): Adjust the call to
14822         display_prop_intangible_p to its new signature.
14824         * dispextern.h (struct bidi_it): New member frame_window_p.
14825         (bidi_init_it): Update prototypes.
14826         (display_prop_intangible_p): Update prototype.
14827         (compute_display_string_pos, compute_display_string_end):
14828         Declare prototypes.
14829         (struct bidi_it): New members nchars and disp_pos.  ch_len is now
14830         EMACS_INT.
14832 2011-06-02  Paul Eggert  <eggert@cs.ucla.edu>
14834         Malloc failure behavior now depends on size of allocation.
14835         * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14836         * lisp.h: Change signatures accordingly.
14837         * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14838         All callers changed.  (Bug#8762)
14840         * gnutls.c: Use Emacs's memory allocators.
14841         Without this change, the gnutls library would invoke malloc etc.
14842         directly, which causes problems on non-SYNC_INPUT hosts, and which
14843         runs afoul of improving memory_full behavior.  (Bug#8761)
14844         (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14845         (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14846         xfree instead of the default malloc, realloc, free.
14847         (Fgnutls_boot): No need to check for memory allocation failure,
14848         since xmalloc does that for us.
14850         Remove arbitrary limit of 2**31 entries in hash tables.  (Bug#8771)
14851         * category.c (hash_get_category_set):
14852         * ccl.c (ccl_driver):
14853         * charset.c (Fdefine_charset_internal):
14854         * charset.h (struct charset.hash_index):
14855         * composite.c (get_composition_id, gstring_lookup_cache)
14856         (composition_gstring_put_cache):
14857         * composite.h (struct composition.hash_index):
14858         * dispextern.h (struct image.hash):
14859         * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14860         (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14861         (hashfn_equal, hashfn_user_defined, make_hash_table)
14862         (maybe_resize_hash_table, hash_lookup, hash_put)
14863         (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14864         (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14865         (Fsxhash, Fgethash, Fputhash, Fmaphash):
14866         * image.c (make_image, search_image_cache, lookup_image)
14867         (xpm_put_color_table_h):
14868         * lisp.h (struct Lisp_Hash_Table):
14869         * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
14870         * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
14871         for hashes and hash indexes, instead of 'unsigned' and 'int'.
14872         * alloc.c (allocate_vectorlike):
14873         Check for overflow in vector size calculations.
14874         * ccl.c (ccl_driver):
14875         Check for overflow when converting EMACS_INT to int.
14876         * fns.c, image.c: Remove unnecessary static decls that would otherwise
14877         need to be updated by these changes.
14878         * fns.c (make_hash_table, maybe_resize_hash_table):
14879         Check for integer overflow with large hash tables.
14880         (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14881         Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14882         (SXHASH_REDUCE): New macro.
14883         (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14884         Use it instead of discarding useful hash info with large hash values.
14885         (sxhash_float): New function.
14886         (sxhash): Use it.  No more need for "& INTMASK" due to above changes.
14887         * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
14888         (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14889         Rewrite to use FIXNUM_BITS, as this simplifies things.
14890         (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14891         Adjust signatures to match updated version of code.
14892         (consing_since_gc): Now EMACS_INT, since a single hash table can
14893         use more than INT_MAX bytes.
14895 2011-06-01  Dan Nicolaescu  <dann@ics.uci.edu>
14897         Make it possible to build with GCC-4.6+ -O2 -flto.
14899         * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14901 2011-06-01  Stefan Monnier  <monnier@iro.umontreal.ca>
14903         * minibuf.c (get_minibuffer, read_minibuf_unwind):
14904         Call minibuffer-inactive-mode.
14906 2011-05-31  Juanma Barranquero  <lekktu@gmail.com>
14908         * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14909         Update dependencies.
14911 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
14913         * data.c (init_data): Remove code for UTS, this system is not
14914         supported anymore.
14916 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
14918         Don't force ./temacs to start in terminal mode.
14920         * frame.c (make_initial_frame): Initialize faces in all cases, not
14921         only when CANNOT_DUMP is defined.
14922         * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14924 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
14926         * dispnew.c (add_window_display_history): Use const for the string
14927         pointer.  Remove declaration, not needed.
14929 2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
14931         Use 'inline', not 'INLINE'.
14932         <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
14933         * alloc.c, fontset.c (INLINE): Remove.
14934         * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14935         * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14936         * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14937         * gmalloc.c (register_heapinfo): Use inline unconditionally.
14938         * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14940 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
14942         Make it possible to run ./temacs.
14944         * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14945         syms_of_callproc does the same thing.  Remove test for
14946         "initialized", do it in the caller.
14947         * emacs.c (main): Avoid calling set_initial_environment when dumping.
14949 2011-05-31  Stefan Monnier  <monnier@iro.umontreal.ca>
14951         * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14952         (read_minibuf): Use get_minibuffer.
14953         (syms_of_minibuf): Use DEFSYM.
14954         (Qmetadata): New var.
14955         * data.c (Qbuffer): Don't make it static.
14956         (syms_of_data): Use DEFSYM.
14958 2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
14960         * ccl.c (CCL_CODE_RANGE): Allow negative numbers.  (Bug#8751)
14961         (CCL_CODE_MIN): New macro.
14963 2011-05-30  Paul Eggert  <eggert@cs.ucla.edu>
14965         * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14967         * eval.c (Qdebug): Now static.
14968         * lisp.h (Qdebug): Remove decl.  This reverts a part of the
14969         2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14970         2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14972 2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
14974         * image.c: Various fixes to ImageMagick code comments.
14975         (Fimagemagick_types): Doc fix.
14977 2011-05-29  Paul Eggert  <eggert@cs.ucla.edu>
14979         Minor fixes prompted by GCC 4.6.0 warnings.
14981         * xselect.c (converted_selections, conversion_fail_tag): Now static.
14983         * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14984         (x_clipboard_manager_save_all): Move extern decl to ...
14985         * xterm.h: ... here, so that it can be checked for consistency.
14987 2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
14989         * xselect.c (x_clipboard_manager_save_frame)
14990         (x_clipboard_manager_save_all): New functions.
14991         (Fx_clipboard_manager_save): Lisp function deleted.
14993         * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14994         * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14996         * xterm.h: Update prototype.
14998 2011-05-28  William Xu  <william.xwl@gmail.com>
15000         * nsterm.m (ns_term_shutdown): Synchronize user defaults before
15001         exiting (Bug#8239).
15003 2011-05-28  Jim Meyering  <meyering@redhat.com>
15005         Avoid a sign-extension bug in crypto_hash_function.
15006         * fns.c (to_uchar): Define.
15007         (crypto_hash_function): Use it to convert some newly-signed
15008         variables to unsigned, to avoid sign-extension bugs.  For example,
15009         without this change, (md5 "truc") would evaluate to
15010         45723a2aff78ff4fff7fff1114760e62 rather than the expected
15011         45723a2af3788c4ff17f8d1114760e62.  Reported by Antoine Levitt in
15012         https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
15014 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
15016         Integer overflow fixes.
15018         * dbusbind.c: Serial number integer overflow fixes.
15019         (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
15020         (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
15021         to hold a serial number that is too large for a fixnum.
15022         (Fdbus_method_return_internal, Fdbus_method_error_internal):
15023         Check for serial numbers out of range.  Decode any serial number
15024         that was so large that it became a float.  (Bug#8722)
15026         * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
15027         (Fdbus_call_method, Fdbus_call_method_asynchronously):
15028         Use XFASTINT rather than XUINT when numbers are nonnegative.
15029         (xd_append_arg, Fdbus_method_return_internal):
15030         (Fdbus_method_error_internal): Likewise.  Also, for unsigned
15031         arguments, check that Lisp number is nonnegative, rather than
15032         silently wrapping negative numbers around.  (Bug#8722)
15033         (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
15034         (Bug#8722)
15036         * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
15038         * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
15040         ccl: Add integer overflow checks.
15041         * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
15042         (IN_INT_RANGE): New macros.
15043         (ccl_driver): Use them to check for integer overflow when
15044         decoding a CCL program.  Many of the new checks are whether XINT (x)
15045         fits in int; it doesn't always, on 64-bit hosts.  The new version
15046         doesn't catch all possible integer overflows, but it's an
15047         improvement.  (Bug#8719)
15049         * alloc.c (make_event_array): Use XINT, not XUINT.
15050         There's no need for unsigned here.
15052         * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
15053         This follows up to the 2011-05-06 change that substituted uintptr_t
15054         for EMACS_INT.  This case wasn't caught back then.
15056         Rework Fformat to avoid integer overflow issues.
15057         * editfns.c: Include <float.h> unconditionally, as it's everywhere
15058         now (part of C89).  Include <verify.h>.
15059         (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
15060         (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
15061         (Fformat): Avoid the prepass trying to compute sizes; it was only
15062         approximate and thus did not catch overflow reliably.  Instead, walk
15063         through the format just once, formatting and computing sizes as we go,
15064         checking for integer overflow at every step, and allocating a larger
15065         buffer as needed.  Keep track separately whether the format is
15066         multibyte.  Keep only the most-recently calculated precision, rather
15067         than them all.  Record whether each argument has been converted to
15068         string.  Use EMACS_INT, not int, for byte and char and arg counts.
15069         Support field widths and precisions larger than INT_MAX.  Avoid
15070         sprintf's undefined behavior with conversion specifications such as %#d
15071         and %.0c.  Fix bug with strchr succeeding on '\0' when looking for
15072         flags.  Fix bug with (format "%c" 256.0).  Avoid integer overflow when
15073         formatting out-of-range floating point numbers with int
15074         formats.  (Bug#8668)
15076         * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
15078         * data.c: Avoid integer truncation in expressions involving floats.
15079         * data.c: Include <intprops.h>.
15080         (arith_driver): When there's an integer overflow in an expression
15081         involving floating point, convert the integers to floating point
15082         so that the resulting value does not suffer from catastrophic
15083         integer truncation.  For example, on a 64-bit host (* 4
15084         most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
15085         Do not rely on undefined behavior after integer overflow.
15087         merge count_size_as_multibyte, parse_str_to_multibyte
15088         * character.c, character.h (count_size_as_multibyte):
15089         Rename from parse_str_to_multibyte; all uses changed.
15090         Check for integer overflow.
15091         * insdel.c, lisp.h (count_size_as_multibyte): Remove,
15092         since it's now a duplicate of the other.  This is more of
15093         a character than a buffer op, so better that it's in character.c.
15094         * fns.c, print.c: Adjust to above changes.
15096 2011-05-27  Stefan Monnier  <monnier@iro.umontreal.ca>
15098         * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
15100 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
15102         * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15103         (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
15104         (x_clipboard_manager_save): Now static.
15105         (Fx_clipboard_manager_save): Rename local to avoid shadowing.
15107         * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15108         (crypto_hash_function): Now static.
15109         Fix pointer signedness problems.  Avoid unnecessary initializations.
15111 2011-05-27  Chong Yidong  <cyd@stupidchicken.com>
15113         * termhooks.h (Vselection_alist): Make it terminal-local.
15115         * terminal.c (create_terminal): Initialize it.
15117         * xselect.c: Support for clipboard managers.
15118         (Vselection_alist): Move to termhooks.h as terminal-local var.
15119         (LOCAL_SELECTION): New macro.
15120         (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15121         (symbol_to_x_atom): Remove gratuitous arg.
15122         (x_handle_selection_request, lisp_data_to_selection_data)
15123         (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
15124         (x_own_selection, x_get_local_selection, x_convert_selection):
15125         New arg, specifying work frame.  Use terminal-local Vselection_alist.
15126         (some_frame_on_display): Delete unused function.
15127         (Fx_own_selection_internal, Fx_get_selection_internal)
15128         (Fx_disown_selection_internal, Fx_selection_owner_p)
15129         (Fx_selection_exists_p): New optional frame arg.
15130         (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15131         (x_handle_selection_clear): Don't treat other terminals with the
15132         same keyboard specially.  Use the terminal-local Vselection_alist.
15133         (x_clear_frame_selections): Use Frun_hook_with_args.
15135         * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
15137         * xterm.h: Add support for those atoms.
15139 2011-05-26  Chong Yidong  <cyd@stupidchicken.com>
15141         * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15142         (converted_selections, conversion_fail_tag): New global variables.
15143         (x_selection_request_lisp_error): Free the above.
15144         (x_get_local_selection): Remove unnecessary code.
15145         (x_reply_selection_request): Args changed; handle arbitrary array
15146         of converted selections stored in converted_selections.
15147         Separate the XChangeProperty and SelectionNotify steps.
15148         (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15149         (x_convert_selection): New function.
15150         (x_handle_selection_event): Simplify.
15151         (x_get_foreign_selection): Don't ignore incoming requests while
15152         waiting for an answer; this will fail when we implement
15153         SAVE_TARGETS, and seems unnecessary anyway.
15154         (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15155         (Vx_sent_selection_functions): Doc fix.
15157 2011-05-26  Leo Liu  <sdl.web@gmail.com>
15159         * editfns.c (Ftranspose_regions): Allow empty regions.  (Bug#8699)
15161 2011-05-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
15163         * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15165         * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15166         for fringe update if it has periodic bitmap.
15167         (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
15168         and fringe_bitmap_periodic_p.
15170         * fringe.c (get_fringe_bitmap_data): New function.
15171         (draw_fringe_bitmap_1, update_window_fringes): Use it.
15172         (update_window_fringes): Record periodicity of fringe bitmap in glyph
15173         row.  Mark glyph row for fringe update if periodicity changed.
15175         * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15176         for fringe update unless it has periodic bitmap.
15178 2011-05-25  Kenichi Handa  <handa@m17n.org>
15180         * xdisp.c (get_next_display_element): Set correct it->face_id for
15181         a static composition.
15183 2011-05-24  Leo Liu  <sdl.web@gmail.com>
15185         * deps.mk (fns.o):
15186         * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15188         * fns.c (crypto_hash_function, Fsha1): New function.
15189         (Fmd5): Use crypto_hash_function.
15190         (syms_of_fns): Add Ssha1.
15192 2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
15194         * gnutls.c: Remove unused macros.
15195         (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15196         (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15197         Remove macros that are defined and never used.
15198         Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15200 2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
15202         * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15203         (Fx_get_selection_internal): Minor cleanup.
15204         (Fx_own_selection_internal): Rename arguments for consistency with
15205         select.el.
15207 2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
15209         * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15211 2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
15213         * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15215 2011-05-21  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
15217         * dispnew.c (scrolling_window): Don't exclude the case that the
15218         last enabled row in the desired matrix touches the bottom boundary.
15220 2011-05-21  Glenn Morris  <rgm@gnu.org>
15222         * Makefile.in ($(etc)/DOC): Make second command line even shorter.
15223         (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15224         and add some more files.
15226 2011-05-20  Eli Zaretskii  <eliz@gnu.org>
15228         * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15229         report_file_error introduced by the change from 2011-05-07.
15231 2011-05-20  Paul Eggert  <eggert@cs.ucla.edu>
15233         * systime.h (Time): Define only if emacs is defined.
15234         This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15235         where the include path doesn't have X11/X.h by default.  See
15236         <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15238 2011-05-20  Kenichi Handa  <handa@m17n.org>
15240         * composite.c (find_automatic_composition): Fix previous change.
15242 2011-05-20  Glenn Morris  <rgm@gnu.org>
15244         * lisp.mk: New file, split from Makefile.in.
15245         * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15246         (shortlisp): Remove.
15247         ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15249 2011-05-19  Glenn Morris  <rgm@gnu.org>
15251         * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15252         (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15253         (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15254         (lisp): Set the order to that of loadup.el.
15255         (shortlisp): Make it a copy of $lisp.
15256         (SOME_MACHINE_LISP): Remove.
15257         ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15258         Use just $shortlisp, not $SOME_MACHINE_LISP too.
15260 2011-05-18  Kenichi Handa  <handa@m17n.org>
15262         * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15263         (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15264         (find_automatic_composition): Mostly rewrite for efficiency.
15266 2011-05-18  Juanma Barranquero  <lekktu@gmail.com>
15268         * makefile.w32-in: Update dependencies.
15270 2011-05-18  Christoph Scholtes  <cschol2112@googlemail.com>
15272         * menu.c: Include limits.h (fixes the MS-Windows build broken by
15273         2011-06-18T18:49:19Z!cyd@stupidchicken.com).
15275 2011-05-18  Paul Eggert  <eggert@cs.ucla.edu>
15277         Fix some integer overflow issues, such as string length overflow.
15279         * insdel.c (count_size_as_multibyte): Check for string overflow.
15281         * character.c (lisp_string_width): Check for string overflow.
15282         Use EMACS_INT, not int, for string indexes and lengths; in
15283         particular, 2nd arg is now EMACS_INT, not int.  Do not crash if
15284         the resulting string length overflows an EMACS_INT; instead,
15285         report a string overflow if no precision given.  When checking for
15286         precision exhaustion, use a check that cannot possibly have
15287         integer overflow.  (Bug#8675)
15288         * character.h (lisp_string_width): Adjust to new signature.
15290         * alloc.c (string_overflow): New function.
15291         (Fmake_string): Use it.  This doesn't change behavior, but saves
15292         a few bytes and will simplify future changes.
15293         * character.c (string_escape_byte8): Likewise.
15294         * lisp.h (string_overflow): New decl.
15296         Fixups, following up to the user-interface timestamp change.
15297         * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15298         for UI timestamps, instead of unsigned long.
15299         * msdos.c (mouse_get_pos): Likewise.
15300         * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
15301         * w32gui.h (Time): Define by including "systime.h" rather than by
15302         declaring it ourselves.  (Bug#8664)
15304         * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15305         * image.c (clear_image_cache): Likewise.
15307         * term.c (term_mouse_position): Don't assume time_t wraparound.
15309         Be more systematic about user-interface timestamps.
15310         Before, the code sometimes used 'Time', sometimes 'unsigned long',
15311         and sometimes 'EMACS_UINT', to represent these timestamps.
15312         This change causes it to use 'Time' uniformly, as that's what X uses.
15313         This makes the code easier to follow, and makes it easier to catch
15314         integer overflow bugs such as Bug#8664.
15315         * frame.c (Fmouse_position, Fmouse_pixel_position):
15316         Use Time, not unsigned long, for user-interface timestamps.
15317         * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15318         (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15319         * keyboard.h (last_event_timestamp): Likewise.
15320         * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15321         * menu.h (xmenu_show): Likewise.
15322         * term.c (term_mouse_position): Likewise.
15323         * termhooks.h (struct input_event.timestamp): Likewise.
15324         (struct terminal.mouse_position_hook): Likewise.
15325         * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15326         * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15327         * systime.h (Time): New decl.  Pull it in from <X11/X.h> if
15328         HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15329         what it was before.
15330         * menu.h, termhooks.h: Include "systime.h", for Time.
15332         * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15333         Don't assume that the difference between two unsigned long values
15334         can fit into an integer.  At this point, we know button_down_time
15335         <= event->timestamp, so the difference must be nonnegative, so
15336         there's no need to cast the result if double-click-time is
15337         nonnegative, as it should be; check that it's nonnegative, just in
15338         case.  This bug is triggered when events are more than 2**31 ms
15339         apart (about 25 days).  (Bug#8664)
15341         * xselect.c (last_event_timestamp): Remove duplicate decl.
15342         (x_own_selection): Remove needless cast to unsigned long.
15344         * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15345         that always fit in int.  Use a sentinel instead of a counter, to
15346         avoid a temp and to allay GCC's concerns about possible int overflow.
15347         * frame.h (struct frame): Use int for menu_bar_items_used
15348         instead of EMACS_INT, since it always fits in int.
15350         * menu.c (grow_menu_items): Check for int overflow.
15352         * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15354         * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15355         Before, the code was not consistent.  These values cannot exceed
15356         2**31 - 1 so there's no need to make them unsigned.
15357         (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15358         (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15359         (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15360         as modifiers.
15361         * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15363         * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15364         (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15365         Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15366         presumably because the widths might not match.
15368         * window.c (size_window): Avoid needless test at loop start.
15370 2011-05-18  Courtney Bane  <emacs-bugs-7626@cbane.org>  (tiny change)
15372         * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15374 2011-05-12  Drew Adams  <drew.adams@oracle.com>
15376         * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15378 2011-05-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
15380         * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15381         `width' to `bar_area_x' and `bar_area_width', respectively.
15382         (x_scroll_run): Take account of fringe background extension.
15384         * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15385         Rename local vars `left' and `width' to `bar_area_x' and
15386         `bar_area_width', respectively.
15387         (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15388         background extension.
15390 2011-05-10  Jim Meyering  <meyering@redhat.com>
15392         * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15394 2011-05-10  Juanma Barranquero  <lekktu@gmail.com>
15396         * image.c (Finit_image_library): Return t for built-in image types,
15397         like pbm and xbm.  (Bug#8640)
15399 2011-05-09  Andreas Schwab  <schwab@linux-m68k.org>
15401         * w32menu.c (set_frame_menubar): Fix submenu allocation.
15403 2011-05-07  Eli Zaretskii  <eliz@gnu.org>
15405         * w32console.c (Fset_screen_color): Doc fix.
15406         (Fget_screen_color): New function.
15407         (syms_of_ntterm): Defsubr it.
15409         * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15410         unlink the temporary file if Fcall_process didn't create it in the
15411         first place.
15412         (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15413         child process will be redirected to a file specified with `:file'.
15414         Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15415         cue to call_process_cleanup not to close that handle.
15417 2011-05-07  Ben Key  <bkey76@gmail.com>
15419         * makefile.w32-in: The bootstrap-temacs rule now makes use of
15420         one of two shell specific rules, either bootstrap-temacs-CMD or
15421         bootstrap-temacs-SH.  The bootstrap-temacs-SH rule is identical
15422         to the previous implementation of the bootstrap-temacs rule.
15423         The bootstrap-temacs-CMD rule is similar to the previous
15424         implementation of the bootstrap-temacs rule except that it
15425         makes use of the ESC_CFLAGS variable instead of the CFLAGS
15426         variable.
15428         These changes, along with some changes to nt/configure.bat,
15429         nt/gmake.defs, and nt/nmake.defs, are required to extend my
15430         earlier fix to add support for --cflags and --ldflags options
15431         that include quotes so that it works whether make uses cmd or
15432         sh as the shell.
15434 2011-05-06  Michael Albinus  <michael.albinus@gmx.de>
15436         * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15437         (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15438         is a constant.
15439         (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15440         a string.  Handle both cases.
15441         (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15442         (Fdbus_register_method): Use Qinvalid_function.
15444 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
15446         * makefile.w32-in: Update dependencies.
15447         (LISP_H): Add inttypes.h and stdin.h.
15448         (PROCESS_H): Add unistd.h.
15450 2011-05-06  Eli Zaretskii  <eliz@gnu.org>
15452         * lread.c: Include limits.h (fixes the MS-Windows build broken by
15453         2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15455 2011-05-06  Paul Eggert  <eggert@cs.ucla.edu>
15457         * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15459         * term.c (vfatal): Remove stray call to va_end.
15460         It's not needed and the C Standard doesn't allow it here anyway.
15462         Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15463         * eval.c (verror): doprnt a copy of ap, not the original.  (Bug#8545)
15465         * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15466         bytes.
15468         * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15470         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15472         * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15474         * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15476         * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15478         * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15479         * charset.c (Fdefine_charset_internal): Don't initialize
15480         charset.code_space[15].  The value was garbage, on hosts with
15481         32-bit int (Bug#8600).
15483         * lread.c (read_integer): Be more consistent with string-to-number.
15484         Use string_to_number to do the actual conversion; this avoids
15485         rounding errors and fixes some other screwups.  Without this fix,
15486         for example, #x1fffffffffffffff was misread as -2305843009213693952.
15487         (digit_to_number): Move earlier, for benefit of read_integer.
15488         Return -1 if the digit is out of range for the base, -2 if it is
15489         not a digit in any supported base.  (Bug#8602)
15491         * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15493         * dispnew.c (scrolling_window): Return 1 if we scrolled,
15494         to match comment at start of function.  This also removes a
15495         GCC warning about overflow in a 32+64-bit port.
15497         * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15499         * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15500         Reported by Stefan Monnier in
15501         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
15502         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15503         Use SYMBOLP-guarded XSYMBOL, not XPNTR.
15505         * lisp.h (EMACS_INTPTR): Remove.  All uses changed to intptr_t.
15506         (EMACS_UINTPTR): Likewise, with uintptr_t.
15508         * lisp.h: Prefer 64-bit EMACS_INT if available.
15509         (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15510         on 32-bit hosts that have 64-bit int, so that they can access
15511         large files.
15512         However, temporarily disable this change unless the temporary
15513         symbol WIDE_EMACS_INT is defined.
15515         * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15517         Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15518         This removes an assumption that EMACS_INT and long are the same
15519         width as pointers.  The assumption is true for Emacs porting targets
15520         now, but we want to make other targets possible.
15521         * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15522         (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15523         In the rest of the code, change types of integers that hold casted
15524         pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15525         replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15526         (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15527         (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15528         No need to cast type when ORing.
15529         (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15530         * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15531         * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15532         assume EMACS_INT is the same width as char *.
15533         * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15534         (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15535         Remove no-longer-needed casts.
15536         (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15537         (xg_tool_bar_help_callback, xg_make_tool_item):
15538         Use EMACS_INTPTR to hold an integer
15539         that will be cast to void *; this can avoid a GCC warning
15540         if EMACS_INT is not the same width as void *.
15541         * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15542         * xdisp.c (display_echo_area_1, resize_mini_window_1):
15543         (current_message_1, set_message_1):
15544         Use a local to convert to proper width without a cast.
15545         * xmenu.c (dialog_selection_callback): Likewise.
15547         * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15548         Also, don't assume VALBITS / RAND_BITS is less than 5,
15549         and don't rely on undefined behavior when shifting a 1 left into
15550         the sign bit.
15551         * lisp.h (get_random): Change signature to match.
15553         * lread.c (hash_string): Use size_t, not int, for hash computation.
15554         Normally we prefer signed values; but hashing is special, because
15555         it's better to use unsigned division on hash table sizes so that
15556         the remainder is nonnegative.  Also, size_t is the natural width
15557         for hashing into memory.  The previous code used 'int', which doesn't
15558         retain enough info to hash well into very large tables.
15559         (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15561         * dbusbind.c: Don't possibly lose pointer info when converting.
15562         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15563         Use XPNTR rather than XHASH, so that the high-order bits of
15564         the pointer aren't lost when converting through void *.
15566         * eval.c (Fautoload): Don't double-shift a pointer.
15568         * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15570 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
15572         * gnutls.c (DEF_GNUTLS_FN):
15573         * image.c (DEF_IMGLIB_FN): Make function pointers static.
15575 2011-05-05  Andreas Schwab  <schwab@linux-m68k.org>
15577         * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15578         marker.  (Bug#8610)
15580 2011-05-05  Eli Zaretskii  <eliz@gnu.org>
15582         * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15583         New version that can reserve upto 2GB of heap space.
15585 2011-05-05  Chong Yidong  <cyd@stupidchicken.com>
15587         * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15589 2011-05-05  Teodor Zlatanov  <tzz@lifelogs.com>
15591         * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15592         `gnutls_certificate_set_x509_key_file'.
15594 2011-05-05  Juanma Barranquero  <lekktu@gmail.com>
15596         * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15597         Update dependencies.
15599 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
15601         * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15602         * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15603         Remove unused parameter `fildes'.
15604         * process.c (read_process_output, send_process): Don't pass it.
15606 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
15608         Fix previous change: the library cache is defined in w32.c.
15609         * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15610         (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15612 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
15614         Implement dynamic loading of GnuTLS on Windows.
15616         * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15617         (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15618         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15619         Declare.
15621         * gnutls.c (Qgnutls_dll): Define.
15622         (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15623         (gnutls_*): Declare function pointers.
15624         (init_gnutls_functions): New function to initialize function pointers.
15625         (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15626         (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15627         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15628         Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15629         (emacs_gnutls_write, emacs_gnutls_read)
15630         (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15631         (Fgnutls_available_p): New function.
15632         (Fgnutls_boot): Call Fgnutls_available_p.  Use function pointers.
15633         (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15634         (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15636         * image.c: Include w32.h.
15637         (Vimage_type_cache): Delete.
15638         (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15639         (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15640         (w32_delayed_load): Move to w32.c.
15642         * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15644         * w32.c (QCloaded_from, Vlibrary_cache): Define.
15645         (w32_delayed_load): Move from image.c.  When loading a library, record
15646         its filename in the :loaded-from property of the library id.
15647         (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15648         Initialize and staticpro them.
15649         (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15651         * process.c: Include lisp.h before w32.h, not after.
15652         (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15653         instead of gnutls_record_check_pending.
15655         * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15657 2011-05-04  Teodor Zlatanov  <tzz@lifelogs.com>
15659         * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15660         instead of :keyfiles.  Give GnuTLS the keylist and the CRL lists
15661         as passed in.
15663 2011-05-03  Jan Djärv  <jan.h.d@swipnet.se>
15665         * xterm.c (x_set_frame_alpha): Do not set property on anything
15666         else than FRAME_X_OUTER_WINDOW (Bug#8608).
15668 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
15670         * sysdep.c (get_tty_size) [WINDOWSNT]: Implement.  (Bug#8596)
15672 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
15674         * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15675         (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15676         (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15677         (gnutls_global_initialized, Qgnutls_bootprop_priority)
15678         (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15679         (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15680         (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15681         (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15682         (Qgnutls_bootprop_callbacks_verify): Make static.
15684 2011-05-01  Andreas Schwab  <schwab@linux-m68k.org>
15686         * callproc.c: Indentation fixup.
15688         * sysdep.c (wait_for_termination_1): Make static.
15689         (wait_for_termination, interruptible_wait_for_termination):
15690         Move after wait_for_termination_1.
15692 2011-05-01  Lars Magne Ingebrigtsen  <larsi@gnus.org>
15694         * sysdep.c (interruptible_wait_for_termination): New function
15695         which is like wait_for_termination, but allows keyboard
15696         interruptions.
15698         * callproc.c (Fcall_process): Add (:file "file") as an option for
15699         the STDOUT buffer.
15700         (Fcall_process_region): Ditto.
15702 2011-04-30  Eli Zaretskii  <eliz@gnu.org>
15704         * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15705         rather than `XVECTOR (FOO)->size'.
15707         * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15708         inttypes.h, as a gnulib replacement is used if it not available in
15709         system headers.
15711 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
15713         Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15714         * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15715         of MOST_POSITIVE_FIXNUM.  (Bug#8528)
15717         * coding.c (coding_alloc_by_realloc): Error out if destination
15718         will grow beyond MOST_POSITIVE_FIXNUM.
15719         (decode_coding_emacs_mule): Abort if there isn't enough place in
15720         charbuf for the composition carryover bytes.  Reserve an extra
15721         space for up to 2 characters produced in a loop.
15722         (decode_coding_iso_2022): Abort if there isn't enough place in
15723         charbuf for the composition carryover bytes.
15725 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
15727         * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15728         aborting when %lld or %lll format is passed.
15729         [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15730         %llo or %llx format is passed.  (Bug#8545)
15732         * window.c (window_scroll_line_based): Use a marker instead of
15733         simple variables to record original value of point.  (Bug#7952)
15735         * doprnt.c (doprnt): Fix the case where a multibyte sequence
15736         produced by %s or %c overflows available buffer space.  (Bug#8545)
15738 2011-04-28  Paul Eggert  <eggert@cs.ucla.edu>
15740         * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
15741         (SIZE_MAX): Move defn after all includes, as they might #define it.
15743 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
15745         * w32.c (init_environment): Warn about defaulting HOME to C:\.
15747 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
15749         * keyboard.c (Qdelayed_warnings_hook): Define.
15750         (command_loop_1): Run `delayed-warnings-hook'
15751         if Vdelayed_warnings_list is non-nil.
15752         (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15753         (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15755 2011-04-28  Eli Zaretskii  <eliz@gnu.org>
15757         * doprnt.c (doprnt): Don't return value smaller than the buffer
15758         size if the message was truncated.  (Bug#8545).
15760 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
15762         * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15763         (Fx_window_property): #if-0 the whole functions, not just the bodies.
15765 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
15767         * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15769 2011-04-27  Juanma Barranquero  <lekktu@gmail.com>
15771         * makefile.w32-in: Update dependencies.
15773 2011-04-27  Eli Zaretskii  <eliz@gnu.org>
15775         Improve `doprnt' and its usage.  (Bug#8545)
15776         * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15777         `format_end'.  Remove support for %l as a conversion specifier.
15778         Don't use xrealloc.  Improve diagnostics when the %l size modifier
15779         is used.  Update the commentary.
15781         * eval.c (verror): Simplify calculation of size_t.
15783         * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15784         messages.
15786 2011-04-27  Yoshiaki Kasahara  <kasahara@nc.kyushu-u.ac.jp>  (tiny change)
15788         * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15789         change.
15791 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
15793         * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15794         This makes this file independent of the recent pseudovector change.
15796 2011-04-26  Paul Eggert  <eggert@cs.ucla.edu>
15798         * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15800         * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
15801         (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
15802         Remove unused local.
15803         (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
15805         * lisp.h: Fix a problem with aliasing and vector headers.  (Bug#8546)
15806         GCC 4.6.0 optimizes based on type-based alias analysis.
15807         For example, if b is of type struct buffer * and v of type struct
15808         Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15809         != &v->size, and therefore "v->size = 1; b->size = 2; return
15810         v->size;" must therefore return 1.  This assumption is incorrect
15811         for Emacs, since it type-puns struct Lisp_Vector * with many other
15812         types.  To fix this problem, this patch adds a new type struct
15813         vectorlike_header that documents the constraints on layout of vectors
15814         and pseudovectors, and helps optimizing compilers not get fooled
15815         by Emacs's type punning.  It also adds the macros XSETTYPED_PVECTYPE
15816         XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
15817         * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15818         the size member.
15819         (XSETPVECTYPE): Rewrite in terms of new macro.
15820         (XSETPVECTYPESIZE): New macro, specifying both type and size.
15821         This is a bit clearer, and further avoids the possibility of
15822         undesirable aliasing.
15823         (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
15824         (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
15825         (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15826         since Lisp_Subr is a special case (no "next" field).
15827         (ASIZE): Now uses header.size rather than size.
15828         All previous uses of XVECTOR (foo)->size replaced to use this macro,
15829         to avoid the hassle of writing XVECTOR (foo)->header.size.
15830         (struct vectorlike_header): New type.
15831         (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15832         object, to help avoid aliasing.
15833         (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15834         (SUBRP): Likewise, since Lisp_Subr is a special case.
15835         * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15836         (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15837         (struct Lisp_Hash_Table): Combine first two members into a single
15838         struct vectorlike_header member.  All uses of "size" and "next" members
15839         changed to be "header.size" and "header.next".
15840         * buffer.h (struct buffer): Likewise.
15841         * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15842         * frame.h (struct frame): Likewise.
15843         * process.h (struct Lisp_Process): Likewise.
15844         * termhooks.h (struct terminal): Likewise.
15845         * window.c (struct save_window_data, struct saved_window): Likewise.
15846         * window.h (struct window): Likewise.
15847         * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15848         Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15849         * buffer.c (init_buffer_once): Likewise.
15850         * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15851         special case.
15852         * process.c (Fformat_network_address): Use local var for size,
15853         for brevity.
15855         * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15857         Make the Lisp reader and string-to-float more consistent (Bug#8525)
15858         * data.c (atof): Remove decl; no longer used or needed.
15859         (digit_to_number): Move to lread.c.
15860         (Fstring_to_number): Use new string_to_number function, to be
15861         consistent with how the Lisp reader treats infinities and NaNs.
15862         Do not assume that floating-point numbers represent EMACS_INT
15863         without losing information; this is not true on most 64-bit hosts.
15864         Avoid double-rounding errors, by insisting on integers when
15865         parsing non-base-10 numbers, as the documentation specifies.
15866         * lisp.h (string_to_number): New decl, replacing ...
15867         (isfloat_string): Remove.
15868         * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
15869         (read1): Do not accept +. and -. as integers; this
15870         appears to have been a coding error.  Similarly, do not accept
15871         strings like +-1e0 as floating point numbers.  Do not report
15872         overflow for integer overflows unless the base is not 10 which
15873         means we have no simple and reliable way to continue.
15874         Break out the floating-point parsing into a new
15875         function string_to_number, so that Fstring_to_number parses
15876         floating point numbers consistently with the Lisp reader.
15877         (digit_to_number): Move here from data.c.  Make it static inline.
15878         (E_CHAR, EXP_INT): Remove, replacing with ...
15879         (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15880         (string_to_number): New function, replacing isfloat_string.
15881         This function checks for valid syntax and produces the resulting
15882         Lisp float number too.  Rework it so that string-to-number
15883         no longer mishandles examples like "1.0e+".  Use strtoumax,
15884         so that overflow for non-base-10 numbers is reported only when
15885         there's no portable and simple way to convert to floating point.
15887         * textprop.c (set_text_properties_1): Rewrite for clarity,
15888         and to avoid GCC warning about integer overflow.
15890         * intervals.h (struct interval): Use EMACS_INT for members
15891         where EMACS_UINT might cause problems.  See
15892         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15893         (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15894         * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15895         All uses changed.
15896         (offset_intervals): Tell GCC not to worry about length overflow
15897         when negating a negative length.
15899         * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15900         (overrun_check_free): Likewise.
15902         * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15903         in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15904         word size.
15906         * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15907         (gnutls_make_error): Rename local to avoid shadowing.
15908         (gnutls_emacs_global_deinit): ifdef out; not used.
15909         (Fgnutls_boot): Use const for pointer to readonly storage.
15910         Comment out unused local.  Fix pointer signedness problems.
15912         * lread.c (openp): Don't stuff size_t into an 'int'.
15913         Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15914         about possible signed overflow.
15916         * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15917         (GDK_KEY_g): Don't define if already defined.
15918         (xg_prepare_tooltip): Avoid pointer signedness problem.
15919         (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15921         * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15922         behavior with 1 << 31.  GCC 4.6.0 warns about this on 32-bit hosts.
15924         * xfns.c (Fx_window_property): Simplify a bit,
15925         to make a bit faster and to avoid GCC 4.6.0 warning.
15926         * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15928         * fns.c (internal_equal): Don't assume size_t fits in int.
15930         * alloc.c (compact_small_strings): Tighten assertion a little.
15932         Replace pEd with more-general pI, and fix some printf arg casts.
15933         * lisp.h (pI): New macro, generalizing old pEd macro to other
15934         conversion specifiers.  For example, use "...%"pI"d..." rather
15935         than "...%"pEd"...".
15936         (pEd): Remove.  All uses replaced with similar uses of pI.
15937         * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
15938         * alloc.c (check_pure_size): Don't overflow by converting size to int.
15939         * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15940         * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15941         * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15942         (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15943         * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15944         64-bit hosts.
15945         (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15946         * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15947         * print.c (safe_debug_print, print_object): Likewise.
15948         (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15949         to int.
15950         Use pI instead of if-then-else-abort.  Use %p to avoid casts,
15951         avoiding the 0 flag, which is not portable.
15952         * process.c (Fmake_network_process): Use pI to avoid cast.
15953         * region-cache.c (pp_cache): Likewise.
15954         * xdisp.c (decode_mode_spec): Likewise.
15955         * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15956         behavior on 64-bit hosts with printf arg.
15957         * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
15958         (x_stop_queuing_selection_requests): Likewise.
15959         (x_get_window_property): Don't truncate byte count to an 'int'
15960         when tracing.
15962         * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15963         here, since it parses constructs like leading '-' and spaces,
15964         which are not wanted; and it overflows with large numbers.
15965         Instead, simply match F[0-9]+, which is what is wanted anyway.
15967         * alloc.c: Remove unportable assumptions about struct layout.
15968         (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15969         (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15970         (allocate_vectorlike, make_pure_vector): Use the new macros,
15971         plus offsetof, to remove unportable assumptions about struct layout.
15972         These assumptions hold on all porting targets that I know of, but
15973         they are not guaranteed, they're easy to remove, and removing them
15974         makes further changes easier.
15976         * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15977         This doesn't fix a bug but makes the code clearer.
15978         (string_overrun_cookie): Now const.  Use initializers that
15979         don't formally overflow signed char, to avoid warnings.
15980         (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15981         can cause Emacs to crash when string overrun checking is enabled.
15982         (allocate_buffer): Don't assume sizeof (struct buffer) is a
15983         multiple of sizeof (EMACS_INT); it need not be, if
15984         alignof(EMACS_INT) < sizeof (EMACS_INT).
15985         (check_sblock, check_string_bytes, check_string_free_list): Protoize.
15987 2011-04-26  Juanma Barranquero  <lekktu@gmail.com>
15989         * keyboard.c (QCrtl): Rename from Qrtl.  All uses changed.
15991 2011-04-26  Teodor Zlatanov  <tzz@lifelogs.com>
15993         * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
15994         supposed to be handshaking.  (Bug#8556)
15995         Reported by Paul Eggert <eggert@cs.ucla.edu>.
15997 2011-04-26  Daniel Colascione  <dan.colascione@gmail.com>
15999         * lisp.h (Qdebug): List symbol.
16000         * eval.c (Qdebug): Restore global linkage.
16001         * keyboard.c (debug-on-event): New variable.
16002         (handle_user_signal): Break into debugger when debug-on-event
16003         matches the current signal symbol.
16005 2011-04-25  Dan Nicolaescu  <dann@ics.uci.edu>
16007         * alloc.c (check_sblock, check_string_bytes)
16008         (check_string_free_list): Convert to standard C.
16010 2011-04-25  Teodor Zlatanov  <tzz@lifelogs.com>
16012         * w32.c (emacs_gnutls_push): Fix typo.
16014 2011-04-25  Eli Zaretskii  <eliz@gnu.org>
16016         * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
16017         "cast to pointer from integer of different size".
16019         Improve doprnt and its use in verror.  (Bug#8545)
16020         * doprnt.c (doprnt): Document the set of format control sequences
16021         supported by the function.  Use SAFE_ALLOCA instead of always
16022         using `alloca'.
16024         * eval.c (verror): Don't limit the buffer size at size_max-1, that
16025         is one byte too soon.  Don't use xrealloc; instead xfree and
16026         xmalloc anew.
16028 2011-04-24  Teodor Zlatanov  <tzz@lifelogs.com>
16030         * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
16031         callbacks stage.
16033         * gnutls.c: Renamed global_initialized to
16034         gnutls_global_initialized.  Added internals for the
16035         :verify-hostname-error, :verify-error, and :verify-flags
16036         parameters of `gnutls-boot' and documented those parameters in the
16037         docstring.  Start callback support.
16038         (emacs_gnutls_handshake): Add Woe32 support.  Retry handshake
16039         unless a fatal error occurred.  Call gnutls_alert_send_appropriate
16040         on error.  Return error code.
16041         (emacs_gnutls_write): Call emacs_gnutls_handle_error.
16042         (emacs_gnutls_read): Likewise.
16043         (Fgnutls_boot): Return handshake error code.
16044         (emacs_gnutls_handle_error): New function.
16045         (wsaerror_to_errno): Likewise.
16047         * w32.h (emacs_gnutls_pull): Add prototype.
16048         (emacs_gnutls_push): Likewise.
16050         * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
16051         (emacs_gnutls_push): Likewise.
16053 2011-04-24  Claudio Bley  <claudio.bley@gmail.com>  (tiny change)
16055         * process.c (wait_reading_process_output): Check if GnuTLS
16056         buffered some data internally if no FDs are set for TLS
16057         connections.
16059         * makefile.w32-in (OBJ2): Add gnutls.$(O).
16060         (LIBS): Link to USER_LIBS.
16061         ($(BLD)/gnutls.$(0)): New target.
16063 2011-04-24  Eli Zaretskii  <eliz@gnu.org>
16065         * xdisp.c (handle_single_display_spec): Rename the
16066         display_replaced_before_p argument into display_replaced_p, to
16067         make it consistent with the commentary.  Fix typos in the
16068         commentary.
16070         * textprop.c (syms_of_textprop): Remove dead code.
16071         (copy_text_properties): Delete obsolete commentary about an
16072         interface that was deleted long ago.  Fix typos in the description
16073         of arguments.
16075         * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
16076         to changes in oldXMenu/XMenu.h from 2011-04-16.
16077         <menu_help_message, prev_menu_help_message>: Constify.
16078         (IT_menu_make_room): menu->help_text is now `const char **';
16079         adjust.
16081         * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
16082         to changes in oldXMenu/XMenu.h from 2011-04-16.
16083         (struct XMenu): Declare `help_text' `const char **'.
16085         * xfaces.c <Qunspecified>: Make extern again.
16087         * syntax.c: Include sys/types.h before including regex.h, as
16088         required by POSIX.
16090         * doc.c (get_doc_string): Improve the format passed to `error'.
16092         * doprnt.c (doprnt): Improve commentary.
16094         * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
16096         * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
16097         them with etags.
16099         * makefile.w32-in (globals.h): Add a dummy recipe, to make any
16100         changes in globals.h immediately force recompilation.
16101         (TAGS): Depend on $(CURDIR)/m/intel386.h and
16102         $(CURDIR)/s/ms-w32.h.
16103         (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
16105         * character.c (Fchar_direction): Function deleted.
16106         (syms_of_character): Don't defsubr it.
16107         <char-direction-table>: Deleted.
16109 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
16111         Fix doprnt so it could be used again safely in `verror'.  (Bug#8435)
16112         * doprnt.c: Include limits.h.
16113         (SIZE_MAX): New macro.
16114         (doprnt): Return a size_t value.  2nd arg is now size_t.
16115         Many local variables are now size_t instead of int or unsigned.
16116         Improve overflow protection.  Support `l' modifier for integer
16117         conversions.  Support %l conversion.  Don't assume an EMACS_INT
16118         argument for integer conversions and for %c.
16120         * lisp.h (doprnt): Restore prototype.
16122         * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16123         $(SRC)/character.h.
16125         * Makefile.in (base_obj): Add back doprnt.o.
16127         * deps.mk (doprnt.o): Add back prerequisites.
16128         (callint.o): Depend on character.h.
16130         * eval.c (internal_lisp_condition_case): Include the handler
16131         representation in the error message.
16132         (verror): Call doprnt instead of vsnprintf.  Fix an off-by-one bug
16133         when breaking from the loop.
16135         * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
16137         * callint.c (Fcall_interactively): When displaying error message
16138         about invalid control letter, pass the character's codepoint, not
16139         a pointer to its multibyte form.  Improve display of the character
16140         in octal and display also its hex code.
16142         * character.c (char_string): Use %x to display the (unsigned)
16143         codepoint of an invalid character, to avoid displaying a bogus
16144         negative value.
16146         * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16147         `error', not SYMBOL_NAME itself.
16149         * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16150         character arguments to `error'.
16152         * charset.c (check_iso_charset_parameter): Fix incorrect argument
16153         to `error' in error message about FINAL_CHAR argument.  Make sure
16154         FINAL_CHAR is a character, and use %c when it is passed as
16155         argument to `error'.
16157 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
16159         * s/ms-w32.h (localtime): Redirect to sys_localtime.
16161         * w32.c: Include <time.h>.
16162         (sys_localtime): New function.
16164 2011-04-23  Chong Yidong  <cyd@stupidchicken.com>
16166         * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16168         * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
16170 2011-04-23  Samuel Thibault  <sthibault@debian.org>  (tiny change)
16172         * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16173         zombies (Bug#8467).
16175 2011-04-19  Eli Zaretskii  <eliz@gnu.org>
16177         * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16178         gl_state.e_property when gl_state.object is Qt.
16180         * insdel.c (make_gap_larger): Remove limitation of buffer size
16181         to <= INT_MAX.
16183 2011-04-18  Chong Yidong  <cyd@stupidchicken.com>
16185         * xdisp.c (lookup_glyphless_char_display)
16186         (produce_glyphless_glyph): Handle cons cell entry in
16187         glyphless-char-display.
16188         (Vglyphless_char_display): Document it.
16190         * term.c (produce_glyphless_glyph): Handle cons cell entry in
16191         glyphless-char-display.
16193 2011-04-17  Chong Yidong  <cyd@stupidchicken.com>
16195         * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16197         * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16199         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16200         definition for no-X builds.
16202 2011-04-16  Paul Eggert  <eggert@cs.ucla.edu>
16204         Static checks with GCC 4.6.0 and non-default toolkits.
16206         * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16208         * process.c (keyboard_bit_set): Define only if SIGIO.
16209         (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16210         (send_process): Repair possible setjmp clobbering.
16212         * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16214         * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16216         * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16218         * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16219         Define only if needed.
16221         * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16222         by pacifying GCC about it.  Maybe it's time to retire it?
16223         * xfaces.c (USG, __TIMEVAL__): Likewise.
16225         * dispextern.h (struct redisplay_interface): Rename param
16226         to avoid shadowing.
16227         * termhooks.h (struct terminal): Likewise.
16228         * xterm.c (xembed_send_message): Likewise.
16230         * insdel.c (make_gap_smaller): Define only if
16231         USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16233         * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16234         it.
16236         * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16237         so that we aren't warned about unused symbols.
16239         * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16241         * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
16243         * xfns.c (x_real_positions): Mark locals as initialized.
16245         * xmenu.c (xmenu_show): Don't use uninitialized vars.
16247         * xterm.c: Fix problems found by static analysis with other toolkits.
16248         (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
16249         (x_dispatch_event): Declare static if USE_GTK, and
16250         define if USE_GTK || USE_X_TOOLKIT.
16251         (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
16252         * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
16253         * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16254         if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
16256         * xmenu.c (menu_help_callback): Pointer type fixes.
16257         Use const pointers when pointing at readonly data.  Avoid pointer
16258         signedness clashes.
16259         (FALSE): Remove unused macro.
16260         (update_frame_menubar): Remove unused decl.
16262         * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16264         * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16265         USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16266         (single_menu_item): Rename local to avoid shadowing.
16268         * keyboard.c (make_lispy_event): Remove unused local var.
16270         * frame.c, frame.h (x_get_resource_string): Bring this back, but
16271         only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16273         * bitmaps: Change bitmaps from unsigned char back to the X11
16274         compatible char.  Avoid the old compiler warnings about
16275         out-of-range initializers by using, for example, '\xab' rather
16276         than 0xab.
16278         * xgselect.c (xgselect_initialize): Check vs interface
16279         even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16281         * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16283         * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16284         to read-only memory.
16286         * fns.c (vector): Remove; this old hack is no longer needed.
16288         * xsmfns.c (create_client_leader_window): Rename shadowing arg.
16289         Remove unused var.
16290         (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
16292         * xrdb.c (x_load_resources): Omit unused local.
16294         * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
16295         (x_window): Rename locals to avoid shadowing.
16296         (USG): Use the kludged USG macro, to pacify gcc.
16298         * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
16299         (x_term_init): Remove local to avoid shadowing.
16301         * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
16303         * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16304         USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16306 2011-04-16  Eli Zaretskii  <eliz@gnu.org>
16308         * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16310         Fix regex.c, syntax.c and friends for buffers > 2GB.
16311         * syntax.h (struct gl_state_s): Declare character position members
16312         EMACS_INT.
16314         * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16316         * textprop.c (verify_interval_modification, interval_of):
16317         Declare arguments EMACS_INT.
16319         * intervals.c (adjust_intervals_for_insertion): Declare arguments
16320         EMACS_INT.
16322         * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16324         * indent.c (Fvertical_motion): Local variable it_start is now
16325         EMACS_INT.
16327         * regex.c (re_match, re_match_2, re_match_2_internal)
16328         (bcmp_translate, regcomp, regexec, print_double_string)
16329         (group_in_compile_stack, re_search, re_search_2, regex_compile)
16330         (re_compile_pattern, re_exec): Declare arguments and local
16331         variables `size_t' and `ssize_t' and return values `regoff_t', as
16332         appropriate.
16333         (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16334         (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16335         <compile_stack_type>: `size' and `avail' are now `size_t'.
16337         * regex.h <regoff_t>: Use ssize_t, not int.
16338         (re_search, re_search_2, re_match, re_match_2): Arguments that
16339         specify buffer/string position and length are now ssize_t and
16340         size_t.  Return type is regoff_t.
16342 2011-04-16  Ben Key  <bkey76@gmail.com>
16344         * nsfont.m: Fixed bugs in ns_get_family and
16345         ns_descriptor_to_entity that were caused by using free to
16346         deallocate memory blocks that were allocated by xmalloc (via
16347         xstrdup).  This caused Emacs to crash when compiled with
16348         XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16349         --enable-checking=xmallocoverrun).  xfree is now used to
16350         deallocate these memory blocks.
16352 2011-04-15  Paul Eggert  <eggert@cs.ucla.edu>
16354         * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16356         emacs_write: Accept and return EMACS_INT for sizes.
16357         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16358         et seq.
16359         * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16360         Accept and return EMACS_INT.
16361         (emacs_gnutls_write): Return the number of bytes written on
16362         partial writes.
16363         * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
16364         (emacs_read, emacs_write): Remove check for negative size, as the
16365         Emacs source code has been audited now.
16366         * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16367         (emacs_read, emacs_write): Use it.
16368         * process.c (send_process): Adjust to the new signatures of
16369         emacs_write and emacs_gnutls_write.  Do not attempt to store
16370         a byte offset into an 'int'; it might overflow.
16371         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
16373         * sound.c: Don't assume sizes fit in 'int'.
16374         (struct sound_device.period_size, alsa_period_size):
16375         Return EMACS_INT, not int.
16376         (struct sound_device.write, vox_write, alsa_write):
16377         Accept EMACS_INT, not int.
16378         (wav_play, au_play): Use EMACS_INT to store sizes and to
16379         record read return values.
16381 2011-04-15  Ben Key  <bkey76@gmail.com>
16383         * keyboard.c (Qundefined): Don't declare static since it is used
16384         in nsfns.m.
16385         * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16386         static since they are used in nsfont.m.
16388 2011-04-15  Stefan Monnier  <monnier@iro.umontreal.ca>
16390         * process.c (Qprocessp): Don't declare static.
16391         * lisp.h (Qprocessp): Declare again.
16393 2011-04-15  Juanma Barranquero  <lekktu@gmail.com>
16395         * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16397 2011-04-14  Paul Eggert  <eggert@cs.ucla.edu>
16399         Improve C-level modularity by making more things 'static'.
16401         Don't publish debugger-only interfaces to other modules.
16402         * lisp.h (safe_debug_print, debug_output_compilation_hack):
16403         (verify_bytepos, count_markers): Move decls to the only modules
16404         that need them.
16405         * region-cache.h (pp_cache): Likewise.
16406         * window.h (check_all_windows): Likewise.
16407         * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16409         * sysdep.c (croak): Now static, if
16410         defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16411         * syssignal.h (croak): Declare only if not static.
16413         * alloc.c (refill_memory_reserve): Now static if
16414         !defined REL_ALLOC || defined SYSTEM_MALLOC.
16415         * lisp.h (refill_memory_reserve): Declare only if not static.
16417         * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16418         Define only if USE_LUCID.
16420         * xrdb.c (x_customization_string, x_rm_string): Now static.
16422         * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16423         * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16425         * xdisp.c (draw_row_with_mouse_face): Now static.
16426         * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16428         * window.h (check_all_windows): Mark externally visible.
16430         * window.c (window_deletion_count): Now static.
16432         * undo.c: Make symbols static if they're not exported.
16433         (last_undo_buffer, last_boundary_position, pending_boundary):
16434         Now static.
16436         * textprop.c (interval_insert_behind_hooks): Now static.
16437         (interval_insert_in_front_hooks): Likewise.
16439         * term.c: Make symbols static if they're not exported.
16440         (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16441         (max_frame_lines, tty_set_terminal_modes):
16442         (tty_reset_terminal_modes, tty_turn_off_highlight):
16443         (get_tty_terminal): Now static.
16444         (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16445         * termhooks.h (term_mouse_moveto): Do not declare if
16446         HAVE_WINDOW_SYSTEM.
16447         * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16448         (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16450         * sysdep.c: Make symbols static if they're not exported.
16451         (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16452         Now static.
16453         (sigprocmask_set, full_mask): Remove; unused.
16454         (wait_debugging): Mark as visible.
16455         * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16456         * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16458         * syntax.c (syntax_temp): Define only if !__GNUC__.
16460         * sound.c (current_sound_device, current_sound): Now static.
16462         * search.c (searchbufs, searchbuf_head): Now static.
16464         * scroll.c (scroll_cost): Remove; unused.
16465         * dispextern.h (scroll_cost): Remove decl.
16467         * region-cache.h (pp_cache): Mark as externally visible.
16469         * process.c: Make symbols static if they're not exported.
16470         (process_tick, update_tick, create_process, chan_process):
16471         (Vprocess_alist, proc_buffered_char, datagram_access):
16472         (fd_callback_data, send_process_frame, process_sent_to): Now static.
16473         (deactivate_process): Mark defn as static, as well as decl.
16474         * lisp.h (create_process): Remove decl.
16475         * process.h (chan_process, Vprocess_alist): Remove decls.
16477         * print.c: Make symbols static if they're not exported.
16478         (print_depth, new_backquote_output, being_printed, print_buffer):
16479         (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16480         (print_interval, print_number_index, initial_stderr_stream):
16481         Now static.
16482         * lisp.h (Fprinc): Remove decl.
16483         (debug_output_compilation_hack): Mark as externally visible.
16485         * sysdep.c (croak): Move decl from here to syssignal.h.
16486         * syssignal.h (croak): Put it here, so the API can be checked when
16487         'croak' is called from dissociate_if_controlling_tty.
16489         * minibuf.c: Make symbols static if they're not exported.
16490         (minibuf_save_list, choose_minibuf_frame): Now static.
16491         * lisp.h (choose_minibuf_frame): Remove decl.
16493         * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16495         * lread.c: Make symbols static if they're not exported.
16496         (read_objects, initial_obarray, oblookup_last_bucket_number):
16497         Now static.
16498         (make_symbol): Remove; unused.
16499         * lisp.h (initial_obarray, make_symbol): Remove decls.
16501         * keyboard.c: Make symbols static if they're not exported.
16502         (single_kboard, recent_keys_index, total_keys, recent_keys):
16503         (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16504         (this_single_command_key_start, echoing, last_auto_save):
16505         (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16506         (command_loop, echo_now, keyboard_init_hook, help_char_p):
16507         (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16508         (Vlispy_mouse_stem, double_click_count):
16509         Now static.
16510         (force_auto_save_soon): Define only if SIGDANGER.
16511         (ignore_mouse_drag_p): Now static if
16512         !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16513         (print_help): Remove; unused.
16514         (stop_character, last_timer_event): Mark as externally visible.
16515         * keyboard.h (ignore_mouse_drag_p): Declare only if
16516         defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16517         (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16518         * lisp.h (echoing): Remove decl.
16519         (force_auto_save_soon): Declare only if SIGDANGER.
16520         * xdisp.c (redisplay_window): Simplify code, to make it more
16521         obvious that ignore_mouse_drag_p is not accessed if !defined
16522         USE_GTK && !defined HAVE_NS.
16524         * intervals.c: Make symbols static if they're not exported.
16525         (merge_properties_sticky, merge_interval_right, delete_interval):
16526         Now static.
16527         * intervals.h (merge_interval_right, delete_interval): Remove decls.
16529         * insdel.c: Make symbols static if they're not exported.
16530         However, leave prepare_to_modify_buffer alone.  It's never
16531         called from outside this function, but that appears to be a bug.
16532         (combine_after_change_list, combine_after_change_buffer):
16533         (adjust_after_replace, signal_before_change): Now static.
16534         (adjust_after_replace_noundo): Remove; unused.
16535         * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
16536         (signal_before_change): Remove decls.
16538         * indent.c (val_compute_motion, val_vmotion): Now static.
16540         * image.c: Make symbols static if they're not exported.
16541         * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16542         if USE_GTK.
16543         * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16544         (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16546         * fringe.c (standard_bitmaps): Now static.
16547         (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16549         * frame.c: Make symbols static if they're not exported.
16550         (x_report_frame_params, make_terminal_frame): Now static.
16551         (get_frame_param): Now static, unless HAVE_NS.
16552         (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16553         (x_get_resource_string): Remove; not used.
16554         * frame.h (make_terminal_frame, x_report_frame_params):
16555         (x_get_resource_string); Remove decls.
16556         (x_fullscreen_adjust): Declare only if WINDOWSNT.
16557         * lisp.h (get_frame_param): Declare only if HAVE_NS.
16559         * font.c, fontset.c: Make symbols static if they're not exported.
16560         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16561         (FACE_SUITABLE_FOR_CHAR_P): Use it.
16562         * font.c (font_close_object): Now static.
16563         * font.h (font_close_object): Remove.
16564         * fontset.c (FONTSET_OBJLIST): Remove.
16565         (free_realized_fontset) #if-0 the body, which does nothing.
16566         (face_suitable_for_char_p): #if-0, as it's never called.
16567         * fontset.h (face_suitable_for_char_p): Remove decl.
16568         * xfaces.c (face_at_string_position):
16569         Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
16570         since 0 is always ASCII.
16572         * fns.c (weak_hash_tables): Now static.
16574         * fileio.c: Make symbols static if they're not exported.
16575         (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16576         (Vwrite_region_annotation_buffers): Now static.
16578         * eval.c: Make symbols static if they're not exported.
16579         (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16580         * lisp.h (backtrace_list): Remove decl.
16582         * emacs.c: Make symbols static if they're not exported.
16583         (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16584         (fatal_error_code, fatal_error_signal_hook, standard_args):
16585         Now static.
16586         (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16587         (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16588         (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16589         * lisp.h (fatal_error_signal_hook): Remove decl.
16590         (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16592         * editfns.c: Move a (normally-unused) function to its only use.
16593         * editfns.c, lisp.h (get_operating_system_release): Remove.
16594         * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16595         worth the hassle of breaking this out.
16597         * xterm.c: Make symbols static if they're not exported.
16598         (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16599         (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16600         (x_destroy_window, x_delete_display):
16601         Now static.
16602         (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16603         (x_mouse_leave): Remove; unused.
16604         * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16605         (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16606         (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16607         Remove decls.
16608         (x_mouse_leave): Declare only if WINDOWSNT.
16609         (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16610         (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16611         USE_X_TOOLKIT.
16613         * ftxfont.c: Make symbols static if they're not exported.
16614         (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16615         HAVE_FREETYPE.
16616         * font.h (ftxfont_driver): Likewise.
16618         * xfns.c: Make symbols static if they're not exported.
16619         (x_last_font_name, x_display_info_for_name):
16620         (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16621         (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16622         (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16623         (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16624         (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16625         (last_show_tip_args): Now static.
16626         (xic_defaut_fontset, xic_create_fontsetname): Define only if
16627         defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16628         (x_screen_planes): Remove; unused.
16629         * dispextern.h (x_screen_planes): Remove decl.
16631         * dispnew.c: Make symbols static if they're not exported.
16632         * dispextern.h (redraw_garbaged_frames, scrolling):
16633         (increment_row_positions): Remove.
16634         * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16635         (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16636         Now static.
16637         (redraw_garbaged_frames): Remove; unused.
16639         * xfaces.c: Make symbols static if they're not exported.
16640         * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16641         Remove decls.
16642         * xterm.h (defined_color): Remove decls.
16643         (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16644         * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16645         (menu_face_changed_default, defined_color, free_realized_face):
16646         (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16647         (ascii_face_of_lisp_face): Remove; unused.
16649         * xdisp.c: Make symbols static if they're not exported.
16650         * dispextern.h (scratch_glyph_row, window_box_edges):
16651         (glyph_to_pixel_coords, set_cursor_from_row):
16652         (get_next_display_element, set_iterator_to_next):
16653         (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16654         (show_mouse_face): Remove decls
16655         * frame.h (message_buf_print): Likewise.
16656         * lisp.h (pop_message, set_message, check_point_in_composition):
16657         Likewise.
16658         * xterm.h (set_vertical_scroll_bar): Likewise.
16659         * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16660         (message_buf_print, scratch_glyph_row, displayed_buffer):
16661         (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16662         (get_next_display_element, show_mouse_face, window_box_edges):
16663         (frame_to_window_pixel_xy, check_point_in_composition):
16664         (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16665         (glyph_to_pixel_coords): Remove; unused.
16667         * dired.c (file_name_completion): Now static.
16669         * dbusbind.c (xd_in_read_queued_messages): Now static.
16671         * lisp.h (circular_list_error, FOREACH): Remove; unused.
16672         * data.c (circular_list_error): Remove.
16674         * commands.h (last_point_position, last_point_position_buffer):
16675         (last_point_position_window): Remove decls.
16676         * keyboard.c: Make these variables static.
16678         * coding.h (coding, code_convert_region, encode_coding_gap):
16679         Remove decls.
16680         * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16681         (iso_code_class, detect_coding, code_convert_region): Now static.
16682         (encode_coding_gap): Remove; unused.
16684         * chartab.c (chartab_chars, chartab_bits): Now static.
16686         * charset.h (charset_iso_8859_1): Remove decl.
16687         * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16688         Now static.
16690         * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16691         * ccl.c (Vccl_program_table): Now static.
16692         (check_ccl_update): Remove; unused.
16694         * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16695         * category.h: ... from here.
16696         * category.c (check_category_table, set_category_set): Now static.
16698         * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16699         * lisp.h: Remove these decls.
16701         * buffer.c (buffer_count): Remove unused var.
16703         * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16704         so that it's not optimized away.
16705         (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16706         * dispextern.h (bidi_dump_cached_states): Remove, since it's
16707         exported only to the debugger.
16709         * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
16710         * atimer.h (run_all_atimers): Remove; not exported.
16712         font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16713         * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16714         was inaccessible from Lisp.
16715         (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16716         * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16718         alloc.c: Import and export fewer symbols, and remove unused items.
16719         * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16720         is defined.
16721         (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16722         it's not optimized away by whole-program optimization.
16723         (message_enable_multibyte, free_misc): Remove.
16724         (catchlist, handlerlist, mark_backtrace):
16725         Declare only if BYTE_MARK_STACK.
16726         (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16727         * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16728         (message_enable_multibyte): Remove decl.
16729         (free_misc, interval_free_list, float_block, float_block_index):
16730         (n_float_blocks, float_free_list, cons_block, cons_block_index):
16731         (cons_free_list, last_marked_index):
16732         Now static.
16733         (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16734         * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16735         (mark_backtrace): Define only if BYTE_MARK_STACK.
16736         * xdisp.c (message_enable_multibyte): Now static.
16738         Declare Lisp_Object Q* variables to be 'static' if not exported.
16739         This makes it easier for human readers (and static analyzers)
16740         to see whether these variables are used from other modules.
16741         * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16742         * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16743         * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16744         * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16745         * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16746         * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16747         * xmenu.c, xselect.c:
16748         Declare Q* vars static if they are not used in other modules.
16749         * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16750         * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16751         Remove decls of unexported vars.
16752         * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16754         * lisp.h (DEFINE_FUNC): Make sname 'static'.
16756         Make Emacs functions such as Fatom 'static' by default.
16757         This makes it easier for human readers (and static analyzers)
16758         to see whether these functions can be called from other modules.
16759         DEFUN now defines a static function.  To make the function external
16760         so that it can be used in other C modules, use the new macro DEFUE.
16761         * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16762         (Finit_image_library):
16763         (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16764         (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16765         (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16766         Remove decls, since these functions are now static.
16767         (Funintern, Fget_internal_run_time): New decls, since these functions
16768         were already external.
16770         * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16771         * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16772         * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16773         * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16774         * keyboard.c, keymap.c, lread.c:
16775         * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16776         * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16777         * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16778         Mark functions with DEFUE instead of DEFUN,
16779         if they are used in other modules.
16780         * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16781         decls for now-static functions.
16782         * buffer.h (Fdelete_overlay): Remove decl.
16783         * callproc.c (Fgetenv_internal): Mark as internal.
16784         * composite.c (Fremove_list_of_text_properties): Remove decl.
16785         (Fcomposition_get_gstring): New forward static decl.
16786         * composite.h (Fcomposite_get_gstring): Remove decl.
16787         * dired.c (Ffile_attributes): New forward static decl.
16788         * doc.c (Fdocumntation_property): New forward static decl.
16789         * eval.c (Ffetch_bytecode): New forward static decl.
16790         (Funintern): Remove extern decl; now in .h file where it belongs.
16791         * fileio.c (Fmake_symbolic_link): New forward static decl.
16792         * image.c (Finit_image_library): New forward static decl.
16793         * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16794         * intervals.h (Fprevious_property_change):
16795         (Fremove_list_of_text_properties): Remove decls.
16796         * keyboard.c (Fthis_command_keys): Remove decl.
16797         (Fcommand_execute): New forward static decl.
16798         * keymap.c (Flookup_key): New forward static decl.
16799         (Fcopy_keymap): Now static.
16800         * keymap.h (Flookup_key): Remove decl.
16801         * process.c (Fget_process): New forward static decl.
16802         (Fprocess_datagram_address): Mark as internal.
16803         * syntax.c (Fsyntax_table_p): New forward static decl.
16804         (skip_chars): Remove duplicate decl.
16805         * textprop.c (Fprevious_property_change): New forward static decl.
16806         * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16807         Now internal.
16808         (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16809         * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16811         * editfns.c (Fformat): Remove unreachable code.
16813 2011-04-14  Andreas Schwab  <schwab@linux-m68k.org>
16815         * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16816         change.  (Bug#8496)
16818 2011-04-13  Eli Zaretskii  <eliz@gnu.org>
16820         * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16821         when at ZV.  (Bug#8487)
16823 2011-04-12  Andreas Schwab  <schwab@linux-m68k.org>
16825         * charset.c (Fclear_charset_maps): Use xfree instead of free.
16826         (Bug#8437)
16827         * keyboard.c (parse_tool_bar_item): Likewise.
16828         * sound.c (sound_cleanup, alsa_close): Likewise.
16829         * termcap.c (tgetent): Likewise.
16830         * xfns.c (x_default_font_parameter): Likewise.
16831         * xsettings.c (read_and_apply_settings): Likewise.
16833         * alloc.c (overrun_check_malloc, overrun_check_realloc)
16834         (overrun_check_free): Protoize.
16836 2011-04-12  Paul Eggert  <eggert@cs.ucla.edu>
16838         * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16839         since callers should never pass a negative size.
16840         Change the signature to match that of plain 'read' and 'write'; see
16841         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16842         * lisp.h: Update prototypes of emacs_write and emacs_read.
16844 2011-04-11  Eli Zaretskii  <eliz@gnu.org>
16846         * xdisp.c (redisplay_window): Don't try to determine the character
16847         position of the scroll margin if the window start point w->startp
16848         is outside the buffer's accessible region.  (Bug#8468)
16850 2011-04-10  Eli Zaretskii  <eliz@gnu.org>
16852         Fix write-region and its subroutines for buffers > 2GB.
16853         * fileio.c (a_write, e_write): Modify declaration of arguments and
16854         local variables to support buffers larger than 2GB.
16855         (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16857         * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16858         argument, local variables, and return value.
16860         * lisp.h: Update prototypes of emacs_write and emacs_read.
16862         * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16864 2011-04-10  Paul Eggert  <eggert@cs.ucla.edu>
16866         * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16868         Fix more problems found by GCC 4.6.0's static checks.
16870         * xdisp.c (vmessage): Use a better test for character truncation.
16872         * charset.c (load_charset_map): <, not <=, for optimization,
16873         and to avoid potential problems with integer overflow.
16874         * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
16875         * casetab.c (set_identity, shuffle): Likewise.
16876         * editfns.c (Fformat): Likewise.
16877         * syntax.c (skip_chars): Likewise.
16879         * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16880         This also lets GCC 4.6.0 generate slightly better loop code.
16882         * callint.c (Fcall_interactively): <, not <=, for optimization.
16883         (Fcall_interactively): Count the number of arguments produced,
16884         not the number of arguments given.  This is simpler and lets GCC
16885         4.6.0 generate slightly better code.
16887         * ftfont.c: Distingish more carefully between FcChar8 and char.
16888         The previous code passed unsigned char * to a functions like
16889         strlen and xstrcasecmp that expect char *, which does not
16890         conform to the C standard.
16891         (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16892         arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16893         char * when the C standard requires it.
16895         * keyboard.c (read_char): Remove unused var.
16897         * eval.c: Port to Windows vsnprintf (Bug#8435).
16898         Include <limits.h>.
16899         (SIZE_MAX): Define if the headers do not.
16900         (verror): Do not give up if vsnprintf returns a negative count.
16901         Instead, grow the buffer.  This ports to Windows vsnprintf, which
16902         does not conform to C99.  Problem reported by Eli Zaretskii.
16903         Also, simplify the allocation scheme, by avoiding the need for
16904         calling realloc, and removing the ALLOCATED variable.
16906         * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16908         Remove invocations of doprnt, as Emacs now uses vsnprintf.
16909         But keep the doprint source code for now, as we might revamp it
16910         and use it again (Bug#8435).
16911         * lisp.h (doprnt): Remove.
16912         * Makefile.in (base_obj): Remove doprnt.o.
16913         * deps.mk (doprnt.o): Remove.
16915         error: Print 32- and 64-bit integers portably (Bug#8435).
16916         Without this change, on typical 64-bit hosts error ("...%d...", N)
16917         was used to print both 32- and 64-bit integers N, which relied on
16918         undefined behavior.
16919         * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
16920         * lisp.h (error, verror): Mark as printf-like functions.
16921         * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16922         Report overflow in size calculations when allocating printf buffer.
16923         Do not truncate output string at its first null byte.
16924         * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16925         Truncate the output at a character boundary, since vsnprintf does not
16926         do that.
16927         * charset.c (check_iso_charset_parameter): Convert internal
16928         character to string before calling 'error', since %c now has the
16929         printf meaning.
16930         * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16931         overflow when computing char to be passed to 'error'.  Do not
16932         pass Lisp_Object to 'error'; pass the integer instead.
16933         * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16934         formatted with plain %d.
16936         * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16938         * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16940         * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16942         * xterm.c (x_catch_errors): Remove duplicate declaration.
16944         * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16946         * xdisp.c, lisp.h (message_nolog): Remove; unused.
16948 2011-04-10  Jim Meyering  <meyering@redhat.com>
16950         use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16951         * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16952         return ssize_t not "int", and use size_t as the buffer length.
16953         (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16954         * gnutls.h: Update declarations.
16955         * process.c (read_process_output): Use ssize_t, to match.
16956         (send_process): Likewise.
16958 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
16960         * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16962 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
16964         * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16965         Use unsigned char, to match FcChar8 type definition.
16967         * xterm.c (handle_one_xevent):
16968         * xmenu.c (create_and_show_popup_menu):
16969         * xselect.c (x_decline_selection_request)
16970         (x_reply_selection_request): Avoid type-punned deref of X events.
16972 2011-04-09  Eli Zaretskii  <eliz@gnu.org>
16974         Fix some uses of `int' instead of EMACS_INT.
16975         * search.c (string_match_1, fast_string_match)
16976         (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16977         (scan_buffer, find_next_newline_no_quit)
16978         (find_before_next_newline, search_command, Freplace_match)
16979         (Fmatch_data): Make some `int' variables be EMACS_INT.
16981         * xdisp.c (display_count_lines): 3rd argument and return value now
16982         EMACS_INT.  All callers changed.
16983         (pint2hrstr): Last argument is now EMACS_INT.
16985         * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16986         (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16987         (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16988         (decode_coding_utf_16, decode_coding_emacs_mule)
16989         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16990         (decode_coding_ccl, decode_coding_charset)
16991         <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16992         (decode_coding_iso_2022, decode_coding_emacs_mule)
16993         (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16994         <char_offset, last_offset>: Declare EMACS_INT.
16995         (encode_coding_utf_8, encode_coding_utf_16)
16996         (encode_coding_emacs_mule, encode_invocation_designation)
16997         (encode_designation_at_bol, encode_coding_iso_2022)
16998         (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16999         (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
17000         Declare EMACS_INT.
17001         (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
17002         (encode_invocation_designation): Last argument P_NCHARS is now
17003         EMACS_INT.
17004         (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
17005         (produce_chars): from_nchars and to_nchars are now EMACS_INT.
17007         * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
17008         All users changed.
17010         * ccl.c (Fccl_execute_on_string): Declare some variables
17011         EMACS_INT.
17013 2011-04-08  Samuel Thibault  <sthibault@debian.org>  (tiny change)
17015         * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
17017 2011-03-19  Christoph Scholtes  <cschol2112@googlemail.com>
17019         * process.c (Fformat_network_address): Doc fix.
17021 2011-04-08  T.V. Raman  <tv.raman.tv@gmail.com>  (tiny change)
17023         * xml.c (parse_region): Avoid creating spurious whitespace nodes.
17025 2011-04-08  Chong Yidong  <cyd@stupidchicken.com>
17027         * keyboard.c (read_char): Call Lisp function help-form-show,
17028         instead of using internal_with_output_to_temp_buffer.
17029         (Qhelp_form_show): New var.
17030         (syms_of_keyboard): Use DEFSYM macro.
17032         * print.c (internal_with_output_to_temp_buffer): Function deleted.
17034         * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
17036 2011-04-06  Chong Yidong  <cyd@stupidchicken.com>
17038         * process.c (Flist_processes): Remove to Lisp.
17039         (list_processes_1): Delete.
17041 2011-04-06  Eli Zaretskii  <eliz@gnu.org>
17043         * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
17045         * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
17047 2011-04-06  Paul Eggert  <eggert@cs.ucla.edu>
17049         Fix more problems found by GCC 4.6.0's static checks.
17051         * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
17053         * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
17055         * lisp.h (message, message_nolog, fatal): Mark as printf-like.
17057         * xdisp.c (vmessage): Mark as a printf-like function.
17059         * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
17061         * sound.c (sound_warning): Don't crash if arg contains a printf format.
17063         * image.c (tiff_error_handler, tiff_warning_handler): Mark as
17064         printf-like functions.
17065         (tiff_load): Add casts to remove these marks before passing them
17066         to system-supplied API.
17068         * eval.c (Fsignal): Remove excess argument to 'fatal'.
17070         * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
17071         This avoids several warnings with gcc -Wstrict-overflow.
17072         (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
17073         directly, rather than having caller test rule sign.  This avoids
17074         some unnecessary tests.
17075         * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
17076         (COMPOSITION_ENCODE_RULE): Arguments now must be valid.  This
17077         affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
17079         * xfont.c (xfont_text_extents): Remove var that was set but not used.
17080         (xfont_open): Avoid unnecessary tests.
17082         * composite.c (composition_gstring_put_cache): Use unsigned integer.
17084         * composite.h, composite.c (composition_gstring_put_cache):
17085         Use EMACS_INT, not int, for length.
17087         * composite.h (COMPOSITION_DECODE_REFS): New macro,
17088         breaking out part of COMPOSITION_DECODE_RULE.
17089         (COMPOSITION_DECODE_RULE): Use it.
17090         * composite.c (get_composition_id): Remove unused local vars,
17091         by using the new macro.
17093         * textprop.c (set_text_properties_1): Change while to do-while,
17094         since the condition is always true at first.
17096         * intervals.c (graft_intervals_into_buffer): Mark var as used.
17097         (interval_deletion_adjustment): Return unsigned value.
17098         All uses changed.
17100         * process.c (list_processes_1, create_pty, read_process_output):
17101         (exec_sentinel): Remove vars that were set but not used.
17102         (create_pty): Remove unnecessary "volatile"s.
17103         (Fnetwork_interface_info): Avoid possibility of int overflow.
17104         (read_process_output): Do adaptive read buffering even if carryover.
17105         (read_process_output): Simplify nbytes computation if buffered.
17107         * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
17109         * syntax.c (scan_words): Remove var that was set but not used.
17110         (update_syntax_table): Use unsigned instead of int.
17112         * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
17113         (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
17114         (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
17116         * print.c (print_error_message): Avoid int overflow.
17118         * font.c (font_list_entities): Redo for clarity,
17119         so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17121         * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
17122         (font_score): Avoid potential overflow in diff calculation.
17124         * fns.c (substring_both): Remove var that is set but not used.
17125         (sxhash): Redo loop for clarity and to avoid wraparound warning.
17127         * eval.c (funcall_lambda): Rename local to avoid shadowing.
17129         * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17130         Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17131         can always succeed if overflow has undefined behavior.
17133         * search.c (boyer_moore, wordify): Remove vars set but not used.
17134         (wordify): Omit three unnecessary tests.
17136         * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
17137         All callers changed.  This avoids the need for an unused var.
17139         * casefiddle.c (casify_region): Remove var that is set but not used.
17141         * dired.c (file_name_completion): Remove var that is set but not used.
17143         * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17145         * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
17146         (Finsert_file_contents): Remove unnecessary code checking fd.
17148         * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17149         Check for integer overflow on size calculations.
17151         * buffer.c (Fprevious_overlay_change): Remove var that is set
17152         but not used.
17154         * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17155         Remove vars that are set but not used.
17156         (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
17157         (timer_check_2): Mark vars as initialized.
17159         * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17161         * image.c (lookup_image): Remove var that is set but not used.
17162         (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
17164         * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17165         that are set but not used.
17167         * xfns.c (make_invisible_cursor): Don't return garbage
17168         if XCreateBitmapFromData fails (Bug#8410).
17170         * xselect.c (x_get_local_selection, x_handle_property_notify):
17171         Remove vars that are set but not used.
17173         * xfns.c (x_create_tip_frame): Remove var that is set but not used.
17174         (make_invisible_cursor): Initialize a possibly-uninitialized variable.
17176         * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17177         Remove var that is set but not used.
17178         (scroll_bar_windows_size): Now size_t, not int.
17179         (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17180         Check for overflow.
17182         * xfaces.c (realize_named_face): Remove vars that are set but not used.
17183         (map_tty_color) [!defined MSDOS]: Likewise.
17185         * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17187         * coding.c: Remove vars that are set but not used.
17188         (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17189         All callers changed.
17190         (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17191         (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17192         (decode_coding_charset): Remove vars that are set but not used.
17194         * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17195         that is set but not used.
17197         * print.c (print_object): Remove var that is set but not used.
17199         Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
17200         The gnulib version avoids calling malloc in the usual case,
17201         and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17202         * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17203         * filelock.c (current_lock_owner): Likewise.
17204         * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17205         * sysdep.c: Include allocator.h, careadlinkat.h.
17206         (emacs_no_realloc_allocator): New static constant.
17207         (emacs_readlink): New function.
17208         * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17209         ../lib/careadlinkat.h.
17211 2011-04-04  Stefan Monnier  <monnier@iro.umontreal.ca>
17213         * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17214         first non-nil return value).
17216 2011-04-03  Jan Djärv  <jan.h.d@swipnet.se>
17218         * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17219         if not defined (Bug#8403).
17221 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
17223         * xdisp.c (display_count_lines): Remove parameter `start',
17224         unused since 1998-01-01T02:27:27Z!rms@gnu.org.  All callers changed.
17225         (get_char_face_and_encoding): Remove parameter `multibyte_p',
17226         unused since 2008-05-14T01:40:23Z!handa@m17n.org.  All callers changed.
17227         (fill_stretch_glyph_string): Remove parameters `row' and `area',
17228         unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17229         and thereabouts.  All callers changed.
17230         (get_per_char_metric): Remove parameter `f', unused since
17231         2008-05-14T01:40:23Z!handa@m17n.org.  All callers changed.
17233 2011-04-02  Jim Meyering  <meyering@redhat.com>
17235         do not dereference NULL upon failed strdup
17236         * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17237         (ns_get_family): Likewise.
17239 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
17241         * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17243 2011-04-02  Jan Djärv  <jan.h.d@swipnet.se>
17245         * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17246         later (Bug#8403).
17248 2011-04-01  Stefan Monnier  <monnier@iro.umontreal.ca>
17250         Add lexical binding.
17252         * window.c (Ftemp_output_buffer_show): New fun.
17253         (Fsave_window_excursion):
17254         * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17256         * lread.c (lisp_file_lexically_bound_p): New function.
17257         (Fload): Bind Qlexical_binding.
17258         (readevalloop): Remove `evalfun' arg.
17259         Bind Qinternal_interpreter_environment.
17260         (Feval_buffer): Bind Qlexical_binding.
17261         (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17262         Mark as dynamic.
17263         (syms_of_lread): Declare `lexical-binding'.
17265         * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17267         * keyboard.c (eval_dyn): New fun.
17268         (menu_item_eval_property): Use it.
17270         * image.c (parse_image_spec): Use Ffunctionp.
17272         * fns.c (concat, mapcar1): Accept byte-code-functions.
17274         * eval.c (Fsetq): Handle lexical vars.
17275         (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17276         (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17277         (FletX, Flet): Obey lexical binding.
17278         (Fcommandp): Handle closures.
17279         (Feval): New `lexical' arg.
17280         (eval_sub): New function extracted from Feval.  Use it almost
17281         everywhere where Feval was used.  Look up vars in lexical env.
17282         Handle closures.
17283         (Ffunctionp): Move from subr.el.
17284         (Ffuncall): Handle closures.
17285         (apply_lambda): Remove `eval_flags'.
17286         (funcall_lambda): Handle closures and new byte-code-functions.
17287         (Fspecial_variable_p): New function.
17288         (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17289         but without exporting it to Lisp.
17291         * doc.c (Fdocumentation, store_function_docstring):
17292         * data.c (Finteractive_form): Handle closures.
17294         * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17295         interactive spec.
17297         * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17298         New byte-codes.
17299         (exec_byte_code): New function extracted from Fbyte_code to handle new
17300         calling convention for byte-code-functions.  Add new byte-codes.
17302         * buffer.c (defvar_per_buffer): Set new `declared_special' field.
17304         * alloc.c (Fmake_symbol): Init new `declared_special' field.
17306 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
17308         * xdisp.c (redisplay_internal): Fix prototype.
17310 2011-03-31  Eli Zaretskii  <eliz@gnu.org>
17312         * xdisp.c (SCROLL_LIMIT): New macro.
17313         (try_scrolling): Use it when setting scroll_limit.
17314         Limit scrolling to 100 screen lines.
17315         (redisplay_window): Even when falling back on "recentering",
17316         position point in the window according to scroll-conservatively,
17317         scroll-margin, and scroll-*-aggressively variables.  (Bug#6671)
17319         (try_scrolling): When point is above the window, allow searching
17320         as far as scroll_max, or one screenful, to compute vertical
17321         distance from PT to the scroll margin position.  This prevents
17322         try_scrolling from unnecessarily failing when
17323         scroll-conservatively is set to a value slightly larger than the
17324         window height.  Clean up the case of PT below the margin at bottom
17325         of window: scroll_max can no longer be INT_MAX.  When aggressive
17326         scrolling is in use, don't let point enter the opposite scroll
17327         margin as result of the scroll.
17328         (syms_of_xdisp) <scroll-conservatively>: Document the
17329         threshold of 100 lines for never-recentering scrolling.
17331 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
17333         * dispextern.h (move_it_by_lines):
17334         * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17335         since 2000-12-29T14:24:09Z!gerd@gnu.org.  All callers changed.
17336         (message_log_check_duplicate): Remove parameters `prev_bol' and
17337         `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org.  All callers changed.
17338         (redisplay_internal): Remove parameter `preserve_echo_area',
17339         unused since 1999-07-21T21:43:52Z!gerd@gnu.org.  All callers changed.
17341         * indent.c (Fvertical_motion):
17342         * window.c (window_scroll_pixel_based, Frecenter):
17343         Don't pass `need_y_p' to `move_it_by_lines'.
17345 2011-03-30  Stefan Monnier  <monnier@iro.umontreal.ca>
17347         * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17348         steal a few bits to be more compact.
17349         (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17350         Remove unneeded casts.
17352         * bytecode.c (Fbyte_code): CAR and CDR can GC.
17354 2011-03-30  Zachary Kanfer  <zkanfer@gmail.com>  (tiny change)
17356         * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17357         binding" message (bug#7967).
17359 2011-03-30  Paul Eggert  <eggert@cs.ucla.edu>
17361         Fix more problems found by GCC 4.6.0's static checks.
17363         * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17364         Remove unused local var.
17366         * editfns.c (Fmessage_box): Remove unused local var.
17368         * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17369         (note_mode_line_or_margin_highlight, note_mouse_highlight):
17370         Omit unused local vars.
17371         * window.c (shrink_windows): Omit unused local var.
17372         * menu.c (digest_single_submenu): Omit unused local var.
17373         * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17374         Omit unused local var.
17376         * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17377         Don't assume string length fits in int.
17378         (keyremap_step, read_key_sequence): Use size_t for sizes.
17379         (read_key_sequence): Don't check last_real_key_start redundantly.
17381         * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17382         instead of alloca (Bug#8344).
17384         * eval.c (Fbacktrace): Don't assume nargs fits in int.
17385         (Fbacktrace_frame): Don't assume nframes fits in int.
17387         * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17389         * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17390         concerns.
17392         * term.c (produce_glyphless_glyph): Remove unnecessary test.
17394         * cm.c (calccost): Turn while-do into do-while, for clarity.
17396         * keyboard.c (syms_of_keyboard): Use the same style as later
17397         in this function when indexing through an array.  This also
17398         works around GCC bug 48267.
17400         * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17402         * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17404         * chartab.c (sub_char_table_ref_and_range): Redo for slight
17405         efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17407         * keyboard.c, keyboard.h (num_input_events): Now size_t.
17408         This avoids undefined behavior on integer overflow, and is a bit
17409         more convenient anyway since it is compared to a size_t variable.
17411         Variadic C functions now count arguments with size_t, not int.
17412         This avoids an unnecessary limitation on 64-bit machines, which
17413         caused (substring ...) to crash on large vectors (Bug#8344).
17414         * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17415         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
17416         All variadic functions and their callers changed accordingly.
17417         (struct gcpro.nvars): Now size_t, not int.  All uses changed.
17418         * data.c (arith_driver, float_arith_driver): Likewise.
17419         * editfns.c (general_insert_function): Likewise.
17420         * eval.c (struct backtrace.nargs, interactive_p)
17421         (internal_condition_case_n, run_hook_with_args, apply_lambda)
17422         (funcall_lambda, mark_backtrace): Likewise.
17423         * fns.c (concat): Likewise.
17424         * frame.c (x_set_frame_parameters): Likewise.
17425         * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17426         0 if not found, not -1.  All callers changed.
17428         * alloc.c (garbage_collect): Don't assume stack size fits in int.
17429         (stack_copy_size): Now size_t, not int.
17430         (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17432 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
17434         * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17435         unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17436         All callers changed.
17438         * lisp.h (multibyte_char_to_unibyte):
17439         * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17440         unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17441         * character.h (CHAR_TO_BYTE8):
17442         * cmds.c (internal_self_insert):
17443         * editfns.c (general_insert_function):
17444         * keymap.c (push_key_description):
17445         * search.c (Freplace_match):
17446         * xdisp.c (message_dolog, set_message_1): All callers changed.
17448 2011-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
17450         * keyboard.c (safe_run_hook_funcall): New function.
17451         (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17452         don't set the hook to nil, but remove the offending function instead.
17453         (Qcommand_hook_internal): Remove, unused.
17454         (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17455         Vcommand_hook_internal.
17457         * eval.c (enum run_hooks_condition): Remove.
17458         (funcall_nil, funcall_not): New functions.
17459         (run_hook_with_args): Call each function through a `funcall' argument.
17460         Remove `cond' argument, now redundant.
17461         (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17462         (Frun_hook_with_args_until_failure): Adjust accordingly.
17463         (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17465 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
17467         * dispextern.h (string_buffer_position): Remove declaration.
17469         * print.c (strout): Remove parameter `multibyte', unused since
17470         1999-08-21T19:30:21Z!gerd@gnu.org.  All callers changed.
17472         * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17473         never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17474         All callers changed.
17476         * w32.c (_wsa_errlist): Use braces for struct initializers.
17478         * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17479         never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17480         All callers changed.
17481         (string_buffer_position): Likewise.  Also, make static (it's never
17482         used outside xdisp.c).
17483         (cursor_row_p): Remove parameter `w', unused since
17484         2000-10-17T16:08:57Z!gerd@gnu.org.  All callers changed.
17485         (decode_mode_spec): Remove parameter `precision', introduced during
17486         Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17487         All callers changed.
17489 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
17491         * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17493 2011-03-27  Anders Lindgren  <andlind@gmail.com>
17495         * nsterm.m (ns_menu_bar_is_hidden): New variable.
17496         (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17497         (ns_update_auto_hide_menu_bar): New functions.
17498         (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17499         (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17500         ns_constrain_all_frames.
17501         (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17502         (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17504 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
17506         * nsmenu.m (runDialogAt): Remove argument to timer_check.
17508 2011-03-27  Glenn Morris  <rgm@gnu.org>
17510         * syssignal.h: Replace RETSIGTYPE with void.
17511         * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17512         * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17513         Replace SIGTYPE with void everywhere.
17514         * s/usg5-4-common.h (SIGTYPE): Remove definition.
17515         * s/template.h (SIGTYPE): Remove commented out definition.
17517 2011-03-26  Eli Zaretskii  <eliz@gnu.org>
17519         * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17520         flag as a prerequisite for invoking try_scrolling.  (Bug#6671)
17522 2011-03-26  Juanma Barranquero  <lekktu@gmail.com>
17524         * w32.c (read_unc_volume): Use parameter `henum', instead of
17525         global variable `wget_enum_handle'.
17527         * keymap.c (describe_vector): Remove parameters `indices' and
17528         `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17529         (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17531         * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17533         * keyboard.c (timer_check): Remove parameter `do_it_now',
17534         unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17535         (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17536         unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17538         * keyboard.c (read_char):
17539         * w32menu.c (w32_menu_display_help):
17540         * xmenu.c (show_help_event, menu_help_callback):
17541         Adjust calls to `show_help_echo'.
17543         * gtkutil.c (xg_maybe_add_timer):
17544         * keyboard.c (readable_events):
17545         * process.c (wait_reading_process_output):
17546         * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17548         * insdel.c (adjust_markers_gap_motion):
17549         Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17550         (gap_left, gap_right): Don't call it.
17552 2011-03-25  Chong Yidong  <cyd@stupidchicken.com>
17554         * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17555         incurred during fontification.
17557 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
17559         * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17560         (DEFVAR_PER_BUFFER): Don't pass it.
17562         * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17563         (scrolling_window): Don't pass it.
17565 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
17567         * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17569         * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17570         and `suffix'.
17571         (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17572         of variables specific to SELinux and computation of `encoded_absname'.
17574         * image.c (XPutPixel): Remove unused variable `height'.
17576         * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17578         * unexw32.c (get_section_info): Remove unused variable `section'.
17580         * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17581         (system_process_attributes): Remove unused variable `sess'.
17582         (sys_read): Remove unused variable `err'.
17584         * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17585         (w32_wnd_proc): Remove unused variable `isdead'.
17586         (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17587         (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17588         (x_create_tip_frame): Remove unused variable `tem'.
17590         * w32inevt.c (w32_console_read_socket):
17591         Remove unused variable `no_events'.
17593         * w32term.c (x_draw_composite_glyph_string_foreground):
17594         Remove unused variable `width'.
17596 2011-03-24  Juanma Barranquero  <lekktu@gmail.com>
17598         * w32term.c (x_set_glyph_string_clipping):
17599         Don't pass uninitialized region to CombineRgn.
17601 2011-03-23  Juanma Barranquero  <lekktu@gmail.com>
17603         * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17604         (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17605         (Fx_close_connection): Remove unused variable `i'.
17607         * w32font.c (w32font_draw): Return number of glyphs.
17608         (w32font_open_internal): Remove unused variable `i'.
17609         (w32font_driver): Add missing initializer.
17611         * w32menu.c (utf8to16): Remove unused variable `utf16'.
17612         (fill_in_menu): Remove unused variable `items_added'.
17614         * w32term.c (last_mouse_press_frame): Remove static global variable.
17615         (w32_clip_to_row): Remove unused variable `f'.
17616         (x_delete_terminal): Remove unused variable `i'.
17618         * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17619         (NOTHING): Remove unused static global variable.
17620         (uniscribe_check_otf): Remove unused variable `table'.
17621         (uniscribe_font_driver): Add missing initializers.
17623 2011-03-23  Julien Danjou  <julien@danjou.info>
17625         * term.c (Fsuspend_tty, Fresume_tty):
17626         * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17627         * window.c (temp_output_buffer_show):
17628         * insdel.c (signal_before_change):
17629         * frame.c (Fhandle_switch_frame):
17630         * fileio.c (Fdo_auto_save):
17631         * emacs.c (Fkill_emacs):
17632         * editfns.c (save_excursion_restore):
17633         * cmds.c (internal_self_insert):
17634         * callint.c (Fcall_interactively):
17635         * buffer.c (Fkill_all_local_variables):
17636         * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17637         Use Frun_hooks.
17638         (command_loop_1): Use Frun_hooks.  Call safe_run_hooks
17639         unconditionally since it does the check itself.
17641 2011-03-23  Paul Eggert  <eggert@cs.ucla.edu>
17643         Fix more problems found by GCC 4.5.2's static checks.
17645         * coding.c (encode_coding_raw_text): Avoid unnecessary test
17646         the first time through the loop, since we know p0 < p1 then.
17647         This also avoids a gcc -Wstrict-overflow warning.
17649         * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17650         leading to a memory leak, possible in functions like
17651         load_charset_map_from_file that can allocate an unbounded number
17652         of objects (Bug#8318).
17654         * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17655         that could (at least in theory) be that large.
17657         * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17658         This is less likely to overflow, and avoids undefined behavior if
17659         overflow does occur.  All callers changed.  Use strtoul to scan
17660         for the unsigned long integer.
17661         (pint2hrstr): Simplify and tune code slightly.
17662         This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
17664         * scroll.c (do_scrolling): Work around GCC bug 48228.
17665         See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17667         * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17668         This also avoids a warning with gcc -Wstrict-overflow.
17669         (validate_x_resource_name): Simplify count usage.
17670         This also avoids a warning with gcc -Wstrict-overflow.
17672         * fileio.c (Fcopy_file): Report error if fchown or fchmod
17673         fail (Bug#8306).
17675         * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
17677         * process.c (Fmake_network_process): Use socklen_t, not int,
17678         where POSIX says socklen_t is required in portable programs.
17679         This fixes a porting bug on hosts like 64-bit HP-UX, where
17680         socklen_t is wider than int (Bug#8277).
17681         (Fmake_network_process, server_accept_connection):
17682         (wait_reading_process_output, read_process_output):
17683         Likewise.
17685         * process.c: Rename or move locals to avoid shadowing.
17686         (list_processes_1, Fmake_network_process):
17687         (read_process_output_error_handler, exec_sentinel_error_handler):
17688         Rename or move locals.
17689         (Fmake_network_process): Define label "retry_connect" only if needed.
17690         (Fnetwork_interface_info): Fix pointer signedness.
17691         (process_send_signal): Add cast to avoid pointer signedness problem.
17692         (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
17693         (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
17695         Make tparam.h and terminfo.c consistent.
17696         * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17697         Include tparam.h instead, since it declares them.
17698         * cm.h (PC): Remove extern decl; tparam.h now does this.
17699         * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17700         * terminfo.c: Include tparam.h, to check interfaces.
17701         (tparm): Make 1st arg a const pointer in decl.  Put it at top level.
17702         (tparam): Adjust signature to match interface in tparam.h;
17703         this removes some undefined behavior.  Check that outstring and len
17704         are zero, which they always are with Emacs.
17705         * tparam.h (PC, BC, UP): New extern decls.
17707         * xftfont.c (xftfont_shape): Now static, and defined only if needed.
17708         (xftfont_open): Rename locals to avoid shadowing.
17710         * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
17711         (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17712         (OTF_TAG_SYM): Omit macro if not needed.
17713         (ftfont_list): Remove unused local.
17714         (get_adstyle_property, ftfont_pattern_entity):
17715         (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17716         Rename locals to avoid shadowing.
17718         * xfont.c (xfont_list_family): Mark var as initialized.
17720         * xml.c (make_dom): Now static.
17722         * composite.c (composition_compute_stop_pos): Rename local to
17723         avoid shadowing.
17724         (composition_reseat_it): Remove unused locals.
17725         (find_automatic_composition, composition_adjust_point): Likewise.
17726         (composition_update_it): Mark var as initialized.
17727         (find_automatic_composition): Mark vars as initialized,
17728         with a FIXME (Bug#8290).
17730         character.h: Rename locals to avoid shadowing.
17731         * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17732         (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17733         (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17734         (BUF_DEC_POS): Be more systematic about renaming local temporaries
17735         to avoid shadowing.
17737         * textprop.c (property_change_between_p): Remove; unused.
17739         * intervals.c (interval_start_pos): Now static.
17741         * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17743         * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17744         Rename locals to avoid shadowing.
17746         * sound.c (wav_play, au_play, Fplay_sound_internal):
17747         Fix pointer signedness.
17748         (alsa_choose_format): Remove unused local var.
17749         (wav_play): Initialize a variable to 0, to prevent undefined
17750         behavior (Bug#8278).
17752         * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17754         * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17756         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17757         clobbering (Bug#8298).
17758         * sysdep.c (sys_subshell): Likewise.
17759         Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
17761         * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17762         This should get cleaned up, so that child_setup has the
17763         same signature on all platforms.
17765         * callproc.c (call_process_cleanup): Now static.
17766         (relocate_fd): Rename locals to avoid shadowing.
17768 2011-03-22  Chong Yidong  <cyd@stupidchicken.com>
17770         * xterm.c (x_clear_frame): Remove XClearWindow call.  This appears
17771         not to be necessary, and produces flickering.
17773 2011-03-20  Glenn Morris  <rgm@gnu.org>
17775         * config.in: Remove file.
17777 2011-03-20  Juanma Barranquero  <lekktu@gmail.com>
17779         * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17780         are now in src/globals.h.
17781         (syms_of_minibuf): Remove spurious & from previous change.
17783 2011-03-20  Leo Liu  <sdl.web@gmail.com>
17785         * minibuf.c (completing-read-function): New variable.
17786         (completing-read-default): Rename from completing-read.
17787         (completing-read): Call completing-read-function.
17789 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
17791         * xfaces.c (Fx_load_color_file):
17792         Read color file from absolute filename (bug#8250).
17794 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
17796         * makefile.w32-in: Update dependencies.
17798 2011-03-17  Eli Zaretskii  <eliz@gnu.org>
17800         * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17802 2011-03-17  Paul Eggert  <eggert@cs.ucla.edu>
17804         Fix more problems found by GCC 4.5.2's static checks.
17806         * process.c (make_serial_process_unwind, send_process_trap):
17807         (sigchld_handler): Now static.
17809         * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17810         That way, the code declares only the vars that it needs.
17811         * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17812         * s/cygwin.h (PTY_ITERATION): Likewise.
17813         * s/darwin.h (PTY_ITERATION): Likewise.
17814         * s/gnu-linux.h (PTY_ITERATION): Likewise.
17816         * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17817         * process.c (allocate_pty): Don't declare stb unless it's needed.
17819         * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
17820         (CONSTANTLIM): Remove; unused.
17821         (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17822         Define only if needed.
17824         * unexelf.c (unexec): Name an expression,
17825         to avoid gcc -Wbad-function-cast warning.
17826         Use a different way to cause a compilation error if anyone uses
17827         n rather than nn, a way that does not involve shadowing.
17828         (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
17830         * deps.mk (unexalpha.o): Remove; unused.
17832         New file unexec.h, the (simple) interface for unexec (Bug#8267).
17833         * unexec.h: New file.
17834         * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17835         (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17836         Depend on unexec.h.
17837         * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17838         * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17839         * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
17840         Change as necessary to match prototype in unexec.h.
17842         * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17843         shadowing.
17844         (back_comment, skip_chars): Mark vars as initialized.
17846         * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17847         Rename locals to avoid shadowing.
17849         * lread.c (read1): Rewrite so as not to use empty "else".
17850         (Fload, readevalloop, read1): Rename locals to avoid shadowing.
17852         * print.c (Fredirect_debugging_output): Fix pointer signedess.
17854         * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17855         warning when compiling print.c.
17857         * font.c (font_unparse_fcname): Abort in an "impossible" situation
17858         instead of using an uninitialized var.
17859         (font_sort_entities): Mark var as initialized.
17861         * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17863         * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17864         pointers to constants.
17865         (font_parse_fcname): Remove unused vars.
17866         (font_delete_unmatched): Now static.
17867         (font_get_spec): Remove; unused.
17868         (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17869         (font_update_drivers, Ffont_get_glyphs, font_add_log):
17870         Rename or move locals to avoid shadowing.
17872         * fns.c (require_nesting_list, require_unwind): Now static.
17873         (Ffillarray): Rename locals to avoid shadowing.
17875         * floatfns.c (domain_error2): Define only if needed.
17876         (Ffrexp, Fldexp): Rename locals to avoid shadowing.
17878         * alloc.c (mark_backtrace): Move decl from here ...
17879         * lisp.h: ... to here, so that it can be checked.
17881         * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
17882         (Fdefvar): Rewrite so as not to use empty "else".
17883         (lisp_indirect_variable): Name an expression,
17884         to avoid gcc -Wbad-function-cast warning.
17885         (Fdefvar): Rename locals to avoid shadowing.
17887         * callint.c (quotify_arg, quotify_args): Now static.
17888         (Fcall_interactively): Rename locals to avoid shadowing.
17889         Use const pointer when appropriate.
17891         * lisp.h (get_system_name, get_operating_system_release):
17892         Move decls here, to check interfaces.
17893         * process.c (get_operating_system_release): Move decl to lisp.h.
17894         * xrdb.c (get_system_name): Likewise.
17895         * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17896         (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17897         some of which prompt warnings from gcc -Wbad-function-cast.
17898         (Fformat_time_string, Fencode_time, Finsert_char):
17899         (Ftranslate_region_internal, Fformat):
17900         Rename or remove local vars to avoid shadowing.
17901         (Ftranslate_region_internal): Mark var as initialized.
17903         * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17904         avoid shadowing.
17906         * lisp.h (eassert): Check that the argument compiles, even if
17907         ENABLE_CHECKING is not defined.
17909         * data.c (Findirect_variable): Name an expression, to avoid
17910         gcc -Wbad-function-cast warning.
17911         (default_value, arithcompare, arith_driver, arith_error): Now static.
17912         (store_symval_forwarding): Rename local to avoid shadowing.
17913         (Fmake_variable_buffer_local, Fmake_local_variable):
17914         Mark variables as initialized.
17915         (do_blv_forwarding, do_symval_forwarding): Remove; unused.
17917         * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
17918         (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17919         Rename locals to avoid shadowing.
17920         (mark_stack): Move local variables into the #ifdef region where
17921         they're used.
17922         (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17923         ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17924         needed otherwise.
17925         (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17926         (GC_STRING_CHARS): Remove; not used.
17927         (Fmemory_limit): Cast sbrk's returned value to char *.
17929         * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17930         avoids undefined behavior in theory.
17932         * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17934         Use functions, not macros, for up- and down-casing (Bug#8254).
17935         * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17936         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove.  All callers changed
17937         to use the following functions instead of these macros.
17938         (downcase): Adjust to lack of DOWNCASE_TABLE.  Return int, not
17939         EMACS_INT, since callers assume the returned value fits in int.
17940         (upcase1): Likewise, for UPCASE_TABLE.
17941         (uppercasep, lowercasep, upcase): New static inline functions.
17942         * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
17943         the race-condition problem in the old DOWNCASE.
17945         * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17946         Rename locals to avoid shadowing.
17947         (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
17948         (regex_compile, re_search_2, re_match_2_internal):
17949         Remove unused local vars.
17950         (FREE_VAR): Rewrite so as not to use empty "else",
17951         which gcc can warn about.
17952         (regex_compile, re_match_2_internal): Mark locals as initialized.
17953         (RETALLOC_IF): Define only if needed.
17954         (WORDCHAR_P): Likewise.  This one is never needed, but is used
17955         only in a comment talking about a compiler bug, so put inside
17956         the #if 0 of that comment.
17957         (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17958         (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17959         Remove; unused.
17961         * search.c (boyer_moore): Rename locals to avoid shadowing.
17962         * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17963         (PREV_CHAR_BOUNDARY): Likewise.
17965         * search.c (simple_search): Remove unused var.
17967         * dired.c (compile_pattern): Move decl from here ...
17968         * lisp.h: ... to here, so that it can be checked.
17969         (struct re_registers): New forward decl.
17971         * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17973         * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17974         All uses changed.
17975         (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17976         Rename locals to avoid shadowing.
17977         (Fvertical_motion): Mark locals as initialized.
17979         * casefiddle.c (casify_object, casify_region): Now static.
17980         (casify_region): Mark local as initialized.
17982         * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17984         * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17985         New macros, so that the caller can use some names other than
17986         gcpro1, gcpro2, etc.
17987         (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17988         of the new macros.
17989         (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17990         argument, for consistency with GCPRO2_VAR, etc: it is now the
17991         prefix of the variable, not the variable itself.  All uses
17992         changed.
17993         * dired.c (directory_files_internal, file_name_completion):
17994         Rename locals to avoid shadowing.
17996         Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17997         An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17998         dired.c's scmp function, had undefined behavior.
17999         * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18000         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
18001         * buffer.h: ... to here, because these macros use current_buffer,
18002         and the new implementation with inline functions needs to have
18003         current_buffer in scope now, rather than later when the macros
18004         are used.
18005         (downcase, upcase1): New static inline functions.
18006         (DOWNCASE, UPCASE1): Reimplement using these functions.
18007         This avoids undefined behavior in expressions like
18008         DOWNCASE (x) == DOWNCASE (y), which previously suffered
18009         from race conditions in accessing the global variables
18010         case_temp1 and case_temp2.
18011         * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
18012         * lisp.h (case_temp1, case_temp2): Remove their decls.
18013         * character.h (ASCII_CHAR_P): Move from here ...
18014         * lisp.h: ... to here, so that the inline functions mentioned
18015         above can use them.
18017         * dired.c (directory_files_internal_unwind): Now static.
18019         * fileio.c (file_name_as_directory, directory_file_name):
18020         (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
18021         Now static.
18022         (file_name_as_directory): Use const pointers when appropriate.
18023         (Fexpand_file_name): Likewise.  In particular, newdir might
18024         point at constant storage, so make it a const pointer.
18025         (Fmake_directory_internal, Fread_file_name): Remove unused vars.
18026         (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
18027         signedness issues.
18028         (Fset_file_times, Finsert_file_contents, auto_save_error):
18029         Rename locals to avoid shadowing.
18031         * minibuf.c (choose_minibuf_frame_1): Now static.
18032         (Ftry_completion, Fall_completions): Rename or remove locals
18033         to avoid shadowing.
18035         * marker.c (bytepos_to_charpos): Remove; unused.
18037         * lisp.h (verify_bytepos, count_markers): New decls,
18038         so that gcc does not warn that these functions aren't declared.
18040         * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
18041         (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
18042         (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
18043         (copy_text): Remove unused local var.
18045         * filelock.c (within_one_second): Now static.
18046         (lock_file_1): Rename local to avoid shadowing.
18048         * buffer.c (fix_overlays_before): Mark locals as initialized.
18049         (fix_start_end_in_overlays): Likewise.  This function should be
18050         simplified by using pointers-to-pointers, but that's a different
18051         matter.
18052         (switch_to_buffer_1): Now static.
18053         (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
18054         (report_overlay_modification): Rename locals to avoid shadowing.
18056         * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
18057         Fix pointer signedness issue.
18058         (sys_subshell): Mark local as volatile if checking for lint,
18059         to suppress a gcc -Wclobbered warning that does not seem to be right.
18060         (MAXPATHLEN): Define only if needed.
18062         * process.c (serial_open, serial_configure): Move decls from here ...
18063         * systty.h: ... to here, so that they can be checked.
18065         * fns.c (get_random, seed_random): Move extern decls from here ...
18066         * lisp.h: ... to here, so that they can be checked.
18068         * sysdep.c (reset_io): Now static.
18069         (wait_for_termination_signal): Remove; unused.
18071         * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
18072         (copy_keymap_item, append_key, push_text_char_description):
18073         Now static.
18074         (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
18075         (DENSE_TABLE_SIZE): Remove; unused.
18076         (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
18077         (describe_map_tree):
18078         Rename locals to avoid shadowing.
18080         * keyboard.c: Declare functions static if they are not used elsewhere.
18081         (echo_char, echo_dash, cmd_error, top_level_2):
18082         (poll_for_input, handle_async_input): Now static.
18083         (read_char, kbd_buffer_get_event, make_lispy_position):
18084         (make_lispy_event, make_lispy_movement, apply_modifiers):
18085         (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
18086         (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
18087         (Fread_key_sequence_vector): Rename locals to avoid shadowing.
18088         (read_key_sequence, read_char): Mark locals as initialized.
18089         (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
18091         * keyboard.h (make_ctrl_char): New decl.
18092         (mark_kboards): Move decl here ...
18093         * alloc.c (mark_kboards): ... from here.
18095         * lisp.h (force_auto_save_soon): New decl.
18097         * emacs.c (init_cmdargs): Rename local to avoid shadowing.
18098         (DEFINE_DUMMY_FUNCTION): New macro.
18099         (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
18100         Use it.
18101         (main): Add casts to avoid warnings
18102         if GCC considers string literals to be constants.
18104         * lisp.h (fatal_error_signal): Add decl, since it's exported.
18106         * dbusbind.c: Pointer signedness fixes.
18107         (xd_signature, xd_append_arg, xd_initialize):
18108         (Fdbus_call_method, Fdbus_call_method_asynchronously):
18109         (Fdbus_method_return_internal, Fdbus_method_error_internal):
18110         (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18111         (Fdbus_register_signal): Use SSDATA when the context wants char *.
18113         * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18114         if GCC considers string literals to be constants.
18115         (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
18117 2011-03-16  Stefan Monnier  <monnier@iro.umontreal.ca>
18119         * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18120         (print_preprocess, print_object): New macro to fix last change.
18122         * print.c (print_preprocess): Don't forget font objects.
18124 2011-03-16  Juanma Barranquero  <lekktu@gmail.com>
18126         * emacs.c (USAGE3): Doc fixes.
18128 2011-03-15  Andreas Schwab  <schwab@linux-m68k.org>
18130         * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18131         structure.
18133 2011-03-14  Juanma Barranquero  <lekktu@gmail.com>
18135         * lisp.h (VWindow_system, Qfile_name_history):
18136         * keyboard.h (lispy_function_keys) [WINDOWSNT]:
18137         * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
18138         (w32_system_caret_x, w32_system_caret_y): Declare extern.
18140         * w32select.c: Don't #include "keyboard.h".
18141         (run_protected): Add extern declaration for waiting_for_input.
18143         * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18144         * w32console.c (detect_input_pending, read_input_pending)
18145         (encode_terminal_code):
18146         * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18147         (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18148         (w32_system_caret_y, Qfile_name_history):
18149         * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18150         * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18151         * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18152         (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18153         * w32proc.c (Qlocal, report_file_error):
18154         * w32term.c (Vwindow_system, updating_frame):
18155         * w32uniscribe.c (initialized, uniscribe_font_driver):
18156         Remove unneeded extern declarations.
18158 2011-03-14  Chong Yidong  <cyd@stupidchicken.com>
18160         * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
18162 2011-03-13  Chong Yidong  <cyd@stupidchicken.com>
18164         * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18165         (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18166         These macros can no longer be used for assignment.
18168         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18169         Assign struct members directly, instead of using BUF_BEGV etc.
18170         (record_buffer_markers, fetch_buffer_markers): New functions for
18171         recording and fetching special buffer markers.
18172         (set_buffer_internal_1, set_buffer_temp): Use them.
18174         * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18176         * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18178         * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18179         (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18181         * xdisp.c (hscroll_window_tree):
18182         (reconsider_clip_changes): Use PT instead of BUF_PT.
18184 2011-03-13  Eli Zaretskii  <eliz@gnu.org>
18186         * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18187         $(EMACS_ROOT)/lib/intprops.h.
18189 2011-03-13  Paul Eggert  <eggert@cs.ucla.edu>
18191         Fix more problems found by GCC 4.5.2's static checks.
18193         * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18194         to unsigned char * to avoid compiler diagnostic.
18195         (xg_free_frame_widgets): Make it clear that a local variable is
18196         needed only if USE_GTK_TOOLTIP.
18197         (gdk_window_get_screen): Make it clear that this macro is needed
18198         only if USE_GTK_TOOLTIP.
18199         (int_gtk_range_get_value): New function, which avoids a diagnostic
18200         from gcc -Wbad-function-cast.
18201         (xg_set_toolkit_scroll_bar_thumb): Use it.
18202         (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18203         diagnostic from gcc -Wbad-function-cast.
18204         (get_utf8_string, xg_get_file_with_chooser):
18205         Rename locals to avoid shadowing.
18206         (create_dialog): Move locals to avoid shadowing.
18208         * xgselect.c (xg_select): Remove unused var.
18210         * image.c (four_corners_best): Mark locals as initialized.
18211         (gif_load): Initialize transparent_p to zero (Bug#8238).
18212         Mark another local as initialized.
18213         (my_png_error, my_error_exit): Mark with NO_RETURN.
18215         * image.c (clear_image_cache): Now static.
18216         (DIM, HAVE_STDLIB_H_1): Remove unused macros.
18217         (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
18218         (x_edge_detection): Remove unnecessary cast that
18219         gcc -Wbad-function-cast diagnoses.
18220         (gif_load): Fix pointer signedness.
18221         (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18222         (jpeg_load, gif_load): Rename locals to avoid shadowing.
18224 2011-03-12  Paul Eggert  <eggert@cs.ucla.edu>
18226         Improve quality of tests for time stamp overflow.
18227         For example, without this patch (encode-time 0 0 0 1 1
18228         1152921504606846976) returns the obviously-bogus value (-948597
18229         62170) on my RHEL 5.5 x86-64 host.  With the patch, it correctly
18230         reports time overflow.  See
18231         <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
18232         * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18233         * editfns.c: Include limits.h and intprops.h.
18234         (TIME_T_MIN, TIME_T_MAX): New macros.
18235         (time_overflow): Move earlier, to before first use.
18236         (hi_time, lo_time): New functions, for an accurate test for
18237         out-of-range times.
18238         (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18239         (Fget_internal_run_time): Don't assume time_t fits in int.
18240         (make_time): Use list2 instead of Fcons twice.
18241         (Fdecode_time): More accurate test for out-of-range times.
18242         (check_tm_member): New function.
18243         (Fencode_time): Use it, to test for out-of-range times.
18244         (lisp_time_argument): Don't rely on undefined left-shift and
18245         right-shift behavior when checking for time stamp overflow.
18247         * editfns.c (time_overflow): New function, refactoring common code.
18248         (Fformat_time_string, Fdecode_time, Fencode_time):
18249         (Fcurrent_time_string): Use it.
18251         Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18252         * dired.c (make_time): Move to ...
18253         * editfns.c (make_time): ... here.
18254         * systime.h: Note the move.
18256 2011-03-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
18258         * fringe.c (update_window_fringes): Remove unused variables.
18260         * unexmacosx.c (copy_data_segment): Also copy __got section.
18261         (Bug#8223)
18263 2011-03-12  Eli Zaretskii  <eliz@gnu.org>
18265         * termcap.c [MSDOS]: Include "msdos.h".
18266         (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18267         Constify `char *' arguments and their references according to
18268         prototypes in tparam.h.
18270         * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
18272         * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18273         Adapt all references accordingly.
18275         * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18277 2011-03-11  Tom Tromey  <tromey@redhat.com>
18279         * buffer.c (syms_of_buffer): Remove obsolete comment.
18281 2011-03-11  Eli Zaretskii  <eliz@gnu.org>
18283         * termhooks.h (encode_terminal_code): Declare prototype.
18285         * msdos.c (encode_terminal_code): Don't declare prototype.
18287         * term.c (encode_terminal_code): Now external again, used by
18288         w32console.c and msdos.c.
18290         * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18291         Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
18293 2011-03-11  Paul Eggert  <eggert@cs.ucla.edu>
18295         Fix some minor problems found by GCC 4.5.2's static checks.
18297         * fringe.c (update_window_fringes): Mark locals as initialized
18298         (Bug#8227).
18299         (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
18301         * alloc.c (mark_fringe_data): Move decl from here ...
18302         * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18303         to check its interface.
18304         (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18306         * fontset.c (free_realized_fontset): Now static.
18307         (Fset_fontset_font): Rename local to avoid shadowing.
18308         (fontset_font): Mark local as initialized.
18309         (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
18311         * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18313         * xselect.c (x_disown_buffer_selections): Remove; not used.
18314         (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
18315         (x_own_selection, Fx_disown_selection_internal): Rename locals
18316         to avoid shadowing.
18317         (x_handle_dnd_message): Remove local to avoid shadowing.
18319         * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18320         so that the caller can use some name other than gcpro1.
18321         (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
18322         * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18323         (Fx_backspace_delete_keys_p):
18324         Use them to avoid shadowing, and rename vars to avoid shadowing.
18325         (x_decode_color, x_set_name, x_window): Now static.
18326         (Fx_create_frame): Add braces to silence GCC warning.
18327         (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
18328         (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18329         Remove unused locals.
18330         (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18331         (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18332         Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18333         macros.
18335         * xterm.h (x_mouse_leave): New decl.
18337         * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18338         Remove unused functions.
18339         (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18340         (x_calc_absolute_position): Now static.
18341         (XTread_socket): Don't define label "out" unless it's used.
18342         Don't declare local "event" unless it's used.
18343         (x_iconify_frame, x_free_frame_resources): Don't declare locals
18344         unless they are used.
18345         (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18346         (x_fatal_error_signal): Remove; not used.
18347         (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18348         (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18349         (x_error_catcher, x_connection_closed, x_error_handler):
18350         (x_error_quitter, xembed_send_message, x_iconify_frame):
18351         (my_log_handler): Rename locals to avoid shadowing.
18352         (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
18353         (x_connection_closed): Tell GCC not to suggest NO_RETURN.
18355         * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18356         Rename or move locals to avoid shadowing.
18357         (tty_defined_color, merge_face_heights): Now static.
18358         (free_realized_faces_for_fontset): Remove; not used.
18359         (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18360         does not deduce is never used uninitialized.
18361         (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18362         (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
18364         * terminal.c (store_terminal_param): Now static.
18366         * xmenu.c (menu_highlight_callback): Now static.
18367         (set_frame_menubar): Remove unused local.
18368         (xmenu_show): Rename parameter to avoid shadowing.
18369         (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18370         since they might point to immutable storage.
18371         (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18372         since it's unused otherwise.
18374         * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
18375         Add a FIXME, since the code still doesn't look right.  (Bug#8215)
18376         (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18377         avoids a gcc -Wuninitialized diagnostic.
18378         (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
18379         (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18380         does not deduce are never used uninitialized.
18382         * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18384         * xdisp.c (redisplay_window): Rename local to avoid shadowing.
18385         * window.c (window_loop, size_window):
18386         (run_window_configuration_change_hook, enlarge_window): Likewise.
18388         * window.c (display_buffer): Now static.
18389         (size_window): Mark variables that gcc -Wuninitialized
18390         does not deduce are never used uninitialized.
18391         * window.h (check_all_windows): New decl, to forestall
18392         gcc -Wmissing-prototypes diagnostic.
18393         * dispextern.h (bidi_dump_cached_states): Likewise.
18395         * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18396         shadowing.
18397         * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
18398         Include <limits.h>.
18399         (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18400         and to avoid gcc -Wuninitialized warning.
18401         (load_charset_map): Mark variables that gcc -Wuninitialized
18402         does not deduce are never used uninitialized.
18403         (load_charset): Abort instead of using uninitialized var (Bug#8229).
18405         * coding.c (coding_set_source, coding_set_destination):
18406         Use "else { /* comment */ }" rather than "else /* comment */;"
18407         for clarity, and to avoid gcc -Wempty-body warning.
18408         (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18409         a block, when the outer 'i' will do.
18410         (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18411         (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18412         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18413         (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18414         (Fdecode_sjis_char, Fdefine_coding_system_internal):
18415         Rename locals to avoid shadowing.
18416         * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
18417         * coding.c (emacs_mule_char, encode_invocation_designation):
18418         Now static, since they're not used elsewhere.
18419         (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
18420         (decode_coding_object, encode_coding_object, detect_coding_system):
18421         (decode_coding_emacs_mule): Mark variables that gcc
18422         -Wuninitialized does not deduce are never used uninitialized.
18423         (detect_coding_iso_2022): Initialize a local variable that might
18424         be used uninitialized.  Leave a FIXME because it's not clear that
18425         this initialization is needed.  (Bug#8211)
18426         (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18427         (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18428         (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18429         (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18430         Remove unused macros.
18432         * category.c (hash_get_category_set): Remove unused local var.
18433         (copy_category_table): Now static, since it's not used elsewhere.
18434         * character.c (string_count_byte8): Likewise.
18436         * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18437         (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18439         * chartab.c (copy_sub_char_table): Now static, since it's not used
18440         elsewhere.
18441         (sub_char_table_ref_and_range, char_table_ref_and_range):
18442         Rename locals to avoid shadowing.
18443         (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
18445         * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
18446         (BIDI_BOB): Remove unused macro.
18448         * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18449         deduce are never used uninitialized.
18450         * term.c (encode_terminal_code): Likewise.
18452         * term.c (encode_terminal_code): Now static.  Remove unused local.
18454         * tparam.h: New file.
18455         * term.c, tparam.h: Include it.
18456         * deps.mk (term.o, tparam.o): Depend on tparam.h.
18457         * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18458         Move these decls to tparam.h, and make them agree with what
18459         is actually in tparam.c.  The previous trick of using incompatible
18460         decls in different modules does not conform to the C standard.
18461         All callers of tparam changed to use tparam's actual API.
18462         * tparam.c (tparam1, tparam, tgoto):
18463         Use const pointers where appropriate.
18465         * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18466         * cm.h (struct cm): Likewise.
18467         * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18468         * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18469         * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18470         (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18471         (turn_on_face, init_tty): Likewise.
18472         * termchar.h (struct tty_display_info): Likewise.
18474         * term.c (term_mouse_position): Rename local to avoid shadowing.
18476         * alloc.c (mark_ttys): Move decl from here ...
18477         * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18479 2011-03-11  Andreas Schwab  <schwab@linux-m68k.org>
18481         * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18483 2011-03-09  Juanma Barranquero  <lekktu@gmail.com>
18485         * search.c (compile_pattern_1): Remove argument regp, unused since
18486         revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18487         (compile_pattern): Don't pass it.
18489 2011-03-08  Jan Djärv  <jan.h.d@swipnet.se>
18491         * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18492         (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18493         for ! HAVE_GTK3.
18494         (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18496         * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18498         * gtkutil.c: Include gtkx.h if HAVE_GTK3.  If ! HAVE_GTK3, define
18499         gdk_window_get_screen, gdk_window_get_geometry,
18500         gdk_x11_window_lookup_for_display and GDK_KEY_g.
18501         (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18502         (xg_get_pixbuf_from_pixmap): New function.
18503         (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18504         to Pixmap, take frame as parameter, remove GdkColormap parameter.
18505         Call xg_get_pixbuf_from_pixmap instead of
18506         gdk_pixbuf_get_from_drawable.
18507         (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18508         xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18509         (xg_check_special_colors): Use GtkStyleContext and its functions
18510         for HAVE_GTK3.
18511         (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18512         (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18513         (xg_update_frame_menubar, xg_tool_bar_detach_callback)
18514         (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18515         Call gtk_widget_get_preferred_size.
18516         (xg_frame_resized): gdk_window_get_geometry only takes 5
18517         parameters.
18518         (xg_win_to_widget, xg_event_is_for_menubar):
18519         Call gdk_x11_window_lookup_for_display.
18520         (xg_set_widget_bg): New function.
18521         (delete_cb): New function.
18522         (xg_create_frame_widgets): Connect delete-event to delete_cb.
18523         Call xg_set_widget_bg.  Only set background pixmap for ! HAVE_GTK3
18524         (xg_set_background_color): Call xg_set_widget_bg.
18525         (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18526         (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18527         Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18528         (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18529         if ! HAVE_GTK3.
18530         (update_frame_tool_bar): Call gtk_widget_hide.
18531         (xg_initialize): Use GDK_KEY_g.
18533         * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18534         if ! HAVE_GTK3
18535         (x_session_initialize): Call gdk_x11_set_sm_client_id.
18537         * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18538         (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18539         Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18541 2011-03-08  Juanma Barranquero  <lekktu@gmail.com>
18543         * w32xfns.c (select_palette): Check success of RealizePalette against
18544         GDI_ERROR, not zero.
18546 See ChangeLog.11 for earlier changes.
18548 ;; Local Variables:
18549 ;; coding: utf-8
18550 ;; End:
18552   Copyright (C) 2011-2012 Free Software Foundation, Inc.
18554   This file is part of GNU Emacs.
18556   GNU Emacs is free software: you can redistribute it and/or modify
18557   it under the terms of the GNU General Public License as published by
18558   the Free Software Foundation, either version 3 of the License, or
18559   (at your option) any later version.
18561   GNU Emacs is distributed in the hope that it will be useful,
18562   but WITHOUT ANY WARRANTY; without even the implied warranty of
18563   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18564   GNU General Public License for more details.
18566   You should have received a copy of the GNU General Public License
18567   along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.