Fix another bug with cursor motion around display properties.
[emacs.git] / src / ChangeLog
blob74a684df45eed514fbf040bf11afc488f6e80aa9
1 2011-07-07  Eli Zaretskii  <eliz@gnu.org>
3         * xdisp.c (find_row_edges): If ROW->start.pos gives position
4         smaller than min_pos, use it as ROW->minpos.  (Bug#7616)
6 2011-07-05  Eli Zaretskii  <eliz@gnu.org>
8         * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
9         cache around display iteration.
11         * window.c (Fwindow_end, window_scroll_pixel_based)
12         (displayed_window_lines, Frecenter): Save and restore the bidi
13         cache around display iteration.
15         * bidi.c (bidi_unshelve_cache): Ensure we have enough space before
16         restoring the shelved cache.
17         (bidi_cache_ensure_space): Don't assume the required size is just
18         one BIDI_CACHE_CHUNK away.
20         * xdisp.c (back_to_previous_visible_line_start, reseat_1)
21         (init_iterator): Empty the bidi cache "stack".
23 2011-07-03  Eli Zaretskii  <eliz@gnu.org>
25         * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): New functions.
27         * dispextern.h (bidi_shelve_cache, bidi_unshelve_cache): Declare
28         prototypes.
30         * xdisp.c (SAVE_IT, RESTORE_IT): New macros.
31         (pos_visible_p, face_before_or_after_it_pos)
32         (back_to_previous_visible_line_start)
33         (move_it_in_display_line_to, move_it_in_display_line)
34         (move_it_to, move_it_vertically_backward, move_it_by_lines)
35         (try_scrolling, redisplay_window, display_line): Use them when
36         saving a temporary copy of the iterator and restoring it back.
38 2011-07-02  Eli Zaretskii  <eliz@gnu.org>
40         * xdisp.c (reseat_1): Call bidi_init_it to resync the bidi
41         iterator with IT's position.  (Bug#7616)
42         (handle_stop, back_to_previous_visible_line_start, reseat_1):
43         Reset the from_disp_prop_p flag.
45         * bidi.c (bidi_cache_search): Don't assume bidi_cache_last_idx is
46         always valid if bidi_cache_idx is valid.
47         (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
48         is valid if it's going to be used.
50         * dispextern.h (struct iterator_stack_entry, struct it): New
51         member from_disp_prop_p.
53         * xdisp.c (push_it, pop_it): Save and restore from_disp_prop_p.
54         (handle_single_display_spec, push_display_prop): Set the
55         from_disp_prop_p flag.
56         (get_overlay_strings_1): Reset the from_disp_prop_p flag.
57         (pop_it): Call iterate_out_of_display_property only if we are
58         popping after iteration over a string that came from a display
59         property.  Fix a typo in popping stretch info.  Add an assertion
60         for verifying that the iterator position is in sync with the bidi
61         iterator.
62         (handle_single_display_spec, get_overlay_strings_1)
63         (push_display_prop): Fix initialization of paragraph direction for
64         string when that of the parent object is not yet determined.
66 2011-07-01  Eli Zaretskii  <eliz@gnu.org>
68         * dispextern.h (struct bidi_string_data): New member `unibyte'.
70         * xdisp.c (handle_single_display_spec, next_overlay_string)
71         (get_overlay_strings_1, reseat_1, reseat_to_string)
72         (push_display_prop): Set up the `unibyte' member of bidi_it.string
73         correctly.  Don't assume unibyte strings are not bidi-reordered.
74         (compute_display_string_pos)
75         (compute_display_string_end): Fix handling the case of C string.
77         * bidi.c (bidi_count_bytes, bidi_char_at_pos): Accept an
78         additional argument UNIBYTE, and support unibyte strings.  All
79         callers changed.
80         (bidi_fetch_char): Support unibyte strings.
82 2011-06-25  Eli Zaretskii  <eliz@gnu.org>
84         * xdisp.c (set_iterator_to_next, get_visually_first_element): Use
85         it->bidi_it.string.schars rather than it->string_nchars when
86         testing whether we're beyond string end, because string_nchars is
87         zero for strings that come from overlays and display properties.
89         * bidi.c (bidi_cache_iterator_state): Fix a bug with testing
90         character positions against the cached range, when we use a
91         stacked cache.
93         * xdisp.c (push_it, pop_it): Save and restore it.
95         * dispextern.h (struct iterator_stack_entry): New member
96         paragraph_embedding.
98         * xdisp.c (handle_single_display_spec, next_overlay_string)
99         (get_overlay_strings_1, push_display_prop): Set up the bidi
100         iterator for displaying display or overlay strings.
101         (forward_to_next_line_start): Don't use the shortcut if
102         bidi-iterating.
103         (back_to_previous_visible_line_start): If handle_display_prop
104         pushed the iterator stack, restore the internal state of the bidi
105         iterator by calling bidi_pop_it same number of times.
106         (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
107         and we are bidi-iterating, don't decrement the iterator position;
108         instead, set the first_elt flag in the bidi iterator, to produce
109         the same effect.
110         (reseat_1): Remove redundant setting of string_from_display_prop_p.
111         (push_display_prop): xassert that we are iterating a buffer.
113         * bidi.c (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
115 2011-06-24  Eli Zaretskii  <eliz@gnu.org>
117         * xdisp.c (push_it, pop_it): Save and restore the state of the
118         bidi iterator.  Save and restore the bidi_p flag.
119         (pop_it): Iterate out of display property for string iteration as
120         well.
121         (iterate_out_of_display_property): Support iteration over strings.
122         (handle_single_display_spec): Set up it->bidi_it for iteration
123         over a display string, and call bidi_init_it.
125         * dispextern.h (struct iterator_stack_entry): New member bidi_p.
126         (struct it): Member bidi_p is now a bit field 1 bit wide.
128 2011-06-23  Eli Zaretskii  <eliz@gnu.org>
130         * dispextern.h (bidi_push_it, bidi_pop_it): Add prototypes.
132         * bidi.c (bidi_push_it, bidi_pop_it): New functions.
133         (bidi_initialize): Initialize the bidi cache start stack pointer.
134         (bidi_cache_ensure_space): New function, refactored from part of
135         bidi_cache_iterator_state.
137 2011-06-18  Eli Zaretskii  <eliz@gnu.org>
139         * xdisp.c (tool_bar_lines_needed, redisplay_tool_bar)
140         (display_menu_bar): Force left-to-right direction.  Add a FIXME
141         comment for making that be controlled by a user option.
143         * bidi.c (bidi_move_to_visually_next): GCPRO the Lisp string we
144         are iterating.
146         * term.c (produce_glyphs): Add IT_GLYPHLESS to the values of
147         it->what accepted by the xassert.  Fixes a gratuitous crash in an
148         Emacs built with -DXASSERTS.
150         * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
151         (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
152         and vector-like objects.
154         * xdisp.c (face_before_or_after_it_pos): Support bidi iteration.
155         (next_element_from_c_string): Handle the case of the first string
156         character that is not the first one in the visual order.
157         (get_visually_first_element): New function, refactored from common
158         parts of next_element_from_buffer, next_element_from_string, and
159         next_element_from_c_string.
161 2011-06-16  Eli Zaretskii  <eliz@gnu.org>
163         * xdisp.c (init_iterator): Don't initialize it->bidi_p for strings
164         here.
165         (reseat_to_string): Initialize it->bidi_p for strings here.
166         (next_element_from_string, next_element_from_c_string)
167         (next_element_from_buffer): Add xassert's for correspondence
168         between IT's object being iterated and it->bidi_it.string
169         structure.
171         * bidi.c (bidi_level_of_next_char): Fix the logic for looking up
172         the sentinel state in the cache.
174 2011-06-13  Eli Zaretskii  <eliz@gnu.org>
176         * xdisp.c (compute_display_string_pos)
177         (compute_display_string_end, reseat_to_string): Don't assume
178         it->bidi_it.string.s always points to string.lstring's data.
180         * bidi.c (bidi_fetch_char, bidi_paragraph_init)
181         (bidi_resolve_explicit_1, bidi_resolve_explicit)
182         (bidi_resolve_weak, bidi_level_of_next_char): Don't assume
183         string.s always points to string.lstring's data.
185 2011-06-11  Eli Zaretskii  <eliz@gnu.org>
187         * xdisp.c (set_iterator_to_next): Advance string position
188         correctly when padding it with blanks.
190 2011-06-11  Eli Zaretskii  <eliz@gnu.org>
192         * xdisp.c (next_element_from_buffer): Improve commentary for when
193         the iterator is before prev_stop.
194         (init_iterator): Initialize bidi_p from the default value of
195         bidi-display-reordering, not from buffer-local value.  Use the
196         buffer-local value only if initializing for buffer iteration.
197         (handle_invisible_prop): Support invisible properties on strings
198         that are being bidi-reordered.
199         (reseat_to_string): Enable bidi-related code.
200         (set_iterator_to_next): Support bidi reordering of C strings and
201         Lisp strings.
202         (next_element_from_string): Support bidi reordering of Lisp
203         strings.
204         (handle_stop_backwards): Support Lisp strings as well.
205         (display_mode_line, display_mode_element): Temporarily force L2R
206         paragraph direction.
207         (display_string): Support display of R2L glyph rows.  Use
208         IT_STRING_CHARPOS when displaying from a Lisp string.
210 2011-06-10  Eli Zaretskii  <eliz@gnu.org>
212         * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
213         itb.string.lstring.
214         (compute_display_string_pos, compute_display_string_end):
215         Fix calculation of the object to scan.  Fixes an error when using
216         arrow keys.
217         (next_element_from_buffer): Don't abort when IT_CHARPOS is before
218         base_level_stop; instead, set base_level_stop to BEGV.  Fixes
219         crashes in vertical-motion.
221 2011-06-09  Eli Zaretskii  <eliz@gnu.org>
223         * xdisp.c (compute_display_string_pos): First arg is now struct
224         `text_pos *'; all callers changed.  Support display properties on
225         Lisp strings.
226         (compute_display_string_end): Support display properties on Lisp
227         strings.
228         (init_iterator, reseat_1, reseat_to_string): Initialize the
229         string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
230         when iterating on a string not from display properties).
232         * bidi.c (bidi_fetch_char): Support strings with display
233         properties.
235         * dispextern.h (struct bidi_string_data): New member bufpos.
236         (compute_display_string_pos): Update prototype.
238 2011-06-09  Eli Zaretskii  <eliz@gnu.org>
240         * bidi.c (bidi_level_of_next_char): Allow the sentinel "position"
241         to pass the test for valid cached positions.
243         * xdisp.c (init_iterator): Call bidi_init_it only of a valid
244         buffer position was specified.  Initialize paragraph_embedding to
245         L2R.
246         (reseat_to_string): Initialize the bidi iterator (for now ifdef'ed
247         out).
248         (display_string): If we need to ignore text properties of
249         LISP_STRING, set IT->stop_charpos to IT->end_charpos.  (The
250         original value of -1 will not work with bidi.)
252         * dispextern.h (struct bidi_string_data): New member lstring.
254 2011-06-09  Eli Zaretskii  <eliz@gnu.org>
256         * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
257         itb.string.s to NULL (avoids a crash in bidi_paragraph_init).
259 2011-06-08  Eli Zaretskii  <eliz@gnu.org>
261         * bidi.c (bidi_paragraph_info): Delete unused struct.
262         (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
263         (bidi_cache_start): New variable.
264         (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
265         to zero.
266         (bidi_cache_fetch_state, bidi_cache_search)
267         (bidi_cache_find_level_change, bidi_cache_iterator_state)
268         (bidi_cache_find, bidi_peek_at_next_level)
269         (bidi_level_of_next_char, bidi_find_other_level_edge)
270         (bidi_move_to_visually_next): Compare cache index with
271         bidi_cache_start rather than with zero.
272         (bidi_fetch_char): Accept new argument STRING; all callers
273         changed.  Support iteration over a string.
274         (bidi_paragraph_init, bidi_resolve_explicit_1)
275         (bidi_resolve_explicit, bidi_resolve_weak)
276         (bidi_level_of_next_char, bidi_move_to_visually_next): Support
277         iteration over a string.
278         (bidi_set_sor_type, bidi_resolve_explicit_1)
279         (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
280         can now be zero (for strings); special values 0 and -1 were
281         changed to -1 and -2, respectively.
282         (bidi_char_at_pos): New function.
283         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
284         Call it instead of FETCH_MULTIBYTE_CHAR.
285         (bidi_move_to_visually_next): Abort if charpos or bytepos were not
286         initialized to valid values.
287         (bidi_init_it): Don't initialize charpos and bytepos with invalid
288         values.
290         * xdisp.c (compute_display_string_pos)
291         (compute_display_string_end): Accept additional argument STRING.
292         (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
293         (reseat_to_string): Initialize bidi_it->string.s and
294         bidi_it->string.schars.
296         * dispextern.h (struct bidi_string_data): New structure.
297         (struct bidi_it): New member `string'.  Make flag members be 1-bit
298         fields, and put them last in the struct.
299         (compute_display_string_pos, compute_display_string_end): Update
300         prototypes.
302 2011-06-04  Eli Zaretskii  <eliz@gnu.org>
304         * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
306 2011-06-03  Eli Zaretskii  <eliz@gnu.org>
308         * bidi.c (bidi_fetch_char_advance): Remove unused and
309         unimplemented function.
311 2011-05-28  Eli Zaretskii  <eliz@gnu.org>
313         * xdisp.c (set_cursor_from_row): Set start and stop points
314         according to the row's direction when priming the loop that looks
315         for the glyph on which to display cursor.
316         (single_display_spec_intangible_p): Function deleted.
317         (display_prop_intangible_p): Reimplement to call
318         handle_display_spec instead of single_display_spec_intangible_p.
319         Accept 3 additional arguments needed by handle_display_spec.  This
320         fixes incorrect cursor motion across display property with complex
321         values: lists, `(when COND...)' forms, etc.
322         (single_display_spec_string_p): Support property values that are
323         lists with the argument STRING its top-level element.
324         (display_prop_string_p): Fix the condition for processing a
325         property that is a list to be consistent with handle_display_spec.
327         * keyboard.c (adjust_point_for_property): Adjust the call to
328         display_prop_intangible_p to its new signature.
330         * dispextern.h (display_prop_intangible_p): Adjust prototype.
332 2011-05-21  Eli Zaretskii  <eliz@gnu.org>
334         * xdisp.c (handle_display_spec): New function, refactored from the
335         last portion of handle_display_prop.
336         (compute_display_string_pos): Accept additional argument
337         FRAME_WINDOW_P.  Call handle_display_spec to determine whether the
338         value of a `display' property is a "replacing spec".
339         (handle_single_display_spec): Accept 2 additional arguments BUFPOS
340         and FRAME_WINDOW_P.  If IT is NULL, don't set up the iterator from
341         the display property, but just return a value indicating whether
342         the display property will replace the characters it covers.
343         (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
344         frame_window_p members of struct bidi_it.
346         * bidi.c (bidi_fetch_char): Accept additional argument
347         FRAME_WINDOW_P and pass it to compute_display_string_pos.  All
348         callers changed.
349         (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
350         it to initialize the frame_window_p member of struct bidi_it.
352         * dispextern.h (struct bidi_it): New member frame_window_p.
353         (bidi_init_it, compute_display_string_pos): Update prototypes.
355 2011-05-14  Eli Zaretskii  <eliz@gnu.org>
357         * xdisp.c (compute_display_string_pos): Non-trivial implementation.
358         (compute_display_string_end): New function.
359         (push_it): Accept second argument POSITION, where pop_it should
360         jump to continue iteration.
362         * dispextern.h (compute_display_string_end): Declare prototype.
364         * bidi.c (bidi_resolve_explicit_1): Use ZV for disp_pos.
365         (bidi_fetch_char): Implement support for runs of characters
366         covered by display strings.
368         * bidi.c (bidi_fetch_char): Accept also character position
369         corresponding to BYTEPOS.  DISP_POS is now a character position,
370         not a byte position.  All callers changed.
371         (bidi_cache_iterator_state, bidi_resolve_explicit_1)
372         (bidi_resolve_explicit, bidi_resolve_weak)
373         (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
374         bidi_it->nchars is non-positive.
375         (bidi_level_of_next_char): Don't try to lookup the cache for the
376         next/previous character if nothing is cached there yet, or if we
377         were just reseat()'ed to a new position.
378         (bidi_paragraph_init, bidi_resolve_explicit_1)
379         (bidi_level_of_next_char): Fix arguments in the calls to
380         bidi_fetch_char.
382 2011-05-10  Eli Zaretskii  <eliz@gnu.org>
384         * xdisp.c (compute_display_string_pos): New function.
385         (reseat_1): Initialize bidi_it.disp_pos.
387         * bidi.c (bidi_copy_it): Use offsetof.
388         (bidi_fetch_char, bidi_fetch_char_advance): New functions.
389         (bidi_cache_search, bidi_cache_iterator_state)
390         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
391         (bidi_level_of_next_char, bidi_move_to_visually_next): Support
392         character positions inside a run of characters covered by a
393         display string.
394         (bidi_paragraph_init, bidi_resolve_explicit_1)
395         (bidi_level_of_next_char): Call bidi_fetch_char and
396         bidi_fetch_char_advance instead of FETCH_CHAR and
397         FETCH_CHAR_ADVANCE.
398         (bidi_init_it): Initialize new members.
399         (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
400         definitions.
401         (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
402         instead of using explicit *_CHAR codes.
403         (bidi_resolve_explicit, bidi_resolve_weak): Use
404         FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
405         bidirectional text is supported only in multibyte buffers.
407         * dispextern.h (struct bidi_it): New members nchars and disp_pos.
408         ch_len is now EMACS_INT.
409         (compute_display_string_pos): Declare prototype.
411 2011-05-09  Andreas Schwab  <schwab@linux-m68k.org>
413         * w32menu.c (set_frame_menubar): Fix submenu allocation.
415 2011-05-07  Eli Zaretskii  <eliz@gnu.org>
417         * w32console.c (Fset_screen_color): Doc fix.
418         (Fget_screen_color): New function.
419         (syms_of_ntterm): Defsubr it.
421         * callproc.c (call_process_cleanup): Don't close and unlink the
422         temporary file if Fcall_process didn't create it in the first
423         place.
424         (Fcall_process): Don't create tempfile if stdout of the child
425         process will be redirected to a file specified with `:file'.
426         Don't try to re-open tempfile in that case, and set fd[0] to -1 as
427         cue to call_process_cleanup not to close that handle.
429 2011-05-07  Ben Key  <bkey76@gmail.com>
431         * makefile.w32-in: The bootstrap-temacs rule now makes use of
432         one of two shell specific rules, either bootstrap-temacs-CMD or
433         bootstrap-temacs-SH.  The bootstrap-temacs-SH rule is identical
434         to the previous implementation of the bootstrap-temacs rule.
435         The bootstrap-temacs-CMD rule is similar to the previous
436         implementation of the bootstrap-temacs rule except that it
437         makes use of the ESC_CFLAGS variable instead of the CFLAGS
438         variable.
440         These changes, along with some changes to nt/configure.bat,
441         nt/gmake.defs, and nt/nmake.defs, are required to extend my
442         earlier fix to add support for --cflags and --ldflags options
443         that include quotes so that it works whether make uses cmd or
444         sh as the shell.
446 2011-05-06  Michael Albinus  <michael.albinus@gmx.de>
448         * dbusbind.c (QCdbus_type_unix_fd): Declare static.
449         (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
450         is a constant.
451         (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
452         a string.  Handle both cases.
453         (Fdbus_call_method_asynchronously, Fdbus_register_signal)
454         (Fdbus_register_method): Use Qinvalid_function.
456 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
458         * makefile.w32-in: Update dependencies.
459         (LISP_H): Add inttypes.h and stdin.h.
460         (PROCESS_H): Add unistd.h.
462 2011-05-06  Eli Zaretskii  <eliz@gnu.org>
464         * lread.c: Include limits.h (fixes the MS-Windows build broken by
465         2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
467 2011-05-06  Paul Eggert  <eggert@cs.ucla.edu>
469         * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
471         * term.c (vfatal): Remove stray call to va_end.
472         It's not needed and the C Standard doesn't allow it here anyway.
474         Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
475         * eval.c (verror): doprnt a copy of ap, not the original.  (Bug#8545)
477         * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
478         bytes.
480         * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
482         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
484         * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
486         * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
488         * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
490         * charset.h (struct charset.code_space): Now has 15 elements, not 16.
491         * charset.c (Fdefine_charset_internal): Don't initialize
492         charset.code_space[15].  The value was garbage, on hosts with
493         32-bit int (Bug#8600).
495         * lread.c (read_integer): Be more consistent with string-to-number.
496         Use string_to_number to do the actual conversion; this avoids
497         rounding errors and fixes some other screwups.  Without this fix,
498         for example, #x1fffffffffffffff was misread as -2305843009213693952.
499         (digit_to_number): Move earlier, for benefit of read_integer.
500         Return -1 if the digit is out of range for the base, -2 if it is
501         not a digit in any supported base.  (Bug#8602)
503         * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
505         * dispnew.c (scrolling_window): Return 1 if we scrolled,
506         to match comment at start of function.  This also removes a
507         GCC warning about overflow in a 32+64-bit port.
509         * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
511         * dbusbind.c: Do not use XPNTR on a value that may be an integer.
512         Reported by Stefan Monnier in
513         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
514         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages): Use
515         SYMBOLP-guarded XSYMBOL, not XPNTR.
517         * lisp.h (EMACS_INTPTR): Remove.  All uses changed to intptr_t.
518         (EMACS_UINTPTR): Likewise, with uintptr_t.
520         * lisp.h: Prefer 64-bit EMACS_INT if available.
521         (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
522         on 32-bit hosts that have 64-bit int, so that they can access
523         large files.
524         However, temporarily disable this change unless the temporary
525         symbol WIDE_EMACS_INT is defined.
527         * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
529         Prefer intptr_t/uintptr_t for integers the same widths as pointers.
530         This removes an assumption that EMACS_INT and long are the same
531         width as pointers.  The assumption is true for Emacs porting targets
532         now, but we want to make other targets possible.
533         * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
534         (EMACS_INTPTR, EMACS_UINTPTR): New macros.
535         In the rest of the code, change types of integers that hold casted
536         pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
537         replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
538         (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
539         (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
540         No need to cast type when ORing.
541         (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
542         * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
543         * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
544         assume EMACS_INT is the same width as char *.
545         * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
546         (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
547         Remove no-longer-needed casts.
548         (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
549         (xg_tool_bar_help_callback, xg_make_tool_item):
550         Use EMACS_INTPTR to hold an integer
551         that will be cast to void *; this can avoid a GCC warning
552         if EMACS_INT is not the same width as void *.
553         * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
554         * xdisp.c (display_echo_area_1, resize_mini_window_1):
555         (current_message_1, set_message_1):
556         Use a local to convert to proper width without a cast.
557         * xmenu.c (dialog_selection_callback): Likewise.
559         * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
560         Also, don't assume VALBITS / RAND_BITS is less than 5,
561         and don't rely on undefined behavior when shifting a 1 left into
562         the sign bit.
563         * lisp.h (get_random): Change signature to match.
565         * lread.c (hash_string): Use size_t, not int, for hash computation.
566         Normally we prefer signed values; but hashing is special, because
567         it's better to use unsigned division on hash table sizes so that
568         the remainder is nonnegative.  Also, size_t is the natural width
569         for hashing into memory.  The previous code used 'int', which doesn't
570         retain enough info to hash well into very large tables.
571         (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
573         * dbusbind.c: Don't possibly lose pointer info when converting.
574         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
575         Use XPNTR rather than XHASH, so that the high-order bits of
576         the pointer aren't lost when converting through void *.
578         * eval.c (Fautoload): Don't double-shift a pointer.
580         * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
582 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
584         * gnutls.c (DEF_GNUTLS_FN):
585         * image.c (DEF_IMGLIB_FN): Make function pointers static.
587 2011-05-05  Andreas Schwab  <schwab@linux-m68k.org>
589         * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
590         marker.  (Bug#8610)
592 2011-05-05 Eli Zaretskii  <eliz@gnu.org>
594         * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
595         New version that can reserve upto 2GB of heap space.
597 2011-05-05  Chong Yidong  <cyd@stupidchicken.com>
599         * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
601 2011-05-05  Teodor Zlatanov  <tzz@lifelogs.com>
603         * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
604         `gnutls_certificate_set_x509_key_file'.
606 2011-05-05  Juanma Barranquero  <lekktu@gmail.com>
608         * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
609         Update dependencies.
611 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
613         * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
614         * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
615         Remove unused parameter `fildes'.
616         * process.c (read_process_output, send_process): Don't pass it.
618 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
620         Fix previous change: the library cache is defined in w32.c.
621         * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
622         (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
624 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
626         Implement dynamic loading of GnuTLS on Windows.
628         * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
629         (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
630         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
631         Declare.
633         * gnutls.c (Qgnutls_dll): Define.
634         (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
635         (gnutls_*): Declare function pointers.
636         (init_gnutls_functions): New function to initialize function pointers.
637         (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
638         (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
639         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
640         Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
641         (emacs_gnutls_write, emacs_gnutls_read)
642         (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
643         (Fgnutls_available_p): New function.
644         (Fgnutls_boot): Call Fgnutls_available_p.  Use function pointers.
645         (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
646         (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
648         * image.c: Include w32.h.
649         (Vimage_type_cache): Delete.
650         (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
651         (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
652         (w32_delayed_load): Move to w32.c.
654         * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
656         * w32.c (QCloaded_from, Vlibrary_cache): Define.
657         (w32_delayed_load): Move from image.c.  When loading a library, record
658         its filename in the :loaded-from property of the library id.
659         (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
660         Initialize and staticpro them.
661         (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
663         * process.c: Include lisp.h before w32.h, not after.
664         (wait_reading_process_output): Call emacs_gnutls_record_check_pending
665         instead of gnutls_record_check_pending.
667         * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
669 2011-05-04  Teodor Zlatanov  <tzz@lifelogs.com>
671         * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
672         instead of :keyfiles.  Give GnuTLS the keylist and the CRL lists
673         as passed in.
675 2011-05-03  Jan Djärv  <jan.h.d@swipnet.se>
677         * xterm.c (x_set_frame_alpha): Do not set property on anything
678         else than FRAME_X_OUTER_WINDOW (Bug#8608).
680 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
682         * sysdep.c (get_tty_size) [WINDOWSNT]: Implement.  (Bug#8596)
684 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
686         * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
687         (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
688         (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
689         (gnutls_global_initialized, Qgnutls_bootprop_priority)
690         (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
691         (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
692         (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
693         (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
694         (Qgnutls_bootprop_callbacks_verify): Make static.
696 2011-05-01  Andreas Schwab  <schwab@linux-m68k.org>
698         * callproc.c: Indentation fixup.
700         * sysdep.c (wait_for_termination_1): Make static.
701         (wait_for_termination, interruptible_wait_for_termination): Move
702         after wait_for_termination_1.
704 2011-05-01  Lars Magne Ingebrigtsen  <larsi@gnus.org>
706         * sysdep.c (interruptible_wait_for_termination): New function
707         which is like wait_for_termination, but allows keyboard
708         interruptions.
710         * callproc.c (Fcall_process): Add (:file "file") as an option for
711         the STDOUT buffer.
712         (Fcall_process_region): Ditto.
714 2011-04-30  Eli Zaretskii  <eliz@gnu.org>
716         * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
717         rather than `XVECTOR (FOO)->size'.
719         * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
720         inttypes.h, as a gnulib replacement is used if it not available in
721         system headers.
723 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
725         Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
726         * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
727         of MOST_POSITIVE_FIXNUM.  (Bug#8528)
729         * coding.c (coding_alloc_by_realloc): Error out if destination
730         will grow beyond MOST_POSITIVE_FIXNUM.
731         (decode_coding_emacs_mule): Abort if there isn't enough place in
732         charbuf for the composition carryover bytes.  Reserve an extra
733         space for up to 2 characters produced in a loop.
734         (decode_coding_iso_2022): Abort if there isn't enough place in
735         charbuf for the composition carryover bytes.
737 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
739         * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
740         aborting when %lld or %lll format is passed.
741         [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
742         %llo or %llx format is passed.  (Bug#8545)
744         * window.c (window_scroll_line_based): Use a marker instead of
745         simple variables to record original value of point.  (Bug#7952)
747         * doprnt.c (doprnt): Fix the case where a multibyte sequence
748         produced by %s or %c overflows available buffer space.  (Bug#8545)
750 2011-04-28  Paul Eggert  <eggert@cs.ucla.edu>
752         * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
753         (SIZE_MAX): Move defn after all includes, as they might #define it.
755 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
757         * w32.c (init_environment): Warn about defaulting HOME to C:\.
759 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
761         * keyboard.c (Qdelayed_warnings_hook): Define.
762         (command_loop_1): Run `delayed-warnings-hook'
763         if Vdelayed_warnings_list is non-nil.
764         (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
765         (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
767 2011-04-28  Eli Zaretskii  <eliz@gnu.org>
769         * doprnt.c (doprnt): Don't return value smaller than the buffer
770         size if the message was truncated.  (Bug#8545).
772 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
774         * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
775         (Fx_window_property): #if-0 the whole functions, not just the bodies.
777 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
779         * doprnt.c (doprnt): Support "ll" length modifier, for long long.
781 2011-04-27  Juanma Barranquero  <lekktu@gmail.com>
783         * makefile.w32-in: Update dependencies.
785 2011-04-27  Eli Zaretskii  <eliz@gnu.org>
787         Improve `doprnt' and its usage.  (Bug#8545)
788         * doprnt.c (doprnt): Make sure `format' is never accessed beyond
789         `format_end'.  Remove support for %l as a conversion specifier.
790         Don't use xrealloc.  Improve diagnostics when the %l size modifier
791         is used.  Update the commentary.
793         * eval.c (verror): Simplify calculation of size_t.
795         * coding.c (Ffind_operation_coding_system): Fix diagnostic error
796         messages.
798 2011-04-27  Yoshiaki Kasahara  <kasahara@nc.kyushu-u.ac.jp>  (tiny change)
800         * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
801         change.
803 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
805         * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
806         This makes this file independent of the recent pseudovector change.
808 2011-04-26  Paul Eggert  <eggert@cs.ucla.edu>
810         * keyboard.c (handle_user_signal): Fix pointer signedness problem.
812         * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
813         (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
814         Remove unused local.
815         (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
817         * lisp.h: Fix a problem with aliasing and vector headers.  (Bug#8546)
818         GCC 4.6.0 optimizes based on type-based alias analysis.  For
819         example, if b is of type struct buffer * and v of type struct
820         Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
821         != &v->size, and therefore "v->size = 1; b->size = 2; return
822         v->size;" must therefore return 1.  This assumption is incorrect
823         for Emacs, since it type-puns struct Lisp_Vector * with many other
824         types.  To fix this problem, this patch adds a new type struct
825         vectorlike_header that documents the constraints on layout of vectors
826         and pseudovectors, and helps optimizing compilers not get fooled
827         by Emacs's type punning.  It also adds the macros XSETTYPED_PVECTYPE
828         XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
829         * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
830         the size member.
831         (XSETPVECTYPE): Rewrite in terms of new macro.
832         (XSETPVECTYPESIZE): New macro, specifying both type and size.
833         This is a bit clearer, and further avoids the possibility of
834         undesirable aliasing.
835         (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
836         (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
837         (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
838         since Lisp_Subr is a special case (no "next" field).
839         (ASIZE): Now uses header.size rather than size.  All
840         previous uses of XVECTOR (foo)->size replaced to use this macro,
841         to avoid the hassle of writing XVECTOR (foo)->header.size.
842         (struct vectorlike_header): New type.
843         (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
844         object, to help avoid aliasing.
845         (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
846         (SUBRP): Likewise, since Lisp_Subr is a special case.
847         * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
848         (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
849         (struct Lisp_Hash_Table): Combine first two members into a single
850         struct vectorlike_header member.  All uses of "size" and "next" members
851         changed to be "header.size" and "header.next".
852         * buffer.h (struct buffer): Likewise.
853         * font.h (struct font_spec, struct font_entity, struct font): Likewise.
854         * frame.h (struct frame): Likewise.
855         * process.h (struct Lisp_Process): Likewise.
856         * termhooks.h (struct terminal): Likewise.
857         * window.c (struct save_window_data, struct saved_window): Likewise.
858         * window.h (struct window): Likewise.
859         * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
860         Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
861         * buffer.c (init_buffer_once): Likewise.
862         * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
863         special case.
864         * process.c (Fformat_network_address): Use local var for size,
865         for brevity.
867         * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
869         Make the Lisp reader and string-to-float more consistent (Bug#8525)
870         * data.c (atof): Remove decl; no longer used or needed.
871         (digit_to_number): Move to lread.c.
872         (Fstring_to_number): Use new string_to_number function, to be
873         consistent with how the Lisp reader treats infinities and NaNs.
874         Do not assume that floating-point numbers represent EMACS_INT
875         without losing information; this is not true on most 64-bit hosts.
876         Avoid double-rounding errors, by insisting on integers when
877         parsing non-base-10 numbers, as the documentation specifies.
878         * lisp.h (string_to_number): New decl, replacing ...
879         (isfloat_string): Remove.
880         * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
881         (read1): Do not accept +. and -. as integers; this
882         appears to have been a coding error.  Similarly, do not accept
883         strings like +-1e0 as floating point numbers.  Do not report
884         overflow for integer overflows unless the base is not 10 which
885         means we have no simple and reliable way to continue.
886         Break out the floating-point parsing into a new
887         function string_to_number, so that Fstring_to_number parses
888         floating point numbers consistently with the Lisp reader.
889         (digit_to_number): Moved here from data.c.  Make it static inline.
890         (E_CHAR, EXP_INT): Remove, replacing with ...
891         (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
892         (string_to_number): New function, replacing isfloat_string.
893         This function checks for valid syntax and produces the resulting
894         Lisp float number too.  Rework it so that string-to-number
895         no longer mishandles examples like "1.0e+".  Use strtoumax,
896         so that overflow for non-base-10 numbers is reported only when
897         there's no portable and simple way to convert to floating point.
899         * textprop.c (set_text_properties_1): Rewrite for clarity,
900         and to avoid GCC warning about integer overflow.
902         * intervals.h (struct interval): Use EMACS_INT for members
903         where EMACS_UINT might cause problems.  See
904         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
905         (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
906         * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
907         All uses changed.
908         (offset_intervals): Tell GCC not to worry about length overflow
909         when negating a negative length.
911         * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
912         (overrun_check_free): Likewise.
914         * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
915         in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
916         word size.
918         * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
919         (gnutls_make_error): Rename local to avoid shadowing.
920         (gnutls_emacs_global_deinit): ifdef out; not used.
921         (Fgnutls_boot): Use const for pointer to readonly storage.
922         Comment out unused local.  Fix pointer signedness problems.
924         * lread.c (openp): Don't stuff size_t into an 'int'.
925         Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
926         about possible signed overflow.
928         * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
929         (GDK_KEY_g): Don't define if already defined.
930         (xg_prepare_tooltip): Avoid pointer signedness problem.
931         (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
933         * process.c (Fnetwork_interface_info): Avoid left-shift undefined
934         behavior with 1 << 31.  GCC 4.6.0 warns about this on 32-bit hosts.
936         * xfns.c (Fx_window_property): Simplify a bit,
937         to make a bit faster and to avoid GCC 4.6.0 warning.
938         * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
940         * fns.c (internal_equal): Don't assume size_t fits in int.
942         * alloc.c (compact_small_strings): Tighten assertion a little.
944         Replace pEd with more-general pI, and fix some printf arg casts.
945         * lisp.h (pI): New macro, generalizing old pEd macro to other
946         conversion specifiers.  For example, use "...%"pI"d..." rather
947         than "...%"pEd"...".
948         (pEd): Remove.  All uses replaced with similar uses of pI.
949         * src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h: Likewise.
950         * alloc.c (check_pure_size): Don't overflow by converting size to int.
951         * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
952         * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
953         * dbusbind.c (xd_append_arg): Use pI to avoid cast.
954         (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
955         * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
956         64-bit hosts.
957         (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
958         * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
959         * print.c (safe_debug_print, print_object): Likewise.
960         (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
961         to int.
962         Use pI instead of if-then-else-abort.  Use %p to avoid casts,
963         avoiding the 0 flag, which is not portable.
964         * process.c (Fmake_network_process): Use pI to avoid cast.
965         * region-cache.c (pp_cache): Likewise.
966         * xdisp.c (decode_mode_spec): Likewise.
967         * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
968         behavior on 64-bit hosts with printf arg.
969         * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
970         (x_stop_queuing_selection_requests): Likewise.
971         (x_get_window_property): Don't truncate byte count to an 'int'
972         when tracing.
974         * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
975         here, since it parses constructs like leading '-' and spaces,
976         which are not wanted; and it overflows with large numbers.
977         Instead, simply match F[0-9]+, which is what is wanted anyway.
979         * alloc.c: Remove unportable assumptions about struct layout.
980         (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
981         (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
982         (allocate_vectorlike, make_pure_vector): Use the new macros,
983         plus offsetof, to remove unportable assumptions about struct layout.
984         These assumptions hold on all porting targets that I know of, but
985         they are not guaranteed, they're easy to remove, and removing them
986         makes further changes easier.
988         * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
989         This doesn't fix a bug but makes the code clearer.
990         (string_overrun_cookie): Now const.  Use initializers that
991         don't formally overflow signed char, to avoid warnings.
992         (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
993         can cause Emacs to crash when string overrun checking is enabled.
994         (allocate_buffer): Don't assume sizeof (struct buffer) is a
995         multiple of sizeof (EMACS_INT); it need not be, if
996         alignof(EMACS_INT) < sizeof (EMACS_INT).
997         (check_sblock, check_string_bytes, check_string_free_list): Protoize.
999 2011-04-26  Juanma Barranquero  <lekktu@gmail.com>
1001         * keyboard.c (QCrtl): Rename from Qrtl.  All uses changed.
1003 2011-04-26  Teodor Zlatanov  <tzz@lifelogs.com>
1005         * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
1006         supposed to be handshaking.  (Bug#8556)
1007         Reported by Paul Eggert <eggert@cs.ucla.edu>.
1009 2011-04-26  Daniel Colascione  <dan.colascione@gmail.com>
1011         * lisp.h (Qdebug): List symbol.
1012         * eval.c (Qdebug): Restore global linkage.
1013         * keyboard.c (debug-on-event): New variable.
1014         (handle_user_signal): Break into debugger when debug-on-event
1015         matches the current signal symbol.
1017 2011-04-25  Dan Nicolaescu  <dann@ics.uci.edu>
1019         * alloc.c (check_sblock, check_string_bytes)
1020         (check_string_free_list): Convert to standard C.
1022 2011-04-25  Teodor Zlatanov  <tzz@lifelogs.com>
1024         * w32.c (emacs_gnutls_push): Fix typo.
1026 2011-04-25  Eli Zaretskii  <eliz@gnu.org>
1028         * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
1029         "cast to pointer from integer of different size".
1031         Improve doprnt and its use in verror.  (Bug#8545)
1032         * doprnt.c (doprnt): Document the set of format control sequences
1033         supported by the function.  Use SAFE_ALLOCA instead of always
1034         using `alloca'.
1036         * eval.c (verror): Don't limit the buffer size at size_max-1, that
1037         is one byte too soon.  Don't use xrealloc; instead xfree and
1038         xmalloc anew.
1040 2011-04-24  Teodor Zlatanov  <tzz@lifelogs.com>
1042         * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
1043         callbacks stage.
1045         * gnutls.c: Renamed global_initialized to
1046         gnutls_global_initialized.  Added internals for the
1047         :verify-hostname-error, :verify-error, and :verify-flags
1048         parameters of `gnutls-boot' and documented those parameters in the
1049         docstring.  Start callback support.
1050         (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
1051         unless a fatal error occured. Call gnutls_alert_send_appropriate
1052         on error. Return error code.
1053         (emacs_gnutls_write): Call emacs_gnutls_handle_error.
1054         (emacs_gnutls_read): Likewise.
1055         (Fgnutls_boot): Return handshake error code.
1056         (emacs_gnutls_handle_error): New function.
1057         (wsaerror_to_errno): Likewise.
1059         * w32.h (emacs_gnutls_pull): Add prototype.
1060         (emacs_gnutls_push): Likewise.
1062         * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
1063         (emacs_gnutls_push): Likewise.
1065 2011-04-24  Claudio Bley  <claudio.bley@gmail.com>  (tiny change)
1067         * process.c (wait_reading_process_output): Check if GnuTLS
1068         buffered some data internally if no FDs are set for TLS
1069         connections.
1071         * makefile.w32-in (OBJ2): Add gnutls.$(O).
1072         (LIBS): Link to USER_LIBS.
1073         ($(BLD)/gnutls.$(0)): New target.
1075 2011-04-24  Eli Zaretskii  <eliz@gnu.org>
1077         * xdisp.c (handle_single_display_spec): Rename the
1078         display_replaced_before_p argument into display_replaced_p, to
1079         make it consistent with the commentary.  Fix typos in the
1080         commentary.
1082         * textprop.c (syms_of_textprop): Remove dead code.
1083         (copy_text_properties): Delete obsolete commentary about an
1084         interface that was deleted long ago.  Fix typos in the description
1085         of arguments.
1087         * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
1088         to changes in oldXMenu/XMenu.h from 2011-04-16.
1089         <menu_help_message, prev_menu_help_message>: Constify.
1090         (IT_menu_make_room): menu->help_text is now `const char **';
1091         adjust.
1093         * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
1094         to changes in oldXMenu/XMenu.h from 2011-04-16.
1095         (struct XMenu): Declare `help_text' `const char **'.
1097         * xfaces.c <Qunspecified>: Make extern again.
1099         * syntax.c: Include sys/types.h before including regex.h, as
1100         required by Posix.
1102         * doc.c (get_doc_string): Improve the format passed to `error'.
1104         * doprnt.c (doprnt): Improve commentary.
1106         * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
1108         * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
1109         them with etags.
1111         * makefile.w32-in (globals.h): Add a dummy recipe, to make any
1112         changes in globals.h immediately force recompilation.
1113         (TAGS): Depend on $(CURDIR)/m/intel386.h and
1114         $(CURDIR)/s/ms-w32.h.
1115         (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
1117         * character.c (Fchar_direction): Function deleted.
1118         (syms_of_character): Don't defsubr it.
1119         <char-direction-table>: Deleted.
1121 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
1123         Fix doprnt so it could be used again safely in `verror'.  (Bug#8435)
1124         * doprnt.c: Include limits.h.
1125         (SIZE_MAX): New macro.
1126         (doprnt): Return a size_t value.  2nd arg is now size_t.  Many
1127         local variables are now size_t instead of int or unsigned.
1128         Improve overflow protection.  Support `l' modifier for integer
1129         conversions.  Support %l conversion.  Don't assume an EMACS_INT
1130         argument for integer conversions and for %c.
1132         * lisp.h (doprnt): Restore prototype.
1134         * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
1135         $(SRC)/character.h.
1137         * Makefile.in (base_obj): Add back doprnt.o.
1139         * deps.mk (doprnt.o): Add back prerequisites.
1140         (callint.o): Depend on character.h.
1142         * eval.c (internal_lisp_condition_case): Include the handler
1143         representation in the error message.
1144         (verror): Call doprnt instead of vsnprintf.  Fix an off-by-one bug
1145         when breaking from the loop.
1147         * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
1149         * callint.c (Fcall_interactively): When displaying error message
1150         about invalid control letter, pass the character's codepoint, not
1151         a pointer to its multibyte form.  Improve display of the character
1152         in octal and display also its hex code.
1154         * character.c (char_string): Use %x to display the (unsigned)
1155         codepoint of an invalid character, to avoid displaying a bogus
1156         negative value.
1158         * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
1159         `error', not SYMBOL_NAME itself.
1161         * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
1162         character arguments to `error'.
1164         * charset.c (check_iso_charset_parameter): Fix incorrect argument
1165         to `error' in error message about FINAL_CHAR argument.  Make sure
1166         FINAL_CHAR is a character, and use %c when it is passed as
1167         argument to `error'.
1169 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
1171         * s/ms-w32.h (localtime): Redirect to sys_localtime.
1173         * w32.c: Include <time.h>.
1174         (sys_localtime): New function.
1176 2011-04-23  Chong Yidong  <cyd@stupidchicken.com>
1178         * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
1180         * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
1182 2011-04-23  Samuel Thibault  <sthibault@debian.org>  (tiny change)
1184         * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
1185         zombies (Bug#8467).
1187 2011-04-19  Eli Zaretskii  <eliz@gnu.org>
1189         * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
1190         gl_state.e_property when gl_state.object is Qt.
1192         * insdel.c (make_gap_larger): Remove limitation of buffer size
1193         to <= INT_MAX.
1195 2011-04-18  Chong Yidong  <cyd@stupidchicken.com>
1197         * xdisp.c (lookup_glyphless_char_display)
1198         (produce_glyphless_glyph): Handle cons cell entry in
1199         glyphless-char-display.
1200         (Vglyphless_char_display): Document it.
1202         * term.c (produce_glyphless_glyph): Handle cons cell entry in
1203         glyphless-char-display.
1205 2011-04-17  Chong Yidong  <cyd@stupidchicken.com>
1207         * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
1209         * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
1211         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
1212         definition for no-X builds.
1214 2011-04-16  Paul Eggert  <eggert@cs.ucla.edu>
1216         Static checks with GCC 4.6.0 and non-default toolkits.
1218         * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
1220         * process.c (keyboard_bit_set): Define only if SIGIO.
1221         (send_process_trap): Mark it with NO_RETURN if it doesn't return.
1222         (send_process): Repair possible setjmp clobbering.
1224         * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
1226         * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
1228         * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
1230         * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
1231         Define only if needed.
1233         * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
1234         by pacifying GCC about it.  Maybe it's time to retire it?
1235         * xfaces.c (USG, __TIMEVAL__): Likewise.
1237         * dispextern.h (struct redisplay_interface): Rename param
1238         to avoid shadowing.
1239         * termhooks.h (struct terminal): Likewise.
1240         * xterm.c (xembed_send_message): Likewise.
1242         * insdel.c (make_gap_smaller): Define only if
1243         USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
1245         * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
1246         it.
1248         * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
1249         so that we aren't warned about unused symbols.
1251         * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
1253         * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
1255         * xfns.c (x_real_positions): Mark locals as initialized.
1257         * xmenu.c (xmenu_show): Don't use uninitialized vars.
1259         * xterm.c: Fix problems found by static analysis with other toolkits.
1260         (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
1261         (x_dispatch_event): Declare static if USE_GTK, and
1262         define if USE_GTK || USE_X_TOOLKIT.
1263         (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
1264         * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
1265         * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
1266         if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
1268         * xmenu.c (menu_help_callback): Pointer type fixes.
1269         Use const pointers when pointing at readonly data.  Avoid pointer
1270         signedness clashes.
1271         (FALSE): Remove unused macro.
1272         (update_frame_menubar): Remove unused decl.
1274         * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
1276         * menu.c (push_submenu_start, push_submenu_end): Do not define unless
1277         USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
1278         (single_menu_item): Rename local to avoid shadowing.
1280         * keyboard.c (make_lispy_event): Remove unused local var.
1282         * frame.c, frame.h (x_get_resource_string): Bring this back, but
1283         only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
1285         * bitmaps: Change bitmaps from unsigned char back to the X11
1286         compatible char.  Avoid the old compiler warnings about
1287         out-of-range initializers by using, for example, '\xab' rather
1288         than 0xab.
1290         * xgselect.c (xgselect_initialize): Check vs interface
1291         even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
1293         * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
1295         * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
1296         to read-only memory.
1298         * fns.c (vector): Remove; this old hack is no longer needed.
1300         * xsmfns.c (create_client_leader_window): Rename shadowing arg.
1301         Remove unused var.
1302         (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
1304         * xrdb.c (x_load_resources): Omit unused local.
1306         * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
1307         (x_window): Rename locals to avoid shadowing.
1308         (USG): Use the kludged USG macro, to pacify gcc.
1310         * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
1311         (x_term_init): Remove local to avoid shadowing.
1313         * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
1315         * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
1316         USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
1318 2011-04-16  Eli Zaretskii  <eliz@gnu.org>
1320         * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
1322         Fix regex.c, syntax.c and friends for buffers > 2GB.
1323         * syntax.h (struct gl_state_s): Declare character position members
1324         EMACS_INT.
1326         * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
1328         * textprop.c (verify_interval_modification, interval_of): Declare
1329         arguments EMACS_INT.
1331         * intervals.c (adjust_intervals_for_insertion): Declare arguments
1332         EMACS_INT.
1334         * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
1336         * indent.c (Fvertical_motion): Local variable it_start is now
1337         EMACS_INT.
1339         * regex.c (re_match, re_match_2, re_match_2_internal)
1340         (bcmp_translate, regcomp, regexec, print_double_string)
1341         (group_in_compile_stack, re_search, re_search_2, regex_compile)
1342         (re_compile_pattern, re_exec): Declare arguments and local
1343         variables `size_t' and `ssize_t' and return values `regoff_t', as
1344         appropriate.
1345         (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
1346         (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
1347         <compile_stack_type>: `size' and `avail' are now `size_t'.
1349         * regex.h <regoff_t>: Use ssize_t, not int.
1350         (re_search, re_search_2, re_match, re_match_2): Arguments that
1351         specify buffer/string position and length are now ssize_t and
1352         size_t.  Return type is regoff_t.
1354 2011-04-16  Ben Key  <bkey76@gmail.com>
1356         * nsfont.m: Fixed bugs in ns_get_family and
1357         ns_descriptor_to_entity that were caused by using free to
1358         deallocate memory blocks that were allocated by xmalloc (via
1359         xstrdup).  This caused Emacs to crash when compiled with
1360         XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
1361         --enable-checking=xmallocoverrun).  xfree is now used to
1362         deallocate these memory blocks.
1364 2011-04-15  Paul Eggert  <eggert@cs.ucla.edu>
1366         * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
1368         emacs_write: Accept and return EMACS_INT for sizes.
1369         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
1370         et seq.
1371         * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
1372         Accept and return EMACS_INT.
1373         (emacs_gnutls_write): Return the number of bytes written on
1374         partial writes.
1375         * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
1376         (emacs_read, emacs_write): Remove check for negative size, as the
1377         Emacs source code has been audited now.
1378         * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
1379         (emacs_read, emacs_write): Use it.
1380         * process.c (send_process): Adjust to the new signatures of
1381         emacs_write and emacs_gnutls_write.  Do not attempt to store
1382         a byte offset into an 'int'; it might overflow.
1383         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
1385         * sound.c: Don't assume sizes fit in 'int'.
1386         (struct sound_device.period_size, alsa_period_size):
1387         Return EMACS_INT, not int.
1388         (struct sound_device.write, vox_write, alsa_write):
1389         Accept EMACS_INT, not int.
1390         (wav_play, au_play): Use EMACS_INT to store sizes and to
1391         record read return values.
1393 2011-04-15  Ben Key  <bkey76@gmail.com>
1395         * keyboard.c (Qundefined): Don't declare static since it is used
1396         in nsfns.m.
1397         * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
1398         static since they are used in nsfont.m.
1400 2011-04-15  Stefan Monnier  <monnier@iro.umontreal.ca>
1402         * process.c (Qprocessp): Don't declare static.
1403         * lisp.h (Qprocessp): Declare again.
1405 2011-04-15  Juanma Barranquero  <lekktu@gmail.com>
1407         * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
1409 2011-04-14  Paul Eggert  <eggert@cs.ucla.edu>
1411         Improve C-level modularity by making more things 'static'.
1413         Don't publish debugger-only interfaces to other modules.
1414         * lisp.h (safe_debug_print, debug_output_compilation_hack):
1415         (verify_bytepos, count_markers): Move decls to the only modules
1416         that need them.
1417         * region-cache.h (pp_cache): Likewise.
1418         * window.h (check_all_windows): Likewise.
1419         * marker.c, print.c, region-cache.c, window.c: Decls moved here.
1421         * sysdep.c (croak): Now static, if
1422         defined TIOCNOTTY || defined USG5 || defined CYGWIN.
1423         * syssignal.h (croak): Declare only if not static.
1425         * alloc.c (refill_memory_reserve): Now static if
1426         !defined REL_ALLOC || defined SYSTEM_MALLOC.
1427         * lisp.h (refill_memory_reserve): Declare only if not static.
1429         * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
1430         Define only if USE_LUCID.
1432         * xrdb.c (x_customization_string, x_rm_string): Now static.
1434         * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
1435         * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
1437         * xdisp.c (draw_row_with_mouse_face): Now static.
1438         * dispextern.h (draw_row_with_mouse_fave): Remove decl.
1440         * window.h (check_all_windows): Mark externally visible.
1442         * window.c (window_deletion_count): Now static.
1444         * undo.c: Make symbols static if they're not exported.
1445         (last_undo_buffer, last_boundary_position, pending_boundary):
1446         Now static.
1448         * textprop.c (interval_insert_behind_hooks): Now static.
1449         (interval_insert_in_front_hooks): Likewise.
1451         * term.c: Make symbols static if they're not exported.
1452         (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
1453         (max_frame_lines, tty_set_terminal_modes):
1454         (tty_reset_terminal_modes, tty_turn_off_highlight):
1455         (get_tty_terminal): Now static.
1456         (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
1457         * termhooks.h (term_mouse_moveto): Do not declare if
1458         HAVE_WINDOW_SYSTEM.
1459         * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
1460         (tty_turn_off_highlight, get_tty_terminal): Remove decls.
1462         * sysdep.c: Make symbols static if they're not exported.
1463         (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
1464         Now static.
1465         (sigprocmask_set, full_mask): Remove; unused.
1466         (wait_debugging): Mark as visible.
1467         * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
1468         * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
1470         * syntax.c (syntax_temp): Define only if !__GNUC__.
1472         * sound.c (current_sound_device, current_sound): Now static.
1474         * search.c (searchbufs, searchbuf_head): Now static.
1476         * scroll.c (scroll_cost): Remove; unused.
1477         * dispextern.h (scroll_cost): Remove decl.
1479         * region-cache.h (pp_cache): Mark as externally visible.
1481         * process.c: Make symbols static if they're not exported.
1482         (process_tick, update_tick, create_process, chan_process):
1483         (Vprocess_alist, proc_buffered_char, datagram_access):
1484         (fd_callback_data, send_process_frame, process_sent_to): Now static.
1485         (deactivate_process): Mark defn as static, as well as decl.
1486         * lisp.h (create_process): Remove decl.
1487         * process.h (chan_process, Vprocess_alist): Remove decls.
1489         * print.c: Make symbols static if they're not exported.
1490         (print_depth, new_backquote_output, being_printed, print_buffer):
1491         (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
1492         (print_interval, print_number_index, initial_stderr_stream):
1493         Now static.
1494         * lisp.h (Fprinc): Remove decl.
1495         (debug_output_compilation_hack): Mark as externally visible.
1497         * sysdep.c (croak): Move decl from here to syssignal.h.
1498         * syssignal.h (croak): Put it here, so the API can be checked when
1499         'croak' is called from dissociate_if_controlling_tty.
1501         * minibuf.c: Make symbols static if they're not exported.
1502         (minibuf_save_list, choose_minibuf_frame): Now static.
1503         * lisp.h (choose_minibuf_frame): Remove decl.
1505         * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
1507         * lread.c: Make symbols static if they're not exported.
1508         (read_objects, initial_obarray, oblookup_last_bucket_number):
1509         Now static.
1510         (make_symbol): Remove; unused.
1511         * lisp.h (initial_obarray, make_symbol): Remove decls.
1513         * keyboard.c: Make symbols static if they're not exported.
1514         (single_kboard, recent_keys_index, total_keys, recent_keys):
1515         (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
1516         (this_single_command_key_start, echoing, last_auto_save):
1517         (read_key_sequence_cmd, dribble, recursive_edit_unwind):
1518         (command_loop, echo_now, keyboard_init_hook, help_char_p):
1519         (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
1520         (Vlispy_mouse_stem, double_click_count):
1521         Now static.
1522         (force_auto_save_soon): Define only if SIGDANGER.
1523         (ignore_mouse_drag_p): Now static if
1524         !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
1525         (print_help): Remove; unused.
1526         (stop_character, last_timer_event): Mark as externally visible.
1527         * keyboard.h (ignore_mouse_drag_p): Declare only if
1528         defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
1529         (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
1530         * lisp.h (echoing): Remove decl.
1531         (force_auto_save_soon): Declare only if SIGDANGER.
1532         * xdisp.c (redisplay_window): Simplify code, to make it more
1533         obvious that ignore_mouse_drag_p is not accessed if !defined
1534         USE_GTK && !defined HAVE_NS.
1536         * intervals.c: Make symbols static if they're not exported.
1537         (merge_properties_sticky, merge_interval_right, delete_interval):
1538         Now static.
1539         * intervals.h (merge_interval_right, delete_interval): Remove decls.
1541         * insdel.c: Make symbols static if they're not exported.
1542         However, leave prepare_to_modify_buffer alone.  It's never
1543         called from outside this function, but that appears to be a bug.
1544         (combine_after_change_list, combine_after_change_buffer):
1545         (adjust_after_replace, signal_before_change): Now static.
1546         (adjust_after_replace_noundo): Remove; unused.
1547         * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
1548         (signal_before_change): Remove decls.
1550         * indent.c (val_compute_motion, val_vmotion): Now static.
1552         * image.c: Make symbols static if they're not exported.
1553         * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
1554         if USE_GTK.
1555         * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
1556         (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
1558         * fringe.c (standard_bitmaps): Now static.
1559         (max_used_fringe_bitmap): Now static, unless HAVE_NS.
1561         * frame.c: Make symbols static if they're not exported.
1562         (x_report_frame_params, make_terminal_frame): Now static.
1563         (get_frame_param): Now static, unless HAVE_NS.
1564         (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
1565         (x_get_resource_string): Remove; not used.
1566         * frame.h (make_terminal_frame, x_report_frame_params):
1567         (x_get_resource_string); Remove decls.
1568         (x_fullscreen_adjust): Declare only if WINDOWSNT.
1569         * lisp.h (get_frame_param): Declare only if HAVE_NS.
1571         * font.c, fontset.c: Make symbols static if they're not exported.
1572         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
1573         (FACE_SUITABLE_FOR_CHAR_P): Use it.
1574         * font.c (font_close_object): Now static.
1575         * font.h (font_close_object): Remove.
1576         * fontset.c (FONTSET_OBJLIST): Remove.
1577         (free_realized_fontset) #if-0 the body, which does nothing.
1578         (face_suitable_for_char_p): #if-0, as it's never called.
1579         * fontset.h (face_suitable_for_char_p): Remove decl.
1580         * xfaces.c (face_at_string_position): Use
1581         FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
1582         since 0 is always ASCII.
1584         * fns.c (weak_hash_tables): Now static.
1586         * fileio.c: Make symbols static if they're not exported.
1587         (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
1588         (Vwrite_region_annotation_buffers): Now static.
1590         * eval.c: Make symbols static if they're not exported.
1591         (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
1592         * lisp.h (backtrace_list): Remove decl.
1594         * emacs.c: Make symbols static if they're not exported.
1595         (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
1596         (fatal_error_code, fatal_error_signal_hook, standard_args):
1597         Now static.
1598         (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
1599         (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
1600         (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
1601         * lisp.h (fatal_error_signal_hook): Remove decl.
1602         (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
1604         * editfns.c: Move a (normally-unused) function to its only use.
1605         * editfns.c, lisp.h (get_operating_system_release): Remove.
1606         * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
1607         worth the hassle of breaking this out.
1609         * xterm.c: Make symbols static if they're not exported.
1610         (x_raise_frame, x_lower_frame, x_wm_set_window_state):
1611         (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
1612         (x_destroy_window, x_delete_display):
1613         Now static.
1614         (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
1615         (x_mouse_leave): Remove; unused.
1616         * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
1617         (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
1618         (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
1619         Remove decls.
1620         (x_mouse_leave): Declare only if WINDOWSNT.
1621         (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
1622         (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
1623         USE_X_TOOLKIT.
1625         * ftxfont.c: Make symbols static if they're not exported.
1626         (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
1627         HAVE_FREETYPE.
1628         * font.h (ftxfont_driver): Likewise.
1630         * xfns.c: Make symbols static if they're not exported.
1631         (x_last_font_name, x_display_info_for_name):
1632         (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
1633         (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
1634         (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
1635         (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
1636         (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
1637         (last_show_tip_args): Now static.
1638         (xic_defaut_fontset, xic_create_fontsetname): Define only if
1639         defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
1640         (x_screen_planes): Remove; unused.
1641         * dispextern.h (x_screen_planes): Remove decl.
1643         * dispnew.c: Make symbols static if they're not exported.
1644         * dispextern.h (redraw_garbaged_frames, scrolling):
1645         (increment_row_positions): Remove.
1646         * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
1647         (delayed_size_change, glyph_matrix_count, glyph_pool_count):
1648         Now static.
1649         (redraw_garbaged_frames): Remove; unused.
1651         * xfaces.c: Make symbols static if they're not exported.
1652         * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
1653         Remove decls.
1654         * xterm.h (defined_color): Remove decls.
1655         (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
1656         * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
1657         (menu_face_changed_default, defined_color, free_realized_face):
1658         (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
1659         (ascii_face_of_lisp_face): Remove; unused.
1661         * xdisp.c: Make symbols static if they're not exported.
1662         * dispextern.h (scratch_glyph_row, window_box_edges):
1663         (glyph_to_pixel_coords, set_cursor_from_row):
1664         (get_next_display_element, set_iterator_to_next):
1665         (highlight_trailing_whitespace, frame_to_window_pixel_xy):
1666         (show_mouse_face): Remove decls
1667         * frame.h (message_buf_print): Likewise.
1668         * lisp.h (pop_message, set_message, check_point_in_composition):
1669         Likewise.
1670         * xterm.h (set_vertical_scroll_bar): Likewise.
1671         * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
1672         (message_buf_print, scratch_glyph_row, displayed_buffer):
1673         (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
1674         (get_next_display_element, show_mouse_face, window_box_edges):
1675         (frame_to_window_pixel_xy, check_point_in_composition):
1676         (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
1677         (glyph_to_pixel_coords): Remove; unused.
1679         * dired.c (file_name_completion): Now static.
1681         * dbusbind.c (xd_in_read_queued_messages): Now static.
1683         * lisp.h (circular_list_error, FOREACH): Remove; unused.
1684         * data.c (circular_list_error): Remove.
1686         * commands.h (last_point_position, last_point_position_buffer):
1687         (last_point_position_window): Remove decls.
1688         * keyboard.c: Make these variables static.
1690         * coding.h (coding, code_convert_region, encode_coding_gap): Remove
1691         decls.
1692         * coding.c (Vsjis_coding_system, Vbig5_coding_system):
1693         (iso_code_class, detect_coding, code_convert_region): Now static.
1694         (encode_coding_gap): Remove; unused.
1696         * chartab.c (chartab_chars, chartab_bits): Now static.
1698         * charset.h (charset_iso_8859_1): Remove decl.
1699         * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
1700         Now static.
1702         * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
1703         * ccl.c (Vccl_program_table): Now static.
1704         (check_ccl_update): Remove; unused.
1706         * category.c (SET_CATEGORY_SET, set_category_set): Move here.
1707         * category.h: ... from here.
1708         * category.c (check_category_table, set_category_set): Now static.
1710         * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
1711         * lisp.h: Remove these decls.
1713         * buffer.c (buffer_count): Remove unused var.
1715         * bidi.c (bidi_dump_cached_states): Mark as externally visible,
1716         so that it's not optimized away.
1717         (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
1718         * dispextern.h (bidi_dump_cached_states): Remove, since it's
1719         exported only to the debugger.
1721         * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
1722         * atimer.h (run_all_atimers): Removed; not exported.
1724         font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
1725         * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
1726         was inaccessible from Lisp.
1727         (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
1728         * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
1730         alloc.c: Import and export fewer symbols, and remove unused items.
1731         * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
1732         is defined.
1733         (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
1734         it's not optimized away by whole-program optimization.
1735         (message_enable_multibyte, free_misc): Remove.
1736         (catchlist, handlerlist, mark_backtrace):
1737         Declare only if BYTE_MARK_STACK.
1738         (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
1739         * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
1740         (message_enable_multibyte): Remove decl.
1741         (free_misc, interval_free_list, float_block, float_block_index):
1742         (n_float_blocks, float_free_list, cons_block, cons_block_index):
1743         (cons_free_list, last_marked_index):
1744         Now static.
1745         (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
1746         * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
1747         (mark_backtrace): Define only if BYTE_MARK_STACK.
1748         * xdisp.c (message_enable_multibyte): Now static.
1750         Declare Lisp_Object Q* variables to be 'static' if not exported.
1751         This makes it easier for human readers (and static analyzers)
1752         to see whether these variables are used from other modules.
1753         * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
1754         * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
1755         * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
1756         * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
1757         * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
1758         * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
1759         * xmenu.c, xselect.c:
1760         Declare Q* vars static if they are not used in other modules.
1761         * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
1762         * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
1763         Remove decls of unexported vars.
1764         * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
1766         * lisp.h (DEFINE_FUNC): Make sname 'static'.
1768         Make Emacs functions such as Fatom 'static' by default.
1769         This makes it easier for human readers (and static analyzers)
1770         to see whether these functions can be called from other modules.
1771         DEFUN now defines a static function.  To make the function external
1772         so that it can be used in other C modules, use the new macro DEFUE.
1773         * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
1774         (Finit_image_library):
1775         (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
1776         (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
1777         (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
1778         Remove decls, since these functions are now static.
1779         (Funintern, Fget_internal_run_time): New decls, since these functions
1780         were already external.
1782         * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
1783         * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
1784         * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
1785         * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
1786         * keyboard.c, keymap.c, lread.c:
1787         * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
1788         * syntax.c, term.c, terminal.c, textprop.c, undo.c:
1789         * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
1790         Mark functions with DEFUE instead of DEFUN,
1791         if they are used in other modules.
1792         * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
1793         decls for now-static functions.
1794         * buffer.h (Fdelete_overlay): Remove decl.
1795         * callproc.c (Fgetenv_internal): Mark as internal.
1796         * composite.c (Fremove_list_of_text_properties): Remove decl.
1797         (Fcomposition_get_gstring): New forward static decl.
1798         * composite.h (Fcomposite_get_gstring): Remove decl.
1799         * dired.c (Ffile_attributes): New forward static decl.
1800         * doc.c (Fdocumntation_property): New forward static decl.
1801         * eval.c (Ffetch_bytecode): New forward static decl.
1802         (Funintern): Remove extern decl; now in .h file where it belongs.
1803         * fileio.c (Fmake_symbolic_link): New forward static decl.
1804         * image.c (Finit_image_library): New forward static decl.
1805         * insdel.c (Fcombine_after_change_execute): Make forward decl static.
1806         * intervals.h (Fprevious_property_change):
1807         (Fremove_list_of_text_properties): Remove decls.
1808         * keyboard.c (Fthis_command_keys): Remove decl.
1809         (Fcommand_execute): New forward static decl.
1810         * keymap.c (Flookup_key): New forward static decl.
1811         (Fcopy_keymap): Now static.
1812         * keymap.h (Flookup_key): Remove decl.
1813         * process.c (Fget_process): New forward static decl.
1814         (Fprocess_datagram_address): Mark as internal.
1815         * syntax.c (Fsyntax_table_p): New forward static decl.
1816         (skip_chars): Remove duplicate decl.
1817         * textprop.c (Fprevious_property_change): New forward static decl.
1818         * window.c (Fset_window_fringes, Fset_window_scroll_bars):
1819         Now internal.
1820         (Fset_window_margins, Fset_window_vscroll): New forward static decls.
1821         * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
1823         * editfns.c (Fformat): Remove unreachable code.
1825 2011-04-14  Andreas Schwab  <schwab@linux-m68k.org>
1827         * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
1828         change.  (Bug#8496)
1830 2011-04-13  Eli Zaretskii  <eliz@gnu.org>
1832         * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
1833         when at ZV.  (Bug#8487)
1835 2011-04-12  Andreas Schwab  <schwab@linux-m68k.org>
1837         * charset.c (Fclear_charset_maps): Use xfree instead of free.
1838         (Bug#8437)
1839         * keyboard.c (parse_tool_bar_item): Likewise.
1840         * sound.c (sound_cleanup, alsa_close): Likewise.
1841         * termcap.c (tgetent): Likewise.
1842         * xfns.c (x_default_font_parameter): Likewise.
1843         * xsettings.c (read_and_apply_settings): Likewise.
1845         * alloc.c (overrun_check_malloc, overrun_check_realloc)
1846         (overrun_check_free): Protoize.
1848 2011-04-12  Paul Eggert  <eggert@cs.ucla.edu>
1850         * sysdep.c (emacs_read, emacs_write): Check for negative sizes
1851         since callers should never pass a negative size.
1852         Change the signature to match that of plain 'read' and 'write'; see
1853         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
1854         * lisp.h: Update prototypes of emacs_write and emacs_read.
1856 2011-04-11  Eli Zaretskii  <eliz@gnu.org>
1858         * xdisp.c (redisplay_window): Don't try to determine the character
1859         position of the scroll margin if the window start point w->startp
1860         is outside the buffer's accessible region.  (Bug#8468)
1862 2011-04-10  Eli Zaretskii  <eliz@gnu.org>
1864         Fix write-region and its subroutines for buffers > 2GB.
1865         * fileio.c (a_write, e_write): Modify declaration of arguments and
1866         local variables to support buffers larger than 2GB.
1867         (Fcopy_file): Use EMACS_INT for return value of emacs_read.
1869         * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
1870         argument, local variables, and return value.
1872         * lisp.h: Update prototypes of emacs_write and emacs_read.
1874         * sound.c (vox_write): Use ssize_t for return value of emacs_write.
1876 2011-04-10  Paul Eggert  <eggert@cs.ucla.edu>
1878         * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
1880         Fix more problems found by GCC 4.6.0's static checks.
1882         * xdisp.c (vmessage): Use a better test for character truncation.
1884         * charset.c (load_charset_map): <, not <=, for optimization,
1885         and to avoid potential problems with integer overflow.
1886         * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
1887         * casetab.c (set_identity, shuffle): Likewise.
1888         * editfns.c (Fformat): Likewise.
1889         * syntax.c (skip_chars): Likewise.
1891         * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
1892         This also lets GCC 4.6.0 generate slightly better loop code.
1894         * callint.c (Fcall_interactively): <, not <=, for optimization.
1895         (Fcall_interactively): Count the number of arguments produced,
1896         not the number of arguments given.  This is simpler and lets GCC
1897         4.6.0 generate slightly better code.
1899         * ftfont.c: Distingish more carefully between FcChar8 and char.
1900         The previous code passed unsigned char * to a functions like
1901         strlen and xstrcasecmp that expect char *, which does not
1902         conform to the C standard.
1903         (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
1904         arguments to FcPatternGetString, and explicitly cast FcChar8 * to
1905         char * when the C standard requires it.
1907         * keyboard.c (read_char): Remove unused var.
1909         * eval.c: Port to Windows vsnprintf (Bug#8435).
1910         Include <limits.h>.
1911         (SIZE_MAX): Define if the headers do not.
1912         (verror): Do not give up if vsnprintf returns a negative count.
1913         Instead, grow the buffer.  This ports to Windows vsnprintf, which
1914         does not conform to C99.  Problem reported by Eli Zaretskii.
1915         Also, simplify the allocation scheme, by avoiding the need for
1916         calling realloc, and removing the ALLOCATED variable.
1918         * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
1920         Remove invocations of doprnt, as Emacs now uses vsnprintf.
1921         But keep the doprint source code for now, as we might revamp it
1922         and use it again (Bug#8435).
1923         * lisp.h (doprnt): Remove.
1924         * Makefile.in (base_obj): Remove doprnt.o.
1925         * deps.mk (doprnt.o): Remove.
1927         error: Print 32- and 64-bit integers portably (Bug#8435).
1928         Without this change, on typical 64-bit hosts error ("...%d...", N)
1929         was used to print both 32- and 64-bit integers N, which relied on
1930         undefined behavior.
1931         * lisp.h, src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h (pEd):
1932         New macro.
1933         * lisp.h (error, verror): Mark as printf-like functions.
1934         * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
1935         Report overflow in size calculations when allocating printf buffer.
1936         Do not truncate output string at its first null byte.
1937         * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
1938         Truncate the output at a character boundary, since vsnprintf does not
1939         do that.
1940         * charset.c (check_iso_charset_parameter): Convert internal
1941         character to string before calling 'error', since %c now has the
1942         printf meaning.
1943         * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
1944         overflow when computing char to be passed to 'error'.  Do not
1945         pass Lisp_Object to 'error'; pass the integer instead.
1946         * nsfns.m (Fns_do_applescript): Use int, not long, since it's
1947         formatted with plain %d.
1949         * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
1951         * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
1953         * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
1955         * xterm.c (x_catch_errors): Remove duplicate declaration.
1957         * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
1959         * xdisp.c, lisp.h (message_nolog): Remove; unused.
1961 2011-04-10  Jim Meyering  <meyering@redhat.com>
1963         use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
1964         * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
1965         return ssize_t not "int", and use size_t as the buffer length.
1966         (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
1967         * gnutls.h: Update declarations.
1968         * process.c (read_process_output): Use ssize_t, to match.
1969         (send_process): Likewise.
1971 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
1973         * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
1975 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
1977         * ftfont.c (get_adstyle_property, ftfont_pattern_entity): Use
1978         unsigned char, to match FcChar8 type definition.
1980         * xterm.c (handle_one_xevent):
1981         * xmenu.c (create_and_show_popup_menu):
1982         * xselect.c (x_decline_selection_request)
1983         (x_reply_selection_request): Avoid type-punned deref of X events.
1985 2011-04-09  Eli Zaretskii  <eliz@gnu.org>
1987         Fix some uses of `int' instead of EMACS_INT.
1988         * search.c (string_match_1, fast_string_match)
1989         (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
1990         (scan_buffer, find_next_newline_no_quit)
1991         (find_before_next_newline, search_command, Freplace_match)
1992         (Fmatch_data): Make some `int' variables be EMACS_INT.
1994         * xdisp.c (display_count_lines): 3rd argument and return value now
1995         EMACS_INT.  All callers changed.
1996         (pint2hrstr): Last argument is now EMACS_INT.
1998         * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
1999         (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
2000         (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
2001         (decode_coding_utf_16, decode_coding_emacs_mule)
2002         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
2003         (decode_coding_ccl, decode_coding_charset)
2004         <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
2005         (decode_coding_iso_2022, decode_coding_emacs_mule)
2006         (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
2007         <char_offset, last_offset>: Declare EMACS_INT.
2008         (encode_coding_utf_8, encode_coding_utf_16)
2009         (encode_coding_emacs_mule, encode_invocation_designation)
2010         (encode_designation_at_bol, encode_coding_iso_2022)
2011         (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
2012         (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
2013         Declare EMACS_INT.
2014         (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
2015         (encode_invocation_designation): Last argument P_NCHARS is now
2016         EMACS_INT.
2017         (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
2018         (produce_chars): from_nchars and to_nchars are now EMACS_INT.
2020         * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
2021         All users changed.
2023         * ccl.c (Fccl_execute_on_string): Declare some variables
2024         EMACS_INT.
2026 2011-04-08  Samuel Thibault  <sthibault@debian.org>  (tiny change)
2028         * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
2030 2011-03-19  Christoph Scholtes  <cschol2112@googlemail.com>
2032         * process.c (Fformat_network_address): Doc fix.
2034 2011-04-08  T.V. Raman  <tv.raman.tv@gmail.com>  (tiny change)
2036         * xml.c (parse_region): Avoid creating spurious whiespace nodes.
2038 2011-04-08  Chong Yidong  <cyd@stupidchicken.com>
2040         * keyboard.c (read_char): Call Lisp function help-form-show,
2041         instead of using internal_with_output_to_temp_buffer.
2042         (Qhelp_form_show): New var.
2043         (syms_of_keyboard): Use DEFSYM macro.
2045         * print.c (internal_with_output_to_temp_buffer): Function deleted.
2047         * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
2049 2011-04-06  Chong Yidong  <cyd@stupidchicken.com>
2051         * process.c (Flist_processes): Removed to Lisp.
2052         (list_processes_1): Deleted.
2054 2011-04-06  Eli Zaretskii  <eliz@gnu.org>
2056         * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
2058         * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
2060 2011-04-06  Paul Eggert  <eggert@cs.ucla.edu>
2062         Fix more problems found by GCC 4.6.0's static checks.
2064         * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
2066         * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
2068         * lisp.h (message, message_nolog, fatal): Mark as printf-like.
2070         * xdisp.c (vmessage): Mark as a printf-like function.
2072         * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
2074         * sound.c (sound_warning): Don't crash if arg contains a printf format.
2076         * image.c (tiff_error_handler, tiff_warning_handler): Mark as
2077         printf-like functions.
2078         (tiff_load): Add casts to remove these marks before passing them
2079         to system-supplied API.
2081         * eval.c (Fsignal): Remove excess argument to 'fatal'.
2083         * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
2084         This avoids several warnings with gcc -Wstrict-overflow.
2085         (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
2086         directly, rather than having caller test rule sign.  This avoids
2087         some unnecessary tests.
2088         * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
2089         (COMPOSITION_ENCODE_RULE): Arguments now must be valid.  This
2090         affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
2092         * xfont.c (xfont_text_extents): Remove var that was set but not used.
2093         (xfont_open): Avoid unnecessary tests.
2095         * composite.c (composition_gstring_put_cache): Use unsigned integer.
2097         * composite.h, composite.c (composition_gstring_put_cache):
2098         Use EMACS_INT, not int, for length.
2100         * composite.h (COMPOSITION_DECODE_REFS): New macro,
2101         breaking out part of COMPOSITION_DECODE_RULE.
2102         (COMPOSITION_DECODE_RULE): Use it.
2103         * composite.c (get_composition_id): Remove unused local vars,
2104         by using the new macro.
2106         * textprop.c (set_text_properties_1): Change while to do-while,
2107         since the condition is always true at first.
2109         * intervals.c (graft_intervals_into_buffer): Mark var as used.
2110         (interval_deletion_adjustment): Return unsigned value.
2111         All uses changed.
2113         * process.c (list_processes_1, create_pty, read_process_output):
2114         (exec_sentinel): Remove vars that were set but not used.
2115         (create_pty): Remove unnecessary "volatile"s.
2116         (Fnetwork_interface_info): Avoid possibility of int overflow.
2117         (read_process_output): Do adaptive read buffering even if carryover.
2118         (read_process_output): Simplify nbytes computation if buffered.
2120         * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
2122         * syntax.c (scan_words): Remove var that was set but not used.
2123         (update_syntax_table): Use unsigned instead of int.
2125         * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
2126         (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
2127         (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
2129         * print.c (print_error_message): Avoid int overflow.
2131         * font.c (font_list_entities): Redo for clarity,
2132         so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
2134         * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
2135         (font_score): Avoid potential overflow in diff calculation.
2137         * fns.c (substring_both): Remove var that is set but not used.
2138         (sxhash): Redo loop for clarity and to avoid wraparound warning.
2140         * eval.c (funcall_lambda): Rename local to avoid shadowing.
2142         * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
2143         Otherwise, GCC 4.6.0 optimizes the loop check away since the check
2144         can always succeed if overflow has undefined behavior.
2146         * search.c (boyer_moore, wordify): Remove vars set but not used.
2147         (wordify): Omit three unnecessary tests.
2149         * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
2150         All callers changed.  This avoids the need for an unused var.
2152         * casefiddle.c (casify_region): Remove var that is set but not used.
2154         * dired.c (file_name_completion): Remove var that is set but not used.
2156         * fileio.c (Finsert_file_contents): Make EOF condition clearer.
2158         * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
2159         (Finsert_file_contents): Remove unnecessary code checking fd.
2161         * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
2162         Check for integer overflow on size calculations.
2164         * buffer.c (Fprevious_overlay_change): Remove var that is set
2165         but not used.
2167         * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
2168         Remove vars that are set but not used.
2169         (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
2170         (timer_check_2): Mark vars as initialized.
2172         * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
2174         * image.c (lookup_image): Remove var that is set but not used.
2175         (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
2177         * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
2178         that are set but not used.
2180         * xfns.c (make_invisible_cursor): Don't return garbage
2181         if XCreateBitmapFromData fails (Bug#8410).
2183         * xselect.c (x_get_local_selection, x_handle_property_notify):
2184         Remove vars that are set but not used.
2186         * xfns.c (x_create_tip_frame): Remove var that is set but not used.
2187         (make_invisible_cursor): Initialize a possibly-uninitialized variable.
2189         * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
2190         Remove var that is set but not used.
2191         (scroll_bar_windows_size): Now size_t, not int.
2192         (x_send_scroll_bar_event): Use size_t, not int, for sizes.
2193         Check for overflow.
2195         * xfaces.c (realize_named_face): Remove vars that are set but not used.
2196         (map_tty_color) [!defined MSDOS]: Likewise.
2198         * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
2200         * coding.c: Remove vars that are set but not used.
2201         (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
2202         All callers changed.
2203         (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
2204         (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
2205         (decode_coding_charset): Remove vars that are set but not used.
2207         * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
2208         that is set but not used.
2210         * print.c (print_object): Remove var that is set but not used.
2212         Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
2213         The gnulib version avoids calling malloc in the usual case,
2214         and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
2215         * fileio.c (Ffile_symlink_p): Use emacs_readlink.
2216         * filelock.c (current_lock_owner): Likewise.
2217         * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
2218         * sysdep.c: Include allocator.h, careadlinkat.h.
2219         (emacs_no_realloc_allocator): New static constant.
2220         (emacs_readlink): New function.
2221         * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
2222         ../lib/careadlinkat.h.
2224 2011-04-04  Stefan Monnier  <monnier@iro.umontreal.ca>
2226         * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
2227         first non-nil return value).
2229 2011-04-03  Jan Djärv  <jan.h.d@swipnet.se>
2231         * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
2232         if not defined (Bug#8403).
2234 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
2236         * xdisp.c (display_count_lines): Remove parameter `start',
2237         unused since 1998-01-01T02:27:27Z!rms@gnu.org.  All callers changed.
2238         (get_char_face_and_encoding): Remove parameter `multibyte_p',
2239         unused since 2008-05-14T01:40:23Z!handa@m17n.org.  All callers changed.
2240         (fill_stretch_glyph_string): Remove parameters `row' and `area',
2241         unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
2242         and thereabouts.  All callers changed.
2243         (get_per_char_metric): Remove parameter `f', unused since
2244         2008-05-14T01:40:23Z!handa@m17n.org.  All callers changed.
2246 2011-04-02  Jim Meyering  <meyering@redhat.com>
2248         do not dereference NULL upon failed strdup
2249         * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
2250         (ns_get_family): Likewise.
2252 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
2254         * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
2256 2011-04-02  Jan Djärv  <jan.h.d@swipnet.se>
2258         * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
2259         later (Bug#8403).
2261 2011-04-01  Stefan Monnier  <monnier@iro.umontreal.ca>
2263         Add lexical binding.
2265         * window.c (Ftemp_output_buffer_show): New fun.
2266         (Fsave_window_excursion):
2267         * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
2269         * lread.c (lisp_file_lexically_bound_p): New function.
2270         (Fload): Bind Qlexical_binding.
2271         (readevalloop): Remove `evalfun' arg.
2272         Bind Qinternal_interpreter_environment.
2273         (Feval_buffer): Bind Qlexical_binding.
2274         (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
2275         Mark as dynamic.
2276         (syms_of_lread): Declare `lexical-binding'.
2278         * lisp.h (struct Lisp_Symbol): New field `declared_special'.
2280         * keyboard.c (eval_dyn): New fun.
2281         (menu_item_eval_property): Use it.
2283         * image.c (parse_image_spec): Use Ffunctionp.
2285         * fns.c (concat, mapcar1): Accept byte-code-functions.
2287         * eval.c (Fsetq): Handle lexical vars.
2288         (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
2289         (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
2290         (FletX, Flet): Obey lexical binding.
2291         (Fcommandp): Handle closures.
2292         (Feval): New `lexical' arg.
2293         (eval_sub): New function extracted from Feval.  Use it almost
2294         everywhere where Feval was used.  Look up vars in lexical env.
2295         Handle closures.
2296         (Ffunctionp): Move from subr.el.
2297         (Ffuncall): Handle closures.
2298         (apply_lambda): Remove `eval_flags'.
2299         (funcall_lambda): Handle closures and new byte-code-functions.
2300         (Fspecial_variable_p): New function.
2301         (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
2302         but without exporting it to Lisp.
2304         * doc.c (Fdocumentation, store_function_docstring):
2305         * data.c (Finteractive_form): Handle closures.
2307         * callint.c (Fcall_interactively): Preserve lexical-binding mode for
2308         interactive spec.
2310         * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN): New
2311         byte-codes.
2312         (exec_byte_code): New function extracted from Fbyte_code to handle new
2313         calling convention for byte-code-functions.  Add new byte-codes.
2315         * buffer.c (defvar_per_buffer): Set new `declared_special' field.
2317         * alloc.c (Fmake_symbol): Init new `declared_special' field.
2319 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
2321         * xdisp.c (redisplay_internal): Fix prototype.
2323 2011-03-31  Eli Zaretskii  <eliz@gnu.org>
2325         * xdisp.c (SCROLL_LIMIT): New macro.
2326         (try_scrolling): Use it when setting scroll_limit.  Limit
2327         scrolling to 100 screen lines.
2328         (redisplay_window): Even when falling back on "recentering",
2329         position point in the window according to scroll-conservatively,
2330         scroll-margin, and scroll-*-aggressively variables.  (Bug#6671)
2332         (try_scrolling): When point is above the window, allow searching
2333         as far as scroll_max, or one screenful, to compute vertical
2334         distance from PT to the scroll margin position.  This prevents
2335         try_scrolling from unnecessarily failing when
2336         scroll-conservatively is set to a value slightly larger than the
2337         window height.  Clean up the case of PT below the margin at bottom
2338         of window: scroll_max can no longer be INT_MAX.  When aggressive
2339         scrolling is in use, don't let point enter the opposite scroll
2340         margin as result of the scroll.
2341         (syms_of_xdisp) <scroll-conservatively>: Document the
2342         threshold of 100 lines for never-recentering scrolling.
2344 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
2346         * dispextern.h (move_it_by_lines):
2347         * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
2348         since 2000-12-29T14:24:09Z!gerd@gnu.org.  All callers changed.
2349         (message_log_check_duplicate): Remove parameters `prev_bol' and
2350         `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org.  All callers changed.
2351         (redisplay_internal): Remove parameter `preserve_echo_area',
2352         unused since 1999-07-21T21:43:52Z!gerd@gnu.org.  All callers changed.
2354         * indent.c (Fvertical_motion):
2355         * window.c (window_scroll_pixel_based, Frecenter):
2356         Don't pass `need_y_p' to `move_it_by_lines'.
2358 2011-03-30  Stefan Monnier  <monnier@iro.umontreal.ca>
2360         * eval.c (struct backtrace): Don't cheat with negative numbers, but do
2361         steal a few bits to be more compact.
2362         (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
2363         Remove unneeded casts.
2365         * bytecode.c (Fbyte_code): CAR and CDR can GC.
2367 2011-03-30  Zachary Kanfer  <zkanfer@gmail.com>  (tiny change)
2369         * keyboard.c (Fexecute_extended_command): Do log the "suggest key
2370         binding" message (bug#7967).
2372 2011-03-30  Paul Eggert  <eggert@cs.ucla.edu>
2374         Fix more problems found by GCC 4.6.0's static checks.
2376         * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
2377         Remove unused local var.
2379         * editfns.c (Fmessage_box): Remove unused local var.
2381         * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
2382         (note_mode_line_or_margin_highlight, note_mouse_highlight):
2383         Omit unused local vars.
2384         * window.c (shrink_windows): Omit unused local var.
2385         * menu.c (digest_single_submenu): Omit unused local var.
2386         * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
2387         Omit unused local var.
2389         * keyboard.c (parse_modifiers_uncached, parse_modifiers):
2390         Don't assume string length fits in int.
2391         (keyremap_step, read_key_sequence): Use size_t for sizes.
2392         (read_key_sequence): Don't check last_real_key_start redundantly.
2394         * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
2395         instead of alloca (Bug#8344).
2397         * eval.c (Fbacktrace): Don't assume nargs fits in int.
2398         (Fbacktrace_frame): Don't assume nframes fits in int.
2400         * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
2402         * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
2403         concerns.
2405         * term.c (produce_glyphless_glyph): Remove unnecessary test.
2407         * cm.c (calccost): Turn while-do into do-while, for clarity.
2409         * keyboard.c (syms_of_keyboard): Use the same style as later
2410         in this function when indexing through an array.  This also
2411         works around GCC bug 48267.
2413         * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
2415         * xselect.c (x_check_property_data): Return correct size (Bug#8335).
2417         * chartab.c (sub_char_table_ref_and_range): Redo for slight
2418         efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
2420         * keyboard.c, keyboard.h (num_input_events): Now size_t.
2421         This avoids undefined behavior on integer overflow, and is a bit
2422         more convenient anyway since it is compared to a size_t variable.
2424         Variadic C functions now count arguments with size_t, not int.
2425         This avoids an unnecessary limitation on 64-bit machines, which
2426         caused (substring ...) to crash on large vectors (Bug#8344).
2427         * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
2428         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
2429         All variadic functions and their callers changed accordingly.
2430         (struct gcpro.nvars): Now size_t, not int.  All uses changed.
2431         * data.c (arith_driver, float_arith_driver): Likewise.
2432         * editfns.c (general_insert_function): Likewise.
2433         * eval.c (struct backtrace.nargs, interactive_p)
2434         (internal_condition_case_n, run_hook_with_args, apply_lambda)
2435         (funcall_lambda, mark_backtrace): Likewise.
2436         * fns.c (concat): Likewise.
2437         * frame.c (x_set_frame_parameters): Likewise.
2438         * fns.c (get_key_arg): Now accepts and returns size_t, and returns
2439         0 if not found, not -1.  All callers changed.
2441         * alloc.c (garbage_collect): Don't assume stack size fits in int.
2442         (stack_copy_size): Now size_t, not int.
2443         (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
2445 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
2447         * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
2448         unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
2449         All callers changed.
2451         * lisp.h (multibyte_char_to_unibyte):
2452         * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
2453         unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
2454         * character.h (CHAR_TO_BYTE8):
2455         * cmds.c (internal_self_insert):
2456         * editfns.c (general_insert_function):
2457         * keymap.c (push_key_description):
2458         * search.c (Freplace_match):
2459         * xdisp.c (message_dolog, set_message_1): All callers changed.
2461 2011-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
2463         * keyboard.c (safe_run_hook_funcall): New function.
2464         (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
2465         don't set the hook to nil, but remove the offending function instead.
2466         (Qcommand_hook_internal): Remove, unused.
2467         (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
2468         Vcommand_hook_internal.
2470         * eval.c (enum run_hooks_condition): Remove.
2471         (funcall_nil, funcall_not): New functions.
2472         (run_hook_with_args): Call each function through a `funcall' argument.
2473         Remove `cond' argument, now redundant.
2474         (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
2475         (Frun_hook_with_args_until_failure): Adjust accordingly.
2476         (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
2478 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
2480         * dispextern.h (string_buffer_position): Remove declaration.
2482         * print.c (strout): Remove parameter `multibyte', unused since
2483         1999-08-21T19:30:21Z!gerd@gnu.org.  All callers changed.
2485         * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
2486         never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
2487         All callers changed.
2489         * w32.c (_wsa_errlist): Use braces for struct initializers.
2491         * xdisp.c (string_buffer_position_lim): Remove parameter `w',
2492         never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
2493         All callers changed.
2494         (string_buffer_position): Likewise.  Also, make static (it's never
2495         used outside xdisp.c).
2496         (cursor_row_p): Remove parameter `w', unused since
2497         2000-10-17T16:08:57Z!gerd@gnu.org.  All callers changed.
2498         (decode_mode_spec): Remove parameter `precision', introduced during
2499         Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
2500         All callers changed.
2502 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
2504         * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
2506 2011-03-27  Anders Lindgren  <andlind@gmail.com>
2508         * nsterm.m (ns_menu_bar_is_hidden): New variable.
2509         (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
2510         (ns_update_auto_hide_menu_bar): New functions.
2511         (ns_update_begin): Call ns_update_auto_hide_menu_bar.
2512         (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
2513         ns_constrain_all_frames.
2514         (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
2515         (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
2517 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
2519         * nsmenu.m (runDialogAt): Remove argument to timer_check.
2521 2011-03-27  Glenn Morris  <rgm@gnu.org>
2523         * syssignal.h: Replace RETSIGTYPE with void.
2524         * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
2525         * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
2526         Replace SIGTYPE with void everywhere.
2527         * s/usg5-4-common.h (SIGTYPE): Remove definition.
2528         * s/template.h (SIGTYPE): Remove commented out definition.
2530 2011-03-26  Eli Zaretskii  <eliz@gnu.org>
2532         * xdisp.c (redisplay_window): Don't check buffer's clip_changed
2533         flag as a prerequisite for invoking try_scrolling.  (Bug#6671)
2535 2011-03-26  Juanma Barranquero  <lekktu@gmail.com>
2537         * w32.c (read_unc_volume): Use parameter `henum', instead of
2538         global variable `wget_enum_handle'.
2540         * keymap.c (describe_vector): Remove parameters `indices' and
2541         `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
2542         (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
2544         * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
2546         * keyboard.c (timer_check): Remove parameter `do_it_now',
2547         unused since 1996-04-12T06:01:29Z!rms@gnu.org.
2548         (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
2549         unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
2551         * keyboard.c (read_char):
2552         * w32menu.c (w32_menu_display_help):
2553         * xmenu.c (show_help_event, menu_help_callback):
2554         Adjust calls to `show_help_echo'.
2556         * gtkutil.c (xg_maybe_add_timer):
2557         * keyboard.c (readable_events):
2558         * process.c (wait_reading_process_output):
2559         * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
2561         * insdel.c (adjust_markers_gap_motion):
2562         Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
2563         (gap_left, gap_right): Don't call it.
2565 2011-03-25  Chong Yidong  <cyd@stupidchicken.com>
2567         * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
2568         incurred during fontification.
2570 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
2572         * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
2573         (DEFVAR_PER_BUFFER): Don't pass it.
2575         * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
2576         (scrolling_window): Don't pass it.
2578 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
2580         * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
2582         * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
2583         and `suffix'.
2584         (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
2585         of variables specific to SELinux and computation of `encoded_absname'.
2587         * image.c (XPutPixel): Remove unused variable `height'.
2589         * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
2591         * unexw32.c (get_section_info): Remove unused variable `section'.
2593         * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
2594         (system_process_attributes): Remove unused variable `sess'.
2595         (sys_read): Remove unused variable `err'.
2597         * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
2598         (w32_wnd_proc): Remove unused variable `isdead'.
2599         (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
2600         (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
2601         (x_create_tip_frame): Remove unused variable `tem'.
2603         * w32inevt.c (w32_console_read_socket):
2604         Remove unused variable `no_events'.
2606         * w32term.c (x_draw_composite_glyph_string_foreground):
2607         Remove unused variable `width'.
2609 2011-03-24  Juanma Barranquero  <lekktu@gmail.com>
2611         * w32term.c (x_set_glyph_string_clipping):
2612         Don't pass uninitialized region to CombineRgn.
2614 2011-03-23  Juanma Barranquero  <lekktu@gmail.com>
2616         * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
2617         (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
2618         (Fx_close_connection): Remove unused variable `i'.
2620         * w32font.c (w32font_draw): Return number of glyphs.
2621         (w32font_open_internal): Remove unused variable `i'.
2622         (w32font_driver): Add missing initializer.
2624         * w32menu.c (utf8to16): Remove unused variable `utf16'.
2625         (fill_in_menu): Remove unused variable `items_added'.
2627         * w32term.c (last_mouse_press_frame): Remove static global variable.
2628         (w32_clip_to_row): Remove unused variable `f'.
2629         (x_delete_terminal): Remove unused variable `i'.
2631         * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
2632         (NOTHING): Remove unused static global variable.
2633         (uniscribe_check_otf): Remove unused variable `table'.
2634         (uniscribe_font_driver): Add missing initializers.
2636 2011-03-23  Julien Danjou  <julien@danjou.info>
2638         * term.c (Fsuspend_tty, Fresume_tty):
2639         * minibuf.c (read_minibuf, run_exit_minibuf_hook):
2640         * window.c (temp_output_buffer_show):
2641         * insdel.c (signal_before_change):
2642         * frame.c (Fhandle_switch_frame):
2643         * fileio.c (Fdo_auto_save):
2644         * emacs.c (Fkill_emacs):
2645         * editfns.c (save_excursion_restore):
2646         * cmds.c (internal_self_insert):
2647         * callint.c (Fcall_interactively):
2648         * buffer.c (Fkill_all_local_variables):
2649         * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
2650         Use Frun_hooks.
2651         (command_loop_1): Use Frun_hooks.  Call safe_run_hooks
2652         unconditionnaly since it does the check itself.
2654 2011-03-23  Paul Eggert  <eggert@cs.ucla.edu>
2656         Fix more problems found by GCC 4.5.2's static checks.
2658         * coding.c (encode_coding_raw_text): Avoid unnecessary test
2659         the first time through the loop, since we know p0 < p1 then.
2660         This also avoids a gcc -Wstrict-overflow warning.
2662         * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
2663         leading to a memory leak, possible in functions like
2664         load_charset_map_from_file that can allocate an unbounded number
2665         of objects (Bug#8318).
2667         * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
2668         that could (at least in theory) be that large.
2670         * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
2671         This is less likely to overflow, and avoids undefined behavior if
2672         overflow does occur.  All callers changed.  Use strtoul to scan
2673         for the unsigned long integer.
2674         (pint2hrstr): Simplify and tune code slightly.
2675         This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
2677         * scroll.c (do_scrolling): Work around GCC bug 48228.
2678         See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
2680         * frame.c (Fmodify_frame_parameters): Simplify loop counter.
2681         This also avoids a warning with gcc -Wstrict-overflow.
2682         (validate_x_resource_name): Simplify count usage.
2683         This also avoids a warning with gcc -Wstrict-overflow.
2685         * fileio.c (Fcopy_file): Report error if fchown or fchmod
2686         fail (Bug#8306).
2688         * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
2690         * process.c (Fmake_network_process): Use socklen_t, not int,
2691         where POSIX says socklen_t is required in portable programs.
2692         This fixes a porting bug on hosts like 64-bit HP-UX, where
2693         socklen_t is wider than int (Bug#8277).
2694         (Fmake_network_process, server_accept_connection):
2695         (wait_reading_process_output, read_process_output):
2696         Likewise.
2698         * process.c: Rename or move locals to avoid shadowing.
2699         (list_processes_1, Fmake_network_process):
2700         (read_process_output_error_handler, exec_sentinel_error_handler):
2701         Rename or move locals.
2702         (Fmake_network_process): Define label "retry_connect" only if needed.
2703         (Fnetwork_interface_info): Fix pointer signedness.
2704         (process_send_signal): Add cast to avoid pointer signedness problem.
2705         (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
2706         (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
2708         Make tparam.h and terminfo.c consistent.
2709         * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
2710         Include tparam.h instead, since it declares them.
2711         * cm.h (PC): Remove extern decl; tparam.h now does this.
2712         * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
2713         * terminfo.c: Include tparam.h, to check interfaces.
2714         (tparm): Make 1st arg a const pointer in decl.  Put it at top level.
2715         (tparam): Adjust signature to match interface in tparam.h;
2716         this removes some undefined behavior.  Check that outstring and len
2717         are zero, which they always are with Emacs.
2718         * tparam.h (PC, BC, UP): New extern decls.
2720         * xftfont.c (xftfont_shape): Now static, and defined only if needed.
2721         (xftfont_open): Rename locals to avoid shadowing.
2723         * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
2724         (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
2725         (OTF_TAG_SYM): Omit macro if not needed.
2726         (ftfont_list): Remove unused local.
2727         (get_adstyle_property, ftfont_pattern_entity):
2728         (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
2729         Rename locals to avoid shadowing.
2731         * xfont.c (xfont_list_family): Mark var as initialized.
2733         * xml.c (make_dom): Now static.
2735         * composite.c (composition_compute_stop_pos): Rename local to
2736         avoid shadowing.
2737         (composition_reseat_it): Remove unused locals.
2738         (find_automatic_composition, composition_adjust_point): Likewise.
2739         (composition_update_it): Mark var as initialized.
2740         (find_automatic_composition): Mark vars as initialized,
2741         with a FIXME (Bug#8290).
2743         character.h: Rename locals to avoid shadowing.
2744         * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
2745         (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
2746         (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
2747         (BUF_DEC_POS): Be more systematic about renaming local temporaries
2748         to avoid shadowing.
2750         * textprop.c (property_change_between_p): Remove; unused.
2752         * intervals.c (interval_start_pos): Now static.
2754         * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
2756         * atimer.c (start_atimer, append_atimer_lists, set_alarm):
2757         Rename locals to avoid shadowing.
2759         * sound.c (wav_play, au_play, Fplay_sound_internal):
2760         Fix pointer signedness.
2761         (alsa_choose_format): Remove unused local var.
2762         (wav_play): Initialize a variable to 0, to prevent undefined
2763         behavior (Bug#8278).
2765         * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
2767         * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
2769         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
2770         clobbering (Bug#8298).
2771         * sysdep.c (sys_subshell): Likewise.
2772         Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
2774         * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
2775         This should get cleaned up, so that child_setup has the
2776         same signature on all platforms.
2778         * callproc.c (call_process_cleanup): Now static.
2779         (relocate_fd): Rename locals to avoid shadowing.
2781 2011-03-22  Chong Yidong  <cyd@stupidchicken.com>
2783         * xterm.c (x_clear_frame): Remove XClearWindow call.  This appears
2784         not to be necessary, and produces flickering.
2786 2011-03-20  Glenn Morris  <rgm@gnu.org>
2788         * config.in: Remove file.
2790 2011-03-20  Juanma Barranquero  <lekktu@gmail.com>
2792         * minibuf.c (Vcompleting_read_function): Don't declare, global variables
2793         are now in src/globals.h.
2794         (syms_of_minibuf): Remove spurious & from previous change.
2796 2011-03-20  Leo  <sdl.web@gmail.com>
2798         * minibuf.c (completing-read-function): New variable.
2799         (completing-read-default): Rename from completing-read.
2800         (completing-read): Call completing-read-function.
2802 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
2804         * xfaces.c (Fx_load_color_file):
2805         Read color file from absolute filename (bug#8250).
2807 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
2809         * makefile.w32-in: Update dependencies.
2811 2011-03-17  Eli Zaretskii  <eliz@gnu.org>
2813         * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
2815 2011-03-17  Paul Eggert  <eggert@cs.ucla.edu>
2817         Fix more problems found by GCC 4.5.2's static checks.
2819         * process.c (make_serial_process_unwind, send_process_trap):
2820         (sigchld_handler): Now static.
2822         * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
2823         That way, the code declares only the vars that it needs.
2824         * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
2825         * s/cygwin.h (PTY_ITERATION): Likewise.
2826         * s/darwin.h (PTY_ITERATION): Likewise.
2827         * s/gnu-linux.h (PTY_ITERATION): Likewise.
2829         * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
2830         * process.c (allocate_pty): Don't declare stb unless it's needed.
2832         * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
2833         (CONSTANTLIM): Remove; unused.
2834         (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
2835         Define only if needed.
2837         * unexelf.c (unexec): Name an expression,
2838         to avoid gcc -Wbad-function-cast warning.
2839         Use a different way to cause a compilation error if anyone uses
2840         n rather than nn, a way that does not involve shadowing.
2841         (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
2843         * deps.mk (unexalpha.o): Remove; unused.
2845         New file unexec.h, the (simple) interface for unexec (Bug#8267).
2846         * unexec.h: New file.
2847         * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
2848         (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
2849         Depend on unexec.h.
2850         * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
2851         * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
2852         * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
2853         Change as necessary to match prototype in unexec.h.
2855         * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
2856         shadowing.
2857         (back_comment, skip_chars): Mark vars as initialized.
2859         * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
2860         Rename locals to avoid shadowing.
2862         * lread.c (read1): Rewrite so as not to use empty "else".
2863         (Fload, readevalloop, read1): Rename locals to avoid shadowing.
2865         * print.c (Fredirect_debugging_output): Fix pointer signedess.
2867         * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
2868         warning when compiling print.c.
2870         * font.c (font_unparse_fcname): Abort in an "impossible" situation
2871         instead of using an uninitialized var.
2872         (font_sort_entities): Mark var as initialized.
2874         * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
2876         * font.c (font_unparse_xlfd): Don't mix pointers to variables with
2877         pointers to constants.
2878         (font_parse_fcname): Remove unused vars.
2879         (font_delete_unmatched): Now static.
2880         (font_get_spec): Remove; unused.
2881         (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
2882         (font_update_drivers, Ffont_get_glyphs, font_add_log):
2883         Rename or move locals to avoid shadowing.
2885         * fns.c (require_nesting_list, require_unwind): Now static.
2886         (Ffillarray): Rename locals to avoid shadowing.
2888         * floatfns.c (domain_error2): Define only if needed.
2889         (Ffrexp, Fldexp): Rename locals to avoid shadowing.
2891         * alloc.c (mark_backtrace): Move decl from here ...
2892         * lisp.h: ... to here, so that it can be checked.
2894         * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
2895         (Fdefvar): Rewrite so as not to use empty "else".
2896         (lisp_indirect_variable): Name an expression,
2897         to avoid gcc -Wbad-function-cast warning.
2898         (Fdefvar): Rename locals to avoid shadowing.
2900         * callint.c (quotify_arg, quotify_args): Now static.
2901         (Fcall_interactively): Rename locals to avoid shadowing.
2902         Use const pointer when appropriate.
2904         * lisp.h (get_system_name, get_operating_system_release):
2905         Move decls here, to check interfaces.
2906         * process.c (get_operating_system_release): Move decl to lisp.h.
2907         * xrdb.c (get_system_name): Likewise.
2908         * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
2909         (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
2910         some of which prompt warnings from gcc -Wbad-function-cast.
2911         (Fformat_time_string, Fencode_time, Finsert_char):
2912         (Ftranslate_region_internal, Fformat):
2913         Rename or remove local vars to avoid shadowing.
2914         (Ftranslate_region_internal): Mark var as initialized.
2916         * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
2917         avoid shadowing.
2919         * lisp.h (eassert): Check that the argument compiles, even if
2920         ENABLE_CHECKING is not defined.
2922         * data.c (Findirect_variable): Name an expression, to avoid
2923         gcc -Wbad-function-cast warning.
2924         (default_value, arithcompare, arith_driver, arith_error): Now static.
2925         (store_symval_forwarding): Rename local to avoid shadowing.
2926         (Fmake_variable_buffer_local, Fmake_local_variable):
2927         Mark variables as initialized.
2928         (do_blv_forwarding, do_symval_forwarding): Remove; unused.
2930         * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
2931         (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
2932         Rename locals to avoid shadowing.
2933         (mark_stack): Move local variables into the #ifdef region where
2934         they're used.
2935         (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
2936         ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
2937         needed otherwise.
2938         (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
2939         (GC_STRING_CHARS): Remove; not used.
2940         (Fmemory_limit): Cast sbrk's returned value to char *.
2942         * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
2943         avoids undefined behavior in theory.
2945         * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
2947         Use functions, not macros, for up- and down-casing (Bug#8254).
2948         * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
2949         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove.  All callers changed
2950         to use the following functions instead of these macros.
2951         (downcase): Adjust to lack of DOWNCASE_TABLE.  Return int, not
2952         EMACS_INT, since callers assume the returned value fits in int.
2953         (upcase1): Likewise, for UPCASE_TABLE.
2954         (uppercasep, lowercasep, upcase): New static inline functions.
2955         * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
2956         the race-condition problem in the old DOWNCASE.
2958         * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
2959         Rename locals to avoid shadowing.
2960         (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
2961         (regex_compile, re_search_2, re_match_2_internal):
2962         Remove unused local vars.
2963         (FREE_VAR): Rewrite so as not to use empty "else",
2964         which gcc can warn about.
2965         (regex_compile, re_match_2_internal): Mark locals as initialized.
2966         (RETALLOC_IF): Define only if needed.
2967         (WORDCHAR_P): Likewise.  This one is never needed, but is used
2968         only in a comment talking about a compiler bug, so put inside
2969         the #if 0 of that comment.
2970         (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
2971         (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
2972         Remove; unused.
2974         * search.c (boyer_moore): Rename locals to avoid shadowing.
2975         * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
2976         (PREV_CHAR_BOUNDARY): Likewise.
2978         * search.c (simple_search): Remove unused var.
2980         * dired.c (compile_pattern): Move decl from here ...
2981         * lisp.h: ... to here, so that it can be checked.
2982         (struct re_registers): New forward decl.
2984         * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
2986         * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
2987         All uses changed.
2988         (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
2989         Rename locals to avoid shadowing.
2990         (Fvertical_motion): Mark locals as initialized.
2992         * casefiddle.c (casify_object, casify_region): Now static.
2993         (casify_region): Mark local as initialized.
2995         * cmds.c (internal_self_insert): Rename local to avoid shadowing.
2997         * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
2998         New macros, so that the caller can use some names other than
2999         gcpro1, gcpro2, etc.
3000         (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
3001         of the new macros.
3002         (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
3003         argument, for consistency with GCPRO2_VAR, etc: it is now the
3004         prefix of the variable, not the variable itself.  All uses
3005         changed.
3006         * dired.c (directory_files_internal, file_name_completion):
3007         Rename locals to avoid shadowing.
3009         Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
3010         An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
3011         dired.c's scmp function, had undefined behavior.
3012         * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
3013         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
3014         * buffer.h: ... to here, because these macros use current_buffer,
3015         and the new implementation with inline functions needs to have
3016         current_buffer in scope now, rather than later when the macros
3017         are used.
3018         (downcase, upcase1): New static inline functions.
3019         (DOWNCASE, UPCASE1): Reimplement using these functions.
3020         This avoids undefined behavior in expressions like
3021         DOWNCASE (x) == DOWNCASE (y), which previously suffered
3022         from race conditions in accessing the global variables
3023         case_temp1 and case_temp2.
3024         * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
3025         * lisp.h (case_temp1, case_temp2): Remove their decls.
3026         * character.h (ASCII_CHAR_P): Move from here ...
3027         * lisp.h: ... to here, so that the inline functions mentioned
3028         above can use them.
3030         * dired.c (directory_files_internal_unwind): Now static.
3032         * fileio.c (file_name_as_directory, directory_file_name):
3033         (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
3034         Now static.
3035         (file_name_as_directory): Use const pointers when appropriate.
3036         (Fexpand_file_name): Likewise.  In particular, newdir might
3037         point at constant storage, so make it a const pointer.
3038         (Fmake_directory_internal, Fread_file_name): Remove unused vars.
3039         (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
3040         signedness issues.
3041         (Fset_file_times, Finsert_file_contents, auto_save_error):
3042         Rename locals to avoid shadowing.
3044         * minibuf.c (choose_minibuf_frame_1): Now static.
3045         (Ftry_completion, Fall_completions): Rename or remove locals
3046         to avoid shadowing.
3048         * marker.c (bytepos_to_charpos): Remove; unused.
3050         * lisp.h (verify_bytepos, count_markers): New decls,
3051         so that gcc does not warn that these functions aren't declared.
3053         * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
3054         (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
3055         (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
3056         (copy_text): Remove unused local var.
3058         * filelock.c (within_one_second): Now static.
3059         (lock_file_1): Rename local to avoid shadowing.
3061         * buffer.c (fix_overlays_before): Mark locals as initialized.
3062         (fix_start_end_in_overlays): Likewise.  This function should be
3063         simplified by using pointers-to-pointers, but that's a different
3064         matter.
3065         (switch_to_buffer_1): Now static.
3066         (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
3067         (report_overlay_modification): Rename locals to avoid shadowing.
3069         * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
3070         Fix pointer signedness issue.
3071         (sys_subshell): Mark local as volatile if checking for lint,
3072         to suppress a gcc -Wclobbered warning that does not seem to be right.
3073         (MAXPATHLEN): Define only if needed.
3075         * process.c (serial_open, serial_configure): Move decls from here ...
3076         * systty.h: ... to here, so that they can be checked.
3078         * fns.c (get_random, seed_random): Move extern decls from here ...
3079         * lisp.h: ... to here, so that they can be checked.
3081         * sysdep.c (reset_io): Now static.
3082         (wait_for_termination_signal): Remove; unused.
3084         * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
3085         (copy_keymap_item, append_key, push_text_char_description):
3086         Now static.
3087         (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
3088         (DENSE_TABLE_SIZE): Remove; unused.
3089         (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
3090         (describe_map_tree):
3091         Rename locals to avoid shadowing.
3093         * keyboard.c: Declare functions static if they are not used elsewhere.
3094         (echo_char, echo_dash, cmd_error, top_level_2):
3095         (poll_for_input, handle_async_input): Now static.
3096         (read_char, kbd_buffer_get_event, make_lispy_position):
3097         (make_lispy_event, make_lispy_movement, apply_modifiers):
3098         (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
3099         (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
3100         (Fread_key_sequence_vector): Rename locals to avoid shadowing.
3101         (read_key_sequence, read_char): Mark locals as initialized.
3102         (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
3104         * keyboard.h (make_ctrl_char): New decl.
3105         (mark_kboards): Move decl here ...
3106         * alloc.c (mark_kboards): ... from here.
3108         * lisp.h (force_auto_save_soon): New decl.
3110         * emacs.c (init_cmdargs): Rename local to avoid shadowing.
3111         (DEFINE_DUMMY_FUNCTION): New macro.
3112         (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
3113         Use it.
3114         (main): Add casts to avoid warnings
3115         if GCC considers string literals to be constants.
3117         * lisp.h (fatal_error_signal): Add decl, since it's exported.
3119         * dbusbind.c: Pointer signedness fixes.
3120         (xd_signature, xd_append_arg, xd_initialize):
3121         (Fdbus_call_method, Fdbus_call_method_asynchronously):
3122         (Fdbus_method_return_internal, Fdbus_method_error_internal):
3123         (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
3124         (Fdbus_register_signal): Use SSDATA when the context wants char *.
3126         * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
3127         if GCC considers string literals to be constants.
3128         (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
3130 2011-03-16  Stefan Monnier  <monnier@iro.umontreal.ca>
3132         * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
3133         (print_preprocess, print_object): New macro to fix last change.
3135         * print.c (print_preprocess): Don't forget font objects.
3137 2011-03-16  Juanma Barranquero  <lekktu@gmail.com>
3139         * emacs.c (USAGE3): Doc fixes.
3141 2011-03-15  Andreas Schwab  <schwab@linux-m68k.org>
3143         * coding.c (detect_coding_iso_2022): Reorganize code to clarify
3144         structure.
3146 2011-03-14  Juanma Barranquero  <lekktu@gmail.com>
3148         * lisp.h (VWindow_system, Qfile_name_history):
3149         * keyboard.h (lispy_function_keys) [WINDOWSNT]:
3150         * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
3151         (w32_system_caret_x, w32_system_caret_y): Declare extern.
3153         * w32select.c: Don't #include "keyboard.h".
3154         (run_protected): Add extern declaration for waiting_for_input.
3156         * w32.c (Qlocal, noninteractive1, inhibit_window_system):
3157         * w32console.c (detect_input_pending, read_input_pending)
3158         (encode_terminal_code):
3159         * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
3160         (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
3161         (w32_system_caret_y, Qfile_name_history):
3162         * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
3163         * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
3164         * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
3165         (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
3166         * w32proc.c (Qlocal, report_file_error):
3167         * w32term.c (Vwindow_system, updating_frame):
3168         * w32uniscribe.c (initialized, uniscribe_font_driver):
3169         Remove unneeded extern declarations.
3171 2011-03-14  Chong Yidong  <cyd@stupidchicken.com>
3173         * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
3175 2011-03-13  Chong Yidong  <cyd@stupidchicken.com>
3177         * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
3178         (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
3179         These macros can no longer be used for assignment.
3181         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3182         Assign struct members directly, instead of using BUF_BEGV etc.
3183         (record_buffer_markers, fetch_buffer_markers): New functions for
3184         recording and fetching special buffer markers.
3185         (set_buffer_internal_1, set_buffer_temp): Use them.
3187         * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
3189         * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
3191         * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
3192         (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
3194         * xdisp.c (hscroll_window_tree):
3195         (reconsider_clip_changes): Use PT instead of BUF_PT.
3197 2011-03-13  Eli Zaretskii  <eliz@gnu.org>
3199         * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
3200         $(EMACS_ROOT)/lib/intprops.h.
3202 2011-03-13  Paul Eggert  <eggert@cs.ucla.edu>
3204         Fix more problems found by GCC 4.5.2's static checks.
3206         * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
3207         to unsigned char * to avoid compiler diagnostic.
3208         (xg_free_frame_widgets): Make it clear that a local variable is
3209         needed only if USE_GTK_TOOLTIP.
3210         (gdk_window_get_screen): Make it clear that this macro is needed
3211         only if USE_GTK_TOOLTIP.
3212         (int_gtk_range_get_value): New function, which avoids a diagnostic
3213         from gcc -Wbad-function-cast.
3214         (xg_set_toolkit_scroll_bar_thumb): Use it.
3215         (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
3216         diagnostic from gcc -Wbad-function-cast.
3217         (get_utf8_string, xg_get_file_with_chooser):
3218         Rename locals to avoid shadowing.
3219         (create_dialog): Move locals to avoid shadowing.
3221         * xgselect.c (xg_select): Remove unused var.
3223         * image.c (four_corners_best): Mark locals as initialized.
3224         (gif_load): Initialize transparent_p to zero (Bug#8238).
3225         Mark another local as initialized.
3226         (my_png_error, my_error_exit): Mark with NO_RETURN.
3228         * image.c (clear_image_cache): Now static.
3229         (DIM, HAVE_STDLIB_H_1): Remove unused macros.
3230         (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
3231         (x_edge_detection): Remove unnecessary cast that
3232         gcc -Wbad-function-cast diagnoses.
3233         (gif_load): Fix pointer signedness.
3234         (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
3235         (jpeg_load, gif_load): Rename locals to avoid shadowing.
3237 2011-03-12  Paul Eggert  <eggert@cs.ucla.edu>
3239         Improve quality of tests for time stamp overflow.
3240         For example, without this patch (encode-time 0 0 0 1 1
3241         1152921504606846976) returns the obviously-bogus value (-948597
3242         62170) on my RHEL 5.5 x86-64 host.  With the patch, it correctly
3243         reports time overflow.  See
3244         <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
3245         * deps.mk (editfns.o): Depend on ../lib/intprops.h.
3246         * editfns.c: Include limits.h and intprops.h.
3247         (TIME_T_MIN, TIME_T_MAX): New macros.
3248         (time_overflow): Move earlier, to before first use.
3249         (hi_time, lo_time): New functions, for an accurate test for
3250         out-of-range times.
3251         (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
3252         (Fget_internal_run_time): Don't assume time_t fits in int.
3253         (make_time): Use list2 instead of Fcons twice.
3254         (Fdecode_time): More accurate test for out-of-range times.
3255         (check_tm_member): New function.
3256         (Fencode_time): Use it, to test for out-of-range times.
3257         (lisp_time_argument): Don't rely on undefined left-shift and
3258         right-shift behavior when checking for time stamp overflow.
3260         * editfns.c (time_overflow): New function, refactoring common code.
3261         (Fformat_time_string, Fdecode_time, Fencode_time):
3262         (Fcurrent_time_string): Use it.
3264         Move 'make_time' to be next to its inverse 'lisp_time_argument'.
3265         * dired.c (make_time): Move to ...
3266         * editfns.c (make_time): ... here.
3267         * systime.h: Note the move.
3269 2011-03-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
3271         * fringe.c (update_window_fringes): Remove unused variables.
3273         * unexmacosx.c (copy_data_segment): Also copy __got section.
3274         (Bug#8223)
3276 2011-03-12  Eli Zaretskii  <eliz@gnu.org>
3278         * termcap.c [MSDOS]: Include "msdos.h".
3279         (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
3280         Constify `char *' arguments and their references according to
3281         prototypes in tparam.h.
3283         * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
3285         * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
3286         Adapt all references accordingly.
3288         * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
3290 2011-03-11  Tom Tromey  <tromey@redhat.com>
3292         * buffer.c (syms_of_buffer): Remove obsolete comment.
3294 2011-03-11  Eli Zaretskii  <eliz@gnu.org>
3296         * termhooks.h (encode_terminal_code): Declare prototype.
3298         * msdos.c (encode_terminal_code): Don't declare prototype.
3300         * term.c (encode_terminal_code): Now external again, used by
3301         w32console.c and msdos.c.
3303         * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
3304         Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
3306 2011-03-11  Paul Eggert  <eggert@cs.ucla.edu>
3308         Fix some minor problems found by GCC 4.5.2's static checks.
3310         * fringe.c (update_window_fringes): Mark locals as initialized
3311         (Bug#8227).
3312         (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
3314         * alloc.c (mark_fringe_data): Move decl from here ...
3315         * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
3316         to check its interface.
3317         (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
3319         * fontset.c (free_realized_fontset): Now static.
3320         (Fset_fontset_font): Rename local to avoid shadowing.
3321         (fontset_font): Mark local as initialized.
3322         (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
3324         * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
3326         * xselect.c (x_disown_buffer_selections): Remove; not used.
3327         (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
3328         (x_own_selection, Fx_disown_selection_internal): Rename locals
3329         to avoid shadowing.
3330         (x_handle_dnd_message): Remove local to avoid shadowing.
3332         * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
3333         so that the caller can use some name other than gcpro1.
3334         (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
3335         * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
3336         (Fx_backspace_delete_keys_p):
3337         Use them to avoid shadowing, and rename vars to avoid shadowing.
3338         (x_decode_color, x_set_name, x_window): Now static.
3339         (Fx_create_frame): Add braces to silence GCC warning.
3340         (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
3341         (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
3342         Remove unused locals.
3343         (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
3344         (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
3345         Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
3346         macros.
3348         * xterm.h (x_mouse_leave): New decl.
3350         * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
3351         Remove unused functions.
3352         (x_shift_glyphs_for_insert, XTflash, XTring_bell):
3353         (x_calc_absolute_position): Now static.
3354         (XTread_socket): Don't define label "out" unless it's used.
3355         Don't declare local "event" unless it's used.
3356         (x_iconify_frame, x_free_frame_resources): Don't declare locals
3357         unless they are used.
3358         (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
3359         (x_fatal_error_signal): Remove; not used.
3360         (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
3361         (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
3362         (x_error_catcher, x_connection_closed, x_error_handler):
3363         (x_error_quitter, xembed_send_message, x_iconify_frame):
3364         (my_log_handler): Rename locals to avoid shadowing.
3365         (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
3366         (x_connection_closed): Tell GCC not to suggest NO_RETURN.
3368         * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
3369         Rename or move locals to avoid shadowing.
3370         (tty_defined_color, merge_face_heights): Now static.
3371         (free_realized_faces_for_fontset): Remove; not used.
3372         (Fx_list_fonts): Mark variable that gcc -Wuninitialized
3373         does not deduce is never used uninitialized.
3374         (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
3375         (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
3377         * terminal.c (store_terminal_param): Now static.
3379         * xmenu.c (menu_highlight_callback): Now static.
3380         (set_frame_menubar): Remove unused local.
3381         (xmenu_show): Rename parameter to avoid shadowing.
3382         (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
3383         since they might point to immutable storage.
3384         (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
3385         since it's unused otherwise.
3387         * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
3388         Add a FIXME, since the code still doesn't look right.  (Bug#8215)
3389         (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
3390         avoids a gcc -Wuninitialized diagnostic.
3391         (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
3392         (note_mouse_highlight): Mark variables that gcc -Wuninitialized
3393         does not deduce are never used uninitialized.
3395         * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
3397         * xdisp.c (redisplay_window): Rename local to avoid shadowing.
3398         * window.c (window_loop, size_window):
3399         (run_window_configuration_change_hook, enlarge_window): Likewise.
3401         * window.c (display_buffer): Now static.
3402         (size_window): Mark variables that gcc -Wuninitialized
3403         does not deduce are never used uninitialized.
3404         * window.h (check_all_windows): New decl, to forestall
3405         gcc -Wmissing-prototypes diagnostic.
3406         * dispextern.h (bidi_dump_cached_states): Likewise.
3408         * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
3409         shadowing.
3410         * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
3411         Include <limits.h>.
3412         (Fsort_charsets): Redo min/max calculation to shorten the code a bit
3413         and to avoid gcc -Wuninitialized warning.
3414         (load_charset_map): Mark variables that gcc -Wuninitialized
3415         does not deduce are never used uninitialized.
3416         (load_charset): Abort instead of using uninitialized var (Bug#8229).
3418         * coding.c (coding_set_source, coding_set_destination):
3419         Use "else { /* comment */ }" rather than "else /* comment */;"
3420         for clarity, and to avoid gcc -Wempty-body warning.
3421         (Fdefine_coding_system_internal): Don't redeclare 'i' inside
3422         a block, when the outer 'i' will do.
3423         (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
3424         (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
3425         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
3426         (decode_coding_raw_text, decode_coding_charset, get_translation_table):
3427         (Fdecode_sjis_char, Fdefine_coding_system_internal):
3428         Rename locals to avoid shadowing.
3429         * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
3430         * coding.c (emacs_mule_char, encode_invocation_designation):
3431         Now static, since they're not used elsewhere.
3432         (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
3433         (decode_coding_object, encode_coding_object, detect_coding_system):
3434         (decode_coding_emacs_mule): Mark variables that gcc
3435         -Wuninitialized does not deduce are never used uninitialized.
3436         (detect_coding_iso_2022): Initialize a local variable that might
3437         be used uninitialized.  Leave a FIXME because it's not clear that
3438         this initialization is needed.  (Bug#8211)
3439         (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
3440         (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
3441         (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
3442         (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
3443         Remove unused macros.
3445         * category.c (hash_get_category_set): Remove unused local var.
3446         (copy_category_table): Now static, since it's not used elsewhere.
3447         * character.c (string_count_byte8): Likewise.
3449         * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
3450         (Fregister_code_conversion_map): Rename locals to avoid shadowing.
3452         * chartab.c (copy_sub_char_table): Now static, since it's not used
3453         elsewhere.
3454         (sub_char_table_ref_and_range, char_table_ref_and_range):
3455         Rename locals to avoid shadowing.
3456         (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
3458         * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
3459         (BIDI_BOB): Remove unused macro.
3461         * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
3462         deduce are never used uninitialized.
3463         * term.c (encode_terminal_code): Likewise.
3465         * term.c (encode_terminal_code): Now static.  Remove unused local.
3467         * tparam.h: New file.
3468         * term.c, tparam.h: Include it.
3469         * deps.mk (term.o, tparam.o): Depend on tparam.h.
3470         * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
3471         Move these decls to tparam.h, and make them agree with what
3472         is actually in tparam.c.  The previous trick of using incompatible
3473         decls in different modules does not conform to the C standard.
3474         All callers of tparam changed to use tparam's actual API.
3475         * tparam.c (tparam1, tparam, tgoto):
3476         Use const pointers where appropriate.
3478         * cm.c (calccost, cmgoto): Use const pointers where appropriate.
3479         * cm.h (struct cm): Likewise.
3480         * dispextern.h (do_line_insertion_deletion_costs): Likewise.
3481         * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
3482         * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
3483         (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
3484         (turn_on_face, init_tty): Likewise.
3485         * termchar.h (struct tty_display_info): Likewise.
3487         * term.c (term_mouse_position): Rename local to avoid shadowing.
3489         * alloc.c (mark_ttys): Move decl from here ...
3490         * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
3492 2011-03-11  Andreas Schwab  <schwab@linux-m68k.org>
3494         * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
3496 2011-03-09  Juanma Barranquero  <lekktu@gmail.com>
3498         * search.c (compile_pattern_1): Remove argument regp, unused since
3499         revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
3500         (compile_pattern): Don't pass it.
3502 2011-03-08  Jan Djärv  <jan.h.d@swipnet.se>
3504         * xterm.h (DEFAULT_GDK_DISPLAY): New define.
3505         (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
3506         for ! HAVE_GTK3.
3507         (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
3509         * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
3511         * gtkutil.c: Include gtkx.h if HAVE_GTK3.  If ! HAVE_GTK3, define
3512         gdk_window_get_screen, gdk_window_get_geometry,
3513         gdk_x11_window_lookup_for_display and GDK_KEY_g.
3514         (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
3515         (xg_get_pixbuf_from_pixmap): New function.
3516         (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
3517         to Pixmap, take frame as parameter, remove GdkColormap parameter.
3518         Call xg_get_pixbuf_from_pixmap instead of
3519         gdk_pixbuf_get_from_drawable.
3520         (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
3521         xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
3522         (xg_check_special_colors): Use GtkStyleContext and its functions
3523         for HAVE_GTK3.
3524         (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
3525         (xg_prepare_tooltip, create_dialog, menubar_map_cb)
3526         (xg_update_frame_menubar, xg_tool_bar_detach_callback)
3527         (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
3528         Call gtk_widget_get_preferred_size.
3529         (xg_frame_resized): gdk_window_get_geometry only takes 5
3530         parameters.
3531         (xg_win_to_widget, xg_event_is_for_menubar):
3532         Call gdk_x11_window_lookup_for_display.
3533         (xg_set_widget_bg): New function.
3534         (delete_cb): New function.
3535         (xg_create_frame_widgets): Connect delete-event to delete_cb.
3536         Call xg_set_widget_bg.  Only set backgrund pixmap for ! HAVE_GTK3
3537         (xg_set_background_color): Call xg_set_widget_bg.
3538         (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
3539         (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
3540         Only call gtk_range_set_update_policy if ! HAVE_GTK3.
3541         (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
3542         if ! HAVE_GTK3.
3543         (update_frame_tool_bar): Call gtk_widget_hide.
3544         (xg_initialize): Use GDK_KEY_g.
3546         * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
3547         if ! HAVE_GTK3
3548         (x_session_initialize): Call gdk_x11_set_sm_client_id.
3550         * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
3551         (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
3552         Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
3554 2011-03-08  Juanma Barranquero  <lekktu@gmail.com>
3556         * w32xfns.c (select_palette): Check success of RealizePalette against
3557         GDI_ERROR, not zero.
3559 See ChangeLog.11 for earlier changes.
3561 ;; Local Variables:
3562 ;; coding: utf-8
3563 ;; End:
3565   Copyright (C) 2011  Free Software Foundation, Inc.
3567   This file is part of GNU Emacs.
3569   GNU Emacs is free software: you can redistribute it and/or modify
3570   it under the terms of the GNU General Public License as published by
3571   the Free Software Foundation, either version 3 of the License, or
3572   (at your option) any later version.
3574   GNU Emacs is distributed in the hope that it will be useful,
3575   but WITHOUT ANY WARRANTY; without even the implied warranty of
3576   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3577   GNU General Public License for more details.
3579   You should have received a copy of the GNU General Public License
3580   along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.