* src/xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
[emacs.git] / src / ChangeLog
bloba2891fa9c911bfafc283bfa42f1d24a2a47a1a55
1 2011-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
3         * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
4         to compare Lisp_Objects.
5         * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
6         global_gnutls_log_level, don't mistake it for a Lisp_Object.
7         (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
9 2011-07-17  Andreas Schwab  <schwab@linux-m68k.org>
11         * lread.c (read_integer): Unread even EOF character.
12         (read1): Likewise.  Properly record start position of symbol.
14         * lread.c (read1): Read `#:' as empty uninterned symbol if no
15         symbol character follows.
17 2011-07-17  Paul Eggert  <eggert@cs.ucla.edu>
19         * fileio.c (Fcopy_file): Pacify gcc re fchown.  (Bug#9002)
20         This works around a problem with the previous change to Fcopy_file.
21         Recent glibc declares fchown with __attribute__((warn_unused_result)),
22         and without this change, GCC might complain about discarding
23         fchown's return value.
25 2011-07-16  Juanma Barranquero  <lekktu@gmail.com>
27         * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
29 2011-07-16  Paul Eggert  <eggert@cs.ucla.edu>
31         * fileio.c (Fcopy_file): Don't diagnose fchown failures.  (Bug#9002)
33 2011-07-16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
35         * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
36         it's used from the C level.
38         * process.c: Use the same condition for POLL_FOR_INPUT in both
39         keyboard.c and process.c (bug#1858).
41 2011-07-09  Lawrence Mitchell  <wence@gmx.li>
43         * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
44         (Fgnutls_boot): Use it.
46 2011-07-15  Andreas Schwab  <schwab@linux-m68k.org>
48         * doc.c (Fsubstitute_command_keys): Revert last change.
50 2011-07-15  Lars Magne Ingebrigtsen  <larsi@gnus.org>
52         * doc.c (Fsubstitute_command_keys): Clarify that \= really only
53         quotes the next character, and doesn't affect other longer
54         sequences (bug#8935).
56         * lread.c (syms_of_lread): Clarify that is isn't only
57         `eval-buffer' and `eval-defun' that's affected by
58         `lexical-binding' (bug#8460).
60 2011-07-15  Eli Zaretskii  <eliz@gnu.org>
62         * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
63         bidi redisplay when a line includes both an image and is
64         truncated.
66 2011-07-14  Paul Eggert  <eggert@cs.ucla.edu>
68         Fix minor problems found by static checking.
69         * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
70         (elsz): Now a signed constant, not a size_t var.  We prefer signed
71         types to unsigned, to avoid integer comparison confusion.  Without
72         this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
73         "cannot optimize loop, the loop counter may overflow", a symptom
74         of the confusion.
75         * indent.c (Fvertical_motion): Mark locals as initialized.
76         * xdisp.c (reseat_to_string): Fix pointer signedness issue.
78 2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
80         * search.c (Fre_search_backward): Mention `case-fold-search' in
81         all the re_search_* functions (bug#8138).
83         * keyboard.c (Fopen_dribble_file): Document when the file is
84         closed (bug#8056).
86 2011-07-14  Eli Zaretskii  <eliz@gnu.org>
88         * bidi.c (bidi_dump_cached_states): Fix format of displaying
89         bidi_cache_idx.
91         Support bidi reordering of display and overlay strings.
92         * xdisp.c (compute_display_string_pos)
93         (compute_display_string_end): Accept additional argument STRING.
94         (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
95         (reseat_to_string): Initialize bidi_it->string.s and
96         bidi_it->string.schars.
97         (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
98         NULL (avoids a crash in bidi_paragraph_init).  Initialize
99         itb.string.lstring.
100         (init_iterator): Call bidi_init_it only of a valid
101         buffer position was specified.  Initialize paragraph_embedding to
102         L2R.
103         (reseat_to_string): Initialize the bidi iterator.
104         (display_string): If we need to ignore text properties of
105         LISP_STRING, set IT->stop_charpos to IT->end_charpos.  (The
106         original value of -1 will not work with bidi.)
107         (compute_display_string_pos): First arg is now struct
108         `text_pos *'; all callers changed.  Support display properties on
109         Lisp strings.
110         (compute_display_string_end): Support display properties on Lisp
111         strings.
112         (init_iterator, reseat_1, reseat_to_string): Initialize the
113         string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
114         when iterating on a string not from display properties).
115         (compute_display_string_pos, compute_display_string_end): Fix
116         calculation of the object to scan.  Fixes an error when using
117         arrow keys.
118         (next_element_from_buffer): Don't abort when IT_CHARPOS is before
119         base_level_stop; instead, set base_level_stop to BEGV.  Fixes
120         crashes in vertical-motion.
121         (next_element_from_buffer): Improve commentary for when
122         the iterator is before prev_stop.
123         (init_iterator): Initialize bidi_p from the default value of
124         bidi-display-reordering, not from buffer-local value.  Use the
125         buffer-local value only if initializing for buffer iteration.
126         (handle_invisible_prop): Support invisible properties on strings
127         that are being bidi-reordered.
128         (set_iterator_to_next): Support bidi reordering of C strings and
129         Lisp strings.
130         (next_element_from_string): Support bidi reordering of Lisp
131         strings.
132         (handle_stop_backwards): Support Lisp strings as well.
133         (display_string): Support display of R2L glyph rows.  Use
134         IT_STRING_CHARPOS when displaying from a Lisp string.
135         (init_iterator): Don't initialize it->bidi_p for strings
136         here.
137         (reseat_to_string): Initialize it->bidi_p for strings here.
138         (next_element_from_string, next_element_from_c_string)
139         (next_element_from_buffer): Add xassert's for correspondence
140         between IT's object being iterated and it->bidi_it.string
141         structure.
142         (face_before_or_after_it_pos): Support bidi iteration.
143         (next_element_from_c_string): Handle the case of the first string
144         character that is not the first one in the visual order.
145         (get_visually_first_element): New function, refactored from common
146         parts of next_element_from_buffer, next_element_from_string, and
147         next_element_from_c_string.
148         (tool_bar_lines_needed, redisplay_tool_bar)
149         (display_menu_bar): Force left-to-right direction.  Add a FIXME
150         comment for making that be controlled by a user option.
151         (push_it, pop_it): Save and restore the state of the
152         bidi iterator.  Save and restore the bidi_p flag.
153         (pop_it): Iterate out of display property for string iteration as
154         well.
155         (iterate_out_of_display_property): Support iteration over strings.
156         (handle_single_display_spec): Set up it->bidi_it for iteration
157         over a display string, and call bidi_init_it.
158         (handle_single_display_spec, next_overlay_string)
159         (get_overlay_strings_1, push_display_prop): Set up the bidi
160         iterator for displaying display or overlay strings.
161         (forward_to_next_line_start): Don't use the shortcut if
162         bidi-iterating.
163         (back_to_previous_visible_line_start): If handle_display_prop
164         pushed the iterator stack, restore the internal state of the bidi
165         iterator by calling bidi_pop_it same number of times.
166         (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
167         and we are bidi-iterating, don't decrement the iterator position;
168         instead, set the first_elt flag in the bidi iterator, to produce
169         the same effect.
170         (reseat_1): Remove redundant setting of string_from_display_prop_p.
171         (push_display_prop): xassert that we are iterating a buffer.
172         (push_it, pop_it): Save and restore paragraph_embedding member.
173         (handle_single_display_spec, next_overlay_string)
174         (get_overlay_strings_1, reseat_1, reseat_to_string)
175         (push_display_prop): Set up the `unibyte' member of bidi_it.string
176         correctly.  Don't assume unibyte strings are not bidi-reordered.
177         (compute_display_string_pos)
178         (compute_display_string_end): Fix handling the case of C string.
179         (push_it, pop_it): Save and restore from_disp_prop_p.
180         (handle_single_display_spec, push_display_prop): Set the
181         from_disp_prop_p flag.
182         (get_overlay_strings_1): Reset the from_disp_prop_p flag.
183         (pop_it): Call iterate_out_of_display_property only if we are
184         popping after iteration over a string that came from a display
185         property.  Fix a typo in popping stretch info.  Add an assertion
186         for verifying that the iterator position is in sync with the bidi
187         iterator.
188         (handle_single_display_spec, get_overlay_strings_1)
189         (push_display_prop): Fix initialization of paragraph direction for
190         string when that of the parent object is not yet determined.
191         (reseat_1): Call bidi_init_it to resync the bidi
192         iterator with IT's position.  (Bug#7616)
193         (find_row_edges): If ROW->start.pos gives position
194         smaller than min_pos, use it as ROW->minpos.  (Bug#7616)
195         (handle_stop, back_to_previous_visible_line_start, reseat_1):
196         Reset the from_disp_prop_p flag.
197         (SAVE_IT, RESTORE_IT): New macros.
198         (pos_visible_p, face_before_or_after_it_pos)
199         (back_to_previous_visible_line_start)
200         (move_it_in_display_line_to, move_it_in_display_line)
201         (move_it_to, move_it_vertically_backward, move_it_by_lines)
202         (try_scrolling, redisplay_window, display_line): Use them when
203         saving a temporary copy of the iterator and restoring it back.
204         (back_to_previous_visible_line_start, reseat_1)
205         (init_iterator): Empty the bidi cache "stack".
206         (move_it_in_display_line_to): If iterator ended up at
207         EOL, but we never saw any buffer positions smaller than
208         to_charpos, return MOVE_POS_MATCH_OR_ZV.  Fixes vertical cursor
209         motion in bidi-reordered lines.
210         (move_it_in_display_line_to): Record prev_method and prev_pos
211         immediately before the call to set_iterator_to_next.  Fixes cursor
212         motion in bidi-reordered lines with stretch glyphs and strings
213         displayed in margins.  (Bug#8133) (Bug#8867)
214         Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
215         TO_CHARPOS.
216         (pos_visible_p): Support positions in bidi-reordered lines.  Save
217         and restore bidi cache.
219         * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
220         (bidi_paragraph_info): Delete unused struct.
221         (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
222         (bidi_cache_start): New variable.
223         (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
224         to zero.
225         (bidi_cache_fetch_state, bidi_cache_search)
226         (bidi_cache_find_level_change, bidi_cache_iterator_state)
227         (bidi_cache_find, bidi_peek_at_next_level)
228         (bidi_level_of_next_char, bidi_find_other_level_edge)
229         (bidi_move_to_visually_next): Compare cache index with
230         bidi_cache_start rather than with zero.
231         (bidi_fetch_char): Accept new argument STRING; all callers
232         changed.  Support iteration over a string.  Support strings with
233         display properties.  Support unibyte strings.  Fix the type of
234         `len' according to what STRING_CHAR_AND_LENGTH expects.
235         (bidi_paragraph_init, bidi_resolve_explicit_1)
236         (bidi_resolve_explicit, bidi_resolve_weak)
237         (bidi_level_of_next_char, bidi_move_to_visually_next): Support
238         iteration over a string.
239         (bidi_set_sor_type, bidi_resolve_explicit_1)
240         (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
241         can now be zero (for strings); special values 0 and -1 were
242         changed to -1 and -2, respectively.
243         (bidi_char_at_pos): New function.
244         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
245         Call it instead of FETCH_MULTIBYTE_CHAR.
246         (bidi_move_to_visually_next): Abort if charpos or bytepos were not
247         initialized to valid values.
248         (bidi_init_it): Don't initialize charpos and bytepos with invalid
249         values.
250         (bidi_level_of_next_char): Allow the sentinel "position" to pass
251         the test for valid cached positions.  Fix the logic for looking up
252         the sentinel state in the cache.  GCPRO the Lisp string we are
253         iterating.
254         (bidi_push_it, bidi_pop_it): New functions.
255         (bidi_initialize): Initialize the bidi cache start stack pointer.
256         (bidi_cache_ensure_space): New function, refactored from part of
257         bidi_cache_iterator_state.  Don't assume the required size is just
258         one BIDI_CACHE_CHUNK away.
259         (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
260         (bidi_count_bytes, bidi_char_at_pos): New functions.
261         (bidi_cache_search): Don't assume bidi_cache_last_idx is
262         always valid if bidi_cache_idx is valid.
263         (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
264         is valid if it's going to be used.
265         (bidi_shelve_cache, bidi_unshelve_cache): New functions.
266         (bidi_cache_fetch_state, bidi_cache_search)
267         (bidi_cache_find_level_change, bidi_cache_ensure_space)
268         (bidi_cache_iterator_state, bidi_cache_find)
269         (bidi_find_other_level_edge, bidi_cache_start_stack): All
270         variables related to cache indices are now EMACS_INT.
272         * dispextern.h (struct bidi_string_data): New structure.
273         (struct bidi_it): New member `string'.  Make flag members be 1-bit
274         fields, and put them last in the struct.
275         (compute_display_string_pos, compute_display_string_end): Update
276         prototypes.
277         (bidi_push_it, bidi_pop_it): Add prototypes.
278         (struct iterator_stack_entry): New members bidi_p,
279         paragraph_embedding, and from_disp_prop_p.
280         (struct it): Member bidi_p is now a bit field 1 bit wide.
281         (bidi_shelve_cache, bidi_unshelve_cache): Declare
282         prototypes.
284         * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
285         (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
286         and vector-like objects.
288         * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
289         cache around display iteration.
291         * window.c (Fwindow_end, window_scroll_pixel_based)
292         (displayed_window_lines, Frecenter): Save and restore the bidi
293         cache around display iteration.
295 2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
297         * editfns.c (Fdelete_region): Clarify the use of the named
298         parameters (bug#6788).
300 2011-07-14  Martin Rudalics  <rudalics@gmx.at>
302         * indent.c (Fvertical_motion): Set and restore w->pointm when
303         saving and restoring the window's buffer (Bug#9006).
305 2011-07-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
307         * editfns.c (Fstring_to_char): Clarify just what is returned
308         (bug#6576).  Text by Eli Zaretskii.
310 2011-07-13  Juanma Barranquero  <lekktu@gmail.com>
312         * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
314 2011-07-13  Eli Zaretskii  <eliz@gnu.org>
316         * buffer.c (mmap_find): Fix a typo.
318 2011-07-13  Johan Bockgård  <bojohan@gnu.org>
320         Fix execution of x selection hooks.
321         * xselect.c (Qx_lost_selection_functions)
322         (Qx_sent_selection_functions): New vars.
323         (syms_of_xselect): DEFSYM them.
324         (x_handle_selection_request): Pass Qx_sent_selection_functions
325         rather than Vx_sent_selection_functions to Frun_hook_with_args.
326         (x_handle_selection_clear,x_clear_frame_selections):
327         Pass Qx_lost_selection_functions rather than
328         Vx_lost_selection_functions to Frun_hook_with_args.
330 2011-07-13  Paul Eggert  <eggert@cs.ucla.edu>
332         * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
333         The old code sometimes used this field without initializing it.
335         * alloc.c (gc_sweep): Don't read past end of array.
336         In theory, the old code could also have corrupted Emacs internals,
337         though it'd be very unlikely.
339 2011-07-12  Andreas Schwab  <schwab@linux-m68k.org>
341         * character.c (Fcharacterp): Don't advertise optional ignored
342         argument.  (Bug#4026)
344 2011-07-12  Lars Magne Ingebrigtsen  <larsi@gnus.org>
346         * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
347         key" (bug#4257).
349         * window.c (Fset_window_start): Doc fix (bug#4199).
350         (Fset_window_hscroll): Ditto.
352 2011-07-12  Paul Eggert  <eggert@cs.ucla.edu>
354         Fix minor new problems caught by GCC 4.6.1.
355         * term.c (init_tty): Remove unused local.
356         * xsettings.c (store_monospaced_changed): Define this function only
357         if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
358         not used otherwise.
360 2011-07-12  Chong Yidong  <cyd@stupidchicken.com>
362         * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
364 2011-07-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
366         * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
367         are the mini-buffer and the echo area (bug#3320).
369         * term.c (init_tty): Remove support for supdup, c10 and perq
370         terminals, which are no longer supported (bug#1482).
372 2011-07-10  Johan Bockgård  <bojohan@gnu.org>
374         * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
376 2011-07-10  Jan Djärv  <jan.h.d@swipnet.se>
378         * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
379         for non-popups (Bug#3642).
381 2011-07-10  Andreas Schwab  <schwab@linux-m68k.org>
383         * alloc.c (reset_malloc_hooks): Protoize.
384         * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
385         (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
386         * cm.c (losecursor): Likewise.
387         * data.c (fmod): Likewise.
388         * dispnew.c (swap_glyphs_in_rows): Likewise.
389         * emacs.c (memory_warning_signal): Likewise.
390         * floatfns.c (float_error): Likewise.
391         * font.c (check_gstring, check_otf_features, otf_tag_symbol)
392         (otf_open, font_otf_capability, generate_otf_features)
393         (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
394         Likewise.
395         * image.c (pbm_read_file): Likewise.
396         * indent.c (string_display_width): Likewise.
397         * intervals.c (check_for_interval, search_for_interval)
398         (inc_interval_count, count_intervals, root_interval)
399         (adjust_intervals_for_insertion, make_new_interval): Likewise.
400         * lread.c (defalias): Likewise.
401         * ralloc.c (r_alloc_check): Likewise.
402         * regex.c (set_image_of_range_1, set_image_of_range)
403         (regex_grow_registers): Likewise.
404         * sysdep.c (strerror): Likewise.
405         * termcap.c (valid_filename_p, tprint, main): Likewise.
406         * tparam.c (main): Likewise.
407         * unexhp9k800.c (run_time_remap, save_data_space)
408         (update_file_ptrs, read_header, write_header, calculate_checksum)
409         (copy_file, copy_rest, display_header): Likewise.
410         * widget.c (mark_shell_size_user_specified, create_frame_gcs):
411         Likewise.
412         * xdisp.c (check_it): Likewise.
413         * xfaces.c (register_color, unregister_color, unregister_colors):
414         Likewise.
415         * xfns.c (print_fontset_result): Likewise.
416         * xrdb.c (member, fatal, main): Likewise.
418 2011-07-10  Paul Eggert  <eggert@cs.ucla.edu>
420         Fix minor problems found by static checking (Bug#9031).
421         * chartab.c (char_table_set_range, map_sub_char_table):
422         Remove unused locals.
423         (uniprop_table): Now static.
424         * composite.c (_work_char): Remove unused static var.
426 2011-07-09  Juanma Barranquero  <lekktu@gmail.com>
428         * chartab.c (uniprop_table_uncompress): Remove unused local variable.
430 2011-07-09  Jan Djärv  <jan.h.d@swipnet.se>
432         * gtkutil.c (qttip_cb): Remove code without function.
434 2011-07-09  Eli Zaretskii  <eliz@gnu.org>
436         * w32.c (pthread_sigmask): New stub.
438 2011-07-08  Paul Eggert  <eggert@cs.ucla.edu>
440         Use pthread_sigmask, not sigprocmask (Bug#9010).
441         sigprocmask is portable only for single-threaded applications, and
442         Emacs can be multi-threaded when it uses GTK.
443         * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
444         (LIBES): Use it.
445         * callproc.c (Fcall_process):
446         * process.c (create_process):
447         * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
448         Use pthread_sigmask, not sigprocmask.
450 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
452         * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
453         (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
454         wrong (Bug#8591).
456 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
458         * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
459         Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
460         (xg_hide_tooltip): Fix comment.
462         * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
463         in registerServicesMenuSendTypes.
464         (validRequestorForSendType): Don't check ns_return_types.
466         * nsfns.m (Fx_open_connection): Put NSStringPboardType into
467         ns_return_type.
469 2011-07-08  Jason Rumney  <jasonr@gnu.org>
471         * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
472         frame struct members of non-existent frames (Bug#6284).
474 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
476         * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
477         variable firstTime not needed on OSX >= 10.6.
478         (setPosition): setFloatValue:knobProportion: is deprecated on OSX
479         >= 10.5.  Use setKnobProportion, setDoubleValue.
481         * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
482         (MAC_OS_X_VERSION_10_5): Define if not defined.
483         (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
484         (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
485         (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
487         * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
488         cString and lossyCString on OSX >= 10.4
490         * nsmenu.m (fillWithWidgetValue): Don't use depercated method
491         sizeToFit on OSX >= 10.2.
493         * nsimage.m (allocInitFromFile): Don't use deprecated method
494         bestRepresentationForDevice on OSX >= 10.6.
496         * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
497         to avoid warning.
499         * emacs.c: Declare unexec_init_emacs_zone.
501         * nsgui.h: Fix compiler warning about gnulib redefining verify.
503         * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
505         * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
506         on svcsMenu (Bug#8842).
508         * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
509         ns_return_types.
510         (Fns_list_services): Just return Qnil on 10.6, code not working there.
512         * nsterm.m (QUTF8_STRING): Declare.
513         (initFrameFromEmacs): Call registerServicesMenuSendTypes.
514         (validRequestorForSendType): Return type is (id).
515         Change indexOfObjectIdenticalTo to indexOfObject.
516         Check if we have local selection before returning self (Bug#8842).
517         (writeSelectionToPasteboard): Put local selection into paste board
518         if we have a local selection (Bug#8842).
519         (syms_of_nsterm): DEFSYM QUTF8_STRING.
521         * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
522         (ns_get_local_selection): Declare.
524 2011-07-07  Lars Magne Ingebrigtsen  <larsi@gnus.org>
526         * keymap.c (describe_map_tree): Don't insert a double newline at
527         the end of the buffer (bug#1169) and return whether we inserted
528         something.
530         * callint.c (Fcall_interactively): Change "reading args" to
531         "providing args" to try to clarify what it does (bug#1010).
533 2011-07-07  Kenichi Handa  <handa@m17n.org>
535         * composite.c (composition_compute_stop_pos): Ignore a static
536         composition starting before CHARPOS (Bug#8915).
538         * xdisp.c (handle_composition_prop): Likewise.
540 2011-07-07  Eli Zaretskii  <eliz@gnu.org>
542         * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
543         (Bug#9015)
545 2011-07-07  Kenichi Handa  <handa@m17n.org>
547         * character.h (unicode_category_t): New enum type.
549         * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
550         (Qchar_code_property_table): New variable.
551         (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
552         (UNIPROP_COMPRESSED_FORM_P): New macros.
553         (char_table_ascii): Uncompress the compressed values.
554         (sub_char_table_ref): New arg is_uniprop.  Callers changed.
555         Uncompress the compressed values.
556         (sub_char_table_ref_and_range): Likewise.
557         (char_table_ref_and_range): Uncompress the compressed values.
558         (sub_char_table_set): New arg is_uniprop.  Callers changed.
559         Uncompress the compressed values.
560         (sub_char_table_set_range): Args changed.  Callers changed.
561         (char_table_set_range): Adjuted for the above change.
562         (map_sub_char_table): Delete args default_val and parent.  Add arg
563         top.  Give decoded values to a Lisp function.
564         (map_char_table): Adjusted for the above change.  Give decoded
565         values to a Lisp function.  Gcpro more variables.
566         (uniprop_table_uncompress)
567         (uniprop_decode_value_run_length): New functions.
568         (uniprop_decoder, uniprop_decoder_count): New variables.
569         (uniprop_get_decoder, uniprop_encode_value_character)
570         (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
571         New functions.
572         (uniprop_encoder, uniprop_encoder_count): New variables.
573         (uniprop_get_encoder, uniprop_table)
574         (Funicode_property_table_internal, Fget_unicode_property_internal)
575         (Fput_unicode_property_internal): New functions.
576         (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
577         Sunicode_property_table_internal, Sget_unicode_property_internal,
578         and Sput_unicode_property_internal. Defvar_lisp
579         char-code-property-alist.
581         * composite.c (CHAR_COMPOSABLE_P): Adjusted for the change of
582         Vunicode_category_table.
584         * font.c (font_range): Adjusted for the change of
585         Vunicode_category_table.
587 2011-07-07  Dan Nicolaescu  <dann@ics.uci.edu>
589         * m/iris4d.h: Remove file, move contents ...
590         * s/irix6-5.h: ... here.
592 2011-07-06  Paul Eggert  <eggert@cs.ucla.edu>
594         Remove unportable assumption about struct layout (Bug#8884).
595         * alloc.c (mark_buffer):
596         * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
597         (clone_per_buffer_values): Don't assume that
598         sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
599         This isn't true in general, and it's particularly not true
600         if Emacs is configured with --with-wide-int.
601         * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
602         New macros, used in the buffer.c change.
604 2011-07-05  Jan Djärv  <jan.h.d@swipnet.se>
606         * xsettings.c: Use both GConf and GSettings if both are available.
607         (store_config_changed_event): Add comment.
608         (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
609         (store_tool_bar_style_changed): New functions.
610         (store_monospaced_changed): Add comment. Call dpyinfo_valid.
611         (struct xsettings): Move font inside HAVE_XFT.
612         (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
613         (GSETTINGS_MONO_FONT): Renamed from SYSTEM_MONO_FONT.
614         Move inside HAVE_XFT.
615         (something_changed_gsettingsCB): Renamed from something_changedCB.
616         Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
617         also.
618         (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
619         (GCONF_MONO_FONT): Renamed from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
620         (something_changed_gconfCB): Renamed from something_changedCB.
621         Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
622         (parse_settings): Move check for font inside HAVE_XFT.
623         (read_settings, apply_xft_settings): Add comment.
624         (read_and_apply_settings): Add comment.  Call map_tool_bar_style and
625         store_tool_bar_style_changed.  Move check for font inside HAVE_XFT and
626         call store_font_name_changed.
627         (xft_settings_event): Add comment.
628         (init_gsettings): Add comment.  Get values for GSETTINGS_TOOL_BAR_STYLE
629         and GSETTINGS_FONT_NAME.  Move check for fonts within HAVE_XFT.
630         (init_gconf): Add comment.  Get values for GCONF_TOOL_BAR_STYLE
631         and GCONF_FONT_NAME.  Move check for fonts within HAVE_XFT.
632         (xsettings_initialize): Call init_gsettings last.
633         (xsettings_get_system_font, xsettings_get_system_normal_font): Add
634         comment.
636 2011-07-05  Paul Eggert  <eggert@cs.ucla.edu>
638         Random fixes.  E.g., (random) never returned negative values.
639         * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
640         subseconds part to the entropy, as that's a bit more random.
641         Prefer signed to unsigned, since the signedness doesn't matter and
642         in general we prefer signed.  When given a limit, use a
643         denominator equal to INTMASK + 1, not to VALMASK + 1, because the
644         latter isn't right if USE_2_TAGS_FOR_INTS.
645         * sysdep.c (get_random): Return a value in the range 0..INTMASK,
646         not 0..VALMASK.  Don't discard "excess" bits that random () returns.
648 2011-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
650         * textprop.c (text_property_stickiness):
651         Obey Vtext_property_default_nonsticky.
652         (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
653         * w32fns.c (syms_of_w32fns):
654         * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
656 2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
658         * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
659         This is more efficient than Ffile_directory_p and avoids a minor race.
661 2011-07-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
663         * buffer.c (Foverlay_put): Say what the return value is
664         (bug#7835).
666         * fileio.c (barf_or_query_if_file_exists): Check first if the file
667         is a directory before asking whether to use the file name
668         (bug#7564).
669         (barf_or_query_if_file_exists): Make the "File is a directory"
670         error be more correct.
672         * fns.c (Frequire): Remove the mention of the .gz files, since
673         that's installation-specific, but keep the mention of
674         `get-load-suffixes'.
676 2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
678         * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
679         Report string overflow if the output is too long.
681 2011-07-04  Juanma Barranquero  <lekktu@gmail.com>
683         * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
684         (syms_of_gnutls): Remove duplicate DEFSYM for
685         Qgnutls_bootprop_verify_hostname_error, an error for
686         Qgnutls_bootprop_verify_error (which is no longer used).
688         * eval.c (find_handler_clause): Remove parameters `sig' and `data',
689         unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca.  All callers changed.
690         Also (re)move comments that are misplaced or no longer relevant.
692 2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
694         * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
696 2011-07-03  Chong Yidong  <cyd@stupidchicken.com>
698         * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
699         and background color parameters if they have been changed.
701 2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
703         * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
705 2011-07-03  Paul Eggert  <eggert@cs.ucla.edu>
707         * xsettings.c (SYSTEM_FONT): Define only when used.
708         No need to define when HAVE_GSETTINGS || !HAVE_XFT.
710         * keymap.c (access_keymap_1): Now static.
712 2011-07-02  Chong Yidong  <cyd@stupidchicken.com>
714         * keyboard.c (command_loop_1): If a down-mouse event is unbound,
715         leave any prefix arg for the up event (Bug#1586).
717 2011-07-02  Lars Magne Ingebrigtsen  <larsi@gnus.org>
719         * lread.c (syms_of_lread): Mention single symbols defined by
720         `defvar' or `defconst' (bug#7154).
722         * fns.c (Frequire): Mention .el.gz files (bug#7314).
723         (Frequire): Mention get-load-suffixes.
725 2011-07-02  Martin Rudalics  <rudalics@gmx.at>
727         * window.h (window): Remove clone_number slot.
728         * window.c (Fwindow_clone_number, Fset_window_clone_number):
729         Remove.
730         (make_parent_window, make_window, saved_window)
731         (Fset_window_configuration, save_window_save): Don't deal with
732         clone numbers.
733         * buffer.c (Qclone_number): Remove declaration.
734         (sort_overlays, overlay_strings): Don't deal with clone numbers.
736 2011-07-02  Stefan Monnier  <monnier@iro.umontreal.ca>
738         Add multiple inheritance to keymaps.
739         * keymap.c (Fmake_composed_keymap): New function.
740         (Fset_keymap_parent): Simplify.
741         (fix_submap_inheritance): Remove.
742         (access_keymap_1): New function extracted from access_keymap to handle
743         embedded parents and handle lists of maps.
744         (access_keymap): Use it.
745         (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
746         (Fcopy_keymap): Handle embedded parents.
747         (Fcommand_remapping, define_as_prefix): Simplify.
748         (Fkey_binding): Simplify.
749         (syms_of_keymap): Move minibuffer-local-completion-map,
750         minibuffer-local-filename-completion-map,
751         minibuffer-local-must-match-map, and
752         minibuffer-local-filename-must-match-map to Elisp.
753         (syms_of_keymap): Defsubr make-composed-keymap.
754         * keyboard.c (menu_bar_items): Use map_keymap_canonical.
755         (parse_menu_item): Trivial simplification.
757 2011-07-01  Glenn Morris  <rgm@gnu.org>
759         * Makefile.in (SETTINGS_LIBS): Fix typo.
761 2011-07-01  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny patch)
763         * coding.c (Fencode_coding_string): Record the last coding system
764         used, as the function doc string says (bug#8738).
766 2011-07-01  Jan Djärv  <jan.h.d@swipnet.se>
768         * xsettings.c (store_monospaced_changed): Take new font as arg and
769         check for change against current_mono_font.
770         (EMACS_TYPE_SETTINGS): Remove this and related defines.
771         (emacs_settings_constructor, emacs_settings_get_property)
772         (emacs_settings_set_property, emacs_settings_class_init)
773         (emacs_settings_init, gsettings_obj): Remove.
774         (something_changedCB): New function for HAVE_GSETTINGS.
775         (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
776         with value as argument.
777         (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
778         g_settings_new (Bug#8967).  Do not create gsettings_obj.
779         Remove calls to g_settings_bind.  Connect something_changedCB to
780         "changed".
782         * xgselect.c: Add defined (HAVE_GSETTINGS).
783         (xgselect_initialize): Ditto.
785         * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
786         (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
787         xg_select.
789 2011-07-01  Paul Eggert  <eggert@cs.ucla.edu>
791         * eval.c (struct backtrace): Simplify and port the data structure.
792         Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
793         signed bit field, as this assumption is not portable and it makes
794         Emacs crash when compiled with Sun C 5.8 on sparc.  Do not use
795         "char debug_on_exit : 1" as this is not portable either; instead,
796         use the portable "unsigned int debug_on_exit : 1".  Remove unused
797         member evalargs.  Remove obsolete comments about cc bombing out.
799 2011-06-30  Jan Djärv  <jan.h.d@swipnet.se>
801         * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
802         Let HAVE_GSETTINGS override HAVE_GCONF.
803         (store_monospaced_changed): New function.
804         (EMACS_SETTINGS): A new type derived from GObject to handle
805         GSettings notifications.
806         (emacs_settings_constructor, emacs_settings_get_property)
807         (emacs_settings_set_property, emacs_settings_class_init):
808         New functions.
809         (gsettings_client, gsettings_obj): New variables.
810         (GSETTINGS_SCHEMA): New define.
811         (something_changedCB): Call store_monospaced_changed.
812         (init_gsettings): New function.
813         (xsettings_initialize): Call init_gsettings.
814         (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
815         to NULL.
817         * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Renamed from
818         GCONF_CFLAGS/LIBS.
820 2011-06-29  Martin Rudalics  <rudalics@gmx.at>
822         * window.c (resize_root_window, grow_mini_window)
823         (shrink_mini_window): Rename Qresize_root_window to
824         Qwindow_resize_root_window and Qresize_root_window_vertically to
825         Qwindow_resize_root_window_vertically.
827 2011-06-28  Paul Eggert  <eggert@cs.ucla.edu>
829         * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
831 2011-06-27  Juanma Barranquero  <lekktu@gmail.com>
833         * makefile.w32-in: Redesign dependencies so they reflect more
834         clearly which files are directly included by each source file,
835         and not through other includes.
837 2011-06-27  Martin Rudalics  <rudalics@gmx.at>
839         * buffer.c (Qclone_number): Declare static and DEFSYM it.
840         (sort_overlays, overlay_strings): When an overlay's clone number
841         matches the window's clone number process the overlay even if
842         the overlay's window property doesn't match the current window.
844         * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
845         (Fwindow_hchild): Rename to Fwindow_left_child.
846         (Fwindow_next): Rename to Fwindow_next_sibling.
847         (Fwindow_prev): Rename to Fwindow_prev_sibling.
848         (resize_window_check): Rename to window_resize_check.
849         (resize_window_apply): Rename to window_resize_apply.
850         (Fresize_window_apply): Rename to Fwindow_resize_apply.
851         (Fdelete_other_windows_internal, resize_frame_windows)
852         (Fsplit_window_internal, Fdelete_window_internal)
853         (grow_mini_window, shrink_mini_window)
854         (Fresize_mini_window_internal): Fix callers accordingly.
856 2011-06-26  Jan Djärv  <jan.h.d@swipnet.se>
858         * emacsgtkfixed.h: State that this is only used with Gtk+3.
859         (emacs_fixed_set_min_size): Remove.
860         (emacs_fixed_new): Take frame as argument.
862         * emacsgtkfixed.c: State that this is only used with Gtk+3.
863         (_EmacsFixedPrivate): Remove minwidth/height.
864         Add struct frame *f.
865         (emacs_fixed_init): Initialize priv->f.
866         (get_parent_class, emacs_fixed_set_min_size): Remove.
867         (emacs_fixed_new): Set priv->f to argument.
868         (emacs_fixed_get_preferred_width)
869         (emacs_fixed_get_preferred_height): Use min_width/height from
870         frames size_hint to set minimum and natural (Bug#8919).
871         (XSetWMSizeHints, XSetWMNormalHints): Override these functions
872         and use min_width/height from frames size_hint to set
873         min_width/height (Bug#8919).
875         * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
876         (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
877         Fix indentation.
879 2011-06-26  Eli Zaretskii  <eliz@gnu.org>
881         * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
882         bidi_at_paragraph_end, since fast_looking_at doesn't like to be
883         called at ZV.
885 2011-06-26  Chong Yidong  <cyd@stupidchicken.com>
887         * process.c (wait_reading_process_output): Bypass select if
888         waiting for a cell while ignoring keyboard input, and input is
889         pending.  Suggested by Jan Djärv (Bug#8869).
891 2011-06-25  Paul Eggert  <eggert@cs.ucla.edu>
893         Use gnulib's dup2 module instead of rolling our own.
894         * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
896 2011-06-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
898         * dispnew.c (scrolling_window): Before scrolling, turn off a
899         mouse-highlight in the window being scrolled.
901 2011-06-24  Juanma Barranquero  <lekktu@gmail.com>
903         Move DEFSYM to lisp.h and use everywhere.
905         * character.h (DEFSYM): Move declaration...
906         * lisp.h (DEFSYM): ...here.
908         * gnutls.c:
909         * minibuf.c:
910         * w32menu.c:
911         * w32proc.c:
912         * w32select.c: Don't include character.h.
914         * alloc.c (syms_of_alloc):
915         * buffer.c (syms_of_buffer):
916         * bytecode.c (syms_of_bytecode):
917         * callint.c (syms_of_callint):
918         * casefiddle.c (syms_of_casefiddle):
919         * casetab.c (init_casetab_once):
920         * category.c (init_category_once, syms_of_category):
921         * ccl.c (syms_of_ccl):
922         * cmds.c (syms_of_cmds):
923         * composite.c (syms_of_composite):
924         * dbusbind.c (syms_of_dbusbind):
925         * dired.c (syms_of_dired):
926         * dispnew.c (syms_of_display):
927         * doc.c (syms_of_doc):
928         * editfns.c (syms_of_editfns):
929         * emacs.c (syms_of_emacs):
930         * eval.c (syms_of_eval):
931         * fileio.c (syms_of_fileio):
932         * fns.c (syms_of_fns):
933         * frame.c (syms_of_frame):
934         * fringe.c (syms_of_fringe):
935         * insdel.c (syms_of_insdel):
936         * keymap.c (syms_of_keymap):
937         * lread.c (init_obarray, syms_of_lread):
938         * macros.c (syms_of_macros):
939         * msdos.c (syms_of_msdos):
940         * print.c (syms_of_print):
941         * process.c (syms_of_process):
942         * search.c (syms_of_search):
943         * sound.c (syms_of_sound):
944         * syntax.c (init_syntax_once, syms_of_syntax):
945         * terminal.c (syms_of_terminal):
946         * textprop.c (syms_of_textprop):
947         * undo.c (syms_of_undo):
948         * w32.c (globals_of_w32):
949         * window.c (syms_of_window):
950         * xdisp.c (syms_of_xdisp):
951         * xfaces.c (syms_of_xfaces):
952         * xfns.c (syms_of_xfns):
953         * xmenu.c (syms_of_xmenu):
954         * xsettings.c (syms_of_xsettings):
955         * xterm.c (syms_of_xterm): Use DEFSYM.
957 2011-06-24  Teodor Zlatanov  <tzz@lifelogs.com>
959         * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
961 2011-06-23  Paul Eggert  <eggert@cs.ucla.edu>
963         Integer and buffer overflow fixes (Bug#8873).
965         * print.c (printchar, strout): Check for string overflow.
966         (PRINTPREPARE, printchar, strout):
967         Don't set size unless allocation succeeds.
969         * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
970         for sizes.  Check for string overflow more accurately.
971         Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
973         * macros.c: Integer and buffer overflow fixes.
974         * keyboard.h (struct keyboard.kbd_macro_bufsize):
975         * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
976         Use ptrdiff_t, not int, for sizes.
977         Don't increment bufsize until after realloc succeeds.
978         Check for size-calculation overflow.
979         (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
981         * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
983         * lread.c: Integer overflow fixes.
984         (read_integer): Radix is now EMACS_INT, not int,
985         to improve quality of diagnostics for out-of-range radices.
986         Calculate buffer size correctly for out-of-range radices.
987         (read1): Check for integer overflow in radices, and in
988         read-circle numbers.
989         (read_escape): Avoid int overflow.
990         (Fload, openp, read_buffer_size, read1)
991         (substitute_object_recurse, read_vector, read_list, map_obarray):
992         Use ptrdiff_t, not int, for sizes.
993         (read1): Use EMACS_INT, not int, for sizes.
994         Check for size overflow.
996         * image.c (cache_image): Check for size arithmetic overflow.
998         * lread.c: Integer overflow issues.
999         (saved_doc_string_size, saved_doc_string_length)
1000         (prev_saved_doc_string_size, prev_saved_doc_string_length):
1001         Now ptrdiff_t, not int.
1002         (read1): Don't assume doc string length fits in int.  Check for
1003         out-of-range doc string lengths.
1004         (read_list): Don't assume file position fits in int.
1005         (read_escape): Check for hex character overflow.
1007 2011-06-22  Leo Liu  <sdl.web@gmail.com>
1009         * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
1010         Move to minibuffer.el.
1012 2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
1014         Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
1015         The following patches are for when GLYPH_DEBUG && !XASSERT.
1016         * dispextern.h (trace_redisplay_p, dump_glyph_string):
1017         * dispnew.c (flush_stdout):
1018         * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
1019         Mark as externally visible.
1020         * dispnew.c (check_window_matrix_pointers): Now static.
1021         * dispnew.c (window_to_frame_vpos):
1022         * xfns.c (unwind_create_frame):
1023         * xterm.c (x_check_font): Remove unused local.
1024         * scroll.c (CHECK_BOUNDS):
1025         * xfaces.c (cache_fache): Rename local to avoid shadowing.
1026         * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
1027         * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
1028         (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
1029         (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
1030         Now static.
1031         (debug_method_add): Use va_list and vsprintf rather than relying
1032         on undefined behavior with wrong number of arguments.
1033         (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
1034         Don't assume ptrdiff_t and EMACS_INT are the same width as int.
1035         In this code, it's OK to assume C99 behavior for ptrdiff_t formats
1036         since we're not interested in debugging glyphs with old libraries.
1037         * xfaces.c (cache_face): Move debugging code earlier; this pacifies
1038         GCC 4.6.0's static checking.
1040 2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
1042         Integer overflow and signedness fixes (Bug#8873).
1043         A few related buffer overrun fixes, too.
1045         * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
1047         * dispextern.h (struct face.stipple):
1048         * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
1049         (x_bitmap_mask, x_allocate_bitmap_record)
1050         (x_create_bitmap_from_data, x_create_bitmap_from_file)
1051         (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
1052         (x_create_bitmap_from_xpm_data):
1053         * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
1054         * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
1055         (.bitmaps_last):
1056         * xfaces.c (load_pixmap):
1057         * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
1058         * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
1059         (.bitmaps_last, struct x_output.icon_bitmap):
1060         Use ptrdiff_t, not int, for bitmap indexes.
1061         (x_allocate_bitmap_record): Check for size overflow.
1062         * dispextern.h, lisp.h: Adjust to API changes elsewhere.
1064         Use ptrdiff_t, not int, for overlay counts.
1065         * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
1066         * editfns.c (overlays_around, get_pos_property):
1067         * textprop.c (get_char_property_and_overlay):
1068         * xdisp.c (next_overlay_change, note_mouse_highlight):
1069         * xfaces.c (face_at_buffer_position):
1070         * buffer.c (OVERLAY_COUNT_MAX): New macro.
1071         (overlays_at, overlays_in, sort_overlays, Foverlays_at)
1072         (Fnext_overlay_change, Fprevious_overlay_change)
1073         (mouse_face_overlay_overlaps, Foverlays_in):
1074         Use ptrdiff_t, not int, for sizes.
1075         (overlays_at, overlays_in): Check for size-calculation overflow.
1077         * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
1079         * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
1080         (x_session_initialize): Do not assume string length fits in int.
1082         * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
1083         This is unlikely, but can occur if DPI is outlandish.
1085         * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
1086         * xselect.c (Fx_get_atom_name): Avoid need for strlen.
1088         * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
1089         * xrdb.c (magic_file_p, search_magic_path):
1090         Omit last arg SUFFIX; it was always 0.  All callers changed.
1091         (magic_file_p): Use ptrdiff_t, not int.  Check for size overflow.
1093         * xfont.c (xfont_match): Avoid need for strlen.
1095         * xfns.c: Don't assume strlen fits in int.
1096         (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
1098         * xdisp.c (message_log_check_duplicate): Return intmax_t,
1099         not unsigned long, as we prefer signed integers.  All callers changed.
1100         Detect integer overflow in repeat count.
1101         (message_dolog): Don't assume print length fits in 39 bytes.
1102         (display_mode_element): Don't assume strlen fits in int.
1104         * termcap.c: Don't assume sizes fit in int and never overflow.
1105         (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
1106         (gobble_line): Check for size-calculation overflow.
1108         * minibuf.c (Fread_buffer):
1109         * lread.c (intern, intern_c_string):
1110         * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
1111         Don't assume string length fits in int.
1113         * keyboard.c (parse_tool_bar_item):
1114         * gtkutil.c (style_changed_cb): Avoid need for strlen.
1116         * font.c: Don't assume string length fits in int.
1117         (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
1118         Use ptrdiff_t, not int.
1119         (font_intern_prop): Don't assume string length fits in int.
1120         Don't assume integer property fits in fixnum.
1121         * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
1123         * filelock.c: Fix some buffer overrun and integer overflow issues.
1124         (get_boot_time): Don't assume gzip command string fits in 100 bytes.
1125         Reformulate so as not to need the command string.
1126         Invoke gzip -cd rather than gunzip, as it's more portable.
1127         (lock_info_type, lock_file_1, lock_file):
1128         Don't assume pid_t and time_t fit in unsigned long.
1129         (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
1130         (current_lock_owner): Prefer signed type for sizes.
1131         Use memcpy, not strncpy, where memcpy is what is really wanted.
1132         Don't assume (via atoi) that time_t and pid_t fit in int.
1133         Check for time_t and/or pid_t out of range, e.g., via a network share.
1134         Don't alloca where an auto var works fine.
1136         * fileio.c: Fix some integer overflow issues.
1137         (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
1138         Don't assume string length fits in int.
1139         (directory_file_name): Don't assume string length fits in long.
1140         (make_temp_name): Don't assume pid fits in int, or that its print
1141         length is less than 20.
1143         * data.c (Fsubr_name): Rewrite to avoid a strlen call.
1145         * coding.c (make_subsidiaries): Don't assume string length fits in int.
1147         * callproc.c (child_setup): Rewrite to avoid two strlen calls.
1149         * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
1150         We prefer signed integers, even for size calculations.
1152         * emacs.c: Don't assume string length fits in 'int'.
1153         (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
1154         (main): Don't invoke strlen when not needed.
1156         * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
1157         (XD_DEBUG_MESSAGE): Don't waste a byte.
1159         * callproc.c (getenv_internal_1, getenv_internal)
1160         (Fgetenv_internal):
1161         * buffer.c (init_buffer): Don't assume string length fits in 'int'.
1163         * lread.c (invalid_syntax): Omit length argument.
1164         All uses changed.  This doesn't fix a bug, but it simplifies the
1165         code away from its former Hollerith-constant appearance, and it's
1166         one less 'int' to worry about when looking at integer-overflow issues.
1167         (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
1169         * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
1170         This didn't break anything, but it didn't help either.
1171         It's confusing to put a bogus integer in a place where the actual
1172         value does not matter.
1173         (LIST_END_P): Remove unused macro and its bogus comment.
1174         (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
1176         * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
1177         This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
1178         implementation.
1179         (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
1180         We prefer signed types, and the value cannot exceed the EMACS_INT
1181         range anyway (because otherwise the length would not be representable).
1182         (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
1183         not EMACS_UINT and EMACS_INT, when converting pointer to integer.
1184         This avoids a GCC warning when WIDE_EMACS_INT.
1186         * indent.c (sane_tab_width): New function.
1187         (current_column, scan_for_column, Findent_to, position_indentation)
1188         (compute_motion): Use it.  This is just for clarity.
1189         (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
1191         * image.c (xbm_image_p): Don't assume stated width, height fit in int.
1193         * lisp.h (lint_assume): New macro.
1194         * composite.c (composition_gstring_put_cache):
1195         * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
1197         * editfns.c, insdel.c:
1198         Omit unnecessary forward decls, to simplify future changes.
1200         * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
1202         * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
1204         * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
1205         Use much-faster test for byte-length change.
1206         Don't assume string byte-length fits in 'int'.
1207         Check that character arg fits in 'int'.
1208         (mapcar1): Declare byte as byte, for clarity.
1210         * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
1212         * fns.c (concat): Catch string overflow earlier.
1213         Do not rely on integer wraparound.
1215         * dispextern.h (struct it.overlay_strings_charpos)
1216         (struct it.selective): Now EMACS_INT, not int.
1217         * xdisp.c (forward_to_next_line_start)
1218         (back_to_previous_visible_line_start)
1219         (reseat_at_next_visible_line_start, next_element_from_buffer):
1220         Don't arbitrarily truncate the value of 'selective' to int.
1222         * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
1224         * composite.c: Don't truncate sizes to 'int'.
1225         (composition_gstring_p, composition_reseat_it)
1226         (composition_adjust_point): Use EMACS_INT, not int.
1227         (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
1228         not EMACS_UINT, for indexes.
1230         * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
1232         * buffer.c: Include <verify.h>.
1233         (struct sortvec.priority, struct sortstr.priority):
1234         Now EMACS_INT, not int.
1235         (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
1236         (struct sortstr.size, record_overlay_string)
1237         (struct sortstrlist.size, struct sortlist.used):
1238         Don't truncate size to int.
1239         (record_overlay_string): Check for size-calculation overflow.
1240         (init_buffer_once): Check at compile-time, not run-time.
1242 2011-06-22  Jim Meyering  <meyering@redhat.com>
1244         Don't leak an XBM-image-sized buffer
1245         * image.c (xbm_load): Free the image buffer after using it.
1247 2011-06-21  Paul Eggert  <eggert@cs.ucla.edu>
1249         Port to Sun C.
1250         * composite.c (find_automatic_composition): Omit needless 'return 0;'
1251         that Sun C diagnosed.
1252         * fns.c (secure_hash): Fix pointer signedness issue.
1253         * intervals.c (static_offset_intervals): New function.
1254         (offset_intervals): Use it.
1256 2011-06-21  Leo Liu  <sdl.web@gmail.com>
1258         * deps.mk (fns.o):
1259         * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
1260         sha512.h.
1262         * fns.c (secure_hash): Rename from crypto_hash_function and change
1263         the first arg to accept symbols.
1264         (Fsecure_hash): New primitive.
1265         (syms_of_fns): New symbols.
1267 2011-06-20  Deniz Dogan  <deniz@dogan.se>
1269         * process.c (Fset_process_buffer): Clarify return value in
1270         docstring.
1272 2011-06-18  Chong Yidong  <cyd@stupidchicken.com>
1274         * dispnew.c (add_window_display_history): Use BVAR.
1276         * xdisp.c (debug_method_add): Use BVAR.
1277         (check_window_end, dump_glyph_matrix, dump_glyph)
1278         (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
1280         * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
1281         Likewise.
1283         * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
1284         check till after the cache is created in init_frame_faces.
1286 2011-06-17  Stefan Monnier  <monnier@iro.umontreal.ca>
1288         * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
1290 2011-06-16  Paul Eggert  <eggert@cs.ucla.edu>
1292         * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
1293         Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
1294         hosts with pre-C99 libraries, because pD is wrongly defined to "t".
1296         Improve buffer-overflow checking (Bug#8873).
1297         * fileio.c (Finsert_file_contents):
1298         * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
1299         Remove the old (too-loose) buffer overflow checks.
1300         They weren't needed, since make_gap checks for buffer overflow.
1301         * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
1302         The old code merely checked for Emacs fixnum overflow, and relied
1303         on undefined (wraparound) behavior.  The new code avoids undefined
1304         behavior, and also checks for ptrdiff_t and/or size_t overflow.
1306         * editfns.c (Finsert_char): Don't dump core with very negative counts.
1307         Tune.  Don't use wider integers than needed.  Don't use alloca.
1308         Use a bigger 'string' buffer.  Rewrite to avoid 'n > 0' test.
1310         * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
1312         * insdel.c, lisp.h (buffer_overflow): New function.
1313         (insert_from_buffer_1, replace_range, replace_range_2):
1314         * insdel.c (make_gap_larger):
1315         * editfns.c (Finsert_char):
1316         * fileio.c (Finsert_file_contents): Use it, to normalize wording.
1318         * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
1320 2011-06-15  Paul Eggert  <eggert@cs.ucla.edu>
1322         Integer overflow and signedness fixes (Bug#8873).
1324         * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
1325         (GET_CCL_RANGE, IN_INT_RANGE): Use it.
1327         * fileio.c: Don't assume EMACS_INT fits in off_t.
1328         (emacs_lseek): New static function.
1329         (Finsert_file_contents, Fwrite_region): Use it.
1330         Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
1332         * fns.c (Fload_average): Don't assume 100 * load average fits in int.
1334         * fns.c: Don't overflow int when computing a list length.
1335         * fns.c (QUIT_COUNT_HEURISTIC): New constant.
1336         (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
1337         truncation on 64-bit hosts.  Check for QUIT every
1338         QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
1339         faster and is responsive enough.
1340         (Flength): Report an error instead of overflowing an integer.
1341         (Fsafe_length): Return a float if the value is not representable
1342         as a fixnum.  This shouldn't happen except in contrived situations.
1343         (Fnthcdr, Fsort): Don't assume list length fits in int.
1344         (Fcopy_sequence): Don't assume vector length fits in int.
1346         * alloc.c: Check that resized vectors' lengths fit in fixnums.
1347         (header_size, word_size): New constants.
1348         (allocate_vectorlike): Don't check size overflow here.
1349         (allocate_vector): Check it here instead, since this is the only
1350         caller of allocate_vectorlike that could cause overflow.
1351         Check that the new vector's length is representable as a fixnum.
1353         * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
1354         The previous code was bogus.  For example, next_almost_prime (32)
1355         returned 39, which is undesirable as it is a multiple of 3; and
1356         next_almost_prime (24) returned 25, which is a multiple of 5 so
1357         why was the code bothering to check for multiples of 7?
1359         * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
1361         * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
1363         Variadic C functions now count arguments with ptrdiff_t.
1364         This partly undoes my 2011-03-30 change, which replaced int with size_t.
1365         Back then I didn't know that the Emacs coding style prefers signed int.
1366         Also, in the meantime I found a few more instances where arguments
1367         were being counted with int, which may truncate counts on 64-bit
1368         machines, or EMACS_INT, which may be unnecessarily wide.
1369         * lisp.h (struct Lisp_Subr.function.aMANY)
1370         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
1371         Arg counts are now ptrdiff_t, not size_t.
1372         All variadic functions and their callers changed accordingly.
1373         (struct gcpro.nvars): Now size_t, not size_t.  All uses changed.
1374         * bytecode.c (exec_byte_code): Check maxdepth for overflow,
1375         to avoid potential buffer overrun.  Don't assume arg counts fit in 'int'.
1376         * callint.c (Fcall_interactively): Check arg count for overflow,
1377         to avoid potential buffer overrun.  Use signed char, not 'int',
1378         for 'varies' array, so that we needn't bother to check its size
1379         calculation for overflow.
1380         * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
1381         * eval.c (apply_lambda):
1382         * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
1383         (struct textprop_rec.argnum): Now ptrdiff_t, not int.  All uses changed.
1384         (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
1386         * callint.c (Fcall_interactively): Don't use index var as event count.
1388         * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
1389         * mem-limits.h (SIZE): Remove; no longer used.
1391         * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
1393         Remove unnecessary casts.
1394         * xterm.c (x_term_init):
1395         * xfns.c (x_set_border_pixel):
1396         * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
1397         These aren't needed now that we assume ANSI C.
1399         * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
1400         It's more likely to cause problems (due to unsigned overflow)
1401         than to cure them.
1403         * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
1405         * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
1407         * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
1409         * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
1411         * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
1413         * lread.c (Fload): Don't compare a possibly-garbage time_t value.
1415         GLYPH_CODE_FACE returns EMACS_INT, not int.
1416         * dispextern.h (merge_faces):
1417         * xfaces.c (merge_faces):
1418         * xdisp.c (get_next_display_element, next_element_from_display_vector):
1419         Don't assume EMACS_INT fits in int.
1421         * character.h (CHAR_VALID_P): Remove unused parameter.
1422         * fontset.c, lisp.h, xdisp.c: All uses changed.
1424         * editfns.c (Ftranslate_region_internal): Omit redundant test.
1426         * fns.c (concat): Minor tuning based on overflow analysis.
1427         This doesn't fix any bugs.  Use int to hold character, instead
1428         of constantly refetching from Emacs object.  Use XFASTINT, not
1429         XINT, for value known to be a character.  Don't bother comparing
1430         a single byte to 0400, as it's always less.
1432         * floatfns.c (Fexpt):
1433         * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
1435         * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
1436         for characters.
1438         * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
1440         * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
1441         Without this fix, on a 64-bit host (aset S 0 4294967386) would
1442         incorrectly succeed when S was a string, because 4294967386 was
1443         truncated before it was used.
1445         * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
1446         Otherwise, an out-of-range integer could cause undefined behavior
1447         on a 64-bit host.
1449         * composite.c: Use int, not EMACS_INT, for characters.
1450         (fill_gstring_body, composition_compute_stop_pos): Use int, not
1451         EMACS_INT, for values that are known to be in character range.
1452         This doesn't fix any bugs but is the usual style inside Emacs and
1453         may generate better code on 32-bit machines.
1455         Make sure a 64-bit char is never passed to ENCODE_CHAR.
1456         This is for reasons similar to the recent CHAR_STRING fix.
1457         * charset.c (Fencode_char): Check that character arg is actually
1458         a character.  Pass an int to ENCODE_CHAR.
1459         * charset.h (ENCODE_CHAR): Verify that the character argument is no
1460         wider than 'int', as a compile-time check to prevent future regressions
1461         in this area.
1463         * character.c (char_string): Remove unnecessary casts.
1465         Make sure a 64-bit char is never passed to CHAR_STRING.
1466         Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
1467         by silently ignoring the top 32 bits, allowing some values
1468         that were far too large to be valid characters.
1469         * character.h: Include <verify.h>.
1470         (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
1471         arguments are no wider than unsigned, as a compile-time check
1472         to prevent future regressions in this area.
1473         * data.c (Faset):
1474         * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
1475         (Fsubst_char_in_region):
1476         * fns.c (concat):
1477         * xdisp.c (decode_mode_spec_coding):
1478         Adjust to CHAR_STRING's new requirement.
1479         * editfns.c (Finsert_char, Fsubst_char_in_region):
1480         * fns.c (concat): Check that character args are actually
1481         characters.  Without this test, these functions did the wrong
1482         thing with wildly out-of-range values on 64-bit hosts.
1484         Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
1485         These casts should not be needed on 32-bit hosts, either.
1486         * keyboard.c (read_char):
1487         * lread.c (Fload): Remove casts to unsigned.
1489         * lisp.h (UNSIGNED_CMP): New macro.
1490         This fixes comparison bugs on 64-bit hosts.
1491         (ASCII_CHAR_P): Use it.
1492         * casefiddle.c (casify_object):
1493         * character.h (ASCII_BYTE_P, CHAR_VALID_P)
1494         (SINGLE_BYTE_CHAR_P, CHAR_STRING):
1495         * composite.h (COMPOSITION_ENCODE_RULE_VALID):
1496         * dispextern.h (FACE_FROM_ID):
1497         * keyboard.c (read_char): Use UNSIGNED_CMP.
1499         * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
1500         not to EMACS_INT, to avoid GCC warning.
1502         * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
1504         * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
1505         The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
1506         isn't needed on 32-bit machines.
1508         * buffer.c (Fgenerate_new_buffer_name):
1509         Use EMACS_INT for count, not int.
1510         (advance_to_char_boundary): Return EMACS_INT, not int.
1512         * data.c (Qcompiled_function): Now static.
1514         * window.c (window_body_lines): Now static.
1516         * image.c (gif_load): Rename local to avoid shadowing.
1518         * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
1519         (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
1520         * alloc.c (make_save_value): Integer argument is now of type
1521         ptrdiff_t, not int.
1522         (mark_object): Use ptrdiff_t, not int.
1523         * lisp.h (pD): New macro.
1524         * print.c (print_object): Use it.
1526         * alloc.c: Use EMACS_INT, not int, to count objects.
1527         (total_conses, total_markers, total_symbols, total_vector_size)
1528         (total_free_conses, total_free_markers, total_free_symbols)
1529         (total_free_floats, total_floats, total_free_intervals)
1530         (total_intervals, total_strings, total_free_strings):
1531         Now EMACS_INT, not int.  All uses changed.
1532         (Fgarbage_collect): Compute overall total using a double, so that
1533         integer overflow is less likely to be a problem.  Check for overflow
1534         when converting back to an integer.
1535         (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
1536         (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
1537         These were 'int' variables that could overflow on 64-bit hosts;
1538         they were never used, so remove them instead of repairing them.
1539         (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
1540         (inhibit_garbage_collection): Set gc_cons_threshold to max value.
1541         Previously, this ceilinged at INT_MAX, but that doesn't work on
1542         64-bit machines.
1543         (allocate_pseudovector): Don't use EMACS_INT when int would do.
1545         * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
1546         (allocate_vectorlike): Check for ptrdiff_t overflow.
1547         (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
1548         when a (possibly-narrower) signed value would do just as well.
1549         We prefer using signed arithmetic, to avoid comparison confusion.
1551         * alloc.c: Catch some string size overflows that we were missing.
1552         (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
1553         for convenience in STRING_BYTES_MAX.
1554         (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
1555         The definition here is exact; the one in lisp.h was approximate.
1556         (allocate_string_data): Check for string overflow.  This catches
1557         some instances we weren't catching before.  Also, it catches
1558         size_t overflow on (unusual) hosts where SIZE_MAX <= min
1559         (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
1560         and ptrdiff_t and EMACS_INT are both 64 bits.
1562         * character.c, coding.c, doprnt.c, editfns.c, eval.c:
1563         All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
1564         * lisp.h (STRING_BYTES_BOUND): Renamed from STRING_BYTES_MAX.
1566         * character.c (string_escape_byte8): Fix nbytes/nchars typo.
1568         * alloc.c (Fmake_string): Check for out-of-range init.
1570 2011-06-15  Stefan Monnier  <monnier@iro.umontreal.ca>
1572         * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
1574 2011-06-14  Jan Djärv  <jan.h.d@swipnet.se>
1576         * xfns.c (x_set_scroll_bar_default_width): Remove argument to
1577         xg_get_default_scrollbar_width.
1579         * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
1580         (int_gtk_range_get_value): Move to the scroll bar part of the file.
1581         (style_changed_cb): Call update_theme_scrollbar_width and call
1582         x_set_scroll_bar_default_width and xg_frame_set_char_size for
1583         all frames (Bug#8505).
1584         (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
1585         Call gtk_window_set_resizable if HAVE_GTK3.
1586         (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
1587         and height if HAVE_GTK3 (Bug#8505).
1588         (scroll_bar_width_for_theme): New variable.
1589         (update_theme_scrollbar_width): New function.
1590         (xg_get_default_scrollbar_width): Move code to
1591         update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
1592         (xg_initialize): Call update_theme_scrollbar_width.
1594         * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
1596         * emacsgtkfixed.c, emacsgtkfixed.h: New files.
1598 2011-06-12  Martin Rudalics  <rudalics@gmx.at>
1600         * frame.c (make_frame): Call other_buffer_safely instead of
1601         other_buffer.
1603         * window.c (temp_output_buffer_show): Call display_buffer with
1604         second argument Vtemp_buffer_show_specifiers and reset latter
1605         immediately after the call.
1606         (Vtemp_buffer_show_specifiers): New variable.
1607         (auto_window_vscroll_p, next_screen_context_lines)
1608         (Vscroll_preserve_screen_position): Remove leading asterisks from
1609         doc-strings.
1611 2011-06-12  Paul Eggert  <eggert@cs.ucla.edu>
1613         Fix minor problems found by GCC 4.6.0 static checking.
1614         * buffer.c (Qclone_number): Remove for now, as it's unused.
1615         (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
1616         (record_buffer): Remove unused local.
1617         * frame.c (other_visible_frames, frame_buffer_list): Now static.
1618         (set_frame_buffer_list): Remove; unused.
1619         * frame.h (other_visible_frames): Remove decl.
1620         * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
1621         * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
1622         (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
1623         if HAVE_GPM.
1624         * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
1625         * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
1626         Define only if HAVE_GPM.
1627         * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
1628         (update_hints_inhibit): Remove; never set.  All uses removed.
1629         * widgetprv.h (emacsFrameClassRec): Remove decl.
1630         * window.c (delete_deletable_window): Now returns void, since it
1631         wasn't returning anything.
1632         (compare_window_configurations): Remove unused locals.
1633         * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
1634         * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
1635         (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
1636         the same widths as pointers.  This follows up on the 2011-05-06 patch.
1637         * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
1638         * xterm.h: Likewise.
1639         (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
1641 2011-06-12  Juanma Barranquero  <lekktu@gmail.com>
1643         * makefile.w32-in: Update dependencies.
1644         (LISP_H): Add lib/intprops.h.
1646 2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
1648         * image.c (gif_load): Add animation frame delay to the metadata.
1649         (syms_of_image): Use DEFSYM.  New symbol `delay'.
1651 2011-06-11  Martin Rudalics  <rudalics@gmx.at>
1653         * window.c (delete_deletable_window): Re-add.
1654         (Fset_window_configuration): Rewrite to handle dead buffers and
1655         consequently deletable windows.
1656         (window_tree, Fwindow_tree): Remove.  Supply functionality in
1657         window.el.
1658         (compare_window_configurations): Simplify code.
1660 2011-06-11  Andreas Schwab  <schwab@linux-m68k.org>
1662         * image.c (imagemagick_load_image): Fix type mismatch.
1663         (Fimagemagick_types): Likewise.
1665         * window.h (replace_buffer_in_windows): Declare.
1667 2011-06-11  Martin Rudalics  <rudalics@gmx.at>
1669         * buffer.c: New Lisp objects Qbuffer_list_update_hook and
1670         Qclone_number.  Remove external declaration of Qdelete_window.
1671         (Fbuffer_list): Rewrite doc-string.  Minor restructuring of
1672         code.
1673         (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer): Run
1674         Qbuffer_list_update_hook if allowed.
1675         (Fother_buffer): Rewrite doc-string.  Major rewrite for new
1676         buffer list implementation.
1677         (other_buffer_safely): New function.
1678         (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
1679         calls to replace_buffer_in_windows and
1680         replace_buffer_in_windows_safely.  Run Qbuffer_list_update_hook
1681         if allowed.
1682         (record_buffer): Inhibit quitting and rewrite using quittable
1683         functions.  Run Qbuffer_list_update_hook if allowed.
1684         (Frecord_buffer, Funrecord_buffer): New functions.
1685         (switch_to_buffer_1, Fswitch_to_buffer): Remove.  Move
1686         switch-to-buffer to window.el.
1687         (bury-buffer): Move to window.el.
1688         (Vbuffer_list_update_hook): New variable.
1690         * lisp.h (other_buffer_safely): Add prototype in buffer.c
1691         section.
1693         * window.h (resize_frame_windows): Move up in code.
1694         (Fwindow_frame): Remove EXFUN.
1695         (replace_buffer_in_all_windows): Remove prototype.
1696         (replace_buffer_in_windows_safely): Add prototype.
1698         * window.c: Declare Qdelete_window static again.  Move down
1699         declaration of select_count.
1700         (Fnext_window, Fprevious_window): Rewrite doc-strings.
1701         (Fother_window): Move to window.el.
1702         (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
1703         cases.  Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
1704         (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
1705         window.el.
1706         (replace_buffer_in_windows): Implement by calling
1707         Qreplace_buffer_in_windows.
1708         (replace_buffer_in_all_windows): Remove with some functionality
1709         moved into replace_buffer_in_windows_safely.
1710         (replace_buffer_in_windows_safely): New function.
1711         (select_window_norecord, select_frame_norecord): Move in front
1712         of run_window_configuration_change_hook.  Remove now obsolete
1713         declarations.
1714         (Fset_window_buffer): Rewrite doc-string.  Call
1715         Qrecord_window_buffer.
1716         (keys_of_window): Move binding for other-window to window.el.
1718 2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
1720         * dispextern.h (struct image): Replace data member, whose int_val
1721         and ptr_val fields were not used by anything, with a single
1722         lisp_val object.
1724         * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
1725         (gif_clear_image, gif_load, imagemagick_load_image)
1726         (gs_clear_image, gs_load): Callers changed.
1728 2011-06-10  Paul Eggert  <eggert@cs.ucla.edu>
1730         * buffer.h: Include <time.h>, for time_t.
1731         Needed to build on FreeBSD 8.2.  Problem reported by Herbert J. Skuhra.
1733         Fix minor problems found by static checking.
1735         * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
1737         Make identifiers static if they are not used in other modules.
1738         * data.c (Qcompiled_function, Qframe, Qvector):
1739         * image.c (QimageMagick, Qsvg):
1740         * minibuf.c (Qmetadata):
1741         * window.c (resize_window_check, resize_root_window): Now static.
1742         * window.h (resize_window_check, resize_root_window): Remove decls.
1744         * window.c (window_deletion_count, delete_deletable_window):
1745         Remove; unused.
1746         (window_body_lines): Now static.
1747         (Fdelete_other_windows_internal): Mark vars as initialized.
1748         Make sure 'resize_failed' is initialized.
1749         (run_window_configuration_change_hook): Rename local to avoid shadowing.
1750         (resize_window_apply): Remove unused local.
1751         * window.h (delete_deletable_window): Remove decl.
1753         * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
1754         (imagemagick_load_image): Fix pointer signedness problem by changing
1755         last arg from unsigned char * to char *.  All uses changed.
1756         Also, fix a local for similar reasons.
1757         Remove unused locals.  Remove locals to avoid shadowing.
1758         (fn_rsvg_handle_free): Remove; unused.
1759         (svg_load, svg_load_image): Fix pointer signedness problem.
1760         (imagemagick_load_image): Don't use garbage pointer image_wand.
1762         * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
1764 2011-06-10  Chong Yidong  <cyd@stupidchicken.com>
1766         * image.c (gif_load): Fix omitted cast error introduced by
1767         2011-06-06 change.
1769 2011-06-10  Martin Rudalics  <rudalics@gmx.at>
1771         * window.h (resize_proportionally, orig_total_lines)
1772         (orig_top_line): Remove from window structure.
1773         (set_window_height, set_window_width, change_window_heights)
1774         (Fdelete_window): Remove prototypes.
1775         (resize_frame_windows): Remove duplicate declaration.
1777 2011-06-10  Eli Zaretskii  <eliz@gnu.org>
1779         * window.h (resize_frame_windows, resize_window_check)
1780         (delete_deletable_window, resize_root_window)
1781         (resize_frame_windows): Declare prototypes.
1783         * window.c (resize_window_apply): Make definition be "static" to
1784         match the prototype.
1786 2011-06-10  Martin Rudalics  <rudalics@gmx.at>
1788         * window.c: Remove declarations of Qwindow_size_fixed,
1789         window_min_size_1, window_min_size_2, window_min_size,
1790         size_window, window_fixed_size_p, enlarge_window, delete_window.
1791         Remove static from declaration of Qdelete_window, it's
1792         temporarily needed by Fbury_buffer.
1793         (replace_window): Don't assign orig_top_line and
1794         orig_total_lines.
1795         (Fdelete_window, delete_window): Remove.  Window deletion is
1796         handled by window.el.
1797         (window_loop): Remove DELETE_OTHER_WINDOWS case.  Replace
1798         Fdelete_window calls with calls to Qdelete_window.
1799         (Fdelete_other_windows): Remove.  Deleting other windows is
1800         handled by window.el.
1801         (window_fixed_size_p): Remove.  Fixed-sizeness of windows is
1802         handled in window.el.
1803         (window_min_size_2, window_min_size_1, window_min_size): Remove.
1804         Window minimum sizes are handled in window.el.
1805         (shrink_windows, size_window, set_window_height)
1806         (set_window_width, change_window_heights, window_height)
1807         (window_width, CURBEG, CURSIZE, enlarge_window)
1808         (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
1809         (Fenlarge_window, Fshrink_window): Remove.  Window resizing is
1810         handled in window.el.
1811         (make_dummy_parent): Rename to make_parent_window and give it a
1812         second argument horflag.
1813         (make_window): Don't set resize_proportionally any more.
1814         (Fsplit_window): Remove.  Windows are split in window.el.
1815         (save_restore_action, save_restore_orig_size)
1816         (shrink_window_lowest_first, save_restore_orig_size): Remove.
1817         Resize mini windows in window.el.
1818         (grow_mini_window, shrink_mini_window): Implement by calling
1819         Qresize_root_window_vertically, resize_window_check and
1820         resize_window_apply.
1821         (saved_window, Fset_window_configuration, save_window_save): Do
1822         not handle orig_top_line, orig_total_lines, and
1823         resize_proportionally.
1824         (window_min_height, window_min_width): Move to window.el.
1825         (keys_of_window): Move bindings for delete-other-windows,
1826         split-window, delete-window and enlarge-window to window.el.
1828         * buffer.c: Temporarily extern Qdelete_window.
1829         (Fbury_buffer): Temporarily call Qdelete_window instead of
1830         Fdelete_window (Fbury_buffer will move to window.el soon).
1832         * frame.c (set_menu_bar_lines_1): Remove code handling
1833         orig_top_line and orig_total_lines.
1835         * dispnew.c (adjust_frame_glyphs_initially): Don't use
1836         set_window_height but set heights directly.
1837         (change_frame_size_1): Use resize_frame_windows.
1839         * xdisp.c (init_xdisp): Don't use set_window_height but set
1840         heights directly.
1842         * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines): Use
1843         resize_frame_windows instead of change_window_heights and run
1844         run_window_configuration_change_hook.
1846         * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
1847         instead of change_window_heights and run
1848         run_window_configuration_change_hook.
1850 2011-06-09  Martin Rudalics  <rudalics@gmx.at>
1852         * window.c (replace_window): Rename second argument REPLACEMENT to
1853         NEW.  New third argument SETFLAG.  Rewrite.
1854         (delete_window, make_dummy_parent): Call replace_window with
1855         third argument 1.
1856         (window_list_1): Move down in code.
1857         (run_window_configuration_change_hook): Move set_buffer part
1858         before select_frame_norecord part in order to unwind correctly.
1859         Rename count1 to count.
1860         (recombine_windows, delete_deletable_window, resize_root_window)
1861         (Fdelete_other_windows_internal)
1862         (Frun_window_configuration_change_hook, make_parent_window)
1863         (resize_window_check, resize_window_apply, Fresize_window_apply)
1864         (resize_frame_windows, Fsplit_window_internal)
1865         (Fdelete_window_internal, Fresize_mini_window_internal): New
1866         functions.
1867         (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
1869 2011-06-08  Martin Rudalics  <rudalics@gmx.at>
1871         * window.h (window): Add some new members to window structure -
1872         normal_lines, normal_cols, new_total, new_normal, clone_number,
1873         splits, nest, prev_buffers, next_buffers.
1874         (WINDOW_TOTAL_SIZE): Move here from window.c.
1875         (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
1877         * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
1878         Remove.
1879         (make_dummy_parent): Set new members of windows structure.
1880         (make_window): Move down in code.  Handle new members of window
1881         structure.
1882         (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
1883         (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
1884         (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
1885         (Fset_window_prev_buffers, Fwindow_next_buffers)
1886         (Fset_window_next_buffers, Fset_window_clone_number): New
1887         functions.
1888         (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
1889         (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
1890         Doc-string fixes.
1891         (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
1892         Argument WINDOW can be now internal window too.
1893         (Fwindow_use_time): Move up in code.
1894         (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
1895         Rewrite doc-string.
1896         (Fset_window_configuration, saved_window)
1897         (Fcurrent_window_configuration, save_window_save): Handle new
1898         members of window structure.
1899         (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
1900         (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
1901         (syms_of_window): New Lisp objects Qrecord_window_buffer,
1902         Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
1903         Qget_mru_window, Qresize_root_window,
1904         Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
1905         Qauto_buffer_name; staticpro them.
1907 2011-06-07  Martin Rudalics  <rudalics@gmx.at>
1909         * window.c (Fwindow_total_size, Fwindow_left_column)
1910         (Fwindow_top_line, window_body_lines, Fwindow_body_size)
1911         (Fwindow_list_1): New functions.
1912         (window_box_text_cols): Replace with window_body_cols.
1913         (Fwindow_width, Fscroll_left, Fscroll_right): Use
1914         window_body_cols instead of window_box_text_cols.
1915         (delete_window, Fset_window_configuration): Call
1916         delete_all_subwindows with window as argument.
1917         (delete_all_subwindows): Take a window as argument and not a
1918         structure.  Rewrite.
1919         (window_loop): Remove handling of GET_LRU_WINDOW and
1920         GET_LARGEST_WINDOW.
1921         (Fget_lru_window, Fget_largest_window): Move to window.el.
1923         * window.h: Extern window_body_cols instead of
1924         window_box_text_cols.  delete_all_subwindows now takes a
1925         Lisp_Object as argument.
1927         * indent.c (compute_motion, Fcompute_motion): Use
1928         window_body_cols instead of window_box_text_cols.
1930         * frame.c (delete_frame): Call delete_all_subwindows with root
1931         window as argument.
1933 2011-06-07  Daniel Colascione  <dan.colascione@gmail.com>
1935         * fns.c (Fputhash): Document return value.
1937 2011-06-06  Chong Yidong  <cyd@stupidchicken.com>
1939         * image.c (gif_load): Implement gif89a spec "no disposal" method.
1941 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
1943         Cons<->int and similar integer overflow fixes (Bug#8794).
1945         Check for overflow when converting integer to cons and back.
1946         * charset.c (Fdefine_charset_internal, Fdecode_char):
1947         Use cons_to_unsigned to catch overflow.
1948         (Fencode_char): Use INTEGER_TO_CONS.
1949         * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
1950         (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
1951         * data.c (long_to_cons, cons_to_long): Remove.
1952         (cons_to_unsigned, cons_to_signed): New functions.
1953         These signal an error for invalid or out-of-range values.
1954         * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
1955         * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
1956         * font.c (Ffont_variation_glyphs):
1957         * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
1958         * lisp.h: Include <intprops.h>.
1959         (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
1960         (cons_to_signed, cons_to_unsigned): New decls.
1961         (long_to_cons, cons_to_long): Remove decls.
1962         * undo.c (record_first_change): Use INTEGER_TO_CONS.
1963         (Fprimitive_undo): Use CONS_TO_INTEGER.
1964         * xfns.c (Fx_window_property): Likewise.
1965         * xselect.c: Include <limits.h>.
1966         (x_own_selection, selection_data_to_lisp_data):
1967         Use INTEGER_TO_CONS.
1968         (x_handle_selection_request, x_handle_selection_clear)
1969         (x_get_foreign_selection, Fx_disown_selection_internal)
1970         (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
1971         (lisp_data_to_selection_data): Use cons_to_unsigned.
1972         (x_fill_property_data): Use cons_to_signed.
1973         Report values out of range.
1975         Check for buffer and string overflow more precisely.
1976         * buffer.h (BUF_BYTES_MAX): New macro.
1977         * lisp.h (STRING_BYTES_MAX): New macro.
1978         * alloc.c (Fmake_string):
1979         * character.c (string_escape_byte8):
1980         * coding.c (coding_alloc_by_realloc):
1981         * doprnt.c (doprnt):
1982         * editfns.c (Fformat):
1983         * eval.c (verror):
1984         Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
1985         since they may not be the same number.
1986         * editfns.c (Finsert_char):
1987         * fileio.c (Finsert_file_contents):
1988         Likewise for BUF_BYTES_MAX.
1990         * image.c: Use ptrdiff_t, not int, for sizes.
1991         (slurp_file): Switch from int to ptrdiff_t.
1992         All uses changed.
1993         (slurp_file): Check that file size fits in both size_t (for
1994         malloc) and ptrdiff_t (for sanity and safety).
1996         * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
1997         if b->modtime has its maximal value.
1999         * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
2001         Don't assume time_t can fit into int.
2002         * buffer.h (struct buffer.modtime): Now time_t, not int.
2003         * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
2004         * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
2006         Minor fixes for signed vs unsigned integers.
2007         * character.h (MAYBE_UNIFY_CHAR):
2008         * charset.c (maybe_unify_char):
2009         * keyboard.c (read_char, reorder_modifiers):
2010         XINT -> XFASTINT, since the integer must be nonnegative.
2011         * ftfont.c (ftfont_spec_pattern):
2012         * keymap.c (access_keymap, silly_event_symbol_error):
2013         XUINT -> XFASTINT, since the integer must be nonnegative.
2014         (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
2015         since it makes no difference and we prefer signed.
2016         * keyboard.c (record_char): Use XUINT when all the neighbors do.
2017         (access_keymap): NATNUMP -> INTEGERP, since the integer must be
2018         nonnegative.
2020 2011-06-06  Stefan Monnier  <monnier@iro.umontreal.ca>
2022         * window.h (Fwindow_frame): Declare.
2024 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
2026         * alloc.c: Simplify handling of large-request failures (Bug#8800).
2027         (SPARE_MEMORY): Always define.
2028         (LARGE_REQUEST): Remove.
2029         (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
2031 2011-06-06  Martin Rudalics  <rudalics@gmx.at>
2033         * lisp.h: Move EXFUNS for Fframe_root_window,
2034         Fframe_first_window and Fset_frame_selected_window to window.h.
2036         * window.h: Move EXFUNS for Fframe_root_window,
2037         Fframe_first_window and Fset_frame_selected_window here from
2038         lisp.h.
2040         * frame.c (Fwindow_frame, Fframe_first_window)
2041         (Fframe_root_window, Fframe_selected_window)
2042         (Fset_frame_selected_window): Move to window.c.
2043         (Factive_minibuffer_window): Move to minibuf.c.
2044         (Fother_visible_frames_p): New function.
2046         * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
2048         * window.c (decode_window, decode_any_window): Move up in code.
2049         (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
2050         (inhibit_frame_unsplittable): Remove unused variable.
2051         (Fwindow_buffer): Move up and rewrite doc-string.
2052         (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
2053         (Fwindow_prev): New functions.
2054         (Fwindow_frame): Move here from frame.c.  Accept any window as
2055         argument.
2056         (Fframe_root_window, Fframe_first_window)
2057         (Fframe_selected_window): Move here from frame.c.  Accept frame
2058         or arbitrary window as argument.  Update doc-strings.
2059         (Fminibuffer_window): Move up in code.
2060         (Fwindow_minibuffer_p): Move up in code and simplify.
2061         (Fset_frame_selected_window): Move here from frame.c.
2062         Marginal rewrite.
2063         (Fselected_window, select_window, Fselect_window): Move up in
2064         code.  Minor doc-string fixes.
2066 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
2068         * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
2069         Do not assume that spare memory exists; that assumption is valid
2070         only if SYSTEM_MALLOC.
2071         (LARGE_REQUEST): New macro, so that the issue of large requests
2072         is separated from the issue of spare memory.
2074 2011-06-05  Andreas Schwab  <schwab@linux-m68k.org>
2076         * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
2077         format.  (Bug#8806)
2079         * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
2081         * xfns.c (x_set_scroll_bar_default_width): Move declarations
2082         before statements.
2084 2011-06-05  Jan Djärv  <jan.h.d@swipnet.se>
2086         * gtkutil.c (xg_get_default_scrollbar_width): New function.
2088         * gtkutil.h: Declare xg_get_default_scrollbar_width.
2090         * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
2091         min width by calling x_set_scroll_bar_default_width (Bug#8505).
2093 2011-06-05  Juanma Barranquero  <lekktu@gmail.com>
2095         * xdisp.c (single_display_spec_intangible_p): Remove declaration.
2097 2011-06-04  Chong Yidong  <cyd@stupidchicken.com>
2099         * xselect.c (x_clipboard_manager_save): Remove redundant arg.
2100         (x_clipboard_manager_save): Add return value.
2101         (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
2102         New error handlers.
2103         (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
2104         Obey Vx_select_enable_clipboard_manager.  Catch errors in
2105         x_clipboard_manager_save (Bug#8779).
2106         (Vx_select_enable_clipboard_manager): New variable.
2107         (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
2109 2011-06-04  Dan Nicolaescu  <dann@ics.uci.edu>
2111         * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
2113 2011-06-04  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
2115         * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
2116         in the current matrix if keep_current_p is non-zero.
2118 2011-06-04  Eli Zaretskii  <eliz@gnu.org>
2120         * bidi.c (bidi_level_of_next_char): Fix last change.
2122 2011-06-03  Eli Zaretskii  <eliz@gnu.org>
2124         Support bidi reordering of text covered by display properties.
2126         * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
2127         (bidi_fetch_char, bidi_fetch_char_advance): New functions.
2128         (bidi_cache_search, bidi_cache_iterator_state)
2129         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
2130         (bidi_level_of_next_char, bidi_move_to_visually_next):
2131         Support character positions inside a run of characters covered by a
2132         display string.
2133         (bidi_paragraph_init, bidi_resolve_explicit_1)
2134         (bidi_level_of_next_char): Call bidi_fetch_char and
2135         bidi_fetch_char_advance instead of FETCH_CHAR and
2136         FETCH_CHAR_ADVANCE.
2137         (bidi_init_it): Initialize new members.
2138         (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
2139         definitions.
2140         (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
2141         instead of using explicit *_CHAR codes.
2142         (bidi_resolve_explicit, bidi_resolve_weak):
2143         Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
2144         bidirectional text is supported only in multibyte buffers.
2145         (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
2146         it to initialize the frame_window_p member of struct bidi_it.
2147         (bidi_cache_iterator_state, bidi_resolve_explicit_1)
2148         (bidi_resolve_explicit, bidi_resolve_weak)
2149         (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
2150         bidi_it->nchars is non-positive.
2151         (bidi_level_of_next_char): Don't try to lookup the cache for the
2152         next/previous character if nothing is cached there yet, or if we
2153         were just reseat()'ed to a new position.
2155         * xdisp.c (set_cursor_from_row): Set start and stop points
2156         according to the row's direction when priming the loop that looks
2157         for the glyph on which to display cursor.
2158         (single_display_spec_intangible_p): Function deleted.
2159         (display_prop_intangible_p): Reimplement to call
2160         handle_display_spec instead of single_display_spec_intangible_p.
2161         Accept 3 additional arguments needed by handle_display_spec.
2162         This fixes incorrect cursor motion across display property with complex
2163         values: lists, `(when COND...)' forms, etc.
2164         (single_display_spec_string_p): Support property values that are
2165         lists with the argument STRING its top-level element.
2166         (display_prop_string_p): Fix the condition for processing a
2167         property that is a list to be consistent with handle_display_spec.
2168         (handle_display_spec): New function, refactored from the
2169         last portion of handle_display_prop.
2170         (compute_display_string_pos): Accept additional argument
2171         FRAME_WINDOW_P.  Call handle_display_spec to determine whether the
2172         value of a `display' property is a "replacing spec".
2173         (handle_single_display_spec): Accept 2 additional arguments BUFPOS
2174         and FRAME_WINDOW_P.  If IT is NULL, don't set up the iterator from
2175         the display property, but just return a value indicating whether
2176         the display property will replace the characters it covers.
2177         (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
2178         frame_window_p members of struct bidi_it.
2179         (compute_display_string_pos, compute_display_string_end):
2180         New functions.
2181         (push_it): Accept second argument POSITION, where pop_it should
2182         jump to continue iteration.
2183         (reseat_1): Initialize bidi_it.disp_pos.
2185         * keyboard.c (adjust_point_for_property): Adjust the call to
2186         display_prop_intangible_p to its new signature.
2188         * dispextern.h (struct bidi_it): New member frame_window_p.
2189         (bidi_init_it): Update prototypes.
2190         (display_prop_intangible_p): Update prototype.
2191         (compute_display_string_pos, compute_display_string_end):
2192         Declare prototypes.
2193         (struct bidi_it): New members nchars and disp_pos.  ch_len is now
2194         EMACS_INT.
2196 2011-06-02  Paul Eggert  <eggert@cs.ucla.edu>
2198         Malloc failure behavior now depends on size of allocation.
2199         * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
2200         * lisp.h: Change signatures accordingly.
2201         * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
2202         All callers changed.  (Bug#8762)
2204         * gnutls.c: Use Emacs's memory allocators.
2205         Without this change, the gnutls library would invoke malloc etc.
2206         directly, which causes problems on non-SYNC_INPUT hosts, and which
2207         runs afoul of improving memory_full behavior.  (Bug#8761)
2208         (fn_gnutls_global_set_mem_functions): New macro or function pointer.
2209         (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
2210         xfree instead of the default malloc, realloc, free.
2211         (Fgnutls_boot): No need to check for memory allocation failure,
2212         since xmalloc does that for us.
2214         Remove arbitrary limit of 2**31 entries in hash tables.  (Bug#8771)
2215         * category.c (hash_get_category_set):
2216         * ccl.c (ccl_driver):
2217         * charset.c (Fdefine_charset_internal):
2218         * charset.h (struct charset.hash_index):
2219         * composite.c (get_composition_id, gstring_lookup_cache)
2220         (composition_gstring_put_cache):
2221         * composite.h (struct composition.hash_index):
2222         * dispextern.h (struct image.hash):
2223         * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
2224         (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
2225         (hashfn_equal, hashfn_user_defined, make_hash_table)
2226         (maybe_resize_hash_table, hash_lookup, hash_put)
2227         (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
2228         (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
2229         (Fsxhash, Fgethash, Fputhash, Fmaphash):
2230         * image.c (make_image, search_image_cache, lookup_image)
2231         (xpm_put_color_table_h):
2232         * lisp.h (struct Lisp_Hash_Table):
2233         * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
2234         * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
2235         for hashes and hash indexes, instead of 'unsigned' and 'int'.
2236         * alloc.c (allocate_vectorlike):
2237         Check for overflow in vector size calculations.
2238         * ccl.c (ccl_driver):
2239         Check for overflow when converting EMACS_INT to int.
2240         * fns.c, image.c: Remove unnecessary static decls that would otherwise
2241         need to be updated by these changes.
2242         * fns.c (make_hash_table, maybe_resize_hash_table):
2243         Check for integer overflow with large hash tables.
2244         (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
2245         Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
2246         (SXHASH_REDUCE): New macro.
2247         (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
2248         Use it instead of discarding useful hash info with large hash values.
2249         (sxhash_float): New function.
2250         (sxhash): Use it.  No more need for "& INTMASK" due to above changes.
2251         * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
2252         (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
2253         Rewrite to use FIXNUM_BITS, as this simplifies things.
2254         (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
2255         Adjust signatures to match updated version of code.
2256         (consing_since_gc): Now EMACS_INT, since a single hash table can
2257         use more than INT_MAX bytes.
2259 2011-06-01  Dan Nicolaescu  <dann@ics.uci.edu>
2261         Make it possible to build with GCC-4.6+ -O2 -flto.
2263         * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
2265 2011-06-01  Stefan Monnier  <monnier@iro.umontreal.ca>
2267         * minibuf.c (get_minibuffer, read_minibuf_unwind):
2268         Call minibuffer-inactive-mode.
2270 2011-05-31  Juanma Barranquero  <lekktu@gmail.com>
2272         * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
2273         Update dependencies.
2275 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
2277         * data.c (init_data): Remove code for UTS, this system is not
2278         supported anymore.
2280 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
2282         Don't force ./temacs to start in terminal mode.
2284         * frame.c (make_initial_frame): Initialize faces in all cases, not
2285         only when CANNOT_DUMP is defined.
2286         * dispnew.c (init_display): Remove CANNOT_DUMP condition.
2288 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
2290         * dispnew.c (add_window_display_history): Use const for the string
2291         pointer.  Remove declaration, not needed.
2293 2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
2295         Use 'inline', not 'INLINE'.
2296         <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
2297         * alloc.c, fontset.c (INLINE): Remove.
2298         * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
2299         * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
2300         * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
2301         * gmalloc.c (register_heapinfo): Use inline unconditionally.
2302         * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
2304 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
2306         Make it possible to run ./temacs.
2308         * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
2309         syms_of_callproc does the same thing.  Remove test for
2310         "initialized", do it in the caller.
2311         * emacs.c (main): Avoid calling set_initial_environment when dumping.
2313 2011-05-31  Stefan Monnier  <monnier@iro.umontreal.ca>
2315         * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
2316         (read_minibuf): Use get_minibuffer.
2317         (syms_of_minibuf): Use DEFSYM.
2318         (Qmetadata): New var.
2319         * data.c (Qbuffer): Don't make it static.
2320         (syms_of_data): Use DEFSYM.
2322 2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
2324         * ccl.c (CCL_CODE_RANGE): Allow negative numbers.  (Bug#8751)
2325         (CCL_CODE_MIN): New macro.
2327 2011-05-30  Paul Eggert  <eggert@cs.ucla.edu>
2329         * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
2331         * eval.c (Qdebug): Now static.
2332         * lisp.h (Qdebug): Remove decl.  This reverts a part of the
2333         2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
2334         2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
2336 2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
2338         * image.c: Various fixes to ImageMagick code comments.
2339         (Fimagemagick_types): Doc fix.
2341 2011-05-29  Paul Eggert  <eggert@cs.ucla.edu>
2343         Minor fixes prompted by GCC 4.6.0 warnings.
2345         * xselect.c (converted_selections, conversion_fail_tag): Now static.
2347         * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
2348         (x_clipboard_manager_save_all): Move extern decl to ...
2349         * xterm.h: ... here, so that it can be checked for consistency.
2351 2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
2353         * xselect.c (x_clipboard_manager_save_frame)
2354         (x_clipboard_manager_save_all): New functions.
2355         (Fx_clipboard_manager_save): Lisp function deleted.
2357         * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
2358         * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
2360         * xterm.h: Update prototype.
2362 2011-05-28  William Xu  <william.xwl@gmail.com>
2364         * nsterm.m (ns_term_shutdown): Synchronize user defaults before
2365         exiting (Bug#8239).
2367 2011-05-28  Jim Meyering  <meyering@redhat.com>
2369         Avoid a sign-extension bug in crypto_hash_function.
2370         * fns.c (to_uchar): Define.
2371         (crypto_hash_function): Use it to convert some newly-signed
2372         variables to unsigned, to avoid sign-extension bugs.  For example,
2373         without this change, (md5 "truc") would evaluate to
2374         45723a2aff78ff4fff7fff1114760e62 rather than the expected
2375         45723a2af3788c4ff17f8d1114760e62.  Reported by Antoine Levitt in
2376         https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
2378 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
2380         Integer overflow fixes.
2382         * dbusbind.c: Serial number integer overflow fixes.
2383         (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
2384         (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
2385         to hold a serial number that is too large for a fixnum.
2386         (Fdbus_method_return_internal, Fdbus_method_error_internal):
2387         Check for serial numbers out of range.  Decode any serial number
2388         that was so large that it became a float.  (Bug#8722)
2390         * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
2391         (Fdbus_call_method, Fdbus_call_method_asynchronously):
2392         Use XFASTINT rather than XUINT when numbers are nonnegative.
2393         (xd_append_arg, Fdbus_method_return_internal):
2394         (Fdbus_method_error_internal): Likewise.  Also, for unsigned
2395         arguments, check that Lisp number is nonnegative, rather than
2396         silently wrapping negative numbers around.  (Bug#8722)
2397         (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
2398         (Bug#8722)
2400         * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
2402         * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
2404         ccl: add integer overflow checks
2405         * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
2406         (IN_INT_RANGE): New macros.
2407         (ccl_driver): Use them to check for integer overflow when
2408         decoding a CCL program.  Many of the new checks are whether XINT (x)
2409         fits in int; it doesn't always, on 64-bit hosts.  The new version
2410         doesn't catch all possible integer overflows, but it's an
2411         improvement.  (Bug#8719)
2413         * alloc.c (make_event_array): Use XINT, not XUINT.
2414         There's no need for unsigned here.
2416         * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
2417         This follows up to the 2011-05-06 change that substituted uintptr_t
2418         for EMACS_INT.  This case wasn't caught back then.
2420         Rework Fformat to avoid integer overflow issues.
2421         * editfns.c: Include <float.h> unconditionally, as it's everywhere
2422         now (part of C89).  Include <verify.h>.
2423         (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
2424         (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
2425         (Fformat): Avoid the prepass trying to compute sizes; it was only
2426         approximate and thus did not catch overflow reliably.  Instead, walk
2427         through the format just once, formatting and computing sizes as we go,
2428         checking for integer overflow at every step, and allocating a larger
2429         buffer as needed.  Keep track separately whether the format is
2430         multibyte.  Keep only the most-recently calculated precision, rather
2431         than them all.  Record whether each argument has been converted to
2432         string.  Use EMACS_INT, not int, for byte and char and arg counts.
2433         Support field widths and precisions larger than INT_MAX.  Avoid
2434         sprintf's undefined behavior with conversion specifications such as %#d
2435         and %.0c.  Fix bug with strchr succeeding on '\0' when looking for
2436         flags.  Fix bug with (format "%c" 256.0).  Avoid integer overflow when
2437         formatting out-of-range floating point numbers with int
2438         formats.  (Bug#8668)
2440         * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
2442         * data.c: Avoid integer truncation in expressions involving floats.
2443         * data.c: Include <intprops.h>.
2444         (arith_driver): When there's an integer overflow in an expression
2445         involving floating point, convert the integers to floating point
2446         so that the resulting value does not suffer from catastrophic
2447         integer truncation.  For example, on a 64-bit host (* 4
2448         most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
2449         Do not rely on undefined behavior after integer overflow.
2451         merge count_size_as_multibyte, parse_str_to_multibyte
2452         * character.c, character.h (count_size_as_multibyte):
2453         Rename from parse_str_to_multibyte; all uses changed.
2454         Check for integer overflow.
2455         * insdel.c, lisp.h (count_size_as_multibyte): Remove,
2456         since it's now a duplicate of the other.  This is more of
2457         a character than a buffer op, so better that it's in character.c.
2458         * fns.c, print.c: Adjust to above changes.
2460 2011-05-27  Stefan Monnier  <monnier@iro.umontreal.ca>
2462         * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
2464 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
2466         * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
2467         (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
2468         (x_clipboard_manager_save): Now static.
2469         (Fx_clipboard_manager_save): Rename local to avoid shadowing.
2471         * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
2472         (crypto_hash_function): Now static.
2473         Fix pointer signedness problems.  Avoid unnecessary initializations.
2475 2011-05-27  Chong Yidong  <cyd@stupidchicken.com>
2477         * termhooks.h (Vselection_alist): Make it terminal-local.
2479         * terminal.c (create_terminal): Initialize it.
2481         * xselect.c: Support for clipboard managers.
2482         (Vselection_alist): Move to termhooks.h as terminal-local var.
2483         (LOCAL_SELECTION): New macro.
2484         (x_atom_to_symbol): Handle x_display_info_for_display fail case.
2485         (symbol_to_x_atom): Remove gratuitous arg.
2486         (x_handle_selection_request, lisp_data_to_selection_data)
2487         (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
2488         (x_own_selection, x_get_local_selection, x_convert_selection):
2489         New arg, specifying work frame.  Use terminal-local Vselection_alist.
2490         (some_frame_on_display): Delete unused function.
2491         (Fx_own_selection_internal, Fx_get_selection_internal)
2492         (Fx_disown_selection_internal, Fx_selection_owner_p)
2493         (Fx_selection_exists_p): New optional frame arg.
2494         (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
2495         (x_handle_selection_clear): Don't treat other terminals with the
2496         same keyboard specially.  Use the terminal-local Vselection_alist.
2497         (x_clear_frame_selections): Use Frun_hook_with_args.
2499         * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
2501         * xterm.h: Add support for those atoms.
2503 2011-05-26  Chong Yidong  <cyd@stupidchicken.com>
2505         * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
2506         (converted_selections, conversion_fail_tag): New global variables.
2507         (x_selection_request_lisp_error): Free the above.
2508         (x_get_local_selection): Remove unnecessary code.
2509         (x_reply_selection_request): Args changed; handle arbitrary array
2510         of converted selections stored in converted_selections.
2511         Separate the XChangeProperty and SelectionNotify steps.
2512         (x_handle_selection_request): Rewrite to handle MULTIPLE target.
2513         (x_convert_selection): New function.
2514         (x_handle_selection_event): Simplify.
2515         (x_get_foreign_selection): Don't ignore incoming requests while
2516         waiting for an answer; this will fail when we implement
2517         SAVE_TARGETS, and seems unnecessary anyway.
2518         (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
2519         (Vx_sent_selection_functions): Doc fix.
2521 2011-05-26  Leo Liu  <sdl.web@gmail.com>
2523         * editfns.c (Ftranspose_regions): Allow empty regions.  (Bug#8699)
2525 2011-05-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
2527         * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
2529         * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
2530         for fringe update if it has periodic bitmap.
2531         (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
2532         and fringe_bitmap_periodic_p.
2534         * fringe.c (get_fringe_bitmap_data): New function.
2535         (draw_fringe_bitmap_1, update_window_fringes): Use it.
2536         (update_window_fringes): Record periodicity of fringe bitmap in glyph
2537         row.  Mark glyph row for fringe update if periodicity changed.
2539         * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
2540         for fringe update unless it has periodic bitmap.
2542 2011-05-25  Kenichi Handa  <handa@m17n.org>
2544         * xdisp.c (get_next_display_element): Set correct it->face_id for
2545         a static composition.
2547 2011-05-24  Leo Liu  <sdl.web@gmail.com>
2549         * deps.mk (fns.o):
2550         * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
2552         * fns.c (crypto_hash_function, Fsha1): New function.
2553         (Fmd5): Use crypto_hash_function.
2554         (syms_of_fns): Add Ssha1.
2556 2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
2558         * gnutls.c: Remove unused macros.
2559         (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
2560         (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
2561         Remove macros that are defined and never used.
2562         Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
2564 2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
2566         * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
2567         (Fx_get_selection_internal): Minor cleanup.
2568         (Fx_own_selection_internal): Rename arguments for consistency with
2569         select.el.
2571 2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
2573         * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
2575 2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
2577         * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
2579 2011-05-21  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
2581         * dispnew.c (scrolling_window): Don't exclude the case that the
2582         last enabled row in the desired matrix touches the bottom boundary.
2584 2011-05-21  Glenn Morris  <rgm@gnu.org>
2586         * Makefile.in ($(etc)/DOC): Make second command line even shorter.
2587         (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
2588         and add some more files.
2590 2011-05-20  Eli Zaretskii  <eliz@gnu.org>
2592         * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
2593         report_file_error introduced by the change from 2011-05-07.
2595 2011-05-20  Paul Eggert  <eggert@cs.ucla.edu>
2597         * systime.h (Time): Define only if emacs is defined.
2598         This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
2599         where the include path doesn't have X11/X.h by default.  See
2600         <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
2602 2011-05-20 Kenichi Handa  <handa@m17n.org>
2604         * composite.c (find_automatic_composition): Fix previous change.
2606 2011-05-20  Glenn Morris  <rgm@gnu.org>
2608         * lisp.mk: New file, split from Makefile.in.
2609         * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
2610         (shortlisp): Remove.
2611         ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
2613 2011-05-19  Glenn Morris  <rgm@gnu.org>
2615         * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
2616         (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
2617         (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
2618         (lisp): Set the order to that of loadup.el.
2619         (shortlisp): Make it a copy of $lisp.
2620         (SOME_MACHINE_LISP): Remove.
2621         ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
2622         Use just $shortlisp, not $SOME_MACHINE_LISP too.
2624 2011-05-18  Kenichi Handa  <handa@m17n.org>
2626         * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
2627         (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
2628         (find_automatic_composition): Mostly rewrite for efficiency.
2630 2011-05-18  Juanma Barranquero  <lekktu@gmail.com>
2632         * makefile.w32-in: Update dependencies.
2634 2011-05-18  Christoph Scholtes  <cschol2112@googlemail.com>
2636         * menu.c: Include limits.h (fixes the MS-Windows build broken by
2637         2011-06-18T18:49:19Z!cyd@stupidchicken.com).
2639 2011-05-18  Paul Eggert  <eggert@cs.ucla.edu>
2641         Fix some integer overflow issues, such as string length overflow.
2643         * insdel.c (count_size_as_multibyte): Check for string overflow.
2645         * character.c (lisp_string_width): Check for string overflow.
2646         Use EMACS_INT, not int, for string indexes and lengths; in
2647         particular, 2nd arg is now EMACS_INT, not int.  Do not crash if
2648         the resulting string length overflows an EMACS_INT; instead,
2649         report a string overflow if no precision given.  When checking for
2650         precision exhaustion, use a check that cannot possibly have
2651         integer overflow.  (Bug#8675)
2652         * character.h (lisp_string_width): Adjust to new signature.
2654         * alloc.c (string_overflow): New function.
2655         (Fmake_string): Use it.  This doesn't change behavior, but saves
2656         a few bytes and will simplify future changes.
2657         * character.c (string_escape_byte8): Likewise.
2658         * lisp.h (string_overflow): New decl.
2660         Fixups, following up to the user-interface timestamp change.
2661         * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
2662         for UI timestamps, instead of unsigned long.
2663         * msdos.c (mouse_get_pos): Likewise.
2664         * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
2665         * w32gui.h (Time): Define by including "systime.h" rather than by
2666         declaring it ourselves.  (Bug#8664)
2668         * dispextern.h (struct image): Don't assume time_t <= unsigned long.
2669         * image.c (clear_image_cache): Likewise.
2671         * term.c (term_mouse_position): Don't assume time_t wraparound.
2673         Be more systematic about user-interface timestamps.
2674         Before, the code sometimes used 'Time', sometimes 'unsigned long',
2675         and sometimes 'EMACS_UINT', to represent these timestamps.
2676         This change causes it to use 'Time' uniformly, as that's what X uses.
2677         This makes the code easier to follow, and makes it easier to catch
2678         integer overflow bugs such as Bug#8664.
2679         * frame.c (Fmouse_position, Fmouse_pixel_position):
2680         Use Time, not unsigned long, for user-interface timestamps.
2681         * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
2682         (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
2683         * keyboard.h (last_event_timestamp): Likewise.
2684         * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
2685         * menu.h (xmenu_show): Likewise.
2686         * term.c (term_mouse_position): Likewise.
2687         * termhooks.h (struct input_event.timestamp): Likewise.
2688         (struct terminal.mouse_position_hook): Likewise.
2689         * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
2690         * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
2691         * systime.h (Time): New decl.  Pull it in from <X11/X.h> if
2692         HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
2693         what it was before.
2694         * menu.h, termhooks.h: Include "systime.h", for Time.
2696         * keyboard.c (make_lispy_event): Fix problem in integer overflow.
2697         Don't assume that the difference between two unsigned long values
2698         can fit into an integer.  At this point, we know button_down_time
2699         <= event->timestamp, so the difference must be nonnegative, so
2700         there's no need to cast the result if double-click-time is
2701         nonnegative, as it should be; check that it's nonnegative, just in
2702         case.  This bug is triggered when events are more than 2**31 ms
2703         apart (about 25 days).  (Bug#8664)
2705         * xselect.c (last_event_timestamp): Remove duplicate decl.
2706         (x_own_selection): Remove needless cast to unsigned long.
2708         * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
2709         that always fit in int.  Use a sentinel instead of a counter, to
2710         avoid a temp and to allay GCC's concerns about possible int overflow.
2711         * frame.h (struct frame): Use int for menu_bar_items_used
2712         instead of EMACS_INT, since it always fits in int.
2714         * menu.c (grow_menu_items): Check for int overflow.
2716         * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
2718         * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
2719         Before, the code was not consistent.  These values cannot exceed
2720         2**31 - 1 so there's no need to make them unsigned.
2721         (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
2722         (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
2723         (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
2724         as modifiers.
2725         * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
2727         * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
2728         (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
2729         Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
2730         presumably because the widths might not match.
2732         * window.c (size_window): Avoid needless test at loop start.
2734 2011-05-18  Courtney Bane  <emacs-bugs-7626@cbane.org>  (tiny change)
2736         * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
2738 2011-05-12  Drew Adams  <drew.adams@oracle.com>
2740         * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
2742 2011-05-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
2744         * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
2745         `width' to `bar_area_x' and `bar_area_width', respectively.
2746         (x_scroll_run): Take account of fringe background extension.
2748         * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
2749         Rename local vars `left' and `width' to `bar_area_x' and
2750         `bar_area_width', respectively.
2751         (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
2752         background extension.
2754 2011-05-10  Jim Meyering  <meyering@redhat.com>
2756         * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
2758 2011-05-10  Juanma Barranquero  <lekktu@gmail.com>
2760         * image.c (Finit_image_library): Return t for built-in image types,
2761         like pbm and xbm.  (Bug#8640)
2763 2011-05-09  Andreas Schwab  <schwab@linux-m68k.org>
2765         * w32menu.c (set_frame_menubar): Fix submenu allocation.
2767 2011-05-07  Eli Zaretskii  <eliz@gnu.org>
2769         * w32console.c (Fset_screen_color): Doc fix.
2770         (Fget_screen_color): New function.
2771         (syms_of_ntterm): Defsubr it.
2773         * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
2774         unlink the temporary file if Fcall_process didn't create it in the
2775         first place.
2776         (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
2777         child process will be redirected to a file specified with `:file'.
2778         Don't try to re-open tempfile in that case, and set fd[0] to -1 as
2779         cue to call_process_cleanup not to close that handle.
2781 2011-05-07  Ben Key  <bkey76@gmail.com>
2783         * makefile.w32-in: The bootstrap-temacs rule now makes use of
2784         one of two shell specific rules, either bootstrap-temacs-CMD or
2785         bootstrap-temacs-SH.  The bootstrap-temacs-SH rule is identical
2786         to the previous implementation of the bootstrap-temacs rule.
2787         The bootstrap-temacs-CMD rule is similar to the previous
2788         implementation of the bootstrap-temacs rule except that it
2789         makes use of the ESC_CFLAGS variable instead of the CFLAGS
2790         variable.
2792         These changes, along with some changes to nt/configure.bat,
2793         nt/gmake.defs, and nt/nmake.defs, are required to extend my
2794         earlier fix to add support for --cflags and --ldflags options
2795         that include quotes so that it works whether make uses cmd or
2796         sh as the shell.
2798 2011-05-06  Michael Albinus  <michael.albinus@gmx.de>
2800         * dbusbind.c (QCdbus_type_unix_fd): Declare static.
2801         (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
2802         is a constant.
2803         (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
2804         a string.  Handle both cases.
2805         (Fdbus_call_method_asynchronously, Fdbus_register_signal)
2806         (Fdbus_register_method): Use Qinvalid_function.
2808 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
2810         * makefile.w32-in: Update dependencies.
2811         (LISP_H): Add inttypes.h and stdin.h.
2812         (PROCESS_H): Add unistd.h.
2814 2011-05-06  Eli Zaretskii  <eliz@gnu.org>
2816         * lread.c: Include limits.h (fixes the MS-Windows build broken by
2817         2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
2819 2011-05-06  Paul Eggert  <eggert@cs.ucla.edu>
2821         * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
2823         * term.c (vfatal): Remove stray call to va_end.
2824         It's not needed and the C Standard doesn't allow it here anyway.
2826         Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
2827         * eval.c (verror): doprnt a copy of ap, not the original.  (Bug#8545)
2829         * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
2830         bytes.
2832         * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
2834         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
2836         * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
2838         * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
2840         * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
2842         * charset.h (struct charset.code_space): Now has 15 elements, not 16.
2843         * charset.c (Fdefine_charset_internal): Don't initialize
2844         charset.code_space[15].  The value was garbage, on hosts with
2845         32-bit int (Bug#8600).
2847         * lread.c (read_integer): Be more consistent with string-to-number.
2848         Use string_to_number to do the actual conversion; this avoids
2849         rounding errors and fixes some other screwups.  Without this fix,
2850         for example, #x1fffffffffffffff was misread as -2305843009213693952.
2851         (digit_to_number): Move earlier, for benefit of read_integer.
2852         Return -1 if the digit is out of range for the base, -2 if it is
2853         not a digit in any supported base.  (Bug#8602)
2855         * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
2857         * dispnew.c (scrolling_window): Return 1 if we scrolled,
2858         to match comment at start of function.  This also removes a
2859         GCC warning about overflow in a 32+64-bit port.
2861         * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
2863         * dbusbind.c: Do not use XPNTR on a value that may be an integer.
2864         Reported by Stefan Monnier in
2865         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
2866         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
2867         Use SYMBOLP-guarded XSYMBOL, not XPNTR.
2869         * lisp.h (EMACS_INTPTR): Remove.  All uses changed to intptr_t.
2870         (EMACS_UINTPTR): Likewise, with uintptr_t.
2872         * lisp.h: Prefer 64-bit EMACS_INT if available.
2873         (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
2874         on 32-bit hosts that have 64-bit int, so that they can access
2875         large files.
2876         However, temporarily disable this change unless the temporary
2877         symbol WIDE_EMACS_INT is defined.
2879         * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
2881         Prefer intptr_t/uintptr_t for integers the same widths as pointers.
2882         This removes an assumption that EMACS_INT and long are the same
2883         width as pointers.  The assumption is true for Emacs porting targets
2884         now, but we want to make other targets possible.
2885         * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
2886         (EMACS_INTPTR, EMACS_UINTPTR): New macros.
2887         In the rest of the code, change types of integers that hold casted
2888         pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
2889         replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
2890         (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
2891         (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
2892         No need to cast type when ORing.
2893         (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
2894         * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
2895         * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
2896         assume EMACS_INT is the same width as char *.
2897         * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
2898         (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
2899         Remove no-longer-needed casts.
2900         (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
2901         (xg_tool_bar_help_callback, xg_make_tool_item):
2902         Use EMACS_INTPTR to hold an integer
2903         that will be cast to void *; this can avoid a GCC warning
2904         if EMACS_INT is not the same width as void *.
2905         * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
2906         * xdisp.c (display_echo_area_1, resize_mini_window_1):
2907         (current_message_1, set_message_1):
2908         Use a local to convert to proper width without a cast.
2909         * xmenu.c (dialog_selection_callback): Likewise.
2911         * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
2912         Also, don't assume VALBITS / RAND_BITS is less than 5,
2913         and don't rely on undefined behavior when shifting a 1 left into
2914         the sign bit.
2915         * lisp.h (get_random): Change signature to match.
2917         * lread.c (hash_string): Use size_t, not int, for hash computation.
2918         Normally we prefer signed values; but hashing is special, because
2919         it's better to use unsigned division on hash table sizes so that
2920         the remainder is nonnegative.  Also, size_t is the natural width
2921         for hashing into memory.  The previous code used 'int', which doesn't
2922         retain enough info to hash well into very large tables.
2923         (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
2925         * dbusbind.c: Don't possibly lose pointer info when converting.
2926         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
2927         Use XPNTR rather than XHASH, so that the high-order bits of
2928         the pointer aren't lost when converting through void *.
2930         * eval.c (Fautoload): Don't double-shift a pointer.
2932         * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
2934 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
2936         * gnutls.c (DEF_GNUTLS_FN):
2937         * image.c (DEF_IMGLIB_FN): Make function pointers static.
2939 2011-05-05  Andreas Schwab  <schwab@linux-m68k.org>
2941         * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
2942         marker.  (Bug#8610)
2944 2011-05-05 Eli Zaretskii  <eliz@gnu.org>
2946         * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
2947         New version that can reserve upto 2GB of heap space.
2949 2011-05-05  Chong Yidong  <cyd@stupidchicken.com>
2951         * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
2953 2011-05-05  Teodor Zlatanov  <tzz@lifelogs.com>
2955         * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
2956         `gnutls_certificate_set_x509_key_file'.
2958 2011-05-05  Juanma Barranquero  <lekktu@gmail.com>
2960         * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
2961         Update dependencies.
2963 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
2965         * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
2966         * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
2967         Remove unused parameter `fildes'.
2968         * process.c (read_process_output, send_process): Don't pass it.
2970 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
2972         Fix previous change: the library cache is defined in w32.c.
2973         * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
2974         (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
2976 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
2978         Implement dynamic loading of GnuTLS on Windows.
2980         * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
2981         (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
2982         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
2983         Declare.
2985         * gnutls.c (Qgnutls_dll): Define.
2986         (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
2987         (gnutls_*): Declare function pointers.
2988         (init_gnutls_functions): New function to initialize function pointers.
2989         (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
2990         (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
2991         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
2992         Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
2993         (emacs_gnutls_write, emacs_gnutls_read)
2994         (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
2995         (Fgnutls_available_p): New function.
2996         (Fgnutls_boot): Call Fgnutls_available_p.  Use function pointers.
2997         (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
2998         (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
3000         * image.c: Include w32.h.
3001         (Vimage_type_cache): Delete.
3002         (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
3003         (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
3004         (w32_delayed_load): Move to w32.c.
3006         * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
3008         * w32.c (QCloaded_from, Vlibrary_cache): Define.
3009         (w32_delayed_load): Move from image.c.  When loading a library, record
3010         its filename in the :loaded-from property of the library id.
3011         (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
3012         Initialize and staticpro them.
3013         (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
3015         * process.c: Include lisp.h before w32.h, not after.
3016         (wait_reading_process_output): Call emacs_gnutls_record_check_pending
3017         instead of gnutls_record_check_pending.
3019         * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
3021 2011-05-04  Teodor Zlatanov  <tzz@lifelogs.com>
3023         * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
3024         instead of :keyfiles.  Give GnuTLS the keylist and the CRL lists
3025         as passed in.
3027 2011-05-03  Jan Djärv  <jan.h.d@swipnet.se>
3029         * xterm.c (x_set_frame_alpha): Do not set property on anything
3030         else than FRAME_X_OUTER_WINDOW (Bug#8608).
3032 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
3034         * sysdep.c (get_tty_size) [WINDOWSNT]: Implement.  (Bug#8596)
3036 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
3038         * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
3039         (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
3040         (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
3041         (gnutls_global_initialized, Qgnutls_bootprop_priority)
3042         (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
3043         (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
3044         (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
3045         (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
3046         (Qgnutls_bootprop_callbacks_verify): Make static.
3048 2011-05-01  Andreas Schwab  <schwab@linux-m68k.org>
3050         * callproc.c: Indentation fixup.
3052         * sysdep.c (wait_for_termination_1): Make static.
3053         (wait_for_termination, interruptible_wait_for_termination):
3054         Move after wait_for_termination_1.
3056 2011-05-01  Lars Magne Ingebrigtsen  <larsi@gnus.org>
3058         * sysdep.c (interruptible_wait_for_termination): New function
3059         which is like wait_for_termination, but allows keyboard
3060         interruptions.
3062         * callproc.c (Fcall_process): Add (:file "file") as an option for
3063         the STDOUT buffer.
3064         (Fcall_process_region): Ditto.
3066 2011-04-30  Eli Zaretskii  <eliz@gnu.org>
3068         * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
3069         rather than `XVECTOR (FOO)->size'.
3071         * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
3072         inttypes.h, as a gnulib replacement is used if it not available in
3073         system headers.
3075 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
3077         Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
3078         * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
3079         of MOST_POSITIVE_FIXNUM.  (Bug#8528)
3081         * coding.c (coding_alloc_by_realloc): Error out if destination
3082         will grow beyond MOST_POSITIVE_FIXNUM.
3083         (decode_coding_emacs_mule): Abort if there isn't enough place in
3084         charbuf for the composition carryover bytes.  Reserve an extra
3085         space for up to 2 characters produced in a loop.
3086         (decode_coding_iso_2022): Abort if there isn't enough place in
3087         charbuf for the composition carryover bytes.
3089 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
3091         * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
3092         aborting when %lld or %lll format is passed.
3093         [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
3094         %llo or %llx format is passed.  (Bug#8545)
3096         * window.c (window_scroll_line_based): Use a marker instead of
3097         simple variables to record original value of point.  (Bug#7952)
3099         * doprnt.c (doprnt): Fix the case where a multibyte sequence
3100         produced by %s or %c overflows available buffer space.  (Bug#8545)
3102 2011-04-28  Paul Eggert  <eggert@cs.ucla.edu>
3104         * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
3105         (SIZE_MAX): Move defn after all includes, as they might #define it.
3107 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
3109         * w32.c (init_environment): Warn about defaulting HOME to C:\.
3111 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
3113         * keyboard.c (Qdelayed_warnings_hook): Define.
3114         (command_loop_1): Run `delayed-warnings-hook'
3115         if Vdelayed_warnings_list is non-nil.
3116         (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
3117         (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
3119 2011-04-28  Eli Zaretskii  <eliz@gnu.org>
3121         * doprnt.c (doprnt): Don't return value smaller than the buffer
3122         size if the message was truncated.  (Bug#8545).
3124 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
3126         * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
3127         (Fx_window_property): #if-0 the whole functions, not just the bodies.
3129 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
3131         * doprnt.c (doprnt): Support "ll" length modifier, for long long.
3133 2011-04-27  Juanma Barranquero  <lekktu@gmail.com>
3135         * makefile.w32-in: Update dependencies.
3137 2011-04-27  Eli Zaretskii  <eliz@gnu.org>
3139         Improve `doprnt' and its usage.  (Bug#8545)
3140         * doprnt.c (doprnt): Make sure `format' is never accessed beyond
3141         `format_end'.  Remove support for %l as a conversion specifier.
3142         Don't use xrealloc.  Improve diagnostics when the %l size modifier
3143         is used.  Update the commentary.
3145         * eval.c (verror): Simplify calculation of size_t.
3147         * coding.c (Ffind_operation_coding_system): Fix diagnostic error
3148         messages.
3150 2011-04-27  Yoshiaki Kasahara  <kasahara@nc.kyushu-u.ac.jp>  (tiny change)
3152         * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
3153         change.
3155 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
3157         * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
3158         This makes this file independent of the recent pseudovector change.
3160 2011-04-26  Paul Eggert  <eggert@cs.ucla.edu>
3162         * keyboard.c (handle_user_signal): Fix pointer signedness problem.
3164         * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
3165         (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
3166         Remove unused local.
3167         (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
3169         * lisp.h: Fix a problem with aliasing and vector headers.  (Bug#8546)
3170         GCC 4.6.0 optimizes based on type-based alias analysis.
3171         For example, if b is of type struct buffer * and v of type struct
3172         Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
3173         != &v->size, and therefore "v->size = 1; b->size = 2; return
3174         v->size;" must therefore return 1.  This assumption is incorrect
3175         for Emacs, since it type-puns struct Lisp_Vector * with many other
3176         types.  To fix this problem, this patch adds a new type struct
3177         vectorlike_header that documents the constraints on layout of vectors
3178         and pseudovectors, and helps optimizing compilers not get fooled
3179         by Emacs's type punning.  It also adds the macros XSETTYPED_PVECTYPE
3180         XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
3181         * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
3182         the size member.
3183         (XSETPVECTYPE): Rewrite in terms of new macro.
3184         (XSETPVECTYPESIZE): New macro, specifying both type and size.
3185         This is a bit clearer, and further avoids the possibility of
3186         undesirable aliasing.
3187         (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
3188         (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
3189         (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
3190         since Lisp_Subr is a special case (no "next" field).
3191         (ASIZE): Now uses header.size rather than size.
3192         All previous uses of XVECTOR (foo)->size replaced to use this macro,
3193         to avoid the hassle of writing XVECTOR (foo)->header.size.
3194         (struct vectorlike_header): New type.
3195         (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
3196         object, to help avoid aliasing.
3197         (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
3198         (SUBRP): Likewise, since Lisp_Subr is a special case.
3199         * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
3200         (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
3201         (struct Lisp_Hash_Table): Combine first two members into a single
3202         struct vectorlike_header member.  All uses of "size" and "next" members
3203         changed to be "header.size" and "header.next".
3204         * buffer.h (struct buffer): Likewise.
3205         * font.h (struct font_spec, struct font_entity, struct font): Likewise.
3206         * frame.h (struct frame): Likewise.
3207         * process.h (struct Lisp_Process): Likewise.
3208         * termhooks.h (struct terminal): Likewise.
3209         * window.c (struct save_window_data, struct saved_window): Likewise.
3210         * window.h (struct window): Likewise.
3211         * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
3212         Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
3213         * buffer.c (init_buffer_once): Likewise.
3214         * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
3215         special case.
3216         * process.c (Fformat_network_address): Use local var for size,
3217         for brevity.
3219         * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
3221         Make the Lisp reader and string-to-float more consistent (Bug#8525)
3222         * data.c (atof): Remove decl; no longer used or needed.
3223         (digit_to_number): Move to lread.c.
3224         (Fstring_to_number): Use new string_to_number function, to be
3225         consistent with how the Lisp reader treats infinities and NaNs.
3226         Do not assume that floating-point numbers represent EMACS_INT
3227         without losing information; this is not true on most 64-bit hosts.
3228         Avoid double-rounding errors, by insisting on integers when
3229         parsing non-base-10 numbers, as the documentation specifies.
3230         * lisp.h (string_to_number): New decl, replacing ...
3231         (isfloat_string): Remove.
3232         * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
3233         (read1): Do not accept +. and -. as integers; this
3234         appears to have been a coding error.  Similarly, do not accept
3235         strings like +-1e0 as floating point numbers.  Do not report
3236         overflow for integer overflows unless the base is not 10 which
3237         means we have no simple and reliable way to continue.
3238         Break out the floating-point parsing into a new
3239         function string_to_number, so that Fstring_to_number parses
3240         floating point numbers consistently with the Lisp reader.
3241         (digit_to_number): Move here from data.c.  Make it static inline.
3242         (E_CHAR, EXP_INT): Remove, replacing with ...
3243         (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
3244         (string_to_number): New function, replacing isfloat_string.
3245         This function checks for valid syntax and produces the resulting
3246         Lisp float number too.  Rework it so that string-to-number
3247         no longer mishandles examples like "1.0e+".  Use strtoumax,
3248         so that overflow for non-base-10 numbers is reported only when
3249         there's no portable and simple way to convert to floating point.
3251         * textprop.c (set_text_properties_1): Rewrite for clarity,
3252         and to avoid GCC warning about integer overflow.
3254         * intervals.h (struct interval): Use EMACS_INT for members
3255         where EMACS_UINT might cause problems.  See
3256         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
3257         (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
3258         * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
3259         All uses changed.
3260         (offset_intervals): Tell GCC not to worry about length overflow
3261         when negating a negative length.
3263         * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
3264         (overrun_check_free): Likewise.
3266         * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
3267         in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
3268         word size.
3270         * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
3271         (gnutls_make_error): Rename local to avoid shadowing.
3272         (gnutls_emacs_global_deinit): ifdef out; not used.
3273         (Fgnutls_boot): Use const for pointer to readonly storage.
3274         Comment out unused local.  Fix pointer signedness problems.
3276         * lread.c (openp): Don't stuff size_t into an 'int'.
3277         Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
3278         about possible signed overflow.
3280         * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
3281         (GDK_KEY_g): Don't define if already defined.
3282         (xg_prepare_tooltip): Avoid pointer signedness problem.
3283         (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
3285         * process.c (Fnetwork_interface_info): Avoid left-shift undefined
3286         behavior with 1 << 31.  GCC 4.6.0 warns about this on 32-bit hosts.
3288         * xfns.c (Fx_window_property): Simplify a bit,
3289         to make a bit faster and to avoid GCC 4.6.0 warning.
3290         * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
3292         * fns.c (internal_equal): Don't assume size_t fits in int.
3294         * alloc.c (compact_small_strings): Tighten assertion a little.
3296         Replace pEd with more-general pI, and fix some printf arg casts.
3297         * lisp.h (pI): New macro, generalizing old pEd macro to other
3298         conversion specifiers.  For example, use "...%"pI"d..." rather
3299         than "...%"pEd"...".
3300         (pEd): Remove.  All uses replaced with similar uses of pI.
3301         * src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h: Likewise.
3302         * alloc.c (check_pure_size): Don't overflow by converting size to int.
3303         * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
3304         * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
3305         * dbusbind.c (xd_append_arg): Use pI to avoid cast.
3306         (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
3307         * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
3308         64-bit hosts.
3309         (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
3310         * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
3311         * print.c (safe_debug_print, print_object): Likewise.
3312         (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
3313         to int.
3314         Use pI instead of if-then-else-abort.  Use %p to avoid casts,
3315         avoiding the 0 flag, which is not portable.
3316         * process.c (Fmake_network_process): Use pI to avoid cast.
3317         * region-cache.c (pp_cache): Likewise.
3318         * xdisp.c (decode_mode_spec): Likewise.
3319         * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
3320         behavior on 64-bit hosts with printf arg.
3321         * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
3322         (x_stop_queuing_selection_requests): Likewise.
3323         (x_get_window_property): Don't truncate byte count to an 'int'
3324         when tracing.
3326         * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
3327         here, since it parses constructs like leading '-' and spaces,
3328         which are not wanted; and it overflows with large numbers.
3329         Instead, simply match F[0-9]+, which is what is wanted anyway.
3331         * alloc.c: Remove unportable assumptions about struct layout.
3332         (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
3333         (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
3334         (allocate_vectorlike, make_pure_vector): Use the new macros,
3335         plus offsetof, to remove unportable assumptions about struct layout.
3336         These assumptions hold on all porting targets that I know of, but
3337         they are not guaranteed, they're easy to remove, and removing them
3338         makes further changes easier.
3340         * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
3341         This doesn't fix a bug but makes the code clearer.
3342         (string_overrun_cookie): Now const.  Use initializers that
3343         don't formally overflow signed char, to avoid warnings.
3344         (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
3345         can cause Emacs to crash when string overrun checking is enabled.
3346         (allocate_buffer): Don't assume sizeof (struct buffer) is a
3347         multiple of sizeof (EMACS_INT); it need not be, if
3348         alignof(EMACS_INT) < sizeof (EMACS_INT).
3349         (check_sblock, check_string_bytes, check_string_free_list): Protoize.
3351 2011-04-26  Juanma Barranquero  <lekktu@gmail.com>
3353         * keyboard.c (QCrtl): Rename from Qrtl.  All uses changed.
3355 2011-04-26  Teodor Zlatanov  <tzz@lifelogs.com>
3357         * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
3358         supposed to be handshaking.  (Bug#8556)
3359         Reported by Paul Eggert <eggert@cs.ucla.edu>.
3361 2011-04-26  Daniel Colascione  <dan.colascione@gmail.com>
3363         * lisp.h (Qdebug): List symbol.
3364         * eval.c (Qdebug): Restore global linkage.
3365         * keyboard.c (debug-on-event): New variable.
3366         (handle_user_signal): Break into debugger when debug-on-event
3367         matches the current signal symbol.
3369 2011-04-25  Dan Nicolaescu  <dann@ics.uci.edu>
3371         * alloc.c (check_sblock, check_string_bytes)
3372         (check_string_free_list): Convert to standard C.
3374 2011-04-25  Teodor Zlatanov  <tzz@lifelogs.com>
3376         * w32.c (emacs_gnutls_push): Fix typo.
3378 2011-04-25  Eli Zaretskii  <eliz@gnu.org>
3380         * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
3381         "cast to pointer from integer of different size".
3383         Improve doprnt and its use in verror.  (Bug#8545)
3384         * doprnt.c (doprnt): Document the set of format control sequences
3385         supported by the function.  Use SAFE_ALLOCA instead of always
3386         using `alloca'.
3388         * eval.c (verror): Don't limit the buffer size at size_max-1, that
3389         is one byte too soon.  Don't use xrealloc; instead xfree and
3390         xmalloc anew.
3392 2011-04-24  Teodor Zlatanov  <tzz@lifelogs.com>
3394         * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
3395         callbacks stage.
3397         * gnutls.c: Renamed global_initialized to
3398         gnutls_global_initialized.  Added internals for the
3399         :verify-hostname-error, :verify-error, and :verify-flags
3400         parameters of `gnutls-boot' and documented those parameters in the
3401         docstring.  Start callback support.
3402         (emacs_gnutls_handshake): Add Woe32 support.  Retry handshake
3403         unless a fatal error occurred.  Call gnutls_alert_send_appropriate
3404         on error.  Return error code.
3405         (emacs_gnutls_write): Call emacs_gnutls_handle_error.
3406         (emacs_gnutls_read): Likewise.
3407         (Fgnutls_boot): Return handshake error code.
3408         (emacs_gnutls_handle_error): New function.
3409         (wsaerror_to_errno): Likewise.
3411         * w32.h (emacs_gnutls_pull): Add prototype.
3412         (emacs_gnutls_push): Likewise.
3414         * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
3415         (emacs_gnutls_push): Likewise.
3417 2011-04-24  Claudio Bley  <claudio.bley@gmail.com>  (tiny change)
3419         * process.c (wait_reading_process_output): Check if GnuTLS
3420         buffered some data internally if no FDs are set for TLS
3421         connections.
3423         * makefile.w32-in (OBJ2): Add gnutls.$(O).
3424         (LIBS): Link to USER_LIBS.
3425         ($(BLD)/gnutls.$(0)): New target.
3427 2011-04-24  Eli Zaretskii  <eliz@gnu.org>
3429         * xdisp.c (handle_single_display_spec): Rename the
3430         display_replaced_before_p argument into display_replaced_p, to
3431         make it consistent with the commentary.  Fix typos in the
3432         commentary.
3434         * textprop.c (syms_of_textprop): Remove dead code.
3435         (copy_text_properties): Delete obsolete commentary about an
3436         interface that was deleted long ago.  Fix typos in the description
3437         of arguments.
3439         * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
3440         to changes in oldXMenu/XMenu.h from 2011-04-16.
3441         <menu_help_message, prev_menu_help_message>: Constify.
3442         (IT_menu_make_room): menu->help_text is now `const char **';
3443         adjust.
3445         * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
3446         to changes in oldXMenu/XMenu.h from 2011-04-16.
3447         (struct XMenu): Declare `help_text' `const char **'.
3449         * xfaces.c <Qunspecified>: Make extern again.
3451         * syntax.c: Include sys/types.h before including regex.h, as
3452         required by Posix.
3454         * doc.c (get_doc_string): Improve the format passed to `error'.
3456         * doprnt.c (doprnt): Improve commentary.
3458         * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
3460         * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
3461         them with etags.
3463         * makefile.w32-in (globals.h): Add a dummy recipe, to make any
3464         changes in globals.h immediately force recompilation.
3465         (TAGS): Depend on $(CURDIR)/m/intel386.h and
3466         $(CURDIR)/s/ms-w32.h.
3467         (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
3469         * character.c (Fchar_direction): Function deleted.
3470         (syms_of_character): Don't defsubr it.
3471         <char-direction-table>: Deleted.
3473 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
3475         Fix doprnt so it could be used again safely in `verror'.  (Bug#8435)
3476         * doprnt.c: Include limits.h.
3477         (SIZE_MAX): New macro.
3478         (doprnt): Return a size_t value.  2nd arg is now size_t.
3479         Many local variables are now size_t instead of int or unsigned.
3480         Improve overflow protection.  Support `l' modifier for integer
3481         conversions.  Support %l conversion.  Don't assume an EMACS_INT
3482         argument for integer conversions and for %c.
3484         * lisp.h (doprnt): Restore prototype.
3486         * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
3487         $(SRC)/character.h.
3489         * Makefile.in (base_obj): Add back doprnt.o.
3491         * deps.mk (doprnt.o): Add back prerequisites.
3492         (callint.o): Depend on character.h.
3494         * eval.c (internal_lisp_condition_case): Include the handler
3495         representation in the error message.
3496         (verror): Call doprnt instead of vsnprintf.  Fix an off-by-one bug
3497         when breaking from the loop.
3499         * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
3501         * callint.c (Fcall_interactively): When displaying error message
3502         about invalid control letter, pass the character's codepoint, not
3503         a pointer to its multibyte form.  Improve display of the character
3504         in octal and display also its hex code.
3506         * character.c (char_string): Use %x to display the (unsigned)
3507         codepoint of an invalid character, to avoid displaying a bogus
3508         negative value.
3510         * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
3511         `error', not SYMBOL_NAME itself.
3513         * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
3514         character arguments to `error'.
3516         * charset.c (check_iso_charset_parameter): Fix incorrect argument
3517         to `error' in error message about FINAL_CHAR argument.  Make sure
3518         FINAL_CHAR is a character, and use %c when it is passed as
3519         argument to `error'.
3521 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
3523         * s/ms-w32.h (localtime): Redirect to sys_localtime.
3525         * w32.c: Include <time.h>.
3526         (sys_localtime): New function.
3528 2011-04-23  Chong Yidong  <cyd@stupidchicken.com>
3530         * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
3532         * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
3534 2011-04-23  Samuel Thibault  <sthibault@debian.org>  (tiny change)
3536         * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
3537         zombies (Bug#8467).
3539 2011-04-19  Eli Zaretskii  <eliz@gnu.org>
3541         * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
3542         gl_state.e_property when gl_state.object is Qt.
3544         * insdel.c (make_gap_larger): Remove limitation of buffer size
3545         to <= INT_MAX.
3547 2011-04-18  Chong Yidong  <cyd@stupidchicken.com>
3549         * xdisp.c (lookup_glyphless_char_display)
3550         (produce_glyphless_glyph): Handle cons cell entry in
3551         glyphless-char-display.
3552         (Vglyphless_char_display): Document it.
3554         * term.c (produce_glyphless_glyph): Handle cons cell entry in
3555         glyphless-char-display.
3557 2011-04-17  Chong Yidong  <cyd@stupidchicken.com>
3559         * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
3561         * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
3563         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
3564         definition for no-X builds.
3566 2011-04-16  Paul Eggert  <eggert@cs.ucla.edu>
3568         Static checks with GCC 4.6.0 and non-default toolkits.
3570         * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
3572         * process.c (keyboard_bit_set): Define only if SIGIO.
3573         (send_process_trap): Mark it with NO_RETURN if it doesn't return.
3574         (send_process): Repair possible setjmp clobbering.
3576         * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
3578         * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
3580         * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
3582         * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
3583         Define only if needed.
3585         * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
3586         by pacifying GCC about it.  Maybe it's time to retire it?
3587         * xfaces.c (USG, __TIMEVAL__): Likewise.
3589         * dispextern.h (struct redisplay_interface): Rename param
3590         to avoid shadowing.
3591         * termhooks.h (struct terminal): Likewise.
3592         * xterm.c (xembed_send_message): Likewise.
3594         * insdel.c (make_gap_smaller): Define only if
3595         USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
3597         * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
3598         it.
3600         * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
3601         so that we aren't warned about unused symbols.
3603         * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
3605         * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
3607         * xfns.c (x_real_positions): Mark locals as initialized.
3609         * xmenu.c (xmenu_show): Don't use uninitialized vars.
3611         * xterm.c: Fix problems found by static analysis with other toolkits.
3612         (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
3613         (x_dispatch_event): Declare static if USE_GTK, and
3614         define if USE_GTK || USE_X_TOOLKIT.
3615         (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
3616         * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
3617         * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
3618         if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
3620         * xmenu.c (menu_help_callback): Pointer type fixes.
3621         Use const pointers when pointing at readonly data.  Avoid pointer
3622         signedness clashes.
3623         (FALSE): Remove unused macro.
3624         (update_frame_menubar): Remove unused decl.
3626         * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
3628         * menu.c (push_submenu_start, push_submenu_end): Do not define unless
3629         USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
3630         (single_menu_item): Rename local to avoid shadowing.
3632         * keyboard.c (make_lispy_event): Remove unused local var.
3634         * frame.c, frame.h (x_get_resource_string): Bring this back, but
3635         only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
3637         * bitmaps: Change bitmaps from unsigned char back to the X11
3638         compatible char.  Avoid the old compiler warnings about
3639         out-of-range initializers by using, for example, '\xab' rather
3640         than 0xab.
3642         * xgselect.c (xgselect_initialize): Check vs interface
3643         even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
3645         * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
3647         * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
3648         to read-only memory.
3650         * fns.c (vector): Remove; this old hack is no longer needed.
3652         * xsmfns.c (create_client_leader_window): Rename shadowing arg.
3653         Remove unused var.
3654         (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
3656         * xrdb.c (x_load_resources): Omit unused local.
3658         * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
3659         (x_window): Rename locals to avoid shadowing.
3660         (USG): Use the kludged USG macro, to pacify gcc.
3662         * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
3663         (x_term_init): Remove local to avoid shadowing.
3665         * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
3667         * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
3668         USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
3670 2011-04-16  Eli Zaretskii  <eliz@gnu.org>
3672         * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
3674         Fix regex.c, syntax.c and friends for buffers > 2GB.
3675         * syntax.h (struct gl_state_s): Declare character position members
3676         EMACS_INT.
3678         * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
3680         * textprop.c (verify_interval_modification, interval_of):
3681         Declare arguments EMACS_INT.
3683         * intervals.c (adjust_intervals_for_insertion): Declare arguments
3684         EMACS_INT.
3686         * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
3688         * indent.c (Fvertical_motion): Local variable it_start is now
3689         EMACS_INT.
3691         * regex.c (re_match, re_match_2, re_match_2_internal)
3692         (bcmp_translate, regcomp, regexec, print_double_string)
3693         (group_in_compile_stack, re_search, re_search_2, regex_compile)
3694         (re_compile_pattern, re_exec): Declare arguments and local
3695         variables `size_t' and `ssize_t' and return values `regoff_t', as
3696         appropriate.
3697         (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
3698         (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
3699         <compile_stack_type>: `size' and `avail' are now `size_t'.
3701         * regex.h <regoff_t>: Use ssize_t, not int.
3702         (re_search, re_search_2, re_match, re_match_2): Arguments that
3703         specify buffer/string position and length are now ssize_t and
3704         size_t.  Return type is regoff_t.
3706 2011-04-16  Ben Key  <bkey76@gmail.com>
3708         * nsfont.m: Fixed bugs in ns_get_family and
3709         ns_descriptor_to_entity that were caused by using free to
3710         deallocate memory blocks that were allocated by xmalloc (via
3711         xstrdup).  This caused Emacs to crash when compiled with
3712         XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
3713         --enable-checking=xmallocoverrun).  xfree is now used to
3714         deallocate these memory blocks.
3716 2011-04-15  Paul Eggert  <eggert@cs.ucla.edu>
3718         * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
3720         emacs_write: Accept and return EMACS_INT for sizes.
3721         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
3722         et seq.
3723         * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
3724         Accept and return EMACS_INT.
3725         (emacs_gnutls_write): Return the number of bytes written on
3726         partial writes.
3727         * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
3728         (emacs_read, emacs_write): Remove check for negative size, as the
3729         Emacs source code has been audited now.
3730         * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
3731         (emacs_read, emacs_write): Use it.
3732         * process.c (send_process): Adjust to the new signatures of
3733         emacs_write and emacs_gnutls_write.  Do not attempt to store
3734         a byte offset into an 'int'; it might overflow.
3735         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
3737         * sound.c: Don't assume sizes fit in 'int'.
3738         (struct sound_device.period_size, alsa_period_size):
3739         Return EMACS_INT, not int.
3740         (struct sound_device.write, vox_write, alsa_write):
3741         Accept EMACS_INT, not int.
3742         (wav_play, au_play): Use EMACS_INT to store sizes and to
3743         record read return values.
3745 2011-04-15  Ben Key  <bkey76@gmail.com>
3747         * keyboard.c (Qundefined): Don't declare static since it is used
3748         in nsfns.m.
3749         * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
3750         static since they are used in nsfont.m.
3752 2011-04-15  Stefan Monnier  <monnier@iro.umontreal.ca>
3754         * process.c (Qprocessp): Don't declare static.
3755         * lisp.h (Qprocessp): Declare again.
3757 2011-04-15  Juanma Barranquero  <lekktu@gmail.com>
3759         * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
3761 2011-04-14  Paul Eggert  <eggert@cs.ucla.edu>
3763         Improve C-level modularity by making more things 'static'.
3765         Don't publish debugger-only interfaces to other modules.
3766         * lisp.h (safe_debug_print, debug_output_compilation_hack):
3767         (verify_bytepos, count_markers): Move decls to the only modules
3768         that need them.
3769         * region-cache.h (pp_cache): Likewise.
3770         * window.h (check_all_windows): Likewise.
3771         * marker.c, print.c, region-cache.c, window.c: Decls moved here.
3773         * sysdep.c (croak): Now static, if
3774         defined TIOCNOTTY || defined USG5 || defined CYGWIN.
3775         * syssignal.h (croak): Declare only if not static.
3777         * alloc.c (refill_memory_reserve): Now static if
3778         !defined REL_ALLOC || defined SYSTEM_MALLOC.
3779         * lisp.h (refill_memory_reserve): Declare only if not static.
3781         * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
3782         Define only if USE_LUCID.
3784         * xrdb.c (x_customization_string, x_rm_string): Now static.
3786         * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
3787         * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
3789         * xdisp.c (draw_row_with_mouse_face): Now static.
3790         * dispextern.h (draw_row_with_mouse_fave): Remove decl.
3792         * window.h (check_all_windows): Mark externally visible.
3794         * window.c (window_deletion_count): Now static.
3796         * undo.c: Make symbols static if they're not exported.
3797         (last_undo_buffer, last_boundary_position, pending_boundary):
3798         Now static.
3800         * textprop.c (interval_insert_behind_hooks): Now static.
3801         (interval_insert_in_front_hooks): Likewise.
3803         * term.c: Make symbols static if they're not exported.
3804         (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
3805         (max_frame_lines, tty_set_terminal_modes):
3806         (tty_reset_terminal_modes, tty_turn_off_highlight):
3807         (get_tty_terminal): Now static.
3808         (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
3809         * termhooks.h (term_mouse_moveto): Do not declare if
3810         HAVE_WINDOW_SYSTEM.
3811         * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
3812         (tty_turn_off_highlight, get_tty_terminal): Remove decls.
3814         * sysdep.c: Make symbols static if they're not exported.
3815         (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
3816         Now static.
3817         (sigprocmask_set, full_mask): Remove; unused.
3818         (wait_debugging): Mark as visible.
3819         * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
3820         * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
3822         * syntax.c (syntax_temp): Define only if !__GNUC__.
3824         * sound.c (current_sound_device, current_sound): Now static.
3826         * search.c (searchbufs, searchbuf_head): Now static.
3828         * scroll.c (scroll_cost): Remove; unused.
3829         * dispextern.h (scroll_cost): Remove decl.
3831         * region-cache.h (pp_cache): Mark as externally visible.
3833         * process.c: Make symbols static if they're not exported.
3834         (process_tick, update_tick, create_process, chan_process):
3835         (Vprocess_alist, proc_buffered_char, datagram_access):
3836         (fd_callback_data, send_process_frame, process_sent_to): Now static.
3837         (deactivate_process): Mark defn as static, as well as decl.
3838         * lisp.h (create_process): Remove decl.
3839         * process.h (chan_process, Vprocess_alist): Remove decls.
3841         * print.c: Make symbols static if they're not exported.
3842         (print_depth, new_backquote_output, being_printed, print_buffer):
3843         (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
3844         (print_interval, print_number_index, initial_stderr_stream):
3845         Now static.
3846         * lisp.h (Fprinc): Remove decl.
3847         (debug_output_compilation_hack): Mark as externally visible.
3849         * sysdep.c (croak): Move decl from here to syssignal.h.
3850         * syssignal.h (croak): Put it here, so the API can be checked when
3851         'croak' is called from dissociate_if_controlling_tty.
3853         * minibuf.c: Make symbols static if they're not exported.
3854         (minibuf_save_list, choose_minibuf_frame): Now static.
3855         * lisp.h (choose_minibuf_frame): Remove decl.
3857         * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
3859         * lread.c: Make symbols static if they're not exported.
3860         (read_objects, initial_obarray, oblookup_last_bucket_number):
3861         Now static.
3862         (make_symbol): Remove; unused.
3863         * lisp.h (initial_obarray, make_symbol): Remove decls.
3865         * keyboard.c: Make symbols static if they're not exported.
3866         (single_kboard, recent_keys_index, total_keys, recent_keys):
3867         (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
3868         (this_single_command_key_start, echoing, last_auto_save):
3869         (read_key_sequence_cmd, dribble, recursive_edit_unwind):
3870         (command_loop, echo_now, keyboard_init_hook, help_char_p):
3871         (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
3872         (Vlispy_mouse_stem, double_click_count):
3873         Now static.
3874         (force_auto_save_soon): Define only if SIGDANGER.
3875         (ignore_mouse_drag_p): Now static if
3876         !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
3877         (print_help): Remove; unused.
3878         (stop_character, last_timer_event): Mark as externally visible.
3879         * keyboard.h (ignore_mouse_drag_p): Declare only if
3880         defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
3881         (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
3882         * lisp.h (echoing): Remove decl.
3883         (force_auto_save_soon): Declare only if SIGDANGER.
3884         * xdisp.c (redisplay_window): Simplify code, to make it more
3885         obvious that ignore_mouse_drag_p is not accessed if !defined
3886         USE_GTK && !defined HAVE_NS.
3888         * intervals.c: Make symbols static if they're not exported.
3889         (merge_properties_sticky, merge_interval_right, delete_interval):
3890         Now static.
3891         * intervals.h (merge_interval_right, delete_interval): Remove decls.
3893         * insdel.c: Make symbols static if they're not exported.
3894         However, leave prepare_to_modify_buffer alone.  It's never
3895         called from outside this function, but that appears to be a bug.
3896         (combine_after_change_list, combine_after_change_buffer):
3897         (adjust_after_replace, signal_before_change): Now static.
3898         (adjust_after_replace_noundo): Remove; unused.
3899         * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
3900         (signal_before_change): Remove decls.
3902         * indent.c (val_compute_motion, val_vmotion): Now static.
3904         * image.c: Make symbols static if they're not exported.
3905         * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
3906         if USE_GTK.
3907         * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
3908         (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
3910         * fringe.c (standard_bitmaps): Now static.
3911         (max_used_fringe_bitmap): Now static, unless HAVE_NS.
3913         * frame.c: Make symbols static if they're not exported.
3914         (x_report_frame_params, make_terminal_frame): Now static.
3915         (get_frame_param): Now static, unless HAVE_NS.
3916         (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
3917         (x_get_resource_string): Remove; not used.
3918         * frame.h (make_terminal_frame, x_report_frame_params):
3919         (x_get_resource_string); Remove decls.
3920         (x_fullscreen_adjust): Declare only if WINDOWSNT.
3921         * lisp.h (get_frame_param): Declare only if HAVE_NS.
3923         * font.c, fontset.c: Make symbols static if they're not exported.
3924         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
3925         (FACE_SUITABLE_FOR_CHAR_P): Use it.
3926         * font.c (font_close_object): Now static.
3927         * font.h (font_close_object): Remove.
3928         * fontset.c (FONTSET_OBJLIST): Remove.
3929         (free_realized_fontset) #if-0 the body, which does nothing.
3930         (face_suitable_for_char_p): #if-0, as it's never called.
3931         * fontset.h (face_suitable_for_char_p): Remove decl.
3932         * xfaces.c (face_at_string_position):
3933         Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
3934         since 0 is always ASCII.
3936         * fns.c (weak_hash_tables): Now static.
3938         * fileio.c: Make symbols static if they're not exported.
3939         (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
3940         (Vwrite_region_annotation_buffers): Now static.
3942         * eval.c: Make symbols static if they're not exported.
3943         (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
3944         * lisp.h (backtrace_list): Remove decl.
3946         * emacs.c: Make symbols static if they're not exported.
3947         (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
3948         (fatal_error_code, fatal_error_signal_hook, standard_args):
3949         Now static.
3950         (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
3951         (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
3952         (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
3953         * lisp.h (fatal_error_signal_hook): Remove decl.
3954         (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
3956         * editfns.c: Move a (normally-unused) function to its only use.
3957         * editfns.c, lisp.h (get_operating_system_release): Remove.
3958         * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
3959         worth the hassle of breaking this out.
3961         * xterm.c: Make symbols static if they're not exported.
3962         (x_raise_frame, x_lower_frame, x_wm_set_window_state):
3963         (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
3964         (x_destroy_window, x_delete_display):
3965         Now static.
3966         (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
3967         (x_mouse_leave): Remove; unused.
3968         * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
3969         (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
3970         (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
3971         Remove decls.
3972         (x_mouse_leave): Declare only if WINDOWSNT.
3973         (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
3974         (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
3975         USE_X_TOOLKIT.
3977         * ftxfont.c: Make symbols static if they're not exported.
3978         (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
3979         HAVE_FREETYPE.
3980         * font.h (ftxfont_driver): Likewise.
3982         * xfns.c: Make symbols static if they're not exported.
3983         (x_last_font_name, x_display_info_for_name):
3984         (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
3985         (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
3986         (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
3987         (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
3988         (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
3989         (last_show_tip_args): Now static.
3990         (xic_defaut_fontset, xic_create_fontsetname): Define only if
3991         defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
3992         (x_screen_planes): Remove; unused.
3993         * dispextern.h (x_screen_planes): Remove decl.
3995         * dispnew.c: Make symbols static if they're not exported.
3996         * dispextern.h (redraw_garbaged_frames, scrolling):
3997         (increment_row_positions): Remove.
3998         * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
3999         (delayed_size_change, glyph_matrix_count, glyph_pool_count):
4000         Now static.
4001         (redraw_garbaged_frames): Remove; unused.
4003         * xfaces.c: Make symbols static if they're not exported.
4004         * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
4005         Remove decls.
4006         * xterm.h (defined_color): Remove decls.
4007         (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
4008         * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
4009         (menu_face_changed_default, defined_color, free_realized_face):
4010         (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
4011         (ascii_face_of_lisp_face): Remove; unused.
4013         * xdisp.c: Make symbols static if they're not exported.
4014         * dispextern.h (scratch_glyph_row, window_box_edges):
4015         (glyph_to_pixel_coords, set_cursor_from_row):
4016         (get_next_display_element, set_iterator_to_next):
4017         (highlight_trailing_whitespace, frame_to_window_pixel_xy):
4018         (show_mouse_face): Remove decls
4019         * frame.h (message_buf_print): Likewise.
4020         * lisp.h (pop_message, set_message, check_point_in_composition):
4021         Likewise.
4022         * xterm.h (set_vertical_scroll_bar): Likewise.
4023         * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
4024         (message_buf_print, scratch_glyph_row, displayed_buffer):
4025         (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
4026         (get_next_display_element, show_mouse_face, window_box_edges):
4027         (frame_to_window_pixel_xy, check_point_in_composition):
4028         (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
4029         (glyph_to_pixel_coords): Remove; unused.
4031         * dired.c (file_name_completion): Now static.
4033         * dbusbind.c (xd_in_read_queued_messages): Now static.
4035         * lisp.h (circular_list_error, FOREACH): Remove; unused.
4036         * data.c (circular_list_error): Remove.
4038         * commands.h (last_point_position, last_point_position_buffer):
4039         (last_point_position_window): Remove decls.
4040         * keyboard.c: Make these variables static.
4042         * coding.h (coding, code_convert_region, encode_coding_gap):
4043         Remove decls.
4044         * coding.c (Vsjis_coding_system, Vbig5_coding_system):
4045         (iso_code_class, detect_coding, code_convert_region): Now static.
4046         (encode_coding_gap): Remove; unused.
4048         * chartab.c (chartab_chars, chartab_bits): Now static.
4050         * charset.h (charset_iso_8859_1): Remove decl.
4051         * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
4052         Now static.
4054         * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
4055         * ccl.c (Vccl_program_table): Now static.
4056         (check_ccl_update): Remove; unused.
4058         * category.c (SET_CATEGORY_SET, set_category_set): Move here.
4059         * category.h: ... from here.
4060         * category.c (check_category_table, set_category_set): Now static.
4062         * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
4063         * lisp.h: Remove these decls.
4065         * buffer.c (buffer_count): Remove unused var.
4067         * bidi.c (bidi_dump_cached_states): Mark as externally visible,
4068         so that it's not optimized away.
4069         (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
4070         * dispextern.h (bidi_dump_cached_states): Remove, since it's
4071         exported only to the debugger.
4073         * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
4074         * atimer.h (run_all_atimers): Remove; not exported.
4076         font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
4077         * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
4078         was inaccessible from Lisp.
4079         (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
4080         * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
4082         alloc.c: Import and export fewer symbols, and remove unused items.
4083         * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
4084         is defined.
4085         (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
4086         it's not optimized away by whole-program optimization.
4087         (message_enable_multibyte, free_misc): Remove.
4088         (catchlist, handlerlist, mark_backtrace):
4089         Declare only if BYTE_MARK_STACK.
4090         (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
4091         * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
4092         (message_enable_multibyte): Remove decl.
4093         (free_misc, interval_free_list, float_block, float_block_index):
4094         (n_float_blocks, float_free_list, cons_block, cons_block_index):
4095         (cons_free_list, last_marked_index):
4096         Now static.
4097         (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
4098         * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
4099         (mark_backtrace): Define only if BYTE_MARK_STACK.
4100         * xdisp.c (message_enable_multibyte): Now static.
4102         Declare Lisp_Object Q* variables to be 'static' if not exported.
4103         This makes it easier for human readers (and static analyzers)
4104         to see whether these variables are used from other modules.
4105         * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
4106         * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
4107         * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
4108         * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
4109         * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
4110         * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
4111         * xmenu.c, xselect.c:
4112         Declare Q* vars static if they are not used in other modules.
4113         * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
4114         * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
4115         Remove decls of unexported vars.
4116         * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
4118         * lisp.h (DEFINE_FUNC): Make sname 'static'.
4120         Make Emacs functions such as Fatom 'static' by default.
4121         This makes it easier for human readers (and static analyzers)
4122         to see whether these functions can be called from other modules.
4123         DEFUN now defines a static function.  To make the function external
4124         so that it can be used in other C modules, use the new macro DEFUE.
4125         * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
4126         (Finit_image_library):
4127         (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
4128         (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
4129         (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
4130         Remove decls, since these functions are now static.
4131         (Funintern, Fget_internal_run_time): New decls, since these functions
4132         were already external.
4134         * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
4135         * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
4136         * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
4137         * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
4138         * keyboard.c, keymap.c, lread.c:
4139         * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
4140         * syntax.c, term.c, terminal.c, textprop.c, undo.c:
4141         * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
4142         Mark functions with DEFUE instead of DEFUN,
4143         if they are used in other modules.
4144         * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
4145         decls for now-static functions.
4146         * buffer.h (Fdelete_overlay): Remove decl.
4147         * callproc.c (Fgetenv_internal): Mark as internal.
4148         * composite.c (Fremove_list_of_text_properties): Remove decl.
4149         (Fcomposition_get_gstring): New forward static decl.
4150         * composite.h (Fcomposite_get_gstring): Remove decl.
4151         * dired.c (Ffile_attributes): New forward static decl.
4152         * doc.c (Fdocumntation_property): New forward static decl.
4153         * eval.c (Ffetch_bytecode): New forward static decl.
4154         (Funintern): Remove extern decl; now in .h file where it belongs.
4155         * fileio.c (Fmake_symbolic_link): New forward static decl.
4156         * image.c (Finit_image_library): New forward static decl.
4157         * insdel.c (Fcombine_after_change_execute): Make forward decl static.
4158         * intervals.h (Fprevious_property_change):
4159         (Fremove_list_of_text_properties): Remove decls.
4160         * keyboard.c (Fthis_command_keys): Remove decl.
4161         (Fcommand_execute): New forward static decl.
4162         * keymap.c (Flookup_key): New forward static decl.
4163         (Fcopy_keymap): Now static.
4164         * keymap.h (Flookup_key): Remove decl.
4165         * process.c (Fget_process): New forward static decl.
4166         (Fprocess_datagram_address): Mark as internal.
4167         * syntax.c (Fsyntax_table_p): New forward static decl.
4168         (skip_chars): Remove duplicate decl.
4169         * textprop.c (Fprevious_property_change): New forward static decl.
4170         * window.c (Fset_window_fringes, Fset_window_scroll_bars):
4171         Now internal.
4172         (Fset_window_margins, Fset_window_vscroll): New forward static decls.
4173         * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
4175         * editfns.c (Fformat): Remove unreachable code.
4177 2011-04-14  Andreas Schwab  <schwab@linux-m68k.org>
4179         * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
4180         change.  (Bug#8496)
4182 2011-04-13  Eli Zaretskii  <eliz@gnu.org>
4184         * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
4185         when at ZV.  (Bug#8487)
4187 2011-04-12  Andreas Schwab  <schwab@linux-m68k.org>
4189         * charset.c (Fclear_charset_maps): Use xfree instead of free.
4190         (Bug#8437)
4191         * keyboard.c (parse_tool_bar_item): Likewise.
4192         * sound.c (sound_cleanup, alsa_close): Likewise.
4193         * termcap.c (tgetent): Likewise.
4194         * xfns.c (x_default_font_parameter): Likewise.
4195         * xsettings.c (read_and_apply_settings): Likewise.
4197         * alloc.c (overrun_check_malloc, overrun_check_realloc)
4198         (overrun_check_free): Protoize.
4200 2011-04-12  Paul Eggert  <eggert@cs.ucla.edu>
4202         * sysdep.c (emacs_read, emacs_write): Check for negative sizes
4203         since callers should never pass a negative size.
4204         Change the signature to match that of plain 'read' and 'write'; see
4205         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
4206         * lisp.h: Update prototypes of emacs_write and emacs_read.
4208 2011-04-11  Eli Zaretskii  <eliz@gnu.org>
4210         * xdisp.c (redisplay_window): Don't try to determine the character
4211         position of the scroll margin if the window start point w->startp
4212         is outside the buffer's accessible region.  (Bug#8468)
4214 2011-04-10  Eli Zaretskii  <eliz@gnu.org>
4216         Fix write-region and its subroutines for buffers > 2GB.
4217         * fileio.c (a_write, e_write): Modify declaration of arguments and
4218         local variables to support buffers larger than 2GB.
4219         (Fcopy_file): Use EMACS_INT for return value of emacs_read.
4221         * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
4222         argument, local variables, and return value.
4224         * lisp.h: Update prototypes of emacs_write and emacs_read.
4226         * sound.c (vox_write): Use ssize_t for return value of emacs_write.
4228 2011-04-10  Paul Eggert  <eggert@cs.ucla.edu>
4230         * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
4232         Fix more problems found by GCC 4.6.0's static checks.
4234         * xdisp.c (vmessage): Use a better test for character truncation.
4236         * charset.c (load_charset_map): <, not <=, for optimization,
4237         and to avoid potential problems with integer overflow.
4238         * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
4239         * casetab.c (set_identity, shuffle): Likewise.
4240         * editfns.c (Fformat): Likewise.
4241         * syntax.c (skip_chars): Likewise.
4243         * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
4244         This also lets GCC 4.6.0 generate slightly better loop code.
4246         * callint.c (Fcall_interactively): <, not <=, for optimization.
4247         (Fcall_interactively): Count the number of arguments produced,
4248         not the number of arguments given.  This is simpler and lets GCC
4249         4.6.0 generate slightly better code.
4251         * ftfont.c: Distingish more carefully between FcChar8 and char.
4252         The previous code passed unsigned char * to a functions like
4253         strlen and xstrcasecmp that expect char *, which does not
4254         conform to the C standard.
4255         (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
4256         arguments to FcPatternGetString, and explicitly cast FcChar8 * to
4257         char * when the C standard requires it.
4259         * keyboard.c (read_char): Remove unused var.
4261         * eval.c: Port to Windows vsnprintf (Bug#8435).
4262         Include <limits.h>.
4263         (SIZE_MAX): Define if the headers do not.
4264         (verror): Do not give up if vsnprintf returns a negative count.
4265         Instead, grow the buffer.  This ports to Windows vsnprintf, which
4266         does not conform to C99.  Problem reported by Eli Zaretskii.
4267         Also, simplify the allocation scheme, by avoiding the need for
4268         calling realloc, and removing the ALLOCATED variable.
4270         * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
4272         Remove invocations of doprnt, as Emacs now uses vsnprintf.
4273         But keep the doprint source code for now, as we might revamp it
4274         and use it again (Bug#8435).
4275         * lisp.h (doprnt): Remove.
4276         * Makefile.in (base_obj): Remove doprnt.o.
4277         * deps.mk (doprnt.o): Remove.
4279         error: Print 32- and 64-bit integers portably (Bug#8435).
4280         Without this change, on typical 64-bit hosts error ("...%d...", N)
4281         was used to print both 32- and 64-bit integers N, which relied on
4282         undefined behavior.
4283         * lisp.h, src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h (pEd):
4284         New macro.
4285         * lisp.h (error, verror): Mark as printf-like functions.
4286         * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
4287         Report overflow in size calculations when allocating printf buffer.
4288         Do not truncate output string at its first null byte.
4289         * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
4290         Truncate the output at a character boundary, since vsnprintf does not
4291         do that.
4292         * charset.c (check_iso_charset_parameter): Convert internal
4293         character to string before calling 'error', since %c now has the
4294         printf meaning.
4295         * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
4296         overflow when computing char to be passed to 'error'.  Do not
4297         pass Lisp_Object to 'error'; pass the integer instead.
4298         * nsfns.m (Fns_do_applescript): Use int, not long, since it's
4299         formatted with plain %d.
4301         * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
4303         * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
4305         * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
4307         * xterm.c (x_catch_errors): Remove duplicate declaration.
4309         * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
4311         * xdisp.c, lisp.h (message_nolog): Remove; unused.
4313 2011-04-10  Jim Meyering  <meyering@redhat.com>
4315         use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
4316         * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
4317         return ssize_t not "int", and use size_t as the buffer length.
4318         (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
4319         * gnutls.h: Update declarations.
4320         * process.c (read_process_output): Use ssize_t, to match.
4321         (send_process): Likewise.
4323 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
4325         * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
4327 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
4329         * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
4330         Use unsigned char, to match FcChar8 type definition.
4332         * xterm.c (handle_one_xevent):
4333         * xmenu.c (create_and_show_popup_menu):
4334         * xselect.c (x_decline_selection_request)
4335         (x_reply_selection_request): Avoid type-punned deref of X events.
4337 2011-04-09  Eli Zaretskii  <eliz@gnu.org>
4339         Fix some uses of `int' instead of EMACS_INT.
4340         * search.c (string_match_1, fast_string_match)
4341         (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
4342         (scan_buffer, find_next_newline_no_quit)
4343         (find_before_next_newline, search_command, Freplace_match)
4344         (Fmatch_data): Make some `int' variables be EMACS_INT.
4346         * xdisp.c (display_count_lines): 3rd argument and return value now
4347         EMACS_INT.  All callers changed.
4348         (pint2hrstr): Last argument is now EMACS_INT.
4350         * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
4351         (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
4352         (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
4353         (decode_coding_utf_16, decode_coding_emacs_mule)
4354         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
4355         (decode_coding_ccl, decode_coding_charset)
4356         <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
4357         (decode_coding_iso_2022, decode_coding_emacs_mule)
4358         (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
4359         <char_offset, last_offset>: Declare EMACS_INT.
4360         (encode_coding_utf_8, encode_coding_utf_16)
4361         (encode_coding_emacs_mule, encode_invocation_designation)
4362         (encode_designation_at_bol, encode_coding_iso_2022)
4363         (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
4364         (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
4365         Declare EMACS_INT.
4366         (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
4367         (encode_invocation_designation): Last argument P_NCHARS is now
4368         EMACS_INT.
4369         (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
4370         (produce_chars): from_nchars and to_nchars are now EMACS_INT.
4372         * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
4373         All users changed.
4375         * ccl.c (Fccl_execute_on_string): Declare some variables
4376         EMACS_INT.
4378 2011-04-08  Samuel Thibault  <sthibault@debian.org>  (tiny change)
4380         * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
4382 2011-03-19  Christoph Scholtes  <cschol2112@googlemail.com>
4384         * process.c (Fformat_network_address): Doc fix.
4386 2011-04-08  T.V. Raman  <tv.raman.tv@gmail.com>  (tiny change)
4388         * xml.c (parse_region): Avoid creating spurious whiespace nodes.
4390 2011-04-08  Chong Yidong  <cyd@stupidchicken.com>
4392         * keyboard.c (read_char): Call Lisp function help-form-show,
4393         instead of using internal_with_output_to_temp_buffer.
4394         (Qhelp_form_show): New var.
4395         (syms_of_keyboard): Use DEFSYM macro.
4397         * print.c (internal_with_output_to_temp_buffer): Function deleted.
4399         * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
4401 2011-04-06  Chong Yidong  <cyd@stupidchicken.com>
4403         * process.c (Flist_processes): Remove to Lisp.
4404         (list_processes_1): Delete.
4406 2011-04-06  Eli Zaretskii  <eliz@gnu.org>
4408         * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
4410         * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
4412 2011-04-06  Paul Eggert  <eggert@cs.ucla.edu>
4414         Fix more problems found by GCC 4.6.0's static checks.
4416         * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
4418         * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
4420         * lisp.h (message, message_nolog, fatal): Mark as printf-like.
4422         * xdisp.c (vmessage): Mark as a printf-like function.
4424         * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
4426         * sound.c (sound_warning): Don't crash if arg contains a printf format.
4428         * image.c (tiff_error_handler, tiff_warning_handler): Mark as
4429         printf-like functions.
4430         (tiff_load): Add casts to remove these marks before passing them
4431         to system-supplied API.
4433         * eval.c (Fsignal): Remove excess argument to 'fatal'.
4435         * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
4436         This avoids several warnings with gcc -Wstrict-overflow.
4437         (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
4438         directly, rather than having caller test rule sign.  This avoids
4439         some unnecessary tests.
4440         * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
4441         (COMPOSITION_ENCODE_RULE): Arguments now must be valid.  This
4442         affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
4444         * xfont.c (xfont_text_extents): Remove var that was set but not used.
4445         (xfont_open): Avoid unnecessary tests.
4447         * composite.c (composition_gstring_put_cache): Use unsigned integer.
4449         * composite.h, composite.c (composition_gstring_put_cache):
4450         Use EMACS_INT, not int, for length.
4452         * composite.h (COMPOSITION_DECODE_REFS): New macro,
4453         breaking out part of COMPOSITION_DECODE_RULE.
4454         (COMPOSITION_DECODE_RULE): Use it.
4455         * composite.c (get_composition_id): Remove unused local vars,
4456         by using the new macro.
4458         * textprop.c (set_text_properties_1): Change while to do-while,
4459         since the condition is always true at first.
4461         * intervals.c (graft_intervals_into_buffer): Mark var as used.
4462         (interval_deletion_adjustment): Return unsigned value.
4463         All uses changed.
4465         * process.c (list_processes_1, create_pty, read_process_output):
4466         (exec_sentinel): Remove vars that were set but not used.
4467         (create_pty): Remove unnecessary "volatile"s.
4468         (Fnetwork_interface_info): Avoid possibility of int overflow.
4469         (read_process_output): Do adaptive read buffering even if carryover.
4470         (read_process_output): Simplify nbytes computation if buffered.
4472         * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
4474         * syntax.c (scan_words): Remove var that was set but not used.
4475         (update_syntax_table): Use unsigned instead of int.
4477         * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
4478         (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
4479         (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
4481         * print.c (print_error_message): Avoid int overflow.
4483         * font.c (font_list_entities): Redo for clarity,
4484         so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
4486         * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
4487         (font_score): Avoid potential overflow in diff calculation.
4489         * fns.c (substring_both): Remove var that is set but not used.
4490         (sxhash): Redo loop for clarity and to avoid wraparound warning.
4492         * eval.c (funcall_lambda): Rename local to avoid shadowing.
4494         * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
4495         Otherwise, GCC 4.6.0 optimizes the loop check away since the check
4496         can always succeed if overflow has undefined behavior.
4498         * search.c (boyer_moore, wordify): Remove vars set but not used.
4499         (wordify): Omit three unnecessary tests.
4501         * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
4502         All callers changed.  This avoids the need for an unused var.
4504         * casefiddle.c (casify_region): Remove var that is set but not used.
4506         * dired.c (file_name_completion): Remove var that is set but not used.
4508         * fileio.c (Finsert_file_contents): Make EOF condition clearer.
4510         * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
4511         (Finsert_file_contents): Remove unnecessary code checking fd.
4513         * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
4514         Check for integer overflow on size calculations.
4516         * buffer.c (Fprevious_overlay_change): Remove var that is set
4517         but not used.
4519         * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
4520         Remove vars that are set but not used.
4521         (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
4522         (timer_check_2): Mark vars as initialized.
4524         * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
4526         * image.c (lookup_image): Remove var that is set but not used.
4527         (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
4529         * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
4530         that are set but not used.
4532         * xfns.c (make_invisible_cursor): Don't return garbage
4533         if XCreateBitmapFromData fails (Bug#8410).
4535         * xselect.c (x_get_local_selection, x_handle_property_notify):
4536         Remove vars that are set but not used.
4538         * xfns.c (x_create_tip_frame): Remove var that is set but not used.
4539         (make_invisible_cursor): Initialize a possibly-uninitialized variable.
4541         * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
4542         Remove var that is set but not used.
4543         (scroll_bar_windows_size): Now size_t, not int.
4544         (x_send_scroll_bar_event): Use size_t, not int, for sizes.
4545         Check for overflow.
4547         * xfaces.c (realize_named_face): Remove vars that are set but not used.
4548         (map_tty_color) [!defined MSDOS]: Likewise.
4550         * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
4552         * coding.c: Remove vars that are set but not used.
4553         (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
4554         All callers changed.
4555         (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
4556         (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
4557         (decode_coding_charset): Remove vars that are set but not used.
4559         * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
4560         that is set but not used.
4562         * print.c (print_object): Remove var that is set but not used.
4564         Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
4565         The gnulib version avoids calling malloc in the usual case,
4566         and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
4567         * fileio.c (Ffile_symlink_p): Use emacs_readlink.
4568         * filelock.c (current_lock_owner): Likewise.
4569         * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
4570         * sysdep.c: Include allocator.h, careadlinkat.h.
4571         (emacs_no_realloc_allocator): New static constant.
4572         (emacs_readlink): New function.
4573         * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
4574         ../lib/careadlinkat.h.
4576 2011-04-04  Stefan Monnier  <monnier@iro.umontreal.ca>
4578         * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
4579         first non-nil return value).
4581 2011-04-03  Jan Djärv  <jan.h.d@swipnet.se>
4583         * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
4584         if not defined (Bug#8403).
4586 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
4588         * xdisp.c (display_count_lines): Remove parameter `start',
4589         unused since 1998-01-01T02:27:27Z!rms@gnu.org.  All callers changed.
4590         (get_char_face_and_encoding): Remove parameter `multibyte_p',
4591         unused since 2008-05-14T01:40:23Z!handa@m17n.org.  All callers changed.
4592         (fill_stretch_glyph_string): Remove parameters `row' and `area',
4593         unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
4594         and thereabouts.  All callers changed.
4595         (get_per_char_metric): Remove parameter `f', unused since
4596         2008-05-14T01:40:23Z!handa@m17n.org.  All callers changed.
4598 2011-04-02  Jim Meyering  <meyering@redhat.com>
4600         do not dereference NULL upon failed strdup
4601         * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
4602         (ns_get_family): Likewise.
4604 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
4606         * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
4608 2011-04-02  Jan Djärv  <jan.h.d@swipnet.se>
4610         * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
4611         later (Bug#8403).
4613 2011-04-01  Stefan Monnier  <monnier@iro.umontreal.ca>
4615         Add lexical binding.
4617         * window.c (Ftemp_output_buffer_show): New fun.
4618         (Fsave_window_excursion):
4619         * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
4621         * lread.c (lisp_file_lexically_bound_p): New function.
4622         (Fload): Bind Qlexical_binding.
4623         (readevalloop): Remove `evalfun' arg.
4624         Bind Qinternal_interpreter_environment.
4625         (Feval_buffer): Bind Qlexical_binding.
4626         (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
4627         Mark as dynamic.
4628         (syms_of_lread): Declare `lexical-binding'.
4630         * lisp.h (struct Lisp_Symbol): New field `declared_special'.
4632         * keyboard.c (eval_dyn): New fun.
4633         (menu_item_eval_property): Use it.
4635         * image.c (parse_image_spec): Use Ffunctionp.
4637         * fns.c (concat, mapcar1): Accept byte-code-functions.
4639         * eval.c (Fsetq): Handle lexical vars.
4640         (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
4641         (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
4642         (FletX, Flet): Obey lexical binding.
4643         (Fcommandp): Handle closures.
4644         (Feval): New `lexical' arg.
4645         (eval_sub): New function extracted from Feval.  Use it almost
4646         everywhere where Feval was used.  Look up vars in lexical env.
4647         Handle closures.
4648         (Ffunctionp): Move from subr.el.
4649         (Ffuncall): Handle closures.
4650         (apply_lambda): Remove `eval_flags'.
4651         (funcall_lambda): Handle closures and new byte-code-functions.
4652         (Fspecial_variable_p): New function.
4653         (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
4654         but without exporting it to Lisp.
4656         * doc.c (Fdocumentation, store_function_docstring):
4657         * data.c (Finteractive_form): Handle closures.
4659         * callint.c (Fcall_interactively): Preserve lexical-binding mode for
4660         interactive spec.
4662         * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
4663         New byte-codes.
4664         (exec_byte_code): New function extracted from Fbyte_code to handle new
4665         calling convention for byte-code-functions.  Add new byte-codes.
4667         * buffer.c (defvar_per_buffer): Set new `declared_special' field.
4669         * alloc.c (Fmake_symbol): Init new `declared_special' field.
4671 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
4673         * xdisp.c (redisplay_internal): Fix prototype.
4675 2011-03-31  Eli Zaretskii  <eliz@gnu.org>
4677         * xdisp.c (SCROLL_LIMIT): New macro.
4678         (try_scrolling): Use it when setting scroll_limit.
4679         Limit scrolling to 100 screen lines.
4680         (redisplay_window): Even when falling back on "recentering",
4681         position point in the window according to scroll-conservatively,
4682         scroll-margin, and scroll-*-aggressively variables.  (Bug#6671)
4684         (try_scrolling): When point is above the window, allow searching
4685         as far as scroll_max, or one screenful, to compute vertical
4686         distance from PT to the scroll margin position.  This prevents
4687         try_scrolling from unnecessarily failing when
4688         scroll-conservatively is set to a value slightly larger than the
4689         window height.  Clean up the case of PT below the margin at bottom
4690         of window: scroll_max can no longer be INT_MAX.  When aggressive
4691         scrolling is in use, don't let point enter the opposite scroll
4692         margin as result of the scroll.
4693         (syms_of_xdisp) <scroll-conservatively>: Document the
4694         threshold of 100 lines for never-recentering scrolling.
4696 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
4698         * dispextern.h (move_it_by_lines):
4699         * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
4700         since 2000-12-29T14:24:09Z!gerd@gnu.org.  All callers changed.
4701         (message_log_check_duplicate): Remove parameters `prev_bol' and
4702         `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org.  All callers changed.
4703         (redisplay_internal): Remove parameter `preserve_echo_area',
4704         unused since 1999-07-21T21:43:52Z!gerd@gnu.org.  All callers changed.
4706         * indent.c (Fvertical_motion):
4707         * window.c (window_scroll_pixel_based, Frecenter):
4708         Don't pass `need_y_p' to `move_it_by_lines'.
4710 2011-03-30  Stefan Monnier  <monnier@iro.umontreal.ca>
4712         * eval.c (struct backtrace): Don't cheat with negative numbers, but do
4713         steal a few bits to be more compact.
4714         (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
4715         Remove unneeded casts.
4717         * bytecode.c (Fbyte_code): CAR and CDR can GC.
4719 2011-03-30  Zachary Kanfer  <zkanfer@gmail.com>  (tiny change)
4721         * keyboard.c (Fexecute_extended_command): Do log the "suggest key
4722         binding" message (bug#7967).
4724 2011-03-30  Paul Eggert  <eggert@cs.ucla.edu>
4726         Fix more problems found by GCC 4.6.0's static checks.
4728         * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
4729         Remove unused local var.
4731         * editfns.c (Fmessage_box): Remove unused local var.
4733         * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
4734         (note_mode_line_or_margin_highlight, note_mouse_highlight):
4735         Omit unused local vars.
4736         * window.c (shrink_windows): Omit unused local var.
4737         * menu.c (digest_single_submenu): Omit unused local var.
4738         * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
4739         Omit unused local var.
4741         * keyboard.c (parse_modifiers_uncached, parse_modifiers):
4742         Don't assume string length fits in int.
4743         (keyremap_step, read_key_sequence): Use size_t for sizes.
4744         (read_key_sequence): Don't check last_real_key_start redundantly.
4746         * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
4747         instead of alloca (Bug#8344).
4749         * eval.c (Fbacktrace): Don't assume nargs fits in int.
4750         (Fbacktrace_frame): Don't assume nframes fits in int.
4752         * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
4754         * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
4755         concerns.
4757         * term.c (produce_glyphless_glyph): Remove unnecessary test.
4759         * cm.c (calccost): Turn while-do into do-while, for clarity.
4761         * keyboard.c (syms_of_keyboard): Use the same style as later
4762         in this function when indexing through an array.  This also
4763         works around GCC bug 48267.
4765         * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
4767         * xselect.c (x_check_property_data): Return correct size (Bug#8335).
4769         * chartab.c (sub_char_table_ref_and_range): Redo for slight
4770         efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
4772         * keyboard.c, keyboard.h (num_input_events): Now size_t.
4773         This avoids undefined behavior on integer overflow, and is a bit
4774         more convenient anyway since it is compared to a size_t variable.
4776         Variadic C functions now count arguments with size_t, not int.
4777         This avoids an unnecessary limitation on 64-bit machines, which
4778         caused (substring ...) to crash on large vectors (Bug#8344).
4779         * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
4780         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
4781         All variadic functions and their callers changed accordingly.
4782         (struct gcpro.nvars): Now size_t, not int.  All uses changed.
4783         * data.c (arith_driver, float_arith_driver): Likewise.
4784         * editfns.c (general_insert_function): Likewise.
4785         * eval.c (struct backtrace.nargs, interactive_p)
4786         (internal_condition_case_n, run_hook_with_args, apply_lambda)
4787         (funcall_lambda, mark_backtrace): Likewise.
4788         * fns.c (concat): Likewise.
4789         * frame.c (x_set_frame_parameters): Likewise.
4790         * fns.c (get_key_arg): Now accepts and returns size_t, and returns
4791         0 if not found, not -1.  All callers changed.
4793         * alloc.c (garbage_collect): Don't assume stack size fits in int.
4794         (stack_copy_size): Now size_t, not int.
4795         (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
4797 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
4799         * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
4800         unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
4801         All callers changed.
4803         * lisp.h (multibyte_char_to_unibyte):
4804         * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
4805         unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
4806         * character.h (CHAR_TO_BYTE8):
4807         * cmds.c (internal_self_insert):
4808         * editfns.c (general_insert_function):
4809         * keymap.c (push_key_description):
4810         * search.c (Freplace_match):
4811         * xdisp.c (message_dolog, set_message_1): All callers changed.
4813 2011-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
4815         * keyboard.c (safe_run_hook_funcall): New function.
4816         (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
4817         don't set the hook to nil, but remove the offending function instead.
4818         (Qcommand_hook_internal): Remove, unused.
4819         (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
4820         Vcommand_hook_internal.
4822         * eval.c (enum run_hooks_condition): Remove.
4823         (funcall_nil, funcall_not): New functions.
4824         (run_hook_with_args): Call each function through a `funcall' argument.
4825         Remove `cond' argument, now redundant.
4826         (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
4827         (Frun_hook_with_args_until_failure): Adjust accordingly.
4828         (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
4830 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
4832         * dispextern.h (string_buffer_position): Remove declaration.
4834         * print.c (strout): Remove parameter `multibyte', unused since
4835         1999-08-21T19:30:21Z!gerd@gnu.org.  All callers changed.
4837         * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
4838         never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
4839         All callers changed.
4841         * w32.c (_wsa_errlist): Use braces for struct initializers.
4843         * xdisp.c (string_buffer_position_lim): Remove parameter `w',
4844         never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
4845         All callers changed.
4846         (string_buffer_position): Likewise.  Also, make static (it's never
4847         used outside xdisp.c).
4848         (cursor_row_p): Remove parameter `w', unused since
4849         2000-10-17T16:08:57Z!gerd@gnu.org.  All callers changed.
4850         (decode_mode_spec): Remove parameter `precision', introduced during
4851         Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
4852         All callers changed.
4854 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
4856         * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
4858 2011-03-27  Anders Lindgren  <andlind@gmail.com>
4860         * nsterm.m (ns_menu_bar_is_hidden): New variable.
4861         (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
4862         (ns_update_auto_hide_menu_bar): New functions.
4863         (ns_update_begin): Call ns_update_auto_hide_menu_bar.
4864         (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
4865         ns_constrain_all_frames.
4866         (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
4867         (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
4869 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
4871         * nsmenu.m (runDialogAt): Remove argument to timer_check.
4873 2011-03-27  Glenn Morris  <rgm@gnu.org>
4875         * syssignal.h: Replace RETSIGTYPE with void.
4876         * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
4877         * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
4878         Replace SIGTYPE with void everywhere.
4879         * s/usg5-4-common.h (SIGTYPE): Remove definition.
4880         * s/template.h (SIGTYPE): Remove commented out definition.
4882 2011-03-26  Eli Zaretskii  <eliz@gnu.org>
4884         * xdisp.c (redisplay_window): Don't check buffer's clip_changed
4885         flag as a prerequisite for invoking try_scrolling.  (Bug#6671)
4887 2011-03-26  Juanma Barranquero  <lekktu@gmail.com>
4889         * w32.c (read_unc_volume): Use parameter `henum', instead of
4890         global variable `wget_enum_handle'.
4892         * keymap.c (describe_vector): Remove parameters `indices' and
4893         `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
4894         (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
4896         * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
4898         * keyboard.c (timer_check): Remove parameter `do_it_now',
4899         unused since 1996-04-12T06:01:29Z!rms@gnu.org.
4900         (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
4901         unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
4903         * keyboard.c (read_char):
4904         * w32menu.c (w32_menu_display_help):
4905         * xmenu.c (show_help_event, menu_help_callback):
4906         Adjust calls to `show_help_echo'.
4908         * gtkutil.c (xg_maybe_add_timer):
4909         * keyboard.c (readable_events):
4910         * process.c (wait_reading_process_output):
4911         * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
4913         * insdel.c (adjust_markers_gap_motion):
4914         Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
4915         (gap_left, gap_right): Don't call it.
4917 2011-03-25  Chong Yidong  <cyd@stupidchicken.com>
4919         * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
4920         incurred during fontification.
4922 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
4924         * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
4925         (DEFVAR_PER_BUFFER): Don't pass it.
4927         * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
4928         (scrolling_window): Don't pass it.
4930 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
4932         * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
4934         * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
4935         and `suffix'.
4936         (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
4937         of variables specific to SELinux and computation of `encoded_absname'.
4939         * image.c (XPutPixel): Remove unused variable `height'.
4941         * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
4943         * unexw32.c (get_section_info): Remove unused variable `section'.
4945         * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
4946         (system_process_attributes): Remove unused variable `sess'.
4947         (sys_read): Remove unused variable `err'.
4949         * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
4950         (w32_wnd_proc): Remove unused variable `isdead'.
4951         (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
4952         (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
4953         (x_create_tip_frame): Remove unused variable `tem'.
4955         * w32inevt.c (w32_console_read_socket):
4956         Remove unused variable `no_events'.
4958         * w32term.c (x_draw_composite_glyph_string_foreground):
4959         Remove unused variable `width'.
4961 2011-03-24  Juanma Barranquero  <lekktu@gmail.com>
4963         * w32term.c (x_set_glyph_string_clipping):
4964         Don't pass uninitialized region to CombineRgn.
4966 2011-03-23  Juanma Barranquero  <lekktu@gmail.com>
4968         * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
4969         (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
4970         (Fx_close_connection): Remove unused variable `i'.
4972         * w32font.c (w32font_draw): Return number of glyphs.
4973         (w32font_open_internal): Remove unused variable `i'.
4974         (w32font_driver): Add missing initializer.
4976         * w32menu.c (utf8to16): Remove unused variable `utf16'.
4977         (fill_in_menu): Remove unused variable `items_added'.
4979         * w32term.c (last_mouse_press_frame): Remove static global variable.
4980         (w32_clip_to_row): Remove unused variable `f'.
4981         (x_delete_terminal): Remove unused variable `i'.
4983         * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
4984         (NOTHING): Remove unused static global variable.
4985         (uniscribe_check_otf): Remove unused variable `table'.
4986         (uniscribe_font_driver): Add missing initializers.
4988 2011-03-23  Julien Danjou  <julien@danjou.info>
4990         * term.c (Fsuspend_tty, Fresume_tty):
4991         * minibuf.c (read_minibuf, run_exit_minibuf_hook):
4992         * window.c (temp_output_buffer_show):
4993         * insdel.c (signal_before_change):
4994         * frame.c (Fhandle_switch_frame):
4995         * fileio.c (Fdo_auto_save):
4996         * emacs.c (Fkill_emacs):
4997         * editfns.c (save_excursion_restore):
4998         * cmds.c (internal_self_insert):
4999         * callint.c (Fcall_interactively):
5000         * buffer.c (Fkill_all_local_variables):
5001         * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
5002         Use Frun_hooks.
5003         (command_loop_1): Use Frun_hooks.  Call safe_run_hooks
5004         unconditionnaly since it does the check itself.
5006 2011-03-23  Paul Eggert  <eggert@cs.ucla.edu>
5008         Fix more problems found by GCC 4.5.2's static checks.
5010         * coding.c (encode_coding_raw_text): Avoid unnecessary test
5011         the first time through the loop, since we know p0 < p1 then.
5012         This also avoids a gcc -Wstrict-overflow warning.
5014         * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
5015         leading to a memory leak, possible in functions like
5016         load_charset_map_from_file that can allocate an unbounded number
5017         of objects (Bug#8318).
5019         * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
5020         that could (at least in theory) be that large.
5022         * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
5023         This is less likely to overflow, and avoids undefined behavior if
5024         overflow does occur.  All callers changed.  Use strtoul to scan
5025         for the unsigned long integer.
5026         (pint2hrstr): Simplify and tune code slightly.
5027         This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
5029         * scroll.c (do_scrolling): Work around GCC bug 48228.
5030         See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
5032         * frame.c (Fmodify_frame_parameters): Simplify loop counter.
5033         This also avoids a warning with gcc -Wstrict-overflow.
5034         (validate_x_resource_name): Simplify count usage.
5035         This also avoids a warning with gcc -Wstrict-overflow.
5037         * fileio.c (Fcopy_file): Report error if fchown or fchmod
5038         fail (Bug#8306).
5040         * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
5042         * process.c (Fmake_network_process): Use socklen_t, not int,
5043         where POSIX says socklen_t is required in portable programs.
5044         This fixes a porting bug on hosts like 64-bit HP-UX, where
5045         socklen_t is wider than int (Bug#8277).
5046         (Fmake_network_process, server_accept_connection):
5047         (wait_reading_process_output, read_process_output):
5048         Likewise.
5050         * process.c: Rename or move locals to avoid shadowing.
5051         (list_processes_1, Fmake_network_process):
5052         (read_process_output_error_handler, exec_sentinel_error_handler):
5053         Rename or move locals.
5054         (Fmake_network_process): Define label "retry_connect" only if needed.
5055         (Fnetwork_interface_info): Fix pointer signedness.
5056         (process_send_signal): Add cast to avoid pointer signedness problem.
5057         (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
5058         (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
5060         Make tparam.h and terminfo.c consistent.
5061         * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
5062         Include tparam.h instead, since it declares them.
5063         * cm.h (PC): Remove extern decl; tparam.h now does this.
5064         * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
5065         * terminfo.c: Include tparam.h, to check interfaces.
5066         (tparm): Make 1st arg a const pointer in decl.  Put it at top level.
5067         (tparam): Adjust signature to match interface in tparam.h;
5068         this removes some undefined behavior.  Check that outstring and len
5069         are zero, which they always are with Emacs.
5070         * tparam.h (PC, BC, UP): New extern decls.
5072         * xftfont.c (xftfont_shape): Now static, and defined only if needed.
5073         (xftfont_open): Rename locals to avoid shadowing.
5075         * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
5076         (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
5077         (OTF_TAG_SYM): Omit macro if not needed.
5078         (ftfont_list): Remove unused local.
5079         (get_adstyle_property, ftfont_pattern_entity):
5080         (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
5081         Rename locals to avoid shadowing.
5083         * xfont.c (xfont_list_family): Mark var as initialized.
5085         * xml.c (make_dom): Now static.
5087         * composite.c (composition_compute_stop_pos): Rename local to
5088         avoid shadowing.
5089         (composition_reseat_it): Remove unused locals.
5090         (find_automatic_composition, composition_adjust_point): Likewise.
5091         (composition_update_it): Mark var as initialized.
5092         (find_automatic_composition): Mark vars as initialized,
5093         with a FIXME (Bug#8290).
5095         character.h: Rename locals to avoid shadowing.
5096         * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
5097         (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
5098         (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
5099         (BUF_DEC_POS): Be more systematic about renaming local temporaries
5100         to avoid shadowing.
5102         * textprop.c (property_change_between_p): Remove; unused.
5104         * intervals.c (interval_start_pos): Now static.
5106         * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
5108         * atimer.c (start_atimer, append_atimer_lists, set_alarm):
5109         Rename locals to avoid shadowing.
5111         * sound.c (wav_play, au_play, Fplay_sound_internal):
5112         Fix pointer signedness.
5113         (alsa_choose_format): Remove unused local var.
5114         (wav_play): Initialize a variable to 0, to prevent undefined
5115         behavior (Bug#8278).
5117         * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
5119         * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
5121         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
5122         clobbering (Bug#8298).
5123         * sysdep.c (sys_subshell): Likewise.
5124         Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
5126         * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
5127         This should get cleaned up, so that child_setup has the
5128         same signature on all platforms.
5130         * callproc.c (call_process_cleanup): Now static.
5131         (relocate_fd): Rename locals to avoid shadowing.
5133 2011-03-22  Chong Yidong  <cyd@stupidchicken.com>
5135         * xterm.c (x_clear_frame): Remove XClearWindow call.  This appears
5136         not to be necessary, and produces flickering.
5138 2011-03-20  Glenn Morris  <rgm@gnu.org>
5140         * config.in: Remove file.
5142 2011-03-20  Juanma Barranquero  <lekktu@gmail.com>
5144         * minibuf.c (Vcompleting_read_function): Don't declare, global variables
5145         are now in src/globals.h.
5146         (syms_of_minibuf): Remove spurious & from previous change.
5148 2011-03-20  Leo  <sdl.web@gmail.com>
5150         * minibuf.c (completing-read-function): New variable.
5151         (completing-read-default): Rename from completing-read.
5152         (completing-read): Call completing-read-function.
5154 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
5156         * xfaces.c (Fx_load_color_file):
5157         Read color file from absolute filename (bug#8250).
5159 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
5161         * makefile.w32-in: Update dependencies.
5163 2011-03-17  Eli Zaretskii  <eliz@gnu.org>
5165         * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
5167 2011-03-17  Paul Eggert  <eggert@cs.ucla.edu>
5169         Fix more problems found by GCC 4.5.2's static checks.
5171         * process.c (make_serial_process_unwind, send_process_trap):
5172         (sigchld_handler): Now static.
5174         * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
5175         That way, the code declares only the vars that it needs.
5176         * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
5177         * s/cygwin.h (PTY_ITERATION): Likewise.
5178         * s/darwin.h (PTY_ITERATION): Likewise.
5179         * s/gnu-linux.h (PTY_ITERATION): Likewise.
5181         * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
5182         * process.c (allocate_pty): Don't declare stb unless it's needed.
5184         * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
5185         (CONSTANTLIM): Remove; unused.
5186         (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
5187         Define only if needed.
5189         * unexelf.c (unexec): Name an expression,
5190         to avoid gcc -Wbad-function-cast warning.
5191         Use a different way to cause a compilation error if anyone uses
5192         n rather than nn, a way that does not involve shadowing.
5193         (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
5195         * deps.mk (unexalpha.o): Remove; unused.
5197         New file unexec.h, the (simple) interface for unexec (Bug#8267).
5198         * unexec.h: New file.
5199         * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
5200         (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
5201         Depend on unexec.h.
5202         * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
5203         * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
5204         * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
5205         Change as necessary to match prototype in unexec.h.
5207         * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
5208         shadowing.
5209         (back_comment, skip_chars): Mark vars as initialized.
5211         * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
5212         Rename locals to avoid shadowing.
5214         * lread.c (read1): Rewrite so as not to use empty "else".
5215         (Fload, readevalloop, read1): Rename locals to avoid shadowing.
5217         * print.c (Fredirect_debugging_output): Fix pointer signedess.
5219         * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
5220         warning when compiling print.c.
5222         * font.c (font_unparse_fcname): Abort in an "impossible" situation
5223         instead of using an uninitialized var.
5224         (font_sort_entities): Mark var as initialized.
5226         * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
5228         * font.c (font_unparse_xlfd): Don't mix pointers to variables with
5229         pointers to constants.
5230         (font_parse_fcname): Remove unused vars.
5231         (font_delete_unmatched): Now static.
5232         (font_get_spec): Remove; unused.
5233         (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
5234         (font_update_drivers, Ffont_get_glyphs, font_add_log):
5235         Rename or move locals to avoid shadowing.
5237         * fns.c (require_nesting_list, require_unwind): Now static.
5238         (Ffillarray): Rename locals to avoid shadowing.
5240         * floatfns.c (domain_error2): Define only if needed.
5241         (Ffrexp, Fldexp): Rename locals to avoid shadowing.
5243         * alloc.c (mark_backtrace): Move decl from here ...
5244         * lisp.h: ... to here, so that it can be checked.
5246         * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
5247         (Fdefvar): Rewrite so as not to use empty "else".
5248         (lisp_indirect_variable): Name an expression,
5249         to avoid gcc -Wbad-function-cast warning.
5250         (Fdefvar): Rename locals to avoid shadowing.
5252         * callint.c (quotify_arg, quotify_args): Now static.
5253         (Fcall_interactively): Rename locals to avoid shadowing.
5254         Use const pointer when appropriate.
5256         * lisp.h (get_system_name, get_operating_system_release):
5257         Move decls here, to check interfaces.
5258         * process.c (get_operating_system_release): Move decl to lisp.h.
5259         * xrdb.c (get_system_name): Likewise.
5260         * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
5261         (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
5262         some of which prompt warnings from gcc -Wbad-function-cast.
5263         (Fformat_time_string, Fencode_time, Finsert_char):
5264         (Ftranslate_region_internal, Fformat):
5265         Rename or remove local vars to avoid shadowing.
5266         (Ftranslate_region_internal): Mark var as initialized.
5268         * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
5269         avoid shadowing.
5271         * lisp.h (eassert): Check that the argument compiles, even if
5272         ENABLE_CHECKING is not defined.
5274         * data.c (Findirect_variable): Name an expression, to avoid
5275         gcc -Wbad-function-cast warning.
5276         (default_value, arithcompare, arith_driver, arith_error): Now static.
5277         (store_symval_forwarding): Rename local to avoid shadowing.
5278         (Fmake_variable_buffer_local, Fmake_local_variable):
5279         Mark variables as initialized.
5280         (do_blv_forwarding, do_symval_forwarding): Remove; unused.
5282         * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
5283         (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
5284         Rename locals to avoid shadowing.
5285         (mark_stack): Move local variables into the #ifdef region where
5286         they're used.
5287         (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
5288         ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
5289         needed otherwise.
5290         (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
5291         (GC_STRING_CHARS): Remove; not used.
5292         (Fmemory_limit): Cast sbrk's returned value to char *.
5294         * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
5295         avoids undefined behavior in theory.
5297         * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
5299         Use functions, not macros, for up- and down-casing (Bug#8254).
5300         * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
5301         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove.  All callers changed
5302         to use the following functions instead of these macros.
5303         (downcase): Adjust to lack of DOWNCASE_TABLE.  Return int, not
5304         EMACS_INT, since callers assume the returned value fits in int.
5305         (upcase1): Likewise, for UPCASE_TABLE.
5306         (uppercasep, lowercasep, upcase): New static inline functions.
5307         * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
5308         the race-condition problem in the old DOWNCASE.
5310         * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
5311         Rename locals to avoid shadowing.
5312         (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
5313         (regex_compile, re_search_2, re_match_2_internal):
5314         Remove unused local vars.
5315         (FREE_VAR): Rewrite so as not to use empty "else",
5316         which gcc can warn about.
5317         (regex_compile, re_match_2_internal): Mark locals as initialized.
5318         (RETALLOC_IF): Define only if needed.
5319         (WORDCHAR_P): Likewise.  This one is never needed, but is used
5320         only in a comment talking about a compiler bug, so put inside
5321         the #if 0 of that comment.
5322         (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
5323         (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
5324         Remove; unused.
5326         * search.c (boyer_moore): Rename locals to avoid shadowing.
5327         * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
5328         (PREV_CHAR_BOUNDARY): Likewise.
5330         * search.c (simple_search): Remove unused var.
5332         * dired.c (compile_pattern): Move decl from here ...
5333         * lisp.h: ... to here, so that it can be checked.
5334         (struct re_registers): New forward decl.
5336         * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
5338         * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
5339         All uses changed.
5340         (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
5341         Rename locals to avoid shadowing.
5342         (Fvertical_motion): Mark locals as initialized.
5344         * casefiddle.c (casify_object, casify_region): Now static.
5345         (casify_region): Mark local as initialized.
5347         * cmds.c (internal_self_insert): Rename local to avoid shadowing.
5349         * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
5350         New macros, so that the caller can use some names other than
5351         gcpro1, gcpro2, etc.
5352         (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
5353         of the new macros.
5354         (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
5355         argument, for consistency with GCPRO2_VAR, etc: it is now the
5356         prefix of the variable, not the variable itself.  All uses
5357         changed.
5358         * dired.c (directory_files_internal, file_name_completion):
5359         Rename locals to avoid shadowing.
5361         Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
5362         An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
5363         dired.c's scmp function, had undefined behavior.
5364         * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
5365         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
5366         * buffer.h: ... to here, because these macros use current_buffer,
5367         and the new implementation with inline functions needs to have
5368         current_buffer in scope now, rather than later when the macros
5369         are used.
5370         (downcase, upcase1): New static inline functions.
5371         (DOWNCASE, UPCASE1): Reimplement using these functions.
5372         This avoids undefined behavior in expressions like
5373         DOWNCASE (x) == DOWNCASE (y), which previously suffered
5374         from race conditions in accessing the global variables
5375         case_temp1 and case_temp2.
5376         * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
5377         * lisp.h (case_temp1, case_temp2): Remove their decls.
5378         * character.h (ASCII_CHAR_P): Move from here ...
5379         * lisp.h: ... to here, so that the inline functions mentioned
5380         above can use them.
5382         * dired.c (directory_files_internal_unwind): Now static.
5384         * fileio.c (file_name_as_directory, directory_file_name):
5385         (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
5386         Now static.
5387         (file_name_as_directory): Use const pointers when appropriate.
5388         (Fexpand_file_name): Likewise.  In particular, newdir might
5389         point at constant storage, so make it a const pointer.
5390         (Fmake_directory_internal, Fread_file_name): Remove unused vars.
5391         (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
5392         signedness issues.
5393         (Fset_file_times, Finsert_file_contents, auto_save_error):
5394         Rename locals to avoid shadowing.
5396         * minibuf.c (choose_minibuf_frame_1): Now static.
5397         (Ftry_completion, Fall_completions): Rename or remove locals
5398         to avoid shadowing.
5400         * marker.c (bytepos_to_charpos): Remove; unused.
5402         * lisp.h (verify_bytepos, count_markers): New decls,
5403         so that gcc does not warn that these functions aren't declared.
5405         * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
5406         (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
5407         (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
5408         (copy_text): Remove unused local var.
5410         * filelock.c (within_one_second): Now static.
5411         (lock_file_1): Rename local to avoid shadowing.
5413         * buffer.c (fix_overlays_before): Mark locals as initialized.
5414         (fix_start_end_in_overlays): Likewise.  This function should be
5415         simplified by using pointers-to-pointers, but that's a different
5416         matter.
5417         (switch_to_buffer_1): Now static.
5418         (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
5419         (report_overlay_modification): Rename locals to avoid shadowing.
5421         * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
5422         Fix pointer signedness issue.
5423         (sys_subshell): Mark local as volatile if checking for lint,
5424         to suppress a gcc -Wclobbered warning that does not seem to be right.
5425         (MAXPATHLEN): Define only if needed.
5427         * process.c (serial_open, serial_configure): Move decls from here ...
5428         * systty.h: ... to here, so that they can be checked.
5430         * fns.c (get_random, seed_random): Move extern decls from here ...
5431         * lisp.h: ... to here, so that they can be checked.
5433         * sysdep.c (reset_io): Now static.
5434         (wait_for_termination_signal): Remove; unused.
5436         * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
5437         (copy_keymap_item, append_key, push_text_char_description):
5438         Now static.
5439         (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
5440         (DENSE_TABLE_SIZE): Remove; unused.
5441         (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
5442         (describe_map_tree):
5443         Rename locals to avoid shadowing.
5445         * keyboard.c: Declare functions static if they are not used elsewhere.
5446         (echo_char, echo_dash, cmd_error, top_level_2):
5447         (poll_for_input, handle_async_input): Now static.
5448         (read_char, kbd_buffer_get_event, make_lispy_position):
5449         (make_lispy_event, make_lispy_movement, apply_modifiers):
5450         (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
5451         (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
5452         (Fread_key_sequence_vector): Rename locals to avoid shadowing.
5453         (read_key_sequence, read_char): Mark locals as initialized.
5454         (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
5456         * keyboard.h (make_ctrl_char): New decl.
5457         (mark_kboards): Move decl here ...
5458         * alloc.c (mark_kboards): ... from here.
5460         * lisp.h (force_auto_save_soon): New decl.
5462         * emacs.c (init_cmdargs): Rename local to avoid shadowing.
5463         (DEFINE_DUMMY_FUNCTION): New macro.
5464         (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
5465         Use it.
5466         (main): Add casts to avoid warnings
5467         if GCC considers string literals to be constants.
5469         * lisp.h (fatal_error_signal): Add decl, since it's exported.
5471         * dbusbind.c: Pointer signedness fixes.
5472         (xd_signature, xd_append_arg, xd_initialize):
5473         (Fdbus_call_method, Fdbus_call_method_asynchronously):
5474         (Fdbus_method_return_internal, Fdbus_method_error_internal):
5475         (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
5476         (Fdbus_register_signal): Use SSDATA when the context wants char *.
5478         * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
5479         if GCC considers string literals to be constants.
5480         (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
5482 2011-03-16  Stefan Monnier  <monnier@iro.umontreal.ca>
5484         * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
5485         (print_preprocess, print_object): New macro to fix last change.
5487         * print.c (print_preprocess): Don't forget font objects.
5489 2011-03-16  Juanma Barranquero  <lekktu@gmail.com>
5491         * emacs.c (USAGE3): Doc fixes.
5493 2011-03-15  Andreas Schwab  <schwab@linux-m68k.org>
5495         * coding.c (detect_coding_iso_2022): Reorganize code to clarify
5496         structure.
5498 2011-03-14  Juanma Barranquero  <lekktu@gmail.com>
5500         * lisp.h (VWindow_system, Qfile_name_history):
5501         * keyboard.h (lispy_function_keys) [WINDOWSNT]:
5502         * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
5503         (w32_system_caret_x, w32_system_caret_y): Declare extern.
5505         * w32select.c: Don't #include "keyboard.h".
5506         (run_protected): Add extern declaration for waiting_for_input.
5508         * w32.c (Qlocal, noninteractive1, inhibit_window_system):
5509         * w32console.c (detect_input_pending, read_input_pending)
5510         (encode_terminal_code):
5511         * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
5512         (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
5513         (w32_system_caret_y, Qfile_name_history):
5514         * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
5515         * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
5516         * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
5517         (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
5518         * w32proc.c (Qlocal, report_file_error):
5519         * w32term.c (Vwindow_system, updating_frame):
5520         * w32uniscribe.c (initialized, uniscribe_font_driver):
5521         Remove unneeded extern declarations.
5523 2011-03-14  Chong Yidong  <cyd@stupidchicken.com>
5525         * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
5527 2011-03-13  Chong Yidong  <cyd@stupidchicken.com>
5529         * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
5530         (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
5531         These macros can no longer be used for assignment.
5533         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
5534         Assign struct members directly, instead of using BUF_BEGV etc.
5535         (record_buffer_markers, fetch_buffer_markers): New functions for
5536         recording and fetching special buffer markers.
5537         (set_buffer_internal_1, set_buffer_temp): Use them.
5539         * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
5541         * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
5543         * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
5544         (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
5546         * xdisp.c (hscroll_window_tree):
5547         (reconsider_clip_changes): Use PT instead of BUF_PT.
5549 2011-03-13  Eli Zaretskii  <eliz@gnu.org>
5551         * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
5552         $(EMACS_ROOT)/lib/intprops.h.
5554 2011-03-13  Paul Eggert  <eggert@cs.ucla.edu>
5556         Fix more problems found by GCC 4.5.2's static checks.
5558         * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
5559         to unsigned char * to avoid compiler diagnostic.
5560         (xg_free_frame_widgets): Make it clear that a local variable is
5561         needed only if USE_GTK_TOOLTIP.
5562         (gdk_window_get_screen): Make it clear that this macro is needed
5563         only if USE_GTK_TOOLTIP.
5564         (int_gtk_range_get_value): New function, which avoids a diagnostic
5565         from gcc -Wbad-function-cast.
5566         (xg_set_toolkit_scroll_bar_thumb): Use it.
5567         (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
5568         diagnostic from gcc -Wbad-function-cast.
5569         (get_utf8_string, xg_get_file_with_chooser):
5570         Rename locals to avoid shadowing.
5571         (create_dialog): Move locals to avoid shadowing.
5573         * xgselect.c (xg_select): Remove unused var.
5575         * image.c (four_corners_best): Mark locals as initialized.
5576         (gif_load): Initialize transparent_p to zero (Bug#8238).
5577         Mark another local as initialized.
5578         (my_png_error, my_error_exit): Mark with NO_RETURN.
5580         * image.c (clear_image_cache): Now static.
5581         (DIM, HAVE_STDLIB_H_1): Remove unused macros.
5582         (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
5583         (x_edge_detection): Remove unnecessary cast that
5584         gcc -Wbad-function-cast diagnoses.
5585         (gif_load): Fix pointer signedness.
5586         (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
5587         (jpeg_load, gif_load): Rename locals to avoid shadowing.
5589 2011-03-12  Paul Eggert  <eggert@cs.ucla.edu>
5591         Improve quality of tests for time stamp overflow.
5592         For example, without this patch (encode-time 0 0 0 1 1
5593         1152921504606846976) returns the obviously-bogus value (-948597
5594         62170) on my RHEL 5.5 x86-64 host.  With the patch, it correctly
5595         reports time overflow.  See
5596         <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
5597         * deps.mk (editfns.o): Depend on ../lib/intprops.h.
5598         * editfns.c: Include limits.h and intprops.h.
5599         (TIME_T_MIN, TIME_T_MAX): New macros.
5600         (time_overflow): Move earlier, to before first use.
5601         (hi_time, lo_time): New functions, for an accurate test for
5602         out-of-range times.
5603         (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
5604         (Fget_internal_run_time): Don't assume time_t fits in int.
5605         (make_time): Use list2 instead of Fcons twice.
5606         (Fdecode_time): More accurate test for out-of-range times.
5607         (check_tm_member): New function.
5608         (Fencode_time): Use it, to test for out-of-range times.
5609         (lisp_time_argument): Don't rely on undefined left-shift and
5610         right-shift behavior when checking for time stamp overflow.
5612         * editfns.c (time_overflow): New function, refactoring common code.
5613         (Fformat_time_string, Fdecode_time, Fencode_time):
5614         (Fcurrent_time_string): Use it.
5616         Move 'make_time' to be next to its inverse 'lisp_time_argument'.
5617         * dired.c (make_time): Move to ...
5618         * editfns.c (make_time): ... here.
5619         * systime.h: Note the move.
5621 2011-03-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
5623         * fringe.c (update_window_fringes): Remove unused variables.
5625         * unexmacosx.c (copy_data_segment): Also copy __got section.
5626         (Bug#8223)
5628 2011-03-12  Eli Zaretskii  <eliz@gnu.org>
5630         * termcap.c [MSDOS]: Include "msdos.h".
5631         (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
5632         Constify `char *' arguments and their references according to
5633         prototypes in tparam.h.
5635         * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
5637         * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
5638         Adapt all references accordingly.
5640         * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
5642 2011-03-11  Tom Tromey  <tromey@redhat.com>
5644         * buffer.c (syms_of_buffer): Remove obsolete comment.
5646 2011-03-11  Eli Zaretskii  <eliz@gnu.org>
5648         * termhooks.h (encode_terminal_code): Declare prototype.
5650         * msdos.c (encode_terminal_code): Don't declare prototype.
5652         * term.c (encode_terminal_code): Now external again, used by
5653         w32console.c and msdos.c.
5655         * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
5656         Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
5658 2011-03-11  Paul Eggert  <eggert@cs.ucla.edu>
5660         Fix some minor problems found by GCC 4.5.2's static checks.
5662         * fringe.c (update_window_fringes): Mark locals as initialized
5663         (Bug#8227).
5664         (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
5666         * alloc.c (mark_fringe_data): Move decl from here ...
5667         * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
5668         to check its interface.
5669         (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
5671         * fontset.c (free_realized_fontset): Now static.
5672         (Fset_fontset_font): Rename local to avoid shadowing.
5673         (fontset_font): Mark local as initialized.
5674         (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
5676         * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
5678         * xselect.c (x_disown_buffer_selections): Remove; not used.
5679         (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
5680         (x_own_selection, Fx_disown_selection_internal): Rename locals
5681         to avoid shadowing.
5682         (x_handle_dnd_message): Remove local to avoid shadowing.
5684         * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
5685         so that the caller can use some name other than gcpro1.
5686         (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
5687         * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
5688         (Fx_backspace_delete_keys_p):
5689         Use them to avoid shadowing, and rename vars to avoid shadowing.
5690         (x_decode_color, x_set_name, x_window): Now static.
5691         (Fx_create_frame): Add braces to silence GCC warning.
5692         (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
5693         (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
5694         Remove unused locals.
5695         (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
5696         (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
5697         Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
5698         macros.
5700         * xterm.h (x_mouse_leave): New decl.
5702         * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
5703         Remove unused functions.
5704         (x_shift_glyphs_for_insert, XTflash, XTring_bell):
5705         (x_calc_absolute_position): Now static.
5706         (XTread_socket): Don't define label "out" unless it's used.
5707         Don't declare local "event" unless it's used.
5708         (x_iconify_frame, x_free_frame_resources): Don't declare locals
5709         unless they are used.
5710         (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
5711         (x_fatal_error_signal): Remove; not used.
5712         (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
5713         (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
5714         (x_error_catcher, x_connection_closed, x_error_handler):
5715         (x_error_quitter, xembed_send_message, x_iconify_frame):
5716         (my_log_handler): Rename locals to avoid shadowing.
5717         (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
5718         (x_connection_closed): Tell GCC not to suggest NO_RETURN.
5720         * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
5721         Rename or move locals to avoid shadowing.
5722         (tty_defined_color, merge_face_heights): Now static.
5723         (free_realized_faces_for_fontset): Remove; not used.
5724         (Fx_list_fonts): Mark variable that gcc -Wuninitialized
5725         does not deduce is never used uninitialized.
5726         (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
5727         (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
5729         * terminal.c (store_terminal_param): Now static.
5731         * xmenu.c (menu_highlight_callback): Now static.
5732         (set_frame_menubar): Remove unused local.
5733         (xmenu_show): Rename parameter to avoid shadowing.
5734         (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
5735         since they might point to immutable storage.
5736         (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
5737         since it's unused otherwise.
5739         * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
5740         Add a FIXME, since the code still doesn't look right.  (Bug#8215)
5741         (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
5742         avoids a gcc -Wuninitialized diagnostic.
5743         (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
5744         (note_mouse_highlight): Mark variables that gcc -Wuninitialized
5745         does not deduce are never used uninitialized.
5747         * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
5749         * xdisp.c (redisplay_window): Rename local to avoid shadowing.
5750         * window.c (window_loop, size_window):
5751         (run_window_configuration_change_hook, enlarge_window): Likewise.
5753         * window.c (display_buffer): Now static.
5754         (size_window): Mark variables that gcc -Wuninitialized
5755         does not deduce are never used uninitialized.
5756         * window.h (check_all_windows): New decl, to forestall
5757         gcc -Wmissing-prototypes diagnostic.
5758         * dispextern.h (bidi_dump_cached_states): Likewise.
5760         * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
5761         shadowing.
5762         * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
5763         Include <limits.h>.
5764         (Fsort_charsets): Redo min/max calculation to shorten the code a bit
5765         and to avoid gcc -Wuninitialized warning.
5766         (load_charset_map): Mark variables that gcc -Wuninitialized
5767         does not deduce are never used uninitialized.
5768         (load_charset): Abort instead of using uninitialized var (Bug#8229).
5770         * coding.c (coding_set_source, coding_set_destination):
5771         Use "else { /* comment */ }" rather than "else /* comment */;"
5772         for clarity, and to avoid gcc -Wempty-body warning.
5773         (Fdefine_coding_system_internal): Don't redeclare 'i' inside
5774         a block, when the outer 'i' will do.
5775         (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
5776         (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
5777         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
5778         (decode_coding_raw_text, decode_coding_charset, get_translation_table):
5779         (Fdecode_sjis_char, Fdefine_coding_system_internal):
5780         Rename locals to avoid shadowing.
5781         * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
5782         * coding.c (emacs_mule_char, encode_invocation_designation):
5783         Now static, since they're not used elsewhere.
5784         (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
5785         (decode_coding_object, encode_coding_object, detect_coding_system):
5786         (decode_coding_emacs_mule): Mark variables that gcc
5787         -Wuninitialized does not deduce are never used uninitialized.
5788         (detect_coding_iso_2022): Initialize a local variable that might
5789         be used uninitialized.  Leave a FIXME because it's not clear that
5790         this initialization is needed.  (Bug#8211)
5791         (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
5792         (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
5793         (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
5794         (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
5795         Remove unused macros.
5797         * category.c (hash_get_category_set): Remove unused local var.
5798         (copy_category_table): Now static, since it's not used elsewhere.
5799         * character.c (string_count_byte8): Likewise.
5801         * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
5802         (Fregister_code_conversion_map): Rename locals to avoid shadowing.
5804         * chartab.c (copy_sub_char_table): Now static, since it's not used
5805         elsewhere.
5806         (sub_char_table_ref_and_range, char_table_ref_and_range):
5807         Rename locals to avoid shadowing.
5808         (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
5810         * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
5811         (BIDI_BOB): Remove unused macro.
5813         * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
5814         deduce are never used uninitialized.
5815         * term.c (encode_terminal_code): Likewise.
5817         * term.c (encode_terminal_code): Now static.  Remove unused local.
5819         * tparam.h: New file.
5820         * term.c, tparam.h: Include it.
5821         * deps.mk (term.o, tparam.o): Depend on tparam.h.
5822         * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
5823         Move these decls to tparam.h, and make them agree with what
5824         is actually in tparam.c.  The previous trick of using incompatible
5825         decls in different modules does not conform to the C standard.
5826         All callers of tparam changed to use tparam's actual API.
5827         * tparam.c (tparam1, tparam, tgoto):
5828         Use const pointers where appropriate.
5830         * cm.c (calccost, cmgoto): Use const pointers where appropriate.
5831         * cm.h (struct cm): Likewise.
5832         * dispextern.h (do_line_insertion_deletion_costs): Likewise.
5833         * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
5834         * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
5835         (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
5836         (turn_on_face, init_tty): Likewise.
5837         * termchar.h (struct tty_display_info): Likewise.
5839         * term.c (term_mouse_position): Rename local to avoid shadowing.
5841         * alloc.c (mark_ttys): Move decl from here ...
5842         * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
5844 2011-03-11  Andreas Schwab  <schwab@linux-m68k.org>
5846         * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
5848 2011-03-09  Juanma Barranquero  <lekktu@gmail.com>
5850         * search.c (compile_pattern_1): Remove argument regp, unused since
5851         revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
5852         (compile_pattern): Don't pass it.
5854 2011-03-08  Jan Djärv  <jan.h.d@swipnet.se>
5856         * xterm.h (DEFAULT_GDK_DISPLAY): New define.
5857         (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
5858         for ! HAVE_GTK3.
5859         (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
5861         * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
5863         * gtkutil.c: Include gtkx.h if HAVE_GTK3.  If ! HAVE_GTK3, define
5864         gdk_window_get_screen, gdk_window_get_geometry,
5865         gdk_x11_window_lookup_for_display and GDK_KEY_g.
5866         (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
5867         (xg_get_pixbuf_from_pixmap): New function.
5868         (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
5869         to Pixmap, take frame as parameter, remove GdkColormap parameter.
5870         Call xg_get_pixbuf_from_pixmap instead of
5871         gdk_pixbuf_get_from_drawable.
5872         (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
5873         xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
5874         (xg_check_special_colors): Use GtkStyleContext and its functions
5875         for HAVE_GTK3.
5876         (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
5877         (xg_prepare_tooltip, create_dialog, menubar_map_cb)
5878         (xg_update_frame_menubar, xg_tool_bar_detach_callback)
5879         (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
5880         Call gtk_widget_get_preferred_size.
5881         (xg_frame_resized): gdk_window_get_geometry only takes 5
5882         parameters.
5883         (xg_win_to_widget, xg_event_is_for_menubar):
5884         Call gdk_x11_window_lookup_for_display.
5885         (xg_set_widget_bg): New function.
5886         (delete_cb): New function.
5887         (xg_create_frame_widgets): Connect delete-event to delete_cb.
5888         Call xg_set_widget_bg.  Only set backgrund pixmap for ! HAVE_GTK3
5889         (xg_set_background_color): Call xg_set_widget_bg.
5890         (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
5891         (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
5892         Only call gtk_range_set_update_policy if ! HAVE_GTK3.
5893         (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
5894         if ! HAVE_GTK3.
5895         (update_frame_tool_bar): Call gtk_widget_hide.
5896         (xg_initialize): Use GDK_KEY_g.
5898         * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
5899         if ! HAVE_GTK3
5900         (x_session_initialize): Call gdk_x11_set_sm_client_id.
5902         * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
5903         (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
5904         Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
5906 2011-03-08  Juanma Barranquero  <lekktu@gmail.com>
5908         * w32xfns.c (select_palette): Check success of RealizePalette against
5909         GDI_ERROR, not zero.
5911 See ChangeLog.11 for earlier changes.
5913 ;; Local Variables:
5914 ;; coding: utf-8
5915 ;; End:
5917   Copyright (C) 2011  Free Software Foundation, Inc.
5919   This file is part of GNU Emacs.
5921   GNU Emacs is free software: you can redistribute it and/or modify
5922   it under the terms of the GNU General Public License as published by
5923   the Free Software Foundation, either version 3 of the License, or
5924   (at your option) any later version.
5926   GNU Emacs is distributed in the hope that it will be useful,
5927   but WITHOUT ANY WARRANTY; without even the implied warranty of
5928   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5929   GNU General Public License for more details.
5931   You should have received a copy of the GNU General Public License
5932   along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.