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