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